|
|
@ -8,10 +8,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
void write_mtimecmp(unsigned long long int mtimecmp)
|
|
|
|
void write_mtimecmp(unsigned long long int mtimecmp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
unsigned int lo = mtimecmp;
|
|
|
|
unsigned int lo = mtimecmp & 0xffffffff;
|
|
|
|
unsigned int hi = mtimecmp >> 32;
|
|
|
|
unsigned int hi = mtimecmp >> 32;
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ (
|
|
|
|
__asm__ volatile(
|
|
|
|
"li t0, %0\n"
|
|
|
|
"li t0, %0\n"
|
|
|
|
"sw %1, 0(t0)\n"
|
|
|
|
"sw %1, 0(t0)\n"
|
|
|
|
"sw %2, 4(t0)" ::
|
|
|
|
"sw %2, 4(t0)" ::
|
|
|
@ -23,10 +23,10 @@ void write_mtimecmp(unsigned long long int mtimecmp)
|
|
|
|
|
|
|
|
|
|
|
|
void write_mtimecmp(unsigned long long int mtimecmp)
|
|
|
|
void write_mtimecmp(unsigned long long int mtimecmp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
unsigned int lower = mtimecmp;
|
|
|
|
unsigned int lower = mtimecmp & 0xffffffff;
|
|
|
|
unsigned int higher = mtimecmp >> 32;
|
|
|
|
unsigned int higher = mtimecmp >> 32;
|
|
|
|
|
|
|
|
|
|
|
|
__asm__ (
|
|
|
|
__asm__ volatile(
|
|
|
|
"csrw %0, %2\n"
|
|
|
|
"csrw %0, %2\n"
|
|
|
|
"csrw %1, %3" ::
|
|
|
|
"csrw %1, %3" ::
|
|
|
|
"I"(CSR_MTIMECMP),"I"(CSR_MTIMECMPH),
|
|
|
|
"I"(CSR_MTIMECMP),"I"(CSR_MTIMECMPH),
|
|
|
|