Commit b9de2e44 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://namesys.com/bk/reiser3-linux-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 70c452ad d743e951
......@@ -222,10 +222,10 @@ cmd_link_vmlinux = $(LD) $(LINKFLAGS) $(HEAD) $(INIT) \
define rule_link_vmlinux
set -e
echo Generating build number
echo ' Generating build number'
. scripts/mkversion > .tmpversion
mv -f .tmpversion .version
$(MAKE) -C init
+$(MAKE) -C init
$(call cmd,cmd_link_vmlinux)
$(cmd_link_vmlinux)
echo 'cmd_$@ := $(cmd_link_vmlinux)' > $(@D)/.$(@F).cmd
......@@ -243,14 +243,14 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ;
# Handle descending into subdirectories listed in $(SUBDIRS)
.PHONY: $(SUBDIRS)
$(SUBDIRS): .hdepend prepare include/config/MARKER
$(SUBDIRS): .hdepend prepare
@$(MAKE) -C $@
# Things we need done before we descend to build or make
# module versions are listed in "prepare"
.PHONY: prepare
prepare: include/linux/version.h include/asm
prepare: include/linux/version.h include/asm include/config/MARKER
# Single targets
# ---------------------------------------------------------------------------
......@@ -273,13 +273,13 @@ prepare: include/linux/version.h include/asm
# before switching between archs anyway.
include/asm:
@echo 'Making asm->asm-$(ARCH) symlink'
@echo ' Making asm->asm-$(ARCH) symlink'
@ln -s asm-$(ARCH) $@
# Split autoconf.h into include/linux/config/*
include/config/MARKER: scripts/split-include include/linux/autoconf.h
@echo 'Splitting include/linux/autoconf.h -> include/config'
@echo ' SPLIT include/linux/autoconf.h -> include/config/*'
@scripts/split-include include/linux/autoconf.h include/config
@touch $@
......@@ -306,7 +306,7 @@ include/linux/version.h: Makefile
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \
fi;
@echo -n 'Generating $@'
@echo -n ' Generating $@'
@(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
......@@ -349,11 +349,11 @@ ifdef CONFIG_MODVERSIONS
include/linux/modversions.h: scripts/fixdep prepare FORCE
@rm -rf .tmp_export-objs
@$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS))
@echo -n 'Generating $@'
@echo -n ' Generating $@'
@( echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.h>"; \
for f in `cd .tmp_export-objs; find modules -name \*.ver -print`; do \
for f in `cd .tmp_export-objs; find modules -name \*.ver -print | sort`; do \
echo "#include <linux/$${f}>"; \
done; \
echo "#endif"; \
......@@ -574,9 +574,8 @@ make_with_config: .config
# files removed with 'make clean'
CLEAN_FILES += \
kernel/ksyms.lst include/linux/compile.h \
include/linux/compile.h \
vmlinux System.map \
.tmp* \
drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
drivers/char/conmakehash \
drivers/char/drm/*-mod.c \
......@@ -616,9 +615,11 @@ MRPROPER_FILES += \
.hdepend scripts/split-include scripts/docproc \
scripts/fixdep $(TOPDIR)/include/linux/modversions.h \
tags TAGS kernel.spec \
.tmpversion
# directories removed with 'make mrproper'
MRPROPER_DIRS += \
.tmp_export-objs \
include/config \
$(TOPDIR)/include/linux/modules
......@@ -631,7 +632,7 @@ clean: archclean
@find . \( -name \*.[oas] -o -name core -o -name .\*.cmd -o \
-name .\*.tmp -o -name .\*.d \) -type f -print \
| grep -v lxdialog/ | xargs rm -f
@rm -rf $(CLEAN_FILES)
@rm -f $(CLEAN_FILES)
@$(MAKE) -C Documentation/DocBook clean
mrproper: clean archmrproper
......
This diff is collapsed.
......@@ -439,15 +439,16 @@ static int __init pci_v3_setup_resources(struct resource **resource)
#define SC_LBFADDR (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x20)
#define SC_LBFCODE (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x24)
static int v3_fault(unsigned long addr, struct pt_regs *regs)
static int
v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
unsigned long pc = instruction_pointer(regs);
unsigned long instr = *(unsigned long *)pc;
#if 0
char buf[128];
sprintf(buf, "V3 fault: address=0x%08lx, pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n",
addr, pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255,
sprintf(buf, "V3 fault: addr 0x%08lx, FSR 0x%03x, PC 0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n",
addr, fsr, pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255,
v3_readb(V3_LB_ISTAT));
printk(KERN_DEBUG "%s", buf);
printascii(buf);
......@@ -515,8 +516,6 @@ static void v3_irq(int irq, void *devid, struct pt_regs *regs)
#endif
}
extern int (*external_fault)(unsigned long addr, struct pt_regs *regs);
int __init pci_v3_setup(int nr, struct pci_sys_data *sys)
{
int ret = 0;
......@@ -547,7 +546,10 @@ void __init pci_v3_preinit(void)
/*
* Hook in our fault handler for PCI errors
*/
external_fault = v3_fault;
hook_fault_code(4, v3_pci_fault, SIGBUS, "external abort on linefetch");
hook_fault_code(6, v3_pci_fault, SIGBUS, "external abort on linefetch");
hook_fault_code(8, v3_pci_fault, SIGBUS, "external abort on non-linefetch");
hook_fault_code(10, v3_pci_fault, SIGBUS, "external abort on non-linefetch");
spin_lock_irqsave(&v3_lock, flags);
......
......@@ -106,19 +106,32 @@ static int iop310_pri_pci_status(void)
return ret;
}
static inline u32 iop310_pri_read(struct pci_dev *dev, int where)
{
unsigned long addr = iop310_cfg_address(dev, where);
u32 val;
__asm__ __volatile__(
"str %1, [%2]\n\t"
"ldr %0, [%3]\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
: "=r" (val)
: "r" (addr), "r" (IOP310_POCCAR), "r" (IOP310_POCCDR));
return val;
}
static int
iop310_pri_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p)
{
int ret;
u8 val;
*IOP310_POCCAR = iop310_cfg_address(dev, where);
val = (*IOP310_POCCDR) >> ((where & 3) * 8);
__asm__ __volatile__("nop; nop; nop; nop");
val = iop310_pri_read(dev, where) >> ((where & 3) * 8);
ret = iop310_pri_pci_status();
if (ret)
if (iop310_pri_pci_status())
val = 0xff;
*p = val;
......@@ -129,16 +142,11 @@ iop310_pri_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p)
static int
iop310_pri_rd_cfg_word(struct pci_dev *dev, int where, u16 *p)
{
int ret;
u16 val;
*IOP310_POCCAR = iop310_cfg_address(dev, where);
val = (*IOP310_POCCDR) >> ((where & 2) * 8);
__asm__ __volatile__("nop; nop; nop; nop");
val = iop310_pri_read(dev, where) >> ((where & 3) * 8);
ret = iop310_pri_pci_status();
if (ret)
if (iop310_pri_pci_status())
val = 0xffff;
*p = val;
......@@ -149,16 +157,11 @@ iop310_pri_rd_cfg_word(struct pci_dev *dev, int where, u16 *p)
static int
iop310_pri_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p)
{
int ret;
u32 val;
*IOP310_POCCAR = iop310_cfg_address(dev, where);
val = iop310_pri_read(dev, where);
val = *IOP310_POCCDR;
__asm__ __volatile__("nop; nop; nop; nop");
ret = iop310_pri_pci_status();
if (ret)
if (iop310_pri_pci_status())
val = 0xffffffff;
*p = val;
......@@ -169,16 +172,11 @@ iop310_pri_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p)
static int
iop310_pri_wr_cfg_byte(struct pci_dev *dev, int where, u8 v)
{
int ret;
u32 val;
*IOP310_POCCAR = iop310_cfg_address(dev, where);
val = iop310_pri_read(dev, where);
val = *IOP310_POCCDR;
__asm__ __volatile__("nop; nop; nop; nop");
ret = iop310_pri_pci_status();
if (ret == 0) {
if (iop310_pri_pci_status() == 0) {
where = (where & 3) * 8;
val &= ~(0xff << where);
val |= v << where;
......@@ -191,16 +189,11 @@ iop310_pri_wr_cfg_byte(struct pci_dev *dev, int where, u8 v)
static int
iop310_pri_wr_cfg_word(struct pci_dev *dev, int where, u16 v)
{
int ret;
u32 val;
*IOP310_POCCAR = iop310_cfg_address(dev, where);
val = *IOP310_POCCDR;
__asm__ __volatile__("nop; nop; nop; nop");
val = iop310_pri_read(dev, where);
ret = iop310_pri_pci_status();
if (ret == 0) {
if (iop310_pri_pci_status() == 0) {
where = (where & 2) * 8;
val &= ~(0xffff << where);
val |= v << where;
......@@ -211,11 +204,21 @@ iop310_pri_wr_cfg_word(struct pci_dev *dev, int where, u16 v)
}
static int
iop310_pri_wr_cfg_dword(struct pci_dev *dev, int where, u32 v)
iop310_pri_wr_cfg_dword(struct pci_dev *dev, int where, u32 val)
{
*IOP310_POCCAR = iop310_cfg_address(dev, where);
*IOP310_POCCDR = v;
__asm__ __volatile__("nop; nop; nop; nop");
unsigned long addr;
addr = iop310_cfg_address(dev, where);
__asm__ __volatile__(
"str %1, [%2]\n\t"
"str %0, [%3]\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
:
: "r" (val), "r" (addr), "r" (IOP310_POCCAR), "r" (IOP310_POCCDR));
return PCIBIOS_SUCCESSFUL;
}
......@@ -248,28 +251,38 @@ static int iop310_sec_pci_status(void)
ret = 1;
}
if (ret)
DBG("ERROR (%08lx %08lx)", usr, uisr);
DBG("ERROR (%08x %08x)", usr, uisr);
return ret;
}
static inline u32 iop310_sec_read(struct pci_dev *dev, int where)
{
unsigned long addr = iop310_cfg_address(dev, where);
u32 val;
__asm__ __volatile__(
"str %1, [%2]\n\t"
"ldr %0, [%3]\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
: "=r" (val)
: "r" (addr), "r" (IOP310_SOCCAR), "r" (IOP310_SOCCDR));
return val;
}
static int
iop310_sec_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p)
{
int ret;
u8 val;
DBG("rdb: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = iop310_sec_read(dev, where) >> ((where & 3) * 8);
val = (*IOP310_SOCCDR) >> ((where & 3) * 8);
__asm__ __volatile__("nop; nop; nop; nop");
DBG(">= %08lx ", val);
ret = iop310_sec_pci_status();
if (ret)
if (iop310_sec_pci_status())
val = 0xff;
DBG("\n");
*p = val;
return PCIBIOS_SUCCESSFUL;
......@@ -278,21 +291,13 @@ iop310_sec_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p)
static int
iop310_sec_rd_cfg_word(struct pci_dev *dev, int where, u16 *p)
{
int ret;
u16 val;
DBG("rdw: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = (*IOP310_SOCCDR) >> ((where & 3) * 8);
__asm__ __volatile__("nop; nop; nop; nop");
val = iop310_sec_read(dev, where) >> ((where & 3) * 8);
DBG(">= %08lx ", val);
ret = iop310_sec_pci_status();
if (ret)
if (iop310_sec_pci_status())
val = 0xffff;
DBG("\n");
*p = val;
return PCIBIOS_SUCCESSFUL;
......@@ -301,21 +306,13 @@ iop310_sec_rd_cfg_word(struct pci_dev *dev, int where, u16 *p)
static int
iop310_sec_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p)
{
int ret;
u32 val;
DBG("rdl: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = *IOP310_SOCCDR;
__asm__ __volatile__("nop; nop; nop; nop");
val = iop310_sec_read(dev, where);
DBG(">= %08lx ", val);
ret = iop310_sec_pci_status();
if (ret)
if (iop310_sec_pci_status())
val = 0xffffffff;
DBG("\n");
*p = val;
return PCIBIOS_SUCCESSFUL;
......@@ -324,63 +321,54 @@ iop310_sec_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p)
static int
iop310_sec_wr_cfg_byte(struct pci_dev *dev, int where, u8 v)
{
int ret;
u32 val;
DBG("wrb: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = *IOP310_SOCCDR;
__asm__ __volatile__("nop; nop; nop; nop");
val = iop310_sec_read(dev, where);
DBG("<= %08lx", v);
ret = iop310_sec_pci_status();
if (ret == 0) {
if (iop310_sec_pci_status() == 0) {
where = (where & 3) * 8;
val &= ~(0xff << where);
val |= v << where;
*IOP310_SOCCDR = val;
}
DBG("\n");
return PCIBIOS_SUCCESSFUL;
}
static int
iop310_sec_wr_cfg_word(struct pci_dev *dev, int where, u16 v)
{
int ret;
u32 val;
DBG("wrw: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = iop310_sec_read(dev, where);
val = *IOP310_SOCCDR;
__asm__ __volatile__("nop; nop; nop; nop");
DBG("<= %08lx", v);
ret = iop310_sec_pci_status();
if (ret == 0) {
if (iop310_sec_pci_status() == 0) {
where = (where & 2) * 8;
val &= ~(0xffff << where);
val |= v << where;
*IOP310_SOCCDR = val;
}
DBG("\n");
return PCIBIOS_SUCCESSFUL;
}
static int
iop310_sec_wr_cfg_dword(struct pci_dev *dev, int where, u32 v)
iop310_sec_wr_cfg_dword(struct pci_dev *dev, int where, u32 val)
{
DBG("wrl: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
*IOP310_SOCCDR = v;
__asm__ __volatile__("nop; nop; nop; nop");
unsigned long addr;
addr = iop310_cfg_address(dev, where);
__asm__ __volatile__(
"str %1, [%2]\n\t"
"str %0, [%3]\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
:
: "r" (val), "r" (addr), "r" (IOP310_SOCCAR), "r" (IOP310_SOCCDR));
DBG("<= %08lx\n", v);
return PCIBIOS_SUCCESSFUL;
}
......@@ -394,13 +382,34 @@ static struct pci_ops iop310_secondary_ops = {
};
/*
* When a PCI device does not exist during config cycles, the 80200 gets a
* bus error instead of returning 0xffffffff. This handler simply returns.
* When a PCI device does not exist during config cycles, the 80200 gets
* an external abort instead of returning 0xffffffff. If it was an
* imprecise abort, we need to correct the return address to point after
* the instruction. Also note that the Xscale manual says:
*
* "if a stall-until-complete LD or ST instruction triggers an
* imprecise fault, then that fault will be seen by the program
* within 3 instructions."
*
* This does not appear to be the case. With 8 NOPs after the load, we
* see the imprecise abort occuring on the STM of iop310_sec_pci_status()
* which is about 10 instructions away.
*
* Always trust reality!
*/
int iop310_pci_abort_handler(unsigned long addr, struct pt_regs *regs)
static int
iop310_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
DBG("PCI abort: address = %08x PC = %08x LR = %08lx\n",
addr, regs->ARM_pc, regs->ARM_lr);
DBG("PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx\n",
addr, fsr, regs->ARM_pc, regs->ARM_lr);
/*
* If it was an imprecise abort, then we need to correct the
* return address to be _after_ the instruction.
*/
if (fsr & (1 << 10))
regs->ARM_pc += 4;
return 0;
}
......@@ -515,6 +524,5 @@ void iop310_init(void)
*/
*IOP310_PCR &= 0xfff8;
external_fault = iop310_pci_abort_handler;
hook_fault_code(6, iop310_pci_abort, SIGBUS, "imprecise external abort");
}
......@@ -40,6 +40,7 @@ obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o
obj-$(CONFIG_SA1100_BADGE4) += badge4.o
export-objs += badge4.o
led-$(CONFIG_SA1100_BADGE4) += leds-badge4.o
obj-$(CONFIG_SA1100_BRUTUS) += brutus.o
led-$(CONFIG_SA1100_BRUTUS) += leds-brutus.o
......
/*
* linux/arch/arm/mach-sa1100/leds-badge4.c
*
* Author: Christopher Hoover <ch@hpl.hp.com>
* Copyright (C) 2002 Hewlett-Packard Company
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#include <linux/config.h>
#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/leds.h>
#include <asm/system.h>
#include "leds.h"
#define LED_STATE_ENABLED 1
#define LED_STATE_CLAIMED 2
static unsigned int led_state;
static unsigned int hw_led_state;
#define LED_RED GPIO_GPIO(7)
#define LED_GREEN GPIO_GPIO(9)
#define LED_MASK (LED_RED|LED_GREEN)
#define LED_IDLE LED_GREEN
#define LED_TIMER LED_RED
void badge4_leds_event(led_event_t evt)
{
unsigned long flags;
local_irq_save(flags);
switch (evt) {
case led_start:
GPDR |= LED_MASK;
hw_led_state = LED_MASK;
led_state = LED_STATE_ENABLED;
break;
case led_stop:
led_state &= ~LED_STATE_ENABLED;
break;
case led_claim:
led_state |= LED_STATE_CLAIMED;
hw_led_state = LED_MASK;
break;
case led_release:
led_state &= ~LED_STATE_CLAIMED;
hw_led_state = LED_MASK;
break;
#ifdef CONFIG_LEDS_TIMER
case led_timer:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state ^= LED_TIMER;
break;
#endif
#ifdef CONFIG_LEDS_CPU
case led_idle_start:
/* LED off when system is idle */
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state &= ~LED_IDLE;
break;
case led_idle_end:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state |= LED_IDLE;
break;
#endif
case led_red_on:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state &= ~LED_RED;
break;
case led_red_off:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state |= LED_RED;
break;
case led_green_on:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state &= ~LED_GREEN;
break;
case led_green_off:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state |= LED_GREEN;
break;
default:
break;
}
if (led_state & LED_STATE_ENABLED) {
GPSR = hw_led_state;
GPCR = hw_led_state ^ LED_MASK;
}
local_irq_restore(flags);
}
......@@ -19,6 +19,8 @@ sa1100_leds_init(void)
leds_event = assabet_leds_event;
if (machine_is_consus())
leds_event = consus_leds_event;
if (machine_is_badge4())
leds_event = badge4_leds_event;
if (machine_is_brutus())
leds_event = brutus_leds_event;
if (machine_is_cerf())
......
extern void assabet_leds_event(led_event_t evt);
extern void badge4_leds_event(led_event_t evt);
extern void consus_leds_event(led_event_t evt);
extern void brutus_leds_event(led_event_t evt);
extern void cerf_leds_event(led_event_t evt);
......
......@@ -26,11 +26,11 @@ obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o
obj-$(CONFIG_DISCONTIGMEM) += discontig.o
# Select the processor-specific files
p-$(CONFIG_CPU_26) += proc-arm2,3.o
p-$(CONFIG_CPU_26) += proc-arm2_3.o
# ARMv3
p-$(CONFIG_CPU_ARM610) += proc-arm6,7.o tlb-v3.o copypage-v3.o
p-$(CONFIG_CPU_ARM710) += proc-arm6,7.o tlb-v3.o copypage-v3.o
p-$(CONFIG_CPU_ARM610) += proc-arm6_7.o tlb-v3.o copypage-v3.o
p-$(CONFIG_CPU_ARM710) += proc-arm6_7.o tlb-v3.o copypage-v3.o
# ARMv4
p-$(CONFIG_CPU_ARM720T) += proc-arm720.o tlb-v4.o copypage-v4wt.o abort-lv4t.o
......
......@@ -30,9 +30,7 @@
#include <asm/pgtable.h>
#include <asm/unaligned.h>
extern void
do_bad_area(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr,
int error_code, struct pt_regs *regs);
#include "fault.h"
/*
* 32-bit misaligned trap handler (c) 1998 San Mehat (CCC) -July 1998
......@@ -130,31 +128,6 @@ static int proc_alignment_write(struct file *file, const char *buffer,
return count;
}
/*
* This needs to be done after sysctl_init, otherwise sys/ will be
* overwritten. Actually, this shouldn't be in sys/ at all since
* it isn't a sysctl, and it doesn't contain sysctl information.
* We now locate it in /proc/cpu/alignment instead.
*/
static int __init alignment_init(void)
{
struct proc_dir_entry *res;
res = proc_mkdir("cpu", NULL);
if (!res)
return -ENOMEM;
res = create_proc_entry("alignment", S_IWUSR | S_IRUGO, res);
if (!res)
return -ENOMEM;
res->read_proc = proc_alignment_read;
res->write_proc = proc_alignment_write;
return 0;
}
__initcall(alignment_init);
#endif /* CONFIG_PROC_FS */
union offset_union {
......@@ -486,7 +459,8 @@ do_alignment_ldmstm(unsigned long addr, unsigned long instr, struct pt_regs *reg
return TYPE_ERROR;
}
int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs)
static int
do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
union offset_union offset;
unsigned long instr, instrptr;
......@@ -577,7 +551,7 @@ int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs)
/*
* We got a fault - fix it up, or die.
*/
do_bad_area(current, current->mm, addr, error_code, regs);
do_bad_area(current, current->mm, addr, fsr, regs);
return 0;
bad:
......@@ -594,8 +568,8 @@ int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs)
if (ai_usermode & 1)
printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%08lx "
"Address=0x%08lx Code 0x%02x\n", current->comm,
current->pid, instrptr, instr, addr, error_code);
"Address=0x%08lx FSR 0x%03x\n", current->comm,
current->pid, instrptr, instr, addr, fsr);
if (ai_usermode & 2)
goto fixup;
......@@ -607,3 +581,34 @@ int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs)
return 0;
}
/*
* This needs to be done after sysctl_init, otherwise sys/ will be
* overwritten. Actually, this shouldn't be in sys/ at all since
* it isn't a sysctl, and it doesn't contain sysctl information.
* We now locate it in /proc/cpu/alignment instead.
*/
static int __init alignment_init(void)
{
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *res;
res = proc_mkdir("cpu", NULL);
if (!res)
return -ENOMEM;
res = create_proc_entry("alignment", S_IWUSR | S_IRUGO, res);
if (!res)
return -ENOMEM;
res->read_proc = proc_alignment_read;
res->write_proc = proc_alignment_write;
#endif
hook_fault_code(1, do_alignment, SIGILL, "alignment exception");
hook_fault_code(3, do_alignment, SIGILL, "alignment exception");
return 0;
}
__initcall(alignment_init);
......@@ -2,102 +2,62 @@
* linux/arch/arm/mm/fault-armv.c
*
* Copyright (C) 1995 Linus Torvalds
* Modifications for ARM processor (c) 1995-2001 Russell King
* Modifications for ARM processor (c) 1995-2002 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/config.h>
#include <linux/compiler.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#include <linux/bitops.h>
#include <linux/init.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
extern void die_if_kernel(const char *str, struct pt_regs *regs, int err);
extern void show_pte(struct mm_struct *mm, unsigned long addr);
extern int do_page_fault(unsigned long addr, int error_code,
struct pt_regs *regs);
extern int do_translation_fault(unsigned long addr, int error_code,
struct pt_regs *regs);
extern void do_bad_area(struct task_struct *tsk, struct mm_struct *mm,
unsigned long addr, int error_code,
struct pt_regs *regs);
#ifdef CONFIG_ALIGNMENT_TRAP
extern int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs);
#else
#define do_alignment do_bad
#endif
#include "fault.h"
/*
* Some section permission faults need to be handled gracefully.
* They can happen due to a __{get,put}_user during an oops.
*/
static int
do_sect_fault(unsigned long addr, int error_code, struct pt_regs *regs)
do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
struct task_struct *tsk = current;
do_bad_area(tsk, tsk->active_mm, addr, error_code, regs);
do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
return 0;
}
/*
* Hook for things that need to trap external faults. Note that
* we don't guarantee that this will be the final version of the
* interface.
*/
int (*external_fault)(unsigned long addr, struct pt_regs *regs);
static int
do_external_fault(unsigned long addr, int error_code, struct pt_regs *regs)
{
if (external_fault)
return external_fault(addr, regs);
return 1;
}
/*
* This abort handler always returns "fault".
*/
static int
do_bad(unsigned long addr, int error_code, struct pt_regs *regs)
do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
return 1;
}
static const struct fsr_info {
int (*fn)(unsigned long addr, int error_code, struct pt_regs *regs);
static struct fsr_info {
int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
int sig;
const char *name;
} fsr_info[] = {
{ do_bad, SIGSEGV, "vector exception" },
{ do_alignment, SIGILL, "alignment exception" },
{ do_bad, SIGILL, "alignment exception" },
{ do_bad, SIGKILL, "terminal exception" },
{ do_alignment, SIGILL, "alignment exception" },
{ do_external_fault, SIGBUS, "external abort on linefetch" },
{ do_bad, SIGILL, "alignment exception" },
{ do_bad, SIGBUS, "external abort on linefetch" },
{ do_translation_fault, SIGSEGV, "section translation fault" },
{ do_external_fault, SIGBUS, "external abort on linefetch" },
{ do_bad, SIGBUS, "external abort on linefetch" },
{ do_page_fault, SIGSEGV, "page translation fault" },
{ do_external_fault, SIGBUS, "external abort on non-linefetch" },
{ do_bad, SIGBUS, "external abort on non-linefetch" },
{ do_bad, SIGSEGV, "section domain fault" },
{ do_external_fault, SIGBUS, "external abort on non-linefetch" },
{ do_bad, SIGBUS, "external abort on non-linefetch" },
{ do_bad, SIGSEGV, "page domain fault" },
{ do_bad, SIGBUS, "external abort on translation" },
{ do_sect_fault, SIGSEGV, "section permission fault" },
......@@ -105,6 +65,17 @@ static const struct fsr_info {
{ do_page_fault, SIGSEGV, "page permission fault" }
};
void __init
hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
int sig, const char *name)
{
if (nr >= 0 && nr < 16) {
fsr_info[nr].fn = fn;
fsr_info[nr].sig = sig;
fsr_info[nr].name = name;
}
}
/*
* Dispatch a data abort to the relevant handler.
*/
......
......@@ -23,9 +23,9 @@
#include <linux/init.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/unaligned.h>
#include "fault.h"
#ifdef CONFIG_CPU_26
#define FAULT_CODE_WRITE 0x02
......@@ -43,8 +43,6 @@
#define READ_FAULT(code) (!DO_COW(code))
#endif
NORET_TYPE void die(const char *msg, struct pt_regs *regs, int err) ATTRIB_NORET;
/*
* This is useful to dump out the page tables associated with
* 'addr' in mm 'mm'.
......@@ -101,7 +99,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
* Oops. The kernel tried to access some page that wasn't present.
*/
static void
__do_kernel_fault(struct mm_struct *mm, unsigned long addr, int error_code,
__do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
struct pt_regs *regs)
{
unsigned long fixup;
......@@ -127,7 +125,7 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, int error_code,
"paging request", addr);
show_pte(mm, addr);
die("Oops", regs, error_code);
die("Oops", regs, fsr);
do_exit(SIGKILL);
}
......@@ -136,20 +134,20 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, int error_code,
* User mode accesses just cause a SIGSEGV
*/
static void
__do_user_fault(struct task_struct *tsk, unsigned long addr, int error_code,
int code, struct pt_regs *regs)
__do_user_fault(struct task_struct *tsk, unsigned long addr,
unsigned int fsr, int code, struct pt_regs *regs)
{
struct siginfo si;
#ifdef CONFIG_DEBUG_USER
printk(KERN_DEBUG "%s: unhandled page fault at 0x%08lx, code 0x%03x\n",
tsk->comm, addr, error_code);
tsk->comm, addr, fsr);
show_pte(tsk->mm, addr);
show_regs(regs);
#endif
tsk->thread.address = addr;
tsk->thread.error_code = error_code;
tsk->thread.error_code = fsr;
tsk->thread.trap_no = 14;
si.si_signo = SIGSEGV;
si.si_errno = 0;
......@@ -160,20 +158,20 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr, int error_code,
void
do_bad_area(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr,
int error_code, struct pt_regs *regs)
unsigned int fsr, struct pt_regs *regs)
{
/*
* If we are in kernel mode at this point, we
* have no context to handle this fault with.
*/
if (user_mode(regs))
__do_user_fault(tsk, addr, error_code, SEGV_MAPERR, regs);
__do_user_fault(tsk, addr, fsr, SEGV_MAPERR, regs);
else
__do_kernel_fault(mm, addr, error_code, regs);
__do_kernel_fault(mm, addr, fsr, regs);
}
static int
__do_page_fault(struct mm_struct *mm, unsigned long addr, int error_code,
__do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
struct task_struct *tsk)
{
struct vm_area_struct *vma;
......@@ -191,7 +189,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, int error_code,
* memory access, so we can handle it.
*/
good_area:
if (READ_FAULT(error_code)) /* read? */
if (READ_FAULT(fsr)) /* read? */
mask = VM_READ|VM_EXEC;
else
mask = VM_WRITE;
......@@ -206,7 +204,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, int error_code,
* than endlessly redo the fault.
*/
survive:
fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, DO_COW(error_code));
fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, DO_COW(fsr));
/*
* Handle the "normal" cases first - successful and sigbus
......@@ -239,7 +237,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, int error_code,
return fault;
}
int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs)
int do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
struct task_struct *tsk;
struct mm_struct *mm;
......@@ -256,7 +254,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs)
goto no_context;
down_read(&mm->mmap_sem);
fault = __do_page_fault(mm, addr, error_code, tsk);
fault = __do_page_fault(mm, addr, fsr, tsk);
up_read(&mm->mmap_sem);
/*
......@@ -287,7 +285,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs)
printk("VM: killing process %s\n", tsk->comm);
do_exit(SIGKILL);
} else
__do_user_fault(tsk, addr, error_code, fault == -1 ?
__do_user_fault(tsk, addr, fsr, fault == -1 ?
SEGV_ACCERR : SEGV_MAPERR, regs);
return 0;
......@@ -302,7 +300,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs)
* or user mode.
*/
tsk->thread.address = addr;
tsk->thread.error_code = error_code;
tsk->thread.error_code = fsr;
tsk->thread.trap_no = 14;
force_sig(SIGBUS, tsk);
#ifdef CONFIG_DEBUG_USER
......@@ -315,7 +313,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs)
return 0;
no_context:
__do_kernel_fault(mm, addr, error_code, regs);
__do_kernel_fault(mm, addr, fsr, regs);
return 0;
}
......@@ -336,7 +334,8 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs)
* interrupt or a critical region, and should only copy the information
* from the master page table, nothing more.
*/
int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *regs)
int do_translation_fault(unsigned long addr, unsigned int fsr,
struct pt_regs *regs)
{
struct task_struct *tsk;
unsigned int offset;
......@@ -344,7 +343,7 @@ int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *reg
pmd_t *pmd, *pmd_k;
if (addr < TASK_SIZE)
return do_page_fault(addr, error_code, regs);
return do_page_fault(addr, fsr, regs);
offset = __pgd_offset(addr);
......@@ -372,6 +371,6 @@ int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *reg
bad_area:
tsk = current;
do_bad_area(tsk, tsk->active_mm, addr, error_code, regs);
do_bad_area(tsk, tsk->active_mm, addr, fsr, regs);
return 0;
}
void do_bad_area(struct task_struct *tsk, struct mm_struct *mm,
unsigned long addr, unsigned int fsr, struct pt_regs *regs);
void show_pte(struct mm_struct *mm, unsigned long addr);
int do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
int do_translation_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
......@@ -848,6 +848,7 @@ static void apm_cpu_idle(void)
case 1: apm_idle_done = 1;
break;
default: /* BIOS refused */
;
}
}
if (original_pm_idle)
......
......@@ -189,10 +189,10 @@ void __init smp_store_cpu_info(int id)
/* If we get here, it's not a certified SMP capable AMD system. */
printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n");
tainted |= TAINT_UNSAFE_SMP;
}
valid_k7:
valid_k7:
;
}
/*
......
......@@ -329,8 +329,8 @@ static void pcd_init_units( void )
}
int pcd_init (void) /* preliminary initialisation */
{ int i, unit;
{
int unit;
if (disable) return -1;
......
......@@ -381,9 +381,8 @@ void pd_init_units( void )
}
int pd_init (void)
{ int i;
request_queue_t * q;
{
request_queue_t * q;
if (disable) return -1;
if (devfs_register_blkdev(MAJOR_NR,name,&pd_fops)) {
......
......@@ -1507,7 +1507,6 @@ static int cdromplaytrkind(unsigned long arg)
static int cdromreadtochdr(unsigned long arg)
{
int status;
struct cdrom_tochdr tochdr;
tochdr.cdth_trk0 = disk_info.first;
......@@ -1519,7 +1518,6 @@ static int cdromreadtochdr(unsigned long arg)
static int cdromreadtocentry(unsigned long arg)
{
int status;
struct cdrom_tocentry entry;
struct cdrom_subchnl *tocptr;
......@@ -1646,7 +1644,6 @@ static int cdromseek(unsigned long arg)
#ifdef MULTISESSION
static int cdrommultisession(unsigned long arg)
{
int status;
struct cdrom_multisession ms;
if (copy_from_user(&ms, (void*) arg, sizeof ms))
......
......@@ -1012,7 +1012,6 @@ static int
sony_get_subchnl_info(long arg)
{
struct cdrom_subchnl schi;
int err;
/* Get attention stuff */
if (check_drive_status() != 0)
......
......@@ -48,7 +48,7 @@
#define MY_NAME THIS_MODULE->name
#endif
#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: "__FUNCTION__": " fmt , MY_NAME , ## arg); } while (0)
#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt, MY_NAME, __FUNCTION__, ## arg); } while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
......
......@@ -41,7 +41,7 @@
#define MY_NAME THIS_MODULE->name
#endif
#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: "__FUNCTION__": " fmt , MY_NAME , ## arg); } while (0)
#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt, MY_NAME, __FUNCTION__, ## arg); } while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
......
......@@ -381,10 +381,10 @@ int i2c_del_driver(struct i2c_driver *driver)
printk("i2c-core.o: while "
"unregistering driver "
"`%s', the client at "
"address %02x of
adapter `%s' could not
be detached; driver
not unloaded!",
"address %02x of "
"adapter `%s' could not "
"be detached; driver "
"not unloaded!",
driver->name,
client->addr,
adap->name);
......
......@@ -86,7 +86,7 @@ static unsigned int debug = 0;
#define PDEBUG(level, fmt, args...) \
do { \
if (debug >= level) \
info("[" __PRETTY_FUNCTION__ ":%d] " fmt, __LINE__ , ## args); \
info("[%s:%d] " fmt, __FUNCTION__, __LINE__ , ## args); \
} while (0)
......
......@@ -129,13 +129,13 @@ static void read_bulk_callback( struct urb *urb )
usb_rcvbulkpipe(ether_dev->usb, ether_dev->data_ep_in),
ether_dev->rx_buff, ether_dev->wMaxSegmentSize,
read_bulk_callback, ether_dev );
// Give this to the USB subsystem so it can tell us
// Give this to the USB subsystem so it can tell us
// when more data arrives.
if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) ) {
warn( __FUNCTION__ " failed submint rx_urb %d", res);
warn("%s failed submint rx_urb %d", __FUNCTION__, res);
}
// We are no longer busy, show us the frames!!!
ether_dev->flags &= ~CDC_ETHER_RX_BUSY;
}
......@@ -339,7 +339,7 @@ static int CDCEther_open(struct net_device *net)
// Turn on the USB and let the packets flow!!!
if ( (res = enable_net_traffic( ether_dev )) ) {
err( __FUNCTION__ "can't enable_net_traffic() - %d", res );
err("%s can't enable_net_traffic() - %d", __FUNCTION__, res );
return -EIO;
}
......@@ -353,7 +353,7 @@ static int CDCEther_open(struct net_device *net)
if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) )
{
// Hmm... Okay...
warn( __FUNCTION__ " failed rx_urb %d", res );
warn("%s failed rx_urb %d", __FUNCTION__, res );
}
// Tell the kernel we are ready to start receiving from it
......@@ -411,6 +411,7 @@ static int CDCEther_ioctl( struct net_device *net, struct ifreq *rq, int cmd )
}
}
#if 0
static void CDC_SetEthernetPacketFilter (ether_dev_t *ether_dev)
{
usb_control_msg(ether_dev->usb,
......@@ -422,15 +423,15 @@ static void CDC_SetEthernetPacketFilter (ether_dev_t *ether_dev)
NULL,
0, /* size */
HZ); /* timeout */
}
}
#endif
static void CDCEther_set_multicast( struct net_device *net )
{
ether_dev_t *ether_dev = net->priv;
int i;
__u8 *buff;
// Tell the kernel to stop sending us frames while we get this
// all set up.
......
......@@ -43,7 +43,7 @@
#define CDC_ETHER_REQ_GET_REGS 0xf0
#define CDC_ETHER_REQ_SET_REGS 0xf1
#define CDC_ETHER_REQ_SET_REG PIPERIDER_REQ_SET_REGS
#define ALIGN(x) x __attribute__((aligned(L1_CACHE_BYTES)))
#define L1_ALIGN(x) x __attribute__((aligned(L1_CACHE_BYTES)))
#define MODE_FLAG_PROMISCUOUS (1<<0)
#define MODE_FLAG_ALL_MULTICAST (1<<1)
......@@ -84,9 +84,9 @@ typedef struct _ether_dev_t {
__u8 bNumberPowerFilters;
int intr_interval;
struct urb *rx_urb, *tx_urb, *intr_urb;
unsigned char ALIGN(rx_buff[CDC_ETHER_MAX_MTU]);
unsigned char ALIGN(tx_buff[CDC_ETHER_MAX_MTU]);
unsigned char ALIGN(intr_buff[8]);
unsigned char L1_ALIGN(rx_buff[CDC_ETHER_MAX_MTU]);
unsigned char L1_ALIGN(tx_buff[CDC_ETHER_MAX_MTU]);
unsigned char L1_ALIGN(intr_buff[8]);
} ether_dev_t;
#define REQ_HDR_FUNC_DESCR 0x0001
......
......@@ -43,12 +43,14 @@
void cfb_imageblit(struct fb_info *p, struct fb_image *image)
{
int pad, ppw, shift, shift_right, shift_left, x2, y2, n, i, j, k, l = 7;
int pad, ppw;
int x2, y2, n, i, j, k, l = 7;
unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel);
unsigned long fgx, bgx, fgcolor, bgcolor, eorx;
unsigned long end_index, end_mask;
unsigned long end_mask;
unsigned long *dst = NULL;
u8 *dst1, *src;
u8 *dst1;
u8 *src;
/*
* We could use hardware clipping but on many cards you get around hardware
......@@ -97,8 +99,8 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
for (j = image->width/ppw; j > 0; j--) {
end_mask = 0;
for (k = ppw; k > 0; k--) {
if (test_bit(l, src))
for (k = ppw; k > 0; k--) {
if (test_bit(l, (unsigned long *) src))
end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
l--;
if (l < 0) { l = 7; src++; }
......@@ -110,7 +112,7 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
if (n) {
end_mask = 0;
for (j = n; j > 0; j--) {
if (test_bit(l, src))
if (test_bit(l, (unsigned long *) src))
end_mask |= (tmp >> (p->var.bits_per_pixel*(j-1)));
l--;
if (l < 0) { l = 7; src++; }
......
......@@ -257,7 +257,7 @@ int
adfs_map_lookup(struct super_block *sb, unsigned int frag_id,
unsigned int offset)
{
struct adfs_sb_info *asb = &sb->u.adfs_sb;
struct adfs_sb_info *asb = ADFS_SB(sb);
unsigned int zone, mapoff;
int result;
......
......@@ -7,20 +7,20 @@
(dentry)->d_parent->d_name.name,(dentry)->d_name.name
/*
* safety checks that should never happen ???
* safety checks that should never happen ???
* these are normally enabled.
*/
#ifdef SMBFS_PARANOIA
#define PARANOIA(x...) printk(KERN_NOTICE __FUNCTION__ ": " x)
# define PARANOIA(f, a...) printk(KERN_NOTICE "%s: " f, __FUNCTION__, ## a)
#else
#define PARANOIA(x...) do { ; } while(0)
# define PARANOIA(f, a...) do { ; } while(0)
#endif
/* lots of debug messages */
#ifdef SMBFS_DEBUG_VERBOSE
#define VERBOSE(x...) printk(KERN_DEBUG __FUNCTION__ ": " x)
# define VERBOSE(f, a...) printk(KERN_DEBUG "%s: " f, __FUNCTION__, ## a)
#else
#define VERBOSE(x...) do { ; } while(0)
# define VERBOSE(f, a...) do { ; } while(0)
#endif
/*
......
......@@ -32,7 +32,7 @@ typedef struct { volatile int counter; } atomic_t;
#define atomic_read(v) ((v)->counter)
#define atomic_set(v,i) (((v)->counter) = (i))
static __inline__ void atomic_add(int i, volatile atomic_t *v)
static inline void atomic_add(int i, volatile atomic_t *v)
{
unsigned long flags;
......@@ -41,7 +41,7 @@ static __inline__ void atomic_add(int i, volatile atomic_t *v)
__restore_flags(flags);
}
static __inline__ void atomic_sub(int i, volatile atomic_t *v)
static inline void atomic_sub(int i, volatile atomic_t *v)
{
unsigned long flags;
......@@ -50,7 +50,7 @@ static __inline__ void atomic_sub(int i, volatile atomic_t *v)
__restore_flags(flags);
}
static __inline__ void atomic_inc(volatile atomic_t *v)
static inline void atomic_inc(volatile atomic_t *v)
{
unsigned long flags;
......@@ -59,7 +59,7 @@ static __inline__ void atomic_inc(volatile atomic_t *v)
__restore_flags(flags);
}
static __inline__ void atomic_dec(volatile atomic_t *v)
static inline void atomic_dec(volatile atomic_t *v)
{
unsigned long flags;
......@@ -68,7 +68,7 @@ static __inline__ void atomic_dec(volatile atomic_t *v)
__restore_flags(flags);
}
static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
static inline int atomic_dec_and_test(volatile atomic_t *v)
{
unsigned long flags;
int val;
......@@ -94,7 +94,7 @@ static inline int atomic_add_negative(int i, volatile atomic_t *v)
return val < 0;
}
static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *addr)
static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
{
unsigned long flags;
......
......@@ -318,6 +318,12 @@ static inline unsigned long __ffs(unsigned long word)
return k;
}
/*
* fls: find last bit set.
*/
#define fls(x) generic_fls(x)
/*
* ffs: find first bit set. This is defined the same way as
* the libc and compiler builtin ffs routines, therefore
......@@ -332,15 +338,14 @@ static inline unsigned long __ffs(unsigned long word)
*/
static inline int sched_find_first_bit(unsigned long *b)
{
if (unlikely(b[0]))
return __ffs(b[0]);
if (unlikely(b[1]))
return __ffs(b[1]) + 32;
if (unlikely(b[2]))
return __ffs(b[2]) + 64;
if (b[3])
return __ffs(b[3]) + 96;
return __ffs(b[4]) + 128;
unsigned long v;
unsigned int off;
for (off = 0; v = b[off], off < 4; off++) {
if (unlikely(v))
break;
}
return __ffs(v) + off * 32;
}
/*
......
......@@ -24,6 +24,17 @@ extern int have_isa_bridge;
#define have_isa_bridge (0)
#endif
struct pt_regs;
void die(const char *msg, struct pt_regs *regs, int err)
__attribute__((noreturn));
void die_if_kernel(const char *str, struct pt_regs *regs, int err);
void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
struct pt_regs *),
int sig, const char *name);
#include <asm/proc-fns.h>
#define xchg(ptr,x) \
......
......@@ -24,7 +24,7 @@ typedef struct list_head list_t;
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
list_t name = LIST_HEAD_INIT(name)
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
......@@ -36,9 +36,7 @@ typedef struct list_head list_t;
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static __inline__ void __list_add(struct list_head * new,
struct list_head * prev,
struct list_head * next)
static inline void __list_add(list_t *new, list_t *prev, list_t *next)
{
next->prev = new;
new->next = next;
......@@ -54,7 +52,7 @@ static __inline__ void __list_add(struct list_head * new,
* Insert a new entry after the specified head.
* This is good for implementing stacks.
*/
static __inline__ void list_add(struct list_head *new, struct list_head *head)
static inline void list_add(list_t *new, list_t *head)
{
__list_add(new, head, head->next);
}
......@@ -67,7 +65,7 @@ static __inline__ void list_add(struct list_head *new, struct list_head *head)
* Insert a new entry before the specified head.
* This is useful for implementing queues.
*/
static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
static inline void list_add_tail(list_t *new, list_t *head)
{
__list_add(new, head->prev, head);
}
......@@ -79,8 +77,7 @@ static __inline__ void list_add_tail(struct list_head *new, struct list_head *he
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static __inline__ void __list_del(struct list_head * prev,
struct list_head * next)
static inline void __list_del(list_t * prev, list_t * next)
{
next->prev = prev;
prev->next = next;
......@@ -91,7 +88,7 @@ static __inline__ void __list_del(struct list_head * prev,
* @entry: the element to delete from the list.
* Note: list_empty on entry does not return true after this, the entry is in an undefined state.
*/
static __inline__ void list_del(struct list_head *entry)
static inline void list_del(list_t *entry)
{
__list_del(entry->prev, entry->next);
entry->next = (void *) 0;
......@@ -102,17 +99,39 @@ static __inline__ void list_del(struct list_head *entry)
* list_del_init - deletes entry from list and reinitialize it.
* @entry: the element to delete from the list.
*/
static __inline__ void list_del_init(struct list_head *entry)
static inline void list_del_init(list_t *entry)
{
__list_del(entry->prev, entry->next);
INIT_LIST_HEAD(entry);
}
/**
* list_move - delete from one list and add as another's head
* @list: the entry to move
* @head: the head that will precede our entry
*/
static inline void list_move(list_t *list, list_t *head)
{
__list_del(list->prev, list->next);
list_add(list, head);
}
/**
* list_move_tail - delete from one list and add as another's tail
* @list: the entry to move
* @head: the head that will follow our entry
*/
static inline void list_move_tail(list_t *list, list_t *head)
{
__list_del(list->prev, list->next);
list_add_tail(list, head);
}
/**
* list_empty - tests whether a list is empty
* @head: the list to test.
*/
static __inline__ int list_empty(struct list_head *head)
static inline int list_empty(list_t *head)
{
return head->next == head;
}
......@@ -122,13 +141,13 @@ static __inline__ int list_empty(struct list_head *head)
* @list: the new list to add.
* @head: the place to add it in the first list.
*/
static __inline__ void list_splice(struct list_head *list, struct list_head *head)
static inline void list_splice(list_t *list, list_t *head)
{
struct list_head *first = list->next;
list_t *first = list->next;
if (first != list) {
struct list_head *last = list->prev;
struct list_head *at = head->next;
list_t *last = list->prev;
list_t *at = head->next;
first->prev = head;
head->next = first;
......@@ -140,7 +159,7 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
/**
* list_entry - get the struct for this entry
* @ptr: the &struct list_head pointer.
* @ptr: the &list_t pointer.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct.
*/
......@@ -149,7 +168,7 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
/**
* list_for_each - iterate over a list
* @pos: the &struct list_head to use as a loop counter.
* @pos: the &list_t to use as a loop counter.
* @head: the head for your list.
*/
#define list_for_each(pos, head) \
......@@ -157,7 +176,7 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
pos = pos->next, prefetch(pos->next))
/**
* list_for_each_prev - iterate over a list backwards
* @pos: the &struct list_head to use as a loop counter.
* @pos: the &list_t to use as a loop counter.
* @head: the head for your list.
*/
#define list_for_each_prev(pos, head) \
......@@ -166,8 +185,8 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
/**
* list_for_each_safe - iterate over a list safe against removal of list entry
* @pos: the &struct list_head to use as a loop counter.
* @n: another &struct list_head to use as temporary storage
* @pos: the &list_t to use as a loop counter.
* @n: another &list_t to use as temporary storage
* @head: the head for your list.
*/
#define list_for_each_safe(pos, n, head) \
......
......@@ -22,5 +22,5 @@ $(TOPDIR)/include/linux/compile.h: ../include/linux/compile.h ;
# actual file if its content has changed.
../include/linux/compile.h: FORCE
@echo -n 'Generating $@'
@echo -n ' Generating $@'
@../scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
This diff is collapsed.
/*********************************************************************
*
*
* Filename: irda_device.c
* Version: 0.9
* Description: Utility functions used by the device drivers
......@@ -8,25 +8,25 @@
* Created at: Sat Oct 9 09:22:27 1999
* Modified at: Sun Jan 23 17:41:24 2000
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
*
* Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved.
* Copyright (c) 2000-2001 Jean Tourrilhes <jt@hpl.hp.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
********************************************************************/
#include <linux/config.h>
......@@ -83,7 +83,7 @@ const char *infrared_mode[] = {
#ifdef CONFIG_IRDA_DEBUG
static const char *task_state[] = {
"IRDA_TASK_INIT",
"IRDA_TASK_DONE",
"IRDA_TASK_DONE",
"IRDA_TASK_WAIT",
"IRDA_TASK_WAIT1",
"IRDA_TASK_WAIT2",
......@@ -97,7 +97,7 @@ static const char *task_state[] = {
static void irda_task_timer_expired(void *data);
#ifdef CONFIG_PROC_FS
int irda_device_proc_read(char *buf, char **start, off_t offset, int len,
int irda_device_proc_read(char *buf, char **start, off_t offset, int len,
int unused);
#endif /* CONFIG_PROC_FS */
......@@ -106,21 +106,19 @@ int __init irda_device_init( void)
{
dongles = hashbin_new(HB_GLOBAL);
if (dongles == NULL) {
printk(KERN_WARNING
"IrDA: Can't allocate dongles hashbin!\n");
printk(KERN_WARNING "IrDA: Can't allocate dongles hashbin!\n");
return -ENOMEM;
}
tasks = hashbin_new(HB_GLOBAL);
if (tasks == NULL) {
printk(KERN_WARNING
"IrDA: Can't allocate tasks hashbin!\n");
printk(KERN_WARNING "IrDA: Can't allocate tasks hashbin!\n");
return -ENOMEM;
}
/*
/*
* Call the init function of the device drivers that has not been
* compiled as a module
* compiled as a module
*/
#ifdef CONFIG_IRTTY_SIR
irtty_init();
......@@ -156,10 +154,10 @@ int __init irda_device_init( void)
litelink_init();
#endif
#ifdef CONFIG_OLD_BELKIN
old_belkin_init();
old_belkin_init();
#endif
#ifdef CONFIG_EP7211_IR
ep7211_ir_init();
ep7211_ir_init();
#endif
return 0;
}
......@@ -178,7 +176,7 @@ void irda_device_cleanup(void)
* Called when we have detected that another station is transmiting
* in contention mode.
*/
void irda_device_set_media_busy(struct net_device *dev, int status)
void irda_device_set_media_busy(struct net_device *dev, int status)
{
struct irlap_cb *self;
......@@ -203,15 +201,15 @@ void irda_device_set_media_busy(struct net_device *dev, int status)
}
int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts)
{
{
struct if_irda_req req;
int ret;
IRDA_DEBUG(2, __FUNCTION__ "()\n");
if (!dev->do_ioctl) {
ERROR(__FUNCTION__ "(), do_ioctl not impl. by "
"device driver\n");
ERROR("%s: do_ioctl not impl. by device driver\n",
__FUNCTION__);
return -1;
}
......@@ -224,15 +222,15 @@ int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts)
}
int irda_device_change_speed(struct net_device *dev, __u32 speed)
{
{
struct if_irda_req req;
int ret;
IRDA_DEBUG(2, __FUNCTION__ "()\n");
if (!dev->do_ioctl) {
ERROR(__FUNCTION__ "(), do_ioctl not impl. by "
"device driver\n");
ERROR("%s: do_ioctl not impl. by device driver\n",
__FUNCTION__);
return -1;
}
......@@ -257,8 +255,8 @@ int irda_device_is_receiving(struct net_device *dev)
IRDA_DEBUG(2, __FUNCTION__ "()\n");
if (!dev->do_ioctl) {
ERROR(__FUNCTION__ "(), do_ioctl not impl. by "
"device driver\n");
ERROR("%s: do_ioctl not impl. by device driver\n",
__FUNCTION__);
return -1;
}
......@@ -279,7 +277,7 @@ void irda_task_next_state(struct irda_task *task, IRDA_TASK_STATE state)
static void __irda_task_delete(struct irda_task *task)
{
del_timer(&task->timer);
kfree(task);
}
......@@ -314,14 +312,14 @@ int irda_task_kick(struct irda_task *task)
do {
timeout = task->function(task);
if (count++ > 100) {
ERROR(__FUNCTION__ "(), error in task handler!\n");
ERROR("%s: error in task handler!\n", __FUNCTION__);
irda_task_delete(task);
return TRUE;
}
}
} while ((timeout == 0) && (task->state != IRDA_TASK_DONE));
if (timeout < 0) {
ERROR(__FUNCTION__ "(), Error executing task!\n");
ERROR("%s: Error executing task!\n", __FUNCTION__);
irda_task_delete(task);
return TRUE;
}
......@@ -346,14 +344,14 @@ int irda_task_kick(struct irda_task *task)
/* Kick parent task */
irda_task_kick(task->parent);
}
}
}
irda_task_delete(task);
} else if (timeout > 0) {
irda_start_timer(&task->timer, timeout, (void *) task,
irda_start_timer(&task->timer, timeout, (void *) task,
irda_task_timer_expired);
finished = FALSE;
} else {
IRDA_DEBUG(0, __FUNCTION__
IRDA_DEBUG(0, __FUNCTION__
"(), not finished, and no timeout!\n");
finished = FALSE;
}
......@@ -367,7 +365,7 @@ int irda_task_kick(struct irda_task *task)
* This function registers and tries to execute tasks that may take some
* time to complete. We do it this hairy way since we may have been
* called from interrupt context, so it's not possible to use
* schedule_timeout()
* schedule_timeout()
* Two important notes :
* o Make sure you irda_task_delete(task); in case you delete the
* calling instance.
......@@ -375,9 +373,9 @@ int irda_task_kick(struct irda_task *task)
* want to lock within the task handler.
* Jean II
*/
struct irda_task *irda_task_execute(void *instance,
IRDA_TASK_CALLBACK function,
IRDA_TASK_CALLBACK finished,
struct irda_task *irda_task_execute(void *instance,
IRDA_TASK_CALLBACK function,
IRDA_TASK_CALLBACK finished,
struct irda_task *parent, void *param)
{
struct irda_task *task;
......@@ -394,7 +392,7 @@ struct irda_task *irda_task_execute(void *instance,
task->function = function;
task->finished = finished;
task->parent = parent;
task->param = param;
task->param = param;
task->magic = IRDA_TASK_MAGIC;
init_timer(&task->timer);
......@@ -433,7 +431,7 @@ static void irda_task_timer_expired(void *data)
* This function should be used by low level device drivers in a similar way
* as ether_setup() is used by normal network device drivers
*/
int irda_device_setup(struct net_device *dev)
int irda_device_setup(struct net_device *dev)
{
ASSERT(dev != NULL, return -1;);
......@@ -445,7 +443,7 @@ int irda_device_setup(struct net_device *dev)
dev->type = ARPHRD_IRDA;
dev->tx_queue_len = 8; /* Window size + 1 s-frame */
memset(dev->broadcast, 0xff, 4);
dev->mtu = 2048;
......@@ -491,7 +489,7 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
sprintf(modname, "irda-dongle-%d", type);
request_module(modname);
}
#endif /* CONFIG_KMOD */
#endif
if (!(reg = hashbin_find(dongles, type, NULL))) {
ERROR("IrDA: Unable to find requested dongle\n");
......@@ -514,9 +512,6 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
/*
* Function irda_device_dongle_cleanup (dongle)
*
*
*
*/
int irda_device_dongle_cleanup(dongle_t *dongle)
{
......@@ -531,21 +526,18 @@ int irda_device_dongle_cleanup(dongle_t *dongle)
/*
* Function irda_device_register_dongle (dongle)
*
*
*
*/
int irda_device_register_dongle(struct dongle_reg *new)
{
/* Check if this dongle has been registred before */
if (hashbin_find(dongles, new->type, NULL)) {
MESSAGE(__FUNCTION__ "(), Dongle already registered\n");
MESSAGE("%s: Dongle already registered\n", __FUNCTION__);
return 0;
}
/* Insert IrDA dongle into hashbin */
hashbin_insert(dongles, (irda_queue_t *) new, new->type, NULL);
return 0;
}
......@@ -561,7 +553,7 @@ void irda_device_unregister_dongle(struct dongle_reg *dongle)
node = hashbin_remove(dongles, dongle->type, NULL);
if (!node) {
ERROR(__FUNCTION__ "(), dongle not found!\n");
ERROR("%s: dongle not found!\n", __FUNCTION__);
return;
}
}
......@@ -574,22 +566,22 @@ void irda_device_unregister_dongle(struct dongle_reg *dongle)
* driver to find out which modes it support.
*/
int irda_device_set_mode(struct net_device* dev, int mode)
{
{
struct if_irda_req req;
int ret;
IRDA_DEBUG(0, __FUNCTION__ "()\n");
if (!dev->do_ioctl) {
ERROR(__FUNCTION__ "(), set_raw_mode not impl. by "
"device driver\n");
ERROR("%s: set_raw_mode not impl. by device driver\n",
__FUNCTION__);
return -1;
}
req.ifr_mode = mode;
ret = dev->do_ioctl(dev, (struct ifreq *) &req, SIOCSMODE);
return ret;
}
......@@ -602,9 +594,9 @@ int irda_device_set_mode(struct net_device* dev, int mode)
void setup_dma(int channel, char *buffer, int count, int mode)
{
unsigned long flags;
flags = claim_dma_lock();
disable_dma(channel);
clear_dma_ff(channel);
set_dma_mode(channel, mode);
......
This diff is collapsed.
This diff is collapsed.
/*********************************************************************
*
*
* Filename: irias_object.c
* Version: 0.3
* Description: IAS object database and functions
......@@ -8,18 +8,18 @@
* Created at: Thu Oct 1 22:50:04 1998
* Modified at: Wed Dec 15 11:23:16 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
*
* Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
*
* Neither Dag Brattli nor University of Troms admit liability nor
* provide warranty for any of this software. This material is
* provide warranty for any of this software. This material is
* provided "AS-IS" and at no charge.
*
*
********************************************************************/
#include <linux/string.h>
......@@ -47,7 +47,7 @@ char *strndup(char *str, int max)
{
char *new_str;
int len;
/* Check string */
if (str == NULL)
return NULL;
......@@ -59,14 +59,14 @@ char *strndup(char *str, int max)
/* Allocate new string */
new_str = kmalloc(len + 1, GFP_ATOMIC);
if (new_str == NULL) {
WARNING(__FUNCTION__"(), Unable to kmalloc!\n");
WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL;
}
/* Copy and truncate */
memcpy(new_str, str, len);
new_str[len] = '\0';
return new_str;
}
......@@ -79,10 +79,10 @@ char *strndup(char *str, int max)
struct ias_object *irias_new_object( char *name, int id)
{
struct ias_object *obj;
IRDA_DEBUG( 4, __FUNCTION__ "()\n");
obj = (struct ias_object *) kmalloc(sizeof(struct ias_object),
obj = (struct ias_object *) kmalloc(sizeof(struct ias_object),
GFP_ATOMIC);
if (obj == NULL) {
IRDA_DEBUG(0, __FUNCTION__ "(), Unable to allocate object!\n");
......@@ -95,7 +95,7 @@ struct ias_object *irias_new_object( char *name, int id)
obj->id = id;
obj->attribs = hashbin_new(HB_LOCAL);
return obj;
}
......@@ -115,7 +115,7 @@ void __irias_delete_attrib(struct ias_attrib *attrib)
irias_delete_value(attrib->value);
attrib->magic = ~IAS_ATTRIB_MAGIC;
kfree(attrib);
}
......@@ -126,11 +126,11 @@ void __irias_delete_object(struct ias_object *obj)
if (obj->name)
kfree(obj->name);
hashbin_delete(obj->attribs, (FREE_FUNC) __irias_delete_attrib);
obj->magic = ~IAS_OBJECT_MAGIC;
kfree(obj);
}
......@@ -141,7 +141,7 @@ void __irias_delete_object(struct ias_object *obj)
* with this object and the object itself
*
*/
int irias_delete_object(struct ias_object *obj)
int irias_delete_object(struct ias_object *obj)
{
struct ias_object *node;
......@@ -164,7 +164,7 @@ int irias_delete_object(struct ias_object *obj)
* the object, remove the object as well.
*
*/
int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib)
int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib)
{
struct ias_attrib *node;
......@@ -198,7 +198,7 @@ void irias_insert_object(struct ias_object *obj)
{
ASSERT(obj != NULL, return;);
ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
hashbin_insert(objects, (irda_queue_t *) obj, 0, obj->name);
}
......@@ -247,7 +247,7 @@ void irias_add_attrib( struct ias_object *obj, struct ias_attrib *attrib,
{
ASSERT(obj != NULL, return;);
ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
ASSERT(attrib != NULL, return;);
ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, return;);
......@@ -263,8 +263,8 @@ void irias_add_attrib( struct ias_object *obj, struct ias_attrib *attrib,
* Change the value of an objects attribute.
*
*/
int irias_object_change_attribute(char *obj_name, char *attrib_name,
struct ias_value *new_value)
int irias_object_change_attribute(char *obj_name, char *attrib_name,
struct ias_value *new_value)
{
struct ias_object *obj;
struct ias_attrib *attrib;
......@@ -272,7 +272,7 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name,
/* Find object */
obj = hashbin_find(objects, 0, obj_name);
if (obj == NULL) {
WARNING(__FUNCTION__ "(), Unable to find object: %s\n",
WARNING("%s: Unable to find object: %s\n", __FUNCTION__,
obj_name);
return -1;
}
......@@ -280,20 +280,20 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name,
/* Find attribute */
attrib = hashbin_find(obj->attribs, 0, attrib_name);
if (attrib == NULL) {
WARNING(__FUNCTION__ "(), Unable to find attribute: %s\n",
WARNING("%s: Unable to find attribute: %s\n", __FUNCTION__,
attrib_name);
return -1;
}
if ( attrib->value->type != new_value->type) {
IRDA_DEBUG( 0, __FUNCTION__
IRDA_DEBUG( 0, __FUNCTION__
"(), changing value type not allowed!\n");
return -1;
}
/* Delete old value */
irias_delete_value(attrib->value);
/* Insert new value */
attrib->value = new_value;
......@@ -315,11 +315,11 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
ASSERT(obj != NULL, return;);
ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
ASSERT(name != NULL, return;);
attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib),
attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib),
GFP_ATOMIC);
if (attrib == NULL) {
WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n");
WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__);
return;
}
memset(attrib, 0, sizeof( struct ias_attrib));
......@@ -329,7 +329,7 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
/* Insert value */
attrib->value = irias_new_integer_value(value);
irias_add_attrib(obj, attrib, owner);
}
......@@ -344,27 +344,26 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
int len, int owner)
{
struct ias_attrib *attrib;
ASSERT(obj != NULL, return;);
ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
ASSERT(name != NULL, return;);
ASSERT(octets != NULL, return;);
attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib),
attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib),
GFP_ATOMIC);
if (attrib == NULL) {
WARNING(__FUNCTION__
"(), Unable to allocate attribute!\n");
WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__);
return;
}
memset(attrib, 0, sizeof( struct ias_attrib));
attrib->magic = IAS_ATTRIB_MAGIC;
attrib->name = strndup(name, IAS_MAX_ATTRIBNAME);
attrib->value = irias_new_octseq_value( octets, len);
irias_add_attrib(obj, attrib, owner);
}
......@@ -384,11 +383,11 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
ASSERT(name != NULL, return;);
ASSERT(value != NULL, return;);
attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib),
attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib),
GFP_ATOMIC);
if (attrib == NULL) {
WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n");
WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__);
return;
}
memset(attrib, 0, sizeof( struct ias_attrib));
......@@ -413,7 +412,7 @@ struct ias_value *irias_new_integer_value(int integer)
value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) {
WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL;
}
memset(value, 0, sizeof(struct ias_value));
......@@ -438,7 +437,7 @@ struct ias_value *irias_new_string_value(char *string)
value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) {
WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL;
}
memset( value, 0, sizeof( struct ias_value));
......@@ -465,7 +464,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) {
WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL;
}
memset(value, 0, sizeof(struct ias_value));
......@@ -478,7 +477,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
value->t.oct_seq = kmalloc(len, GFP_ATOMIC);
if (value->t.oct_seq == NULL){
WARNING(__FUNCTION__"(), Unable to kmalloc!\n");
WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
kfree(value);
return NULL;
}
......@@ -492,7 +491,7 @@ struct ias_value *irias_new_missing_value(void)
value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) {
WARNING(__FUNCTION__ "(), Unable to kmalloc!\n");
WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL;
}
memset(value, 0, sizeof(struct ias_value));
......@@ -536,6 +535,3 @@ void irias_delete_value(struct ias_value *value)
}
kfree(value);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -22,7 +22,7 @@ TAIL=tail.tk
# Config.in files to depend on anyways. So I'll force it to remake.
kconfig.tk: $(TOPDIR)/arch/$(ARCH)/config.in tkparse $(HEADER) $(TAIL) FORCE
@echo Generating $@
@echo ' Generating $@'
@( \
if [ -f /usr/local/bin/wish ]; then \
echo '#!'"/usr/local/bin/wish -f"; \
......
This diff is collapsed.
......@@ -29,6 +29,7 @@
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
......
......@@ -29,6 +29,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/time.h>
#include <linux/init.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
......
......@@ -29,6 +29,7 @@
#include <sound/driver.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/init.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
......
......@@ -28,6 +28,7 @@
#define __NO_VERSION__
#include <sound/driver.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <sound/core.h>
#include <sound/emu10k1.h>
......
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