From 1bca614d1109cf61c3a4b5d8ea8b489b5c82fcb3 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 5 Apr 2015 17:55:05 +0800 Subject: [PATCH] runtime: use UP/AMP terminology --- soc/runtime/Makefile | 6 ++++-- soc/runtime/comm_serial.c | 6 +++--- soc/runtime/exceptions.c | 4 ++-- soc/runtime/gen_service_table.py | 8 ++++---- soc/runtime/ksupport.ld | 2 +- soc/runtime/linker.ld | 2 +- soc/runtime/main.c | 10 +++++----- soc/runtime/test_mode.c | 6 +++--- 8 files changed, 23 insertions(+), 21 deletions(-) diff --git a/soc/runtime/Makefile b/soc/runtime/Makefile index 3ef30f3b4..ce173b506 100644 --- a/soc/runtime/Makefile +++ b/soc/runtime/Makefile @@ -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 \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 diff --git a/soc/runtime/comm_serial.c b/soc/runtime/comm_serial.c index a6d532817..7a29a8659 100644 --- a/soc/runtime/comm_serial.c +++ b/soc/runtime/comm_serial.c @@ -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) diff --git a/soc/runtime/exceptions.c b/soc/runtime/exceptions.c index e43901e04..1626989df 100644 --- a/soc/runtime/exceptions.c +++ b/soc/runtime/exceptions.c @@ -1,7 +1,7 @@ #include #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); diff --git a/soc/runtime/gen_service_table.py b/soc/runtime/gen_service_table.py index 3bcbe085b..5ef506abd 100755 --- a/soc/runtime/gen_service_table.py +++ b/soc/runtime/gen_service_table.py @@ -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) diff --git a/soc/runtime/ksupport.ld b/soc/runtime/ksupport.ld index da55618dd..bc6912f83 100644 --- a/soc/runtime/ksupport.ld +++ b/soc/runtime/ksupport.ld @@ -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); diff --git a/soc/runtime/linker.ld b/soc/runtime/linker.ld index 75513c922..fa988613c 100644 --- a/soc/runtime/linker.ld +++ b/soc/runtime/linker.ld @@ -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); diff --git a/soc/runtime/main.c b/soc/runtime/main.c index 946a5ad64..9b718ee0d 100644 --- a/soc/runtime/main.c +++ b/soc/runtime/main.c @@ -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(); diff --git a/soc/runtime/test_mode.c b/soc/runtime/test_mode.c index 655752693..82bbaff08 100644 --- a/soc/runtime/test_mode.c +++ b/soc/runtime/test_mode.c @@ -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 */