require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SDMMCREG_H_)) {
    eval 'sub _SDMMCREG_H_ () {1;}' unless defined(&_SDMMCREG_H_);
    eval 'sub MMC_GO_IDLE_STATE () {0;}' unless defined(&MMC_GO_IDLE_STATE);
    eval 'sub MMC_SEND_OP_COND () {1;}' unless defined(&MMC_SEND_OP_COND);
    eval 'sub MMC_ALL_SEND_CID () {2;}' unless defined(&MMC_ALL_SEND_CID);
    eval 'sub MMC_SET_RELATIVE_ADDR () {3;}' unless defined(&MMC_SET_RELATIVE_ADDR);
    eval 'sub MMC_SELECT_CARD () {7;}' unless defined(&MMC_SELECT_CARD);
    eval 'sub MMC_SEND_CSD () {9;}' unless defined(&MMC_SEND_CSD);
    eval 'sub MMC_SEND_STATUS () {13;}' unless defined(&MMC_SEND_STATUS);
    eval 'sub MMC_SET_BLOCKLEN () {16;}' unless defined(&MMC_SET_BLOCKLEN);
    eval 'sub MMC_READ_BLOCK_SINGLE () {17;}' unless defined(&MMC_READ_BLOCK_SINGLE);
    eval 'sub MMC_READ_BLOCK_MULTIPLE () {18;}' unless defined(&MMC_READ_BLOCK_MULTIPLE);
    eval 'sub MMC_SET_BLOCK_COUNT () {23;}' unless defined(&MMC_SET_BLOCK_COUNT);
    eval 'sub MMC_WRITE_BLOCK_SINGLE () {24;}' unless defined(&MMC_WRITE_BLOCK_SINGLE);
    eval 'sub MMC_WRITE_BLOCK_MULTIPLE () {25;}' unless defined(&MMC_WRITE_BLOCK_MULTIPLE);
    eval 'sub MMC_APP_CMD () {55;}' unless defined(&MMC_APP_CMD);
    eval 'sub SD_SEND_RELATIVE_ADDR () {3;}' unless defined(&SD_SEND_RELATIVE_ADDR);
    eval 'sub SD_APP_SET_BUS_WIDTH () {6;}' unless defined(&SD_APP_SET_BUS_WIDTH);
    eval 'sub SD_APP_OP_COND () {41;}' unless defined(&SD_APP_OP_COND);
    eval 'sub MMC_OCR_MEM_READY () {(1<<31);}' unless defined(&MMC_OCR_MEM_READY);
    eval 'sub MMC_OCR_3_5V_3_6V () {(1<<23);}' unless defined(&MMC_OCR_3_5V_3_6V);
    eval 'sub MMC_OCR_3_4V_3_5V () {(1<<22);}' unless defined(&MMC_OCR_3_4V_3_5V);
    eval 'sub MMC_OCR_3_3V_3_4V () {(1<<21);}' unless defined(&MMC_OCR_3_3V_3_4V);
    eval 'sub MMC_OCR_3_2V_3_3V () {(1<<20);}' unless defined(&MMC_OCR_3_2V_3_3V);
    eval 'sub MMC_OCR_3_1V_3_2V () {(1<<19);}' unless defined(&MMC_OCR_3_1V_3_2V);
    eval 'sub MMC_OCR_3_0V_3_1V () {(1<<18);}' unless defined(&MMC_OCR_3_0V_3_1V);
    eval 'sub MMC_OCR_2_9V_3_0V () {(1<<17);}' unless defined(&MMC_OCR_2_9V_3_0V);
    eval 'sub MMC_OCR_2_8V_2_9V () {(1<<16);}' unless defined(&MMC_OCR_2_8V_2_9V);
    eval 'sub MMC_OCR_2_7V_2_8V () {(1<<15);}' unless defined(&MMC_OCR_2_7V_2_8V);
    eval 'sub MMC_OCR_2_6V_2_7V () {(1<<14);}' unless defined(&MMC_OCR_2_6V_2_7V);
    eval 'sub MMC_OCR_2_5V_2_6V () {(1<<13);}' unless defined(&MMC_OCR_2_5V_2_6V);
    eval 'sub MMC_OCR_2_4V_2_5V () {(1<<12);}' unless defined(&MMC_OCR_2_4V_2_5V);
    eval 'sub MMC_OCR_2_3V_2_4V () {(1<<11);}' unless defined(&MMC_OCR_2_3V_2_4V);
    eval 'sub MMC_OCR_2_2V_2_3V () {(1<<10);}' unless defined(&MMC_OCR_2_2V_2_3V);
    eval 'sub MMC_OCR_2_1V_2_2V () {(1<<9);}' unless defined(&MMC_OCR_2_1V_2_2V);
    eval 'sub MMC_OCR_2_0V_2_1V () {(1<<8);}' unless defined(&MMC_OCR_2_0V_2_1V);
    eval 'sub MMC_OCR_1_9V_2_0V () {(1<<7);}' unless defined(&MMC_OCR_1_9V_2_0V);
    eval 'sub MMC_OCR_1_8V_1_9V () {(1<<6);}' unless defined(&MMC_OCR_1_8V_1_9V);
    eval 'sub MMC_OCR_1_7V_1_8V () {(1<<5);}' unless defined(&MMC_OCR_1_7V_1_8V);
    eval 'sub MMC_OCR_1_6V_1_7V () {(1<<4);}' unless defined(&MMC_OCR_1_6V_1_7V);
    eval 'sub MMC_R1_READY_FOR_DATA () {(1<<8);}' unless defined(&MMC_R1_READY_FOR_DATA);
    eval 'sub MMC_R1_APP_CMD () {(1<<5);}' unless defined(&MMC_R1_APP_CMD);
    eval 'sub MMC_R1 {
        my($resp) = @_;
	    eval q((($resp)[0]));
    }' unless defined(&MMC_R1);
    eval 'sub MMC_R3 {
        my($resp) = @_;
	    eval q((($resp)[0]));
    }' unless defined(&MMC_R3);
    eval 'sub SD_R6 {
        my($resp) = @_;
	    eval q((($resp)[0]));
    }' unless defined(&SD_R6);
    eval 'sub MMC_ARG_RCA {
        my($rca) = @_;
	    eval q((($rca) << 16));
    }' unless defined(&MMC_ARG_RCA);
    eval 'sub SD_R6_RCA {
        my($resp) = @_;
	    eval q(( &SD_R6(($resp)) >> 16));
    }' unless defined(&SD_R6_RCA);
    eval 'sub SD_ARG_BUS_WIDTH_1 () {0;}' unless defined(&SD_ARG_BUS_WIDTH_1);
    eval 'sub SD_ARG_BUS_WIDTH_4 () {2;}' unless defined(&SD_ARG_BUS_WIDTH_4);
    eval 'sub MMC_CSD_CSDVER {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 126, 2));
    }' unless defined(&MMC_CSD_CSDVER);
    eval 'sub MMC_CSD_CSDVER_1_0 () {1;}' unless defined(&MMC_CSD_CSDVER_1_0);
    eval 'sub MMC_CSD_CSDVER_2_0 () {2;}' unless defined(&MMC_CSD_CSDVER_2_0);
    eval 'sub MMC_CSD_MMCVER {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 122, 4));
    }' unless defined(&MMC_CSD_MMCVER);
    eval 'sub MMC_CSD_MMCVER_1_0 () {0;}' unless defined(&MMC_CSD_MMCVER_1_0);
    eval 'sub MMC_CSD_MMCVER_1_4 () {1;}' unless defined(&MMC_CSD_MMCVER_1_4);
    eval 'sub MMC_CSD_MMCVER_2_0 () {2;}' unless defined(&MMC_CSD_MMCVER_2_0);
    eval 'sub MMC_CSD_MMCVER_3_1 () {3;}' unless defined(&MMC_CSD_MMCVER_3_1);
    eval 'sub MMC_CSD_MMCVER_4_0 () {4;}' unless defined(&MMC_CSD_MMCVER_4_0);
    eval 'sub MMC_CSD_READ_BL_LEN {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 80, 4));
    }' unless defined(&MMC_CSD_READ_BL_LEN);
    eval 'sub MMC_CSD_C_SIZE {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 62, 12));
    }' unless defined(&MMC_CSD_C_SIZE);
    eval 'sub MMC_CSD_CAPACITY {
        my($resp) = @_;
	    eval q((( &MMC_CSD_C_SIZE(($resp))+1) << ( &MMC_CSD_C_SIZE_MULT(($resp))+2)));
    }' unless defined(&MMC_CSD_CAPACITY);
    eval 'sub MMC_CSD_C_SIZE_MULT {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 47, 3));
    }' unless defined(&MMC_CSD_C_SIZE_MULT);
    eval 'sub MMC_CID_MID_V1 {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 104, 24));
    }' unless defined(&MMC_CID_MID_V1);
    eval 'sub MMC_CID_PNM_V1_CPY {
        my($resp, $pnm) = @_;
	    eval q( &do { ($pnm)[0] =  &MMC_RSP_BITS(($resp), 96, 8); ($pnm)[1] =  &MMC_RSP_BITS(($resp), 88, 8); ($pnm)[2] =  &MMC_RSP_BITS(($resp), 80, 8); ($pnm)[3] =  &MMC_RSP_BITS(($resp), 72, 8); ($pnm)[4] =  &MMC_RSP_BITS(($resp), 64, 8); ($pnm)[5] =  &MMC_RSP_BITS(($resp), 56, 8); ($pnm)[6] =  &MMC_RSP_BITS(($resp), 48, 8); ($pnm)[7] = ord(\'\\\\0\'); }  &while (0));
    }' unless defined(&MMC_CID_PNM_V1_CPY);
    eval 'sub MMC_CID_REV_V1 {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 40, 8));
    }' unless defined(&MMC_CID_REV_V1);
    eval 'sub MMC_CID_PSN_V1 {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 16, 24));
    }' unless defined(&MMC_CID_PSN_V1);
    eval 'sub MMC_CID_MDT_V1 {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 8, 8));
    }' unless defined(&MMC_CID_MDT_V1);
    eval 'sub MMC_CID_MID_V2 {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 120, 8));
    }' unless defined(&MMC_CID_MID_V2);
    eval 'sub MMC_CID_OID_V2 {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 104, 16));
    }' unless defined(&MMC_CID_OID_V2);
    eval 'sub MMC_CID_PNM_V2_CPY {
        my($resp, $pnm) = @_;
	    eval q( &do { ($pnm)[0] =  &MMC_RSP_BITS(($resp), 96, 8); ($pnm)[1] =  &MMC_RSP_BITS(($resp), 88, 8); ($pnm)[2] =  &MMC_RSP_BITS(($resp), 80, 8); ($pnm)[3] =  &MMC_RSP_BITS(($resp), 72, 8); ($pnm)[4] =  &MMC_RSP_BITS(($resp), 64, 8); ($pnm)[5] =  &MMC_RSP_BITS(($resp), 56, 8); ($pnm)[6] = ord(\'\\\\0\'); }  &while (0));
    }' unless defined(&MMC_CID_PNM_V2_CPY);
    eval 'sub MMC_CID_PSN_V2 {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 16, 32));
    }' unless defined(&MMC_CID_PSN_V2);
    eval 'sub SD_CSD_CSDVER {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 126, 2));
    }' unless defined(&SD_CSD_CSDVER);
    eval 'sub SD_CSD_CSDVER_1_0 () {0;}' unless defined(&SD_CSD_CSDVER_1_0);
    eval 'sub SD_CSD_TAAC {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 112, 8));
    }' unless defined(&SD_CSD_TAAC);
    eval 'sub SD_CSD_TAAC_1_5_MSEC () {0x26;}' unless defined(&SD_CSD_TAAC_1_5_MSEC);
    eval 'sub SD_CSD_NSAC {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 104, 8));
    }' unless defined(&SD_CSD_NSAC);
    eval 'sub SD_CSD_SPEED {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 96, 8));
    }' unless defined(&SD_CSD_SPEED);
    eval 'sub SD_CSD_SPEED_25_MHZ () {0x32;}' unless defined(&SD_CSD_SPEED_25_MHZ);
    eval 'sub SD_CSD_SPEED_50_MHZ () {0x5a;}' unless defined(&SD_CSD_SPEED_50_MHZ);
    eval 'sub SD_CSD_CCC {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 84, 12));
    }' unless defined(&SD_CSD_CCC);
    eval 'sub SD_CSD_CCC_ALL () {0x5f5;}' unless defined(&SD_CSD_CCC_ALL);
    eval 'sub SD_CSD_READ_BL_LEN {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 80, 4));
    }' unless defined(&SD_CSD_READ_BL_LEN);
    eval 'sub SD_CSD_READ_BL_PARTIAL {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 79, 1));
    }' unless defined(&SD_CSD_READ_BL_PARTIAL);
    eval 'sub SD_CSD_WRITE_BLK_MISALIGN {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 78, 1));
    }' unless defined(&SD_CSD_WRITE_BLK_MISALIGN);
    eval 'sub SD_CSD_READ_BLK_MISALIGN {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 77, 1));
    }' unless defined(&SD_CSD_READ_BLK_MISALIGN);
    eval 'sub SD_CSD_DSR_IMP {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 76, 1));
    }' unless defined(&SD_CSD_DSR_IMP);
    eval 'sub SD_CSD_C_SIZE {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 62, 12));
    }' unless defined(&SD_CSD_C_SIZE);
    eval 'sub SD_CSD_CAPACITY {
        my($resp) = @_;
	    eval q((( &SD_CSD_C_SIZE(($resp))+1) << ( &SD_CSD_C_SIZE_MULT(($resp))+2)));
    }' unless defined(&SD_CSD_CAPACITY);
    eval 'sub SD_CSD_VDD_R_CURR_MIN {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 59, 3));
    }' unless defined(&SD_CSD_VDD_R_CURR_MIN);
    eval 'sub SD_CSD_VDD_R_CURR_MAX {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 56, 3));
    }' unless defined(&SD_CSD_VDD_R_CURR_MAX);
    eval 'sub SD_CSD_VDD_W_CURR_MIN {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 53, 3));
    }' unless defined(&SD_CSD_VDD_W_CURR_MIN);
    eval 'sub SD_CSD_VDD_W_CURR_MAX {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 50, 3));
    }' unless defined(&SD_CSD_VDD_W_CURR_MAX);
    eval 'sub SD_CSD_VDD_RW_CURR_100mA () {0x7;}' unless defined(&SD_CSD_VDD_RW_CURR_100mA);
    eval 'sub SD_CSD_VDD_RW_CURR_80mA () {0x6;}' unless defined(&SD_CSD_VDD_RW_CURR_80mA);
    eval 'sub SD_CSD_C_SIZE_MULT {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 47, 3));
    }' unless defined(&SD_CSD_C_SIZE_MULT);
    eval 'sub SD_CSD_ERASE_BLK_EN {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 46, 1));
    }' unless defined(&SD_CSD_ERASE_BLK_EN);
    eval 'sub SD_CSD_SECTOR_SIZE {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 39, 7));
    }' unless defined(&SD_CSD_SECTOR_SIZE);
    eval 'sub SD_CSD_WP_GRP_SIZE {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 32, 7));
    }' unless defined(&SD_CSD_WP_GRP_SIZE);
    eval 'sub SD_CSD_WP_GRP_ENABLE {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 31, 1));
    }' unless defined(&SD_CSD_WP_GRP_ENABLE);
    eval 'sub SD_CSD_R2W_FACTOR {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 26, 3));
    }' unless defined(&SD_CSD_R2W_FACTOR);
    eval 'sub SD_CSD_WRITE_BL_LEN {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 22, 4));
    }' unless defined(&SD_CSD_WRITE_BL_LEN);
    eval 'sub SD_CSD_RW_BL_LEN_2G () {0xa;}' unless defined(&SD_CSD_RW_BL_LEN_2G);
    eval 'sub SD_CSD_RW_BL_LEN_1G () {0x9;}' unless defined(&SD_CSD_RW_BL_LEN_1G);
    eval 'sub SD_CSD_WRITE_BL_PARTIAL {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 21, 1));
    }' unless defined(&SD_CSD_WRITE_BL_PARTIAL);
    eval 'sub SD_CSD_FILE_FORMAT_GRP {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 15, 1));
    }' unless defined(&SD_CSD_FILE_FORMAT_GRP);
    eval 'sub SD_CSD_COPY {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 14, 1));
    }' unless defined(&SD_CSD_COPY);
    eval 'sub SD_CSD_PERM_WRITE_PROTECT {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 13, 1));
    }' unless defined(&SD_CSD_PERM_WRITE_PROTECT);
    eval 'sub SD_CSD_TMP_WRITE_PROTECT {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 12, 1));
    }' unless defined(&SD_CSD_TMP_WRITE_PROTECT);
    eval 'sub SD_CSD_FILE_FORMAT {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 10, 2));
    }' unless defined(&SD_CSD_FILE_FORMAT);
    eval 'sub SD_CID_MID {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 120, 8));
    }' unless defined(&SD_CID_MID);
    eval 'sub SD_CID_OID {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 104, 16));
    }' unless defined(&SD_CID_OID);
    eval 'sub SD_CID_PNM_CPY {
        my($resp, $pnm) = @_;
	    eval q( &do { ($pnm)[0] =  &MMC_RSP_BITS(($resp), 96, 8); ($pnm)[1] =  &MMC_RSP_BITS(($resp), 88, 8); ($pnm)[2] =  &MMC_RSP_BITS(($resp), 80, 8); ($pnm)[3] =  &MMC_RSP_BITS(($resp), 72, 8); ($pnm)[4] =  &MMC_RSP_BITS(($resp), 64, 8); ($pnm)[5] = ord(\'\\\\0\'); }  &while (0));
    }' unless defined(&SD_CID_PNM_CPY);
    eval 'sub SD_CID_REV {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 56, 8));
    }' unless defined(&SD_CID_REV);
    eval 'sub SD_CID_PSN {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 24, 32));
    }' unless defined(&SD_CID_PSN);
    eval 'sub SD_CID_MDT {
        my($resp) = @_;
	    eval q( &MMC_RSP_BITS(($resp), 8, 12));
    }' unless defined(&SD_CID_MDT);
    eval 'sub MMC_RSP_BITS {
        my($resp, $start, $len) = @_;
	    eval q( &__bitfield(($resp), ($start)-8, ($len)));
    }' unless defined(&MMC_RSP_BITS);
    eval 'sub __bitfield {
        my($src,$start,$len) = @_;
	    eval q({  &u_int8_t * &sp;  &u_int32_t  &dst,  &mask; \'int\'  &shift,  &bs,  &bc;  &if ($start < 0|| $len < 0|| $len > 32) 0;  &dst = 0;  &mask = $len % 32?  &UINT_MAX >> (32- ($len % 32)) :  &UINT_MAX;  &shift = 0;  &while ($len > 0) {  &sp = ( &u_int8_t *)$src + $start / 8;  &bs = $start % 8;  &bc = 8-  &bs;  &if ( &bc > $len)  &bc = $len;  &dst |= (* &sp++ >>  &bs) <<  &shift;  &shift +=  &bc; $start +=  &bc; $len -=  &bc; }  &dst &=  &mask;  &dst; });
    }' unless defined(&__bitfield);
}
1;
