Mixed changes

- Added automatic utcb map/prefaulting of forked tasks for fs0
  so that it does not need to explicitly request those tasks from mm0.
  Eliminating fs0 requests to mm0 reduce deadlock possibilities.

- Replaced kmalloc with a public malloc implementation because of a bug in kmalloc.
- Fixed a kfree bug. default_release_pages was trying to free page_array pages.
This commit is contained in:
Bahadir Balban
2008-09-09 13:36:42 +03:00
parent 68a4e78e66
commit 89d774f7fa
13 changed files with 515 additions and 42 deletions

View File

@@ -0,0 +1,19 @@
#ifndef __PRIVATE_MALLOC_H__
#define __PRIVATE_MALLOC_H__
#include <stddef.h>
#include <string.h>
void *kmalloc(size_t size);
void kfree(void *blk);
static inline void *kzalloc(size_t size)
{
void *buf = kmalloc(size);
memset(buf, 0, size);
return buf;
}
#endif /*__PRIVATE_MALLOC_H__ */

View File

@@ -43,7 +43,7 @@ struct shm_descriptor {
/* Initialises shared memory bookkeeping structures */
void shm_init();
void *shmat_shmget_internal(key_t key, void *shmaddr);
void *shmat_shmget_internal(struct tcb *task, key_t key, void *shmaddr);
struct vm_file *shm_new(key_t key, unsigned long npages);
#endif /* __SHM_H__ */

View File

@@ -101,5 +101,6 @@ void init_pm(struct initdata *initdata);
struct tcb *task_create(struct task_ids *ids, unsigned int flags);
int send_task_data(l4id_t requester);
void task_map_prefault_utcb(struct tcb *mapper, struct tcb *owner);
#endif /* __TASK_H__ */

View File

@@ -14,7 +14,7 @@
#include <arch/mm.h>
#include <lib/spinlock.h>
#define DEBUG_FAULT_HANDLING
// #define DEBUG_FAULT_HANDLING
#ifdef DEBUG_FAULT_HANDLING
#define dprintf(...) printf(__VA_ARGS__)
#else