# HG changeset patch # User Josef 'Jeff' Sipek # Date 1565104053 14400 # Tue Aug 06 11:07:33 2019 -0400 # Node ID 9056cff5956f9c0b41d71bf38a57d2b23d2181ee # Parent 2684dfba1884ee6c7e73e6c590ed0bda786bfa7d loader: don't open-code sigp_stop() Signed-off-by: Josef 'Jeff' Sipek diff --git a/loader/loader/loader_c.c b/loader/loader/loader_c.c --- a/loader/loader/loader_c.c +++ b/loader/loader/loader_c.c @@ -51,26 +51,6 @@ static u32 *ptrbuf = (u32*) (20 * 1024); /* - * halt the cpu - * - * NOTE: we don't care about not clobbering registers as when this - * code executes, the CPU will be stopped. - */ -static inline void die(void) -{ - asm volatile( - "SR %r1, %r1 # not used, but should be zero\n" - "SR %r3, %r3 # CPU Address\n" - "SIGP %r1, %r3, 0x05 # Signal, order 0x05\n" - ); - - /* - * Just in case SIGP fails - */ - for(;;); -} - -/* * determine amount of storage */ static u64 sense_memsize(void) @@ -128,7 +108,7 @@ u16 cc, hh, r; if (lba < 1) - die(); + sigp_stop(); memset(ccw, 0, sizeof(ccw)); @@ -200,14 +180,14 @@ (ADT->DBSIZ != EDF_SUPPORTED_BLOCK_SIZE) || (ADT->OFFST != 0) || (ADT->FSTSZ != sizeof(struct FST))) - die(); + sigp_stop(); nfst = ADT->NFST; read_blk(buf, ADT->DOP); if (FST->NLVL != 0) - die(); // FIXME + sigp_stop(); // FIXME for(i=0,found=0; iAIC * FST->LRECL) > (3ULL * 1024 * 1024)) - die(); + sigp_stop(); /* Since we're assuming that NLVL==1, there's only 1 pointer block */ read_blk(ptrbuf, fst.FOP); @@ -280,7 +260,7 @@ nucleus_elf->e_type != ET_EXEC || nucleus_elf->e_machine != 0x16 || // FIXME: find the name for the #define nucleus_elf->e_version != EV_CURRENT) - die(); + sigp_stop(); /* Iterate through each program header, and copy all PT_LOAD * segments to the final destinations.