Split panic routine
Split panic routine so that the 'Hit Any Key to continue' behavior can be overriden. Sponsored by: Netflix
This commit is contained in:
parent
e23ae408c0
commit
86bb84d576
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328437
@ -102,7 +102,6 @@ static struct bios_smap smap;
|
|||||||
static char *heap_next;
|
static char *heap_next;
|
||||||
static char *heap_end;
|
static char *heap_end;
|
||||||
|
|
||||||
void exit(int);
|
|
||||||
static void load(void);
|
static void load(void);
|
||||||
static int parse_cmds(char *, int *);
|
static int parse_cmds(char *, int *);
|
||||||
static int dskread(void *, daddr_t, unsigned);
|
static int dskread(void *, daddr_t, unsigned);
|
||||||
@ -365,6 +364,7 @@ main(void)
|
|||||||
void
|
void
|
||||||
exit(int x)
|
exit(int x)
|
||||||
{
|
{
|
||||||
|
while (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -39,7 +39,18 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <stand.h>
|
#include <stand.h>
|
||||||
#include <machine/stdarg.h>
|
#include <machine/stdarg.h>
|
||||||
|
|
||||||
extern void exit(int) __dead2;
|
/*
|
||||||
|
* Boot loaders and other standalone programs that wish to have a
|
||||||
|
* different panic policy can provide their own panic_action rotuine.
|
||||||
|
*/
|
||||||
|
__weak_symbol void
|
||||||
|
panic_action(void)
|
||||||
|
{
|
||||||
|
printf("--> Press a key on the console to reboot <--\n");
|
||||||
|
getchar();
|
||||||
|
printf("Rebooting...\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
panic(const char *fmt,...)
|
panic(const char *fmt,...)
|
||||||
@ -51,9 +62,5 @@ panic(const char *fmt,...)
|
|||||||
vprintf(fmt, ap);
|
vprintf(fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
panic_action();
|
||||||
printf("--> Press a key on the console to reboot <--\n");
|
|
||||||
getchar();
|
|
||||||
printf("Rebooting...\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
@ -368,7 +368,6 @@ static __inline quad_t qmin(quad_t a, quad_t b) { return (a < b ? a : b); }
|
|||||||
static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); }
|
static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); }
|
||||||
static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
|
static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
|
||||||
|
|
||||||
|
|
||||||
/* null functions for device/filesystem switches (undocumented) */
|
/* null functions for device/filesystem switches (undocumented) */
|
||||||
extern int nodev(void);
|
extern int nodev(void);
|
||||||
extern int noioctl(struct open_file *, u_long, void *);
|
extern int noioctl(struct open_file *, u_long, void *);
|
||||||
@ -387,13 +386,14 @@ extern int null_readdir(struct open_file *f, struct dirent *d);
|
|||||||
* Machine dependent functions and data, must be provided or stubbed by
|
* Machine dependent functions and data, must be provided or stubbed by
|
||||||
* the consumer
|
* the consumer
|
||||||
*/
|
*/
|
||||||
extern void exit(int);
|
extern void exit(int) __dead2;
|
||||||
extern int getchar(void);
|
extern int getchar(void);
|
||||||
extern int ischar(void);
|
extern int ischar(void);
|
||||||
extern void putchar(int);
|
extern void putchar(int);
|
||||||
extern int devopen(struct open_file *, const char *, const char **);
|
extern int devopen(struct open_file *, const char *, const char **);
|
||||||
extern int devclose(struct open_file *f);
|
extern int devclose(struct open_file *f);
|
||||||
extern void panic(const char *, ...) __dead2 __printflike(1, 2);
|
extern void panic(const char *, ...) __dead2 __printflike(1, 2);
|
||||||
|
extern void panic_action(void) __weak_symbol __dead2;
|
||||||
extern time_t getsecs(void);
|
extern time_t getsecs(void);
|
||||||
extern struct fs_ops *file_system[];
|
extern struct fs_ops *file_system[];
|
||||||
extern struct fs_ops *exclusive_file_system;
|
extern struct fs_ops *exclusive_file_system;
|
||||||
|
Loading…
Reference in New Issue
Block a user