Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/linux-milkymist
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d5f28d5a11f0
Choose a base ref
...
head repository: m-labs/linux-milkymist
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0ca475bc9227
Choose a head ref
  • 7 commits
  • 17 files changed
  • 2 contributors

Commits on Feb 23, 2013

  1. lm32: Drop unused debugger_info field from thread_info struct

    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 23, 2013
    Copy the full SHA
    37807cf View commit details
  2. Drop __devinit/__devexit from milkymist drivers

    These will be gone in upstream v3.8
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 23, 2013
    Copy the full SHA
    b0017d7 View commit details
  3. lm32: Implement user_stack_pointer()

    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 23, 2013
    Copy the full SHA
    a756401 View commit details
  4. lm32: Switch to GENERIC_KERNEL_THREAD and GENERIC_KERNEL_EXECVE

    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 23, 2013
    Copy the full SHA
    50af5f9 View commit details
  5. lm32: switch to generic sys_execve()

    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 23, 2013
    Copy the full SHA
    aab9d67 View commit details
  6. generic sys_fork / sys_vfork / sys_clone

    ... and get rid of idiotic struct pt_regs * in asm-generic/syscalls.h
    prototypes of the same, while we are at it.  Eventually we want those
    in linux/syscalls.h, of course, but that'll have to wait a bit.
    
    Note that there are *three* variants of sys_clone() order of arguments.
    Braindamage galore...
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Al Viro authored and larsclausen committed Feb 23, 2013
    Copy the full SHA
    e1bbf3a View commit details
  7. lm32: switch to generic clone(2)

    Unfortunately lm32 has yet another crazy sys_clone parameter order. We need to
    fix this at some point. This will break all existing userspace though.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 23, 2013
    Copy the full SHA
    0ca475b View commit details
17 changes: 17 additions & 0 deletions arch/Kconfig
Original file line number Diff line number Diff line change
@@ -341,4 +341,21 @@ config MODULES_USE_ELF_REL
Modules only use ELF REL relocations. Modules with ELF RELA
relocations will give an error.

#
# ABI hall of shame
#
config CLONE_BACKWARDS
bool
help
Architecture has tls passed as the 4th argument of clone(2),
not the 5th one.

config CLONE_BACKWARDS2
bool
help
Architecture has the first two arguments of clone(2) swapped.

config CLONE_BACKWARDS3
bool

source "kernel/gcov/Kconfig"
3 changes: 3 additions & 0 deletions arch/lm32/Kconfig
Original file line number Diff line number Diff line change
@@ -13,6 +13,9 @@ config LM32
select HAVE_MEMBLOCK
select MODULES_USE_ELF_REL
select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select CLONE_BACKWARDS3

config GENERIC_GPIO
bool
1 change: 0 additions & 1 deletion arch/lm32/include/asm/processor.h
Original file line number Diff line number Diff line change
@@ -63,7 +63,6 @@ struct thread_struct {
unsigned long ksp; /* kernel stack pointer */
unsigned long usp; /* user stack pointer */
unsigned long which_stack; /* 0 if we are on kernel stack, 1 if we are on user stack */
void * debuggerinfo;
};

