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
fc79e616
Commit
fc79e616
authored
Apr 25, 2003
by
Dave Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AGPGART] Remove semaphore abstraction.
parent
50ab4d67
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
18 deletions
+14
-18
drivers/char/agp/frontend.c
drivers/char/agp/frontend.c
+14
-14
include/linux/agpgart.h
include/linux/agpgart.h
+0
-4
No files found.
drivers/char/agp/frontend.c
View file @
fc79e616
...
@@ -586,7 +586,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
...
@@ -586,7 +586,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
agp_file_private
*
priv
=
(
agp_file_private
*
)
file
->
private_data
;
agp_file_private
*
priv
=
(
agp_file_private
*
)
file
->
private_data
;
agp_kern_info
kerninfo
;
agp_kern_info
kerninfo
;
AGP_LOCK
(
);
down
(
&
(
agp_fe
.
agp_mutex
)
);
if
(
agp_fe
.
backend_acquired
!=
TRUE
)
if
(
agp_fe
.
backend_acquired
!=
TRUE
)
goto
out_eperm
;
goto
out_eperm
;
...
@@ -619,7 +619,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
...
@@ -619,7 +619,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
size
,
vma
->
vm_page_prot
))
{
size
,
vma
->
vm_page_prot
))
{
goto
out_again
;
goto
out_again
;
}
}
AGP_UNLOCK
(
);
up
(
&
(
agp_fe
.
agp_mutex
)
);
return
0
;
return
0
;
}
}
...
@@ -634,20 +634,20 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
...
@@ -634,20 +634,20 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
size
,
vma
->
vm_page_prot
))
{
size
,
vma
->
vm_page_prot
))
{
goto
out_again
;
goto
out_again
;
}
}
AGP_UNLOCK
(
);
up
(
&
(
agp_fe
.
agp_mutex
)
);
return
0
;
return
0
;
}
}
out_eperm:
out_eperm:
AGP_UNLOCK
(
);
up
(
&
(
agp_fe
.
agp_mutex
)
);
return
-
EPERM
;
return
-
EPERM
;
out_inval:
out_inval:
AGP_UNLOCK
(
);
up
(
&
(
agp_fe
.
agp_mutex
)
);
return
-
EINVAL
;
return
-
EINVAL
;
out_again:
out_again:
AGP_UNLOCK
(
);
up
(
&
(
agp_fe
.
agp_mutex
)
);
return
-
EAGAIN
;
return
-
EAGAIN
;
}
}
...
@@ -655,7 +655,7 @@ static int agp_release(struct inode *inode, struct file *file)
...
@@ -655,7 +655,7 @@ static int agp_release(struct inode *inode, struct file *file)
{
{
agp_file_private
*
priv
=
(
agp_file_private
*
)
file
->
private_data
;
agp_file_private
*
priv
=
(
agp_file_private
*
)
file
->
private_data
;
AGP_LOCK
(
);
down
(
&
(
agp_fe
.
agp_mutex
)
);
if
(
test_bit
(
AGP_FF_IS_CONTROLLER
,
&
priv
->
access_flags
))
{
if
(
test_bit
(
AGP_FF_IS_CONTROLLER
,
&
priv
->
access_flags
))
{
agp_controller
*
controller
;
agp_controller
*
controller
;
...
@@ -675,7 +675,7 @@ static int agp_release(struct inode *inode, struct file *file)
...
@@ -675,7 +675,7 @@ static int agp_release(struct inode *inode, struct file *file)
}
}
agp_remove_file_private
(
priv
);
agp_remove_file_private
(
priv
);
kfree
(
priv
);
kfree
(
priv
);
AGP_UNLOCK
(
);
up
(
&
(
agp_fe
.
agp_mutex
)
);
return
0
;
return
0
;
}
}
...
@@ -686,7 +686,7 @@ static int agp_open(struct inode *inode, struct file *file)
...
@@ -686,7 +686,7 @@ static int agp_open(struct inode *inode, struct file *file)
agp_client
*
client
;
agp_client
*
client
;
int
rc
=
-
ENXIO
;
int
rc
=
-
ENXIO
;
AGP_LOCK
(
);
down
(
&
(
agp_fe
.
agp_mutex
)
);
if
(
minor
!=
AGPGART_MINOR
)
if
(
minor
!=
AGPGART_MINOR
)
goto
err_out
;
goto
err_out
;
...
@@ -711,13 +711,13 @@ static int agp_open(struct inode *inode, struct file *file)
...
@@ -711,13 +711,13 @@ static int agp_open(struct inode *inode, struct file *file)
}
}
file
->
private_data
=
(
void
*
)
priv
;
file
->
private_data
=
(
void
*
)
priv
;
agp_insert_file_private
(
priv
);
agp_insert_file_private
(
priv
);
AGP_UNLOCK
(
);
up
(
&
(
agp_fe
.
agp_mutex
)
);
return
0
;
return
0
;
err_out_nomem:
err_out_nomem:
rc
=
-
ENOMEM
;
rc
=
-
ENOMEM
;
err_out:
err_out:
AGP_UNLOCK
(
);
up
(
&
(
agp_fe
.
agp_mutex
)
);
return
rc
;
return
rc
;
}
}
...
@@ -965,7 +965,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
...
@@ -965,7 +965,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
agp_file_private
*
curr_priv
=
(
agp_file_private
*
)
file
->
private_data
;
agp_file_private
*
curr_priv
=
(
agp_file_private
*
)
file
->
private_data
;
int
ret_val
=
-
ENOTTY
;
int
ret_val
=
-
ENOTTY
;
AGP_LOCK
(
);
down
(
&
(
agp_fe
.
agp_mutex
)
);
if
((
agp_fe
.
current_controller
==
NULL
)
&&
if
((
agp_fe
.
current_controller
==
NULL
)
&&
(
cmd
!=
AGPIOC_ACQUIRE
))
{
(
cmd
!=
AGPIOC_ACQUIRE
))
{
...
@@ -1034,7 +1034,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
...
@@ -1034,7 +1034,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
}
}
ioctl_out:
ioctl_out:
AGP_UNLOCK
(
);
up
(
&
(
agp_fe
.
agp_mutex
)
);
return
ret_val
;
return
ret_val
;
}
}
...
@@ -1060,7 +1060,7 @@ static struct miscdevice agp_miscdev =
...
@@ -1060,7 +1060,7 @@ static struct miscdevice agp_miscdev =
int
agp_frontend_initialize
(
void
)
int
agp_frontend_initialize
(
void
)
{
{
memset
(
&
agp_fe
,
0
,
sizeof
(
struct
agp_front_data
));
memset
(
&
agp_fe
,
0
,
sizeof
(
struct
agp_front_data
));
AGP_LOCK_INIT
(
);
sema_init
(
&
(
agp_fe
.
agp_mutex
),
1
);
if
(
misc_register
(
&
agp_miscdev
))
{
if
(
misc_register
(
&
agp_miscdev
))
{
printk
(
KERN_ERR
PFX
"unable to get minor: %d
\n
"
,
AGPGART_MINOR
);
printk
(
KERN_ERR
PFX
"unable to get minor: %d
\n
"
,
AGPGART_MINOR
);
...
...
include/linux/agpgart.h
View file @
fc79e616
...
@@ -112,10 +112,6 @@ typedef struct _agp_unbind {
...
@@ -112,10 +112,6 @@ typedef struct _agp_unbind {
#define AGPGART_MINOR 175
#define AGPGART_MINOR 175
#define AGP_UNLOCK() up(&(agp_fe.agp_mutex));
#define AGP_LOCK() down(&(agp_fe.agp_mutex));
#define AGP_LOCK_INIT() sema_init(&(agp_fe.agp_mutex), 1)
#ifndef _AGP_BACKEND_H
#ifndef _AGP_BACKEND_H
struct
_agp_version
{
struct
_agp_version
{
u16
major
;
u16
major
;
...
...
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