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
0aff9b57
Commit
0aff9b57
authored
Jun 15, 2003
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: various fixes to sys32_sysinfo, from Will Schmidt
parent
9a1a077b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
arch/ppc64/kernel/sys_ppc32.c
arch/ppc64/kernel/sys_ppc32.c
+27
-1
No files found.
arch/ppc64/kernel/sys_ppc32.c
View file @
0aff9b57
...
@@ -1136,7 +1136,11 @@ struct sysinfo32 {
...
@@ -1136,7 +1136,11 @@ struct sysinfo32 {
u32
totalswap
;
u32
totalswap
;
u32
freeswap
;
u32
freeswap
;
unsigned
short
procs
;
unsigned
short
procs
;
char
_f
[
22
];
unsigned
short
pad
;
u32
totalhigh
;
u32
freehigh
;
u32
mem_unit
;
char
_f
[
20
-
2
*
sizeof
(
long
)
-
sizeof
(
int
)];
};
};
extern
asmlinkage
long
sys_sysinfo
(
struct
sysinfo
*
info
);
extern
asmlinkage
long
sys_sysinfo
(
struct
sysinfo
*
info
);
...
@@ -1145,11 +1149,30 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 *info)
...
@@ -1145,11 +1149,30 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 *info)
{
{
struct
sysinfo
s
;
struct
sysinfo
s
;
int
ret
,
err
;
int
ret
,
err
;
int
bitcount
=
0
;
mm_segment_t
old_fs
=
get_fs
();
mm_segment_t
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
set_fs
(
KERNEL_DS
);
ret
=
sys_sysinfo
(
&
s
);
ret
=
sys_sysinfo
(
&
s
);
set_fs
(
old_fs
);
set_fs
(
old_fs
);
/* Check to see if any memory value is too large for 32-bit and
* scale down if needed.
*/
if
((
s
.
totalram
>>
32
)
||
(
s
.
totalswap
>>
32
))
{
while
(
s
.
mem_unit
<
PAGE_SIZE
)
{
s
.
mem_unit
<<=
1
;
bitcount
++
;
}
s
.
totalram
>>=
bitcount
;
s
.
freeram
>>=
bitcount
;
s
.
sharedram
>>=
bitcount
;
s
.
bufferram
>>=
bitcount
;
s
.
totalswap
>>=
bitcount
;
s
.
freeswap
>>=
bitcount
;
s
.
totalhigh
>>=
bitcount
;
s
.
freehigh
>>=
bitcount
;
}
err
=
put_user
(
s
.
uptime
,
&
info
->
uptime
);
err
=
put_user
(
s
.
uptime
,
&
info
->
uptime
);
err
|=
__put_user
(
s
.
loads
[
0
],
&
info
->
loads
[
0
]);
err
|=
__put_user
(
s
.
loads
[
0
],
&
info
->
loads
[
0
]);
err
|=
__put_user
(
s
.
loads
[
1
],
&
info
->
loads
[
1
]);
err
|=
__put_user
(
s
.
loads
[
1
],
&
info
->
loads
[
1
]);
...
@@ -1161,6 +1184,9 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 *info)
...
@@ -1161,6 +1184,9 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 *info)
err
|=
__put_user
(
s
.
totalswap
,
&
info
->
totalswap
);
err
|=
__put_user
(
s
.
totalswap
,
&
info
->
totalswap
);
err
|=
__put_user
(
s
.
freeswap
,
&
info
->
freeswap
);
err
|=
__put_user
(
s
.
freeswap
,
&
info
->
freeswap
);
err
|=
__put_user
(
s
.
procs
,
&
info
->
procs
);
err
|=
__put_user
(
s
.
procs
,
&
info
->
procs
);
err
|=
__put_user
(
s
.
totalhigh
,
&
info
->
totalhigh
);
err
|=
__put_user
(
s
.
freehigh
,
&
info
->
freehigh
);
err
|=
__put_user
(
s
.
mem_unit
,
&
info
->
mem_unit
);
if
(
err
)
if
(
err
)
return
-
EFAULT
;
return
-
EFAULT
;
...
...
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