Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Apr 2003 10:02:01 -0700 (PDT)
From:      Serguei Tzukanov <tzukanov@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 29703 for review
Message-ID:  <200304251702.h3PH21MM040942@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=29703

Change 29703 by tzukanov@tzukanov_antares on 2003/04/25 10:01:21

	Rewrite boot memory allocator to use linker sets.

Affected files ...

.. //depot/projects/s390/sys/conf/files.s390#4 edit
.. //depot/projects/s390/sys/dev/dasd/dasd.c#2 edit
.. //depot/projects/s390/sys/dev/mts/mts.c#2 edit
.. //depot/projects/s390/sys/s390/css/css.c#2 edit
.. //depot/projects/s390/sys/s390/css/css.h#2 edit
.. //depot/projects/s390/sys/s390/css/css_VM.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_bio.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_blinders.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_bus.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_chpath.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_cio.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_cold.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_debug.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_dynamic.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_if.m#2 edit
.. //depot/projects/s390/sys/s390/css/css_interrupt.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_mbuf.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_memory.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_monitor.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_private.h#2 edit
.. //depot/projects/s390/sys/s390/css/css_request.c#2 edit
.. //depot/projects/s390/sys/s390/css/css_subch.c#2 edit
.. //depot/projects/s390/sys/s390/s390/clock.c#3 edit
.. //depot/projects/s390/sys/s390/s390/dat.h#3 edit
.. //depot/projects/s390/sys/s390/s390/esa.h#2 edit
.. //depot/projects/s390/sys/s390/s390/external.c#2 edit
.. //depot/projects/s390/sys/s390/s390/hmcsc.c#7 edit
.. //depot/projects/s390/sys/s390/s390/identcpu.c#4 edit
.. //depot/projects/s390/sys/s390/s390/machdep.c#7 edit
.. //depot/projects/s390/sys/s390/s390/mcheck.c#2 edit
.. //depot/projects/s390/sys/s390/s390/mcheck.h#2 edit
.. //depot/projects/s390/sys/s390/s390/mem.c#5 edit
.. //depot/projects/s390/sys/s390/s390/pmap.c#11 edit

Differences ...

==== //depot/projects/s390/sys/conf/files.s390#4 (text+ko) ====

@@ -45,8 +45,10 @@
 libkern/udivdi3.c		standard
 libkern/umoddi3.c		standard
 
+#s390/css/css.c			standard
+#s390/css/css_VM.c		standard
 #s390/css/css_bio.c		standard
-#s390/css/css_blinders.c	standard
+#s390/css/css_blinders.c		standard
 #s390/css/css_bus.c		standard
 #s390/css/css_chpath.c		standard
 #s390/css/css_cio.c		standard
@@ -59,8 +61,6 @@
 #s390/css/css_monitor.c		standard
 #s390/css/css_request.c		standard
 #s390/css/css_subch.c		standard
-#s390/css/css_VM.c		standard
-#s390/css/css.c			standard
 
 s390/s390/autoconf.c		standard
 s390/s390/clock.c		standard

==== //depot/projects/s390/sys/dev/dasd/dasd.c#2 (text+ko) ====

@@ -24,7 +24,10 @@
 MTX_SYSINIT(classes_mutex, &classes_mutex, "classes mutex", MTX_DEF);
 
 static __inline struct dasd *
-dasd_softc(dev_t dev) { return (struct dasd *)dev->si_drv1; }
+dasd_softc(dev_t dev)
+{
+	return (struct dasd *)dev->si_drv1;
+}
 
 static int
 dasd_release(struct dasd *dasd)

==== //depot/projects/s390/sys/dev/mts/mts.c#2 (text+ko) ====

@@ -242,7 +242,7 @@
 	struct css_ccw cp[1];
 
 	css_define_request(&req, cp, 1, ip, 0xff, mts_callback,
-			   CSS_REQ_SYNC|CSS_DER_DEFAULT);
+			   CSS_REQ_SYNC | CSS_DER_DEFAULT);
 	css_define_request_ccw(cp, NULL, cmd, 0, 0, 0);
 	return css_start_request(&req);
 }

==== //depot/projects/s390/sys/s390/css/css.c#2 (text+ko) ====

