- added I/D-cache invalidate
git-svn-id: http://moon:8086/svn/mips@38 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -80,6 +80,64 @@ uint32_t CP0_PRID_read(void)
|
||||
return result;
|
||||
}
|
||||
|
||||
void CP0_TR_write_ptr(uint32_t* pPtr)
|
||||
{
|
||||
__asm__
|
||||
(
|
||||
"swc0 $31, 0(%[pPtr])\n"
|
||||
:
|
||||
: [pPtr] "r" (pPtr)
|
||||
);
|
||||
}
|
||||
|
||||
void CP0_TR_read_ptr(uint32_t* pPtr)
|
||||
{
|
||||
__asm__
|
||||
(
|
||||
"lwc0 $31, 0(%[pPtr])\n"
|
||||
:
|
||||
: [pPtr] "r" (pPtr)
|
||||
);
|
||||
}
|
||||
|
||||
void ICACHE_invalidate_all(void)
|
||||
{
|
||||
__asm__
|
||||
(
|
||||
"cop0 32\n"
|
||||
);
|
||||
}
|
||||
|
||||
void ICACHE_invalidate_at(uint32_t* pPtr)
|
||||
{
|
||||
__asm__
|
||||
(
|
||||
"mtc0 %[pPtr], $31\n"
|
||||
"cop0 33\n"
|
||||
:
|
||||
: [pPtr] "r" (pPtr)
|
||||
);
|
||||
}
|
||||
|
||||
void DCACHE_invalidate_all(void)
|
||||
{
|
||||
__asm__
|
||||
(
|
||||
"cop0 34\n"
|
||||
);
|
||||
}
|
||||
|
||||
void DCACHE_invalidate_at(uint32_t* pPtr)
|
||||
{
|
||||
__asm__
|
||||
(
|
||||
"mtc0 %[pPtr], $31\n"
|
||||
"cop0 35\n"
|
||||
:
|
||||
: [pPtr] "r" (pPtr)
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
char readchar(void)
|
||||
{
|
||||
|
||||
@@ -59,6 +59,14 @@ void CP0_SR_write(uint32_t val);
|
||||
uint32_t CP0_CR_read(void);
|
||||
void CP0_CR_write(uint32_t val);
|
||||
uint32_t CP0_PRID_read(void);
|
||||
uint32_t CP0_TR_read(void);
|
||||
void CP0_TR_write(uint32_t val);
|
||||
void CP0_TR_write_ptr(uint32_t* pPtr);
|
||||
void CP0_TR_read_ptr(uint32_t* pPtr);
|
||||
void ICACHE_invalidate_all(void);
|
||||
void ICACHE_invalidate_at(uint32_t* pPtr);
|
||||
void DCACHE_invalidate_all(void);
|
||||
void DCACHE_invalidate_at(uint32_t* pPtr);
|
||||
|
||||
// General
|
||||
char readchar(void);
|
||||
|
||||
Reference in New Issue
Block a user