diff mbox

[U-Boot,36/48] x86: Add an enum for some commonly-used GDT bits

Message ID 1437580180-6405-37-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 22, 2015, 3:49 p.m. UTC
Rather than add these as open-coded values, create an enum with the commonly
used flags.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/x86/include/asm/cpu.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Bin Meng July 24, 2015, 6:11 a.m. UTC | #1
Hi Simon,

On Wed, Jul 22, 2015 at 11:49 PM, Simon Glass <sjg@chromium.org> wrote:
> Rather than add these as open-coded values, create an enum with the commonly
> used flags.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/x86/include/asm/cpu.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
> index 08284ee..b96513d 100644
> --- a/arch/x86/include/asm/cpu.h
> +++ b/arch/x86/include/asm/cpu.h
> @@ -27,6 +27,16 @@ enum {
>         X86_VENDOR_UNKNOWN = 0xff
>  };
>
> +/* Global descriptor table (GDT) bits */
> +enum {
> +       GDT_4GB                 = 1ULL << 55,

I think it should be GDT_4KB

> +       GDT_32BIT               = 1ULL << 54,
> +       GDT_LONG                = 1ULL << 53,
> +       GDT_PRESENT             = 1ULL << 47,
> +       GDT_NOTSYS              = 1ULL << 44,
> +       GDT_CODE                = 1ULL << 43,
> +};
> +
>  struct cpuid_result {
>         uint32_t eax;
>         uint32_t ebx;
> --

Regards,
Bin
diff mbox

Patch

diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index 08284ee..b96513d 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -27,6 +27,16 @@  enum {
 	X86_VENDOR_UNKNOWN = 0xff
 };
 
+/* Global descriptor table (GDT) bits */
+enum {
+	GDT_4GB			= 1ULL << 55,
+	GDT_32BIT		= 1ULL << 54,
+	GDT_LONG		= 1ULL << 53,
+	GDT_PRESENT		= 1ULL << 47,
+	GDT_NOTSYS		= 1ULL << 44,
+	GDT_CODE		= 1ULL << 43,
+};
+
 struct cpuid_result {
 	uint32_t eax;
 	uint32_t ebx;