Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
37ee75f4
Commit
37ee75f4
authored
14 years ago
by
Austin Clements
Browse files
Options
Downloads
Patches
Plain Diff
Rearrange for better page breaking
parent
7472b2b4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
x86.h
+43
-42
43 additions, 42 deletions
x86.h
with
43 additions
and
42 deletions
x86.h
+
43
−
42
View file @
37ee75f4
...
...
@@ -90,25 +90,36 @@ readeflags(void)
return
eflags
;
}
static
inline
uint
xchg
(
volatile
uint
*
addr
,
uint
newval
)
{
uint
result
;
// The + in "+m" denotes a read-modify-write operand.
asm
volatile
(
"lock; xchgl %0, %1"
:
"+m"
(
*
addr
),
"=a"
(
result
)
:
"1"
(
newval
)
:
"cc"
);
return
result
;
}
static
inline
void
loadgs
(
ushort
v
)
{
asm
volatile
(
"movw %0, %%gs"
:
:
"r"
(
v
));
}
static
inline
void
lebp
(
uint
val
)
{
asm
volatile
(
"movl %0,%%ebp"
:
:
"r"
(
val
));
}
static
inline
uint
rebp
(
void
)
{
uint
val
;
asm
volatile
(
"movl %%ebp,%0"
:
"=r"
(
val
));
return
val
;
}
static
inline
void
lesp
(
uint
val
)
{
asm
volatile
(
"movl %0,%%esp"
:
:
"r"
(
val
));
}
static
inline
uint
resp
(
void
)
{
uint
val
;
asm
volatile
(
"movl %%esp,%0"
:
"=r"
(
val
));
return
val
;
}
static
inline
void
cli
(
void
)
{
...
...
@@ -121,6 +132,25 @@ sti(void)
asm
volatile
(
"sti"
);
}
static
inline
void
nop_pause
(
void
)
{
asm
volatile
(
"pause"
:
:
);
}
//PAGEBREAK!
static
inline
uint
xchg
(
volatile
uint
*
addr
,
uint
newval
)
{
uint
result
;
// The + in "+m" denotes a read-modify-write operand.
asm
volatile
(
"lock; xchgl %0, %1"
:
"+m"
(
*
addr
),
"=a"
(
result
)
:
"1"
(
newval
)
:
"cc"
);
return
result
;
}
static
inline
void
lcr0
(
uint
val
)
{
asm
volatile
(
"movl %0,%%cr0"
:
:
"r"
(
val
));
...
...
@@ -152,35 +182,6 @@ static inline uint rcr3(void)
return
val
;
}
static
inline
void
lebp
(
uint
val
)
{
asm
volatile
(
"movl %0,%%ebp"
:
:
"r"
(
val
));
}
static
inline
uint
rebp
(
void
)
{
uint
val
;
asm
volatile
(
"movl %%ebp,%0"
:
"=r"
(
val
));
return
val
;
}
static
inline
void
lesp
(
uint
val
)
{
asm
volatile
(
"movl %0,%%esp"
:
:
"r"
(
val
));
}
static
inline
uint
resp
(
void
)
{
uint
val
;
asm
volatile
(
"movl %%esp,%0"
:
"=r"
(
val
));
return
val
;
}
static
inline
void
nop_pause
(
void
)
{
asm
volatile
(
"pause"
:
:
);
}
//PAGEBREAK: 36
// Layout of the trap frame built on the stack by the
// hardware and by trapasm.S, and passed to trap().
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment