コード例 #1
0
ファイル: bootmap.c プロジェクト: Acidburn0zzz/qemu
static void jump_to_IPL_code(uint64_t address)
{
    /* store the subsystem information _after_ the bootmap was loaded */
    write_subsystem_identification();
    /*
     * The IPL PSW is at address 0. We also must not overwrite the
     * content of non-BIOS memory after we loaded the guest, so we
     * save the original content and restore it in jump_to_IPL_2.
     */
    ResetInfo *current = 0;

    save = *current;
    current->ipl_addr = (uint32_t) (uint64_t) &jump_to_IPL_2;
    current->ipl_continue = address & 0x7fffffff;

    /*
     * HACK ALERT.
     * We use the load normal reset to keep r15 unchanged. jump_to_IPL_2
     * can then use r15 as its stack pointer.
     */
    asm volatile("lghi 1,1\n\t"
                 "diag 1,1,0x308\n\t"
                 : : : "1", "memory");
    virtio_panic("\n! IPL returns !\n");
}
コード例 #2
0
ファイル: bootmap.c プロジェクト: Nolaan/qemu-rpi
static void ipl_eckd(ECKD_IPL_mode_t mode)
{
    switch (mode) {
    case ECKD_CDL:
        ipl_eckd_cdl(); /* no return */
    case ECKD_CMS:
    case ECKD_LDL:
        ipl_eckd_ldl(mode); /* no return */
    default:
        virtio_panic("\n! Unknown ECKD IPL mode !\n");
    }
}
コード例 #3
0
ファイル: main.c プロジェクト: Acidburn0zzz/qemu
static void virtio_setup(uint64_t dev_info)
{
    struct schib schib;
    int i;
    int r;
    bool found = false;
    bool check_devno = false;
    uint16_t dev_no = -1;

    if (dev_info != -1) {
        check_devno = true;
        dev_no = dev_info & 0xffff;
        debug_print_int("device no. ", dev_no);
        blk_schid.ssid = (dev_info >> 16) & 0x3;
        if (blk_schid.ssid != 0) {
            debug_print_int("ssid ", blk_schid.ssid);
            if (enable_mss_facility() != 0) {
                virtio_panic("Failed to enable mss facility\n");
            }
        }
    }
コード例 #4
0
ファイル: bootmap.c プロジェクト: Nolaan/qemu-rpi
void zipl_load(void)
{
    ScsiMbr *mbr = (void *)sec;
    LDL_VTOC *vlbl = (void *)sec;

    /* Grab the MBR */
    memset(sec, FREE_SPACE_FILLER, sizeof(sec));
    read_block(0, mbr, "Cannot read block 0");

    dputs("checking magic\n");

    if (magic_match(mbr->magic, ZIPL_MAGIC)) {
        ipl_scsi(); /* no return */
    }

    /* We have failed to follow the SCSI scheme, so */
    sclp_print("Using ECKD scheme.\n");
    if (virtio_guessed_disk_nature()) {
        sclp_print("Using guessed DASD geometry.\n");
        virtio_assume_eckd();
    }

    if (magic_match(mbr->magic, IPL1_MAGIC)) {
        ipl_eckd(ECKD_CDL); /* no return */
    }

    /* LDL/CMS? */
    memset(sec, FREE_SPACE_FILLER, sizeof(sec));
    read_block(2, vlbl, "Cannot read block 2");

    if (magic_match(vlbl->magic, CMS1_MAGIC)) {
        ipl_eckd(ECKD_CMS); /* no return */
    }
    if (magic_match(vlbl->magic, LNX1_MAGIC)) {
        ipl_eckd(ECKD_LDL); /* no return */
    }

    virtio_panic("\n* invalid MBR magic *\n");
}