diff mbox series

[07/10] target/ppc/internal: Restrict MMU declarations to sysemu

Message ID 20221216220539.7065-8-philmd@linaro.org
State Superseded
Headers show
Series target/misc: Header cleanups around "cpu.h" | expand

Commit Message

Philippe Mathieu-Daudé Dec. 16, 2022, 10:05 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/ppc/internal.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Richard Henderson Dec. 17, 2022, 12:38 a.m. UTC | #1
On 12/16/22 14:05, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/ppc/internal.h | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/target/ppc/internal.h b/target/ppc/internal.h
> index 337a362205..901bae6d39 100644
> --- a/target/ppc/internal.h
> +++ b/target/ppc/internal.h
> @@ -242,9 +242,12 @@ static inline int prot_for_access_type(MMUAccessType access_type)
>       g_assert_not_reached();
>   }
>   
> +#ifndef CONFIG_USER_ONLY
> +
>   /* PowerPC MMU emulation */
>   
>   typedef struct mmu_ctx_t mmu_ctx_t;
> +
>   bool ppc_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,
>                         hwaddr *raddrp, int *psizep, int *protp,
>                         int mmu_idx, bool guest_visible);
> @@ -266,6 +269,8 @@ struct mmu_ctx_t {
>       int nx;                        /* Non-execute area          */
>   };
>   
> +#endif /* !CONFIG_USER_ONLY */

Eh.  I suppose.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Philippe Mathieu-Daudé Dec. 17, 2022, 10:53 a.m. UTC | #2
On 17/12/22 01:38, Richard Henderson wrote:
> On 12/16/22 14:05, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   target/ppc/internal.h | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/target/ppc/internal.h b/target/ppc/internal.h
>> index 337a362205..901bae6d39 100644
>> --- a/target/ppc/internal.h
>> +++ b/target/ppc/internal.h
>> @@ -242,9 +242,12 @@ static inline int 
>> prot_for_access_type(MMUAccessType access_type)
>>       g_assert_not_reached();
>>   }
>> +#ifndef CONFIG_USER_ONLY
>> +
>>   /* PowerPC MMU emulation */
>>   typedef struct mmu_ctx_t mmu_ctx_t;
>> +
>>   bool ppc_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,
>>                         hwaddr *raddrp, int *psizep, int *protp,
>>                         int mmu_idx, bool guest_visible);
>> @@ -266,6 +269,8 @@ struct mmu_ctx_t {
>>       int nx;                        /* Non-execute area          */
>>   };
>> +#endif /* !CONFIG_USER_ONLY */
> 
> Eh.  I suppose.

I forgot the justification:

'''
The 'hwaddr' type is only available / meaningful on system emulation.
'''

> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Thanks!
diff mbox series

Patch

diff --git a/target/ppc/internal.h b/target/ppc/internal.h
index 337a362205..901bae6d39 100644
--- a/target/ppc/internal.h
+++ b/target/ppc/internal.h
@@ -242,9 +242,12 @@  static inline int prot_for_access_type(MMUAccessType access_type)
     g_assert_not_reached();
 }
 
+#ifndef CONFIG_USER_ONLY
+
 /* PowerPC MMU emulation */
 
 typedef struct mmu_ctx_t mmu_ctx_t;
+
 bool ppc_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,
                       hwaddr *raddrp, int *psizep, int *protp,
                       int mmu_idx, bool guest_visible);
@@ -266,6 +269,8 @@  struct mmu_ctx_t {
     int nx;                        /* Non-execute area          */
 };
 
+#endif /* !CONFIG_USER_ONLY */
+
 /* Common routines used by software and hardware TLBs emulation */
 static inline int pte_is_valid(target_ulong pte0)
 {