Re: sparc64: simplify boot()

2020-01-04 Thread Mark Kettenis
> Date: Fri, 3 Jan 2020 19:26:22 +
> From: Miod Vallat 
> 
> Although Open Firmware supports it, there is no way from OpenBSD to
> reboot with a specified boot command line, so drop vestigial support for
> it from boot().

Hmm, reboot(2) does allow us to pass flags.  But you're right that
there is no userland tool to pass the flags to the kernel.

I suppose the dominant platforms simply didn't support passing flags
across reboots, so this never took off.  But with EFI we could support
these on amd64 and arm64.


> Index: sparc64/machdep.c
> ===
> RCS file: /OpenBSD/src/sys/arch/sparc64/sparc64/machdep.c,v
> retrieving revision 1.191
> diff -u -p -r1.191 machdep.c
> --- sparc64/machdep.c 1 Apr 2019 07:00:52 -   1.191
> +++ sparc64/machdep.c 3 Jan 2020 19:24:45 -
> @@ -593,9 +593,6 @@ struct pcb dumppcb;
>  __dead void
>  boot(int howto)
>  {
> - int i;
> - static char str[128];
> -
>   if ((howto & RB_RESET) != 0)
>   goto doreset;
>  
> @@ -655,30 +652,7 @@ haltsys:
>  
>  doreset:
>   printf("rebooting\n\n");
> -#if 0
> - if (user_boot_string && *user_boot_string) {
> - i = strlen(user_boot_string);
> - if (i > sizeof(str))
> - OF_boot(user_boot_string);  /* XXX */
> - bcopy(user_boot_string, str, i);
> - } else
> -#endif
> - {
> - i = 1;
> - str[0] = '\0';
> - }
> -
> - if ((howto & RB_SINGLE) != 0)
> - str[i++] = 's';
> - if ((howto & RB_KDB) != 0)
> - str[i++] = 'd';
> - if (i > 1) {
> - if (str[0] == '\0')
> - str[0] = '-';
> - str[i] = 0;
> - } else
> - str[0] = 0;
> - OF_boot(str);
> + OF_boot("");
>   panic("cpu_reboot -- failed");
>   for (;;)
>   continue;
> 
> 



sparc64: simplify boot()

2020-01-03 Thread Miod Vallat
Although Open Firmware supports it, there is no way from OpenBSD to
reboot with a specified boot command line, so drop vestigial support for
it from boot().

Index: sparc64/machdep.c
===
RCS file: /OpenBSD/src/sys/arch/sparc64/sparc64/machdep.c,v
retrieving revision 1.191
diff -u -p -r1.191 machdep.c
--- sparc64/machdep.c   1 Apr 2019 07:00:52 -   1.191
+++ sparc64/machdep.c   3 Jan 2020 19:24:45 -
@@ -593,9 +593,6 @@ struct pcb dumppcb;
 __dead void
 boot(int howto)
 {
-   int i;
-   static char str[128];
-
if ((howto & RB_RESET) != 0)
goto doreset;
 
@@ -655,30 +652,7 @@ haltsys:
 
 doreset:
printf("rebooting\n\n");
-#if 0
-   if (user_boot_string && *user_boot_string) {
-   i = strlen(user_boot_string);
-   if (i > sizeof(str))
-   OF_boot(user_boot_string);  /* XXX */
-   bcopy(user_boot_string, str, i);
-   } else
-#endif
-   {
-   i = 1;
-   str[0] = '\0';
-   }
-
-   if ((howto & RB_SINGLE) != 0)
-   str[i++] = 's';
-   if ((howto & RB_KDB) != 0)
-   str[i++] = 'd';
-   if (i > 1) {
-   if (str[0] == '\0')
-   str[0] = '-';
-   str[i] = 0;
-   } else
-   str[0] = 0;
-   OF_boot(str);
+   OF_boot("");
panic("cpu_reboot -- failed");
for (;;)
continue;