// ElTorito - Terminate disk emu void cdemu_134b(struct bregs *regs) { // FIXME ElTorito Hardcoded SET_INT13ET(regs, size, 0x13); SET_INT13ET(regs, media, GET_LOW(CDEmu.media)); SET_INT13ET(regs, emulated_drive, GET_LOW(CDEmu.emulated_extdrive)); struct drive_s *drive_gf = GET_LOW(CDEmu.emulated_drive_gf); u8 cntl_id = 0; if (drive_gf) cntl_id = GET_GLOBALFLAT(drive_gf->cntl_id); SET_INT13ET(regs, controller_index, cntl_id / 2); SET_INT13ET(regs, device_spec, cntl_id % 2); SET_INT13ET(regs, ilba, GET_LOW(CDEmu.ilba)); SET_INT13ET(regs, buffer_segment, GET_LOW(CDEmu.buffer_segment)); SET_INT13ET(regs, load_segment, GET_LOW(CDEmu.load_segment)); SET_INT13ET(regs, sector_count, GET_LOW(CDEmu.sector_count)); SET_INT13ET(regs, cylinders, GET_LOW(CDEmu.lchs.cylinders)); SET_INT13ET(regs, sectors, GET_LOW(CDEmu.lchs.spt)); SET_INT13ET(regs, heads, GET_LOW(CDEmu.lchs.heads)); // If we have to terminate emulation if (regs->al == 0x00) { // FIXME ElTorito Various. Should be handled accordingly to spec SET_LOW(CDEmu.active, 0x00); // bye bye // XXX - update floppy/hd count. } disk_ret(regs, DISK_RET_SUCCESS); }
// INT 13h Fixed Disk Services Entry Point void VISIBLE16 handle_13(struct bregs *regs) { debug_enter(regs, DEBUG_HDL_13); u8 extdrive = regs->dl; if (CONFIG_CDROM_EMU) { if (regs->ah == 0x4b) { cdemu_134b(regs); return; } if (GET_LOW(CDEmu.media)) { u8 emudrive = GET_LOW(CDEmu.emulated_drive); if (extdrive == emudrive) { // Access to an emulated drive. struct drive_s *cdemu_gf = GET_GLOBAL(cdemu_drive_gf); if (regs->ah > 0x16) { // Only old-style commands supported. disk_13XX(regs, cdemu_gf); return; } disk_13(regs, cdemu_gf); return; } if (extdrive < EXTSTART_CD && ((emudrive ^ extdrive) & 0x80) == 0) // Adjust id to make room for emulated drive. extdrive--; } } handle_legacy_disk(regs, extdrive); }
static int cdemu_read(struct disk_op_s *op) { struct drive_s *drive_g; drive_g = GLOBALFLAT2GLOBAL(GET_LOW(CDEmu.emulated_drive_gf)); struct disk_op_s dop; dop.drive_g = drive_g; dop.command = op->command; dop.lba = GET_LOW(CDEmu.ilba) + op->lba / 4; int count = op->count; op->count = 0; u8 *cdbuf_fl = GET_GLOBAL(bounce_buf_fl); if (op->lba & 3) { // Partial read of first block. dop.count = 1; dop.buf_fl = cdbuf_fl; int ret = process_op(&dop); if (ret) return ret; u8 thiscount = 4 - (op->lba & 3); if (thiscount > count) thiscount = count; count -= thiscount; memcpy_fl(op->buf_fl, cdbuf_fl + (op->lba & 3) * 512, thiscount * 512); op->buf_fl += thiscount * 512; op->count += thiscount; dop.lba++; } if (count > 3) { // Read n number of regular blocks. dop.count = count / 4; dop.buf_fl = op->buf_fl; int ret = process_op(&dop); op->count += dop.count * 4; if (ret) return ret; u8 thiscount = count & ~3; count &= 3; op->buf_fl += thiscount * 512; dop.lba += thiscount / 4; } if (count) { // Partial read on last block. dop.count = 1; dop.buf_fl = cdbuf_fl; int ret = process_op(&dop); if (ret) return ret; u8 thiscount = count; memcpy_fl(op->buf_fl, cdbuf_fl, thiscount * 512); op->count += thiscount; } return DISK_RET_SUCCESS; }
// read disk drive parameters static void noinline disk_1308(struct bregs *regs, struct drive_s *drive_g) { // Get logical geometry from table struct chs_s chs = getLCHS(drive_g); u16 nlc=chs.cylinders, nlh=chs.heads, nlspt=chs.spt; nlc--; nlh--; u8 count; if (regs->dl < EXTSTART_HD) { // Floppy count = GET_GLOBAL(FloppyCount); if (CONFIG_CDROM_EMU && drive_g == GLOBALFLAT2GLOBAL(GET_GLOBAL(cdemu_drive_gf))) regs->bx = GET_LOW(CDEmu.media) * 2; else regs->bx = GET_GLOBAL(drive_g->floppy_type); // set es & di to point to 11 byte diskette param table in ROM regs->es = SEG_BIOS; regs->di = (u32)&diskette_param_table2; } else if (regs->dl < EXTSTART_CD) { // Hard drive count = GET_BDA(hdcount); nlc--; // last sector reserved } else { // Not supported on CDROM disk_ret(regs, DISK_RET_EPARAM); return; } if (CONFIG_CDROM_EMU && GET_LOW(CDEmu.active)) { u8 emudrive = GET_LOW(CDEmu.emulated_extdrive); if (((emudrive ^ regs->dl) & 0x80) == 0) // Note extra drive due to emulation. count++; if (regs->dl < EXTSTART_HD && count > 2) // Max of two floppy drives. count = 2; } regs->al = 0; regs->ch = nlc & 0xff; regs->cl = ((nlc >> 2) & 0xc0) | (nlspt & 0x3f); regs->dh = nlh; disk_ret(regs, DISK_RET_SUCCESS); regs->dl = count; }
// IBM/MS eject media static void noinline disk_1346(struct bregs *regs, struct drive_s *drive_gf) { if (regs->dl < EXTSTART_CD) { // Volume Not Removable disk_ret(regs, DISK_RET_ENOTREMOVABLE); return; } int cdid = regs->dl - EXTSTART_CD; u8 locks = GET_LOW(CDRom_locks[cdid]); if (locks != 0) { disk_ret(regs, DISK_RET_ELOCKED); return; } // FIXME should handle 0x31 no media in device // FIXME should handle 0xb5 valid request failed // Call removable media eject struct bregs br; memset(&br, 0, sizeof(br)); br.ah = 0x52; br.dl = regs->dl; call16_int(0x15, &br); if (br.ah || br.flags & F_CF) { disk_ret(regs, DISK_RET_ELOCKED); return; } disk_ret(regs, DISK_RET_SUCCESS); }
// status static void disk_134502(struct bregs *regs, struct drive_s *drive_gf) { int cdid = regs->dl - EXTSTART_CD; u8 locks = GET_LOW(CDRom_locks[cdid]); regs->al = (locks ? 1 : 0); disk_ret(regs, DISK_RET_SUCCESS); }
// Get the cylinders/heads/sectors for the given drive. static struct chs_s getLCHS(struct drive_s *drive_gf) { struct chs_s res = { }; if (CONFIG_CDROM_EMU && drive_gf == GET_GLOBAL(cdemu_drive_gf)) { // Emulated drive - get info from CDEmu. (It's not possible to // populate the geometry directly in the driveid because the // geometry is only known after the bios segment is made // read-only). res.cylinder = GET_LOW(CDEmu.lchs.cylinder); res.head = GET_LOW(CDEmu.lchs.head); res.sector = GET_LOW(CDEmu.lchs.sector); return res; } res.cylinder = GET_GLOBALFLAT(drive_gf->lchs.cylinder); res.head = GET_GLOBALFLAT(drive_gf->lchs.head); res.sector = GET_GLOBALFLAT(drive_gf->lchs.sector); return res; }
// lock static void disk_134500(struct bregs *regs, struct drive_s *drive_gf) { int cdid = regs->dl - EXTSTART_CD; u8 locks = GET_LOW(CDRom_locks[cdid]); if (locks == 0xff) { regs->al = 1; disk_ret(regs, DISK_RET_ETOOMANYLOCKS); return; } SET_LOW(CDRom_locks[cdid], locks + 1); regs->al = 1; disk_ret(regs, DISK_RET_SUCCESS); }
// unlock static void disk_134501(struct bregs *regs, struct drive_s *drive_gf) { int cdid = regs->dl - EXTSTART_CD; u8 locks = GET_LOW(CDRom_locks[cdid]); if (locks == 0x00) { regs->al = 0; disk_ret(regs, DISK_RET_ENOTLOCKED); return; } locks--; SET_LOW(CDRom_locks[cdid], locks); regs->al = (locks ? 1 : 0); disk_ret(regs, DISK_RET_SUCCESS); }
char * lsb_pendreason(int numReasons, int *rsTb, struct jobInfoHead *jInfoH, struct loadIndexLog *ld) { static char fname[] = "lsb_pendreason"; int i; int j; int num; int hostId; int reason; int hostIdJ; int reasonJ; static int *reasonTb; static int memSize; static char *hostList = NULL; static char *retMsg = NULL; char *sp; struct msgMap pendMsg[] = { /* * Job Related Reasons (001 - 300) */ { PEND_JOB_NEW, "New job is waiting for scheduling"}, { PEND_JOB_START_TIME, "The job has a specified start time"}, { PEND_JOB_DEPEND, "Job dependency condition not satisfied"}, { PEND_JOB_DEP_INVALID, "Dependency condition invalid or never satisfied"}, { PEND_JOB_MIG, "Migrating job is waiting for rescheduling"}, { PEND_JOB_PRE_EXEC, "The job's pre-exec command exited with non-zero status"}, { PEND_JOB_NO_FILE, "Unable to access job file"}, { PEND_JOB_ENV, "Unable to set job's environment variables"}, { PEND_JOB_PATHS, "Unable to determine job's home/working directories"}, { PEND_JOB_OPEN_FILES, "Unable to open job's I/O buffers"}, { PEND_JOB_EXEC_INIT, "Job execution initialization failed"}, { PEND_JOB_RESTART_FILE, "Unable to copy restarting job's checkpoint files"}, { PEND_JOB_DELAY_SCHED, "The schedule of the job is postponed for a while"}, { PEND_JOB_SWITCH, "Waiting for re-scheduling after switching queue"}, {PEND_JOB_DEP_REJECT, "Event is rejected by eeventd due to syntax error"}, {PEND_JOB_NO_PASSWD, "Failed to get user password"}, {PEND_JOB_MODIFY, "Waiting for re-scheduling after parameters have been changed"}, { PEND_SYS_UNABLE, "System is unable to schedule the job" }, /* * Queue and System Related Reasons (301 - 599) */ { PEND_QUE_INACT, "The queue is inactivated by the administrator"}, { PEND_QUE_WINDOW, "The queue is inactivated by its time windows"}, { PEND_QUE_JOB_LIMIT, "The queue has reached its job slot limit"}, { PEND_QUE_PJOB_LIMIT, "The queue has not enough job slots for the parallel job"}, { PEND_QUE_USR_JLIMIT, "User has reached the per-user job slot limit of the queue"}, { PEND_QUE_USR_PJLIMIT, "Not enough per-user job slots of the queue for the parallel job"}, { PEND_QUE_PRE_FAIL, "The queue's pre-exec command exited with non-zero status"}, { PEND_SYS_NOT_READY, "System is not ready for scheduling after reconfiguration"}, { PEND_SBD_JOB_REQUEUE, "Requeued job is waiting for rescheduling"}, { PEND_JOB_SPREAD_TASK, "Not enough hosts to meet the job's spanning requirement"}, { PEND_QUE_SPREAD_TASK, "Not enough hosts to meet the queue's spanning requirement"}, { PEND_QUE_WINDOW_WILL_CLOSE, "Job will not finish before queue's run window is closed"}, /* * User Related Reasons (601 - 800) */ { PEND_USER_JOB_LIMIT, "The user has reached his/her job slot limit"}, { PEND_UGRP_JOB_LIMIT, "One of the user's groups has reached its job slot limit"}, { PEND_USER_PJOB_LIMIT, "The user has not enough job slots for the parallel job"}, {PEND_UGRP_PJOB_LIMIT, "One of user's groups has not enough job slots for the parallel job"}, { PEND_USER_RESUME, "Waiting for scheduling after resumed by user"}, { PEND_USER_STOP, "The job was suspended by the user while pending"}, { PEND_ADMIN_STOP, "The job was suspended by LSF admin or root while pending"}, { PEND_NO_MAPPING, "Unable to determine user account for execution"}, { PEND_RMT_PERMISSION, "The user has no permission to run the job on remote host/cluster"}, /* * NON-EXCLUSIVE PENDING REASONS * A job may still start even though non-exclusive reasons exist. * * Job and Host(sbatchd) Related Reasons (1001 - 1300) */ { PEND_HOST_RES_REQ, "Job's resource requirements not satisfied"}, { PEND_HOST_NONEXCLUSIVE, "Job's requirement for exclusive execution not satisfied"}, { PEND_HOST_JOB_SSUSP, "Higher or equal priority jobs already suspended by system"}, { PEND_SBD_GETPID, "Unable to get the PID of the restarting job"}, { PEND_SBD_LOCK, "Unable to lock host for exclusively executing the job"}, { PEND_SBD_ZOMBIE, "Cleaning up zombie job"}, { PEND_SBD_ROOT, "Can't run jobs submitted by root"}, { PEND_HOST_WIN_WILL_CLOSE, "Job will not finish on the host before queue's run window is closed"}, { PEND_HOST_MISS_DEADLINE, "Job will not finish on the host before job's termination deadline"}, /* * Host Related Reasons (1301 - 1600) */ { PEND_HOST_DISABLED, "Closed by LSF administrator"}, { PEND_HOST_LOCKED, "Host is locked"}, { PEND_HOST_LESS_SLOTS, "Not enough job slot(s)"}, { PEND_HOST_WINDOW, "Dispatch windows closed"}, { PEND_HOST_JOB_LIMIT, "Job slot limit reached"}, { PEND_QUE_PROC_JLIMIT, "Queue's per-CPU job slot limit reached"}, { PEND_QUE_HOST_JLIMIT, "Queue's per-host job slot limit reached"}, { PEND_USER_PROC_JLIMIT, "User's per-CPU job slot limit reached"}, { PEND_UGRP_PROC_JLIMIT, "User group's per-CPU job slot limit reached"}, { PEND_HOST_USR_JLIMIT, "Host's per-user job slot limit reached"}, { PEND_HOST_QUE_MEMB, "Not usable to the queue"}, { PEND_HOST_USR_SPEC, "Not specified in job submission"}, { PEND_HOST_PART_USER, "User has no access to the host partition"}, { PEND_HOST_NO_USER, "There is no such user account"}, { PEND_HOST_ACCPT_ONE, "Just started a job recently"}, { PEND_LOAD_UNAVAIL, "Load information unavailable"}, { PEND_HOST_NO_LIM, "LIM is unreachable now"}, { PEND_HOST_QUE_RESREQ, "Queue's resource requirements not satisfied"}, { PEND_HOST_SCHED_TYPE, "Not the same type as the submission host"}, { PEND_JOB_NO_SPAN, "Not enough processors to meet the job's spanning requirement"}, { PEND_QUE_NO_SPAN, "Not enough processors to meet the queue's spanning requirement"}, { PEND_HOST_EXCLUSIVE, "Running an exclusive job"}, { PEND_HOST_QUE_RUSAGE, "Queue's requirements for resource reservation not satisfied"}, { PEND_HOST_JOB_RUSAGE, "Job's requirements for resource reservation not satisfied"}, /* * sbatchd Related Reasons (1601 - 1900) */ { PEND_SBD_UNREACH, "Unable to reach slave batch server"}, { PEND_SBD_JOB_QUOTA, "Number of jobs exceeds quota"}, { PEND_JOB_START_FAIL, "Failed in talking to server to start the job"}, { PEND_JOB_START_UNKNWN, "Failed in receiving the reply from server when starting the job"}, { PEND_SBD_NO_MEM, "Unable to allocate memory to run job"}, { PEND_SBD_NO_PROCESS, "Unable to fork process to run job"}, { PEND_SBD_SOCKETPAIR, "Unable to communicate with job process"}, { PEND_SBD_JOB_ACCEPT, "Slave batch server failed to accept job"}, /* * Load Related Reasons (2001 - 2300) */ { PEND_HOST_LOAD, "Load threshold reached"}, { PEND_JOB_PREEMPTED, "Preempted job is waiting to be resumed"}, { PEND_JOB_REQUEUED, "The job has been requeued"}, { 0, NULL} }; if (logclass & (LC_TRACE | LC_SCHED | LC_EXEC)) ls_syslog(LOG_DEBUG1, "%s: numReasons=%d", fname, numReasons); if (!numReasons || !rsTb) { lsberrno = LSBE_BAD_ARG; return (""); } if (memSize < numReasons) { FREEUP (reasonTb); reasonTb = calloc(numReasons, sizeof(int)); if (!reasonTb) { memSize = 0; lsberrno = LSBE_NO_MEM; return (""); } memSize = numReasons; } for (i = 0; i < numReasons; i++) reasonTb[i] = rsTb[i]; FREEUP(hostList); FREEUP(retMsg); if (jInfoH && jInfoH->numHosts != 0 && jInfoH->hostNames != NULL) { hostList = calloc(jInfoH->numHosts, MAXHOSTNAMELEN); retMsg = calloc(jInfoH->numHosts, MAXHOSTNAMELEN + MSGSIZE); if (hostList == NULL || retMsg == NULL) { lsberrno = LSBE_NO_MEM; return ""; } } else { retMsg = calloc(MSGSIZE, sizeof(char)); if (retMsg == NULL) { lsberrno = LSBE_NO_MEM; return ""; } } retMsg[0] = '\0'; for (i = 0; i < numReasons; i++) { if (!reasonTb[i]) continue; GET_LOW (reason, reasonTb[i]); if (!reason) continue; GET_HIGH (hostId, reasonTb[i]); if (logclass & (LC_TRACE | LC_SCHED | LC_EXEC)) ls_syslog(LOG_DEBUG2, "%s: hostId=%d, reason=%d reasonTb[%d]=%d", fname, hostId, reason, i, reasonTb[i]); if (jInfoH && jInfoH->numHosts != 0 && jInfoH->hostNames != NULL) { if (hostId > 0) strcpy(hostList, jInfoH->hostNames[hostId - 1]); else strcpy(hostList, jInfoH->hostNames[hostId]); } else { num = 1; } /* * Search for the rest of the reasonTb and see whether there * is a matching reason. If so, we add the associated host name * to the string stored in hostList so that we can provide a * summary information instead of repeating the same reason for * each host. */ for (j = i + 1; j < numReasons; j++) { if (reasonTb[j] == 0) continue; GET_LOW (reasonJ, reasonTb[j]); if (logclass & (LC_TRACE | LC_SCHED | LC_EXEC)) ls_syslog(LOG_DEBUG2, "%s: reasonJ=%d reasonTb[j]=%d", fname, reasonJ, reasonTb[j]); if (reasonJ != reason) continue; GET_HIGH (hostIdJ, reasonTb[j]); if (logclass & (LC_TRACE | LC_SCHED | LC_EXEC)) ls_syslog(LOG_DEBUG2, "%s: j=%d, hostIdJ=%d", fname, j, hostIdJ); reasonTb[j] = 0; if (jInfoH && jInfoH->numHosts != 0 && jInfoH->hostNames != NULL) { if (hostIdJ > 0) sprintf(hostList, "%s, %s", hostList, jInfoH->hostNames[hostIdJ - 1]); else sprintf(hostList, "%s, %s", hostList, jInfoH->hostNames[hostIdJ]); } else { num++; } } if (reason >= PEND_HOST_LOAD && reason < PEND_HOST_QUE_RUSAGE) { getMsgByRes(reason - PEND_HOST_LOAD, PEND_HOST_LOAD, &sp, ld); } else if (reason >= PEND_HOST_QUE_RUSAGE && reason < PEND_HOST_JOB_RUSAGE) { getMsgByRes(reason - PEND_HOST_QUE_RUSAGE, PEND_HOST_QUE_RUSAGE, &sp, ld); } else if (reason >= PEND_HOST_JOB_RUSAGE) { getMsgByRes(reason - PEND_HOST_JOB_RUSAGE, PEND_HOST_JOB_RUSAGE, &sp, ld); } else { sp = getMsg(pendMsg, reason); } if (jInfoH && jInfoH->numHosts != 0 && jInfoH->hostNames != NULL) sprintf(retMsg, "%s %s: %s;\n", retMsg, sp, hostList); else if (num == 1) sprintf(retMsg, "%s %s: 1 host;\n", retMsg, sp); else sprintf(retMsg, "%s %s: %d hosts;\n", retMsg, sp, num); } return retMsg; }
char * lsb_pendreason(int numReasons, int *rsTb, struct jobInfoHead *jInfoH, struct loadIndexLog *ld) { static char fname[] = "lsb_pendreason"; int i, j, num; int hostId, reason, hostIdJ, reasonJ; static int *reasonTb, memSize = 0; static char *hostList = NULL, *retMsg = NULL; char *sp; int pendMsg_ID[] = { 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 566, 567, 568, 571, 583, 655, 656, 586, 587, 588, 589, 590, 591, 592, 596, 597, 598, 599, 600, 662, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 614, 615, 616, 617, 618, 619, 667, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 633, 634, 635, 636, 638, 639, 640, 641, 642, 664, 646, 647, 648, 649, 650, 651, 652, 653, 654, 644, 645, 665, 666 }; struct msgMap pendMsg[] = { { PEND_JOB_NEW, "New job is waiting for scheduling"}, /* catgets 550 */ { PEND_JOB_START_TIME, "The job has a specified start time"}, /* catgets 551 */ { PEND_JOB_DEPEND, "Job dependency condition not satisfied"}, /* catgets 552 */ { PEND_JOB_DEP_INVALID, "Dependency condition invalid or never satisfied"}, /* catgets 553 */ { PEND_JOB_MIG, "Migrating job is waiting for rescheduling"}, /* catgets 554 */ { PEND_JOB_PRE_EXEC, "The job's pre-exec command exited with non-zero status"}, /* catgets 555 */ { PEND_JOB_NO_FILE, "Unable to access job file"}, /* catgets 556 */ { PEND_JOB_ENV, "Unable to set job's environment variables"}, /* catgets 557 */ { PEND_JOB_PATHS, "Unable to determine job's home/working directories"}, /* catgets 558 */ { PEND_JOB_OPEN_FILES, "Unable to open job's I/O buffers"}, /* catgets 559 */ { PEND_JOB_EXEC_INIT, "Job execution initialization failed"}, /* catgets 560 */ { PEND_JOB_RESTART_FILE, "Unable to copy restarting job's checkpoint files"}, /* catgets 561 */ { PEND_JOB_DELAY_SCHED, "The schedule of the job is postponed for a while"}, /* catgets 562 */ { PEND_JOB_SWITCH, "Waiting for re-scheduling after switching queue"}, /* catgets 563 */ {PEND_JOB_DEP_REJECT, "Event is rejected by eeventd due to syntax error"}, /* catgets 564 */ {PEND_JOB_NO_PASSWD, "Failed to get user password"}, /* catgets 566 */ {PEND_JOB_MODIFY, "Waiting for re-scheduling after parameters have been changed"},/* catgets 568 */ { PEND_JOB_REQUEUED, "Requeue the job for the next run"}, /* catgets 571 */ { PEND_SYS_UNABLE, "System is unable to schedule the job" }, /* catgets 583 */ {PEND_JOB_ARRAY_JLIMIT, "The job array has reached its running element limit"}, /* catgets 655 */ { PEND_CHKPNT_DIR, "Checkpoint directory is invalid"}, /* catgets 656 */ { PEND_QUE_INACT, "The queue is inactivated by the administrator"}, /* catgets 586 */ { PEND_QUE_WINDOW, "The queue is inactivated by its time windows"}, /* catgets 587 */ { PEND_QUE_JOB_LIMIT, "The queue has reached its job slot limit"}, /* catgets 588 */ { PEND_QUE_PJOB_LIMIT, "The queue has not enough job slots for the parallel job"}, /* catgets 589 */ { PEND_QUE_USR_JLIMIT, "User has reached the per-user job slot limit of the queue"}, /* catgets 590 */ { PEND_QUE_USR_PJLIMIT, "Not enough per-user job slots of the queue for the parallel job"}, /* catgets 591 */ { PEND_QUE_PRE_FAIL, "The queue's pre-exec command exited with non-zero status"}, /* catgets 592 */ { PEND_SYS_NOT_READY, "System is not ready for scheduling after reconfiguration"}, /* catgets 596 */ { PEND_SBD_JOB_REQUEUE, "Requeued job is waiting for rescheduling"}, /* catgets 597 */ { PEND_JOB_SPREAD_TASK, "Not enough hosts to meet the job's spanning requirement"}, /* catgets 598 */ { PEND_QUE_SPREAD_TASK, "Not enough hosts to meet the queue's spanning requirement"}, /* catgets 599 */ { PEND_QUE_WINDOW_WILL_CLOSE, "Job will not finish before queue's run window is closed"}, /* catgets 600 */ { PEND_QUE_PROCLIMIT, "Job no longer satisfies queue PROCLIMIT configuration"}, /* catgets 662 */ { PEND_USER_JOB_LIMIT, "The user has reached his/her job slot limit"}, /* catgets 601 */ { PEND_UGRP_JOB_LIMIT, "One of the user's groups has reached its job slot limit"}, /* catgets 602 */ { PEND_USER_PJOB_LIMIT, "The user has not enough job slots for the parallel job"}, /* catgets 603 */ {PEND_UGRP_PJOB_LIMIT, "One of user's groups has not enough job slots for the parallel job"}, /* catgets 604 */ { PEND_USER_RESUME, "Waiting for scheduling after resumed by user"}, /* catgets 605 */ { PEND_USER_STOP, "The job was suspended by the user while pending"}, /* catgets 606 */ { PEND_ADMIN_STOP, "The job was suspended by LSF admin or root while pending"}, /* catgets 607 */ { PEND_NO_MAPPING, "Unable to determine user account for execution"}, /* catgets 608 */ { PEND_RMT_PERMISSION, "The user has no permission to run the job on remote host/cluster"}, /* catgets 609 */ { PEND_HOST_RES_REQ, "Job's resource requirements not satisfied"}, /* catgets 610 */ { PEND_HOST_NONEXCLUSIVE, "Job's requirement for exclusive execution not satisfied"}, /* catgets 611 */ { PEND_HOST_JOB_SSUSP, "Higher or equal priority jobs suspended by host load"}, /* catgets 612 */ { PEND_SBD_GETPID, "Unable to get the PID of the restarting job"}, /* catgets 614 */ { PEND_SBD_LOCK, "Unable to lock host for exclusively executing the job"}, /* catgets 615 */ { PEND_SBD_ZOMBIE, "Cleaning up zombie job"}, /* catgets 616 */ { PEND_SBD_ROOT, "Can't run jobs submitted by root"}, /* catgets 617 */ { PEND_HOST_WIN_WILL_CLOSE, "Job will not finish on the host before queue's run window is closed"}, /* catgets 618 */ { PEND_HOST_MISS_DEADLINE, "Job will not finish on the host before job's termination deadline"}, /* catgets 619 */ { PEND_FIRST_HOST_INELIGIBLE, "The specified first exection host is not eligible for this job at this time"}, /* catgets 667 */ { PEND_HOST_DISABLED, "Closed by LSF administrator"}, /* catgets 620 */ { PEND_HOST_LOCKED, "Host is locked by LSF administrator"}, /* catgets 621 */ { PEND_HOST_LESS_SLOTS, "Not enough job slot(s)"}, /* catgets 622 */ { PEND_HOST_WINDOW, "Dispatch windows closed"}, /* catgets 623 */ { PEND_HOST_JOB_LIMIT, "Job slot limit reached"}, /* catgets 624 */ { PEND_QUE_PROC_JLIMIT, "Queue's per-CPU job slot limit reached"}, /* catgets 625 */ { PEND_QUE_HOST_JLIMIT, "Queue's per-host job slot limit reached"}, /* catgets 626 */ { PEND_USER_PROC_JLIMIT, "User's per-CPU job slot limit reached"}, /* catgets 627 */ { PEND_UGRP_PROC_JLIMIT, "User group's per-CPU job slot limit reached"}, /* catgets 628 */ { PEND_HOST_USR_JLIMIT, "Host's per-user job slot limit reached"}, /* catgets 629 */ { PEND_HOST_QUE_MEMB, "Not usable to the queue"}, /* catgets 630 */ { PEND_HOST_USR_SPEC, "Not specified in job submission"}, /* catgets 631 */ { PEND_HOST_NO_USER, "There is no such user account"}, /* catgets 633 */ { PEND_HOST_ACCPT_ONE, "Just started a job recently"}, /* catgets 634 */ { PEND_LOAD_UNAVAIL, "Load information unavailable"}, /* catgets 635 */ { PEND_HOST_NO_LIM, "LIM is unreachable now"}, /* catgets 636 */ { PEND_HOST_QUE_RESREQ, "Queue's resource requirements not satisfied"}, /* catgets 638 */ { PEND_HOST_SCHED_TYPE, "Not the same type as the submission host"}, /* catgets 639 */ { PEND_JOB_NO_SPAN, "Not enough processors to meet the job's spanning requirement"}, /* catgets 640 */ { PEND_QUE_NO_SPAN, "Not enough processors to meet the queue's spanning requirement"}, /* catgets 641 */ { PEND_HOST_EXCLUSIVE, "Running an exclusive job"}, /* catgets 642 */ { PEND_HOST_LOCKED_MASTER, "Host is locked by master LIM"}, /* catgets 664 */ { PEND_SBD_UNREACH, "Unable to reach slave batch server"}, /* catgets 646 */ { PEND_SBD_JOB_QUOTA, "Number of jobs exceeds quota"}, /* catgets 647 */ { PEND_JOB_START_FAIL, "Failed in talking to server to start the job"}, /* catgets 648 */ { PEND_JOB_START_UNKNWN, "Failed in receiving the reply from server when starting the job"}, /* catgets 649 */ { PEND_SBD_NO_MEM, "Unable to allocate memory to run job"}, /* catgets 650 */ { PEND_SBD_NO_PROCESS, "Unable to fork process to run job"}, /* catgets 651 */ { PEND_SBD_SOCKETPAIR, "Unable to communicate with job process"}, /* catgets 652 */ { PEND_SBD_JOB_ACCEPT, "Slave batch server failed to accept job"}, /* catgets 653 */ { PEND_HOST_LOAD, "Load threshold reached"}, /* catgets 654 */ { PEND_HOST_QUE_RUSAGE, "Queue's requirements for resource reservation not satisfied"}, /* catgets 644 */ { PEND_HOST_JOB_RUSAGE, "Job's requirements for resource reservation not satisfied"}, /* catgets 645 */ { PEND_BAD_HOST, "Bad host name, host group name or cluster name"}, /* catgets 665 */ { PEND_QUEUE_HOST, "Host or host group is not used by the queue"}, /* catgets 666 */ { 0, NULL} }; if (logclass & (LC_TRACE | LC_SCHED | LC_EXEC)) ls_syslog(LOG_DEBUG1, "%s: numReasons=%d", fname, numReasons); if (!numReasons || !rsTb) { lsberrno = LSBE_BAD_ARG; return (""); } if (memSize < numReasons) { FREEUP (reasonTb); reasonTb = (int *)calloc (numReasons, sizeof(int)); if (!reasonTb) { memSize = 0; lsberrno = LSBE_NO_MEM; return (""); } memSize = numReasons; } for (i = 0; i < numReasons; i++) reasonTb[i] = rsTb[i]; FREEUP (hostList); FREEUP (retMsg); if (jInfoH && jInfoH->numHosts != 0 && jInfoH->hostNames != NULL) { hostList = malloc (jInfoH->numHosts * MAXHOSTNAMELEN); retMsg = malloc (jInfoH->numHosts * MAXHOSTNAMELEN + MSGSIZE); if (hostList == NULL || retMsg == NULL) { lsberrno = LSBE_NO_MEM; return (""); } } else { retMsg = malloc (MSGSIZE); if (retMsg == NULL) { lsberrno = LSBE_NO_MEM; return (""); } } retMsg[0] = '\0'; for (i = 0; i < numReasons; i++) { if (!reasonTb[i]) continue; GET_LOW (reason, reasonTb[i]); if (!reason) continue; GET_HIGH (hostId, reasonTb[i]); if (logclass & (LC_TRACE | LC_SCHED | LC_EXEC)) ls_syslog(LOG_DEBUG2, "%s: hostId=%d, reason=%d reasonTb[%d]=%d", fname, hostId, reason, i, reasonTb[i]); if (!hostId) { sprintf (msgline, " %s;\n", getMsg(pendMsg, pendMsg_ID, reason)); strcat (retMsg, msgline); continue; } if (jInfoH && jInfoH->numHosts != 0 && jInfoH->hostNames != NULL) strcpy (hostList, jInfoH->hostNames[hostId-1]); else num = 1; for (j = i + 1; j < numReasons; j++) { if (reasonTb[j] == 0) continue; GET_LOW (reasonJ, reasonTb[j]); if (logclass & (LC_TRACE | LC_SCHED | LC_EXEC)) ls_syslog(LOG_DEBUG2, "%s: reasonJ=%d reasonTb[j]=%d", fname, reasonJ, reasonTb[j]); if (reasonJ != reason) continue; GET_HIGH (hostIdJ, reasonTb[j]); if (logclass & (LC_TRACE | LC_SCHED | LC_EXEC)) ls_syslog(LOG_DEBUG2, "%s: j=%d, hostIdJ=%d", fname, j, hostIdJ); reasonTb[j] = 0; if (jInfoH && jInfoH->numHosts != 0 && jInfoH->hostNames != NULL) { sprintf(hostList, "%s, %s", hostList, jInfoH->hostNames[hostIdJ-1]); } else num++; } if (reason >= PEND_HOST_LOAD && reason < PEND_HOST_QUE_RUSAGE) { getMsgByRes(reason - PEND_HOST_LOAD, PEND_HOST_LOAD, &sp, ld); } else if (reason >= PEND_HOST_QUE_RUSAGE && reason < PEND_HOST_JOB_RUSAGE) { getMsgByRes(reason - PEND_HOST_QUE_RUSAGE, PEND_HOST_QUE_RUSAGE, &sp, ld); } else if (reason >= PEND_HOST_JOB_RUSAGE) { getMsgByRes(reason - PEND_HOST_JOB_RUSAGE, PEND_HOST_JOB_RUSAGE, &sp, ld); } else { sp = getMsg(pendMsg, pendMsg_ID, reason); } if (jInfoH && jInfoH->numHosts != 0 && jInfoH->hostNames != NULL) sprintf (retMsg, "%s %s: %s;\n", retMsg, sp, hostList); else if (num == 1) sprintf (retMsg, _i18n_msg_get(ls_catd , NL_SETN, 713, "%s %s: 1 host;\n"), retMsg, sp); /* catgets 713 */ else sprintf (retMsg, _i18n_msg_get(ls_catd , NL_SETN, 714, "%s %s: %d hosts;\n"), retMsg, sp, num); /* catgets 714 */ } return retMsg; }
// Process USB keyboard data. static void handle_key(struct keyevent *data) { dprintf(9, "Got key %x %x\n", data->modifiers, data->keys[0]); // Load old keys. struct usbkeyinfo old; old.data = GET_LOW(LastUSBkey.data); // Check for keys no longer pressed. int addpos = 0; int i; for (i=0; i<ARRAY_SIZE(old.keys); i++) { u8 key = old.keys[i]; if (!key) break; int j; for (j=0;; j++) { if (j>=ARRAY_SIZE(data->keys)) { // Key released. procscankey(key, RELEASEBIT, data->modifiers); if (i+1 >= ARRAY_SIZE(old.keys) || !old.keys[i+1]) // Last pressed key released - disable repeat. old.repeatcount = 0xff; break; } if (data->keys[j] == key) { // Key still pressed. data->keys[j] = 0; old.keys[addpos++] = key; break; } } } procmodkey(old.modifiers & ~data->modifiers, RELEASEBIT); // Process new keys procmodkey(data->modifiers & ~old.modifiers, 0); old.modifiers = data->modifiers; for (i=0; i<ARRAY_SIZE(data->keys); i++) { u8 key = data->keys[i]; if (!key) continue; // New key pressed. procscankey(key, 0, data->modifiers); old.keys[addpos++] = key; old.repeatcount = KEYREPEATWAITMS / KEYREPEATMS + 1; } if (addpos < ARRAY_SIZE(old.keys)) old.keys[addpos] = 0; // Check for key repeat event. if (addpos) { if (!old.repeatcount) procscankey(old.keys[addpos-1], 0, data->modifiers); else if (old.repeatcount != 0xff) old.repeatcount--; } // Update old keys SET_LOW(LastUSBkey.data, old.data); }