@@ -12,10 +12,13 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
+/* This variable reflects stage of startup */
 int css_cold = 1;
+
+/* Number of kicked subchannels */
 volatile int css_init_counter;
 
 static __inline void
@@ -47,9 +50,9 @@
 	struct css_subchannel *subch;
 	int subchno, devno, error;
 
-	css_cold_init();
-	css_mcheck_init();
-	css_subch_init();
+	css_init_cold();
+	css_init_dynamic();
+	css_init_subchannels();
 
 	for (subchno = 0; subchno < SUBCHNO_MAX; subchno++) {
 		error = css_probe_subchannel(subchno, &devno);
@@ -91,7 +94,7 @@
  * Print (possible deprecated/incomplete) info about attached subchannels.
  */
 void
-css_startup_print_subchannels(void)
+css_init_info(void)
 {
 	struct css_subchannel *subch;
 

==== //depot/projects/s390/sys/s390/css/css.h#2 (text+ko) ====

@@ -197,21 +197,34 @@
 	uint8_t		sense[32];	/* Extended-Control Word actually */
 };
 
+/* Sense-ID Information Block. */
+struct css_sense_id {
+        uint8_t        xFF;
+        uint16_t       cu_type;
+        uint8_t        cu_model;
+        uint16_t       dev_type;
+        uint8_t        dev_model;
+        uint8_t        reserved;
+        struct css_ciw ciw[3];          /* (256 - 8) / 4 = 62 */
+} __attribute__ ((packed));
+
 /*----------------------------------------------------------------------------*
- * Exported implementtion specific data structures                            *
+ * Exported implementation specific data structures                            *
  *----------------------------------------------------------------------------*/
 
+struct bio;
+
 /* Drivers don't need to know internals of subchannel structure. */
 struct css_subchannel;
 struct css_request;
 
-/* "Probe" analogue in the css_cold = 1 time. */
+/* "Probe" analogue during css_cold = 1 time. */
 struct css_cold_find_info {
-	uint8_t  mask;		/* Validity mask for other fields. */
+	uint16_t mask;		/* Validity mask for other fields. */
+	uint8_t  cu_model;
+	uint8_t  dev_model;
 	uint16_t cu_type;
-	uint8_t  cu_model;
 	uint16_t dev_type;
-	uint8_t  dev_model;
 	uint16_t dev_number;
 };
 
@@ -323,20 +336,28 @@
 }
 
 static __inline u_int css_sense_id_cut_dt(struct css_sense_id *sense_id)
-{ return ((u_int)sense_id->cu_type << 16) | (u_int)sense_id->dev_type; }
+{
+	return ((u_int)sense_id->cu_type << 16) | (u_int)sense_id->dev_type;
+}
 
 static __inline u_int css_sense_id_cut_cum(struct css_sense_id *sense_id)
-{ return ((u_int)sense_id->cu_type << 8) | (u_int)sense_id->cu_model; }
+{
+	return ((u_int)sense_id->cu_type << 8) | (u_int)sense_id->cu_model;
+}
 
 static __inline u_int css_sense_id_dt_dm(struct css_sense_id *sense_id)
-{ return ((u_int)sense_id->dev_type << 8) | (u_int)sense_id->dev_model; }
+{
+	return ((u_int)sense_id->dev_type << 8) | (u_int)sense_id->dev_model;
+}
 
 /*----------------------------------------------------------------------------*
  * Bus related inlines                                                        *
  *----------------------------------------------------------------------------*/
 
 static __inline struct css_subchannel *css_dev2subch(device_t dev)
-{ return (struct css_subchannel *)device_get_ivars(dev); }
+{
+	return (struct css_subchannel *)device_get_ivars(dev);
+}
 
 #define CSS_IVAR_SUBCHNO	0
 #define CSS_IVAR_DEVNO		1

==== //depot/projects/s390/sys/s390/css/css_VM.c#2 (text+ko) ====

