From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HCYFg-0000cs-3o for qemu-devel@nongnu.org; Thu, 01 Feb 2007 04:29:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HCYFf-0000cE-61 for qemu-devel@nongnu.org; Thu, 01 Feb 2007 04:29:07 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HCYFe-0000c2-TQ for qemu-devel@nongnu.org; Thu, 01 Feb 2007 04:29:06 -0500 Received: from partizan.velesys.com ([213.184.230.195] helo=localhost.localdomain) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HCYFe-0008TK-4q for qemu-devel@nongnu.org; Thu, 01 Feb 2007 04:29:06 -0500 Date: Thu, 1 Feb 2007 11:27:15 +0300 From: "Kirill A. Shutemov" Subject: Re: [Qemu-devel] sem* and msg* for qemu Message-ID: <20070201082715.GB9362@localhost.localdomain> References: <20070131213430.GA31682@localhost.localdomain> <41e41e7a0701311853o72346ca8p6a6d8e6ea7cc61a0@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NtwzykIc2mflq5ck" Content-Disposition: inline In-Reply-To: <41e41e7a0701311853o72346ca8p6a6d8e6ea7cc61a0@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --NtwzykIc2mflq5ck Content-Type: multipart/mixed; boundary="tqI+Z3u+9OQ7kwn0" Content-Disposition: inline --tqI+Z3u+9OQ7kwn0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On [Thu, 01.02.2007 04:53], Hetz Ben Hamo wrote: > attached? where? Oh... Sorry. Attached now. --tqI+Z3u+9OQ7kwn0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu-0.8.2-alt-sem.patch" Content-Transfer-Encoding: quoted-printable --- qemu-0.8.2.orig/linux-user/syscall.c 2007-01-31 23:06:58 +0300 +++ qemu-0.8.2/linux-user/syscall.c 2007-01-31 23:22:12 +0300 @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -1188,6 +1189,12 @@ uint32_t size; } shm_regions[N_SHM_REGIONS]; =20 +union semun { + int val; + struct senid_ds *buf; + unsigned short *array; +}; + /* ??? This only works with linear mappings. */ static long do_ipc(long call, long first, long second, long third, long ptr, long fifth) @@ -1202,6 +1209,23 @@ call &=3D 0xffff; =20 switch (call) { + case IPCOP_semop: + ret =3D get_errno(semop(first,(struct sembuf *) ptr, second)); + break; + + case IPCOP_semget: + ret =3D get_errno(semget(first, second, third)); + break; + + case IPCOP_semctl: + ret =3D get_errno(semctl(first, second, third, ((union semun*)ptr)= ->val)); + + break; + + case IPCOP_semtimedop: + gemu_log("Unsupported ipc call: %ld (version %d)\n", call, version= ); + ret =3D -ENOSYS; + break; case IPCOP_shmat: /* SHM_* flags are the same on all linux platforms */ ret =3D get_errno((long) shmat(first, (void *) ptr, second)); --tqI+Z3u+9OQ7kwn0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu-0.8.2-alt-msg.patch" --- qemu.orig/linux-user/syscall.c.orig 2007-02-01 00:15:37 +0300 +++ qemu/linux-user/syscall.c 2007-02-01 00:03:56 +0300 @@ -1226,6 +1226,35 @@ gemu_log("Unsupported ipc call: %ld (version %d)\n", call, version); ret = -ENOSYS; break; + + case IPCOP_msgget: + ret = get_errno(msgget(first, second)); + break; + + case IPCOP_msgsnd: + ret = get_errno(msgsnd(first, (struct msgbuf *) ptr, second, third)); + break; + + case IPCOP_msgctl: + ret = get_errno(msgctl(first, second, (struct msqid_ds *) ptr)); + break; + + case IPCOP_msgrcv: + { + struct ipc_kludge + { + void *__unbounded msgp; + long int msgtyp; + }; + + struct ipc_kludge *foo = (struct ipc_kludge *) ptr; + struct msgbuf *msgp = (struct msgbuf *) foo->msgp; + + ret = get_errno(msgrcv(first, msgp, second, 0, third)); + + } + break; + case IPCOP_shmat: /* SHM_* flags are the same on all linux platforms */ ret = get_errno((long) shmat(first, (void *) ptr, second)); --tqI+Z3u+9OQ7kwn0-- --NtwzykIc2mflq5ck Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFFwaRjbWYnhzC5v6oRAnubAJ90dod7VAxptk7wP6vE7AnfPNin9gCghSc/ 28TRoWGTGpWguxCg9f9t4zM= =G1/4 -----END PGP SIGNATURE----- --NtwzykIc2mflq5ck--