MCPcopy Create free account
hub / github.com/F-Stack/f-stack / init_6x86

Function init_6x86

freebsd/i386/i386/initcpu.c:304–375  ·  view source on GitHub ↗

* Cyrix 6x86 * * XXX - What should I do here? Please let me know. */

Source from the content-addressed store, hash-verified

302 * XXX - What should I do here? Please let me know.
303 */
304static void
305init_6x86(void)
306{
307 register_t saveintr;
308 u_char ccr3, ccr4;
309
310 saveintr = intr_disable();
311
312 load_cr0(rcr0() | CR0_CD | CR0_NW);
313 wbinvd();
314
315 /* Initialize CCR0. */
316 write_cyrix_reg(CCR0, read_cyrix_reg(CCR0) | CCR0_NC1);
317
318 /* Initialize CCR1. */
319#ifdef CPU_CYRIX_NO_LOCK
320 write_cyrix_reg(CCR1, read_cyrix_reg(CCR1) | CCR1_NO_LOCK);
321#else
322 write_cyrix_reg(CCR1, read_cyrix_reg(CCR1) & ~CCR1_NO_LOCK);
323#endif
324
325 /* Initialize CCR2. */
326#ifdef CPU_SUSP_HLT
327 write_cyrix_reg(CCR2, read_cyrix_reg(CCR2) | CCR2_SUSP_HLT);
328#else
329 write_cyrix_reg(CCR2, read_cyrix_reg(CCR2) & ~CCR2_SUSP_HLT);
330#endif
331
332 ccr3 = read_cyrix_reg(CCR3);
333 write_cyrix_reg(CCR3, CCR3_MAPEN0);
334
335 /* Initialize CCR4. */
336 ccr4 = read_cyrix_reg(CCR4);
337 ccr4 |= CCR4_DTE;
338 ccr4 &= ~CCR4_IOMASK;
339#ifdef CPU_IORT
340 write_cyrix_reg(CCR4, ccr4 | (CPU_IORT & CCR4_IOMASK));
341#else
342 write_cyrix_reg(CCR4, ccr4 | 7);
343#endif
344
345 /* Initialize CCR5. */
346#ifdef CPU_WT_ALLOC
347 write_cyrix_reg(CCR5, read_cyrix_reg(CCR5) | CCR5_WT_ALLOC);
348#endif
349
350 /* Restore CCR3. */
351 write_cyrix_reg(CCR3, ccr3);
352
353 /* Unlock NW bit in CR0. */
354 write_cyrix_reg(CCR2, read_cyrix_reg(CCR2) & ~CCR2_LOCK_NW);
355
356 /*
357 * Earlier revision of the 6x86 CPU could crash the system if
358 * L1 cache is in write-back mode.
359 */
360 if ((cyrix_did & 0xff00) > 0x1600)
361 load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); /* CD = 0 and NW = 0 */

Callers 1

initializecpuFunction · 0.85

Calls 7

write_cyrix_regFunction · 0.85
read_cyrix_regFunction · 0.85
intr_disableFunction · 0.50
load_cr0Function · 0.50
rcr0Function · 0.50
wbinvdFunction · 0.50
intr_restoreFunction · 0.50

Tested by

no test coverage detected