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
5f50b72d
Commit
5f50b72d
authored
17 years ago
by
Linus Torvalds
Browse files
Options
Download
Email Patches
Plain Diff
Import 1.1.52
parent
c3347054
Changes
46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
918 additions
and
818 deletions
+918
-818
CREDITS
CREDITS
+176
-51
Makefile
Makefile
+1
-1
arch/i386/entry.S
arch/i386/entry.S
+0
-1
drivers/block/blk.h
drivers/block/blk.h
+1
-2
drivers/block/floppy.c
drivers/block/floppy.c
+516
-407
drivers/block/hd.c
drivers/block/hd.c
+30
-32
drivers/block/ramdisk.c
drivers/block/ramdisk.c
+18
-11
drivers/char/console.c
drivers/char/console.c
+2
-1
drivers/char/lp.c
drivers/char/lp.c
+66
-1
drivers/char/n_tty.c
drivers/char/n_tty.c
+13
-20
drivers/char/tty_io.c
drivers/char/tty_io.c
+13
-0
drivers/char/tty_ioctl.c
drivers/char/tty_ioctl.c
+20
-1
drivers/net/plip.c
drivers/net/plip.c
+7
-6
drivers/sound/dma.h
drivers/sound/dma.h
+0
-266
fs/buffer.c
fs/buffer.c
+19
-8
fs/exec.c
fs/exec.c
+2
-2
fs/ext/dir.c
fs/ext/dir.c
+1
-1
fs/ext2/file.c
fs/ext2/file.c
+27
-5
fs/hpfs/hpfs.h
fs/hpfs/hpfs.h
+5
-1
fs/locks.c
fs/locks.c
+1
-1
No files found.
CREDITS
View file @
5f50b72d
...
...
@@ -7,6 +7,10 @@
Linus
----------
N: Werner Almesberger
E: almesber@bernina.ethz.ch
D: dosfs, LILO, some fd features, various other hacks here and there
N: Krishna Balasubramanian
E: balasub@cis.ohio-state.edu
D: Wrote SYS V IPC (part of standard kernel since 0.99.10)
...
...
@@ -38,8 +42,9 @@ E: becker@cesdis.gsfc.nasa.gov
D: General low-level networking hacker
D: Most of the ethercard drivers
D: Original author of the NFS server
S: 17100 Science Drive
S: Bowie, Maryland 20715
S: USRA Center of Excellence in Space Data and Information Sciences
S: Code 930.5, Goddard Space Flight Center
S: Greenbelt, Maryland 20771
S: USA
N: Stephen R. van den Berg (AKA BuGless)
...
...
@@ -48,11 +53,11 @@ D: General kernel, gcc, and libc hacker
D: Specialisation: tweaking, ensuring portability, tweaking, cleaning,
D: tweaking and occasionally debugging :-)
S: Bouwensstraat 22
S: 6369 BG
Simpelveld
S: 6369 BG Simpelveld
S: The Netherlands
N: Hennus Bergman
E: hennus@sky.nl.mugnet.org
[My uucp-fed Linux box at home]
E: hennus@sky.nl.mugnet.org [My uucp-fed Linux box at home]
D: Author and maintainer of the QIC-02 tape driver
S: The Netherlands
...
...
@@ -72,7 +77,7 @@ N: John Boyd
E: boyd@cis.ohio-state.edu
D: Co-author of wd7000 SCSI driver
S: 101 Curl Drive #591
S: Columbus, Ohio 43210
S: Columbus, Ohio 43210
S: USA
N: Andries Brouwer
...
...
@@ -82,12 +87,21 @@ S: Bessemerstraat 21
S: Amsterdam
S: The Netherlands
N: Michael Callahan
E: callahan@maths.ox.ac.uk
D: PPP for Linux
S: The Mathematical Institute
S: 25-29 St Giles
S: Oxford
S: United Kingdom
N: Remy Card
E: Remy.Card@masi.ibp.fr
D: Extended file system designer and developer
D: Second extended file system designer and developer
S: Institut Blaise Pascal
S: 4 Place Jussieu, 75252 Paris Cedex 05
S: 4 Place Jussieu
S: 75252 Paris Cedex 05
S: France
N: Ed Carp
...
...
@@ -95,14 +109,14 @@ E: ecarp@netcom.com
D: uucp, elm, pine, pico port
D: cron, at(1) developer
S: 48287 Sawleaf
S: Fremont, California
94539
S: Fremont, California 94539
S: USA
N: Raymond Chen
E: raymondc@microsoft.com
D: Author of Configure script
S: 14509 NE 39th St
,
#1096
S: Bellevue W
A
98007
S: 14509 NE 39th St
reet
#1096
S: Bellevue
,
W
ashington
98007
S: USA
N: Alan Cox
...
...
@@ -113,7 +127,6 @@ E: GW4PTS@GB7SWN (packet radio)
D: NET2Debugged author
D: Network layer debugging
D: AX.25 & IPX alpha releases
S: <No>
N: Laurence Culhane
E: loz@holmes.demon.co.uk
...
...
@@ -121,12 +134,21 @@ D: Wrote the initial alpha SLIP code
S: 81 Hood Street
S: Northampton
S: NN1 3QT
S:
England
S:
United Kingdom
N: Wayne Davison
E: davison@borland.com
D: Second extended file system co-designer
N: Todd J. Derr
E: tjd@cs.pitt.edu
D: maintainer of dual-monitor patches for 1.0+
D: MouseMan driver for selection
S: Department of Computer Science
S: University of Pittsburgh
S: Pittsburgh, Pennsylvania 15260
S: USA
N: Thomas Dunbar
E: tdunbar@vtaix.cc.vt.edu
D: TeX & METAFONT hacking/maintenance
...
...
@@ -144,19 +166,20 @@ S: 47807 Krefeld
S: Germany
N: Drew Eckhardt
E: drew@
cs.
Colorado.EDU
E: drew@Colorado.EDU
D: SCSI code
D: Assorted snippets elsewhere
D: Boot sector "..." printing
S:
538 West Laurell Court
S:
L
ou
isville
, Colorado 8002
7
S:
2255 Spruce
S:
B
ou
lder
, Colorado 80
3
02
S: USA
N: Bjorn Ekwall
E: bj0rn@blox.se
D: Driver for the D-Link parallel port Ethernet adapter
D: Extended support for loadable modules
D: D-Link pocket adapter drivers
S: Myrstuguv. 83
S: S-143 32
VARBY
S: S-143 32 VARBY
S: Sweden
N: Doug Evans
...
...
@@ -189,9 +212,15 @@ D: The Linux Support Team Erlangen
N: Lawrence Foard
E: entropy@world.std.com
D: Floppy track reading, fs code
S: Suite #108
S: 217 Park Ave.
S: Worcester Ma 01609
S: 217 Park Avenue, Suite 108
S: Worcester, Massachusetts 01609
S: USA
N: Karl Fogel
E: kfogel@cs.oberlin.edu
D: Contributor, Linux User's Guide
S: 1123 North Oak Park Avenue
S: Oak Park, Illinois 60302
S: USA
N: Nigel Gamble
...
...
@@ -201,12 +230,19 @@ S: 301 Norwood Terrace, Apartment N226
S: Boca Raton, Florida 33431-6588
S: USA
N: Jacques Gelinas
E: jacques@solucorp.qc.ca
D: Author of the Umsdos file system
S: 1326 De Val-Brillant
S: Laval, Quebec
S: Canada H7Y 1V9
N: David Gentzel
E: gentzel@nova.enet.dec.com
D: BusLogic driver and original UltraStor driver
S: Whitfield Software Services
S: 631 Idlewood Avenue
S: Carnegie, Pennsylvania
15106-1126
S: Carnegie, Pennsylvania 15106-1126
S: USA
N: Philip Gladstone
...
...
@@ -220,13 +256,21 @@ S: Augartenstrasse 40
S: D - 76137 Karlsruhe
S: Germany
N: Greg Hankins
E: gregh@cc.gatech.edu
D: fixed keyboard driver to separate LED and locking status
S: 25360 Georgia Tech Station
S: Atlanta, Georgia 30332
S: USA
N: Andrew Haylett
E: ajh@gec-mrc.co.uk
D: Selection mechanism
S: GEC-Marconi Research Centre
S: West Hanningfield Road
S: Great Baddow, Essex CM2 8HN
S: UK
S: Great Baddow
S: CM2 8HN
S: United Kingdom
N: Michael Hipp
E: mhipp@student.uni-tuebingen.de
...
...
@@ -236,11 +280,12 @@ S: D - 72072 Tuebingen
S: Germany
N: Dirk Hohndel
E: hohndel@informatik.uni-wuerzburg.de
D: XFree86
S: Universit"at W"urzburg, LS Informatik I
S: Am Hubland, 97218 W"urzburg
S: Germany
E: hohndel@aib.com
D: The XFree86[tm] Project
S: AIB Software Corporation
S: 46030 Manekin Plaza, Suite 160
S: Dulles, Virginia 20166
S: USA
N: Nick Holloway
E: alfie@dcs.warwick.ac.uk
...
...
@@ -250,7 +295,7 @@ S: Department of Computer Science
S: University of Warwick
S: Coventry
S: CV4 7AL
S: U
K
S: U
nited Kingdom
N: Ron Holt
E: ron@novell.com
...
...
@@ -270,6 +315,31 @@ S: Panoramastrasse 18
S: D-69126 Heidelberg
S: Germany
N: Ian Jackson
E: iwj10@cus.cam.ac.uk
E: ijackson@nyx.cs.du.edu
D: FAQ maintainer and poster of the daily postings
D: FSSTND group member
D: Debian core team member and maintainer of several Debian packages
S: 2 Lexington Close
S: Cambridge
S: CB3 0DS
S: United Kingdom
N: Mike Jagdis
E: jaggy@purplet.demon.co.uk
E: Mike.Jagdis@purplet.demon.co.uk
D: iBCS personalities, socket and X interfaces, x.out loader, syscalls...
D: Purple Distribution maintainer
D: UK FidoNet support
D: ISODE && PP
D: Kernel and device driver hacking
S: 280 Silverdale Road
S: Earley
S: Reading
S: RG6 2NU
S: United Kingdom
N: Michael K. Johnson
E: johnsonm@sunsite.unc.edu
D: The Linux Documentation Project
...
...
@@ -288,7 +358,7 @@ D: NET-2
D: Drivers
D: Kernel cleanups
S: Hoefbladhof 27
S: 2215 DV
Voorhout
S: 2215 DV Voorhout
S: The Netherlands
N: Olaf Kirch
...
...
@@ -313,13 +383,28 @@ N: Bas Laarhoven
E: bas@vimec.nl
D: Loadable modules and ftape driver
S: Mr. v. Boemellaan 39
S: NL-5237 KA
's-Hertogenbosch
S: NL-5237 KA 's-Hertogenbosch
S: The Netherlands
N: Kevin Lentin
E: kevinl@cs.monash.edu.au
D: NCR53C400/T130B SCSI extension to NCR5380 driver.
S: 18 Board Street
S: Doncaster VIC 3108
S: Australia
N: Mark Lord
E: mlord@bnr.ca
E: mlord@achilles.net
D: IDE drive support in hd.c
S: 33 Ridgefield Cr
S: Nepean, Ontario
S: Canada K2H 6S3
N: Warner Losh
E: imp@boulder.parcplace.com
D: Provided OI/OB for Linux, general hacker
S: 4909 Pearl East Circle Suite 200
S: 4909 Pearl East Circle
,
Suite 200
S: Boulder, Colorado 80303
S: USA
...
...
@@ -352,8 +437,8 @@ E: pat@it.com.au
D: 8 bit XT hard disk driver
D: Miscellaneous ST0x, TMC-8xx and other SCSI hacking
S: 25 McMillan Street
S: Victoria Park
,
6100
S:
Western
Australia
S: Victoria Park 6100
S: Australia
N: John A. Martin
E: jmartin@csc.com
...
...
@@ -366,6 +451,15 @@ S: 1100 West Street
S: Laurel, Maryland 20707-3587
S: USA
N: Kevin E. Martin
E: martin@cs.unc.edu
D: Developed original accelerated X servers included in XFree86
D: XF86_Mach64 (forthcoming -- please don't ask when)
D: XF86_Mach32
D: XF86_Mach8
D: XF86_8514
D: cfdisk (curses based disk partitioning program)
N: Bradley McLean
E: brad@bradpc.gaylord.com
D: Device driver hacker
...
...
@@ -411,7 +505,9 @@ D: Linux Projects Map, Linux Commercial-HOWTO
D: general Linux publicity in Germany, vacation port
D: UUCP and CNEWS binary packages for LST
S: Editorial Board iX Mag
S: Helstorfer Str. 7, D-30625 Hannover
S: Helstorfer Str. 7
S: D-30625 Hannover
S: Germany
N: Corey Minyard
E: minyard@wf-rch.cirr.com
...
...
@@ -431,7 +527,7 @@ N: Ian A. Murdock
E: imurdock@gnu.ai.mit.edu
D: Creator of Debian distribution
S: 30 White Tail Lane
S: Lafayette, Indiana 4790
6
S: Lafayette, Indiana 4790
5
S: USA
N: Johan Myreen
...
...
@@ -442,6 +538,7 @@ S: FIN-00330 Helsingfors
S: Finland
N: David C. Niemi
E: niemidc@clark.net
E: niemidc@slma.com
D: FSSTND, The XFree86 Project
D: DMA memory support, floppy driver
...
...
@@ -449,6 +546,16 @@ S: 2364 Old Trail Drive
S: Reston, Virginia 22091
S: USA
N: Michael O'Reilly
E: michael@iinet.com.au
E: oreillym@tartarus.uwa.edu.au
D: Wrote the original dynamic sized disk cache stuff. I think the only
D: part that remains is the GFP_KERNEL et al #defines. :)
S: 192 Nichsolson Road
S: Subiaco, 6008
S: Perth, Western Australia
S: Australia
N: Kai Petzke
E: wpp@marie.physik.tu-berlin.de
D: Driver for Laser Magnetic Storage CD-ROM
...
...
@@ -463,11 +570,10 @@ E: snprobst@immd4.informatik.uni-erlangen.de
D: The Linux Support Team Erlangen
N: Daniel Quinlan
E: quinlan@
bucknell.edu
E: quinlan@
yggdrasil.com
D: FSSTND Coordinator
S: Box C3529
S: Bucknell University
S: Lewisburg, Pennsylvania 17837
S: 816 Saratoga Avenue, Apartment M208
S: San Jose, California 95129
S: USA
N: Florian La Roche
...
...
@@ -481,7 +587,7 @@ S: Germany
N: Stephen Rothwell
E: sfr@pdact.pd.necisa.oz.au
D: Boot/setup/build work for setup > 2K
S: 59 Bugden Ave
S: 59 Bugden Ave
nue
S: Gowrie ACT 2904
S: Australia
...
...
@@ -510,6 +616,15 @@ S: 620 Park View Drive #206
S: Santa Clara, California 95054
S: USA
N: Rick Sladkey
E: jrs@world.std.com
D: utility hacker: Emacs, NFS server, mount, kmem-ps, UPS debugger, strace, GDB
D: library hacker: RPC, profil(3), realpath(3), regexp.h
D: kernel hacker: unnamed block devs, NFS client, fast select, precision timer
S: 24 Avon Place
S: Arlington, Massachusetts 02174
S: USA
N: Chris Smith
E: csmith@convex.com
D: HPFS filesystem
...
...
@@ -521,7 +636,7 @@ E: drew@lethe.north.net
D: iBCS2 developer
S: 22 Irvington Cres.
S: Willowdale, Ontario
S: Canada
,
M2N 2Z1
S: Canada M2N 2Z1
N: Tommy Thorn
E: Tommy.Thorn@daimi.aau.dk
...
...
@@ -579,8 +694,9 @@ S: Dept. of Computer Science
S: University of Edinburgh
S: JCMB, The King's Buildings
S: Mayfield Road
S: Edinburgh EH9 3JZ
S: Scotland, UK
S: Edinburgh
S: EH9 3JZ
S: United Kingdom
N: Thomas Uhl
E: uhl@sun1.rz.fh-heilbronn.de
...
...
@@ -591,12 +707,22 @@ S: Obere Heerbergstrasse 17
S: 97078 Wuerzburg
S: Germany
N: Jeffrey A. Uphoff
E: juphoff@nrao.edu
E: jeff.uphoff@linux.org
D: 'dip' contributor.
D: AIPS port, astronomical community support.
S: National Radio Astronomy Observatory
S: 520 Edgemont Road
S: Charlottesville, Virginia 22903
S: USA
N: Patrick Volkerding
E: volkerdi@ftp.cdrom.com
D: Produced the Slackware distribution, updated the SVGAlib
D: patches for ghostscript, worked on color 'ls', etc.
S: 301 15th Street S.
S: Moorhead, M
N
56560
S: Moorhead, M
innesota
56560
S: USA
N: Juergen Weigert
...
...
@@ -611,7 +737,7 @@ D: HOWTO coordinator and writer
D: Maintainer of sunsite.unc.edu Linux doc archives
D: Moderator, comp.os.linux.announce
S: 205 Gray Street NE
S: Wilson, North Carolina 27893
S: Wilson, North Carolina 27893
S: USA
...
...
@@ -635,7 +761,7 @@ E: gunter@mbfys.kun.nl
D: Some bug fixes in the polling printer driver (lp.c)
S: University of Nijmegen
S: Geert-Grooteplein Noord 21
S: 6525 EZ
Nijmegen
S: 6525 EZ Nijmegen
S: The Netherlands
N: Lars Wirzenius
...
...
@@ -655,8 +781,8 @@ S: Finland
N: Roger E. Wolff
E: wolff@dutecai.et.tudelft.nl
D: Written kmalloc/kfree
S: Oosterstraat 23
S: 2611 TT
Delft
S: Oosterstraat 23
S: 2611 TT Delft
S: The Netherlands
N: Frank Xia
...
...
@@ -668,15 +794,14 @@ S: USA
N: Eric Youngdale
E: ericy@cais.com
E: eric@tantalus.nrl.navy.mil
D: General kernel hacker
D: SCSI
,
iso9660
, ELF, ibcs2, clustering in buffer cache, generalized mmap.
D: SCSI iso9660
and ELF
S: 17 Canterbury Square #101
S: Alexandria, Virginia 22304
S: USA
N: Orest Zborowski
E: orestz@
microsoft
.com
E: orestz@
eskimo
.com
D: XFree86 and kernel development
S: 1507 145th Place SE #B5
S: Bellevue, Washington 98007
...
...
This diff is collapsed.
Click to expand it.
Makefile
View file @
5f50b72d
VERSION
=
1
PATCHLEVEL
=
1
SUBLEVEL
=
5
1
SUBLEVEL
=
5
2
ARCH
=
i386
...
...
This diff is collapsed.
Click to expand it.
arch/i386/entry.S
View file @
5f50b72d
...
...
@@ -541,5 +541,4 @@ _sys_call_table:
.
long
_sys_setfsuid
.
long
_sys_setfsgid
.
long
_sys_llseek
/*
140
*/
.
space
(
NR_syscalls
-
139
)*
4
.
space
(
NR_syscalls
-
140
)*
4
This diff is collapsed.
Click to expand it.
drivers/block/blk.h
View file @
5f50b72d
...
...
@@ -75,14 +75,13 @@ extern unsigned long xd_init(unsigned long mem_start, unsigned long mem_end);
#elif (MAJOR_NR == FLOPPY_MAJOR)
static
void
floppy_on
(
unsigned
int
nr
);
static
void
floppy_off
(
unsigned
int
nr
);
#define DEVICE_NAME "floppy"
#define DEVICE_INTR do_floppy
#define DEVICE_REQUEST do_fd_request
#define DEVICE_NR(device) ( ((device) & 3) | (((device) & 0x80 ) >> 5 ))
#define DEVICE_ON(device)
floppy_on(DEVICE_NR(device))
#define DEVICE_ON(device)
#define DEVICE_OFF(device) floppy_off(DEVICE_NR(device))
#elif (MAJOR_NR == HD_MAJOR)
...
...
This diff is collapsed.
Click to expand it.
drivers/block/floppy.c
View file @
5f50b72d
This diff is collapsed.
Click to expand it.
drivers/block/hd.c
View file @
5f50b72d
...
...
@@ -80,7 +80,7 @@ static int hd_error = 0;
struct
hd_i_struct
{
unsigned
int
head
,
sect
,
cyl
,
wpcom
,
lzone
,
ctl
;
};
static
struct
hd_driveid
*
hd_ident_info
[
MAX_HD
];
static
struct
hd_driveid
*
hd_ident_info
[
MAX_HD
]
=
{
0
,
}
;
#ifdef HD_TYPE
static
struct
hd_i_struct
hd_info
[]
=
{
HD_TYPE
};
...
...
@@ -275,16 +275,21 @@ static void identify_intr(void)
{
unsigned
int
dev
=
DEVICE_NR
(
CURRENT
->
dev
);
unsigned
short
stat
=
inb_p
(
HD_STATUS
);
struct
hd_driveid
id
;
struct
hd_driveid
*
id
=
hd_ident_info
[
dev
]
;
if
(
unmask_intr
[
dev
])
sti
();
if
(
stat
&
(
BUSY_STAT
|
ERR_STAT
))
printk
(
" hd%c: identity unknown
\n
"
,
dev
+
'a'
);
else
{
insw
(
HD_DATA
,
(
char
*
)
&
id
,
sizeof
(
id
)
/
2
);
/* get ID bytes */
max_mult
[
dev
]
=
id
.
max_multsect
;
if
((
id
.
cur_valid
&
1
)
&&
id
.
cur_cyls
&&
id
.
cur_heads
&&
(
id
.
cur_heads
<=
16
)
&&
id
.
cur_sectors
)
{
if
(
stat
&
(
BUSY_STAT
|
ERR_STAT
))
{
printk
(
" hd%c: non-IDE device, CHS=%d%d%d
\n
"
,
dev
+
'a'
,
hd_info
[
dev
].
cyl
,
hd_info
[
dev
].
head
,
hd_info
[
dev
].
sect
);
if
(
id
!=
NULL
)
{
hd_ident_info
[
dev
]
=
NULL
;
kfree_s
(
id
,
512
);
}
}
else
{
insw
(
HD_DATA
,
id
,
256
);
/* get ID info */
max_mult
[
dev
]
=
id
->
max_multsect
;
if
((
id
->
field_valid
&
1
)
&&
id
->
cur_cyls
&&
id
->
cur_heads
&&
(
id
->
cur_heads
<=
16
)
&&
id
->
cur_sectors
)
{
/*
* Extract the physical drive geometry for our use.
* Note that we purposely do *not* update the bios_info.
...
...
@@ -292,31 +297,24 @@ static void identify_intr(void)
* still have the same logical view as the BIOS does,
* which keeps the partition table from being screwed.
*/
hd_info
[
dev
].
cyl
=
id
.
cur_cyls
;
hd_info
[
dev
].
head
=
id
.
cur_heads
;
hd_info
[
dev
].
sect
=
id
.
cur_sectors
;
hd_info
[
dev
].
cyl
=
id
->
cur_cyls
;
hd_info
[
dev
].
head
=
id
->
cur_heads
;
hd_info
[
dev
].
sect
=
id
->
cur_sectors
;
}
fixstring
(
id
.
serial_no
,
sizeof
(
id
.
serial_no
));
fixstring
(
id
.
fw_rev
,
sizeof
(
id
.
fw_rev
));
fixstring
(
id
.
model
,
sizeof
(
id
.
model
));
fixstring
(
id
->
serial_no
,
sizeof
(
id
->
serial_no
));
fixstring
(
id
->
fw_rev
,
sizeof
(
id
->
fw_rev
));
fixstring
(
id
->
model
,
sizeof
(
id
->
model
));
printk
(
" hd%c: %.40s, %dMB w/%dKB Cache, CHS=%d/%d/%d, MaxMult=%d
\n
"
,
dev
+
'a'
,
id
.
model
,
id
.
cyls
*
id
.
heads
*
id
.
sectors
/
2048
,
id
.
buf_size
/
2
,
hd_info
[
dev
].
cyl
,
hd_info
[
dev
].
head
,
hd_info
[
dev
].
sect
,
id
.
max_multsect
);
/* save drive info for later query via HDIO_GETIDENTITY */
if
(
NULL
!=
(
hd_ident_info
[
dev
]
=
(
struct
hd_driveid
*
)
kmalloc
(
sizeof
(
id
),
GFP_ATOMIC
)))
*
hd_ident_info
[
dev
]
=
id
;
/* Quantum drives go weird at this point, so reset them! */
/* In fact, we should probably do a reset in any case in */
/* case we changed the geometry */
if
(
!
strncmp
(
id
.
model
,
"QUANTUM"
,
7
))
reset
=
1
;
/* flush remaining 384 (reserved/undefined) ID bytes: */
insw
(
HD_DATA
,(
char
*
)
&
id
,
sizeof
(
id
)
/
2
);
insw
(
HD_DATA
,(
char
*
)
&
id
,
sizeof
(
id
)
/
2
);
insw
(
HD_DATA
,(
char
*
)
&
id
,
sizeof
(
id
)
/
2
);
dev
+
'a'
,
id
->
model
,
id
->
cyls
*
id
->
heads
*
id
->
sectors
/
2048
,
id
->
buf_size
/
2
,
hd_info
[
dev
].
cyl
,
hd_info
[
dev
].
head
,
hd_info
[
dev
].
sect
,
id
->
max_multsect
);
/*
* Early model Quantum drives go weird at this point,
* but doing a recalibrate seems to "fix" them.
* (Doing a full reset confuses some newer model Quantums)
*/
if
(
!
strncmp
(
id
->
model
,
"QUANTUM"
,
7
))
special_op
[
dev
]
=
recalibrate
[
dev
]
=
1
;
}
#if (HD_DELAY > 0)
last_req
=
read_timer
();
...
...
@@ -1040,7 +1038,7 @@ static void hd_geninit(void)
}
hd
[
i
<<
6
].
nr_sects
=
bios_info
[
i
].
head
*
bios_info
[
i
].
sect
*
bios_info
[
i
].
cyl
;
hd_ident_info
[
i
]
=
NULL
;
hd_ident_info
[
i
]
=
(
struct
hd_driveid
*
)
kmalloc
(
512
,
GFP_KERNEL
)
;
special_op
[
i
]
=
1
;
}
if
(
NR_HD
)
{
...
...
This diff is collapsed.
Click to expand it.
drivers/block/ramdisk.c
View file @
5f50b72d
...
...
@@ -22,6 +22,7 @@
#define RAMDISK_MINOR 1
extern
void
wait_for_keypress
(
void
);
char
*
rd_start
;
int
rd_length
=
0
;
...
...
@@ -102,7 +103,7 @@ static void do_load(void)
int
i
=
1
;
int
nblocks
;
char
*
cp
;
/*
* Check for a super block on the diskette.
* The old-style boot/root diskettes had their RAM image
...
...
@@ -164,9 +165,6 @@ static void do_load(void)
}
}
int
floppy_grab_irq_and_dma
(
void
);
void
floppy_release_irq_and_dma
(
void
);
/*
* If the root device is the RAM disk, try to load it.
* In order to do this, the root device is originally set to the
...
...
@@ -174,6 +172,9 @@ void floppy_release_irq_and_dma(void);
*/
void
rd_load
(
void
)
{
struct
inode
inode
;
struct
file
filp
;
/* If no RAM disk specified, give up early. */
if
(
!
rd_length
)
return
;
...
...
@@ -184,12 +185,18 @@ void rd_load(void)
if
(
MAJOR
(
ROOT_DEV
)
!=
FLOPPY_MAJOR
)
return
;
/* ugly, ugly */
if
(
floppy_grab_irq_and_dma
())
{
printk
(
"Unable to grab floppy IRQ/DMA for loading ramdisk image
\n
"
);
return
;
/* for Slackware install disks */
printk
(
KERN_NOTICE
"VFS: Insert ramdisk floppy and press ENTER
\n
"
);
wait_for_keypress
();
memset
(
&
filp
,
0
,
sizeof
(
filp
));
memset
(
&
inode
,
0
,
sizeof
(
inode
));
inode
.
i_rdev
=
ROOT_DEV
;
filp
.
f_mode
=
1
;
/* read only */
filp
.
f_inode
=
&
inode
;
if
(
blkdev_open
(
&
inode
,
&
filp
)
==
0
){
do_load
();
if
(
filp
.
f_op
&&
filp
.
f_op
->
release
)
filp
.
f_op
->
release
(
&
inode
,
&
filp
);
}
check_disk_change
(
ROOT_DEV
);
do_load
();
floppy_release_irq_and_dma
();
}
This diff is collapsed.
Click to expand it.
drivers/char/console.c
View file @
5f50b72d
...
...
@@ -2100,7 +2100,8 @@ static void clear_selection()
*/
#define colourmap ((char *)0xa0000)
#define blackwmap ((char *)0xb0000)
/* Pauline Middelink reports that we should use 0xA0000 for the bwmap as well.. */
#define blackwmap ((char *)0xa0000)
#define cmapsz 8192
#define seq_port_reg (0x3c4)
#define seq_port_val (0x3c5)
...
...
This diff is collapsed.
Click to expand it.
drivers/char/lp.c
View file @
5f50b72d
...
...
@@ -4,6 +4,7 @@
* - Thanks much to Gunter Windau for pointing out to me where the error
* checking ought to be.
* Copyright (C) 1993 by Nigel Gamble (added interrupt code)
* Copyright (C) 1994 by Alan Cox (Modularised it)
*/
#include <linux/errno.h>
...
...
@@ -17,6 +18,24 @@
#include <asm/segment.h>
#include <asm/system.h>
/* the BIOS manuals say there can be up to 4 lpt devices
* but I have not seen a board where the 4th address is listed
* if you have different hardware change the table below
* please let me know if you have different equipment
* if you have more than 3 printers, remember to increase LP_NO
*/
struct
lp_struct
lp_table
[]
=
{
{
0x3bc
,
0
,
0
,
LP_INIT_CHAR
,
LP_INIT_TIME
,
LP_INIT_WAIT
,
NULL
,
NULL
,
},
{
0x378
,
0
,
0
,
LP_INIT_CHAR
,
LP_INIT_TIME
,
LP_INIT_WAIT
,
NULL
,
NULL
,
},
{
0x278
,
0
,
0
,
LP_INIT_CHAR
,
LP_INIT_TIME
,
LP_INIT_WAIT
,
NULL
,
NULL
,
},
};
#define LP_NO 3
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#endif
/*
* All my debugging code assumes that you debug with only one printer at
* a time. RWWH
...
...
@@ -305,7 +324,9 @@ static int lp_open(struct inode * inode, struct file * file)
}
LP_F
(
minor
)
|=
LP_BUSY
;
#ifdef MODULE
MOD_INC_USE_COUNT
;
#endif
return
0
;
}
...
...
@@ -321,6 +342,9 @@ static void lp_release(struct inode * inode, struct file * file)
}
LP_F
(
minor
)
&=
~
LP_BUSY
;
#ifdef MODULE
MOD_DEC_USE_COUNT
;
#endif
}
...
...
@@ -418,6 +442,8 @@ static struct file_operations lp_fops = {
lp_release
};
#ifndef MODULE
long
lp_init
(
long
kmem_start
)
{
int
offset
=
0
;
...
...
@@ -450,3 +476,42 @@ long lp_init(long kmem_start)
printk
(
"lp_init: no lp devices found
\n
"
);
return
kmem_start
;
}
#else
char
kernel_version
[]
=
UTS_RELEASE
;
int
init_module
(
void
)
{
int
offset
=
0
;
unsigned
int
testvalue
=
0
;
int
count
=
0
;
if
(
register_chrdev
(
LP_MAJOR
,
"lp"
,
&
lp_fops
))
{
printk
(
"unable to get major %d for line printer
\n
"
,
LP_MAJOR
);
return
-
EIO
;
}
/* take on all known port values */
for
(
offset
=
0
;
offset
<
LP_NO
;
offset
++
)
{
/* write to port & read back to check */
outb_p
(
LP_DUMMY
,
LP_B
(
offset
));
for
(
testvalue
=
0
;
testvalue
<
LP_DELAY
;
testvalue
++
)
;
testvalue
=
inb_p
(
LP_B
(
offset
));
if
(
testvalue
==
LP_DUMMY
)
{
LP_F
(
offset
)
|=
LP_EXIST
;
lp_reset
(
offset
);
printk
(
"lp_init: lp%d exists, "
,
offset
);
if
(
LP_IRQ
(
offset
))
printk
(
"using IRQ%d
\n
"
,
LP_IRQ
(
offset
));
else
printk
(
"using polling driver
\n
"
);
count
++
;
}
}
if
(
count
==
0
)
printk
(
"lp_init: no lp devices found
\n
"
);
return
0
;
}
#endif
This diff is collapsed.
Click to expand it.
drivers/char/n_tty.c
View file @
5f50b72d
...
...
@@ -453,6 +453,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
goto
handle_newline
;
}
if
(
c
==
EOF_CHAR
(
tty
))
{
if
(
tty
->
canon_head
!=
tty
->
read_head
)
set_bit
(
TTY_PUSH
,
&
tty
->
flags
);
c
=
__DISABLED_CHAR
;
goto
handle_newline
;
}
...
...
@@ -718,24 +720,6 @@ static inline void copy_from_read_buf(struct tty_struct *tty,
*
nr
-=
n
;
}
/*
* Called to gobble up an immediately following EOF when there is no
* more room in buf (this can happen if the user "pushes" some
* characters using ^D). This prevents the next read() from falsely
* returning EOF.
*/
static
inline
void
gobble_eof
(
struct
tty_struct
*
tty
)
{
cli
();
if
((
tty
->
read_cnt
)
&&
(
tty
->
read_buf
[
tty
->
read_tail
]
==
__DISABLED_CHAR
)
&&
clear_bit
(
tty
->
read_tail
,
&
tty
->
read_flags
))
{
tty
->
read_tail
=
(
tty
->
read_tail
+
1
)
&
(
N_TTY_BUF_SIZE
-
1
);
tty
->
read_cnt
--
;
}
sti
();
}
static
int
read_chan
(
struct
tty_struct
*
tty
,
struct
file
*
file
,
unsigned
char
*
buf
,
unsigned
int
nr
)
{
...
...
@@ -744,6 +728,9 @@ static int read_chan(struct tty_struct *tty, struct file *file,
unsigned
char
*
b
=
buf
;
int
minimum
,
time
;
int
retval
=
0
;
int
size
;
do_it_again:
if
(
!
tty
->
read_buf
)
{
printk
(
"n_tty_read_chan: called with read_buf == NULL?!?
\n
"
);
...
...
@@ -858,7 +845,6 @@ static int read_chan(struct tty_struct *tty, struct file *file,
put_fs_byte
(
c
,
b
++
);
if
(
--
nr
)
continue
;
gobble_eof
(
tty
);
break
;
}
if
(
--
tty
->
canon_data
<
0
)
{
...
...
@@ -896,7 +882,14 @@ static int read_chan(struct tty_struct *tty, struct file *file,
current
->
state
=
TASK_RUNNING
;
current
->
timeout
=
0
;
return
(
b
-
buf
)
?
b
-
buf
:
retval
;
size
=
b
-
buf
;
if
(
size
&&
nr
)
clear_bit
(
TTY_PUSH
,
&
tty
->
flags
);
if
(
!
size
&&
clear_bit
(
TTY_PUSH
,
&
tty
->
flags
))
goto
do_it_again
;
if
(
!
size
&&
!
retval
)
clear_bit
(
TTY_PUSH
,
&
tty
->
flags
);
return
(
size
?
size
:
retval
);
}
static
int
write_chan
(
struct
tty_struct
*
tty
,
struct
file
*
file
,
...
...
This diff is collapsed.
Click to expand it.
drivers/char/tty_io.c
View file @
5f50b72d
...
...
@@ -1242,6 +1242,9 @@ static int tty_ioctl(struct inode * inode, struct file * file,
case
TIOCSTI
:
if
((
current
->
tty
!=
tty
)
&&
!
suser
())
return
-
EPERM
;
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
1
);
if
(
retval
)
return
retval
;
ch
=
get_fs_byte
((
char
*
)
arg
);
tty
->
ldisc
.
receive_buf
(
tty
,
&
ch
,
&
mbz
,
1
);
return
0
;
...
...
@@ -1254,6 +1257,10 @@ static int tty_ioctl(struct inode * inode, struct file * file,
sizeof
(
struct
winsize
));
return
0
;
case
TIOCSWINSZ
:
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
sizeof
(
struct
winsize
));
if
(
retval
)
return
retval
;
memcpy_fromfs
(
&
tmp_ws
,
(
struct
winsize
*
)
arg
,
sizeof
(
struct
winsize
));
if
(
memcmp
(
&
tmp_ws
,
&
tty
->
winsize
,
...
...
@@ -1279,6 +1286,9 @@ static int tty_ioctl(struct inode * inode, struct file * file,
redirect
=
real_tty
;
return
0
;
case
FIONBIO
:
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
sizeof
(
long
));
if
(
retval
)
return
retval
;
arg
=
get_fs_long
((
unsigned
long
*
)
arg
);
if
(
arg
)
file
->
f_flags
|=
O_NONBLOCK
;
...
...
@@ -1371,6 +1381,9 @@ static int tty_ioctl(struct inode * inode, struct file * file,
arg
=
get_fs_long
((
unsigned
long
*
)
arg
);
return
tty_set_ldisc
(
tty
,
arg
);
case
TIOCLINUX
:
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
1
);
if
(
retval
)
return
retval
;
switch
(
get_fs_byte
((
char
*
)
arg
))
{
case
0
:
...
...
This diff is collapsed.
Click to expand it.
drivers/char/tty_ioctl.c
View file @
5f50b72d
...
...
@@ -98,6 +98,9 @@ static int set_termios(struct tty_struct * tty, unsigned long arg, int opt)
return
retval
;
if
(
opt
&
TERMIOS_TERMIO
)
{
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
sizeof
(
struct
termio
));
if
(
retval
)
return
retval
;
tmp_termios
=
*
tty
->
termios
;
memcpy_fromfs
(
&
tmp_termio
,
(
struct
termio
*
)
arg
,
sizeof
(
struct
termio
));
...
...
@@ -109,9 +112,13 @@ static int set_termios(struct tty_struct * tty, unsigned long arg, int opt)
SET_LOW_BITS
(
tmp_termios
.
c_lflag
,
tmp_termio
.
c_lflag
);
memcpy
(
&
tmp_termios
.
c_cc
,
&
tmp_termio
.
c_cc
,
NCC
);
#undef SET_LOW_BITS
}
else
}
else
{
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
sizeof
(
struct
termios
));
if
(
retval
)
return
retval
;
memcpy_fromfs
(
&
tmp_termios
,
(
struct
termios
*
)
arg
,
sizeof
(
struct
termios
));
}
if
((
opt
&
TERMIOS_FLUSH
)
&&
tty
->
ldisc
.
flush_buffer
)
tty
->
ldisc
.
flush_buffer
(
tty
);
...
...
@@ -307,6 +314,10 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
(
unsigned
long
*
)
arg
);
return
0
;
case
TIOCGLCKTRMIOS
:
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
sizeof
(
unsigned
long
));
if
(
retval
)
return
retval
;
arg
=
get_fs_long
((
unsigned
long
*
)
arg
);
retval
=
verify_area
(
VERIFY_WRITE
,
(
void
*
)
arg
,
sizeof
(
struct
termios
));
...
...
@@ -319,7 +330,15 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
case
TIOCSLCKTRMIOS
:
if
(
!
suser
())
return
-
EPERM
;
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
sizeof
(
unsigned
long
));
if
(
retval
)
return
retval
;
arg
=
get_fs_long
((
unsigned
long
*
)
arg
);
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
sizeof
(
struct
termios
));
if
(
retval
)
return
retval
;
memcpy_fromfs
(
&
real_tty
->
termios_locked
,
(
struct
termios
*
)
arg
,
sizeof
(
struct
termios
));
...
...
This diff is collapsed.
Click to expand it.
drivers/net/plip.c
View file @
5f50b72d
...
...
@@ -78,6 +78,7 @@ make one yourself. The wiring is:
#include <netinet/in.h>
#include <errno.h>
#include <linux/delay.h>
#include <linux/lp.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
...
...
@@ -196,7 +197,7 @@ plip_init(struct device *dev)
struct
net_local
*
pl
;
/* Check that there is something at base_addr. */
outb
(
0x00
,
PAR_CONTROL
(
dev
));
outb
(
LP_PINITP
,
PAR_CONTROL
(
dev
));
outb
(
0x00
,
PAR_DATA
(
dev
));
if
(
inb
(
PAR_DATA
(
dev
))
!=
0x00
)
return
-
ENODEV
;
...
...
@@ -212,9 +213,9 @@ plip_init(struct device *dev)
printk
(
"%s: configured for parallel port at %#3x"
,
dev
->
name
,
dev
->
base_addr
);
autoirq_setup
(
0
);
outb
(
0x00
,
PAR_CONTROL
(
dev
));
outb
(
0x10
,
PAR_CONTROL
(
dev
));
outb
(
0x00
,
PAR_CONTROL
(
dev
));
outb
(
LP_PINITP
|
LP_PSELECP
,
PAR_CONTROL
(
dev
));
outb
(
LP_PINITP
|
LP_PSELECP
|
LP_PINTEN
,
PAR_CONTROL
(
dev
));
outb
(
LP_PINITP
|
LP_PSELECP
,
PAR_CONTROL
(
dev
));
dev
->
irq
=
autoirq_report
(
1
);
if
(
dev
->
irq
)
printk
(
", probed IRQ %d.
\n
"
,
dev
->
irq
);
...
...
@@ -368,7 +369,7 @@ plip_open(struct device *dev)
irq2dev_map
[
dev
->
irq
]
=
dev
;
sti
();
/* enable rx interrupt. */
outb
(
0x10
,
PAR_CONTROL
(
dev
));
outb
(
LP_PINITP
|
LP_PSELECP
|
LP_PINTEN
,
PAR_CONTROL
(
dev
));
plip_device_clear
(
dev
);
dev
->
start
=
1
;
#ifdef MODULE
...
...
@@ -393,7 +394,7 @@ plip_close(struct device *dev)
/* make sure that we don't register the timer */
del_timer
(
&
lp
->
tl
);
/* release the interrupt. */
outb
(
0x00
,
PAR_CONTROL
(
dev
));
outb
(
LP_PINITP
|
LP_PSELECP
,
PAR_CONTROL
(
dev
));
#ifdef MODULE
MOD_DEC_USE_COUNT
;
#endif
...
...
This diff is collapsed.
Click to expand it.
drivers/sound/dma.h
deleted
100644 → 0
View file @
c3347054
/* $Id: dma.h,v 1.7 1992/12/14 00:29:34 root Exp root $
* linux/include/asm/dma.h: Defines for using and allocating dma channels.
* Written by Hennus Bergman, 1992.
* High DMA channel support & info by Hannu Savolainen
* and John Boyd, Nov. 1992.
*/
#ifndef _ASM_DMA_H
#define _ASM_DMA_H
#include <asm/io.h>
/* need byte IO */
#define deb_outb(x,y) {printk("out %02x, %02x\n", x, y);outb(x,y);}
#ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER
#define outb outb_p
#endif
/*
* NOTES about DMA transfers:
*
* controller 1: channels 0-3, byte operations, ports 00-1F
* controller 2: channels 4-7, word operations, ports C0-DF
*
* - ALL registers are 8 bits only, regardless of transfer size
* - channel 4 is not used - cascades 1 into 2.
* - channels 0-3 are byte - addresses/counts are for physical bytes
* - channels 5-7 are word - addresses/counts are for physical words
* - transfers must not cross physical 64K (0-3) or 128K (5-7) boundaries
* - transfer count loaded to registers is 1 less than actual count
* - controller 2 offsets are all even (2x offsets for controller 1)
* - page registers for 5-7 don't use data bit 0, represent 128K pages
* - page registers for 0-3 use bit 0, represent 64K pages
*
* DMA transfers are limited to the lower 16MB of _physical_ memory.
* Note that addresses loaded into registers must be _physical_ addresses,
* not logical addresses (which may differ if paging is active).
*
* Address mapping for channels 0-3:
*
* A23 ... A16 A15 ... A8 A7 ... A0 (Physical addresses)
* | ... | | ... | | ... |
* | ... | | ... | | ... |
* | ... | | ... | | ... |
* P7 ... P0 A7 ... A0 A7 ... A0
* | Page | Addr MSB | Addr LSB | (DMA registers)
*
* Address mapping for channels 5-7:
*
* A23 ... A17 A16 A15 ... A9 A8 A7 ... A1 A0 (Physical addresses)
* | ... | \ \ ... \ \ \ ... \ \
* | ... | \ \ ... \ \ \ ... \ (not used)
* | ... | \ \ ... \ \ \ ... \
* P7 ... P1 (0) A7 A6 ... A0 A7 A6 ... A0
* | Page | Addr MSB | Addr LSB | (DMA registers)
*
* Again, channels 5-7 transfer _physical_ words (16 bits), so addresses
* and counts _must_ be word-aligned (the lowest address bit is _ignored_ at
* the hardware level, so odd-byte transfers aren't possible).
*
* Transfer count (_not # bytes_) is limited to 64K, represented as actual
* count - 1 : 64K => 0xFFFF, 1 => 0x0000. Thus, count is always 1 or more,
* and up to 128K bytes may be transferred on channels 5-7 in one operation.
*
*/
#define MAX_DMA_CHANNELS 8
/* 8237 DMA controllers */
#define IO_DMA1_BASE 0x00
/* 8 bit slave DMA, channels 0..3 */
#define IO_DMA2_BASE 0xC0
/* 16 bit master DMA, ch 4(=slave input)..7 */
/* DMA controller registers */
#define DMA1_CMD_REG 0x08
/* command register (w) */
#define DMA1_STAT_REG 0x08
/* status register (r) */
#define DMA1_REQ_REG 0x09
/* request register (w) */
#define DMA1_MASK_REG 0x0A
/* single-channel mask (w) */
#define DMA1_MODE_REG 0x0B
/* mode register (w) */
#define DMA1_CLEAR_FF_REG 0x0C
/* clear pointer flip-flop (w) */
#define DMA1_TEMP_REG 0x0D
/* Temporary Register (r) */
#define DMA1_RESET_REG 0x0D
/* Master Clear (w) */
#define DMA1_CLR_MASK_REG 0x0E
/* Clear Mask */
#define DMA1_MASK_ALL_REG 0x0F
/* all-channels mask (w) */
#define DMA2_CMD_REG 0xD0
/* command register (w) */
#define DMA2_STAT_REG 0xD0
/* status register (r) */
#define DMA2_REQ_REG 0xD2
/* request register (w) */
#define DMA2_MASK_REG 0xD4
/* single-channel mask (w) */
#define DMA2_MODE_REG 0xD6
/* mode register (w) */
#define DMA2_CLEAR_FF_REG 0xD8
/* clear pointer flip-flop (w) */
#define DMA2_TEMP_REG 0xDA
/* Temporary Register (r) */
#define DMA2_RESET_REG 0xDA
/* Master Clear (w) */
#define DMA2_CLR_MASK_REG 0xDC
/* Clear Mask */
#define DMA2_MASK_ALL_REG 0xDE
/* all-channels mask (w) */
#define DMA_ADDR_0 0x00
/* DMA address registers */
#define DMA_ADDR_1 0x02
#define DMA_ADDR_2 0x04
#define DMA_ADDR_3 0x06
#define DMA_ADDR_4 0xC0
#define DMA_ADDR_5 0xC4
#define DMA_ADDR_6 0xC8
#define DMA_ADDR_7 0xCC
#define DMA_CNT_0 0x01
/* DMA count registers */
#define DMA_CNT_1 0x03
#define DMA_CNT_2 0x05
#define DMA_CNT_3 0x07
#define DMA_CNT_4 0xC2
#define DMA_CNT_5 0xC6
#define DMA_CNT_6 0xCA
#define DMA_CNT_7 0xCE
#define DMA_PAGE_0 0x87
/* DMA page registers */
#define DMA_PAGE_1 0x83
#define DMA_PAGE_2 0x81
#define DMA_PAGE_3 0x82
#define DMA_PAGE_5 0x8B
#define DMA_PAGE_6 0x89
#define DMA_PAGE_7 0x8A
#define DMA_MODE_READ 0x44
/* I/O to memory, no autoinit, increment, single mode */
#define DMA_MODE_WRITE 0x48
/* memory to I/O, no autoinit, increment, single mode */
#define DMA_MODE_CASCADE 0xC0
/* pass thru DREQ->HRQ, DACK<-HLDA only */
/* enable/disable a specific DMA channel */
static
__inline__
void
enable_dma
(
unsigned
int
dmanr
)
{
if
(
dmanr
<=
3
)
deb_outb
(
dmanr
,
DMA1_MASK_REG
)
else
deb_outb
(
dmanr
&
3
,
DMA2_MASK_REG
);
}
static
__inline__
void
disable_dma
(
unsigned
int
dmanr
)
{
if
(
dmanr
<=
3
)
deb_outb
(
dmanr
|
4
,
DMA1_MASK_REG
)
else
deb_outb
((
dmanr
&
3
)
|
4
,
DMA2_MASK_REG
);
}
/* Clear the 'DMA Pointer Flip Flop'.
* Write 0 for LSB/MSB, 1 for MSB/LSB access.
* Use this once to initialize the FF to a known state.
* After that, keep track of it. :-)
* --- In order to do that, the DMA routines below should ---
* --- only be used while interrupts are disabled! ---
*/
static
__inline__
void
clear_dma_ff
(
unsigned
int
dmanr
)
{
if
(
dmanr
<=
3
)
deb_outb
(
0
,
DMA1_CLEAR_FF_REG
)
else
deb_outb
(
0
,
DMA2_CLEAR_FF_REG
);
}
/* set mode (above) for a specific DMA channel */
static
__inline__
void
set_dma_mode
(
unsigned
int
dmanr
,
char
mode
)
{
if
(
dmanr
<=
3
)
deb_outb
(
mode
|
dmanr
,
DMA1_MODE_REG
)
else
deb_outb
(
mode
|
(
dmanr
&
3
),
DMA2_MODE_REG
);
}
/* Set only the page register bits of the transfer address.
* This is used for successive transfers when we know the contents of
* the lower 16 bits of the DMA current address register, but a 64k boundary
* may have been crossed.
*/
static
__inline__
void
set_dma_page
(
unsigned
int
dmanr
,
char
pagenr
)
{
switch
(
dmanr
)
{
case
0
:
deb_outb
(
pagenr
,
DMA_PAGE_0
);
break
;
case
1
:
deb_outb
(
pagenr
,
DMA_PAGE_1
);
break
;
case
2
:
deb_outb
(
pagenr
,
DMA_PAGE_2
);
break
;
case
3
:
deb_outb
(
pagenr
,
DMA_PAGE_3
);
break
;
case
5
:
deb_outb
(
pagenr
&
0xfe
,
DMA_PAGE_5
);
break
;
case
6
:
deb_outb
(
pagenr
&
0xfe
,
DMA_PAGE_6
);
break
;
case
7
:
deb_outb
(
pagenr
&
0xfe
,
DMA_PAGE_7
);
break
;
}
}
/* Set transfer address & page bits for specific DMA channel.
* Assumes dma flipflop is clear.
*/
static
__inline__
void
set_dma_addr
(
unsigned
int
dmanr
,
unsigned
int
a
)
{
set_dma_page
(
dmanr
,
a
>>
16
);
if
(
dmanr
<=
3
)
{
deb_outb
(
a
&
0xff
,
((
dmanr
&
3
)
<<
1
)
+
IO_DMA1_BASE
);
deb_outb
(
(
a
>>
8
)
&
0xff
,
((
dmanr
&
3
)
<<
1
)
+
IO_DMA1_BASE
)
}
else
{
deb_outb
(
(
a
>>
1
)
&
0xff
,
((
dmanr
&
3
)
<<
2
)
+
IO_DMA2_BASE
);
deb_outb
(
(
a
>>
9
)
&
0xff
,
((
dmanr
&
3
)
<<
2
)
+
IO_DMA2_BASE
);
}
}
/* Set transfer size (max 64k for DMA1..3, 128k for DMA5..7) for
* a specific DMA channel.
* You must ensure the parameters are valid.
* NOTE: from a manual: "the number of transfers is one more
* than the initial word count"! This is taken into account.
* Assumes dma flip-flop is clear.
* NOTE 2: "count" represents _bytes_ and must be even for channels 5-7.
*/
static
__inline__
void
set_dma_count
(
unsigned
int
dmanr
,
unsigned
int
count
)
{
count
--
;
if
(
dmanr
<=
3
)
{
deb_outb
(
count
&
0xff
,
((
dmanr
&
3
)
<<
1
)
+
1
+
IO_DMA1_BASE
);
deb_outb
(
(
count
>>
8
)
&
0xff
,
((
dmanr
&
3
)
<<
1
)
+
1
+
IO_DMA1_BASE
);
}
else
{
deb_outb
(
(
count
>>
1
)
&
0xff
,
((
dmanr
&
3
)
<<
2
)
+
2
+
IO_DMA2_BASE
);
deb_outb
(
(
count
>>
9
)
&
0xff
,
((
dmanr
&
3
)
<<
2
)
+
2
+
IO_DMA2_BASE
);
}
}
/* Get DMA residue count. After a DMA transfer, this
* should return zero. Reading this while a DMA transfer is
* still in progress will return unpredictable results.
* If called before the channel has been used, it may return 1.
* Otherwise, it returns the number of _bytes_ left to transfer.
*
* Assumes DMA flip-flop is clear.
*/
static
__inline__
int
get_dma_residue
(
unsigned
int
dmanr
)
{
unsigned
int
io_port
=
(
dmanr
<=
3
)
?
((
dmanr
&
3
)
<<
1
)
+
1
+
IO_DMA1_BASE
:
((
dmanr
&
3
)
<<
2
)
+
2
+
IO_DMA2_BASE
;
/* using short to get 16-bit wrap around */
unsigned
short
count
;
count
=
1
+
inb
(
io_port
);
count
+=
inb
(
io_port
)
<<
8
;
return
(
dmanr
<=
3
)
?
count
:
(
count
<<
1
);
}
/* These are in kernel/dma.c: */
extern
int
request_dma
(
unsigned
int
dmanr
,
char
*
deviceID
);
/* reserve a DMA channel */
extern
void
free_dma
(
unsigned
int
dmanr
);
/* release it again */
#endif
/* _ASM_DMA_H */
This diff is collapsed.
Click to expand it.
fs/buffer.c
View file @
5f50b72d
...
...
@@ -147,6 +147,7 @@ static int sync_buffers(dev_t dev, int wait)
2) wait for completion by waiting for all buffers to unlock. */
repeat:
retry
=
0
;
repeat2:
ncount
=
0
;
/* We search all lists as a failsafe mechanism, not because we expect
there to be dirty buffers on any of the other lists. */
...
...
@@ -170,6 +171,7 @@ static int sync_buffers(dev_t dev, int wait)
continue
;
}
wait_on_buffer
(
bh
);
goto
repeat2
;
}
/* If an unlocked buffer is not uptodate, there has
been an IO error. Skip it. */
...
...
@@ -183,6 +185,9 @@ static int sync_buffers(dev_t dev, int wait)
on the third pass. */
if
(
!
bh
->
b_dirt
||
pass
>=
2
)
continue
;
/* don't bother about locked buffers */
if
(
bh
->
b_lock
)
continue
;
bh
->
b_count
++
;
bh
->
b_flushtime
=
0
;
ll_rw_block
(
WRITE
,
1
,
&
bh
);
...
...
@@ -1735,31 +1740,37 @@ asmlinkage int sys_bdflush(int func, int data)
int
ncount
;
struct
buffer_head
*
bh
,
*
next
;
if
(
!
suser
())
return
-
EPERM
;
if
(
!
suser
())
return
-
EPERM
;
if
(
func
==
1
)
if
(
func
==
1
)
return
sync_old_buffers
();
/* Basically func 0 means start, 1 means read param 1, 2 means write param 1, etc */
if
(
func
>=
2
){
if
(
func
>=
2
)
{
i
=
(
func
-
2
)
>>
1
;
if
(
i
<
0
||
i
>=
N_PARAM
)
return
-
EINVAL
;
if
(
i
<
0
||
i
>=
N_PARAM
)
return
-
EINVAL
;
if
((
func
&
1
)
==
0
)
{
error
=
verify_area
(
VERIFY_WRITE
,
(
void
*
)
data
,
sizeof
(
int
));
if
(
error
)
return
error
;
if
(
error
)
return
error
;
put_fs_long
(
bdf_prm
.
data
[
i
],
data
);
return
0
;
};
if
(
data
<
bdflush_min
[
i
]
||
data
>
bdflush_max
[
i
])
return
-
EINVAL
;
if
(
data
<
bdflush_min
[
i
]
||
data
>
bdflush_max
[
i
])
return
-
EINVAL
;
bdf_prm
.
data
[
i
]
=
data
;
return
0
;
};
if
(
bdflush_running
++
)
return
-
EBUSY
;
/* Only one copy of this running at one time */
if
(
bdflush_running
)
return
-
EBUSY
;
/* Only one copy of this running at one time */
bdflush_running
++
;
/* OK, from here on is the daemon */
while
(
1
==
1
)
{
for
(;;)
{
#ifdef DEBUG
printk
(
"bdflush() activated..."
);
#endif
...
...
This diff is collapsed.
Click to expand it.
fs/exec.c
View file @
5f50b72d
...
...
@@ -728,10 +728,10 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
if
(
!
fn
)
break
;
retval
=
fn
(
&
bprm
,
regs
);
if
(
retval
=
=
0
)
{
if
(
retval
>
=
0
)
{
iput
(
bprm
.
inode
);
current
->
did_exec
=
1
;
return
0
;
return
retval
;
}
if
(
retval
!=
-
ENOEXEC
)
break
;
...
...
This diff is collapsed.
Click to expand it.
fs/ext/dir.c
View file @
5f50b72d
...
...
@@ -72,7 +72,7 @@ static int ext_readdir(struct inode * inode, struct file * filp,
if
(
!
inode
||
!
S_ISDIR
(
inode
->
i_mode
))
return
-
EBADF
;
if
(
filp
->
f_pos
%
8
!=
0
)
if
(
(
filp
->
f_pos
&
7
)
!=
0
)
return
-
EBADF
;
while
(
filp
->
f_pos
<
inode
->
i_size
)
{
offset
=
filp
->
f_pos
&
1023
;
...
...
This diff is collapsed.
Click to expand it.
fs/ext2/file.c
View file @
5f50b72d
...
...
@@ -232,11 +232,13 @@ static int ext2_file_write (struct inode * inode, struct file * filp,
{
off_t
pos
;
int
written
,
c
;
struct
buffer_head
*
bh
;
struct
buffer_head
*
bh
,
*
bufferlist
[
NBUF
]
;
char
*
p
;
struct
super_block
*
sb
;
int
err
;
int
i
,
buffercount
,
write_error
;
write_error
=
buffercount
=
0
;
if
(
!
inode
)
{
printk
(
"ext2_file_write: inode = NULL
\n
"
);
return
-
EINVAL
;
...
...
@@ -294,12 +296,32 @@ static int ext2_file_write (struct inode * inode, struct file * filp,
buf
+=
c
;
bh
->
b_uptodate
=
1
;
mark_buffer_dirty
(
bh
,
0
);
if
(
filp
->
f_flags
&
O_SYNC
)
{
ll_rw_block
(
WRITE
,
1
,
&
bh
);
wait_on_buffer
(
bh
);
if
(
filp
->
f_flags
&
O_SYNC
)
bufferlist
[
buffercount
++
]
=
bh
;
else
brelse
(
bh
);
if
(
buffercount
==
NBUF
){
ll_rw_block
(
WRITE
,
buffercount
,
bufferlist
);
for
(
i
=
0
;
i
<
buffercount
;
i
++
){
wait_on_buffer
(
bufferlist
[
i
]);
if
(
!
bufferlist
[
i
]
->
b_uptodate
)
write_error
=
1
;
brelse
(
bufferlist
[
i
]);
}
buffercount
=
0
;
}
brelse
(
bh
);
if
(
write_error
)
break
;
}
if
(
buffercount
){
ll_rw_block
(
WRITE
,
buffercount
,
bufferlist
);
for
(
i
=
0
;
i
<
buffercount
;
i
++
){
wait_on_buffer
(
bufferlist
[
i
]);
if
(
!
bufferlist
[
i
]
->
b_uptodate
)
write_error
=
1
;
brelse
(
bufferlist
[
i
]);
}
}
if
(
pos
>
inode
->
i_size
)
inode
->
i_size
=
pos
;
if
(
filp
->
f_flags
&
O_SYNC
)
...
...
This diff is collapsed.
Click to expand it.
fs/hpfs/hpfs.h
View file @
5f50b72d
...
...
@@ -92,7 +92,11 @@ struct hpfs_spare_block
{
unsigned
magic
;
/* f991 1849 */
unsigned
magic1
;
/* fa52 29c5, more magic? */
unsigned
dirty
;
/* 0 clean, 1 "improperly stopped" */
unsigned
dirty
:
1
;
/* 0 clean, 1 "improperly stopped" */
unsigned
flag1234
:
4
;
/* unknown flags */
unsigned
fast
:
1
;
/* partition was fast formatted */
unsigned
flag6to31
:
26
;
/* unknown flags */
secno
hotfix_map
;
/* info about remapped bad sectors */
unsigned
n_spares_used
;
/* number of hotfixes */
...
...
This diff is collapsed.
Click to expand it.
fs/locks.c
View file @
5f50b72d
...
...
@@ -109,7 +109,7 @@ int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l)
if
(
fd
>=
NR_OPEN
||
!
(
filp
=
current
->
files
->
fd
[
fd
]))
return
-
EBADF
;
error
=
verify_area
(
VERIFY_
WRITE
,
l
,
sizeof
(
*
l
));
error
=
verify_area
(
VERIFY_
READ
,
l
,
sizeof
(
*
l
));
if
(
error
)
return
error
;
memcpy_fromfs
(
&
flock
,
l
,
sizeof
(
flock
));
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
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