forked from M-Labs/artiq
runtime: use UP/AMP terminology
This commit is contained in:
parent
71b7fe38bc
commit
1bca614d11
|
@ -3,17 +3,19 @@ include $(MSCDIR)/software/common.mak
|
|||
OBJECTS_SERVICES=exception_jmp.o exceptions.o rtio.o dds.o
|
||||
OBJECTS=isr.o elf_loader.o services.o comm_serial.o test_mode.o main.o
|
||||
|
||||
# NOTE: this does not handle dependencies well. Run "make clean"
|
||||
# when switching between UP and AMP.
|
||||
UNIPROCESSOR := $(shell echo -e "\#include <generated/csr.h>\nCSR_KERNEL_CPU_BASE" | $(CC_normal) $(CFLAGS) -E - | tail -n 1 | grep -c CSR_KERNEL_CPU_BASE)
|
||||
|
||||
ifeq ($(UNIPROCESSOR),0)
|
||||
OBJECTS += kernelcpu.o ksupport_data.o
|
||||
CFLAGS += -DARTIQ_BIPROCESSOR
|
||||
CFLAGS += -DARTIQ_AMP
|
||||
SERVICE_TABLE_INPUT = ksupport.elf
|
||||
else
|
||||
ifeq ($(UNIPROCESSOR),1)
|
||||
OBJECTS += $(OBJECTS_SERVICES)
|
||||
else
|
||||
$(error failed to determine uniprocessor/biprocessor build)
|
||||
$(error failed to determine UP/AMP build)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ static void receive_and_run_kernel(kernel_runner run_kernel)
|
|||
send_char(MSGTYPE_KERNEL_EXCEPTION);
|
||||
send_int(eid);
|
||||
for(i=0;i<3;i++)
|
||||
#ifdef ARTIQ_BIPROCESSOR
|
||||
#ifdef ARTIQ_AMP
|
||||
#warning TODO
|
||||
send_llint(0LL);
|
||||
#else
|
||||
|
@ -177,7 +177,7 @@ void comm_serve(object_loader load_object, kernel_runner run_kernel)
|
|||
if(msgtype == MSGTYPE_REQUEST_IDENT) {
|
||||
send_char(MSGTYPE_IDENT);
|
||||
send_int(0x41524f52); /* "AROR" - ARTIQ runtime on OpenRISC */
|
||||
#ifdef ARTIQ_BIPROCESSOR
|
||||
#ifdef ARTIQ_AMP
|
||||
#warning TODO
|
||||
send_int(125*1000*1000);
|
||||
send_char(0);
|
||||
|
@ -265,7 +265,7 @@ int comm_rpc(int rpc_num, ...)
|
|||
eid = receive_int();
|
||||
retval = receive_int();
|
||||
|
||||
#ifdef ARTIQ_BIPROCESSOR
|
||||
#ifdef ARTIQ_AMP
|
||||
#warning TODO
|
||||
#else
|
||||
if(eid != EID_NONE)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <generated/csr.h>
|
||||
|
||||
#include "exceptions.h"
|
||||
#ifndef ARTIQ_BIPROCESSOR
|
||||
#ifndef ARTIQ_AMP
|
||||
#include "comm.h"
|
||||
#endif
|
||||
|
||||
|
@ -49,7 +49,7 @@ void exception_raise_params(int id,
|
|||
exception_params[2] = p2;
|
||||
exception_longjmp(exception_contexts[--ec_top].jb);
|
||||
} else {
|
||||
#ifdef ARTIQ_BIPROCESSOR
|
||||
#ifdef ARTIQ_AMP
|
||||
#warning TODO
|
||||
#else
|
||||
comm_log("ERROR: uncaught exception, ID=%d\n", id);
|
||||
|
|
|
@ -24,7 +24,7 @@ services = [
|
|||
]
|
||||
|
||||
|
||||
def print_uniprocessor():
|
||||
def print_up():
|
||||
for name, contents in services:
|
||||
print("static const struct symbol {}[] = {{".format(name))
|
||||
for name, value in contents:
|
||||
|
@ -33,7 +33,7 @@ def print_uniprocessor():
|
|||
print("};")
|
||||
|
||||
|
||||
def print_biprocessor(ksupport_elf_filename):
|
||||
def print_amp(ksupport_elf_filename):
|
||||
from elftools.elf.elffile import ELFFile
|
||||
with open(ksupport_elf_filename, "rb") as f:
|
||||
elf = ELFFile(f)
|
||||
|
@ -51,9 +51,9 @@ def print_biprocessor(ksupport_elf_filename):
|
|||
|
||||
def main():
|
||||
if len(sys.argv) == 1:
|
||||
print_uniprocessor()
|
||||
print_up()
|
||||
elif len(sys.argv) == 2:
|
||||
print_biprocessor(sys.argv[1])
|
||||
print_amp(sys.argv[1])
|
||||
else:
|
||||
print("Incorrect number of command line arguments")
|
||||
sys.exit(1)
|
||||
|
|
|
@ -10,7 +10,7 @@ MEMORY {
|
|||
ksupport : ORIGIN = 0x40020000, LENGTH = 0x4000
|
||||
}
|
||||
|
||||
/* On biprocessor systems, kernel stack is at the end of main RAM,
|
||||
/* On AMP systems, kernel stack is at the end of main RAM,
|
||||
* before the runtime stack. Leave 1M for runtime stack.
|
||||
*/
|
||||
PROVIDE(_fstack = 0x40000000 + LENGTH(main_ram) - 1024*1024 - 4);
|
||||
|
|
|
@ -13,7 +13,7 @@ MEMORY {
|
|||
/* Kernel memory space start right after the runtime,
|
||||
* and ends before the runtime stack.
|
||||
* Runtime stack is always at the end of main_ram.
|
||||
* This stack is shared with the kernel on uniprocessor systems.
|
||||
* This stack is shared with the kernel on UP systems.
|
||||
*/
|
||||
PROVIDE(_fstack = 0x40000000 + LENGTH(main_ram) - 4);
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ typedef void (*kernel_function)(void);
|
|||
static int run_kernel(const char *kernel_name, int *eid)
|
||||
{
|
||||
kernel_function k;
|
||||
#ifndef ARTIQ_BIPROCESSOR
|
||||
#ifndef ARTIQ_AMP
|
||||
void *jb;
|
||||
#endif
|
||||
|
||||
|
@ -78,7 +78,7 @@ static int run_kernel(const char *kernel_name, int *eid)
|
|||
return KERNEL_RUN_STARTUP_FAILED;
|
||||
}
|
||||
|
||||
#ifdef ARTIQ_BIPROCESSOR
|
||||
#ifdef ARTIQ_AMP
|
||||
kernelcpu_start(k);
|
||||
*eid = 0;
|
||||
while(1) {
|
||||
|
@ -146,10 +146,10 @@ int main(void)
|
|||
irq_setie(1);
|
||||
uart_init();
|
||||
|
||||
#ifdef ARTIQ_BIPROCESSOR
|
||||
puts("ARTIQ runtime built "__DATE__" "__TIME__" for biprocessor systems\n");
|
||||
#ifdef ARTIQ_AMP
|
||||
puts("ARTIQ runtime built "__DATE__" "__TIME__" for AMP systems\n");
|
||||
#else
|
||||
puts("ARTIQ runtime built "__DATE__" "__TIME__" for uniprocessor systems\n");
|
||||
puts("ARTIQ runtime built "__DATE__" "__TIME__" for UP systems\n");
|
||||
#endif
|
||||
blink_led();
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
#include "rtio.h"
|
||||
#include "dds.h"
|
||||
|
||||
#ifdef ARTIQ_BIPROCESSOR
|
||||
#ifdef ARTIQ_AMP
|
||||
|
||||
#warning TODO
|
||||
|
||||
void test_main(void)
|
||||
{
|
||||
printf("Not implemented yet for biprocessor systems\n");
|
||||
printf("Not implemented yet for AMP systems\n");
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -353,4 +353,4 @@ void test_main(void)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* ARTIQ_BIPROCESSOR */
|
||||
#endif /* ARTIQ_AMP */
|
||||
|
|
Loading…
Reference in New Issue