#define KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32)
1 change: 1 addition & 0 deletions arch/lm32/include/asm/ptrace.h
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ struct pt_regs {
#ifdef __KERNEL__
#define user_mode(regs) ((regs)->pt_mode == PT_MODE_USER)

#define user_stack_pointer(regs) ((regs)->sp)
#define instruction_pointer(regs) ((regs)->ea)
#define profile_pc(regs) instruction_pointer(regs)

2 changes: 2 additions & 0 deletions arch/lm32/include/asm/unistd.h
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
#define __ARCH_WANT_SYSCALL_NO_FLAGS
#define __ARCH_WANT_SYSCALL_OFF_T
#define __ARCH_WANT_SYSCALL_DEPRECATED
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE

#include <asm-generic/unistd.h>

2 changes: 1 addition & 1 deletion arch/lm32/kernel/Makefile
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

extra-y := head.o vmlinux.lds
obj-y := \
sys_lm32.o setup.o traps.o signal.o time.o \
setup.o traps.o signal.o time.o \
ptrace.o irq.o process.o entry.o \
flat.o cpuinfo.o prom.o platform.o

18 changes: 11 additions & 7 deletions arch/lm32/kernel/entry.S
Original file line number Diff line number Diff line change
@@ -154,14 +154,18 @@ EXCEPTION_RETURN_PATH(_return_from_exception, _restore_and_return_exception)
/* returns to continuation(arg1, arg2) */
ENTRY(ret_from_fork)
calli schedule_tail
mv r1, r11
mv r2, r12
mv ra, r13
ret
mvi r1, 0
bi syscall_tail

ENTRY(sys_execve)
mv r4, r7
bi lm32_execve
/* ret_from_fork(arg1, arg2, continuation) */
/* calls schedule_tail and then manage_signals */
/* returns to continuation(arg1, arg2) */
ENTRY(ret_from_kernel_thread)
calli schedule_tail
mv r1, r12
mvhi ra, hi(syscall_tail)
ori ra, ra, lo(syscall_tail)
b r11

ENTRY(sys_rt_sigreturn)
mv r1, r7
50 changes: 12 additions & 38 deletions arch/lm32/kernel/process.c
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@
#include <asm/pgtable.h>

asmlinkage void ret_from_fork(void);
asmlinkage void ret_from_kernel_thread(void);
asmlinkage void syscall_tail(void);

struct thread_info* lm32_current_thread;
@@ -127,32 +128,6 @@ void show_regs(struct pt_regs *regs)
printk("%3s: 0x%lx\n", lm32_reg_names[i], reg[i]);
}

static void kernel_thread_helper(int (*fn)(void*), void* arg)
{
do_exit(fn(arg));
}

/*
* Create a kernel thread
*/
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
{
/* prepare registers from which a child task switch frame will be copied */
struct pt_regs regs;

set_fs(KERNEL_DS);

memset(&regs, 0, sizeof(regs));

//printk("kernel_thread fn=%x arg=%x regs=%x\n", fn, arg, &regs);

regs.r11 = (unsigned long)fn;
regs.r12 = (unsigned long)arg;
regs.r13 = (unsigned long)kernel_thread_helper;
regs.pt_mode = PT_MODE_KERNEL;
return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
}

void flush_thread(void)
{
}
@@ -169,24 +144,23 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
}

