mirror of
https://github.com/handsomezhuzhu/2025-yatcpu.git
synced 2026-02-20 20:10:14 +00:00
added c source files back
This commit is contained in:
@@ -5,7 +5,7 @@ project(yatcpu-programs C CXX ASM)
|
||||
# Setting variables
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 --target=riscv32-unknown-elf -march=rv32i -mabi=ilp32")
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -O0 --target=riscv32-unknown-elf -march=rv32i -mabi=ilp32")
|
||||
set(C_PROGRAMS tetris hello fibonacci quicksort paging tetris_mmu)
|
||||
set(C_PROGRAMS tetris hello fibonacci quicksort paging tetris_mmu simpletest)
|
||||
set(ASM_PROGRAMS mmio sb)
|
||||
set(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/link.lds)
|
||||
set(LINKER_FLAGS -T ${LINKER_SCRIPT})
|
||||
|
||||
12
lab2/csrc/simpletest.c
Normal file
12
lab2/csrc/simpletest.c
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
extern void enable_interrupt();
|
||||
|
||||
void trap_handler(void *epc, unsigned int cause){
|
||||
*((int*)0x4) = 0x2022;
|
||||
}
|
||||
|
||||
int main(){
|
||||
*((int*)0x4) = 0xDEADBEEF;
|
||||
enable_interrupt();
|
||||
for(;;);
|
||||
}
|
||||
Reference in New Issue
Block a user