/kernel/trunk/arch/mips32/include/exception.h |
---|
62,45 → 62,45 |
#define EXC_VCED 31 |
struct istate { |
__u32 at; |
__u32 v0; |
__u32 v1; |
__u32 a0; |
__u32 a1; |
__u32 a2; |
__u32 a3; |
__u32 t0; |
__u32 t1; |
__u32 t2; |
__u32 t3; |
__u32 t4; |
__u32 t5; |
__u32 t6; |
__u32 t7; |
__u32 s0; |
__u32 s1; |
__u32 s2; |
__u32 s3; |
__u32 s4; |
__u32 s5; |
__u32 s6; |
__u32 s7; |
__u32 t8; |
__u32 t9; |
__u32 gp; |
__u32 sp; |
__u32 s8; |
__u32 ra; |
uint32_t at; |
uint32_t v0; |
uint32_t v1; |
uint32_t a0; |
uint32_t a1; |
uint32_t a2; |
uint32_t a3; |
uint32_t t0; |
uint32_t t1; |
uint32_t t2; |
uint32_t t3; |
uint32_t t4; |
uint32_t t5; |
uint32_t t6; |
uint32_t t7; |
uint32_t s0; |
uint32_t s1; |
uint32_t s2; |
uint32_t s3; |
uint32_t s4; |
uint32_t s5; |
uint32_t s6; |
uint32_t s7; |
uint32_t t8; |
uint32_t t9; |
uint32_t gp; |
uint32_t sp; |
uint32_t s8; |
uint32_t ra; |
__u32 lo; |
__u32 hi; |
uint32_t lo; |
uint32_t hi; |
__u32 status; /* cp0_status */ |
__u32 epc; /* cp0_epc */ |
__u32 k1; /* We use it as thread-local pointer */ |
uint32_t status; /* cp0_status */ |
uint32_t epc; /* cp0_epc */ |
uint32_t k1; /* We use it as thread-local pointer */ |
}; |
static inline void istate_set_retaddr(istate_t *istate, __address retaddr) |
static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) |
{ |
istate->epc = retaddr; |
} |
110,7 → 110,7 |
{ |
return istate->status & cp0_status_um_bit; |
} |
static inline __native istate_get_pc(istate_t *istate) |
static inline unative_t istate_get_pc(istate_t *istate) |
{ |
return istate->epc; |
} |
/kernel/trunk/arch/mips32/include/fpu_context.h |
---|
37,11 → 37,11 |
#include <arch/types.h> |
#define FPU_CONTEXT_ALIGN sizeof(__native) |
#define FPU_CONTEXT_ALIGN sizeof(unative_t) |
struct fpu_context { |
__native dregs[32]; |
__native cregs[32]; |
unative_t dregs[32]; |
unative_t cregs[32]; |
}; |
#endif |
/kernel/trunk/arch/mips32/include/byteorder.h |
---|
39,19 → 39,19 |
#include <byteorder.h> |
#ifdef BIG_ENDIAN |
static inline __u64 __u64_le2host(__u64 n) |
static inline uint64_t uint64_t_le2host(uint64_t n) |
{ |
return __u64_byteorder_swap(n); |
return uint64_t_byteorder_swap(n); |
} |
static inline __native __native_le2host(__native n) |
static inline unative_t unative_t_le2host(unative_t n) |
{ |
return __u32_byteorder_swap(n); |
return uint32_t_byteorder_swap(n); |
} |
#else |
# define __native_le2host(n) (n) |
# define __u64_le2host(n) (n) |
# define unative_t_le2host(n) (n) |
# define uint64_t_le2host(n) (n) |
#endif |
#endif |
/kernel/trunk/arch/mips32/include/boot.h |
---|
34,12 → 34,12 |
#include <arch/types.h> |
typedef struct { |
__address addr; |
__u32 size; |
uintptr_t addr; |
uint32_t size; |
} utask_t; |
typedef struct { |
__u32 cnt; |
uint32_t cnt; |
utask_t tasks[TASKMAP_MAX_RECORDS]; |
} bootinfo_t; |
/kernel/trunk/arch/mips32/include/types.h |
---|
37,28 → 37,28 |
#define NULL 0 |
typedef signed char __s8; |
typedef unsigned char __u8; |
typedef signed char int8_t; |
typedef unsigned char uint8_t; |
typedef signed short __s16; |
typedef unsigned short __u16; |
typedef signed short int16_t; |
typedef unsigned short uint16_t; |
typedef unsigned long __u32; |
typedef signed long __s32; |
typedef unsigned long uint32_t; |
typedef signed long int32_t; |
typedef unsigned long long __u64; |
typedef signed long long __s64; |
typedef unsigned long long uint64_t; |
typedef signed long long int64_t; |
typedef __u32 __address; |
typedef uint32_t uintptr_t; |
typedef __u32 ipl_t; |
typedef uint32_t ipl_t; |
typedef __u32 __native; |
typedef __s32 __snative; |
typedef uint32_t unative_t; |
typedef int32_t native_t; |
typedef struct pte pte_t; |
typedef __u32 pfn_t; |
typedef uint32_t pfn_t; |
#endif |
/kernel/trunk/arch/mips32/include/memstr.h |
---|
37,10 → 37,10 |
#define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) |
extern void memsetw(__address dst, size_t cnt, __u16 x); |
extern void memsetb(__address dst, size_t cnt, __u8 x); |
extern void memsetw(uintptr_t dst, size_t cnt, uint16_t x); |
extern void memsetb(uintptr_t dst, size_t cnt, uint8_t x); |
extern int memcmp(__address src, __address dst, int cnt); |
extern int memcmp(uintptr_t src, uintptr_t dst, int cnt); |
#endif |
/kernel/trunk/arch/mips32/include/arg.h |
---|
42,13 → 42,13 |
* To satisfy this, paddings must be sometimes inserted. |
*/ |
typedef __address va_list; |
typedef uintptr_t va_list; |
#define va_start(ap, lst) \ |
((ap) = (va_list)&(lst) + sizeof(lst)) |
#define va_arg(ap, type) \ |
(((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((__address)((ap) + 2*4 - 1) & (~3)) : ((__address)((ap) + 2*8 -1) & (~7)) )))[-1]) |
(((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((uintptr_t)((ap) + 2*4 - 1) & (~3)) : ((uintptr_t)((ap) + 2*8 -1) & (~7)) )))[-1]) |
#define va_copy(dst,src) ((dst)=(src)) |
/kernel/trunk/arch/mips32/include/asm.h |
---|
52,9 → 52,9 |
* The stack is assumed to be STACK_SIZE bytes long. |
* The stack must start on page boundary. |
*/ |
static inline __address get_stack_base(void) |
static inline uintptr_t get_stack_base(void) |
{ |
__address v; |
uintptr_t v; |
__asm__ volatile ("and %0, $29, %1\n" : "=r" (v) : "r" (~(STACK_SIZE-1))); |
62,9 → 62,9 |
} |
extern void cpu_halt(void); |
extern void asm_delay_loop(__u32 t); |
extern void userspace_asm(__address ustack, __address uspace_uarg, |
__address entry); |
extern void asm_delay_loop(uint32_t t); |
extern void userspace_asm(uintptr_t ustack, uintptr_t uspace_uarg, |
uintptr_t entry); |
#endif |
/kernel/trunk/arch/mips32/include/faddr.h |
---|
37,7 → 37,7 |
#include <arch/types.h> |
#define FADDR(fptr) ((__address) (fptr)) |
#define FADDR(fptr) ((uintptr_t) (fptr)) |
#endif |
/kernel/trunk/arch/mips32/include/cp0.h |
---|
63,14 → 63,14 |
#define cp0_mask_int(it) cp0_status_write(cp0_status_read() & ~(1<<(cp0_status_im_shift+(it)))) |
#define cp0_unmask_int(it) cp0_status_write(cp0_status_read() | (1<<(cp0_status_im_shift+(it)))) |
#define GEN_READ_CP0(nm,reg) static inline __u32 cp0_ ##nm##_read(void) \ |
#define GEN_READ_CP0(nm,reg) static inline uint32_t cp0_ ##nm##_read(void) \ |
{ \ |
__u32 retval; \ |
uint32_t retval; \ |
asm("mfc0 %0, $" #reg : "=r"(retval)); \ |
return retval; \ |
} |
#define GEN_WRITE_CP0(nm,reg) static inline void cp0_ ##nm##_write(__u32 val) \ |
#define GEN_WRITE_CP0(nm,reg) static inline void cp0_ ##nm##_write(uint32_t val) \ |
{ \ |
asm("mtc0 %0, $" #reg : : "r"(val) ); \ |
} |
/kernel/trunk/arch/mips32/include/mm/page.h |
---|
41,8 → 41,8 |
#define PAGE_SIZE FRAME_SIZE |
#ifndef __ASM__ |
# define KA2PA(x) (((__address) (x)) - 0x80000000) |
# define PA2KA(x) (((__address) (x)) + 0x80000000) |
# define KA2PA(x) (((uintptr_t) (x)) - 0x80000000) |
# define PA2KA(x) (((uintptr_t) (x)) + 0x80000000) |
#else |
# define KA2PA(x) ((x) - 0x80000000) |
# define PA2KA(x) ((x) + 0x80000000) |
100,7 → 100,7 |
#define SET_PTL3_FLAGS_ARCH(ptl2, i, x) |
#define SET_FRAME_FLAGS_ARCH(ptl3, i, x) set_pt_flags((pte_t *)(ptl3), (index_t)(i), (x)) |
#define PTE_VALID_ARCH(pte) (*((__u32 *) (pte)) != 0) |
#define PTE_VALID_ARCH(pte) (*((uint32_t *) (pte)) != 0) |
#define PTE_PRESENT_ARCH(pte) ((pte)->p != 0) |
#define PTE_GET_FRAME_ARCH(pte) ((pte)->pfn<<12) |
#define PTE_WRITABLE_ARCH(pte) ((pte)->w != 0) |
/kernel/trunk/arch/mips32/include/mm/asid.h |
---|
39,7 → 39,7 |
#define ASID_MAX_ARCH 255 /* 2^8 - 1 */ |
typedef __u8 asid_t; |
typedef uint8_t asid_t; |
#endif |
/kernel/trunk/arch/mips32/include/mm/tlb.h |
---|
75,7 → 75,7 |
unsigned : 2; /* zero */ |
#endif |
} __attribute__ ((packed)); |
__u32 value; |
uint32_t value; |
}; |
/** Page Table Entry. */ |
103,7 → 103,7 |
unsigned vpn2 : 19; |
#endif |
} __attribute__ ((packed)); |
__u32 value; |
uint32_t value; |
}; |
union page_mask { |
118,7 → 118,7 |
unsigned : 7; |
#endif |
} __attribute__ ((packed)); |
__u32 value; |
uint32_t value; |
}; |
union index { |
133,7 → 133,7 |
unsigned p : 1; |
#endif |
} __attribute__ ((packed)); |
__u32 value; |
uint32_t value; |
}; |
/** Probe TLB for Matching Entry |
/kernel/trunk/arch/mips32/include/debugger.h |
---|
50,9 → 50,9 |
#define BKPOINT_FUNCCALL (1 << 3) /**< Call a predefined function */ |
typedef struct { |
__address address; /**< Breakpoint address */ |
__native instruction; /**< Original instruction */ |
__native nextinstruction; /**< Original instruction following break */ |
uintptr_t address; /**< Breakpoint address */ |
unative_t instruction; /**< Original instruction */ |
unative_t nextinstruction; /**< Original instruction following break */ |
int flags; /**< Flags regarding breakpoint */ |
count_t counter; |
void (*bkfunc)(void *b, istate_t *istate); |
/kernel/trunk/arch/mips32/include/context.h |
---|
55,19 → 55,19 |
* function calls. |
*/ |
struct context { |
__address sp; |
__address pc; |
uintptr_t sp; |
uintptr_t pc; |
__u32 s0; |
__u32 s1; |
__u32 s2; |
__u32 s3; |
__u32 s4; |
__u32 s5; |
__u32 s6; |
__u32 s7; |
__u32 s8; |
__u32 gp; |
uint32_t s0; |
uint32_t s1; |
uint32_t s2; |
uint32_t s3; |
uint32_t s4; |
uint32_t s5; |
uint32_t s6; |
uint32_t s7; |
uint32_t s8; |
uint32_t gp; |
ipl_t ipl; |
}; |
/kernel/trunk/arch/mips32/include/cpu.h |
---|
38,8 → 38,8 |
#include <arch/types.h> |
struct cpu_arch { |
__u32 imp_num; |
__u32 rev_num; |
uint32_t imp_num; |
uint32_t rev_num; |
}; |
#endif |
/kernel/trunk/arch/mips32/include/drivers/arc.h |
---|
56,9 → 56,9 |
}cm_resource_type; |
typedef struct { |
__u8 type; |
__u8 sharedisposition; |
__u16 flags; |
uint8_t type; |
uint8_t sharedisposition; |
uint16_t flags; |
union { |
struct { |
long long start; /* 64-bit phys address */ |
77,8 → 77,8 |
}__attribute__ ((packed)) cm_resource_descriptor; |
typedef struct { |
__u16 version; |
__u16 revision; |
uint16_t version; |
uint16_t revision; |
unsigned long count; |
cm_resource_descriptor descr[1]; |
}__attribute__ ((packed)) cm_resource_list; |
153,23 → 153,23 |
arc_component_class class; |
arc_component_type type; |
arc_component_flags flags; |
__u16 revision; |
__u16 version; |
__u32 key; |
__u32 affinitymask; |
__u32 configdatasize; |
__u32 identifier_len; |
uint16_t revision; |
uint16_t version; |
uint32_t key; |
uint32_t affinitymask; |
uint32_t configdatasize; |
uint32_t identifier_len; |
char *identifier; |
} __attribute__ ((packed)) arc_component; |
typedef struct { |
__u16 year; |
__u16 month; |
__u16 day; |
__u16 hour; |
__u16 minutes; |
__u16 seconds; |
__u16 mseconds; |
uint16_t year; |
uint16_t month; |
uint16_t day; |
uint16_t hour; |
uint16_t minutes; |
uint16_t seconds; |
uint16_t mseconds; |
} __attribute__ ((packed)) arc_timeinfo; |
/* This is the SGI block structure, WinNT has it different */ |
186,8 → 186,8 |
typedef struct { |
arc_memorytype_t type; |
__u32 basepage; /* *4096 = baseaddr */ |
__u32 basecount; |
uint32_t basepage; /* *4096 = baseaddr */ |
uint32_t basecount; |
}arc_memdescriptor_t; |
typedef struct { |
197,9 → 197,9 |
typedef struct { |
long (*load)(void); /* ... */ |
long (*invoke)(__u32 eaddr,__u32 saddr,__u32 argc,char **argv, |
long (*invoke)(uint32_t eaddr,uint32_t saddr,uint32_t argc,char **argv, |
char **envp); |
long (*execute)(char *path,__u32 argc,char **argv,char **envp); |
long (*execute)(char *path,uint32_t argc,char **argv,char **envp); |
void (*halt)(void); |
void (*powerdown)(void); |
void (*restart)(void); |
221,13 → 221,13 |
/* 20 */ |
long (*reserved2)(void); |
arc_timeinfo * (*gettime)(void); |
__u32 (*getrelativetime)(void); |
uint32_t (*getrelativetime)(void); |
long (*getdirectoryentry)(); |
long (*open)(void); /* ... */ |
long (*close)(__u32 fileid); |
long (*read)(__u32 fileid,void *buf,__u32 n,__u32 *cnt); |
long (*getreadstatus)(__u32 fileid); |
long (*write)(__u32 fileid, void *buf,__u32 n,__u32 *cnt); |
long (*close)(uint32_t fileid); |
long (*read)(uint32_t fileid,void *buf,uint32_t n,uint32_t *cnt); |
long (*getreadstatus)(uint32_t fileid); |
long (*write)(uint32_t fileid, void *buf,uint32_t n,uint32_t *cnt); |
long (*seek)(void); /* ... */ |
/* 30 */ |
long (*mount)(void); /* ... */ |
234,7 → 234,7 |
char * (*getenvironmentvariable)(char *name); |
char * (*setenvironmentvariable)(char *name, char *value); |
long (*getfileinformation)(void); /* ... */ |
long (*setfileinformation)(__u32 fileid,__u32 attflags,__u32 attmask); |
long (*setfileinformation)(uint32_t fileid,uint32_t attflags,uint32_t attmask); |
void (*flushallcaches)(void); |
long (*testunicodecharacter)(void); /* ... */ |
long (*getdisplaystatus)(void); /* ... */ |
241,19 → 241,19 |
} arc_func_vector_t; |
typedef struct { |
__u32 signature; |
__u32 length; |
__u16 version; |
__u16 revision; |
uint32_t signature; |
uint32_t length; |
uint16_t version; |
uint16_t revision; |
void *restartblock; |
void *debugblock; |
void *gevector; |
void *utlbmissvector; |
__u32 firmwarevectorlen; |
uint32_t firmwarevectorlen; |
arc_func_vector_t *firmwarevector; |
__u32 privvectorlen; |
uint32_t privvectorlen; |
void *privvector; |
__u32 adaptercount; |
uint32_t adaptercount; |
}__attribute__ ((packed)) arc_sbp; |
extern int arc_init(void); |