int copy_thread(unsigned long clone_flags,
unsigned long usp, unsigned long stk_size,
struct task_struct * p, struct pt_regs * regs)
unsigned long usp_thread_fn, unsigned long thread_fn_arg,
struct task_struct *p, struct pt_regs *unused)
{
unsigned long child_tos = KSTK_TOS(p);
struct pt_regs *childregs;
struct pt_regs *childregs = task_pt_regs(p);

if (!user_mode(regs)) {
if (p->flags & PF_KTHREAD) {
/* kernel thread */

if( usp != 0 )
panic("trying to start kernel thread with usp != 0");

/* childregs = full task switch frame on kernel stack of child */
childregs = (struct pt_regs *)(child_tos) - 1;
*childregs = *regs;
memset(childregs, 0, sizeof(childregs));
childregs->r11 = usp_thread_fn;
childregs->r12 = thread_fn_arg;
/* childregs = full task switch frame on kernel stack of child */

/* return via ret_from_fork */
childregs->ra = (unsigned long)ret_from_fork;
childregs->ra = (unsigned long)ret_from_kernel_thread;

/* setup ksp/usp */
p->thread.ksp = (unsigned long)childregs - 4; /* perhaps not necessary */
@@ -204,14 +178,14 @@ int copy_thread(unsigned long clone_flags,
/* childsyscallregs = full syscall frame on kernel stack of child */
childsyscallregs = (struct pt_regs *)(child_tos) - 1; /* 32 = safety */
/* child shall have same syscall context to restore as parent has ... */
*childsyscallregs = *regs;
*childsyscallregs = *current_pt_regs();

/* childregs = full task switch frame on kernel stack of child below * childsyscallregs */
childregs = childsyscallregs - 1;
memset(childregs, 0, sizeof(childregs));

/* user stack pointer is shared with the parent per definition of vfork */
p->thread.usp = usp;
p->thread.usp = usp_thread_fn;

/* kernel stack pointer is not shared with parent, it is the beginning of
* the just created new task switch segment on the kernel stack */
98 changes: 0 additions & 98 deletions arch/lm32/kernel/sys_lm32.c

This file was deleted.

6 changes: 3 additions & 3 deletions arch/lm32/platforms/milkymist/gpio.c
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ static int milkymist_gpio_direction_output(struct gpio_chip *gc,
return 0;
}

static int __devinit milkymist_gpio_probe(struct platform_device *ofdev)
static int milkymist_gpio_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct milkymist_gpio_chip *chip;
@@ -148,7 +148,7 @@ static int __devinit milkymist_gpio_probe(struct platform_device *ofdev)
return ret;
}

static int __devexit milkymist_gpio_remove(struct platform_device *ofdev)
static int milkymist_gpio_remove(struct platform_device *ofdev)
{
struct milkymist_gpio_chip *chip = platform_get_drvdata(ofdev);

@@ -173,7 +173,7 @@ static struct platform_driver milkymist_gpio_driver = {
.of_match_table = milkymist_gpio_match,
},
.probe = milkymist_gpio_probe,
.remove = __devexit_p(milkymist_gpio_remove),
.remove = milkymist_gpio_remove,
};

static int __init milkymist_gpio_init(void)
6 changes: 3 additions & 3 deletions drivers/input/keyboard/softusb.c
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@ printk(" ");
return IRQ_HANDLED;
}

static int __devinit softusb_probe(struct platform_device *pdev)
static int softusb_probe(struct platform_device *pdev)
{
struct input_dev *dev;
int i, nwords, err;
@@ -189,7 +189,7 @@ static int __devinit softusb_probe(struct platform_device *pdev)
return 0;
}

static int __devexit softusb_remove(struct platform_device *pdev)
static int softusb_remove(struct platform_device *pdev)
{
struct input_dev *dev = platform_get_drvdata(pdev);

@@ -207,7 +207,7 @@ static const struct of_device_id softusb_of_ids[] = {

static struct platform_driver softusb_driver = {
.probe = softusb_probe,
.remove = __devexit_p(softusb_remove),
.remove = softusb_remove,
.driver = {
.name = "softusb",
.of_match_table = softusb_of_ids,
6 changes: 3 additions & 3 deletions drivers/input/serio/milkbd.c
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ static void milkbd_close(struct serio *port)
* Allocate and initialize serio structure for subsequent registration
* with serio core.
*/
static int __devinit milkbd_probe(struct platform_device *dev)
static int milkbd_probe(struct platform_device *dev)
{
struct serio *serio;

@@ -105,7 +105,7 @@ static int __devinit milkbd_probe(struct platform_device *dev)
return 0;
}

static int __devexit milkbd_remove(struct platform_device *dev)
static int milkbd_remove(struct platform_device *dev)
{
struct serio *serio = platform_get_drvdata(dev);
serio_unregister_port(serio);
@@ -114,7 +114,7 @@ static int __devexit milkbd_remove(struct platform_device *dev)

static struct platform_driver milkbd_driver = {
.probe = milkbd_probe,
.remove = __devexit_p(milkbd_remove),
.remove = milkbd_remove,
.driver = {
.name = "milkbd",
},
6 changes: 3 additions & 3 deletions drivers/input/serio/milkmouse.c
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ static void milkmouse_close(struct serio *port)
* Allocate and initialize serio structure for subsequent registration
* with serio core.
*/
static int __devinit milkmouse_probe(struct platform_device *dev)
static int milkmouse_probe(struct platform_device *dev)
{
struct serio *serio;

@@ -105,7 +105,7 @@ static int __devinit milkmouse_probe(struct platform_device *dev)
return 0;
}

static int __devexit milkmouse_remove(struct platform_device *dev)
static int milkmouse_remove(struct platform_device *dev)
{
struct serio *serio = platform_get_drvdata(dev);
serio_unregister_port(serio);
@@ -114,7 +114,7 @@ static int __devexit milkmouse_remove(struct platform_device *dev)

static struct platform_driver milkmouse_driver = {
.probe = milkmouse_probe,
.remove = __devexit_p(milkmouse_remove),
.remove = milkmouse_remove,
.driver = {
.name = "milkmouse",
},
Loading