@@ -11,8 +11,8 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 /*
  * Use DIAGNOSE 210 call to build fake Sense-ID data to

==== //depot/projects/s390/sys/s390/css/css_bio.c#2 (text+ko) ====

@@ -12,8 +12,8 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 /*
  * It's assumed that sva is mapped above 2 GB.
@@ -57,6 +57,7 @@
 #else
 		    (atop(lra(sva)) != pi))
 			return trunc_page(sva);
+#endif
 	}
 
 	return eva;

==== //depot/projects/s390/sys/s390/css/css_blinders.c#2 (text+ko) ====

@@ -20,8 +20,8 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 #define BLINDERS_MAX	((DEVNO_MAX + NBLO - 1) / NBLO)
 
@@ -154,7 +154,7 @@
 			if ((l < 0) || (r >= DEVNO_MAX) || (l > r))
 				return EINVAL;
 			may_be_spaces(&s);
-			if ((*s != ',') && (*s != '\0))
+			if ((*s != ',') && (*s != '\0'))
 				return EINVAL;
 			if (action) {
 				if (add) {

==== //depot/projects/s390/sys/s390/css/css_bus.c#2 (text+ko) ====

@@ -17,8 +17,8 @@
 #include <sys/bus.h>
 #include <machine/bus.h>
 #include <sys/rman.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 device_t css_bus;
 

==== //depot/projects/s390/sys/s390/css/css_chpath.c#2 (text+ko) ====

@@ -11,9 +11,10 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
+#if notyet
 int
 css_generate_pgid(struct css_pgid *pgid)
 {
@@ -30,3 +31,4 @@
 		     css_completion_t completion)
 {
 }
+#endif

==== //depot/projects/s390/sys/s390/css/css_cio.c#2 (text+ko) ====

@@ -11,8 +11,8 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 static void
 css_sense_callback(struct css_request *sense_req)
@@ -95,7 +95,7 @@
 	css_unlock_subchannel(subch);
 	if (sense_id == NULL) {
 		sense_id = css_any_malloc(sizeof(*sense_id),
-					  M_CSS, M_WAITOK|M_ZERO);
+					  M_CSS, M_WAITOK | M_ZERO);
 		css_lock_subchannel(subch);
 		subch->sense_id = sense_id;
 		css_unlock_subchannel(subch);

==== //depot/projects/s390/sys/s390/css/css_cold.c#2 (text+ko) ====

@@ -17,8 +17,8 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 static __inline int
 css_cfi_compare(struct css_subchannel *subch,

==== //depot/projects/s390/sys/s390/css/css_debug.c#2 (text+ko) ====

@@ -11,8 +11,8 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 static char *
 bitstring(int n, void *p, char *s)

==== //depot/projects/s390/sys/s390/css/css_dynamic.c#2 (text+ko) ====

@@ -11,9 +11,9 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <esa/mcheck.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/s390/mcheck.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 /*
  * Reconfiguration is relatively rare operation, so I decided to use
@@ -259,7 +259,7 @@
  * This is called from css_startup().
  */
 void
