Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f76865d6
Commit
f76865d6
authored
May 05, 2003
by
Arun Sharma
Committed by
David Mosberger
May 05, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] ia64: fix ia32 emulation of rlimit et al
parent
38b89d93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
165 deletions
+9
-165
arch/ia64/ia32/ia32_entry.S
arch/ia64/ia32/ia32_entry.S
+5
-5
arch/ia64/ia32/sys_ia32.c
arch/ia64/ia32/sys_ia32.c
+1
-160
include/asm-ia64/compat.h
include/asm-ia64/compat.h
+3
-0
No files found.
arch/ia64/ia32/ia32_entry.S
View file @
f76865d6
...
...
@@ -273,9 +273,9 @@ ia32_syscall_table:
data8
sys32_sigsuspend
data8
compat_sys_sigpending
data8
sys_sethostname
data8
sys32
_setrlimit
/*
75
*/
data8
sys32
_old_getrlimit
data8
sys32
_getrusage
data8
compat_sys
_setrlimit
/*
75
*/
data8
compat_sys
_old_getrlimit
data8
compat_sys
_getrusage
data8
sys32_gettimeofday
data8
sys32_settimeofday
data8
sys32_getgroups16
/*
80
*/
...
...
@@ -312,7 +312,7 @@ ia32_syscall_table:
data8
sys_vhangup
data8
sys32_ni_syscall
/*
used
to
be
sys_idle
*/
data8
sys32_ni_syscall
data8
sys32
_wait4
data8
compat_sys
_wait4
data8
sys_swapoff
/*
115
*/
data8
sys32_sysinfo
data8
sys32_ipc
...
...
@@ -389,7 +389,7 @@ ia32_syscall_table:
data8
sys32_ni_syscall
/*
streams1
*/
data8
sys32_ni_syscall
/*
streams2
*/
data8
sys32_vfork
/*
190
*/
data8
sys32
_getrlimit
data8
compat_sys
_getrlimit
data8
sys32_mmap2
data8
sys32_truncate64
data8
sys32_ftruncate64
...
...
arch/ia64/ia32/sys_ia32.c
View file @
f76865d6
...
...
@@ -1004,77 +1004,6 @@ sys32_writev (int fd, struct compat_iovec *vector, u32 count)
return
ret
;
}
#define RLIM_INFINITY32 0x7fffffff
#define RESOURCE32(x) ((x > RLIM_INFINITY32) ? RLIM_INFINITY32 : x)
struct
rlimit32
{
int
rlim_cur
;
int
rlim_max
;
};
extern
asmlinkage
long
sys_getrlimit
(
unsigned
int
resource
,
struct
rlimit
*
rlim
);
asmlinkage
long
sys32_old_getrlimit
(
unsigned
int
resource
,
struct
rlimit32
*
rlim
)
{
mm_segment_t
old_fs
=
get_fs
();
struct
rlimit
r
;
int
ret
;
set_fs
(
KERNEL_DS
);
ret
=
sys_getrlimit
(
resource
,
&
r
);
set_fs
(
old_fs
);
if
(
!
ret
)
{
ret
=
put_user
(
RESOURCE32
(
r
.
rlim_cur
),
&
rlim
->
rlim_cur
);
ret
|=
put_user
(
RESOURCE32
(
r
.
rlim_max
),
&
rlim
->
rlim_max
);
}
return
ret
;
}
asmlinkage
long
sys32_getrlimit
(
unsigned
int
resource
,
struct
rlimit32
*
rlim
)
{
mm_segment_t
old_fs
=
get_fs
();
struct
rlimit
r
;
int
ret
;
set_fs
(
KERNEL_DS
);
ret
=
sys_getrlimit
(
resource
,
&
r
);
set_fs
(
old_fs
);
if
(
!
ret
)
{
if
(
r
.
rlim_cur
>=
0xffffffff
)
r
.
rlim_cur
=
0xffffffff
;
if
(
r
.
rlim_max
>=
0xffffffff
)
r
.
rlim_max
=
0xffffffff
;
ret
=
put_user
(
r
.
rlim_cur
,
&
rlim
->
rlim_cur
);
ret
|=
put_user
(
r
.
rlim_max
,
&
rlim
->
rlim_max
);
}
return
ret
;
}
extern
asmlinkage
long
sys_setrlimit
(
unsigned
int
resource
,
struct
rlimit
*
rlim
);
asmlinkage
long
sys32_setrlimit
(
unsigned
int
resource
,
struct
rlimit32
*
rlim
)
{
struct
rlimit
r
;
int
ret
;
mm_segment_t
old_fs
=
get_fs
();
if
(
resource
>=
RLIM_NLIMITS
)
return
-
EINVAL
;
if
(
get_user
(
r
.
rlim_cur
,
&
rlim
->
rlim_cur
)
||
get_user
(
r
.
rlim_max
,
&
rlim
->
rlim_max
))
return
-
EFAULT
;
if
(
r
.
rlim_cur
==
RLIM_INFINITY32
)
r
.
rlim_cur
=
RLIM_INFINITY
;
if
(
r
.
rlim_max
==
RLIM_INFINITY32
)
r
.
rlim_max
=
RLIM_INFINITY
;
set_fs
(
KERNEL_DS
);
ret
=
sys_setrlimit
(
resource
,
&
r
);
set_fs
(
old_fs
);
return
ret
;
}
/*
* sys32_ipc() is the de-multiplexer for the SysV IPC calls in 32bit emulation..
*
...
...
@@ -1723,98 +1652,10 @@ sys32_time (int *tloc)
return
i
;
}
struct
rusage32
{
struct
compat_timeval
ru_utime
;
struct
compat_timeval
ru_stime
;
int
ru_maxrss
;
int
ru_ixrss
;
int
ru_idrss
;
int
ru_isrss
;
int
ru_minflt
;
int
ru_majflt
;
int
ru_nswap
;
int
ru_inblock
;
int
ru_oublock
;
int
ru_msgsnd
;
int
ru_msgrcv
;
int
ru_nsignals
;
int
ru_nvcsw
;
int
ru_nivcsw
;
};
static
int
put_rusage
(
struct
rusage32
*
ru
,
struct
rusage
*
r
)
{
int
err
;
if
(
!
access_ok
(
VERIFY_WRITE
,
ru
,
sizeof
(
*
ru
)))
return
-
EFAULT
;
err
=
__put_user
(
r
->
ru_utime
.
tv_sec
,
&
ru
->
ru_utime
.
tv_sec
);
err
|=
__put_user
(
r
->
ru_utime
.
tv_usec
,
&
ru
->
ru_utime
.
tv_usec
);
err
|=
__put_user
(
r
->
ru_stime
.
tv_sec
,
&
ru
->
ru_stime
.
tv_sec
);
err
|=
__put_user
(
r
->
ru_stime
.
tv_usec
,
&
ru
->
ru_stime
.
tv_usec
);
err
|=
__put_user
(
r
->
ru_maxrss
,
&
ru
->
ru_maxrss
);
err
|=
__put_user
(
r
->
ru_ixrss
,
&
ru
->
ru_ixrss
);
err
|=
__put_user
(
r
->
ru_idrss
,
&
ru
->
ru_idrss
);
err
|=
__put_user
(
r
->
ru_isrss
,
&
ru
->
ru_isrss
);
err
|=
__put_user
(
r
->
ru_minflt
,
&
ru
->
ru_minflt
);
err
|=
__put_user
(
r
->
ru_majflt
,
&
ru
->
ru_majflt
);
err
|=
__put_user
(
r
->
ru_nswap
,
&
ru
->
ru_nswap
);
err
|=
__put_user
(
r
->
ru_inblock
,
&
ru
->
ru_inblock
);
err
|=
__put_user
(
r
->
ru_oublock
,
&
ru
->
ru_oublock
);
err
|=
__put_user
(
r
->
ru_msgsnd
,
&
ru
->
ru_msgsnd
);
err
|=
__put_user
(
r
->
ru_msgrcv
,
&
ru
->
ru_msgrcv
);
err
|=
__put_user
(
r
->
ru_nsignals
,
&
ru
->
ru_nsignals
);
err
|=
__put_user
(
r
->
ru_nvcsw
,
&
ru
->
ru_nvcsw
);
err
|=
__put_user
(
r
->
ru_nivcsw
,
&
ru
->
ru_nivcsw
);
return
err
;
}
asmlinkage
long
sys32_wait4
(
int
pid
,
unsigned
int
*
stat_addr
,
int
options
,
struct
rusage32
*
ru
)
{
if
(
!
ru
)
return
sys_wait4
(
pid
,
stat_addr
,
options
,
NULL
);
else
{
struct
rusage
r
;
int
ret
;
unsigned
int
status
;
mm_segment_t
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
sys_wait4
(
pid
,
stat_addr
?
&
status
:
NULL
,
options
,
&
r
);
set_fs
(
old_fs
);
if
(
put_rusage
(
ru
,
&
r
))
return
-
EFAULT
;
if
(
stat_addr
&&
put_user
(
status
,
stat_addr
))
return
-
EFAULT
;
return
ret
;
}
}
asmlinkage
long
sys32_waitpid
(
int
pid
,
unsigned
int
*
stat_addr
,
int
options
)
{
return
sys32_wait4
(
pid
,
stat_addr
,
options
,
NULL
);
}
extern
asmlinkage
long
sys_getrusage
(
int
who
,
struct
rusage
*
ru
);
asmlinkage
long
sys32_getrusage
(
int
who
,
struct
rusage32
*
ru
)
{
struct
rusage
r
;
int
ret
;
mm_segment_t
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
sys_getrusage
(
who
,
&
r
);
set_fs
(
old_fs
);
if
(
put_rusage
(
ru
,
&
r
))
return
-
EFAULT
;
return
ret
;
return
compat_sys_wait4
(
pid
,
stat_addr
,
options
,
NULL
);
}
static
unsigned
int
...
...
include/asm-ia64/compat.h
View file @
f76865d6
...
...
@@ -102,6 +102,9 @@ struct compat_statfs {
int
f_spare
[
6
];
};
#define COMPAT_RLIM_OLD_INFINITY 0x7fffffff
#define COMPAT_RLIM_INFINITY 0xffffffff
typedef
u32
compat_old_sigset_t
;
/* at least 32 bits */
#define _COMPAT_NSIG 64
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment