Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1. Hlavička v LibC
- int __PDCLIB_syscall open( int fd );
- // 2. Wrapper v LibC
- int open( int fd ) {
- int ret;
- __dios__syscall( SYS_open, &ret, fd );
- return ret;
- }
- // 3. Hlavička v kernelu
- struct VFS {
- int open( ind fd );
- }
- // 4. Implementace v kernelu
- int VFS::open( int fd ) {
- // ...
- return 0;
- }
- // 5. Enum syscallů - definice SYS_*
- // 6. Tabulka reschedule
- const bool _SYS_SCHED[ MAX_SYSCALL ] = { ... }
- // 7. Hlavička konfigračního wrapperu
- namespace configuration { namespace myConfig {
- void open( void *context, void *ret, void *err, va_list vl );
- }
- // 8. Implementace konfigračního wrapperu
- namespace configuration { namespace myConfig {
- void open( void *context, void *ret, void *err, va_list vl ) {
- // Unpack and call
- *ret = getVFS(context).open( fd );
- }
- }
- // 9. Tabulka syscallů pro konfiguraci
- namespace configuration { namespace myConfig {
- const _SC_IMPL syscalls[ MAX_SYSCALL ] = { ... }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement