Changeset 96b02eb9 in mainline for kernel/arch


Ignore:
Timestamp:
2010-12-14T12:52:38Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6b10dab
Parents:
554debd
Message:

more unification of basic types

  • use sysarg_t and native_t (unsigned and signed variant) in both kernel and uspace
  • remove ipcarg_t in favour of sysarg_t

(no change in functionality)

Location:
kernel/arch
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/include/types.h

    r554debd r96b02eb9  
    4646typedef uint32_t ipl_t;
    4747
    48 typedef uint32_t unative_t;
     48typedef uint32_t sysarg_t;
    4949typedef int32_t native_t;
    5050typedef uint32_t atomic_count_t;
     
    5757
    5858#define PRIdn  PRId32  /**< Format for native_t. */
    59 #define PRIun  PRIu32  /**< Format for unative_t. */
    60 #define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
     59#define PRIun  PRIu32  /**< Format for sysarg_t. */
     60#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
    6161#define PRIua  PRIu32  /**< Format for atomic_count_t. */
    6262
  • kernel/arch/abs32le/src/abs32le.c

    r554debd r96b02eb9  
    8686}
    8787
    88 unative_t sys_tls_set(unative_t addr)
     88sysarg_t sys_tls_set(sysarg_t addr)
    8989{
    9090        return EOK;
  • kernel/arch/amd64/include/asm.h

    r554debd r96b02eb9  
    304304}
    305305
    306 NO_TRACE static inline unative_t read_msr(uint32_t msr)
     306NO_TRACE static inline sysarg_t read_msr(uint32_t msr)
    307307{
    308308        uint32_t ax, dx;
     
    343343        asm volatile (
    344344                "invlpg %[addr]\n"
    345                 :: [addr] "m" (*((unative_t *) addr))
     345                :: [addr] "m" (*((sysarg_t *) addr))
    346346        );
    347347}
     
    398398}
    399399
    400 #define GEN_READ_REG(reg) NO_TRACE static inline unative_t read_ ##reg (void) \
     400#define GEN_READ_REG(reg) NO_TRACE static inline sysarg_t read_ ##reg (void) \
    401401        { \
    402                 unative_t res; \
     402                sysarg_t res; \
    403403                asm volatile ( \
    404404                        "movq %%" #reg ", %[res]" \
     
    408408        }
    409409
    410 #define GEN_WRITE_REG(reg) NO_TRACE static inline void write_ ##reg (unative_t regn) \
     410#define GEN_WRITE_REG(reg) NO_TRACE static inline void write_ ##reg (sysarg_t regn) \
    411411        { \
    412412                asm volatile ( \
  • kernel/arch/amd64/include/proc/thread.h

    r554debd r96b02eb9  
    4141
    4242typedef struct {
    43         unative_t tls;
     43        sysarg_t tls;
    4444        /** User and kernel RSP for syscalls. */
    4545        uint64_t syscall_rsp[2];
  • kernel/arch/amd64/include/types.h

    r554debd r96b02eb9  
    4343typedef uint64_t ipl_t;
    4444
    45 typedef uint64_t unative_t;
     45typedef uint64_t sysarg_t;
    4646typedef int64_t native_t;
    4747typedef uint64_t atomic_count_t;
     
    5454
    5555#define PRIdn  PRId64  /**< Format for native_t. */
    56 #define PRIun  PRIu64  /**< Format for unative_t. */
    57 #define PRIxn  PRIx64  /**< Format for hexadecimal unative_t. */
     56#define PRIun  PRIu64  /**< Format for sysarg_t. */
     57#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t. */
    5858#define PRIua  PRIu64  /**< Format for atomic_count_t. */
    5959
  • kernel/arch/amd64/src/amd64.c

    r554debd r96b02eb9  
    256256 * we need not to go to CPL0 to read it.
    257257 */
    258 unative_t sys_tls_set(unative_t addr)
     258sysarg_t sys_tls_set(sysarg_t addr)
    259259{
    260260        THREAD->arch.tls = addr;
  • kernel/arch/amd64/src/debugger.c

    r554debd r96b02eb9  
    125125       
    126126        /* Disable breakpoint in DR7 */
    127         unative_t dr7 = read_dr7();
     127        sysarg_t dr7 = read_dr7();
    128128        dr7 &= ~(0x02U << (curidx * 2));
    129129       
     
    152152                if (!(flags & BKPOINT_INSTR)) {
    153153#ifdef __32_BITS__
    154                         dr7 |= ((unative_t) 0x03U) << (18 + 4 * curidx);
     154                        dr7 |= ((sysarg_t) 0x03U) << (18 + 4 * curidx);
    155155#endif
    156156                       
    157157#ifdef __64_BITS__
    158                         dr7 |= ((unative_t) 0x02U) << (18 + 4 * curidx);
     158                        dr7 |= ((sysarg_t) 0x02U) << (18 + 4 * curidx);
    159159#endif
    160160                       
    161161                        if ((flags & BKPOINT_WRITE))
    162                                 dr7 |= ((unative_t) 0x01U) << (16 + 4 * curidx);
     162                                dr7 |= ((sysarg_t) 0x01U) << (16 + 4 * curidx);
    163163                        else if ((flags & BKPOINT_READ_WRITE))
    164                                 dr7 |= ((unative_t) 0x03U) << (16 + 4 * curidx);
     164                                dr7 |= ((sysarg_t) 0x03U) << (16 + 4 * curidx);
    165165                }
    166166               
     
    227227        if (!(breakpoints[slot].flags & BKPOINT_INSTR)) {
    228228                if ((breakpoints[slot].flags & BKPOINT_CHECK_ZERO)) {
    229                         if (*((unative_t *) breakpoints[slot].address) != 0)
     229                        if (*((sysarg_t *) breakpoints[slot].address) != 0)
    230230                                return;
    231231                       
     
    234234                } else {
    235235                        printf("Data watchpoint - new data: %#" PRIxn "\n",
    236                             *((unative_t *) breakpoints[slot].address));
     236                            *((sysarg_t *) breakpoints[slot].address));
    237237                }
    238238        }
     
    279279#endif
    280280       
    281         unative_t dr6 = read_dr6();
     281        sysarg_t dr6 = read_dr6();
    282282       
    283283        unsigned int i;
     
    384384int cmd_del_breakpoint(cmd_arg_t *argv)
    385385{
    386         unative_t bpno = argv->intval;
     386        sysarg_t bpno = argv->intval;
    387387        if (bpno > BKPOINTS_MAX) {
    388388                printf("Invalid breakpoint number.\n");
  • kernel/arch/arm32/include/types.h

    r554debd r96b02eb9  
    5050typedef uint32_t ipl_t;
    5151
    52 typedef uint32_t unative_t;
     52typedef uint32_t sysarg_t;
    5353typedef int32_t native_t;
    5454typedef uint32_t atomic_count_t;
     
    6161
    6262#define PRIdn  PRId32  /**< Format for native_t. */
    63 #define PRIun  PRIu32  /**< Format for unative_t. */
    64 #define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
     63#define PRIun  PRIu32  /**< Format for sysarg_t. */
     64#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
    6565#define PRIua  PRIu32  /**< Format for atomic_count_t. */
    6666
  • kernel/arch/arm32/src/mach/testarm/testarm.c

    r554debd r96b02eb9  
    123123        sysinfo_set_item_val("kbd", NULL, true);
    124124        sysinfo_set_item_val("kbd.inr", NULL, GXEMUL_KBD_IRQ);
    125         sysinfo_set_item_val("kbd.address.virtual", NULL, (unative_t) gxemul_kbd);
     125        sysinfo_set_item_val("kbd.address.virtual", NULL, (sysarg_t) gxemul_kbd);
    126126#endif
    127127}
  • kernel/arch/ia32/include/asm.h

    r554debd r96b02eb9  
    6464}
    6565
    66 #define GEN_READ_REG(reg) NO_TRACE static inline unative_t read_ ##reg (void) \
     66#define GEN_READ_REG(reg) NO_TRACE static inline sysarg_t read_ ##reg (void) \
    6767        { \
    68                 unative_t res; \
     68                sysarg_t res; \
    6969                asm volatile ( \
    7070                        "movl %%" #reg ", %[res]" \
     
    7474        }
    7575
    76 #define GEN_WRITE_REG(reg) NO_TRACE static inline void write_ ##reg (unative_t regn) \
     76#define GEN_WRITE_REG(reg) NO_TRACE static inline void write_ ##reg (sysarg_t regn) \
    7777        { \
    7878                asm volatile ( \
     
    366366        asm volatile (
    367367                "invlpg %[addr]\n"
    368                 :: [addr] "m" (*(unative_t *) addr)
     368                :: [addr] "m" (*(sysarg_t *) addr)
    369369        );
    370370}
  • kernel/arch/ia32/include/proc/thread.h

    r554debd r96b02eb9  
    3939
    4040typedef struct {
    41         unative_t tls;
     41        sysarg_t tls;
    4242} thread_arch_t;
    4343
  • kernel/arch/ia32/include/types.h

    r554debd r96b02eb9  
    4343typedef uint32_t ipl_t;
    4444
    45 typedef uint32_t unative_t;
     45typedef uint32_t sysarg_t;
    4646typedef int32_t native_t;
    4747typedef uint32_t atomic_count_t;
     
    5454
    5555#define PRIdn  PRId32  /**< Format for native_t. */
    56 #define PRIun  PRIu32  /**< Format for unative_t. */
    57 #define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
     56#define PRIun  PRIu32  /**< Format for sysarg_t. */
     57#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
    5858#define PRIua  PRIu32  /**< Format for atomic_count_t. */
    5959
  • kernel/arch/ia32/src/ia32.c

    r554debd r96b02eb9  
    211211 * selector, and the descriptor->base is the correct address.
    212212 */
    213 unative_t sys_tls_set(unative_t addr)
     213sysarg_t sys_tls_set(sysarg_t addr)
    214214{
    215215        THREAD->arch.tls = addr;
  • kernel/arch/ia64/include/bootinfo.h

    r554debd r96b02eb9  
    6262        unsigned int memmap_items;
    6363       
    64         unative_t *sapic;
     64        sysarg_t *sapic;
    6565        unsigned long sys_freq;
    6666        unsigned long freq_scale;
  • kernel/arch/ia64/include/types.h

    r554debd r96b02eb9  
    4343typedef uint64_t ipl_t;
    4444
    45 typedef uint64_t unative_t;
     45typedef uint64_t sysarg_t;
    4646typedef int64_t native_t;
    4747typedef uint64_t atomic_count_t;
    4848
    4949typedef struct {
    50         unative_t fnc;
    51         unative_t gp;
     50        sysarg_t fnc;
     51        sysarg_t gp;
    5252} __attribute__((may_alias)) fncptr_t;
    5353
     
    5656
    5757#define PRIdn  PRId64  /**< Format for native_t. */
    58 #define PRIun  PRIu64  /**< Format for unative_t. */
    59 #define PRIxn  PRIx64  /**< Format for hexadecimal unative_t. */
     58#define PRIun  PRIu64  /**< Format for sysarg_t. */
     59#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t. */
    6060#define PRIua  PRIu64  /**< Format for atomic_count_t. */
    6161
  • kernel/arch/ia64/src/ia64.c

    r554debd r96b02eb9  
    104104static void iosapic_init(void)
    105105{
    106         uint64_t IOSAPIC = PA2KA((unative_t)(iosapic_base)) | FW_OFFSET;
     106        uint64_t IOSAPIC = PA2KA((sysarg_t)(iosapic_base)) | FW_OFFSET;
    107107        int i;
    108108       
     
    251251 * We use r13 (a.k.a. tp) for this purpose.
    252252 */
    253 unative_t sys_tls_set(unative_t addr)
     253sysarg_t sys_tls_set(sysarg_t addr)
    254254{
    255255        return 0;
     
    274274void *arch_construct_function(fncptr_t *fptr, void *addr, void *caller)
    275275{
    276         fptr->fnc = (unative_t) addr;
    277         fptr->gp = ((unative_t *) caller)[1];
     276        fptr->fnc = (sysarg_t) addr;
     277        fptr->gp = ((sysarg_t *) caller)[1];
    278278       
    279279        return (void *) fptr;
  • kernel/arch/mips32/include/debugger.h

    r554debd r96b02eb9  
    5858
    5959typedef struct  {
    60         uintptr_t address;          /**< Breakpoint address */
    61         unative_t instruction;      /**< Original instruction */
    62         unative_t nextinstruction;  /**< Original instruction following break */
    63         unsigned int flags;         /**< Flags regarding breakpoint */
     60        uintptr_t address;         /**< Breakpoint address */
     61        sysarg_t instruction;      /**< Original instruction */
     62        sysarg_t nextinstruction;  /**< Original instruction following break */
     63        unsigned int flags;        /**< Flags regarding breakpoint */
    6464        size_t counter;
    6565        void (*bkfunc)(void *, istate_t *);
     
    6868extern bpinfo_t breakpoints[BKPOINTS_MAX];
    6969
    70 extern bool is_jump(unative_t);
     70extern bool is_jump(sysarg_t);
    7171
    7272extern void debugger_init(void);
  • kernel/arch/mips32/include/fpu_context.h

    r554debd r96b02eb9  
    3838#include <typedefs.h>
    3939
    40 #define FPU_CONTEXT_ALIGN    sizeof(unative_t)
     40#define FPU_CONTEXT_ALIGN    sizeof(sysarg_t)
    4141
    4242typedef struct {
    43         unative_t dregs[32];
    44         unative_t cregs[32];
     43        sysarg_t dregs[32];
     44        sysarg_t cregs[32];
    4545} fpu_context_t;
    4646
  • kernel/arch/mips32/include/types.h

    r554debd r96b02eb9  
    4343typedef uint32_t ipl_t;
    4444
    45 typedef uint32_t unative_t;
     45typedef uint32_t sysarg_t;
    4646typedef int32_t native_t;
    4747typedef uint32_t atomic_count_t;
     
    5454
    5555#define PRIdn  PRId32  /**< Format for native_t. */
    56 #define PRIun  PRIu32  /**< Format for unative_t. */
    57 #define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
     56#define PRIun  PRIu32  /**< Format for sysarg_t. */
     57#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
    5858#define PRIua  PRIu32  /**< Format for atomic_count_t. */
    5959
  • kernel/arch/mips32/src/debugger.c

    r554debd r96b02eb9  
    134134 *
    135135 */
    136 bool is_jump(unative_t instr)
     136bool is_jump(sysarg_t instr)
    137137{
    138138        unsigned int i;
     
    166166                        return 0;
    167167                } else if ((breakpoints[i].address == (uintptr_t) argv->intval +
    168                     sizeof(unative_t)) || (breakpoints[i].address ==
    169                     (uintptr_t) argv->intval - sizeof(unative_t))) {
     168                    sizeof(sysarg_t)) || (breakpoints[i].address ==
     169                    (uintptr_t) argv->intval - sizeof(sysarg_t))) {
    170170                        printf("Adjacent breakpoints not supported, conflict "
    171171                            "with %d.\n", i);
     
    194194       
    195195        cur->address = (uintptr_t) argv->intval;
    196         cur->instruction = ((unative_t *) cur->address)[0];
    197         cur->nextinstruction = ((unative_t *) cur->address)[1];
     196        cur->instruction = ((sysarg_t *) cur->address)[0];
     197        cur->nextinstruction = ((sysarg_t *) cur->address)[1];
    198198        if (argv == &add_argv) {
    199199                cur->flags = 0;
     
    209209       
    210210        /* Set breakpoint */
    211         *((unative_t *) cur->address) = 0x0d;
     211        *((sysarg_t *) cur->address) = 0x0d;
    212212        smc_coherence(cur->address);
    213213       
     
    341341                /* Reinst only breakpoint */
    342342                if ((breakpoints[i].flags & BKPOINT_REINST) &&
    343                     (fireaddr == breakpoints[i].address + sizeof(unative_t))) {
     343                    (fireaddr == breakpoints[i].address + sizeof(sysarg_t))) {
    344344                        cur = &breakpoints[i];
    345345                        break;
  • kernel/arch/mips32/src/mips32.c

    r554debd r96b02eb9  
    233233 * possible to have it separately in the future.
    234234 */
    235 unative_t sys_tls_set(unative_t addr)
     235sysarg_t sys_tls_set(sysarg_t addr)
    236236{
    237237        return 0;
  • kernel/arch/ppc32/include/exception.h

    r554debd r96b02eb9  
    9898}
    9999
    100 NO_TRACE static inline unative_t istate_get_pc(istate_t *istate)
     100NO_TRACE static inline sysarg_t istate_get_pc(istate_t *istate)
    101101{
    102102        return istate->pc;
    103103}
    104104
    105 NO_TRACE static inline unative_t istate_get_fp(istate_t *istate)
     105NO_TRACE static inline sysarg_t istate_get_fp(istate_t *istate)
    106106{
    107107        return istate->sp;
  • kernel/arch/ppc32/include/types.h

    r554debd r96b02eb9  
    4343typedef uint32_t ipl_t;
    4444
    45 typedef uint32_t unative_t;
     45typedef uint32_t sysarg_t;
    4646typedef int32_t native_t;
    4747typedef uint32_t atomic_count_t;
     
    5454
    5555#define PRIdn  PRId32  /**< Format for native_t. */
    56 #define PRIun  PRIu32  /**< Format for unative_t. */
    57 #define PRIxn  PRIx32  /**< Format for hexadecimal unative_t. */
     56#define PRIun  PRIu32  /**< Format for sysarg_t. */
     57#define PRIxn  PRIx32  /**< Format for hexadecimal sysarg_t. */
    5858#define PRIua  PRIu32  /**< Format for atomic_count_t. */
    5959
  • kernel/arch/sparc64/include/mm/sun4u/tlb.h

    r554debd r96b02eb9  
    678678}
    679679
    680 extern void fast_instruction_access_mmu_miss(unative_t, istate_t *);
     680extern void fast_instruction_access_mmu_miss(sysarg_t, istate_t *);
    681681extern void fast_data_access_mmu_miss(tlb_tag_access_reg_t, istate_t *);
    682682extern void fast_data_access_protection(tlb_tag_access_reg_t , istate_t *);
  • kernel/arch/sparc64/include/mm/sun4v/tlb.h

    r554debd r96b02eb9  
    141141}
    142142
    143 extern void fast_instruction_access_mmu_miss(unative_t, istate_t *);
    144 extern void fast_data_access_mmu_miss(unative_t, istate_t *);
    145 extern void fast_data_access_protection(unative_t, istate_t *);
     143extern void fast_instruction_access_mmu_miss(sysarg_t, istate_t *);
     144extern void fast_data_access_mmu_miss(sysarg_t, istate_t *);
     145extern void fast_data_access_protection(sysarg_t, istate_t *);
    146146
    147147extern void dtlb_insert_mapping(uintptr_t, uintptr_t, int, bool, bool);
  • kernel/arch/sparc64/include/types.h

    r554debd r96b02eb9  
    4343typedef uint64_t ipl_t;
    4444
    45 typedef uint64_t unative_t;
     45typedef uint64_t sysarg_t;
    4646typedef int64_t native_t;
    4747typedef uint64_t atomic_count_t;
     
    5656
    5757#define PRIdn  PRId64  /**< Format for native_t. */
    58 #define PRIun  PRIu64  /**< Format for unative_t. */
    59 #define PRIxn  PRIx64  /**< Format for hexadecimal unative_t. */
     58#define PRIun  PRIu64  /**< Format for sysarg_t. */
     59#define PRIxn  PRIx64  /**< Format for hexadecimal sysarg_t. */
    6060#define PRIua  PRIu64  /**< Format for atomic_count_t. */
    6161
  • kernel/arch/sparc64/src/mm/sun4u/tlb.c

    r554debd r96b02eb9  
    200200
    201201/** ITLB miss handler. */
    202 void fast_instruction_access_mmu_miss(unative_t unused, istate_t *istate)
     202void fast_instruction_access_mmu_miss(sysarg_t unused, istate_t *istate)
    203203{
    204204        uintptr_t page_16k = ALIGN_DOWN(istate->tpc, PAGE_SIZE);
  • kernel/arch/sparc64/src/mm/sun4v/tlb.c

    r554debd r96b02eb9  
    213213
    214214/** ITLB miss handler. */
    215 void fast_instruction_access_mmu_miss(unative_t unused, istate_t *istate)
     215void fast_instruction_access_mmu_miss(sysarg_t unused, istate_t *istate)
    216216{
    217217        uintptr_t va = ALIGN_DOWN(istate->tpc, PAGE_SIZE);
Note: See TracChangeset for help on using the changeset viewer.