-css_reconf_init(void)
+css_init_dynamic(void)
 {
 	/*
 	 * By registering before scan for available

==== //depot/projects/s390/sys/s390/css/css_if.m#2 (text+ko) ====


==== //depot/projects/s390/sys/s390/css/css_interrupt.c#2 (text+ko) ====

@@ -12,16 +12,16 @@
 /*
  * Subchannel's ithread run with I/O interruptions disabled on local CPU.
  * That way we can efficiently use TPI to reduce number of context switches
- * in case of heavy I/O and still can be preempted.
+ * in case of heavy I/O and still be preempted by timer.
  */
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/interrupt.h>
 #include <sys/proc.h>
-#include <esa/esa.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/s390/esa.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 static void
 css_interruption_handler(void *arg)
@@ -49,6 +49,8 @@
 	KASSERT(subch->flags & SUBCH_VALID,
 		("css_callback: subch not enabled"));
 
+
+	for (;;) {
 		valid_sc = scsw_valid_sc[irb.scsw.mask & SCSW_SC];
 
 		if (css_monitor & CSS_MONITOR_DCTM)
@@ -63,6 +65,7 @@
 		case SCSW_SC_AS|SCSW_SC_PS|SCSW_SC_IS:
 		case SCSW_SC_AS|SCSW_SC_SS:
 
+		/* */
 		if ((irb.scsw.mask & SCSW_SC_SP) == 0) {
 		}
 
@@ -78,7 +81,7 @@
 
 		if (do_callback) {
 			if (alert_status) {
-			if (!csense
+			if (!csense)
 		}
 	}
 
@@ -89,10 +92,11 @@
 	cc = tpi(0);
 	if ()
 		continue;
+
 }
 
 void
-css_interruption(void)
+io_intr(void)
 {
 	struct css_subchannel *subch;
 	struct css_ioic *ioic;

==== //depot/projects/s390/sys/s390/css/css_mbuf.c#2 (text+ko) ====

@@ -12,8 +12,8 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 int
 css_mbuf2cp(struct mbuf *);

==== //depot/projects/s390/sys/s390/css/css_memory.c#2 (text+ko) ====

@@ -16,8 +16,8 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 MALLOC_DEFINE(M_CSS, "css", "Memory used for channel subsystem layer");
 

==== //depot/projects/s390/sys/s390/css/css_monitor.c#2 (text+ko) ====

@@ -11,8 +11,8 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 #define CSS_MONITOR_MB		
 #define CSS_MONITOR_DCTM	
@@ -23,7 +23,6 @@
 void
 css_monitor_startup()
 {
-	css_malloc_contig();
 }
 
 

==== //depot/projects/s390/sys/s390/css/css_private.h#2 (text+ko) ====

@@ -119,17 +119,6 @@
 	uint16_t count;
 };
 
-/* Sense-ID Information Block. */
-struct css_sense_id {
-	uint8_t        xFF;
-	uint16_t       cu_type;
-	uint8_t        cu_model;
-	uint16_t       dev_type;
-	uint8_t        dev_model;
-	uint8_t        reserved;
-	struct css_ciw ciw[3];		/* (256 - 8) / 4 = 62 */
-} __attribute__ ((packed));
-
 /* Horrible name. */
 struct css_vrdc {
 	uint16_t vrdc_dvno;	/* Virtual device number */
@@ -465,10 +454,14 @@
  *----------------------------------------------------------------------------*/
 
 static __inline void css_lock_subch_dir(void)
-{ mtx_lock_spin(&subch_dir_lock); }
+{
+	mtx_lock_spin(&subch_dir_lock);
+}
 
 static __inline void css_unlock_subch_dir(void)
-{ mtx_unlock_spin(&subch_dir_lock); }
+{
+	mtx_unlock_spin(&subch_dir_lock);
+}
 
 /*
  * Get a pointer to wanted subchannel if it
@@ -507,9 +500,13 @@
 }
 
 static __inline void css_set_bit(u_long *bitmap, int n)
-{ atomic_set_long(&bitmap[n >> L2NBLO], 1 << (n & (NBLO-1))); }
+{
+	atomic_set_long(&bitmap[n >> L2NBLO], 1 << (n & (NBLO-1)));
+}
 
 static __inline void css_clear_bit(u_long *bitmap, int n)
-{ atomic_clear_long(&bitmap[n >> L2NBLO], 1 << (n & (NBLO-1))); }
+{
+	atomic_clear_long(&bitmap[n >> L2NBLO], 1 << (n & (NBLO-1)));
+}
 
 #endif /* !_CSS_CSS_PRIVATE_H_ */

==== //depot/projects/s390/sys/s390/css/css_request.c#2 (text+ko) ====

@@ -11,8 +11,8 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 static MALLOC_DEFINE(M_CSSREQ);
 
@@ -78,7 +78,7 @@
 	if (req->flags & CSS_REQ_INITIAL)
 		orb->mask1 |= ORB_I;
 	orb->lpm = (req->lpm == 0) ? subch->pathmask : req->lpm;
-	orb->mask2 = ORB_L|ORB_X;
+	orb->mask2 = ORB_L | ORB_X;
 	orb->cpa = lra(req->cp);
 }
 
@@ -290,9 +290,13 @@
 	}
 
 	if (error && (subch->toh == NULL) && !css_cold)
-		subch->toh = timeout(css_request_timeout, req, timeout);
+		req->toh = timeout(css_restart_request_timeout, req, req->restart_to);
 
+	if (req->flags & CSS_REQ_SYNC)
+		css_sleep();
 	css_unlock_subchannel(subch);
+
+	return error;
 }
 
 int
