Signed-off-by: Robert Richter <[email protected]>
---
include/asm-x86/apicdef_32.h | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
Index: linux-perfmon/include/asm-x86/apicdef_32.h
===================================================================
--- linux-perfmon.orig/include/asm-x86/apicdef_32.h
+++ linux-perfmon/include/asm-x86/apicdef_32.h
@@ -13,23 +13,23 @@
#define APIC_ID 0x20
#define APIC_LVR 0x30
#define APIC_LVR_MASK 0xFF00FF
-#define GET_APIC_VERSION(x) ((x)&0xFF)
-#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
-#define APIC_INTEGRATED(x) ((x)&0xF0)
+#define GET_APIC_VERSION(x) ((x)&0xFFu)
+#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFFu)
+#define APIC_INTEGRATED(x) ((x)&0xF0u)
#define APIC_XAPIC(x) ((x) >= 0x14)
#define APIC_TASKPRI 0x80
-#define APIC_TPRI_MASK 0xFF
+#define APIC_TPRI_MASK 0xFFu
#define APIC_ARBPRI 0x90
-#define APIC_ARBPRI_MASK 0xFF
+#define APIC_ARBPRI_MASK 0xFFu
#define APIC_PROCPRI 0xA0
#define APIC_EOI 0xB0
#define APIC_EIO_ACK 0x0 /* Write this to the EOI register */
#define APIC_RRR 0xC0
#define APIC_LDR 0xD0
-#define APIC_LDR_MASK (0xFF<<24)
-#define GET_APIC_LOGICAL_ID(x) (((x)>>24)&0xFF)
+#define APIC_LDR_MASK (0xFFu<<24)
+#define GET_APIC_LOGICAL_ID(x) (((x)>>24)&0xFFu)
#define SET_APIC_LOGICAL_ID(x) (((x)<<24))
-#define APIC_ALL_CPUS 0xFF
+#define APIC_ALL_CPUS 0xFFu
#define APIC_DFR 0xE0
#define APIC_DFR_CLUSTER 0x0FFFFFFFul
#define APIC_DFR_FLAT 0xFFFFFFFFul
--
Advanced Micro Devices, Inc.
Operating System Research Center
email: [email protected]
Robert Richter wrote:
> -#define GET_APIC_VERSION(x) ((x)&0xFF)
> -#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
> -#define APIC_INTEGRATED(x) ((x)&0xF0)
> +#define GET_APIC_VERSION(x) ((x)&0xFFu)
> +#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFFu)
> +#define APIC_INTEGRATED(x) ((x)&0xF0u)
Can these ever be used in .S files? Might be better to use the _AC stuff.
J
On 07.11.07 12:41:09, Jeremy Fitzhardinge wrote:
> > -#define GET_APIC_VERSION(x) ((x)&0xFF)
> > -#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
> > -#define APIC_INTEGRATED(x) ((x)&0xF0)
> > +#define GET_APIC_VERSION(x) ((x)&0xFFu)
> > +#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFFu)
> > +#define APIC_INTEGRATED(x) ((x)&0xF0u)
>
> Can these ever be used in .S files? Might be better to use the _AC stuff.
I did not want to make functional changes, just do a simple
merge. However there are already updated files in the x86/cleanup
tree, so these patches are obsolete.
-Robert
--
Advanced Micro Devices, Inc.
Operating System Research Center
email: [email protected]
On Tue, 6 Nov 2007, Robert Richter wrote:
> -#define GET_APIC_VERSION(x) ((x)&0xFF)
> -#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
> -#define APIC_INTEGRATED(x) ((x)&0xF0)
> +#define GET_APIC_VERSION(x) ((x)&0xFFu)
> +#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFFu)
> +#define APIC_INTEGRATED(x) ((x)&0xF0u)
No point in doing this -- hexadecimal literals are unsigned by
definition. File a compiler bug if you see them interpreted otherwise.
Maciej
On 12.11.07 12:31:44, Maciej W. Rozycki wrote:
> > -#define GET_APIC_VERSION(x) ((x)&0xFF)
> > -#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
> > -#define APIC_INTEGRATED(x) ((x)&0xF0)
> > +#define GET_APIC_VERSION(x) ((x)&0xFFu)
> > +#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFFu)
> > +#define APIC_INTEGRATED(x) ((x)&0xF0u)
>
> No point in doing this -- hexadecimal literals are unsigned by
> definition. File a compiler bug if you see them interpreted otherwise.
My understanding from the c90/c99 standards is that hexadecimal
constants may result in signed or unsigned types. Contrarily, decimal
constants always result in integer types, if no signed suffix is
given.
However, I made this change only to unify 32 and 64 bit implementation
and took already existing code from the 64 bit version.
-Robert
--
Advanced Micro Devices, Inc.
Operating System Research Center
email: [email protected]
Maciej W. Rozycki wrote:
> On Tue, 6 Nov 2007, Robert Richter wrote:
>
>> -#define GET_APIC_VERSION(x) ((x)&0xFF)
>> -#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
>> -#define APIC_INTEGRATED(x) ((x)&0xF0)
>> +#define GET_APIC_VERSION(x) ((x)&0xFFu)
>> +#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFFu)
>> +#define APIC_INTEGRATED(x) ((x)&0xF0u)
>
> No point in doing this -- hexadecimal literals are unsigned by
> definition. File a compiler bug if you see them interpreted otherwise.
>
Not unless they have to be (see C99 if you don't believe me... on a
I32LP64 system for example, 0x7fffffff is signed int, 0x80000000 is
unsigned int, 0x100000000 is signed long).
What is this supposed to solve in the first place?
-hpa