Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1766 → Rev 1767

/kernel/trunk/test/mm/falloc1/test.c
54,13 → 54,13
printf("Allocating %d frames blocks ... ", 1 << order);
allocated = 0;
for (i = 0; i < MAX_FRAMES >> order; i++) {
frames[allocated] = frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
frames[allocated] = (__address) frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
panic("Test failed. Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
}
if (status == 0) {
if (frames[allocated]) {
allocated++;
} else {
printf("done. ");
/kernel/trunk/test/mm/falloc2/test.c
51,7 → 51,7
 
void falloc(void * arg)
{
int status, order, run, allocated, i;
int order, run, allocated, i;
__u8 val = THREAD->tid % THREADS;
index_t k;
65,8 → 65,8
printf("Thread #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
allocated = 0;
for (i = 0; i < (MAX_FRAMES >> order); i++) {
frames[allocated] = frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status);
if (status == 0) {
frames[allocated] = (__address)frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
if (frames[allocated]) {
memsetb(frames[allocated], FRAME_SIZE << order, val);
allocated++;
} else {
/kernel/trunk/genarch/src/mm/as_pt.c
73,7 → 73,7
pte_t *src_ptl0, *dst_ptl0;
ipl_t ipl;
 
dst_ptl0 = (pte_t *) frame_alloc(ONE_FRAME, FRAME_KA | FRAME_PANIC);
dst_ptl0 = (pte_t *) frame_alloc(ONE_FRAME, FRAME_KA);
 
if (flags & FLAG_AS_KERNEL) {
memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
/kernel/trunk/generic/include/mm/frame.h
58,9 → 58,8
#define ZONE_JOIN 0x1 /**< If possible, merge with neighbouring zones */
 
#define FRAME_KA 0x1 /* skip frames conflicting with user address space */
#define FRAME_PANIC 0x2 /* panic on failure */
#define FRAME_ATOMIC 0x4 /* do not panic and do not sleep on failure */
#define FRAME_NO_RECLAIM 0x8 /* do not start reclaiming when no free memory */
#define FRAME_ATOMIC 0x2 /* do not panic and do not sleep on failure */
#define FRAME_NO_RECLAIM 0x4 /* do not start reclaiming when no free memory */
 
#define FRAME_OK 0 /* frame_alloc return status */
#define FRAME_NO_MEMORY 1 /* frame_alloc return status */
/kernel/trunk/generic/src/cpu/cpu.c
71,7 → 71,7
memsetb((__address) cpus, sizeof(cpu_t) * config.cpu_count, 0);
 
for (i=0; i < config.cpu_count; i++) {
cpus[i].stack = (__u8 *) frame_alloc(STACK_FRAMES, FRAME_KA | FRAME_PANIC);
cpus[i].stack = (__u8 *) frame_alloc(STACK_FRAMES, FRAME_KA | FRAME_ATOMIC);
cpus[i].id = i;
/kernel/trunk/generic/src/mm/frame.c
959,9 → 959,6
}
}
if (!zone) {
if (flags & FRAME_PANIC)
panic("Can't allocate frame.\n");
/*
* TODO: Sleep until frames are available again.
*/
/kernel/trunk/arch/ia64/src/mm/vhpt.c
42,8 → 42,9
 
__address vhpt_set_up(void)
{
vhpt_base=(vhpt_entry_t*) frame_alloc(VHPT_WIDTH-FRAME_WIDTH,FRAME_KA);
if(!vhpt_base) panic("Kernel configured with VHPT but no memory for table.");
vhpt_base = frame_alloc(VHPT_WIDTH-FRAME_WIDTH,FRAME_KA | FRAME_ATOMIC);
if(!vhpt_base)
panic("Kernel configured with VHPT but no memory for table.");
vhpt_invalidate_all();
return (__address) vhpt_base;
}
/kernel/trunk/arch/ppc64/src/mm/page.c
274,7 → 274,7
}
/* Allocate page hash table */
phte_t *physical_phte = (phte_t *) frame_alloc(PHT_ORDER, FRAME_KA | FRAME_PANIC);
phte_t *physical_phte = (phte_t *) frame_alloc(PHT_ORDER, FRAME_KA | FRAME_ATOMIC);
ASSERT((__address) physical_phte % (1 << PHT_BITS) == 0);
pht_init();