From owner-svn-src-all@freebsd.org Wed Nov 7 16:55:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EACC1112A383; Wed, 7 Nov 2018 16:55:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65284707BD; Wed, 7 Nov 2018 16:55:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A36D1857F; Wed, 7 Nov 2018 16:55:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA7Gt5Z6097186; Wed, 7 Nov 2018 16:55:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA7Gt4hU097183; Wed, 7 Nov 2018 16:55:04 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811071655.wA7Gt4hU097183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 7 Nov 2018 16:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340221 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 340221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65284707BD X-Spamd-Result: default: False [-106.84 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.73)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.91), asn: 11403(-3.75), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 16:55:06 -0000 Author: brooks Date: Wed Nov 7 16:55:04 2018 New Revision: 340221 URL: https://svnweb.freebsd.org/changeset/base/340221 Log: makesyscalls.sh: allow pointer return types. The previous code required that the return type be a single word. This allows it to be a pointer without using a typedef. Update the return types of break, mmap, and shmat to be void * as declared. This only effects systrace output in-tree, but can aid in generating system call wrappers from syscalls.master. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17873 Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/makesyscalls.sh head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Nov 7 16:28:09 2018 (r340220) +++ head/sys/compat/freebsd32/syscalls.master Wed Nov 7 16:55:04 2018 (r340221) @@ -88,7 +88,7 @@ int mode, int dev); } 15 AUE_CHMOD NOPROTO { int chmod(const char *path, mode_t mode); } 16 AUE_CHOWN NOPROTO { int chown(const char *path, int uid, int gid); } -17 AUE_NULL NOPROTO { caddr_t break(char *nsize); } +17 AUE_NULL NOPROTO { void *break(char *nsize); } 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ struct statfs32 *buf, long bufsize, \ int mode); } @@ -175,7 +175,7 @@ 68 AUE_NULL OBSOL vwrite 69 AUE_SBRK NOPROTO { int sbrk(int incr); } 70 AUE_SSTK NOPROTO { int sstk(int incr); } -71 AUE_MMAP COMPAT|NOPROTO { int mmap(void *addr, int len, \ +71 AUE_MMAP COMPAT|NOPROTO { void *mmap(void *addr, int len, \ int prot, int flags, int fd, int pos); } 72 AUE_O_VADVISE COMPAT11|NOPROTO { int vadvise(int anom); } 73 AUE_MUNMAP NOPROTO { int munmap(void *addr, size_t len); } @@ -373,7 +373,7 @@ __setrlimit_args int 196 AUE_GETDIRENTRIES COMPAT11 { int freebsd32_getdirentries(int fd, \ char *buf, u_int count, int32_t *basep); } -197 AUE_MMAP COMPAT6 { caddr_t freebsd32_mmap(void *addr, \ +197 AUE_MMAP COMPAT6 { void *freebsd32_mmap(void *addr, \ size_t len, int prot, int flags, int fd, \ int pad, uint32_t pos1, uint32_t pos2); } 198 AUE_NULL NOPROTO { int nosys(void); } __syscall \ @@ -432,7 +432,7 @@ size_t msgsz, int msgflg); } 227 AUE_MSGRCV NOSTD { int freebsd32_msgrcv(int msqid, void *msgp, \ size_t msgsz, long msgtyp, int msgflg); } -228 AUE_SHMAT NOSTD|NOPROTO { int shmat(int shmid, void *shmaddr, \ +228 AUE_SHMAT NOSTD|NOPROTO { void *shmat(int shmid, void *shmaddr, \ int shmflg); } 229 AUE_SHMCTL COMPAT7|NOSTD { int freebsd32_shmctl( \ int shmid, int cmd, \ @@ -876,7 +876,7 @@ const void *buf, size_t nbyte, \ int pad, \ uint32_t offset1, uint32_t offset2); } -477 AUE_MMAP STD { caddr_t freebsd32_mmap(void *addr, \ +477 AUE_MMAP STD { void *freebsd32_mmap(void *addr, \ size_t len, int prot, int flags, int fd, \ int pad, \ uint32_t pos1, uint32_t pos2); } @@ -897,7 +897,7 @@ 476 AUE_PWRITE STD { ssize_t freebsd32_pwrite(int fd, \ const void *buf, size_t nbyte, \ uint32_t offset1, uint32_t offset2); } -477 AUE_MMAP STD { caddr_t freebsd32_mmap(void *addr, \ +477 AUE_MMAP STD { void *freebsd32_mmap(void *addr, \ size_t len, int prot, int flags, int fd, \ uint32_t pos1, uint32_t pos2); } 478 AUE_LSEEK STD { off_t freebsd32_lseek(int fd, \ Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Wed Nov 7 16:28:09 2018 (r340220) +++ head/sys/kern/makesyscalls.sh Wed Nov 7 16:55:04 2018 (r340221) @@ -325,6 +325,7 @@ sed -e ' } function parseline() { f=4 # toss number, type, audit event + ret_inc = 0 argc= 0; argssize = "0" thr_flag = "SY_THR_STATIC" @@ -340,12 +341,15 @@ sed -e ' funcalias="" argalias="" rettype="int" + if ($(f+2) == "*") { + ret_inc = 1 + } end=NF } if (flag("NODEF")) { auditev="AUE_NULL" - funcname=$4 - argssize = "AS(" $6 ")" + funcname=$(4 + ret_inc) + argssize = "AS(" $(6 + ret_inc) ")" return } if ($f != "{") @@ -363,6 +367,11 @@ sed -e ' syscallret=$f f++ + while (ret_inc > 0) { + syscallret=syscallret " " $f + f++ + ret_inc-- + } funcname=$f Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Nov 7 16:28:09 2018 (r340220) +++ head/sys/kern/syscalls.master Wed Nov 7 16:55:04 2018 (r340221) @@ -180,7 +180,7 @@ ); } 17 AUE_NULL STD { - caddr_t break( + void *break( _In_ char *nsize ); } @@ -480,7 +480,7 @@ ); } 71 AUE_MMAP COMPAT { - int mmap( + void *mmap( _In_ void *addr, int len, int prot, @@ -1168,7 +1168,7 @@ ); } 197 AUE_MMAP COMPAT6 { - caddr_t mmap( + void *mmap( _In_ void *addr, size_t len, int prot, @@ -1317,7 +1317,7 @@ ); } 228 AUE_SHMAT NOSTD { - int shmat( + void *shmat( int shmid, _In_ const void *shmaddr, int shmflg @@ -2543,7 +2543,7 @@ ); } 477 AUE_MMAP STD { - caddr_t mmap( + void *mmap( _In_ void *addr, size_t len, int prot,