@@ -302,6 +306,14 @@
 }
 
 void
+css_restart_request_timeout(void *arg)
+{
+	css_lock_subchannel(subch);
+	
+	css_unlock_subchannel(subch);
+}
+
+void
 css_request_timeout(void *arg)
 {
 	struct css_request *req = (struct css_request *)arg;

==== //depot/projects/s390/sys/s390/css/css_subch.c#2 (text+ko) ====

@@ -11,8 +11,8 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <css/css.h>
-#include <css/css_private.h>
+#include <s390/css/css.h>
+#include <s390/css/css_private.h>
 
 #define NSCPP		(PAGE_SIZE/sizeof(void *))
 #define NSCPP_SHIFT	(PAGE_SHIFT - L2NBLO)
@@ -30,10 +30,14 @@
 CTASSERT(sizeof(struct css_subchannel_page) == PAGE_SIZE);
 
 static __inline void css_lock_free_subchannels(void)
-{ mtx_lock(&free_subchannels_mutex); }
+{
+	mtx_lock(&free_subchannels_mutex);
+}
 
 static __inline void css_unlock_free_subchannels(void)
-{ mtx_unlock(&free_subchannels_mutex); }
+{
+	mtx_unlock(&free_subchannels_mutex);
+}
 
 /*
  * Allocate memory for subchannel, initialize fields and insert into
@@ -332,7 +336,7 @@
 }
 
 void
-css_subch_init(void)
+css_init_subchannels(void)
 {
 	mtx_init(&free_subchannels_mutex, "free subchannels", NULL, MTX_DEF);
 	mtx_init(&subch_dir_lock, "subch dir lock", NULL, MTX_SPIN);

==== //depot/projects/s390/sys/s390/s390/clock.c#3 (text+ko) ====

@@ -86,9 +86,9 @@
 	clock_comparator_set(tod_clock_get() + cc_delta);
 
 #ifdef SMP
-	if (PCPU_GET(cpuid) == 0)
+	if (PCPU_GET(cpuid) == 0) {
 		hardclock(cf);
-	else {
+	} else {
 		mtx_lock_spin(&sched_lock);
 		hardclock_process(curthread, CLKF_USERMODE(cf));
 		statclock_process(curthread->td_kse, CLKF_PC(cf),

==== //depot/projects/s390/sys/s390/s390/dat.h#3 (text+ko) ====

@@ -15,8 +15,8 @@
 /* Include machine-dependent DAT definitions. */
 #include <machine/dat.h>
 
-#define SACF_ACCESS_REGISTER	0x00000200
-#define SACF_PRIMARY_SPACE	0x00000000
+#define SACF_ACCESS_REGISTER		0x00000200
+#define SACF_PRIMARY_SPACE		0x00000000
 
 #define CR0_SECONDARY_SPACE		0x04000000ul
 #define CR0_ADDRESS_SPACE_FUNCTION	0x00010000ul

==== //depot/projects/s390/sys/s390/s390/esa.h#2 (text+ko) ====

@@ -14,24 +14,35 @@
 
 #define KERNELDUMP_ESA_VERSION	1
 
-struct sccb;
+struct trapframe;
 
 void esa_init(void);
 void esa_check_features(void);
 void esa_cpu_model(void);
-void pmap_bootstrap(void);
-void io_intr_entry(void);
-void css_interruption(void);
+void dat_init(void);
+void io_intr(struct trapframe *tf);
+void css_init(void);
+void css_init_info(void);
 
-#define css_startup()
-#define css_startup_print()
+void io_intr_entry(struct trapframe *tf);
 
 extern uint8_t esa_sm_per;
 extern int esa_features;
-extern struct sccb *sccb;	/* bogus name */
-extern caddr_t devmempage;
 extern vm_offset_t kstack0;
 
+struct dat_init_map {
+	vm_offset_t *vap;
+	int         n;
+};
+
+#define DAT_INIT_MAP(uniq, va, n)				\
+	static struct dat_init_map uniq ## _dat_init = {	\
+		(vm_offset_t *)&(va),				\
+		(n)						\
+	};							\
+	DATA_SET(dat_init_set, uniq ## _dat_init)
+
+
 /* System masks for intr_restore() and friends. */
 #define SM_R	0x40		/* PER Mask */
 #define SM_T	0x04		/* DAT Mode */

==== //depot/projects/s390/sys/s390/s390/external.c#2 (text+ko) ====

@@ -32,17 +32,17 @@
 	char *		   name;	/* pretty name for KTR */
 	external_handler_t handler;
 } external[] = {
-	{EI_CLOCK_COMPARATOR, "Clock-Comparator"},
-	{EI_EXTERNAL_CALL, "External-Call"},
-	{EI_VM_DIAGNOSE, "VM Diagnose"},
-	{EI_SERVICE_SIGNAL, "Service-Signal"},
-	{EI_IUCV, "IUCV"},
-	{EI_MALFUNCTION_ALERT, "Malfunction-Alert"},
-	{EI_CPU_TIMER, "CPU-Timer"},
-	{EI_INTERRUPT_KEY, "Interrupt-Key"},
-	{EI_TOD_CLOCK_SYNC_CHECK, "TOD-Clock-Sync-Check"},
-	{EI_EMERGENCY_SIGNAL, "Emergency-Signal"},
-	{EI_ETR, "ETR"},
+	{EI_CLOCK_COMPARATOR,		"Clock-Comparator"},
+	{EI_EXTERNAL_CALL,		"External-Call"},
+	{EI_VM_DIAGNOSE,		"VM Diagnose"},
+	{EI_SERVICE_SIGNAL,		"Service-Signal"},
+	{EI_IUCV,			"IUCV"},
+	{EI_MALFUNCTION_ALERT,		"Malfunction-Alert"},
+	{EI_CPU_TIMER,			"CPU-Timer"},
+	{EI_INTERRUPT_KEY,		"Interrupt-Key"},
+	{EI_TOD_CLOCK_SYNC_CHECK,	"TOD-Clock-Sync-Check"},
+	{EI_EMERGENCY_SIGNAL,		"Emergency-Signal"},
+	{EI_ETR,			"ETR"},
 };
 
 #define EXTERNAL_NUM	(sizeof(external) / sizeof(external[0]))

