Subversion Repositories HelenOS-historic

Compare Revisions

Regard whitespace Rev 1765 → Rev 1766

/kernel/trunk/generic/include/mm/frame.h
89,12 → 89,10
#define IS_BUDDY_LEFT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0)
#define IS_BUDDY_RIGHT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 1)
 
#define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL, NULL)
#define frame_alloc_rc(order, flags, status) frame_alloc_generic(order, flags, status, NULL)
#define frame_alloc_rc_zone(order, flags, status, zone) frame_alloc_generic(order, flags, status, zone)
#define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL)
 
extern void frame_init(void);
extern void * frame_alloc_generic(__u8 order, int flags, int * status, int *pzone);
extern void * frame_alloc_generic(__u8 order, int flags, int *pzone);
extern void frame_free(__address frame);
extern void frame_reference_add(pfn_t pfn);
 
/kernel/trunk/generic/src/proc/thread.c
124,7 → 124,6
static int thr_constructor(void *obj, int kmflags)
{
thread_t *t = (thread_t *)obj;
int status;
 
spinlock_initialize(&t->lock, "thread_t_lock");
link_initialize(&t->rq_link);
141,8 → 140,8
# endif
#endif
 
t->kstack = frame_alloc_rc(STACK_FRAMES, FRAME_KA | kmflags,&status);
if (status) {
t->kstack = frame_alloc(STACK_FRAMES, FRAME_KA | kmflags);
if (! t->kstack) {
#ifdef ARCH_HAS_FPU
if (t->saved_fpu_context)
slab_free(fpu_context_slab,t->saved_fpu_context);
/kernel/trunk/generic/src/mm/slab.c
161,11 → 161,10
slab_t *slab;
size_t fsize;
int i;
int status;
int zone=0;
data = frame_alloc_rc_zone(cache->order, FRAME_KA | flags, &status, &zone);
if (status != FRAME_OK) {
data = frame_alloc_generic(cache->order, FRAME_KA | flags, &zone);
if (!data) {
return NULL;
}
if (! (cache->flags & SLAB_CACHE_SLINSIDE)) {
/kernel/trunk/generic/src/mm/frame.c
931,7 → 931,7
* @return Physical address of the allocated frame.
*
*/
void * frame_alloc_generic(__u8 order, int flags, int *status, int *pzone)
void * frame_alloc_generic(__u8 order, int flags, int *pzone)
{
ipl_t ipl;
int freed;
967,12 → 967,8
*/
interrupts_restore(ipl);
 
if (flags & FRAME_ATOMIC) {
ASSERT(status != NULL);
if (status)
*status = FRAME_NO_MEMORY;
if (flags & FRAME_ATOMIC)
return 0;
}
panic("Sleep not implemented.\n");
goto loop;
984,9 → 980,6
spinlock_unlock(&zone->lock);
interrupts_restore(ipl);
 
if (status)
*status = FRAME_OK;
 
if (flags & FRAME_KA)
return (void *)PA2KA(PFN2ADDR(v));
return (void *)PFN2ADDR(v);