updates BSP
This commit is contained in:
Submodule bare-metal-bsp updated: bf0e4ec057...328a961276
@@ -1,38 +1,30 @@
|
|||||||
|
#include "encoding.h"
|
||||||
|
#include "platform.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "platform.h"
|
|
||||||
#include "encoding.h"
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
extern void _init();
|
extern void _init();
|
||||||
int main() {
|
int main() {
|
||||||
// board_init();
|
// board_init();
|
||||||
_init();
|
_init();
|
||||||
puts("after _init");
|
puts("after _init");
|
||||||
|
|
||||||
// set only MPP
|
// enable global interrupt
|
||||||
__asm__ volatile (
|
// csr_set_bits_mstatus(MSTATUS_MIE_BIT_MASK);
|
||||||
"csrs mstatus, %0"
|
|
||||||
:
|
|
||||||
: "r"(MSTATUS_MPP | MSTATUS_MIE)
|
|
||||||
: "memory"
|
|
||||||
);
|
|
||||||
|
|
||||||
puts("after enable MSTATUS_MIE/MPP");
|
puts("after enable MSTATUS_MIE/MPP");
|
||||||
/*
|
|
||||||
// enable MIE
|
// enable MIE
|
||||||
write_csr(mie,MIE_MTIE | MIE_MSIE | MIE_MEIE);
|
csr_set_bits_mie(MIE_MTI_BIT_MASK | MIE_MSI_BIT_MASK | MIE_MEI_BIT_MASK);
|
||||||
puts("after enable MIE");
|
puts("after enable MIE");
|
||||||
*/
|
|
||||||
|
|
||||||
uint64_t time = get_aclint_mtime(aclint);
|
uint64_t time = get_aclint_mtime(aclint);
|
||||||
printf("in main() get_aclint_mtime return %d \n ",time);
|
printf("in main() get_aclint_mtime return %lu \n ", (uint32_t)time);
|
||||||
set_aclint_mtime(aclint, 9);
|
set_aclint_mtime(aclint, 9);
|
||||||
time = get_aclint_mtime(aclint);
|
time = get_aclint_mtime(aclint);
|
||||||
printf("in main() get_aclint_mtime after set 9, return %d \n ",time);
|
printf("in main() get_aclint_mtime after set 9, return %lu \n ", (uint32_t)time);
|
||||||
|
|
||||||
set_aclint_mtimecmp(aclint, (time + 3));
|
set_aclint_mtimecmp(aclint, (time + 3));
|
||||||
puts("set mtimecmp");
|
puts("set mtimecmp");
|
||||||
|
|||||||
Reference in New Issue
Block a user