mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Add {rd,wr}{fs,gs}base C wrappers for instructions.
Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
7bf0049e48
commit
0fd7ea1f21
1 changed files with 32 additions and 0 deletions
|
|
@ -651,6 +651,38 @@ load_gs(u_short sel)
|
|||
}
|
||||
#endif
|
||||
|
||||
static __inline uint64_t
|
||||
rdfsbase(void)
|
||||
{
|
||||
uint64_t x;
|
||||
|
||||
__asm __volatile("rdfsbase %0" : "=r" (x));
|
||||
return (x);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
wrfsbase(uint64_t x)
|
||||
{
|
||||
|
||||
__asm __volatile("wrfsbase %0" : : "r" (x));
|
||||
}
|
||||
|
||||
static __inline uint64_t
|
||||
rdgsbase(void)
|
||||
{
|
||||
uint64_t x;
|
||||
|
||||
__asm __volatile("rdgsbase %0" : "=r" (x));
|
||||
return (x);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
wrgsbase(uint64_t x)
|
||||
{
|
||||
|
||||
__asm __volatile("wrgsbase %0" : : "r" (x));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
bare_lgdt(struct region_descriptor *addr)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue