12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #include "cache.h"
- #include <mips/uhi_syscalls.h>
- static void __attribute__ ((noreturn)) _MIPS_HAL_NOMIPS16
- __boot_fail (void)
- {
- register long arg1 asm ("$4") = __MIPS_UHI_BF_CACHE;
- register long op asm ("$25") = __MIPS_UHI_BOOTFAIL;
- register long ret asm ("$2") = __MIPS_UHI_SYSCALL_NUM;
- __asm__ volatile (" # %0 = bootfail(%0, %1) op=%2\n"
- SYSCALL (__MIPS_UHI_SYSCALL_NUM)
- : "+r" (ret)
- : "r" (arg1), "r" (op));
- __boot_fail ();
- }
- void _MIPS_HAL_NOMIPS16
- __def_cache_size_hook (void)
- {
-
- if ((mips32_getconfig3 () & CFG3_M) == 0
- || (mips32_getconfig4 () & CFG4_M) == 0
- || (mips32_getconfig5 () & CFG5_L2C) == 0)
- {
- unsigned int cfg, tmp1, tmp2;
- cfg = mips32_getconfig2 ();
-
- tmp1 = (cfg & CFG2_SL_MASK) >> CFG2_SL_SHIFT;
- if (tmp1 == 0)
- return;
- tmp1++;
-
- mips_scache_ways = ((cfg & CFG2_SA_MASK) >> CFG2_SA_SHIFT) + 1;
-
- mips_scache_linesize = 1 << tmp1;
- tmp2 = mips_scache_ways << tmp1;
-
- tmp1 = ((cfg & CFG2_SS_MASK) >> CFG2_SS_SHIFT) + 6;
- mips_scache_size = tmp2 << tmp1;
- return;
- }
-
- __boot_fail ();
- }
- void __cache_size_hook (void) __attribute__ ((weak, alias ("__def_cache_size_hook")));
|