Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6:
  parisc: export length of os_hpmc vector
  parisc: fix kernel crash (protection id trap) when compiling ruby1.9
  parisc: Use DEFINE_SPINLOCK
  parisc: add uevent helper for parisc bus
  parisc: fix ipv6 checksum
  parisc: quiet palo not-found message from "which"
  parisc: Replace NR_CPUS in parisc code
  parisc: trivial fixes
  parisc: fix braino in commit adding __space_to_prot
  parisc: factor out sid to protid conversion
  parisc: use leX_to_cpu in place of __fswabX
  parisc: fix GFP_KERNEL use while atomic in unwinder
  parisc: remove dead BIO_VMERGE_BOUNDARY and BIO_VMERGE_MAX_SIZE definitions
  parisc: set_time() catch errors
  parisc: use the new byteorder headers
  parisc: drivers/parisc/: make code static
  parisc: lib/: make code static
  • Loading branch information
torvalds committed Jan 9, 2009
2 parents d9e8a3a + ae16489 commit 29a41e9
Show file tree
Hide file tree
Showing 31 changed files with 191 additions and 173 deletions.
2 changes: 1 addition & 1 deletion arch/parisc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ libs-y += arch/parisc/lib/ `$(CC) -print-libgcc-file-name`

drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/

PALO := $(shell if which palo; then : ; \
PALO := $(shell if (which palo 2>&1); then : ; \
elif [ -x /sbin/palo ]; then echo /sbin/palo; \
fi)

Expand Down
37 changes: 12 additions & 25 deletions arch/parisc/include/asm/byteorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
#include <asm/types.h>
#include <linux/compiler.h>

#ifdef __GNUC__
#define __BIG_ENDIAN
#define __SWAB_64_THRU_32__

static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
{
__asm__("dep %0, 15, 8, %0\n\t" /* deposit 00ab -> 0bab */
"shd %%r0, %0, 8, %0" /* shift 000000ab -> 00ba */
: "=r" (x)
: "0" (x));
return x;
}
#define __arch_swab16 __arch_swab16

static __inline__ __attribute_const__ __u32 ___arch__swab24(__u32 x)
static inline __attribute_const__ __u32 __arch_swab24(__u32 x)
{
__asm__("shd %0, %0, 8, %0\n\t" /* shift xabcxabc -> cxab */
"dep %0, 15, 8, %0\n\t" /* deposit cxab -> cbab */
Expand All @@ -25,7 +27,7 @@ static __inline__ __attribute_const__ __u32 ___arch__swab24(__u32 x)
return x;
}

static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
{
unsigned int temp;
__asm__("shd %0, %0, 16, %1\n\t" /* shift abcdabcd -> cdab */
Expand All @@ -35,7 +37,7 @@ static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
: "0" (x));
return x;
}

#define __arch_swab32 __arch_swab32

#if BITS_PER_LONG > 32
/*
Expand All @@ -48,7 +50,8 @@ static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
** HSHR 67452301 -> *6*4*2*0 into %0
** OR %0 | %1 -> 76543210 into %0 (all done!)
*/
static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x) {
static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
{
__u64 temp;
__asm__("permh,3210 %0, %0\n\t"
"hshl %0, 8, %1\n\t"
Expand All @@ -58,25 +61,9 @@ static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x) {
: "0" (x));
return x;
}
#define __arch__swab64(x) ___arch__swab64(x)
#define __BYTEORDER_HAS_U64__
#elif !defined(__STRICT_ANSI__)
static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x)
{
__u32 t1 = ___arch__swab32((__u32) x);
__u32 t2 = ___arch__swab32((__u32) (x >> 32));
return (((__u64) t1 << 32) | t2);
}
#define __arch__swab64(x) ___arch__swab64(x)
#define __BYTEORDER_HAS_U64__
#endif

#define __arch__swab16(x) ___arch__swab16(x)
#define __arch__swab24(x) ___arch__swab24(x)
#define __arch__swab32(x) ___arch__swab32(x)

#endif /* __GNUC__ */
#define __arch_swab64 __arch_swab64
#endif /* BITS_PER_LONG > 32 */

#include <linux/byteorder/big_endian.h>
#include <linux/byteorder.h>

#endif /* _PARISC_BYTEORDER_H */
2 changes: 1 addition & 1 deletion arch/parisc/include/asm/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
#endif
: "=r" (sum), "=r" (saddr), "=r" (daddr), "=r" (len)
: "0" (sum), "1" (saddr), "2" (daddr), "3" (len), "r" (proto)
: "r19", "r20", "r21", "r22");
: "r19", "r20", "r21", "r22", "memory");
return csum_fold(sum);
}

