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
64a8617f
Commit
64a8617f
authored
Apr 09, 2003
by
James Simmons
Browse files
Options
Browse Files
Download
Plain Diff
Merge maxwell.earthlink.net:/usr/src/linus-2.5
into maxwell.earthlink.net:/usr/src/fbdev-2.5
parents
6a47ae51
5edf8b9a
Changes
42
Show whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
366 additions
and
549 deletions
+366
-549
drivers/char/agp/Kconfig
drivers/char/agp/Kconfig
+10
-26
drivers/char/agp/Makefile
drivers/char/agp/Makefile
+1
-3
drivers/char/agp/agp.h
drivers/char/agp/agp.h
+5
-4
drivers/char/agp/ali-agp.c
drivers/char/agp/ali-agp.c
+1
-1
drivers/char/agp/amd-k7-agp.c
drivers/char/agp/amd-k7-agp.c
+1
-1
drivers/char/agp/amd-k8-agp.c
drivers/char/agp/amd-k8-agp.c
+10
-8
drivers/char/agp/backend.c
drivers/char/agp/backend.c
+1
-1
drivers/char/agp/frontend.c
drivers/char/agp/frontend.c
+1
-1
drivers/char/agp/generic-3.0.c
drivers/char/agp/generic-3.0.c
+27
-48
drivers/char/agp/generic.c
drivers/char/agp/generic.c
+25
-8
drivers/char/agp/hp-agp.c
drivers/char/agp/hp-agp.c
+3
-3
drivers/char/agp/i460-agp.c
drivers/char/agp/i460-agp.c
+2
-2
drivers/char/agp/i7x05-agp.c
drivers/char/agp/i7x05-agp.c
+0
-234
drivers/char/agp/intel-agp.c
drivers/char/agp/intel-agp.c
+76
-8
drivers/char/agp/sis-agp.c
drivers/char/agp/sis-agp.c
+1
-1
drivers/char/agp/via-agp.c
drivers/char/agp/via-agp.c
+31
-41
drivers/char/drm/drmP.h
drivers/char/drm/drmP.h
+11
-11
drivers/char/drm/drm_bufs.h
drivers/char/drm/drm_bufs.h
+2
-2
drivers/char/drm/drm_context.h
drivers/char/drm/drm_context.h
+1
-1
drivers/char/drm/drm_dma.h
drivers/char/drm/drm_dma.h
+6
-5
drivers/char/drm/drm_ioctl.h
drivers/char/drm/drm_ioctl.h
+1
-1
drivers/char/drm/drm_os_linux.h
drivers/char/drm/drm_os_linux.h
+23
-24
drivers/char/drm/drm_proc.h
drivers/char/drm/drm_proc.h
+5
-5
drivers/char/drm/drm_vm.h
drivers/char/drm/drm_vm.h
+3
-3
drivers/char/drm/gamma_dma.c
drivers/char/drm/gamma_dma.c
+2
-2
drivers/char/drm/i810_dma.c
drivers/char/drm/i810_dma.c
+1
-1
drivers/char/drm/i830_dma.c
drivers/char/drm/i830_dma.c
+1
-1
fs/read_write.c
fs/read_write.c
+18
-18
fs/stat.c
fs/stat.c
+15
-15
include/linux/agp_backend.h
include/linux/agp_backend.h
+1
-1
include/linux/fs.h
include/linux/fs.h
+5
-5
include/linux/pci_ids.h
include/linux/pci_ids.h
+10
-1
include/linux/sysctl.h
include/linux/sysctl.h
+4
-4
kernel/futex.c
kernel/futex.c
+1
-1
kernel/itimer.c
kernel/itimer.c
+4
-3
kernel/posix-timers.c
kernel/posix-timers.c
+13
-11
kernel/printk.c
kernel/printk.c
+2
-2
kernel/ptrace.c
kernel/ptrace.c
+9
-10
kernel/softirq.c
kernel/softirq.c
+2
-2
kernel/sysctl.c
kernel/sysctl.c
+26
-25
kernel/time.c
kernel/time.c
+3
-3
kernel/uid16.c
kernel/uid16.c
+2
-2
No files found.
drivers/char/agp/Kconfig
View file @
64a8617f
...
...
@@ -29,17 +29,13 @@ config AGP_GART
bool "/dev/agpgart (AGP Support)"
depends on GART_IOMMU
config AGP3
bool "AGP 3.0 compliance (EXPERIMENTAL)"
depends on AGP
config AGP_INTEL
tristate "Intel 440LX/BX/GX
and I815/I820/830M/I830MP/I840/I845/845G/I850/852GM/855GM/I860/865G
support"
depends on AGP
tristate "Intel 440LX/BX/GX
, I8xx and E7x05
support"
depends on AGP
&& !X86_64
help
This option gives you AGP support for the GLX component of the
XFree86 4.x on Intel 440LX/BX/GX, 815, 820, 830, 840, 845, 850
and 860
chipsets and full support for the 810, 815, 830M, 845G,
XFree86 4.x on Intel 440LX/BX/GX, 815, 820, 830, 840, 845, 850
, 860
E7205 and E7505
chipsets and full support for the 810, 815, 830M, 845G,
852GM, 855GM and 865G integrated graphics chipsets.
You should say Y here if you use XFree86 3.3.6 or 4.x and want to
...
...
@@ -48,7 +44,7 @@ config AGP_INTEL
#config AGP_I810
# tristate "Intel I810/I815/I830M (on-board) support"
# depends on AGP
# depends on AGP
&& !X86_64
# help
# This option gives you AGP support for the Xserver on the Intel 810
# 815 and 830m chipset boards for their on-board integrated graphics. This
...
...
@@ -56,7 +52,7 @@ config AGP_INTEL
config AGP_VIA
tristate "VIA chipset support"
depends on AGP
depends on AGP
&& !X86_64
help
This option gives you AGP support for the GLX component of the
XFree86 4.x on VIA MPV3/Apollo Pro chipsets.
...
...
@@ -66,7 +62,7 @@ config AGP_VIA
config AGP_AMD
tristate "AMD Irongate, 761, and 762 support"
depends on AGP
depends on AGP
&& !X86_64
help
This option gives you AGP support for the GLX component of the
XFree86 4.x on AMD Irongate, 761, and 762 chipsets.
...
...
@@ -76,7 +72,7 @@ config AGP_AMD
config AGP_SIS
tristate "Generic SiS support"
depends on AGP
depends on AGP
&& !X86_64
help
This option gives you AGP support for the GLX component of the "soon
to be released" XFree86 4.x on Silicon Integrated Systems [SiS]
...
...
@@ -89,7 +85,7 @@ config AGP_SIS
config AGP_ALI
tristate "ALI chipset support"
depends on AGP
depends on AGP
&& !X86_64
---help---
This option gives you AGP support for the GLX component of the
XFree86 4.x on the following ALi chipsets. The supported chipsets
...
...
@@ -107,7 +103,7 @@ config AGP_ALI
config AGP_SWORKS
tristate "Serverworks LE/HE support"
depends on AGP
depends on AGP
&& !X86_64
help
Say Y here to support the Serverworks AGP card. See
<http://www.serverworks.com/> for product descriptions and images.
...
...
@@ -139,15 +135,3 @@ config AGP_ALPHA_CORE
depends on AGP && (ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL)
default AGP
# Put AGP 3.0 entries below here.
config AGP_I7505
tristate "Intel 7205/7505 support (AGP 3.0)"
depends on AGP3
help
This option gives you AGP support for the GLX component of the
XFree86 4.x on Intel I7505 chipsets.
You should say Y here if you use XFree86 3.3.6 or 4.x and want to
use GLX or DRI. If unsure, say N
drivers/char/agp/Makefile
View file @
64a8617f
...
...
@@ -3,8 +3,7 @@
# space ioctl interface to use agp memory. It also adds a kernel interface
# that other drivers could use to manipulate agp memory.
agpgart-y
:=
backend.o frontend.o generic.o
agpgart-$(CONFIG_AGP3)
+=
generic-3.0.o
agpgart-y
:=
backend.o frontend.o generic.o generic-3.0.o
agpgart-objs
:=
$
(
agpgart-y
)
obj-$(CONFIG_AGP)
+=
agpgart.o
...
...
@@ -19,5 +18,4 @@ obj-$(CONFIG_AGP_HP_ZX1) += hp-agp.o
obj-$(CONFIG_AGP_AMD_8151)
+=
amd-k8-agp.o
obj-$(CONFIG_AGP_ALPHA_CORE)
+=
alpha-agp.o
obj-$(CONFIG_AGP_I7x05)
+=
i7x05-agp.o
drivers/char/agp/agp.h
View file @
64a8617f
/*
* AGPGART
* Copyright (C) 2002 Dave Jones
* Copyright (C) 2002
-2003
Dave Jones
* Copyright (C) 1999 Jeff Hartmann
* Copyright (C) 1999 Precision Insight, Inc.
* Copyright (C) 1999 Xi Graphics, Inc.
...
...
@@ -46,7 +46,7 @@ static void __attribute__((unused)) global_cache_flush(void)
panic
(
PFX
"timed out waiting for the other CPUs!
\n
"
);
}
#else
static
inline
void
global_cache_flush
(
void
)
static
void
global_cache_flush
(
void
)
{
flush_agp_cache
();
}
...
...
@@ -281,6 +281,7 @@ struct agp_bridge_data {
#define INTEL_I7505_ATTBASE 0x78
#define INTEL_I7505_ERRSTS 0x42
#define INTEL_I7505_AGPCTRL 0x70
#define INTEL_I7505_MCHCFG 0x50
/* VIA register */
#define VIA_APBASE 0x10
...
...
@@ -380,8 +381,7 @@ struct agp_driver {
/* Generic routines. */
void
agp_generic_agp_enable
(
u32
mode
);
void
agp_generic_agp_3_0_enable
(
u32
mode
);
void
agp_generic_enable
(
u32
mode
);
int
agp_generic_create_gatt_table
(
void
);
int
agp_generic_free_gatt_table
(
void
);
agp_memory
*
agp_create_memory
(
int
scratch_pages
);
...
...
@@ -399,5 +399,6 @@ int agp_register_driver (struct agp_driver *drv);
int
agp_unregister_driver
(
struct
agp_driver
*
drv
);
u32
agp_collect_device_status
(
u32
mode
,
u32
command
);
void
agp_device_command
(
u32
command
,
int
agp_v3
);
int
agp_3_0_node_enable
(
u32
mode
,
u32
minor
);
#endif
/* _AGP_BACKEND_PRIV_H */
drivers/char/agp/ali-agp.c
View file @
64a8617f
...
...
@@ -208,7 +208,7 @@ static int __init ali_generic_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
ali_cleanup
;
agp_bridge
->
tlb_flush
=
ali_tlbflush
;
agp_bridge
->
mask_memory
=
ali_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
ali_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
drivers/char/agp/amd-k7-agp.c
View file @
64a8617f
...
...
@@ -368,7 +368,7 @@ static int __init amd_irongate_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
amd_irongate_cleanup
;
agp_bridge
->
tlb_flush
=
amd_irongate_tlbflush
;
agp_bridge
->
mask_memory
=
amd_irongate_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
amd_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
amd_free_gatt_table
;
...
...
drivers/char/agp/amd-k8-agp.c
View file @
64a8617f
/*
* Copyright 2001
,2002 SuSE Labs
* Copyright 2001
-2003 SuSE Labs.
* Distributed under the GNU public license, v2.
*
* This is a GART driver for the AMD
K8 northbridge and the AMD 8151
*
AGP bridge. The main work is done in the northbridge. The configuration
*
is only mirrored in the 8151 for compatibility (could be likely
*
removed now
).
* This is a GART driver for the AMD
64 on-CPU northbridge.
*
It also includes support for the AMD 8151 AGP bridge,
*
although it doesn't actually do much, as all the real
*
work is done in the northbridge(s
).
*/
/*
...
...
@@ -224,7 +224,7 @@ static unsigned long amd_8151_mask_memory(unsigned long addr, int type)
static
struct
gatt_mask
amd_8151_masks
[]
=
{
{
0x00000001
,
0
}
{
.
mask
=
0x00000001
,
.
type
=
0
}
};
...
...
@@ -265,7 +265,7 @@ static void agp_x86_64_agp_enable(u32 mode)
/* If not enough, go to AGP v2 setup */
if
(
v3_devs
<
2
)
{
printk
(
KERN_INFO
"AGP: Only %d devices found, not enough, trying AGPv2
\n
"
,
v3_devs
);
return
agp_generic_
agp_
enable
(
mode
);
return
agp_generic_enable
(
mode
);
}
else
{
printk
(
KERN_INFO
"AGP: Enough AGPv3 devices found, setting up...
\n
"
);
}
...
...
@@ -340,6 +340,8 @@ static int __init agp_amdk8_probe (struct pci_dev *dev, const struct pci_device_
if
(
cap_ptr
==
0
)
return
-
ENODEV
;
printk
(
KERN_INFO
PFX
"Detected AMD64 on-CPU GART
\n
"
);
agp_bridge
->
dev
=
dev
;
agp_bridge
->
capndx
=
cap_ptr
;
...
...
drivers/char/agp/backend.c
View file @
64a8617f
/*
* AGPGART driver backend routines.
* Copyright (C) 2002 Dave Jones.
* Copyright (C) 2002
-2003
Dave Jones.
* Copyright (C) 1999 Jeff Hartmann.
* Copyright (C) 1999 Precision Insight, Inc.
* Copyright (C) 1999 Xi Graphics, Inc.
...
...
drivers/char/agp/frontend.c
View file @
64a8617f
/*
* AGPGART driver frontend
* Copyright (C) 2002 Dave Jones
* Copyright (C) 2002
-2003
Dave Jones
* Copyright (C) 1999 Jeff Hartmann
* Copyright (C) 1999 Precision Insight, Inc.
* Copyright (C) 1999 Xi Graphics, Inc.
...
...
drivers/char/agp/generic-3.0.c
View file @
64a8617f
...
...
@@ -319,10 +319,10 @@ static int agp_3_0_nonisochronous_node_enable(struct agp_3_0_dev *dev_list, unsi
* Fully configure and enable an AGP 3.0 host bridge and all the devices
* lying behind it.
*/
static
int
agp_3_0_node_enable
(
u32
mode
,
u32
minor
)
int
agp_3_0_node_enable
(
u32
mode
,
u32
minor
)
{
struct
pci_dev
*
td
=
agp_bridge
->
dev
,
*
dev
;
u8
bus_num
,
mcapndx
;
u8
mcapndx
;
u32
isoch
,
arqsz
,
cal_cycle
,
tmp
,
rate
;
u32
tstatus
,
tcmd
,
mcmd
,
mstatus
,
ncapid
;
u32
mmajor
,
mminor
;
...
...
@@ -343,23 +343,30 @@ static int agp_3_0_node_enable(u32 mode, u32 minor)
head
=
&
dev_list
->
list
;
INIT_LIST_HEAD
(
head
);
/*
* Find all the devices on this bridge's secondary bus and add them
* to dev_list.
*/
pci_read_config_byte
(
td
,
PCI_SECONDARY_BUS
,
&
bus_num
);
/* Find all AGP devices, and add them to dev_list. */
pci_for_each_dev
(
dev
)
{
if
(
dev
->
bus
->
number
==
bus_num
)
{
switch
((
dev
->
class
>>
8
)
&
0xff00
)
{
case
0x0001
:
/* Unclassified device */
case
0x0300
:
/* Display controller */
case
0x0400
:
/* Multimedia controller */
case
0x0600
:
/* Bridge */
mcapndx
=
pci_find_capability
(
dev
,
PCI_CAP_ID_AGP
);
if
(
mcapndx
==
0
)
continue
;
if
((
cur
=
kmalloc
(
sizeof
(
*
cur
),
GFP_KERNEL
))
==
NULL
)
{
ret
=
-
ENOMEM
;
goto
free_and_exit
;
}
cur
->
dev
=
dev
;
pos
=
&
cur
->
list
;
list_add
(
pos
,
head
);
ndevs
++
;
continue
;
default:
continue
;
}
}
...
...
@@ -518,33 +525,5 @@ static int agp_3_0_node_enable(u32 mode, u32 minor)
return
ret
;
}
/*
* Entry point to AGP 3.0 host bridge init. Check to see if we
* have an AGP 3.0 device operating in 3.0 mode. Call
* agp_3_0_node_enable or agp_generic_agp_enable if we don't
* (AGP 3.0 devices are required to operate as AGP 2.0 devices
* when not using 3.0 electricals.
*/
void
agp_generic_agp_3_0_enable
(
u32
mode
)
{
u32
ncapid
,
major
,
minor
,
agp_3_0
;
pci_read_config_dword
(
agp_bridge
->
dev
,
agp_bridge
->
capndx
,
&
ncapid
);
major
=
(
ncapid
>>
20
)
&
0xf
;
minor
=
(
ncapid
>>
16
)
&
0xf
;
printk
(
KERN_INFO
PFX
"Found an AGP %d.%d compliant device.
\n
"
,
major
,
minor
);
if
(
major
>=
3
)
{
pci_read_config_dword
(
agp_bridge
->
dev
,
agp_bridge
->
capndx
+
0x4
,
&
agp_3_0
);
/*
* Check to see if we are operating in 3.0 mode
*/
if
((
agp_3_0
>>
3
)
&
0x1
)
agp_3_0_node_enable
(
mode
,
minor
);
}
}
EXPORT_SYMBOL
(
agp_generic_agp_3_0_enable
);
EXPORT_SYMBOL_GPL
(
agp_3_0_node_enable
);
drivers/char/agp/generic.c
View file @
64a8617f
...
...
@@ -34,6 +34,7 @@
#include <linux/miscdevice.h>
#include <linux/pm.h>
#include <linux/agp_backend.h>
#include <linux/vmalloc.h>
#include "agp.h"
__u32
*
agp_gatt_table
;
...
...
@@ -392,21 +393,37 @@ void agp_device_command(u32 command, int agp_v3)
}
}
void
agp_generic_
agp_
enable
(
u32
mode
)
void
agp_generic_enable
(
u32
mode
)
{
u32
command
;
u32
command
,
ncapid
,
major
,
minor
;
pci_read_config_dword
(
agp_bridge
->
dev
,
agp_bridge
->
capndx
,
&
ncapid
);
major
=
(
ncapid
>>
20
)
&
0xf
;
minor
=
(
ncapid
>>
16
)
&
0xf
;
printk
(
KERN_INFO
PFX
"Found an AGP %d.%d compliant device.
\n
"
,
major
,
minor
);
if
(
major
>=
3
)
{
u32
agp_3_0
;
pci_read_config_dword
(
agp_bridge
->
dev
,
agp_bridge
->
capndx
+
0x4
,
&
agp_3_0
);
/* Check to see if we are operating in 3.0 mode */
if
((
agp_3_0
>>
3
)
&
0x1
)
{
agp_3_0_node_enable
(
mode
,
minor
);
return
;
}
else
{
printk
(
KERN_INFO
PFX
"not in AGP 3.0 mode, falling back to 2.x
\n
"
);
}
}
/* AGP v<3 */
pci_read_config_dword
(
agp_bridge
->
dev
,
agp_bridge
->
capndx
+
PCI_AGP_STATUS
,
&
command
);
agp_bridge
->
capndx
+
PCI_AGP_STATUS
,
&
command
);
command
=
agp_collect_device_status
(
mode
,
command
);
command
|=
0x100
;
pci_write_config_dword
(
agp_bridge
->
dev
,
agp_bridge
->
capndx
+
PCI_AGP_COMMAND
,
command
);
agp_bridge
->
capndx
+
PCI_AGP_COMMAND
,
command
);
agp_device_command
(
command
,
0
);
}
...
...
@@ -745,7 +762,7 @@ EXPORT_SYMBOL(agp_generic_alloc_page);
EXPORT_SYMBOL
(
agp_generic_destroy_page
);
EXPORT_SYMBOL
(
agp_generic_suspend
);
EXPORT_SYMBOL
(
agp_generic_resume
);
EXPORT_SYMBOL
(
agp_generic_
agp_
enable
);
EXPORT_SYMBOL
(
agp_generic_enable
);
EXPORT_SYMBOL
(
agp_generic_create_gatt_table
);
EXPORT_SYMBOL
(
agp_generic_free_gatt_table
);
EXPORT_SYMBOL
(
agp_generic_insert_memory
);
...
...
drivers/char/agp/hp-agp.c
View file @
64a8617f
...
...
@@ -339,7 +339,7 @@ static int __init hp_zx1_setup (struct pci_dev *pdev __attribute__((unused)))
agp_bridge
->
cleanup
=
hp_zx1_cleanup
;
agp_bridge
->
tlb_flush
=
hp_zx1_tlbflush
;
agp_bridge
->
mask_memory
=
hp_zx1_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
hp_zx1_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
hp_zx1_free_gatt_table
;
...
...
@@ -369,7 +369,7 @@ static int __init agp_find_supported_device(struct pci_dev *dev)
}
static
struct
agp_driver
hp_agp_driver
=
{
.
owner
=
THIS_MODULE
;
.
owner
=
THIS_MODULE
,
};
static
int
__init
agp_hp_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
ent
)
...
...
@@ -394,7 +394,7 @@ static struct pci_device_id agp_hp_pci_table[] __initdata = {
{
}
};
MODULE_DEVICE_TABLE
(
pci
,
agp_pci_table
);
MODULE_DEVICE_TABLE
(
pci
,
agp_
hp_
pci_table
);
static
struct
__initdata
pci_driver
agp_hp_pci_driver
=
{
.
name
=
"agpgart-hp"
,
...
...
drivers/char/agp/i460-agp.c
View file @
64a8617f
...
...
@@ -536,7 +536,7 @@ static int __init intel_i460_setup (struct pci_dev *pdev __attribute__((unused))
agp_bridge
->
cleanup
=
i460_cleanup
;
agp_bridge
->
tlb_flush
=
i460_tlb_flush
;
agp_bridge
->
mask_memory
=
i460_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
i460_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
i460_free_gatt_table
;
...
...
@@ -560,7 +560,7 @@ static int __init intel_i460_setup (struct pci_dev *pdev __attribute__((unused))
}
static
struct
agp_driver
i460_agp_driver
=
{
.
owner
=
THIS_MODULE
;
.
owner
=
THIS_MODULE
,
};
static
int
__init
agp_intel_i460_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
ent
)
...
...
drivers/char/agp/i7x05-agp.c
deleted
100644 → 0
View file @
6a47ae51
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/agp_backend.h>
#include "agp.h"
static
int
intel_7505_fetch_size
(
void
)
{
int
i
;
u16
tmp
;
aper_size_info_16
*
values
;
/*
* For AGP 3.0 APSIZE is now 16 bits
*/
pci_read_config_word
(
agp_bridge
->
dev
,
INTEL_I7505_APSIZE
,
&
tmp
);
tmp
=
(
tmp
&
0xfff
);
values
=
A_SIZE_16
(
agp_bridge
->
aperture_sizes
);
for
(
i
=
0
;
i
<
agp_bridge
->
num_aperture_sizes
;
i
++
)
{
if
(
tmp
==
values
[
i
].
size_value
)
{
agp_bridge
->
previous_size
=
agp_bridge
->
current_size
=
(
void
*
)(
values
+
i
);
agp_bridge
->
aperture_size_idx
=
i
;
return
values
[
i
].
size
;
}
}
return
0
;
}
static
void
intel_7505_tlbflush
(
agp_memory
*
mem
)
{
u32
temp
;
pci_read_config_dword
(
agp_bridge
->
dev
,
INTEL_I7505_AGPCTRL
,
&
temp
);
pci_write_config_dword
(
agp_bridge
->
dev
,
INTEL_I7505_AGPCTRL
,
temp
&
~
(
1
<<
7
));
pci_read_config_dword
(
agp_bridge
->
dev
,
INTEL_I7505_AGPCTRL
,
&
temp
);
pci_write_config_dword
(
agp_bridge
->
dev
,
INTEL_I7505_AGPCTRL
,
temp
|
(
1
<<
7
));
}
static
void
intel_7505_cleanup
(
void
)
{
aper_size_info_16
*
previous_size
;
previous_size
=
A_SIZE_16
(
agp_bridge
->
previous_size
);
pci_write_config_byte
(
agp_bridge
->
dev
,
INTEL_I7505_APSIZE
,
previous_size
->
size_value
);
}
static
int
intel_7505_configure
(
void
)
{
u32
temp
;
aper_size_info_16
*
current_size
;
current_size
=
A_SIZE_16
(
agp_bridge
->
current_size
);
/* aperture size */
pci_write_config_word
(
agp_bridge
->
dev
,
INTEL_I7505_APSIZE
,
current_size
->
size_value
);
/* address to map to */
pci_read_config_dword
(
agp_bridge
->
dev
,
INTEL_I7505_NAPBASELO
,
&
temp
);
agp_bridge
->
gart_bus_addr
=
(
temp
&
PCI_BASE_ADDRESS_MEM_MASK
);
/* attbase */
pci_write_config_dword
(
agp_bridge
->
dev
,
INTEL_I7505_ATTBASE
,
agp_bridge
->
gatt_bus_addr
);
/* agpctrl */
pci_write_config_dword
(
agp_bridge
->
dev
,
INTEL_I7505_AGPCTRL
,
0x0000
);
/* clear error registers */
pci_write_config_byte
(
agp_bridge
->
dev
,
INTEL_I7505_ERRSTS
,
0xff
);
return
0
;
}
static
aper_size_info_16
intel_7505_sizes
[
7
]
=
{
{
256
,
65536
,
6
,
0xf00
},
{
128
,
32768
,
5
,
0xf20
},
{
64
,
16384
,
4
,
0xf30
},
{
32
,
8192
,
3
,
0xf38
},
{
16
,
4096
,
2
,
0xf3c
},
{
8
,
2048
,
1
,
0xf3e
},
{
4
,
1024
,
0
,
0xf3f
}
};
static
void
i7505_setup
(
u32
mode
)
{
if
((
agp_generic_agp_3_0_enable
)
==
FALSE
)
agp_generic_agp_enable
(
mode
);
}
static
int
__init
intel_7505_setup
(
struct
pci_dev
*
pdev
)
{
agp_bridge
->
masks
=
intel_generic_masks
;
agp_bridge
->
aperture_sizes
=
(
void
*
)
intel_7505_sizes
;
agp_bridge
->
size_type
=
U16_APER_SIZE
;
agp_bridge
->
num_aperture_sizes
=
7
;
agp_bridge
->
dev_private_data
=
NULL
;
agp_bridge
->
needs_scratch_page
=
FALSE
;
agp_bridge
->
configure
=
intel_7505_configure
;
agp_bridge
->
fetch_size
=
intel_7505_fetch_size
;
agp_bridge
->
cleanup
=
intel_7505_cleanup
;
agp_bridge
->
tlb_flush
=
intel_7505_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
i7505_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
agp_bridge
->
insert_memory
=
agp_generic_insert_memory
;
agp_bridge
->
remove_memory
=
agp_generic_remove_memory
;
agp_bridge
->
alloc_by_type
=
agp_generic_alloc_by_type
;
agp_bridge
->
free_by_type
=
agp_generic_free_by_type
;
agp_bridge
->
agp_alloc_page
=
agp_generic_alloc_page
;
agp_bridge
->
agp_destroy_page
=
agp_generic_destroy_page
;
agp_bridge
->
suspend
=
agp_generic_suspend
;
agp_bridge
->
resume
=
agp_generic_resume
;
agp_bridge
->
cant_use_aperture
=
0
;
return
0
;
}
struct
agp_device_ids
i7x05_agp_device_ids
[]
__initdata
=
{
{
.
device_id
=
PCI_DEVICE_ID_INTEL_7505_0
,
.
chipset
=
INTEL_I7505
,
.
chipset_name
=
"i7505"
,
},
{
.
device_id
=
PCI_DEVICE_ID_INTEL_7205_0
,
.
chipset
=
INTEL_I7505
,
.
chipset_name
=
"i7205"
,
},
{
},
/* dummy final entry, always present */
};
/* scan table above for supported devices */
static
int
__init
agp_lookup_host_bridge
(
struct
pci_dev
*
pdev
)
{
int
j
=
0
;
struct
agp_device_ids
*
devs
;
devs
=
i7x05_agp_device_ids
;
while
(
devs
[
j
].
chipset_name
!=
NULL
)
{
if
(
pdev
->
device
==
devs
[
j
].
device_id
)
{
printk
(
KERN_INFO
PFX
"Detected Intel %s chipset
\n
"
,
devs
[
j
].
chipset_name
);
agp_bridge
->
type
=
devs
[
j
].
chipset
;
if
(
devs
[
j
].
chipset_setup
!=
NULL
)
return
devs
[
j
].
chipset_setup
(
pdev
);
else
return
intel_7505_setup
(
pdev
);
}
j
++
;
}
printk
(
KERN_ERR
PFX
"Unsupported Intel chipset (device id: %04x),"
,
pdev
->
device
);
return
-
ENODEV
;
}
static
struct
agp_driver
i7x05_agp_driver
=
{
.
owner
=
THIS_MODULE
;
};
static
int
__init
agp_i7x05_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
ent
)
{
u8
cap_ptr
=
0
;
cap_ptr
=
pci_find_capability
(
dev
,
PCI_CAP_ID_AGP
);
if
(
cap_ptr
==
0
)
return
-
ENODEV
;
if
(
agp_lookup_host_bridge
(
dev
)
!=
-
ENODEV
)
{
agp_bridge
->
dev
=
dev
;
agp_bridge
->
capndx
=
cap_ptr
;
/* Fill in the mode register */
pci_read_config_dword
(
agp_bridge
->
dev
,
agp_bridge
->
capndx
+
PCI_AGP_STATUS
,
&
agp_bridge
->
mode
)
i7x05_agp_driver
.
dev
=
dev
;
agp_register_driver
(
&
i7x05_agp_driver
);
return
0
;
}
return
-
ENODEV
;
}
static
struct
pci_device_id
agp_i7x05_pci_table
[]
__initdata
=
{
{
.
class
=
(
PCI_CLASS_BRIDGE_HOST
<<
8
),
.
class_mask
=
~
0
,
.
vendor
=
PCI_VENDOR_ID_INTEL
,
.
device
=
PCI_ANY_ID
,
.
subvendor
=
PCI_ANY_ID
,
.
subdevice
=
PCI_ANY_ID
,
},
{
}
};
MODULE_DEVICE_TABLE
(
pci
,
agp_i7x05_pci_table
);
static
struct
__initdata
pci_driver
agp_i7x05_pci_driver
=
{
.
name
=
"agpgart-i7x05"
,
.
id_table
=
agp_i7x05_pci_table
,
.
probe
=
agp_i7x05_probe
,
};
int
__init
agp_i7x05_init
(
void
)
{
int
ret_val
;
ret_val
=
pci_module_init
(
&
agp_i7x05_pci_driver
);
if
(
ret_val
)
agp_bridge
->
type
=
NOT_SUPPORTED
;
return
ret_val
;
}
static
void
__exit
agp_i7x05_cleanup
(
void
)
{
agp_unregister_driver
(
&
i7x05_agp_driver
);
pci_unregister_driver
(
&
agp_i7x05_pci_driver
);
}
module_init
(
agp_i7x05_init
);
module_exit
(
agp_i7x05_cleanup
);
MODULE_AUTHOR
(
"Matthew E Tolentino <matthew.e.tolentino@intel.com>"
);
MODULE_LICENSE
(
"GPL and additional rights"
);
drivers/char/agp/intel-agp.c
View file @
64a8617f
...
...
@@ -960,6 +960,34 @@ static int intel_830mp_configure(void)
return
0
;
}
static
int
intel_7505_configure
(
void
)
{
u32
temp
;
u16
temp2
;
struct
aper_size_info_8
*
current_size
;
current_size
=
A_SIZE_8
(
agp_bridge
->
current_size
);
/* aperture size */
pci_write_config_byte
(
agp_bridge
->
dev
,
INTEL_APSIZE
,
current_size
->
size_value
);
/* address to map to */
pci_read_config_dword
(
agp_bridge
->
dev
,
INTEL_APBASE
,
&
temp
);
agp_bridge
->
gart_bus_addr
=
(
temp
&
PCI_BASE_ADDRESS_MEM_MASK
);
/* attbase - aperture base */
pci_write_config_dword
(
agp_bridge
->
dev
,
INTEL_ATTBASE
,
agp_bridge
->
gatt_bus_addr
);
/* agpctrl */
pci_write_config_dword
(
agp_bridge
->
dev
,
INTEL_AGPCTRL
,
0x0000
);
/* mchcfg */
pci_read_config_word
(
agp_bridge
->
dev
,
INTEL_I7505_MCHCFG
,
&
temp2
);
pci_write_config_word
(
agp_bridge
->
dev
,
INTEL_I7505_MCHCFG
,
temp2
|
(
1
<<
9
));
return
0
;
}
static
unsigned
long
intel_mask_memory
(
unsigned
long
addr
,
int
type
)
{
/* Memory type is ignored */
...
...
@@ -1026,7 +1054,7 @@ static int __init intel_generic_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
intel_cleanup
;
agp_bridge
->
tlb_flush
=
intel_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
@@ -1055,7 +1083,7 @@ static int __init intel_815_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
intel_8xx_cleanup
;
agp_bridge
->
tlb_flush
=
intel_8xx_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
@@ -1085,7 +1113,7 @@ static int __init intel_820_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
intel_820_cleanup
;
agp_bridge
->
tlb_flush
=
intel_820_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
@@ -1114,7 +1142,7 @@ static int __init intel_830mp_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
intel_8xx_cleanup
;
agp_bridge
->
tlb_flush
=
intel_8xx_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
@@ -1143,7 +1171,7 @@ static int __init intel_840_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
intel_8xx_cleanup
;
agp_bridge
->
tlb_flush
=
intel_8xx_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
@@ -1172,7 +1200,7 @@ static int __init intel_845_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
intel_8xx_cleanup
;
agp_bridge
->
tlb_flush
=
intel_8xx_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
@@ -1201,7 +1229,7 @@ static int __init intel_850_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
intel_8xx_cleanup
;
agp_bridge
->
tlb_flush
=
intel_8xx_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
@@ -1230,7 +1258,7 @@ static int __init intel_860_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
intel_8xx_cleanup
;
agp_bridge
->
tlb_flush
=
intel_8xx_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
@@ -1246,6 +1274,34 @@ static int __init intel_860_setup (struct pci_dev *pdev)
return
0
;
}
static
int
__init
intel_7505_setup
(
struct
pci_dev
*
pdev
)
{
agp_bridge
->
masks
=
intel_generic_masks
;
agp_bridge
->
aperture_sizes
=
(
void
*
)
intel_8xx_sizes
;
agp_bridge
->
size_type
=
U8_APER_SIZE
;
agp_bridge
->
num_aperture_sizes
=
7
;
agp_bridge
->
dev_private_data
=
NULL
;
agp_bridge
->
needs_scratch_page
=
FALSE
;
agp_bridge
->
configure
=
intel_7505_configure
;
agp_bridge
->
fetch_size
=
intel_8xx_fetch_size
;
agp_bridge
->
cleanup
=
intel_8xx_cleanup
;
agp_bridge
->
tlb_flush
=
intel_8xx_tlbflush
;
agp_bridge
->
mask_memory
=
intel_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
agp_bridge
->
insert_memory
=
agp_generic_insert_memory
;
agp_bridge
->
remove_memory
=
agp_generic_remove_memory
;
agp_bridge
->
alloc_by_type
=
agp_generic_alloc_by_type
;
agp_bridge
->
free_by_type
=
agp_generic_free_by_type
;
agp_bridge
->
agp_alloc_page
=
agp_generic_alloc_page
;
agp_bridge
->
agp_destroy_page
=
agp_generic_destroy_page
;
agp_bridge
->
suspend
=
agp_generic_suspend
;
agp_bridge
->
resume
=
agp_generic_resume
;
agp_bridge
->
cant_use_aperture
=
0
;
return
0
;
}
struct
agp_device_ids
intel_agp_device_ids
[]
__initdata
=
{
{
...
...
@@ -1329,6 +1385,18 @@ struct agp_device_ids intel_agp_device_ids[] __initdata =
.
chipset_name
=
"865G"
,
.
chipset_setup
=
intel_845_setup
},
{
.
device_id
=
PCI_DEVICE_ID_INTEL_7505_0
,
.
chipset
=
INTEL_E7505
,
.
chipset_name
=
"E7505"
,
.
chipset_setup
=
intel_7505_setup
},
{
.
device_id
=
PCI_DEVICE_ID_INTEL_7205_0
,
.
chipset
=
INTEL_E7505
,
.
chipset_name
=
"E7205"
,
.
chipset_setup
=
intel_7505_setup
},
{
},
/* dummy final entry, always present */
};
...
...
drivers/char/agp/sis-agp.c
View file @
64a8617f
...
...
@@ -99,7 +99,7 @@ static int __init sis_generic_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
sis_cleanup
;
agp_bridge
->
tlb_flush
=
sis_tlbflush
;
agp_bridge
->
mask_memory
=
sis_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
drivers/char/agp/via-agp.c
View file @
64a8617f
...
...
@@ -101,7 +101,6 @@ static struct gatt_mask via_generic_masks[] =
};
#ifdef CONFIG_AGP3
static
int
via_fetch_size_agp3
(
void
)
{
int
i
;
...
...
@@ -186,7 +185,7 @@ static int __init via_generic_agp3_setup (struct pci_dev *pdev)
agp_bridge
->
num_aperture_sizes
=
10
;
agp_bridge
->
dev_private_data
=
NULL
;
agp_bridge
->
needs_scratch_page
=
FALSE
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_3_0_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
configure
=
via_configure_agp3
;
agp_bridge
->
fetch_size
=
via_fetch_size_agp3
;
agp_bridge
->
cleanup
=
via_cleanup_agp3
;
...
...
@@ -206,18 +205,10 @@ static int __init via_generic_agp3_setup (struct pci_dev *pdev)
agp_bridge
->
cant_use_aperture
=
0
;
return
0
;
}
#else
static
int
__init
via_generic_agp3_setup
(
struct
pci_dev
*
pdev
)
{
printk
(
KERN_INFO
PFX
"Bridge in AGP3 mode, but CONFIG_AGP3=n
\n
"
);
return
-
ENODEV
;
}
#endif
/* CONFIG_AGP3 */
static
int
__init
via_generic_setup
(
struct
pci_dev
*
pdev
)
{
#ifdef CONFIG_AGP3
/* Garg, there are KT400s with KT266 IDs. */
if
(
pdev
->
device
==
PCI_DEVICE_ID_VIA_8367_0
)
{
...
...
@@ -235,7 +226,6 @@ static int __init via_generic_setup (struct pci_dev *pdev)
/* Its in 2.0 mode, drop through. */
}
}
#endif
agp_bridge
->
masks
=
via_generic_masks
;
agp_bridge
->
aperture_sizes
=
(
void
*
)
via_generic_sizes
;
...
...
@@ -248,7 +238,7 @@ static int __init via_generic_setup (struct pci_dev *pdev)
agp_bridge
->
cleanup
=
via_cleanup
;
agp_bridge
->
tlb_flush
=
via_tlbflush
;
agp_bridge
->
mask_memory
=
via_mask_memory
;
agp_bridge
->
agp_enable
=
agp_generic_
agp_
enable
;
agp_bridge
->
agp_enable
=
agp_generic_enable
;
agp_bridge
->
cache_flush
=
global_cache_flush
;
agp_bridge
->
create_gatt_table
=
agp_generic_create_gatt_table
;
agp_bridge
->
free_gatt_table
=
agp_generic_free_gatt_table
;
...
...
@@ -319,10 +309,10 @@ static struct agp_device_ids via_agp_device_ids[] __initdata =
},
/* VT8361 */
/*
{
{
.
device_id
=
PCI_DEVICE_ID_VIA_8361
,
// 0x3112
.
chipset_name
=
"Apollo KLE133"
,
},
*/
},
/* VT8365 / VT8362 */
{
...
...
@@ -331,10 +321,10 @@ static struct agp_device_ids via_agp_device_ids[] __initdata =
},
/* VT8753A */
/*
{
.device_id = PCI_DEVICE_ID_VIA_8753_0,
// 0x3128
{
.
device_id
=
PCI_DEVICE_ID_VIA_8753_0
,
.
chipset_name
=
"P4X266"
,
},
*/
},
/* VT8366 */
{
...
...
@@ -349,16 +339,16 @@ static struct agp_device_ids via_agp_device_ids[] __initdata =
},
/* KM266 / PM266 */
/*
{
.device_id = PCI_DEVICE_ID_VIA_KM266,
// 0x3116
{
.
device_id
=
PCI_DEVICE_ID_VIA_KM266
,
.
chipset_name
=
"KM266/PM266"
,
},
*/
},
/* CLE266 */
/*
{
.device_id = PCI_DEVICE_ID_VIA_CLE266,
// 0x3123
{
.
device_id
=
PCI_DEVICE_ID_VIA_CLE266
,
.
chipset_name
=
"CLE266"
,
},
*/
},
{
.
device_id
=
PCI_DEVICE_ID_VIA_8377_0
,
...
...
@@ -374,16 +364,16 @@ static struct agp_device_ids via_agp_device_ids[] __initdata =
},
/* VT8752*/
/*
{
.device_id = PCI_DEVICE_ID_VIA_8752,
// 0x3148
{
.
device_id
=
PCI_DEVICE_ID_VIA_8752
,
.
chipset_name
=
"ProSavage DDR P4M266"
,
},
*/
},
/* KN266/PN266 */
/*
{
.device_id = PCI_DEVICE_ID_
KN266, // 0x3156
{
.
device_id
=
PCI_DEVICE_ID_
VIA_KN266
,
.
chipset_name
=
"KN266/PN266"
,
},
*/
},
/* VT8754 */
{
...
...
@@ -392,28 +382,28 @@ static struct agp_device_ids via_agp_device_ids[] __initdata =
},
/* P4N333 */
/*
{
.device_id = PCI_DEVICE_ID_VIA_P4N333,
// 0x3178
{
.
device_id
=
PCI_DEVICE_ID_VIA_P4N333
,
.
chipset_name
=
"P4N333"
,
},
*/
},
/* P4X600 */
/*
{
.device_id = PCI_DEVICE_ID_VIA_P4X600,
// 0x0198
{
.
device_id
=
PCI_DEVICE_ID_VIA_P4X600
,
.
chipset_name
=
"P4X600"
,
},
*/
},
/* KM400 */
/*
{
.device_id = PCI_DEVICE_ID_VIA_KM400,
// 0x3205
{
.
device_id
=
PCI_DEVICE_ID_VIA_KM400
,
.
chipset_name
=
"KM400"
,
},
*/
},
/* P4M400 */
/*
{
.device_id = PCI_DEVICE_ID_VIA_P4M400,
// 0x3209
{
.
device_id
=
PCI_DEVICE_ID_VIA_P4M400
,
.
chipset_name
=
"PM400"
,
},
*/
},
{
},
/* dummy final entry, always present */
};
...
...
drivers/char/drm/drmP.h
View file @
64a8617f
...
...
@@ -246,7 +246,7 @@ static inline struct page * vmalloc_to_page(void * vmalloc_addr)
do { \
struct list_head *_list; \
list_for_each( _list, &dev->maplist->head ) { \
drm_map_list_t *_entry =
(drm_map_list_t *)_list
; \
drm_map_list_t *_entry =
list_entry( _list, drm_map_list_t, head )
; \
if ( _entry->map && \
_entry->map->offset == (_o) ) { \
(_map) = _entry->map; \
...
...
drivers/char/drm/drm_bufs.h
View file @
64a8617f
...
...
@@ -106,7 +106,7 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
switch
(
map
->
type
)
{
case
_DRM_REGISTERS
:
case
_DRM_FRAME_BUFFER
:
#if !defined(__sparc__) && !defined(__alpha__)
#if !defined(__sparc__) && !defined(__alpha__)
&& !defined(__ia64__)
if
(
map
->
offset
+
map
->
size
<
map
->
offset
||
map
->
offset
<
virt_to_phys
(
high_memory
)
)
{
DRM
(
free
)(
map
,
sizeof
(
*
map
),
DRM_MEM_MAPS
);
...
...
@@ -210,7 +210,7 @@ int DRM(rmmap)(struct inode *inode, struct file *filp,
down
(
&
dev
->
struct_sem
);
list
=
&
dev
->
maplist
->
head
;
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
r_list
=
(
drm_map_list_t
*
)
list
;
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
if
(
r_list
->
map
&&
r_list
->
map
->
handle
==
request
.
handle
&&
...
...
drivers/char/drm/drm_context.h
View file @
64a8617f
...
...
@@ -194,7 +194,7 @@ int DRM(setsareactx)(struct inode *inode, struct file *filp,
down
(
&
dev
->
struct_sem
);
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
r_list
=
(
drm_map_list_t
*
)
list
;
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
if
(
r_list
->
map
&&
r_list
->
map
->
handle
==
request
.
handle
)
goto
found
;
...
...
drivers/char/drm/drm_dma.h
View file @
64a8617f
...
...
@@ -444,7 +444,7 @@ static int DRM(dma_get_buffers_of_order)(struct file *filp, drm_dma_t *d,
d
->
flags
&
_DRM_DMA_WAIT
);
if
(
!
buf
)
break
;
if
(
buf
->
pending
||
buf
->
waiting
)
{
DRM_ERROR
(
"Free buffer %d in use
by %x
(w%d, p%d)
\n
"
,
DRM_ERROR
(
"Free buffer %d in use
: filp %p
(w%d, p%d)
\n
"
,
buf
->
idx
,
buf
->
filp
,
buf
->
waiting
,
...
...
@@ -651,7 +651,7 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
* for the same vblank sequence number; nothing to be done in
* that case
*/
list_for_each
(
(
(
struct
list_head
*
)
vbl_sig
),
&
dev
->
vbl_sigs
.
head
)
{
list_for_each
_entry
(
vbl_sig
,
&
dev
->
vbl_sigs
.
head
,
head
)
{
if
(
vbl_sig
->
sequence
==
vblwait
.
request
.
sequence
&&
vbl_sig
->
info
.
si_signo
==
vblwait
.
request
.
signal
&&
vbl_sig
->
task
==
current
)
...
...
@@ -702,19 +702,20 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
void
DRM
(
vbl_send_signals
)(
drm_device_t
*
dev
)
{
struct
list_head
*
tmp
;
struct
list_head
*
list
,
*
tmp
;
drm_vbl_sig_t
*
vbl_sig
;
unsigned
int
vbl_seq
=
atomic_read
(
&
dev
->
vbl_received
);
unsigned
long
flags
;
spin_lock_irqsave
(
&
dev
->
vbl_lock
,
flags
);
list_for_each_safe
(
(
(
struct
list_head
*
)
vbl_sig
),
tmp
,
&
dev
->
vbl_sigs
.
head
)
{
list_for_each_safe
(
list
,
tmp
,
&
dev
->
vbl_sigs
.
head
)
{
vbl_sig
=
list_entry
(
list
,
drm_vbl_sig_t
,
head
);
if
(
(
vbl_seq
-
vbl_sig
->
sequence
)
<=
(
1
<<
23
)
)
{
vbl_sig
->
info
.
si_code
=
vbl_seq
;
send_sig_info
(
vbl_sig
->
info
.
si_signo
,
&
vbl_sig
->
info
,
vbl_sig
->
task
);
list_del
(
(
struct
list_head
*
)
vbl_sig
);
list_del
(
list
);
DRM_FREE
(
vbl_sig
,
sizeof
(
*
vbl_sig
)
);
...
...
drivers/char/drm/drm_ioctl.h
View file @
64a8617f
...
...
@@ -204,7 +204,7 @@ int DRM(getmap)( struct inode *inode, struct file *filp,
i
=
0
;
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
if
(
i
==
idx
)
{
r_list
=
(
drm_map_list_t
*
)
list
;
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
break
;
}
i
++
;
...
...
drivers/char/drm/drm_os_linux.h
View file @
64a8617f
...
...
@@ -46,9 +46,8 @@
#define DRM_GETSAREA() \
do { \
struct list_head *list; \
list_for_each( list, &dev->maplist->head ) { \
drm_map_list_t *entry = (drm_map_list_t *)list; \
drm_map_list_t *entry; \
list_for_each_entry( entry, &dev->maplist->head, head ) { \
if ( entry->map && \
entry->map->type == _DRM_SHM && \
(entry->map->flags & _DRM_CONTAINS_LOCK) ) { \
...
...
@@ -70,7 +69,7 @@ do { \
current->state = TASK_INTERRUPTIBLE; \
if (condition) \
break; \
if
((signed)(end - jiffies) <= 0) {
\
if
(time_after_eq(jiffies, end)) {
\
ret = -EBUSY; \
break; \
} \
...
...
drivers/char/drm/drm_proc.h
View file @
64a8617f
...
...
@@ -168,9 +168,9 @@ static int DRM(_vm_info)(char *buf, char **start, off_t offset, int request,
struct
list_head
*
list
;
/* Hardcoded from _DRM_FRAME_BUFFER,
_DRM_REGISTERS, _DRM_SHM, and
_DRM_
AGP
. */
const
char
*
types
[]
=
{
"FB"
,
"REG"
,
"SHM"
,
"AGP"
};
_DRM_REGISTERS, _DRM_SHM,
_DRM_AGP,
and
_DRM_
SCATTER_GATHER
. */
const
char
*
types
[]
=
{
"FB"
,
"REG"
,
"SHM"
,
"AGP"
,
"SG"
};
const
char
*
type
;
int
i
;
...
...
@@ -186,10 +186,10 @@ static int DRM(_vm_info)(char *buf, char **start, off_t offset, int request,
"address mtrr
\n\n
"
);
i
=
0
;
if
(
dev
->
maplist
!=
NULL
)
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
r_list
=
(
drm_map_list_t
*
)
list
;
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
map
=
r_list
->
map
;
if
(
!
map
)
continue
;
if
(
map
->
type
<
0
||
map
->
type
>
3
)
type
=
"??"
;
if
(
map
->
type
<
0
||
map
->
type
>
4
)
type
=
"??"
;
else
type
=
types
[
map
->
type
];
DRM_PROC_PRINT
(
"%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08lx "
,
i
,
...
...
drivers/char/drm/drm_vm.h
View file @
64a8617f
...
...
@@ -73,7 +73,7 @@ struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
if
(
!
dev
->
agp
||
!
dev
->
agp
->
cant_use_aperture
)
goto
vm_nopage_error
;
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
r_list
=
(
drm_map_list_t
*
)
list
;
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
map
=
r_list
->
map
;
if
(
!
map
)
continue
;
if
(
map
->
offset
==
VM_OFFSET
(
vma
))
break
;
...
...
@@ -189,7 +189,7 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma)
found_maps
=
0
;
list
=
&
dev
->
maplist
->
head
;
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
r_list
=
(
drm_map_list_t
*
)
list
;
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
if
(
r_list
->
map
==
map
)
found_maps
++
;
}
...
...
@@ -392,7 +392,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
unsigned
long
off
;
r_list
=
(
drm_map_list_t
*
)
list
;
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
map
=
r_list
->
map
;
if
(
!
map
)
continue
;
off
=
DRIVER_GET_MAP_OFS
();
...
...
drivers/char/drm/gamma_dma.c
View file @
64a8617f
...
...
@@ -605,7 +605,7 @@ static int gamma_do_init_dma( drm_device_t *dev, drm_gamma_init_t *init )
memset
(
dev_priv
,
0
,
sizeof
(
drm_gamma_private_t
)
);
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
drm_map_list_t
*
r_list
=
(
drm_map_list_t
*
)
list
;
drm_map_list_t
*
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
if
(
r_list
->
map
&&
r_list
->
map
->
type
==
_DRM_SHM
&&
r_list
->
map
->
flags
&
_DRM_CONTAINS_LOCK
)
{
...
...
@@ -809,7 +809,7 @@ int gamma_setsareactx(struct inode *inode, struct file *filp,
down
(
&
dev
->
struct_sem
);
r_list
=
NULL
;
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
r_list
=
(
drm_map_list_t
*
)
list
;
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
if
(
r_list
->
map
&&
r_list
->
map
->
handle
==
request
.
handle
)
break
;
}
...
...
drivers/char/drm/i810_dma.c
View file @
64a8617f
...
...
@@ -340,7 +340,7 @@ static int i810_dma_initialize(drm_device_t *dev,
memset
(
dev_priv
,
0
,
sizeof
(
drm_i810_private_t
));
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
drm_map_list_t
*
r_list
=
(
drm_map_list_t
*
)
list
;
drm_map_list_t
*
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
if
(
r_list
->
map
&&
r_list
->
map
->
type
==
_DRM_SHM
&&
r_list
->
map
->
flags
&
_DRM_CONTAINS_LOCK
)
{
...
...
drivers/char/drm/i830_dma.c
View file @
64a8617f
...
...
@@ -363,7 +363,7 @@ static int i830_dma_initialize(drm_device_t *dev,
memset
(
dev_priv
,
0
,
sizeof
(
drm_i830_private_t
));
list_for_each
(
list
,
&
dev
->
maplist
->
head
)
{
drm_map_list_t
*
r_list
=
(
drm_map_list_t
*
)
list
;
drm_map_list_t
*
r_list
=
list_entry
(
list
,
drm_map_list_t
,
head
)
;
if
(
r_list
->
map
&&
r_list
->
map
->
type
==
_DRM_SHM
&&
r_list
->
map
->
flags
&
_DRM_CONTAINS_LOCK
)
{
...
...
fs/read_write.c
View file @
64a8617f
...
...
@@ -135,7 +135,7 @@ asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
#if !defined(__alpha__)
asmlinkage
long
sys_llseek
(
unsigned
int
fd
,
unsigned
long
offset_high
,
unsigned
long
offset_low
,
loff_t
*
result
,
unsigned
long
offset_low
,
loff_t
__user
*
result
,
unsigned
int
origin
)
{
int
retval
;
...
...
@@ -167,7 +167,7 @@ asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
}
#endif
ssize_t
do_sync_read
(
struct
file
*
filp
,
char
*
buf
,
size_t
len
,
loff_t
*
ppos
)
ssize_t
do_sync_read
(
struct
file
*
filp
,
char
__user
*
buf
,
size_t
len
,
loff_t
*
ppos
)
{
struct
kiocb
kiocb
;
ssize_t
ret
;
...
...
@@ -181,7 +181,7 @@ ssize_t do_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos)
return
ret
;
}
ssize_t
vfs_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
pos
)
ssize_t
vfs_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
ssize_t
ret
;
...
...
@@ -207,7 +207,7 @@ ssize_t vfs_read(struct file *file, char *buf, size_t count, loff_t *pos)
return
ret
;
}
ssize_t
do_sync_write
(
struct
file
*
filp
,
const
char
*
buf
,
size_t
len
,
loff_t
*
ppos
)
ssize_t
do_sync_write
(
struct
file
*
filp
,
const
char
__user
*
buf
,
size_t
len
,
loff_t
*
ppos
)
{
struct
kiocb
kiocb
;
ssize_t
ret
;
...
...
@@ -221,7 +221,7 @@ ssize_t do_sync_write(struct file *filp, const char *buf, size_t len, loff_t *pp
return
ret
;
}
ssize_t
vfs_write
(
struct
file
*
file
,
const
char
*
buf
,
size_t
count
,
loff_t
*
pos
)
ssize_t
vfs_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
ssize_t
ret
;
...
...
@@ -247,7 +247,7 @@ ssize_t vfs_write(struct file *file, const char *buf, size_t count, loff_t *pos)
return
ret
;
}
asmlinkage
ssize_t
sys_read
(
unsigned
int
fd
,
char
*
buf
,
size_t
count
)
asmlinkage
ssize_t
sys_read
(
unsigned
int
fd
,
char
__user
*
buf
,
size_t
count
)
{
struct
file
*
file
;
ssize_t
ret
=
-
EBADF
;
...
...
@@ -261,7 +261,7 @@ asmlinkage ssize_t sys_read(unsigned int fd, char * buf, size_t count)
return
ret
;
}
asmlinkage
ssize_t
sys_write
(
unsigned
int
fd
,
const
char
*
buf
,
size_t
count
)
asmlinkage
ssize_t
sys_write
(
unsigned
int
fd
,
const
char
__user
*
buf
,
size_t
count
)
{
struct
file
*
file
;
ssize_t
ret
=
-
EBADF
;
...
...
@@ -275,7 +275,7 @@ asmlinkage ssize_t sys_write(unsigned int fd, const char * buf, size_t count)
return
ret
;
}
asmlinkage
ssize_t
sys_pread64
(
unsigned
int
fd
,
char
*
buf
,
asmlinkage
ssize_t
sys_pread64
(
unsigned
int
fd
,
char
__user
*
buf
,
size_t
count
,
loff_t
pos
)
{
struct
file
*
file
;
...
...
@@ -293,7 +293,7 @@ asmlinkage ssize_t sys_pread64(unsigned int fd, char *buf,
return
ret
;
}
asmlinkage
ssize_t
sys_pwrite64
(
unsigned
int
fd
,
const
char
*
buf
,
asmlinkage
ssize_t
sys_pwrite64
(
unsigned
int
fd
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
pos
)
{
struct
file
*
file
;
...
...
@@ -332,7 +332,7 @@ unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to)
}
static
ssize_t
do_readv_writev
(
int
type
,
struct
file
*
file
,
const
struct
iovec
*
vector
,
const
struct
iovec
__user
*
u
vector
,
unsigned
long
nr_segs
,
loff_t
*
pos
)
{
typedef
ssize_t
(
*
io_fn_t
)(
struct
file
*
,
char
*
,
size_t
,
loff_t
*
);
...
...
@@ -340,7 +340,7 @@ static ssize_t do_readv_writev(int type, struct file *file,
size_t
tot_len
;
struct
iovec
iovstack
[
UIO_FASTIOV
];
struct
iovec
*
iov
=
iovstack
;
struct
iovec
*
iov
=
iovstack
,
*
vector
;
ssize_t
ret
;
int
seg
;
io_fn_t
fn
;
...
...
@@ -372,7 +372,7 @@ static ssize_t do_readv_writev(int type, struct file *file,
goto
out
;
}
ret
=
-
EFAULT
;
if
(
copy_from_user
(
iov
,
vector
,
nr_segs
*
sizeof
(
*
vector
)))
if
(
copy_from_user
(
iov
,
uvector
,
nr_segs
*
sizeof
(
*
u
vector
)))
goto
out
;
/*
...
...
@@ -451,7 +451,7 @@ static ssize_t do_readv_writev(int type, struct file *file,
return
ret
;
}
ssize_t
vfs_readv
(
struct
file
*
file
,
const
struct
iovec
*
vec
,
ssize_t
vfs_readv
(
struct
file
*
file
,
const
struct
iovec
__user
*
vec
,
unsigned
long
vlen
,
loff_t
*
pos
)
{
if
(
!
(
file
->
f_mode
&
FMODE_READ
))
...
...
@@ -462,7 +462,7 @@ ssize_t vfs_readv(struct file *file, const struct iovec *vec,
return
do_readv_writev
(
READ
,
file
,
vec
,
vlen
,
pos
);
}
ssize_t
vfs_writev
(
struct
file
*
file
,
const
struct
iovec
*
vec
,
ssize_t
vfs_writev
(
struct
file
*
file
,
const
struct
iovec
__user
*
vec
,
unsigned
long
vlen
,
loff_t
*
pos
)
{
if
(
!
(
file
->
f_mode
&
FMODE_WRITE
))
...
...
@@ -475,7 +475,7 @@ ssize_t vfs_writev(struct file *file, const struct iovec *vec,
asmlinkage
ssize_t
sys_readv
(
unsigned
long
fd
,
const
struct
iovec
*
vec
,
unsigned
long
vlen
)
sys_readv
(
unsigned
long
fd
,
const
struct
iovec
__user
*
vec
,
unsigned
long
vlen
)
{
struct
file
*
file
;
ssize_t
ret
=
-
EBADF
;
...
...
@@ -490,7 +490,7 @@ sys_readv(unsigned long fd, const struct iovec *vec, unsigned long vlen)
}
asmlinkage
ssize_t
sys_writev
(
unsigned
long
fd
,
const
struct
iovec
*
vec
,
unsigned
long
vlen
)
sys_writev
(
unsigned
long
fd
,
const
struct
iovec
__user
*
vec
,
unsigned
long
vlen
)
{
struct
file
*
file
;
ssize_t
ret
=
-
EBADF
;
...
...
@@ -586,7 +586,7 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
return
retval
;
}
asmlinkage
ssize_t
sys_sendfile
(
int
out_fd
,
int
in_fd
,
off_t
*
offset
,
size_t
count
)
asmlinkage
ssize_t
sys_sendfile
(
int
out_fd
,
int
in_fd
,
off_t
__user
*
offset
,
size_t
count
)
{
loff_t
pos
;
off_t
off
;
...
...
@@ -605,7 +605,7 @@ asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t cou
return
do_sendfile
(
out_fd
,
in_fd
,
NULL
,
count
,
MAX_NON_LFS
);
}
asmlinkage
ssize_t
sys_sendfile64
(
int
out_fd
,
int
in_fd
,
loff_t
*
offset
,
size_t
count
)
asmlinkage
ssize_t
sys_sendfile64
(
int
out_fd
,
int
in_fd
,
loff_t
__user
*
offset
,
size_t
count
)
{
loff_t
pos
;
ssize_t
ret
;
...
...
fs/stat.c
View file @
64a8617f
...
...
@@ -56,7 +56,7 @@ int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
return
0
;
}
int
vfs_stat
(
char
*
name
,
struct
kstat
*
stat
)
int
vfs_stat
(
char
__user
*
name
,
struct
kstat
*
stat
)
{
struct
nameidata
nd
;
int
error
;
...
...
@@ -69,7 +69,7 @@ int vfs_stat(char *name, struct kstat *stat)
return
error
;
}
int
vfs_lstat
(
char
*
name
,
struct
kstat
*
stat
)
int
vfs_lstat
(
char
__user
*
name
,
struct
kstat
*
stat
)
{
struct
nameidata
nd
;
int
error
;
...
...
@@ -102,7 +102,7 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
* For backward compatibility? Maybe this should be moved
* into arch/i386 instead?
*/
static
int
cp_old_stat
(
struct
kstat
*
stat
,
struct
__old_kernel_stat
*
statbuf
)
static
int
cp_old_stat
(
struct
kstat
*
stat
,
struct
__old_kernel_stat
__user
*
statbuf
)
{
static
int
warncount
=
5
;
struct
__old_kernel_stat
tmp
;
...
...
@@ -134,7 +134,7 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat * statbuf)
return
copy_to_user
(
statbuf
,
&
tmp
,
sizeof
(
tmp
))
?
-
EFAULT
:
0
;
}
asmlinkage
long
sys_stat
(
char
*
filename
,
struct
__old_kernel_stat
*
statbuf
)
asmlinkage
long
sys_stat
(
char
__user
*
filename
,
struct
__old_kernel_stat
__user
*
statbuf
)
{
struct
kstat
stat
;
int
error
=
vfs_stat
(
filename
,
&
stat
);
...
...
@@ -144,7 +144,7 @@ asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
return
error
;
}
asmlinkage
long
sys_lstat
(
char
*
filename
,
struct
__old_kernel_stat
*
statbuf
)
asmlinkage
long
sys_lstat
(
char
__user
*
filename
,
struct
__old_kernel_stat
__user
*
statbuf
)
{
struct
kstat
stat
;
int
error
=
vfs_lstat
(
filename
,
&
stat
);
...
...
@@ -154,7 +154,7 @@ asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
return
error
;
}
asmlinkage
long
sys_fstat
(
unsigned
int
fd
,
struct
__old_kernel_stat
*
statbuf
)
asmlinkage
long
sys_fstat
(
unsigned
int
fd
,
struct
__old_kernel_stat
__user
*
statbuf
)
{
struct
kstat
stat
;
int
error
=
vfs_fstat
(
fd
,
&
stat
);
...
...
@@ -167,7 +167,7 @@ asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat * statbuf)
#endif
static
int
cp_new_stat
(
struct
kstat
*
stat
,
struct
stat
*
statbuf
)
static
int
cp_new_stat
(
struct
kstat
*
stat
,
struct
stat
__user
*
statbuf
)
{
struct
stat
tmp
;
...
...
@@ -197,7 +197,7 @@ static int cp_new_stat(struct kstat *stat, struct stat *statbuf)
return
copy_to_user
(
statbuf
,
&
tmp
,
sizeof
(
tmp
))
?
-
EFAULT
:
0
;
}
asmlinkage
long
sys_newstat
(
char
*
filename
,
struct
stat
*
statbuf
)
asmlinkage
long
sys_newstat
(
char
__user
*
filename
,
struct
stat
__user
*
statbuf
)
{
struct
kstat
stat
;
int
error
=
vfs_stat
(
filename
,
&
stat
);
...
...
@@ -207,7 +207,7 @@ asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
return
error
;
}
asmlinkage
long
sys_newlstat
(
char
*
filename
,
struct
stat
*
statbuf
)
asmlinkage
long
sys_newlstat
(
char
__user
*
filename
,
struct
stat
__user
*
statbuf
)
{
struct
kstat
stat
;
int
error
=
vfs_lstat
(
filename
,
&
stat
);
...
...
@@ -217,7 +217,7 @@ asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
return
error
;
}
asmlinkage
long
sys_newfstat
(
unsigned
int
fd
,
struct
stat
*
statbuf
)
asmlinkage
long
sys_newfstat
(
unsigned
int
fd
,
struct
stat
__user
*
statbuf
)
{
struct
kstat
stat
;
int
error
=
vfs_fstat
(
fd
,
&
stat
);
...
...
@@ -228,7 +228,7 @@ asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf)
return
error
;
}
asmlinkage
long
sys_readlink
(
const
char
*
path
,
cha
r
*
buf
,
int
bufsiz
)
asmlinkage
long
sys_readlink
(
const
char
__user
*
path
,
char
__use
r
*
buf
,
int
bufsiz
)
{
struct
nameidata
nd
;
int
error
;
...
...
@@ -257,7 +257,7 @@ asmlinkage long sys_readlink(const char * path, char * buf, int bufsiz)
/* ---------- LFS-64 ----------- */
#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips64) && !defined(__x86_64__) && !defined(CONFIG_ARCH_S390X)
static
long
cp_new_stat64
(
struct
kstat
*
stat
,
struct
stat64
*
statbuf
)
static
long
cp_new_stat64
(
struct
kstat
*
stat
,
struct
stat64
__user
*
statbuf
)
{
struct
stat64
tmp
;
...
...
@@ -284,7 +284,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 *statbuf)
return
copy_to_user
(
statbuf
,
&
tmp
,
sizeof
(
tmp
))
?
-
EFAULT
:
0
;
}
asmlinkage
long
sys_stat64
(
char
*
filename
,
struct
stat64
*
statbuf
,
long
flags
)
asmlinkage
long
sys_stat64
(
char
__user
*
filename
,
struct
stat64
__user
*
statbuf
,
long
flags
)
{
struct
kstat
stat
;
int
error
=
vfs_stat
(
filename
,
&
stat
);
...
...
@@ -294,7 +294,7 @@ asmlinkage long sys_stat64(char * filename, struct stat64 * statbuf, long flags)
return
error
;
}
asmlinkage
long
sys_lstat64
(
char
*
filename
,
struct
stat64
*
statbuf
,
long
flags
)
asmlinkage
long
sys_lstat64
(
char
__user
*
filename
,
struct
stat64
__user
*
statbuf
,
long
flags
)
{
struct
kstat
stat
;
int
error
=
vfs_lstat
(
filename
,
&
stat
);
...
...
@@ -304,7 +304,7 @@ asmlinkage long sys_lstat64(char * filename, struct stat64 * statbuf, long flags
return
error
;
}
asmlinkage
long
sys_fstat64
(
unsigned
long
fd
,
struct
stat64
*
statbuf
,
long
flags
)
asmlinkage
long
sys_fstat64
(
unsigned
long
fd
,
struct
stat64
__user
*
statbuf
,
long
flags
)
{
struct
kstat
stat
;
int
error
=
vfs_fstat
(
fd
,
&
stat
);
...
...
include/linux/agp_backend.h
View file @
64a8617f
...
...
@@ -53,7 +53,7 @@ enum chipset_type {
INTEL_I850
,
INTEL_I860
,
INTEL_460GX
,
INTEL_
I
7505
,
INTEL_
E
7505
,
VIA_GENERIC
,
SIS_GENERIC
,
AMD_GENERIC
,
...
...
include/linux/fs.h
View file @
64a8617f
...
...
@@ -705,10 +705,10 @@ typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, u
struct
file_operations
{
struct
module
*
owner
;
loff_t
(
*
llseek
)
(
struct
file
*
,
loff_t
,
int
);
ssize_t
(
*
read
)
(
struct
file
*
,
char
*
,
size_t
,
loff_t
*
);
ssize_t
(
*
aio_read
)
(
struct
kiocb
*
,
char
*
,
size_t
,
loff_t
);
ssize_t
(
*
write
)
(
struct
file
*
,
const
char
*
,
size_t
,
loff_t
*
);
ssize_t
(
*
aio_write
)
(
struct
kiocb
*
,
const
char
*
,
size_t
,
loff_t
);
ssize_t
(
*
read
)
(
struct
file
*
,
char
__user
*
,
size_t
,
loff_t
*
);
ssize_t
(
*
aio_read
)
(
struct
kiocb
*
,
char
__user
*
,
size_t
,
loff_t
);
ssize_t
(
*
write
)
(
struct
file
*
,
const
char
__user
*
,
size_t
,
loff_t
*
);
ssize_t
(
*
aio_write
)
(
struct
kiocb
*
,
const
char
__user
*
,
size_t
,
loff_t
);
int
(
*
readdir
)
(
struct
file
*
,
void
*
,
filldir_t
);
unsigned
int
(
*
poll
)
(
struct
file
*
,
struct
poll_table_struct
*
);
int
(
*
ioctl
)
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
);
...
...
@@ -738,7 +738,7 @@ struct inode_operations {
int
(
*
mknod
)
(
struct
inode
*
,
struct
dentry
*
,
int
,
dev_t
);
int
(
*
rename
)
(
struct
inode
*
,
struct
dentry
*
,
struct
inode
*
,
struct
dentry
*
);
int
(
*
readlink
)
(
struct
dentry
*
,
char
*
,
int
);
int
(
*
readlink
)
(
struct
dentry
*
,
char
__user
*
,
int
);
int
(
*
follow_link
)
(
struct
dentry
*
,
struct
nameidata
*
);
void
(
*
truncate
)
(
struct
inode
*
);
int
(
*
permission
)
(
struct
inode
*
,
int
);
...
...
include/linux/pci_ids.h
View file @
64a8617f
...
...
@@ -1074,6 +1074,7 @@
#define PCI_DEVICE_ID_TTI_HPT374 0x0008
#define PCI_VENDOR_ID_VIA 0x1106
#define PCI_DEVICE_ID_VIA_P4X600 0x0198
#define PCI_DEVICE_ID_VIA_8363_0 0x0305
#define PCI_DEVICE_ID_VIA_8371_0 0x0391
#define PCI_DEVICE_ID_VIA_8501_0 0x0501
...
...
@@ -1114,10 +1115,18 @@
#define PCI_DEVICE_ID_VIA_8622 0x3102
#define PCI_DEVICE_ID_VIA_8233C_0 0x3109
#define PCI_DEVICE_ID_VIA_8361 0x3112
#define PCI_DEVICE_ID_VIA_KM266 0x3116
#define PCI_DEVICE_ID_VIA_CLE266 0x3123
#define PCI_DEVICE_ID_VIA_8753_0 0x3128
#define PCI_DEVICE_ID_VIA_8233A 0x3147
#define PCI_DEVICE_ID_VIA_8752 0x3148
#define PCI_DEVICE_ID_VIA_KN266 0x3156
#define PCI_DEVICE_ID_VIA_8754 0x3168
#define PCI_DEVICE_ID_VIA_8235 0x3177
#define PCI_DEVICE_ID_VIA_P4N333 0x3178
#define PCI_DEVICE_ID_VIA_8377_0 0x3189
#define PCI_DEVICE_ID_VIA_KM400 0x3205
#define PCI_DEVICE_ID_VIA_P4M400 0x3209
#define PCI_DEVICE_ID_VIA_86C100A 0x6100
#define PCI_DEVICE_ID_VIA_8231 0x8231
#define PCI_DEVICE_ID_VIA_8231_4 0x8235
...
...
include/linux/sysctl.h
View file @
64a8617f
...
...
@@ -679,8 +679,8 @@ extern void sysctl_init(void);
typedef
struct
ctl_table
ctl_table
;
typedef
int
ctl_handler
(
ctl_table
*
table
,
int
*
name
,
int
nlen
,
void
*
oldval
,
size_t
*
oldlenp
,
void
*
newval
,
size_t
newlen
,
void
__user
*
oldval
,
size_t
__user
*
oldlenp
,
void
__user
*
newval
,
size_t
newlen
,
void
**
context
);
typedef
int
proc_handler
(
ctl_table
*
ctl
,
int
write
,
struct
file
*
filp
,
...
...
@@ -707,8 +707,8 @@ extern int do_sysctl (int *name, int nlen,
extern
int
do_sysctl_strategy
(
ctl_table
*
table
,
int
*
name
,
int
nlen
,
void
*
oldval
,
size_t
*
oldlenp
,
void
*
newval
,
size_t
newlen
,
void
**
context
);
void
__user
*
oldval
,
size_t
__user
*
oldlenp
,
void
__user
*
newval
,
size_t
newlen
,
void
**
context
);
extern
ctl_handler
sysctl_string
;
extern
ctl_handler
sysctl_intvec
;
...
...
kernel/futex.c
View file @
64a8617f
...
...
@@ -448,7 +448,7 @@ long do_futex(unsigned long uaddr, int op, int val, unsigned long timeout)
return
ret
;
}
asmlinkage
long
sys_futex
(
u32
*
uaddr
,
int
op
,
int
val
,
struct
timespec
*
utime
)
asmlinkage
long
sys_futex
(
u32
__user
*
uaddr
,
int
op
,
int
val
,
struct
timespec
__user
*
utime
)
{
struct
timespec
t
;
unsigned
long
timeout
=
MAX_SCHEDULE_TIMEOUT
;
...
...
kernel/itimer.c
View file @
64a8617f
...
...
@@ -48,7 +48,7 @@ int do_getitimer(int which, struct itimerval *value)
}
/* SMP: Only we modify our itimer values. */
asmlinkage
long
sys_getitimer
(
int
which
,
struct
itimerval
*
value
)
asmlinkage
long
sys_getitimer
(
int
which
,
struct
itimerval
__user
*
value
)
{
int
error
=
-
EFAULT
;
struct
itimerval
get_buffer
;
...
...
@@ -120,8 +120,9 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
/* SMP: Again, only we play with our itimers, and signals are SMP safe
* now so that is not an issue at all anymore.
*/
asmlinkage
long
sys_setitimer
(
int
which
,
struct
itimerval
*
value
,
struct
itimerval
*
ovalue
)
asmlinkage
long
sys_setitimer
(
int
which
,
struct
itimerval
__user
*
value
,
struct
itimerval
__user
*
ovalue
)
{
struct
itimerval
set_buffer
,
get_buffer
;
int
error
;
...
...
kernel/posix-timers.c
View file @
64a8617f
...
...
@@ -341,7 +341,7 @@ static void posix_timer_fn(unsigned long __data)
* Here we define a mask to get rid of the common bits. The
* optimizer should make this costless to all but mips.
*/
#if
(ARCH == mips) || (ARCH == mips64
)
#if
defined(ARCH) && ((ARCH == mips) || (ARCH == mips64)
)
#define MIPS_SIGEV ~(SIGEV_NONE & \
SIGEV_SIGNAL & \
SIGEV_THREAD & \
...
...
@@ -402,7 +402,8 @@ static void release_posix_timer(struct k_itimer *tmr)
asmlinkage
long
sys_timer_create
(
clockid_t
which_clock
,
struct
sigevent
*
timer_event_spec
,
timer_t
*
created_timer_id
)
struct
sigevent
__user
*
timer_event_spec
,
timer_t
__user
*
created_timer_id
)
{
int
error
=
0
;
struct
k_itimer
*
new_timer
=
NULL
;
...
...
@@ -623,7 +624,7 @@ do_timer_gettime(struct k_itimer *timr, struct itimerspec *cur_setting)
/* Get the time remaining on a POSIX.1b interval timer. */
asmlinkage
long
sys_timer_gettime
(
timer_t
timer_id
,
struct
itimerspec
*
setting
)
sys_timer_gettime
(
timer_t
timer_id
,
struct
itimerspec
__user
*
setting
)
{
struct
k_itimer
*
timr
;
struct
itimerspec
cur_setting
;
...
...
@@ -801,8 +802,8 @@ do_timer_settime(struct k_itimer *timr, int flags,
/* Set a POSIX.1b interval timer */
asmlinkage
long
sys_timer_settime
(
timer_t
timer_id
,
int
flags
,
const
struct
itimerspec
*
new_setting
,
struct
itimerspec
*
old_setting
)
const
struct
itimerspec
__user
*
new_setting
,
struct
itimerspec
__user
*
old_setting
)
{
struct
k_itimer
*
timr
;
struct
itimerspec
new_spec
,
old_spec
;
...
...
@@ -985,7 +986,7 @@ int do_posix_clock_monotonic_settime(struct timespec *tp)
}
asmlinkage
long
sys_clock_settime
(
clockid_t
which_clock
,
const
struct
timespec
*
tp
)
sys_clock_settime
(
clockid_t
which_clock
,
const
struct
timespec
__user
*
tp
)
{
struct
timespec
new_tp
;
...
...
@@ -1002,7 +1003,7 @@ sys_clock_settime(clockid_t which_clock, const struct timespec *tp)
}
asmlinkage
long
sys_clock_gettime
(
clockid_t
which_clock
,
struct
timespec
*
tp
)
sys_clock_gettime
(
clockid_t
which_clock
,
struct
timespec
__user
*
tp
)
{
struct
timespec
rtn_tp
;
int
error
=
0
;
...
...
@@ -1021,7 +1022,7 @@ sys_clock_gettime(clockid_t which_clock, struct timespec *tp)
}
asmlinkage
long
sys_clock_getres
(
clockid_t
which_clock
,
struct
timespec
*
tp
)
sys_clock_getres
(
clockid_t
which_clock
,
struct
timespec
__user
*
tp
)
{
struct
timespec
rtn_tp
;
...
...
@@ -1074,7 +1075,7 @@ extern long do_clock_nanosleep(clockid_t which_clock, int flags,
#ifdef FOLD_NANO_SLEEP_INTO_CLOCK_NANO_SLEEP
asmlinkage
long
sys_nanosleep
(
struct
timespec
*
rqtp
,
struct
timespec
*
rmtp
)
sys_nanosleep
(
struct
timespec
__user
*
rqtp
,
struct
timespec
__user
*
rmtp
)
{
struct
timespec
t
;
long
ret
;
...
...
@@ -1096,7 +1097,8 @@ sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp)
asmlinkage
long
sys_clock_nanosleep
(
clockid_t
which_clock
,
int
flags
,
const
struct
timespec
*
rqtp
,
struct
timespec
*
rmtp
)
const
struct
timespec
__user
*
rqtp
,
struct
timespec
__user
*
rmtp
)
{
struct
timespec
t
;
int
ret
;
...
...
@@ -1218,7 +1220,7 @@ clock_nanosleep_restart(struct restart_block *restart_block)
int
ret
=
do_clock_nanosleep
(
restart_block
->
arg0
,
0
,
&
t
);
if
((
ret
==
-
ERESTART_RESTARTBLOCK
)
&&
restart_block
->
arg1
&&
copy_to_user
((
struct
timespec
*
)(
restart_block
->
arg1
),
&
t
,
copy_to_user
((
struct
timespec
__user
*
)(
restart_block
->
arg1
),
&
t
,
sizeof
(
t
)))
return
-
EFAULT
;
return
ret
;
...
...
kernel/printk.c
View file @
64a8617f
...
...
@@ -155,7 +155,7 @@ __setup("console=", console_setup);
* 8 -- Set level of messages printed to console
* 9 -- Return number of unread characters in the log buffer
*/
int
do_syslog
(
int
type
,
char
*
buf
,
int
len
)
int
do_syslog
(
int
type
,
char
__user
*
buf
,
int
len
)
{
unsigned
long
i
,
j
,
limit
,
count
;
int
do_clear
=
0
;
...
...
@@ -276,7 +276,7 @@ int do_syslog(int type, char * buf, int len)
return
error
;
}
asmlinkage
long
sys_syslog
(
int
type
,
char
*
buf
,
int
len
)
asmlinkage
long
sys_syslog
(
int
type
,
char
__user
*
buf
,
int
len
)
{
return
do_syslog
(
type
,
buf
,
len
);
}
...
...
kernel/ptrace.c
View file @
64a8617f
...
...
@@ -200,7 +200,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
return
buf
-
old_buf
;
}
int
ptrace_readdata
(
struct
task_struct
*
tsk
,
unsigned
long
src
,
char
*
dst
,
int
len
)
int
ptrace_readdata
(
struct
task_struct
*
tsk
,
unsigned
long
src
,
char
__user
*
dst
,
int
len
)
{
int
copied
=
0
;
...
...
@@ -225,7 +225,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int l
return
copied
;
}
int
ptrace_writedata
(
struct
task_struct
*
tsk
,
char
*
src
,
unsigned
long
dst
,
int
len
)
int
ptrace_writedata
(
struct
task_struct
*
tsk
,
char
__user
*
src
,
unsigned
long
dst
,
int
len
)
{
int
copied
=
0
;
...
...
@@ -278,19 +278,18 @@ static int ptrace_setoptions(struct task_struct *child, long data)
return
(
data
&
~
PTRACE_O_MASK
)
?
-
EINVAL
:
0
;
}
static
int
ptrace_getsiginfo
(
struct
task_struct
*
child
,
long
data
)
static
int
ptrace_getsiginfo
(
struct
task_struct
*
child
,
siginfo_t
__user
*
data
)
{
if
(
child
->
last_siginfo
==
NULL
)
return
-
EINVAL
;
return
copy_siginfo_to_user
((
siginfo_t
*
)
data
,
child
->
last_siginfo
);
return
copy_siginfo_to_user
(
data
,
child
->
last_siginfo
);
}
static
int
ptrace_setsiginfo
(
struct
task_struct
*
child
,
long
data
)
static
int
ptrace_setsiginfo
(
struct
task_struct
*
child
,
siginfo_t
__user
*
data
)
{
if
(
child
->
last_siginfo
==
NULL
)
return
-
EINVAL
;
if
(
copy_from_user
(
child
->
last_siginfo
,
(
siginfo_t
*
)
data
,
sizeof
(
siginfo_t
))
!=
0
)
if
(
copy_from_user
(
child
->
last_siginfo
,
data
,
sizeof
(
siginfo_t
))
!=
0
)
return
-
EFAULT
;
return
0
;
}
...
...
@@ -308,13 +307,13 @@ int ptrace_request(struct task_struct *child, long request,
ret
=
ptrace_setoptions
(
child
,
data
);
break
;
case
PTRACE_GETEVENTMSG
:
ret
=
put_user
(
child
->
ptrace_message
,
(
unsigned
long
*
)
data
);
ret
=
put_user
(
child
->
ptrace_message
,
(
unsigned
long
__user
*
)
data
);
break
;
case
PTRACE_GETSIGINFO
:
ret
=
ptrace_getsiginfo
(
child
,
data
);
ret
=
ptrace_getsiginfo
(
child
,
(
siginfo_t
__user
*
)
data
);
break
;
case
PTRACE_SETSIGINFO
:
ret
=
ptrace_setsiginfo
(
child
,
data
);
ret
=
ptrace_setsiginfo
(
child
,
(
siginfo_t
__user
*
)
data
);
break
;
default:
break
;
...
...
kernel/softirq.c
View file @
64a8617f
...
...
@@ -51,7 +51,7 @@ static inline void wakeup_softirqd(unsigned cpu)
wake_up_process
(
tsk
);
}
asmlinkage
void
do_softirq
()
asmlinkage
void
do_softirq
(
void
)
{
__u32
pending
;
unsigned
long
flags
;
...
...
@@ -296,7 +296,7 @@ static struct notifier_block tasklet_nb = {
.
next
=
NULL
,
};
void
__init
softirq_init
()
void
__init
softirq_init
(
void
)
{
open_softirq
(
TASKLET_SOFTIRQ
,
tasklet_action
,
NULL
);
open_softirq
(
HI_SOFTIRQ
,
tasklet_hi_action
,
NULL
);
...
...
kernel/sysctl.c
View file @
64a8617f
...
...
@@ -403,7 +403,7 @@ int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
return
-
ENOTDIR
;
}
extern
asmlinkage
long
sys_sysctl
(
struct
__sysctl_args
*
args
)
asmlinkage
long
sys_sysctl
(
struct
__sysctl_args
__user
*
args
)
{
struct
__sysctl_args
tmp
;
int
error
;
...
...
@@ -444,8 +444,8 @@ static inline int ctl_perm(ctl_table *table, int op)
}
static
int
parse_table
(
int
*
name
,
int
nlen
,
void
*
oldval
,
size_t
*
oldlenp
,
void
*
newval
,
size_t
newlen
,
void
__user
*
oldval
,
size_t
__user
*
oldlenp
,
void
__user
*
newval
,
size_t
newlen
,
ctl_table
*
table
,
void
**
context
)
{
int
n
;
...
...
@@ -485,8 +485,8 @@ static int parse_table(int *name, int nlen,
/* Perform the actual read/write of a sysctl table entry. */
int
do_sysctl_strategy
(
ctl_table
*
table
,
int
*
name
,
int
nlen
,
void
*
oldval
,
size_t
*
oldlenp
,
void
*
newval
,
size_t
newlen
,
void
**
context
)
void
__user
*
oldval
,
size_t
__user
*
oldlenp
,
void
__user
*
newval
,
size_t
newlen
,
void
**
context
)
{
int
op
=
0
,
rc
;
size_t
len
;
...
...
@@ -787,10 +787,11 @@ static int proc_sys_permission(struct inode *inode, int op)
* Returns 0 on success.
*/
int
proc_dostring
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
)
void
__user
*
buffer
,
size_t
*
lenp
)
{
size_t
len
;
char
*
p
,
c
;
char
__user
*
p
;
char
c
;
if
(
!
table
->
data
||
!
table
->
maxlen
||
!*
lenp
||
(
filp
->
f_pos
&&
!
write
))
{
...
...
@@ -840,7 +841,7 @@ int proc_dostring(ctl_table *table, int write, struct file *filp,
*/
static
int
proc_doutsstring
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
)
void
__user
*
buffer
,
size_t
*
lenp
)
{
int
r
;
...
...
@@ -863,7 +864,7 @@ static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
#define OP_MIN 4
static
int
do_proc_dointvec
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
,
int
conv
,
int
op
)
void
__user
*
buffer
,
size_t
*
lenp
,
int
conv
,
int
op
)
{
int
*
i
,
vleft
,
first
=
1
,
neg
,
val
;
size_t
left
,
len
;
...
...
@@ -885,12 +886,12 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
if
(
write
)
{
while
(
left
)
{
char
c
;
if
(
get_user
(
c
,(
cha
r
*
)
buffer
))
if
(
get_user
(
c
,(
char
__use
r
*
)
buffer
))
return
-
EFAULT
;
if
(
!
isspace
(
c
))
break
;
left
--
;
((
char
*
)
buffer
)
++
;
buffer
++
;
}
if
(
!
left
)
break
;
...
...
@@ -979,7 +980,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
* Returns 0 on success.
*/
int
proc_dointvec
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
)
void
__user
*
buffer
,
size_t
*
lenp
)
{
return
do_proc_dointvec
(
table
,
write
,
filp
,
buffer
,
lenp
,
1
,
OP_SET
);
}
...
...
@@ -989,7 +990,7 @@ int proc_dointvec(ctl_table *table, int write, struct file *filp,
*/
int
proc_dointvec_bset
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
)
void
__user
*
buffer
,
size_t
*
lenp
)
{
if
(
!
capable
(
CAP_SYS_MODULE
))
{
return
-
EPERM
;
...
...
@@ -1015,7 +1016,7 @@ int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
* Returns 0 on success.
*/
int
proc_dointvec_minmax
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
)
void
__user
*
buffer
,
size_t
*
lenp
)
{
int
*
i
,
*
min
,
*
max
,
vleft
,
first
=
1
,
neg
,
val
;
size_t
len
,
left
;
...
...
@@ -1043,7 +1044,7 @@ int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
if
(
!
isspace
(
c
))
break
;
left
--
;
((
char
*
)
buffer
)
++
;
buffer
++
;
}
if
(
!
left
)
break
;
...
...
@@ -1113,7 +1114,7 @@ int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
static
int
do_proc_doulongvec_minmax
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
,
void
__user
*
buffer
,
size_t
*
lenp
,
unsigned
long
convmul
,
unsigned
long
convdiv
)
{
...
...
@@ -1139,12 +1140,12 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
if
(
write
)
{
while
(
left
)
{
char
c
;
if
(
get_user
(
c
,
(
cha
r
*
)
buffer
))
if
(
get_user
(
c
,
(
char
__use
r
*
)
buffer
))
return
-
EFAULT
;
if
(
!
isspace
(
c
))
break
;
left
--
;
((
char
*
)
buffer
)
++
;
buffer
++
;
}
if
(
!
left
)
break
;
...
...
@@ -1152,7 +1153,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
len
=
left
;
if
(
len
>
TMPBUFLEN
-
1
)
len
=
TMPBUFLEN
-
1
;
if
(
copy_from_user
(
buf
,
buffer
,
len
))
if
(
copy_from_user
(
buf
,
buffer
,
len
))
return
-
EFAULT
;
buf
[
len
]
=
0
;
p
=
buf
;
...
...
@@ -1232,7 +1233,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
* Returns 0 on success.
*/
int
proc_doulongvec_minmax
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
)
void
__user
*
buffer
,
size_t
*
lenp
)
{
return
do_proc_doulongvec_minmax
(
table
,
write
,
filp
,
buffer
,
lenp
,
1l
,
1l
);
}
...
...
@@ -1256,7 +1257,7 @@ int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
*/
int
proc_doulongvec_ms_jiffies_minmax
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
)
void
__user
*
buffer
,
size_t
*
lenp
)
{
return
do_proc_doulongvec_minmax
(
table
,
write
,
filp
,
buffer
,
lenp
,
HZ
,
1000l
);
...
...
@@ -1279,7 +1280,7 @@ int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
* Returns 0 on success.
*/
int
proc_dointvec_jiffies
(
ctl_table
*
table
,
int
write
,
struct
file
*
filp
,
void
*
buffer
,
size_t
*
lenp
)
void
__user
*
buffer
,
size_t
*
lenp
)
{
return
do_proc_dointvec
(
table
,
write
,
filp
,
buffer
,
lenp
,
HZ
,
OP_SET
);
}
...
...
@@ -1345,8 +1346,8 @@ int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
/* The generic string strategy routine: */
int
sysctl_string
(
ctl_table
*
table
,
int
*
name
,
int
nlen
,
void
*
oldval
,
size_t
*
oldlenp
,
void
*
newval
,
size_t
newlen
,
void
**
context
)
void
__user
*
oldval
,
size_t
__user
*
oldlenp
,
void
__user
*
newval
,
size_t
newlen
,
void
**
context
)
{
size_t
l
,
len
;
...
...
@@ -1453,7 +1454,7 @@ int sysctl_jiffies(ctl_table *table, int *name, int nlen,
#else
/* CONFIG_SYSCTL */
extern
asmlinkage
long
sys_sysctl
(
struct
__sysctl_args
*
args
)
extern
asmlinkage
long
sys_sysctl
(
struct
__sysctl_args
__user
*
args
)
{
return
-
ENOSYS
;
}
...
...
kernel/time.c
View file @
64a8617f
...
...
@@ -90,7 +90,7 @@ asmlinkage long sys_stime(int * tptr)
#endif
asmlinkage
long
sys_gettimeofday
(
struct
timeval
*
tv
,
struct
timezone
*
tz
)
asmlinkage
long
sys_gettimeofday
(
struct
timeval
__user
*
tv
,
struct
timezone
__user
*
tz
)
{
if
(
likely
(
tv
!=
NULL
))
{
struct
timeval
ktv
;
...
...
@@ -166,7 +166,7 @@ int do_sys_settimeofday(struct timeval *tv, struct timezone *tz)
return
0
;
}
asmlinkage
long
sys_settimeofday
(
struct
timeval
*
tv
,
struct
timezone
*
tz
)
asmlinkage
long
sys_settimeofday
(
struct
timeval
__user
*
tv
,
struct
timezone
__user
*
tz
)
{
struct
timeval
new_tv
;
struct
timezone
new_tz
;
...
...
@@ -387,7 +387,7 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0
return
(
result
);
}
asmlinkage
long
sys_adjtimex
(
struct
timex
*
txc_p
)
asmlinkage
long
sys_adjtimex
(
struct
timex
__user
*
txc_p
)
{
struct
timex
txc
;
/* Local copy of parameter */
int
ret
;
...
...
kernel/uid16.c
View file @
64a8617f
...
...
@@ -107,7 +107,7 @@ asmlinkage long sys_setfsgid16(old_gid_t gid)
return
sys_setfsgid
((
gid_t
)
gid
);
}
asmlinkage
long
sys_getgroups16
(
int
gidsetsize
,
old_gid_t
*
grouplist
)
asmlinkage
long
sys_getgroups16
(
int
gidsetsize
,
old_gid_t
__user
*
grouplist
)
{
old_gid_t
groups
[
NGROUPS
];
int
i
,
j
;
...
...
@@ -126,7 +126,7 @@ asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t *grouplist)
return
i
;
}
asmlinkage
long
sys_setgroups16
(
int
gidsetsize
,
old_gid_t
*
grouplist
)
asmlinkage
long
sys_setgroups16
(
int
gidsetsize
,
old_gid_t
__user
*
grouplist
)
{
old_gid_t
groups
[
NGROUPS
];
gid_t
new_groups
[
NGROUPS
];
...
...
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