Changeset 45b26dad in mainline for kernel/arch/sparc64/src
- Timestamp:
- 2006-09-26T12:59:28Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b44939b
- Parents:
- 6ff1f1e
- Location:
- kernel/arch/sparc64/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/cpu/cpu.c
r6ff1f1e r45b26dad 36 36 #include <cpu.h> 37 37 #include <arch.h> 38 #include <print.h> 38 39 #include <arch/register.h> 39 #include <print.h> 40 #include <arch/boot/boot.h> 40 #include <genarch/ofw/ofw_tree.h> 41 #include <arch/types.h> 42 #include <arch/drivers/tick.h> 41 43 44 /** Perform sparc64 specific initialization of the processor structure for the current processor. */ 42 45 void cpu_arch_init(void) 43 46 { 44 CPU->arch.clock_frequency = bootinfo.processor.clock_frequency; 47 ofw_tree_node_t *node; 48 uint32_t mid; 49 uint32_t clock_frequency = 0; 50 upa_config_t upa_config; 51 52 upa_config.value = upa_config_read(); 53 node = ofw_tree_find_child_by_device_type(ofw_tree_lookup("/"), "cpu"); 54 while (node) { 55 ofw_tree_property_t *prop; 56 57 prop = ofw_tree_getprop(node, "upa-portid"); 58 if (prop && prop->value) { 59 mid = *((uint32_t *) prop->value); 60 if (mid == upa_config.mid) { 61 prop = ofw_tree_getprop(node, "clock-frequency"); 62 if (prop && prop->value) 63 clock_frequency = *((uint32_t *) prop->value); 64 } 65 } 66 node = ofw_tree_find_peer_by_device_type(node, "cpu"); 67 } 68 69 CPU->arch.clock_frequency = clock_frequency; 70 tick_init(); 45 71 } 46 72 73 /** Read version information from the current processor. */ 47 74 void cpu_identify(void) 48 75 { … … 50 77 } 51 78 79 /** Print version information for a processor. 80 * 81 * @param m Processor structure of the CPU for which version information is to be printed. 82 */ 52 83 void cpu_print_report(cpu_t *m) 53 84 { -
kernel/arch/sparc64/src/drivers/tick.c
r6ff1f1e r45b26dad 53 53 interrupt_register(14, "tick_int", tick_interrupt); 54 54 compare.int_dis = false; 55 compare.tick_cmpr = bootinfo.processor.clock_frequency/HZ;55 compare.tick_cmpr = CPU->arch.clock_frequency/HZ; 56 56 tick_compare_write(compare.value); 57 57 tick_write(0); -
kernel/arch/sparc64/src/sparc64.c
r6ff1f1e r45b26dad 38 38 #include <arch/trap/trap.h> 39 39 #include <arch/console.h> 40 #include <arch/drivers/tick.h>41 40 #include <proc/thread.h> 42 41 #include <console/console.h> … … 73 72 { 74 73 trap_init(); 75 tick_init();76 74 } 77 75 -
kernel/arch/sparc64/src/start.S
r6ff1f1e r45b26dad 44 44 * 45 45 * The registers are expected to be in this state: 46 * - %o0 bootinfo structure address 47 * - %o1 bootinfo structure size 46 * - %o0 non-zero for the bootstrup processor, zero for application/secondary processors 47 * - %o1 bootinfo structure address 48 * - %o2 bootinfo structure size 48 49 * 49 50 * Moreover, we depend on boot having established the … … 56 57 .global kernel_image_start 57 58 kernel_image_start: 59 brz %o0, kernel_image_start ! block secondary processors 60 nop 58 61 59 62 /* … … 73 76 * to the kernel bootinfo structure. 74 77 */ 75 mov %o1, %o276 mov %o0, %o177 78 sethi %hi(bootinfo), %o0 78 79 call memcpy
Note:
See TracChangeset
for help on using the changeset viewer.
