]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
thunk: Rename args and fields in host-target bitmask conversion code
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 2 Jun 2016 16:10:20 +0000 (17:10 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 7 Jun 2016 15:19:24 +0000 (18:19 +0300)
The target_to_host_bitmask() and host_to_target_bitmask() functions
and the associated struct bitmask_transtbl are completely generic,
but for historical reasons the target related fields and parameters
are named 'x86' and the host related fields are named 'alpha'.
Rename them to 'target' and 'host'.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
include/exec/user/thunk.h
thunk.c

index 57eb358d96d14bd9df3e00d061f35dc89ea2e4b0..f19ef4b2304d4fb5844c918d46177b1a6dbc140f 100644 (file)
@@ -60,10 +60,10 @@ typedef struct {
 
 /* Translation table for bitmasks... */
 typedef struct bitmask_transtbl {
-       unsigned int    x86_mask;
-       unsigned int    x86_bits;
-       unsigned int    alpha_mask;
-       unsigned int    alpha_bits;
+    unsigned int target_mask;
+    unsigned int target_bits;
+    unsigned int host_mask;
+    unsigned int host_bits;
 } bitmask_transtbl;
 
 void thunk_register_struct(int id, const char *name, const argtype *types);
@@ -177,9 +177,9 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host)
     }
 }
 
-unsigned int target_to_host_bitmask(unsigned int x86_mask,
+unsigned int target_to_host_bitmask(unsigned int target_mask,
                                     const bitmask_transtbl * trans_tbl);
-unsigned int host_to_target_bitmask(unsigned int alpha_mask,
+unsigned int host_to_target_bitmask(unsigned int host_mask,
                                     const bitmask_transtbl * trans_tbl);
 
 void thunk_init(unsigned int max_structs);
diff --git a/thunk.c b/thunk.c
index 8aee29918b12a4969fd8b2cf1f37b3c35da15175..2dac36666de47c74477dc42ff897497e1440fc5a 100644 (file)
--- a/thunk.c
+++ b/thunk.c
@@ -273,34 +273,34 @@ const argtype *thunk_convert(void *dst, const void *src,
 /* from em86 */
 
 /* Utility function: Table-driven functions to translate bitmasks
- * between X86 and Alpha formats...
+ * between host and target formats
  */
-unsigned int target_to_host_bitmask(unsigned int x86_mask,
+unsigned int target_to_host_bitmask(unsigned int target_mask,
                                     const bitmask_transtbl * trans_tbl)
 {
     const bitmask_transtbl *btp;
-    unsigned int       alpha_mask = 0;
+    unsigned int host_mask = 0;
 
-    for(btp = trans_tbl; btp->x86_mask && btp->alpha_mask; btp++) {
-       if((x86_mask & btp->x86_mask) == btp->x86_bits) {
-           alpha_mask |= btp->alpha_bits;
-       }
+    for (btp = trans_tbl; btp->target_mask && btp->host_mask; btp++) {
+        if ((target_mask & btp->target_mask) == btp->target_bits) {
+            host_mask |= btp->host_bits;
+        }
     }
-    return(alpha_mask);
+    return host_mask;
 }
 
-unsigned int host_to_target_bitmask(unsigned int alpha_mask,
+unsigned int host_to_target_bitmask(unsigned int host_mask,
                                     const bitmask_transtbl * trans_tbl)
 {
     const bitmask_transtbl *btp;
-    unsigned int       x86_mask = 0;
+    unsigned int target_mask = 0;
 
-    for(btp = trans_tbl; btp->x86_mask && btp->alpha_mask; btp++) {
-       if((alpha_mask & btp->alpha_mask) == btp->alpha_bits) {
-           x86_mask |= btp->x86_bits;
-       }
+    for (btp = trans_tbl; btp->target_mask && btp->host_mask; btp++) {
+        if ((host_mask & btp->host_mask) == btp->host_bits) {
+            target_mask |= btp->target_bits;
+        }
     }
-    return(x86_mask);
+    return target_mask;
 }
 
 int thunk_type_size_array(const argtype *type_ptr, int is_host)