Skip to contentSkip to conversation

linux-user semaphore structure mapping

PATCH In review Stuart Anderson 2 participants 4 messages May 30, 2007 – Jun 2, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user semaphore structure mapping

This is a refresh (vs 5/28 cvs) of a patch sent several weeks ago. This patch implments the structure handling for the semaphore IPC related structures used by semctl().

This was tested using LTP on an ARM target.

Were there any objections to this patch?

Stuart

Stuart R. Anderson                               [email protected]
Network & Software Engineering                   http://www.netsweng.com/
1024D/37A79149:                                  0791 D3B8 9A4C 2CDC A31F
                                                 BD03 0A62 E534 37A7 9149
linux-user/i386/syscall.h +0 -76
Index: qemu/linux-user/i386/syscall.h
===================================================================
@@ -142,80 +142,4 @@
 	struct target_vm86plus_info_struct vm86plus;
 };
 
-/* ipcs */
-
-#define TARGET_SEMOP           1
-#define TARGET_SEMGET          2
-#define TARGET_SEMCTL          3 
-#define TARGET_MSGSND          11 
-#define TARGET_MSGRCV          12
-#define TARGET_MSGGET          13
-#define TARGET_MSGCTL          14
-#define TARGET_SHMAT           21
-#define TARGET_SHMDT           22
-#define TARGET_SHMGET          23
-#define TARGET_SHMCTL          24
-
-struct target_msgbuf {
-	int mtype;
-	char mtext[1];
-};
-
-struct target_ipc_kludge {
-	unsigned int	msgp;	/* Really (struct msgbuf *) */
-	int msgtyp;
-};	
-
-struct target_ipc_perm {
-	int	key;
-	unsigned short	uid;
-	unsigned short	gid;
-	unsigned short	cuid;
-	unsigned short	cgid;
-	unsigned short	mode;
-	unsigned short	seq;
-};
-
-struct target_msqid_ds {
-	struct target_ipc_perm	msg_perm;
-	unsigned int		msg_first;	/* really struct target_msg* */
-	unsigned int		msg_last;	/* really struct target_msg* */
-	unsigned int		msg_stime;	/* really target_time_t */
-	unsigned int		msg_rtime;	/* really target_time_t */
-	unsigned int		msg_ctime;	/* really target_time_t */
-	unsigned int		wwait;		/* really struct wait_queue* */
-	unsigned int		rwait;		/* really struct wait_queue* */
-	unsigned short		msg_cbytes;
-	unsigned short		msg_qnum;
-	unsigned short		msg_qbytes;
-	unsigned short		msg_lspid;
-	unsigned short		msg_lrpid;
-};
-
-struct target_shmid_ds {
-	struct target_ipc_perm	shm_perm;
-	int			shm_segsz;
-	unsigned int		shm_atime;	/* really target_time_t */
-	unsigned int		shm_dtime;	/* really target_time_t */
-	unsigned int		shm_ctime;	/* really target_time_t */
-	unsigned short		shm_cpid;
-	unsigned short		shm_lpid;
-	short			shm_nattch;
-	unsigned short		shm_npages;
-	unsigned long		*shm_pages;
-	void 			*attaches;	/* really struct shm_desc * */
-};
-
-#define TARGET_IPC_RMID	0
-#define TARGET_IPC_SET	1
-#define TARGET_IPC_STAT	2
-
-union target_semun {
-    int val;
-    unsigned int buf;	/* really struct semid_ds * */
-    unsigned int array; /* really unsigned short * */
-    unsigned int __buf;	/* really struct seminfo * */
-    unsigned int __pad;	/* really void* */
-};
-
 #define UNAME_MACHINE "i686"
linux-user/ppc/syscall.h +0 -76

80 lines not on this page · raw message

linux-user/syscall.c +195 -3

215 lines not on this page · raw message

#1 lore raw
Quoted 8 lines · Stuart Anderson

This is a refresh (vs 5/28 cvs) of a patch sent several weeks ago. This patch implments the structure handling for the semaphore IPC related structures used by semctl().

This was tested using LTP on an ARM target.

Were there any objections to this patch?

It produces too many compiler warnings to be comfortable with, and breaks compilation of alpha-linux-user.

Thiemo

#2 lore raw
Quoted 6 lines · Thiemo Seufer
Quoted 5 lines · Stuart Anderson

This is a refresh (vs 5/28 cvs) of a patch sent several weeks ago. This patch implments the structure handling for the semaphore IPC related structures used by semctl().

Quoted 6 lines
Quoted 3 lines

This was tested using LTP on an ARM target.

Were there any objections to this patch?

It produces too many compiler warnings to be comfortable with, and breaks compilation of alpha-linux-user.

