diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c index b984c38c05..ace24a84b2 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss.c +++ b/arch/arm/src/cxd56xx/cxd56_gnss.c @@ -2154,13 +2154,10 @@ static void cxd56_gnss_common_signalhandler(uint32_t data, struct cxd56_gnss_sig_s *sig = &priv->sigs[i]; if (sig->enable && sig->info.gnsssig == sigtype) { -#ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; + value.sival_ptr = &sig->info; sigqueue(sig->pid, sig->info.signo, value); -#else - sigqueue(sig->pid, sig->info.signo, &sig->info); -#endif issetmask = 1; } } diff --git a/arch/arm/src/cxd56xx/cxd56_icc.c b/arch/arm/src/cxd56xx/cxd56_icc.c index 74c7b37649..aa6be14a5c 100644 --- a/arch/arm/src/cxd56xx/cxd56_icc.c +++ b/arch/arm/src/cxd56xx/cxd56_icc.c @@ -251,13 +251,10 @@ static int icc_irqhandler(int cpuid, uint32_t word[2]) #ifndef CONFIG_DISABLE_SIGNAL if (priv->pid != INVALID_PROCESS_ID) { -# ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; + value.sival_ptr = priv->sigdata; sigqueue(priv->pid, priv->signo, value); -# else - sigqueue(priv->pid, priv->signo, priv->sigdata); -# endif } #endif diff --git a/arch/arm/src/cxd56xx/cxd56_scu.c b/arch/arm/src/cxd56xx/cxd56_scu.c index cb927fbd92..67fe21849f 100644 --- a/arch/arm/src/cxd56xx/cxd56_scu.c +++ b/arch/arm/src/cxd56xx/cxd56_scu.c @@ -1490,9 +1490,7 @@ static void seq_handlefifointr(FAR struct cxd56_scudev_s *priv, int i; #ifndef CONFIG_DISABLE_SIGNAL struct wm_notify_s *notify; -# ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; -# endif #endif if ((intr & 0x007ffe00) == 0) @@ -1520,12 +1518,8 @@ static void seq_handlefifointr(FAR struct cxd56_scudev_s *priv, DEBUGASSERT(notify->pid != 0); -# ifdef CONFIG_CAN_PASS_STRUCTS value.sival_ptr = notify->ts; sigqueue(notify->pid, notify->signo, value); -# else - sigqueue(notify->pid, notify->signo, (FAR void *)notify->ts); -# endif #endif } } @@ -1611,15 +1605,12 @@ static void seq_handlemathfintr(FAR struct cxd56_scudev_s *priv, #ifndef CONFIG_DISABLE_SIGNAL if (detected) { + union sigval value; + DEBUGASSERT(notify->pid != 0); -# ifdef CONFIG_CAN_PASS_STRUCTS - union sigval value; value.sival_ptr = notify->arg; sigqueue(notify->pid, notify->signo, value); -# else - sigqueue(notify->pid, notify->signo, (FAR void *)notify->arg); -# endif detected = 0; } #endif diff --git a/arch/arm/src/cxd56xx/cxd56_usbdev.c b/arch/arm/src/cxd56xx/cxd56_usbdev.c index 120dcd5f1b..ba282d1b8b 100644 --- a/arch/arm/src/cxd56xx/cxd56_usbdev.c +++ b/arch/arm/src/cxd56xx/cxd56_usbdev.c @@ -3392,13 +3392,9 @@ static void cxd56_notify_signal(uint16_t state, uint16_t power) if (priv->signo > 0) { -#ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; value.sival_int = state << 16 | power; sigqueue(priv->pid, priv->signo, value); -#else - sigqueue(priv->pid, priv->signo, state << 16 | power); -#endif } } diff --git a/binfmt/libnxflat/libnxflat_bind.c b/binfmt/libnxflat/libnxflat_bind.c index 1ac9f4d9b0..4267264f43 100644 --- a/binfmt/libnxflat/libnxflat_bind.c +++ b/binfmt/libnxflat/libnxflat_bind.c @@ -1,35 +1,20 @@ /**************************************************************************** * binfmt/libnxflat/libnxflat_bind.c * - * Copyright (C) 2009, 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -277,14 +262,9 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) { /* Handle the relocation by the relocation type */ -#ifdef CONFIG_CAN_PASS_STRUCTS - reloc = *relocs++; -#else - memcpy(&reloc, relocs, sizeof(struct nxflat_reloc_s)); - relocs++; -#endif - + reloc = *relocs++; result = OK; + switch (NXFLAT_RELOC_TYPE(reloc.r_info)) { /* NXFLAT_RELOC_TYPE_REL32I Meaning: Object file contains a 32-bit diff --git a/fs/aio/aio_signal.c b/fs/aio/aio_signal.c index 85e058a6a5..f0ba64a8c6 100644 --- a/fs/aio/aio_signal.c +++ b/fs/aio/aio_signal.c @@ -1,35 +1,20 @@ /**************************************************************************** * fs/aio/aio_signal.c * - * Copyright (C) 2014-2015, 2018 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -79,9 +64,7 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp) { -#ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; -#endif int status; int ret; @@ -102,12 +85,8 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp) * on sig_suspend(); */ -#ifdef CONFIG_CAN_PASS_STRUCTS value.sival_ptr = aiocbp; status = nxsig_queue(pid, SIGPOLL, value); -#else - status = nxsig_queue(pid, SIGPOLL, aiocbp); -#endif if (status < 0) { ferr("ERROR: nxsig_queue #2 failed: %d\n", status); diff --git a/fs/procfs/fs_procfsmeminfo.c b/fs/procfs/fs_procfsmeminfo.c index 2a9d4bbe69..d1f0decfc2 100644 --- a/fs/procfs/fs_procfsmeminfo.c +++ b/fs/procfs/fs_procfsmeminfo.c @@ -1,35 +1,20 @@ /**************************************************************************** * fs/procfs/fs_procfsmeminfo.c * - * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -312,12 +297,7 @@ static ssize_t meminfo_read(FAR struct file *filep, FAR char *buffer, /* Show kernel heap information */ -#ifdef CONFIG_CAN_PASS_STRUCTS mem = kmm_mallinfo(); -#else - kmm_mallinfo(&mem); -#endif - linesize = snprintf(procfile->line, MEMINFO_LINELEN, "Kmem: %11lu%11lu%11lu%11lu\n", (unsigned long)mem.arena, @@ -338,12 +318,7 @@ static ssize_t meminfo_read(FAR struct file *filep, FAR char *buffer, /* Show user heap information */ -#ifdef CONFIG_CAN_PASS_STRUCTS mem = kumm_mallinfo(); -#else - kumm_mallinfo(&mem); -#endif - linesize = snprintf(procfile->line, MEMINFO_LINELEN, "Umem: %11lu%11lu%11lu%11lu\n", (unsigned long)mem.arena, diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 26b9e31bf9..afb9d064a4 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -1,35 +1,20 @@ /**************************************************************************** * include/arpa/inet.h * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -112,20 +97,10 @@ int inet_aton(FAR const char *cp, FAR struct in_addr *inp); in_addr_t inet_addr(FAR const char *cp); in_addr_t inet_network(FAR const char *cp); -#ifdef CONFIG_CAN_PASS_STRUCTS FAR char *inet_ntoa(struct in_addr in); in_addr_t inet_lnaof(struct in_addr in); in_addr_t inet_netof(struct in_addr in); -#else -FAR char *_inet_ntoa(in_addr_t in); -# define inet_ntoa(in) _inet_ntoa(in.s_addr) -in_addr_t _inet_lnaof(in_addr_t in); -# define inet_lnaof(in) _inet_lnaof(in.s_addr) - -in_addr_t _inet_netof(in_addr_t in); -# define inet_netof(in) _inet_netof(in.s_addr) -#endif struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host); int inet_pton(int af, FAR const char *src, FAR void *dst); diff --git a/include/cxx/cstdlib b/include/cxx/cstdlib index 714319e415..cf12ddffa3 100644 --- a/include/cxx/cstdlib +++ b/include/cxx/cstdlib @@ -1,35 +1,20 @@ //*************************************************************************** // include/cxx/cstdlib // -// Copyright (C) 2009, 2012, 2015-2017 Gregory Nutt. All rights reserved. -// Author: Gregory Nutt +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. The +// ASF licenses this file to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance with the +// License. You may obtain a copy of the License at // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: +// http://www.apache.org/licenses/LICENSE-2.0 // -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in -// the documentation and/or other materials provided with the -// distribution. -// 3. Neither the name NuttX nor the names of its contributors may be -// used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. // //*************************************************************************** @@ -138,12 +123,10 @@ namespace std using ::llabs; #endif -#ifdef CONFIG_CAN_PASS_STRUCTS using ::div; using ::ldiv; #ifdef CONFIG_HAVE_LONG_LONG using ::lldiv; -#endif #endif // Temporary files diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index b027ae68fd..aef87bb58a 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -1,36 +1,20 @@ /**************************************************************************** * include/nuttx/compiler.h * - * Copyright (C) 2007-2009, 2012-2013, 2015-2017 Gregory Nutt. All rights - * reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -299,10 +283,6 @@ # define CONFIG_HAVE_DOUBLE 1 # define CONFIG_HAVE_LONG_DOUBLE 1 -/* Structures and unions can be assigned and passed as values */ - -# define CONFIG_CAN_PASS_STRUCTS 1 - /* Indicate that a local variable is not used */ # define UNUSED(a) ((void)(a)) @@ -445,12 +425,6 @@ # undef CONFIG_HAVE_DOUBLE # undef CONFIG_HAVE_LONG_DOUBLE -/* Structures and unions cannot be passed as values or used - * in assignments. - */ - -# undef CONFIG_CAN_PASS_STRUCTS - /* Indicate that a local variable is not used */ # define UNUSED(a) ((void)(a)) @@ -580,10 +554,6 @@ # undef CONFIG_HAVE_DOUBLE # undef CONFIG_HAVE_LONG_DOUBLE -/* Structures and unions can be assigned and passed as values */ - -# define CONFIG_CAN_PASS_STRUCTS 1 - /* Indicate that a local variable is not used */ # define UNUSED(a) ((void)(a)) @@ -677,7 +647,6 @@ # define CONFIG_HAVE_FLOAT 1 # undef CONFIG_HAVE_DOUBLE # undef CONFIG_HAVE_LONG_DOUBLE -# undef CONFIG_CAN_PASS_STRUCTS # undef CONFIG_HAVE_ANONYMOUS_STRUCT # undef CONFIG_HAVE_ANONYMOUS_UNION diff --git a/include/nuttx/kmalloc.h b/include/nuttx/kmalloc.h index a1d5170e35..6ea4d8e532 100644 --- a/include/nuttx/kmalloc.h +++ b/include/nuttx/kmalloc.h @@ -1,36 +1,20 @@ /**************************************************************************** * include/nuttx/kmalloc.h * - * Copyright (C) 2007-2008, 2011, 2013, 2016, 2018 Gregory Nutt. All - * rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -96,11 +80,7 @@ extern "C" #define kumm_realloc(p,s) realloc(p,s) #define kumm_memalign(a,s) memalign(a,s) #define kumm_free(p) free(p) -#ifdef CONFIG_CAN_PASS_STRUCTS -# define kumm_mallinfo() mallinfo() -#else -# define kumm_mallinfo(i) mallinfo(i) -#endif +#define kumm_mallinfo() mallinfo() /* This family of allocators is used to manage kernel protected memory */ @@ -120,11 +100,7 @@ extern "C" # define kmm_realloc(p,s) realloc(p,s) # define kmm_memalign(a,s) memalign(a,s) # define kmm_free(p) free(p) -#ifdef CONFIG_CAN_PASS_STRUCTS # define kmm_mallinfo() mallinfo() -#else -# define kmm_mallinfo(i) mallinfo(i) -#endif #elif !defined(CONFIG_MM_KERNEL_HEAP) /* If this the kernel phase of a kernel build, and there are only user-space @@ -143,11 +119,7 @@ extern "C" # define kmm_realloc(p,s) realloc(p,s) # define kmm_memalign(a,s) memalign(a,s) # define kmm_free(p) free(p) -#ifdef CONFIG_CAN_PASS_STRUCTS # define kmm_mallinfo() mallinfo() -#else -# define kmm_mallinfo(i) mallinfo(i) -#endif #else /* Otherwise, the kernel-space allocators are declared in diff --git a/include/nuttx/mm/mm.h b/include/nuttx/mm/mm.h index d32a3464b8..4536200ec8 100644 --- a/include/nuttx/mm/mm.h +++ b/include/nuttx/mm/mm.h @@ -1,36 +1,20 @@ /**************************************************************************** * include/nuttx/mm/mm.h * - * Copyright (C) 2007-2009, 2013-2014, 2017 Gregory Nutt. - * All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -513,12 +497,8 @@ int mm_mallinfo(FAR struct mm_heap_s *heap, FAR struct mallinfo *info); /* Functions contained in kmm_mallinfo.c ************************************/ #ifdef CONFIG_MM_KERNEL_HEAP -#ifdef CONFIG_CAN_PASS_STRUCTS struct mallinfo kmm_mallinfo(void); -#else -int kmm_mallinfo(struct mallinfo *info); -#endif /* CONFIG_CAN_PASS_STRUCTS */ -#endif /* CONFIG_MM_KERNEL_HEAP */ +#endif /* Functions contained in mm_shrinkchunk.c **********************************/ diff --git a/include/nuttx/signal.h b/include/nuttx/signal.h index e9f0983f71..85f119bab0 100644 --- a/include/nuttx/signal.h +++ b/include/nuttx/signal.h @@ -1,35 +1,20 @@ /**************************************************************************** * include/nuttx/signal.h * - * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -230,11 +215,7 @@ int nxsig_action(int signo, FAR const struct sigaction *act, * ****************************************************************************/ -#ifdef CONFIG_CAN_PASS_STRUCTS int nxsig_queue(int pid, int signo, union sigval value); -#else -int nxsig_queue(int pid, int signo, void *sival_ptr); -#endif /**************************************************************************** * Name: nxsig_kill diff --git a/include/signal.h b/include/signal.h index 8921cc6acf..95f95a31a3 100644 --- a/include/signal.h +++ b/include/signal.h @@ -1,35 +1,20 @@ /******************************************************************************** * include/signal.h * - * Copyright (C) 2007-2009, 2011, 2013-2018 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ********************************************************************************/ @@ -305,11 +290,7 @@ union sigval * available on a queue */ -#ifdef CONFIG_CAN_PASS_STRUCTS typedef CODE void (*sigev_notify_function_t)(union sigval value); -#else -typedef CODE void (*sigev_notify_function_t)(FAR void *sival_ptr); -#endif struct sigevent { @@ -400,11 +381,7 @@ _sa_handler_t signal(int signo, _sa_handler_t func); int sigpause(int signo); int sigpending(FAR sigset_t *set); int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); -#ifdef CONFIG_CAN_PASS_STRUCTS int sigqueue(int pid, int signo, union sigval value); -#else -int sigqueue(int pid, int signo, FAR void *sival_ptr); -#endif int sigrelse(int signo); _sa_handler_t sigset(int signo, _sa_handler_t func); int sigwait(FAR const sigset_t *set, FAR int *sig); diff --git a/include/stdlib.h b/include/stdlib.h index 60e7e7be44..16912dfc59 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,35 +1,20 @@ /**************************************************************************** * include/stdlib.h * - * Copyright (C) 2007-2016, 2018 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -231,11 +216,7 @@ FAR void *memalign(size_t, size_t); FAR void *zalloc(size_t); FAR void *calloc(size_t, size_t); -#ifdef CONFIG_CAN_PASS_STRUCTS struct mallinfo mallinfo(void); -#else -int mallinfo(FAR struct mallinfo *info); -#endif /* Pseudo-Terminals */ @@ -260,13 +241,11 @@ long int labs(long int j); long long int llabs(long long int j); #endif -#ifdef CONFIG_CAN_PASS_STRUCTS div_t div(int number, int denom); ldiv_t ldiv(long number, long denom); #ifdef CONFIG_HAVE_LONG_LONG lldiv_t lldiv(long long number, long long denom); #endif -#endif /* Temporary files */ diff --git a/libs/libc/libc.csv b/libs/libc/libc.csv index ee6c542ad9..a979851ac6 100644 --- a/libs/libc/libc.csv +++ b/libs/libc/libc.csv @@ -1,4 +1,3 @@ -"_inet_ntoa","arpa/inet.h","defined(CONFIG_NET_IPv4) && !defined(CONFIG_CAN_PASS_STRUCTS)","FAR char","in_addr_t" "abort","stdlib.h","","void" "abs","stdlib.h","","int","int" "aio_error","aio.h","defined(CONFIG_FS_AIO)","int","FAR struct aiocb *" @@ -62,7 +61,7 @@ "htons","arpa/inet.h","","uint16_t","uint16_t" "imaxabs","inttypes.h","","intmax_t","intmax_t" "inet_addr","arpa/inet.h","","in_addr_t","FAR const char " -"inet_ntoa","arpa/inet.h","defined(CONFIG_NET_IPv4) && defined(CONFIG_CAN_PASS_STRUCTS)","FAR char","struct in_addr" +"inet_ntoa","arpa/inet.h","defined(CONFIG_NET_IPv4)","FAR char","struct in_addr" "inet_ntop","arpa/inet.h","","FAR const char","int","FAR const void *","FAR char *","socklen_t" "inet_pton","arpa/inet.h","","int","int","FAR const char *","FAR void *" "ioctl","sys/ioctl.h","defined(CONFIG_LIBC_IOCTL_VARIADIC)","int","int","int","..." diff --git a/libs/libc/net/lib_inetntoa.c b/libs/libc/net/lib_inetntoa.c index 62b1416cfd..e4078eb63d 100644 --- a/libs/libc/net/lib_inetntoa.c +++ b/libs/libc/net/lib_inetntoa.c @@ -1,35 +1,20 @@ /**************************************************************************** * libs/libc/net/lib_inetntoa.c * - * Copyright (C) 2007-2008, 2011-2012, 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -61,7 +46,6 @@ * ****************************************************************************/ -#ifdef CONFIG_CAN_PASS_STRUCTS FAR char *inet_ntoa(struct in_addr in) { static char buffer[INET_ADDRSTRLEN + 2]; @@ -70,14 +54,5 @@ FAR char *inet_ntoa(struct in_addr in) ptr[0], ptr[1], ptr[2], ptr[3]); return buffer; } -#else -FAR char *_inet_ntoa(in_addr_t in) -{ - static char buffer[INET_ADDRSTRLEN + 2]; - FAR unsigned char *ptr = (FAR unsigned char *)∈ - snprintf(buffer, INET_ADDRSTRLEN + 2, "%u.%u.%u.%u", - ptr[0], ptr[1], ptr[2], ptr[3]); - return buffer; -} -#endif + #endif /* CONFIG_NET_IPv4 || CONFIG_LIBC_IPv4_ADDRCONV */ diff --git a/libs/libc/stdlib/lib_div.c b/libs/libc/stdlib/lib_div.c index 62474dcf3e..780100b5cc 100644 --- a/libs/libc/stdlib/lib_div.c +++ b/libs/libc/stdlib/lib_div.c @@ -42,8 +42,6 @@ #include -#ifdef CONFIG_CAN_PASS_STRUCTS - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -76,5 +74,3 @@ div_t div(int numer, int denom) f.rem = numer % denom; return f; } - -#endif /* CONFIG_CAN_PASS_STRUCTS */ diff --git a/libs/libc/stdlib/lib_ldiv.c b/libs/libc/stdlib/lib_ldiv.c index d7cd499c3f..1c86649a5c 100644 --- a/libs/libc/stdlib/lib_ldiv.c +++ b/libs/libc/stdlib/lib_ldiv.c @@ -47,8 +47,6 @@ #include -#ifdef CONFIG_CAN_PASS_STRUCTS - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -81,5 +79,3 @@ ldiv_t ldiv(long numer, long denom) f.rem = numer % denom; return f; } - -#endif /* CONFIG_CAN_PASS_STRUCTS */ diff --git a/libs/libc/stdlib/lib_lldiv.c b/libs/libc/stdlib/lib_lldiv.c index 8279fe90e0..b5c54b1261 100644 --- a/libs/libc/stdlib/lib_lldiv.c +++ b/libs/libc/stdlib/lib_lldiv.c @@ -47,7 +47,7 @@ #include -#if defined(CONFIG_CAN_PASS_STRUCTS) && defined(CONFIG_HAVE_LONG_LONG) +#if defined(CONFIG_HAVE_LONG_LONG) /**************************************************************************** * Public Functions @@ -82,4 +82,4 @@ lldiv_t lldiv(long long numer, long long denom) return f; } -#endif /* CONFIG_CAN_PASS_STRUCTS && CONFIG_HAVE_LONG_LONG */ +#endif /* CONFIG_HAVE_LONG_LONG */ diff --git a/mm/kmm_heap/kmm_mallinfo.c b/mm/kmm_heap/kmm_mallinfo.c index 9f812bad2b..c1da8141a6 100644 --- a/mm/kmm_heap/kmm_mallinfo.c +++ b/mm/kmm_heap/kmm_mallinfo.c @@ -1,35 +1,20 @@ /**************************************************************************** * mm/kmm_heap/kmm_mallinfo.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -58,8 +43,6 @@ * ****************************************************************************/ -#ifdef CONFIG_CAN_PASS_STRUCTS - struct mallinfo kmm_mallinfo(void) { struct mallinfo info; @@ -67,12 +50,4 @@ struct mallinfo kmm_mallinfo(void) return info; } -#else - -int kmm_mallinfo(struct mallinfo *info) -{ - return mm_mallinfo(&g_kmmheap, info); -} - -#endif /* CONFIG_CAN_PASS_STRUCTS */ #endif /* CONFIG_MM_KERNEL_HEAP */ diff --git a/mm/umm_heap/umm_mallinfo.c b/mm/umm_heap/umm_mallinfo.c index a6c1aaa847..39a4058e23 100644 --- a/mm/umm_heap/umm_mallinfo.c +++ b/mm/umm_heap/umm_mallinfo.c @@ -1,35 +1,20 @@ /**************************************************************************** * mm/umm_heap/umm_mallinfo.c * - * Copyright (C) 2007, 2009, 2013-2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -58,20 +43,9 @@ * ****************************************************************************/ -#ifdef CONFIG_CAN_PASS_STRUCTS - struct mallinfo mallinfo(void) { struct mallinfo info; mm_mallinfo(USR_HEAP, &info); return info; } - -#else - -int mallinfo(FAR struct mallinfo *info) -{ - return mm_mallinfo(USR_HEAP, info); -} - -#endif /* CONFIG_CAN_PASS_STRUCTS */ diff --git a/sched/pthread/pthread_condtimedwait.c b/sched/pthread/pthread_condtimedwait.c index 6f140097b8..e0c224648a 100644 --- a/sched/pthread/pthread_condtimedwait.c +++ b/sched/pthread/pthread_condtimedwait.c @@ -124,16 +124,12 @@ static void pthread_condtimedout(int argc, wdparm_t arg1, ...) * just use nxsig_queue(). */ -#ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; /* Send the specified signal to the specified task. */ value.sival_ptr = NULL; nxsig_queue((int)pid, signo, value); -#else - nxsig_queue((int)pid, signo, NULL); -#endif } #endif /* HAVE_GROUP_MEMBERS */ diff --git a/sched/signal/sig_notification.c b/sched/signal/sig_notification.c index 8b51019182..f8033ddc32 100644 --- a/sched/signal/sig_notification.c +++ b/sched/signal/sig_notification.c @@ -86,11 +86,7 @@ static void nxsig_notification_worker(FAR void *arg) /* Perform the callback */ -#ifdef CONFIG_CAN_PASS_STRUCTS work->func(work->value); -#else - work->func(work->value.sival_ptr); -#endif } #endif /* CONFIG_SIG_EVTHREAD */ @@ -167,12 +163,8 @@ int nxsig_notification(pid_t pid, FAR struct sigevent *event, { /* Initialize the work information */ -#ifdef CONFIG_CAN_PASS_STRUCTS work->value = event->sigev_value; -#else - work->value.sival_ptr = event->sigev_value.sival_ptr; -#endif - work->func = event->sigev_notify_function; + work->func = event->sigev_notify_function; /* Then queue the work */ diff --git a/sched/signal/sig_queue.c b/sched/signal/sig_queue.c index 9f5ea4adbd..5f0d920e9a 100644 --- a/sched/signal/sig_queue.c +++ b/sched/signal/sig_queue.c @@ -1,35 +1,20 @@ /**************************************************************************** * sched/signal/sig_queue.c * - * Copyright (C) 2007-2009, 2013, 2017 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -89,11 +74,7 @@ * ****************************************************************************/ -#ifdef CONFIG_CAN_PASS_STRUCTS int nxsig_queue (int pid, int signo, union sigval value) -#else -int nxsig_queue(int pid, int signo, void *sival_ptr) -#endif { #ifdef CONFIG_SCHED_HAVE_PARENT FAR struct tcb_s *rtcb = this_task(); @@ -101,11 +82,7 @@ int nxsig_queue(int pid, int signo, void *sival_ptr) siginfo_t info; int ret; -#ifdef CONFIG_CAN_PASS_STRUCTS sinfo("pid=0x%08x signo=%d value=%d\n", pid, signo, value.sival_int); -#else - sinfo("pid=0x%08x signo=%d value=%p\n", pid, signo, sival_ptr); -#endif /* Sanity checks */ @@ -119,11 +96,7 @@ int nxsig_queue(int pid, int signo, void *sival_ptr) info.si_signo = signo; info.si_code = SI_QUEUE; info.si_errno = OK; -#ifdef CONFIG_CAN_PASS_STRUCTS info.si_value = value; -#else - info.si_value.sival_ptr = sival_ptr; -#endif #ifdef CONFIG_SCHED_HAVE_PARENT info.si_pid = rtcb->pid; info.si_status = OK; @@ -170,21 +143,13 @@ int nxsig_queue(int pid, int signo, void *sival_ptr) * ****************************************************************************/ -#ifdef CONFIG_CAN_PASS_STRUCTS int sigqueue (int pid, int signo, union sigval value) -#else -int sigqueue(int pid, int signo, void *sival_ptr) -#endif { int ret; /* Let nxsig_queue() do all of the real work */ -#ifdef CONFIG_CAN_PASS_STRUCTS ret = nxsig_queue(pid, signo, value); -#else - ret = nxsig_queue(pid, signo, sival_ptr); -#endif if (ret < 0) { set_errno(-ret); diff --git a/sched/timer/timer_settime.c b/sched/timer/timer_settime.c index b9669e3c97..b492383ce4 100644 --- a/sched/timer/timer_settime.c +++ b/sched/timer/timer_settime.c @@ -125,39 +125,6 @@ static inline void timer_restart(FAR struct posix_timer_s *timer, static void timer_timeout(int argc, wdparm_t itimer, ...) { -#ifndef CONFIG_CAN_PASS_STRUCTS - /* On many small machines, pointers are encoded and cannot be simply cast - * from wdparm_t to struct tcb_s *. The following union works around this - * (see wdogparm_t). - */ - - union - { - FAR struct posix_timer_s *timer; - wdparm_t itimer; - } u; - - u.itimer = itimer; - - /* Send the specified signal to the specified task. Increment the - * reference count on the timer first so that will not be deleted until - * after the signal handler returns. - */ - - u.timer->pt_crefs++; - timer_signotify(u.timer); - - /* Release the reference. timer_release will return nonzero if the timer - * was not deleted. - */ - - if (timer_release(u.timer)) - { - /* If this is a repetitive timer, then restart the watchdog */ - - timer_restart(u.timer, itimer); - } -#else FAR struct posix_timer_s *timer = (FAR struct posix_timer_s *)itimer; /* Send the specified signal to the specified task. Increment the @@ -178,7 +145,6 @@ static void timer_timeout(int argc, wdparm_t itimer, ...) timer_restart(timer, itimer); } -#endif } /****************************************************************************