Cross Reference: cpu.h
xref
: /
osnet-11
/
usr
/
src
/
grub
/
grub-0.97
/
stage2
/
cpu.h
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
1
N/A
/*
1
N/A
* GRUB -- GRand Unified Bootloader
1
N/A
* Copyright (C) 2006 Free Software Foundation, Inc.
1
N/A
*
1
N/A
* This program is free software; you can redistribute it
and
/
or
modify
1
N/A
* it under the terms of the GNU General Public License as published by
1
N/A
* the Free Software Foundation; either version 2 of the License, or
1
N/A
* (at your option) any later version.
1
N/A
*
1
N/A
* This program is distributed in the hope that it will be useful,
1
N/A
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1
N/A
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1
N/A
* GNU General Public License for more details.
1
N/A
*
1
N/A
* You should have received a copy of the GNU General Public License
1
N/A
* along with this program; if not, write to the Free Software
1
N/A
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1
N/A
*/
1
N/A
/*
1
N/A
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
1
N/A
* Use is subject to license terms.
1
N/A
*/
1
N/A
1
N/A
#
ifndef
_AMD64_CPU
1
N/A
#
define
_AMD64_CPU
1
N/A
1
N/A
#
pragma
ident
"%Z%%M% %I% %E% SMI"
1
N/A
1
N/A
#
ifdef
__cplusplus
1
N/A
extern
"C"
{
1
N/A
#
endif
1
N/A
1
N/A
typedef
unsigned
int
uint_t
;
1
N/A
typedef
unsigned
long
ulong_t
;
1
N/A
1
N/A
#
define
BITX
(u, h, l) (((u) >> (l)) & ((
1lu
<< ((h) - (l) +
1lu
)) -
1lu
))
1
N/A
1
N/A
#
include
<
controlregs.h
>
1
N/A
1
N/A
#
define
CB
0x0001
1
N/A
1
N/A
extern
void
amd64_flush_tlb
(
void
);
1
N/A
extern
void
amd64_flush_tlbentry
(
caddr_t
);
1
N/A
1
N/A
extern
ulong_t
amd64_get_cr2
(
void
);
1
N/A
extern
ulong_t
amd64_get_cr0
(
void
);
1
N/A
extern
ulong_t
amd64_get_cr3
(
void
);
1
N/A
extern
ulong_t
amd64_get_cr4
(
void
);
1
N/A
1
N/A
extern
ulong_t
amd64_get_eflags
(
void
);
1
N/A
1
N/A
struct
amd64_cpuid_regs
{
1
N/A
uint32_t
r_eax
;
1
N/A
uint32_t
r_ebx
;
1
N/A
uint32_t
r_ecx
;
1
N/A
uint32_t
r_edx
;
1
N/A
};
1
N/A
1
N/A
#
define
AMD64_Auth
0x68747541
1
N/A
#
define
AMD64_enti
0x69746e65
1
N/A
#
define
AMD64_cAMD
0x444d4163
1
N/A
1
N/A
extern
uint32_t
amd64_cpuid_supported
(
void
);
1
N/A
extern
void
amd64_cpuid_insn
(
uint32_t
,
struct
amd64_cpuid_regs
*);
1
N/A
extern
void
amd64_rdmsr
(
uint32_t
,
uint64_t
*);
1
N/A
extern
void
amd64_wrmsr
(
uint32_t
,
const
uint64_t
*);
1
N/A
extern
int
get_target_operating_mode
(
void
);
1
N/A
1
N/A
#
ifdef
__cplusplus
1
N/A
}
1
N/A
#
endif
1
N/A
1
N/A
#
endif
/* _AMD64_CPU */