Expand Down
12 changes: 3 additions & 9 deletions arch/parisc/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
#include <linux/types.h>
#include <asm/pgtable.h>

extern unsigned long parisc_vmerge_boundary;
extern unsigned long parisc_vmerge_max_size;

#define BIO_VMERGE_BOUNDARY parisc_vmerge_boundary
#define BIO_VMERGE_MAX_SIZE parisc_vmerge_max_size

#define virt_to_phys(a) ((unsigned long)__pa(a))
#define phys_to_virt(a) __va(a)
#define virt_to_bus virt_to_phys
Expand Down Expand Up @@ -182,9 +176,9 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add

/* readb can never be const, so use __fswab instead of le*_to_cpu */
#define readb(addr) __raw_readb(addr)
#define readw(addr) __fswab16(__raw_readw(addr))
#define readl(addr) __fswab32(__raw_readl(addr))
#define readq(addr) __fswab64(__raw_readq(addr))
#define readw(addr) le16_to_cpu(__raw_readw(addr))
#define readl(addr) le32_to_cpu(__raw_readl(addr))
#define readq(addr) le64_to_cpu(__raw_readq(addr))
#define writeb(b, addr) __raw_writeb(b, addr)
#define writew(b, addr) __raw_writew(cpu_to_le16(b), addr)
#define writel(b, addr) __raw_writel(cpu_to_le32(b), addr)
Expand Down
13 changes: 9 additions & 4 deletions arch/parisc/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,21 @@ destroy_context(struct mm_struct *mm)
mm->context = 0;
}

static inline void load_context(mm_context_t context)
static inline unsigned long __space_to_prot(mm_context_t context)
{
mtsp(context, 3);
#if SPACEID_SHIFT == 0
mtctl(context << 1,8);
return context << 1;
#else
mtctl(context >> (SPACEID_SHIFT - 1),8);
return context >> (SPACEID_SHIFT - 1);
#endif
}

static inline void load_context(mm_context_t context)
{
mtsp(context, 3);
mtctl(__space_to_prot(context), 8);
}

static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
{

Expand Down
4 changes: 2 additions & 2 deletions arch/parisc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <asm/ptrace.h>
#include <asm/types.h>
#include <asm/system.h>
#include <asm/percpu.h>
#endif /* __ASSEMBLY__ */

#define KERNEL_STACK_SIZE (4*PAGE_SIZE)
Expand Down Expand Up @@ -109,8 +110,7 @@ struct cpuinfo_parisc {
};

extern struct system_cpuinfo_parisc boot_cpu_data;
extern struct cpuinfo_parisc cpu_data[NR_CPUS];
#define current_cpu_data cpu_data[smp_processor_id()]
DECLARE_PER_CPU(struct cpuinfo_parisc, cpu_data);

#define CPU_HVERSION ((boot_cpu_data.hversion >> 4) & 0x0FFF)

Expand Down
2 changes: 2 additions & 0 deletions arch/parisc/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,6 @@ unsigned long copy_in_user(void __user *dst, const void __user *src, unsigned lo
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user

int fixup_exception(struct pt_regs *regs);

#endif /* __PARISC_UACCESS_H */
40 changes: 34 additions & 6 deletions arch/parisc/kernel/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,38 @@ static int parisc_generic_match(struct device *dev, struct device_driver *drv)
return match_device(to_parisc_driver(drv), to_parisc_device(dev));
}

static ssize_t make_modalias(struct device *dev, char *buf)
{
const struct parisc_device *padev = to_parisc_device(dev);
const struct parisc_device_id *id = &padev->id;

return sprintf(buf, "parisc:t%02Xhv%04Xrev%02Xsv%08X\n",
(u8)id->hw_type, (u16)id->hversion, (u8)id->hversion_rev,
(u32)id->sversion);
}

static int parisc_uevent(struct device *dev, struct kobj_uevent_env *env)
{
const struct parisc_device *padev;
char modalias[40];

if (!dev)
return -ENODEV;

padev = to_parisc_device(dev);
if (!padev)
return -ENODEV;

if (add_uevent_var(env, "PARISC_NAME=%s", padev->name))
return -ENOMEM;

make_modalias(dev, modalias);
if (add_uevent_var(env, "MODALIAS=%s", modalias))
return -ENOMEM;

return 0;
}

#define pa_dev_attr(name, field, format_string) \
static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \
{ \
Expand All @@ -566,12 +598,7 @@ pa_dev_attr_id(sversion, "0x%05x\n");

static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
{
struct parisc_device *padev = to_parisc_device(dev);
struct parisc_device_id *id = &padev->id;

return sprintf(buf, "parisc:t%02Xhv%04Xrev%02Xsv%08X\n",
(u8)id->hw_type, (u16)id->hversion, (u8)id->hversion_rev,
(u32)id->sversion);
return make_modalias(dev, buf);
}

static struct device_attribute parisc_device_attrs[] = {
Expand All @@ -587,6 +614,7 @@ static struct device_attribute parisc_device_attrs[] = {
struct bus_type parisc_bus_type = {
.name = "parisc",
.match = parisc_generic_match,
.uevent = parisc_uevent,
.dev_attrs = parisc_device_attrs,
.probe = parisc_driver_probe,
.remove = parisc_driver_remove,
Expand Down
8 changes: 7 additions & 1 deletion arch/parisc/kernel/hpmc.S
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ END(hpmc_pim_data)

.import intr_save, code
ENTRY(os_hpmc)
.os_hpmc:

/*
* registers modified:
Expand Down Expand Up @@ -295,5 +296,10 @@ os_hpmc_6:
b .
nop
ENDPROC(os_hpmc)
ENTRY(os_hpmc_end) /* this label used to compute os_hpmc checksum */
.os_hpmc_end:
nop
.data
.align 4
.export os_hpmc_size
os_hpmc_size:
.word .os_hpmc_end-.os_hpmc
11 changes: 6 additions & 5 deletions arch/parisc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ unsigned long txn_affinity_addr(unsigned int irq, int cpu)
irq_desc[irq].affinity = cpumask_of_cpu(cpu);
#endif

return cpu_data[cpu].txn_addr;
return per_cpu(cpu_data, cpu).txn_addr;
}


Expand All @@ -309,8 +309,9 @@ unsigned long txn_alloc_addr(unsigned int virt_irq)
next_cpu++; /* assign to "next" CPU we want this bugger on */

/* validate entry */
while ((next_cpu < NR_CPUS) && (!cpu_data[next_cpu].txn_addr ||
!cpu_online(next_cpu)))
while ((next_cpu < NR_CPUS) &&
(!per_cpu(cpu_data, next_cpu).txn_addr ||
!cpu_online(next_cpu)))
next_cpu++;

if (next_cpu >= NR_CPUS)
Expand Down Expand Up @@ -359,7 +360,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
printk(KERN_DEBUG "redirecting irq %d from CPU %d to %d\n",
irq, smp_processor_id(), cpu);
gsc_writel(irq + CPU_IRQ_BASE,
cpu_data[cpu].hpa);
per_cpu(cpu_data, cpu).hpa);
goto set_out;
}
#endif
Expand Down Expand Up @@ -421,5 +422,5 @@ void __init init_IRQ(void)

void ack_bad_irq(unsigned int irq)
{
printk("unexpected IRQ %d\n", irq);
printk(KERN_WARNING "unexpected IRQ %d\n", irq);
}
2 changes: 1 addition & 1 deletion arch/parisc/kernel/pdc_cons.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <linux/tty.h>
#include <asm/pdc.h> /* for iodc_call() proto and friends */

static spinlock_t pdc_console_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(pdc_console_lock);

static void pdc_console_write(struct console *co, const char *s, unsigned count)
{
Expand Down
4 changes: 2 additions & 2 deletions arch/parisc/kernel/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,9 @@ static int __init perf_init(void)
spin_lock_init(&perf_lock);

/* TODO: this only lets us access the first cpu.. what to do for SMP? */
cpu_device = cpu_data[0].dev;
cpu_device = per_cpu(cpu_data, 0).dev;
printk("Performance monitoring counters enabled for %s\n",
cpu_data[0].dev->name);
per_cpu(cpu_data, 0).dev->name);

return 0;
}
Expand Down
Loading

0 comments on commit 29a41e9

Please sign in to comment.