Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5a2072bd48eb4a35c57a8ec45897ac2db3a3f82
Commit:     e5a2072bd48eb4a35c57a8ec45897ac2db3a3f82
Parent:     fae59c39e885148acf42320fe0d4ebf4cb3e9231
Author:     David Gibson <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 22 17:02:21 2007 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Mon Mar 26 15:11:20 2007 +1000

    [POWERPC] New reg.h for the zImage
    
    This patch adds a reg.h to the zImage code, with common definitions
    for accessing system registers.  For now, this includes functions for
    retrieving the PVR and the stack pointer.  This patch then uses the
    new reg.h to let start() display the running stack address without
    having to explicitly pass the stack as a parameter from the asm code.
    
    Signed-off-by: David Gibson <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/crt0.S |    1 -
 arch/powerpc/boot/main.c |    5 +++--
 arch/powerpc/boot/ops.h  |    2 +-
 arch/powerpc/boot/reg.h  |   22 ++++++++++++++++++++++
 4 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S
index 25ad745..bd7770b 100644
--- a/arch/powerpc/boot/crt0.S
+++ b/arch/powerpc/boot/crt0.S
@@ -88,5 +88,4 @@ _zimage_start_lib:
        bl      platform_init
 
        /* Call start */
-       mr      r3,r1
        b       start
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 33c7329..e1df8fe 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -17,6 +17,7 @@
 #include "ops.h"
 #include "gunzip_util.h"
 #include "flatdevtree.h"
+#include "reg.h"
 
 extern char _start[];
 extern char __bss_start[];
@@ -247,7 +248,7 @@ struct dt_ops dt_ops;
 struct console_ops console_ops;
 struct loader_info loader_info;
 
-void start(void *sp)
+void start(void)
 {
        struct addr_range vmlinux, initrd;
        kernel_entry_t kentry;
@@ -260,7 +261,7 @@ void start(void *sp)
                platform_ops.fixups();
 
        printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r",
-              _start, sp);
+              _start, get_sp());
 
        vmlinux = prep_kernel();
        initrd = prep_initrd(vmlinux, loader_info.initrd_addr,
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index ea5368c..592dc6c 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -73,7 +73,7 @@ struct loader_info {
 };
 extern struct loader_info loader_info;
 
-void start(void *sp);
+void start(void);
 int ft_init(void *dt_blob, unsigned int max_size, unsigned int 
max_find_device);
 int serial_console_init(void);
 int ns16550_console_init(void *devp, struct serial_console_data *scdp);
diff --git a/arch/powerpc/boot/reg.h b/arch/powerpc/boot/reg.h
new file mode 100644
index 0000000..d3cd9ee
--- /dev/null
+++ b/arch/powerpc/boot/reg.h
@@ -0,0 +1,22 @@
+#ifndef _PPC_BOOT_REG_H
+#define _PPC_BOOT_REG_H
+/*
+ * Copyright 2007 Davud Gibson, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+static inline u32 mfpvr(void)
+{
+       u32 pvr;
+       asm volatile ("mfpvr    %0" : "=r"(pvr));
+       return pvr;
+}
+
+register void *__stack_pointer asm("r1");
+#define get_sp()       (__stack_pointer)
+
+#endif /* _PPC_BOOT_REG_H */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to