==== //depot/projects/s390/sys/s390/s390/hmcsc.c#7 (text+ko) ====

@@ -57,7 +57,9 @@
 /* This is overkill on UP. */
 struct mtx hmcsc_lock;
 
-struct sccb *sccb;
+static struct sccb *sccb;
+DAT_INIT_MAP(sccb, sccb, 1);
+
 static struct sccb_edh *edh;
 static struct sccb_edb *edb;
 static struct sccb_mcdb *mcdb;

==== //depot/projects/s390/sys/s390/s390/identcpu.c#4 (text+ko) ====

@@ -176,7 +176,7 @@
 	if (idp.vc == 0xff);
 		esa_features |= ESA_FEATURE_VM_FLAG;
 
-	/* kstack0 is not used at this time. */
+	/* kstack0 is not used at this time so let's abuse it. */
 	sysib = (struct stsi_sysib111 *)kstack0;
 	cc = stsi(0x10000001, 0x00000001, sysib);
 	switch (cc) {

==== //depot/projects/s390/sys/s390/s390/machdep.c#7 (text+ko) ====

@@ -106,6 +106,12 @@
 
 int cold = 1;
 
+struct msgbuf *msgbufp;
+
+DAT_INIT_MAP(kstack0, kstack0, KSTACK_PAGES + 1);
+DAT_INIT_MAP(msgbufp, msgbufp, atop(round_page(MSGBUF_SIZE)));
+DAT_INIT_MAP(pcpu, sysarea.pcpu, 1);
+
 void
 io_intr(struct trapframe *tf)
 {
@@ -166,16 +172,16 @@
 	sysarea.sp_align_mask = ~7ul;
 
 	psw_define(&sysarea.svc_new_psw,
-		   PSW_0|PSW_T|PSW_M|PSW_KEY, (u_long)svc_intr_entry);
+		   PSW_0 | PSW_T | PSW_M | PSW_KEY, (u_long)svc_intr_entry);
 	psw_define(&sysarea.program_new_psw,
-		   PSW_0|PSW_T|PSW_M|PSW_KEY, (u_long)program_intr_entry);
+		   PSW_0 | PSW_T | PSW_M | PSW_KEY, (u_long)program_intr_entry);
 	psw_define(&sysarea.external_new_psw,
-		   PSW_0|PSW_T|PSW_M|PSW_KEY, (u_long)external_intr_entry);
+		   PSW_0 | PSW_T | PSW_M | PSW_KEY, (u_long)external_intr_entry);
 	psw_define(&sysarea.io_new_psw,
-		   PSW_0|PSW_T|PSW_M|PSW_KEY, (u_long)io_intr_entry);
+		   PSW_0 | PSW_T | PSW_M | PSW_KEY, (u_long)io_intr_entry);
 	mcheck_init();
 
