add func do_mod_exit

Conflicts:

	kernel/syscall.c
This commit is contained in:
simin
2012-11-29 14:01:26 +09:00
parent 092069fd80
commit 9fd7f3ddf7
2 changed files with 35 additions and 3 deletions

View File

@ -233,7 +233,7 @@ void aal_mc_map_micpa(unsigned long host_pa, unsigned long* mic_pa) {
break;
}
}
dkprintf("aal_mc_map_micpa,1,i=%d,host_pa=%lx,mic_pa=%llx\n", i, host_pa, *mic_pa);
kprintf("aal_mc_map_micpa,1,i=%d,host_pa=%lx,mic_pa=%llx\n", i, host_pa, *mic_pa);
if(i == NUM_SMPT_ENTRIES_IN_USE - NUM_SMPT_ENTRIES_MICPA - 1) {
*mic_pa = 0;
return;
@ -250,10 +250,15 @@ int aal_mc_free_micpa(unsigned long mic_pa) {
return -1;
}
free_bitmap_micpa |= (1ULL << smpt_ndx);
dkprintf("aal_mc_free_micpa,index=%d,freed\n", smpt_ndx);
kprintf("aal_mc_free_micpa,index=%d,freed\n", smpt_ndx);
return 0;
}
void aal_mc_clean_micpa(void){
free_bitmap_micpa = ((~((1ULL<<(NUM_SMPT_ENTRIES_IN_USE - NUM_SMPT_ENTRIES_MICPA))-1))&((1ULL << NUM_SMPT_ENTRIES_IN_USE) - 1));
kprintf("aal_mc_clean_micpa\n");
}
void mem_init(void)
{
page_allocator_init();

View File

@ -38,6 +38,11 @@ static aal_atomic_t pid_cnt = AAL_ATOMIC_INIT(1024);
int memcpy_async(unsigned long dest, unsigned long src,
unsigned long len, int wait, unsigned long *notify);
#ifdef DCFA_KMOD
static void do_mod_exit(int status);
#endif
static void send_syscall(struct syscall_request *req)
{
struct ikc_scd_packet packet;
@ -343,8 +348,12 @@ SYSCALL_DECLARE(lseek)
SYSCALL_DECLARE(exit_group)
{
SYSCALL_HEADER;
do_syscall(&request, ctx);
#ifdef DCFA_KMOD
do_mod_exit((int)aal_mc_syscall_arg0(ctx));
#endif
do_syscall(&request, ctx);
runq_del_proc(cpu_local_var(current), aal_mc_get_processor_id());
free_process_memory(cpu_local_var(current));
@ -952,6 +961,10 @@ SYSCALL_DECLARE(futex)
SYSCALL_DECLARE(exit)
{
#ifdef DCFA_KMOD
do_mod_exit((int)aal_mc_syscall_arg0(ctx));
#endif
/* If there is a clear_child_tid address set, clear it and wake it.
* This unblocks any pthread_join() waiters. */
if (cpu_local_var(current)->thread.clear_child_tid) {
@ -1058,12 +1071,18 @@ SYSCALL_DECLARE(noop)
extern int ibmic_cmd_syscall(char *uargs);
extern int dcfampi_cmd_syscall(char *uargs);
extern void ibmic_cmd_exit(int status);
static int (*mod_call_table[]) (char *) = {
[1] = ibmic_cmd_syscall,
[2] = dcfampi_cmd_syscall,
};
static void (*mod_exit_table[]) (int) = {
[1] = ibmic_cmd_exit,
[2] = NULL,
};
SYSCALL_DECLARE(mod_call) {
int mod_id;
unsigned long long uargs;
@ -1078,6 +1097,14 @@ SYSCALL_DECLARE(mod_call) {
return -ENOSYS;
}
static void do_mod_exit(int status){
int i;
for(i=1; i<=2; i++){
if(mod_exit_table[i])
mod_exit_table[i](status);
}
}
#endif
SYSCALL_DECLARE(process_data_section) {