Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Felix Kopp
Ardix
Commits
6d886d72
Verified
Commit
6d886d72
authored
Aug 05, 2021
by
Felix Kopp
Browse files
syscall: refactor names
parent
6e269e02
Changes
7
Hide whitespace changes
Inline
Side-by-side
arch/at91sam3x8e/atomic.c
View file @
6d886d72
...
...
@@ -3,7 +3,7 @@
#include <ardix/atomic.h>
#include <ardix/atom.h>
static
ATOM
_DEFINE
(
atomic_context
);
static
ATOM
(
atomic_context
);
void
atomic_enter
(
void
)
{
...
...
include/arch-generic/entry.h
View file @
6d886d72
...
...
@@ -3,15 +3,18 @@
#pragma once
/**
* Perform a syscall.
*
@brief
Perform a syscall.
*
* This is the first and only method called by the irq handler for system calls.
* It is responsible for finishing the context switch, obtaining the syscall
* number and arguments, and invoking the respective system call.
* This is called by the syscall exception handler. It is responsible for
* finishing the context switch, obtaining the syscall number and arguments,
* and invoking the respective system call. If the return value of this
* function is nonzero, the scheduler is invoked after the call and before
* returning to userspace.
*
* @param sp: The current stack pointer.
* @param sp current stack pointer
* @returns Whether rescheduling is required
*/
void
arch_enter
(
void
*
sp
);
int
arch_enter
(
void
*
sp
);
/*
* This file is part of Ardix.
...
...
include/arch-generic/syscall.h
View file @
6d886d72
...
...
@@ -2,8 +2,8 @@
#pragma once
#define ARCH_SYS
CALL_READ
0
#define ARCH_SYS
CALL_WRITE
1
#define ARCH_SYS
_read
0
#define ARCH_SYS
_write
1
/*
* This file is part of Ardix.
...
...
include/ardix/atom.h
View file @
6d886d72
...
...
@@ -5,7 +5,7 @@
#include <ardix/types.h>
#include <toolchain.h>
#define ATOM
_DEFINE
(name) atom_t name = { .count = 0, }
#define ATOM(name) atom_t name = { .count = 0, }
void
atom_init
(
atom_t
*
atom
);
...
...
include/ardix/syscall.h
View file @
6d886d72
...
...
@@ -10,8 +10,8 @@
#include <toolchain.h>
enum
syscall
{
SYS
CALL_READ
=
ARCH_SYS
CALL_READ
,
SYS
CALL_WRITE
=
ARCH_SYS
CALL_WRITE
,
SYS
_read
=
ARCH_SYS
_read
,
SYS
_write
=
ARCH_SYS
_write
,
NSYSCALLS
};
...
...
kernel/syscall.c
View file @
6d886d72
...
...
@@ -10,8 +10,8 @@
__rodata
int
(
*
const
sys_table
[
NSYSCALLS
])(
sysarg_t
arg1
,
sysarg_t
arg2
,
sysarg_t
arg3
,
sysarg_t
arg4
,
sysarg_t
arg5
,
sysarg_t
arg6
)
=
{
sys_table_entry
(
SYS
CALL_READ
,
&
sys_read
),
sys_table_entry
(
SYS
CALL_WRITE
,
&
sys_write
),
sys_table_entry
(
SYS
_read
,
sys_read
),
sys_table_entry
(
SYS
_write
,
sys_write
),
};
int
sys_stub
(
void
)
...
...
lib/unistd.c
View file @
6d886d72
...
...
@@ -6,12 +6,12 @@
ssize_t
read
(
int
fildes
,
void
*
buf
,
size_t
nbyte
)
{
return
syscall
(
SYS
CALL_READ
,
(
sysarg_t
)
fildes
,
(
sysarg_t
)
buf
,
(
sysarg_t
)
nbyte
);
return
syscall
(
SYS
_read
,
(
sysarg_t
)
fildes
,
(
sysarg_t
)
buf
,
(
sysarg_t
)
nbyte
);
}
ssize_t
write
(
int
fildes
,
const
void
*
buf
,
size_t
nbyte
)
{
return
syscall
(
SYS
CALL_WRITE
,
(
sysarg_t
)
fildes
,
(
sysarg_t
)
buf
,
(
sysarg_t
)
nbyte
);
return
syscall
(
SYS
_write
,
(
sysarg_t
)
fildes
,
(
sysarg_t
)
buf
,
(
sysarg_t
)
nbyte
);
}
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment