diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-01-20 15:19:34 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-01-20 15:19:34 +0000 |
commit | 9220fe54c679d145232a28df6255e166ebf91bab (patch) | |
tree | d2eefcbd2877e4da58887affa6d7ff97343c27ab /target-i386/seg_helper.c | |
parent | 177ea79f65c90b3bc84d59565b7519e47ea02f63 (diff) |
cpu_ldst.h: Use inline functions for usermode cpu_ld/st accessors
Use inline functions rather than macros for cpu_ld/st accessors
for the *-user configurations, as we already do for softmmu.
This has a two advantages:
* we can actually typecheck our arguments
* we don't need to leak the _raw macros everywhere
Since the _kernel functions were only used by target-i386/seg_helper.c,
put the definitions for them in that file too. (It already has the
similar template include code to define them for the softmmu case,
so it makes sense to have it deal with defining them for user-only.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1421334118-3287-12-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'target-i386/seg_helper.c')
-rw-r--r-- | target-i386/seg_helper.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/target-i386/seg_helper.c b/target-i386/seg_helper.c index c98eeb4351..fa374d0c0b 100644 --- a/target-i386/seg_helper.c +++ b/target-i386/seg_helper.c @@ -34,7 +34,21 @@ # define LOG_PCALL_STATE(cpu) do { } while (0) #endif -#ifndef CONFIG_USER_ONLY +#ifdef CONFIG_USER_ONLY +#define MEMSUFFIX _kernel +#define DATA_SIZE 1 +#include "exec/cpu_ldst_useronly_template.h" + +#define DATA_SIZE 2 +#include "exec/cpu_ldst_useronly_template.h" + +#define DATA_SIZE 4 +#include "exec/cpu_ldst_useronly_template.h" + +#define DATA_SIZE 8 +#include "exec/cpu_ldst_useronly_template.h" +#undef MEMSUFFIX +#else #define CPU_MMU_INDEX (cpu_mmu_index_kernel(env)) #define MEMSUFFIX _kernel #define DATA_SIZE 1 |