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
6f232758
Commit
6f232758
authored
13 years ago
by
Frans Kaashoek
Browse files
Options
Downloads
Patches
Plain Diff
Eliminate USERTOP; no use for it.
parent
194f8bf7
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
memlayout.h
+0
-1
0 additions, 1 deletion
memlayout.h
vm.c
+3
-3
3 additions, 3 deletions
vm.c
with
3 additions
and
4 deletions
memlayout.h
+
0
−
1
View file @
6f232758
...
...
@@ -6,7 +6,6 @@
// Key addresses for address space layout (see kmap in vm.c for the layout)
#define KERNBASE 0xF0000000 // First kernel virtual address
#define USERTOP (KERNBASE-PGSIZE) // Highest user virtual address
#define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
#ifndef __ASSEMBLER__
...
...
This diff is collapsed.
Click to expand it.
vm.c
+
3
−
3
View file @
6f232758
...
...
@@ -99,7 +99,7 @@ mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm, char* (*alloc)(vo
// than its memory.
//
// setupkvm() and exec() set up every page table like this:
// 0..
USERTOP
: user memory (text, data, stack, heap), mapped to some unused phys mem
// 0..
KERNBASE
: user memory (text, data, stack, heap), mapped to some unused phys mem
// KERNBASE..KERNBASE+EXTMEM: mapped to 0..EXTMEM (below extended memory)
// KERNBASE+EXTMEM..KERNBASE+end : mapped to EXTMEM..end (mapped without write permission)
// KERNBASE+end..KERBASE+PHYSTOP : mapped to end..PHYSTOP (rw data + free memory)
...
...
@@ -223,7 +223,7 @@ allocuvm(pde_t *pgdir, uint oldsz, uint newsz)
char
*
mem
;
uint
a
;
if
(
newsz
>
USERTOP
)
if
(
newsz
>
=
KERNBASE
)
return
0
;
if
(
newsz
<
oldsz
)
return
oldsz
;
...
...
@@ -279,7 +279,7 @@ freevm(pde_t *pgdir)
if
(
pgdir
==
0
)
panic
(
"freevm: no pgdir"
);
deallocuvm
(
pgdir
,
USERTOP
,
0
);
deallocuvm
(
pgdir
,
KERNBASE
,
0
);
for
(
i
=
0
;
i
<
NPDENTRIES
;
i
++
){
if
(
pgdir
[
i
]
&
PTE_P
)
{
char
*
v
=
p2v
(
PTE_ADDR
(
pgdir
[
i
]));
...
...
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