mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
7b9d199ec8
wrap some libc functions that do system calls (terminal output) wrap read/write with syscall guard define real_read/write (next dynamic linker find for read/write) guard system calls in remaining code introduce native_internhal.h throw out some debug statements that break things clean up includes a bit declare board_init in native_internhal.h add -ldl to LINKFLAGS for cpu/syscalls
58 lines
1.2 KiB
C
58 lines
1.2 KiB
C
/**
|
|
* Native CPU internal declarations
|
|
*/
|
|
|
|
/**
|
|
* @ingroup arch
|
|
* @defgroup native_cpu Native CPU
|
|
* @{
|
|
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
|
|
*/
|
|
|
|
#ifndef _NATIVE_INTERNAL_H
|
|
#define _NATIVE_INTERNAL_H
|
|
|
|
//#include <signal.h>
|
|
|
|
/**
|
|
* internal functions
|
|
*/
|
|
void native_cpu_init(void);
|
|
void native_interrupt_init(void);
|
|
|
|
void native_irq_handler();
|
|
extern void _native_sig_leave_tramp(void);
|
|
|
|
void _native_syscall_leave();
|
|
void _native_syscall_enter();
|
|
|
|
/**
|
|
* external functions regularly wrapped in native for direct use
|
|
*/
|
|
extern ssize_t (*real_read)(int fd, void *buf, size_t count);
|
|
extern ssize_t (*real_write)(int fd, const void *buf, size_t count);
|
|
|
|
/**
|
|
* data structures
|
|
*/
|
|
extern volatile int native_interrupts_enabled;
|
|
extern volatile unsigned int _native_saved_eip;
|
|
extern int _sig_pipefd[2];
|
|
extern volatile int _native_sigpend;
|
|
extern volatile int _native_in_isr;
|
|
extern volatile int _native_in_syscall;
|
|
|
|
extern char __isr_stack[SIGSTKSZ];
|
|
extern char __end_stack[SIGSTKSZ];
|
|
extern ucontext_t native_isr_context;
|
|
extern ucontext_t end_context;
|
|
extern ucontext_t *_native_cur_ctx, *_native_isr_ctx;
|
|
|
|
#ifdef MODULE_UART0
|
|
#include <sys/select.h>
|
|
extern fd_set _native_rfds;
|
|
#endif
|
|
|
|
/** @} */
|
|
#endif /* _NATIVE_INTERNAL_H */
|