Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110079
b: refs/heads/master
c: 3d97776
h: refs/heads/master
i:
  110077: 9987fca
  110075: 5588fa8
  110071: 22a5196
  110063: 4553679
  110047: af0dff1
  110015: 71b4f73
  109951: 26fd908
  109823: 06cad18
  109567: f2cb472
v: v3
  • Loading branch information
Ralf Baechle authored and Bartlomiej Zolnierkiewicz committed Sep 27, 2008
1 parent 29057c1 commit 8578b17
Show file tree
Hide file tree
Showing 44 changed files with 439 additions and 330 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f873d5fb68a6aea9519c9cd613ddf4e7e2378d4
refs/heads/master: 3d977760b9478538821a75dd5eb74d0f2a2b01e3
78 changes: 78 additions & 0 deletions trunk/arch/arm/include/asm/cnt32_to_63.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* include/asm/cnt32_to_63.h -- extend a 32-bit counter to 63 bits
*
* Author: Nicolas Pitre
* Created: December 3, 2006
* Copyright: MontaVista Software, Inc.
*
* 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.
*/

#ifndef __INCLUDE_CNT32_TO_63_H__
#define __INCLUDE_CNT32_TO_63_H__

#include <linux/compiler.h>
#include <asm/types.h>
#include <asm/byteorder.h>

/*
* Prototype: u64 cnt32_to_63(u32 cnt)
* Many hardware clock counters are only 32 bits wide and therefore have
* a relatively short period making wrap-arounds rather frequent. This
* is a problem when implementing sched_clock() for example, where a 64-bit
* non-wrapping monotonic value is expected to be returned.
*
* To overcome that limitation, let's extend a 32-bit counter to 63 bits
* in a completely lock free fashion. Bits 0 to 31 of the clock are provided
* by the hardware while bits 32 to 62 are stored in memory. The top bit in
* memory is used to synchronize with the hardware clock half-period. When
* the top bit of both counters (hardware and in memory) differ then the
* memory is updated with a new value, incrementing it when the hardware
* counter wraps around.
*
* Because a word store in memory is atomic then the incremented value will
* always be in synch with the top bit indicating to any potential concurrent
* reader if the value in memory is up to date or not with regards to the
* needed increment. And any race in updating the value in memory is harmless
* as the same value would simply be stored more than once.
*
* The only restriction for the algorithm to work properly is that this
* code must be executed at least once per each half period of the 32-bit
* counter to properly update the state bit in memory. This is usually not a
* problem in practice, but if it is then a kernel timer could be scheduled
* to manage for this code to be executed often enough.
*
* Note that the top bit (bit 63) in the returned value should be considered
* as garbage. It is not cleared here because callers are likely to use a
* multiplier on the returned value which can get rid of the top bit
* implicitly by making the multiplier even, therefore saving on a runtime
* clear-bit instruction. Otherwise caller must remember to clear the top
* bit explicitly.
*/

/* this is used only to give gcc a clue about good code generation */
typedef union {
struct {
#if defined(__LITTLE_ENDIAN)
u32 lo, hi;
#elif defined(__BIG_ENDIAN)
u32 hi, lo;
#endif
};
u64 val;
} cnt32_to_63_t;

#define cnt32_to_63(cnt_lo) \
({ \
static volatile u32 __m_cnt_hi = 0; \
cnt32_to_63_t __x; \
__x.hi = __m_cnt_hi; \
__x.lo = (cnt_lo); \
if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \
__m_cnt_hi = __x.hi = (__x.hi ^ 0x80000000) + (__x.hi >> 31); \
__x.val; \
})

