Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
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
Joshua
wendelin.core
Commits
56411971
Commit
56411971
authored
Jul 09, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
323df0d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
7 deletions
+23
-7
Makefile
Makefile
+1
-1
bigfile/virtmem.c
bigfile/virtmem.c
+18
-5
include/wendelin/bigfile/file.h
include/wendelin/bigfile/file.h
+1
-1
include/wendelin/bigfile/virtmem.h
include/wendelin/bigfile/virtmem.h
+3
-0
No files found.
Makefile
View file @
56411971
...
...
@@ -96,7 +96,7 @@ LINKC = $(LINK.c) $< $(LOADLIBES) $(LDLIBS) -o $@
# tests without instrumentation
test.t
:
$(TESTS:%=%.trun)
%.trun
:
%.t
$
(
XRUN<
)
gdb
-q
-ex
run
-ex
backtrace
-ex
quit
$
(
XRUN<
)
%.t
:
%.c $(ccan_config)
$(LINKC)
...
...
bigfile/virtmem.c
View file @
56411971
...
...
@@ -223,6 +223,8 @@ int fileh_mmap(VMA *vma, BigFileH *fileh, pgoff_t pgoffset, pgoff_t pglen)
void
*
addr
;
size_t
len
=
pglen
*
fileh
->
ramh
->
ram
->
pagesize
;
int
err
=
0
;
BigFile
*
file
=
fileh
->
file
;
const
bigfile_ops
*
fops
=
file
->
file_ops
;
sigset_t
save_sigset
;
sigsegv_block
(
&
save_sigset
);
...
...
@@ -235,11 +237,22 @@ int fileh_mmap(VMA *vma, BigFileH *fileh, pgoff_t pgoffset, pgoff_t pglen)
if
(
!
vma
->
page_ismappedv
)
goto
fail
;
/* allocate address space somewhere */
// XXX overlay: -> mmap(base, READ) + mmap(fileh->dirty_pages)
addr
=
mem_valloc
(
NULL
,
len
);
if
(
!
addr
)
goto
fail
;
// XXX hardcoded - allow user choise?
vma
->
mmap_overlay
=
(
fops
->
mmap_setup_read
!=
NULL
);
if
(
vma
->
mmap_overlay
)
{
TODO
(
file
->
blksize
!=
fileh
->
ramh
->
ram
->
pagesize
);
addr
=
fops
->
mmap_setup_read
(
file
,
pgoffset
,
pglen
,
vma
);
if
(
!
addr
)
goto
fail
;
// XXX + mmap(fileh->dirty_pages)
}
else
{
/* allocate address space somewhere */
addr
=
mem_valloc
(
NULL
,
len
);
if
(
!
addr
)
goto
fail
;
}
/* everything allocated - link it up */
vma
->
addr_start
=
(
uintptr_t
)
addr
;
...
...
include/wendelin/bigfile/file.h
View file @
56411971
...
...
@@ -96,6 +96,6 @@ struct bigfile_ops {
*/
void
(
*
release
)
(
BigFile
*
file
);
};
typedef
struct
bigfile_ops
bigfile_ops
;
#endif
include/wendelin/bigfile/virtmem.h
View file @
56411971
...
...
@@ -137,6 +137,9 @@ struct VMA {
/* whether corresponding to pgoffset-f_offset page is mapped in this VMA */
bitmap
*
page_ismappedv
;
/* len ~ Δaddr / pagesize */
// XXX name
unsigned
mmap_overlay
:
1
;
/* whether base data are taken as file mmap XXX */
};
...
...
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