-	intr_restore(SM_T|SM_EX|esa_sm_per);
+	intr_restore(SM_T | SM_EX | esa_sm_per);
 }
 
 void
@@ -191,7 +197,10 @@
 	mp_early_probe();
 
 	/* Enable DAT. */
-	pmap_bootstrap();
+	dat_init();
+#ifndef __s390x__
+	sysarea.pcpu += EXTENDED_SAVE_AREA_SIZE;
+#endif
 
 	init_param1();
 	init_param2(physmem);
@@ -221,13 +230,17 @@
 	msgbufinit(msgbufp, MSGBUF_SIZE);
 
 	/* Probe available subchannels and fire up CSS layer. */
-	css_startup();
+#if 0
+	css_init();
+#endif
 
 	/* Now we can init console, even a channel attached one. */
 	cninit();
 
 	/* Print info about found subchannels/devices. */
-	css_startup_print();
+#if 0
+	css_init_info();
+#endif
 
 	esa_cpu_model();
 }

==== //depot/projects/s390/sys/s390/s390/mcheck.c#2 (text+ko) ====

@@ -255,7 +255,7 @@
 mcheck_init(void)
 {
 	psw_define(&sysarea.mcheck_new_psw,
-		   PSW_0|PSW_T|PSW_KEY, (u_long)mcheck_intr_entry);
+		   PSW_0 | PSW_T | PSW_KEY, (u_long)mcheck_intr_entry);
 	mcheck_cpu_init();
 	mtx_init(&mciq_lock, "mciq_lock", NULL, MTX_SPIN|MTX_RECURSE);
 }

==== //depot/projects/s390/sys/s390/s390/mcheck.h#2 (text+ko) ====

@@ -62,11 +62,8 @@
 #define CR14_EXTERNAL_DAMAGE		0x02000000ul
 #define CR14_WARNING			0x01000000ul
 
-#ifdef __s390x__
-#define EXTENDED_SAVE_AREA_SIZE	0
-#else
+#ifndef __s390x__
 #define EXTENDED_SAVE_AREA_SIZE	144
-
 #define CR14_EXTENDED_SAVE_AREA	0x20000000ul
 #endif
 

==== //depot/projects/s390/sys/s390/s390/mem.c#5 (text+ko) ====

@@ -62,8 +62,11 @@
 #include <vm/pmap.h>
 #include <vm/vm_extern.h>
 #include <machine/vmparam.h>
+#include <s390/s390/esa.h>
+
+static caddr_t devmempage;
 
-caddr_t devmempage;
+DAT_INIT_MAP(devmempage, devmempage, 1);
 
 static int
 mmclose(dev_t dev, int flags, int fmt, struct thread *td)

==== //depot/projects/s390/sys/s390/s390/pmap.c#11 (text+ko) ====

@@ -109,8 +109,6 @@
 static unsigned nkptp;
 vm_offset_t kernel_vm_end;
 
-struct msgbuf *msgbufp;
-
 /* Data for the pv entry allocation mechanism. */
 static uma_zone_t pvzone;
 static struct vm_object pvzone_obj;
@@ -133,6 +131,15 @@
 
 static vm_offset_t pmap_ptepa(pmap_t pmap, vm_offset_t va);
 
