require '_h2ph_pre.ph';

no warnings 'redefine';

require 'sys/device.ph';
require 'sys/timeout.ph';
require 'dev/pcmcia/pcmciareg.ph';
require 'dev/pcmcia/pcmciachip.ph';
require 'dev/ic/i82365reg.ph';
unless(defined(&PCIC_EVENT_INSERTION)) {
    sub PCIC_EVENT_INSERTION () {	0;}
}
unless(defined(&PCIC_EVENT_REMOVAL)) {
    sub PCIC_EVENT_REMOVAL () {	1;}
}
unless(defined(&PCIC_FLAG_SOCKETP)) {
    sub PCIC_FLAG_SOCKETP () {	0x1;}
}
unless(defined(&PCIC_FLAG_CARDP)) {
    sub PCIC_FLAG_CARDP () {	0x2;}
}
unless(defined(&PCIC_LASTSTATE_PRESENT)) {
    sub PCIC_LASTSTATE_PRESENT () {	0x2;}
}
unless(defined(&PCIC_LASTSTATE_HALF)) {
    sub PCIC_LASTSTATE_HALF () {	0x1;}
}
unless(defined(&PCIC_LASTSTATE_EMPTY)) {
    sub PCIC_LASTSTATE_EMPTY () {	0x;}
}
unless(defined(&C0SA)) {
    sub C0SA () {	 &PCIC_CHIP0_BASE+ &PCIC_SOCKETA_INDEX;}
}
unless(defined(&C0SB)) {
    sub C0SB () {	 &PCIC_CHIP0_BASE+ &PCIC_SOCKETB_INDEX;}
}
unless(defined(&C1SA)) {
    sub C1SA () {	 &PCIC_CHIP1_BASE+ &PCIC_SOCKETA_INDEX;}
}
unless(defined(&C1SB)) {
    sub C1SB () {	 &PCIC_CHIP1_BASE+ &PCIC_SOCKETB_INDEX;}
}
unless(defined(&PCIC_MEM_PAGES)) {
    sub PCIC_MEM_PAGES () {	4;}
}
unless(defined(&PCIC_MEMSIZE)) {
    sub PCIC_MEMSIZE () {	 &PCIC_MEM_PAGES* &PCIC_MEM_PAGESIZE;}
}
unless(defined(&PCIC_NSLOTS)) {
    sub PCIC_NSLOTS () {	4;}
}
unless(defined(&PCIC_MAX_MEM_PAGES)) {
    sub PCIC_MAX_MEM_PAGES () {	(8* $sizeof{'int'});}
}
unless(defined(&pcic_read)) {
    sub pcic_read {
	my($h, $idx) = @_;
	eval q((*($h)-> &ph_read)(($h), ($idx)));
    }
}
unless(defined(&pcic_write)) {
    sub pcic_write {
	my($h, $idx, $data) = @_;
	eval q((*($h)-> &ph_write)(($h), ($idx), ($data)));
    }
}
1;
