Changeset eb17041 in rtems
- Timestamp:
- 12/03/99 14:01:11 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- ae252c9
- Parents:
- ad9a21a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libcpu/i386/cpuModel.S
rad9a21a reb17041 143 143 is486x: xor ax,ax 144 144 sahf 145 movb $5,a x146 movb $2,b x145 movb $5,al 146 movb $2,bl 147 147 div bl 148 148 lahf … … 155 155 */ 156 156 #define setCx86(reg, val) \ 157 movb reg,a x; \158 outb a x,$0x22; \159 movb val,a x; \160 outb a x,$0x23157 movb reg,al; \ 158 outb al,$0x22; \ 159 movb val,al; \ 160 outb al,$0x23 161 161 162 162 #define getCx86(reg) \ 163 movb reg,a x; \164 outb a x,$0x22; \165 inb $0x23,a x163 movb reg,al; \ 164 outb al,$0x22; \ 165 inb $0x23,al 166 166 167 167 cli 168 168 getCx86($0xc3) /* get CCR3 */ 169 movb a x,cx/* Save old value */170 movb a x,bx171 andb $0x0f,b x/* Enable access to all config registers */172 orb $0x10,b x/* by setting bit 4 */173 setCx86($0xc3,b x)169 movb al,cl /* Save old value */ 170 movb al,bl 171 andb $0x0f,bl /* Enable access to all config registers */ 172 orb $0x10,bl /* by setting bit 4 */ 173 setCx86($0xc3,bl) 174 174 175 175 getCx86($0xe8) /* now we can get CCR4 */ 176 orb $0x80,a x/* and set bit 7 (CPUIDEN) */177 movb a x,bx/* to enable CPUID execution */178 setCx86($0xe8,b x)176 orb $0x80,al /* and set bit 7 (CPUIDEN) */ 177 movb al,bl /* to enable CPUID execution */ 178 setCx86($0xe8,bl) 179 179 180 180 getCx86($0xfe) /* DIR0 : let's check this is a 6x86(L) */ 181 andb $0xf0,a x/* should be 3xh */182 cmpb $0x30,a x181 andb $0xf0,al /* should be 3xh */ 182 cmpb $0x30,al 183 183 jne n6x86 184 184 getCx86($0xe9) /* CCR5 : we reset the SLOP bit */ 185 andb $0xfd,a x/* so that udelay calculation */186 movb a x,bx/* is correct on 6x86(L) CPUs */187 setCx86($0xe9,b x)188 setCx86($0xc3,c x) /* Restore old CCR3 */185 andb $0xfd,al /* so that udelay calculation */ 186 movb al,bl /* is correct on 6x86(L) CPUs */ 187 setCx86($0xe9,bl) 188 setCx86($0xc3,cl) /* Restore old CCR3 */ 189 189 sti 190 190 jmp isnew /* We enabled CPUID now */ 191 191 192 n6x86: setCx86($0xc3,c x) /* Restore old CCR3 */192 n6x86: setCx86($0xc3,cl) /* Restore old CCR3 */ 193 193 sti 194 194 ncyrix: /* restore original EFLAGS */
Note: See TracChangeset
for help on using the changeset viewer.