+SET_DECLARE(dat_init_set, struct dat_init_map);
+
+DAT_INIT_MAP(proc0sto, proc0sto, NKPTP0 + 1);
+DAT_INIT_MAP(csrc_va, csrc_va, 1);
+DAT_INIT_MAP(cdst_va, cdst_va, 1);
+DAT_INIT_MAP(z_va, z_va, 1);
+DAT_INIT_MAP(zi_va, zi_va, 1);
+DAT_INIT_MAP(crashdumpmap, crashdumpmap, MAXDUMPPGS);
+
 static void
 ipte(vm_offset_t ptepa)
 {
@@ -153,33 +160,9 @@
 	}
 }
 
-#define BOOTSTRAP_MAP_ENTRY(va,n)	{(vm_offset_t *)&(va), (n)}
-#define BOOTSTRAP_MAP_TABLE_SIZE	(sizeof(bsme)/sizeof(bsme[0]))
-
-static struct bootstrap_map_entry {
-	vm_offset_t *ptr;
-	int         size;
-} bsme[] = {
-	BOOTSTRAP_MAP_ENTRY(proc0sto, NKPTP0 + 1),
-	BOOTSTRAP_MAP_ENTRY(csrc_va, 1),
-	BOOTSTRAP_MAP_ENTRY(cdst_va, 1),
-	BOOTSTRAP_MAP_ENTRY(z_va, 1),
-	BOOTSTRAP_MAP_ENTRY(zi_va, 1),
-	BOOTSTRAP_MAP_ENTRY(kstack0, KSTACK_PAGES + 1),
-	BOOTSTRAP_MAP_ENTRY(devmempage, 1),
-	BOOTSTRAP_MAP_ENTRY(msgbufp, atop(round_page(MSGBUF_SIZE))),
-#ifdef DEV_HMCSC
-	BOOTSTRAP_MAP_ENTRY(sccb, 1),
-#endif	
-	BOOTSTRAP_MAP_ENTRY(crashdumpmap, MAXDUMPPGS),
-/*	BOOTSTRAP_MAP_ENTRY(sysarea.pcpu, 1),*/
-#ifdef DDB
-	BOOTSTRAP_MAP_ENTRY(ddbstack, DDBSTACK_PAGES),
-#endif
-};	
 
 static vm_offset_t
-pmap_bootstrap_map(int n)
+dat_init_map(int n)
 {
 	vm_offset_t pa = avail_start;
 
@@ -194,8 +177,9 @@
 }
 
 void
-pmap_bootstrap(void)
+dat_init(void)
 {
+	struct dat_init_map **dimp;
 	vm_offset_t va;
 	ste_t *ste;
 	pte_t *pte;
@@ -216,9 +200,11 @@
 	virtual_avail = avail_start = (vm_offset_t)_end;
 	virtual_end = VM_MAX_KERNEL_ADDRESS;
 
-	for (i = 0; i < BOOTSTRAP_MAP_TABLE_SIZE; i++)
-		*bsme[i].ptr = pmap_bootstrap_map(bsme[i].size);
+	SET_FOREACH(dimp, dat_init_set) {
+		*(*dimp)->vap = dat_init_map((*dimp)->n);
+	}
 
+#if 0
 	sysarea.pcpu = (struct pcpu *)
 		(pmap_bootstrap_map(1) + EXTENDED_SAVE_AREA_SIZE);
 #ifdef SMP
@@ -229,38 +215,6 @@
 	mp_sysarea = pmap_bootstrap_map((mp_ncpus - 1) * SYSAREA_PAGES);
 	mp_pcpu = pmap_bootstrap_map(mp_ncpus - 1);
 #endif
-
-#if 0
-	proc0sto = (ste_t *)pmap_bootstrap_map(NKPTP0 + 1);
-
-	/* Reserve some special page table entries. */
-	csrc_va = (caddr_t)pmap_bootstrap_map(1);
-	cdst_va = (caddr_t)pmap_bootstrap_map(1);
-	z_va = (caddr_t)pmap_bootstrap_map(1);
-	zi_va = (caddr_t)pmap_bootstrap_map(1);
-
-	/* Allocate kstack for thread0. */
-	kstack0 = pmap_bootstrap_map(KSTACK_PAGES + 1);
-
-	/* For /dev/mem. */
-	devmempage = (caddr_t)pmap_bootstrap_map(1);
-
-	/* Map the message buffer. */
-	msgbufp = (struct msgbuf *)

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304251702.h3PH21MM040942>