arm32
[Libc]

arm32 architecture dependent parts of libc More...


Files

file  atomic.h
 Atomic operations.
file  config.h
 Configuration constants.
file  ddi.h
file  faddr.h
 Function address conversion.
file  fibril.h
 Fibrils related declarations.
file  istate.h
file  stackarg.h
 Empty.
file  stacktrace.c
file  syscall.c
 Syscall routine.
file  syscall.h
file  thread.h
file  tls.c
file  tls.h
file  types.h
 Definitions of basic types like uintptr_t.

Data Structures

struct  context_t
 Fibril context. More...
struct  tcb_t
 TCB (Thread Control Block) struct. More...

Defines

#define __32_BITS__
#define ARM_TP_OFFSET   (-8)
 Offsets for accessing thread-local variables are shifted 8 bytes higher.
#define CAS
#define CONFIG_TLS_VARIANT_1
#define context_set(c, _pc, stack, size, ptls)
 Sets data to the context.
#define FADDR(f)   (f)
 Calculate absolute address of function referenced by fptr pointer.
#define FRAME_OFFSET_FP_PREV   -12
#define FRAME_OFFSET_RA   -4
#define LIBARCH_SYSCALL_GENERIC
#define LIBC_ARCH_ATOMIC_H_
#define PAGE_SIZE   (1 << PAGE_WIDTH)
#define PAGE_WIDTH   12
#define PRIdn   PRId32
 Format for native_t.
#define PRIua   PRIu32
 Format for atomic_count_t.
#define PRIun   PRIu32
 Format for sysarg_t.
#define PRIxn   PRIx32
 Format for hexadecimal sysarg_t.
#define SIZE_MAX   UINT32_MAX
#define SIZE_MIN   UINT32_MIN
#define SP_DELTA   (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
#define SSIZE_MAX   INT32_MAX
#define SSIZE_MIN   INT32_MIN
#define STACK_ALIGNMENT   8
 Stack alignment - see ABI for details.
#define STACK_ITEM_SIZE   4
 Size of a stack item.

Typedefs

typedef uint32_t atomic_count_t
typedef int32_t atomic_signed_t
typedef uint32_t size_t
typedef int32_t ssize_t
typedef uint32_t sysarg_t
typedef uint32_t uintptr_t

Functions

uintptr_t __aeabi_read_tp (void)
 Returns TLS address stored.
tcb_t__alloc_tls (void **data, size_t size)
void __free_tls_arch (tcb_t *tcb, size_t size)
sysarg_t __syscall (const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, const sysarg_t p4, const sysarg_t p5, const sysarg_t p6, const syscall_t id)
 Syscall routine.
static tcb_t__tcb_get (void)
 Returns TCB address.
static void __tcb_set (tcb_t *tcb)
 Sets TLS address to the r9 register.
static atomic_count_t atomic_add (atomic_t *val, atomic_count_t i)
 Atomic addition.
static void atomic_dec (atomic_t *val)
 Atomic decrement.
static void atomic_inc (atomic_t *val)
 Atomic increment.
static atomic_count_t atomic_postdec (atomic_t *val)
 Atomic post-decrement.
static atomic_count_t atomic_postinc (atomic_t *val)
 Atomic post-increment.
static atomic_count_t atomic_predec (atomic_t *val)
 Atomic pre-decrement.
static atomic_count_t atomic_preinc (atomic_t *val)
 Atomic pre-increment.
static bool cas (atomic_t *val, atomic_count_t ov, atomic_count_t nv)
static uintptr_t context_get_fp (context_t *ctx)
int stacktrace_fp_prev (stacktrace_t *st, uintptr_t fp, uintptr_t *prev)
bool stacktrace_fp_valid (stacktrace_t *st, uintptr_t fp)
int stacktrace_ra_get (stacktrace_t *st, uintptr_t fp, uintptr_t *ra)

Detailed Description

arm32 architecture dependent parts of libc


Define Documentation

#define context_set ( c,
_pc,
stack,
size,
ptls   ) 

Value:

do { \
                (c)->pc = (sysarg_t) (_pc); \
                (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
                (c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t) + ARM_TP_OFFSET; \
                (c)->fp = 0; \
        } while (0)
Sets data to the context.

Parameters:
c Context (context_t).
_pc Program counter.
stack Stack address.
size Stack size.
ptls Pointer to the TCB.

Definition at line 60 of file fibril.h.

#define FADDR ( f   )     (f)

Calculate absolute address of function referenced by fptr pointer.

Parameters:
f Function pointer.

Definition at line 45 of file faddr.h.


Function Documentation

uintptr_t __aeabi_read_tp ( void   ) 

Returns TLS address stored.

Implemented in assembly.

Returns:
TLS address stored in r9 register

Definition at line 46 of file tls.c.

sysarg_t __syscall ( const sysarg_t  p1,
const sysarg_t  p2,
const sysarg_t  p3,
const sysarg_t  p4,
const sysarg_t  p5,
const sysarg_t  p6,
const syscall_t  id 
)

Syscall routine.

Stores p1-p4, id to r0-r4 registers and calls swi instruction. Returned value is read from r0 register.

Parameters:
p1 Parameter 1.
p2 Parameter 2.
p3 Parameter 3.
p4 Parameter 4.
id Number of syscall.
Returns:
Syscall return value.

Definition at line 52 of file syscall.c.

static tcb_t* __tcb_get ( void   )  [inline, static]

Returns TCB address.

Returns:
TCB address (starts before TLS which address is stored in r9 register).

Definition at line 77 of file tls.h.

static void __tcb_set ( tcb_t tcb  )  [inline, static]

Sets TLS address to the r9 register.

Parameters:
tcb TCB (TLS starts behind)

Definition at line 60 of file tls.h.

static atomic_count_t atomic_add ( atomic_t val,
atomic_count_t  i 
) [inline, static]

Atomic addition.

Parameters:
val Where to add.
i Value to be added.
Returns:
Value after addition.

Definition at line 95 of file atomic.h.

static void atomic_dec ( atomic_t val  )  [inline, static]

Atomic decrement.

Parameters:
val Variable to be decremented.

Definition at line 147 of file atomic.h.

static void atomic_inc ( atomic_t val  )  [inline, static]

Atomic increment.

Parameters:
val Variable to be incremented.

Definition at line 136 of file atomic.h.

static atomic_count_t atomic_postdec ( atomic_t val  )  [inline, static]

Atomic post-decrement.

Parameters:
val Variable to be decremented.
Returns:
Value before decrementation.

Definition at line 195 of file atomic.h.

static atomic_count_t atomic_postinc ( atomic_t val  )  [inline, static]

Atomic post-increment.

Parameters:
val Variable to be incremented.
Returns:
Value before incrementation.

Definition at line 183 of file atomic.h.

static atomic_count_t atomic_predec ( atomic_t val  )  [inline, static]

Atomic pre-decrement.

Parameters:
val Variable to be decremented.
Returns:
Value after decrementation.

Definition at line 171 of file atomic.h.

static atomic_count_t atomic_preinc ( atomic_t val  )  [inline, static]

Atomic pre-increment.

Parameters:
val Variable to be incremented.
Returns:
Value after incrementation.

Definition at line 159 of file atomic.h.


Generated on Thu Jun 2 07:45:57 2011 for HelenOS/USB by  doxygen 1.4.7