/SPARTAN/trunk/src/Makefile.config |
---|
34,3 → 34,4 |
#TEST_DIR=synch/semaphore2/ |
#TEST_DIR=fpu/fpu1 |
#TEST_DIR=print/print1 |
TEST_DIR=thread/thread1 |
/SPARTAN/trunk/src/main/kinit.c |
---|
40,6 → 40,7 |
#include <mm/page.h> |
#include <arch/mm/page.h> |
#include <mm/vm.h> |
#include <print.h> |
#ifdef __SMP__ |
#include <arch/smp/mps.h> |
/SPARTAN/trunk/src/main/uinit.c |
---|
30,7 → 30,9 |
#include <arch/types.h> |
#include <proc/thread.h> |
#include <userspace.h> |
#include <print.h> |
void uinit(void *arg) |
{ |
printf("USER task, uinit thread: kernel mode\n"); |
/SPARTAN/trunk/src/synch/spinlock.c |
---|
31,6 → 31,7 |
#include <arch/atomic.h> |
#include <arch/barrier.h> |
#include <synch/spinlock.h> |
#include <print.h> |
#ifdef __SMP__ |
/SPARTAN/trunk/src/synch/semaphore.c |
---|
31,6 → 31,7 |
#include <synch/waitq.h> |
#include <synch/spinlock.h> |
#include <arch/asm.h> |
#include <arch.h> |
void semaphore_initialize(semaphore_t *s, int val) |
{ |
/SPARTAN/trunk/src/debug/print.c |
---|
31,6 → 31,7 |
#include <synch/spinlock.h> |
#include <arch/arg.h> |
#include <arch/asm.h> |
#include <arch.h> |
static char digits[] = "0123456789abcdef"; /**< Hexadecimal characters */ |
/SPARTAN/trunk/src/proc/scheduler.c |
---|
43,7 → 43,11 |
#include <synch/spinlock.h> |
#include <arch/faddr.h> |
#include <arch/atomic.h> |
#include <print.h> |
#include <mm/frame.h> |
#include <mm/heap.h> |
volatile int nrdy; |
357,8 → 361,9 |
} |
THREAD = NULL; |
} |
printf("*0*"); |
THREAD = find_best_thread(); |
printf("*1*"); |
spinlock_lock(&THREAD->lock); |
priority = THREAD->pri; |
/SPARTAN/trunk/src/proc/thread.c |
---|
50,6 → 50,7 |
#include <smp/ipi.h> |
#include <arch/faddr.h> |
#include <arch/atomic.h> |
#include <memstr.h> |
char *thread_states[] = {"Invalid", "Running", "Sleeping", "Ready", "Entering", "Exiting"}; /**< Thread states */ |
/SPARTAN/trunk/src/lib/memstr.c |
---|
41,12 → 41,16 |
* @param cnt Number of bytes to copy. |
* |
*/ |
void _memcopy(__address src, __address dst, size_t cnt) |
char * _memcopy(void * dst,const void *src, size_t cnt); |
char * _memcopy(void * dst,const void *src, size_t cnt) |
{ |
int i; |
for (i=0; i<cnt; i++) |
*((__u8 *) (dst + i)) = *((__u8 *) (src + i)); |
return (char *)src; |
} |
/SPARTAN/trunk/src/mm/vm.c |
---|
40,6 → 40,8 |
#include <panic.h> |
#include <arch/asm.h> |
#include <debug.h> |
#include <memstr.h> |
#include <arch.h> |
#define KAS_START_INDEX PTL0_INDEX(KERNEL_ADDRESS_SPACE_START) |
#define KAS_END_INDEX PTL0_INDEX(KERNEL_ADDRESS_SPACE_END) |
66,7 → 68,7 |
dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC); |
// memsetb((__address) dst_ptl0, PAGE_SIZE, 0); |
// memcopy((__address) &src_ptl0[KAS_START_INDEX], (__address) &dst_ptl0[KAS_START_INDEX], KAS_INDICES*sizeof(pte_t)); |
memcopy(PA2KA((__address) GET_PTL0_ADDRESS()), (__address) dst_ptl0, PAGE_SIZE); |
memcopy((void *)PA2KA((__address) dst_ptl0), (void *)GET_PTL0_ADDRESS() , PAGE_SIZE); |
m->ptl0 = (pte_t *) KA2PA((__address) dst_ptl0); |
} |
} |
/SPARTAN/trunk/src/mm/frame.c |
---|
43,6 → 43,7 |
#include <synch/spinlock.h> |
#include <arch/asm.h> |
#include <arch.h> |
count_t frames = 0; |
count_t frames_free; |
/SPARTAN/trunk/src/mm/page.c |
---|
32,7 → 32,9 |
#include <arch/types.h> |
#include <typedefs.h> |
#include <arch/asm.h> |
#include <memstr.h> |
void page_init(void) |
{ |
page_arch_init(); |
/SPARTAN/trunk/src/mm/heap.c |
---|
33,6 → 33,7 |
#include <panic.h> |
#include <arch/types.h> |
#include <arch/asm.h> |
#include <arch.h> |
/* |
* First-fit algorithm. |