mirror of
https://github.com/SDL-Hercules-390/hyperion.git
synced 2026-07-26 10:38:47 +02:00
Fix halt and clear subchannel on CTC type devices
Fix logmsg macro to appear as a singular statement git-svn-id: file:///home/jj/hercules.svn/trunk@466 956126f8-22a0-4046-8f4a-272fa8102e63
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
13 Nov 2001 Fix halt and clear subchannel on CTC type devices - Jan Jaeger
|
||||
13 Nov 2001 Fix logmsg macro to appear as a singular statement - Jan Jaeger
|
||||
09 Nov 2001 Add HMC cdrom type IPL support - Jan Jaeger
|
||||
09 Nov 2001 Fix hang in synchronize_broadcast - Greg Smith
|
||||
09 Nov 2001 Make MODEL_DEPENDENT more specific with CS and STCM - Paul Leisy
|
||||
|
||||
+5
-5
@@ -403,11 +403,11 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
|
||||
uninstall-info-recursive all-recursive install-data-recursive \
|
||||
install-exec-recursive installdirs-recursive install-recursive \
|
||||
uninstall-recursive check-recursive installcheck-recursive
|
||||
DIST_COMMON = README $(noinst_HEADERS) ./stamp-h.in INSTALL Makefile.am \
|
||||
Makefile.in TODO aclocal.m4 autoconf/README \
|
||||
autoconf/config.guess autoconf/config.sub autoconf/depcomp \
|
||||
autoconf/install-sh autoconf/missing autoconf/mkinstalldirs \
|
||||
config.h.in configure configure.ac
|
||||
DIST_COMMON = $(noinst_HEADERS) ./stamp-h.in INSTALL Makefile.am \
|
||||
Makefile.in aclocal.m4 autoconf/README autoconf/config.guess \
|
||||
autoconf/config.sub autoconf/depcomp autoconf/install-sh \
|
||||
autoconf/missing autoconf/mkinstalldirs config.h.in configure \
|
||||
configure.ac
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
SOURCES = $(cckd2ckd_SOURCES) $(cckdcdsk_SOURCES) $(cckdcomp_SOURCES) $(cckdswap_SOURCES) $(ckd2cckd_SOURCES) $(dasdinit_SOURCES) $(dasdisup_SOURCES) $(dasdload_SOURCES) $(dasdls_SOURCES) $(dasdpdsu_SOURCES) $(dmap2hrc_SOURCES) $(hercifc_SOURCES) $(hercules_SOURCES) $(hetget_SOURCES) $(hetinit_SOURCES) $(hetmap_SOURCES) $(hetupd_SOURCES) $(tapecopy_SOURCES) $(tapemap_SOURCES) $(tapesplt_SOURCES)
|
||||
|
||||
|
||||
@@ -561,7 +561,7 @@ int rc; /* Return code */
|
||||
{
|
||||
if (rc < 0)
|
||||
logmsg ("HHC407I Error reading file %s: %s\n",
|
||||
dev->filename, strerror(errno))
|
||||
dev->filename, strerror(errno));
|
||||
else
|
||||
logmsg ("HHC408I Unexpected end of file on %s\n",
|
||||
dev->filename);
|
||||
|
||||
@@ -518,6 +518,13 @@ void clear_subchan (REGS *regs, DEVBLK *dev)
|
||||
dev->scsw.flag2 |= SCSW2_AC_RESUM;
|
||||
signal_condition (&dev->resumecond);
|
||||
}
|
||||
#if !defined(NO_SIGABEND_HANDLER)
|
||||
else
|
||||
{
|
||||
if( dev->ctctype )
|
||||
signal_thread(dev->tid, SIGUSR2);
|
||||
}
|
||||
#endif /*!defined(NO_SIGABEND_HANDLER)*/
|
||||
|
||||
/* Release the device lock */
|
||||
release_lock (&dev->lock);
|
||||
@@ -633,6 +640,13 @@ int halt_subchan (REGS *regs, DEVBLK *dev)
|
||||
dev->scsw.flag2 |= SCSW2_AC_RESUM;
|
||||
signal_condition (&dev->resumecond);
|
||||
}
|
||||
#if !defined(NO_SIGABEND_HANDLER)
|
||||
else
|
||||
{
|
||||
if( dev->ctctype )
|
||||
signal_thread(dev->tid, SIGUSR2);
|
||||
}
|
||||
#endif /*!defined(NO_SIGABEND_HANDLER)*/
|
||||
|
||||
/* Release the device lock */
|
||||
release_lock (&dev->lock);
|
||||
@@ -853,6 +867,7 @@ void device_thread ()
|
||||
sysblk.ioq = dev->nextioq;
|
||||
if (sysblk.ioq && sysblk.devtwait)
|
||||
signal_condition(&sysblk.ioqcond);
|
||||
dev->tid = thread_id();
|
||||
release_lock (&sysblk.ioqlock);
|
||||
|
||||
switch (sysblk.arch_mode)
|
||||
@@ -864,6 +879,7 @@ void device_thread ()
|
||||
}
|
||||
|
||||
obtain_lock(&sysblk.ioqlock);
|
||||
dev->tid = 0;
|
||||
}
|
||||
|
||||
if (sysblk.devtmax < 0
|
||||
@@ -1320,7 +1336,6 @@ int ARCH_DEP(device_attention) (DEVBLK *dev, BYTE unitstat)
|
||||
int ARCH_DEP(startio) (DEVBLK *dev, ORB *orb) /*@IWZ*/
|
||||
{
|
||||
#if !defined(OPTION_FISHIO)
|
||||
TID tid; /* Device thread thread id */
|
||||
DEVBLK *previoq, *ioq; /* Device I/O queue pointers */
|
||||
int rc; /* Return code */
|
||||
#endif // !defined(OPTION_FISHIO)
|
||||
@@ -1402,7 +1417,7 @@ int rc; /* Return code */
|
||||
signal_condition(&sysblk.ioqcond);
|
||||
else if (sysblk.devtmax == 0 || sysblk.devtnbr < sysblk.devtmax)
|
||||
{
|
||||
rc = create_device_thread(&tid,&sysblk.detattr,device_thread,NULL);
|
||||
rc = create_device_thread(&dev->tid,&sysblk.detattr,device_thread,NULL);
|
||||
if (rc != 0 && sysblk.devtnbr == 0)
|
||||
{
|
||||
logmsg ("HHC760I %4.4X create_thread error: %s",
|
||||
|
||||
@@ -357,7 +357,7 @@ int cckd=0; /* 1 if compressed CKD */
|
||||
{
|
||||
if (rc < 0)
|
||||
logmsg ("HHC354I %s read error: %s\n",
|
||||
dev->filename, strerror(errno))
|
||||
dev->filename, strerror(errno));
|
||||
else
|
||||
logmsg ("HHC355I %s CKD header incomplete\n",
|
||||
dev->filename);
|
||||
|
||||
@@ -1042,6 +1042,11 @@ static struct timeval tv; /* Timeout time for 'select' */
|
||||
|
||||
case -1:
|
||||
{
|
||||
if(errno == EINTR)
|
||||
{
|
||||
// logmsg("read interrupted for ctc %4.4X\n",dev->devnum);
|
||||
return;
|
||||
}
|
||||
logmsg ("HHC869I %4.4X Error reading from %s: %s\n",
|
||||
dev->devnum, dev->filename, strerror(errno));
|
||||
dev->sense[0] = SENSE_EC;
|
||||
@@ -1318,6 +1323,8 @@ int n;
|
||||
/* -2 will cause an error status to be set */
|
||||
return -2;
|
||||
}
|
||||
if( n == EINTR )
|
||||
return -3;
|
||||
logmsg ("%4.4X: Error: read: %s\n",
|
||||
dev->devnum, strerror(errno));
|
||||
sleep(2);
|
||||
@@ -1371,6 +1378,8 @@ int lastlen = 2; /* block length at last pckt */
|
||||
while (1) {
|
||||
c = bufgetc(dev, lastlen == 2);
|
||||
if (c < 0) {
|
||||
if(c == -3)
|
||||
return 0;
|
||||
/* End of input buffer. Return what we have. */
|
||||
|
||||
setblkheader (iobuf, lastlen);
|
||||
@@ -1399,6 +1408,8 @@ int lastlen = 2; /* block length at last pckt */
|
||||
case SLIP_ESC:
|
||||
c = bufgetc(dev, lastlen == 2);
|
||||
if (c < 0) {
|
||||
if(c == -3)
|
||||
return 0;
|
||||
/* End of input buffer. Return what we have. */
|
||||
|
||||
setblkheader (iobuf, lastlen);
|
||||
|
||||
@@ -338,7 +338,7 @@ int repcnt; /* Replication count */
|
||||
/* Handle read error condition */
|
||||
if (rc < 0)
|
||||
logmsg ("HHC312I Read error in file %s: %s\n",
|
||||
dev->filename, strerror(errno))
|
||||
dev->filename, strerror(errno));
|
||||
else
|
||||
logmsg ("HHC313I Unexpected end of file in %s\n",
|
||||
dev->filename);
|
||||
@@ -498,7 +498,7 @@ int repcnt; /* Replication count */
|
||||
/* Handle read error condition */
|
||||
if (rc < 0)
|
||||
logmsg ("HHC316I Read error in file %s: %s\n",
|
||||
dev->filename, strerror(errno))
|
||||
dev->filename, strerror(errno));
|
||||
else
|
||||
logmsg ("HHC317I Unexpected end of filein %s\n",
|
||||
dev->filename);
|
||||
@@ -926,7 +926,7 @@ int blkfactor; /* Number of device blocks
|
||||
/* Handle read error condition */
|
||||
if (rc < 0)
|
||||
logmsg ("HHC323I Read error in file %s: %s\n",
|
||||
dev->filename, strerror(errno))
|
||||
dev->filename, strerror(errno));
|
||||
else
|
||||
logmsg ("HHC324I Unexpected end of file in %s\n",
|
||||
dev->filename);
|
||||
|
||||
+7
-5
@@ -111,19 +111,21 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
|
||||
/*-------------------------------------------------------------------*/
|
||||
#ifndef FLUSHLOG
|
||||
#define logmsg(a...) \
|
||||
{ \
|
||||
do { \
|
||||
fprintf(sysblk.msgpipew, a); \
|
||||
}
|
||||
} while(0)
|
||||
#else
|
||||
#define logmsg(a...) \
|
||||
{ \
|
||||
do { \
|
||||
fprintf(sysblk.msgpipew, a); \
|
||||
fflush(sysblk.msgpipew); \
|
||||
}
|
||||
} while(0)
|
||||
#endif
|
||||
#define DEVTRACE(format, a...) \
|
||||
do { \
|
||||
if(dev->ccwtrace||dev->ccwstep) \
|
||||
fprintf(sysblk.msgpipew, "%4.4X:" format, dev->devnum, a)
|
||||
fprintf(sysblk.msgpipew, "%4.4X:" format, dev->devnum, a); \
|
||||
} while(0)
|
||||
|
||||
/* Debugging */
|
||||
|
||||
|
||||
@@ -174,7 +174,8 @@ TID paneltid;
|
||||
|| sigaction(SIGFPE, &sa, NULL)
|
||||
|| sigaction(SIGSEGV, &sa, NULL)
|
||||
|| sigaction(SIGBUS, &sa, NULL)
|
||||
|| sigaction(SIGUSR1, &sa, NULL) )
|
||||
|| sigaction(SIGUSR1, &sa, NULL)
|
||||
|| sigaction(SIGUSR2, &sa, NULL) )
|
||||
{
|
||||
fprintf (stderr,
|
||||
"HHC031I Cannot register SIG ILL/FPE/SEGV/BUS handler: %s\n",
|
||||
|
||||
@@ -264,6 +264,20 @@ int i;
|
||||
|
||||
tid = thread_id();
|
||||
|
||||
if( signo == SIGUSR2 )
|
||||
{
|
||||
DEVBLK *dev;
|
||||
for (dev = sysblk.firstdev; dev != NULL; dev = dev->nextdev)
|
||||
if (dev->tid == tid) break;
|
||||
if( dev == NULL)
|
||||
logmsg("signal USR2 received for undetermined device\n");
|
||||
#if 0
|
||||
else
|
||||
logmsg("signal USR2 received for device %4.4X\n",dev->devnum);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef FEATURE_CPU_RECONFIG
|
||||
for (i = 0; i < MAX_CPU_ENGINES; i++)
|
||||
#else /*!FEATURE_CPU_RECONFIG*/
|
||||
|
||||
@@ -658,11 +658,11 @@ int i;
|
||||
if(regs->arch_mode < ARCH_900)
|
||||
for (i = 0; i < 16; i++)
|
||||
logmsg ("GR%2.2d=%8.8X%s", i, regs->GR_L(i),
|
||||
((i & 0x03) == 0x03) ? "\n" : "\t")
|
||||
((i & 0x03) == 0x03) ? "\n" : "\t");
|
||||
else
|
||||
for (i = 0; i < 16; i++)
|
||||
logmsg ("R%1.1X=%16.16llX%s", i, regs->GR_G(i),
|
||||
((i & 0x03) == 0x03) ? "\n" : " ")
|
||||
((i & 0x03) == 0x03) ? "\n" : " ");
|
||||
|
||||
} /* end function display_regs */
|
||||
|
||||
@@ -676,11 +676,11 @@ int i;
|
||||
if(regs->arch_mode < ARCH_900)
|
||||
for (i = 0; i < 16; i++)
|
||||
logmsg ("CR%2.2d=%8.8X%s", i, regs->CR_L(i),
|
||||
((i & 0x03) == 0x03) ? "\n" : "\t")
|
||||
((i & 0x03) == 0x03) ? "\n" : "\t");
|
||||
else
|
||||
for (i = 0; i < 16; i++)
|
||||
logmsg ("C%1.1X=%16.16llX%s", i, regs->CR_G(i),
|
||||
((i & 0x03) == 0x03) ? "\n" : " ")
|
||||
((i & 0x03) == 0x03) ? "\n" : " ");
|
||||
|
||||
} /* end function display_cregs */
|
||||
|
||||
@@ -693,7 +693,7 @@ int i;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
logmsg ("AR%2.2d=%8.8X%s", i, regs->AR(i),
|
||||
((i & 0x03) == 0x03) ? "\n" : "\t")
|
||||
((i & 0x03) == 0x03) ? "\n" : "\t");
|
||||
|
||||
} /* end function display_aregs */
|
||||
|
||||
@@ -1582,9 +1582,9 @@ BYTE *cmdarg; /* -> Command argument */
|
||||
if (strcmp(cmd,"pr") == 0)
|
||||
{
|
||||
if(regs->arch_mode > ARCH_390)
|
||||
logmsg ("Prefix=%16.16llX\n", regs->PX_G)
|
||||
logmsg ("Prefix=%16.16llX\n", regs->PX_G);
|
||||
else
|
||||
logmsg ("Prefix=%8.8X\n", regs->PX_L)
|
||||
logmsg ("Prefix=%8.8X\n", regs->PX_L);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1875,7 +1875,7 @@ BYTE *cmdarg; /* -> Command argument */
|
||||
#else /*!_FEATURE_CPU_RECONFIG*/
|
||||
if(cpu < 0 || cpu > sysblk.numcpu)
|
||||
#endif /*!_FEATURE_CPU_RECONFIG*/
|
||||
logmsg ("CPU%4.4X not configured\n",cpu)
|
||||
logmsg ("CPU%4.4X not configured\n",cpu);
|
||||
else
|
||||
sysblk.pcpu = cpu;
|
||||
return NULL;
|
||||
|
||||
@@ -1332,9 +1332,9 @@ BYTE *xstmap; /* Xstore bitmap, zero means
|
||||
|| sysblk.cp_send_mask != old_cp_send_mask)
|
||||
{
|
||||
if (sysblk.cp_recv_mask != 0 || sysblk.cp_send_mask != 0)
|
||||
logmsg ("HHC701I SYSCONS interface active\n")
|
||||
logmsg ("HHC701I SYSCONS interface active\n");
|
||||
else
|
||||
logmsg ("HHC702I SYSCONS interface inactive\n")
|
||||
logmsg ("HHC702I SYSCONS interface inactive\n");
|
||||
}
|
||||
|
||||
/* Set response code X'0020' in SCCB header */
|
||||
|
||||
@@ -1263,7 +1263,7 @@ long density; /* Tape density code */
|
||||
|
||||
if (tapeinfo[i].t_name != NULL)
|
||||
logmsg ("HHC218I %s device type: %s\n",
|
||||
dev->filename, tapeinfo[i].t_name)
|
||||
dev->filename, tapeinfo[i].t_name);
|
||||
else
|
||||
logmsg ("HHC219I %s device type: 0x%lX\n",
|
||||
dev->filename, stblk.mt_type);
|
||||
@@ -1276,7 +1276,7 @@ long density; /* Tape density code */
|
||||
|
||||
if (densinfo[i].t_name != NULL)
|
||||
logmsg ("HHC220I %s tape density: %s\n",
|
||||
dev->filename, densinfo[i].t_name)
|
||||
dev->filename, densinfo[i].t_name);
|
||||
else
|
||||
logmsg ("HHC221I %s tape density code: 0x%lX\n",
|
||||
dev->filename, density);
|
||||
|
||||
Reference in New Issue
Block a user