Updated for new stack alignment changes in atom.h.

This commit is contained in:
Natie van Rooyen
2012-09-27 12:18:00 +02:00
parent b8afea38ba
commit 4c669225c6
6 changed files with 48 additions and 17 deletions

View File

@@ -44,7 +44,7 @@ include ../rules.mk
run_test: clean all
echo "START TEST $(TEST_NAME)"
qemu-system-arm -M integratorcp -kernel boot.elf -semihosting | tee atomthreads_test.out
qemu-system-arm -M integratorcp -kernel boot.elf -semihosting >> atomthreads_test.out
all_tests:
echo "Starting atomthreads test suite" > atomthreads_test.out
@@ -87,5 +87,5 @@ all_tests:
make run_test "TEST_NAME=sem9"
run_last:
qemu-system-arm -M integratorcp -kernel boot.elf -monitor stdio -semihosting
qemu-system-arm -M integratorcp -kernel boot.elf -semihosting

View File

@@ -77,8 +77,8 @@ main (void)
printf ("atomthreads starting %s... ", ATOMTHREADS_TEST) ;
atomOSInit(&idle_stack[IDLE_STACK_BYTE_SIZE - sizeof(unsigned int)], IDLE_STACK_BYTE_SIZE - sizeof(unsigned int)) ;
atomThreadCreate ((ATOM_TCB *)&test_tcb, TEST_THREAD_PRIO, test_thread, 0, &test_stack[(TEST_STACK_BYTE_SIZE) - sizeof(unsigned int)], TEST_STACK_BYTE_SIZE - sizeof(unsigned int));
atomOSInit(&idle_stack[0], IDLE_STACK_BYTE_SIZE, TRUE) ;
atomThreadCreate ((ATOM_TCB *)&test_tcb, TEST_THREAD_PRIO, test_thread, 0, &test_stack[0], TEST_STACK_BYTE_SIZE, TRUE);
atomOSStart() ;
return 0 ;

View File

@@ -85,11 +85,11 @@ all_tests:
make run_test "TEST_NAME=sem8"
make run_test "TEST_NAME=sem9"
all_fail:
fail_tests:
make run_test "TEST_NAME=mutex4"
make run_test "TEST_NAME=sem4"
run_last:
qemu-system-arm -M lm3s6965evb -kernel boot.elf -monitor stdio -semihosting
qemu-system-arm -M lm3s6965evb -kernel boot.elf -semihosting

View File

@@ -79,8 +79,8 @@ main (void)
uint32_t failures ;
printf ("Atomthreads starting %s... \r\n", ATOMTHREADS_TEST) ;
atomOSInit(&idle_stack[IDLE_STACK_BYTE_SIZE - sizeof(unsigned int)], IDLE_STACK_BYTE_SIZE - sizeof(unsigned int)) ;
atomThreadCreate ((ATOM_TCB *)&test_tcb, TEST_THREAD_PRIO, test_thread, 0, &test_stack[(TEST_STACK_BYTE_SIZE) - sizeof(unsigned int)], TEST_STACK_BYTE_SIZE - sizeof(unsigned int));
atomOSInit(&idle_stack[0], IDLE_STACK_BYTE_SIZE, TRUE) ;
atomThreadCreate ((ATOM_TCB *)&test_tcb, TEST_THREAD_PRIO, test_thread, 0, &test_stack[0], TEST_STACK_BYTE_SIZE, TRUE);
atomOSStart() ;
return 0 ;

View File

@@ -32,8 +32,17 @@
#include "types.h"
#define SYSTEM_TICKS_PER_SEC 100
#define SYSTEM_TICKS_PER_SEC 100
/**
* Definition of NULL.
* If stddef.h is available on the platform it is simplest to include it
* from this header, otherwise define below.
*/
#define NULL ((void *)(0))
/* Size of each stack entry / stack alignment size (e.g. 32 bits) */
#define STACK_ALIGN_SIZE sizeof(unsigned int)
/**
* Architecture-specific types.
@@ -47,12 +56,17 @@
* Functions defined in atomport_arm.asm
*
*/
extern void contextInit (void) ;
extern uint32_t contextEnterCritical (void) ;
extern void contextExitCritical (uint32_t posture) ;
extern void contextInit (void) ;
extern uint32_t contextEnterCritical (void) ;
extern void contextExitCritical (uint32_t posture) ;
/* Critical region protection */
/**
* Critical region protection: this should disable interrupts
* to protect OS data structures during modification. It must
* allow nested calls, which means that interrupts should only
* be re-enabled when the outer CRITICAL_END() is reached.
*/
#define CRITICAL_STORE uint32_t __atom_critical
#define CRITICAL_START() __atom_critical = contextEnterCritical()
#define CRITICAL_END() contextExitCritical(__atom_critical)

View File

@@ -32,7 +32,23 @@
#include "types.h"
#define SYSTEM_TICKS_PER_SEC 100
#define SYSTEM_TICKS_PER_SEC 100
/**
* Definition of NULL.
* If stddef.h is available on the platform it is simplest to include it
* from this header, otherwise define below.
*/
#define NULL ((void *)(0))
/* Size of each stack entry / stack alignment size (e.g. 32 bits) */
#define STACK_ALIGN_SIZE sizeof(unsigned int)
/**
* Architecture-specific types.
* Most of these are available from types.h on this platform, which is
* included above.
*/
/**
@@ -47,9 +63,9 @@
* Functions defined in atomport_arm.asm
*
*/
extern void contextInit (void) ;
extern uint32_t contextEnterCritical (void) ;
extern void contextExitCritical (uint32_t posture) ;
extern void contextInit (void) ;
extern uint32_t contextEnterCritical (void) ;
extern void contextExitCritical (uint32_t posture) ;
/* Critical region protection */
@@ -58,3 +74,4 @@ extern void contextExitCritical (uint32_t posture) ;
#define CRITICAL_END() contextExitCritical(__atom_critical)
#endif /* __ATOM_PORT_H__ */