Added copy-on-write shared memory but untested yet.

For anonymous shm, mmap now adds a shm_file and devzero behind it
as two vm_objects. Faults are handled by copy_on_write(). Just as
shadows copy r/w pages from original files, it should copy r/w
pages from devzero into the shm_file in front.

shmat/shmget uses mmap to set-up their areas.

Untested yet so bugs expected.

	modified:   tasks/libl4/src/init.c
	modified:   tasks/mm0/include/shm.h
	modified:   tasks/mm0/include/vm_area.h
	modified:   tasks/mm0/src/fault.c
	modified:   tasks/mm0/src/mmap.c
	modified:   tasks/mm0/src/shm.c
This commit is contained in:
Bahadir Balban
2008-03-21 15:40:54 +00:00
parent 466138f125
commit b369ff6efe
6 changed files with 129 additions and 79 deletions

View File

@@ -96,12 +96,10 @@ int utcb_init(void)
/* Use it as a key to create a shared memory region */
BUG_ON((shmid = shmget((key_t)utcb_page,
PAGE_SIZE, IPC_CREAT)) < 0);
printf("Shmget success. shmid: %d\n", shmid);
/* Attach to the region */
BUG_ON((shmaddr = shmat(shmid, utcb_page, 0)) < 0);
BUG_ON(shmaddr != utcb_page);
printf("Shmat success. Attached %d @ 0x%x\n", shmid, (unsigned long)shmaddr);
}
return 0;