[OpenBIOS] [commit] r843 - in trunk/openbios-devel: arch/sparc32 drivers

repository service svn at openbios.org
Sun Aug 8 21:54:06 CEST 2010


Author: blueswirl
Date: Sun Aug  8 21:54:06 2010
New Revision: 843
URL: http://tracker.coreboot.org/trac/openbios/changeset/843

Log:
sparc32: move /uuid property setup to openbios.c

Signed-off-by: Blue Swirl <blauwirbel at gmail.com>

Modified:
   trunk/openbios-devel/arch/sparc32/openbios.c
   trunk/openbios-devel/drivers/obio.c

Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c	Sun Aug  8 20:50:22 2010	(r842)
+++ trunk/openbios-devel/arch/sparc32/openbios.c	Sun Aug  8 21:54:06 2010	(r843)
@@ -27,6 +27,7 @@
 
 #define MEMORY_SIZE     (128*1024)       /* 16K ram for hosted system */
 #define DICTIONARY_SIZE (256*1024)      /* 256K for the dictionary   */
+#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
 
 static ucell *memory;
 
@@ -116,6 +117,29 @@
 {
 }
 
+/* Add /uuid */
+static void setup_uuid(void)
+{
+    static uint8_t qemu_uuid[16];
+
+    fw_cfg_read(FW_CFG_UUID, (char *)qemu_uuid, 16);
+
+    printk("UUID: " UUID_FMT "\n", qemu_uuid[0], qemu_uuid[1], qemu_uuid[2],
+           qemu_uuid[3], qemu_uuid[4], qemu_uuid[5], qemu_uuid[6],
+           qemu_uuid[7], qemu_uuid[8], qemu_uuid[9], qemu_uuid[10],
+           qemu_uuid[11], qemu_uuid[12], qemu_uuid[13], qemu_uuid[14],
+           qemu_uuid[15]);
+
+    push_str("/");
+    fword("find-device");
+
+    PUSH((long)&qemu_uuid);
+    PUSH(16);
+    fword("encode-bytes");
+    push_str("uuid");
+    fword("property");
+}
+
 static void init_memory(void)
 {
     memory = malloc(MEMORY_SIZE);
@@ -208,6 +232,8 @@
 
 	bind_func("platform-boot", boot );
 	bind_func("(go)", go );
+
+        setup_uuid();
 }
 
 int openbios(void)

Modified: trunk/openbios-devel/drivers/obio.c
==============================================================================
--- trunk/openbios-devel/drivers/obio.c	Sun Aug  8 20:50:22 2010	(r842)
+++ trunk/openbios-devel/drivers/obio.c	Sun Aug  8 21:54:06 2010	(r843)
@@ -24,8 +24,6 @@
 #include "arch/common/fw_cfg.h"
 #include "escc.h"
 
-#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
-
 #define	PROMDEV_KBD	0		/* input from keyboard */
 #define	PROMDEV_SCREEN	0		/* output to screen */
 #define	PROMDEV_TTYA	1		/* in/out to ttya */
@@ -637,8 +635,6 @@
     for (;;);
 }
 
-static uint8_t qemu_uuid[16];
-
 static void
 ob_nvram_init(uint64_t base, uint64_t offset)
 {
@@ -686,24 +682,6 @@
     fw_cfg_read(FW_CFG_NOGRAPHIC, &nographic, 1);
     graphic_depth = fw_cfg_read_i16(FW_CFG_SUN4M_DEPTH);
 
-    // Add /uuid
-    fw_cfg_read(FW_CFG_UUID, (char *)qemu_uuid, 16);
-
-    printk("UUID: " UUID_FMT "\n", qemu_uuid[0], qemu_uuid[1], qemu_uuid[2],
-           qemu_uuid[3], qemu_uuid[4], qemu_uuid[5], qemu_uuid[6],
-           qemu_uuid[7], qemu_uuid[8], qemu_uuid[9], qemu_uuid[10],
-           qemu_uuid[11], qemu_uuid[12], qemu_uuid[13], qemu_uuid[14],
-           qemu_uuid[15]);
-
-    push_str("/");
-    fword("find-device");
-
-    PUSH((long)&qemu_uuid);
-    PUSH(16);
-    fword("encode-bytes");
-    push_str("uuid");
-    fword("property");
-
     // Add /idprom
     push_str("/");
     fword("find-device");



More information about the OpenBIOS mailing list