Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
linux
Commits
12770fac
Commit
12770fac
authored
21 years ago
by
Patrick Mochel
Browse files
Options
Download
Plain Diff
Hand Merge
parents
a7668df2
f5268fce
Changes
96
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
815 additions
and
699 deletions
+815
-699
Documentation/filesystems/Locking
Documentation/filesystems/Locking
+93
-57
Documentation/nmi_watchdog.txt
Documentation/nmi_watchdog.txt
+1
-1
Documentation/video4linux/Zoran
Documentation/video4linux/Zoran
+494
-454
MAINTAINERS
MAINTAINERS
+7
-0
arch/i386/Kconfig
arch/i386/Kconfig
+0
-4
arch/i386/defconfig
arch/i386/defconfig
+0
-1
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/acpi/boot.c
+1
-0
arch/i386/kernel/dmi_scan.c
arch/i386/kernel/dmi_scan.c
+19
-28
arch/i386/kernel/doublefault.c
arch/i386/kernel/doublefault.c
+1
-2
arch/i386/kernel/ioport.c
arch/i386/kernel/ioport.c
+15
-21
arch/i386/kernel/process.c
arch/i386/kernel/process.c
+14
-14
arch/i386/kernel/setup.c
arch/i386/kernel/setup.c
+4
-1
arch/i386/lib/usercopy.c
arch/i386/lib/usercopy.c
+97
-77
arch/x86_64/kernel/ioport.c
arch/x86_64/kernel/ioport.c
+15
-13
arch/x86_64/kernel/process.c
arch/x86_64/kernel/process.c
+6
-8
arch/x86_64/kernel/setup64.c
arch/x86_64/kernel/setup64.c
+6
-1
drivers/base/power/resume.c
drivers/base/power/resume.c
+17
-0
drivers/base/power/suspend.c
drivers/base/power/suspend.c
+21
-0
drivers/char/pcxx.c
drivers/char/pcxx.c
+2
-15
drivers/char/pcxx.h
drivers/char/pcxx.h
+2
-2
No files found.
Documentation/filesystems/Locking
View file @
12770fac
...
...
@@ -28,8 +28,9 @@ d_iput: no no no yes
--------------------------- inode_operations ---------------------------
prototypes:
int (*create) (struct inode *,struct dentry *,int);
struct dentry * (*lookup) (struct inode *,struct dentry *);
int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameid
ata *);
int (*link) (struct dentry *,struct inode *,struct dentry *);
int (*unlink) (struct inode *,struct dentry *);
int (*symlink) (struct inode *,struct dentry *,const char *);
...
...
@@ -38,13 +39,13 @@ prototypes:
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);
int (*permission) (struct inode *, int
, struct nameidata *
);
int (*setattr) (struct dentry *, struct iattr *);
int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
int (*setxattr) (struct dentry *, const char *, void *,
size_t,
int);
int (*setxattr) (struct dentry *, const char *,
const
void *,size_t,int);
ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
ssize_t (*listxattr) (struct dentry *, char *, size_t);
int (*removexattr) (struct dentry *, const char *);
...
...
@@ -85,42 +86,55 @@ of the locking scheme for directory operations.
--------------------------- super_operations ---------------------------
prototypes:
struct inode *(*alloc_inode)(struct super_block *sb);
void (*destroy_inode)(struct inode *);
void (*read_inode) (struct inode *);
void (*dirty_inode) (struct inode *);
void (*write_inode) (struct inode *, int);
void (*put_inode) (struct inode *);
void (*drop_inode) (struct inode *);
void (*delete_inode) (struct inode *);
void (*put_super) (struct super_block *);
void (*write_super) (struct super_block *);
int (*sync_fs) (struct super_block *sb, int wait);
int (*statfs) (struct super_block *, struct statfs *);
int (*sync_fs)(struct super_block *sb, int wait);
void (*write_super_lockfs) (struct super_block *);
void (*unlockfs) (struct super_block *);
int (*statfs) (struct super_block *, struct kstatfs *);
int (*remount_fs) (struct super_block *, int *, char *);
void (*clear_inode) (struct inode *);
void (*umount_begin) (struct super_block *);
int (*show_options)(struct seq_file *, struct vfsmount *);
locking rules:
All may block.
BKL s_lock mount_sem
read_inode: yes (see below)
write_inode: no
put_inode: no
drop_inode: no !!!inode_lock!!!
delete_inode: no
clear_inode: no
put_super: yes yes maybe (see below)
write_super: no yes maybe (see below)
sync_fs: no no maybe (see below)
statfs: no no no
remount_fs: yes yes maybe (see below)
umount_begin: yes no maybe (see below)
BKL s_lock s_umount
alloc_inode: no no no
destroy_inode: no
read_inode: no (see below)
dirty_inode: no (must not sleep)
write_inode: no
put_inode: no
drop_inode: no !!!inode_lock!!!
delete_inode: no
put_super: yes yes no
write_super: no yes read
sync_fs: no no read
write_super_lockfs: ?
unlockfs: ?
statfs: no no no
remount_fs: no yes maybe (see below)
clear_inode: no
umount_begin: yes no no
show_options: no (vfsmount->sem)
->read_inode() is not a method - it's a callback used in iget().
rules for mount_sem are not too nice - it is going to die and be replac
ed
by better scheme anyway
.
->remount_fs() will have the s_umount lock if it's already mount
ed
.
When called from get_sb_single, it does NOT have the s_umount lock
.
--------------------------- file_system_type ---------------------------
prototypes:
struct super_block *(*get_sb) (struct file_system_type *, int, const char *, void *);
struct super_block *(*get_sb) (struct file_system_type *, int,
const char *, void *);
void (*kill_sb) (struct super_block *);
locking rules:
may block BKL
...
...
@@ -128,7 +142,7 @@ get_sb yes yes
kill_sb yes yes
->get_sb() returns error or a locked superblock (exclusive on ->s_umount).
->kill_sb() takes a locked superblock, does all shutdown work on it,
->kill_sb() takes a
write-
locked superblock, does all shutdown work on it,
unlocks and drops the reference.
--------------------------- address_space_operations --------------------------
...
...
@@ -138,12 +152,15 @@ prototypes:
int (*sync_page)(struct page *);
int (*writepages)(struct address_space *, struct writeback_control *);
int (*set_page_dirty)(struct page *page);
int (*readpages)(struct file *filp, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages);
int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
in
t (*bmap)(struct address_space *,
long
);
sector_
t (*bmap)(struct address_space *,
sector_t
);
int (*invalidatepage) (struct page *, unsigned long);
int (*releasepage) (struct page *, int);
int (*direct_IO)(int, struct inode *, struct kiobuf *, unsigned long, int);
int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
loff_t offset, unsigned long nr_segs);
locking rules:
All except set_page_dirty may block
...
...
@@ -151,15 +168,16 @@ locking rules:
BKL PageLocked(page)
writepage: no yes, unlocks (see below)
readpage: no yes, unlocks
readpages: no
sync_page: no maybe
writepages: no
set_page_dirty no no
readpages: no
prepare_write: no yes
commit_write: no yes
bmap: yes
invalidatepage: no yes
releasepage: no yes
direct_IO: no
->prepare_write(), ->commit_write(), ->sync_page() and ->readpage()
may be called from the request handler (/dev/loop).
...
...
@@ -253,8 +271,8 @@ prototypes:
locking rules:
BKL may block
fl_notify: yes no
fl_insert: yes
maybe
fl_remove: yes
maybe
fl_insert: yes
no
fl_remove: yes
no
Currently only NLM provides instances of this class. None of the
them block. If you have out-of-tree instances - please, show up. Locking
in that area will change.
...
...
@@ -274,57 +292,75 @@ prototypes:
int (*open) (struct inode *, struct file *);
int (*release) (struct inode *, struct file *);
int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
int (*check_media_change) (kdev_t);
int (*revalidate) (kdev_t);
int (*media_changed) (struct gendisk *);
int (*revalidate_disk) (struct gendisk *);
locking rules:
BKL bd_sem
open: yes yes
release: yes yes
ioctl: yes no
check_
media_change:
yes
no
revalidate
: yes
no
media_change
d
:
no
no
revalidate
_disk: no
no
The last two are called only from check_disk_change(). Prototypes are very
bad - as soon as we'll get disk_struct they will change (and methods will
become per-disk instead of per-partition).
The last two are called only from check_disk_change().
--------------------------- file_operations -------------------------------
prototypes:
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*read) (struct file *, char *, size_t, loff_t *);
ssize_t (*write) (struct file *, 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);
int (*ioctl) (struct inode *, struct file *, unsigned int,
unsigned long);
int (*mmap) (struct file *, struct vm_area_struct *);
int (*open) (struct inode *, struct file *);
int (*flush) (struct file *);
int (*release) (struct inode *, struct file *);
int (*fsync) (struct file *, struct dentry *, int datasync);
int (*aio_fsync) (struct kiocb *, int datasync);
int (*fasync) (int, struct file *, int);
int (*lock) (struct file *, int, struct file_lock *);
ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);
ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);
ssize_t (*readv) (struct file *, const struct iovec *, unsigned long,
loff_t *);
ssize_t (*writev) (struct file *, const struct iovec *, unsigned long,
loff_t *);
ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t,
void __user *);
ssize_t (*sendpage) (struct file *, struct page *, int, size_t,
loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long,
unsigned long, unsigned long, unsigned long);
};
locking rules:
All except ->poll() may block.
BKL
llseek: yes (see below)
read: no
write: no
readdir: no
poll: no
ioctl: yes (see below)
mmap: no
open: maybe (see below)
flush: no
release: no
fsync: yes (see below)
fasync: yes (see below)
lock: yes
readv: no
writev: no
BKL
llseek: no (see below)
read: no
aio_read: no
write: no
aio_write: no
readdir: no
poll: no
ioctl: yes (see below)
mmap: no
open: maybe (see below)
flush: no
release: no
fsync: no (see below)
aio_fsync: no
fasync: yes (see below)
lock: yes
readv: no
writev: no
sendfile: no
sendpage: no
get_unmapped_area: no
->llseek() locking has moved from llseek to the individual llseek
implementations. If your fs is not using generic_file_llseek, you
...
...
This diff is collapsed.
Click to expand it.
Documentation/nmi_watchdog.txt
View file @
12770fac
...
...
@@ -12,7 +12,7 @@ This can be used to debug hard kernel lockups. By executing periodic
NMI interrupts, the kernel can monitor whether any CPU has locked up,
and print out debugging messages if so.
In order to use the NMI watchdo
c
, you need to have APIC support in your
In order to use the NMI watchdo
g
, you need to have APIC support in your
kernel. For SMP kernels, APIC support gets compiled in automatically. For
UP, enable either CONFIG_X86_UP_APIC (Processor type and features -> Local
APIC support on uniprocessors) or CONFIG_X86_UP_IOAPIC (Processor type and
...
...
This diff is collapsed.
Click to expand it.
Documentation/video4linux/Zoran
View file @
12770fac
This diff is collapsed.
Click to expand it.
MAINTAINERS
View file @
12770fac
...
...
@@ -2253,6 +2253,13 @@ M: fuganti@netbank.com.br
W: http://cvs.conectiva.com.br/drivers/ZFL-watchdog/
S: Maintained
ZR36067 VIDEO FOR LINUX DRIVER
P: Ronald Bultje
M: R.S.Bultje@pharm.uu.nl
L: mjpeg-users@lists.sourceforge.net
W: http://mjpeg.sourceforge.net/driver-zoran/
S: Maintained
ZR36120 VIDEO FOR LINUX DRIVER
P: Pauline Middelink
M: middelin@polyware.nl
...
...
This diff is collapsed.
Click to expand it.
arch/i386/Kconfig
View file @
12770fac
...
...
@@ -1204,10 +1204,6 @@ source "drivers/pnp/Kconfig"
source "drivers/block/Kconfig"
config MOUNT_ROOT_FAILED_MSG
bool
default y
source "drivers/ide/Kconfig"
source "drivers/scsi/Kconfig"
...
...
This diff is collapsed.
Click to expand it.
arch/i386/defconfig
View file @
12770fac
...
...
@@ -228,7 +228,6 @@ CONFIG_BLK_DEV_FD=y
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_INITRD is not set
CONFIG_LBD=y
CONFIG_MOUNT_ROOT_FAILED_MSG=y
#
# ATA/ATAPI/MFM/RLL support
...
...
This diff is collapsed.
Click to expand it.
arch/i386/kernel/acpi/boot.c
View file @
12770fac
...
...
@@ -35,6 +35,7 @@
#if defined (CONFIG_X86_LOCAL_APIC)
#include <mach_apic.h>
#include <mach_mpparse.h>
#include <asm/io_apic.h>
#endif
#define PREFIX "ACPI: "
...
...
This diff is collapsed.
Click to expand it.
arch/i386/kernel/dmi_scan.c
View file @
12770fac
...
...
@@ -162,6 +162,23 @@ enum
static
char
*
dmi_ident
[
DMI_STRING_MAX
];
#ifdef CONFIG_ACPI_BOOT
/* print some information suitable for a blacklist entry. */
static
void
dmi_dump_system
(
void
)
{
printk
(
"DMI: BIOS: %.40s, %.40s, %.40s
\n
"
,
dmi_ident
[
DMI_BIOS_VENDOR
],
dmi_ident
[
DMI_BIOS_VERSION
],
dmi_ident
[
DMI_BIOS_DATE
]);
printk
(
"DMI: System: %.40s, %.40s, %.40s
\n
"
,
dmi_ident
[
DMI_SYS_VENDOR
],
dmi_ident
[
DMI_PRODUCT_NAME
],
dmi_ident
[
DMI_PRODUCT_VERSION
]);
printk
(
"DMI: Board: %.40s, %.40s, %.40s
\n
"
,
dmi_ident
[
DMI_BOARD_VENDOR
],
dmi_ident
[
DMI_BOARD_NAME
],
dmi_ident
[
DMI_BOARD_VERSION
]);
}
#endif
/*
* Save a DMI string
*/
...
...
@@ -1104,25 +1121,6 @@ void __init dmi_scan_machine(void)
EXPORT_SYMBOL
(
is_unsafe_smbus
);
#ifdef CONFIG_MOUNT_ROOT_FAILED_MSG
#ifdef CONFIG_ACPI_BOOT
/* print some information suitable for a blacklist entry. */
static
void
dmi_dump_system
(
void
)
{
printk
(
"DMI: BIOS: %.40s, %.40s, %.40s
\n
"
,
dmi_ident
[
DMI_BIOS_VENDOR
],
dmi_ident
[
DMI_BIOS_VERSION
],
dmi_ident
[
DMI_BIOS_DATE
]);
printk
(
"DMI: System: %.40s, %.40s, %.40s
\n
"
,
dmi_ident
[
DMI_SYS_VENDOR
],
dmi_ident
[
DMI_PRODUCT_NAME
],
dmi_ident
[
DMI_PRODUCT_VERSION
]);
printk
(
"DMI: Board: %.40s, %.40s, %.40s
\n
"
,
dmi_ident
[
DMI_BOARD_VENDOR
],
dmi_ident
[
DMI_BOARD_NAME
],
dmi_ident
[
DMI_BOARD_VERSION
]);
}
/*
* mount_root_failed_msg()
*
...
...
@@ -1135,20 +1133,13 @@ static void dmi_dump_system(void)
void
mount_root_failed_msg
(
void
)
{
#ifdef CONFIG_ACPI_BOOT
printk
(
"Try booting with pci=noacpi, acpi=ht, "
"or acpi=off on the command line.
\n
"
);
printk
(
"If one helps, please report the following lines:
\n
"
);
dmi_dump_system
();
}
#else
void
mount_root_failed_msg
(
void
)
{
}
#endif
}
#endif
/* CONFIG_MOUNT_ROOT_FAILED_MSG */
This diff is collapsed.
Click to expand it.
arch/i386/kernel/doublefault.c
View file @
12770fac
...
...
@@ -50,8 +50,7 @@ struct tss_struct doublefault_tss __cacheline_aligned = {
.
esp0
=
STACK_START
,
.
ss0
=
__KERNEL_DS
,
.
ldt
=
0
,
.
bitmap
=
INVALID_IO_BITMAP_OFFSET
,
.
io_bitmap
=
{
[
0
...
IO_BITMAP_SIZE
]
=
~
0
},
.
io_bitmap_base
=
INVALID_IO_BITMAP_OFFSET
,
.
eip
=
(
unsigned
long
)
doublefault_fn
,
.
eflags
=
0x00000082
,
...
...
This diff is collapsed.
Click to expand it.
arch/i386/kernel/ioport.c
View file @
12770fac
...
...
@@ -17,17 +17,17 @@
#include <linux/thread_info.h>
/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */
static
void
set_bitmap
(
unsigned
long
*
bitmap
,
unsigned
long
base
,
unsigned
long
extent
,
int
new_value
)
static
void
set_bitmap
(
unsigned
long
*
bitmap
,
unsigned
int
base
,
unsigned
int
extent
,
int
new_value
)
{
unsigned
long
mask
;
unsigned
long
*
bitmap_base
=
bitmap
+
(
base
/
BITS_PER_LONG
);
unsigned
long
low_index
=
base
&
(
BITS_PER_LONG
-
1
);
unsigned
int
low_index
=
base
&
(
BITS_PER_LONG
-
1
);
int
length
=
low_index
+
extent
;
if
(
low_index
!=
0
)
{
mask
=
(
~
0UL
<<
low_index
);
if
(
length
<
BITS_PER_LONG
)
mask
&=
~
(
~
0UL
<<
length
);
mask
&=
~
(
~
0UL
<<
length
);
if
(
new_value
)
*
bitmap_base
++
|=
mask
;
else
...
...
@@ -50,6 +50,7 @@ static void set_bitmap(unsigned long *bitmap, unsigned long base, unsigned long
}
}
/*
* this changes the io permissions bitmap in the current task.
*/
...
...
@@ -57,10 +58,9 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
{
struct
thread_struct
*
t
=
&
current
->
thread
;
struct
tss_struct
*
tss
;
unsigned
long
*
bitmap
=
NULL
;
int
ret
=
0
;
unsigned
long
*
bitmap
;
if
((
from
+
num
<=
from
)
||
(
from
+
num
>
IO_BITMAP_
SIZE
*
32
))
if
((
from
+
num
<=
from
)
||
(
from
+
num
>
IO_BITMAP_
BITS
))
return
-
EINVAL
;
if
(
turn_on
&&
!
capable
(
CAP_SYS_RAWIO
))
return
-
EPERM
;
...
...
@@ -70,34 +70,28 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
* IO bitmap up. ioperm() is much less timing critical than clone(),
* this is why we delay this operation until now:
*/
if
(
!
t
->
ts_
io_bitmap
)
{
if
(
!
t
->
io_bitmap
_ptr
)
{
bitmap
=
kmalloc
(
IO_BITMAP_BYTES
,
GFP_KERNEL
);
if
(
!
bitmap
)
{
ret
=
-
ENOMEM
;
goto
out
;
}
if
(
!
bitmap
)
return
-
ENOMEM
;
/*
* just in case ...
*/
memset
(
bitmap
,
0xff
,
IO_BITMAP_BYTES
);
t
->
ts_
io_bitmap
=
bitmap
;
t
->
io_bitmap
_ptr
=
bitmap
;
}
/*
* do it in the per-thread copy and in the TSS ...
*/
set_bitmap
(
t
->
ts_
io_bitmap
,
from
,
num
,
!
turn_on
);
set_bitmap
(
t
->
io_bitmap
_ptr
,
from
,
num
,
!
turn_on
);
tss
=
init_tss
+
get_cpu
();
if
(
tss
->
bitmap
==
IO_BITMAP_OFFSET
)
{
/* already active? */
if
(
tss
->
io_
bitmap
_base
==
IO_BITMAP_OFFSET
)
{
/* already active? */
set_bitmap
(
tss
->
io_bitmap
,
from
,
num
,
!
turn_on
);
}
else
{
memcpy
(
tss
->
io_bitmap
,
t
->
ts_
io_bitmap
,
IO_BITMAP_BYTES
);
tss
->
bitmap
=
IO_BITMAP_OFFSET
;
/* Activate it in the TSS */
memcpy
(
tss
->
io_bitmap
,
t
->
io_bitmap
_ptr
,
IO_BITMAP_BYTES
);
tss
->
io_
bitmap
_base
=
IO_BITMAP_OFFSET
;
/* Activate it in the TSS */
}
put_cpu
();
out:
return
ret
;
return
0
;
}
/*
...
...
This diff is collapsed.
Click to expand it.
arch/i386/kernel/process.c
View file @
12770fac
...
...
@@ -241,9 +241,9 @@ void exit_thread(void)
struct
task_struct
*
tsk
=
current
;
/* The process may have allocated an io port bitmap... nuke it. */
if
(
unlikely
(
NULL
!=
tsk
->
thread
.
ts_
io_bitmap
))
{
kfree
(
tsk
->
thread
.
ts_
io_bitmap
);
tsk
->
thread
.
ts_
io_bitmap
=
NULL
;
if
(
unlikely
(
NULL
!=
tsk
->
thread
.
io_bitmap
_ptr
))
{
kfree
(
tsk
->
thread
.
io_bitmap
_ptr
);
tsk
->
thread
.
io_bitmap
_ptr
=
NULL
;
}
}
...
...
@@ -308,11 +308,11 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
savesegment
(
gs
,
p
->
thread
.
gs
);
tsk
=
current
;
if
(
unlikely
(
NULL
!=
tsk
->
thread
.
ts_
io_bitmap
))
{
p
->
thread
.
ts_
io_bitmap
=
kmalloc
(
IO_BITMAP_BYTES
,
GFP_KERNEL
);
if
(
!
p
->
thread
.
ts_
io_bitmap
)
if
(
unlikely
(
NULL
!=
tsk
->
thread
.
io_bitmap
_ptr
))
{
p
->
thread
.
io_bitmap
_ptr
=
kmalloc
(
IO_BITMAP_BYTES
,
GFP_KERNEL
);
if
(
!
p
->
thread
.
io_bitmap
_ptr
)
return
-
ENOMEM
;
memcpy
(
p
->
thread
.
ts_
io_bitmap
,
tsk
->
thread
.
ts_
io_bitmap
,
memcpy
(
p
->
thread
.
io_bitmap
_ptr
,
tsk
->
thread
.
io_bitmap
_ptr
,
IO_BITMAP_BYTES
);
}
...
...
@@ -342,8 +342,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
err
=
0
;
out:
if
(
err
&&
p
->
thread
.
ts_
io_bitmap
)
kfree
(
p
->
thread
.
ts_
io_bitmap
);
if
(
err
&&
p
->
thread
.
io_bitmap
_ptr
)
kfree
(
p
->
thread
.
io_bitmap
_ptr
);
return
err
;
}
...
...
@@ -492,8 +492,8 @@ struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct
loaddebug
(
next
,
7
);
}
if
(
unlikely
(
prev
->
ts_
io_bitmap
||
next
->
ts_
io_bitmap
))
{
if
(
next
->
ts_
io_bitmap
)
{
if
(
unlikely
(
prev
->
io_bitmap
_ptr
||
next
->
io_bitmap
_ptr
))
{
if
(
next
->
io_bitmap
_ptr
)
{
/*
* 4 cachelines copy ... not good, but not that
* bad either. Anyone got something better?
...
...
@@ -502,9 +502,9 @@ struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct
* and playing VM tricks to switch the IO bitmap
* is not really acceptable.]
*/
memcpy
(
tss
->
io_bitmap
,
next
->
ts_
io_bitmap
,
memcpy
(
tss
->
io_bitmap
,
next
->
io_bitmap
_ptr
,
IO_BITMAP_BYTES
);
tss
->
bitmap
=
IO_BITMAP_OFFSET
;
tss
->
io_
bitmap
_base
=
IO_BITMAP_OFFSET
;
}
else
/*
* a bitmap offset pointing outside of the TSS limit
...
...
@@ -512,7 +512,7 @@ struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct
* tries to use a port IO instruction. The first
* sys_ioperm() call sets up the bitmap properly.
*/
tss
->
bitmap
=
INVALID_IO_BITMAP_OFFSET
;
tss
->
io_
bitmap
_base
=
INVALID_IO_BITMAP_OFFSET
;
}
return
prev_p
;
}
...
...
This diff is collapsed.
Click to expand it.
arch/i386/kernel/setup.c
View file @
12770fac
...
...
@@ -43,6 +43,7 @@
#include <asm/setup.h>
#include <asm/arch_hooks.h>
#include <asm/sections.h>
#include <asm/io_apic.h>
#include "setup_arch_pre.h"
#include "mach_resources.h"
...
...
@@ -543,10 +544,12 @@ static void __init parse_cmdline_early (char ** cmdline_p)
if
(
!
acpi_force
)
acpi_disabled
=
1
;
}
#ifdef CONFIG_X86_LOCAL_APIC
/* disable IO-APIC */
else
if
(
!
memcmp
(
from
,
"noapic"
,
6
))
disable_ioapic_setup
();
#endif
#endif
/* CONFIG_X86_LOCAL_APIC */
#endif
/* CONFIG_ACPI_BOOT */
/*
* highmem=size forces highmem to be exactly 'size' bytes.
...
...
This diff is collapsed.
Click to expand it.
arch/i386/lib/usercopy.c
View file @
12770fac
...
...
@@ -222,85 +222,105 @@ __copy_user_intel(void *to, const void *from,unsigned long size)
{
int
d0
,
d1
;
__asm__
__volatile__
(
" .align 2,0x90
\n
"
"0: movl 32(%4), %%eax
\n
"
" cmpl $67, %0
\n
"
" jbe 1f
\n
"
" movl 64(%4), %%eax
\n
"
" .align 2,0x90
\n
"
"1: movl 0(%4), %%eax
\n
"
" movl 4(%4), %%edx
\n
"
"2: movl %%eax, 0(%3)
\n
"
"21: movl %%edx, 4(%3)
\n
"
" movl 8(%4), %%eax
\n
"
" movl 12(%4),%%edx
\n
"
"3: movl %%eax, 8(%3)
\n
"
"31: movl %%edx, 12(%3)
\n
"
" movl 16(%4), %%eax
\n
"
" movl 20(%4), %%edx
\n
"
"4: movl %%eax, 16(%3)
\n
"
"41: movl %%edx, 20(%3)
\n
"
" movl 24(%4), %%eax
\n
"
" movl 28(%4), %%edx
\n
"
"10: movl %%eax, 24(%3)
\n
"
"51: movl %%edx, 28(%3)
\n
"
" movl 32(%4), %%eax
\n
"
" movl 36(%4), %%edx
\n
"
"11: movl %%eax, 32(%3)
\n
"
"61: movl %%edx, 36(%3)
\n
"
" movl 40(%4), %%eax
\n
"
" movl 44(%4), %%edx
\n
"
"12: movl %%eax, 40(%3)
\n
"
"71: movl %%edx, 44(%3)
\n
"
" movl 48(%4), %%eax
\n
"
" movl 52(%4), %%edx
\n
"
"13: movl %%eax, 48(%3)
\n
"
"81: movl %%edx, 52(%3)
\n
"
" movl 56(%4), %%eax
\n
"
" movl 60(%4), %%edx
\n
"
"14: movl %%eax, 56(%3)
\n
"
"91: movl %%edx, 60(%3)
\n
"
" addl $-64, %0
\n
"
" addl $64, %4
\n
"
" addl $64, %3
\n
"
" cmpl $63, %0
\n
"
" ja 0b
\n
"
"5: movl %0, %%eax
\n
"
" shrl $2, %0
\n
"
" andl $3, %%eax
\n
"
" cld
\n
"
"6: rep; movsl
\n
"
" movl %%eax, %0
\n
"
"7: rep; movsb
\n
"
"8:
\n
"
".section .fixup,
\"
ax
\"\n
"
"9: lea 0(%%eax,%0,4),%0
\n
"
" jmp 8b
\n
"
".previous
\n
"
".section __ex_table,
\"
a
\"\n
"
" .align 4
\n
"
" .long 2b,8b
\n
"
" .long 21b,8b
\n
"
" .long 3b,8b
\n
"
" .long 31b,8b
\n
"
" .long 4b,8b
\n
"
" .long 41b,8b
\n
"
" .long 10b,8b
\n
"
" .long 51b,8b
\n
"
" .long 11b,8b
\n
"
" .long 61b,8b
\n
"
" .long 12b,8b
\n
"
" .long 71b,8b
\n
"
" .long 13b,8b
\n
"
" .long 81b,8b
\n
"
" .long 14b,8b
\n
"
" .long 91b,8b
\n
"
" .long 6b,9b
\n
"
" .long 7b,8b
\n
"
".previous"
" .align 2,0x90
\n
"
"1: movl 32(%4), %%eax
\n
"
" cmpl $67, %0
\n
"
" jbe 3f
\n
"
"2: movl 64(%4), %%eax
\n
"
" .align 2,0x90
\n
"
"3: movl 0(%4), %%eax
\n
"
"4: movl 4(%4), %%edx
\n
"
"5: movl %%eax, 0(%3)
\n
"
"6: movl %%edx, 4(%3)
\n
"
"7: movl 8(%4), %%eax
\n
"
"8: movl 12(%4),%%edx
\n
"
"9: movl %%eax, 8(%3)
\n
"
"10: movl %%edx, 12(%3)
\n
"
"11: movl 16(%4), %%eax
\n
"
"12: movl 20(%4), %%edx
\n
"
"13: movl %%eax, 16(%3)
\n
"
"14: movl %%edx, 20(%3)
\n
"
"15: movl 24(%4), %%eax
\n
"
"16: movl 28(%4), %%edx
\n
"
"17: movl %%eax, 24(%3)
\n
"
"18: movl %%edx, 28(%3)
\n
"
"19: movl 32(%4), %%eax
\n
"
"20: movl 36(%4), %%edx
\n
"
"21: movl %%eax, 32(%3)
\n
"
"22: movl %%edx, 36(%3)
\n
"
"23: movl 40(%4), %%eax
\n
"
"24: movl 44(%4), %%edx
\n
"
"25: movl %%eax, 40(%3)
\n
"
"26: movl %%edx, 44(%3)
\n
"
"27: movl 48(%4), %%eax
\n
"
"28: movl 52(%4), %%edx
\n
"
"29: movl %%eax, 48(%3)
\n
"
"30: movl %%edx, 52(%3)
\n
"
"31: movl 56(%4), %%eax
\n
"
"32: movl 60(%4), %%edx
\n
"
"33: movl %%eax, 56(%3)
\n
"
"34: movl %%edx, 60(%3)
\n
"
" addl $-64, %0
\n
"
" addl $64, %4
\n
"
" addl $64, %3
\n
"
" cmpl $63, %0
\n
"
" ja 1b
\n
"
"35: movl %0, %%eax
\n
"
" shrl $2, %0
\n
"
" andl $3, %%eax
\n
"
" cld
\n
"
"99: rep; movsl
\n
"
"36: movl %%eax, %0
\n
"
"37: rep; movsb
\n
"
"100:
\n
"
".section .fixup,
\"
ax
\"\n
"
"101: lea 0(%%eax,%0,4),%0
\n
"
" jmp 100b
\n
"
".previous
\n
"
".section __ex_table,
\"
a
\"\n
"
" .align 4
\n
"
" .long 1b,100b
\n
"
" .long 2b,100b
\n
"
" .long 3b,100b
\n
"
" .long 4b,100b
\n
"
" .long 5b,100b
\n
"
" .long 6b,100b
\n
"
" .long 7b,100b
\n
"
" .long 8b,100b
\n
"
" .long 9b,100b
\n
"
" .long 10b,100b
\n
"
" .long 11b,100b
\n
"
" .long 12b,100b
\n
"
" .long 13b,100b
\n
"
" .long 14b,100b
\n
"
" .long 15b,100b
\n
"
" .long 16b,100b
\n
"
" .long 17b,100b
\n
"
" .long 18b,100b
\n
"
" .long 19b,100b
\n
"
" .long 20b,100b
\n
"
" .long 21b,100b
\n
"
" .long 22b,100b
\n
"
" .long 23b,100b
\n
"
" .long 24b,100b
\n
"
" .long 25b,100b
\n
"
" .long 26b,100b
\n
"
" .long 27b,100b
\n
"
" .long 28b,100b
\n
"
" .long 29b,100b
\n
"
" .long 30b,100b
\n
"
" .long 31b,100b
\n
"
" .long 32b,100b
\n
"
" .long 33b,100b
\n
"
" .long 34b,100b
\n
"
" .long 35b,100b
\n
"
" .long 36b,100b
\n
"
" .long 37b,100b
\n
"
" .long 99b,101b
\n
"
".previous"
:
"=&c"
(
size
),
"=&D"
(
d0
),
"=&S"
(
d1
)
:
"1"
(
to
),
"2"
(
from
),
"0"
(
size
)
:
"eax"
,
"edx"
,
"memory"
);
:
"eax"
,
"edx"
,
"memory"
);
return
size
;
}
...
...
This diff is collapsed.
Click to expand it.
arch/x86_64/kernel/ioport.c
View file @
12770fac
...
...
@@ -18,11 +18,11 @@
#include <asm/io.h>
/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */
static
void
set_bitmap
(
unsigned
long
*
bitmap
,
short
base
,
shor
t
extent
,
int
new_value
)
static
void
set_bitmap
(
unsigned
long
*
bitmap
,
unsigned
int
base
,
unsigned
in
t
extent
,
int
new_value
)
{
unsigned
long
mask
;
unsigned
long
*
bitmap_base
=
bitmap
+
(
base
/
BITS_PER_LONG
);
unsigned
long
low_index
=
base
&
(
BITS_PER_LONG
-
1
);
unsigned
int
low_index
=
base
&
(
BITS_PER_LONG
-
1
);
int
length
=
low_index
+
extent
;
if
(
low_index
!=
0
)
{
...
...
@@ -58,9 +58,10 @@ static void set_bitmap(unsigned long *bitmap, short base, short extent, int new_
asmlinkage
long
sys_ioperm
(
unsigned
long
from
,
unsigned
long
num
,
int
turn_on
)
{
struct
thread_struct
*
t
=
&
current
->
thread
;
struct
tss_struct
*
tss
;
struct
tss_struct
*
tss
;
unsigned
long
*
bitmap
;
if
((
from
+
num
<=
from
)
||
(
from
+
num
>
IO_BITMAP_
SIZE
*
32
))
if
((
from
+
num
<=
from
)
||
(
from
+
num
>
IO_BITMAP_
BITS
))
return
-
EINVAL
;
if
(
turn_on
&&
!
capable
(
CAP_SYS_RAWIO
))
return
-
EPERM
;
...
...
@@ -70,24 +71,25 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
* IO bitmap up. ioperm() is much less timing critical than clone(),
* this is why we delay this operation until now:
*/
if
(
!
t
->
io_bitmap_ptr
)
{
t
->
io_
bitmap
_ptr
=
kmalloc
(
IO_BITMAP_BYTES
,
GFP_KERNEL
);
if
(
!
t
->
io_
bitmap
_ptr
)
if
(
!
t
->
io_bitmap_ptr
)
{
bitmap
=
kmalloc
(
IO_BITMAP_BYTES
,
GFP_KERNEL
);
if
(
!
bitmap
)
return
-
ENOMEM
;
memset
(
t
->
io_bitmap_ptr
,
0xff
,
IO_BITMAP_BYTES
);
memset
(
bitmap
,
0xff
,
IO_BITMAP_BYTES
);
t
->
io_bitmap_ptr
=
bitmap
;
}
/*
* do it in the per-thread copy and in the TSS ...
*/
set_bitmap
(
(
unsigned
long
*
)
t
->
io_bitmap_ptr
,
from
,
num
,
!
turn_on
);
set_bitmap
(
t
->
io_bitmap_ptr
,
from
,
num
,
!
turn_on
);
tss
=
init_tss
+
get_cpu
();
if
(
tss
->
io_map_base
!=
IO_BITMAP_OFFSET
)
{
memcpy
(
tss
->
io_bitmap
,
t
->
io_bitmap_ptr
,
sizeof
(
tss
->
io_bitmap
));
tss
->
io_map_base
=
IO_BITMAP_OFFSET
;
if
(
tss
->
io_bitmap_base
==
IO_BITMAP_OFFSET
)
{
/* already active? */
set_bitmap
(
tss
->
io_bitmap
,
from
,
num
,
!
turn_on
);
}
else
{
set_bitmap
((
unsigned
long
*
)
tss
->
io_bitmap
,
from
,
num
,
!
turn_on
);
memcpy
(
tss
->
io_bitmap
,
t
->
io_bitmap_ptr
,
IO_BITMAP_BYTES
);
tss
->
io_bitmap_base
=
IO_BITMAP_OFFSET
;
/* Activate it in the TSS */
}
put_cpu
();
return
0
;
...
...
This diff is collapsed.
Click to expand it.
arch/x86_64/kernel/process.c
View file @
12770fac
...
...
@@ -209,7 +209,7 @@ void exit_thread(void)
if
(
me
->
thread
.
io_bitmap_ptr
)
{
kfree
(
me
->
thread
.
io_bitmap_ptr
);
me
->
thread
.
io_bitmap_ptr
=
NULL
;
(
init_tss
+
smp_processor_id
())
->
io_map_base
=
(
init_tss
+
smp_processor_id
())
->
io_
bit
map_base
=
INVALID_IO_BITMAP_OFFSET
;
}
}
...
...
@@ -312,11 +312,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp,
asm
(
"movl %%ds,%0"
:
"=m"
(
p
->
thread
.
ds
));
if
(
unlikely
(
me
->
thread
.
io_bitmap_ptr
!=
NULL
))
{
p
->
thread
.
io_bitmap_ptr
=
kmalloc
(
(
IO_BITMAP_
SIZE
+
1
)
*
4
,
GFP_KERNEL
);
p
->
thread
.
io_bitmap_ptr
=
kmalloc
(
IO_BITMAP_
BYTES
,
GFP_KERNEL
);
if
(
!
p
->
thread
.
io_bitmap_ptr
)
return
-
ENOMEM
;
memcpy
(
p
->
thread
.
io_bitmap_ptr
,
me
->
thread
.
io_bitmap_ptr
,
(
IO_BITMAP_SIZE
+
1
)
*
4
);
memcpy
(
p
->
thread
.
io_bitmap_ptr
,
me
->
thread
.
io_bitmap_ptr
,
IO_BITMAP_BYTES
);
}
/*
...
...
@@ -449,9 +448,8 @@ struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *
* bad either. Anyone got something better?
* This only affects processes which use ioperm().
*/
memcpy
(
tss
->
io_bitmap
,
next
->
io_bitmap_ptr
,
IO_BITMAP_SIZE
*
sizeof
(
u32
));
tss
->
io_map_base
=
IO_BITMAP_OFFSET
;
memcpy
(
tss
->
io_bitmap
,
next
->
io_bitmap_ptr
,
IO_BITMAP_BYTES
);
tss
->
io_bitmap_base
=
IO_BITMAP_OFFSET
;
}
else
{
/*
* a bitmap offset pointing outside of the TSS limit
...
...
@@ -459,7 +457,7 @@ struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *
* tries to use a port IO instruction. The first
* sys_ioperm() call sets up the bitmap properly.
*/
tss
->
io_map_base
=
INVALID_IO_BITMAP_OFFSET
;
tss
->
io_
bit
map_base
=
INVALID_IO_BITMAP_OFFSET
;
}
}
...
...
This diff is collapsed.
Click to expand it.
arch/x86_64/kernel/setup64.c
View file @
12770fac
...
...
@@ -288,7 +288,12 @@ void __init cpu_init (void)
estacks
+=
EXCEPTION_STKSZ
;
}
t
->
io_map_base
=
INVALID_IO_BITMAP_OFFSET
;
t
->
io_bitmap_base
=
INVALID_IO_BITMAP_OFFSET
;
/*
* This is required because the CPU will access up to
* 8 bits beyond the end of the IO permission bitmap.
*/
t
->
io_bitmap
[
IO_BITMAP_LONGS
]
=
~
0UL
;
atomic_inc
(
&
init_mm
.
mm_count
);
me
->
active_mm
=
&
init_mm
;
...
...
This diff is collapsed.
Click to expand it.
drivers/base/power/resume.c
View file @
12770fac
...
...
@@ -82,3 +82,20 @@ void device_pm_power_up(void)
sysdev_resume
();
dpm_power_up
();
}
/**
* device_resume - resume all the devices in the system
* @level: stage of resume process we're at
*
* This function is deprecated, and should be replaced with appropriate
* calls to device_pm_power_up() and device_pm_resume() above.
*/
void
device_resume
(
u32
level
)
{
printk
(
"%s is deprecated. Called from:
\n
"
,
__FUNCTION__
);
dump_stack
();
}
EXPORT_SYMBOL
(
device_resume
);
This diff is collapsed.
Click to expand it.
drivers/base/power/suspend.c
View file @
12770fac
...
...
@@ -123,3 +123,24 @@ int device_pm_power_down(u32 state)
dpm_power_up
();
goto
Done
;
}
/**
* device_suspend - suspend all devices on the device ree
* @state: state we're entering
* @level: Stage of suspend sequence we're in.
*
*
* This function is deprecated. Calls should be replaced with
* appropriate calls to device_pm_suspend() and device_pm_power_down().
*/
int
device_suspend
(
u32
state
,
u32
level
)
{
printk
(
"%s Called from:
\n
"
,
__FUNCTION__
);
dump_stack
();
return
-
EFAULT
;
}
EXPORT_SYMBOL
(
device_suspend
);
This diff is collapsed.
Click to expand it.
drivers/char/pcxx.c
View file @
12770fac
...
...
@@ -142,8 +142,6 @@ static struct tty_driver *pcxe_driver;
static
struct
timer_list
pcxx_timer
;
DECLARE_TASK_QUEUE
(
tq_pcxx
);
static
void
pcxxpoll
(
unsigned
long
dummy
);
static
void
fepcmd
(
struct
channel
*
,
int
,
int
,
int
,
int
,
int
);
static
void
pcxe_put_char
(
struct
tty_struct
*
,
unsigned
char
);
...
...
@@ -161,7 +159,6 @@ static void receive_data(struct channel *);
static
void
pcxxparam
(
struct
tty_struct
*
,
struct
channel
*
ch
);
static
void
do_softint
(
void
*
);
static
inline
void
pcxe_sched_event
(
struct
channel
*
,
int
);
static
void
do_pcxe_bh
(
void
);
static
void
pcxe_start
(
struct
tty_struct
*
);
static
void
pcxe_stop
(
struct
tty_struct
*
);
static
void
pcxe_throttle
(
struct
tty_struct
*
);
...
...
@@ -220,7 +217,6 @@ static void pcxe_cleanup()
save_flags
(
flags
);
cli
();
del_timer_sync
(
&
pcxx_timer
);
remove_bh
(
DIGI_BH
);
if
((
e1
=
tty_unregister_driver
(
pcxe_driver
)))
printk
(
"SERIAL: failed to unregister serial driver (%d)
\n
"
,
e1
);
...
...
@@ -312,8 +308,7 @@ static inline void assertmemoff(struct channel *ch)
static
inline
void
pcxe_sched_event
(
struct
channel
*
info
,
int
event
)
{
info
->
event
|=
1
<<
event
;
queue_task
(
&
info
->
tqueue
,
&
tq_pcxx
);
mark_bh
(
DIGI_BH
);
schedule_work
(
&
info
->
tqueue
);
}
static
void
pcxx_error
(
int
line
,
char
*
msg
)
...
...
@@ -1150,8 +1145,6 @@ int __init pcxe_init(void)
}
memset
(
digi_channels
,
0
,
sizeof
(
struct
channel
)
*
nbdevs
);
init_bh
(
DIGI_BH
,
do_pcxe_bh
);
init_timer
(
&
pcxx_timer
);
pcxx_timer
.
function
=
pcxxpoll
;
...
...
@@ -1450,8 +1443,7 @@ int __init pcxe_init(void)
}
ch
->
brdchan
=
bc
;
ch
->
mailbox
=
gd
;
ch
->
tqueue
.
routine
=
do_softint
;
ch
->
tqueue
.
data
=
ch
;
INIT_WORK
(
&
ch
->
tqueue
,
do_softint
,
ch
);
ch
->
board
=
&
boards
[
crd
];
#ifdef DEFAULT_HW_FLOW
ch
->
digiext
.
digi_flags
=
RTSPACE
|
CTSPACE
;
...
...
@@ -2254,11 +2246,6 @@ static void pcxe_set_termios(struct tty_struct *tty, struct termios *old_termios
}
static
void
do_pcxe_bh
(
void
)
{
run_task_queue
(
&
tq_pcxx
);
}
static
void
do_softint
(
void
*
private_
)
{
...
...
This diff is collapsed.
Click to expand it.
drivers/char/pcxx.h
View file @
12770fac
...
...
@@ -85,10 +85,10 @@ struct channel {
int
count
;
int
blocked_open
;
int
close_delay
;
int
event
;
unsigned
long
event
;
wait_queue_head_t
open_wait
;
wait_queue_head_t
close_wait
;
struct
tq
_struct
tqueue
;
struct
work
_struct
tqueue
;
/* ------------ Async control data ------------- */
unchar
modemfake
;
/* Modem values to be forced */
unchar
modem
;
/* Force values */
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
Next
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