Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions kernel/power/apcr/simple_test/Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
EXEC = test.elf
OBJS += test.o

H2DIR=${UPDIR}../../../..

include ${H2DIR}/scripts/Makefile.inc.test
include $(H2DIR)/scripts/Makefile.inc.tools
include Makefile.inc

ifeq ($(INSTALLPATH),)
export INSTALLPATH := $(H2DIR)/install
endif

ifeq ($(KERNELPATH),)
export KERNELPATH := $(H2DIR)/kernel
endif

H2K_KERNEL_PGSIZE := 2
H2K_ALLOC_HEAP_SIZE := 0x1000

BOOTVM_PROG := .test.elf

ifeq ($(TARGET), rtl)
CRT0_S := $(INSTALLPATH)/src/min_crt0.S
CRT0_O := min_crt0.o
NOSTARTFILES := -nostartfiles
EXTRA_CFLAGS += -DRTL
else
EXTRA_CFLAGS += -DDEBUG
endif


CFLAGS = $(OPTIMIZE) -mv$(TOOLARCH) -DARCHV=$(ARCHV) -Wall -Werror -g -I$(INSTALLPATH)/include -I$(KERNELPATH)/include $(EXTRA_CFLAGS)
LDFLAGS = -nostartfiles -L$(INSTALLPATH)/lib -moslib=h2 -Qunused-arguments
CFLAGS := $(OPTIMIZE) -mv$(TOOLARCH) -DARCHV=$(ARCHV) -Wall -Werror -g -I$(INSTALLPATH)/include -I$(KERNELPATH)/include -Wno-builtin-requires-header $(EXTRA_CFLAGS)
BOOTVM_LDFLAGS = $(NOSTARTFILES) -L$(INSTALLPATH)/lib -moslib=h2 -Qunused-arguments

all: $(BOOTVM_PROG)

include $(H2DIR)/scripts/Makefile.inc.config
include $(H2DIR)/scripts/Makefile.inc.opensource
include $(H2DIR)/scripts/Makefile.inc.bootvm

CLEANUP += *.elf $(BOOTVM_CLEAN) hello stats.* *.o pmu_statsfile.txt

$(BOOTVM_IMAGE): LDFLAGS = $(BOOTVM_LDFLAGS)
$(BOOTVM_PROG_TMP): LDFLAGS = $(BOOTVM_LDFLAGS)
$(BOOTVM_PROG): LDFLAGS = $(BOOTVM_LDFLAGS)

$(BOOTVM_IMAGE): test.o $(CRT0_O) $(BOOTVM_IMAGE_DEPS)
${CC} $(LDFLAGS) $(CFLAGS) $(BOOTVM_IMAGE_CFLAGS) -Wl,--defsym=HEAP_SIZE=0x10000 -Wl,--defsym=STACK_SIZE=0x1000 -o $@ test.o $(CRT0_O) $(BOOTVM_ENTRY_O)
${CC} $(LDFLAGS) $(CFLAGS) $(BOOTVM_IMAGE_CFLAGS) -Wl,--defsym=HEAP_SIZE=0x10000 -Wl,--defsym=STACK_SIZE=0x1000 -Wl,--defsym=__h2_thread_stop_hook__=0xfffffff0 -o $@ test.o $(CRT0_O) $(BOOTVM_ENTRY_O) 2>&1 | perl -pe 's/.*Symbol.*__h2_.*_hook__.*is defined in both linker script and input file.*//';


# This bit of stupidity is needed to suppress warnings about changing the
# recipe for test.elf
Expand Down
7 changes: 3 additions & 4 deletions kernel/power/apcr/simple_test/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Not an H2 regression test (for now?)

# # Need to define how to get back to the main H2 dir
# H2DIR=${UPDIR}../../../..

# # Everything else defined here
# include ${H2DIR}/scripts/Makefile.inc.test
H2DIR=${UPDIR}../../../..
# Everything else defined here
include ${H2DIR}/scripts/Makefile.inc.test
28 changes: 18 additions & 10 deletions kernel/power/apcr/simple_test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,46 @@
*/

#include <h2.h>
/* #include <h2_cache.h> */
/* #include <h2_intwait.h> */
/* #include <h2_thread.h> */
#include <stdio.h>
#include <stdlib.h>

#ifndef DEBUG
#ifdef RTL
#define ITERS 1
#ifndef INTERRUPT_NUM
#define INTERRUPT_NUM 3
#endif
#else
#define ITERS 2
#ifndef INTERRUPT_NUM
#define INTERRUPT_NUM 5
#define HAVE_TIMER
#endif

#ifdef HAVE_TIMER
#define SLEEP (1000*1000*5)
#endif

#define PASSFAIL_VA 0x01000000
#define PASSFAIL_VA (H2K_GUEST_START + 0x01000000)

int main()
int main()
{
int i;
unsigned int *sigil = (void *)(PASSFAIL_VA);

for (i = 0; i < ITERS; i++) {
#ifdef HAVE_TIMER
h2_nanosleep(SLEEP);
#else
h2_intwait(INTERRUPT_NUM);

#ifdef DEBUG
#endif
#ifndef RTL
*sigil = i + 1;
#endif
}
*sigil = 0xe0f0beef;
h2_dccleana(sigil);
#ifndef RTL
printf("TEST PASSED\n");
exit(0);
#endif
h2_thread_stop_trap(0);
return 0;
}
Expand Down
12 changes: 5 additions & 7 deletions kernel/power/apcr/test_multi/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
EXEC = test.elf
OBJS += test.o
#OBJS += $(BOOTVM_ENTRY_O)

include Makefile.inc


ifeq ($(INSTALLPATH),)
export INSTALLPATH := $(H2DIR)/install
endif

# ifeq ($(KERNELPATH),)
# export KERNELPATH := $(H2DIR)/kernel
# endif

H2K_KERNEL_PGSIZE := 2

BOOTVM_PROG := .test.elf
Expand All @@ -26,15 +22,17 @@ EXTRA_CFLAGS += -DDEBUG
endif

CFLAGS := $(OPTIMIZE) -mv$(TOOLARCH) -DARCHV=$(ARCHV) -Wall -Werror -g -I$(INSTALLPATH)/include -I$(KERNELPATH)/include -Wno-builtin-requires-header $(EXTRA_CFLAGS)
LDFLAGS = $(NOSTARTFILES) -L$(INSTALLPATH)/lib -moslib=h2 -Qunused-arguments

BOOTVM_LDFLAGS = $(NOSTARTFILES) -L$(INSTALLPATH)/lib -moslib=h2 -Qunused-arguments

all: $(BOOTVM_PROG)

include $(H2DIR)/scripts/Makefile.inc.bootvm

CLEANUP += *.elf $(BOOTVM_CLEAN) hello stats.* *.o pmu_statsfile.txt

$(BOOTVM_IMAGE): LDFLAGS = $(BOOTVM_LDFLAGS)
$(BOOTVM_PROG_TMP): LDFLAGS = $(BOOTVM_LDFLAGS)
$(BOOTVM_PROG): LDFLAGS = $(BOOTVM_LDFLAGS)

