PERFORCE change 38371 for review
Serguei Tzukanov
tzukanov at FreeBSD.org
Sun Sep 21 05:00:37 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=38371
Change 38371 by tzukanov at tzukanov_antares on 2003/09/21 05:00:29
Update s390 specific code to -current.
Use -fPIC instead -fpic for libraries (gcc silently generates incorrect code with -fpic).
rtld works.
Affected files ...
.. //depot/projects/s390/Makefile.inc1#18 edit
.. //depot/projects/s390/contrib/binutils/gas/config/tc-s390.c#5 edit
.. //depot/projects/s390/lib/libdisk/disk.c#9 edit
.. //depot/projects/s390/libexec/rtld-elf/s390/reloc.c#5 edit
.. //depot/projects/s390/libexec/rtld-elf/s390/rtld_machdep.h#3 edit
.. //depot/projects/s390/share/mk/bsd.lib.mk#6 edit
.. //depot/projects/s390/sys/s390/conf/GENERIC#10 edit
.. //depot/projects/s390/sys/s390/s390/autoconf.c#4 edit
.. //depot/projects/s390/sys/s390/s390/clock.c#5 edit
.. //depot/projects/s390/sys/s390/s390/db_disasm.c#3 edit
.. //depot/projects/s390/sys/s390/s390/db_hwatch.c#3 edit
.. //depot/projects/s390/sys/s390/s390/db_interface.c#3 edit
.. //depot/projects/s390/sys/s390/s390/db_trace.c#3 edit
.. //depot/projects/s390/sys/s390/s390/dump_machdep.c#3 edit
.. //depot/projects/s390/sys/s390/s390/ebcdic.c#3 edit
.. //depot/projects/s390/sys/s390/s390/external.c#4 edit
.. //depot/projects/s390/sys/s390/s390/genassym.c#5 edit
.. //depot/projects/s390/sys/s390/s390/machdep.c#10 edit
.. //depot/projects/s390/sys/s390/s390/pmap.c#15 edit
.. //depot/projects/s390/sys/s390/s390/skey.h#3 edit
.. //depot/projects/s390/sys/s390/s390/swtch.S#5 edit
.. //depot/projects/s390/sys/s390/s390/trap.c#10 edit
.. //depot/projects/s390/sys/s390/s390/vm_machdep.c#9 edit
.. //depot/projects/s390/usr.sbin/crunch/crunchide/exec_elf32.c#8 edit
Differences ...
==== //depot/projects/s390/Makefile.inc1#18 (text+ko) ====
@@ -733,8 +733,8 @@
.for _tool in \
bin/csh \
bin/sh \
+ ${_libopcodes} \
${_rescue} \
- ${_libopcodes} \
gnu/usr.bin/cc/cc_tools \
${_fortran} \
${_libkrb5} \
==== //depot/projects/s390/contrib/binutils/gas/config/tc-s390.c#5 (text+ko) ====
@@ -1375,9 +1375,9 @@
expression (&exp);
if (exp.X_op == O_constant)
{
- if ( ((opformat->oplen == 6) && (exp.X_op > 0) && (exp.X_op < (1ULL << 48)))
- || ((opformat->oplen == 4) && (exp.X_op > 0) && (exp.X_op < (1ULL << 32)))
- || ((opformat->oplen == 2) && (exp.X_op > 0) && (exp.X_op < (1ULL << 16))))
+ if ( ((opformat->oplen == 6) && (exp.X_op > 0))
+ || ((opformat->oplen == 4) && (exp.X_op > 0))
+ || ((opformat->oplen == 2) && (exp.X_op > 0)))
md_number_to_chars (insn, exp.X_add_number, opformat->oplen);
else
as_bad (_("Invalid .insn format\n"));
==== //depot/projects/s390/lib/libdisk/disk.c#9 (text+ko) ====
@@ -58,6 +58,10 @@
p_ppc
#elif defined(__amd64__)
p_amd64
+#elif defined(__s390x__)
+ p_s390x
+#elif defined(__s390__)
+ p_s390
#else
IHAVENOIDEA
#endif
==== //depot/projects/s390/libexec/rtld-elf/s390/reloc.c#5 (text+ko) ====
@@ -190,13 +190,12 @@
if (desc.action & _B)
value += (Elf_Addr)obj->relocbase;
- if (desc.action & _S) {
+ if (desc.action & (_S|_L)) {
defobj = NULL;
def = find_symdef(ELF_R_SYM(rela->r_info),
obj, &defobj, false, cache);
if (def == NULL)
return -1;
-
value += (Elf_Addr)(defobj->relocbase + def->st_value);
}
==== //depot/projects/s390/libexec/rtld-elf/s390/rtld_machdep.h#3 (text+ko) ====
@@ -31,6 +31,16 @@
#ifndef _RTLD_MACHDEP_H_
#define _RTLD_MACHDEP_H_
+#include <sys/types.h>
+#include <machine/atomic.h>
+
+/* What's the actual value of this G5/G6/z800/z900/z990? */
+#ifdef __s390x__
+#define CACHE_LINE_SIZE 128
+#else
+#define CACHE_LINE_SIZE 32
+#endif
+
struct Struct_Obj_Entry;
/* Return the address of the .dynamic section in the dynamic linker. */
@@ -44,11 +54,9 @@
const struct Struct_Obj_Entry *obj,
const Elf_Rel *rel)
{
- dbg("reloc_jmpslot: *%p = %p", (void *)(where),
- (void *)(target));
- *where = target;
+ *where = target + ((const Elf_Rela *)rel)->r_addend;
- return target;
+ return (*where);
}
#define make_function_pointer(def, defobj) \
@@ -57,43 +65,4 @@
#define call_initfini_pointer(obj, target) \
(((InitFunc)(target))())
-
-#define ATOMIC_CHANGE_32(V,OP) \
- int nv, pv; \
- \
- __asm volatile ( \
- " bcr 15, 0\n" \
- " l %[pv], 0(%[p])\n" \
- "1: lr %[nv], %[pv]\n" \
- " "OP" %[nv], %[v]\n" \
- " cs %[pv], %[nv], 0(%[p])\n" \
- " jnz 1b" \
- : [nv]"=&r"(nv), [pv]"=&r"(pv) \
- : [v]"r"(V), [p]"a"(p) \
- : "memory", "cc");
-
-static inline void
-atomic_decr_int(volatile int *p)
-{
- int one = 1;
-
- ATOMIC_CHANGE_32(one, "sr");
-}
-
-static inline void
-atomic_incr_int(volatile int *p)
-{
- int one = 1;
-
- ATOMIC_CHANGE_32(one, "ar");
-}
-
-static inline void
-atomic_add_int(volatile int *p, int v)
-{
- ATOMIC_CHANGE_32(v, "ar");
-}
-
-#undef ATOMIC_CHANGE_32
-
#endif /* !_RTLD_MACHDEP_H_ */
==== //depot/projects/s390/share/mk/bsd.lib.mk#6 (text+ko) ====
@@ -41,7 +41,8 @@
.SUFFIXES: .out .o .po .So .S .asm .s .c .cc .cpp .cxx .m .C .f .y .l .ln
.if !defined(PICFLAG)
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "s390" || \
+ ${MACHINE_ARCH} == "s390x"
PICFLAG=-fPIC
.else
PICFLAG=-fpic
==== //depot/projects/s390/sys/s390/conf/GENERIC#10 (text+ko) ====
@@ -37,14 +37,12 @@
options DIAGNOSTIC
options DEBUG_LOCKS
-options KTR
-options KTR_ENTRIES=8192
-options KTR_COMPILE=KTR_ALL
-#options KTR_MASK="(KTR_PMAP|KTR_TRAP|KTR_PROC|KTR_SIG|KTR_VM|KTR_SYSC|KTR_VOP|KTR_SMP)"
-#options KTR_MASK="(KTR_PMAP|KTR_SIG|KTR_PROC)"
-options KTR_MASK=0
-options KTR_CPUMASK=0x3
-options KTR_VERBOSE
+#options KTR
+#options KTR_ENTRIES=8192
+#options KTR_COMPILE=KTR_ALL
+#options KTR_MASK=0
+#options KTR_CPUMASK=0x3
+#options KTR_VERBOSE
#options SMP
==== //depot/projects/s390/sys/s390/s390/autoconf.c#4 (text+ko) ====
@@ -2,11 +2,10 @@
* S/390 and zSeries version.
*
* Copyright (c) 2002 Serguei Tzukanov.
- *
*/
#include <sys/cdefs.h>
-__FREEBSD("$FreeBSD: src/sys/s390/s390/autoconf.c,v 1.0 2002/08/01 23:51:16 tzukanov Exp $");
+__FBSDID("$FreeBSD: src/sys/s390/s390/autoconf.c,v 1.0 2002/08/01 23:51:16 tzukanov Exp $");
#include <sys/param.h>
#include <sys/systm.h>
==== //depot/projects/s390/sys/s390/s390/clock.c#5 (text+ko) ====
==== //depot/projects/s390/sys/s390/s390/db_disasm.c#3 (text+ko) ====
@@ -1,14 +1,12 @@
/*-
* DDB Disassembler both for S/390 and zSeries.
*
- * Copyright (c) 2002 Serguei Tzukanov.
- *
- * All rights reserved. Terms for use and redistribution
- * are covered by the BSD copyright as found in /usr/src/COPYRIGHT.
- *
- * $FreeBSD: src/sys/s390/s390/db_disasm.c,v 1.0 2002/07/01 23:51:16 tzukanov Exp $
+ * Copyright (c) 2002 Serguei Tzukanov. All rights reserved.
*/
+#include <sys/cdef.h>
+__FBSDID("$FreeBSD: src/sys/s390/s390/db_disasm.c,v 1.0 2002/07/01 23:51:16 tzukanov Exp $");
+
#include <sys/param.h>
#include <ddb/ddb.h>
#include <ddb/db_access.h>
==== //depot/projects/s390/sys/s390/s390/db_hwatch.c#3 (text+ko) ====
@@ -2,13 +2,11 @@
* Support for hardware watchpoint via PER 2.
*
* Copyright (c) 2002 Serguei Tzukanov.
- *
- * All rights reserved. Terms for use and redistribution
- * are covered by the BSD copyright as found in /usr/src/COPYRIGHT.
- *
- * $FreeBSD: src/sys/s390/s390/db_hwatch.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/s390/s390/db_hwatch.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $");
+
#include <sys/param.h>
#include <ddb/ddb.h>
#include <ddb/db_access.h>
==== //depot/projects/s390/sys/s390/s390/db_interface.c#3 (text+ko) ====
@@ -4,9 +4,11 @@
* All rights reserved. Terms for use and redistribution
* are covered by the BSD copyright as found in /usr/src/COPYRIGHT.
*
- * $FreeBSD: src/sys/s390/s390/db_interface.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/s390/s390/db_interface.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $");
+
#include <sys/param.h>
#include <ddb/ddb.h>
#include <ddb/db_access.h>
==== //depot/projects/s390/sys/s390/s390/db_trace.c#3 (text+ko) ====
@@ -2,13 +2,11 @@
* Support for stack tracing in DDB.
*
* Copyright (c) 2002 Serguei Tzukanov.
- *
- * All rights reserved. Terms for use and redistribution
- * are covered by the BSD copyright as found in /usr/src/COPYRIGHT.
- *
- * $FreeBSD: src/sys/s390/s390/db_trace.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/s390/s390/db_trace.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $");
+
#include <sys/param.h>
#include <ddb/ddb.h>
#include <ddb/db_access.h>
==== //depot/projects/s390/sys/s390/s390/dump_machdep.c#3 (text+ko) ====
@@ -31,10 +31,11 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/s390/s390/dump_machdep.c,v 1.0 2002/05/04 17:45:48 tzukanov Exp $
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/s390/s390/dump_machdep.c,v 1.0 2002/05/04 17:45:48 tzukanov Exp $");
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
==== //depot/projects/s390/sys/s390/s390/ebcdic.c#3 (text+ko) ====
@@ -1,15 +1,12 @@
/*-
* EBCDIC to ASCII and back. Shared between S/390 and z/Series ports.
- * Should I move this to libkern?
*
* Copyright (c) 2002 Serguei Tzukanov.
- *
- * All rights reserved. Terms for use and redistribution
- * are covered by the BSD copyright as found in /usr/src/COPYRIGHT.
- *
- * $FreeBSD: src/sys/s390/s390/ebcdic.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/s390/s390/ebcdic.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $");
+
#include <sys/param.h>
#include <sys/systm.h>
#include <s390/s390/ebcdic.h>
==== //depot/projects/s390/sys/s390/s390/external.c#4 (text+ko) ====
@@ -2,13 +2,11 @@
* S/390 and zSeries external interruption handling.
*
* Copyright (c) 2002 Serguei Tzukanov.
- *
- * All rights reserved. Terms for use and redistribution
- * are covered by the BSD copyright as found in /usr/src/COPYRIGHT.
- *
- * $FreeBSD: src/sys/s390/s390/external.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/s390/s390/external.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $");
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
==== //depot/projects/s390/sys/s390/s390/genassym.c#5 (text+ko) ====
@@ -1,14 +1,12 @@
/*-
* Symbols for assembler code.
*
- * Copyright (c) 2002 Serguei Tzukanov.
- *
- * All rights reserved. Terms for use and redistribution
- * are covered by the BSD copyright as found in /usr/src/COPYRIGHT.
- *
- * $FreeBSD: src/sys/s390/s390/genassym.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $
+ * Copyright (c) 2002 Serguei Tzukanov. All rights reserved.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/s390/s390/genassym.c,v 1.0 2002/04/01 23:51:16 tzukanov Exp $");
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/assym.h>
==== //depot/projects/s390/sys/s390/s390/machdep.c#10 (text+ko) ====
@@ -85,6 +85,7 @@
#include <vm/vm_pager.h>
#include <vm/vm_extern.h>
#include <ddb/ddb.h>
+#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/reg.h>
@@ -200,7 +201,9 @@
/* Enable DAT. */
dat_init();
+
#ifndef __s390x__
+ /* Reserve space for machine check exception. */
sysarea.pcpu += EXTENDED_SAVE_AREA_SIZE;
#endif
@@ -308,7 +311,7 @@
/* Old FreeBSD-style arguments. */
tf->tf_gpr[3] = code;
}
- mtx_unlock(&psp->ms_mtx);
+ mtx_unlock(&psp->ps_mtx);
PROC_UNLOCK(p);
/* Copy the sigframe out to the user's stack. */
@@ -329,7 +332,7 @@
* Build siginfo_t for SA thread
*/
void
-cpu_thread_siginfo(int sig, u_long code, siginfo_t si)
+cpu_thread_siginfo(int sig, u_long code, siginfo_t *si)
{
/* No SA on S/390 yet. */
}
==== //depot/projects/s390/sys/s390/s390/pmap.c#15 (text+ko) ====
@@ -175,7 +175,7 @@
virtual_avail += n * PAGE_SIZE;
- return pa;
+ return (pa);
}
void
@@ -190,10 +190,10 @@
/* Find out the size of physical memory. */
psw_define(&sysarea.program_new_psw, PSW_0, (u_long)&&last_page);
- skey_set(0, SKEY_READWRITE);
+ sk_set(0, SK_RW);
avail_end = PAGE_SIZE;
while(tprot(avail_end)) {
- skey_set(avail_end, SKEY_READWRITE);
+ sk_set(avail_end, SK_RW);
avail_end += PAGE_SIZE;
}
@@ -299,7 +299,7 @@
CTR3(KTR_PMAP, "pmap_ptepa: pmap = %p, va = %x, pte = %x", pmap, va, pte);
- return pte;
+ return (pte);
}
static void
@@ -392,9 +392,9 @@
vm_page_free(mpte);
cnt.v_wire_count--;
}
- return 1;
+ return (1);
}
- return 0;
+ return (0);
}
static int
@@ -403,9 +403,11 @@
CTR3(KTR_PMAP, "pmap_unuse_ptp: pmap = %p, va = %x, mpte = %x", pmap, va, mpte);
if (pmap == kernel_pmap)
- return 0;
+ return (0);
if (mpte == NULL) {
+ vm_offset_t ptepa;
+
ptepa = pmap->pm_sto[VA_SX(va)];
mpte = PHYS_TO_VM_PAGE(ptepa);
KASSERT(mpte != NULL, ("pmap_unuse_ptp: mpte == NULL"));
@@ -445,7 +447,7 @@
TAILQ_REMOVE(&pmap->pm_pvlist, pv, pv_plist);
pv_free(pv);
}
- return rv;
+ return (rv);
}
static void
@@ -539,7 +541,7 @@
vm_page_unlock_queues();
VM_OBJECT_UNLOCK(pmap->pm_pteobj);
- return mpte;
+ return (mpte);
}
static vm_page_t
@@ -593,7 +595,7 @@
return pmap_unuse_ptp(pmap, va, NULL);
}
- return 0;
+ return (0);
}
static void *
@@ -626,7 +628,7 @@
{
CTR3(KTR_PMAP, "pmap_addr_hint: object = %p, va = %x, size = %u", object, va, size);
- return va;
+ return (va);
}
void
@@ -658,7 +660,7 @@
CTR1(KTR_PMAP, "pmap_clear_modify: pa = %x", pa);
- skey_set(pa, skey_get(pa) & ~SKEY_CHANGE);
+ sk_set(pa, sk_get(pa) & ~SK_C);
}
void
@@ -747,9 +749,6 @@
/* If we are setting page read-write. */
if (prot & VM_PROT_WRITE) {
- skey_set(opa, SKEY_READWRITE |
- (skey_get(opa) & SKEY_REFERENCE));
-
if (pte_readonly(opte)) {
opte &= ~PTE_PROTECTION;
ipte(ptepa);
@@ -810,13 +809,62 @@
vm_page_t
pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t mpte)
{
+ vm_paddr_t ptepa;
+ pte_t opte, pte;
+
+ KASSERT(va < VM_MAX_ADDRESS,
+ ("%s: va is too big", __func__));
+
+ /* Get a pte page or allocate it. */
+ if (pmap != kernel_pmap) {
+ unsigned int ptpindex;
+
+ ptpindex = VA_SX(va) >> 2;
+ if ((mpte != NULL) && (mpte->pindex == ptpindex)) {
+ mpte->hold_count++;
+ } else {
+ mpte = pmap_get_pte(pmap, va);
+ }
+ } else {
+ mpte = NULL;
+ }
+
+ ptepa = pmap_ptepa(pmap, va);
+ opte = lura(ptepa);
+ if ((opte & PTE_INVALID) == 0) {
+ if (mpte != NULL) {
+ vm_page_lock_queues();
+ pmap_unwire_pte_hold(pmap, mpte);
+ vm_page_unlock_queues();
+ }
+ return (NULL);
+ }
+
+ pte = VM_PAGE_TO_PHYS(m);
+
+ /* Enter on the pv list if part of our managed memory. */
+ if (pmap_initialized &&
+ ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)) {
+ pmap_insert_entry(pmap, va, mpte, m);
+ pte |= PTE_MANAGED;
+ }
+
+ /* Increment counters. */
+ pmap->pm_stats.resident_count++;
+
+ stura(ptepa, pte | PTE_PROTECTION);
+
+ return (mpte);
}
vm_paddr_t
pmap_extract(pmap_t pmap, vm_offset_t va)
{
- vm_paddr_t ptepa = pmap_ptepa(pmap, va);
- pte_t pte = lura(ptepa);
+ vm_paddr_t ptepa;
+ pte_t pte;
+
+ ptepa = pmap_ptepa(pmap, va);
+ pte = lura(ptepa);
if (pte_valid(pte))
return (PTE_PFRA(pte) + VA_BX(va));
@@ -824,6 +872,26 @@
return (0);
}
+vm_page_t
+pmap_extract_and_hold(pmap_t pmap, vm_offset_t va)
+{
+ vm_paddr_t pa;
+ vm_page_t m;
+
+ m = NULL;
+ mtx_lock(&Giant);
+ pa = pmap_extract(pmap, va);
+ if (pa != 0) {
+ m = PHYS_TO_VM_PAGE(pa);
+ vm_page_lock_queues();
+ vm_page_hold(m);
+ vm_page_unlock_queues();
+ }
+ mtx_unlock(&Giant);
+
+ return (m);
+}
+
void
pmap_growkernel(vm_offset_t va)
{
@@ -881,7 +949,7 @@
if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
return FALSE;
- return (skey_get(pa) & SKEY_CHANGE) ? TRUE : FALSE;
+ return (sk_get(pa) & SK_C) ? TRUE : FALSE;
}
void
@@ -927,7 +995,7 @@
pmap_kenter(va, spa);
*vap = va;
- return sva;
+ return (sva);
}
int
@@ -941,11 +1009,11 @@
pte = lura(pmap_ptepa(pmap, va));
if (!pte_valid(pte))
- return 0;
+ return (0);
rv = MINCORE_INCORE;
if (!pte_managed(pte));
- return rv;
+ return (rv);
m = PHYS_TO_VM_PAGE(pte);
@@ -958,13 +1026,12 @@
vm_page_flag_set(m, PG_REFERENCED);
}
- return rv;
+ return (rv);
}
void
-pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,
- vm_object_t object, vm_pindex_t pindex, vm_offset_t size,
- int pagelimit)
+pmap_object_init_pt(pmap_t pmap, vm_offset_t va,
+ vm_object_t object, vm_pindex_t pindex, vm_offset_t size)
{
/* optional */
}
@@ -987,7 +1054,7 @@
if (++loops >= 16)
break;
}
- return FALSE;
+ return (FALSE);
}
void
@@ -995,16 +1062,16 @@
{
vm_offset_t pa = VM_PAGE_TO_PHYS(m);
+panic("GGGG: %s", __func__);
CTR2(KTR_PMAP, "pmap_page_protect: pa = %x, prot = %d", pa, prot);
KASSERT((prot == VM_PROT_READ) || (prot == VM_PROT_NONE),
("pmap_page_protect: unexpected prot"));
if (prot & VM_PROT_READ) {
- int skey = skey_get(pa);
- if (skey & SKEY_CHANGE)
+ int sk = sk_get(pa);
+ if (sk & SK_C)
vm_page_dirty(m);
- skey_set(pa, SKEY_READONLY | (skey & SKEY_REFERENCE));
} else if (prot == VM_PROT_NONE) {
pmap_remove_all(m);
}
@@ -1025,6 +1092,7 @@
if (pmap->pm_pteobj == NULL)
pmap->pm_pteobj = vm_object_allocate(OBJT_DEFAULT, NPTP + 1);
+ VM_OBJECT_LOCK(pmap->pm_pteobj);
stpg = vm_page_grab(pmap->pm_pteobj, NPTP,
VM_ALLOC_NORMAL | VM_ALLOC_RETRY |
VM_ALLOC_WIRED);
@@ -1032,6 +1100,7 @@
vm_page_flag_clear(stpg, PG_BUSY);
stpg->valid = VM_PAGE_BITS_ALL;
vm_page_unlock_queues();
+ VM_OBJECT_UNLOCK(pmap->pm_pteobj);
pmap_kenter((vm_offset_t)pmap->pm_sto, VM_PAGE_TO_PHYS(stpg));
for (i = 0; i < 4*NPTP; i++)
@@ -1268,7 +1337,7 @@
"1:"
: [rv]"+r"(rv) : [pa]"r"(pa) : "r0", "cc");
- return rv;
+ return (rv);
}
void
==== //depot/projects/s390/sys/s390/s390/skey.h#3 (text+ko) ====
@@ -13,30 +13,30 @@
#define _ESA_SKEY_H_
/* Keep this in sync with PSW_KEY (src/sys/{s390|s390x}/include/psw.h). */
-#define SKEY_READONLY 0xe0
-#define SKEY_READWRITE 0xf0
+#define SK_RO 0xe0
+#define SK_RW 0xf0
-#define SKEY_CHANGE 0x04
-#define SKEY_REFERENCE 0x02
+#define SK_C 0x04
+#define SK_R 0x02
static __inline int
-skey_get(vm_offset_t pa)
+sk_get(vm_offset_t pa)
{
- int skey = 0;
+ int sk = 0;
__asm volatile (
- " iske %[skey],%[pa]"
- : [skey]"+r"(skey) : [pa]"r"(pa));
+ " iske %[sk],%[pa]"
+ : [sk]"+r"(sk) : [pa]"r"(pa));
- return skey;
+ return sk;
}
static __inline void
-skey_set(vm_offset_t pa, int skey)
+sk_set(vm_offset_t pa, int sk)
{
__asm volatile (
- " sske %[skey],%[pa]"
- :: [skey]"r"(skey), [pa]"r"(pa) : "memory");
+ " sske %[sk],%[pa]"
+ :: [sk]"r"(sk), [pa]"r"(pa) : "memory");
}
#endif /* !_ESA_SKEY_H_ */
==== //depot/projects/s390/sys/s390/s390/swtch.S#5 (text+ko) ====
@@ -13,28 +13,20 @@
#include "assym.s"
-/* void cpu_throw(void) */
+/* void cpu_throw(struct thread *old, struct thread *new) */
ENTRY(cpu_throw)
xr %r2, %r2
- j .Lchoose
+ j .Lrestore
-/* void cpu_switch(void) */
+/* void cpu_switch(struct thread *old, struct thread *new) */
ENTRY(cpu_switch)
l %r5, PSA_PCPU
- l %r2, PC_CURTHREAD(%r5)
ltr %r2, %r2
- jz .Lchoose
+ jz .Lrestore
/* Mark current pmap inactive. */
l %r1, TD_PROC(%r2)
l %r1, P_VMSPACE(%r1)
-#if 0
- l %r3, PC_CPUMASK(%r5)
- lnr %r3, %r3
- l %r4, VM_PMAP + PM_ACTIVE(%r1)
- nr %r4, %r3
- st %r4, VM_PMAP + PM_ACTIVE(%r1)
-#endif
xc VM_PMAP + PM_ACTIVE(4, %r1), PC_CPUMASK(%r5)
/* Save current context. */
@@ -67,21 +59,14 @@
std %f15, 132 + PCB_FPR(%r1)
#endif
- /* Get new thread. */
-.Lchoose:
- lr %r6, %r2
- SETUP_BASE(%r13)
- CALL(choosethread)
- l %r1, TD_PCB(%r2)
+.Lrestore:
+ /* Set up new kernel stack pointer. */
+ l %r1, TD_PCB(%r3)
st %r1, PSA_KSP
-#if 0
- cr %r6, %r2
- je .Ldontload
-#endif
/* Store new curthread. */
l %r5, PSA_PCPU
- st %r2, PC_CURTHREAD(%r5)
+ st %r3, PC_CURTHREAD(%r5)
/* Setup secondary STD. */
lctl %c7, %c7, PCB_CR7(%r1)
@@ -92,8 +77,8 @@
spm %r0
/* Mark new pmap active. */
- l %r3, TD_PROC(%r2)
- l %r4, P_VMSPACE(%r3)
+ l %r2, TD_PROC(%r3)
+ l %r4, P_VMSPACE(%r2)
oc VM_PMAP + PM_ACTIVE(4, %r4), PC_CPUMASK(%r5)
/* Argument 0 for func in cpu_set_fork_handler. */
@@ -101,7 +86,6 @@
br %r14
-.Ldontload:
lm %r13, %r14, 4*(13-6) + PCB_GPR6(%r1)
br %r14
==== //depot/projects/s390/sys/s390/s390/trap.c#10 (text+ko) ====
==== //depot/projects/s390/sys/s390/s390/vm_machdep.c#9 (text+ko) ====
@@ -57,8 +57,10 @@
#include <sys/vmmeter.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
+#include <sys/mbuf.h>
#include <sys/mutex.h>
#include <sys/smp.h>
+#include <sys/socketvar.h>
#include <sys/sysctl.h>
#include <sys/unistd.h>
#include <sys/user.h>
@@ -74,6 +76,9 @@
#include <machine/pcb.h>
#include <s390/s390/dat.h>
+static void sf_buf_init(void *arg);
+SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL);
+
void
cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
{
@@ -152,7 +157,6 @@
{
td->td_pcb = (struct pcb *)(td->td_kstack + KSTACK_BYTES) - 1;
td->td_frame = (struct trapframe *)td->td_pcb - 1;
- td->td_pcb->pcb_ext = 0;
}
void
@@ -161,10 +165,10 @@
struct trapframe *tf;
struct pcb *pcb;
- CTR2(KTR_PROC, "cpu_set_upcall: td = %p, pcb0 = %p", td, pcb0);
+ CTR2(KTR_PROC, "cpu_set_upcall: td = %p, pcb0 = %p", td, td0->td_pcb);
pcb = td->td_pcb;
- bcopy(td0->pcb, pcb, sizeof(*pcb));
+ bcopy(td0->td_pcb, pcb, sizeof(*pcb));
td->td_frame = tf = (struct trapframe *)pcb - 1;
@@ -202,6 +206,7 @@
struct sf_buf *
sf_buf_alloc(struct vm_page *m)
{
+ return NULL;
}
void
==== //depot/projects/s390/usr.sbin/crunch/crunchide/exec_elf32.c#8 (text+ko) ====
@@ -172,6 +172,10 @@
#define EM_X86_64 62
#endif
case EM_X86_64: break;
+#ifndef EM_S390
+#define EM_S390 22
+#endif
+ case EM_S390: break;
/* ELFDEFNNAME(MACHDEP_ID_CASES) */
default:
More information about the p4-projects
mailing list