/kernel/trunk/generic/include/func.h |
---|
46,7 → 46,7 |
extern size_t strlen(const char *str); |
extern int strncmp(const char *src, const char *dst, size_t len); |
extern void strncpy(char *dest, const char *src, size_t len); |
extern __native atoi(const char *text); |
extern unative_t atoi(const char *text); |
#endif |
/kernel/trunk/generic/include/stackarg.h |
---|
45,12 → 45,12 |
typedef struct va_list { |
int pos; |
__u8 *last; |
uint8_t *last; |
} va_list; |
#define va_start(ap, lst) \ |
(ap).pos = sizeof(lst); \ |
(ap).last = (__u8 *) &(lst) |
(ap).last = (uint8_t *) &(lst) |
#define va_arg(ap, type) \ |
(*((type *)((ap).last + ((ap).pos += sizeof(type) ) - sizeof(type)))) |
/kernel/trunk/generic/include/byteorder.h |
---|
35,7 → 35,7 |
#ifndef __BYTEORDER_H__ |
#define __BYTEORDER_H__ |
static inline __u64 __u64_byteorder_swap(__u64 n) |
static inline uint64_t uint64_t_byteorder_swap(uint64_t n) |
{ |
return ((n & 0xff) << 56) | |
((n & 0xff00) << 40) | |
47,7 → 47,7 |
((n & 0xff00000000000000LL) >> 56); |
} |
static inline __u32 __u32_byteorder_swap(__u32 n) |
static inline uint32_t uint32_t_byteorder_swap(uint32_t n) |
{ |
return ((n & 0xff) << 24) | |
((n & 0xff00) << 8) | |
/kernel/trunk/generic/include/symtab.h |
---|
40,12 → 40,12 |
#define MAX_SYMBOL_NAME 64 |
struct symtab_entry { |
__u64 address_le; |
uint64_t address_le; |
char symbol_name[MAX_SYMBOL_NAME]; |
}; |
extern char * get_symtab_entry(__native addr); |
extern __address get_symbol_addr(const char *name); |
extern char * get_symtab_entry(unative_t addr); |
extern uintptr_t get_symbol_addr(const char *name); |
extern void symtab_print_search(const char *name); |
extern int symtab_compl(char *name); |
/kernel/trunk/generic/include/sysinfo/sysinfo.h |
---|
36,7 → 36,7 |
typedef union sysinfo_item_val |
{ |
__native val; |
unative_t val; |
void *fn; |
}sysinfo_item_val_t; |
45,7 → 45,7 |
char *name; |
union |
{ |
__native val; |
unative_t val; |
void *fn; |
}val; |
69,16 → 69,16 |
#define SYSINFO_SUBINFO_FUNCTION 2 |
typedef __native (*sysinfo_val_fn_t)(sysinfo_item_t *root); |
typedef __native (*sysinfo_subinfo_fn_t)(const char *subname); |
typedef unative_t (*sysinfo_val_fn_t)(sysinfo_item_t *root); |
typedef unative_t (*sysinfo_subinfo_fn_t)(const char *subname); |
typedef struct sysinfo_rettype |
{ |
__native val; |
__native valid; |
unative_t val; |
unative_t valid; |
}sysinfo_rettype_t; |
void sysinfo_set_item_val(const char *name,sysinfo_item_t **root,__native val); |
void sysinfo_set_item_val(const char *name,sysinfo_item_t **root,unative_t val); |
void sysinfo_dump(sysinfo_item_t **root,int depth); |
void sysinfo_set_item_function(const char *name,sysinfo_item_t **root,sysinfo_val_fn_t fn); |
void sysinfo_set_item_undefined(const char *name,sysinfo_item_t **root); |
85,8 → 85,8 |
sysinfo_rettype_t sysinfo_get_val(const char *name,sysinfo_item_t **root); |
__native sys_sysinfo_valid(__native ptr,__native len); |
__native sys_sysinfo_value(__native ptr,__native len); |
unative_t sys_sysinfo_valid(unative_t ptr,unative_t len); |
unative_t sys_sysinfo_value(unative_t ptr,unative_t len); |
/kernel/trunk/generic/include/config.h |
---|
46,7 → 46,7 |
#define CONFIG_INIT_TASKS 32 |
typedef struct { |
__address addr; |
uintptr_t addr; |
size_t size; |
} init_task_t; |
59,7 → 59,7 |
count_t cpu_count; /**< Number of processors detected. */ |
volatile count_t cpu_active; /**< Number of processors that are up and running. */ |
__address base; |
uintptr_t base; |
size_t memory_size; /**< Size of detected memory in bytes. */ |
size_t kernel_size; /**< Size of memory in bytes taken by kernel and stack */ |
} config_t; |
/kernel/trunk/generic/include/elf.h |
---|
193,11 → 193,11 |
* ELF object file specifications. They are the only types used |
* in ELF header. |
*/ |
typedef __u64 elf_xword; |
typedef __s64 elf_sxword; |
typedef __u32 elf_word; |
typedef __s32 elf_sword; |
typedef __u16 elf_half; |
typedef uint64_t elf_xword; |
typedef int64_t elf_sxword; |
typedef uint32_t elf_word; |
typedef int32_t elf_sword; |
typedef uint16_t elf_half; |
/** |
* 32-bit ELF data types. |
204,8 → 204,8 |
* |
* These types are specific for 32-bit format. |
*/ |
typedef __u32 elf32_addr; |
typedef __u32 elf32_off; |
typedef uint32_t elf32_addr; |
typedef uint32_t elf32_off; |
/** |
* 64-bit ELF data types. |
212,12 → 212,12 |
* |
* These types are specific for 64-bit format. |
*/ |
typedef __u64 elf64_addr; |
typedef __u64 elf64_off; |
typedef uint64_t elf64_addr; |
typedef uint64_t elf64_off; |
/** ELF header */ |
struct elf32_header { |
__u8 e_ident[EI_NIDENT]; |
uint8_t e_ident[EI_NIDENT]; |
elf_half e_type; |
elf_half e_machine; |
elf_word e_version; |
233,7 → 233,7 |
elf_half e_shstrndx; |
}; |
struct elf64_header { |
__u8 e_ident[EI_NIDENT]; |
uint8_t e_ident[EI_NIDENT]; |
elf_half e_type; |
elf_half e_machine; |
elf_word e_version; |
309,14 → 309,14 |
elf_word st_name; |
elf32_addr st_value; |
elf_word st_size; |
__u8 st_info; |
__u8 st_other; |
uint8_t st_info; |
uint8_t st_other; |
elf_half st_shndx; |
}; |
struct elf64_symbol { |
elf_word st_name; |
__u8 st_info; |
__u8 st_other; |
uint8_t st_info; |
uint8_t st_other; |
elf_half st_shndx; |
elf64_addr st_value; |
elf_xword st_size; |
/kernel/trunk/generic/include/time/delay.h |
---|
37,7 → 37,7 |
#include <arch/types.h> |
extern void delay(__u32 microseconds); |
extern void delay(uint32_t microseconds); |
#endif |
/kernel/trunk/generic/include/time/timeout.h |
---|
40,7 → 40,7 |
#include <synch/spinlock.h> |
#include <adt/list.h> |
#define us2ticks(us) ((__u64)(((__u32) (us)/(1000000/HZ)))) |
#define us2ticks(us) ((uint64_t)(((uint32_t) (us)/(1000000/HZ)))) |
typedef void (* timeout_handler_t)(void *arg); |
49,7 → 49,7 |
link_t link; /**< Link to the list of active timeouts on THE->cpu */ |
__u64 ticks; /**< Timeout will be activated in this amount of clock() ticks. */ |
uint64_t ticks; /**< Timeout will be activated in this amount of clock() ticks. */ |
timeout_handler_t handler; /**< Function that will be called on timeout activation. */ |
void *arg; /**< Argument to be passed to handler() function. */ |
60,7 → 60,7 |
extern void timeout_init(void); |
extern void timeout_initialize(timeout_t *t); |
extern void timeout_reinitialize(timeout_t *t); |
extern void timeout_register(timeout_t *t, __u64 usec, timeout_handler_t f, void *arg); |
extern void timeout_register(timeout_t *t, uint64_t usec, timeout_handler_t f, void *arg); |
extern bool timeout_unregister(timeout_t *t); |
#endif |
/kernel/trunk/generic/include/proc/task.h |
---|
102,7 → 102,7 |
extern void task_destroy_arch(task_t *t); |
#endif |
extern __native sys_task_get_id(task_id_t *uspace_task_id); |
extern unative_t sys_task_get_id(task_id_t *uspace_task_id); |
#endif |
/kernel/trunk/generic/include/proc/thread.h |
---|
142,14 → 142,14 |
cpu_t *cpu; /**< Thread's CPU. */ |
task_t *task; /**< Containing task. */ |
__u64 ticks; /**< Ticks before preemption. */ |
uint64_t ticks; /**< Ticks before preemption. */ |
int priority; /**< Thread's priority. Implemented as index to CPU->rq */ |
__u32 tid; /**< Thread ID. */ |
uint32_t tid; /**< Thread ID. */ |
thread_arch_t arch; /**< Architecture-specific data. */ |
__u8 *kstack; /**< Thread's kernel stack. */ |
uint8_t *kstack; /**< Thread's kernel stack. */ |
}; |
/** Thread list lock. |
171,11 → 171,11 |
extern void thread_create_arch(thread_t *t); |
#endif |
extern void thread_sleep(__u32 sec); |
extern void thread_usleep(__u32 usec); |
extern void thread_sleep(uint32_t sec); |
extern void thread_usleep(uint32_t usec); |
#define thread_join(t) thread_join_timeout((t), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) |
extern int thread_join_timeout(thread_t *t, __u32 usec, int flags); |
extern int thread_join_timeout(thread_t *t, uint32_t usec, int flags); |
extern void thread_detach(thread_t *t); |
extern void thread_register_call_me(void (* call_me)(void *), void *call_me_with); |
187,8 → 187,8 |
extern slab_cache_t *fpu_context_slab; |
/** Thread syscall prototypes. */ |
__native sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name); |
__native sys_thread_exit(int uspace_status); |
unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name); |
unative_t sys_thread_exit(int uspace_status); |
#endif |
/kernel/trunk/generic/include/debug.h |
---|
38,11 → 38,11 |
#include <panic.h> |
#include <arch/debug.h> |
#define CALLER ((__address)__builtin_return_address(0)) |
#define CALLER ((uintptr_t)__builtin_return_address(0)) |
#ifndef HERE |
/** Current Instruction Pointer address */ |
# define HERE ((__address *)0) |
# define HERE ((uintptr_t *)0) |
#endif |
/** Debugging ASSERT macro |
55,7 → 55,7 |
* |
*/ |
#ifdef CONFIG_DEBUG |
# define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s), caller=%.*p\n", #expr, sizeof(__address) * 2, CALLER); } |
# define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s), caller=%.*p\n", #expr, sizeof(uintptr_t) * 2, CALLER); } |
#else |
# define ASSERT(expr) |
#endif |
/kernel/trunk/generic/include/cpu.h |
---|
80,8 → 80,8 |
int active; |
int tlb_active; |
__u16 frequency_mhz; |
__u32 delay_loop_const; |
uint16_t frequency_mhz; |
uint32_t delay_loop_const; |
cpu_arch_t arch; |
90,7 → 90,7 |
/** |
* Stack used by scheduler when there is no running thread. |
*/ |
__u8 *stack; |
uint8_t *stack; |
}; |
extern cpu_t *cpus; |
/kernel/trunk/generic/include/synch/futex.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup sync |
/** @addtogroup sync |
* @{ |
*/ |
/** @file |
43,7 → 43,7 |
/** Kernel-side futex structure. */ |
struct futex { |
__address paddr; /**< Physical address of the status variable. */ |
uintptr_t paddr; /**< Physical address of the status variable. */ |
waitq_t wq; /**< Wait queue for threads waiting for futex availability. */ |
link_t ht_link; /**< Futex hash table link. */ |
count_t refcount; /**< Number of tasks that reference this futex. */ |
50,13 → 50,13 |
}; |
extern void futex_init(void); |
extern __native sys_futex_sleep_timeout(__address uaddr, __u32 usec, int flags); |
extern __native sys_futex_wakeup(__address uaddr); |
extern unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags); |
extern unative_t sys_futex_wakeup(uintptr_t uaddr); |
extern void futex_cleanup(void); |
#endif |
/** @} |
/** @} |
*/ |
/kernel/trunk/generic/include/synch/condvar.h |
---|
52,7 → 52,7 |
extern void condvar_initialize(condvar_t *cv); |
extern void condvar_signal(condvar_t *cv); |
extern void condvar_broadcast(condvar_t *cv); |
extern int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32 usec, int flags); |
extern int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags); |
#endif |
/kernel/trunk/generic/include/synch/rwlock.h |
---|
69,8 → 69,8 |
extern void rwlock_initialize(rwlock_t *rwl); |
extern void rwlock_read_unlock(rwlock_t *rwl); |
extern void rwlock_write_unlock(rwlock_t *rwl); |
extern int _rwlock_read_lock_timeout(rwlock_t *rwl, __u32 usec, int flags); |
extern int _rwlock_write_lock_timeout(rwlock_t *rwl, __u32 usec, int flags); |
extern int _rwlock_read_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags); |
extern int _rwlock_write_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags); |
#endif |
/kernel/trunk/generic/include/synch/mutex.h |
---|
54,7 → 54,7 |
while (mutex_trylock((mtx)) != ESYNCH_OK_ATOMIC) |
extern void mutex_initialize(mutex_t *mtx); |
extern int _mutex_lock_timeout(mutex_t *mtx, __u32 usec, int flags); |
extern int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags); |
extern void mutex_unlock(mutex_t *mtx); |
#endif |
/kernel/trunk/generic/include/synch/semaphore.h |
---|
53,7 → 53,7 |
_semaphore_down_timeout((s),(usec),SYNCH_FLAGS_NONE) |
extern void semaphore_initialize(semaphore_t *s, int val); |
extern int _semaphore_down_timeout(semaphore_t *s, __u32 usec, int flags); |
extern int _semaphore_down_timeout(semaphore_t *s, uint32_t usec, int flags); |
extern void semaphore_up(semaphore_t *s); |
#endif |
/kernel/trunk/generic/include/synch/waitq.h |
---|
61,9 → 61,9 |
waitq_sleep_timeout((wq),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE) |
extern void waitq_initialize(waitq_t *wq); |
extern int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int flags); |
extern int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags); |
extern ipl_t waitq_sleep_prepare(waitq_t *wq); |
extern int waitq_sleep_timeout_unsafe(waitq_t *wq, __u32 usec, int flags); |
extern int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags); |
extern void waitq_sleep_finish(waitq_t *wq, int rc, ipl_t ipl); |
extern void waitq_wakeup(waitq_t *wq, bool all); |
extern void _waitq_wakeup_unsafe(waitq_t *wq, bool all); |
/kernel/trunk/generic/include/bitops.h |
---|
42,7 → 42,7 |
* |
* If number is zero, it returns 0 |
*/ |
static inline int fnzb32(__u32 arg) |
static inline int fnzb32(uint32_t arg) |
{ |
int n = 0; |
54,12 → 54,12 |
return n; |
} |
static inline int fnzb64(__u64 arg) |
static inline int fnzb64(uint64_t arg) |
{ |
int n = 0; |
if (arg >> 32) { arg >>= 32;n += 32;} |
return n + fnzb32((__u32) arg); |
return n + fnzb32((uint32_t) arg); |
} |
#define fnzb(x) fnzb32(x) |
/kernel/trunk/generic/include/memstr.h |
---|
43,8 → 43,8 |
* Architecture independent variants. |
*/ |
extern void *_memcpy(void *dst, const void *src, size_t cnt); |
extern void _memsetb(__address dst, size_t cnt, __u8 x); |
extern void _memsetw(__address dst, size_t cnt, __u16 x); |
extern void _memsetb(uintptr_t dst, size_t cnt, uint8_t x); |
extern void _memsetw(uintptr_t dst, size_t cnt, uint16_t x); |
#endif |
/kernel/trunk/generic/include/ddi/ddi.h |
---|
39,15 → 39,15 |
#include <arch/types.h> |
#include <typedefs.h> |
__native sys_physmem_map(__native phys_base, __native virt_base, __native pages, |
__native flags); |
extern __native sys_iospace_enable(ddi_ioarg_t *uspace_io_arg); |
extern __native sys_preempt_control(int enable); |
unative_t sys_physmem_map(unative_t phys_base, unative_t virt_base, unative_t pages, |
unative_t flags); |
extern unative_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg); |
extern unative_t sys_preempt_control(int enable); |
/* |
* Interface to be implemented by all architectures. |
*/ |
extern int ddi_iospace_enable_arch(task_t *task, __address ioaddr, size_t size); |
extern int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size); |
#endif |
/kernel/trunk/generic/include/console/chardev.h |
---|
59,7 → 59,7 |
waitq_t wq; |
SPINLOCK_DECLARE(lock); /**< Protects everything below. */ |
__u8 buffer[CHARDEV_BUFLEN]; |
uint8_t buffer[CHARDEV_BUFLEN]; |
count_t counter; |
chardev_operations_t *op; /**< Implementation of chardev operations. */ |
index_t index; |
69,7 → 69,7 |
extern void chardev_initialize(char *name, |
chardev_t *chardev, |
chardev_operations_t *op); |
extern void chardev_push_character(chardev_t *chardev, __u8 ch); |
extern void chardev_push_character(chardev_t *chardev, uint8_t ch); |
#endif /* __CHARDEV_H__ */ |
/kernel/trunk/generic/include/console/kconsole.h |
---|
54,7 → 54,7 |
cmd_arg_type_t type; /**< Type descriptor. */ |
void *buffer; /**< Buffer where to store data. */ |
size_t len; /**< Size of the buffer. */ |
__native intval; /**< Integer value */ |
unative_t intval; /**< Integer value */ |
cmd_arg_type_t vartype; /**< Resulting type of variable arg */ |
}; |
/kernel/trunk/generic/include/console/console.h |
---|
41,8 → 41,8 |
extern chardev_t *stdin; |
extern chardev_t *stdout; |
extern __u8 getc(chardev_t *chardev); |
__u8 _getc(chardev_t *chardev); |
extern uint8_t getc(chardev_t *chardev); |
uint8_t _getc(chardev_t *chardev); |
extern count_t gets(chardev_t *chardev, char *buf, size_t buflen); |
extern void putchar(char c); |
/kernel/trunk/generic/include/security/cap.h |
---|
79,13 → 79,13 |
*/ |
#define CAP_IRQ_REG (1<<4) |
typedef __u32 cap_t; |
typedef uint32_t cap_t; |
extern void cap_set(task_t *t, cap_t caps); |
extern cap_t cap_get(task_t *t); |
extern __native sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps); |
extern __native sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps); |
extern unative_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps); |
extern unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps); |
#endif |
/kernel/trunk/generic/include/adt/hash_table.h |
---|
55,7 → 55,7 |
* |
* @return Index into hash table. |
*/ |
index_t (* hash)(__native key[]); |
index_t (* hash)(unative_t key[]); |
/** Hash table item comparison function. |
* |
63,7 → 63,7 |
* |
* @return true if the keys match, false otherwise. |
*/ |
bool (*compare)(__native key[], count_t keys, link_t *item); |
bool (*compare)(unative_t key[], count_t keys, link_t *item); |
/** Hash table item removal callback. |
* |
75,9 → 75,9 |
#define hash_table_get_instance(item, type, member) list_get_instance((item), type, member) |
extern void hash_table_create(hash_table_t *h, count_t m, count_t max_keys, hash_table_operations_t *op); |
extern void hash_table_insert(hash_table_t *h, __native key[], link_t *item); |
extern link_t *hash_table_find(hash_table_t *h, __native key[]); |
extern void hash_table_remove(hash_table_t *h, __native key[], count_t keys); |
extern void hash_table_insert(hash_table_t *h, unative_t key[], link_t *item); |
extern link_t *hash_table_find(hash_table_t *h, unative_t key[]); |
extern void hash_table_remove(hash_table_t *h, unative_t key[], count_t keys); |
#endif |
/kernel/trunk/generic/include/adt/list.h |
---|
175,7 → 175,7 |
headless_list_split_or_concat(part1, part2); |
} |
#define list_get_instance(link,type,member) (type *)(((__u8*)(link))-((__u8*)&(((type *)NULL)->member))) |
#define list_get_instance(link,type,member) (type *)(((uint8_t*)(link))-((uint8_t*)&(((type *)NULL)->member))) |
extern bool list_member(const link_t *link, const link_t *head); |
extern void list_concat(link_t *head1, link_t *head2); |
/kernel/trunk/generic/include/adt/bitmap.h |
---|
41,11 → 41,11 |
#define BITS2BYTES(bits) (bits ? ((((bits)-1)>>3)+1) : 0) |
typedef struct { |
__u8 *map; |
uint8_t *map; |
count_t bits; |
} bitmap_t; |
extern void bitmap_initialize(bitmap_t *bitmap, __u8 *map, count_t bits); |
extern void bitmap_initialize(bitmap_t *bitmap, uint8_t *map, count_t bits); |
extern void bitmap_set_range(bitmap_t *bitmap, index_t start, count_t bits); |
extern void bitmap_clear_range(bitmap_t *bitmap, index_t start, count_t bits); |
extern void bitmap_copy(bitmap_t *dst, bitmap_t *src, count_t bits); |
/kernel/trunk/generic/include/adt/btree.h |
---|
42,7 → 42,7 |
#define BTREE_M 5 |
#define BTREE_MAX_KEYS (BTREE_M - 1) |
typedef __u64 btree_key_t; |
typedef uint64_t btree_key_t; |
/** B-tree node structure. */ |
struct btree_node { |
/kernel/trunk/generic/include/mm/frame.h |
---|
65,12 → 65,12 |
#define FRAME_NO_MEMORY 1 /* frame_alloc return status */ |
#define FRAME_ERROR 2 /* frame_alloc return status */ |
static inline __address PFN2ADDR(pfn_t frame) |
static inline uintptr_t PFN2ADDR(pfn_t frame) |
{ |
return (__address)(frame << FRAME_WIDTH); |
return (uintptr_t)(frame << FRAME_WIDTH); |
} |
static inline pfn_t ADDR2PFN(__address addr) |
static inline pfn_t ADDR2PFN(uintptr_t addr) |
{ |
return (pfn_t)(addr >> FRAME_WIDTH); |
} |
82,7 → 82,7 |
return (count_t)((size-1) >> FRAME_WIDTH)+1; |
} |
#define IS_BUDDY_ORDER_OK(index, order) ((~(((__native) -1) << (order)) & (index)) == 0) |
#define IS_BUDDY_ORDER_OK(index, order) ((~(((unative_t) -1) << (order)) & (index)) == 0) |
#define IS_BUDDY_LEFT_BLOCK(zone, frame) (((frame_index((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0) |
#define IS_BUDDY_RIGHT_BLOCK(zone, frame) (((frame_index((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 1) |
#define IS_BUDDY_LEFT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0) |
91,8 → 91,8 |
#define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL) |
extern void frame_init(void); |
extern void * frame_alloc_generic(__u8 order, int flags, int *pzone); |
extern void frame_free(__address frame); |
extern void * frame_alloc_generic(uint8_t order, int flags, int *pzone); |
extern void frame_free(uintptr_t frame); |
extern void frame_reference_add(pfn_t pfn); |
extern int zone_create(pfn_t start, count_t count, pfn_t confframe, int flags); |
99,7 → 99,7 |
void * frame_get_parent(pfn_t frame, int hint); |
void frame_set_parent(pfn_t frame, void *data, int hint); |
void frame_mark_unavailable(pfn_t start, count_t count); |
__address zone_conf_size(count_t count); |
uintptr_t zone_conf_size(count_t count); |
void zone_merge(int z1, int z2); |
void zone_merge_all(void); |
/kernel/trunk/generic/include/mm/page.h |
---|
76,9 → 76,9 |
/** Operations to manipulate page mappings. */ |
struct page_mapping_operations { |
void (* mapping_insert)(as_t *as, __address page, __address frame, int flags); |
void (* mapping_remove)(as_t *as, __address page); |
pte_t *(* mapping_find)(as_t *as, __address page); |
void (* mapping_insert)(as_t *as, uintptr_t page, uintptr_t frame, int flags); |
void (* mapping_remove)(as_t *as, uintptr_t page); |
pte_t *(* mapping_find)(as_t *as, uintptr_t page); |
}; |
typedef struct page_mapping_operations page_mapping_operations_t; |
87,13 → 87,13 |
extern void page_init(void); |
extern void page_table_lock(as_t *as, bool lock); |
extern void page_table_unlock(as_t *as, bool unlock); |
extern void page_mapping_insert(as_t *as, __address page, __address frame, int flags); |
extern void page_mapping_remove(as_t *as, __address page); |
extern pte_t *page_mapping_find(as_t *as, __address page); |
extern void page_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags); |
extern void page_mapping_remove(as_t *as, uintptr_t page); |
extern pte_t *page_mapping_find(as_t *as, uintptr_t page); |
extern pte_t *page_table_create(int flags); |
extern void page_table_destroy(pte_t *page_table); |
extern void map_structure(__address s, size_t size); |
extern __address hw_map(__address physaddr, size_t size); |
extern void map_structure(uintptr_t s, size_t size); |
extern uintptr_t hw_map(uintptr_t physaddr, size_t size); |
#endif |
/kernel/trunk/generic/include/mm/slab.h |
---|
90,7 → 90,7 |
int flags; /**< Flags changing behaviour of cache */ |
/* Computed values */ |
__u8 order; /**< Order of frames to be allocated */ |
uint8_t order; /**< Order of frames to be allocated */ |
int objects; /**< Number of objects that fit in */ |
/* Statistics */ |
/kernel/trunk/generic/include/mm/tlb.h |
---|
58,7 → 58,7 |
struct tlb_shootdown_msg { |
tlb_invalidate_type_t type; /**< Message type. */ |
asid_t asid; /**< Address space identifier. */ |
__address page; /**< Page address. */ |
uintptr_t page; /**< Page address. */ |
count_t count; /**< Number of pages to invalidate. */ |
}; |
typedef struct tlb_shootdown_msg tlb_shootdown_msg_t; |
66,7 → 66,7 |
extern void tlb_init(void); |
#ifdef CONFIG_SMP |
extern void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, __address page, count_t count); |
extern void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, uintptr_t page, count_t count); |
extern void tlb_shootdown_finalize(void); |
extern void tlb_shootdown_ipi_recv(void); |
#else |
83,7 → 83,7 |
extern void tlb_invalidate_all(void); |
extern void tlb_invalidate_asid(asid_t asid); |
extern void tlb_invalidate_pages(asid_t asid, __address page, count_t cnt); |
extern void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt); |
#endif |
/** @} |
/kernel/trunk/generic/include/mm/as.h |
---|
123,8 → 123,8 |
/** Address space area backend structure. */ |
typedef struct { |
int (* page_fault)(as_area_t *area, __address addr, pf_access_t access); |
void (* frame_free)(as_area_t *area, __address page, __address frame); |
int (* page_fault)(as_area_t *area, uintptr_t addr, pf_access_t access); |
void (* frame_free)(as_area_t *area, uintptr_t page, uintptr_t frame); |
void (* share)(as_area_t *area); |
} mem_backend_t; |
135,7 → 135,7 |
elf_segment_header_t *segment; |
}; |
struct { /**< phys_backend members */ |
__address base; |
uintptr_t base; |
count_t frames; |
}; |
} mem_backend_data_t; |
151,7 → 151,7 |
int flags; /**< Flags related to the memory represented by the address space area. */ |
int attributes; /**< Attributes related to the address space area itself. */ |
count_t pages; /**< Size of this area in multiples of PAGE_SIZE. */ |
__address base; /**< Base address of this area. */ |
uintptr_t base; /**< Base address of this area. */ |
btree_t used_space; /**< Map of used space. */ |
share_info_t *sh_info; /**< If the address space area has been shared, this pointer will |
reference the share info structure. */ |
172,20 → 172,20 |
extern as_t *as_create(int flags); |
extern void as_destroy(as_t *as); |
extern void as_switch(as_t *old, as_t *new); |
extern int as_page_fault(__address page, pf_access_t access, istate_t *istate); |
extern int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate); |
extern as_area_t *as_area_create(as_t *as, int flags, size_t size, __address base, int attrs, |
extern as_area_t *as_area_create(as_t *as, int flags, size_t size, uintptr_t base, int attrs, |
mem_backend_t *backend, mem_backend_data_t *backend_data); |
extern int as_area_destroy(as_t *as, __address address); |
extern int as_area_resize(as_t *as, __address address, size_t size, int flags); |
int as_area_share(as_t *src_as, __address src_base, size_t acc_size, |
as_t *dst_as, __address dst_base, int dst_flags_mask); |
extern int as_area_destroy(as_t *as, uintptr_t address); |
extern int as_area_resize(as_t *as, uintptr_t address, size_t size, int flags); |
int as_area_share(as_t *src_as, uintptr_t src_base, size_t acc_size, |
as_t *dst_as, uintptr_t dst_base, int dst_flags_mask); |
extern int as_area_get_flags(as_area_t *area); |
extern bool as_area_check_access(as_area_t *area, pf_access_t access); |
extern size_t as_get_size(__address base); |
extern int used_space_insert(as_area_t *a, __address page, count_t count); |
extern int used_space_remove(as_area_t *a, __address page, count_t count); |
extern size_t as_get_size(uintptr_t base); |
extern int used_space_insert(as_area_t *a, uintptr_t page, count_t count); |
extern int used_space_remove(as_area_t *a, uintptr_t page, count_t count); |
/* Interface to be implemented by architectures. */ |
#ifndef as_install_arch |
198,9 → 198,9 |
extern mem_backend_t phys_backend; |
/* Address space area related syscalls. */ |
extern __native sys_as_area_create(__address address, size_t size, int flags); |
extern __native sys_as_area_resize(__address address, size_t size, int flags); |
extern __native sys_as_area_destroy(__address address); |
extern unative_t sys_as_area_create(uintptr_t address, size_t size, int flags); |
extern unative_t sys_as_area_resize(uintptr_t address, size_t size, int flags); |
extern unative_t sys_as_area_destroy(uintptr_t address); |
#endif /* KERNEL */ |
/kernel/trunk/generic/include/mm/buddy.h |
---|
45,17 → 45,17 |
link_t *(* find_buddy)(buddy_system_t *, link_t *); /**< Return pointer to left-side or right-side buddy for block passed as argument. */ |
link_t *(* bisect)(buddy_system_t *, link_t *); /**< Bisect the block passed as argument and return pointer to the new right-side buddy. */ |
link_t *(* coalesce)(buddy_system_t *, link_t *, link_t *); /**< Coalesce two buddies into a bigger block. */ |
void (*set_order)(buddy_system_t *, link_t *, __u8); /**< Set order of block passed as argument. */ |
__u8 (*get_order)(buddy_system_t *, link_t *); /**< Return order of block passed as argument. */ |
void (*set_order)(buddy_system_t *, link_t *, uint8_t); /**< Set order of block passed as argument. */ |
uint8_t (*get_order)(buddy_system_t *, link_t *); /**< Return order of block passed as argument. */ |
void (*mark_busy)(buddy_system_t *, link_t *); /**< Mark block as busy. */ |
void (*mark_available)(buddy_system_t *, link_t *); /**< Mark block as available. */ |
/** Find parent of block that has given order */ |
link_t *(* find_block)(buddy_system_t *, link_t *, __u8); |
link_t *(* find_block)(buddy_system_t *, link_t *, uint8_t); |
void (* print_id)(buddy_system_t *, link_t *); |
}; |
struct buddy_system { |
__u8 max_order; /**< Maximal order of block which can be stored by buddy system. */ |
uint8_t max_order; /**< Maximal order of block which can be stored by buddy system. */ |
link_t *order; |
buddy_system_operations_t *op; |
void *data; /**< Pointer to be used by the implementation. */ |
62,10 → 62,10 |
}; |
extern void buddy_system_create(buddy_system_t *b, |
__u8 max_order, |
uint8_t max_order, |
buddy_system_operations_t *op, void *data); |
extern link_t *buddy_system_alloc(buddy_system_t *b, __u8 i); |
extern bool buddy_system_can_alloc(buddy_system_t *b, __u8 order); |
extern link_t *buddy_system_alloc(buddy_system_t *b, uint8_t i); |
extern bool buddy_system_can_alloc(buddy_system_t *b, uint8_t order); |
extern void buddy_system_free(buddy_system_t *b, link_t *block); |
extern void buddy_system_structure_print(buddy_system_t *b, size_t elem_size); |
extern size_t buddy_conf_size(int max_order); |
/kernel/trunk/generic/include/macros.h |
---|
46,10 → 46,10 |
#define max(a,b) ((a)>(b)?(a):(b)) |
/** Return true if the interlvals overlap. */ |
static inline int overlaps(__address s1, size_t sz1, __address s2, size_t sz2) |
static inline int overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2) |
{ |
__address e1 = s1+sz1; |
__address e2 = s2+sz2; |
uintptr_t e1 = s1+sz1; |
uintptr_t e2 = s2+sz2; |
return s1 < e2 && s2 < e1; |
} |
/kernel/trunk/generic/include/context.h |
---|
42,8 → 42,8 |
#ifndef context_set |
#define context_set(c, _pc, stack, size) \ |
(c)->pc = (__address) (_pc); \ |
(c)->sp = ((__address) (stack)) + (size) - SP_DELTA; |
(c)->pc = (uintptr_t) (_pc); \ |
(c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; |
#endif /* context_set */ |
extern int context_save_arch(context_t *c); |
/kernel/trunk/generic/include/syscall/syscall.h |
---|
73,12 → 73,12 |
#include <arch/types.h> |
#include <typedefs.h> |
typedef __native (*syshandler_t)(); |
typedef unative_t (*syshandler_t)(); |
extern syshandler_t syscall_table[SYSCALL_END]; |
extern __native syscall_handler(__native a1, __native a2, __native a3, |
__native a4, __native id); |
extern __native sys_tls_set(__native addr); |
extern unative_t syscall_handler(unative_t a1, unative_t a2, unative_t a3, |
unative_t a4, unative_t id); |
extern unative_t sys_tls_set(unative_t addr); |
#endif |
/kernel/trunk/generic/include/ipc/sysipc.h |
---|
39,22 → 39,22 |
#include <ipc/irq.h> |
#include <arch/types.h> |
__native sys_ipc_call_sync_fast(__native phoneid, __native method, |
__native arg1, ipc_data_t *data); |
__native sys_ipc_call_sync(__native phoneid, ipc_data_t *question, |
unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method, |
unative_t arg1, ipc_data_t *data); |
unative_t sys_ipc_call_sync(unative_t phoneid, ipc_data_t *question, |
ipc_data_t *reply); |
__native sys_ipc_call_async_fast(__native phoneid, __native method, |
__native arg1, __native arg2); |
__native sys_ipc_call_async(__native phoneid, ipc_data_t *data); |
__native sys_ipc_answer_fast(__native callid, __native retval, |
__native arg1, __native arg2); |
__native sys_ipc_answer(__native callid, ipc_data_t *data); |
__native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32 usec, int nonblocking); |
__native sys_ipc_forward_fast(__native callid, __native phoneid, |
__native method, __native arg1); |
__native sys_ipc_hangup(int phoneid); |
__native sys_ipc_register_irq(int irq, irq_code_t *ucode); |
__native sys_ipc_unregister_irq(int irq); |
unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method, |
unative_t arg1, unative_t arg2); |
unative_t sys_ipc_call_async(unative_t phoneid, ipc_data_t *data); |
unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval, |
unative_t arg1, unative_t arg2); |
unative_t sys_ipc_answer(unative_t callid, ipc_data_t *data); |
unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int nonblocking); |
unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid, |
unative_t method, unative_t arg1); |
unative_t sys_ipc_hangup(int phoneid); |
unative_t sys_ipc_register_irq(int irq, irq_code_t *ucode); |
unative_t sys_ipc_unregister_irq(int irq); |
#endif |
/kernel/trunk/generic/include/ipc/ipc.h |
---|
164,7 → 164,7 |
typedef struct answerbox_s answerbox_t; |
typedef struct phone_s phone_t; |
typedef struct { |
__native args[IPC_CALL_LEN]; |
unative_t args[IPC_CALL_LEN]; |
phone_t *phone; |
}ipc_data_t; |
214,13 → 214,13 |
*/ |
answerbox_t *callerbox; |
__native private; /**< Private data to internal IPC */ |
unative_t private; /**< Private data to internal IPC */ |
ipc_data_t data; /**< Data passed from/to userspace */ |
}call_t; |
extern void ipc_init(void); |
extern call_t * ipc_wait_for_call(answerbox_t *box, __u32 usec, int flags); |
extern call_t * ipc_wait_for_call(answerbox_t *box, uint32_t usec, int flags); |
extern void ipc_answer(answerbox_t *box, call_t *request); |
extern int ipc_call(phone_t *phone, call_t *call); |
extern void ipc_call_sync(phone_t *phone, call_t *request); |
234,7 → 234,7 |
extern int ipc_forward(call_t *call, phone_t *newphone, answerbox_t *oldbox); |
void ipc_cleanup(void); |
int ipc_phone_hangup(phone_t *phone); |
extern void ipc_backsend_err(phone_t *phone, call_t *call, __native err); |
extern void ipc_backsend_err(phone_t *phone, call_t *call, unative_t err); |
extern void ipc_print_task(task_id_t taskid); |
extern answerbox_t *ipc_phone_0; |
/kernel/trunk/generic/include/ipc/irq.h |
---|
79,9 → 79,9 |
extern void ipc_irq_make_table(int irqcount); |
extern int ipc_irq_register(answerbox_t *box, int irq, irq_code_t *ucode); |
extern void ipc_irq_send_notif(int irq); |
extern void ipc_irq_send_msg(int irq, __native a1, __native a2, __native a3); |
extern void ipc_irq_send_msg(int irq, unative_t a1, unative_t a2, unative_t a3); |
extern void ipc_irq_unregister(answerbox_t *box, int irq); |
extern void irq_ipc_bind_arch(__native irq); |
extern void irq_ipc_bind_arch(unative_t irq); |
extern void ipc_irq_cleanup(answerbox_t *box); |
#endif |
/kernel/trunk/generic/include/ipc/ipcrsc.h |
---|
35,7 → 35,7 |
#ifndef __IPCRSC_H__ |
#define __IPCRSC_H__ |
call_t * get_call(__native callid); |
call_t * get_call(unative_t callid); |
int phone_alloc(void); |
void phone_connect(int phoneid, answerbox_t *box); |
void phone_dealloc(int phoneid); |
/kernel/trunk/generic/include/sort.h |
---|
47,9 → 47,9 |
* default sorting comparators |
*/ |
extern int int_cmp(void * a, void * b); |
extern int __u32_cmp(void * a, void * b); |
extern int __u16_cmp(void * a, void * b); |
extern int __u8_cmp(void * a, void * b); |
extern int uint32_t_cmp(void * a, void * b); |
extern int uint16_t_cmp(void * a, void * b); |
extern int uint8_t_cmp(void * a, void * b); |
#endif |