support irq
This commit is contained in:
@@ -23,7 +23,7 @@ INC_DIR = -I$(KERNEL_ROOT)/services/shell/letter-shell \
|
||||
-I$(KERNEL_ROOT)/services/boards/$(BOARD) \
|
||||
-I$(KERNEL_ROOT)/services/app
|
||||
|
||||
all: init test_fs simple_client simple_server shell fs_server test_priority readme.txt | bin
|
||||
all: init test_fs simple_client simple_server shell fs_server test_priority test_irq_hdlr test_irq_send readme.txt | bin
|
||||
../tools/mkfs/mkfs ./fs.img $^
|
||||
@mv $(filter-out readme.txt, $^) bin
|
||||
@mv *.o bin
|
||||
@@ -32,6 +32,14 @@ all: init test_fs simple_client simple_server shell fs_server test_priority read
|
||||
bin:
|
||||
@mkdir -p bin
|
||||
|
||||
test_irq_send: test_irq_sender.o usyscall.o libserial.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^ ${board_specs}
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
test_irq_hdlr: test_irq_handler.o libserial.o libipc.o session.o usyscall.o libmem.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^ ${board_specs}
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
shell: shell_port.o libserial.o shell_cmd_list.o shell.o shell_ext.o libfs_to_client.o libipc.o session.o usyscall.o libmem.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^ ${board_specs}
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
#include "libipc.h"
|
||||
#include "libserial.h"
|
||||
#include "usyscall.h"
|
||||
|
||||
IPC_SERVICES(IpcSwIntrHandler, Ipc_intr_3);
|
||||
|
||||
enum {
|
||||
SW_INTERRUPT_3 = 3,
|
||||
};
|
||||
|
||||
void sgi_test_handler(void)
|
||||
{
|
||||
printf("TEST_SW_HDLR: In %s()\n", __func__);
|
||||
}
|
||||
|
||||
int IPC_DO_SERVE_FUNC(Ipc_intr_3)(void* useless)
|
||||
{
|
||||
sgi_test_handler();
|
||||
return 0;
|
||||
}
|
||||
|
||||
IPC_SERVER_INTERFACE(Ipc_intr_3, 1);
|
||||
IPC_SERVER_REGISTER_INTERFACES(IpcSwIntrHandler, 1, Ipc_intr_3);
|
||||
int main()
|
||||
{
|
||||
register_irq(SW_INTERRUPT_3, Ipc_intr_3);
|
||||
ipc_server_loop(&IpcSwIntrHandler);
|
||||
|
||||
exit();
|
||||
}
|
||||
Reference in New Issue
Block a user