Changeset 965dc18 in mainline for boot/arch/sparc64/loader/main.c
- Timestamp:
- 2008-12-05T19:59:03Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 49093a4
- Parents:
- 0258e67
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/main.c
r0258e67 r965dc18 40 40 41 41 bootinfo_t bootinfo; 42 42 43 component_t components[COMPONENTS]; 43 44 … … 55 56 char *timestamp = ""; 56 57 #endif 58 59 /** UltraSPARC subarchitecture - 1 for US, 3 for US3 */ 60 uint8_t subarchitecture; 61 62 /** 63 * mask of the MID field inside the ICBUS_CONFIG register shifted by 64 * MID_SHIFT bits to the right 65 */ 66 uint16_t mid_mask; 57 67 58 68 /** Print version information. */ … … 64 74 } 65 75 76 /* the lowest ID (read from the VER register) of some US3 CPU model */ 77 #define FIRST_US3_CPU 0x14 78 79 /* the greatest ID (read from the VER register) of some US3 CPU model */ 80 #define LAST_US3_CPU 0x19 81 82 /* UltraSPARC IIIi processor implementation code */ 83 #define US_IIIi_CODE 0x15 84 85 /** 86 * Sets the global variables "subarchitecture" and "mid_mask" to 87 * correct values. 88 */ 89 static void detect_subarchitecture(void) 90 { 91 uint64_t v; 92 asm volatile ("rdpr %%ver, %0\n" : "=r" (v)); 93 94 v = (v << 16) >> 48; 95 if ((v >= FIRST_US3_CPU) && (v <= LAST_US3_CPU)) { 96 subarchitecture = SUBARCH_US3; 97 if (v == US_IIIi_CODE) 98 mid_mask = (1 << 5) - 1; 99 else 100 mid_mask = (1 << 10) - 1; 101 } else if (v < FIRST_US3_CPU) { 102 subarchitecture = SUBARCH_US; 103 mid_mask = (1 << 5) - 1; 104 } else { 105 printf("\nThis CPU is not supported by HelenOS."); 106 } 107 } 108 66 109 void bootstrap(void) 67 110 { … … 73 116 version_print(); 74 117 118 detect_subarchitecture(); 75 119 init_components(components); 76 120 … … 84 128 halt(); 85 129 } 86 130 87 131 if (bootinfo.memmap.total == 0) { 88 132 printf("Error: no memory detected, halting.\n");
Note:
See TracChangeset
for help on using the changeset viewer.