From: Tomas Hruby Date: Sun, 30 Aug 2009 14:55:30 +0000 (+0000) Subject: system_init() renamed to arch_init() X-Git-Tag: v3.1.5~168 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=2e293ce7c043f682a2eeec8ac538a379e73d6f4d;p=minix.git system_init() renamed to arch_init() - a better name for architecture specific init function - some of x86 init code must execute in protected mode - prot_init() removed from this function and still called in cstart() Imho this should be called from the architecture specific assembly not cstart. cstart perform Minix monitor specific tasks and will be touched once another bootloader is in use, e.g. booting via tftp, therefore we keep it as is for now. - this is a backport from the SMP code which requires this. Merging will be simpler --- diff --git a/kernel/arch/i386/system.c b/kernel/arch/i386/system.c index 2cf75d4f7..805e4d451 100644 --- a/kernel/arch/i386/system.c +++ b/kernel/arch/i386/system.c @@ -91,9 +91,8 @@ PUBLIC void arch_get_aout_headers(int i, struct exec *h) phys_copy(aout + i * A_MINHDR, vir2phys(h), (phys_bytes) A_MINHDR); } -PUBLIC void system_init(void) +PUBLIC void arch_init(void) { - prot_init(); idt_init(); #if 0 diff --git a/kernel/main.c b/kernel/main.c index 3fdf0b867..9fa9406c0 100755 --- a/kernel/main.c +++ b/kernel/main.c @@ -37,6 +37,9 @@ PUBLIC void main() reg_t ktsb; /* kernel task stack base */ struct exec e_hdr; /* for a copy of an a.out header */ + /* Architecture-dependent initialization. */ + arch_init(); + /* Clear the process table. Anounce each slot as empty and set up mappings * for proc_addr() and proc_nr() macros. Do the same for the table with * privilege structures for the system processes. diff --git a/kernel/proto.h b/kernel/proto.h index 88f1bb8f2..7536765c5 100755 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -142,7 +142,7 @@ _PROTOTYPE( int intr_disabled, (void) ); _PROTOTYPE( int intr_unmask, (irq_hook_t* hook) ); _PROTOTYPE( int intr_mask, (irq_hook_t* hook) ); _PROTOTYPE( void idle_task, (void) ); -_PROTOTYPE( void system_init, (void) ); +_PROTOTYPE( void arch_init, (void) ); _PROTOTYPE( void ser_putc, (char) ); _PROTOTYPE( void arch_shutdown, (int) ); _PROTOTYPE( void arch_get_aout_headers, (int i, struct exec *h) ); diff --git a/kernel/start.c b/kernel/start.c index aa188dfa3..a1a2b5cb8 100755 --- a/kernel/start.c +++ b/kernel/start.c @@ -29,8 +29,8 @@ U16_t parmoff, parmsize; /* boot parameters offset and length */ kinfo.data_base = seg2phys(ds); kinfo.data_size = (phys_bytes) &end; /* size of data segment */ - /* Architecture-dependent initialization. */ - system_init(); + /* protection initialization */ + prot_init(); /* Copy the boot parameters to the local buffer. */ arch_get_params(params_buffer, sizeof(params_buffer));