/kernel/trunk/generic/include/mm/frame.h |
---|
61,6 → 61,15 |
#define FRAME_NO_MEMORY 1 /* frame_alloc return status */ |
#define FRAME_ERROR 2 /* frame_alloc return status */ |
/* Return true if the interlvals overlap */ |
static inline int overlaps(__address s1,__address sz1, __address s2, __address sz2) |
{ |
__address e1 = s1+sz1; |
__address e2 = s2+sz2; |
return s1 < e2 && s2 < e1; |
} |
static inline __address PFN2ADDR(pfn_t frame) |
{ |
return (__address)(frame << FRAME_WIDTH); |
/kernel/trunk/generic/include/macros.h |
---|
39,15 → 39,4 |
#define min(a,b) ((a)<(b)?(a):(b)) |
#define max(a,b) ((a)>(b)?(a):(b)) |
/* Return true if the interlvals overlap */ |
static inline int overlaps(__address s1,size_t sz1, __address s2, size_t sz2) |
{ |
__address e1 = s1+sz1; |
__address e2 = s2+sz2; |
return s1 < e2 && s2 < e1; |
} |
/* Compute overlapping of physical addresses */ |
#define PA_overlaps(x,szx,y,szy) overlaps(KA2PA(x),szx,KA2PA(y), szy) |
#endif |
/kernel/trunk/generic/src/main/main.c |
---|
55,7 → 55,6 |
#include <arch/faddr.h> |
#include <typedefs.h> |
#include <ipc/ipc.h> |
#include <macros.h> |
#ifdef CONFIG_SMP |
#include <arch/smp/apic.h> |
117,7 → 116,7 |
count_t i; |
bool overlap = false; |
for (i = 0; i < init.cnt; i++) |
if (PA_overlaps(stackaddr, CONFIG_STACK_SIZE, init.tasks[i].addr, init.tasks[i].size)) { |
if (overlaps(stackaddr, CONFIG_STACK_SIZE, init.tasks[i].addr, init.tasks[i].size)) { |
stackaddr = ALIGN_UP(init.tasks[i].addr + init.tasks[i].size, CONFIG_STACK_SIZE); |
init.tasks[i].size = ALIGN_UP(init.tasks[i].size, CONFIG_STACK_SIZE) + CONFIG_STACK_SIZE; |
overlap = true; |
/kernel/trunk/generic/src/ipc/sysipc.c |
---|
164,6 → 164,7 |
} else if (IPC_GET_METHOD(*olddata) == IPC_M_CONNECTMETO) { |
/* If the users accepted call, connect */ |
if (!IPC_GET_RETVAL(answer->data)) { |
printf("Connecting Phone %P\n",IPC_GET_ARG3(*olddata)); |
ipc_phone_connect((phone_t *)IPC_GET_ARG3(*olddata), |
&TASK->answerbox); |
} |
/kernel/trunk/generic/src/mm/frame.c |
---|
51,7 → 51,6 |
#include <align.h> |
#include <mm/slab.h> |
#include <bitops.h> |
#include <macros.h> |
typedef struct { |
count_t refcount; /**< tracking of shared frames */ |