#endif
2 changes: 2 additions & 0 deletions trunk/arch/arm/kernel/kgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ int kgdb_arch_handle_exception(int exception_vector, int signo,
case 'D':
case 'k':
case 'c':
kgdb_contthread = NULL;

/*
* Try to read optional parameter, pc unchanged if no parm.
* If this was a compiled breakpoint, we need to move
Expand Down
10 changes: 9 additions & 1 deletion trunk/arch/m32r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ config MEMORY_SIZE
default "01000000" if PLAT_M32104UT
default "00800000" if PLAT_OAKS32R

config NOHIGHMEM
bool
default y

config ARCH_DISCONTIGMEM_ENABLE
bool "Internal RAM Support"
depends on CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104
Expand Down Expand Up @@ -406,7 +410,11 @@ config PCI_DIRECT
source "drivers/pci/Kconfig"

config ISA
bool
bool "ISA support"
help
Find out whether you have ISA slots on your motherboard. ISA is the
name of a bus system, i.e. the way the CPU talks to the other stuff
inside your box. If you have ISA, say Y, otherwise N.

source "drivers/pcmcia/Kconfig"

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m32r/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ ret_from_intr:
and3 r4, r4, #0x8000 ; check BSM bit
#endif
beqz r4, resume_kernel
resume_userspace:
ENTRY(resume_userspace)
DISABLE_INTERRUPTS(r4) ; make sure we don't miss an interrupt
; setting need_resched or sigpending
; between sampling and the iret
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/m32r/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ __INITDATA
.global _end
ENTRY(stext)
ENTRY(_stext)
ENTRY(startup_32)
/* Setup up the stack pointer */
LDIMM (r0, spi_stack_top)
LDIMM (r1, spu_stack_top)
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/m32r/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <linux/module.h>
#include <asm/uaccess.h>

atomic_t irq_err_count;
atomic_t irq_mis_count;

/*
* Generic, controller-independent functions:
*/
Expand Down Expand Up @@ -60,6 +63,9 @@ int show_interrupts(struct seq_file *p, void *v)
seq_putc(p, '\n');
skip:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
} else if (i == NR_IRQS) {
seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
}
return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/m32r/kernel/m32r_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <asm/delay.h>
#include <asm/irq.h>
#include <asm/tlbflush.h>
#include <asm/pgtable.h>

/* platform dependent support */
EXPORT_SYMBOL(boot_cpu_data);
Expand Down Expand Up @@ -66,7 +65,6 @@ EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(copy_page);
EXPORT_SYMBOL(clear_page);
EXPORT_SYMBOL(strlen);
EXPORT_SYMBOL(empty_zero_page);

EXPORT_SYMBOL(_inb);
EXPORT_SYMBOL(_inw);
Expand Down
30 changes: 28 additions & 2 deletions trunk/arch/m32r/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

#include <linux/err.h>

static int hlt_counter=0;

/*
* Return saved PC of a blocked thread.
*/
Expand All @@ -46,16 +48,31 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
/*
* Powermanagement idle function, if any..
*/
static void (*pm_idle)(void) = NULL;
void (*pm_idle)(void) = NULL;
EXPORT_SYMBOL(pm_idle);

void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL(pm_power_off);

void disable_hlt(void)
{
hlt_counter++;
}

EXPORT_SYMBOL(disable_hlt);

void enable_hlt(void)
{
hlt_counter--;
}

EXPORT_SYMBOL(enable_hlt);

/*
* We use this is we don't have any better
* idle routine..
*/
static void default_idle(void)
void default_idle(void)
{
/* M32R_FIXME: Please use "cpu_sleep" mode. */
cpu_relax();
Expand Down Expand Up @@ -243,6 +260,15 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long spu,
return 0;
}

/*
* Capture the user space registers if the task is not running (in user space)
*/
int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
{
/* M32R_FIXME */
return 1;
}

asmlinkage int sys_fork(unsigned long r0, unsigned long r1, unsigned long r2,
unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6,
struct pt_regs regs)
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/m32r/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void smp_send_timer(void);
void smp_ipi_timer_interrupt(struct pt_regs *);
void smp_local_timer_interrupt(void);

static void send_IPI_allbutself(int, int);
void send_IPI_allbutself(int, int);
static void send_IPI_mask(cpumask_t, int, int);
unsigned long send_IPI_mask_phys(cpumask_t, int, int);

