forked from M-Labs/artiq
1
0
Fork 0

runtime: disable kernel-CPU functions when kernel-CPU not present

This commit is contained in:
Sebastien Bourdeauducq 2015-04-02 17:00:59 +08:00
parent 4b66e3108a
commit f124350555
1 changed files with 4 additions and 0 deletions

View File

@ -305,6 +305,7 @@ static char *get_token(char **str)
return d; return d;
} }
#ifdef CSR_KERNEL_CPU_BASE
static const unsigned int test_program[] = { static const unsigned int test_program[] = {
0x1860dead, // l.movhi r3,0xdead 0x1860dead, // l.movhi r3,0xdead
0x1880d000, // l.movhi r4,0xd000 0x1880d000, // l.movhi r4,0xd000
@ -326,6 +327,7 @@ static void cputest(void)
for(i=0;i<10;i++) for(i=0;i<10;i++)
printf("%08x\n", MMPTR(0xd0000000)); printf("%08x\n", MMPTR(0xd0000000));
} }
#endif
static void do_command(char *c) static void do_command(char *c)
{ {
@ -349,7 +351,9 @@ static void do_command(char *c)
else if(strcmp(token, "ddsftw") == 0) ddsftw(get_token(&c), get_token(&c)); else if(strcmp(token, "ddsftw") == 0) ddsftw(get_token(&c), get_token(&c));
else if(strcmp(token, "ddstest") == 0) ddstest(get_token(&c)); else if(strcmp(token, "ddstest") == 0) ddstest(get_token(&c));
#ifdef CSR_KERNEL_CPU_BASE
else if(strcmp(token, "cputest") == 0) cputest(); else if(strcmp(token, "cputest") == 0) cputest();
#endif
else if(strcmp(token, "") != 0) else if(strcmp(token, "") != 0)
printf("Command not found\n"); printf("Command not found\n");