/branches/arm/kernel/arch/arm32/include/asm/boot.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief Included in assembly boot source. |
*/ |
#ifndef KERN_arm32_ASM_BOOT_H_ |
36,7 → 37,7 |
#define KERN_arm32_ASM_BOOT_H_ |
/* Temporary stack size for boot process */ |
/** Size of a temporary stack used for boot process. */ |
#define TEMP_STACK_SIZE 0x100 |
#endif |
/branches/arm/kernel/arch/arm32/include/interrupt.h |
---|
35,11 → 35,19 |
#ifndef KERN_arm32_INTERRUPT_H_ |
#define KERN_arm32_INTERRUPT_H_ |
#include <arch/types.h> |
#define IVT_ITEMS 6 |
#define IVT_FIRST 0 |
void interrupt_init(void); |
extern void interrupt_init(void); |
extern ipl_t interrupts_disable(void); |
extern ipl_t interrupts_enable(void); |
extern void interrupts_restore(ipl_t ipl); |
extern ipl_t interrupts_read(void); |
#endif |
/** @} |
/branches/arm/kernel/arch/arm32/include/cycle.h |
---|
30,17 → 30,20 |
* @{ |
*/ |
/** @file |
* @brief Count of CPU cycles. |
*/ |
#ifndef KERN_arm32_CYCLE_H_ |
#define KERN_arm32_CYCLE_H_ |
/** No such instruction on ARM to get count of cycles. */ |
static inline uint64_t get_cycle(void) |
{ |
// no such instruction on ARM to get count of cycles |
return 0; |
} |
#endif |
/** @} |
/branches/arm/kernel/arch/arm32/include/byteorder.h |
---|
29,7 → 29,7 |
/** @addtogroup arm32 |
* @{ |
*/ |
/** @file |
/** @file Endianness definitions. |
*/ |
#ifndef KERN_arm32_BYTEORDER_H_ |
/branches/arm/kernel/arch/arm32/include/boot.h |
---|
29,28 → 29,42 |
/** @addtogroup arm32 |
* @{ |
*/ |
/** @file |
/** @file Bootinfo declarations. |
* |
* Reflects boot/arch/arm32/loader/mm.h. |
*/ |
#ifndef KERN_arm32_BOOT_H_ |
#define KERN_arm32_BOOT_H_ |
#include <arch/types.h> |
/** Maximum number of tasks in the #bootinfo_t struct. */ |
#define TASKMAP_MAX_RECORDS 32 |
#include <arch/types.h> |
/** Struct holding information about single loaded uspace task. */ |
typedef struct { |
/** Address where the task was placed. */ |
uintptr_t addr; |
/** Size of the task's binary. */ |
uint32_t size; |
} utask_t; |
/** Struct holding information about loaded uspace tasks. */ |
typedef struct { |
/** Number of loaded tasks. */ |
uint32_t cnt; |
/** Array of loaded tasks. */ |
utask_t tasks[TASKMAP_MAX_RECORDS]; |
} bootinfo_t; |
/** Bootinfo that is filled in #kernel_image_start. */ |
extern bootinfo_t bootinfo; |
#endif |
/** @} |
/branches/arm/kernel/arch/arm32/include/machine.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief Declarations of machine specific functions. |
*/ |
#ifndef KERN_arm32_MACHINE_H_ |
/branches/arm/kernel/arch/arm32/include/stack.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief Stack constants. |
*/ |
#ifndef KERN_arm32_STACK_H_ |
/branches/arm/kernel/arch/arm32/include/elf.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief ARM ELF constants. |
*/ |
#ifndef KERN_arm32_ELF_H_ |
/branches/arm/kernel/arch/arm32/include/arg.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief Empty. |
*/ |
#ifndef KERN_arm32_ARG_H_ |
/branches/arm/kernel/arch/arm32/include/atomic.h |
---|
29,7 → 29,8 |
/** @addtogroup arm32 |
* @{ |
*/ |
/** @file |
/** @file |
* @brief Atomic operations. |
*/ |
#ifndef KERN_arm32_ATOMIC_H_ |
37,8 → 38,8 |
/** Atomic addition. |
* |
* @param val "Atomic variable". |
* @param i Value to add. |
* @param val Where to add. |
* @param i Value to be added. |
* |
* @return Value after addition. |
*/ |
64,15 → 65,48 |
return ret; |
} |
/** Atomic increment. |
* |
* @param val Variable to be incremented. |
*/ |
static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); } |
/** Atomic decrement. |
* |
* @param val Variable to be decremented. |
*/ |
static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); } |
/** Atomic pre-increment. |
* |
* @param val Variable to be incremented. |
* @return Value after incrementation. |
*/ |
static inline long atomic_preinc(atomic_t *val) { return atomic_add(val, 1); } |
/** Atomic pre-decrement. |
* |
* @param val Variable to be decremented. |
* @return Value after decrementation. |
*/ |
static inline long atomic_predec(atomic_t *val) { return atomic_add(val, -1); } |
/** Atomic post-increment. |
* |
* @param val Variable to be incremented. |
* @return Value before incrementation. |
*/ |
static inline long atomic_postinc(atomic_t *val) { return atomic_add(val, 1) - 1; } |
/** Atomic post-decrement. |
* |
* @param val Variable to be decremented. |
* @return Value before decrementation. |
*/ |
static inline long atomic_postdec(atomic_t *val) { return atomic_add(val, -1) + 1; } |
#endif |
/** @} |
/branches/arm/kernel/arch/arm32/include/arch.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief Empty. |
*/ |
#ifndef KERN_arm32_ARCH_H_ |
/branches/arm/kernel/arch/arm32/include/asm.h |
---|
1,5 → 1,5 |
/* |
* Copyright (c) 2003-2004 Jakub Jermar |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
29,7 → 29,8 |
/** @addtogroup arm32 |
* @{ |
*/ |
/** @file |
/** @file |
* @brief Declarations of functions implemented in assembly. |
*/ |
#ifndef KERN_arm32_ASM_H_ |
38,11 → 39,11 |
#include <arch/types.h> |
#include <arch/stack.h> |
#include <config.h> |
#include <arch/interrupt.h> |
/** No such instruction on ARM to sleep CPU. */ |
static inline void cpu_sleep(void) |
{ |
// not implemented on gxemul |
} |
55,7 → 56,11 |
static inline uintptr_t get_stack_base(void) |
{ |
uintptr_t v; |
asm volatile ("and %0, sp, %1\n" : "=r" (v) : "r" (~(STACK_SIZE-1))); |
asm volatile ( |
"and %0, sp, %1\n" |
: "=r" (v) |
: "r" (~(STACK_SIZE-1)) |
); |
return v; |
} |
64,12 → 69,7 |
extern void asm_delay_loop(uint32_t t); |
extern void userspace_asm(uintptr_t ustack, uintptr_t uspace_uarg, uintptr_t entry); |
extern ipl_t interrupts_disable(void); |
extern ipl_t interrupts_enable(void); |
extern void interrupts_restore(ipl_t ipl); |
extern ipl_t interrupts_read(void); |
#endif |
/** @} |
/branches/arm/kernel/arch/arm32/include/context.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief Thread context. |
*/ |
#ifndef KERN_arm32_CONTEXT_H_ |
38,17 → 39,14 |
#include <align.h> |
#include <arch/stack.h> |
/* Put one item onto the stack to support get_stack_base() and align it up. */ |
#define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) |
#ifndef __ASM__ |
#include <arch/types.h> |
/* Structure containing registers that must be preserved across function calls. */ |
/* Struct containing registers that must be preserved across function calls. */ |
typedef struct { |
uint32_t cpu_mode; |
uintptr_t sp; |
/branches/arm/kernel/arch/arm32/include/debug.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief Empty. |
*/ |
#ifndef KERN_arm32_DEBUG_H_ |
/branches/arm/kernel/arch/arm32/include/barrier.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief Memory barriers. |
*/ |
#ifndef KERN_arm32_BARRIER_H_ |
/branches/arm/kernel/arch/arm32/include/cpu.h |
---|
30,6 → 30,7 |
* @{ |
*/ |
/** @file |
* @brief CPU identification. |
*/ |
#ifndef KERN_arm32_CPU_H_ |
39,7 → 40,7 |
#include <arch/asm.h> |
/** Structure representing ARM CPU identifiaction. */ |
/** Struct representing ARM CPU identifiaction. */ |
typedef struct { |
/** Implementator (vendor) number. */ |
uint32_t imp_num; |
/branches/arm/kernel/arch/arm32/src/start.S |
---|
32,7 → 32,6 |
.global kernel_image_start |
.global exc_stack |
.global exc_stack |
.global supervisor_sp |
43,7 → 42,7 |
orr r3, r3, #0x1f |
msr cpsr_c, r3 |
ldr sp, =end_stack |
ldr sp, =temp_stack |
cmp r2, #0 |
beq bootinfo_end |
68,7 → 67,7 |
bl main_bsp |
.space TEMP_STACK_SIZE |
end_stack: |
temp_stack: |
.space 1024 |
exc_stack: |
/branches/arm/boot/arch/arm32/loader/main.h |
---|
46,20 → 46,20 |
*/ |
#define ALIGN_UP(addr, align) (((addr) + ((align) - 1)) & ~((align) - 1)) |
/** Maximum number of tasks in the #bootinfo_t structure. */ |
/** Maximum number of tasks in the #bootinfo_t struct. */ |
#define TASKMAP_MAX_RECORDS 32 |
/** Structure holding information about single loaded task. */ |
/** Struct holding information about single loaded task. */ |
typedef struct { |
/** Address where the task was placed. */ |
void *addr; |
/** Size of the task binary. */ |
/** Size of the task's binary. */ |
unsigned int size; |
} task_t; |
/** Structure holding information about loaded tasks. */ |
/** Struct holding information about loaded tasks. */ |
typedef struct { |
/** Number of loaded tasks. */ |
unsigned int cnt; |