Fwd: [PATCH] Add const qualifier in <sys/cpuset.h>

Joel Sherrill joel.sherrill at oarcorp.com
Mon Jul 7 21:27:28 UTC 2014


Hi Chris,

I added this patch to rtems-tools. Attached is a patch to
RSB to use it for the sparc tools. If this looks OK, should
I make a similar update to all applicable 4.11 targets?

--joel


-------- Original Message --------
Subject: 	[PATCH] Add const qualifier in <sys/cpuset.h>
Date: 	Mon, 14 Apr 2014 08:43:46 -0500
From: 	Sebastian Huber <sebastian.huber at embedded-brains.de>
To: 	newlib at sourceware.org <newlib at sourceware.org>
CC: 	Sebastian Huber <sebastian.huber at embedded-brains.de>



newlib/ChangeLog
2014-04-14  Sebastian Huber  <sebastian.huber at embedded-brains.de>

	* libc/sys/rtems/sys/cpuset.h (CPU_SET_S): Add const qualifier.
	(CPU_SET): Likewise.
---
 newlib/libc/sys/rtems/sys/cpuset.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/sys/rtems/sys/cpuset.h b/newlib/libc/sys/rtems/sys/cpuset.h
index 2818677..8fae475 100644
--- a/newlib/libc/sys/rtems/sys/cpuset.h
+++ b/newlib/libc/sys/rtems/sys/cpuset.h
@@ -153,14 +153,14 @@ static __inline void CPU_CLR(int cpu, cpu_set_t *set)
   CPU_CLR_S(cpu, sizeof(*set), set);
 }
 
-static __inline int CPU_ISSET_S(int cpu, size_t setsize, cpu_set_t *set)
+static __inline int CPU_ISSET_S(int cpu, size_t setsize, const cpu_set_t *set)
 {
   const cpu_set_word_t *w = &set->__bits[0];
 
   return ((w[__cpuset_index(cpu)] & __cpuset_mask(cpu)) != 0);
 }
 
-static __inline int CPU_ISSET(int cpu, cpu_set_t *set)
+static __inline int CPU_ISSET(int cpu, const cpu_set_t *set)
 {
   return CPU_ISSET_S(cpu, sizeof(*set), set);
 }
-- 
1.7.7



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140707/90da215f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-newlib-sys-cpuset-const-20140414.diff-for-sparc-.patch
Type: text/x-patch
Size: 1910 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140707/90da215f/attachment.bin>


More information about the devel mailing list