PERFORCE change 126471 for review
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Sun Sep 16 05:58:45 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=126471
Change 126471 by gonzo at gonzo_jeeves on 2007/09/16 12:58:04
o get rid of mips_init function and merge it's functionality to
platform_init.
o Reorder some function calls:
- init_param1 should be called first to initialize hz variable
- tick_init_params should be called before cninit because uart
code may use DELAY.
Affected files ...
.. //depot/projects/mips2/src/sys/mips/mips32/idt/idt_machdep.c#4 edit
Differences ...
==== //depot/projects/mips2/src/sys/mips/mips32/idt/idt_machdep.c#4 (text+ko) ====
@@ -73,46 +73,6 @@
extern int *end;
void
-mips_init(void)
-{
- int i;
-
- printf("entry: mips_init()\n");
-
- bootverbose = 1;
- realmem = btoc(32 << 20);
-
- for (i = 0; i < 10; i++) {
- phys_avail[i] = 0;
- }
-
- /* phys_avail regions are in bytes */
- phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end);
- phys_avail[1] = ctob(realmem);
-
- physmem = realmem;
-
- init_param1();
- init_param2(physmem);
-
- mips_cpu_init();
- pmap_bootstrap();
-
- proc_linkup(&proc0, &thread0);
- thread0.td_kstack = kstack0;
- pcpu_init(pcpup, 0, sizeof(struct pcpu));
- pcpup->pc_curthread = &thread0;
- cpu_thread_setup(curthread);
- pcpup->pc_curpcb = curthread->td_pcb;
-
- mutex_init();
-
-#ifdef DDB
- kdb_init();
-#endif
-}
-
-void
platform_halt(void)
{
@@ -151,17 +111,53 @@
void
platform_start(int argc, char **argv)
{
+ uint64_t platform_counter_freq;
vm_offset_t kernend;
- uint64_t platform_counter_freq;
+ int i;
/* clear the BSS and SBSS segments */
kernend = round_page((vm_offset_t)&end);
memset(&edata, 0, kernend - (vm_offset_t)(&edata));
+ bootverbose = 1;
+ realmem = btoc(32 << 20);
+
+ for (i = 0; i < 10; i++) {
+ phys_avail[i] = 0;
+ }
+
+ /* phys_avail regions are in bytes */
+ phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end);
+ phys_avail[1] = ctob(realmem);
+
+ physmem = realmem;
+
+ /*
+ * ns8250 uart code uses DELAY so ticker should be inititalized
+ * before cninit. And tick_init_params refers to hz, so * init_param1
+ * should be called first.
+ */
+ init_param1();
+ /* TODO: parse argc,argv */
+ platform_counter_freq = 330000000UL;
+ tick_init_params(platform_counter_freq, 1);
cninit();
- mips_init();
- /* Set counter_freq for tick_init_params() */
- platform_counter_freq = 330000000UL;
+
+ init_param2(physmem);
+
+ mips_cpu_init();
+ pmap_bootstrap();
+
+ proc_linkup(&proc0, &thread0);
+ thread0.td_kstack = kstack0;
+ pcpu_init(pcpup, 0, sizeof(struct pcpu));
+ pcpup->pc_curthread = &thread0;
+ cpu_thread_setup(curthread);
+ pcpup->pc_curpcb = curthread->td_pcb;
+
+ mutex_init();
- tick_init_params(platform_counter_freq, 1);
+#ifdef DDB
+ kdb_init();
+#endif
}
More information about the p4-projects
mailing list