OSDN Git Service

Boot protocol update
authorYoshinori Sato <ysato@users.sourceforge.jp>
Sun, 11 Jan 2015 09:26:28 +0000 (18:26 +0900)
committerYoshinori Sato <ysato@users.sourceforge.jp>
Sun, 11 Jan 2015 09:26:28 +0000 (18:26 +0900)
arch/h8300/include/asm/bootparams.h
arch/h8300/kernel/head_ram.S
arch/h8300/kernel/setup.c

index de88812..cc73382 100644 (file)
@@ -1,8 +1,9 @@
 struct bootparams {
+       short size;
        unsigned char gpio_ddr[16];
        unsigned char gpio_use[16];
        unsigned int clock_freq;
        unsigned int ram_end;
        unsigned char *command_line;
-};
+} __attribute__((aligned(2), packed));
 
index 57fb053..1ad356c 100644 (file)
@@ -30,12 +30,13 @@ _start:
        sub.l   er5,er4
        shlr    er4
        shlr    er4
-       sub.l   er0,er0
+       sub.l   er1,er1
 1:     
-       mov.l   er0,@er5
+       mov.l   er1,@er5
        adds    #4,er5
        dec.l   #1,er4
        bne     1b
+       jsr     @parse_bootparam
 
        /* linux kernel start */
 #if defined(CONFIG_CPU_H8300H)
index 8eaae17..cc3c894 100644 (file)
@@ -156,3 +156,9 @@ unsigned int get_cpu_clock(void)
 {
        return bootparams.clock_freq;
 }
+
+void __init parse_bootparam(struct bootparams *bp)
+{
+       memcpy(&bootparams, bp, bp->size);
+       strncpy(command_line, bootparams.command_line, sizeof(command_line));
+}