Commit 2651e5f8 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.23

parent cbb79dc1
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 22
SUBLEVEL = 23
all: Version zImage
......
......@@ -289,7 +289,7 @@ _tmp_floppy_area:
* data (18*2*512 bytes).
*/
_floppy_track_buffer:
.fill 512*2*18,1,0
.fill 512*2*36,1,0
/* This is the default interrupt "handler" :-) */
int_msg:
......
This README belongs to release 1.6 of the SoundBlaster Pro (Matsushita,
This README belongs to release 2.0 of the SoundBlaster Pro (Matsushita,
Kotobuki, Panasonic, CreativeLabs) CD-ROM driver for Linux.
The driver is able to drive the whole family of IDE-style
Matsushita/Kotobuki/Panasonic drives (the "double speed" versions like CR-562
and CR-563, too), and it will work with the soundcard interfaces (SB Pro,
SB 16, Galaxy, SoundFX, ...) and/or with the "no-sound" cards (Panasonic
CI-101P, LaserMate, Aztech, ...).
CI-101P, LaserMate, WDH-7001C, Aztech, ...).
It should work too now with the "configurable" interface "Sequoia S-1000",
which is found on the Spea Media FX sound card.
The interface type has to get configured in /usr/include/linux/sbpcd.h,
......@@ -16,7 +16,10 @@ but it should work with "old" drives <2.01 ... >3.00 and with "new" drives
(which count the releases around 0.75 or 1.00).
Up to 4 drives are supported. CR-52x ("old") and CR-56x ("new") drives can be
mixed, but the CR-521 ones are hard-wired to drive ID 0.
mixed, but the CR-521 ones are hard-wired to drive ID 0. The drives have to
use different drive IDs, and each drive has to get a unique minor number
(0...3), corresponding to it's drive ID. The drive IDs may be selected freely
from 0 to 3 - they must not be in consecutive order.
As Don Carroll, don@ds9.us.dell.com or FIDO 1:382/14, told me, it is possible
to change old drives to any ID, too. He writes in this sense:
......@@ -35,17 +38,20 @@ to change old drives to any ID, too. He writes in this sense:
did not work with other values. If the values are not good,
ID 3 behaves like ID 0."
The drives have to use different drive IDs, but the same controller (it will
be a little bit harder to support up to four interface cards - but I plan to
do it the day somebody wishes to connect a fifth drive).
Each drive has to get a unique minor number (0...3), corresponding to it's
drive ID. The drive IDs may be selected freely from 0 to 3 - they must not be
in consecutive order.
To use more than 4 drives (now that the single-speed CR-521's are as cheap as
50$), you have to "duplicate" the driver. Just copy sbpcd.c into sbpcd2.c and
change SBPCD_ISSUE accordingly.
The driver supports reading of data from the CD and playing of audio tracks.
The audio part should run with WorkMan, xcdplayer, with the "non-X11" products
CDplayer and WorkBone - tell me if it is not compatible with other software.
With the "new" drive family CR-562 and CR-563, the reading of audio frames is
possible. This is currently implemented by an IOCTL function which reads only
one frame of 2352 bytes at a time. The transfer rate is as slow as 32 kB/sec.
This will get better, and the software interface may change. We have to
standardize it the day the SCSI driver supports it too.
MultiSession is supported (even my "old" CR-521 can handle it), "ManySession"
(not recommended, see below) alternatively.
Photo CDs work, too. At ftp.gwdg.de:/pub/linux/hpcdtoppm/ is Hadmut Danisch's
......@@ -106,6 +112,10 @@ To install:
So, if the DOS driver tells you have drive id #3, you have to
mknod /dev/<any_name> b 25 3
For a second interface board, you have to make nodes like
mknod /dev/sbpcd4 b 26 0
and so on. Use the MAJORs 26, 27, 28.
If you further make a link like
ln -s sbpcd /dev/cdrom
you can use the name /dev/cdrom, too.
......@@ -142,7 +152,12 @@ Those "many-session" CDs can get made by CDROM writers like Philips CDD 521.
If you enable this feature, it is impossible to read true multisession CDs.
The driver uses the "variable BLOCK_SIZE" feature. To use it, you have to
specify "block=2048" as a mount option.
specify "block=2048" as a mount option. Doing this will disable the direct
execution of a binary from the CD; you have to copy it to a device with the
standard BLOCK_SIZE (1024) before. So, do not use this if your system is
directly "running from the CDROM" (like some of YGGDRASIL's installation
variants). There are CDs on the market (like the german "unifix" Linux
distribution) which MUST get handled with a block_size of 1024.
Auto-probing at boot time:
......@@ -199,6 +214,133 @@ The program CDplayer likes to talk to "/dev/mcd" only, xcdplayer wants
them without the need of supplying parameters.
Copying audio tracks:
---------------------
The following little program will copy track 2 of an audio CD into the file
"track02":
/*=================== begin program ========================================*/
/*
* read an audio track from a CD
*
* (c) 1994 Eberhard Moenkeberg <emoenke@gwdg.de>
* may be used & enhanced freely
*
* Due to non-existent sync bytes at the beginning of each audio frame,
* it is currently a kind of fortune if two consecutive frames fit together.
* Usually, they overlap, or a little piece is missing. This has to get
* fixed by higher-level software (reading until an overlap occurs, and then
* eliminate the overlapping bytes). Possibly the first read bytes of each
* frame must get discarded because they are read before we got synchronized.
*
* This example program further is missing to obtain the SubChannel data
* which belong to each frame.
*/
#include <stdio.h>
#include <sys/ioctl.h>
#include <linux/cdrom.h>
static struct cdrom_tochdr hdr;
static struct cdrom_tocentry entry[100];
static struct cdrom_read_audio arg;
static u_char buffer[CD_FRAMESIZE_RAW];
static int datafile, drive;
static int i, j, limit, track, err;
static char filename[32];
main(int argc, char *argv[])
{
/*
* open /dev/cdrom
*/
drive=open("/dev/cdrom", 0);
if (drive<0)
{
fprintf(stderr, "can't open drive.\n");
exit (-1);
}
/*
* get TocHeader
*/
fprintf(stdout, "getting TocHeader...\n");
err=ioctl(drive, CDROMREADTOCHDR, &hdr);
if (err!=0)
{
fprintf(stderr, "can't get TocHeader (error %d).\n", err);
exit (-1);
}
else
fprintf(stdout, "TocHeader: %d %d\n", hdr.cdth_trk0, hdr.cdth_trk1);
/*
* get and display all TocEntries
*/
fprintf(stdout, "getting TocEntries...\n");
for (i=1;i<=hdr.cdth_trk1;i++)
{
entry[i].cdte_track = i;
entry[i].cdte_format = CDROM_LBA;
err=ioctl(drive, CDROMREADTOCENTRY, &entry[i]);
if (err!=0)
{
fprintf(stderr, "can't get TocEntry #%d (error %d).\n", i, err);
exit (-1);
}
else
{
fprintf(stdout, "TocEntry #%d: %1X %1X %06X %02X\n",
entry[i].cdte_track,
entry[i].cdte_adr,
entry[i].cdte_ctrl,
entry[i].cdte_addr.lba,
entry[i].cdte_datamode);
}
}
fprintf(stdout, "got all TocEntries.\n");
/*
* ask for track number (not implemented here)
*/
track=2;
#if 0 /* just read a little piece */
entry[track].cdte_addr.lba=170;
entry[track+1].cdte_addr.lba=190;
#endif
/*
* read track into file
*/
sprintf(filename, "track%02d\0", track);
datafile=creat(filename, 0755);
if (datafile<0)
{
fprintf(stderr, "can't open datafile %s.\n", filename);
exit (-1);
}
arg.addr.lba=entry[track].cdte_addr.lba;
arg.addr_format=CDROM_LBA; /* CDROM_MSF is still buggy, I know that */
arg.nframes=1;
arg.buf=&buffer[0];
limit=entry[track+1].cdte_addr.lba;
for (i=arg.addr.lba;i<limit;i++)
{
err=ioctl(drive, CDROMREADAUDIO, &arg);
if (err!=0)
{
fprintf(stderr, "can't read frame #%d (error %d).\n",
i-entry[track].cdte_addr.lba+1, err);
exit (-1);
}
j=write(datafile, &buffer[0], CD_FRAMESIZE_RAW);
if (j!=CD_FRAMESIZE_RAW)
{
fprintf(stderr,"I/O error (datafile) at frame %d\n",
i-entry[track].cdte_addr.lba+1);
}
arg.addr.lba++;
}
}
/*===================== end program ========================================*/
Known problems:
---------------
......@@ -212,9 +354,6 @@ All attempts to read the UPC/EAN code result in a stream of zeroes. All my
drives are telling there is no UPC/EAN code on disk or there is, but it is an
all-zero number.
My attempts to read audio tracks like data files are of no success. Contact me,
if you have an idea, please.
Bug reports, comments, wishes, donations (technical information is a donation,
too :-) etc. to
emoenke@gwdg.de
......
......@@ -64,9 +64,15 @@
* work.
*/
/* 1994/6/24 --bbroad-- added the floppy table entries and made
* minor modifications to allow 2.88 floppies to be run.
*/
#define REALLY_SLOW_IO
#define FLOPPY_IRQ 6
#define FLOPPY_DMA 2
#define FDC_FIFO_UNTESTED /* -bb */
#include <linux/sched.h>
#include <linux/fs.h>
......@@ -77,6 +83,7 @@
#include <linux/errno.h>
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/segment.h>
......@@ -110,13 +117,14 @@ static unsigned char running = 0;
* Maximum disk size (in kilobytes). This default is used whenever the
* current disk size is unknown.
*/
#define MAX_DISK_SIZE 1440
#define MAX_DISK_SIZE 2880 /* was 1440 -bb */
/*
* Maximum number of sectors in a track buffer. Track buffering is disabled
* if tracks are bigger.
*/
#define MAX_BUFFER_SECTORS 18
#define MAX_BUFFER_SECTORS 36 /* was 18 -bb */
/*
* The DMA channel used by the floppy controller cannot access data at
......@@ -154,6 +162,8 @@ static struct floppy_struct floppy_type[] = {
{ 720, 9,2,40,1,0x23,0x01,0xDF,0x50,NULL }, /* 360kB in 1.2MB drive */
{ 1440, 9,2,80,0,0x23,0x01,0xDF,0x50,NULL }, /* 720kB in 1.2MB drive */
{ 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,NULL }, /* 1.44MB diskette */
{ 5760,36,2,80,0,0x1B,0x43,0xAF,0x54,NULL }, /* 2.88MB diskette */
{ 5760,36,2,80,0,0x1B,0x43,0xAF,0x54,NULL }, /* 2.88MB diskette */
};
/*
......@@ -170,6 +180,10 @@ static struct floppy_struct floppy_types[] = {
{ 1440, 9,2,80,0,0x2A,0x02,0xDF,0x50,"720k" }, /* 3.5" 720kB diskette */
{ 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,"1.44M" }, /* 1.44MB diskette */
{ 1440, 9,2,80,0,0x2A,0x02,0xDF,0x50,"720k/AT" }, /* 3.5" 720kB diskette */
{ 5760,36,2,80,0,0x1B,0x43,0xAF,0x54,"2.88M-AMI" }, /* DUMMY */
{ 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,"1.44M-AMI" }, /* Dummy */
{ 5760,36,2,80,0,0x1B,0x43,0xAF,0x54,"2.88M" }, /* 2.88MB diskette */
{ 2880,18,2,80,0,0x1B,0x40,0xCF,0x6C,"1.44MX" }, /* 1.44MB diskette */
};
/* Auto-detection: Disk type used until the next media change occurs. */
......@@ -186,13 +200,14 @@ struct floppy_struct user_params[4];
static int floppy_sizes[] ={
MAX_DISK_SIZE, MAX_DISK_SIZE, MAX_DISK_SIZE, MAX_DISK_SIZE,
360, 360 ,360, 360,
360, 360, 360, 360,
1200,1200,1200,1200,
360, 360, 360, 360,
720, 720, 720, 720,
360, 360, 360, 360,
720, 720, 720, 720,
1440,1440,1440,1440
1440,1440,1440,1440,
2880,2880,2880,2880 /* -bb */
};
/*
......@@ -269,6 +284,11 @@ extern char tmp_floppy_area[BLOCK_SIZE];
extern char floppy_track_buffer[512*2*MAX_BUFFER_SECTORS];
static void redo_fd_request(void);
static void floppy_ready(void);
static void recalibrate_floppy(void);
static int floppy_grab_irq_and_dma(void);
static void floppy_release_irq_and_dma(void);
/*
* These are global variables, as that's the easiest way to give
......@@ -290,9 +310,7 @@ static unsigned char track = 0;
static unsigned char seek_track = 0;
static unsigned char current_track = NO_TRACK;
static unsigned char command = 0;
static unsigned char fdc_version = FDC_TYPE_STD; /* FDC version code */
static void floppy_ready(void);
static unsigned char fdc_version = 0x90; /* FDC version code */
static void select_callback(unsigned long unused)
{
......@@ -794,8 +812,6 @@ static void transfer(void)
* Special case - used after a unexpected interrupt (or reset)
*/
static void recalibrate_floppy(void);
static void recal_interrupt(void)
{
output_byte(FD_SENSEI);
......@@ -1237,7 +1253,7 @@ static struct floppy_struct *find_base(int drive,int code)
{
struct floppy_struct *base;
if (code > 0 && code < 5) {
if (code > 0 && code < 7) { /* -bb*/
base = &floppy_types[(code-1)*2];
printk("fd%d is %s",drive,base->name);
return base;
......@@ -1273,6 +1289,9 @@ static int floppy_open(struct inode * inode, struct file * filp)
int drive;
int old_dev;
if (floppy_grab_irq_and_dma()) {
return -EBUSY;
}
drive = inode->i_rdev & 3;
old_dev = fd_device[drive];
if (fd_ref[drive])
......@@ -1295,6 +1314,7 @@ static void floppy_release(struct inode * inode, struct file * filp)
printk("floppy_release with fd_ref == 0");
fd_ref[inode->i_rdev & 3] = 0;
}
floppy_release_irq_and_dma();
}
static struct file_operations floppy_fops = {
......@@ -1360,10 +1380,6 @@ void floppy_init(void)
timer_table[FLOPPY_TIMER].fn = floppy_shutdown;
timer_active &= ~(1 << FLOPPY_TIMER);
config_types();
if (irqaction(FLOPPY_IRQ,&floppy_sigaction))
printk("Unable to grab IRQ%d for the floppy driver\n", FLOPPY_IRQ);
if (request_dma(FLOPPY_DMA))
printk("Unable to grab DMA%d for the floppy driver\n", FLOPPY_DMA);
/* Try to determine the floppy controller type */
DEVICE_INTR = ignore_interrupt; /* don't ask ... */
output_byte(FD_VERSION); /* get FDC version code */
......@@ -1382,9 +1398,31 @@ void floppy_init(void)
* properly, so force a reset for the standard FDC clones,
* to avoid interrupt garbage.
*/
if (fdc_version == FDC_TYPE_STD) {
initial_reset_flag = 1;
reset_floppy();
}
}
static int floppy_grab_irq_and_dma(void)
{
if (irqaction(FLOPPY_IRQ,&floppy_sigaction)) {
printk("Unable to grab IRQ%d for the floppy driver\n", FLOPPY_IRQ);
return -1;
}
if (request_dma(FLOPPY_DMA)) {
printk("Unable to grab DMA%d for the floppy driver\n", FLOPPY_DMA);
free_irq(FLOPPY_IRQ);
return -1;
}
enable_irq(FLOPPY_IRQ);
return 0;
}
static void floppy_release_irq_and_dma(void)
{
disable_dma(FLOPPY_DMA);
free_dma(FLOPPY_DMA);
disable_irq(FLOPPY_IRQ);
free_irq(FLOPPY_IRQ);
}
This diff is collapsed.
......@@ -967,9 +967,12 @@ static int normal_select(struct tty_struct * tty, struct inode * inode,
return 1;
if (tty_hung_up_p(file))
return 1;
if (!tty->read_wait)
tty->minimum_to_wake = MIN_CHAR(tty) ?
MIN_CHAR(tty) : 1;
if (!tty->read_wait) {
if (MIN_CHAR(tty) && !TIME_CHAR(tty))
tty->minimum_to_wake = MIN_CHAR(tty);
else
tty->minimum_to_wake = 1;
}
select_wait(&tty->read_wait, wait);
return 0;
case SEL_OUT:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -255,13 +255,13 @@ static int aout_core_dump(long signr, struct pt_regs * regs)
dump_start = dump.u_tsize << 12;
dump_size = dump.u_dsize << 12;
DUMP_WRITE(dump_start,dump_size);
};
}
/* Now prepare to dump the stack area */
if (dump.u_ssize != 0) {
dump_start = dump.start_stack;
dump_size = dump.u_ssize << 12;
DUMP_WRITE(dump_start,dump_size);
};
}
/* Finally dump the task struct. Not be used by gdb, but could be useful */
set_fs(KERNEL_DS);
DUMP_WRITE(current,sizeof(*current));
......@@ -854,8 +854,8 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
if (error != N_TXTADDR(ex)) {
sys_close(fd);
send_sig(SIGSEGV, current, 0);
return 0;
};
return -EINVAL;
}
}
error = do_mmap(file, N_TXTADDR(ex) + ex.a_text, ex.a_data,
......@@ -864,8 +864,8 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
sys_close(fd);
if (error != N_TXTADDR(ex) + ex.a_text) {
send_sig(SIGSEGV, current, 0);
return 0;
};
return -EINVAL;
}
current->executable = bprm->inode;
bprm->inode->i_count++;
}
......
......@@ -18,6 +18,7 @@ static char bin_extensions[] =
"EXECOMBINAPPSYSDRVOVLOVROBJLIBDLLPIF" /* program code */
"ARCZIPLHALZHZOOTARZ ARJ" /* common archivers */
"TZ TAZTZPTPZ" /* abbreviations of tar.Z and tar.zip */
"GZ TGZDEB" /* .gz, .tar.gz and Debian packages */
"GIFBMPTIFGL JPGPCX" /* graphics */
"TFMVF GF PK PXLDVI"; /* TeX */
......
......@@ -466,6 +466,7 @@ static int get_maps(int pid, char *buf)
extern int get_module_list(char *);
extern int get_device_list(char *);
extern int get_filesystem_list(char *);
extern int get_ksyms_list(char *);
static int array_read(struct inode * inode, struct file * file,char * buf, int count)
{
......@@ -529,6 +530,9 @@ static int array_read(struct inode * inode, struct file * file,char * buf, int c
case 19:
length = get_filesystem_list(page);
break;
case 20:
length = get_ksyms_list(page);
break;
default:
free_page((unsigned long) page);
return -EBADF;
......
......@@ -69,6 +69,7 @@ static struct proc_dir_entry root_dir[] = {
{17,4,"stat" },
{18,7,"devices" },
{19,11,"filesystems" },
{20,5,"ksyms" },
};
#define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0])))
......
/****************************************************************************************
* *
* SCSI header library for linux *
* general (not only SCSI) header library for linux CDROM drivers *
* (C) 1992 David Giller rafetmad@oxy.edu *
* 1994 Eberhard Moenkeberg emoenke@gwdg.de ("read audio" and some other stuff) *
* *
* <linux/cdrom.h> -- CD-ROM IOCTLs and structs *
* *
......@@ -10,6 +11,20 @@
#ifndef _LINUX_CDROM_H
#define _LINUX_CDROM_H
/*
* some fix numbers
*/
#define CD_MINS 75 /* minutes per CD */
#define CD_SECS 60 /* seconds per minute */
#define CD_FRAMES 75 /* frames per second */
#define CD_FRAMESIZE 2048 /* bytes per frame, cooked mode */
#define CD_FRAMESIZE_XA 2340 /* bytes per frame, "xa" mode */
#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
#define CD_FRAMESIZE_SUB 96 /* subchannel data size */
#define CD_BLOCK_OFFSET 150 /* offset of first logical frame */
#define CD_XA_HEAD 12 /* header size of XA frame */
#define CD_XA_TAIL 280 /* tail size of XA frame */
/*
*
* For IOCTL calls, we will commandeer byte 0x53, or 'S'.
......@@ -295,6 +310,28 @@ struct cdrom_read
int cdread_buflen;
};
/*
* preliminary extensions for transfering audio frames
* currently used by sbpcd.c
* (still may change if other drivers will use it, too):
*/
struct cdrom_read_audio
{
union
{
struct
{
u_char minute;
u_char second;
u_char frame;
} msf;
int lba;
} addr; /* frame address */
u_char addr_format; /* CDROM_LBA or CDROM_MSF */
int nframes; /* number of 2352-byte-frames to read at once, currently only 1 allowed */
u_char *buf; /* frame buffer (size: nframes*2352 bytes) */
};
#ifdef FIVETWELVE
#define CDROM_MODE1_SIZE 512
#else
......@@ -309,7 +346,7 @@ struct cdrom_read
#define CDROMPAUSE 0x5301 /* pause */
#define CDROMRESUME 0x5302 /* resume */
#define CDROMPLAYMSF 0x5303 /* (stuct cdrom_msf) */
#define CDROMPLAYMSF 0x5303 /* (struct cdrom_msf) */
/* SCMD_PLAY_AUDIO_MSF */
#define CDROMPLAYTRKIND 0x5304 /* (struct cdrom_ti) */
......@@ -336,5 +373,12 @@ struct cdrom_read
#define CDROMREADMODE1 0x530d /* (struct cdrom_read) */
/* read type-1 data */
/*
* preliminary extension for transfering audio frames
* currently used by sbpcd.c
* (still may change if other drivers will use it, too):
*/
#define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */
#endif _LINUX_CDROM_H
#ifndef _LINUX_MKTIME_H
#define _LINUX_MKTIME_H
struct mktime {
int sec;
int min;
int hour;
int day;
int mon;
int year;
};
#endif
/*
* Dynamic loading of modules into the kernel.
*
* Modified by Bjorn Ekwall <bj0rn@blox.se>
*/
#ifndef _LINUX_MODULE_H
......@@ -16,9 +18,36 @@
/* maximum length of symbol name */
#define SYM_MAX_NAME 60
struct kernel_sym { /* sent to "insmod" */
unsigned long value; /* value of symbol */
char name[SYM_MAX_NAME]; /* name of symbol */
};
struct module_ref {
struct module *module;
struct module_ref *next;
};
struct internal_symbol {
void *addr;
char *name;
};
struct symbol_table { /* received from "insmod" */
int size; /* total, including string table!!! */
int n_symbols;
int n_refs;
struct internal_symbol symbol[0]; /* actual size defined by n_symbols */
struct module_ref ref[0]; /* actual size defined by n_refs */
};
/*
* Note: The string table follows immediately after the symbol table in memory!
*/
struct module {
struct module *next;
struct module_ref *ref; /* the list of modules that refer to me */
struct symbol_table *symtab;
char *name;
int size; /* size of module in pages */
void* addr; /* address of module */
......@@ -26,19 +55,13 @@ struct module {
void (*cleanup)(void); /* cleanup routine */
};
struct mod_routines {
int (*init)(void); /* initialization routine */
void (*cleanup)(void); /* cleanup routine */
};
struct kernel_sym {
unsigned long value; /* value of symbol */
char name[SYM_MAX_NAME]; /* name of symbol */
};
extern struct module *module_list;
/* rename_module_symbol(old_name, new_name) WOW! */
extern int rename_module_symbol(char *, char *);
/*
......
......@@ -10,11 +10,25 @@
* sbpcd=0x300,LaserMate
* or
* sbpcd=0x330,SPEA
* these strings are case sensitive !!!
*
* and, if you have a second CDROM controller board,
* sbpcd2=0x310,LaserMate
* and so on.
*
* These strings are case sensitive !!!
*/
/*
* change this to select the type of your interface board:
/*
* put your CDROM port base address into CDROM_PORT
* and specify the type of your interface in SBPRO.
*
* SBPRO addresses typically are 0x0230 (=0x220+0x10), 0x0250, ...
* LASERMATE (CI-101P) adresses typically are 0x0300, 0x0310, ...
* SPEA addresses are 0x320, 0x330, 0x340, 0x350
* there are some soundcards on the market with 0x0630, 0x0650, ...
*
* example: if your SBPRO audio address is 0x220, specify 0x230.
*
*
* set SBPRO to 1 for "true" SoundBlaster card
* set SBPRO to 0 for "poor" (no sound) interface cards
......@@ -30,26 +44,65 @@
* (currently I do not know any "compatible" with SBPRO 1)
* then I can include better information with the next release.
*/
#if !(SBPCD_ISSUE-1) /* first (or if you have only one) interface board: */
#define CDROM_PORT 0x0230
#define SBPRO 1
#endif
/* ignore the rest if you have only one interface board & driver */
#if !(SBPCD_ISSUE-2) /* second interface board: */
#define CDROM_PORT 0x0370
#define SBPRO 0
#endif
#if !(SBPCD_ISSUE-3) /* third interface board: */
#define CDROM_PORT 0x0330
#define SBPRO 0
#endif
#if !(SBPCD_ISSUE-4) /* fourth interface board: */
#define CDROM_PORT 0x0340
#define SBPRO 0
#endif
/*==========================================================================*/
/*==========================================================================*/
/*
* put your CDROM port base address here:
* SBPRO addresses typically are 0x0230 (=0x220+0x10), 0x0250, ...
* LASERMATE (CI-101P) adresses typically are 0x0300, 0x0310, ...
* SPEA addresses are 0x320, 0x330, 0x340, 0x350
* there are some soundcards on the market with 0x0630, 0x0650, ...
*
* example: if your SBPRO audio address is 0x220, specify 0x230.
*
* nothing to change below here if you are not experimenting
*/
#define CDROM_PORT 0x0230
#ifndef _LINUX_SBPCD_H
#define _LINUX_SBPCD_H
/*==========================================================================*/
/*==========================================================================*/
/*
* nothing to change below here if you are not experimenting
* to fork and execute a function after some elapsed time:
* one "jifs" unit is 10 msec.
*/
#undef MY_TIMER
#undef SET_TIMER
#undef CLEAR_TIMER
#if !(SBPCD_ISSUE-1)
#define MY_TIMER SBPCD_TIMER
#endif
#if !(SBPCD_ISSUE-2)
#define MY_TIMER SBPCD2_TIMER
#endif
#if !(SBPCD_ISSUE-3)
#define MY_TIMER SBPCD3_TIMER
#endif
#if !(SBPCD_ISSUE-4)
#define MY_TIMER SBPCD4_TIMER
#endif
#define SET_TIMER(func, jifs) \
((timer_table[MY_TIMER].expires = jiffies + jifs), \
(timer_table[MY_TIMER].fn = func), \
(timer_active |= 1<<MY_TIMER))
#define CLEAR_TIMER timer_active &= ~(1<<MY_TIMER)
/*==========================================================================*/
/*==========================================================================*/
/*
......@@ -80,7 +133,8 @@
#define DBG_LCK 23 /* door (un)lock info */
#define DBG_SQ 24 /* dump SubQ frame */
#define DBG_AUD 25 /* "read audio" debugging */
#define DBG_000 26 /* unnecessary information */
#define DBG_SEQ 26 /* Sequoia interface configuration trace */
#define DBG_000 27 /* unnecessary information */
/*==========================================================================*/
/*==========================================================================*/
......@@ -206,36 +260,15 @@
#define READ_SC 0x04 /* "subchannel info": 96 bytes per frame */
#define READ_AU 0x08 /* "audio frame": 2352 bytes per frame */
/*
* preliminary extensions to cdrom.h for transfering audio frames:
*/
#define CDROMREADAUDIO 0xE0 /* IOCTL function (arg = &cdrom_aud) */
struct cdrom_aud { u_int lba; /* frame address */
u_char *buf; /* frame buffer (2352 bytes) */
};
/*
* sense byte: used only if new_drive
* only during cmd 09 00 xx ah al 00 00
*
* values: 00
* 82
* 82 "raw audio" mode
* xx from infobuf[0] after 85 00 00 00 00 00 00
*/
#define CD_MINS 75 /* minutes per CD */
#define CD_SECS 60 /* seconds per minutes */
#define CD_FRAMES 75 /* frames per second */
#define CD_FRAMESIZE 2048 /* bytes per frame, data mode */
#define CD_FRAMESIZE_XA 2340 /* bytes per frame, "xa" mode */
#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
#define CD_FRAMESIZE_SUB 96 /* subchannel data size */
#define CD_BLOCK_OFFSET 150 /* offset of first logical frame */
#define CD_XA_HEAD 12 /* header size of XA frame */
#define CD_XA_TAIL 280 /* tail size of XA frame */
/* audio status (bin) */
#define aud_00 0x00 /* Audio status byte not supported or not valid */
#define audx11 0x0b /* Audio play operation in progress */
......@@ -406,7 +439,6 @@ Read XA Parameter:
/*
* highest allowed drive number (MINOR+1)
* currently only one controller, maybe later up to 4
*/
#define NR_SBPCD 4
......@@ -429,25 +461,12 @@ Read XA Parameter:
*/
#define READ_DATA(port, buf, nr) insb(port, buf, nr)
/*==========================================================================*/
/*
* to fork and execute a function after some elapsed time:
* one "jifs" unit is 10 msec.
*/
#define SET_TIMER(func, jifs) \
((timer_table[SBPCD_TIMER].expires = jiffies + jifs), \
(timer_table[SBPCD_TIMER].fn = func), \
(timer_active |= 1<<SBPCD_TIMER))
#define CLEAR_TIMER timer_active &= ~(1<<SBPCD_TIMER)
/*==========================================================================*/
/*
* Creative Labs Programmers did this:
*/
#define MAX_TRACKS 120 /* why more than 99? */
/*==========================================================================*/
/*
* To make conversions easier (machine dependent!)
......@@ -467,3 +486,4 @@ typedef union _blk
BLK;
/*==========================================================================*/
#endif _LINUX_SBPCD_H
......@@ -71,6 +71,7 @@ extern char empty_zero_page[PAGE_SIZE];
extern int vsprintf(char *,const char *,va_list);
extern void init(void);
extern void init_IRQ(void);
extern void init_modules(void);
extern long kmalloc_init (long,long);
extern long blk_dev_init(long,long);
extern long chr_dev_init(long,long);
......@@ -399,6 +400,7 @@ asmlinkage void start_kernel(void)
init_IRQ();
sched_init();
parse_options(command_line);
init_modules();
#ifdef CONFIG_PROFILE
prof_buffer = (unsigned long *) memory_start;
prof_len = (unsigned long) &end;
......
......@@ -2,6 +2,9 @@
* Herein lies all the functions/variables that are "exported" for linkage
* with dynamically loaded kernel modules.
* Jon.
*
* Stacked module support and unified symbol table added by
* Bjorn Ekwall <bj0rn@blox.se>
*/
#include <linux/autoconf.h>
......@@ -16,12 +19,16 @@
#include <linux/interrupt.h>
#include <linux/binfmts.h>
#include <linux/personality.h>
#include <linux/module.h>
#ifdef CONFIG_INET
#include <linux/netdevice.h>
#endif
#include <asm/irq.h>
extern void *sys_call_table;
/* must match struct internal_symbol !!! */
#define X(name) { (void *) &name, "_" #name }
#ifdef CONFIG_FTAPE
......@@ -53,12 +60,14 @@ extern void netif_rx(struct sk_buff *);
extern int dev_rint(unsigned char *, long, int, struct device *);
extern void dev_tint(struct device *);
extern struct device *irq2dev_map[];
extern void dev_kfree_skb(struct sk_buff *, int);
#endif
struct {
void *addr;
const char *name;
} symbol_table[] = {
struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */
{
/* stackable module support */
X(rename_module_symbol),
/* system info variables */
X(EISA_bus),
X(wp_works_ok),
......@@ -109,6 +118,8 @@ struct {
X(irqaction),
X(request_irq),
X(free_irq),
X(enable_irq),
X(disable_irq),
X(bh_active),
X(bh_mask),
......@@ -164,7 +175,18 @@ struct {
X(dev_rint),
X(dev_tint),
X(irq2dev_map),
X(dev_kfree_skb),
#endif
/********************************************************
* Do not add anything below this line,
* as the stacked modules depend on this!
*/
{ NULL, NULL } /* mark end of table */
},
{ NULL, NULL } /* no module refs */
};
/*
int symbol_table_size = sizeof (symbol_table) / sizeof (symbol_table[0]);
*/
/*
* linux/kernel/mktime.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
#include <linux/mktime.h>
/*
* This isn't the library routine, it is only used in the kernel.
* as such, we don't care about years<1970 etc, but assume everything
* is ok. Similarly, TZ etc is happily ignored. We just do everything
* as easily as possible. Let's find something public for the library
* routines (although I think minix times is public).
*/
/*
* PS. I hate whoever though up the year 1970 - couldn't they have gotten
* a leap-year instead? I also hate Gregorius, pope or no. I'm grumpy.
*/
#define MINUTE 60
#define HOUR (60*MINUTE)
#define DAY (24*HOUR)
#define YEAR (365*DAY)
/* interestingly, we assume leap-years */
static int month[12] = {
0,
DAY*(31),
DAY*(31+29),
DAY*(31+29+31),
DAY*(31+29+31+30),
DAY*(31+29+31+30+31),
DAY*(31+29+31+30+31+30),
DAY*(31+29+31+30+31+30+31),
DAY*(31+29+31+30+31+30+31+31),
DAY*(31+29+31+30+31+30+31+31+30),
DAY*(31+29+31+30+31+30+31+31+30+31),
DAY*(31+29+31+30+31+30+31+31+30+31+30)
};
long kernel_mktime(struct mktime * time)
{
long res;
int year;
year = time->year - 70;
/* magic offsets (y+1) needed to get leapyears right.*/
res = YEAR*year + DAY*((year+1)/4);
res += month[time->mon];
/* and (y+2) here. If it wasn't a leap-year, we have to adjust */
if (time->mon>1 && ((year+2)%4))
res -= DAY;
res += DAY*(time->day-1);
res += HOUR*time->hour;
res += MINUTE*time->min;
res += time->sec;
return res;
}
This diff is collapsed.
/*
* ddi.c Implement the Device Driver Interface (DDI) routines.
* Currently, this is only used by the NET layer of LINUX,
* but it eventually might move to an upper directory of
* the system.
*
* Version: @(#)ddi.c 1.0.5 04/22/93
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
*
*
* For the moment I'm classifying DDI as 'dead'. However if/when Fred
* produces a masterpiece of design DDI may get resurrected. With the
* current kernel as modules work by Peter MacDonald they might be
* redundant anyway. Thus I've removed all but the protocol initialise.
*
* We will end up with protocol initialisers and socket family initialisers.
*/
#include <asm/segment.h>
#include <asm/system.h>
#include <linux/types.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/socket.h>
#include <linux/ddi.h>
#undef DDI_DEBUG
#ifdef DDI_DEBUG
# define PRINTK(x) printk x
#else
# define PRINTK(x) /**/
#endif
extern struct ddi_proto protocols[]; /* network protocols */
/*
* This is the function that is called by a kernel routine during
* system startup. Its purpose is to walk trough the "devices"
* table (defined above), and to call all moduled defined in it.
*/
void
ddi_init(void)
{
struct ddi_proto *pro;
PRINTK (("DDI: Starting up!\n"));
/* Kick all configured protocols. */
pro = protocols;
while (pro->name != NULL)
{
(*pro->init)(pro);
pro++;
}
/* We're all done... */
}
......@@ -2030,9 +2030,9 @@ static void tcp_conn_request(struct sock *sk, struct sk_buff *skb,
rt=ip_rt_route(saddr, NULL,NULL);
if(rt!=NULL && (rt->rt_flags&RTF_WINDOW))
sk->window_clamp=rt->rt_window;
newsk->window_clamp = rt->rt_window;
else
sk->window_clamp=0;
newsk->window_clamp = 0;
if (sk->user_mss)
newsk->mtu = sk->user_mss;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment