mirror of
https://github.com/drasko/codezero.git
synced 2026-03-01 18:23:14 +01:00
Towards finishing exchange_registers()
- Added mutex_trylock() - Implemented most of exchange_registers() - thread_control() now needs a lock for operations that can modify thread context. - thread_start() does not initialise scheduler flags, now done in thread_create. TODO: - Fork/clone'ed threads should retain their context in tcb, not syscall stack. - exchange_registers() calls in userspace need cleaning up.
This commit is contained in:
@@ -75,6 +75,9 @@
|
||||
#define printk printf
|
||||
#endif
|
||||
|
||||
/* Converts an int-sized field offset in a struct into a bit offset in a word */
|
||||
#define FIELD_TO_BIT(type, field) (1 << (offsetof(type, field) >> 2))
|
||||
|
||||
/* Functions who may either return a pointer or an error code can use these: */
|
||||
#define PTR_ERR(x) ((void *)(x))
|
||||
/* checks up to -1000, the rest might be valid pointers!!! E.g. 0xE0000000 */
|
||||
|
||||
Reference in New Issue
Block a user