2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2002-11-19 23:01:07 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2002
|
2011-08-04 16:45:45 +00:00
|
|
|
* Daniel Engström, Omicron Ceti AB, daniel@omicron.se
|
2002-11-19 23:01:07 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ASM_PROCESSOR_H_
|
|
|
|
#define __ASM_PROCESSOR_H_ 1
|
2011-02-12 04:11:30 +00:00
|
|
|
|
2014-11-15 03:56:29 +00:00
|
|
|
#define X86_GDT_ENTRY_SIZE 8
|
|
|
|
|
|
|
|
#define X86_GDT_ENTRY_NULL 0
|
|
|
|
#define X86_GDT_ENTRY_UNUSED 1
|
|
|
|
#define X86_GDT_ENTRY_32BIT_CS 2
|
|
|
|
#define X86_GDT_ENTRY_32BIT_DS 3
|
|
|
|
#define X86_GDT_ENTRY_32BIT_FS 4
|
|
|
|
#define X86_GDT_ENTRY_16BIT_CS 5
|
|
|
|
#define X86_GDT_ENTRY_16BIT_DS 6
|
|
|
|
#define X86_GDT_ENTRY_16BIT_FLAT_CS 7
|
|
|
|
#define X86_GDT_ENTRY_16BIT_FLAT_DS 8
|
|
|
|
#define X86_GDT_NUM_ENTRIES 9
|
2011-12-30 23:24:36 +00:00
|
|
|
|
|
|
|
#define X86_GDT_SIZE (X86_GDT_NUM_ENTRIES * X86_GDT_ENTRY_SIZE)
|
2011-02-12 04:11:30 +00:00
|
|
|
|
2015-04-30 04:25:59 +00:00
|
|
|
/* Length of the public header on Intel microcode blobs */
|
|
|
|
#define UCODE_HEADER_LEN 0x30
|
|
|
|
|
2014-11-11 01:00:24 +00:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
2015-04-29 02:11:29 +00:00
|
|
|
/*
|
|
|
|
* This register is documented in (for example) the Intel Atom Processor E3800
|
|
|
|
* Product Family Datasheet in "PCU - Power Management Controller (PMC)".
|
|
|
|
*
|
|
|
|
* RST_CNT: Reset Control Register (RST_CNT) Offset cf9.
|
|
|
|
*
|
|
|
|
* The naming follows Intel's naming.
|
|
|
|
*/
|
2016-03-12 05:06:59 +00:00
|
|
|
#define IO_PORT_RESET 0xcf9
|
2014-11-13 05:42:19 +00:00
|
|
|
|
2015-04-29 02:11:29 +00:00
|
|
|
enum {
|
|
|
|
SYS_RST = 1 << 1, /* 0 for soft reset, 1 for hard reset */
|
|
|
|
RST_CPU = 1 << 2, /* initiate reset */
|
|
|
|
FULL_RST = 1 << 3, /* full power cycle */
|
|
|
|
};
|
|
|
|
|
2014-11-11 01:00:24 +00:00
|
|
|
static inline __attribute__((always_inline)) void cpu_hlt(void)
|
|
|
|
{
|
|
|
|
asm("hlt");
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline ulong cpu_get_sp(void)
|
|
|
|
{
|
|
|
|
ulong result;
|
|
|
|
|
|
|
|
asm volatile(
|
|
|
|
"mov %%esp, %%eax"
|
|
|
|
: "=a" (result));
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
|
2002-11-19 23:01:07 +00:00
|
|
|
#endif
|