Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
f8ab2079
Commit
f8ab2079
authored
15 years ago
by
Russ Cox
Browse files
Options
Downloads
Patches
Plain Diff
fix TLS again;
still not quite but a lot better.
parent
57ae1463
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
proc.c
+3
-2
3 additions, 2 deletions
proc.c
proc.h
+4
-1
4 additions, 1 deletion
proc.h
with
7 additions
and
3 deletions
proc.c
+
3
−
2
View file @
f8ab2079
...
...
@@ -70,12 +70,13 @@ ksegment(void)
c
=
&
cpus
[
cpunum
()];
c
->
gdt
[
SEG_KCODE
]
=
SEG
(
STA_X
|
STA_R
,
0
,
0x100000
+
64
*
1024
-
1
,
0
);
c
->
gdt
[
SEG_KDATA
]
=
SEG
(
STA_W
,
0
,
0xffffffff
,
0
);
c
->
gdt
[
SEG_KCPU
]
=
SEG
(
STA_W
,
(
uint
)(
&
c
->
tls
+
1
)
,
0xffffffff
,
0
);
c
->
gdt
[
SEG_KCPU
]
=
SEG
(
STA_W
,
&
c
->
tls
struct
,
0xffffffff
,
0
);
lgdt
(
c
->
gdt
,
sizeof
(
c
->
gdt
));
loadfsgs
(
SEG_KCPU
<<
3
);
// Initialize cpu-local
variables
.
// Initialize cpu-local
storage
.
c
->
tlsstruct
=
&
c
->
tlsstruct
;
asm
volatile
(
""
);
// Do not let gcc reorder across this line.
cpu
=
c
;
proc
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
proc.h
+
4
−
1
View file @
f8ab2079
...
...
@@ -58,7 +58,10 @@ struct cpu {
volatile
uint
booted
;
// Has the CPU started?
int
ncli
;
// Depth of pushcli nesting.
int
intena
;
// Were interrupts enabled before pushcli?
void
*
tls
[
2
];
// "Thread"-local storage variables
struct
cpu
*
cpu
;
struct
proc
*
proc
;
void
*
tlsstruct
;
};
...
...
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