ARM/IntegratorCP: Use similar coding style to avr/other ports.

This commit is contained in:
Kelvin Lawson
2013-02-27 01:09:11 +00:00
parent 1b63c32848
commit 0027134452
10 changed files with 1209 additions and 53 deletions

View File

@@ -30,7 +30,7 @@
#include <stdio.h>
#include <stdarg.h>
#include "atomport.h"
#include "atomport_private.h"
#include "atomport-private.h"
#include "atom.h"
#include "atomport.h"
#include "types.h"
@@ -40,8 +40,8 @@ extern unsigned long _end_text, _start_data, _end_data, _start_bss, _end_bss;
extern int main(void);
/** Board-specific registers */
ICP_TIMER_T* const board_timer_0 = (ICP_TIMER_T*) BOARD_BASE_ADDRESS_TIMER_0 ;
ICP_PIC_T * const board_pic = (ICP_PIC_T*) BOARD_BASE_ADDRESS_PIC ;
ICP_TIMER_T * const board_timer_0 = (ICP_TIMER_T*)BOARD_BASE_ADDRESS_TIMER_0;
ICP_PIC_T * const board_pic = (ICP_PIC_T*)BOARD_BASE_ADDRESS_PIC;
/** TIMER0 clock speed (Hz) */
#define TIMER0_CLOCK_SPEED 40000000

View File

@@ -34,6 +34,7 @@
*/
#include "atomport.h"
#include "types.h"

Binary file not shown.

1161
ports/arm/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,6 @@ SRCS := $(SRCS) \
$(ATOMTHREADS_PORT)/atomport.c
ASMS := $(ASMS) \
$(ATOMTHREADS_PORT)/atomport_s.S
$(ATOMTHREADS_PORT)/atomport-asm.S

View File

@@ -27,24 +27,33 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __ATOMPORT_TEST_H__
#define __ATOMPORT_TEST_H__
#ifndef __ATOM_PORT_TESTS_H
#define __ATOM_PORT_TESTS_H
/* Include Atomthreads kernel API */
#include "atom.h"
extern void dbg_format_msg (char *format, ...) ;
/* Prerequisite for ATOMLOG() macro (via dbg_format_msg) */
extern void dbg_format_msg (char *format, ...) ;
#define TEST_THREAD_STACK_SIZE 1024
#define ATOMLOG dbg_format_msg
#define _STR(x) x
/* Logger macro for viewing test results */
#define ATOMLOG dbg_format_msg
/*
* String location macro: for platforms which need to place strings in
* alternative locations, e.g. on avr-gcc strings can be placed in
* program space, saving SRAM. On most platforms this can expand to
* empty.
*/
#define _STR(x) x
/* Default thread stack size (in bytes) */
#define TEST_THREAD_STACK_SIZE 1024
/* Uncomment to enable logging of stack usage to UART */
/* #define TESTS_LOG_STACK_USAGE */
/* API for starting each test */
extern uint32_t test_start (void);
#endif /* __ATOMPORT_TEST_H__ */
#endif /* __ATOM_PORT_TESTS_H */

View File

@@ -27,29 +27,28 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __ATOM_PORT_H__
#define __ATOM_PORT_H__
#ifndef __ATOM_PORT_H
#define __ATOM_PORT_H
#include "types.h"
/* Portable uint8_t and friends available from stdint.h on this platform */
#include <stdint.h>
#define SYSTEM_TICKS_PER_SEC 100
/* Definition of NULL is available from stddef.h on this platform */
#include <stddef.h>
/**
* 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))
/* Required number of system ticks per second (normally 100 for 10ms tick) */
#define SYSTEM_TICKS_PER_SEC 100
/* Size of each stack entry / stack alignment size (e.g. 32 bits) */
#define STACK_ALIGN_SIZE sizeof(unsigned int)
/* Size of each stack entry / stack alignment size (32 bits on this platform) */
#define STACK_ALIGN_SIZE sizeof(uint32_t)
/**
* Architecture-specific types.
* Most of these are available from types.h on this platform, which is
* Most of these are available from stdint.h on this platform, which is
* included above.
*/
#define POINTER void *
#define POINTER void *
/* *
*
@@ -71,4 +70,8 @@ extern void contextExitCritical (uint32_t posture) ;
#define CRITICAL_START() __atom_critical = contextEnterCritical()
#define CRITICAL_END() contextExitCritical(__atom_critical)
#endif /* __ATOM_PORT_H__ */
/* Uncomment to enable stack-checking */
/* #define ATOM_STACK_CHECKING */
#endif /* __ATOM_PORT_H */

View File

@@ -27,31 +27,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __TYPES_H__
#define __TYPES_H__
typedef unsigned int uintptr_t ;
typedef int intptr_t ;
typedef unsigned long long uint64_t ;
typedef unsigned int uint32_t ;
typedef unsigned short uint16_t ;
typedef unsigned char uint8_t ;
typedef int int32_t ;
typedef short int16_t ;
typedef char int8_t ;
#ifndef OFFSETOF
#define OFFSETOF(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
#endif
#ifndef INLINE
#define INLINE __inline
#endif
#ifndef __TYPES_H
#define __TYPES_H
/* IO definitions (access restrictions to peripheral registers) */
#define __I volatile /*!< defines 'read only' permissions */
#define __O volatile /*!< defines 'write only' permissions */
#define __IO volatile /*!< defines 'read / write' permissions */
#define __O volatile /*!< defines 'write only' permissions */
#define __IO volatile /*!< defines 'read / write' permissions */
#endif /* __TYPES_H__ */
#endif /* __TYPES_H */