[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH 2/6] kernel2: Syscall io_release_port
From: Max Reitz <max@xxxxxxxxxx>
+ Den Syscall zum Freigeben von I/O-Ports hinzugefügt
Signed-off-by: Max Reitz <max@xxxxxxxxxx>
---
src/kernel2/include/syscall.h | 3 +++
src/kernel2/src/syscall.c | 1 +
src/kernel2/src/syscalls/io.c | 10 ++++++++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/kernel2/include/syscall.h b/src/kernel2/include/syscall.h
index 9c5fe77..91cfda8 100644
--- a/src/kernel2/include/syscall.h
+++ b/src/kernel2/include/syscall.h
@@ -131,6 +131,9 @@ void syscall_init_child_page(pid_t pid, vaddr_t src, vaddr_t dest,
/// IO-Ports anfordern
int syscall_io_request_port(uint32_t port, uint32_t length);
+/// IO-Ports freigeben
+int syscall_io_release_port(uint32_t port, uint32_t length);
+
/// Aktuelle Zeit abfragen (Mikrosekunden seit Systemstart)
uint64_t syscall_get_tick_count(void);
diff --git a/src/kernel2/src/syscall.c b/src/kernel2/src/syscall.c
index 073fe9b..143ff44 100644
--- a/src/kernel2/src/syscall.c
+++ b/src/kernel2/src/syscall.c
@@ -84,6 +84,7 @@ void syscall_init()
syscall_register(SYSCALL_ADD_TIMER, &syscall_add_timer, 2);
syscall_register(SYSCALL_PM_REQUEST_PORT, syscall_io_request_port, 2);
+ syscall_register(SYSCALL_PM_RELEASE_PORT, syscall_io_release_port, 2);
syscall_register(SYSCALL_ADD_INTERRUPT_HANDLER,
syscall_add_interrupt_handler, 1);
diff --git a/src/kernel2/src/syscalls/io.c b/src/kernel2/src/syscalls/io.c
index efe344b..31a290c 100644
--- a/src/kernel2/src/syscalls/io.c
+++ b/src/kernel2/src/syscalls/io.c
@@ -1,8 +1,8 @@
/*
- * Copyright (c) 2008 The tyndur Project. All rights reserved.
+ * Copyright (c) 2008, 2010 The tyndur Project. All rights reserved.
*
* This code is derived from software contributed to the tyndur Project
- * by Kevin Wolf.
+ * by Kevin Wolf and Max Reitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -46,3 +46,9 @@ int syscall_io_request_port(uint32_t port, uint32_t length)
return ret;
}
+
+int syscall_io_release_port(uint32_t port, uint32_t length)
+{
+ return io_ports_release(current_process, port, length);
+}
+
--
1.7.1