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
7b644318
Commit
7b644318
authored
15 years ago
by
rsc
Browse files
Options
Downloads
Patches
Plain Diff
clean up %fs %gs use
parent
e97519a6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bootasm.S
+1
-2
1 addition, 2 deletions
bootasm.S
proc.c
+1
-1
1 addition, 1 deletion
proc.c
trapasm.S
+0
-3
0 additions, 3 deletions
trapasm.S
x86.h
+3
-2
3 additions, 2 deletions
x86.h
with
5 additions
and
8 deletions
bootasm.S
+
1
−
2
View file @
7b644318
...
...
@@ -7,7 +7,6 @@
#define SEG_KCODE 1 // kernel code
#define SEG_KDATA 2 // kernel data+stack
#define SEG_KCPU 3 // kernel per-cpu data
#define CR0_PE 1 // protected mode enable bit
...
...
@@ -63,7 +62,7 @@ start32:
movw
%
ax
,
%
ds
#
->
DS
:
Data
Segment
movw
%
ax
,
%
es
#
->
ES
:
Extra
Segment
movw
%
ax
,
%
ss
#
->
SS
:
Stack
Segment
movw
$
(
SEG_KCPU
<<
3
),
%
ax
#
Our
per
-
cpu
segment
selector
movw
$
0
,
%
ax
#
Zero
segments
not
ready
for
use
movw
%
ax
,
%
fs
#
->
FS
movw
%
ax
,
%
gs
#
->
GS
...
...
This diff is collapsed.
Click to expand it.
proc.c
+
1
−
1
View file @
7b644318
...
...
@@ -93,9 +93,9 @@ ksegment(void)
c1
->
gdt
[
SEG_UDATA
]
=
SEG_NULL
;
c1
->
gdt
[
SEG_TSS
]
=
SEG_NULL
;
lgdt
(
c1
->
gdt
,
sizeof
(
c1
->
gdt
));
loadfsgs
(
SEG_KCPU
<<
3
);
// Initialize cpu-local variables.
setgs
(
SEG_KCPU
<<
3
);
c
=
c1
;
cp
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
trapasm.S
+
0
−
3
View file @
7b644318
...
...
@@ -13,10 +13,7 @@ alltraps:
pushal
#
Set
up
data
and
per
-
cpu
segments
.
#
Can
find
out
KDATA
from
%
ss
.
#
Assume
that
KCPU
is
KDATA
+
1
.
movw
$
(
SEG_KDATA
<<
3
),
%
ax
movw
%
ss
,
%
ax
movw
%
ax
,
%
ds
movw
%
ax
,
%
es
movw
$
(
SEG_KCPU
<<
3
),
%
ax
...
...
This diff is collapsed.
Click to expand it.
x86.h
+
3
−
2
View file @
7b644318
...
...
@@ -104,9 +104,10 @@ xchg(volatile uint *addr, uint newval)
}
static
inline
void
set
gs
(
ushort
gs
)
loadfs
gs
(
ushort
v
)
{
asm
volatile
(
"movw %0, %%gs"
:
:
"r"
(
gs
));
asm
volatile
(
"movw %0, %%fs"
:
:
"r"
(
v
));
asm
volatile
(
"movw %0, %%gs"
:
:
"r"
(
v
));
}
static
inline
void
...
...
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