From 78e45ee6134538657fa00938e40d8c26724577f9 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sat, 21 May 2022 22:31:52 +0200 Subject: [PATCH] tests: remove unused functions --- tests/msp430setup.c | 60 --------------------------------------------- tests/timertest.c | 5 ---- 2 files changed, 65 deletions(-) diff --git a/tests/msp430setup.c b/tests/msp430setup.c index 66bdda0..9012f9c 100644 --- a/tests/msp430setup.c +++ b/tests/msp430setup.c @@ -333,63 +333,3 @@ msp430_setup(void) rs232_init(); } - -#define asmv(arg) __asm__ __volatile__(arg) - -#define STACK_EXTRA 32 - -static char *cur_break = (char *)( -#if defined(__MSP430_LIBC__) && 20110612 <= __MSP430_LIBC__ - __bss_end -#else - &__bss_end + 1 -#endif -); - -/* - * Allocate memory from the heap. Check that we don't collide with the - * stack right now (some other routine might later). A watchdog might - * be used to check if cur_break and the stack pointer meet during - * runtime. - */ -void * -sbrk(int incr) -{ - char *stack_pointer; - - asmv("mov r1, %0" : "=r" (stack_pointer)); - stack_pointer -= STACK_EXTRA; - if(incr > (stack_pointer - cur_break)) - return (void *)-1; /* ENOMEM */ - - void *old_break = cur_break; - cur_break += incr; - /* - * If the stack was never here then [old_break .. cur_break] should - * be filled with zeros. - */ - return old_break; -} - -/* - * Mask all interrupts that can be masked. - */ -int -splhigh_(void) -{ - /* Clear the GIE (General Interrupt Enable) flag. */ - int sr; - asmv("mov r2, %0" : "=r" (sr)); - asmv("bic %0, r2" : : "i" (GIE)); - return sr & GIE; /* Ignore other sr bits. */ -} - -/* - * Restore previous interrupt mask. - */ -void -splx_(int sr) -{ - /* If GIE was set, restore it. */ - asmv("bis %0, r2" : : "r" (sr)); -} diff --git a/tests/timertest.c b/tests/timertest.c index 2567e9a..12d6b20 100644 --- a/tests/timertest.c +++ b/tests/timertest.c @@ -67,11 +67,6 @@ #define assertTrue2(text,...) TEST2(text,__VA_ARGS__) #define assertFalse2(text,...) TEST2(text,!(__VA_ARGS__)) -static int testzero(int hm) -{ - return hm > 0; -} - static int caseID = 0; #define RTIMER_ARCH_SECOND 4096