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
87f3060a
Commit
87f3060a
authored
Oct 23, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arch/sparc64/kernel/ioctl32.c: Handle HDIO_GETGEO_BIG{,_RAW}.
parent
ccdcd497
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
+34
-3
arch/sparc64/kernel/ioctl32.c
arch/sparc64/kernel/ioctl32.c
+34
-3
No files found.
arch/sparc64/kernel/ioctl32.c
View file @
87f3060a
...
@@ -868,10 +868,39 @@ static int hdio_getgeo(unsigned int fd, unsigned int cmd, unsigned long arg)
...
@@ -868,10 +868,39 @@ static int hdio_getgeo(unsigned int fd, unsigned int cmd, unsigned long arg)
err
=
sys_ioctl
(
fd
,
HDIO_GETGEO
,
(
unsigned
long
)
&
geo
);
err
=
sys_ioctl
(
fd
,
HDIO_GETGEO
,
(
unsigned
long
)
&
geo
);
set_fs
(
old_fs
);
set_fs
(
old_fs
);
if
(
!
err
)
{
if
(
!
err
)
{
err
=
copy_to_user
((
struct
hd_geometry32
*
)
arg
,
&
geo
,
4
);
if
(
copy_to_user
((
struct
hd_geometry32
*
)
arg
,
&
geo
,
4
)
||
err
|=
__put_user
(
geo
.
start
,
&
(((
struct
hd_geometry32
*
)
arg
)
->
start
));
__put_user
(
geo
.
start
,
&
(((
struct
hd_geometry32
*
)
arg
)
->
start
)))
err
=
-
EFAULT
;
}
}
return
err
?
-
EFAULT
:
0
;
return
err
;
}
struct
hd_big_geometry32
{
unsigned
char
heads
;
unsigned
char
sectors
;
unsigned
int
cylinders
;
u32
start
;
};
static
int
hdio_getgeo_big
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
struct
hd_big_geometry
geo
;
int
err
;
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
geo
);
set_fs
(
old_fs
);
if
(
!
err
)
{
struct
hd_big_geometry32
*
up
=
(
struct
hd_big_geometry32
*
)
arg
;
if
(
put_user
(
geo
.
heads
,
&
up
->
heads
)
||
__put_user
(
geo
.
sectors
,
&
up
->
sectors
)
||
__put_user
(
geo
.
cylinders
,
&
up
->
cylinders
)
||
__put_user
(((
u32
)
geo
.
start
),
&
up
->
start
))
err
=
-
EFAULT
;
}
return
err
;
}
}
struct
fbcmap32
{
struct
fbcmap32
{
...
@@ -5030,6 +5059,8 @@ HANDLE_IOCTL(SIOCDELRT, routing_ioctl)
...
@@ -5030,6 +5059,8 @@ HANDLE_IOCTL(SIOCDELRT, routing_ioctl)
HANDLE_IOCTL
(
SIOCRTMSG
,
ret_einval
)
HANDLE_IOCTL
(
SIOCRTMSG
,
ret_einval
)
HANDLE_IOCTL
(
SIOCGSTAMP
,
do_siocgstamp
)
HANDLE_IOCTL
(
SIOCGSTAMP
,
do_siocgstamp
)
HANDLE_IOCTL
(
HDIO_GETGEO
,
hdio_getgeo
)
HANDLE_IOCTL
(
HDIO_GETGEO
,
hdio_getgeo
)
HANDLE_IOCTL
(
HDIO_GETGEO_BIG
,
hdio_getgeo_big
)
HANDLE_IOCTL
(
HDIO_GETGEO_BIG_RAW
,
hdio_getgeo_big
)
HANDLE_IOCTL
(
BLKGETSIZE
,
w_long
)
HANDLE_IOCTL
(
BLKGETSIZE
,
w_long
)
HANDLE_IOCTL
(
0x1260
,
broken_blkgetsize
)
HANDLE_IOCTL
(
0x1260
,
broken_blkgetsize
)
HANDLE_IOCTL
(
BLKSECTGET
,
w_long
)
HANDLE_IOCTL
(
BLKSECTGET
,
w_long
)
...
...
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