mirror of
https://github.com/drasko/codezero.git
synced 2026-10-27 04:07:27 +01:00
Mixed changes
- Adding prefaulting of fs0 to avoid page fault deadlocks. - Fixed a bug that a vmo page_cache equivalence would simply drop a link to an original vmo, even if the vmo could have more pages outside the page cache, or if the vmo was not a shadow vmo. - Fixed a bug with page allocator where recursion would corrupt global variables. - Now going to fix or re-write a simpler page allocator that works.
This commit is contained in:
@@ -148,11 +148,53 @@ void handle_requests(void)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
int self_spawn(void)
|
||||
{
|
||||
struct task_ids ids;
|
||||
struct tcb *self, *self_child;
|
||||
|
||||
BUG_ON(!(self = find_task(self_tid())));
|
||||
|
||||
ids.tid = THREAD_ID_INVALID;
|
||||
ids.spid = self->spid;
|
||||
|
||||
/* Create a new L4 thread in current thread's address space. */
|
||||
self_child = task_create(&ids, THREAD_CREATE_SAMESPC);
|
||||
|
||||
/* Copy self tcb to child. TODO: ??? Not sure about this */
|
||||
copy_tcb(self_child, self);
|
||||
|
||||
/*
|
||||
* Create a new utcb. Every pager thread will
|
||||
* need its own utcb to answer calls.
|
||||
*/
|
||||
self_child->utcb = utcb_vaddr_new();
|
||||
|
||||
/* TODO: Create a new utcb shm for own thread ??? Does it need to shmat??? */
|
||||
|
||||
/* TODO: Notify vfs ??? */
|
||||
|
||||
/* TODO: Modify registers ???, it depends on what state is copied in C0 */
|
||||
|
||||
task_add_global(self_child);
|
||||
|
||||
l4_thread_control(THREAD_RUN, &ids);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
/* Initialise the memory, server tasks, mmap and start them. */
|
||||
initialise();
|
||||
|
||||
/*
|
||||
if (self_spawn())
|
||||
while (1)
|
||||
;
|
||||
*/
|
||||
|
||||
while (1) {
|
||||
handle_requests();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user