本文整理汇总了C++中DEVICE::boot方法的典型用法代码示例。如果您正苦于以下问题:C++ DEVICE::boot方法的具体用法?C++ DEVICE::boot怎么用?C++ DEVICE::boot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DEVICE
的用法示例。
在下文中一共展示了DEVICE::boot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: kaf_svc
/* Keep-alive service
* If the 8080 detects the 'force reload' bit, it initiates a disk
* boot. IO is reset, but memory is preserved.
*
* If the keep-alive enable bit is set, the -10 updates the keep-alive
* count field every second. The 8080 also checks the word every second.
* If the 8080 finds that the count hasn't changed for 15 consecutive seconds,
* a Keep-Alive Failure is declared. This forces the -10 to execute the
* contents of exec location 71 to collect status and initiate error recovery.
*/
static t_stat kaf_svc (UNIT *uptr)
{
if (M[FE_KEEPA] & INT64_C(0020000000000)) { /* KSRLD - "Forced" (actually, requested) reload */
uint32 oldsw = sim_switches;
DEVICE *bdev = NULL;
int32 i;
sim_switches &= ~SWMASK ('P');
reset_all (4); /* RESET IO starting with UBA */
sim_switches = oldsw;
M[FE_KEEPA] &= ~INT64_C(0030000177777); /* Clear KAF, RLD, KPALIV & reason
* 8080 ucode actually clears HW
* status too, but that's a bug. */
M[FE_KEEPA] |= 02; /* Reason = FORREL */
fei_unit.buf = feo_unit.buf = 0;
M[FE_CTYIN] = M[FE_CTYOUT] = 0;
M[FE_KLININ] = M[FE_KLINOUT] = 0;
/* The 8080 has the disk RH address & unit in its memory, even if
* the previous boot was from tape. It has no NVM, so the last opr
* selection will do here. The case of DS MT <rld> would require a
* SET FE command. It's not a common case.
*/
/* The device may have been detached, disabled or reconfigured since boot time.
* Therefore, search for it by CSR address & validate that it's bootable.
* If there are problems, the processor is halted.
*/
for (i = 0; fe_bootrh && (bdev = sim_devices[i]) != NULL; i++ ) {
DIB *dibp = (DIB *)bdev->ctxt;
if (dibp && (fe_bootrh >= dibp->ba) &&
(fe_bootrh < (dibp->ba + dibp->lnt))) {
break;
}
}
fe_xct = 2;
if ((bdev != NULL) && (fe_bootunit >= 0) && (fe_bootunit < (int32) bdev->numunits)) {
UNIT *bunit = bdev->units + fe_bootunit;
if (!(bunit->flags & UNIT_DIS) && (bunit->flags & UNIT_ATTABLE) && (bunit->flags & UNIT_ATT)) {
if (bdev->boot (fe_bootunit, bdev) == SCPE_OK) /* boot the device */
fe_xct = 1;
}
}
}
else if (M[FE_KEEPA] & INT64_C(0010000000000)) { /* KPACT */
d10 kav = M[FE_KEEPA] & INT64_C(0000000177400); /* KPALIV */
if (kaf_unit.u3 != (int32)kav) {
kaf_unit.u3 = (int32)kav;
kaf_unit.u4 = 0;
}
else if (++kaf_unit.u4 >= 15) {
kaf_unit.u4 = 0;
M[FE_KEEPA] = (M[FE_KEEPA] & ~INT64_C(0000000000377)) | 01; /* RSN = KAF (leaves enabled) */
fei_unit.buf = feo_unit.buf = 0;
M[FE_CTYIN] = M[FE_CTYOUT] = 0;
M[FE_KLININ] = M[FE_KLINOUT] = 0;
fe_xct = 071;
}
}
sim_activate_after (&kaf_unit, kaf_unit.wait);
if (fe_xct == 2) {
fe_xct = 0;
return STOP_CONSOLE;
}
return SCPE_OK;
}