]> git.ozlabs.org Git - yaboot.git/blobdiff - second/yaboot.c
Be explicit in order of evaluation in the reiserfs code
[yaboot.git] / second / yaboot.c
index c73348845721ee06eaadaff8bab1e5cb8497e37f..1f3f1518845aa67b0a81847f226a775a2ea9c34d 100644 (file)
@@ -180,10 +180,10 @@ yaboot_start (unsigned long r3, unsigned long r4, unsigned long r5)
      prom_print_available();
 
      /* Allocate some memory for malloc'ator */
      prom_print_available();
 
      /* Allocate some memory for malloc'ator */
-     malloc_base = prom_claim_chunk((void *)MALLOCADDR, MALLOCSIZE, 0);
+     malloc_base = prom_claim_chunk_top(MALLOCSIZE, 0);
      if (malloc_base == (void *)-1) {
      if (malloc_base == (void *)-1) {
-         prom_printf("Can't claim malloc buffer (%d bytes at 0x%08x)\n",
-                     MALLOCSIZE, MALLOCADDR);
+         prom_printf("Can't claim malloc buffer of %d bytes\n",
+                     MALLOCSIZE);
          return -1;
      }
      malloc_init(malloc_base, MALLOCSIZE);
          return -1;
      }
      malloc_init(malloc_base, MALLOCSIZE);
@@ -709,9 +709,10 @@ int get_params(struct boot_param_t* params)
          if (!imagename) {
               if (bootoncelabel[0] != 0)
                    imagename = bootoncelabel;
          if (!imagename) {
               if (bootoncelabel[0] != 0)
                    imagename = bootoncelabel;
-              else if (bootlastlabel[0] != 0)
-                         imagename = bootlastlabel;
-               else
+              else if (bootlastlabel[0] != 0) {
+                   imagename = bootlastlabel;
+                   word_split(&imagename, &params->args);
+              } else
                    imagename = cfg_get_default();
          }
          if (imagename)
                    imagename = cfg_get_default();
          }
          if (imagename)
@@ -773,7 +774,13 @@ int get_params(struct boot_param_t* params)
          imagename = cfg_get_default();
 
      /* write the imagename out so it can be reused on reboot if necessary */
          imagename = cfg_get_default();
 
      /* write the imagename out so it can be reused on reboot if necessary */
-     prom_set_options("boot-last-label", imagename, strlen(imagename));
+     strcpy(bootlastlabel, imagename);
+     if (params->args && params->args[0]) {
+         strcat(bootlastlabel, " ");
+         strcat(bootlastlabel, params->args);
+     }
+     prom_set_options("boot-last-label", bootlastlabel,
+                     strlen(bootlastlabel) + 1);
 
      label = 0;
      defdevice = boot.dev;
 
      label = 0;
      defdevice = boot.dev;