]> xenbits.xensource.com Git - xen.git/commitdiff
arm/decode.c: switch to plain bool
authorWei Liu <wei.liu2@citrix.com>
Fri, 15 Sep 2017 09:16:18 +0000 (10:16 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 15 Sep 2017 15:28:07 +0000 (16:28 +0100)
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/decode.c

index 514b7a21a593719f30c34da3b533e5dfbb880603..8b1e15d1189284639623841cf592740027f2a620 100644 (file)
@@ -26,7 +26,7 @@
 #include "decode.h"
 
 static void update_dabt(struct hsr_dabt *dabt, int reg,
-                        uint8_t size, bool_t sign)
+                        uint8_t size, bool sign)
 {
     dabt->reg = reg;
     dabt->size = size;
@@ -47,8 +47,8 @@ static int decode_thumb2(register_t pc, struct hsr_dabt *dabt, uint16_t hw1)
     {
     case 12:
     {
-        bool_t sign = !!(hw1 & (1 << 8));
-        bool_t load = !!(hw1 & (1 << 4));
+        bool sign = (hw1 & (1u << 8));
+        bool load = (hw1 & (1u << 4));
 
         if ( (hw1 & 0x0110) == 0x0100 )
             /* NEON instruction */
@@ -101,16 +101,16 @@ static int decode_thumb(register_t pc, struct hsr_dabt *dabt)
         switch ( opB & 0x3 )
         {
         case 0: /* Non-signed word */
-            update_dabt(dabt, reg, 2, 0);
+            update_dabt(dabt, reg, 2, false);
             break;
         case 1: /* Non-signed halfword */
-            update_dabt(dabt, reg, 1, 0);
+            update_dabt(dabt, reg, 1, false);
             break;
         case 2: /* Non-signed byte */
-            update_dabt(dabt, reg, 0, 0);
+            update_dabt(dabt, reg, 0, false);
             break;
         case 3: /* Signed byte */
-            update_dabt(dabt, reg, 0, 1);
+            update_dabt(dabt, reg, 0, true);
             break;
         }
 
@@ -118,19 +118,19 @@ static int decode_thumb(register_t pc, struct hsr_dabt *dabt)
     }
     case 6:
         /* Load/Store word immediate offset */
-        update_dabt(dabt, instr & 7, 2, 0);
+        update_dabt(dabt, instr & 7, 2, false);
         break;
     case 7:
         /* Load/Store byte immediate offset */
-        update_dabt(dabt, instr & 7, 0, 0);
+        update_dabt(dabt, instr & 7, 0, false);
         break;
     case 8:
         /* Load/Store halfword immediate offset */
-        update_dabt(dabt, instr & 7, 1, 0);
+        update_dabt(dabt, instr & 7, 1, false);
         break;
     case 9:
         /* Load/Store word sp offset */
-        update_dabt(dabt, (instr >> 8) & 7, 2, 0);
+        update_dabt(dabt, (instr >> 8) & 7, 2, false);
         break;
     case 14:
         if ( instr & (1 << 11) )