added a segment for segattach(2) that gives access to the raspberry pi's gpio header.

This commit is contained in:
Matthew Veety 2014-01-12 11:00:38 -05:00
parent a5525457bd
commit aeb49aca9e

View file

@ -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 */
}