-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 79940 b: refs/heads/master c: d895422 h: refs/heads/master v: v3
- Loading branch information
Glauber de Oliveira Costa
authored and
Ingo Molnar
committed
Jan 30, 2008
1 parent
bc8d1d9
commit 783f5bc
Showing
5 changed files
with
71 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: e34907ae180f4fe6c28bb4516c679c2f81b0c9ed | ||
refs/heads/master: d89542229b657bdcce6a6f76168f9098ee3e9344 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,74 @@ | ||
#ifndef _ASM_X86_SYSTEM_H_ | ||
#define _ASM_X86_SYSTEM_H_ | ||
|
||
#include <asm/asm.h> | ||
|
||
#ifdef CONFIG_X86_32 | ||
# include "system_32.h" | ||
#else | ||
# include "system_64.h" | ||
#endif | ||
|
||
#ifdef __KERNEL__ | ||
#define _set_base(addr, base) do { unsigned long __pr; \ | ||
__asm__ __volatile__ ("movw %%dx,%1\n\t" \ | ||
"rorl $16,%%edx\n\t" \ | ||
"movb %%dl,%2\n\t" \ | ||
"movb %%dh,%3" \ | ||
:"=&d" (__pr) \ | ||
:"m" (*((addr)+2)), \ | ||
"m" (*((addr)+4)), \ | ||
"m" (*((addr)+7)), \ | ||
"0" (base) \ | ||
); } while (0) | ||
|
||
#define _set_limit(addr, limit) do { unsigned long __lr; \ | ||
__asm__ __volatile__ ("movw %%dx,%1\n\t" \ | ||
"rorl $16,%%edx\n\t" \ | ||
"movb %2,%%dh\n\t" \ | ||
"andb $0xf0,%%dh\n\t" \ | ||
"orb %%dh,%%dl\n\t" \ | ||
"movb %%dl,%2" \ | ||
:"=&d" (__lr) \ | ||
:"m" (*(addr)), \ | ||
"m" (*((addr)+6)), \ | ||
"0" (limit) \ | ||
); } while (0) | ||
|
||
#define set_base(ldt, base) _set_base(((char *)&(ldt)) , (base)) | ||
#define set_limit(ldt, limit) _set_limit(((char *)&(ldt)) , ((limit)-1)) | ||
|
||
/* | ||
* Save a segment register away | ||
*/ | ||
#define savesegment(seg, value) \ | ||
asm volatile("mov %%" #seg ",%0":"=rm" (value)) | ||
|
||
static inline unsigned long get_limit(unsigned long segment) | ||
{ | ||
unsigned long __limit; | ||
__asm__("lsll %1,%0" | ||
:"=r" (__limit):"r" (segment)); | ||
return __limit+1; | ||
} | ||
#endif /* __KERNEL__ */ | ||
|
||
static inline void clflush(void *__p) | ||
{ | ||
asm volatile("clflush %0" : "+m" (*(char __force *)__p)); | ||
} | ||
|
||
#define nop() __asm__ __volatile__ ("nop") | ||
|
||
void disable_hlt(void); | ||
void enable_hlt(void); | ||
|
||
extern int es7000_plat; | ||
void cpu_idle_wait(void); | ||
|
||
extern unsigned long arch_align_stack(unsigned long sp); | ||
extern void free_init_pages(char *what, unsigned long begin, unsigned long end); | ||
|
||
void default_idle(void); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters