FILESYSTEMS =fs/filesystems.a
NETWORKS =net/network.a
DRIVERS =drivers/block/block.a \
- drivers/char/char.a \
+ drivers/char/char.o \
drivers/parport/parport.a
LIBS =$(TOPDIR)/lib/lib.a
SUBDIRS =kernel drivers mm fs net ipc lib
source drivers/parport/Config.in
-bool 'Advanced Power Management BIOS support' CONFIG_APM
-if [ "$CONFIG_APM" = "y" ]; then
+tristate 'Advanced Power Management BIOS support' CONFIG_APM
+if [ "$CONFIG_APM" != "n" ]; then
bool ' Ignore USER SUSPEND' CONFIG_APM_IGNORE_USER_SUSPEND
bool ' Enable PM at boot time' CONFIG_APM_DO_ENABLE
bool ' Make CPU Idle calls when idle' CONFIG_APM_CPU_IDLE
endif
endif
-ifdef CONFIG_APM
+ifeq ($(CONFIG_APM),y)
OX_OBJS += apm.o
+else
+ ifeq ($(CONFIG_APM),m)
+ MX_OBJS += apm.o
+ endif
endif
ifdef CONFIG_SMP
* In short, if something bad happens, at least we have a choice
* of just killing the apm thread..
*/
-void __init apm_init(void)
+static int __init apm_init(void)
{
static struct proc_dir_entry *ent;
kernel_thread(apm, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD);
}
+
+module_init(apm_init)
#include <linux/mm.h>
#include <linux/sched.h>
+#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/desc.h>
-#include <asm/init.h>
static struct vm_area_struct init_mmap = INIT_MMAP;
static struct fs_struct init_fs = INIT_FS;
int pirq_entries [MAX_PIRQS];
int pirqs_enabled;
-static void __init ioapic_setup(char *str, int *ints)
+static int __init ioapic_setup(char *str)
{
extern int skip_ioapic_setup; /* defined in arch/i386/kernel/smp.c */
__setup("noapic", ioapic_setup);
-static void __init ioapic_pirq_setup(char *str)
+static int __init ioapic_pirq_setup(char *str)
{
int i, max;
int ints[11];
*/
pirq_entries[MAX_PIRQS-i-1] = ints[i+1];
}
+ return 1;
}
__setup("pirq=", ioapic_pirq_setup);
printk(KERN_WARNING "LDT allocated for cloned task!\n");
/*
* Possibly do an SMP cross-call to other CPUs to reload
- * their LDTs
+ * their LDTs?
*/
+ load_LDT(mm);
}
lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->segments);
* Take care of "crossing" invalidates
*/
if (test_bit(cpu, &smp_invalidate_needed)) {
+ struct mm_struct *mm = current->mm;
clear_bit(cpu, &smp_invalidate_needed);
+ if (mm)
+ atomic_set_mask(1 << cpu, &mm->cpu_vm_mask);
local_flush_tlb();
}
--stuck;
}
}
+#if CONFIG_AP1000
+
+static int __init init_ap1000(void)
+{
+ kernel_thread(asyncd, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ return 0;
+}
+
+module_init(init_ap1000)
+
+#endif
#
FONTMAPFILE = cp437.uni
-L_TARGET := char.a
+O_TARGET := char.o
M_OBJS :=
-L_OBJS := tty_io.o n_tty.o tty_ioctl.o mem.o random.o raw.o
-LX_OBJS := pty.o misc.o
+O_OBJS := tty_io.o n_tty.o tty_ioctl.o mem.o random.o raw.o
+OX_OBJS := pty.o misc.o
ifdef CONFIG_VT
-L_OBJS += vt.o vc_screen.o consolemap.o consolemap_deftbl.o
-LX_OBJS += console.o selection.o
+O_OBJS += vt.o vc_screen.o consolemap.o consolemap_deftbl.o
+OX_OBJS += console.o selection.o
endif
ifeq ($(CONFIG_SERIAL),y)
ifeq ($(CONFIG_SUN_SERIAL),)
- LX_OBJS += serial.o
+ OX_OBJS += serial.o
endif
else
ifeq ($(CONFIG_SERIAL),m)
ifndef CONFIG_SUN_KEYBOARD
ifdef CONFIG_VT
-LX_OBJS += keyboard.o
+OX_OBJS += keyboard.o
endif
ifneq ($(ARCH),m68k)
- L_OBJS += pc_keyb.o defkeymap.o
+ O_OBJS += pc_keyb.o defkeymap.o
endif
else
ifdef CONFIG_PCI
-L_OBJS += defkeymap.o
-LX_OBJS += keyboard.o
+O_OBJS += defkeymap.o
+OX_OBJS += keyboard.o
endif
endif
ifdef CONFIG_MAGIC_SYSRQ
-LX_OBJS += sysrq.o
+OX_OBJS += sysrq.o
endif
ifeq ($(CONFIG_ATARI_DSP56K),y)
-L_OBJS += dsp56k.o
+O_OBJS += dsp56k.o
S = y
else
ifeq ($(CONFIG_ATARI_DSP56K),m)
endif
ifeq ($(CONFIG_ROCKETPORT),y)
-L_OBJS += rocket.o
+O_OBJS += rocket.o
else
ifeq ($(CONFIG_ROCKETPORT),m)
M_OBJS += rocket.o
endif
ifeq ($(CONFIG_DIGI),y)
-L_OBJS += pcxx.o
+O_OBJS += pcxx.o
else
ifeq ($(CONFIG_DIGI),m)
M_OBJS += pcxx.o
endif
ifeq ($(CONFIG_DIGIEPCA),y)
-L_OBJS += epca.o
+O_OBJS += epca.o
else
ifeq ($(CONFIG_DIGIEPCA),m)
M_OBJS += epca.o
endif
ifeq ($(CONFIG_CYCLADES),y)
-L_OBJS += cyclades.o
+O_OBJS += cyclades.o
else
ifeq ($(CONFIG_CYCLADES),m)
M_OBJS += cyclades.o
endif
ifeq ($(CONFIG_STALLION),y)
-L_OBJS += stallion.o
+O_OBJS += stallion.o
else
ifeq ($(CONFIG_STALLION),m)
M_OBJS += stallion.o
endif
ifeq ($(CONFIG_ISTALLION),y)
-L_OBJS += istallion.o
+O_OBJS += istallion.o
else
ifeq ($(CONFIG_ISTALLION),m)
M_OBJS += istallion.o
endif
ifeq ($(CONFIG_RISCOM8),y)
-L_OBJS += riscom8.o
+O_OBJS += riscom8.o
else
ifeq ($(CONFIG_RISCOM8),m)
M_OBJS += riscom8.o
endif
ifeq ($(CONFIG_ISI),y)
-L_OBJS += isicom.o
+O_OBJS += isicom.o
else
ifeq ($(CONFIG_ISI),m)
M_OBJS += isicom.o
endif
ifeq ($(CONFIG_ESPSERIAL),y)
-L_OBJS += esp.o
+O_OBJS += esp.o
else
ifeq ($(CONFIG_ESPSERIAL),m)
M_OBJS += esp.o
endif
ifeq ($(CONFIG_SPECIALIX),y)
-L_OBJS += specialix.o
+O_OBJS += specialix.o
else
ifeq ($(CONFIG_SPECIALIX),m)
M_OBJS += specialix.o
endif
ifeq ($(CONFIG_ATIXL_BUSMOUSE),y)
-L_OBJS += atixlmouse.o
+O_OBJS += atixlmouse.o
else
ifeq ($(CONFIG_ATIXL_BUSMOUSE),m)
M_OBJS += atixlmouse.o
endif
ifeq ($(CONFIG_LOGIBUSMOUSE),y)
-L_OBJS += logibusmouse.o
+O_OBJS += logibusmouse.o
else
ifeq ($(CONFIG_LOGIBUSMOUSE),m)
M_OBJS += logibusmouse.o
endif
ifeq ($(CONFIG_PRINTER),y)
-L_OBJS += lp.o
+O_OBJS += lp.o
else
ifeq ($(CONFIG_PRINTER),m)
M_OBJS += lp.o
endif
ifeq ($(CONFIG_JOYSTICK),y)
-L_OBJS += joystick/js.o
+O_OBJS += joystick/js.o
SUB_DIRS += joystick
MOD_SUB_DIRS += joystick
else
ifeq ($(CONFIG_MOUSE),y)
M = y
-LX_OBJS += busmouse.o
+OX_OBJS += busmouse.o
else
ifeq ($(CONFIG_MOUSE),m)
MM = m
endif
ifeq ($(CONFIG_DTLK),y)
-L_OBJS += dtlk.o
+O_OBJS += dtlk.o
else
ifeq ($(CONFIG_DTLK),m)
M_OBJS += dtlk.o
endif
ifeq ($(CONFIG_MS_BUSMOUSE),y)
-L_OBJS += msbusmouse.o
+O_OBJS += msbusmouse.o
else
ifeq ($(CONFIG_MS_BUSMOUSE),m)
M_OBJS += msbusmouse.o
endif
ifeq ($(CONFIG_82C710_MOUSE),y)
-L_OBJS += qpmouse.o
+O_OBJS += qpmouse.o
else
ifeq ($(CONFIG_82C710_MOUSE),m)
M_OBJS += qpmouse.o
endif
ifeq ($(CONFIG_SOFT_WATCHDOG),y)
-L_OBJS += softdog.o
+O_OBJS += softdog.o
else
ifeq ($(CONFIG_SOFT_WATCHDOG),m)
M_OBJS += softdog.o
endif
ifeq ($(CONFIG_PCWATCHDOG),y)
-L_OBJS += pcwd.o
+O_OBJS += pcwd.o
else
ifeq ($(CONFIG_PCWATCHDOG),m)
M_OBJS += pcwd.o
endif
ifeq ($(CONFIG_ACQUIRE_WDT),y)
-L_OBJS += acquirewdt.o
+O_OBJS += acquirewdt.o
else
ifeq ($(CONFIG_ACQUIRE_WDT),m)
M_OBJS += acquirewdt.o
endif
ifeq ($(CONFIG_AMIGAMOUSE),y)
-L_OBJS += amigamouse.o
+O_OBJS += amigamouse.o
else
ifeq ($(CONFIG_AMIGAMOUSE),m)
M_OBJS += amigamouse.o
endif
ifeq ($(CONFIG_ATARIMOUSE),y)
-L_OBJS += atarimouse.o
+O_OBJS += atarimouse.o
else
ifeq ($(CONFIG_ATARIMOUSE),m)
M_OBJS += atarimouse.o
endif
ifeq ($(CONFIG_ADBMOUSE),y)
-L_OBJS += adbmouse.o
+O_OBJS += adbmouse.o
else
ifeq ($(CONFIG_ADBMOUSE),m)
M_OBJS += adbmouse.o
endif
ifeq ($(CONFIG_PC110_PAD),y)
-L_OBJS += pc110pad.o
+O_OBJS += pc110pad.o
else
ifeq ($(CONFIG_PC110_PAD),m)
M_OBJS += pc110pad.o
endif
ifeq ($(CONFIG_WDT),y)
-L_OBJS += wdt.o
+O_OBJS += wdt.o
else
ifeq ($(CONFIG_WDT),m)
M_OBJS += wdt.o
endif
ifeq ($(CONFIG_RTC),y)
-L_OBJS += rtc.o
+O_OBJS += rtc.o
endif
ifeq ($(CONFIG_NVRAM),y)
ifeq ($(CONFIG_PPC),)
- L_OBJS += nvram.o
+ O_OBJS += nvram.o
endif
else
ifeq ($(CONFIG_NVRAM),m)
endif
ifeq ($(CONFIG_VIDEO_DEV),y)
-LX_OBJS += videodev.o
+OX_OBJS += videodev.o
else
ifeq ($(CONFIG_VIDEO_DEV),m)
MX_OBJS += videodev.o
endif
ifeq ($(CONFIG_VIDEO_BT848),y)
-L_OBJS += bttv.o msp3400.o tuner.o
+O_OBJS += bttv.o msp3400.o tuner.o
L_I2C=y
else
ifeq ($(CONFIG_VIDEO_BT848),m)
endif
ifeq ($(CONFIG_VIDEO_SAA5249),y)
-L_OBJS += saa5249.o
+O_OBJS += saa5249.o
L_I2C=y
else
ifeq ($(CONFIG_VIDEO_SAA5249),m)
endif
ifeq ($(CONFIG_I2C_PARPORT),y)
-L_OBJS += i2c-parport.o
+O_OBJS += i2c-parport.o
L_I2C = y
else
ifeq ($(CONFIG_I2C_PARPORT),m)
endif
ifeq ($(CONFIG_VIDEO_BWQCAM),y)
-L_OBJS += bw-qcam.o
+O_OBJS += bw-qcam.o
else
ifeq ($(CONFIG_VIDEO_BWQCAM),m)
M_OBJS += bw-qcam.o
endif
ifeq ($(CONFIG_VIDEO_CQCAM),y)
-L_OBJS += c-qcam.o
+O_OBJS += c-qcam.o
else
ifeq ($(CONFIG_VIDEO_CQCAM),m)
M_OBJS += c-qcam.o
endif
ifeq ($(CONFIG_VIDEO_ZORAN),y)
-L_OBJS += buz.o
+O_OBJS += buz.o
else
ifeq ($(CONFIG_VIDEO_LML33),m)
M_OBJS += buz.o
endif
ifeq ($(CONFIG_VIDEO_LML33),y)
-L_OBJS += bt856.o bt819.o
+O_OBJS += bt856.o bt819.o
else
ifeq ($(CONFIG_VIDEO_LML33),m)
M_OBJS += bt856.o bt819.o
endif
ifeq ($(CONFIG_VIDEO_BUZ),y)
-L_OBJS += saa7111.o saa7185.o
+O_OBJS += saa7111.o saa7185.o
else
ifeq ($(CONFIG_VIDEO_BUZ),m)
M_OBJS += saa7111.o saa7185.o
endif
ifeq ($(CONFIG_VIDEO_PMS),y)
-L_OBJS += pms.o
+O_OBJS += pms.o
else
ifeq ($(CONFIG_VIDEO_PMS),m)
M_OBJS += pms.o
endif
ifeq ($(CONFIG_VIDEO_PLANB),y)
-L_OBJS += planb.o
+O_OBJS += planb.o
else
ifeq ($(CONFIG_VIDEO_PLANB),m)
M_OBJS += planb.o
endif
ifeq ($(CONFIG_VIDEO_VINO),y)
-L_OBJS += vino.o
+O_OBJS += vino.o
else
ifeq ($(CONFIG_VIDEO_VINO),m)
M_OBJS += vino.o
endif
ifeq ($(CONFIG_RADIO_AZTECH),y)
-L_OBJS += radio-aztech.o
+O_OBJS += radio-aztech.o
else
ifeq ($(CONFIG_RADIO_AZTECH),m)
M_OBJS += radio-aztech.o
endif
ifeq ($(CONFIG_RADIO_SF16FMI),y)
-L_OBJS += radio-sf16fmi.o
+O_OBJS += radio-sf16fmi.o
else
ifeq ($(CONFIG_RADIO_SF16FMI),m)
M_OBJS += radio-sf16fmi.o
endif
ifeq ($(CONFIG_RADIO_RTRACK),y)
-L_OBJS += radio-aimslab.o
+O_OBJS += radio-aimslab.o
else
ifeq ($(CONFIG_RADIO_RTRACK),m)
M_OBJS += radio-aimslab.o
endif
ifeq ($(CONFIG_RADIO_RTRACK2),y)
-L_OBJS += radio-rtrack2.o
+O_OBJS += radio-rtrack2.o
else
ifeq ($(CONFIG_RADIO_RTRACK2),m)
M_OBJS += radio-rtrack2.o
endif
ifeq ($(CONFIG_RADIO_TYPHOON),y)
-L_OBJS += radio-typhoon.o
+O_OBJS += radio-typhoon.o
else
ifeq ($(CONFIG_RADIO_TYPHOON),m)
M_OBJS += radio-typhoon.o
endif
ifeq ($(CONFIG_RADIO_ZOLTRIX),y)
-L_OBJS += radio-zoltrix.o
+O_OBJS += radio-zoltrix.o
else
ifeq ($(CONFIG_RADIO_ZOLTRIX),m)
M_OBJS += radio-zoltrix.o
endif
ifeq ($(CONFIG_RADIO_CADET),y)
-L_OBJS += radio-cadet.o
+O_OBJS += radio-cadet.o
else
ifeq ($(CONFIG_RADIO_CADET),m)
M_OBJS += radio-cadet.o
endif
ifeq ($(CONFIG_RADIO_MIROPCM20),y)
-L_OBJS += radio-miropcm20.o
+O_OBJS += radio-miropcm20.o
else
ifeq ($(CONFIG_RADIO_MIROPCM20),m)
M_OBJS += radio-miropcm20.o
endif
ifeq ($(CONFIG_RADIO_GEMTEK),y)
-L_OBJS += radio-gemtek.o
+O_OBJS += radio-gemtek.o
else
ifeq ($(CONFIG_RADIO_GEMTEK),m)
M_OBJS += radio-gemtek.o
endif
ifeq ($(CONFIG_RADIO_TERRATEC),y)
-L_OBJS += radio-terratec.o
+O_OBJS += radio-terratec.o
else
ifeq ($(CONFIG_RADIO_TERRATEC),m)
M_OBJS += radio-terratec.o
endif
ifeq ($(CONFIG_QIC02_TAPE),y)
-L_OBJS += tpqic02.o
+O_OBJS += tpqic02.o
else
ifeq ($(CONFIG_QIC02_TAPE),m)
M_OBJS += tpqic02.o
endif
ifeq ($(CONFIG_FTAPE),y)
-L_OBJS += ftape/ftape.o
+O_OBJS += ftape/ftape.o
SUB_DIRS += ftape
ifneq ($(CONFIG_ZFTAPE),n)
MOD_SUB_DIRS += ftape
endif
ifdef CONFIG_H8
-LX_OBJS += h8.o
+OX_OBJS += h8.o
endif
ifeq ($(CONFIG_PPDEV),y)
-L_OBJS += ppdev.o
+O_OBJS += ppdev.o
else
ifeq ($(CONFIG_PPDEV),m)
M_OBJS += ppdev.o
endif
ifeq ($(L_I2C),y)
-LX_OBJS += i2c.o
+OX_OBJS += i2c.o
else
ifeq ($(M_I2C),y)
MX_OBJS += i2c.o
ifeq ($(CONFIG_HFMODEM),y)
ALL_SUB_DIRS += hfmodem
SUB_DIRS += hfmodem
-L_OBJS += hfmodem/hfmodem.o
+O_OBJS += hfmodem/hfmodem.o
else
ifeq ($(CONFIG_HFMODEM),m)
ALL_SUB_DIRS += hfmodem
return msedev < 0 ? msedev : 0;
}
-#ifdef MODULE
-int init_module(void)
-{
- return ms_bus_mouse_init();
-}
-
-void cleanup_module(void)
+void ms_bus_mouse_exit(void)
{
unregister_busmouse(msedev);
release_region(MS_MSE_CONTROL_PORT, 0x04);
}
-#endif
+module_init(ms_bus_mouse_init)
+module_exit(ms_bus_mouse_exit)
* 15.06.99 0.23 Fix bad allocation bug.
* Thanks to Deti Fliegl <fliegl@in.tum.de>
* 28.06.99 0.24 Add pci_set_master
+ * 02.08.99 0.25 Added workaround for the "phantom write" bug first
+ * documented by Dave Sharpless from Anchor Games
*
* some important things missing in Ensoniq documentation:
*
#define ES1370_REG_DAC2_SCOUNT 0x28
#define ES1370_REG_ADC_SCOUNT 0x2c
-#define ES1370_REG_DAC1_FRAMEADR 0xc30
-#define ES1370_REG_DAC1_FRAMECNT 0xc34
-#define ES1370_REG_DAC2_FRAMEADR 0xc38
-#define ES1370_REG_DAC2_FRAMECNT 0xc3c
-#define ES1370_REG_ADC_FRAMEADR 0xd30
-#define ES1370_REG_ADC_FRAMECNT 0xd34
+#define ES1370_REG_DAC1_FRAMEADR 0xc30
+#define ES1370_REG_DAC1_FRAMECNT 0xc34
+#define ES1370_REG_DAC2_FRAMEADR 0xc38
+#define ES1370_REG_DAC2_FRAMECNT 0xc3c
+#define ES1370_REG_ADC_FRAMEADR 0xd30
+#define ES1370_REG_ADC_FRAMECNT 0xd34
+#define ES1370_REG_PHANTOM_FRAMEADR 0xd38
+#define ES1370_REG_PHANTOM_FRAMECNT 0xd3c
#define ES1370_FMT_U8_MONO 0
#define ES1370_FMT_U8_STEREO 1
static struct es1370_state *devs = NULL;
+/*
+ * The following buffer is used to point the phantom write channel to,
+ * so that it cannot wreak havoc. The attribute makes sure it doesn't
+ * cross a page boundary and ensures dword alignment for the DMA engine
+ */
+static unsigned char bugbuf[16] __attribute__ ((aligned (16)));
+
/* --------------------------------------------------------------------- */
extern inline unsigned ld2(unsigned int x)
if (!pci_present()) /* No PCI bus in this machine! */
return -ENODEV;
- printk(KERN_INFO "es1370: version v0.24 time " __TIME__ " " __DATE__ "\n");
+ printk(KERN_INFO "es1370: version v0.25 time " __TIME__ " " __DATE__ "\n");
while (index < NR_DEVICE &&
(pcidev = pci_find_device(PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1370, pcidev))) {
if (pcidev->base_address[0] == 0 ||
/* initialize the chips */
outl(s->ctrl, s->io+ES1370_REG_CONTROL);
outl(s->sctrl, s->io+ES1370_REG_SERIAL_CONTROL);
+ /* point phantom write channel to "bugbuf" */
+ outl((ES1370_REG_PHANTOM_FRAMEADR >> 8) & 15, s->io+ES1370_REG_MEMPAGE);
+ outl(virt_to_bus(bugbuf), s->io+(ES1370_REG_PHANTOM_FRAMEADR & 0xff));
+ outl(0, s->io+(ES1370_REG_PHANTOM_FRAMECNT & 0xff));
pci_set_master(pcidev); /* enable bus mastering */
wrcodec(s, 0x16, 3); /* no RST, PD */
wrcodec(s, 0x17, 0); /* CODEC ADC and CODEC DAC use {LR,B}CLK2 and run off the LRCLK2 PLL; program DAC_SYNC=0!! */
extern void dump_thread(struct pt_regs *, struct user *);
static struct linux_binfmt aout_format = {
- NULL,
-#ifndef MODULE
- NULL,
-#else
- &__this_module,
-#endif
- load_aout_binary, load_aout_library, aout_core_dump, PAGE_SIZE
+ NULL, THIS_MODULE, load_aout_binary, load_aout_library, aout_core_dump, PAGE_SIZE
};
static void set_brk(unsigned long start, unsigned long end)
return register_binfmt(&aout_format);
}
-__initcall(init_aout_binfmt);
-
-#ifdef MODULE
-int init_module(void) {
- return init_aout_binfmt();
-}
-
-void cleanup_module( void) {
+static void __exit exit_aout_binfmt(void)
+{
unregister_binfmt(&aout_format);
}
-#endif
+
+module_init(init_aout_binfmt)
+module_exit(exit_aout_binfmt)
#define ELF_PAGEALIGN(_v) (((_v) + ELF_EXEC_PAGESIZE - 1) & ~(ELF_EXEC_PAGESIZE - 1))
static struct linux_binfmt elf_format = {
- NULL,
-#ifndef MODULE
- NULL,
-#else
- &__this_module,
-#endif
- load_elf_binary, load_elf_library, elf_core_dump, ELF_EXEC_PAGESIZE
+ NULL, THIS_MODULE, load_elf_binary, load_elf_library, elf_core_dump, ELF_EXEC_PAGESIZE
};
static void set_brk(unsigned long start, unsigned long end)
return register_binfmt(&elf_format);
}
-__initcall(init_elf_binfmt);
-
-#ifdef MODULE
-
-int init_module(void)
-{
- /* Install the COFF, ELF and XOUT loaders.
- * N.B. We *rely* on the table being the right size with the
- * right number of free slots...
- */
- return init_elf_binfmt();
-}
-
-
-void cleanup_module( void)
+static void __exit exit_elf_binfmt(void)
{
/* Remove the COFF and ELF loaders. */
unregister_binfmt(&elf_format);
}
-#endif
+
+module_init(init_elf_binfmt)
+module_exit(exit_elf_binfmt)
}
struct linux_binfmt em86_format = {
- NULL,
-#ifndef MODULE
- NULL,
-#else
- &__this_module,
-#endif
- load_em86, NULL, NULL, 0
+ NULL, THIS_MODULE, load_em86, NULL, NULL, 0
};
static int __init init_em86_binfmt(void)
return register_binfmt(&em86_format);
}
-__initcall(init_em86_binfmt);
-
-#ifdef MODULE
-int init_module(void)
+static void __exit exit_em86_binfmt(void)
{
- return init_em86_binfmt();
-}
-
-void cleanup_module( void) {
unregister_binfmt(&em86_format);
}
-#endif
+
+module_init(init_em86_binfmt)
+module_exit(exit_em86_binfmt)
static int entry_proc_setup(struct binfmt_entry *e);
static struct linux_binfmt misc_format = {
- NULL,
-#ifndef MODULE
- NULL,
-#else
- &__this_module,
-#endif
- load_misc_binary, NULL, NULL, 0
+ NULL, THIS_MODULE, load_misc_binary, NULL, NULL, 0
};
static struct proc_dir_entry *bm_dir = NULL;
goto out;
}
-__initcall(init_misc_binfmt);
-
-#ifdef MODULE
-EXPORT_NO_SYMBOLS;
-int init_module(void)
-{
- return init_misc_binfmt();
-}
-
-void cleanup_module(void)
+static void __exit exit_misc_binfmt(void)
{
unregister_binfmt(&misc_format);
remove_proc_entry("register", bm_dir);
clear_entries();
remove_proc_entry("sys/fs/binfmt_misc", NULL);
}
-#endif
-#undef VERBOSE_STATUS
+
+EXPORT_NO_SYMBOLS;
+
+module_init(init_misc_binfmt)
+module_exit(exit_misc_binfmt)
}
struct linux_binfmt script_format = {
- NULL,
-#ifndef MODULE
- NULL,
-#else
- &__this_module,
-#endif
- load_script, NULL, NULL, 0
+ NULL, THIS_MODULE, load_script, NULL, NULL, 0
};
static int __init init_script_binfmt(void)
return register_binfmt(&script_format);
}
-__initcall(init_script_binfmt);
-
-#ifdef MODULE
-int init_module(void)
+static void __exit exit_script_binfmt(void)
{
- return init_script_binfmt();
-}
-
-void cleanup_module( void) {
unregister_binfmt(&script_format);
}
-#endif
+
+module_init(init_script_binfmt)
+module_exit(exit_script_binfmt)
}
}
}
+
+static int __init bdflush_init(void)
+{
+ kernel_thread(bdflush, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ return 0;
+}
+
+module_init(bdflush_init)
+
-#ifndef _I386_INIT_H
-#define _I386_INIT_H
-
-typedef int (*initcall_t)(void);
-
-extern initcall_t __initcall_start, __initcall_end;
-
-struct kernel_param {
- const char *str;
- int (*setup_func)(char *);
-};
-
-extern struct kernel_param __setup_start, __setup_end;
-
-/* Used for initialization calls.. */
-#define __initcall(fn) \
- static __attribute__ ((unused,__section__ (".initcall.init"))) initcall_t __initcall_##fn = fn
-
-/* Used for kernel command line parameter setup */
-#define __setup(str, fn) \
- static __attribute__ ((unused,__section__ (".setup.init"))) struct kernel_param __setup_##fn = { str, fn }
-
-
-#define __init __attribute__ ((__section__ (".text.init")))
-#define __initdata __attribute__ ((__section__ (".data.init")))
-#define __initfunc(__arginit) \
- __arginit __init; \
- __arginit
-/* For assembly routines */
-#define __INIT .section ".text.init",#alloc,#execinstr
-#define __FINIT .previous
-#define __INITDATA .section ".data.init",#alloc,#write
-
-#define __cacheline_aligned __attribute__ \
- ((__section__ (".data.cacheline_aligned")))
-
-#endif
+#error "<asm/init.h> should never be used - use <linux/init.h> instead"
*/
#ifndef MODULE
-#include <asm/init.h>
+
+/*
+ * Used for initialization calls..
+ */
+typedef int (*initcall_t)(void);
+
+extern initcall_t __initcall_start, __initcall_end;
+
+#define __initcall(fn) \
+ static __attribute__ ((unused,__section__ (".initcall.init"))) \
+ initcall_t __initcall_##fn = fn
+
+/*
+ * Used for kernel command line parameter setup
+ */
+struct kernel_param {
+ const char *str;
+ int (*setup_func)(char *);
+};
+
+extern struct kernel_param __setup_start, __setup_end;
+
+#define __setup(str, fn) \
+ static __attribute__ ((__section__ (".data.init"))) \
+ char __setup_str_##fn[] = str; \
+ static __attribute__ ((unused,__section__ (".setup.init"))) \
+ struct kernel_param __setup_##fn = { __setup_str_##fn, fn }
+
+/*
+ * Mark functions and data as being only used at initialization
+ * or exit time.
+ */
+#define __init __attribute__ ((__section__ (".text.init")))
+#define __exit __attribute__ ((unused, __section__(".text.init")))
+#define __initdata __attribute__ ((__section__ (".data.init")))
+#define __exitdata __attribute__ ((unused, __section__ (".data.init")))
+
+#define __initfunc(__arginit) \
+ __arginit __init; \
+ __arginit
+
+/* For assembly routines */
+#define __INIT .section ".text.init","ax"
+#define __FINIT .previous
+#define __INITDATA .section ".data.init","aw"
+
+#define __cacheline_aligned __attribute__ \
+ ((__section__ (".data.cacheline_aligned")))
+
+#define module_init(x) __initcall(x);
+#define module_exit(x) /* nothing */
+
#else
+
#define __init
+#define __exit
#define __initdata
+#define __exitdata
#define __initfunc(__arginit) __arginit
+#defint __initcall
/* For assembly routines */
#define __INIT
#define __FINIT
#define __INITDATA
+
+#define module_init(x) int init_module(void) { return x(); }
+#define module_exit(x) void cleanup_module(void) { x(); }
+
#endif
#if __GNUC__ >= 2 && __GNUC_MINOR__ >= 8
/* Define the module variable, and usage macros. */
extern struct module __this_module;
-#define MOD_INC_USE_COUNT __MOD_INC_USE_COUNT(&__this_module)
-#define MOD_DEC_USE_COUNT __MOD_DEC_USE_COUNT(&__this_module)
-#define MOD_IN_USE __MOD_IN_USE(&__this_module)
+#define THIS_MODULE (&__this_module)
+#define MOD_INC_USE_COUNT __MOD_INC_USE_COUNT(THIS_MODULE)
+#define MOD_DEC_USE_COUNT __MOD_DEC_USE_COUNT(THIS_MODULE)
+#define MOD_IN_USE __MOD_IN_USE(THIS_MODULE)
#ifndef __NO_VERSION__
#include <linux/version.h>
#ifndef __GENKSYMS__
+#define THIS_MODULE NULL
#define MOD_INC_USE_COUNT do { } while (0)
#define MOD_DEC_USE_COUNT do { } while (0)
#define MOD_IN_USE 1
extern int console_loglevel;
static int init(void *);
-extern int bdflush(void *);
-extern int kswapd(void *);
-extern void kswapd_setup(void);
extern void init_IRQ(void);
extern void init_modules(void);
#ifdef CONFIG_MAC
nubus_init();
#endif
-#ifdef CONFIG_APM
- apm_init();
-#endif
/* Networking initialization needs a process context */
sock_init();
do_initcalls();
- /* Launch bdflush from here, instead of the old syscall way. */
- kernel_thread(bdflush, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
- /* Start the background pageout daemon. */
- kswapd_setup();
- kernel_thread(kswapd, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
-
-#if CONFIG_AP1000
- /* Start the async paging daemon. */
- {
- extern int asyncd(void *);
- kernel_thread(asyncd, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
- }
-#endif
-
#ifdef CONFIG_BLK_DEV_INITRD
real_root_dev = ROOT_DEV;
return priority >= 0;
}
-/*
- * Before we start the kernel thread, print out the
- * kswapd initialization message (otherwise the init message
- * may be printed in the middle of another driver's init
- * message). It looks very bad when that happens.
- */
-void __init kswapd_setup(void)
-{
- int i;
- char *revision="$Revision: 1.5 $", *s, *e;
-
- swap_setup();
-
- if ((s = strchr(revision, ':')) &&
- (e = strchr(s, '$')))
- s++, i = e - s;
- else
- s = revision, i = -1;
- printk ("Starting kswapd v%.*s\n", i, s);
-}
-
static struct task_struct *kswapd_process;
/*
retval = do_try_to_free_pages(gfp_mask);
return retval;
}
-
+
+static int __init kswapd_init(void)
+{
+ printk("Starting kswapd v1.6\n");
+ swap_setup();
+ kernel_thread(kswapd, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ return 0;
+}
+
+module_init(kswapd_init)