Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1137 → Rev 1138

/kernel/trunk/contrib/conf/msim.conf
5,8 → 5,8
add dcpu mips1
 
add rwm mainmem 0x0 8M load "/dev/zero"
add rom startmem 0x1fc00000 1024k load "image.boot"
add rwm init 0x01000000 1M load "init"
add rom startmem 0x1fc00000 1024k load "image.boot"
add rwm init 0x01000000 1M load "init"
 
add dprinter printer 0x10000000
add dkeyboard keyboard 0x10000000 2
/kernel/trunk/generic/include/config.h
36,7 → 36,7
#define STACK_SIZE PAGE_SIZE
 
#define CONFIG_MEMORY_SIZE (8 * 1024 * 1024)
#define CONFIG_STACK_SIZE STACK_SIZE
 
#define CONFIG_INIT_TASKS 32
 
typedef struct {
/kernel/trunk/generic/include/mm/frame.h
47,10 → 47,9
#define STACK_FRAMES ONE_FRAME
#endif
 
 
#define ZONES_MAX 16 /**< Maximum number of zones in system */
 
#define ZONE_JOIN 0x1 /**< If possible, merge with neighberhood zones */
#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 */
/kernel/trunk/generic/src/proc/thread.c
266,7 → 266,7
return NULL;
/* Not needed, but good for debugging */
memsetb((__address)t->kstack, THREAD_STACK_SIZE, 0);
memsetb((__address)t->kstack, THREAD_STACK_SIZE * 1<<STACK_FRAMES, 0);
ipl = interrupts_disable();
spinlock_lock(&tidlock);
/kernel/trunk/generic/src/main/main.c
92,6 → 92,8
static void main_ap_separated_stack(void);
#endif
 
#define CONFIG_STACK_SIZE ((1<<STACK_FRAMES)*STACK_SIZE)
 
/** Bootstrap CPU main kernel routine
*
* Initializes the kernel by bootstrap CPU.
128,8 → 130,7
config.kernel_size += CONFIG_STACK_SIZE;
context_save(&ctx);
context_set(&ctx, FADDR(main_bsp_separated_stack),
stackaddr, CONFIG_STACK_SIZE);
context_set(&ctx, FADDR(main_bsp_separated_stack), stackaddr, THREAD_STACK_SIZE);
context_restore(&ctx);
/* not reached */
}
/kernel/trunk/generic/src/cpu/cpu.c
62,7 → 62,7
memsetb((__address) cpus, sizeof(cpu_t) * config.cpu_count, 0);
 
for (i=0; i < config.cpu_count; i++) {
cpus[i].stack = (__u8 *) PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA | FRAME_PANIC)));
cpus[i].stack = (__u8 *) PA2KA(PFN2ADDR(frame_alloc(STACK_FRAMES, FRAME_KA | FRAME_PANIC)));
cpus[i].id = i;
/kernel/trunk/arch/ia64/include/mm/tlb.h
41,7 → 41,8
/** Data and instruction Translation Register indices. */
#define DTR_KERNEL 0
#define ITR_KERNEL 0
#define DTR_KSTACK 1
#define DTR_KSTACK1 1
#define DTR_KSTACK2 2
 
/** Portion of TLB insertion format data structure. */
union tlb_entry {
/kernel/trunk/arch/ia64/include/context.h
36,7 → 36,7
#include <arch/stack.h>
 
/*
* context_save() and context_restore() are both leaf procedures.
* context_save_arch() and context_restore_arch() are both leaf procedures.
* No need to allocate scratch area.
*
* One item is put onto the stack to support get_stack_base().
47,12 → 47,14
#undef context_set
#endif
 
/*RSE stack should begin under bottom of stack @ kernel*/
#define context_set(c, _pc, stack, size) \
(c)->pc = (__address) _pc; \
(c)->bsp = ((__address) stack) + ALIGN_UP((size), STACK_ALIGNMENT) ; \
(c)->ar_pfs &= PFM_MASK; \
(c)->sp = ((__address) stack) + ALIGN_UP((size), STACK_ALIGNMENT) - SP_DELTA;
/* RSE stack starts at the bottom of memory stack. */
#define context_set(c, _pc, stack, size) \
do { \
(c)->pc = (__address) _pc; \
(c)->bsp = ((__address) stack) + ALIGN_UP((size), REGISTER_STACK_ALIGNMENT); \
(c)->ar_pfs &= PFM_MASK; \
(c)->sp = ((__address) stack) + ALIGN_UP((size), STACK_ALIGNMENT) - SP_DELTA; \
} while (0);
 
/*
* Only save registers that must be preserved across
122,6 → 124,4
ipl_t ipl;
};
 
 
 
#endif
/kernel/trunk/arch/ia64/src/ivt.S
32,11 → 32,8
#include <arch/mm/page.h>
#include <align.h>
 
 
#define FRS_TO_SAVE 30
#define STACK_ITEMS (19 + FRS_TO_SAVE*2)
//#define STACK_ITEMS 19
/* 30*2 for FPU registers */
#define STACK_FRAME_SIZE ALIGN_UP((STACK_ITEMS*STACK_ITEM_SIZE) + STACK_SCRATCH_AREA_SIZE, STACK_ALIGNMENT)
 
#if (STACK_ITEMS % 2 == 0)
/kernel/trunk/arch/ia64/src/proc/scheduler.c
43,12 → 43,13
base = ALIGN_DOWN(config.base, 1<<KERNEL_PAGE_WIDTH);
 
if ((__address) THREAD->kstack < base || (__address) THREAD->kstack > base + (1<<KERNEL_PAGE_WIDTH)) {
if ((__address) THREAD->kstack < base || (__address) THREAD->kstack > base + (1<<(KERNEL_PAGE_WIDTH))) {
/*
* Kernel stack of this thread is not mapped by DTR[TR_KERNEL].
* Use DTR[TR_KSTACK] to map it.
* Use DTR[TR_KSTACK1] and DTR[TR_KSTACK2] to map it.
*/
dtlb_kernel_mapping_insert((__address) THREAD->kstack, KA2PA(THREAD->kstack), true, DTR_KSTACK);
dtlb_kernel_mapping_insert((__address) THREAD->kstack, KA2PA(THREAD->kstack), true, DTR_KSTACK1);
dtlb_kernel_mapping_insert((__address) THREAD->kstack + PAGE_SIZE, KA2PA(THREAD->kstack) + FRAME_SIZE, true, DTR_KSTACK2);
}
/*