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
base: 919c3d59ec3b
Choose a base ref
...
head repository: m-labs/linux-milkymist
compare: e7f8b2eb45d1
Choose a head ref
  • 15 commits
  • 11 files changed
  • 1 contributor

Commits on Feb 26, 2013

  1. lm32: Get rid of pm_idle

    This is currently unused and will be gone in upstream soon.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    64d30a6 View commit details
    Browse the repository at this point in the history
  2. lm32: Use _save_altstack helper

    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    b533446 View commit details
    Browse the repository at this point in the history
  3. lm32: switch to generic sys_sigaltstack

    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    a94271a View commit details
    Browse the repository at this point in the history
  4. lm32: sys_rt_sigreturn: Use current_pt_regs()

    Use current_pt_regs() to get a pointer to the registers of the current process.
    None of the syscalls expect a pointer to registers of the current process in r7
    anymore, so we can also get rid of that.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    d2374d9 View commit details
    Browse the repository at this point in the history
  5. lm32: Properly update stack pointer copy_thread()

    If we get a new stack pointer address for the new thread in copy_thread() we
    need to update the register set to the new stack address.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    fa7fba2 View commit details
    Browse the repository at this point in the history
  6. lm32: Don't clobber userspace stack during syscall

    We shouldn't use the userspace stack to backup the registers which we using
    during the early syscall code, this only works by chance.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    0a92396 View commit details
    Browse the repository at this point in the history
  7. lm32: Switch to kernel stack during interrupts

    Don't run the interrupt handlers on userspace stack, this is quite wrong and
    quite dangerous and may cause random process corruption. Instead switch to the
    kernel space stack as soon as we enter kernel space.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    fbc42a6 View commit details
    Browse the repository at this point in the history
  8. lm32: Simplify current_thread_info()

    Now that we are always on kernel stack in kernel mode we can calculate the
    current thread info address based on the stack pointer. The thread info is
    always stored at the lowest address of the kernel stack of a process.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    b1ea119 View commit details
    Browse the repository at this point in the history
  9. lm32: We are always on kernel stack in resume

    We are always on kernel stack now and always resume to kernel stack during a
    context switch. So there is no need to check on which stack we are.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    664ec9d View commit details
    Browse the repository at this point in the history
  10. lm32: Inline _{save,restore}_irq_frame

    There is really no point in having these as separate functions since there is
    only one invocation of them. And making them a macro aslo means we can reuse
    them in _{save,restore}_syscall_frame to get rid of some duplicated code.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    d5c38bd View commit details
    Browse the repository at this point in the history
  11. lm32: Remove usp field from thread_struct struct

    The usp is always stored in the sp field of the pt_regs of the process. No need
    to track it separately.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    c6e4d95 View commit details
    Browse the repository at this point in the history
  12. lm32: Simplify mode switching

    Whenever we enter kernel mode we'll switch to the kernel stack. We will always
    start at the bottom of the kernel stack, once we leave kernel mode we'll be at
    the bottom of the kernel stack again. Since we can calculate the kernel stack
    address based on the current thread_info address (current thread_info address is
    always at the lowest address of the kernel stack) we do not have to track the
    kernel stack address of a process separately. Also the which_stack field is
    redundant since we are always on kernel stack in kernel mode and always on user
    stack in user mode, so we can remove it altogether as well.
    
    Finally as a minor optimization put all the global variables used during mode
    switch in a common struct. This is for one quite cache friendly and we only have
    to load the address of the struct and can use relative addressing to access the
    members instead of loading the address of each global variable individually.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    50c3718 View commit details
    Browse the repository at this point in the history
  13. lm32: Save the process state in the thread_info struct

    Put the process state which is saved during process switching in the thread_info
    stack instead of on top of the stack. This has the advantage that we know where
    the registers are saved and don't need to track this, so we can finally get rid
    of the ksp field of the thread_struct struct. Also only save those registers
    which are callee saved. All other register will already be saved on previous
    stack frames. As a result copy_thread() also looks much nicer.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    52d0953 View commit details
    Browse the repository at this point in the history
  14. lm32: Cleanup start_thread()

    There is no need to call set_fs(USER_DS) in since start_thread() since this is
    already done in generic places. Also don't memset regs to 0 since some of the
    callers pass in preinitialized registers.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    9a504d6 View commit details
    Browse the repository at this point in the history
  15. lm32: Cleanup processor.h/process.c a bit

    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    larsclausen committed Feb 26, 2013
    Copy the full SHA
    e7f8b2e View commit details
    Browse the repository at this point in the history