Welcome to The Fiwix Project
A UNIX-like kernel for the i386 architecture
1 /* 2 * fiwix/include/fiwix/sleep.h 3 * 4 * Copyright 2018-2021, Jordi Sanfeliu. All rights reserved. 5 * Distributed under the terms of the Fiwix License. 6 */ 7 8 #ifndef _FIWIX_SLEEP_H 9 #define _FIWIX_SLEEP_H 10 11 #include <fiwix/process.h> 12 13 #define AREA_BH 0x00000001 14 #define AREA_CALLOUT 0x00000002 15 #define AREA_TTY_READ 0x00000004 16 #define AREA_SERIAL_READ 0x00000008 17 18 extern struct proc *proc_run_head; 19 20 struct resource { 21 char locked; 22 char wanted; 23 }; 24 25 void runnable(struct proc *); 26 void not_runnable(struct proc *, int); 27 int sleep(void *, int); 28 void wakeup(void *); 29 void wakeup_proc(struct proc *); 30 31 void lock_resource(struct resource *); 32 void unlock_resource(struct resource *); 33 int lock_area(unsigned int); 34 int unlock_area(unsigned int); 35 36 void sleep_init(void); 37 38 #endif /* _FIWIX_SLEEP_H */