Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
4781ebda
Commit
4781ebda
authored
Dec 29, 2002
by
Jeff Dike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the segment remapping code under arch/um/kernel/tt.
parent
f976e1ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
arch/um/kernel/tt/mem_user.c
arch/um/kernel/tt/mem_user.c
+50
-0
arch/um/kernel/tt/unmap.c
arch/um/kernel/tt/unmap.c
+0
-0
No files found.
arch/um/kernel/tt/mem_user.c
0 → 100644
View file @
4781ebda
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/mman.h>
#include "tt.h"
#include "mem_user.h"
#include "user_util.h"
void
remap_data
(
void
*
segment_start
,
void
*
segment_end
,
int
w
)
{
void
*
addr
;
unsigned
long
size
;
int
data
,
prot
;
if
(
w
)
prot
=
PROT_WRITE
;
else
prot
=
0
;
prot
|=
PROT_READ
|
PROT_EXEC
;
size
=
(
unsigned
long
)
segment_end
-
(
unsigned
long
)
segment_start
;
data
=
create_mem_file
(
size
);
if
((
addr
=
mmap
(
NULL
,
size
,
PROT_WRITE
|
PROT_READ
,
MAP_SHARED
,
data
,
0
))
<
0
){
perror
(
"mapping new data segment"
);
exit
(
1
);
}
memcpy
(
addr
,
segment_start
,
size
);
if
(
switcheroo
(
data
,
prot
,
addr
,
segment_start
,
size
)
<
0
){
printf
(
"switcheroo failed
\n
"
);
exit
(
1
);
}
}
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
arch/um/kernel/unmap.c
→
arch/um/kernel/
tt/
unmap.c
View file @
4781ebda
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment