minix: Prepare for message queue support to Minix kernel

This commit adds preparatory support for forthcoming message
queue implementation to the Minix kernel. The core implementation
will be added with the next commit.
This commit is contained in:
Sanchayan Maity 2016-02-29 20:43:07 +05:30
parent 06b223febe
commit 6f36b466f3
6 changed files with 42 additions and 2 deletions

View file

@ -849,6 +849,10 @@ struct
{ "VMCTL", SYS_VMCTL }, { "VMCTL", SYS_VMCTL },
{ "MEMSET", SYS_MEMSET }, { "MEMSET", SYS_MEMSET },
{ "PADCONF", SYS_PADCONF }, { "PADCONF", SYS_PADCONF },
{ "MQ_OPEN", SYS_MQ_OPEN},
{ "MQ_CLOSE", SYS_MQ_CLOSE},
{ "MQ_SEND", SYS_MQ_SEND},
{ "MQ_REC", SYS_MQ_REC},
{ NULL, 0 } { NULL, 0 }
}; };

View file

@ -262,8 +262,13 @@
# define SYS_PADCONF (KERNEL_CALL + 57) /* sys_padconf() */ # define SYS_PADCONF (KERNEL_CALL + 57) /* sys_padconf() */
# define SYS_MQ_OPEN (KERNEL_CALL + 58) /* sys_mq_open */
# define SYS_MQ_CLOSE (KERNEL_CALL + 59) /* sys_mq_close */
# define SYS_MQ_SEND (KERNEL_CALL + 60) /* sys_mq_send */
# define SYS_MQ_REC (KERNEL_CALL + 61) /* sys_mq_rec */
/* Total */ /* Total */
#define NR_SYS_CALLS 58 /* number of kernel calls */ #define NR_SYS_CALLS 62 /* number of kernel calls */
#define SYS_CALL_MASK_SIZE BITMAP_CHUNKS(NR_SYS_CALLS) #define SYS_CALL_MASK_SIZE BITMAP_CHUNKS(NR_SYS_CALLS)

View file

@ -45,6 +45,7 @@
#define USE_RUNCTL 1 /* control stop flags of a process */ #define USE_RUNCTL 1 /* control stop flags of a process */
#define USE_STATECTL 1 /* let a process control its state */ #define USE_STATECTL 1 /* let a process control its state */
#define USE_MCONTEXT 1 /* enable getting/setting of machine context */ #define USE_MCONTEXT 1 /* enable getting/setting of machine context */
#define USE_MQ_IPC 1 /* enable user space message queues IPC */
#if defined(__arm__) #if defined(__arm__)
#define USE_PADCONF 1 /* configure pinmux */ #define USE_PADCONF 1 /* configure pinmux */

View file

@ -268,6 +268,12 @@ void system_init(void)
map(SYS_SCHEDULE, do_schedule); /* reschedule a process */ map(SYS_SCHEDULE, do_schedule); /* reschedule a process */
map(SYS_SCHEDCTL, do_schedctl); /* change process scheduler */ map(SYS_SCHEDCTL, do_schedctl); /* change process scheduler */
/* User space IPC */
map(SYS_MQ_OPEN, do_mq_open); /* open a message queue */
map(SYS_MQ_CLOSE, do_mq_close); /* close a message queue */
map(SYS_MQ_SEND, do_mq_send); /* send to a message queue */
map(SYS_MQ_REC, do_mq_rec); /* receive from a message queue */
} }
/*===========================================================================* /*===========================================================================*
* get_priv * * get_priv *

View file

@ -206,5 +206,25 @@ int do_padconf(struct proc * caller, message *m_ptr);
#define do_padconf NULL #define do_padconf NULL
#endif #endif
int do_mq_open(struct proc * caller, message *m_ptr);
#if ! USE_MQ_IPC
#define do_mq_open NULL
#endif
int do_mq_close(struct proc * caller, message *m_ptr);
#if ! USE_MQ_IPC
#define do_mq_close NULL
#endif
int do_mq_send(struct proc * caller, message *m_ptr);
#if ! USE_MQ_IPC
#define do_mq_send NULL
#endif
int do_mq_rec(struct proc * caller, message *m_ptr);
#if ! USE_MQ_IPC
#define do_mq_rec NULL
#endif
#endif /* SYSTEM_H */ #endif /* SYSTEM_H */

View file

@ -37,7 +37,11 @@ SRCS+= \
do_mcontext.c \ do_mcontext.c \
do_schedule.c \ do_schedule.c \
do_schedctl.c \ do_schedctl.c \
do_statectl.c do_statectl.c \
do_mq_open.c \
do_mq_close.c \
do_mq_send.c \
do_mq_rec.c
.if ${MACHINE_ARCH} == "i386" .if ${MACHINE_ARCH} == "i386"
SRCS+= \ SRCS+= \