Expand Down Expand Up @@ -722,7 +722,7 @@ void smp_local_timer_interrupt(void)
* ---------- --- --------------------------------------------------------
*
*==========================================================================*/
static void send_IPI_allbutself(int ipi_num, int try)
void send_IPI_allbutself(int ipi_num, int try)
{
cpumask_t cpumask;

Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/m32r/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <asm/hw_irq.h>

#ifdef CONFIG_SMP
extern void send_IPI_allbutself(int, int);
extern void smp_local_timer_interrupt(void);
#endif

Expand Down Expand Up @@ -187,7 +188,7 @@ static long last_rtc_update = 0;
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
*/
static irqreturn_t timer_interrupt(int irq, void *dev_id)
irqreturn_t timer_interrupt(int irq, void *dev_id)
{
#ifndef CONFIG_SMP
profile_tick(CPU_PROFILING);
Expand Down Expand Up @@ -227,7 +228,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}

static struct irqaction irq0 = {
struct irqaction irq0 = {
.handler = timer_interrupt,
.flags = IRQF_DISABLED,
.mask = CPU_MASK_NONE,
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/m32r/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extern unsigned long eit_vector[];
((unsigned long)func - (unsigned long)eit_vector - entry*4)/4 \
+ 0xff000000UL

static void set_eit_vector_entries(void)
void set_eit_vector_entries(void)
{
extern void default_eit_handler(void);
extern void system_call(void);
Expand Down Expand Up @@ -121,9 +121,9 @@ void __init trap_init(void)
cpu_init();
}

static int kstack_depth_to_print = 24;
int kstack_depth_to_print = 24;

static void show_trace(struct task_struct *task, unsigned long *stack)
void show_trace(struct task_struct *task, unsigned long *stack)
{
unsigned long addr;

Expand Down Expand Up @@ -224,7 +224,7 @@ static void show_registers(struct pt_regs *regs)
printk("\n");
}

static DEFINE_SPINLOCK(die_lock);
DEFINE_SPINLOCK(die_lock);

void die(const char * str, struct pt_regs * regs, long err)
{
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/m32r/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

#include <linux/param.h>
#include <linux/module.h>
#ifdef CONFIG_SMP
#include <linux/sched.h>
#include <asm/current.h>
Expand Down Expand Up @@ -122,4 +121,3 @@ void __ndelay(unsigned long nsecs)
{
__const_udelay(nsecs * 0x00005); /* 2**32 / 1000000000 (rounded up) */
}
EXPORT_SYMBOL(__ndelay);
4 changes: 2 additions & 2 deletions trunk/arch/mips/au1000/common/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void au1xxx_gpio2_write(unsigned gpio, int value)
{
gpio -= AU1XXX_GPIO_BASE;

gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio);
gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | (value << gpio);
}

static int au1xxx_gpio2_direction_input(unsigned gpio)
Expand All @@ -62,7 +62,7 @@ static int au1xxx_gpio2_direction_output(unsigned gpio, int value)
{
gpio -= AU1XXX_GPIO_BASE;
gpio2->dir |= 0x01 << gpio;
gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio);
gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | (value << gpio);
return 0;
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/mips/kernel/kgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ int kgdb_arch_handle_exception(int vector, int signo, int err_code,

atomic_set(&kgdb_cpu_doing_single_step, -1);
if (remcom_in_buffer[0] == 's')
atomic_set(&kgdb_cpu_doing_single_step, cpu);
if (kgdb_contthread)
atomic_set(&kgdb_cpu_doing_single_step, cpu);

return 0;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/mips/pci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ obj-$(CONFIG_SOC_TX3927) += ops-tx3927.o
obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o
obj-$(CONFIG_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o
obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o

#
# These are still pretty much in the old state, watch, go blind.
Expand Down
Loading

0 comments on commit 8578b17

Please sign in to comment.