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
Kirill Smelkov
linux
Commits
25ca047b
Commit
25ca047b
authored
Jun 15, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC64]: Merge sysinfo32 corrections from ppc64 port.
parent
eaaaa304
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sparc32.c
+29
-3
No files found.
arch/sparc64/kernel/sys_sparc32.c
View file @
25ca047b
...
@@ -1531,7 +1531,11 @@ struct sysinfo32 {
...
@@ -1531,7 +1531,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
(
int
)
-
sizeof
(
int
)];
};
};
extern
asmlinkage
int
sys_sysinfo
(
struct
sysinfo
*
info
);
extern
asmlinkage
int
sys_sysinfo
(
struct
sysinfo
*
info
);
...
@@ -1540,11 +1544,30 @@ asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
...
@@ -1540,11 +1544,30 @@ asmlinkage int 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
]);
...
@@ -1556,6 +1579,9 @@ asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
...
@@ -1556,6 +1579,9 @@ asmlinkage int 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
;
return
ret
;
return
ret
;
...
...
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