summaryrefslogtreecommitdiff
path: root/sys/arch/hppa64
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2011-11-14 14:29:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2011-11-14 14:29:58 +0000
commit5c7adf0fd80829573beaee8f3cd97c8e9817ebd0 (patch)
treefc473f9157ec8660d021879adeec6f2fc1c1c79e /sys/arch/hppa64
parent4479e991875585089291f68488b1c9fe94ef4a35 (diff)
merge various differences between hppa and hppa64
ok jsing
Diffstat (limited to 'sys/arch/hppa64')
-rw-r--r--sys/arch/hppa64/include/atomic.h21
-rw-r--r--sys/arch/hppa64/include/bus.h31
-rw-r--r--sys/arch/hppa64/include/conf.h4
-rw-r--r--sys/arch/hppa64/include/db_machdep.h4
-rw-r--r--sys/arch/hppa64/include/intr.h41
-rw-r--r--sys/arch/hppa64/include/spinlock.h4
-rw-r--r--sys/arch/hppa64/include/vmparam.h26
7 files changed, 77 insertions, 54 deletions
diff --git a/sys/arch/hppa64/include/atomic.h b/sys/arch/hppa64/include/atomic.h
index bb4a8e244c8..9a02d9e0d05 100644
--- a/sys/arch/hppa64/include/atomic.h
+++ b/sys/arch/hppa64/include/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.4 2011/03/23 16:54:35 pirofti Exp $ */
+/* $OpenBSD: atomic.h,v 1.5 2011/11/14 14:29:57 deraadt Exp $ */
/* Public Domain */
@@ -7,6 +7,17 @@
#if defined(_KERNEL)
+#include <sys/mutex.h>
+
+#ifdef MULTIPROCESSOR
+extern struct mutex mtx_atomic;
+#define ATOMIC_LOCK mtx_enter(&mtx_atomic)
+#define ATOMIC_UNLOCK mtx_leave(&mtx_atomic)
+#else
+#define ATOMIC_LOCK
+#define ATOMIC_UNLOCK
+#endif
+
static __inline void
atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
{
@@ -14,7 +25,9 @@ atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
__asm __volatile("mfctl %%cr15, %0": "=r" (eiem));
__asm __volatile("mtctl %r0, %cr15");
+ ATOMIC_LOCK;
*uip |= v;
+ ATOMIC_UNLOCK;
__asm __volatile("mtctl %0, %%cr15":: "r" (eiem));
}
@@ -25,7 +38,9 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
__asm __volatile("mfctl %%cr15, %0": "=r" (eiem));
__asm __volatile("mtctl %r0, %cr15");
+ ATOMIC_LOCK;
*uip &= ~v;
+ ATOMIC_UNLOCK;
__asm __volatile("mtctl %0, %%cr15":: "r" (eiem));
}
@@ -36,7 +51,9 @@ atomic_setbits_long(__volatile unsigned long *uip, unsigned long v)
__asm __volatile("mfctl %%cr15, %0": "=r" (eiem));
__asm __volatile("mtctl %r0, %cr15");
+ ATOMIC_LOCK;
*uip |= v;
+ ATOMIC_UNLOCK;
__asm __volatile("mtctl %0, %%cr15":: "r" (eiem));
}
@@ -47,7 +64,9 @@ atomic_clearbits_long(__volatile unsigned long *uip, unsigned long v)
__asm __volatile("mfctl %%cr15, %0": "=r" (eiem));
__asm __volatile("mtctl %r0, %cr15");
+ ATOMIC_LOCK;
*uip &= ~v;
+ ATOMIC_UNLOCK;
__asm __volatile("mtctl %0, %%cr15":: "r" (eiem));
}
diff --git a/sys/arch/hppa64/include/bus.h b/sys/arch/hppa64/include/bus.h
index f2bc61ae1a2..269829998e8 100644
--- a/sys/arch/hppa64/include/bus.h
+++ b/sys/arch/hppa64/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.5 2009/07/30 21:39:54 miod Exp $ */
+/* $OpenBSD: bus.h,v 1.6 2011/11/14 14:29:57 deraadt Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -30,17 +30,17 @@ typedef u_long bus_space_handle_t;
struct hppa64_bus_space_tag {
void *hbt_cookie;
- int (*hbt_map)(void *v, bus_addr_t addr, bus_size_t size,
+ int (*hbt_map)(void *v, bus_addr_t addr, bus_size_t size,
int flags, bus_space_handle_t *bshp);
- void (*hbt_unmap)(void *v, bus_space_handle_t bsh, bus_size_t size);
- int (*hbt_subregion)(void *v, bus_space_handle_t bsh,
+ void (*hbt_unmap)(void *v, bus_space_handle_t bsh, bus_size_t size);
+ int (*hbt_subregion)(void *v, bus_space_handle_t bsh,
bus_size_t offset, bus_size_t size,
bus_space_handle_t *nbshp);
- int (*hbt_alloc)(void *v, bus_addr_t rstart, bus_addr_t rend,
+ int (*hbt_alloc)(void *v, bus_addr_t rstart, bus_addr_t rend,
bus_size_t size, bus_size_t align, bus_size_t boundary,
int flags, bus_addr_t *addrp, bus_space_handle_t *bshp);
- void (*hbt_free)(void *, bus_space_handle_t, bus_size_t);
- void (*hbt_barrier)(void *v, bus_space_handle_t h,
+ void (*hbt_free)(void *, bus_space_handle_t, bus_size_t);
+ void (*hbt_barrier)(void *v, bus_space_handle_t h,
bus_size_t o, bus_size_t l, int op);
void *(*hbt_vaddr)(void *v, bus_space_handle_t h);
@@ -166,14 +166,6 @@ typedef struct hppa64_bus_space_tag *bus_space_tag_t;
#define bus_space_free(t,h,c) \
(((t)->hbt_free)((t)->hbt_cookie,(h),(c)))
-#define BUS_SPACE_BARRIER_READ 0x01
-#define BUS_SPACE_BARRIER_WRITE 0x02
-
-#define bus_space_barrier(t,h,o,l,op) \
- ((t)->hbt_barrier((t)->hbt_cookie, (h), (o), (l), (op)))
-#define bus_space_vaddr(t,h) \
- ((t)->hbt_vaddr((t)->hbt_cookie, (h)))
-
#define bus_space_read_1(t,h,o) (((t)->hbt_r1)((t)->hbt_cookie,(h),(o)))
#define bus_space_read_2(t,h,o) (((t)->hbt_r2)((t)->hbt_cookie,(h),(o)))
#define bus_space_read_4(t,h,o) (((t)->hbt_r4)((t)->hbt_cookie,(h),(o)))
@@ -274,6 +266,15 @@ typedef struct hppa64_bus_space_tag *bus_space_tag_t;
(((t)->hbt_cp_4)((t)->hbt_cookie, (h1), (o1), (h2), (o2), (c)))
#define bus_space_copy_8(t, h1, o1, h2, o2, c) \
(((t)->hbt_cp_8)((t)->hbt_cookie, (h1), (o1), (h2), (o2), (c)))
+
+#define BUS_SPACE_BARRIER_READ 0x01
+#define BUS_SPACE_BARRIER_WRITE 0x02
+
+#define bus_space_barrier(t,h,o,l,op) \
+ ((t)->hbt_barrier((t)->hbt_cookie, (h), (o), (l), (op)))
+#define bus_space_vaddr(t,h) \
+ ((t)->hbt_vaddr((t)->hbt_cookie, (h)))
+
#define BUS_DMA_WAITOK 0x0000 /* safe to sleep (pseudo-flag) */
#define BUS_DMA_NOWAIT 0x0001 /* not safe to sleep */
#define BUS_DMA_ALLOCNOW 0x0002 /* perform resource allocation now */
diff --git a/sys/arch/hppa64/include/conf.h b/sys/arch/hppa64/include/conf.h
index cbe367c02f5..45287a35f69 100644
--- a/sys/arch/hppa64/include/conf.h
+++ b/sys/arch/hppa64/include/conf.h
@@ -1,7 +1,7 @@
-/* $OpenBSD: conf.h,v 1.1 2005/04/01 10:40:48 mickey Exp $ */
+/* $OpenBSD: conf.h,v 1.2 2011/11/14 14:29:57 deraadt Exp $ */
/*
- * Copyright (c) 2005 Michael Shalayeff
+ * Copyright (c) 1998-2005 Michael Shalayeff
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software for any
diff --git a/sys/arch/hppa64/include/db_machdep.h b/sys/arch/hppa64/include/db_machdep.h
index 4f374e14a0a..aab311e5081 100644
--- a/sys/arch/hppa64/include/db_machdep.h
+++ b/sys/arch/hppa64/include/db_machdep.h
@@ -1,7 +1,7 @@
-/* $OpenBSD: db_machdep.h,v 1.2 2010/11/27 19:57:23 miod Exp $ */
+/* $OpenBSD: db_machdep.h,v 1.3 2011/11/14 14:29:57 deraadt Exp $ */
/*
- * Copyright (c) 2005 Michael Shalayeff
+ * Copyright (c) 1998-2005 Michael Shalayeff
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software for any
diff --git a/sys/arch/hppa64/include/intr.h b/sys/arch/hppa64/include/intr.h
index 0dc9a7ffec9..f4007111df5 100644
--- a/sys/arch/hppa64/include/intr.h
+++ b/sys/arch/hppa64/include/intr.h
@@ -17,29 +17,28 @@
#ifndef _MACHINE_INTR_H_
#define _MACHINE_INTR_H_
-#define CPU_NINTS 64
+#define CPU_NINTS 64
+#define NIPL 12
-#define NIPL 12
+#define IPL_NONE 0
+#define IPL_SOFTCLOCK 1
+#define IPL_SOFTNET 2
+#define IPL_BIO 3
+#define IPL_NET 4
+#define IPL_SOFTTTY 5
+#define IPL_TTY 6
+#define IPL_VM 7
+#define IPL_AUDIO 8
+#define IPL_CLOCK 9
+#define IPL_STATCLOCK 10
+#define IPL_SCHED 10
+#define IPL_HIGH 10
+#define IPL_IPI 11
-#define IPL_NONE 0
-#define IPL_SOFTCLOCK 1
-#define IPL_SOFTNET 2
-#define IPL_BIO 3
-#define IPL_NET 4
-#define IPL_SOFTTTY 5
-#define IPL_TTY 6
-#define IPL_VM 7
-#define IPL_AUDIO 8
-#define IPL_CLOCK 9
-#define IPL_STATCLOCK 10
-#define IPL_SCHED 10
-#define IPL_HIGH 10
-#define IPL_IPI 11
-
-#define IST_NONE 0
-#define IST_PULSE 1
-#define IST_EDGE 2
-#define IST_LEVEL 3
+#define IST_NONE 0
+#define IST_PULSE 1
+#define IST_EDGE 2
+#define IST_LEVEL 3
#define SOFTINT_MASK ((1 << (IPL_SOFTCLOCK - 1)) | \
(1 << (IPL_SOFTNET - 1)) | (1 << (IPL_SOFTTTY - 1)))
diff --git a/sys/arch/hppa64/include/spinlock.h b/sys/arch/hppa64/include/spinlock.h
index d9e362736c5..613d06300df 100644
--- a/sys/arch/hppa64/include/spinlock.h
+++ b/sys/arch/hppa64/include/spinlock.h
@@ -1,10 +1,10 @@
-/* $OpenBSD: spinlock.h,v 1.1 2005/04/01 10:40:48 mickey Exp $ */
+/* $OpenBSD: spinlock.h,v 1.2 2011/11/14 14:29:57 deraadt Exp $ */
#ifndef _MACHINE_SPINLOCK_H_
#define _MACHINE_SPINLOCK_H_
#define _SPINLOCK_UNLOCKED (1)
#define _SPINLOCK_LOCKED (0)
-typedef long _spinlock_lock_t;
+typedef long _spinlock_lock_t __attribute__((__aligned__(16)));
#endif
diff --git a/sys/arch/hppa64/include/vmparam.h b/sys/arch/hppa64/include/vmparam.h
index 16f8d796767..a6d03e4ebe3 100644
--- a/sys/arch/hppa64/include/vmparam.h
+++ b/sys/arch/hppa64/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.6 2011/05/30 22:25:21 oga Exp $ */
+/* $OpenBSD: vmparam.h,v 1.7 2011/11/14 14:29:57 deraadt Exp $ */
/*
* Copyright (c) 1988-1994, The University of Utah and
@@ -41,28 +41,28 @@
* Virtual memory related constants, all in bytes
*/
#ifndef MAXTSIZ
-#define MAXTSIZ (64*1024*1024) /* max text size */
+#define MAXTSIZ (64*1024*1024UL) /* max text size */
#endif
#ifndef DFLDSIZ
#define DFLDSIZ (16*1024*1024) /* initial data size limit */
#endif
#ifndef MAXDSIZ
-#define MAXDSIZ (1*1024*1024*1024) /* max data size */
+#define MAXDSIZ (1*1024*1024*1024UL) /* max data size */
#endif
#ifndef BRKSIZ
#define BRKSIZ MAXDSIZ /* heap gap size */
#endif
#ifndef DFLSSIZ
-#define DFLSSIZ (512*1024) /* initial stack size limit */
+#define DFLSSIZ (2*1024*1024) /* initial stack size limit */
#endif
#ifndef MAXSSIZ
-#define MAXSSIZ (32*1024*1024) /* max stack size */
+#define MAXSSIZ (128*1024*1024UL) /* max stack size */
#endif
#define STACKGAP_RANDOM 256*1024
#ifndef USRIOSIZE
-#define USRIOSIZE ((2*HPPA_PGALIAS)/PAGE_SIZE) /* 2mb */
+#define USRIOSIZE ((2*HPPA_PGALIAS)/PAGE_SIZE) /* 8mb */
#endif
/*
@@ -73,11 +73,16 @@
#define SHMMAXPGS 8192 /* 32mb */
#endif
-#define VM_MIN_ADDRESS (0UL)
-#define VM_MAXUSER_ADDRESS (0x20000000000UL)
+/* user/kernel map constants */
+#define VM_MIN_ADDRESS ((vaddr_t)0)
+#define VM_MAXUSER_ADDRESS ((vaddr_t)0x20000000000UL)
#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
-#define VM_MIN_KERNEL_ADDRESS (0x1000000000UL)
-#define VM_MAX_KERNEL_ADDRESS (0x10f0000000UL)
+#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0x1000000000UL)
+#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0x10f0000000UL)
+
+/* use a small range for PIE to minimize mmap pressure */
+#define VM_PIE_MIN_ADDR PAGE_SIZE
+#define VM_PIE_MAX_ADDR 0x40000UL
/* virtual sizes (bytes) for various kernel submaps */
#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
@@ -92,7 +97,6 @@
#include <sys/lock.h>
#define __HAVE_VM_PAGE_MD
-
struct pv_entry;
struct vm_page_md {
struct simplelock pvh_lock; /* locks every pv on this list */