-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically generate system call prototypes for the Linux kernel.
Inside of the Linux kernel we have the possibility of simply using the same prototypes as what we use for userspace, as long as our system call table has wrappers to invoke them in the right way. Already check in the generator for the header files for our prototypes. Some differences compared to userspace: - We don't want them to be static inline. Move this into the system call implementation generator. - Don't use _Noreturn. The implementations of these functions need to invoke other functions that are not marked that way. - Add __user annotations to pointers going to userspace. I'm now working on patching up all of the system calls to use these prototypes. When this is completed, I'll work on automatically generating a system call table.
- Loading branch information
1 parent
818c03c
commit c015f43
Showing
5 changed files
with
532 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions | ||
// are met: | ||
// 1. Redistributions of source code must retain the above copyright | ||
// notice, this list of conditions and the following disclaimer. | ||
// 2. Redistributions in binary form must reproduce the above copyright | ||
// notice, this list of conditions and the following disclaimer in the | ||
// documentation and/or other materials provided with the distribution. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
// SUCH DAMAGE. | ||
// | ||
// This file is automatically generated. Do not edit. | ||
// | ||
// Source: https://github.com/NuxiNL/cloudabi | ||
|
||
#ifndef CLOUDABI64_SYSCALLS_H | ||
#define CLOUDABI64_SYSCALLS_H | ||
|
||
#include "cloudabi64_types.h" | ||
|
||
cloudabi_errno_t | ||
cloudabi64_sys_fd_pread( | ||
cloudabi_fd_t fd, | ||
const cloudabi64_iovec_t __user *iov, | ||
size_t iovcnt, | ||
cloudabi_filesize_t offset, | ||
size_t *nread | ||
); | ||
|
||
cloudabi_errno_t | ||
cloudabi64_sys_fd_pwrite( | ||
cloudabi_fd_t fd, | ||
const cloudabi64_ciovec_t __user *iov, | ||
size_t iovcnt, | ||
cloudabi_filesize_t offset, | ||
size_t *nwritten | ||
); | ||
|
||
cloudabi_errno_t | ||
cloudabi64_sys_fd_read( | ||
cloudabi_fd_t fd, | ||
const cloudabi64_iovec_t __user *iov, | ||
size_t iovcnt, | ||
size_t *nread | ||
); | ||
|
||
cloudabi_errno_t | ||
cloudabi64_sys_fd_write( | ||
cloudabi_fd_t fd, | ||
const cloudabi64_ciovec_t __user *iov, | ||
size_t iovcnt, | ||
size_t *nwritten | ||
); | ||
|
||
cloudabi_errno_t | ||
cloudabi64_sys_poll( | ||
const cloudabi64_subscription_t __user *in, | ||
cloudabi64_event_t __user *out, | ||
size_t nsubscriptions, | ||
size_t *nevents | ||
); | ||
|
||
cloudabi_errno_t | ||
cloudabi64_sys_poll_fd( | ||
cloudabi_fd_t fd, | ||
const cloudabi64_subscription_t __user *in, | ||
size_t nin, | ||
cloudabi64_event_t __user *out, | ||
size_t nout, | ||
const cloudabi64_subscription_t __user *timeout, | ||
size_t *nevents | ||
); | ||
|
||
cloudabi_errno_t | ||
cloudabi64_sys_sock_recv( | ||
cloudabi_fd_t sock, | ||
const cloudabi64_recv_in_t __user *in, | ||
cloudabi64_recv_out_t __user *out | ||
); | ||
|
||
cloudabi_errno_t | ||
cloudabi64_sys_sock_send( | ||
cloudabi_fd_t sock, | ||
const cloudabi64_send_in_t __user *in, | ||
cloudabi64_send_out_t __user *out | ||
); | ||
|
||
cloudabi_errno_t | ||
cloudabi64_sys_thread_create( | ||
cloudabi64_threadattr_t __user *attr, | ||
cloudabi_tid_t *tid | ||
); | ||
|
||
#endif |
Oops, something went wrong.