Skip to content

Commit

Permalink
Merge tag 'frv-fixes-20121102' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/dhowells/linux-frv

Pull FRV fixes from David Howells:
 "A collection of small fixes for the FRV architecture."

* tag 'frv-fixes-20121102' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-frv:
  frv: fix the broken preempt
  frv: switch to saner kernel_execve() semantics
  FRV: Fix the new-style kernel_thread() stuff
  FRV: Fix the preemption handling
  FRV: gcc-4.1.2 also inlines weak functions
  FRV: Don't objcopy the GNU build_id note
  FRV: Add missing linux/export.h #inclusions
  • Loading branch information
torvalds committed Nov 2, 2012
2 parents 66b6a0c + 1d72d9f commit b987a83
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 32 deletions.
1 change: 1 addition & 0 deletions arch/frv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ config FRV
select GENERIC_CPU_DEVICES
select ARCH_WANT_IPC_PARSE_VERSION
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE

config ZONE_DMA
bool
Expand Down
10 changes: 6 additions & 4 deletions arch/frv/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ PARAMS_PHYS = 0x0207c000
INITRD_PHYS = 0x02180000
INITRD_VIRT = 0x02180000

OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment

#
# If you don't define ZRELADDR above,
# then it defaults to ZTEXTADDR
Expand All @@ -32,18 +34,18 @@ Image: $(obj)/Image
targets: $(obj)/Image

$(obj)/Image: vmlinux FORCE
$(OBJCOPY) -O binary -R .note -R .comment -S vmlinux $@
$(OBJCOPY) $(OBJCOPYFLAGS) -S vmlinux $@

#$(obj)/Image: $(CONFIGURE) $(SYSTEM)
# $(OBJCOPY) -O binary -R .note -R .comment -g -S $(SYSTEM) $@
# $(OBJCOPY) $(OBJCOPYFLAGS) -g -S $(SYSTEM) $@

bzImage: zImage

zImage: $(CONFIGURE) compressed/$(LINUX)
$(OBJCOPY) -O binary -R .note -R .comment -S compressed/$(LINUX) $@
$(OBJCOPY) $(OBJCOPYFLAGS) -S compressed/$(LINUX) $@

bootpImage: bootp/bootp
$(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
$(OBJCOPY) $(OBJCOPYFLAGS) -S bootp/bootp $@

compressed/$(LINUX): $(LINUX) dep
@$(MAKE) -C compressed $(LINUX)
Expand Down
1 change: 0 additions & 1 deletion arch/frv/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_KERNEL_EXECVE

/*
* "Conditional" syscalls
Expand Down
28 changes: 3 additions & 25 deletions arch/frv/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -869,11 +869,6 @@ ret_from_kernel_thread:
call schedule_tail
calll.p @(gr21,gr0)
or gr20,gr20,gr8
bra sys_exit

.globl ret_from_kernel_execve
ret_from_kernel_execve:
ori gr28,0,sp
bra __syscall_exit

###################################################################################################
Expand Down Expand Up @@ -1080,27 +1075,10 @@ __entry_return_from_kernel_interrupt:
subicc gr5,#0,gr0,icc0
beq icc0,#0,__entry_return_direct

__entry_preempt_need_resched:
ldi @(gr15,#TI_FLAGS),gr4
andicc gr4,#_TIF_NEED_RESCHED,gr0,icc0
beq icc0,#1,__entry_return_direct

setlos #PREEMPT_ACTIVE,gr5
sti gr5,@(gr15,#TI_FLAGS)

andi gr23,#~PSR_PIL,gr23
movgs gr23,psr

call schedule
sti gr0,@(gr15,#TI_PRE_COUNT)

movsg psr,gr23
ori gr23,#PSR_PIL_14,gr23
movgs gr23,psr
bra __entry_preempt_need_resched
#else
bra __entry_return_direct
subcc gr0,gr0,gr0,icc2 /* set Z and clear C */
call preempt_schedule_irq
#endif
bra __entry_return_direct


###############################################################################
Expand Down
5 changes: 3 additions & 2 deletions arch/frv/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ int copy_thread(unsigned long clone_flags,
childregs = (struct pt_regs *)
(task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE);

/* set up the userspace frame (the only place that the USP is stored) */
*childregs = *__kernel_frame0_ptr;

p->set_child_tid = p->clear_child_tid = NULL;

p->thread.frame = childregs;
Expand All @@ -191,10 +194,8 @@ int copy_thread(unsigned long clone_flags,
p->thread.frame0 = childregs;

if (unlikely(!regs)) {
memset(childregs, 0, sizeof(struct pt_regs));
childregs->gr9 = usp; /* function */
childregs->gr8 = arg;
childregs->psr = PSR_S;
p->thread.pc = (unsigned long) ret_from_kernel_thread;
save_user_regs(p->thread.user);
return 0;
Expand Down
1 change: 1 addition & 0 deletions arch/frv/mb93090-mb00/pci-dma-nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <linux/types.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/dma-mapping.h>
#include <linux/list.h>
#include <linux/pci.h>
Expand Down
2 changes: 2 additions & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,11 @@ void __init __weak smp_setup_processor_id(void)
{
}

# if THREAD_SIZE >= PAGE_SIZE
void __init __weak thread_info_cache_init(void)
{
}
#endif

/*
* Set up kernel memory allocators
Expand Down

0 comments on commit b987a83

Please sign in to comment.