diff options
author | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-10-28 00:55:05 +0000 |
---|---|---|
committer | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-10-28 00:55:05 +0000 |
commit | a11b8151dfc71f95ac04e5f73c7d5c042911b9e4 (patch) | |
tree | 65abfdb47f2a2a950e148bf5ce2a27cd99967ca5 /target-ppc | |
parent | 5bda28432fc8d269821f8c05e062f7c847f20cac (diff) |
PowerPC coding style and inlining fixes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3461 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/helper.c | 72 | ||||
-rw-r--r-- | target-ppc/op_helper.c | 13 | ||||
-rw-r--r-- | target-ppc/translate.c | 3 |
3 files changed, 46 insertions, 42 deletions
diff --git a/target-ppc/helper.c b/target-ppc/helper.c index 869d5b7677..d3b8db7e61 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -232,22 +232,24 @@ static always_inline int _pte_check (mmu_ctx_t *ctx, int is_64b, return ret; } -static int pte32_check (mmu_ctx_t *ctx, target_ulong pte0, target_ulong pte1, - int h, int rw, int type) +static always_inline int pte32_check (mmu_ctx_t *ctx, + target_ulong pte0, target_ulong pte1, + int h, int rw, int type) { return _pte_check(ctx, 0, pte0, pte1, h, rw, type); } #if defined(TARGET_PPC64) -static int pte64_check (mmu_ctx_t *ctx, target_ulong pte0, target_ulong pte1, - int h, int rw, int type) +static always_inline int pte64_check (mmu_ctx_t *ctx, + target_ulong pte0, target_ulong pte1, + int h, int rw, int type) { return _pte_check(ctx, 1, pte0, pte1, h, rw, type); } #endif -static int pte_update_flags (mmu_ctx_t *ctx, target_ulong *pte1p, - int ret, int rw) +static always_inline int pte_update_flags (mmu_ctx_t *ctx, target_ulong *pte1p, + int ret, int rw) { int store = 0; @@ -272,8 +274,8 @@ static int pte_update_flags (mmu_ctx_t *ctx, target_ulong *pte1p, } /* Software driven TLB helpers */ -static int ppc6xx_tlb_getnum (CPUState *env, target_ulong eaddr, - int way, int is_code) +static always_inline int ppc6xx_tlb_getnum (CPUState *env, target_ulong eaddr, + int way, int is_code) { int nr; @@ -288,7 +290,7 @@ static int ppc6xx_tlb_getnum (CPUState *env, target_ulong eaddr, return nr; } -static void ppc6xx_tlb_invalidate_all (CPUState *env) +static always_inline void ppc6xx_tlb_invalidate_all (CPUState *env) { ppc6xx_tlb_t *tlb; int nr, max; @@ -339,8 +341,9 @@ static always_inline void __ppc6xx_tlb_invalidate_virt (CPUState *env, #endif } -static void ppc6xx_tlb_invalidate_virt (CPUState *env, target_ulong eaddr, - int is_code) +static always_inline void ppc6xx_tlb_invalidate_virt (CPUState *env, + target_ulong eaddr, + int is_code) { __ppc6xx_tlb_invalidate_virt(env, eaddr, is_code, 0); } @@ -368,8 +371,9 @@ void ppc6xx_tlb_store (CPUState *env, target_ulong EPN, int way, int is_code, env->last_way = way; } -static int ppc6xx_tlb_check (CPUState *env, mmu_ctx_t *ctx, - target_ulong eaddr, int rw, int access_type) +static always_inline int ppc6xx_tlb_check (CPUState *env, mmu_ctx_t *ctx, + target_ulong eaddr, int rw, + int access_type) { ppc6xx_tlb_t *tlb; int nr, best, way; @@ -444,8 +448,8 @@ static int ppc6xx_tlb_check (CPUState *env, mmu_ctx_t *ctx, } /* Perform BAT hit & translation */ -static int get_bat (CPUState *env, mmu_ctx_t *ctx, - target_ulong virtual, int rw, int type) +static always_inline int get_bat (CPUState *env, mmu_ctx_t *ctx, + target_ulong virtual, int rw, int type) { target_ulong *BATlt, *BATut, *BATu, *BATl; target_ulong base, BEPIl, BEPIu, bl; @@ -635,13 +639,13 @@ static always_inline int _find_pte (mmu_ctx_t *ctx, int is_64b, int h, return ret; } -static int find_pte32 (mmu_ctx_t *ctx, int h, int rw, int type) +static always_inline int find_pte32 (mmu_ctx_t *ctx, int h, int rw, int type) { return _find_pte(ctx, 0, h, rw, type); } #if defined(TARGET_PPC64) -static int find_pte64 (mmu_ctx_t *ctx, int h, int rw, int type) +static always_inline int find_pte64 (mmu_ctx_t *ctx, int h, int rw, int type) { return _find_pte(ctx, 1, h, rw, type); } @@ -659,18 +663,19 @@ static always_inline int find_pte (CPUState *env, mmu_ctx_t *ctx, } #if defined(TARGET_PPC64) -static inline int slb_is_valid (uint64_t slb64) +static always_inline int slb_is_valid (uint64_t slb64) { return slb64 & 0x0000000008000000ULL ? 1 : 0; } -static inline void slb_invalidate (uint64_t *slb64) +static always_inline void slb_invalidate (uint64_t *slb64) { *slb64 &= ~0x0000000008000000ULL; } -static int slb_lookup (CPUPPCState *env, target_ulong eaddr, - target_ulong *vsid, target_ulong *page_mask, int *attr) +static always_inline int slb_lookup (CPUPPCState *env, target_ulong eaddr, + target_ulong *vsid, + target_ulong *page_mask, int *attr) { target_phys_addr_t sr_base; target_ulong mask; @@ -847,8 +852,8 @@ static always_inline target_phys_addr_t get_pgaddr (target_phys_addr_t sdr1, return (sdr1 & ((target_ulong)(-1ULL) << sdr_sh)) | (hash & mask); } -static int get_segment (CPUState *env, mmu_ctx_t *ctx, - target_ulong eaddr, int rw, int type) +static always_inline int get_segment (CPUState *env, mmu_ctx_t *ctx, + target_ulong eaddr, int rw, int type) { target_phys_addr_t sdr, hash, mask, sdr_mask, htab_mask; target_ulong sr, vsid, vsid_mask, pgidx, page_mask; @@ -1063,10 +1068,10 @@ static int get_segment (CPUState *env, mmu_ctx_t *ctx, } /* Generic TLB check function for embedded PowerPC implementations */ -static int ppcemb_tlb_check (CPUState *env, ppcemb_tlb_t *tlb, - target_phys_addr_t *raddrp, - target_ulong address, - uint32_t pid, int ext, int i) +static always_inline int ppcemb_tlb_check (CPUState *env, ppcemb_tlb_t *tlb, + target_phys_addr_t *raddrp, + target_ulong address, + uint32_t pid, int ext, int i) { target_ulong mask; @@ -1122,7 +1127,7 @@ int ppcemb_tlb_search (CPUPPCState *env, target_ulong address, uint32_t pid) } /* Helpers specific to PowerPC 40x implementations */ -static void ppc4xx_tlb_invalidate_all (CPUState *env) +static always_inline void ppc4xx_tlb_invalidate_all (CPUState *env) { ppcemb_tlb_t *tlb; int i; @@ -1134,8 +1139,9 @@ static void ppc4xx_tlb_invalidate_all (CPUState *env) tlb_flush(env, 1); } -static void ppc4xx_tlb_invalidate_virt (CPUState *env, target_ulong eaddr, - uint32_t pid) +static always_inline void ppc4xx_tlb_invalidate_virt (CPUState *env, + target_ulong eaddr, + uint32_t pid) { #if !defined(FLUSH_ALL_TLBS) ppcemb_tlb_t *tlb; @@ -1286,8 +1292,8 @@ int mmubooke_get_physical_address (CPUState *env, mmu_ctx_t *ctx, return ret; } -static int check_physical (CPUState *env, mmu_ctx_t *ctx, - target_ulong eaddr, int rw) +static always_inline int check_physical (CPUState *env, mmu_ctx_t *ctx, + target_ulong eaddr, int rw) { int in_plb, ret; @@ -1986,7 +1992,7 @@ void ppc_hw_interrupt (CPUState *env) env->error_code = 0; } #else /* defined (CONFIG_USER_ONLY) */ -static void dump_syscall (CPUState *env) +static always_inline void dump_syscall (CPUState *env) { fprintf(logfile, "syscall r0=0x" REGX " r3=0x" REGX " r4=0x" REGX " r5=0x" REGX " r6=0x" REGX " nip=0x" ADDRX "\n", diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 346b29b7eb..61075c0866 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -474,7 +474,7 @@ void do_popcntb_64 (void) /*****************************************************************************/ /* Floating point operations helpers */ -static inline int fpisneg (float64 f) +static always_inline int fpisneg (float64 f) { union { float64 f; @@ -486,7 +486,7 @@ static inline int fpisneg (float64 f) return u.u >> 63 != 0; } -static inline int isden (float f) +static always_inline int isden (float f) { union { float64 f; @@ -498,7 +498,7 @@ static inline int isden (float f) return ((u.u >> 52) & 0x7FF) == 0; } -static inline int iszero (float64 f) +static always_inline int iszero (float64 f) { union { float64 f; @@ -510,7 +510,7 @@ static inline int iszero (float64 f) return (u.u & ~0x8000000000000000ULL) == 0; } -static inline int isinfinity (float64 f) +static always_inline int isinfinity (float64 f) { union { float64 f; @@ -661,7 +661,6 @@ static always_inline void float_zero_divide_excp (void) float64 f; uint64_t u; } u0, u1; - env->fpscr |= 1 << FPSCR_ZX; env->fpscr &= ~((1 << FPSCR_FR) | (1 << FPSCR_FI)); @@ -2825,12 +2824,12 @@ void do_load_74xx_tlb (int is_code) way, is_code, CMP, RPN); } -static target_ulong booke_tlb_to_page_size (int size) +static always_inline target_ulong booke_tlb_to_page_size (int size) { return 1024 << (2 * size); } -static int booke_page_size_to_tlb (target_ulong page_size) +static always_inline int booke_page_size_to_tlb (target_ulong page_size) { int size; diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 3c05b2cbb5..c3e5340f20 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -295,7 +295,6 @@ static void gen_##name (DisasContext *ctx); \ GEN_OPCODE2(name, onam, opc1, opc2, opc3, inval, type); \ static void gen_##name (DisasContext *ctx) - typedef struct opcode_t { unsigned char opc1, opc2, opc3; #if HOST_LONG_BITS == 64 /* Explicitely align to 64 bits */ @@ -3503,7 +3502,7 @@ GEN_HANDLER(mfmsr, 0x1F, 0x13, 0x02, 0x001FF801, PPC_MISC) #endif } -#if 0 +#if 1 #define SPR_NOACCESS ((void *)(-1)) #else static void spr_noaccess (void *opaque, int sprn) |