Commit 2c5c4f1f authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/sfr
parents fe2fffa6 962bf880
...@@ -36,7 +36,8 @@ KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) ...@@ -36,7 +36,8 @@ KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
ARCH := $(SUBARCH) ARCH := $(SUBARCH)
KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g") # Remove hyphens since they have special meaning in RPM filenames
KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE))
UTS_MACHINE := $(ARCH) UTS_MACHINE := $(ARCH)
...@@ -355,7 +356,7 @@ LDFLAGS_vmlinux += -T arch/$(ARCH)/vmlinux.lds.s ...@@ -355,7 +356,7 @@ LDFLAGS_vmlinux += -T arch/$(ARCH)/vmlinux.lds.s
# It's a three stage process: # It's a three stage process:
# o .tmp_vmlinux1 has all symbols and sections, but __kallsyms is # o .tmp_vmlinux1 has all symbols and sections, but __kallsyms is
# empty # empty
# Running kallsyms on that gives as .tmp_kallsyms1.o with # Running kallsyms on that gives us .tmp_kallsyms1.o with
# the right size # the right size
# o .tmp_vmlinux2 now has a __kallsyms section of the right size, # o .tmp_vmlinux2 now has a __kallsyms section of the right size,
# but due to the added section, some addresses have shifted # but due to the added section, some addresses have shifted
...@@ -689,7 +690,7 @@ defconfig: scripts/kconfig/conf ...@@ -689,7 +690,7 @@ defconfig: scripts/kconfig/conf
# make clean Delete all automatically generated files, including # make clean Delete all automatically generated files, including
# tools and firmware. # tools and firmware.
# make mrproper Delete the current configuration, and related files # make mrproper Delete the current configuration, and related files
# Any core files spread around is deleted as well # Any core files spread around are deleted as well
# make distclean Remove editor backup files, patch leftover files and the like # make distclean Remove editor backup files, patch leftover files and the like
# Files removed with 'make clean' # Files removed with 'make clean'
...@@ -884,9 +885,9 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ ...@@ -884,9 +885,9 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
$(filter-out $(cmd_$(1)),$(cmd_$@))\ $(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\ $(filter-out $(cmd_$@),$(cmd_$(1)))),\
@set -e; \ @set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \ $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \
$(cmd_$(1)); \ $(cmd_$(1)); \
scripts/fixdep $(depfile) $@ '$(cmd_$(1))' > $(@D)/.$(@F).tmp; \ scripts/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \
rm -f $(depfile); \ rm -f $(depfile); \
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
...@@ -913,19 +914,19 @@ define update-if-changed ...@@ -913,19 +914,19 @@ define update-if-changed
fi fi
endef endef
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=dir
# Usage: # Usage:
# $(Q)$(MAKE) $(build)=dir # $(Q)$(MAKE) $(build)=dir
build := -f scripts/Makefile.build obj build := -f scripts/Makefile.build obj
# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
# Usage: # Usage:
# $(Q)$(MAKE) $(clean)=dir # $(Q)$(MAKE) $(clean)=dir
clean := -f scripts/Makefile.clean obj clean := -f scripts/Makefile.clean obj
# $(call descend,<dir>,<target>) # $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target> # Recursively call a sub-make in <dir> with target <target>
# Usage is deprecated, because make do not see this as an invocation of make. # Usage is deprecated, because make does not see this as an invocation of make.
descend =$(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2) descend =$(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2)
FORCE: FORCE:
...@@ -619,7 +619,7 @@ do_signal(sigset_t *oldset, struct pt_regs * regs, struct switch_stack * sw, ...@@ -619,7 +619,7 @@ do_signal(sigset_t *oldset, struct pt_regs * regs, struct switch_stack * sw,
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
......
...@@ -560,7 +560,7 @@ int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs) ...@@ -560,7 +560,7 @@ int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal(canrestart, signr, &info, oldset, regs); handle_signal(canrestart, signr, &info, oldset, regs);
......
...@@ -582,7 +582,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -582,7 +582,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Reenable any watchpoints before delivering the /* Reenable any watchpoints before delivering the
* signal to user space. The processor register will * signal to user space. The processor register will
......
...@@ -517,7 +517,7 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall) ...@@ -517,7 +517,7 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
restart = 0; restart = 0;
while (1) { while (1) {
int signr = get_signal_to_deliver(&info, &scr->pt); int signr = get_signal_to_deliver(&info, &scr->pt, NULL);
if (signr <= 0) if (signr <= 0)
break; break;
......
...@@ -768,7 +768,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) ...@@ -768,7 +768,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
for (;;) { for (;;) {
int signr; int signr;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (!signr) if (!signr)
break; break;
......
...@@ -544,7 +544,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) ...@@ -544,7 +544,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
if (regs->regs[0]) if (regs->regs[0])
syscall_restart(regs, ka); syscall_restart(regs, ka);
......
...@@ -602,7 +602,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) ...@@ -602,7 +602,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
if (regs->regs[0]) if (regs->regs[0])
syscall_restart(regs, ka); syscall_restart(regs, ka);
......
...@@ -676,7 +676,7 @@ asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs) ...@@ -676,7 +676,7 @@ asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
if (regs->regs[0]) if (regs->regs[0])
syscall_restart(regs, ka); syscall_restart(regs, ka);
......
...@@ -484,7 +484,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) ...@@ -484,7 +484,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
newsp = frame = 0; newsp = frame = 0;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
ka = &current->sig->action[signr-1]; ka = &current->sig->action[signr-1];
if ( (ka->sa.sa_flags & SA_ONSTACK) if ( (ka->sa.sa_flags & SA_ONSTACK)
......
...@@ -551,7 +551,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) ...@@ -551,7 +551,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
newsp = frame = 0; newsp = frame = 0;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
ka = &current->sighand->action[signr-1]; ka = &current->sighand->action[signr-1];
if ((ka->sa.sa_flags & SA_ONSTACK) if ((ka->sa.sa_flags & SA_ONSTACK)
......
...@@ -1065,7 +1065,7 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) ...@@ -1065,7 +1065,7 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
newsp = frame = 0; newsp = frame = 0;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
ka = &current->sighand->action[signr-1]; ka = &current->sighand->action[signr-1];
if ((ka->sa.sa_flags & SA_ONSTACK) if ((ka->sa.sa_flags & SA_ONSTACK)
......
...@@ -461,7 +461,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -461,7 +461,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal(signr, &info, oldset, regs); handle_signal(signr, &info, oldset, regs);
......
...@@ -461,7 +461,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -461,7 +461,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
} }
#endif #endif
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal(signr, &info, oldset, regs); handle_signal(signr, &info, oldset, regs);
......
...@@ -622,7 +622,7 @@ int do_signal32(struct pt_regs *regs, sigset_t *oldset) ...@@ -622,7 +622,7 @@ int do_signal32(struct pt_regs *regs, sigset_t *oldset)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal32(signr, &info, oldset, regs); handle_signal32(signr, &info, oldset, regs);
......
...@@ -556,7 +556,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -556,7 +556,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal(signr, &info, oldset, regs); handle_signal(signr, &info, oldset, regs);
......
...@@ -38,7 +38,7 @@ endif ...@@ -38,7 +38,7 @@ endif
LDFLAGS_vmlinux = -r LDFLAGS_vmlinux = -r
head-y := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o head-y := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o
HEAD := $(head-y) HEAD_Y := $(head-y)
core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/ core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/
libs-y += arch/sparc/prom/ arch/sparc/lib/ libs-y += arch/sparc/prom/ arch/sparc/lib/
...@@ -52,7 +52,7 @@ CORE_Y := $(patsubst %/, %/built-in.o, $(CORE_Y)) ...@@ -52,7 +52,7 @@ CORE_Y := $(patsubst %/, %/built-in.o, $(CORE_Y))
DRIVERS_Y := $(patsubst %/, %/built-in.o, $(drivers-y)) DRIVERS_Y := $(patsubst %/, %/built-in.o, $(drivers-y))
NET_Y := $(patsubst %/, %/built-in.o, $(net-y)) NET_Y := $(patsubst %/, %/built-in.o, $(net-y))
LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y)) LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y))
export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y
makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/$(ARCH)/boot $(1) makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/$(ARCH)/boot $(1)
......
...@@ -17,7 +17,7 @@ quiet_cmd_piggy = PIGGY $@ ...@@ -17,7 +17,7 @@ quiet_cmd_piggy = PIGGY $@
quiet_cmd_btfix = BTFIX $@ quiet_cmd_btfix = BTFIX $@
cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@
BTOBJS := $(HEAD) $(INIT_Y) BTOBJS := $(HEAD_Y) $(INIT_Y)
BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y)
LDFLAGS_image := -T arch/sparc/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group LDFLAGS_image := -T arch/sparc/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
static struct fs_struct init_fs = INIT_FS; static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES; static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals); static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm); struct mm_struct init_mm = INIT_MM(init_mm);
struct task_struct init_task = INIT_TASK(init_task); struct task_struct init_task = INIT_TASK(init_task);
......
...@@ -1045,8 +1045,9 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, ...@@ -1045,8 +1045,9 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
unsigned long orig_i0, int restart_syscall) unsigned long orig_i0, int restart_syscall)
{ {
struct k_sigaction *ka;
siginfo_t info; siginfo_t info;
struct sparc_deliver_cookie cookie;
int signr;
/* /*
* XXX Disable svr4 signal handling until solaris emulation works. * XXX Disable svr4 signal handling until solaris emulation works.
...@@ -1059,142 +1060,32 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, ...@@ -1059,142 +1060,32 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
int svr4_signal = current->personality == PER_SVR4; int svr4_signal = current->personality == PER_SVR4;
#endif #endif
cookie.restart_syscall = restart_syscall;
cookie.orig_i0 = orig_i0;
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
for (;;) { signr = get_signal_to_deliver(&info, regs, &cookie);
sigset_t *mask = &current->blocked; if (signr > 0) {
unsigned long signr = 0; struct k_sigaction *ka;
spin_lock_irq(&current->sighand->siglock); ka = &current->sighand->action[signr-1];
signr = dequeue_signal(mask, &info); if (cookie.restart_syscall)
spin_unlock_irq(&current->sighand->siglock); syscall_restart(cookie.orig_i0, regs, &ka->sa);
if (!signr)
break;
if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Do the syscall restart before we let the debugger
* look at the child registers.
*/
if (restart_syscall &&
(regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
regs->u_regs[UREG_I0] == ERESTARTSYS ||
regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
/* replay the system call when we are done */
regs->u_regs[UREG_I0] = orig_i0;
regs->pc -= 4;
regs->npc -= 4;
restart_syscall = 0;
}
if (restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->pc -= 4;
regs->npc -= 4;
restart_syscall = 0;
}
current->exit_code = signr;
set_current_state(TASK_STOPPED);
/* This happens to be SMP safe so no need to
* grab master kernel lock even in this case.
*/
notify_parent(current, SIGCHLD);
schedule();
if (!(signr = current->exit_code))
continue;
current->exit_code = 0;
if (signr == SIGSTOP)
continue;
/* Update the siginfo structure. Is this good? */
if (signr != info.si_signo) {
info.si_signo = signr;
info.si_errno = 0;
info.si_code = SI_USER;
info.si_pid = current->parent->pid;
info.si_uid = current->parent->uid;
}
/* If the (new) signal is now blocked, requeue it. */
if (sigismember(&current->blocked, signr)) {
send_sig_info(signr, &info, current);
continue;
}
}
ka = &current->sig->action[signr-1];
if (ka->sa.sa_handler == SIG_IGN) {
if (signr != SIGCHLD)
continue;
/* sys_wait4() grabs the master kernel lock, so
* we need not do so, that sucker should be
* threaded and would not be that difficult to
* do anyways.
*/
while(sys_wait4(-1, NULL, WNOHANG, NULL) > 0)
;
continue;
}
if (ka->sa.sa_handler == SIG_DFL) {
unsigned long exit_code = signr;
if (current->pid == 1)
continue;
switch (signr) {
case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG:
continue;
case SIGTSTP: case SIGTTIN: case SIGTTOU:
/* The operations performed by
* is_orphaned_pgrp() are protected by
* the tasklist_lock.
*/
if (is_orphaned_pgrp(current->pgrp))
continue;
case SIGSTOP: {
struct signal_struct *sig;
set_current_state(TASK_STOPPED);
current->exit_code = signr;
sig = current->parent->sig;
if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags &
SA_NOCLDSTOP))
notify_parent(current, SIGCHLD);
schedule();
continue;
}
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ:
if (do_coredump(signr, exit_code, regs))
exit_code |= 0x80;
/* FALLTHRU */
default:
sig_exit(signr, exit_code, &info);
/* NOT REACHED */
}
}
if (restart_syscall)
syscall_restart(orig_i0, regs, &ka->sa);
handle_signal(signr, ka, &info, oldset, regs, svr4_signal); handle_signal(signr, ka, &info, oldset, regs, svr4_signal);
return 1; return 1;
} }
if (restart_syscall && if (cookie.restart_syscall &&
(regs->u_regs[UREG_I0] == ERESTARTNOHAND || (regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
regs->u_regs[UREG_I0] == ERESTARTSYS || regs->u_regs[UREG_I0] == ERESTARTSYS ||
regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
/* replay the system call when we are done */ /* replay the system call when we are done */
regs->u_regs[UREG_I0] = orig_i0; regs->u_regs[UREG_I0] = cookie.orig_i0;
regs->pc -= 4; regs->pc -= 4;
regs->npc -= 4; regs->npc -= 4;
} }
if (restart_syscall && if (cookie.restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->pc -= 4; regs->pc -= 4;
......
...@@ -525,7 +525,7 @@ void free_initrd_mem(unsigned long start, unsigned long end) ...@@ -525,7 +525,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
} }
#endif #endif
void flush_page_to_ram(struct page *page) void sparc_flush_page_to_ram(struct page *page)
{ {
unsigned long vaddr = (unsigned long)page_address(page); unsigned long vaddr = (unsigned long)page_address(page);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
static struct fs_struct init_fs = INIT_FS; static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES; static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals); static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm); struct mm_struct init_mm = INIT_MM(init_mm);
/* .text section in head.S is aligned at 2 page boundry and this gets linked /* .text section in head.S is aligned at 2 page boundry and this gets linked
......
...@@ -4285,6 +4285,7 @@ COMPATIBLE_IOCTL(TCSETA) ...@@ -4285,6 +4285,7 @@ COMPATIBLE_IOCTL(TCSETA)
COMPATIBLE_IOCTL(TCSETAW) COMPATIBLE_IOCTL(TCSETAW)
COMPATIBLE_IOCTL(TCSETAF) COMPATIBLE_IOCTL(TCSETAF)
COMPATIBLE_IOCTL(TCSBRK) COMPATIBLE_IOCTL(TCSBRK)
COMPATIBLE_IOCTL(TCSBRKP)
COMPATIBLE_IOCTL(TCXONC) COMPATIBLE_IOCTL(TCXONC)
COMPATIBLE_IOCTL(TCFLSH) COMPATIBLE_IOCTL(TCFLSH)
COMPATIBLE_IOCTL(TCGETS) COMPATIBLE_IOCTL(TCGETS)
......
...@@ -603,8 +603,12 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs, ...@@ -603,8 +603,12 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs,
unsigned long orig_i0, int restart_syscall) unsigned long orig_i0, int restart_syscall)
{ {
siginfo_t info; siginfo_t info;
struct k_sigaction *ka; struct signal_deliver_cookie cookie;
int signr;
cookie.restart_syscall = restart_syscall;
cookie.orig_i0 = orig_i0;
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
...@@ -612,135 +616,31 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs, ...@@ -612,135 +616,31 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs,
if (test_thread_flag(TIF_32BIT)) { if (test_thread_flag(TIF_32BIT)) {
extern int do_signal32(sigset_t *, struct pt_regs *, extern int do_signal32(sigset_t *, struct pt_regs *,
unsigned long, int); unsigned long, int);
return do_signal32(oldset, regs, orig_i0, restart_syscall); return do_signal32(oldset, regs, orig_i0,
cookie.restart_syscall);
} }
#endif #endif
for (;;) {
sigset_t *mask = &current->blocked;
unsigned long signr = 0;
spin_lock_irq(&current->sighand->siglock); signr = get_signal_to_deliver(&info, regs, &cookie);
signr = dequeue_signal(mask, &info); if (signr > 0) {
spin_unlock_irq(&current->sighand->siglock); struct k_sigaction *ka;
if (!signr) ka = &current->sighand->action[signr-1];
break; if (cookie.restart_syscall)
if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Do the syscall restart before we let the debugger
* look at the child registers.
*/
if (restart_syscall &&
(regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
regs->u_regs[UREG_I0] == ERESTARTSYS ||
regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
/* replay the system call when we are done */
regs->u_regs[UREG_I0] = orig_i0;
regs->tpc -= 4;
regs->tnpc -= 4;
restart_syscall = 0;
}
if (restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4;
regs->tnpc -= 4;
restart_syscall = 0;
}
current->exit_code = signr;
set_current_state(TASK_STOPPED);
notify_parent(current, SIGCHLD);
schedule();
if (!(signr = current->exit_code))
continue;
current->exit_code = 0;
if (signr == SIGSTOP)
continue;
/* Update the siginfo structure. Is this good? */
if (signr != info.si_signo) {
info.si_signo = signr;
info.si_errno = 0;
info.si_code = SI_USER;
info.si_pid = current->parent->pid;
info.si_uid = current->parent->uid;
}
/* If the (new) signal is now blocked, requeue it. */
if (sigismember(&current->blocked, signr)) {
send_sig_info(signr, &info, current);
continue;
}
}
ka = &current->sig->action[signr-1];
if (ka->sa.sa_handler == SIG_IGN) {
if (signr != SIGCHLD)
continue;
/* sys_wait4() grabs the master kernel lock, so
* we need not do so, that sucker should be
* threaded and would not be that difficult to
* do anyways.
*/
while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0)
;
continue;
}
if (ka->sa.sa_handler == SIG_DFL) {
unsigned long exit_code = signr;
if (current->pid == 1)
continue;
switch (signr) {
case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG:
continue;
case SIGTSTP: case SIGTTIN: case SIGTTOU:
if (is_orphaned_pgrp(current->pgrp))
continue;
case SIGSTOP: {
struct signal_struct *sig;
set_current_state(TASK_STOPPED);
current->exit_code = signr;
sig = current->parent->sig;
if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags &
SA_NOCLDSTOP))
notify_parent(current, SIGCHLD);
schedule();
continue;
}
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ:
if (do_coredump(signr, exit_code, regs))
exit_code |= 0x80;
/* FALLTHRU */
default:
sig_exit(signr, exit_code, &info);
/* NOT REACHED */
}
}
if (restart_syscall)
syscall_restart(orig_i0, regs, &ka->sa); syscall_restart(orig_i0, regs, &ka->sa);
handle_signal(signr, ka, &info, oldset, regs); handle_signal(signr, ka, &info, oldset, regs);
return 1; return 1;
} }
if (restart_syscall && if (cookie.restart_syscall &&
(regs->u_regs[UREG_I0] == ERESTARTNOHAND || (regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
regs->u_regs[UREG_I0] == ERESTARTSYS || regs->u_regs[UREG_I0] == ERESTARTSYS ||
regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
/* replay the system call when we are done */ /* replay the system call when we are done */
regs->u_regs[UREG_I0] = orig_i0; regs->u_regs[UREG_I0] = cookie.orig_i0;
regs->tpc -= 4; regs->tpc -= 4;
regs->tnpc -= 4; regs->tnpc -= 4;
} }
if (restart_syscall && if (cookie.restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4; regs->tpc -= 4;
......
...@@ -1279,136 +1279,34 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs ...@@ -1279,136 +1279,34 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs
int do_signal32(sigset_t *oldset, struct pt_regs * regs, int do_signal32(sigset_t *oldset, struct pt_regs * regs,
unsigned long orig_i0, int restart_syscall) unsigned long orig_i0, int restart_syscall)
{ {
struct k_sigaction *ka;
siginfo_t info; siginfo_t info;
struct signal_deliver_cookie cookie;
int signr;
int svr4_signal = current->personality == PER_SVR4; int svr4_signal = current->personality == PER_SVR4;
for (;;) { cookie.restart_syscall = restart_syscall;
sigset_t *mask = &current->blocked; cookie.orig_i0 = orig_i0;
unsigned long signr = 0;
spin_lock_irq(&current->sighand->siglock);
signr = dequeue_signal(mask, &info);
spin_unlock_irq(&current->sighand->siglock);
if (!signr)
break;
if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { signr = get_signal_to_deliver(&info, regs, &cookie);
/* Do the syscall restart before we let the debugger if (signr > 0) {
* look at the child registers. struct k_sigaction *ka;
*/
if (restart_syscall &&
(regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
regs->u_regs[UREG_I0] == ERESTARTSYS ||
regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
/* replay the system call when we are done */
regs->u_regs[UREG_I0] = orig_i0;
regs->tpc -= 4;
regs->tnpc -= 4;
restart_syscall = 0;
}
if (restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4;
regs->tnpc -= 4;
restart_syscall = 0;
}
current->exit_code = signr;
set_current_state(TASK_STOPPED);
notify_parent(current, SIGCHLD);
schedule();
if (!(signr = current->exit_code))
continue;
current->exit_code = 0;
if (signr == SIGSTOP)
continue;
/* Update the siginfo structure. Is this good? */
if (signr != info.si_signo) {
info.si_signo = signr;
info.si_errno = 0;
info.si_code = SI_USER;
info.si_pid = current->parent->pid;
info.si_uid = current->parent->uid;
}
/* If the (new) signal is now blocked, requeue it. */ ka = &current->sighand->action[signr-1];
if (sigismember(&current->blocked, signr)) { if (cookie.restart_syscall)
send_sig_info(signr, &info, current);
continue;
}
}
ka = &current->sig->action[signr-1];
if (ka->sa.sa_handler == SIG_IGN) {
if (signr != SIGCHLD)
continue;
/* sys_wait4() grabs the master kernel lock, so
* we need not do so, that sucker should be
* threaded and would not be that difficult to
* do anyways.
*/
while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0)
;
continue;
}
if (ka->sa.sa_handler == SIG_DFL) {
unsigned long exit_code = signr;
if (current->pid == 1)
continue;
switch (signr) {
case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG:
continue;
case SIGTSTP: case SIGTTIN: case SIGTTOU:
if (is_orphaned_pgrp(current->pgrp))
continue;
case SIGSTOP: {
struct signal_struct *sig;
set_current_state(TASK_STOPPED);
current->exit_code = signr;
sig = current->parent->sig;
if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags &
SA_NOCLDSTOP))
notify_parent(current, SIGCHLD);
schedule();
continue;
}
case SIGQUIT: case SIGILL: case SIGTRAP:
case SIGABRT: case SIGFPE: case SIGSEGV:
case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ:
if (do_coredump(signr, exit_code, regs))
exit_code |= 0x80;
/* FALLTHRU */
default:
sig_exit(signr, exit_code, &info);
/* NOT REACHED */
}
}
if (restart_syscall)
syscall_restart32(orig_i0, regs, &ka->sa); syscall_restart32(orig_i0, regs, &ka->sa);
handle_signal32(signr, ka, &info, oldset, regs, svr4_signal); handle_signal32(signr, ka, &info, oldset, regs, svr4_signal);
return 1; return 1;
} }
if (restart_syscall && if (cookie.restart_syscall &&
(regs->u_regs[UREG_I0] == ERESTARTNOHAND || (regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
regs->u_regs[UREG_I0] == ERESTARTSYS || regs->u_regs[UREG_I0] == ERESTARTSYS ||
regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
/* replay the system call when we are done */ /* replay the system call when we are done */
regs->u_regs[UREG_I0] = orig_i0; regs->u_regs[UREG_I0] = cookie.orig_i0;
regs->tpc -= 4; regs->tpc -= 4;
regs->tnpc -= 4; regs->tnpc -= 4;
} }
if (restart_syscall && if (cookie.restart_syscall &&
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->u_regs[UREG_G1] = __NR_restart_syscall;
regs->tpc -= 4; regs->tpc -= 4;
......
...@@ -136,7 +136,7 @@ static int kern_do_signal(struct pt_regs *regs, sigset_t *oldset, int error) ...@@ -136,7 +136,7 @@ static int kern_do_signal(struct pt_regs *regs, sigset_t *oldset, int error)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
sig = get_signal_to_deliver(&info, regs); sig = get_signal_to_deliver(&info, regs, NULL);
if(sig == 0) if(sig == 0)
return(0); return(0);
......
...@@ -506,7 +506,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -506,7 +506,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal(signr, &info, oldset, regs); handle_signal(signr, &info, oldset, regs);
......
...@@ -437,7 +437,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -437,7 +437,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs); signr = get_signal_to_deliver(&info, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Reenable any watchpoints before delivering the /* Reenable any watchpoints before delivering the
* signal to user space. The processor register will * signal to user space. The processor register will
......
...@@ -488,6 +488,8 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, ...@@ -488,6 +488,8 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up,
return; return;
} }
up->flags &= ~SUNZILOG_FLAG_TX_ACTIVE;
if (ZS_REGS_HELD(up)) { if (ZS_REGS_HELD(up)) {
__load_zsregs(channel, up->curregs); __load_zsregs(channel, up->curregs);
up->flags &= ~SUNZILOG_FLAG_REGS_HELD; up->flags &= ~SUNZILOG_FLAG_REGS_HELD;
...@@ -495,15 +497,11 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, ...@@ -495,15 +497,11 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up,
if (ZS_TX_STOPPED(up)) { if (ZS_TX_STOPPED(up)) {
up->flags &= ~SUNZILOG_FLAG_TX_STOPPED; up->flags &= ~SUNZILOG_FLAG_TX_STOPPED;
goto ack_tx_int;
sbus_writeb(RES_Tx_P, &channel->control);
ZSDELAY();
ZS_WSYNC(channel);
return;
} }
if (up->port.x_char) { if (up->port.x_char) {
up->flags |= SUNZILOG_FLAG_TX_ACTIVE;
sbus_writeb(up->port.x_char, &channel->data); sbus_writeb(up->port.x_char, &channel->data);
ZSDELAY(); ZSDELAY();
ZS_WSYNC(channel); ZS_WSYNC(channel);
...@@ -516,9 +514,14 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, ...@@ -516,9 +514,14 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up,
if (up->port.info == NULL) if (up->port.info == NULL)
goto ack_tx_int; goto ack_tx_int;
xmit = &up->port.info->xmit; xmit = &up->port.info->xmit;
if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) if (uart_circ_empty(xmit)) {
uart_write_wakeup(&up->port);
goto ack_tx_int;
}
if (uart_tx_stopped(&up->port))
goto ack_tx_int; goto ack_tx_int;
up->flags |= SUNZILOG_FLAG_TX_ACTIVE;
sbus_writeb(xmit->buf[xmit->tail], &channel->data); sbus_writeb(xmit->buf[xmit->tail], &channel->data);
ZSDELAY(); ZSDELAY();
ZS_WSYNC(channel); ZS_WSYNC(channel);
...@@ -529,9 +532,6 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, ...@@ -529,9 +532,6 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up,
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(&up->port); uart_write_wakeup(&up->port);
if (uart_circ_empty(xmit))
goto ack_tx_int;
return; return;
ack_tx_int: ack_tx_int:
...@@ -725,6 +725,9 @@ static void sunzilog_stop_rx(struct uart_port *port) ...@@ -725,6 +725,9 @@ static void sunzilog_stop_rx(struct uart_port *port)
struct zilog_channel *channel; struct zilog_channel *channel;
unsigned long flags; unsigned long flags;
if (ZS_IS_CONS(up))
return;
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
channel = ZILOG_CHANNEL_FROM_PORT(port); channel = ZILOG_CHANNEL_FROM_PORT(port);
...@@ -1588,6 +1591,7 @@ static void __init sunzilog_init_hw(void) ...@@ -1588,6 +1591,7 @@ static void __init sunzilog_init_hw(void)
} else { } else {
/* Normal serial TTY. */ /* Normal serial TTY. */
up->parity_mask = 0xff; up->parity_mask = 0xff;
up->curregs[R1] = EXT_INT_ENAB | INT_ALL_Rx | TxINT_ENAB;
up->curregs[R4] = PAR_EVEN | X16CLK | SB1; up->curregs[R4] = PAR_EVEN | X16CLK | SB1;
up->curregs[R3] = RxENAB | Rx8; up->curregs[R3] = RxENAB | Rx8;
up->curregs[R5] = TxENAB | Tx8; up->curregs[R5] = TxENAB | Tx8;
......
...@@ -146,7 +146,7 @@ xdr_decode_time3(u32 *p, struct timespec *timep) ...@@ -146,7 +146,7 @@ xdr_decode_time3(u32 *p, struct timespec *timep)
static u32 * static u32 *
xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr) xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr)
{ {
unsigned int type; unsigned int type, major, minor;
int fmode; int fmode;
type = ntohl(*p++); type = ntohl(*p++);
...@@ -160,9 +160,12 @@ xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr) ...@@ -160,9 +160,12 @@ xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr)
fattr->gid = ntohl(*p++); fattr->gid = ntohl(*p++);
p = xdr_decode_hyper(p, &fattr->size); p = xdr_decode_hyper(p, &fattr->size);
p = xdr_decode_hyper(p, &fattr->du.nfs3.used); p = xdr_decode_hyper(p, &fattr->du.nfs3.used);
/* Turn remote device info into Linux-specific dev_t */ /* Turn remote device info into Linux-specific dev_t */
fattr->rdev = ntohl(*p++) << MINORBITS; major = ntohl(*p++);
fattr->rdev |= ntohl(*p++) & MINORMASK; minor = ntohl(*p++);
fattr->rdev = MKDEV(major, minor);
p = xdr_decode_hyper(p, &fattr->fsid_u.nfs3); p = xdr_decode_hyper(p, &fattr->fsid_u.nfs3);
p = xdr_decode_hyper(p, &fattr->fileid); p = xdr_decode_hyper(p, &fattr->fileid);
p = xdr_decode_time3(p, &fattr->atime); p = xdr_decode_time3(p, &fattr->atime);
...@@ -412,8 +415,8 @@ nfs3_xdr_mknodargs(struct rpc_rqst *req, u32 *p, struct nfs3_mknodargs *args) ...@@ -412,8 +415,8 @@ nfs3_xdr_mknodargs(struct rpc_rqst *req, u32 *p, struct nfs3_mknodargs *args)
*p++ = htonl(args->type); *p++ = htonl(args->type);
p = xdr_encode_sattr(p, args->sattr); p = xdr_encode_sattr(p, args->sattr);
if (args->type == NF3CHR || args->type == NF3BLK) { if (args->type == NF3CHR || args->type == NF3BLK) {
*p++ = htonl(args->rdev >> MINORBITS); *p++ = htonl(MAJOR(args->rdev));
*p++ = htonl(args->rdev & MINORMASK); *p++ = htonl(MINOR(args->rdev));
} }
req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
......
...@@ -1385,13 +1385,14 @@ decode_getattr(struct xdr_stream *xdr, struct nfs4_getattr *getattr) ...@@ -1385,13 +1385,14 @@ decode_getattr(struct xdr_stream *xdr, struct nfs4_getattr *getattr)
dprintk("read_attrs: gid=%d\n", (int)nfp->gid); dprintk("read_attrs: gid=%d\n", (int)nfp->gid);
} }
if (bmval1 & FATTR4_WORD1_RAWDEV) { if (bmval1 & FATTR4_WORD1_RAWDEV) {
READ_BUF(8); uint32_t major, minor;
len += 8;
READ32(dummy32); READ_BUF(8);
nfp->rdev = (dummy32 << MINORBITS); len += 8;
READ32(dummy32); READ32(major);
nfp->rdev |= (dummy32 & MINORMASK); READ32(minor);
dprintk("read_attrs: rdev=%d\n", nfp->rdev); nfp->rdev = MKDEV(major, minor);
dprintk("read_attrs: rdev=0x%x\n", nfp->rdev);
} }
if (bmval1 & FATTR4_WORD1_SPACE_AVAIL) { if (bmval1 & FATTR4_WORD1_SPACE_AVAIL) {
READ_BUF(8); READ_BUF(8);
......
...@@ -186,6 +186,7 @@ struct sigstack { ...@@ -186,6 +186,7 @@ struct sigstack {
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#define HAVE_ARCH_SYS_PAUSE #define HAVE_ARCH_SYS_PAUSE
#endif #endif
......
...@@ -181,6 +181,7 @@ typedef struct sigaltstack { ...@@ -181,6 +181,7 @@ typedef struct sigaltstack {
/* here we could define asm-optimized sigaddset, sigdelset etc. operations. /* here we could define asm-optimized sigaddset, sigdelset etc. operations.
* if we don't, generic ones are used from linux/signal.h * if we don't, generic ones are used from linux/signal.h
*/ */
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -217,6 +217,7 @@ static __inline__ int sigfindinword(unsigned long word) ...@@ -217,6 +217,7 @@ static __inline__ int sigfindinword(unsigned long word)
struct pt_regs; struct pt_regs;
extern int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset)); extern int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -166,6 +166,7 @@ struct k_sigaction { ...@@ -166,6 +166,7 @@ struct k_sigaction {
# include <asm/sigcontext.h> # include <asm/sigcontext.h>
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#define HAVE_ARCH_SYS_PAUSE #define HAVE_ARCH_SYS_PAUSE
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -176,6 +176,8 @@ typedef struct sigaltstack { ...@@ -176,6 +176,8 @@ typedef struct sigaltstack {
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#undef __HAVE_ARCH_SIG_BITOPS #undef __HAVE_ARCH_SIG_BITOPS
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _M68KNOMMU_SIGNAL_H */ #endif /* _M68KNOMMU_SIGNAL_H */
...@@ -169,6 +169,8 @@ typedef struct sigaltstack { ...@@ -169,6 +169,8 @@ typedef struct sigaltstack {
#define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */ #define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */
#define BRK_MULOVF 1023 /* Multiply overflow */ #define BRK_MULOVF 1023 /* Multiply overflow */
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* defined (__KERNEL__) */ #endif /* defined (__KERNEL__) */
#endif /* _ASM_SIGNAL_H */ #endif /* _ASM_SIGNAL_H */
...@@ -168,6 +168,9 @@ typedef struct sigaltstack { ...@@ -168,6 +168,9 @@ typedef struct sigaltstack {
#define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */ #define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */
#define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */ #define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */
#define BRK_MULOVF 1023 /* Multiply overflow */ #define BRK_MULOVF 1023 /* Multiply overflow */
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* defined (__KERNEL__) || defined (__USE_MISC) */ #endif /* defined (__KERNEL__) || defined (__USE_MISC) */
#endif /* !defined (_ASM_SIGNAL_H) */ #endif /* !defined (_ASM_SIGNAL_H) */
...@@ -150,6 +150,7 @@ typedef struct sigaltstack { ...@@ -150,6 +150,7 @@ typedef struct sigaltstack {
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif #endif
...@@ -143,4 +143,6 @@ typedef struct sigaltstack { ...@@ -143,4 +143,6 @@ typedef struct sigaltstack {
size_t ss_size; size_t ss_size;
} stack_t; } stack_t;
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* _ASMPPC64_SIGNAL_H */ #endif /* _ASMPPC64_SIGNAL_H */
...@@ -175,6 +175,8 @@ struct sigaction { ...@@ -175,6 +175,8 @@ struct sigaction {
#define sa_handler _u._sa_handler #define sa_handler _u._sa_handler
#define sa_sigaction _u._sa_sigaction #define sa_sigaction _u._sa_sigaction
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
typedef struct sigaltstack { typedef struct sigaltstack {
......
...@@ -175,6 +175,8 @@ struct sigaction { ...@@ -175,6 +175,8 @@ struct sigaction {
#define sa_handler _u._sa_handler #define sa_handler _u._sa_handler
#define sa_sigaction _u._sa_sigaction #define sa_sigaction _u._sa_sigaction
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
typedef struct sigaltstack { typedef struct sigaltstack {
......
...@@ -165,6 +165,8 @@ typedef struct sigaltstack { ...@@ -165,6 +165,8 @@ typedef struct sigaltstack {
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* __ASM_SH_SIGNAL_H */ #endif /* __ASM_SH_SIGNAL_H */
...@@ -62,8 +62,9 @@ BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long) ...@@ -62,8 +62,9 @@ BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long)
#define __flush_page_to_ram(addr) BTFIXUP_CALL(__flush_page_to_ram)(addr) #define __flush_page_to_ram(addr) BTFIXUP_CALL(__flush_page_to_ram)(addr)
#define flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(flush_sig_insns)(mm,insn_addr) #define flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(flush_sig_insns)(mm,insn_addr)
extern void flush_page_to_ram(struct page *page); extern void sparc_flush_page_to_ram(struct page *page);
#define flush_dcache_page(page) do { } while (0) #define flush_page_to_ram(page) do { } while (0)
#define flush_dcache_page(page) sparc_flush_page_to_ram(page)
#endif /* _SPARC_CACHEFLUSH_H */ #endif /* _SPARC_CACHEFLUSH_H */
...@@ -31,8 +31,14 @@ ...@@ -31,8 +31,14 @@
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
#define clear_user_page(addr, vaddr, page) clear_page(addr) #define clear_user_page(addr, vaddr, page) \
#define copy_user_page(to, from, vaddr, page) copy_page(to, from) do { clear_page(addr); \
sparc_flush_page_to_ram(page); \
} while (0)
#define copy_user_page(to, from, vaddr, page) \
do { copy_page(to, from); \
sparc_flush_page_to_ram(page); \
} while (0)
/* The following structure is used to hold the physical /* The following structure is used to hold the physical
* memory configuration of the machine. This is filled in * memory configuration of the machine. This is filled in
......
...@@ -216,7 +216,32 @@ typedef struct sigaltstack { ...@@ -216,7 +216,32 @@ typedef struct sigaltstack {
size_t ss_size; size_t ss_size;
} stack_t; } stack_t;
#define HAVE_ARCH_GET_SIGNAL_TO_DELIVER struct sparc_deliver_cookie {
int restart_syscall;
unsigned long orig_i0;
};
#define ptrace_signal_deliver(REGS, COOKIE) \
do { struct sparc_deliver_cookie *cp = (COOKIE); \
if (cp->restart_syscall && \
(regs->u_regs[UREG_I0] == ERESTARTNOHAND || \
regs->u_regs[UREG_I0] == ERESTARTSYS || \
regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { \
/* replay the system call when we are done */ \
regs->u_regs[UREG_I0] = cp->orig_i0; \
regs->pc -= 4; \
regs->npc -= 4; \
cp->restart_syscall = 0; \
} \
if (cp->restart_syscall && \
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { \
regs->u_regs[UREG_G1] = __NR_restart_syscall; \
regs->pc -= 4; \
regs->npc -= 4; \
cp->restart_syscall = 0; \
} \
} while (0)
#endif /* !(__ASSEMBLY__) */ #endif /* !(__ASSEMBLY__) */
......
...@@ -245,7 +245,32 @@ typedef struct sigaltstack32 { ...@@ -245,7 +245,32 @@ typedef struct sigaltstack32 {
compat_size_t ss_size; compat_size_t ss_size;
} stack_t32; } stack_t32;
#define HAVE_ARCH_GET_SIGNAL_TO_DELIVER struct signal_deliver_cookie {
int restart_syscall;
unsigned long orig_i0;
};
#define ptrace_signal_deliver(REGS, COOKIE) \
do { struct signal_deliver_cookie *cp = (COOKIE); \
if (cp->restart_syscall && \
(regs->u_regs[UREG_I0] == ERESTARTNOHAND || \
regs->u_regs[UREG_I0] == ERESTARTSYS || \
regs->u_regs[UREG_I0] == ERESTARTNOINTR)) { \
/* replay the system call when we are done */ \
regs->u_regs[UREG_I0] = cp->orig_i0; \
regs->tpc -= 4; \
regs->tnpc -= 4; \
cp->restart_syscall = 0; \
} \
if (cp->restart_syscall && \
regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { \
regs->u_regs[UREG_G1] = __NR_restart_syscall; \
regs->tpc -= 4; \
regs->tnpc -= 4; \
cp->restart_syscall = 0; \
} \
} while (0)
#define HAVE_ARCH_SYS_PAUSE #define HAVE_ARCH_SYS_PAUSE
#endif #endif
......
...@@ -188,6 +188,8 @@ typedef struct sigaltstack { ...@@ -188,6 +188,8 @@ typedef struct sigaltstack {
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#undef __HAVE_ARCH_SIG_BITOPS #undef __HAVE_ARCH_SIG_BITOPS
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* __V850_SIGNAL_H__ */ #endif /* __V850_SIGNAL_H__ */
...@@ -200,6 +200,9 @@ extern __inline__ int sigfindinword(unsigned long word) ...@@ -200,6 +200,9 @@ extern __inline__ int sigfindinword(unsigned long word)
} }
#endif #endif
#endif #endif
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif #endif
...@@ -208,7 +208,7 @@ extern int sigprocmask(int, sigset_t *, sigset_t *); ...@@ -208,7 +208,7 @@ extern int sigprocmask(int, sigset_t *, sigset_t *);
#ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER #ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER
struct pt_regs; struct pt_regs;
extern int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs); extern int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs, void *cookie);
#endif #endif
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -13,9 +13,30 @@ extern rwlock_t unix_table_lock; ...@@ -13,9 +13,30 @@ extern rwlock_t unix_table_lock;
extern atomic_t unix_tot_inflight; extern atomic_t unix_tot_inflight;
static inline unix_socket *first_unix_socket(int *i)
{
for (*i = 0; *i <= UNIX_HASH_SIZE; (*i)++) {
if (unix_socket_table[*i])
return unix_socket_table[*i];
}
return NULL;
}
static inline unix_socket *next_unix_socket(int *i, unix_socket *s)
{
/* More in this chain? */
if (s->next)
return s->next;
/* Look for next non-empty chain. */
for ((*i)++; *i <= UNIX_HASH_SIZE; (*i)++) {
if (unix_socket_table[*i])
return unix_socket_table[*i];
}
return NULL;
}
#define forall_unix_sockets(i, s) for (i=0; i<=UNIX_HASH_SIZE; i++) \ #define forall_unix_sockets(i, s) \
for (s=unix_socket_table[i]; s; s=s->next) for (s = first_unix_socket(&(i)); s; s = next_unix_socket(&(i),(s)))
struct unix_address struct unix_address
{ {
......
...@@ -1405,7 +1405,7 @@ do_signal_stop(int signr) ...@@ -1405,7 +1405,7 @@ do_signal_stop(int signr)
#ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER #ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER
int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs) int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs, void *cookie)
{ {
sigset_t *mask = &current->blocked; sigset_t *mask = &current->blocked;
...@@ -1443,6 +1443,8 @@ int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs) ...@@ -1443,6 +1443,8 @@ int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs)
break; break;
if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
ptrace_signal_deliver(regs, cookie);
/* /*
* If there is a group stop in progress, * If there is a group stop in progress,
* we must participate in the bookkeeping. * we must participate in the bookkeeping.
......
...@@ -338,6 +338,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -338,6 +338,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
eb = (struct ec_cb *)&skb->cb; eb = (struct ec_cb *)&skb->cb;
/* BUG: saddr may be NULL */
eb->cookie = saddr->cookie; eb->cookie = saddr->cookie;
eb->sec = *saddr; eb->sec = *saddr;
eb->sent = ec_tx_done; eb->sent = ec_tx_done;
......
...@@ -37,10 +37,10 @@ static struct ...@@ -37,10 +37,10 @@ static struct
} initial_table __initdata } initial_table __initdata
= { { "filter", FILTER_VALID_HOOKS, 3, = { { "filter", FILTER_VALID_HOOKS, 3,
sizeof(struct arpt_standard) * 2 + sizeof(struct arpt_error), sizeof(struct arpt_standard) * 2 + sizeof(struct arpt_error),
{ [NF_ARP_IN] 0, { [NF_ARP_IN] = 0,
[NF_ARP_OUT] sizeof(struct arpt_standard) }, [NF_ARP_OUT] = sizeof(struct arpt_standard) },
{ [NF_ARP_IN] 0, { [NF_ARP_IN] = 0,
[NF_ARP_OUT] sizeof(struct arpt_standard), }, [NF_ARP_OUT] = sizeof(struct arpt_standard), },
0, NULL, { } }, 0, NULL, { } },
{ {
/* ARP_IN */ /* ARP_IN */
......
...@@ -160,10 +160,10 @@ static int (*mangle[])(struct sk_buff **, u_int32_t, u_int16_t, ...@@ -160,10 +160,10 @@ static int (*mangle[])(struct sk_buff **, u_int32_t, u_int16_t,
unsigned int, unsigned int,
struct ip_conntrack *, struct ip_conntrack *,
enum ip_conntrack_info) enum ip_conntrack_info)
= { [IP_CT_FTP_PORT] mangle_rfc959_packet, = { [IP_CT_FTP_PORT] = mangle_rfc959_packet,
[IP_CT_FTP_PASV] mangle_rfc959_packet, [IP_CT_FTP_PASV] = mangle_rfc959_packet,
[IP_CT_FTP_EPRT] mangle_eprt_packet, [IP_CT_FTP_EPRT] = mangle_eprt_packet,
[IP_CT_FTP_EPSV] mangle_epsv_packet [IP_CT_FTP_EPSV] = mangle_epsv_packet
}; };
static int ftp_data_fixup(const struct ip_ct_ftp_expect *ct_ftp_info, static int ftp_data_fixup(const struct ip_ct_ftp_expect *ct_ftp_info,
......
...@@ -56,12 +56,12 @@ static struct ...@@ -56,12 +56,12 @@ static struct
} nat_initial_table __initdata } nat_initial_table __initdata
= { { "nat", NAT_VALID_HOOKS, 4, = { { "nat", NAT_VALID_HOOKS, 4,
sizeof(struct ipt_standard) * 3 + sizeof(struct ipt_error), sizeof(struct ipt_standard) * 3 + sizeof(struct ipt_error),
{ [NF_IP_PRE_ROUTING] 0, { [NF_IP_PRE_ROUTING] = 0,
[NF_IP_POST_ROUTING] sizeof(struct ipt_standard), [NF_IP_POST_ROUTING] = sizeof(struct ipt_standard),
[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 2 }, [NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) * 2 },
{ [NF_IP_PRE_ROUTING] 0, { [NF_IP_PRE_ROUTING] = 0,
[NF_IP_POST_ROUTING] sizeof(struct ipt_standard), [NF_IP_POST_ROUTING] = sizeof(struct ipt_standard),
[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 2 }, [NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) * 2 },
0, NULL, { } }, 0, NULL, { } },
{ {
/* PRE_ROUTING */ /* PRE_ROUTING */
......
...@@ -35,12 +35,12 @@ static struct ...@@ -35,12 +35,12 @@ static struct
} initial_table __initdata } initial_table __initdata
= { { "filter", FILTER_VALID_HOOKS, 4, = { { "filter", FILTER_VALID_HOOKS, 4,
sizeof(struct ipt_standard) * 3 + sizeof(struct ipt_error), sizeof(struct ipt_standard) * 3 + sizeof(struct ipt_error),
{ [NF_IP_LOCAL_IN] 0, { [NF_IP_LOCAL_IN] = 0,
[NF_IP_FORWARD] sizeof(struct ipt_standard), [NF_IP_FORWARD] = sizeof(struct ipt_standard),
[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 2 }, [NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) * 2 },
{ [NF_IP_LOCAL_IN] 0, { [NF_IP_LOCAL_IN] = 0,
[NF_IP_FORWARD] sizeof(struct ipt_standard), [NF_IP_FORWARD] = sizeof(struct ipt_standard),
[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 2 }, [NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) * 2 },
0, NULL, { } }, 0, NULL, { } },
{ {
/* LOCAL_IN */ /* LOCAL_IN */
......
...@@ -48,16 +48,16 @@ static struct ...@@ -48,16 +48,16 @@ static struct
} initial_table __initdata } initial_table __initdata
= { { "mangle", MANGLE_VALID_HOOKS, 6, = { { "mangle", MANGLE_VALID_HOOKS, 6,
sizeof(struct ipt_standard) * 5 + sizeof(struct ipt_error), sizeof(struct ipt_standard) * 5 + sizeof(struct ipt_error),
{ [NF_IP_PRE_ROUTING] 0, { [NF_IP_PRE_ROUTING] = 0,
[NF_IP_LOCAL_IN] sizeof(struct ipt_standard), [NF_IP_LOCAL_IN] = sizeof(struct ipt_standard),
[NF_IP_FORWARD] sizeof(struct ipt_standard) * 2, [NF_IP_FORWARD] = sizeof(struct ipt_standard) * 2,
[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 3, [NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) * 3,
[NF_IP_POST_ROUTING] sizeof(struct ipt_standard) * 4 }, [NF_IP_POST_ROUTING] = sizeof(struct ipt_standard) * 4 },
{ [NF_IP_PRE_ROUTING] 0, { [NF_IP_PRE_ROUTING] = 0,
[NF_IP_LOCAL_IN] sizeof(struct ipt_standard), [NF_IP_LOCAL_IN] = sizeof(struct ipt_standard),
[NF_IP_FORWARD] sizeof(struct ipt_standard) * 2, [NF_IP_FORWARD] = sizeof(struct ipt_standard) * 2,
[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 3, [NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) * 3,
[NF_IP_POST_ROUTING] sizeof(struct ipt_standard) * 4 }, [NF_IP_POST_ROUTING] = sizeof(struct ipt_standard) * 4 },
0, NULL, { } }, 0, NULL, { } },
{ {
/* PRE_ROUTING */ /* PRE_ROUTING */
......
...@@ -99,7 +99,7 @@ fold_field(void *mib[], int nr) ...@@ -99,7 +99,7 @@ fold_field(void *mib[], int nr)
*((unsigned long *) (((void *) per_cpu_ptr(mib[0], i)) + *((unsigned long *) (((void *) per_cpu_ptr(mib[0], i)) +
sizeof (unsigned long) * nr)); sizeof (unsigned long) * nr));
res += res +=
*((unsigned long *) (((void *) per_cpu_ptr(mib[0], i)) + *((unsigned long *) (((void *) per_cpu_ptr(mib[1], i)) +
sizeof (unsigned long) * nr)); sizeof (unsigned long) * nr));
} }
return res; return res;
......
...@@ -1522,7 +1522,8 @@ void tcp_send_probe0(struct sock *sk) ...@@ -1522,7 +1522,8 @@ void tcp_send_probe0(struct sock *sk)
} }
if (err <= 0) { if (err <= 0) {
tp->backoff++; if (tp->backoff < sysctl_tcp_retries2)
tp->backoff++;
tp->probes_out++; tp->probes_out++;
tcp_reset_xmit_timer (sk, TCP_TIME_PROBE0, tcp_reset_xmit_timer (sk, TCP_TIME_PROBE0,
min(tp->rto << tp->backoff, TCP_RTO_MAX)); min(tp->rto << tp->backoff, TCP_RTO_MAX));
......
...@@ -35,12 +35,12 @@ static struct ...@@ -35,12 +35,12 @@ static struct
} initial_table __initdata } initial_table __initdata
= { { "filter", FILTER_VALID_HOOKS, 4, = { { "filter", FILTER_VALID_HOOKS, 4,
sizeof(struct ip6t_standard) * 3 + sizeof(struct ip6t_error), sizeof(struct ip6t_standard) * 3 + sizeof(struct ip6t_error),
{ [NF_IP6_LOCAL_IN] 0, { [NF_IP6_LOCAL_IN] = 0,
[NF_IP6_FORWARD] sizeof(struct ip6t_standard), [NF_IP6_FORWARD] = sizeof(struct ip6t_standard),
[NF_IP6_LOCAL_OUT] sizeof(struct ip6t_standard) * 2 }, [NF_IP6_LOCAL_OUT] = sizeof(struct ip6t_standard) * 2 },
{ [NF_IP6_LOCAL_IN] 0, { [NF_IP6_LOCAL_IN] = 0,
[NF_IP6_FORWARD] sizeof(struct ip6t_standard), [NF_IP6_FORWARD] = sizeof(struct ip6t_standard),
[NF_IP6_LOCAL_OUT] sizeof(struct ip6t_standard) * 2 }, [NF_IP6_LOCAL_OUT] = sizeof(struct ip6t_standard) * 2 },
0, NULL, { } }, 0, NULL, { } },
{ {
/* LOCAL_IN */ /* LOCAL_IN */
......
...@@ -45,16 +45,16 @@ static struct ...@@ -45,16 +45,16 @@ static struct
} initial_table __initdata } initial_table __initdata
= { { "mangle", MANGLE_VALID_HOOKS, 6, = { { "mangle", MANGLE_VALID_HOOKS, 6,
sizeof(struct ip6t_standard) * 5 + sizeof(struct ip6t_error), sizeof(struct ip6t_standard) * 5 + sizeof(struct ip6t_error),
{ [NF_IP6_PRE_ROUTING] 0, { [NF_IP6_PRE_ROUTING] = 0,
[NF_IP6_LOCAL_IN] sizeof(struct ip6t_standard), [NF_IP6_LOCAL_IN] = sizeof(struct ip6t_standard),
[NF_IP6_FORWARD] sizeof(struct ip6t_standard) * 2, [NF_IP6_FORWARD] = sizeof(struct ip6t_standard) * 2,
[NF_IP6_LOCAL_OUT] sizeof(struct ip6t_standard) * 3, [NF_IP6_LOCAL_OUT] = sizeof(struct ip6t_standard) * 3,
[NF_IP6_POST_ROUTING] sizeof(struct ip6t_standard) * 4}, [NF_IP6_POST_ROUTING] = sizeof(struct ip6t_standard) * 4},
{ [NF_IP6_PRE_ROUTING] 0, { [NF_IP6_PRE_ROUTING] = 0,
[NF_IP6_LOCAL_IN] sizeof(struct ip6t_standard), [NF_IP6_LOCAL_IN] = sizeof(struct ip6t_standard),
[NF_IP6_FORWARD] sizeof(struct ip6t_standard) * 2, [NF_IP6_FORWARD] = sizeof(struct ip6t_standard) * 2,
[NF_IP6_LOCAL_OUT] sizeof(struct ip6t_standard) * 3, [NF_IP6_LOCAL_OUT] = sizeof(struct ip6t_standard) * 3,
[NF_IP6_POST_ROUTING] sizeof(struct ip6t_standard) * 4}, [NF_IP6_POST_ROUTING] = sizeof(struct ip6t_standard) * 4},
0, NULL, { } }, 0, NULL, { } },
{ {
/* PRE_ROUTING */ /* PRE_ROUTING */
......
...@@ -116,7 +116,7 @@ gred_enqueue(struct sk_buff *skb, struct Qdisc* sch) ...@@ -116,7 +116,7 @@ gred_enqueue(struct sk_buff *skb, struct Qdisc* sch)
} }
if ( ((skb->tc_index&0xf) > t->DPs) || !(q=t->tab[skb->tc_index&0xf])) { if ( ((skb->tc_index&0xf) > (t->DPs -1)) || !(q=t->tab[skb->tc_index&0xf])) {
printk("GRED: setting to default (%d)\n ",t->def); printk("GRED: setting to default (%d)\n ",t->def);
if (!(q=t->tab[t->def])) { if (!(q=t->tab[t->def])) {
DPRINTK("GRED: setting to default FAILED! dropping!! " DPRINTK("GRED: setting to default FAILED! dropping!! "
......
...@@ -218,8 +218,9 @@ void x25_transmit_clear_request(struct x25_neigh *nb, unsigned int lci, ...@@ -218,8 +218,9 @@ void x25_transmit_clear_request(struct x25_neigh *nb, unsigned int lci,
dptr = skb_put(skb, X25_STD_MIN_LEN + 2); dptr = skb_put(skb, X25_STD_MIN_LEN + 2);
*dptr++ = ((lci >> 8) & 0x0F) | nb->extended ? X25_GFI_EXTSEQ : *dptr++ = ((lci >> 8) & 0x0F) | (nb->extended ?
X25_GFI_STDSEQ; X25_GFI_EXTSEQ :
X25_GFI_STDSEQ);
*dptr++ = (lci >> 0) & 0xFF; *dptr++ = (lci >> 0) & 0xFF;
*dptr++ = X25_CLEAR_REQUEST; *dptr++ = X25_CLEAR_REQUEST;
*dptr++ = cause; *dptr++ = cause;
......
...@@ -94,7 +94,7 @@ define rule_vcc_o_c ...@@ -94,7 +94,7 @@ define rule_vcc_o_c
else \ else \
$(CPP) -D__GENKSYMS__ $(c_flags) $< \ $(CPP) -D__GENKSYMS__ $(c_flags) $< \
| $(GENKSYMS) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) \ | $(GENKSYMS) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) \
| sed -n 's/\#define __ver_\(\w*\)\W*\(\w*\)/__crc_\1 = 0x\2 ;/gp' \ | sed -n 's/\#define __ver_\([^ ]*\)[ ]*\([^ ]*\)/__crc_\1 = 0x\2 ;/gp' \
> $(@D)/.tmp_$(@F:.o=.ver); \ > $(@D)/.tmp_$(@F:.o=.ver); \
\ \
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
......
...@@ -165,7 +165,7 @@ cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \ ...@@ -165,7 +165,7 @@ cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
quiet_cmd_objcopy = OBJCOPY $@ quiet_cmd_objcopy = OBJCOPY $@
cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $< $@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
# Gzip # Gzip
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -178,14 +178,16 @@ cmd_gzip = gzip -f -9 < $< > $@ ...@@ -178,14 +178,16 @@ cmd_gzip = gzip -f -9 < $< > $@
# =========================================================================== # ===========================================================================
# function to only execute the passed command if necessary # function to only execute the passed command if necessary
# >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file
# note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars
if_changed = $(if $(strip $? \ if_changed = $(if $(strip $? \
$(filter-out $(cmd_$(1)),$(cmd_$@))\ $(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\ $(filter-out $(cmd_$@),$(cmd_$(1)))),\
@set -e; \ @set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \ $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \
$(cmd_$(1)); \ $(cmd_$(1)); \
echo 'cmd_$@ := $(cmd_$(1))' > $(@D)/.$(@F).cmd) echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd)
# execute the command and also postprocess generated .d dependencies # execute the command and also postprocess generated .d dependencies
...@@ -195,9 +197,9 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ ...@@ -195,9 +197,9 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
$(filter-out $(cmd_$(1)),$(cmd_$@))\ $(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\ $(filter-out $(cmd_$@),$(cmd_$(1)))),\
@set -e; \ @set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \ $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \
$(cmd_$(1)); \ $(cmd_$(1)); \
scripts/fixdep $(depfile) $@ '$(cmd_$(1))' > $(@D)/.$(@F).tmp; \ scripts/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \
rm -f $(depfile); \ rm -f $(depfile); \
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
......
...@@ -9,11 +9,12 @@ include scripts/Makefile.lib ...@@ -9,11 +9,12 @@ include scripts/Makefile.lib
# #
__modules := $(shell cd $(MODVERDIR); cat *.mod) __modules := $(shell cat /dev/null $(wildcard $(MODVERDIR)/*.mod))
modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
ifneq ($(filter-out $(modules),$(__modules)),) ifneq ($(filter-out $(modules),$(__modules)),)
$(warning *** Uh-oh, you have stale module entries. You messed with SUBDIRS, don't complain if something goes wrong.) $(warning *** Uh-oh, you have stale module entries. You messed with SUBDIRS,)
$(warning do not complain if something goes wrong.)
endif endif
__modversions: $(modules) __modversions: $(modules)
......
...@@ -277,6 +277,8 @@ void do_config_file(char *filename) ...@@ -277,6 +277,8 @@ void do_config_file(char *filename)
parse_config_file(map, st.st_size); parse_config_file(map, st.st_size);
munmap(map, st.st_size); munmap(map, st.st_size);
close(fd);
} }
void parse_dep_file(void *map, size_t len) void parse_dep_file(void *map, size_t len)
...@@ -346,6 +348,8 @@ void print_deps(void) ...@@ -346,6 +348,8 @@ void print_deps(void)
parse_dep_file(map, st.st_size); parse_dep_file(map, st.st_size);
munmap(map, st.st_size); munmap(map, st.st_size);
close(fd);
} }
void traps(void) void traps(void)
......
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