mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
Moved ipc flags manipulation to ipc.h glue file
This commit is contained in:
@@ -134,42 +134,6 @@ static inline void set_task_ids(struct ktcb *task, struct task_ids *ids)
|
||||
task->tgid = ids->tgid;
|
||||
}
|
||||
|
||||
static inline void tcb_set_ipc_flags(struct ktcb *task,
|
||||
unsigned int flags)
|
||||
{
|
||||
task->ipc_flags = flags;
|
||||
}
|
||||
|
||||
static inline unsigned int tcb_get_ipc_flags(struct ktcb *task)
|
||||
{
|
||||
return task->ipc_flags;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
ipc_flags_set_type(unsigned int flags, unsigned int type)
|
||||
{
|
||||
flags &= ~IPC_FLAGS_TYPE_MASK;
|
||||
flags |= type & IPC_FLAGS_TYPE_MASK;
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline unsigned int ipc_flags_get_type(unsigned int flags)
|
||||
{
|
||||
return flags & IPC_FLAGS_TYPE_MASK;
|
||||
}
|
||||
|
||||
static inline void tcb_set_ipc_type(struct ktcb *task,
|
||||
unsigned int type)
|
||||
{
|
||||
task->ipc_flags = ipc_flags_set_type(task->ipc_flags,
|
||||
type);
|
||||
}
|
||||
|
||||
static inline unsigned int tcb_get_ipc_type(struct ktcb *task)
|
||||
{
|
||||
return ipc_flags_get_type(task->ipc_flags);
|
||||
}
|
||||
|
||||
#define THREAD_IDS_MAX 1024
|
||||
#define SPACE_IDS_MAX 1024
|
||||
|
||||
|
||||
55
include/l4/glue/arm/ipc.h
Normal file
55
include/l4/glue/arm/ipc.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef __GLUE_ARM_IPC_H__
|
||||
#define __GLUE_ARM_IPC_H__
|
||||
|
||||
#include <l4/generic/tcb.h>
|
||||
#include INC_GLUE(message.h)
|
||||
|
||||
static inline int extended_ipc_msg_index(unsigned int flags)
|
||||
{
|
||||
return (flags & IPC_FLAGS_MSG_INDEX_MASK)
|
||||
>> IPC_FLAGS_MSG_INDEX_SHIFT;
|
||||
}
|
||||
|
||||
static inline int extended_ipc_msg_size(unsigned int flags)
|
||||
{
|
||||
return (flags & IPC_FLAGS_SIZE_MASK)
|
||||
>> IPC_FLAGS_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
static inline void tcb_set_ipc_flags(struct ktcb *task,
|
||||
unsigned int flags)
|
||||
{
|
||||
task->ipc_flags = flags;
|
||||
}
|
||||
|
||||
static inline unsigned int tcb_get_ipc_flags(struct ktcb *task)
|
||||
{
|
||||
return task->ipc_flags;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
ipc_flags_set_type(unsigned int flags, unsigned int type)
|
||||
{
|
||||
flags &= ~IPC_FLAGS_TYPE_MASK;
|
||||
flags |= type & IPC_FLAGS_TYPE_MASK;
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline unsigned int ipc_flags_get_type(unsigned int flags)
|
||||
{
|
||||
return flags & IPC_FLAGS_TYPE_MASK;
|
||||
}
|
||||
|
||||
static inline void tcb_set_ipc_type(struct ktcb *task,
|
||||
unsigned int type)
|
||||
{
|
||||
task->ipc_flags = ipc_flags_set_type(task->ipc_flags,
|
||||
type);
|
||||
}
|
||||
|
||||
static inline unsigned int tcb_get_ipc_type(struct ktcb *task)
|
||||
{
|
||||
return ipc_flags_get_type(task->ipc_flags);
|
||||
}
|
||||
|
||||
#endif /* __GLUE_ARM_IPC_H__ */
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <l4/generic/kmalloc.h>
|
||||
#include INC_API(syscall.h)
|
||||
#include INC_GLUE(message.h)
|
||||
#include INC_GLUE(ipc.h)
|
||||
|
||||
/*
|
||||
* ipc syscall uses an ipc_type variable and send/recv
|
||||
@@ -63,19 +64,6 @@ int ipc_full_copy(struct ktcb *to, struct ktcb *from)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int extended_ipc_msg_index(unsigned int flags)
|
||||
{
|
||||
return (flags & IPC_FLAGS_MSG_INDEX_MASK)
|
||||
>> IPC_FLAGS_MSG_INDEX_SHIFT;
|
||||
}
|
||||
|
||||
static inline int extended_ipc_msg_size(unsigned int flags)
|
||||
{
|
||||
return (flags & IPC_FLAGS_SIZE_MASK)
|
||||
>> IPC_FLAGS_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
/*
|
||||
* Extended copy is asymmetric in that the copying always occurs from
|
||||
* the sender's kernel stack to receivers userspace buffers.
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include INC_GLUE(memlayout.h)
|
||||
#include INC_GLUE(memory.h)
|
||||
#include INC_GLUE(message.h)
|
||||
#include INC_GLUE(ipc.h)
|
||||
#include INC_SUBARCH(mm.h)
|
||||
|
||||
/* Abort debugging conditions */
|
||||
|
||||
Reference in New Issue
Block a user