/trunk/kernel/arch/amd64/include/interrupt.h |
---|
69,7 → 69,7 |
#define VECTOR_DEBUG_IPI (IVT_FREEBASE + 2) |
/** This is passed to interrupt handlers */ |
struct istate { |
typedef struct { |
uint64_t rax; |
uint64_t rbx; |
uint64_t rcx; |
90,7 → 90,7 |
uint64_t cs; |
uint64_t rflags; |
uint64_t stack[]; /* Additional data on stack */ |
}; |
} istate_t; |
/** Return true if exception happened while in userspace */ |
static inline int istate_from_uspace(istate_t *istate) |
/trunk/kernel/arch/amd64/include/types.h |
---|
36,6 → 36,8 |
#define KERN_amd64_TYPES_H_ |
#define NULL 0 |
#define false 0 |
#define true 1 |
typedef signed char int8_t; |
typedef signed short int16_t; |
47,17 → 49,43 |
typedef unsigned int uint32_t; |
typedef unsigned long long uint64_t; |
typedef uint64_t size_t; |
typedef uint64_t count_t; |
typedef uint64_t index_t; |
typedef uint64_t uintptr_t; |
typedef uint64_t pfn_t; |
/* Flags of processor (return value of interrupts_disable()) */ |
typedef uint64_t ipl_t; |
typedef uint64_t unative_t; |
typedef int64_t native_t; |
typedef struct page_specifier pte_t; |
typedef uint8_t bool; |
typedef uint64_t task_id_t; |
typedef uint32_t context_id_t; |
typedef int32_t inr_t; |
typedef int32_t devno_t; |
/** Page Table Entry. */ |
typedef struct { |
unsigned present : 1; |
unsigned writeable : 1; |
unsigned uaccessible : 1; |
unsigned page_write_through : 1; |
unsigned page_cache_disable : 1; |
unsigned accessed : 1; |
unsigned dirty : 1; |
unsigned unused: 1; |
unsigned global : 1; |
unsigned soft_valid : 1; /**< Valid content even if present bit is cleared. */ |
unsigned avl : 2; |
unsigned addr_12_31 : 30; |
unsigned addr_32_51 : 21; |
unsigned no_execute : 1; |
} __attribute__ ((packed)) pte_t; |
#endif |
/** @} |
/trunk/kernel/arch/amd64/include/atomic.h |
---|
38,7 → 38,6 |
#include <arch/types.h> |
#include <arch/barrier.h> |
#include <preemption.h> |
#include <typedefs.h> |
static inline void atomic_inc(atomic_t *val) { |
#ifdef CONFIG_SMP |
/trunk/kernel/arch/amd64/include/pm.h |
---|
37,7 → 37,6 |
#ifndef __ASM__ |
# include <arch/types.h> |
# include <typedefs.h> |
# include <arch/context.h> |
#endif |
/trunk/kernel/arch/amd64/include/proc/task.h |
---|
35,7 → 35,6 |
#ifndef KERN_amd64_TASK_H_ |
#define KERN_amd64_TASK_H_ |
#include <typedefs.h> |
#include <arch/types.h> |
#include <adt/bitmap.h> |
/trunk/kernel/arch/amd64/include/proc/thread.h |
---|
35,8 → 35,6 |
#ifndef KERN_amd64_THREAD_H_ |
#define KERN_amd64_THREAD_H_ |
#include <arch/types.h> |
typedef struct { |
unative_t tls; |
} thread_arch_t; |
/trunk/kernel/arch/amd64/include/asm.h |
---|
35,8 → 35,6 |
#ifndef KERN_amd64_ASM_H_ |
#define KERN_amd64_ASM_H_ |
#include <arch/pm.h> |
#include <arch/types.h> |
#include <config.h> |
extern void asm_delay_loop(uint32_t t); |
/trunk/kernel/arch/amd64/include/mm/page.h |
---|
57,11 → 57,10 |
#ifdef KERNEL |
#ifndef __ASM__ |
# include <mm/page.h> |
# include <mm/mm.h> |
# include <arch/types.h> |
#endif |
# include <arch/interrupt.h> |
#ifndef __ASM__ |
static inline uintptr_t ka2pa(uintptr_t x) |
{ |
if (x > 0xffffffff80000000) |
69,6 → 68,7 |
else |
return x - 0xffff800000000000; |
} |
# define KA2PA(x) ka2pa((uintptr_t)x) |
# define PA2KA_CODE(x) (((uintptr_t) (x)) + 0xffffffff80000000) |
# define PA2KA(x) (((uintptr_t) (x)) + 0xffff800000000000) |
133,24 → 133,6 |
/** When bit on this position os 1, the page fault was caused during instruction fecth. */ |
#define PFERR_CODE_ID (1<<4) |
/** Page Table Entry. */ |
struct page_specifier { |
unsigned present : 1; |
unsigned writeable : 1; |
unsigned uaccessible : 1; |
unsigned page_write_through : 1; |
unsigned page_cache_disable : 1; |
unsigned accessed : 1; |
unsigned dirty : 1; |
unsigned unused: 1; |
unsigned global : 1; |
unsigned soft_valid : 1; /**< Valid content even if present bit is cleared. */ |
unsigned avl : 2; |
unsigned addr_12_31 : 30; |
unsigned addr_32_51 : 21; |
unsigned no_execute : 1; |
} __attribute__ ((packed)); |
static inline int get_pt_flags(pte_t *pt, index_t i) |
{ |
pte_t *p = &pt[i]; |
/trunk/kernel/arch/amd64/include/mm/as.h |
---|
44,9 → 44,6 |
#define USTACK_ADDRESS_ARCH (USER_ADDRESS_SPACE_END_ARCH-(PAGE_SIZE-1)) |
typedef struct { |
} as_arch_t; |
#define as_constructor_arch(as, flags) (as != as) |
#define as_destructor_arch(as) (as != as) |
#define as_create_arch(as, flags) (as != as) |
54,6 → 51,11 |
#define as_deinstall_arch(as) |
#define as_invalidate_translation_cache(as, page, cnt) |
typedef struct { |
} as_arch_t; |
#include <genarch/mm/as_pt.h> |
extern void as_arch_init(void); |
#endif |
/trunk/kernel/arch/amd64/include/cpu.h |
---|
54,7 → 54,6 |
#ifndef __ASM__ |
#include <typedefs.h> |
#include <arch/pm.h> |
typedef struct { |