3 #include "lwp_wkspace.h"
5 u32
__lwp_stack_allocate(lwp_cntrl
*thethread
,u32 size
)
7 void *stack_addr
= NULL
;
9 if(!__lwp_stack_isenough(size
))
10 size
= CPU_MINIMUM_STACK_SIZE
;
12 size
= __lwp_stack_adjust(size
);
13 stack_addr
= __lwp_wkspace_allocate(size
);
15 if(!stack_addr
) size
= 0;
17 thethread
->stack
= stack_addr
;
21 void __lwp_stack_free(lwp_cntrl
*thethread
)
23 if(!thethread
->stack_allocated
)
26 __lwp_wkspace_free(thethread
->stack
);