diff options
author | marcel <marcel@FreeBSD.org> | 2003-08-10 21:33:07 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-08-10 21:33:07 +0000 |
commit | 37e1a74113b874b3aba32c9c3dbbd98b04b88c5e (patch) | |
tree | 41d5e0616afffe88dc4c6a6fee26399cbe995ecd /sys | |
parent | bd283b99fb7767ef65d9310ee0a8a2f3bea3cc53 (diff) | |
download | FreeBSD-src-37e1a74113b874b3aba32c9c3dbbd98b04b88c5e.zip FreeBSD-src-37e1a74113b874b3aba32c9c3dbbd98b04b88c5e.tar.gz |
o move cpu_reset() from vm_machdep.c to machdep.c.
o reorder cpu_boot(), cpu_halt() and identifycpu().
No functional change.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ia64/ia64/machdep.c | 137 | ||||
-rw-r--r-- | sys/ia64/ia64/vm_machdep.c | 10 |
2 files changed, 68 insertions, 79 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 1779341..ec3c33f 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -139,11 +139,56 @@ vm_offset_t phys_avail[100]; void mi_startup(void); /* XXX should be in a MI header */ -static void identifycpu(void); - struct kva_md_info kmi; static void +identifycpu(void) +{ + char vendor[17]; + u_int64_t t; + int number, revision, model, family, archrev; + u_int64_t features; + + /* + * Assumes little-endian. + */ + *(u_int64_t *) &vendor[0] = ia64_get_cpuid(0); + *(u_int64_t *) &vendor[8] = ia64_get_cpuid(1); + vendor[16] = '\0'; + + t = ia64_get_cpuid(3); + number = (t >> 0) & 0xff; + revision = (t >> 8) & 0xff; + model = (t >> 16) & 0xff; + family = (t >> 24) & 0xff; + archrev = (t >> 32) & 0xff; + + if (family == 0x7) + strcpy(cpu_model, "Itanium"); + else if (family == 0x1f) + strcpy(cpu_model, "Itanium 2"); /* McKinley */ + else + snprintf(cpu_model, sizeof(cpu_model), "Family=%d", family); + + features = ia64_get_cpuid(4); + + printf("CPU: %s", cpu_model); + if (processor_frequency) + printf(" (%ld.%02ld-Mhz)\n", + (processor_frequency + 4999) / 1000000, + ((processor_frequency + 4999) / 10000) % 100); + else + printf("\n"); + printf(" Origin = \"%s\" Model = %d Revision = %d\n", + vendor, model, revision); + printf(" Features = 0x%b\n", (u_int32_t) features, + "\020" + "\001LB" /* long branch (brl) instruction. */ + "\002SD" /* Spontaneous deferral. */ + "\003AO" /* 16-byte atomic operations (ld, st, cmpxchg). */ ); +} + +static void cpu_startup(dummy) void *dummy; { @@ -202,6 +247,27 @@ cpu_startup(dummy) } void +cpu_boot(int howto) +{ + + ia64_efi_runtime->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, 0); +} + +void +cpu_halt(void) +{ + + ia64_efi_runtime->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, 0); +} + +void +cpu_reset() +{ + + cpu_boot(0); +} + +void cpu_switch(struct thread *old, struct thread *new) { struct pcb *oldpcb, *newpcb; @@ -258,53 +324,6 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) pcpu->pc_pcb = (struct pcb *)((char*)pcpu + pcpusz); } -static void -identifycpu(void) -{ - char vendor[17]; - u_int64_t t; - int number, revision, model, family, archrev; - u_int64_t features; - - /* - * Assumes little-endian. - */ - *(u_int64_t *) &vendor[0] = ia64_get_cpuid(0); - *(u_int64_t *) &vendor[8] = ia64_get_cpuid(1); - vendor[16] = '\0'; - - t = ia64_get_cpuid(3); - number = (t >> 0) & 0xff; - revision = (t >> 8) & 0xff; - model = (t >> 16) & 0xff; - family = (t >> 24) & 0xff; - archrev = (t >> 32) & 0xff; - - if (family == 0x7) - strcpy(cpu_model, "Itanium"); - else if (family == 0x1f) - strcpy(cpu_model, "Itanium 2"); /* McKinley */ - else - snprintf(cpu_model, sizeof(cpu_model), "Family=%d", family); - - features = ia64_get_cpuid(4); - - printf("CPU: %s", cpu_model); - if (processor_frequency) - printf(" (%ld.%02ld-Mhz)\n", - (processor_frequency + 4999) / 1000000, - ((processor_frequency + 4999) / 10000) % 100); - else - printf("\n"); - printf(" Origin = \"%s\" Model = %d Revision = %d\n", - vendor, model, revision); - printf(" Features = 0x%b\n", (u_int32_t) features, - "\020" - "\001LB" /* long branch (brl) instruction. */ - "\002SD" /* Spontaneous deferral. */ - "\003AO" /* 16-byte atomic operations (ld, st, cmpxchg). */ ); -} - void map_pal_code(void) { @@ -1151,26 +1170,6 @@ set_mcontext(struct thread *td, const mcontext_t *mc) } /* - * Machine dependent boot() routine - */ -void -cpu_boot(int howto) -{ - - ia64_efi_runtime->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, 0); -} - -/* - * Shutdown the CPU as much as possible - */ -void -cpu_halt(void) -{ - - ia64_efi_runtime->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, 0); -} - -/* * Clear registers on exec. */ void diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index fc000b9..dd9ecb3 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -297,16 +297,6 @@ cpu_sched_exit(td) } /* - * Force reset the processor by invalidating the entire address space! - */ -void -cpu_reset() -{ - - cpu_boot(0); -} - -/* * Software interrupt handler for queued VM system processing. */ void |