I think alpha was actually added after I first created this patch, and I haven't been building it as it's not one of the archs I normally use. Note to self to do a build w/ everything turned on more often. The fix for it is to remove the same stuff as is done for a couple of the other archs.

I'll clean it up, and take another look at the warning for this and the message queue patch, and resubmit.

Stuart

Stuart R. Anderson                               [email protected]
Network & Software Engineering                   http://www.netsweng.com/
1024D/37A79149:                                  0791 D3B8 9A4C 2CDC A31F
                                                 BD03 0A62 E534 37A7 9149
#3 lore raw
In reply to Thiemo Seufer
Quoted 8 lines · Thiemo Seufer
Quoted 5 lines · Stuart Anderson

This is a refresh (vs 5/28 cvs) of a patch sent several weeks ago. This patch implments the structure handling for the semaphore IPC related structures used by semctl().

It produces too many compiler warnings to be comfortable with, and breaks compilation of alpha-linux-user.

Thiemo,
I've attached both the semaphore and message queue patches to
this message since there is a dependency between them (message queue patch must be applied on top of the semaphore patch).

This is updated to 6/01 cvs, and includes the additional part to
fix alpha the same as is done for the other archs. It also cleans up the warnings in the new code areas.

Stuart

Stuart R. Anderson                               [email protected]
Network & Software Engineering                   http://www.netsweng.com/
1024D/37A79149:                                  0791 D3B8 9A4C 2CDC A31F
                                                 BD03 0A62 E534 37A7 9149
linux-user/i386/syscall.h +0 -76
Index: qemu/linux-user/i386/syscall.h
===================================================================
@@ -142,80 +142,4 @@
 	struct target_vm86plus_info_struct vm86plus;
 };
 
-/* ipcs */
-
-#define TARGET_SEMOP           1
-#define TARGET_SEMGET          2
-#define TARGET_SEMCTL          3 
-#define TARGET_MSGSND          11 
-#define TARGET_MSGRCV          12
-#define TARGET_MSGGET          13
-#define TARGET_MSGCTL          14
-#define TARGET_SHMAT           21
-#define TARGET_SHMDT           22
-#define TARGET_SHMGET          23
-#define TARGET_SHMCTL          24
-
-struct target_msgbuf {
-	int mtype;
-	char mtext[1];
-};
-
-struct target_ipc_kludge {
-	unsigned int	msgp;	/* Really (struct msgbuf *) */
-	int msgtyp;
-};	
-
-struct target_ipc_perm {
-	int	key;
-	unsigned short	uid;
-	unsigned short	gid;
-	unsigned short	cuid;
-	unsigned short	cgid;
-	unsigned short	mode;
-	unsigned short	seq;
-};
-
-struct target_msqid_ds {
-	struct target_ipc_perm	msg_perm;
-	unsigned int		msg_first;	/* really struct target_msg* */
-	unsigned int		msg_last;	/* really struct target_msg* */
-	unsigned int		msg_stime;	/* really target_time_t */
-	unsigned int		msg_rtime;	/* really target_time_t */
-	unsigned int		msg_ctime;	/* really target_time_t */
-	unsigned int		wwait;		/* really struct wait_queue* */
-	unsigned int		rwait;		/* really struct wait_queue* */
-	unsigned short		msg_cbytes;
-	unsigned short		msg_qnum;
-	unsigned short		msg_qbytes;
-	unsigned short		msg_lspid;
-	unsigned short		msg_lrpid;
-};
-
-struct target_shmid_ds {
-	struct target_ipc_perm	shm_perm;
-	int			shm_segsz;
-	unsigned int		shm_atime;	/* really target_time_t */
-	unsigned int		shm_dtime;	/* really target_time_t */
-	unsigned int		shm_ctime;	/* really target_time_t */
-	unsigned short		shm_cpid;
-	unsigned short		shm_lpid;
-	short			shm_nattch;
-	unsigned short		shm_npages;
-	unsigned long		*shm_pages;
-	void 			*attaches;	/* really struct shm_desc * */
-};
-
-#define TARGET_IPC_RMID	0
-#define TARGET_IPC_SET	1
-#define TARGET_IPC_STAT	2
-
-union target_semun {
-    int val;
-    unsigned int buf;	/* really struct semid_ds * */
-    unsigned int array; /* really unsigned short * */
-    unsigned int __buf;	/* really struct seminfo * */
-    unsigned int __pad;	/* really void* */
-};
-
 #define UNAME_MACHINE "i686"
linux-user/ppc/syscall.h +0 -76

80 lines not on this page · raw message

linux-user/syscall.c +203 -3

223 lines not on this page · raw message

linux-user/alpha/syscall.h +0 -74

78 lines not on this page · raw message

linux-user/syscall.c +123 -12

156 lines not on this page · raw message