mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
Removed unnecessary printks, fixed few minor issues.
This commit is contained in:
@@ -46,8 +46,15 @@ int sys_ipc_control(struct syscall_args *regs)
|
||||
int ipc_send(l4id_t recv_tid)
|
||||
{
|
||||
struct ktcb *receiver = find_task(recv_tid);
|
||||
struct waitqueue_head *wqhs = &receiver->wqh_send;
|
||||
struct waitqueue_head *wqhr = &receiver->wqh_recv;
|
||||
struct waitqueue_head *wqhs, *wqhr;
|
||||
|
||||
if (!receiver) {
|
||||
printk("%s: tid: %d, no such task.\n", __FUNCTION__,
|
||||
recv_tid);
|
||||
return -EINVAL;
|
||||
}
|
||||
wqhs = &receiver->wqh_send;
|
||||
wqhr = &receiver->wqh_recv;
|
||||
|
||||
spin_lock(&wqhs->slock);
|
||||
spin_lock(&wqhr->slock);
|
||||
|
||||
@@ -83,29 +83,19 @@ int thread_create(struct task_ids *ids)
|
||||
copy_pgd_kern_all(new->pgd);
|
||||
|
||||
/* Get new space id */
|
||||
if (ids->spid == TASK_ID_INVALID) {
|
||||
if (ids->spid == TASK_ID_INVALID)
|
||||
ids->spid = id_new(space_id_pool);
|
||||
printk("Got new space id: %d\n", ids->spid);
|
||||
} else {
|
||||
printk("Try new space id: %d\n", ids->spid);
|
||||
else
|
||||
if ((ids->spid = id_get(space_id_pool, ids->spid)) < 0)
|
||||
ids->spid = id_new(space_id_pool);
|
||||
else
|
||||
printk("Success.\n");
|
||||
}
|
||||
|
||||
spc_found:
|
||||
/* Get a new thread id */
|
||||
if (ids->tid == TASK_ID_INVALID) {
|
||||
if (ids->tid == TASK_ID_INVALID)
|
||||
ids->tid = id_new(thread_id_pool);
|
||||
printk("Got new thread id: %d\n", ids->tid);
|
||||
} else {
|
||||
printk("Try new thread id: %d\n", ids->tid);
|
||||
else
|
||||
if ((ids->tid = id_get(thread_id_pool, ids->tid)) < 0)
|
||||
ids->tid = id_new(thread_id_pool);
|
||||
else
|
||||
printk("Success.\n");
|
||||
}
|
||||
|
||||
/* Set all ids */
|
||||
set_task_ids(new, ids);
|
||||
|
||||
@@ -91,22 +91,22 @@ int check_aborts(u32 faulted_pc, u32 fsr, u32 far)
|
||||
int ret = 0;
|
||||
|
||||
if (is_prefetch_abort(fsr)) {
|
||||
dprintk("Prefetch abort @ ", faulted_pc);
|
||||
// dprintk("Prefetch abort @ ", faulted_pc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (fsr & ARM_FSR_MASK) {
|
||||
/* Aborts that are expected on page faults: */
|
||||
case DABT_PERM_PAGE:
|
||||
dprintk("Page permission fault @ ", far);
|
||||
// dprintk("Page permission fault @ ", far);
|
||||
ret = 0;
|
||||
break;
|
||||
case DABT_XLATE_PAGE:
|
||||
dprintk("Page translation fault @ ", far);
|
||||
// dprintk("Page translation fault @ ", far);
|
||||
ret = 0;
|
||||
break;
|
||||
case DABT_XLATE_SECT:
|
||||
dprintk("Section translation fault @ ", far);
|
||||
// dprintk("Section translation fault @ ", far);
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
@@ -175,7 +175,7 @@ int check_aborts(u32 faulted_pc, u32 fsr, u32 far)
|
||||
void data_abort_handler(u32 faulted_pc, u32 fsr, u32 far)
|
||||
{
|
||||
set_abort_type(fsr, ARM_DABT);
|
||||
dprintk("Data abort @ PC: ", faulted_pc);
|
||||
// dprintk("Data abort @ PC: ", faulted_pc);
|
||||
if (check_aborts(faulted_pc, fsr, far) < 0) {
|
||||
printascii("This abort can't be handled by any pager.\n");
|
||||
goto error;
|
||||
|
||||
@@ -25,6 +25,7 @@ int check_access(unsigned long vaddr, unsigned long size, unsigned int flags)
|
||||
/* Do not allow ridiculously big sizes */
|
||||
if (size >= USER_AREA_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
/* Check if in user range, but this is more up to the pager to decide */
|
||||
if (current->tid == PAGER_TID) {
|
||||
if (!(vaddr >= INITTASK_AREA_START && vaddr < INITTASK_AREA_END))
|
||||
|
||||
Reference in New Issue
Block a user