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) \ ...@@ -222,10 +222,10 @@ cmd_link_vmlinux = $(LD) $(LINKFLAGS) $(HEAD) $(INIT) \
define rule_link_vmlinux define rule_link_vmlinux
set -e set -e
echo Generating build number echo ' Generating build number'
. scripts/mkversion > .tmpversion . scripts/mkversion > .tmpversion
mv -f .tmpversion .version mv -f .tmpversion .version
$(MAKE) -C init +$(MAKE) -C init
$(call cmd,cmd_link_vmlinux) $(call cmd,cmd_link_vmlinux)
$(cmd_link_vmlinux) $(cmd_link_vmlinux)
echo 'cmd_$@ := $(cmd_link_vmlinux)' > $(@D)/.$(@F).cmd echo 'cmd_$@ := $(cmd_link_vmlinux)' > $(@D)/.$(@F).cmd
...@@ -243,14 +243,14 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ; ...@@ -243,14 +243,14 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ;
# Handle descending into subdirectories listed in $(SUBDIRS) # Handle descending into subdirectories listed in $(SUBDIRS)
.PHONY: $(SUBDIRS) .PHONY: $(SUBDIRS)
$(SUBDIRS): .hdepend prepare include/config/MARKER $(SUBDIRS): .hdepend prepare
@$(MAKE) -C $@ @$(MAKE) -C $@
# Things we need done before we descend to build or make # Things we need done before we descend to build or make
# module versions are listed in "prepare" # module versions are listed in "prepare"
.PHONY: prepare .PHONY: prepare
prepare: include/linux/version.h include/asm prepare: include/linux/version.h include/asm include/config/MARKER
# Single targets # Single targets
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -273,13 +273,13 @@ prepare: include/linux/version.h include/asm ...@@ -273,13 +273,13 @@ prepare: include/linux/version.h include/asm
# before switching between archs anyway. # before switching between archs anyway.
include/asm: include/asm:
@echo 'Making asm->asm-$(ARCH) symlink' @echo ' Making asm->asm-$(ARCH) symlink'
@ln -s asm-$(ARCH) $@ @ln -s asm-$(ARCH) $@
# Split autoconf.h into include/linux/config/* # Split autoconf.h into include/linux/config/*
include/config/MARKER: scripts/split-include include/linux/autoconf.h 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 @scripts/split-include include/linux/autoconf.h include/config
@touch $@ @touch $@
...@@ -306,7 +306,7 @@ include/linux/version.h: Makefile ...@@ -306,7 +306,7 @@ include/linux/version.h: Makefile
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \ exit 1; \
fi; fi;
@echo -n 'Generating $@' @echo -n ' Generating $@'
@(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \ @(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \ echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
...@@ -349,11 +349,11 @@ ifdef CONFIG_MODVERSIONS ...@@ -349,11 +349,11 @@ ifdef CONFIG_MODVERSIONS
include/linux/modversions.h: scripts/fixdep prepare FORCE include/linux/modversions.h: scripts/fixdep prepare FORCE
@rm -rf .tmp_export-objs @rm -rf .tmp_export-objs
@$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) @$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS))
@echo -n 'Generating $@' @echo -n ' Generating $@'
@( echo "#ifndef _LINUX_MODVERSIONS_H";\ @( echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \ echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.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}>"; \ echo "#include <linux/$${f}>"; \
done; \ done; \
echo "#endif"; \ echo "#endif"; \
...@@ -574,9 +574,8 @@ make_with_config: .config ...@@ -574,9 +574,8 @@ make_with_config: .config
# files removed with 'make clean' # files removed with 'make clean'
CLEAN_FILES += \ CLEAN_FILES += \
kernel/ksyms.lst include/linux/compile.h \ include/linux/compile.h \
vmlinux System.map \ vmlinux System.map \
.tmp* \
drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \ drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
drivers/char/conmakehash \ drivers/char/conmakehash \
drivers/char/drm/*-mod.c \ drivers/char/drm/*-mod.c \
...@@ -616,9 +615,11 @@ MRPROPER_FILES += \ ...@@ -616,9 +615,11 @@ MRPROPER_FILES += \
.hdepend scripts/split-include scripts/docproc \ .hdepend scripts/split-include scripts/docproc \
scripts/fixdep $(TOPDIR)/include/linux/modversions.h \ scripts/fixdep $(TOPDIR)/include/linux/modversions.h \
tags TAGS kernel.spec \ tags TAGS kernel.spec \
.tmpversion
# directories removed with 'make mrproper' # directories removed with 'make mrproper'
MRPROPER_DIRS += \ MRPROPER_DIRS += \
.tmp_export-objs \
include/config \ include/config \
$(TOPDIR)/include/linux/modules $(TOPDIR)/include/linux/modules
...@@ -631,7 +632,7 @@ clean: archclean ...@@ -631,7 +632,7 @@ clean: archclean
@find . \( -name \*.[oas] -o -name core -o -name .\*.cmd -o \ @find . \( -name \*.[oas] -o -name core -o -name .\*.cmd -o \
-name .\*.tmp -o -name .\*.d \) -type f -print \ -name .\*.tmp -o -name .\*.d \) -type f -print \
| grep -v lxdialog/ | xargs rm -f | grep -v lxdialog/ | xargs rm -f
@rm -rf $(CLEAN_FILES) @rm -f $(CLEAN_FILES)
@$(MAKE) -C Documentation/DocBook clean @$(MAKE) -C Documentation/DocBook clean
mrproper: clean archmrproper mrproper: clean archmrproper
......
...@@ -48,12 +48,9 @@ subdir- += $(__subdir-) ...@@ -48,12 +48,9 @@ subdir- += $(__subdir-)
obj-y := $(patsubst %/, %/built-in.o, $(obj-y)) obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
obj-m := $(filter-out %/, $(obj-m)) obj-m := $(filter-out %/, $(obj-m))
# If a dir is selected in $(subdir-y) and also mentioned in $(mod-subdirs), # Subdirectories we need to descend into
# add it to $(subdir-m)
both-m := $(filter $(mod-subdirs), $(subdir-y))
subdir-ym := $(sort $(subdir-y) $(subdir-m)) subdir-ym := $(sort $(subdir-y) $(subdir-m))
subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-))
# export.o is never a composite object, since $(export-objs) has a # export.o is never a composite object, since $(export-objs) has a
# fixed meaning (== objects which EXPORT_SYMBOL()) # fixed meaning (== objects which EXPORT_SYMBOL())
...@@ -85,8 +82,112 @@ subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o) ...@@ -85,8 +82,112 @@ subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o)
real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m))) $(EXTRA_TARGETS) real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m))) $(EXTRA_TARGETS)
real-objs-m := $(foreach m, $(obj-m), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m))) real-objs-m := $(foreach m, $(obj-m), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m)))
# Get things started. # Only build module versions for files which are selected to be built
export-objs := $(filter $(export-objs),$(real-objs-y) $(real-objs-m))
# We're called for one of three purposes:
# o fastdep: build module version files (.ver) for $(export-objs) in
# the current directory
# o modules_install: install the modules in the current directory
# o build: When no target is given, first_rule is the default and
# will build the built-in and modular objects in this dir
# (or a subset thereof, depending on $(KBUILD_MODULES),$(KBUILD_BUILTIN)
# When targets are given directly (like foo.o), we just build these
# targets (That happens when someone does make some/dir/foo.[ois])
ifeq ($(MAKECMDGOALS),fastdep)
# ===========================================================================
# Module versions
# ===========================================================================
ifeq ($(strip $(export-objs)),)
# If we don't export any symbols in this dir, just descend
# ---------------------------------------------------------------------------
fastdep: sub_dirs
@echo -n
else
# This sets version suffixes on exported symbols
# ---------------------------------------------------------------------------
MODVERDIR := $(TOPDIR)/include/linux/modules/$(RELDIR)
#
# Added the SMP separator to stop module accidents between uniprocessor
# and SMP Intel boxes - AC - from bits by Michael Chastain
#
ifdef CONFIG_SMP
genksyms_smp_prefix := -p smp_
else
genksyms_smp_prefix :=
endif
$(MODVERDIR)/$(real-objs-y:.o=.ver): modkern_cflags := $(CFLAGS_KERNEL)
$(MODVERDIR)/$(real-objs-m:.o=.ver): modkern_cflags := $(CFLAGS_MODULE)
$(MODVERDIR)/$(export-objs:.o=.ver): export_flags := -D__GENKSYMS__
c_flags = -Wp,-MD,$(@D)/.$(@F).d $(CFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) \
-DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) \
$(export_flags)
# Our objects only depend on modversions.h, not on the individual .ver
# files (fix-dep filters them), so touch modversions.h if any of the .ver
# files changes
quiet_cmd_cc_ver_c = MKVER include/linux/modules/$(RELDIR)/$*.ver
define cmd_cc_ver_c
mkdir -p $(dir $@); \
$(CPP) $(c_flags) $< | $(GENKSYMS) $(genksyms_smp_prefix) \
-k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp; \
if [ ! -r $@ ] || cmp -s $@ $@.tmp; then \
touch $(TOPDIR)/include/linux/modversions.h; \
fi; \
mv -f $@.tmp $@
endef
$(MODVERDIR)/%.ver: %.c FORCE
@$(call if_changed_dep,cc_ver_c)
targets := $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver))
fastdep: $(targets) sub_dirs
@mkdir -p $(TOPDIR)/.tmp_export-objs/modules/$(RELDIR)
@touch $(addprefix $(TOPDIR)/.tmp_export-objs/modules/$(RELDIR)/,$(export-objs:.o=.ver))
endif # export-objs
else # ! fastdep
ifeq ($(MAKECMDGOALS),modules_install)
# ==========================================================================
# Installing modules
# ==========================================================================
.PHONY: modules_install
modules_install: sub_dirs
ifneq ($(obj-m),)
@echo Installing modules in $(MODLIB)/kernel/$(RELDIR)
@mkdir -p $(MODLIB)/kernel/$(RELDIR)
@cp $(obj-m) $(MODLIB)/kernel/$(RELDIR)
else
@echo -n
endif
else # ! modules_install
# ========================================================================== # ==========================================================================
# Building
# ==========================================================================
# If a Makefile does define neither O_TARGET nor L_TARGET,
# use a standard O_TARGET named "built-in.o"
ifndef O_TARGET ifndef O_TARGET
ifndef L_TARGET ifndef L_TARGET
...@@ -103,15 +204,9 @@ first_rule: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \ ...@@ -103,15 +204,9 @@ first_rule: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \
# Compile C sources (.c) # Compile C sources (.c)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# If we don't know if built-in or modular, assume built-in. # Default is built-in, unless we know otherwise
# Only happens in Makefiles which override the default first_rule:
modkern_cflags := $(CFLAGS_KERNEL) modkern_cflags := $(CFLAGS_KERNEL)
$(real-objs-y) : modkern_cflags := $(CFLAGS_KERNEL)
$(real-objs-y:.o=.i) : modkern_cflags := $(CFLAGS_KERNEL)
$(real-objs-y:.o=.s) : modkern_cflags := $(CFLAGS_KERNEL)
$(real-objs-y:.o=.lst): modkern_cflags := $(CFLAGS_KERNEL)
$(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE) $(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE)
$(real-objs-m:.o=.i) : modkern_cflags := $(CFLAGS_MODULE) $(real-objs-m:.o=.i) : modkern_cflags := $(CFLAGS_MODULE)
$(real-objs-m:.o=.lst): modkern_cflags := $(CFLAGS_MODULE) $(real-objs-m:.o=.lst): modkern_cflags := $(CFLAGS_MODULE)
...@@ -121,60 +216,59 @@ $(export-objs:.o=.i) : export_flags := $(EXPORT_FLAGS) ...@@ -121,60 +216,59 @@ $(export-objs:.o=.i) : export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.s) : export_flags := $(EXPORT_FLAGS) $(export-objs:.o=.s) : export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.lst): export_flags := $(EXPORT_FLAGS) $(export-objs:.o=.lst): export_flags := $(EXPORT_FLAGS)
c_flags = $(CFLAGS) $(NOSTDINC_FLAGS) $(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(export_flags) c_flags = -Wp,-MD,$(@D)/.$(@F).d $(CFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) \
-DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) \
$(export_flags)
quiet_cmd_cc_s_c = CC $(RELDIR)/$@ quiet_cmd_cc_s_c = CC $(RELDIR)/$@
cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
%.s: %.c FORCE %.s: %.c FORCE
$(call cmd,cmd_cc_s_c) $(call if_changed_dep,cc_s_c)
quiet_cmd_cc_i_c = CPP $(RELDIR)/$@ quiet_cmd_cc_i_c = CPP $(RELDIR)/$@
cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $< cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
%.i: %.c FORCE %.i: %.c FORCE
$(call cmd,cmd_cc_i_c) $(call if_changed_dep,cc_i_c)
quiet_cmd_cc_o_c = CC $(RELDIR)/$@ quiet_cmd_cc_o_c = CC $(RELDIR)/$@
cmd_cc_o_c = $(CC) -Wp,-MD,.$(subst /,_,$@).d $(c_flags) -c -o $@ $< cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
%.o: %.c FORCE %.o: %.c FORCE
$(call if_changed_dep,cc_o_c) $(call if_changed_dep,cc_o_c)
quiet_cmd_cc_lst_c = Generating $(RELDIR)/$@ quiet_cmd_cc_lst_c = ' Generating $(RELDIR)/$@'
cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && $(TOPDIR)/scripts/makelst $*.o $(TOPDIR)/System.map $(OBJDUMP) > $@ cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && $(TOPDIR)/scripts/makelst $*.o $(TOPDIR)/System.map $(OBJDUMP) > $@
%.lst: %.c FORCE %.lst: %.c FORCE
$(call cmd,cmd_cc_lst_c) $(call if_changed_dep,cc_lst_c)
# Compile assembler sources (.S) # Compile assembler sources (.S)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# FIXME (s.a.)
modkern_aflags := $(AFLAGS_KERNEL) modkern_aflags := $(AFLAGS_KERNEL)
$(real-objs-y) : modkern_aflags := $(AFLAGS_KERNEL)
$(real-objs-y:.o=.s): modkern_aflags := $(AFLAGS_KERNEL)
$(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE)
$(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
a_flags = $(AFLAGS) $(NOSTDINC_FLAGS) $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) a_flags = -Wp,-MD,$(@D)/.$(@F).d $(AFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
quiet_cmd_as_s_S = CPP $(RELDIR)/$@ quiet_cmd_as_s_S = CPP $(RELDIR)/$@
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
%.s: %.S FORCE %.s: %.S FORCE
$(call cmd,cmd_as_s_S) $(call if_changed_dep,as_s_S)
quiet_cmd_as_o_S = AS $(RELDIR)/$@ quiet_cmd_as_o_S = AS $(RELDIR)/$@
cmd_as_o_S = $(CC) -Wp,-MD,.$(subst /,_,$@).d $(a_flags) -c -o $@ $< cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
%.o: %.S FORCE %.o: %.S FORCE
$(call if_changed_dep,as_o_S) $(call if_changed_dep,as_o_S)
# If a Makefile does define neither O_TARGET nor L_TARGET, targets += $(real-objs-y) $(real-objs-m) $(EXTRA_TARGETS) $(MAKECMDGOALS)
# use a standard O_TARGET named "built-in.o"
# Build the compiled-in targets # Build the compiled-in targets
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -193,7 +287,9 @@ cmd_link_o_target = $(if $(strip $(obj-y)),\ ...@@ -193,7 +287,9 @@ cmd_link_o_target = $(if $(strip $(obj-y)),\
rm -f $@; $(AR) rcs $@) rm -f $@; $(AR) rcs $@)
$(O_TARGET): $(obj-y) FORCE $(O_TARGET): $(obj-y) FORCE
$(call if_changed,cmd_link_o_target) $(call if_changed,link_o_target)
targets += $(O_TARGET)
endif # O_TARGET endif # O_TARGET
# #
...@@ -204,7 +300,9 @@ quiet_cmd_link_l_target = AR $(RELDIR)/$@ ...@@ -204,7 +300,9 @@ quiet_cmd_link_l_target = AR $(RELDIR)/$@
cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y) cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y)
$(L_TARGET): $(obj-y) FORCE $(L_TARGET): $(obj-y) FORCE
$(call if_changed,cmd_link_l_target) $(call if_changed,link_l_target)
targets += $(L_TARGET)
endif endif
# #
...@@ -219,10 +317,12 @@ cmd_link_multi = $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs) ...@@ -219,10 +317,12 @@ cmd_link_multi = $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs)
# but that's not so easy, so we rather make all composite objects depend # but that's not so easy, so we rather make all composite objects depend
# on the set of all their parts # on the set of all their parts
$(multi-used-y) : %.o: $(multi-objs-y) FORCE $(multi-used-y) : %.o: $(multi-objs-y) FORCE
$(call if_changed,cmd_link_multi) $(call if_changed,link_multi)
$(multi-used-m) : %.o: $(multi-objs-m) FORCE $(multi-used-m) : %.o: $(multi-objs-m) FORCE
$(call if_changed,cmd_link_multi) $(call if_changed,link_multi)
targets += $(multi-used-y) $(multi-used-m)
# Compile programs on the host # Compile programs on the host
# =========================================================================== # ===========================================================================
...@@ -250,51 +350,26 @@ cmd_host_cc__o = $(HOSTCC) $(HOSTLDFLAGS) -o $@ $($@-objs) \ ...@@ -250,51 +350,26 @@ cmd_host_cc__o = $(HOSTCC) $(HOSTLDFLAGS) -o $@ $($@-objs) \
$(HOST_LOADLIBES) $(HOST_LOADLIBES)
$(host-progs-multi): %: $(host-progs-multi-objs) FORCE $(host-progs-multi): %: $(host-progs-multi-objs) FORCE
$(call if_changed,cmd_host_cc__o) $(call if_changed,host_cc__o)
# Descending when making module versions
# ---------------------------------------------------------------------------
fastdep-list := $(addprefix _sfdep_,$(subdir-ymn))
.PHONY: fastdep $(fastdep-list) targets += $(host-progs-single) $(host-progs-multi-objs) $(host-progs-multi)
fastdep: $(fastdep-list) endif # ! modules_install
endif # ! fastdep
$(fastdep-list): # ===========================================================================
@$(MAKE) -C $(patsubst _sfdep_%,%,$@) fastdep # Generic stuff
# ===========================================================================
# Descending when building
# ---------------------------------------------------------------------------
subdir-list := $(addprefix _subdir_,$(subdir-ym))
.PHONY: sub_dirs $(subdir-list)
sub_dirs: $(subdir-list)
$(subdir-list):
@$(MAKE) -C $(patsubst _subdir_%,%,$@)
# Descending and installing modules # Descending
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
modinst-list := $(addprefix _modinst_,$(subdir-ym)) .PHONY: sub_dirs $(subdir-ym)
.PHONY: modules_install _modinst_ $(modinst-list) sub_dirs: $(subdir-ym)
modules_install: $(modinst-list) $(subdir-ym):
ifneq ($(obj-m),) @$(MAKE) -C $@ $(MAKECMDGOALS)
@echo Installing modules in $(MODLIB)/kernel/$(RELDIR)
@mkdir -p $(MODLIB)/kernel/$(RELDIR)
@cp $(obj-m) $(MODLIB)/kernel/$(RELDIR)
else
@echo -n
endif
$(modinst-list):
@$(MAKE) -C $(patsubst _modinst_%,%,$@) modules_install
# Add FORCE to the prequisites of a target to force it to be always rebuilt. # Add FORCE to the prequisites of a target to force it to be always rebuilt.
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -303,63 +378,12 @@ $(modinst-list): ...@@ -303,63 +378,12 @@ $(modinst-list):
FORCE: FORCE:
#
# This is useful for testing
# FIXME: really?
script:
$(SCRIPT)
# #
# This sets version suffixes on exported symbols # This sets version suffixes on exported symbols
# Separate the object into "normal" objects and "exporting" objects # Separate the object into "normal" objects and "exporting" objects
# Exporting objects are: all objects that define symbol tables # Exporting objects are: all objects that define symbol tables
# #
ifdef CONFIG_MODVERSIONS
ifneq "$(strip $(export-objs))" ""
MODVERDIR := $(TOPDIR)/include/linux/modules/$(RELDIR)
#
# Added the SMP separator to stop module accidents between uniprocessor
# and SMP Intel boxes - AC - from bits by Michael Chastain
#
ifdef CONFIG_SMP
genksyms_smp_prefix := -p smp_
else
genksyms_smp_prefix :=
endif
# We don't track dependencies for .ver files, so we FORCE to check
# them always (i.e. always at "make dep" time).
quiet_cmd_create_ver = Creating include/linux/modules/$(RELDIR)/$*.ver
cmd_create_ver = $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -E -D__GENKSYMS__ $< | \
$(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
$(MODVERDIR)/%.ver: %.c FORCE
@mkdir -p $(dir $@)
@$(call cmd,cmd_create_ver)
@if [ -r $@ ] && cmp -s $@ $@.tmp; then \
rm -f $@.tmp; \
else \
touch $(TOPDIR)/include/linux/modversions.h; \
mv -f $@.tmp $@; \
fi
# updates .ver files but not modversions.h
fastdep: $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver))
ifneq ($(export-objs),)
@mkdir -p $(TOPDIR)/.tmp_export-objs/modules/$(RELDIR)
@touch $(addprefix $(TOPDIR)/.tmp_export-objs/modules/$(RELDIR)/,$(export-objs:.o=.ver))
endif
endif # export-objs
endif # CONFIG_MODVERSIONS
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Check if command line has changed # Check if command line has changed
...@@ -391,9 +415,14 @@ endif # CONFIG_MODVERSIONS ...@@ -391,9 +415,14 @@ endif # CONFIG_MODVERSIONS
# which is saved in .<target>.o, to the current command line using # which is saved in .<target>.o, to the current command line using
# the two filter-out commands) # the two filter-out commands)
# read all saved command lines and dependencies # Read all saved command lines and dependencies for the $(targets) we
# may be building above, using $(if_changed{,_dep}). As an
# optimization, we don't need to read them if the target does not
# exist, we will rebuild anyway in that case.
targets := $(wildcard $(sort $(targets)))
cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
cmd_files := $(wildcard .*.cmd)
ifneq ($(cmd_files),) ifneq ($(cmd_files),)
include $(cmd_files) include $(cmd_files)
endif endif
...@@ -401,9 +430,12 @@ endif ...@@ -401,9 +430,12 @@ endif
# function to only execute the passed command if necessary # function to only execute the passed command if necessary
if_changed = $(if $(strip $? \ if_changed = $(if $(strip $? \
$(filter-out $($(1)),$(cmd_$(@F)))\ $(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$(@F)),$($(1)))),\ $(filter-out $(cmd_$@),$(cmd_$(1)))),\
@$(if $($(quiet)$(1)),echo ' $($(quiet)$(1))' &&) $($(1)) && echo 'cmd_$@ := $($(1))' > $(@D)/.$(@F).cmd) @set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \
$(cmd_$(1)); \
echo 'cmd_$@ := $(cmd_$(1))' > $(@D)/.$(@F).cmd)
# execute the command and also postprocess generated .d dependencies # execute the command and also postprocess generated .d dependencies
...@@ -415,9 +447,9 @@ if_changed_dep = $(if $(strip $? \ ...@@ -415,9 +447,9 @@ if_changed_dep = $(if $(strip $? \
@set -e; \ @set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \ $(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \
$(cmd_$(1)); \ $(cmd_$(1)); \
$(TOPDIR)/scripts/fixdep $(subst /,_,$@) $(TOPDIR) '$(cmd_$(1))' > .$(subst /,_,$@).tmp; \ $(TOPDIR)/scripts/fixdep $(@D)/.$(@F).d $@ $(TOPDIR) '$(cmd_$(1))' > $(@D)/.$(@F).tmp; \
rm -f .$(subst /,_,$@).d; \ rm -f $(@D)/.$(@F).d; \
mv -f .$(subst /,_,$@).tmp .$(subst /,_,$@).cmd ) mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
# If quiet is set, only print short version of command # If quiet is set, only print short version of command
......
...@@ -439,15 +439,16 @@ static int __init pci_v3_setup_resources(struct resource **resource) ...@@ -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_LBFADDR (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x20)
#define SC_LBFCODE (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x24) #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 pc = instruction_pointer(regs);
unsigned long instr = *(unsigned long *)pc; unsigned long instr = *(unsigned long *)pc;
#if 0 #if 0
char buf[128]; char buf[128];
sprintf(buf, "V3 fault: address=0x%08lx, pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n", sprintf(buf, "V3 fault: addr 0x%08lx, FSR 0x%03x, PC 0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n",
addr, pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255, addr, fsr, pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255,
v3_readb(V3_LB_ISTAT)); v3_readb(V3_LB_ISTAT));
printk(KERN_DEBUG "%s", buf); printk(KERN_DEBUG "%s", buf);
printascii(buf); printascii(buf);
...@@ -515,8 +516,6 @@ static void v3_irq(int irq, void *devid, struct pt_regs *regs) ...@@ -515,8 +516,6 @@ static void v3_irq(int irq, void *devid, struct pt_regs *regs)
#endif #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 __init pci_v3_setup(int nr, struct pci_sys_data *sys)
{ {
int ret = 0; int ret = 0;
...@@ -547,7 +546,10 @@ void __init pci_v3_preinit(void) ...@@ -547,7 +546,10 @@ void __init pci_v3_preinit(void)
/* /*
* Hook in our fault handler for PCI errors * 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); spin_lock_irqsave(&v3_lock, flags);
......
...@@ -106,19 +106,32 @@ static int iop310_pri_pci_status(void) ...@@ -106,19 +106,32 @@ static int iop310_pri_pci_status(void)
return ret; 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 static int
iop310_pri_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p) iop310_pri_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p)
{ {
int ret;
u8 val; u8 val;
*IOP310_POCCAR = iop310_cfg_address(dev, where); val = iop310_pri_read(dev, where) >> ((where & 3) * 8);
val = (*IOP310_POCCDR) >> ((where & 3) * 8);
__asm__ __volatile__("nop; nop; nop; nop");
ret = iop310_pri_pci_status(); if (iop310_pri_pci_status())
if (ret)
val = 0xff; val = 0xff;
*p = val; *p = val;
...@@ -129,16 +142,11 @@ iop310_pri_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p) ...@@ -129,16 +142,11 @@ iop310_pri_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p)
static int static int
iop310_pri_rd_cfg_word(struct pci_dev *dev, int where, u16 *p) iop310_pri_rd_cfg_word(struct pci_dev *dev, int where, u16 *p)
{ {
int ret;
u16 val; u16 val;
*IOP310_POCCAR = iop310_cfg_address(dev, where); val = iop310_pri_read(dev, where) >> ((where & 3) * 8);
val = (*IOP310_POCCDR) >> ((where & 2) * 8);
__asm__ __volatile__("nop; nop; nop; nop");
ret = iop310_pri_pci_status(); if (iop310_pri_pci_status())
if (ret)
val = 0xffff; val = 0xffff;
*p = val; *p = val;
...@@ -149,16 +157,11 @@ iop310_pri_rd_cfg_word(struct pci_dev *dev, int where, u16 *p) ...@@ -149,16 +157,11 @@ iop310_pri_rd_cfg_word(struct pci_dev *dev, int where, u16 *p)
static int static int
iop310_pri_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p) iop310_pri_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p)
{ {
int ret;
u32 val; u32 val;
*IOP310_POCCAR = iop310_cfg_address(dev, where); val = iop310_pri_read(dev, where);
val = *IOP310_POCCDR; if (iop310_pri_pci_status())
__asm__ __volatile__("nop; nop; nop; nop");
ret = iop310_pri_pci_status();
if (ret)
val = 0xffffffff; val = 0xffffffff;
*p = val; *p = val;
...@@ -169,16 +172,11 @@ iop310_pri_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p) ...@@ -169,16 +172,11 @@ iop310_pri_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p)
static int static int
iop310_pri_wr_cfg_byte(struct pci_dev *dev, int where, u8 v) iop310_pri_wr_cfg_byte(struct pci_dev *dev, int where, u8 v)
{ {
int ret;
u32 val; u32 val;
*IOP310_POCCAR = iop310_cfg_address(dev, where); val = iop310_pri_read(dev, where);
val = *IOP310_POCCDR; if (iop310_pri_pci_status() == 0) {
__asm__ __volatile__("nop; nop; nop; nop");
ret = iop310_pri_pci_status();
if (ret == 0) {
where = (where & 3) * 8; where = (where & 3) * 8;
val &= ~(0xff << where); val &= ~(0xff << where);
val |= v << where; val |= v << where;
...@@ -191,16 +189,11 @@ iop310_pri_wr_cfg_byte(struct pci_dev *dev, int where, u8 v) ...@@ -191,16 +189,11 @@ iop310_pri_wr_cfg_byte(struct pci_dev *dev, int where, u8 v)
static int static int
iop310_pri_wr_cfg_word(struct pci_dev *dev, int where, u16 v) iop310_pri_wr_cfg_word(struct pci_dev *dev, int where, u16 v)
{ {
int ret;
u32 val; 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 (iop310_pri_pci_status() == 0) {
if (ret == 0) {
where = (where & 2) * 8; where = (where & 2) * 8;
val &= ~(0xffff << where); val &= ~(0xffff << where);
val |= v << where; val |= v << where;
...@@ -211,11 +204,21 @@ iop310_pri_wr_cfg_word(struct pci_dev *dev, int where, u16 v) ...@@ -211,11 +204,21 @@ iop310_pri_wr_cfg_word(struct pci_dev *dev, int where, u16 v)
} }
static int 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); unsigned long addr;
*IOP310_POCCDR = v;
__asm__ __volatile__("nop; nop; nop; nop"); 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; return PCIBIOS_SUCCESSFUL;
} }
...@@ -248,28 +251,38 @@ static int iop310_sec_pci_status(void) ...@@ -248,28 +251,38 @@ static int iop310_sec_pci_status(void)
ret = 1; ret = 1;
} }
if (ret) if (ret)
DBG("ERROR (%08lx %08lx)", usr, uisr); DBG("ERROR (%08x %08x)", usr, uisr);
return ret; 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 static int
iop310_sec_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p) iop310_sec_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p)
{ {
int ret;
u8 val; u8 val;
DBG("rdb: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn), val = iop310_sec_read(dev, where) >> ((where & 3) * 8);
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = (*IOP310_SOCCDR) >> ((where & 3) * 8); if (iop310_sec_pci_status())
__asm__ __volatile__("nop; nop; nop; nop");
DBG(">= %08lx ", val);
ret = iop310_sec_pci_status();
if (ret)
val = 0xff; val = 0xff;
DBG("\n");
*p = val; *p = val;
return PCIBIOS_SUCCESSFUL; return PCIBIOS_SUCCESSFUL;
...@@ -278,21 +291,13 @@ iop310_sec_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p) ...@@ -278,21 +291,13 @@ iop310_sec_rd_cfg_byte(struct pci_dev *dev, int where, u8 *p)
static int static int
iop310_sec_rd_cfg_word(struct pci_dev *dev, int where, u16 *p) iop310_sec_rd_cfg_word(struct pci_dev *dev, int where, u16 *p)
{ {
int ret;
u16 val; u16 val;
DBG("rdw: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn), val = iop310_sec_read(dev, where) >> ((where & 3) * 8);
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = (*IOP310_SOCCDR) >> ((where & 3) * 8);
__asm__ __volatile__("nop; nop; nop; nop");
DBG(">= %08lx ", val); if (iop310_sec_pci_status())
ret = iop310_sec_pci_status();
if (ret)
val = 0xffff; val = 0xffff;
DBG("\n");
*p = val; *p = val;
return PCIBIOS_SUCCESSFUL; return PCIBIOS_SUCCESSFUL;
...@@ -301,21 +306,13 @@ iop310_sec_rd_cfg_word(struct pci_dev *dev, int where, u16 *p) ...@@ -301,21 +306,13 @@ iop310_sec_rd_cfg_word(struct pci_dev *dev, int where, u16 *p)
static int static int
iop310_sec_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p) iop310_sec_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p)
{ {
int ret;
u32 val; u32 val;
DBG("rdl: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn), val = iop310_sec_read(dev, where);
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = *IOP310_SOCCDR;
__asm__ __volatile__("nop; nop; nop; nop");
DBG(">= %08lx ", val); if (iop310_sec_pci_status())
ret = iop310_sec_pci_status();
if (ret)
val = 0xffffffff; val = 0xffffffff;
DBG("\n");
*p = val; *p = val;
return PCIBIOS_SUCCESSFUL; return PCIBIOS_SUCCESSFUL;
...@@ -324,63 +321,54 @@ iop310_sec_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p) ...@@ -324,63 +321,54 @@ iop310_sec_rd_cfg_dword(struct pci_dev *dev, int where, u32 *p)
static int static int
iop310_sec_wr_cfg_byte(struct pci_dev *dev, int where, u8 v) iop310_sec_wr_cfg_byte(struct pci_dev *dev, int where, u8 v)
{ {
int ret;
u32 val; u32 val;
DBG("wrb: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn), val = iop310_sec_read(dev, where);
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = *IOP310_SOCCDR;
__asm__ __volatile__("nop; nop; nop; nop");
DBG("<= %08lx", v); if (iop310_sec_pci_status() == 0) {
ret = iop310_sec_pci_status();
if (ret == 0) {
where = (where & 3) * 8; where = (where & 3) * 8;
val &= ~(0xff << where); val &= ~(0xff << where);
val |= v << where; val |= v << where;
*IOP310_SOCCDR = val; *IOP310_SOCCDR = val;
} }
DBG("\n");
return PCIBIOS_SUCCESSFUL; return PCIBIOS_SUCCESSFUL;
} }
static int static int
iop310_sec_wr_cfg_word(struct pci_dev *dev, int where, u16 v) iop310_sec_wr_cfg_word(struct pci_dev *dev, int where, u16 v)
{ {
int ret;
u32 val; u32 val;
DBG("wrw: %d:%02x.%x %02x ", dev->bus->number, PCI_SLOT(dev->devfn), val = iop310_sec_read(dev, where);
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where);
val = *IOP310_SOCCDR; if (iop310_sec_pci_status() == 0) {
__asm__ __volatile__("nop; nop; nop; nop");
DBG("<= %08lx", v);
ret = iop310_sec_pci_status();
if (ret == 0) {
where = (where & 2) * 8; where = (where & 2) * 8;
val &= ~(0xffff << where); val &= ~(0xffff << where);
val |= v << where; val |= v << where;
*IOP310_SOCCDR = val; *IOP310_SOCCDR = val;
} }
DBG("\n");
return PCIBIOS_SUCCESSFUL; return PCIBIOS_SUCCESSFUL;
} }
static int 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), unsigned long addr;
PCI_FUNC(dev->devfn), where);
*IOP310_SOCCAR = iop310_cfg_address(dev, where); addr = iop310_cfg_address(dev, where);
*IOP310_SOCCDR = v;
__asm__ __volatile__("nop; nop; nop; nop"); __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; return PCIBIOS_SUCCESSFUL;
} }
...@@ -394,13 +382,34 @@ static struct pci_ops iop310_secondary_ops = { ...@@ -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 * When a PCI device does not exist during config cycles, the 80200 gets
* bus error instead of returning 0xffffffff. This handler simply returns. * 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", DBG("PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx\n",
addr, regs->ARM_pc, regs->ARM_lr); 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; return 0;
} }
...@@ -515,6 +524,5 @@ void iop310_init(void) ...@@ -515,6 +524,5 @@ void iop310_init(void)
*/ */
*IOP310_PCR &= 0xfff8; *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 ...@@ -40,6 +40,7 @@ obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o
obj-$(CONFIG_SA1100_BADGE4) += badge4.o obj-$(CONFIG_SA1100_BADGE4) += badge4.o
export-objs += badge4.o export-objs += badge4.o
led-$(CONFIG_SA1100_BADGE4) += leds-badge4.o
obj-$(CONFIG_SA1100_BRUTUS) += brutus.o obj-$(CONFIG_SA1100_BRUTUS) += brutus.o
led-$(CONFIG_SA1100_BRUTUS) += leds-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) ...@@ -19,6 +19,8 @@ sa1100_leds_init(void)
leds_event = assabet_leds_event; leds_event = assabet_leds_event;
if (machine_is_consus()) if (machine_is_consus())
leds_event = consus_leds_event; leds_event = consus_leds_event;
if (machine_is_badge4())
leds_event = badge4_leds_event;
if (machine_is_brutus()) if (machine_is_brutus())
leds_event = brutus_leds_event; leds_event = brutus_leds_event;
if (machine_is_cerf()) if (machine_is_cerf())
......
extern void assabet_leds_event(led_event_t evt); 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 consus_leds_event(led_event_t evt);
extern void brutus_leds_event(led_event_t evt); extern void brutus_leds_event(led_event_t evt);
extern void cerf_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 ...@@ -26,11 +26,11 @@ obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o
obj-$(CONFIG_DISCONTIGMEM) += discontig.o obj-$(CONFIG_DISCONTIGMEM) += discontig.o
# Select the processor-specific files # Select the processor-specific files
p-$(CONFIG_CPU_26) += proc-arm2,3.o p-$(CONFIG_CPU_26) += proc-arm2_3.o
# ARMv3 # ARMv3
p-$(CONFIG_CPU_ARM610) += 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 p-$(CONFIG_CPU_ARM710) += proc-arm6_7.o tlb-v3.o copypage-v3.o
# ARMv4 # ARMv4
p-$(CONFIG_CPU_ARM720T) += proc-arm720.o tlb-v4.o copypage-v4wt.o abort-lv4t.o p-$(CONFIG_CPU_ARM720T) += proc-arm720.o tlb-v4.o copypage-v4wt.o abort-lv4t.o
......
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
extern void #include "fault.h"
do_bad_area(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr,
int error_code, struct pt_regs *regs);
/* /*
* 32-bit misaligned trap handler (c) 1998 San Mehat (CCC) -July 1998 * 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, ...@@ -130,31 +128,6 @@ static int proc_alignment_write(struct file *file, const char *buffer,
return count; 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 */ #endif /* CONFIG_PROC_FS */
union offset_union { union offset_union {
...@@ -486,7 +459,8 @@ do_alignment_ldmstm(unsigned long addr, unsigned long instr, struct pt_regs *reg ...@@ -486,7 +459,8 @@ do_alignment_ldmstm(unsigned long addr, unsigned long instr, struct pt_regs *reg
return TYPE_ERROR; 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; union offset_union offset;
unsigned long instr, instrptr; unsigned long instr, instrptr;
...@@ -577,7 +551,7 @@ int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs) ...@@ -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. * 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; return 0;
bad: bad:
...@@ -594,8 +568,8 @@ int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs) ...@@ -594,8 +568,8 @@ int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs)
if (ai_usermode & 1) if (ai_usermode & 1)
printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%08lx " printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%08lx "
"Address=0x%08lx Code 0x%02x\n", current->comm, "Address=0x%08lx FSR 0x%03x\n", current->comm,
current->pid, instrptr, instr, addr, error_code); current->pid, instrptr, instr, addr, fsr);
if (ai_usermode & 2) if (ai_usermode & 2)
goto fixup; goto fixup;
...@@ -607,3 +581,34 @@ int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs) ...@@ -607,3 +581,34 @@ int do_alignment(unsigned long addr, int error_code, struct pt_regs *regs)
return 0; 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 @@ ...@@ -2,102 +2,62 @@
* linux/arch/arm/mm/fault-armv.c * linux/arch/arm/mm/fault-armv.c
* *
* Copyright (C) 1995 Linus Torvalds * 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 * 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 * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/config.h>
#include <linux/compiler.h>
#include <linux/signal.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/mman.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
extern void die_if_kernel(const char *str, struct pt_regs *regs, int err); #include "fault.h"
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
/* /*
* Some section permission faults need to be handled gracefully. * Some section permission faults need to be handled gracefully.
* They can happen due to a __{get,put}_user during an oops. * They can happen due to a __{get,put}_user during an oops.
*/ */
static int 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; 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; 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". * This abort handler always returns "fault".
*/ */
static int 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; return 1;
} }
static const struct fsr_info { static struct fsr_info {
int (*fn)(unsigned long addr, int error_code, struct pt_regs *regs); int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
int sig; int sig;
const char *name; const char *name;
} fsr_info[] = { } fsr_info[] = {
{ do_bad, SIGSEGV, "vector exception" }, { do_bad, SIGSEGV, "vector exception" },
{ do_alignment, SIGILL, "alignment exception" }, { do_bad, SIGILL, "alignment exception" },
{ do_bad, SIGKILL, "terminal exception" }, { do_bad, SIGKILL, "terminal exception" },
{ do_alignment, SIGILL, "alignment exception" }, { do_bad, SIGILL, "alignment exception" },
{ do_external_fault, SIGBUS, "external abort on linefetch" }, { do_bad, SIGBUS, "external abort on linefetch" },
{ do_translation_fault, SIGSEGV, "section translation fault" }, { 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_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_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, SIGSEGV, "page domain fault" },
{ do_bad, SIGBUS, "external abort on translation" }, { do_bad, SIGBUS, "external abort on translation" },
{ do_sect_fault, SIGSEGV, "section permission fault" }, { do_sect_fault, SIGSEGV, "section permission fault" },
...@@ -105,6 +65,17 @@ static const struct fsr_info { ...@@ -105,6 +65,17 @@ static const struct fsr_info {
{ do_page_fault, SIGSEGV, "page permission fault" } { 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. * Dispatch a data abort to the relevant handler.
*/ */
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/unaligned.h>
#include "fault.h"
#ifdef CONFIG_CPU_26 #ifdef CONFIG_CPU_26
#define FAULT_CODE_WRITE 0x02 #define FAULT_CODE_WRITE 0x02
...@@ -43,8 +43,6 @@ ...@@ -43,8 +43,6 @@
#define READ_FAULT(code) (!DO_COW(code)) #define READ_FAULT(code) (!DO_COW(code))
#endif #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 * This is useful to dump out the page tables associated with
* 'addr' in mm 'mm'. * 'addr' in mm 'mm'.
...@@ -101,7 +99,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr) ...@@ -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. * Oops. The kernel tried to access some page that wasn't present.
*/ */
static void 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) struct pt_regs *regs)
{ {
unsigned long fixup; unsigned long fixup;
...@@ -127,7 +125,7 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, int error_code, ...@@ -127,7 +125,7 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, int error_code,
"paging request", addr); "paging request", addr);
show_pte(mm, addr); show_pte(mm, addr);
die("Oops", regs, error_code); die("Oops", regs, fsr);
do_exit(SIGKILL); do_exit(SIGKILL);
} }
...@@ -136,20 +134,20 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, int error_code, ...@@ -136,20 +134,20 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, int error_code,
* User mode accesses just cause a SIGSEGV * User mode accesses just cause a SIGSEGV
*/ */
static void static void
__do_user_fault(struct task_struct *tsk, unsigned long addr, int error_code, __do_user_fault(struct task_struct *tsk, unsigned long addr,
int code, struct pt_regs *regs) unsigned int fsr, int code, struct pt_regs *regs)
{ {
struct siginfo si; struct siginfo si;
#ifdef CONFIG_DEBUG_USER #ifdef CONFIG_DEBUG_USER
printk(KERN_DEBUG "%s: unhandled page fault at 0x%08lx, code 0x%03x\n", 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_pte(tsk->mm, addr);
show_regs(regs); show_regs(regs);
#endif #endif
tsk->thread.address = addr; tsk->thread.address = addr;
tsk->thread.error_code = error_code; tsk->thread.error_code = fsr;
tsk->thread.trap_no = 14; tsk->thread.trap_no = 14;
si.si_signo = SIGSEGV; si.si_signo = SIGSEGV;
si.si_errno = 0; si.si_errno = 0;
...@@ -160,20 +158,20 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr, int error_code, ...@@ -160,20 +158,20 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr, int error_code,
void void
do_bad_area(struct task_struct *tsk, struct mm_struct *mm, unsigned long addr, 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 * If we are in kernel mode at this point, we
* have no context to handle this fault with. * have no context to handle this fault with.
*/ */
if (user_mode(regs)) if (user_mode(regs))
__do_user_fault(tsk, addr, error_code, SEGV_MAPERR, regs); __do_user_fault(tsk, addr, fsr, SEGV_MAPERR, regs);
else else
__do_kernel_fault(mm, addr, error_code, regs); __do_kernel_fault(mm, addr, fsr, regs);
} }
static int 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 task_struct *tsk)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
...@@ -191,7 +189,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, int error_code, ...@@ -191,7 +189,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, int error_code,
* memory access, so we can handle it. * memory access, so we can handle it.
*/ */
good_area: good_area:
if (READ_FAULT(error_code)) /* read? */ if (READ_FAULT(fsr)) /* read? */
mask = VM_READ|VM_EXEC; mask = VM_READ|VM_EXEC;
else else
mask = VM_WRITE; mask = VM_WRITE;
...@@ -206,7 +204,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, int error_code, ...@@ -206,7 +204,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, int error_code,
* than endlessly redo the fault. * than endlessly redo the fault.
*/ */
survive: 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 * 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, ...@@ -239,7 +237,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, int error_code,
return fault; 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 task_struct *tsk;
struct mm_struct *mm; struct mm_struct *mm;
...@@ -256,7 +254,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs) ...@@ -256,7 +254,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs)
goto no_context; goto no_context;
down_read(&mm->mmap_sem); 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); up_read(&mm->mmap_sem);
/* /*
...@@ -287,7 +285,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs) ...@@ -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); printk("VM: killing process %s\n", tsk->comm);
do_exit(SIGKILL); do_exit(SIGKILL);
} else } else
__do_user_fault(tsk, addr, error_code, fault == -1 ? __do_user_fault(tsk, addr, fsr, fault == -1 ?
SEGV_ACCERR : SEGV_MAPERR, regs); SEGV_ACCERR : SEGV_MAPERR, regs);
return 0; return 0;
...@@ -302,7 +300,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs) ...@@ -302,7 +300,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs)
* or user mode. * or user mode.
*/ */
tsk->thread.address = addr; tsk->thread.address = addr;
tsk->thread.error_code = error_code; tsk->thread.error_code = fsr;
tsk->thread.trap_no = 14; tsk->thread.trap_no = 14;
force_sig(SIGBUS, tsk); force_sig(SIGBUS, tsk);
#ifdef CONFIG_DEBUG_USER #ifdef CONFIG_DEBUG_USER
...@@ -315,7 +313,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs) ...@@ -315,7 +313,7 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs)
return 0; return 0;
no_context: no_context:
__do_kernel_fault(mm, addr, error_code, regs); __do_kernel_fault(mm, addr, fsr, regs);
return 0; return 0;
} }
...@@ -336,7 +334,8 @@ int do_page_fault(unsigned long addr, int error_code, struct pt_regs *regs) ...@@ -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 * interrupt or a critical region, and should only copy the information
* from the master page table, nothing more. * 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; struct task_struct *tsk;
unsigned int offset; unsigned int offset;
...@@ -344,7 +343,7 @@ int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *reg ...@@ -344,7 +343,7 @@ int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *reg
pmd_t *pmd, *pmd_k; pmd_t *pmd, *pmd_k;
if (addr < TASK_SIZE) if (addr < TASK_SIZE)
return do_page_fault(addr, error_code, regs); return do_page_fault(addr, fsr, regs);
offset = __pgd_offset(addr); offset = __pgd_offset(addr);
...@@ -372,6 +371,6 @@ int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *reg ...@@ -372,6 +371,6 @@ int do_translation_fault(unsigned long addr, int error_code, struct pt_regs *reg
bad_area: bad_area:
tsk = current; 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; 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) ...@@ -848,6 +848,7 @@ static void apm_cpu_idle(void)
case 1: apm_idle_done = 1; case 1: apm_idle_done = 1;
break; break;
default: /* BIOS refused */ default: /* BIOS refused */
;
} }
} }
if (original_pm_idle) if (original_pm_idle)
......
...@@ -189,10 +189,10 @@ void __init smp_store_cpu_info(int id) ...@@ -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. */ /* 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"); printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n");
tainted |= TAINT_UNSAFE_SMP; tainted |= TAINT_UNSAFE_SMP;
} }
valid_k7:
valid_k7:
;
} }
/* /*
......
...@@ -329,8 +329,8 @@ static void pcd_init_units( void ) ...@@ -329,8 +329,8 @@ static void pcd_init_units( void )
} }
int pcd_init (void) /* preliminary initialisation */ int pcd_init (void) /* preliminary initialisation */
{
{ int i, unit; int unit;
if (disable) return -1; if (disable) return -1;
......
...@@ -381,8 +381,7 @@ void pd_init_units( void ) ...@@ -381,8 +381,7 @@ void pd_init_units( void )
} }
int pd_init (void) int pd_init (void)
{
{ int i;
request_queue_t * q; request_queue_t * q;
if (disable) return -1; if (disable) return -1;
......
...@@ -1507,7 +1507,6 @@ static int cdromplaytrkind(unsigned long arg) ...@@ -1507,7 +1507,6 @@ static int cdromplaytrkind(unsigned long arg)
static int cdromreadtochdr(unsigned long arg) static int cdromreadtochdr(unsigned long arg)
{ {
int status;
struct cdrom_tochdr tochdr; struct cdrom_tochdr tochdr;
tochdr.cdth_trk0 = disk_info.first; tochdr.cdth_trk0 = disk_info.first;
...@@ -1519,7 +1518,6 @@ static int cdromreadtochdr(unsigned long arg) ...@@ -1519,7 +1518,6 @@ static int cdromreadtochdr(unsigned long arg)
static int cdromreadtocentry(unsigned long arg) static int cdromreadtocentry(unsigned long arg)
{ {
int status;
struct cdrom_tocentry entry; struct cdrom_tocentry entry;
struct cdrom_subchnl *tocptr; struct cdrom_subchnl *tocptr;
...@@ -1646,7 +1644,6 @@ static int cdromseek(unsigned long arg) ...@@ -1646,7 +1644,6 @@ static int cdromseek(unsigned long arg)
#ifdef MULTISESSION #ifdef MULTISESSION
static int cdrommultisession(unsigned long arg) static int cdrommultisession(unsigned long arg)
{ {
int status;
struct cdrom_multisession ms; struct cdrom_multisession ms;
if (copy_from_user(&ms, (void*) arg, sizeof ms)) if (copy_from_user(&ms, (void*) arg, sizeof ms))
......
...@@ -1012,7 +1012,6 @@ static int ...@@ -1012,7 +1012,6 @@ static int
sony_get_subchnl_info(long arg) sony_get_subchnl_info(long arg)
{ {
struct cdrom_subchnl schi; struct cdrom_subchnl schi;
int err;
/* Get attention stuff */ /* Get attention stuff */
if (check_drive_status() != 0) if (check_drive_status() != 0)
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#define MY_NAME THIS_MODULE->name #define MY_NAME THIS_MODULE->name
#endif #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 err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%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) #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#define MY_NAME THIS_MODULE->name #define MY_NAME THIS_MODULE->name
#endif #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 err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%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) #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
......
...@@ -381,10 +381,10 @@ int i2c_del_driver(struct i2c_driver *driver) ...@@ -381,10 +381,10 @@ int i2c_del_driver(struct i2c_driver *driver)
printk("i2c-core.o: while " printk("i2c-core.o: while "
"unregistering driver " "unregistering driver "
"`%s', the client at " "`%s', the client at "
"address %02x of "address %02x of "
adapter `%s' could not "adapter `%s' could not "
be detached; driver "be detached; driver "
not unloaded!", "not unloaded!",
driver->name, driver->name,
client->addr, client->addr,
adap->name); adap->name);
......
...@@ -86,7 +86,7 @@ static unsigned int debug = 0; ...@@ -86,7 +86,7 @@ static unsigned int debug = 0;
#define PDEBUG(level, fmt, args...) \ #define PDEBUG(level, fmt, args...) \
do { \ do { \
if (debug >= level) \ if (debug >= level) \
info("[" __PRETTY_FUNCTION__ ":%d] " fmt, __LINE__ , ## args); \ info("[%s:%d] " fmt, __FUNCTION__, __LINE__ , ## args); \
} while (0) } while (0)
......
...@@ -133,7 +133,7 @@ static void read_bulk_callback( struct urb *urb ) ...@@ -133,7 +133,7 @@ static void read_bulk_callback( struct urb *urb )
// 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. // when more data arrives.
if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) ) { 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!!! // We are no longer busy, show us the frames!!!
...@@ -339,7 +339,7 @@ static int CDCEther_open(struct net_device *net) ...@@ -339,7 +339,7 @@ static int CDCEther_open(struct net_device *net)
// Turn on the USB and let the packets flow!!! // Turn on the USB and let the packets flow!!!
if ( (res = enable_net_traffic( ether_dev )) ) { 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; return -EIO;
} }
...@@ -353,7 +353,7 @@ static int CDCEther_open(struct net_device *net) ...@@ -353,7 +353,7 @@ static int CDCEther_open(struct net_device *net)
if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) ) if ( (res = usb_submit_urb(ether_dev->rx_urb, GFP_KERNEL)) )
{ {
// Hmm... Okay... // 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 // 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 ) ...@@ -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) static void CDC_SetEthernetPacketFilter (ether_dev_t *ether_dev)
{ {
usb_control_msg(ether_dev->usb, usb_control_msg(ether_dev->usb,
...@@ -423,7 +424,7 @@ static void CDC_SetEthernetPacketFilter (ether_dev_t *ether_dev) ...@@ -423,7 +424,7 @@ static void CDC_SetEthernetPacketFilter (ether_dev_t *ether_dev)
0, /* size */ 0, /* size */
HZ); /* timeout */ HZ); /* timeout */
} }
#endif
static void CDCEther_set_multicast( struct net_device *net ) static void CDCEther_set_multicast( struct net_device *net )
{ {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#define CDC_ETHER_REQ_GET_REGS 0xf0 #define CDC_ETHER_REQ_GET_REGS 0xf0
#define CDC_ETHER_REQ_SET_REGS 0xf1 #define CDC_ETHER_REQ_SET_REGS 0xf1
#define CDC_ETHER_REQ_SET_REG PIPERIDER_REQ_SET_REGS #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_PROMISCUOUS (1<<0)
#define MODE_FLAG_ALL_MULTICAST (1<<1) #define MODE_FLAG_ALL_MULTICAST (1<<1)
...@@ -84,9 +84,9 @@ typedef struct _ether_dev_t { ...@@ -84,9 +84,9 @@ typedef struct _ether_dev_t {
__u8 bNumberPowerFilters; __u8 bNumberPowerFilters;
int intr_interval; int intr_interval;
struct urb *rx_urb, *tx_urb, *intr_urb; struct urb *rx_urb, *tx_urb, *intr_urb;
unsigned char ALIGN(rx_buff[CDC_ETHER_MAX_MTU]); unsigned char L1_ALIGN(rx_buff[CDC_ETHER_MAX_MTU]);
unsigned char ALIGN(tx_buff[CDC_ETHER_MAX_MTU]); unsigned char L1_ALIGN(tx_buff[CDC_ETHER_MAX_MTU]);
unsigned char ALIGN(intr_buff[8]); unsigned char L1_ALIGN(intr_buff[8]);
} ether_dev_t; } ether_dev_t;
#define REQ_HDR_FUNC_DESCR 0x0001 #define REQ_HDR_FUNC_DESCR 0x0001
......
...@@ -43,12 +43,14 @@ ...@@ -43,12 +43,14 @@
void cfb_imageblit(struct fb_info *p, struct fb_image *image) 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 tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel);
unsigned long fgx, bgx, fgcolor, bgcolor, eorx; unsigned long fgx, bgx, fgcolor, bgcolor, eorx;
unsigned long end_index, end_mask; unsigned long end_mask;
unsigned long *dst = NULL; unsigned long *dst = NULL;
u8 *dst1, *src; u8 *dst1;
u8 *src;
/* /*
* We could use hardware clipping but on many cards you get around hardware * We could use hardware clipping but on many cards you get around hardware
...@@ -98,7 +100,7 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image) ...@@ -98,7 +100,7 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
end_mask = 0; end_mask = 0;
for (k = ppw; k > 0; k--) { for (k = ppw; k > 0; k--) {
if (test_bit(l, src)) if (test_bit(l, (unsigned long *) src))
end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1))); end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
l--; l--;
if (l < 0) { l = 7; src++; } if (l < 0) { l = 7; src++; }
...@@ -110,7 +112,7 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image) ...@@ -110,7 +112,7 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
if (n) { if (n) {
end_mask = 0; end_mask = 0;
for (j = n; j > 0; j--) { 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))); end_mask |= (tmp >> (p->var.bits_per_pixel*(j-1)));
l--; l--;
if (l < 0) { l = 7; src++; } if (l < 0) { l = 7; src++; }
......
...@@ -257,7 +257,7 @@ int ...@@ -257,7 +257,7 @@ int
adfs_map_lookup(struct super_block *sb, unsigned int frag_id, adfs_map_lookup(struct super_block *sb, unsigned int frag_id,
unsigned int offset) unsigned int offset)
{ {
struct adfs_sb_info *asb = &sb->u.adfs_sb; struct adfs_sb_info *asb = ADFS_SB(sb);
unsigned int zone, mapoff; unsigned int zone, mapoff;
int result; int result;
......
...@@ -11,16 +11,16 @@ ...@@ -11,16 +11,16 @@
* these are normally enabled. * these are normally enabled.
*/ */
#ifdef SMBFS_PARANOIA #ifdef SMBFS_PARANOIA
#define PARANOIA(x...) printk(KERN_NOTICE __FUNCTION__ ": " x) # define PARANOIA(f, a...) printk(KERN_NOTICE "%s: " f, __FUNCTION__, ## a)
#else #else
#define PARANOIA(x...) do { ; } while(0) # define PARANOIA(f, a...) do { ; } while(0)
#endif #endif
/* lots of debug messages */ /* lots of debug messages */
#ifdef SMBFS_DEBUG_VERBOSE #ifdef SMBFS_DEBUG_VERBOSE
#define VERBOSE(x...) printk(KERN_DEBUG __FUNCTION__ ": " x) # define VERBOSE(f, a...) printk(KERN_DEBUG "%s: " f, __FUNCTION__, ## a)
#else #else
#define VERBOSE(x...) do { ; } while(0) # define VERBOSE(f, a...) do { ; } while(0)
#endif #endif
/* /*
......
...@@ -32,7 +32,7 @@ typedef struct { volatile int counter; } atomic_t; ...@@ -32,7 +32,7 @@ typedef struct { volatile int counter; } atomic_t;
#define atomic_read(v) ((v)->counter) #define atomic_read(v) ((v)->counter)
#define atomic_set(v,i) (((v)->counter) = (i)) #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; unsigned long flags;
...@@ -41,7 +41,7 @@ static __inline__ void atomic_add(int i, volatile atomic_t *v) ...@@ -41,7 +41,7 @@ static __inline__ void atomic_add(int i, volatile atomic_t *v)
__restore_flags(flags); __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; unsigned long flags;
...@@ -50,7 +50,7 @@ static __inline__ void atomic_sub(int i, volatile atomic_t *v) ...@@ -50,7 +50,7 @@ static __inline__ void atomic_sub(int i, volatile atomic_t *v)
__restore_flags(flags); __restore_flags(flags);
} }
static __inline__ void atomic_inc(volatile atomic_t *v) static inline void atomic_inc(volatile atomic_t *v)
{ {
unsigned long flags; unsigned long flags;
...@@ -59,7 +59,7 @@ static __inline__ void atomic_inc(volatile atomic_t *v) ...@@ -59,7 +59,7 @@ static __inline__ void atomic_inc(volatile atomic_t *v)
__restore_flags(flags); __restore_flags(flags);
} }
static __inline__ void atomic_dec(volatile atomic_t *v) static inline void atomic_dec(volatile atomic_t *v)
{ {
unsigned long flags; unsigned long flags;
...@@ -68,7 +68,7 @@ static __inline__ void atomic_dec(volatile atomic_t *v) ...@@ -68,7 +68,7 @@ static __inline__ void atomic_dec(volatile atomic_t *v)
__restore_flags(flags); __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; unsigned long flags;
int val; int val;
...@@ -94,7 +94,7 @@ static inline int atomic_add_negative(int i, volatile atomic_t *v) ...@@ -94,7 +94,7 @@ static inline int atomic_add_negative(int i, volatile atomic_t *v)
return val < 0; 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; unsigned long flags;
......
...@@ -318,6 +318,12 @@ static inline unsigned long __ffs(unsigned long word) ...@@ -318,6 +318,12 @@ static inline unsigned long __ffs(unsigned long word)
return k; 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 * ffs: find first bit set. This is defined the same way as
* the libc and compiler builtin ffs routines, therefore * the libc and compiler builtin ffs routines, therefore
...@@ -332,15 +338,14 @@ static inline unsigned long __ffs(unsigned long word) ...@@ -332,15 +338,14 @@ static inline unsigned long __ffs(unsigned long word)
*/ */
static inline int sched_find_first_bit(unsigned long *b) static inline int sched_find_first_bit(unsigned long *b)
{ {
if (unlikely(b[0])) unsigned long v;
return __ffs(b[0]); unsigned int off;
if (unlikely(b[1]))
return __ffs(b[1]) + 32; for (off = 0; v = b[off], off < 4; off++) {
if (unlikely(b[2])) if (unlikely(v))
return __ffs(b[2]) + 64; break;
if (b[3]) }
return __ffs(b[3]) + 96; return __ffs(v) + off * 32;
return __ffs(b[4]) + 128;
} }
/* /*
......
...@@ -24,6 +24,17 @@ extern int have_isa_bridge; ...@@ -24,6 +24,17 @@ extern int have_isa_bridge;
#define have_isa_bridge (0) #define have_isa_bridge (0)
#endif #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> #include <asm/proc-fns.h>
#define xchg(ptr,x) \ #define xchg(ptr,x) \
......
...@@ -24,7 +24,7 @@ typedef struct list_head list_t; ...@@ -24,7 +24,7 @@ typedef struct list_head list_t;
#define LIST_HEAD_INIT(name) { &(name), &(name) } #define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(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 { \ #define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \
...@@ -36,9 +36,7 @@ typedef struct list_head list_t; ...@@ -36,9 +36,7 @@ typedef struct list_head list_t;
* This is only for internal list manipulation where we know * This is only for internal list manipulation where we know
* the prev/next entries already! * the prev/next entries already!
*/ */
static __inline__ void __list_add(struct list_head * new, static inline void __list_add(list_t *new, list_t *prev, list_t *next)
struct list_head * prev,
struct list_head * next)
{ {
next->prev = new; next->prev = new;
new->next = next; new->next = next;
...@@ -54,7 +52,7 @@ static __inline__ void __list_add(struct list_head * new, ...@@ -54,7 +52,7 @@ static __inline__ void __list_add(struct list_head * new,
* Insert a new entry after the specified head. * Insert a new entry after the specified head.
* This is good for implementing stacks. * 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); __list_add(new, head, head->next);
} }
...@@ -67,7 +65,7 @@ static __inline__ void list_add(struct list_head *new, struct list_head *head) ...@@ -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. * Insert a new entry before the specified head.
* This is useful for implementing queues. * 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); __list_add(new, head->prev, head);
} }
...@@ -79,8 +77,7 @@ static __inline__ void list_add_tail(struct list_head *new, struct list_head *he ...@@ -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 * This is only for internal list manipulation where we know
* the prev/next entries already! * the prev/next entries already!
*/ */
static __inline__ void __list_del(struct list_head * prev, static inline void __list_del(list_t * prev, list_t * next)
struct list_head * next)
{ {
next->prev = prev; next->prev = prev;
prev->next = next; prev->next = next;
...@@ -91,7 +88,7 @@ static __inline__ void __list_del(struct list_head * prev, ...@@ -91,7 +88,7 @@ static __inline__ void __list_del(struct list_head * prev,
* @entry: the element to delete from the list. * @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. * 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); __list_del(entry->prev, entry->next);
entry->next = (void *) 0; entry->next = (void *) 0;
...@@ -102,17 +99,39 @@ static __inline__ void list_del(struct list_head *entry) ...@@ -102,17 +99,39 @@ static __inline__ void list_del(struct list_head *entry)
* list_del_init - deletes entry from list and reinitialize it. * list_del_init - deletes entry from list and reinitialize it.
* @entry: the element to delete from the list. * @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); __list_del(entry->prev, entry->next);
INIT_LIST_HEAD(entry); 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 * list_empty - tests whether a list is empty
* @head: the list to test. * @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; return head->next == head;
} }
...@@ -122,13 +141,13 @@ static __inline__ int list_empty(struct list_head *head) ...@@ -122,13 +141,13 @@ static __inline__ int list_empty(struct list_head *head)
* @list: the new list to add. * @list: the new list to add.
* @head: the place to add it in the first list. * @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) { if (first != list) {
struct list_head *last = list->prev; list_t *last = list->prev;
struct list_head *at = head->next; list_t *at = head->next;
first->prev = head; first->prev = head;
head->next = first; head->next = first;
...@@ -140,7 +159,7 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea ...@@ -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 * 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. * @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct. * @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 ...@@ -149,7 +168,7 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
/** /**
* list_for_each - iterate over a list * 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. * @head: the head for your list.
*/ */
#define list_for_each(pos, head) \ #define list_for_each(pos, head) \
...@@ -157,7 +176,7 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea ...@@ -157,7 +176,7 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
pos = pos->next, prefetch(pos->next)) pos = pos->next, prefetch(pos->next))
/** /**
* list_for_each_prev - iterate over a list backwards * 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. * @head: the head for your list.
*/ */
#define list_for_each_prev(pos, head) \ #define list_for_each_prev(pos, head) \
...@@ -166,8 +185,8 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea ...@@ -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 * 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. * @pos: the &list_t to use as a loop counter.
* @n: another &struct list_head to use as temporary storage * @n: another &list_t to use as temporary storage
* @head: the head for your list. * @head: the head for your list.
*/ */
#define list_for_each_safe(pos, n, head) \ #define list_for_each_safe(pos, n, head) \
......
...@@ -22,5 +22,5 @@ $(TOPDIR)/include/linux/compile.h: ../include/linux/compile.h ; ...@@ -22,5 +22,5 @@ $(TOPDIR)/include/linux/compile.h: ../include/linux/compile.h ;
# actual file if its content has changed. # actual file if its content has changed.
../include/linux/compile.h: FORCE ../include/linux/compile.h: FORCE
@echo -n 'Generating $@' @echo -n ' Generating $@'
@../scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)" @../scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
...@@ -211,14 +211,14 @@ static void irda_connect_confirm(void *instance, void *sap, ...@@ -211,14 +211,14 @@ static void irda_connect_confirm(void *instance, void *sap,
switch (sk->type) { switch (sk->type) {
case SOCK_STREAM: case SOCK_STREAM:
if (max_sdu_size != 0) { if (max_sdu_size != 0) {
ERROR(__FUNCTION__ "(), max_sdu_size must be 0\n"); ERROR("%s: max_sdu_size must be 0\n", __FUNCTION__);
return; return;
} }
self->max_data_size = irttp_get_max_seg_size(self->tsap); self->max_data_size = irttp_get_max_seg_size(self->tsap);
break; break;
case SOCK_SEQPACKET: case SOCK_SEQPACKET:
if (max_sdu_size == 0) { if (max_sdu_size == 0) {
ERROR(__FUNCTION__ "(), max_sdu_size cannot be 0\n"); ERROR("%s: max_sdu_size cannot be 0\n", __FUNCTION__);
return; return;
} }
self->max_data_size = max_sdu_size; self->max_data_size = max_sdu_size;
...@@ -270,14 +270,14 @@ static void irda_connect_indication(void *instance, void *sap, ...@@ -270,14 +270,14 @@ static void irda_connect_indication(void *instance, void *sap,
switch (sk->type) { switch (sk->type) {
case SOCK_STREAM: case SOCK_STREAM:
if (max_sdu_size != 0) { if (max_sdu_size != 0) {
ERROR(__FUNCTION__ "(), max_sdu_size must be 0\n"); ERROR("%s: max_sdu_size must be 0\n", __FUNCTION__);
return; return;
} }
self->max_data_size = irttp_get_max_seg_size(self->tsap); self->max_data_size = irttp_get_max_seg_size(self->tsap);
break; break;
case SOCK_SEQPACKET: case SOCK_SEQPACKET:
if (max_sdu_size == 0) { if (max_sdu_size == 0) {
ERROR(__FUNCTION__ "(), max_sdu_size cannot be 0\n"); ERROR("%s: max_sdu_size cannot be 0\n", __FUNCTION__);
return; return;
} }
self->max_data_size = max_sdu_size; self->max_data_size = max_sdu_size;
...@@ -374,7 +374,7 @@ static void irda_getvalue_confirm(int result, __u16 obj_id, ...@@ -374,7 +374,7 @@ static void irda_getvalue_confirm(int result, __u16 obj_id,
self = (struct irda_sock *) priv; self = (struct irda_sock *) priv;
if (!self) { if (!self) {
WARNING(__FUNCTION__ "(), lost myself!\n"); WARNING("%s: lost myself!\n", __FUNCTION__);
return; return;
} }
...@@ -424,7 +424,7 @@ static void irda_selective_discovery_indication(discovery_t *discovery, ...@@ -424,7 +424,7 @@ static void irda_selective_discovery_indication(discovery_t *discovery,
self = (struct irda_sock *) priv; self = (struct irda_sock *) priv;
if (!self) { if (!self) {
WARNING(__FUNCTION__ "(), lost myself!\n"); WARNING("%s: lost myself!\n", __FUNCTION__);
return; return;
} }
...@@ -482,7 +482,7 @@ static int irda_open_tsap(struct irda_sock *self, __u8 tsap_sel, char *name) ...@@ -482,7 +482,7 @@ static int irda_open_tsap(struct irda_sock *self, __u8 tsap_sel, char *name)
notify_t notify; notify_t notify;
if (self->tsap) { if (self->tsap) {
WARNING(__FUNCTION__ "(), busy!\n"); WARNING("%s: busy!\n", __FUNCTION__);
return -EBUSY; return -EBUSY;
} }
...@@ -559,7 +559,7 @@ static int irda_find_lsap_sel(struct irda_sock *self, char *name) ...@@ -559,7 +559,7 @@ static int irda_find_lsap_sel(struct irda_sock *self, char *name)
ASSERT(self != NULL, return -1;); ASSERT(self != NULL, return -1;);
if (self->iriap) { if (self->iriap) {
WARNING(__FUNCTION__ "(), busy with a previous query\n"); WARNING("%s: busy with a previous query\n", __FUNCTION__);
return -EBUSY; return -EBUSY;
} }
...@@ -1141,7 +1141,7 @@ static int irda_create(struct socket *sock, int protocol) ...@@ -1141,7 +1141,7 @@ static int irda_create(struct socket *sock, int protocol)
self->max_sdu_size_rx = TTP_SAR_UNBOUND; self->max_sdu_size_rx = TTP_SAR_UNBOUND;
break; break;
default: default:
ERROR(__FUNCTION__ "(), protocol not supported!\n"); ERROR("%s: protocol not supported!\n", __FUNCTION__);
return -ESOCKTNOSUPPORT; return -ESOCKTNOSUPPORT;
} }
break; break;
...@@ -1208,9 +1208,6 @@ void irda_destroy_socket(struct irda_sock *self) ...@@ -1208,9 +1208,6 @@ void irda_destroy_socket(struct irda_sock *self)
/* /*
* Function irda_release (sock) * Function irda_release (sock)
*
*
*
*/ */
static int irda_release(struct socket *sock) static int irda_release(struct socket *sock)
{ {
...@@ -1423,9 +1420,6 @@ static inline int irda_data_wait(struct sock *sk) ...@@ -1423,9 +1420,6 @@ static inline int irda_data_wait(struct sock *sk)
/* /*
* Function irda_recvmsg_stream (sock, msg, size, flags, scm) * Function irda_recvmsg_stream (sock, msg, size, flags, scm)
*
*
*
*/ */
static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg, static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg,
int size, int flags, struct scm_cookie *scm) int size, int flags, struct scm_cookie *scm)
...@@ -1655,9 +1649,6 @@ static int irda_sendmsg_ultra(struct socket *sock, struct msghdr *msg, ...@@ -1655,9 +1649,6 @@ static int irda_sendmsg_ultra(struct socket *sock, struct msghdr *msg,
/* /*
* Function irda_shutdown (sk, how) * Function irda_shutdown (sk, how)
*
*
*
*/ */
static int irda_shutdown(struct socket *sock, int how) static int irda_shutdown(struct socket *sock, int how)
{ {
...@@ -1693,9 +1684,6 @@ static int irda_shutdown(struct socket *sock, int how) ...@@ -1693,9 +1684,6 @@ static int irda_shutdown(struct socket *sock, int how)
/* /*
* Function irda_poll (file, sock, wait) * Function irda_poll (file, sock, wait)
*
*
*
*/ */
static unsigned int irda_poll(struct file * file, struct socket *sock, static unsigned int irda_poll(struct file * file, struct socket *sock,
poll_table *wait) poll_table *wait)
...@@ -1758,9 +1746,6 @@ static unsigned int irda_poll(struct file * file, struct socket *sock, ...@@ -1758,9 +1746,6 @@ static unsigned int irda_poll(struct file * file, struct socket *sock,
/* /*
* Function irda_ioctl (sock, cmd, arg) * Function irda_ioctl (sock, cmd, arg)
*
*
*
*/ */
static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{ {
...@@ -2024,9 +2009,8 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, ...@@ -2024,9 +2009,8 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
"(), setting max_sdu_size = %d\n", opt); "(), setting max_sdu_size = %d\n", opt);
self->max_sdu_size_rx = opt; self->max_sdu_size_rx = opt;
} else { } else {
WARNING(__FUNCTION__ WARNING("%s: not allowed to set MAXSDUSIZE for this socket type!\n",
"(), not allowed to set MAXSDUSIZE for this " __FUNCTION__);
"socket type!\n");
return -ENOPROTOOPT; return -ENOPROTOOPT;
} }
break; break;
...@@ -2121,9 +2105,6 @@ static int irda_extract_ias_value(struct irda_ias_set *ias_opt, ...@@ -2121,9 +2105,6 @@ static int irda_extract_ias_value(struct irda_ias_set *ias_opt,
/* /*
* Function irda_getsockopt (sock, level, optname, optval, optlen) * Function irda_getsockopt (sock, level, optname, optval, optlen)
*
*
*
*/ */
static int irda_getsockopt(struct socket *sock, int level, int optname, static int irda_getsockopt(struct socket *sock, int level, int optname,
char *optval, int *optlen) char *optval, int *optlen)
...@@ -2301,8 +2282,8 @@ static int irda_getsockopt(struct socket *sock, int level, int optname, ...@@ -2301,8 +2282,8 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
/* Check that we can proceed with IAP */ /* Check that we can proceed with IAP */
if (self->iriap) { if (self->iriap) {
WARNING(__FUNCTION__ WARNING("%s: busy with a previous query\n",
"(), busy with a previous query\n"); __FUNCTION__);
kfree(ias_opt); kfree(ias_opt);
return -EBUSY; return -EBUSY;
} }
......
...@@ -106,15 +106,13 @@ int __init irda_device_init( void) ...@@ -106,15 +106,13 @@ int __init irda_device_init( void)
{ {
dongles = hashbin_new(HB_GLOBAL); dongles = hashbin_new(HB_GLOBAL);
if (dongles == NULL) { if (dongles == NULL) {
printk(KERN_WARNING printk(KERN_WARNING "IrDA: Can't allocate dongles hashbin!\n");
"IrDA: Can't allocate dongles hashbin!\n");
return -ENOMEM; return -ENOMEM;
} }
tasks = hashbin_new(HB_GLOBAL); tasks = hashbin_new(HB_GLOBAL);
if (tasks == NULL) { if (tasks == NULL) {
printk(KERN_WARNING printk(KERN_WARNING "IrDA: Can't allocate tasks hashbin!\n");
"IrDA: Can't allocate tasks hashbin!\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -210,8 +208,8 @@ int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts) ...@@ -210,8 +208,8 @@ int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts)
IRDA_DEBUG(2, __FUNCTION__ "()\n"); IRDA_DEBUG(2, __FUNCTION__ "()\n");
if (!dev->do_ioctl) { if (!dev->do_ioctl) {
ERROR(__FUNCTION__ "(), do_ioctl not impl. by " ERROR("%s: do_ioctl not impl. by device driver\n",
"device driver\n"); __FUNCTION__);
return -1; return -1;
} }
...@@ -231,8 +229,8 @@ int irda_device_change_speed(struct net_device *dev, __u32 speed) ...@@ -231,8 +229,8 @@ int irda_device_change_speed(struct net_device *dev, __u32 speed)
IRDA_DEBUG(2, __FUNCTION__ "()\n"); IRDA_DEBUG(2, __FUNCTION__ "()\n");
if (!dev->do_ioctl) { if (!dev->do_ioctl) {
ERROR(__FUNCTION__ "(), do_ioctl not impl. by " ERROR("%s: do_ioctl not impl. by device driver\n",
"device driver\n"); __FUNCTION__);
return -1; return -1;
} }
...@@ -257,8 +255,8 @@ int irda_device_is_receiving(struct net_device *dev) ...@@ -257,8 +255,8 @@ int irda_device_is_receiving(struct net_device *dev)
IRDA_DEBUG(2, __FUNCTION__ "()\n"); IRDA_DEBUG(2, __FUNCTION__ "()\n");
if (!dev->do_ioctl) { if (!dev->do_ioctl) {
ERROR(__FUNCTION__ "(), do_ioctl not impl. by " ERROR("%s: do_ioctl not impl. by device driver\n",
"device driver\n"); __FUNCTION__);
return -1; return -1;
} }
...@@ -314,14 +312,14 @@ int irda_task_kick(struct irda_task *task) ...@@ -314,14 +312,14 @@ int irda_task_kick(struct irda_task *task)
do { do {
timeout = task->function(task); timeout = task->function(task);
if (count++ > 100) { if (count++ > 100) {
ERROR(__FUNCTION__ "(), error in task handler!\n"); ERROR("%s: error in task handler!\n", __FUNCTION__);
irda_task_delete(task); irda_task_delete(task);
return TRUE; return TRUE;
} }
} while ((timeout == 0) && (task->state != IRDA_TASK_DONE)); } while ((timeout == 0) && (task->state != IRDA_TASK_DONE));
if (timeout < 0) { if (timeout < 0) {
ERROR(__FUNCTION__ "(), Error executing task!\n"); ERROR("%s: Error executing task!\n", __FUNCTION__);
irda_task_delete(task); irda_task_delete(task);
return TRUE; return TRUE;
} }
...@@ -491,7 +489,7 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type) ...@@ -491,7 +489,7 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
sprintf(modname, "irda-dongle-%d", type); sprintf(modname, "irda-dongle-%d", type);
request_module(modname); request_module(modname);
} }
#endif /* CONFIG_KMOD */ #endif
if (!(reg = hashbin_find(dongles, type, NULL))) { if (!(reg = hashbin_find(dongles, type, NULL))) {
ERROR("IrDA: Unable to find requested dongle\n"); ERROR("IrDA: Unable to find requested dongle\n");
...@@ -514,9 +512,6 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type) ...@@ -514,9 +512,6 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
/* /*
* Function irda_device_dongle_cleanup (dongle) * Function irda_device_dongle_cleanup (dongle)
*
*
*
*/ */
int irda_device_dongle_cleanup(dongle_t *dongle) int irda_device_dongle_cleanup(dongle_t *dongle)
{ {
...@@ -531,15 +526,12 @@ int irda_device_dongle_cleanup(dongle_t *dongle) ...@@ -531,15 +526,12 @@ int irda_device_dongle_cleanup(dongle_t *dongle)
/* /*
* Function irda_device_register_dongle (dongle) * Function irda_device_register_dongle (dongle)
*
*
*
*/ */
int irda_device_register_dongle(struct dongle_reg *new) int irda_device_register_dongle(struct dongle_reg *new)
{ {
/* Check if this dongle has been registred before */ /* Check if this dongle has been registred before */
if (hashbin_find(dongles, new->type, NULL)) { if (hashbin_find(dongles, new->type, NULL)) {
MESSAGE(__FUNCTION__ "(), Dongle already registered\n"); MESSAGE("%s: Dongle already registered\n", __FUNCTION__);
return 0; return 0;
} }
...@@ -561,7 +553,7 @@ void irda_device_unregister_dongle(struct dongle_reg *dongle) ...@@ -561,7 +553,7 @@ void irda_device_unregister_dongle(struct dongle_reg *dongle)
node = hashbin_remove(dongles, dongle->type, NULL); node = hashbin_remove(dongles, dongle->type, NULL);
if (!node) { if (!node) {
ERROR(__FUNCTION__ "(), dongle not found!\n"); ERROR("%s: dongle not found!\n", __FUNCTION__);
return; return;
} }
} }
...@@ -581,8 +573,8 @@ int irda_device_set_mode(struct net_device* dev, int mode) ...@@ -581,8 +573,8 @@ int irda_device_set_mode(struct net_device* dev, int mode)
IRDA_DEBUG(0, __FUNCTION__ "()\n"); IRDA_DEBUG(0, __FUNCTION__ "()\n");
if (!dev->do_ioctl) { if (!dev->do_ioctl) {
ERROR(__FUNCTION__ "(), set_raw_mode not impl. by " ERROR("%s: set_raw_mode not impl. by device driver\n",
"device driver\n"); __FUNCTION__);
return -1; return -1;
} }
......
...@@ -98,7 +98,7 @@ int __init iriap_init(void) ...@@ -98,7 +98,7 @@ int __init iriap_init(void)
objects = hashbin_new(HB_LOCAL); objects = hashbin_new(HB_LOCAL);
if (!objects) { if (!objects) {
WARNING(__FUNCTION__ "(), Can't allocate objects hashbin!\n"); WARNING("%s: Can't allocate objects hashbin!\n", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -164,7 +164,7 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv, ...@@ -164,7 +164,7 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
self = kmalloc(sizeof(struct iriap_cb), GFP_ATOMIC); self = kmalloc(sizeof(struct iriap_cb), GFP_ATOMIC);
if (!self) { if (!self) {
WARNING(__FUNCTION__ "(), Unable to kmalloc!\n"); WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL; return NULL;
} }
...@@ -261,7 +261,7 @@ static int iriap_register_lsap(struct iriap_cb *self, __u8 slsap_sel, int mode) ...@@ -261,7 +261,7 @@ static int iriap_register_lsap(struct iriap_cb *self, __u8 slsap_sel, int mode)
self->lsap = irlmp_open_lsap(slsap_sel, &notify, 0); self->lsap = irlmp_open_lsap(slsap_sel, &notify, 0);
if (self->lsap == NULL) { if (self->lsap == NULL) {
ERROR(__FUNCTION__ "(), Unable to allocated LSAP!\n"); ERROR("%s: Unable to allocated LSAP!\n", __FUNCTION__);
return -1; return -1;
} }
self->slsap_sel = self->lsap->slsap_sel; self->slsap_sel = self->lsap->slsap_sel;
...@@ -318,9 +318,6 @@ static void iriap_disconnect_indication(void *instance, void *sap, ...@@ -318,9 +318,6 @@ static void iriap_disconnect_indication(void *instance, void *sap,
/* /*
* Function iriap_disconnect_request (handle) * Function iriap_disconnect_request (handle)
*
*
*
*/ */
void iriap_disconnect_request(struct iriap_cb *self) void iriap_disconnect_request(struct iriap_cb *self)
{ {
...@@ -840,8 +837,8 @@ static int iriap_data_indication(void *instance, void *sap, ...@@ -840,8 +837,8 @@ static int iriap_data_indication(void *instance, void *sap,
} }
opcode = frame[0]; opcode = frame[0];
if (~opcode & IAP_LST) { if (~opcode & IAP_LST) {
WARNING(__FUNCTION__ "(), IrIAS multiframe commands or " WARNING("%s:, IrIAS multiframe commands or "
"results is not implemented yet!\n"); "results is not implemented yet!\n", __FUNCTION__);
dev_kfree_skb(skb); dev_kfree_skb(skb);
return 0; return 0;
} }
...@@ -927,16 +924,16 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb) ...@@ -927,16 +924,16 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb)
opcode = fp[0]; opcode = fp[0];
if (~opcode & 0x80) { if (~opcode & 0x80) {
WARNING(__FUNCTION__ "(), IrIAS multiframe commands or results" WARNING("%s: IrIAS multiframe commands or results"
"is not implemented yet!\n"); "is not implemented yet!\n", __FUNCTION__);
return; return;
} }
opcode &= 0x7f; /* Mask away LST bit */ opcode &= 0x7f; /* Mask away LST bit */
switch (opcode) { switch (opcode) {
case GET_INFO_BASE: case GET_INFO_BASE:
WARNING(__FUNCTION__ WARNING("%s: GetInfoBaseDetails not implemented yet!\n",
"(), GetInfoBaseDetails not implemented yet!\n"); __FUNCTION__);
break; break;
case GET_VALUE_BY_CLASS: case GET_VALUE_BY_CLASS:
iriap_getvaluebyclass_indication(self, skb); iriap_getvaluebyclass_indication(self, skb);
......
...@@ -362,7 +362,7 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event, ...@@ -362,7 +362,7 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event,
case IAP_LM_CONNECT_INDICATION: case IAP_LM_CONNECT_INDICATION:
tx_skb = dev_alloc_skb(64); tx_skb = dev_alloc_skb(64);
if (tx_skb == NULL) { if (tx_skb == NULL) {
WARNING(__FUNCTION__ "(), unable to malloc!\n"); WARNING("%s: unable to malloc!\n", __FUNCTION__);
return; return;
} }
...@@ -392,9 +392,6 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event, ...@@ -392,9 +392,6 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event,
/* /*
* Function state_r_call (self, event, skb) * Function state_r_call (self, event, skb)
*
*
*
*/ */
static void state_r_call(struct iriap_cb *self, IRIAP_EVENT event, static void state_r_call(struct iriap_cb *self, IRIAP_EVENT event,
struct sk_buff *skb) struct sk_buff *skb)
...@@ -415,13 +412,10 @@ static void state_r_call(struct iriap_cb *self, IRIAP_EVENT event, ...@@ -415,13 +412,10 @@ static void state_r_call(struct iriap_cb *self, IRIAP_EVENT event,
/* /*
* R-Connect FSM * R-Connect FSM
*/ */
/* /*
* Function state_r_waiting (self, event, skb) * Function state_r_waiting (self, event, skb)
*
*
*
*/ */
static void state_r_waiting(struct iriap_cb *self, IRIAP_EVENT event, static void state_r_waiting(struct iriap_cb *self, IRIAP_EVENT event,
struct sk_buff *skb) struct sk_buff *skb)
...@@ -500,12 +494,8 @@ static void state_r_returning(struct iriap_cb *self, IRIAP_EVENT event, ...@@ -500,12 +494,8 @@ static void state_r_returning(struct iriap_cb *self, IRIAP_EVENT event,
switch (event) { switch (event) {
case IAP_RECV_F_LST: case IAP_RECV_F_LST:
break; break;
default: default:
break; break;
} }
} }
...@@ -59,7 +59,7 @@ char *strndup(char *str, int max) ...@@ -59,7 +59,7 @@ char *strndup(char *str, int max)
/* Allocate new string */ /* Allocate new string */
new_str = kmalloc(len + 1, GFP_ATOMIC); new_str = kmalloc(len + 1, GFP_ATOMIC);
if (new_str == NULL) { if (new_str == NULL) {
WARNING(__FUNCTION__"(), Unable to kmalloc!\n"); WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL; return NULL;
} }
...@@ -272,7 +272,7 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name, ...@@ -272,7 +272,7 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name,
/* Find object */ /* Find object */
obj = hashbin_find(objects, 0, obj_name); obj = hashbin_find(objects, 0, obj_name);
if (obj == NULL) { if (obj == NULL) {
WARNING(__FUNCTION__ "(), Unable to find object: %s\n", WARNING("%s: Unable to find object: %s\n", __FUNCTION__,
obj_name); obj_name);
return -1; return -1;
} }
...@@ -280,7 +280,7 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name, ...@@ -280,7 +280,7 @@ int irias_object_change_attribute(char *obj_name, char *attrib_name,
/* Find attribute */ /* Find attribute */
attrib = hashbin_find(obj->attribs, 0, attrib_name); attrib = hashbin_find(obj->attribs, 0, attrib_name);
if (attrib == NULL) { if (attrib == NULL) {
WARNING(__FUNCTION__ "(), Unable to find attribute: %s\n", WARNING("%s: Unable to find attribute: %s\n", __FUNCTION__,
attrib_name); attrib_name);
return -1; return -1;
} }
...@@ -319,7 +319,7 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, ...@@ -319,7 +319,7 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib),
GFP_ATOMIC); GFP_ATOMIC);
if (attrib == NULL) { if (attrib == NULL) {
WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n"); WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__);
return; return;
} }
memset(attrib, 0, sizeof( struct ias_attrib)); memset(attrib, 0, sizeof( struct ias_attrib));
...@@ -354,8 +354,7 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, ...@@ -354,8 +354,7 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib),
GFP_ATOMIC); GFP_ATOMIC);
if (attrib == NULL) { if (attrib == NULL) {
WARNING(__FUNCTION__ WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__);
"(), Unable to allocate attribute!\n");
return; return;
} }
memset(attrib, 0, sizeof( struct ias_attrib)); memset(attrib, 0, sizeof( struct ias_attrib));
...@@ -388,7 +387,7 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, ...@@ -388,7 +387,7 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib), attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib),
GFP_ATOMIC); GFP_ATOMIC);
if (attrib == NULL) { if (attrib == NULL) {
WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n"); WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__);
return; return;
} }
memset(attrib, 0, sizeof( struct ias_attrib)); memset(attrib, 0, sizeof( struct ias_attrib));
...@@ -413,7 +412,7 @@ struct ias_value *irias_new_integer_value(int integer) ...@@ -413,7 +412,7 @@ struct ias_value *irias_new_integer_value(int integer)
value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) { if (value == NULL) {
WARNING(__FUNCTION__ "(), Unable to kmalloc!\n"); WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL; return NULL;
} }
memset(value, 0, sizeof(struct ias_value)); memset(value, 0, sizeof(struct ias_value));
...@@ -438,7 +437,7 @@ struct ias_value *irias_new_string_value(char *string) ...@@ -438,7 +437,7 @@ struct ias_value *irias_new_string_value(char *string)
value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) { if (value == NULL) {
WARNING(__FUNCTION__ "(), Unable to kmalloc!\n"); WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL; return NULL;
} }
memset( value, 0, sizeof( struct ias_value)); memset( value, 0, sizeof( struct ias_value));
...@@ -465,7 +464,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) ...@@ -465,7 +464,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) { if (value == NULL) {
WARNING(__FUNCTION__ "(), Unable to kmalloc!\n"); WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL; return NULL;
} }
memset(value, 0, sizeof(struct ias_value)); memset(value, 0, sizeof(struct ias_value));
...@@ -478,7 +477,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) ...@@ -478,7 +477,7 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len)
value->t.oct_seq = kmalloc(len, GFP_ATOMIC); value->t.oct_seq = kmalloc(len, GFP_ATOMIC);
if (value->t.oct_seq == NULL){ if (value->t.oct_seq == NULL){
WARNING(__FUNCTION__"(), Unable to kmalloc!\n"); WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
kfree(value); kfree(value);
return NULL; return NULL;
} }
...@@ -492,7 +491,7 @@ struct ias_value *irias_new_missing_value(void) ...@@ -492,7 +491,7 @@ struct ias_value *irias_new_missing_value(void)
value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC);
if (value == NULL) { if (value == NULL) {
WARNING(__FUNCTION__ "(), Unable to kmalloc!\n"); WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL; return NULL;
} }
memset(value, 0, sizeof(struct ias_value)); memset(value, 0, sizeof(struct ias_value));
...@@ -536,6 +535,3 @@ void irias_delete_value(struct ias_value *value) ...@@ -536,6 +535,3 @@ void irias_delete_value(struct ias_value *value)
} }
kfree(value); kfree(value);
} }
...@@ -82,7 +82,7 @@ int __init irlap_init(void) ...@@ -82,7 +82,7 @@ int __init irlap_init(void)
/* Allocate master array */ /* Allocate master array */
irlap = hashbin_new(HB_LOCAL); irlap = hashbin_new(HB_LOCAL);
if (irlap == NULL) { if (irlap == NULL) {
ERROR(__FUNCTION__ "(), can't allocate irlap hashbin!\n"); ERROR("%s: can't allocate irlap hashbin!\n", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -477,7 +477,7 @@ void irlap_disconnect_indication(struct irlap_cb *self, LAP_REASON reason) ...@@ -477,7 +477,7 @@ void irlap_disconnect_indication(struct irlap_cb *self, LAP_REASON reason)
reason, NULL); reason, NULL);
break; break;
default: default:
ERROR(__FUNCTION__ "(), Unknown reason %d\n", reason); ERROR("%s: Unknown reason %d\n", __FUNCTION__, reason);
} }
} }
...@@ -599,9 +599,6 @@ void irlap_discovery_indication(struct irlap_cb *self, discovery_t *discovery) ...@@ -599,9 +599,6 @@ void irlap_discovery_indication(struct irlap_cb *self, discovery_t *discovery)
/* /*
* Function irlap_status_indication (quality_of_link) * Function irlap_status_indication (quality_of_link)
*
*
*
*/ */
void irlap_status_indication(struct irlap_cb *self, int quality_of_link) void irlap_status_indication(struct irlap_cb *self, int quality_of_link)
{ {
...@@ -621,9 +618,6 @@ void irlap_status_indication(struct irlap_cb *self, int quality_of_link) ...@@ -621,9 +618,6 @@ void irlap_status_indication(struct irlap_cb *self, int quality_of_link)
/* /*
* Function irlap_reset_indication (void) * Function irlap_reset_indication (void)
*
*
*
*/ */
void irlap_reset_indication(struct irlap_cb *self) void irlap_reset_indication(struct irlap_cb *self)
{ {
...@@ -640,9 +634,6 @@ void irlap_reset_indication(struct irlap_cb *self) ...@@ -640,9 +634,6 @@ void irlap_reset_indication(struct irlap_cb *self)
/* /*
* Function irlap_reset_confirm (void) * Function irlap_reset_confirm (void)
*
*
*
*/ */
void irlap_reset_confirm(void) void irlap_reset_confirm(void)
{ {
...@@ -926,7 +917,6 @@ void irlap_init_qos_capabilities(struct irlap_cb *self, ...@@ -926,7 +917,6 @@ void irlap_init_qos_capabilities(struct irlap_cb *self,
* Function irlap_apply_default_connection_parameters (void, now) * Function irlap_apply_default_connection_parameters (void, now)
* *
* Use the default connection and transmission parameters * Use the default connection and transmission parameters
*
*/ */
void irlap_apply_default_connection_parameters(struct irlap_cb *self) void irlap_apply_default_connection_parameters(struct irlap_cb *self)
{ {
...@@ -1180,4 +1170,3 @@ int irlap_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -1180,4 +1170,3 @@ int irlap_proc_read(char *buf, char **start, off_t offset, int len)
} }
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
...@@ -578,9 +578,9 @@ static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event, ...@@ -578,9 +578,9 @@ static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event,
info->discovery->daddr); info->discovery->daddr);
if (!self->discovery_log) { if (!self->discovery_log) {
WARNING(__FUNCTION__ "(), discovery log is gone! " WARNING("%s: discovery log is gone! "
"maybe the discovery timeout has been set to " "maybe the discovery timeout has been set to "
"short?\n"); "short?\n", __FUNCTION__);
break; break;
} }
hashbin_insert(self->discovery_log, hashbin_insert(self->discovery_log,
...@@ -1353,7 +1353,7 @@ static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event, ...@@ -1353,7 +1353,7 @@ static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event,
del_timer(&self->final_timer); del_timer(&self->final_timer);
irlap_data_indication(self, skb, TRUE); irlap_data_indication(self, skb, TRUE);
irlap_next_state(self, LAP_XMIT_P); irlap_next_state(self, LAP_XMIT_P);
printk(__FUNCTION__ "(): RECV_UI_FRAME: next state %s\n", irlap_state[self->state]); printk("%s: RECV_UI_FRAME: next state %s\n", __FUNCTION__, irlap_state[self->state]);
irlap_start_poll_timer(self, self->poll_timeout); irlap_start_poll_timer(self, self->poll_timeout);
} }
break; break;
...@@ -2121,9 +2121,6 @@ static int irlap_state_nrm_s(struct irlap_cb *self, IRLAP_EVENT event, ...@@ -2121,9 +2121,6 @@ static int irlap_state_nrm_s(struct irlap_cb *self, IRLAP_EVENT event,
/* /*
* Function irlap_state_sclose (self, event, skb, info) * Function irlap_state_sclose (self, event, skb, info)
*
*
*
*/ */
static int irlap_state_sclose(struct irlap_cb *self, IRLAP_EVENT event, static int irlap_state_sclose(struct irlap_cb *self, IRLAP_EVENT event,
struct sk_buff *skb, struct irlap_info *info) struct sk_buff *skb, struct irlap_info *info)
......
...@@ -416,7 +416,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, ...@@ -416,7 +416,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self,
} }
if ((discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) { if ((discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) {
WARNING(__FUNCTION__ "(), kmalloc failed!\n"); WARNING("%s: kmalloc failed!\n", __FUNCTION__);
return; return;
} }
memset(discovery, 0, sizeof(discovery_t)); memset(discovery, 0, sizeof(discovery_t));
...@@ -509,7 +509,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self, ...@@ -509,7 +509,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
if (info->s == 0xff) { if (info->s == 0xff) {
/* Check if things are sane at this point... */ /* Check if things are sane at this point... */
if((discovery_info == NULL) || (skb->len < 3)) { if((discovery_info == NULL) || (skb->len < 3)) {
ERROR(__FUNCTION__ "(), discovery frame to short!\n"); ERROR("%s: discovery frame to short!\n", __FUNCTION__);
return; return;
} }
...@@ -518,7 +518,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self, ...@@ -518,7 +518,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
*/ */
discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC); discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC);
if (!discovery) { if (!discovery) {
WARNING(__FUNCTION__ "(), unable to malloc!\n"); WARNING("%s: unable to malloc!\n", __FUNCTION__);
return; return;
} }
...@@ -1281,7 +1281,7 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -1281,7 +1281,7 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
/* Check if frame is large enough for parsing */ /* Check if frame is large enough for parsing */
if (skb->len < 2) { if (skb->len < 2) {
ERROR(__FUNCTION__ "(), frame to short!\n"); ERROR("%s: frame to short!\n", __FUNCTION__);
dev_kfree_skb(skb); dev_kfree_skb(skb);
return -1; return -1;
} }
...@@ -1330,9 +1330,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -1330,9 +1330,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
irlap_recv_srej_frame(self, skb, &info, command); irlap_recv_srej_frame(self, skb, &info, command);
break; break;
default: default:
WARNING(__FUNCTION__ WARNING("%s: Unknown S-frame %02x received!\n",
"() Unknown S-frame %02x received!\n", __FUNCTION__, info.control);
info.control);
break; break;
} }
goto out; goto out;
...@@ -1369,8 +1368,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -1369,8 +1368,8 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
irlap_recv_ui_frame(self, skb, &info); irlap_recv_ui_frame(self, skb, &info);
break; break;
default: default:
WARNING(__FUNCTION__ "(), Unknown frame %02x received!\n", WARNING("%s: Unknown frame %02x received!\n",
info.control); __FUNCTION__, info.control);
break; break;
} }
out: out:
......
...@@ -152,7 +152,7 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid) ...@@ -152,7 +152,7 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid)
/* Allocate new instance of a LSAP connection */ /* Allocate new instance of a LSAP connection */
self = kmalloc(sizeof(struct lsap_cb), GFP_ATOMIC); self = kmalloc(sizeof(struct lsap_cb), GFP_ATOMIC);
if (self == NULL) { if (self == NULL) {
ERROR(__FUNCTION__ "(), can't allocate memory"); ERROR("%s: can't allocate memory", __FUNCTION__);
return NULL; return NULL;
} }
memset(self, 0, sizeof(struct lsap_cb)); memset(self, 0, sizeof(struct lsap_cb));
...@@ -278,7 +278,7 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify) ...@@ -278,7 +278,7 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify)
*/ */
lap = kmalloc(sizeof(struct lap_cb), GFP_KERNEL); lap = kmalloc(sizeof(struct lap_cb), GFP_KERNEL);
if (lap == NULL) { if (lap == NULL) {
ERROR(__FUNCTION__ "(), unable to kmalloc\n"); ERROR("%s: unable to kmalloc\n", __FUNCTION__);
return; return;
} }
memset(lap, 0, sizeof(struct lap_cb)); memset(lap, 0, sizeof(struct lap_cb));
...@@ -770,8 +770,8 @@ void irlmp_do_discovery(int nslots) ...@@ -770,8 +770,8 @@ void irlmp_do_discovery(int nslots)
/* Make sure the value is sane */ /* Make sure the value is sane */
if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){ if ((nslots != 1) && (nslots != 6) && (nslots != 8) && (nslots != 16)){
WARNING(__FUNCTION__ WARNING("%s: invalid value for number of slots!\n",
"(), invalid value for number of slots!\n"); __FUNCTION__);
nslots = sysctl_discovery_slots = 8; nslots = sysctl_discovery_slots = 8;
} }
...@@ -864,9 +864,6 @@ struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask, int nslots) ...@@ -864,9 +864,6 @@ struct irda_device_info *irlmp_get_discoveries(int *pn, __u16 mask, int nslots)
#if 0 #if 0
/* /*
* Function irlmp_check_services (discovery) * Function irlmp_check_services (discovery)
*
*
*
*/ */
void irlmp_check_services(discovery_t *discovery) void irlmp_check_services(discovery_t *discovery)
{ {
...@@ -1071,9 +1068,6 @@ void irlmp_data_indication(struct lsap_cb *self, struct sk_buff *skb) ...@@ -1071,9 +1068,6 @@ void irlmp_data_indication(struct lsap_cb *self, struct sk_buff *skb)
/* /*
* Function irlmp_udata_request (self, skb) * Function irlmp_udata_request (self, skb)
*
*
*
*/ */
int irlmp_udata_request(struct lsap_cb *self, struct sk_buff *skb) int irlmp_udata_request(struct lsap_cb *self, struct sk_buff *skb)
{ {
...@@ -1114,9 +1108,6 @@ void irlmp_udata_indication(struct lsap_cb *self, struct sk_buff *skb) ...@@ -1114,9 +1108,6 @@ void irlmp_udata_indication(struct lsap_cb *self, struct sk_buff *skb)
/* /*
* Function irlmp_connless_data_request (self, skb) * Function irlmp_connless_data_request (self, skb)
*
*
*
*/ */
#ifdef CONFIG_IRDA_ULTRA #ifdef CONFIG_IRDA_ULTRA
int irlmp_connless_data_request(struct lsap_cb *self, struct sk_buff *skb) int irlmp_connless_data_request(struct lsap_cb *self, struct sk_buff *skb)
...@@ -1802,6 +1793,3 @@ int irlmp_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -1802,6 +1793,3 @@ int irlmp_proc_read(char *buf, char **start, off_t offset, int len)
} }
#endif /* PROC_FS */ #endif /* PROC_FS */
...@@ -510,8 +510,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -510,8 +510,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event,
IRDA_DEBUG(4, __FUNCTION__ "(), LM_CONNECT_REQUEST\n"); IRDA_DEBUG(4, __FUNCTION__ "(), LM_CONNECT_REQUEST\n");
if (self->conn_skb) { if (self->conn_skb) {
WARNING(__FUNCTION__ WARNING("%s: busy with another request!\n",
"(), busy with another request!\n"); __FUNCTION__);
return -EBUSY; return -EBUSY;
} }
self->conn_skb = skb; self->conn_skb = skb;
...@@ -525,8 +525,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event, ...@@ -525,8 +525,8 @@ static int irlmp_state_disconnected(struct lsap_cb *self, IRLMP_EVENT event,
break; break;
case LM_CONNECT_INDICATION: case LM_CONNECT_INDICATION:
if (self->conn_skb) { if (self->conn_skb) {
WARNING(__FUNCTION__ WARNING("%s: busy with another request!\n",
"(), busy with another request!\n"); __FUNCTION__);
return -EBUSY; return -EBUSY;
} }
self->conn_skb = skb; self->conn_skb = skb;
......
...@@ -94,7 +94,7 @@ int __init irttp_init(void) ...@@ -94,7 +94,7 @@ int __init irttp_init(void)
irttp->tsaps = hashbin_new(HB_LOCAL); irttp->tsaps = hashbin_new(HB_LOCAL);
if (!irttp->tsaps) { if (!irttp->tsaps) {
ERROR(__FUNCTION__ "(), can't allocate IrTTP hashbin!\n"); ERROR("%s: can't allocate IrTTP hashbin!\n", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -421,7 +421,7 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify) ...@@ -421,7 +421,7 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify)
*/ */
lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0); lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0);
if (lsap == NULL) { if (lsap == NULL) {
WARNING(__FUNCTION__ "(), unable to allocate LSAP!!\n"); WARNING("%s: unable to allocate LSAP!!\n", __FUNCTION__);
return NULL; return NULL;
} }
...@@ -497,7 +497,7 @@ int irttp_close_tsap(struct tsap_cb *self) ...@@ -497,7 +497,7 @@ int irttp_close_tsap(struct tsap_cb *self)
if (self->connected) { if (self->connected) {
/* Check if disconnect is not pending */ /* Check if disconnect is not pending */
if (!test_bit(0, &self->disconnect_pend)) { if (!test_bit(0, &self->disconnect_pend)) {
WARNING(__FUNCTION__ "(), TSAP still connected!\n"); WARNING("%s: TSAP still connected!\n", __FUNCTION__);
irttp_disconnect_request(self, NULL, P_NORMAL); irttp_disconnect_request(self, NULL, P_NORMAL);
} }
self->close_pend = TRUE; self->close_pend = TRUE;
...@@ -571,7 +571,7 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) ...@@ -571,7 +571,7 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)
/* Check that nothing bad happens */ /* Check that nothing bad happens */
if ((skb->len == 0) || (!self->connected)) { if ((skb->len == 0) || (!self->connected)) {
WARNING(__FUNCTION__ "(), No data, or not connected\n"); WARNING("%s: No data, or not connected\n", __FUNCTION__);
return -ENOTCONN; return -ENOTCONN;
} }
...@@ -580,8 +580,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) ...@@ -580,8 +580,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)
* inside an IrLAP frame * inside an IrLAP frame
*/ */
if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) { if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) {
ERROR(__FUNCTION__ ERROR("%s: SAR disabled, and data is to large for IrLAP!\n",
"(), SAR disabled, and data is to large for IrLAP!\n"); __FUNCTION__);
return -EMSGSIZE; return -EMSGSIZE;
} }
...@@ -593,8 +593,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb) ...@@ -593,8 +593,8 @@ int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)
(self->tx_max_sdu_size != TTP_SAR_UNBOUND) && (self->tx_max_sdu_size != TTP_SAR_UNBOUND) &&
(skb->len > self->tx_max_sdu_size)) (skb->len > self->tx_max_sdu_size))
{ {
ERROR(__FUNCTION__ "(), SAR enabled, " ERROR("%s: SAR enabled, but data is larger than TxMaxSduSize!\n",
"but data is larger than TxMaxSduSize!\n"); __FUNCTION__);
return -EMSGSIZE; return -EMSGSIZE;
} }
/* /*
...@@ -1178,8 +1178,8 @@ static void irttp_connect_confirm(void *instance, void *sap, ...@@ -1178,8 +1178,8 @@ static void irttp_connect_confirm(void *instance, void *sap,
/* Any errors in the parameter list? */ /* Any errors in the parameter list? */
if (ret < 0) { if (ret < 0) {
WARNING(__FUNCTION__ WARNING("%s: error extracting parameters\n",
"(), error extracting parameters\n"); __FUNCTION__);
dev_kfree_skb(skb); dev_kfree_skb(skb);
/* Do not accept this connection attempt */ /* Do not accept this connection attempt */
...@@ -1253,8 +1253,8 @@ void irttp_connect_indication(void *instance, void *sap, struct qos_info *qos, ...@@ -1253,8 +1253,8 @@ void irttp_connect_indication(void *instance, void *sap, struct qos_info *qos,
/* Any errors in the parameter list? */ /* Any errors in the parameter list? */
if (ret < 0) { if (ret < 0) {
WARNING(__FUNCTION__ WARNING("%s: error extracting parameters\n",
"(), error extracting parameters\n"); __FUNCTION__);
dev_kfree_skb(skb); dev_kfree_skb(skb);
/* Do not accept this connection attempt */ /* Do not accept this connection attempt */
......
...@@ -72,9 +72,6 @@ static PV_HANDLER pv_insert_table[] = { ...@@ -72,9 +72,6 @@ static PV_HANDLER pv_insert_table[] = {
/* /*
* Function irda_insert_no_value (self, buf, len, pi, type, func) * Function irda_insert_no_value (self, buf, len, pi, type, func)
*
*
*
*/ */
static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi, static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi,
PV_TYPE type, PI_HANDLER func) PV_TYPE type, PI_HANDLER func)
...@@ -123,9 +120,6 @@ static int irda_extract_no_value(void *self, __u8 *buf, int len, __u8 pi, ...@@ -123,9 +120,6 @@ static int irda_extract_no_value(void *self, __u8 *buf, int len, __u8 pi,
/* /*
* Function irda_insert_integer (self, buf, len, pi, type, func) * Function irda_insert_integer (self, buf, len, pi, type, func)
*
*
*
*/ */
static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
PV_TYPE type, PI_HANDLER func) PV_TYPE type, PI_HANDLER func)
...@@ -162,7 +156,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -162,7 +156,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
} }
/* Check if buffer is long enough for insertion */ /* Check if buffer is long enough for insertion */
if (len < (2+p.pl)) { if (len < (2+p.pl)) {
WARNING(__FUNCTION__ "(), buffer to short for insertion!\n"); WARNING("%s: buffer to short for insertion!\n", __FUNCTION__);
return -1; return -1;
} }
IRDA_DEBUG(2, __FUNCTION__ "(), pi=%#x, pl=%d, pi=%d\n", p.pi, p.pl, p.pv.i); IRDA_DEBUG(2, __FUNCTION__ "(), pi=%#x, pl=%d, pi=%d\n", p.pi, p.pl, p.pv.i);
...@@ -186,7 +180,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -186,7 +180,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
break; break;
default: default:
WARNING(__FUNCTION__ "() length %d not supported\n", p.pl); WARNING("%s: length %d not supported\n", __FUNCTION__, p.pl);
/* Skip parameter */ /* Skip parameter */
return -1; return -1;
} }
...@@ -213,8 +207,9 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -213,8 +207,9 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
/* Check if buffer is long enough for parsing */ /* Check if buffer is long enough for parsing */
if (len < (2+p.pl)) { if (len < (2+p.pl)) {
WARNING(__FUNCTION__ "(), buffer to short for parsing! " WARNING("%s: buffer to short for parsing! "
"Need %d bytes, but len is only %d\n", p.pl, len); "Need %d bytes, but len is only %d\n",
__FUNCTION__, p.pl, len);
return -1; return -1;
} }
...@@ -223,9 +218,9 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -223,9 +218,9 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
* handler want a 16 bits integer then a 32 bits is not good enough * handler want a 16 bits integer then a 32 bits is not good enough
*/ */
if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) { if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) {
ERROR(__FUNCTION__ "(), invalid parameter length! " ERROR("%s: invalid parameter length! "
"Expected %d bytes, but value had %d bytes!\n", "Expected %d bytes, but value had %d bytes!\n",
type & PV_MASK, p.pl); __FUNCTION__, type & PV_MASK, p.pl);
/* Skip parameter */ /* Skip parameter */
return p.pl+2; return p.pl+2;
...@@ -251,7 +246,7 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -251,7 +246,7 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
le32_to_cpus(&p.pv.i); le32_to_cpus(&p.pv.i);
break; break;
default: default:
WARNING(__FUNCTION__ "() length %d not supported\n", p.pl); WARNING("%s: length %d not supported\n", __FUNCTION__, p.pl);
/* Skip parameter */ /* Skip parameter */
return p.pl+2; return p.pl+2;
...@@ -268,9 +263,6 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, ...@@ -268,9 +263,6 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
/* /*
* Function irda_extract_string (self, buf, len, type, func) * Function irda_extract_string (self, buf, len, type, func)
*
*
*
*/ */
static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
PV_TYPE type, PI_HANDLER func) PV_TYPE type, PI_HANDLER func)
...@@ -288,8 +280,9 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, ...@@ -288,8 +280,9 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
/* Check if buffer is long enough for parsing */ /* Check if buffer is long enough for parsing */
if (len < (2+p.pl)) { if (len < (2+p.pl)) {
WARNING(__FUNCTION__ "(), buffer to short for parsing! " WARNING("%s: buffer to short for parsing! "
"Need %d bytes, but len is only %d\n", p.pl, len); "Need %d bytes, but len is only %d\n",
__FUNCTION__, p.pl, len);
return -1; return -1;
} }
...@@ -315,9 +308,6 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, ...@@ -315,9 +308,6 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
/* /*
* Function irda_extract_octseq (self, buf, len, type, func) * Function irda_extract_octseq (self, buf, len, type, func)
*
*
*
*/ */
static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi, static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi,
PV_TYPE type, PI_HANDLER func) PV_TYPE type, PI_HANDLER func)
...@@ -329,8 +319,9 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi, ...@@ -329,8 +319,9 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi,
/* Check if buffer is long enough for parsing */ /* Check if buffer is long enough for parsing */
if (len < (2+p.pl)) { if (len < (2+p.pl)) {
WARNING(__FUNCTION__ "(), buffer to short for parsing! " WARNING("%s: buffer to short for parsing! "
"Need %d bytes, but len is only %d\n", p.pl, len); "Need %d bytes, but len is only %d\n",
__FUNCTION__, p.pl, len);
return -1; return -1;
} }
...@@ -380,7 +371,6 @@ int irda_param_pack(__u8 *buf, char *fmt, ...) ...@@ -380,7 +371,6 @@ int irda_param_pack(__u8 *buf, char *fmt, ...)
va_end(args); va_end(args);
return -1; return -1;
} }
} }
va_end(args); va_end(args);
...@@ -389,9 +379,6 @@ int irda_param_pack(__u8 *buf, char *fmt, ...) ...@@ -389,9 +379,6 @@ int irda_param_pack(__u8 *buf, char *fmt, ...)
/* /*
* Function irda_param_unpack (skb, fmt, ...) * Function irda_param_unpack (skb, fmt, ...)
*
*
*
*/ */
int irda_param_unpack(__u8 *buf, char *fmt, ...) int irda_param_unpack(__u8 *buf, char *fmt, ...)
{ {
...@@ -475,7 +462,7 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, ...@@ -475,7 +462,7 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len,
/* Check if handler has been implemented */ /* Check if handler has been implemented */
if (!pi_minor_info->func) { if (!pi_minor_info->func) {
MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", pi); MESSAGE("%s: no handler for pi=%#x\n", __FUNCTION__, pi);
/* Skip this parameter */ /* Skip this parameter */
return -1; return -1;
} }
...@@ -530,7 +517,7 @@ int irda_param_extract(void *self, __u8 *buf, int len, pi_param_info_t *info) ...@@ -530,7 +517,7 @@ int irda_param_extract(void *self, __u8 *buf, int len, pi_param_info_t *info)
/* Check if handler has been implemented */ /* Check if handler has been implemented */
if (!pi_minor_info->func) { if (!pi_minor_info->func) {
MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", buf[n]); MESSAGE("%s: no handler for pi=%#x\n", __FUNCTION__, buf[n]);
/* Skip this parameter */ /* Skip this parameter */
return 2 + buf[n + 1]; /* Continue */ return 2 + buf[n + 1]; /* Continue */
} }
......
...@@ -295,7 +295,7 @@ static void state_link_escape(struct net_device *dev, ...@@ -295,7 +295,7 @@ static void state_link_escape(struct net_device *dev,
irda_device_set_media_busy(dev, TRUE); irda_device_set_media_busy(dev, TRUE);
break; break;
case CE: case CE:
WARNING(__FUNCTION__ "(), state not defined\n"); WARNING("%s: state not defined\n", __FUNCTION__);
break; break;
case EOF: /* Abort frame */ case EOF: /* Abort frame */
rx_buff->state = OUTSIDE_FRAME; rx_buff->state = OUTSIDE_FRAME;
...@@ -371,5 +371,3 @@ static void state_inside_frame(struct net_device *dev, ...@@ -371,5 +371,3 @@ static void state_inside_frame(struct net_device *dev,
break; break;
} }
} }
...@@ -22,7 +22,7 @@ TAIL=tail.tk ...@@ -22,7 +22,7 @@ TAIL=tail.tk
# Config.in files to depend on anyways. So I'll force it to remake. # 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 kconfig.tk: $(TOPDIR)/arch/$(ARCH)/config.in tkparse $(HEADER) $(TAIL) FORCE
@echo Generating $@ @echo ' Generating $@'
@( \ @( \
if [ -f /usr/local/bin/wish ]; then \ if [ -f /usr/local/bin/wish ]; then \
echo '#!'"/usr/local/bin/wish -f"; \ echo '#!'"/usr/local/bin/wish -f"; \
......
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
* *
* It is invoked as * It is invoked as
* *
* fixdep <target> <topdir> <cmdline> * fixdep <depfile> <target> <topdir> <cmdline>
* *
* and will read the dependency file ".<target>.d". * and will read the dependency file <depfile>
* *
* The transformed dependency snipped is written to stdout. * The transformed dependency snipped is written to stdout.
* *
...@@ -112,29 +112,20 @@ ...@@ -112,29 +112,20 @@
#define INT_FIG_ ntohl(0x4649475f) #define INT_FIG_ ntohl(0x4649475f)
char *topdir; char *topdir;
char *target;
char *depfile;
char *cmdline;
void usage(void) void usage(void)
{ {
fprintf(stderr, "Usage: fixdep <target> <topdir> <cmdline>\n"); fprintf(stderr, "Usage: fixdep <depfile> <target> <topdir> <cmdline>\n");
exit(1); exit(1);
} }
void print_cmdline(char *target, char *cmdline) void print_cmdline(void)
{ {
char *s = strdup(target); printf("cmd_%s := %s\n\n", target, cmdline);
char *p = s;
if (!s) {
fprintf(stderr, "no mem!\n");
exit(2);
}
while ((p = strchr(p,'/')))
*p = '_';
printf("cmd_%s := %s\n\n", s, cmdline);
free(s);
} }
char * str_config = NULL; char * str_config = NULL;
...@@ -297,11 +288,11 @@ void parse_dep_file(void *map, size_t len) ...@@ -297,11 +288,11 @@ void parse_dep_file(void *map, size_t len)
p = strchr(m, ':'); p = strchr(m, ':');
if (!p) { if (!p) {
fprintf(stderr, "parse error at %d", __LINE__); fprintf(stderr, "fixdep: parse error\n");
exit(1); exit(1);
} }
memcpy(s, m, p-m); s[p-m] = 0; memcpy(s, m, p-m); s[p-m] = 0;
printf("%s: \\\n", s); printf("%s: \\\n", target);
m = p+1; m = p+1;
clear_config(); clear_config();
...@@ -326,22 +317,20 @@ void parse_dep_file(void *map, size_t len) ...@@ -326,22 +317,20 @@ void parse_dep_file(void *map, size_t len)
printf("\n"); printf("\n");
} }
void print_deps(char *target) void print_deps(void)
{ {
char filename[PATH_MAX];
struct stat st; struct stat st;
int fd; int fd;
void *map; void *map;
sprintf(filename, ".%s.d", target); fd = open(depfile, O_RDONLY);
fd = open(filename, O_RDONLY);
if (fd < 0) { if (fd < 0) {
perror(filename); perror(depfile);
exit(2); exit(2);
} }
fstat(fd, &st); fstat(fd, &st);
if (st.st_size == 0) { if (st.st_size == 0) {
fprintf(stderr,"%s is empty\n",filename); fprintf(stderr,"fixdep: %s is empty\n",depfile);
close(fd); close(fd);
return; return;
} }
...@@ -362,7 +351,7 @@ void traps(void) ...@@ -362,7 +351,7 @@ void traps(void)
char *test = "CONF"; char *test = "CONF";
if (*(int *)test != INT_CONF) { if (*(int *)test != INT_CONF) {
fprintf(stderr, "sizeof(int) != 4 or wrong endianess? %#x\n", fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n",
*(int *)test); *(int *)test);
exit(2); exit(2);
} }
...@@ -370,19 +359,18 @@ void traps(void) ...@@ -370,19 +359,18 @@ void traps(void)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
char *target, *cmdline;
traps(); traps();
if (argc != 4) if (argc != 5)
usage(); usage();
target = argv[1]; depfile = argv[1];
topdir = argv[2]; target = argv[2];
cmdline = argv[3]; topdir = argv[3];
cmdline = argv[4];
print_cmdline(target, cmdline); print_cmdline();
print_deps(target); print_deps();
return 0; return 0;
} }
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/init.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/emu10k1.h> #include <sound/emu10k1.h>
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#define __NO_VERSION__ #define __NO_VERSION__
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/init.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/emu10k1.h> #include <sound/emu10k1.h>
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/init.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/emu10k1.h> #include <sound/emu10k1.h>
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#define __NO_VERSION__ #define __NO_VERSION__
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/init.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/emu10k1.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