added a segment for segattach(2) that gives access to the raspberry pi's gpio header.
This commit is contained in:
parent
a5525457bd
commit
aeb49aca9e
1 changed files with 14 additions and 0 deletions
|
@ -215,6 +215,19 @@ optionsinit(char* s)
|
|||
oargv[oargc] = nil;
|
||||
}
|
||||
|
||||
void
|
||||
gpiomeminit(void)
|
||||
{
|
||||
Physseg seg;
|
||||
memset(&seg, 0, sizeof seg);
|
||||
seg.attr = SG_PHYSICAL;
|
||||
seg.name = "gpio";
|
||||
seg.pa = (VIRTIO+0x200000);
|
||||
seg.size = 1;
|
||||
addphysseg(&seg);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
main(void)
|
||||
{
|
||||
|
@ -259,6 +272,7 @@ main(void)
|
|||
pageinit();
|
||||
swapinit();
|
||||
userinit();
|
||||
gpiomeminit();
|
||||
schedinit();
|
||||
assert(0); /* shouldn't have returned */
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue