[PATCH 2/8] Use __kernel_long_t/__kernel_ulong_t in

2013-12-27 Thread H.J. Lu
Both x32 and x86-64 use the same struct rusage and struct rlimit for
system calls.  But x32 log is 32-bit.  This patch change uapi
 to use __kernel_long_t in struct rusage and
__kernel_ulong_t in and struct rlimit.

Signed-off-by: H.J. Lu 
---
 include/uapi/linux/resource.h | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
index e0ed284..36fb3b5 100644
--- a/include/uapi/linux/resource.h
+++ b/include/uapi/linux/resource.h
@@ -23,25 +23,25 @@
 struct rusage {
struct timeval ru_utime;/* user time used */
struct timeval ru_stime;/* system time used */
-   longru_maxrss;  /* maximum resident set size */
-   longru_ixrss;   /* integral shared memory size */
-   longru_idrss;   /* integral unshared data size */
-   longru_isrss;   /* integral unshared stack size */
-   longru_minflt;  /* page reclaims */
-   longru_majflt;  /* page faults */
-   longru_nswap;   /* swaps */
-   longru_inblock; /* block input operations */
-   longru_oublock; /* block output operations */
-   longru_msgsnd;  /* messages sent */
-   longru_msgrcv;  /* messages received */
-   longru_nsignals;/* signals received */
-   longru_nvcsw;   /* voluntary context switches */
-   longru_nivcsw;  /* involuntary " */
+   __kernel_long_t ru_maxrss;  /* maximum resident set size */
+   __kernel_long_t ru_ixrss;   /* integral shared memory size */
+   __kernel_long_t ru_idrss;   /* integral unshared data size */
+   __kernel_long_t ru_isrss;   /* integral unshared stack size */
+   __kernel_long_t ru_minflt;  /* page reclaims */
+   __kernel_long_t ru_majflt;  /* page faults */
+   __kernel_long_t ru_nswap;   /* swaps */
+   __kernel_long_t ru_inblock; /* block input operations */
+   __kernel_long_t ru_oublock; /* block output operations */
+   __kernel_long_t ru_msgsnd;  /* messages sent */
+   __kernel_long_t ru_msgrcv;  /* messages received */
+   __kernel_long_t ru_nsignals;/* signals received */
+   __kernel_long_t ru_nvcsw;   /* voluntary context switches */
+   __kernel_long_t ru_nivcsw;  /* involuntary " */
 };
 
 struct rlimit {
-   unsigned long   rlim_cur;
-   unsigned long   rlim_max;
+   __kernel_ulong_trlim_cur;
+   __kernel_ulong_trlim_max;
 };
 
 #define RLIM64_INFINITY(~0ULL)
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/8] Use __kernel_long_t/__kernel_ulong_t in

2013-12-27 Thread H.J. Lu
Both x32 and x86-64 use the same struct rusage and struct rlimit for
system calls.  But x32 log is 32-bit.  This patch change uapi
 to use __kernel_long_t in struct rusage and
__kernel_ulong_t in and struct rlimit if __BITS_PER_LONG == 64.

Signed-off-by: H.J. Lu 
---
 include/uapi/linux/resource.h | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
index e0ed284..87d2daa 100644
--- a/include/uapi/linux/resource.h
+++ b/include/uapi/linux/resource.h
@@ -23,6 +23,22 @@
 struct rusage {
struct timeval ru_utime;/* user time used */
struct timeval ru_stime;/* system time used */
+#if __BITS_PER_LONG == 64
+   __kernel_long_t ru_maxrss;  /* maximum resident set size */
+   __kernel_long_t ru_ixrss;   /* integral shared memory size */
+   __kernel_long_t ru_idrss;   /* integral unshared data size */
+   __kernel_long_t ru_isrss;   /* integral unshared stack size */
+   __kernel_long_t ru_minflt;  /* page reclaims */
+   __kernel_long_t ru_majflt;  /* page faults */
+   __kernel_long_t ru_nswap;   /* swaps */
+   __kernel_long_t ru_inblock; /* block input operations */
+   __kernel_long_t ru_oublock; /* block output operations */
+   __kernel_long_t ru_msgsnd;  /* messages sent */
+   __kernel_long_t ru_msgrcv;  /* messages received */
+   __kernel_long_t ru_nsignals;/* signals received */
+   __kernel_long_t ru_nvcsw;   /* voluntary context switches */
+   __kernel_long_t ru_nivcsw;  /* involuntary " */
+#else
longru_maxrss;  /* maximum resident set size */
longru_ixrss;   /* integral shared memory size */
longru_idrss;   /* integral unshared data size */
@@ -37,11 +53,17 @@ struct  rusage {
longru_nsignals;/* signals received */
longru_nvcsw;   /* voluntary context switches */
longru_nivcsw;  /* involuntary " */
+#endif
 };
 
 struct rlimit {
-   unsigned long   rlim_cur;
-   unsigned long   rlim_max;
+#if __BITS_PER_LONG == 64
+   __kernel_ulong_trlim_cur;
+   __kernel_ulong_trlim_max;
+#else
+   unsigned long   rlim_cur;
+   unsigned long   rlim_max;
+#endif
 };
 
 #define RLIM64_INFINITY(~0ULL)
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/8] Use __kernel_long_t/__kernel_ulong_t in linux/resource.h

2013-12-27 Thread H.J. Lu
Both x32 and x86-64 use the same struct rusage and struct rlimit for
system calls.  But x32 log is 32-bit.  This patch change uapi
linux/resource.h to use __kernel_long_t in struct rusage and
__kernel_ulong_t in and struct rlimit if __BITS_PER_LONG == 64.

Signed-off-by: H.J. Lu hjl.to...@gmail.com
---
 include/uapi/linux/resource.h | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
index e0ed284..87d2daa 100644
--- a/include/uapi/linux/resource.h
+++ b/include/uapi/linux/resource.h
@@ -23,6 +23,22 @@
 struct rusage {
struct timeval ru_utime;/* user time used */
struct timeval ru_stime;/* system time used */
+#if __BITS_PER_LONG == 64
+   __kernel_long_t ru_maxrss;  /* maximum resident set size */
+   __kernel_long_t ru_ixrss;   /* integral shared memory size */
+   __kernel_long_t ru_idrss;   /* integral unshared data size */
+   __kernel_long_t ru_isrss;   /* integral unshared stack size */
+   __kernel_long_t ru_minflt;  /* page reclaims */
+   __kernel_long_t ru_majflt;  /* page faults */
+   __kernel_long_t ru_nswap;   /* swaps */
+   __kernel_long_t ru_inblock; /* block input operations */
+   __kernel_long_t ru_oublock; /* block output operations */
+   __kernel_long_t ru_msgsnd;  /* messages sent */
+   __kernel_long_t ru_msgrcv;  /* messages received */
+   __kernel_long_t ru_nsignals;/* signals received */
+   __kernel_long_t ru_nvcsw;   /* voluntary context switches */
+   __kernel_long_t ru_nivcsw;  /* involuntary  */
+#else
longru_maxrss;  /* maximum resident set size */
longru_ixrss;   /* integral shared memory size */
longru_idrss;   /* integral unshared data size */
@@ -37,11 +53,17 @@ struct  rusage {
longru_nsignals;/* signals received */
longru_nvcsw;   /* voluntary context switches */
longru_nivcsw;  /* involuntary  */
+#endif
 };
 
 struct rlimit {
-   unsigned long   rlim_cur;
-   unsigned long   rlim_max;
+#if __BITS_PER_LONG == 64
+   __kernel_ulong_trlim_cur;
+   __kernel_ulong_trlim_max;
+#else
+   unsigned long   rlim_cur;
+   unsigned long   rlim_max;
+#endif
 };
 
 #define RLIM64_INFINITY(~0ULL)
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/8] Use __kernel_long_t/__kernel_ulong_t in linux/resource.h

2013-12-27 Thread H.J. Lu
Both x32 and x86-64 use the same struct rusage and struct rlimit for
system calls.  But x32 log is 32-bit.  This patch change uapi
linux/resource.h to use __kernel_long_t in struct rusage and
__kernel_ulong_t in and struct rlimit.

Signed-off-by: H.J. Lu hjl.to...@gmail.com
---
 include/uapi/linux/resource.h | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
index e0ed284..36fb3b5 100644
--- a/include/uapi/linux/resource.h
+++ b/include/uapi/linux/resource.h
@@ -23,25 +23,25 @@
 struct rusage {
struct timeval ru_utime;/* user time used */
struct timeval ru_stime;/* system time used */
-   longru_maxrss;  /* maximum resident set size */
-   longru_ixrss;   /* integral shared memory size */
-   longru_idrss;   /* integral unshared data size */
-   longru_isrss;   /* integral unshared stack size */
-   longru_minflt;  /* page reclaims */
-   longru_majflt;  /* page faults */
-   longru_nswap;   /* swaps */
-   longru_inblock; /* block input operations */
-   longru_oublock; /* block output operations */
-   longru_msgsnd;  /* messages sent */
-   longru_msgrcv;  /* messages received */
-   longru_nsignals;/* signals received */
-   longru_nvcsw;   /* voluntary context switches */
-   longru_nivcsw;  /* involuntary  */
+   __kernel_long_t ru_maxrss;  /* maximum resident set size */
+   __kernel_long_t ru_ixrss;   /* integral shared memory size */
+   __kernel_long_t ru_idrss;   /* integral unshared data size */
+   __kernel_long_t ru_isrss;   /* integral unshared stack size */
+   __kernel_long_t ru_minflt;  /* page reclaims */
+   __kernel_long_t ru_majflt;  /* page faults */
+   __kernel_long_t ru_nswap;   /* swaps */
+   __kernel_long_t ru_inblock; /* block input operations */
+   __kernel_long_t ru_oublock; /* block output operations */
+   __kernel_long_t ru_msgsnd;  /* messages sent */
+   __kernel_long_t ru_msgrcv;  /* messages received */
+   __kernel_long_t ru_nsignals;/* signals received */
+   __kernel_long_t ru_nvcsw;   /* voluntary context switches */
+   __kernel_long_t ru_nivcsw;  /* involuntary  */
 };
 
 struct rlimit {
-   unsigned long   rlim_cur;
-   unsigned long   rlim_max;
+   __kernel_ulong_trlim_cur;
+   __kernel_ulong_trlim_max;
 };
 
 #define RLIM64_INFINITY(~0ULL)
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/