35 #ifndef NATIVE_INTERNAL_H
36 #define NATIVE_INTERNAL_H
38 #include "util/ucontext.h"
90 extern volatile bool _native_interrupts_enabled;
98 extern int _signal_pipe_fd[2];
104 extern volatile int _native_pending_signals;
139 void _native_call_sig_handlers_and_switch(
void);
161 extern volatile int _native_pending_syscalls;
167 _native_pending_syscalls += 1;
174 _native_pending_syscalls -= 1;
187 void _native_syscall_leave(
void);
195 void _native_syscall_enter(
void);
238 extern void _native_isr_leave(
void);
274 extern const char *_progname;
280 extern char **_native_argv;
286 extern pid_t _native_pid;
292 extern pid_t _native_id;
298 extern unsigned int _native_rng_seed;
307 extern int _native_rng_mode;
static thread_t * thread_get_active(void)
Returns a pointer to the Thread Control Block of the currently running thread.
void _native_sig_leave_tramp(void)
Switches to ISR context, then enables IRQ and returns to userspace.
static void _native_pending_syscalls_up(void)
Increment spending system call counter.
static void _native_isr_context_make(void(*func)(void))
Makes ISR context so that execution continues at func when the context is applied.
void native_cpu_init(void)
Initializes native CPU.
volatile int _native_in_isr
A boolean variable indicating whether program execution currently takes place in an ISR context.
ssize_t _native_read(int fd, void *buf, size_t count)
Reads file, populates given buffer.
volatile uintptr_t _native_user_fptr
Points to instruction in userspace where RIOT left off and switched to ISR context.
ssize_t _native_write(int fd, const void *buf, size_t count)
Writes given data into file.
static ucontext_t * _native_user_context(void)
Retrieves user context.
void _native_init_syscalls(void)
Registers system calls.
void native_interrupt_init(void)
Registers signal handlers for the native CPU.
int native_register_interrupt(int sig, _native_callback_t handler)
Register interrupt handler handler for interrupt signal.
char _isr_stack[THREAD_STACKSIZE_DEFAULT]
Stack used in ISR context.
ssize_t _native_writev(int fildes, const struct iovec *iov, int iovcnt)
Performs a vectored write operation.
void(* _native_callback_t)(void)
Prototype for native's internal callbacks.
static void _native_pending_syscalls_down(void)
Decrements pending system call counter.
int native_unregister_interrupt(int sig)
Unregister interrupt handler for interrupt signal.
ucontext_t * _native_isr_context
ISR context.
Scheduler API definition.
POSIX compatible sys/statvfs.h definitions.
stdio wrapper to extend the C libs stdio
Implementation specific CPU configuration options.
char * sp
thread's stack pointer
Structure for scatter/gather I/O.
#define THREAD_STACKSIZE_DEFAULT
A reasonable default stack size that will suffice most smaller tasks.
libc header for scatter/gather I/O