mirror of
https://github.com/drasko/codezero.git
synced 2026-10-15 13:47:01 +02:00
Cleaned up all compile errors.
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
#define __MM0_IDPOOL_H__
|
||||
|
||||
#include <lib/bit.h>
|
||||
#include <l4/macros.h>
|
||||
#include INC_GLUE(memory.h)
|
||||
#include <string.h>
|
||||
|
||||
struct id_pool {
|
||||
int nwords;
|
||||
@@ -9,7 +12,7 @@ struct id_pool {
|
||||
};
|
||||
|
||||
/* Copy one id pool to another by calculating its size */
|
||||
static inline void id_pool_copy(struct idpool *to, struct idpool *from, int totalbits)
|
||||
static inline void id_pool_copy(struct id_pool *to, struct id_pool *from, int totalbits)
|
||||
{
|
||||
int nwords = BITWISE_GETWORD(totalbits);
|
||||
|
||||
|
||||
@@ -22,4 +22,8 @@ int pager_sys_write(l4id_t sender, unsigned long vnum, unsigned long f_offset,
|
||||
int pager_sys_close(l4id_t sender, l4id_t closer, int fd);
|
||||
int pager_update_stats(l4id_t sender, unsigned long vnum,
|
||||
unsigned long newsize);
|
||||
|
||||
int pager_notify_fork(l4id_t sender, l4id_t parid,
|
||||
l4id_t chid, unsigned long utcb_address);
|
||||
|
||||
#endif /* __FS0_SYSCALLS_H__ */
|
||||
|
||||
@@ -10,12 +10,6 @@
|
||||
#include INC_GLUE(memory.h)
|
||||
#include <stdio.h>
|
||||
|
||||
static inline void id_pool_copy(struct idpool *to, struct idpool *from, int totalbits)
|
||||
{
|
||||
int nwords = BITWISE_GETWORD(totalbits);
|
||||
|
||||
memcpy(to, from, nwords * SZ_WORD + sizeof(struct id_pool));
|
||||
}
|
||||
struct id_pool *id_pool_new_init(int totalbits)
|
||||
{
|
||||
int nwords = BITWISE_GETWORD(totalbits);
|
||||
|
||||
+16
-17
@@ -72,6 +72,22 @@ int receive_pager_taskdata_orig(l4id_t *tdata)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Allocate a task struct and initialise it */
|
||||
struct tcb *create_tcb(void)
|
||||
{
|
||||
struct tcb *t;
|
||||
|
||||
if (!(t = kmalloc(sizeof(*t))))
|
||||
return PTR_ERR(-ENOMEM);
|
||||
|
||||
t->fdpool = id_pool_new_init(TASK_FILES_MAX);
|
||||
INIT_LIST_HEAD(&t->list);
|
||||
list_add_tail(&t->list, &tcb_head.list);
|
||||
tcb_head.total++;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/*
|
||||
* Receives ipc from pager about a new fork event and
|
||||
* the information on the resulting child task.
|
||||
@@ -80,7 +96,6 @@ int pager_notify_fork(l4id_t sender, l4id_t parid,
|
||||
l4id_t chid, unsigned long utcb_address)
|
||||
{
|
||||
struct tcb *child, *parent;
|
||||
int err;
|
||||
|
||||
// printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
|
||||
BUG_ON(!(parent = find_task(parid)));
|
||||
@@ -136,22 +151,6 @@ struct task_data_head *receive_pager_taskdata(void)
|
||||
return (struct task_data_head *)utcb_page;
|
||||
}
|
||||
|
||||
/* Allocate a task struct and initialise it */
|
||||
struct tcb *create_tcb(void)
|
||||
{
|
||||
struct tcb *t;
|
||||
|
||||
if (!(t = kmalloc(sizeof(*t))))
|
||||
return PTR_ERR(-ENOMEM);
|
||||
|
||||
t->fdpool = id_pool_new_init(TASK_FILES_MAX);
|
||||
INIT_LIST_HEAD(&t->list);
|
||||
list_add_tail(&t->list, &tcb_head.list);
|
||||
tcb_head.total++;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/* Attaches to task's utcb. FIXME: Add SHM_RDONLY and test it. */
|
||||
int task_utcb_attach(struct tcb *t)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user