Skip to content
Permalink
Browse files

10454 loader: panic does add newline for us

Reviewed by: John Levon <john.levon@joyent.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
  • Loading branch information
tsoome committed Nov 29, 2018
1 parent 3c30f56 commit 96cf04672307d7aacdfa73ae214d34affe5a218b
@@ -33,4 +33,4 @@ LOADER_VERSION = 1.1
# Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes.
# The version is processed from left to right, the version number can only
# be increased.
BOOT_VERSION = $(LOADER_VERSION)-2019.02.26.1
BOOT_VERSION = $(LOADER_VERSION)-2019.02.26.2
@@ -118,9 +118,8 @@ arpwhohas(struct iodesc *d, struct in_addr addr)
i = sendrecv(d,
arpsend, &wbuf.data, sizeof (wbuf.data),
arprecv, &pkt, (void **)&ah, NULL);
if (i == -1) {
panic("arp: no response for %s\n", inet_ntoa(addr));
}
if (i == -1)
panic("arp: no response for %s", inet_ntoa(addr));

/* Store ethernet address in cache */
#ifdef ARP_DEBUG
@@ -34,10 +34,9 @@ void
__assert(const char *func, const char *file, int line, const char *expression)
{
if (func == NULL)
panic("Assertion failed: (%s), file %s, line %d.\n",
panic("Assertion failed: (%s), file %s, line %d.",
expression, file, line);
else
panic(
"Assertion failed: (%s), function %s, file %s, line %d.\n",
panic("Assertion failed: (%s), function %s, file %s, line %d.",
expression, func, file, line);
}
@@ -374,7 +374,7 @@ bzf_stat(struct open_file *f, struct stat *sb)
void
bz_internal_error(int errorcode)
{
panic("bzipfs: critical error %d in bzip2 library occured\n",
panic("bzipfs: critical error %d in bzip2 library occured",
errorcode);
}

@@ -179,7 +179,7 @@ netif_attach(struct netif *nif, struct iodesc *desc, void *machdep_hint)
desc->io_netif = nif;
#ifdef PARANOID
if (drv->netif_init == NULL)
panic("%s%d: no netif_init support\n", drv->netif_bname,
panic("%s%d: no netif_init support", drv->netif_bname,
nif->nif_unit);
#endif
drv->netif_init(desc, machdep_hint);
@@ -198,7 +198,7 @@ netif_detach(struct netif *nif)
#endif
#ifdef PARANOID
if (drv->netif_end == NULL)
panic("%s%d: no netif_end support\n", drv->netif_bname,
panic("%s%d: no netif_end support", drv->netif_bname,
nif->nif_unit);
#endif
drv->netif_end(nif);
@@ -219,7 +219,7 @@ netif_get(struct iodesc *desc, void **pkt, time_t timo)
#endif
#ifdef PARANOID
if (drv->netif_get == NULL)
panic("%s%d: no netif_get support\n", drv->netif_bname,
panic("%s%d: no netif_get support", drv->netif_bname,
nif->nif_unit);
#endif
rv = drv->netif_get(desc, pkt, timo);
@@ -246,7 +246,7 @@ netif_put(struct iodesc *desc, void *pkt, size_t len)
#endif
#ifdef PARANOID
if (drv->netif_put == NULL)
panic("%s%d: no netif_put support\n", drv->netif_bname,
panic("%s%d: no netif_put support", drv->netif_bname,
nif->nif_unit);
#endif
rv = drv->netif_put(desc, pkt, len);
@@ -51,6 +51,9 @@ sbrk(int incr)
{
char *ret;

if (heapbase == NULL)
panic("No heap setup");

if ((heapsize + incr) <= maxheap) {
ret = (char *)heapbase + heapsize;
bzero(ret, incr);
@@ -152,7 +152,7 @@ bf_command(ficlVm *vm)
command_errmsg = NULL;
break;
case CMD_FATAL:
panic("%s\n", command_errmsg);
panic("%s", command_errmsg);
}

free(line);
@@ -278,13 +278,13 @@ bf_init(char *rc)
rv = ficlVmEvaluate(bf_vm,
"vocabulary builtins also builtins definitions");
if (rv != FICL_VM_STATUS_OUT_OF_TEXT) {
panic("error interpreting forth: %d\n", rv);
panic("error interpreting forth: %d", rv);
}

/* Builtin constructor word */
rv = ficlVmEvaluate(bf_vm, BUILTIN_CONSTRUCTOR);
if (rv != FICL_VM_STATUS_OUT_OF_TEXT) {
panic("error interpreting forth: %d\n", rv);
panic("error interpreting forth: %d", rv);
}

/* make all commands appear as Forth words */
@@ -294,21 +294,21 @@ bf_init(char *rc)
bf_command, FICL_WORD_DEFAULT);
rv = ficlVmEvaluate(bf_vm, "forth definitions builtins");
if (rv != FICL_VM_STATUS_OUT_OF_TEXT) {
panic("error interpreting forth: %d\n", rv);
panic("error interpreting forth: %d", rv);
}
sprintf(create_buf, "builtin: %s", (*cmdp)->c_name);
rv = ficlVmEvaluate(bf_vm, create_buf);
if (rv != FICL_VM_STATUS_OUT_OF_TEXT) {
panic("error interpreting forth: %d\n", rv);
panic("error interpreting forth: %d", rv);
}
rv = ficlVmEvaluate(bf_vm, "builtins definitions");
if (rv != FICL_VM_STATUS_OUT_OF_TEXT) {
panic("error interpreting forth: %d\n", rv);
panic("error interpreting forth: %d", rv);
}
}
rv = ficlVmEvaluate(bf_vm, "only forth definitions");
if (rv != FICL_VM_STATUS_OUT_OF_TEXT) {
panic("error interpreting forth: %d\n", rv);
panic("error interpreting forth: %d", rv);
}

/*
@@ -1193,7 +1193,7 @@ multiboot2_exec(struct preloaded_file *fp)
break;
}
if (map->PhysicalStart == 0)
panic("Could not find memory for relocater\n");
panic("Could not find memory for relocater");

if (keep_bs == 0) {
status = BS->ExitBootServices(IH, key);
@@ -1253,7 +1253,7 @@ multiboot2_exec(struct preloaded_file *fp)
mp->mb_mod_start = efi_physaddr(module, tmp, map,
map_size / desc_size, desc_size, mp->mb_mod_end);
if (mp->mb_mod_start == 0)
panic("Could not find memory for module\n");
panic("Could not find memory for module");

mp->mb_mod_end += mp->mb_mod_start;
chunk->chunk_paddr = mp->mb_mod_start;
@@ -515,7 +515,7 @@ tems_setup_terminal(struct vis_devinit *tp, size_t height, size_t width)
tems.ts_font.vf_bytes =
malloc(font_data->uncompressed_size);
if (tems.ts_font.vf_bytes == NULL)
panic("out of memory\n");
panic("out of memory");
(void) lz4_decompress(
font_data->compressed_data,
tems.ts_font.vf_bytes,
@@ -62,5 +62,5 @@ bio_free(void *ptr, size_t size)

bio_buffer_ptr -= size;
if (bio_buffer_ptr != ptr)
panic("bio_alloc()/bio_free() mismatch\n");
panic("bio_alloc()/bio_free() mismatch");
}
@@ -984,7 +984,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
if (bbuf == NULL) {
bio_size = V86_IO_BUFFER_SIZE;
if (bio_size / bd->bd_sectorsize == 0)
panic("BUG: Real mode buffer is too small\n");
panic("BUG: Real mode buffer is too small");

/* Use alternate 4k buffer */
bbuf = PTOV(V86_IO_BUFFER);
@@ -133,7 +133,7 @@ uboot_loadaddr(uint_t type, void *data, uint64_t addr)
}
}
if (biggest_size == 0)
panic("Not enough DRAM to load kernel\n");
panic("Not enough DRAM to load kernel");
#if 0
printf("Loading kernel into region 0x%08jx-0x%08jx (%ju MiB)\n",
(uintmax_t)biggest_block,
@@ -323,7 +323,7 @@ net_init(struct iodesc *desc, void *machdep_hint)
sc = nif->nif_devdata = &uboot_softc;

if ((err = ub_dev_open(sc->sc_handle)) != 0)
panic("%s%d: initialisation failed with error %d\n",
panic("%s%d: initialisation failed with error %d",
nif->nif_driver->netif_bname, nif->nif_unit, err);

/* Get MAC address */
@@ -358,6 +358,6 @@ net_end(struct netif *nif)
int err;

if ((err = ub_dev_close(sc->sc_handle)) != 0)
panic("%s%d: net_end failed with error %d\n",
panic("%s%d: net_end failed with error %d",
nif->nif_driver->netif_bname, nif->nif_unit, err);
}

0 comments on commit 96cf046

Please sign in to comment.
You can’t perform that action at this time.