$(BOOTVM_IMAGE): test.o $(CRT0_O) $(BOOTVM_IMAGE_DEPS)
${CC} $(LDFLAGS) $(CFLAGS) $(BOOTVM_IMAGE_CFLAGS) -Wl,--defsym=HEAP_SIZE=0x10000 -Wl,--defsym=STACK_SIZE=0x1000 -Wl,--defsym=__h2_thread_stop_hook__=0xfffffff0 -o $@ test.o $(CRT0_O) $(BOOTVM_ENTRY_O) 2>&1 | perl -pe 's/.*Symbol.*__h2_.*_hook__.*is defined in both linker script and input file.*//';
Expand Down
5 changes: 4 additions & 1 deletion libs/h2/vmtraps/test/test_pcycles/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
#elif ARCHV == 5
#define PCYCLES_PER_TCYCLE 3
#define OVERHEAD 1536
#elif ARCHV == 60
#elif ARCHV >= 68
#define PCYCLES_PER_TCYCLE 3
#define OVERHEAD 1536
#elif ARCHV >= 60
#define PCYCLES_PER_TCYCLE 2
#define OVERHEAD 1536
#else
Expand Down
26 changes: 13 additions & 13 deletions scripts/testlist.v61
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
./kernel/mem/tlbmisc/test
./kernel/mem/tlbmiss/test
#./kernel/mem/varadix/test FIXME: needs to adapt to different kernel page size/count
#./kernel/power/apcr/test_multi FIXME: needs changes to work with new ${EXEC}_tmp make target
./kernel/power/apcr/test_multi
./kernel/power/hvx/test
#./kernel/power/apcr/simple_test
./kernel/power/apcr/simple_test
./kernel/sched/check_sanity/test/tests/H2K_check_sanity/scenarios
./kernel/sched/dosched/test/test
./kernel/futex/futex/test/tests/badaccess
Expand Down Expand Up @@ -82,17 +82,17 @@
./kernel/vm/vmmap/test
./kernel/vm/vmcache/test

#./libs/h2/alloc/test
#./libs/h2/allsignal/test/simple
#./libs/h2/allsignal/test/trapfails
#./libs/h2/anysignal/test/simple
#./libs/h2/anysignal/test/trapfails
#./libs/h2/error/test/simple
#./libs/h2/sem/test/simple
#./libs/h2/sleep/test
#./libs/h2/vmtraps/test/test_ie
#./libs/h2/vmtraps/test/test_pcycles
#./libs/h2/vmtraps/test/test_return
./libs/h2_compat/alloc/test
./libs/h2_compat/allsignal/test/simple
./libs/h2_compat/allsignal/test/trapfails
./libs/h2_compat/anysignal/test/simple
./libs/h2_compat/anysignal/test/trapfails
./libs/h2_compat/error/test/simple
./libs/h2_compat/sem/test/simple
./libs/h2_compat/sleep/test
./libs/h2/vmtraps/test/test_ie
./libs/h2/vmtraps/test/test_pcycles
./libs/h2/vmtraps/test/test_return
./libs/h2/vmtraps/test/test_yield

./perf/setie
Expand Down
9 changes: 4 additions & 5 deletions scripts/testlist.v81
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
./kernel/mem/tlbmisc/test
./kernel/mem/tlbmiss/test
# ./kernel/mem/varadix/test FIXME: needs to adapt to different kernel page size/count
# ./kernel/power/apcr/test_multi FIXME: needs changes to work with new ${EXEC}_tmp make target
./kernel/power/apcr/test_multi
./kernel/power/hvx/test
#./kernel/power/apcr/simple_test
./kernel/power/apcr/simple_test
./kernel/sched/check_sanity/test/tests/H2K_check_sanity/scenarios
./kernel/sched/dosched/test/test
./kernel/futex/futex/test/tests/badaccess
./kernel/futex/futex/test/tests/find_match
./kernel/futex/futex/test/tests/multi_va
./kernel/futex/futex/test/tests/multi_wake
#./kernel/futex/futex/test/tests/pi # FIXME: timing-dependent fails
./kernel/futex/futex/test/tests/pi
./kernel/futex/futex/test/tests/simple_lock_unlock
./kernel/sched/lowprio/test
./kernel/sched/resched/test
Expand Down Expand Up @@ -90,9 +90,8 @@
./libs/h2_compat/error/test/simple
./libs/h2_compat/sem/test/simple
./libs/h2_compat/sleep/test

./libs/h2/vmtraps/test/test_ie
#./libs/h2/vmtraps/test/test_pcycles
./libs/h2/vmtraps/test/test_pcycles
./libs/h2/vmtraps/test/test_return
./libs/h2/vmtraps/test/test_yield

Expand Down
Loading