8 #include <arch/vcore.h>
11 /*****************************************************************************/
12 /* TODO: This is a complete hack, but necessary for vcore stuff tow ork for now
13 * The issue is that exit sometimes calls sys_yield(), and we can't recover from
14 * that properly under our vcore model (we shouldn't though). We really need to
15 * rethink what sys_yield 'should' do when in multicore mode, or else come up
16 * with a different syscall entirely. */
20 #define exit(status) ros_syscall(SYS_proc_destroy, getpid(), status, 0, 0, 0, 0)
21 /*****************************************************************************/
23 #define LOG2_MAX_VCORES 6
24 #define MAX_VCORES (1 << LOG2_MAX_VCORES)
26 #define TRANSITION_STACK_PAGES 2
27 #define TRANSITION_STACK_SIZE (TRANSITION_STACK_PAGES*PGSIZE)
29 /* Defined by glibc; Must be implemented by a user level threading library */
30 extern void vcore_entry();
32 /* Utility Functions */
33 void *allocate_tls(void);
35 /* Vcore API functions */
38 int vcore_request(size_t k);
39 void vcore_yield(void);
40 size_t max_vcores(void);
41 size_t num_vcores(void);