init functions changed
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include <aal/mm.h>
|
#include <aal/mm.h>
|
||||||
#include <aal/debug.h>
|
#include <aal/debug.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
#include <init.h>
|
||||||
|
|
||||||
int num_processors = 1;
|
int num_processors = 1;
|
||||||
static volatile int ap_stop = 1;
|
static volatile int ap_stop = 1;
|
||||||
@@ -21,10 +22,10 @@ static void ap_wait(void)
|
|||||||
barrier();
|
barrier();
|
||||||
cpu_pause();
|
cpu_pause();
|
||||||
}
|
}
|
||||||
kprintf("ap started.\n");
|
|
||||||
kmalloc_init();
|
kmalloc_init();
|
||||||
sched_init();
|
sched_init();
|
||||||
/* init_host_syscall_channel(); */
|
/* init_host_syscall_channel(); */
|
||||||
|
pc_ap_init();
|
||||||
|
|
||||||
schedule();
|
schedule();
|
||||||
}
|
}
|
||||||
|
|||||||
19
kernel/include/init.h
Normal file
19
kernel/include/init.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#ifndef INIT_H
|
||||||
|
#define INIT_H
|
||||||
|
|
||||||
|
extern void arch_init(void);
|
||||||
|
extern void kmsg_init(void);
|
||||||
|
extern void mem_init(void);
|
||||||
|
extern void ikc_master_init(void);
|
||||||
|
extern void ap_init(void);
|
||||||
|
extern void arch_ready(void);
|
||||||
|
extern void mc_ikc_init(void);
|
||||||
|
extern void cpu_local_var_init(void);
|
||||||
|
extern void kmalloc_init(void);
|
||||||
|
extern void ap_start(void);
|
||||||
|
extern void aal_mc_dma_init(void);
|
||||||
|
extern void init_host_syscall_channel(void);
|
||||||
|
extern void sched_init(void);
|
||||||
|
extern void pc_ap_init(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -7,24 +7,11 @@
|
|||||||
#include <aal/dma.h>
|
#include <aal/dma.h>
|
||||||
#include <aal/perfctr.h>
|
#include <aal/perfctr.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
#include <init.h>
|
||||||
#include <cls.h>
|
#include <cls.h>
|
||||||
|
|
||||||
extern struct aal_kmsg_buf kmsg_buf;
|
extern struct aal_kmsg_buf kmsg_buf;
|
||||||
|
|
||||||
extern void arch_init(void);
|
|
||||||
extern void kmsg_init(void);
|
|
||||||
extern void mem_init(void);
|
|
||||||
extern void ikc_master_init(void);
|
|
||||||
extern void ap_init(void);
|
|
||||||
extern void arch_ready(void);
|
|
||||||
extern void mc_ikc_init(void);
|
|
||||||
extern void cpu_local_var_init(void);
|
|
||||||
extern void kmalloc_init(void);
|
|
||||||
extern void ap_start(void);
|
|
||||||
extern void aal_mc_dma_init(void);
|
|
||||||
extern void init_host_syscall_channel(void);
|
|
||||||
extern void sched_init(void);
|
|
||||||
|
|
||||||
extern long syscall(int, aal_mc_user_context_t *);
|
extern long syscall(int, aal_mc_user_context_t *);
|
||||||
|
|
||||||
static void handler_init(void)
|
static void handler_init(void)
|
||||||
@@ -77,15 +64,16 @@ char *find_command_line(char *name)
|
|||||||
return strstr(cmdline, name);
|
return strstr(cmdline, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pc_test(void)
|
void pc_init(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int kmode = PERFCTR_KERNEL_MODE;
|
int kmode = PERFCTR_KERNEL_MODE;
|
||||||
int imode = 1;
|
int imode = 1;
|
||||||
char *p;
|
char *p;
|
||||||
int x[2][4] = { { APT_TYPE_L1D_REQUEST,
|
|
||||||
|
int x[2][4] = { { APT_TYPE_INSTRUCTIONS,
|
||||||
APT_TYPE_L1D_MISS,
|
APT_TYPE_L1D_MISS,
|
||||||
APT_TYPE_L2_MISS, APT_TYPE_INSTRUCTIONS, },
|
APT_TYPE_L2_MISS, APT_TYPE_L1I_MISS, },
|
||||||
{ APT_TYPE_L1I_MISS, APT_TYPE_LLC_MISS,
|
{ APT_TYPE_L1I_MISS, APT_TYPE_LLC_MISS,
|
||||||
APT_TYPE_STALL, APT_TYPE_CYCLE },
|
APT_TYPE_STALL, APT_TYPE_CYCLE },
|
||||||
};
|
};
|
||||||
@@ -110,6 +98,29 @@ static void pc_test(void)
|
|||||||
aal_mc_perfctr_start(0xf);
|
aal_mc_perfctr_start(0xf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pc_ap_init(void)
|
||||||
|
{
|
||||||
|
pc_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void pc_test(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
unsigned long st[4], ed[4];
|
||||||
|
|
||||||
|
pc_init();
|
||||||
|
|
||||||
|
aal_mc_perfctr_read_mask(0xf, st);
|
||||||
|
for (i = 0; i < sizeof(data) / sizeof(data[0]); i++) {
|
||||||
|
data[i] += i;
|
||||||
|
asm volatile ("" : : : "memory");
|
||||||
|
}
|
||||||
|
aal_mc_perfctr_read_mask(0xf, ed);
|
||||||
|
|
||||||
|
kprintf("perfctr:(%ld) %ld, %ld, %ld, %ld\n", st[0], ed[0] - st[0],
|
||||||
|
ed[1] - st[1], ed[2] - st[2], ed[3] - st[3]);
|
||||||
|
}
|
||||||
|
|
||||||
static void rest_init(void)
|
static void rest_init(void)
|
||||||
{
|
{
|
||||||
handler_init();
|
handler_init();
|
||||||
|
|||||||
Reference in New Issue
Block a user