From: Jack Lange Date: Wed, 11 Mar 2009 04:28:39 +0000 (-0500) Subject: added software strobe X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=c82c9c6cd8e4b1ef0bfd6dedd8da8ad3edb307cb added software strobe --- diff --git a/palacios/src/devices/8254.c b/palacios/src/devices/8254.c index 90f860a..1de80e9 100644 --- a/palacios/src/devices/8254.c +++ b/palacios/src/devices/8254.c @@ -154,6 +154,10 @@ static int handle_crystal_tics(struct vm_device * dev, struct channel * ch, uint } else { ushort_t reload_val = ch->reload_value; + if (ch->op_mode == SW_STROBE) { + reload_val = 0xffff; + } + // TODO: Check this.... // Is this correct??? if (reload_val == 0) { @@ -206,8 +210,13 @@ static int handle_crystal_tics(struct vm_device * dev, struct channel * ch, uint break; case SW_STROBE: - PrintError("Software strobe not implemented\n"); - return -1; + + if (channel_cycles > 0) { + if (ch->output_pin == 1) { + ch->output_pin = 0; + output_changed = 1; + } + } break; case HW_STROBE: PrintError("Hardware strobe not implemented\n"); @@ -357,6 +366,9 @@ static int handle_channel_write(struct channel * ch, char val) { case SQR_WAVE: ch->output_pin = 1; break; + case SW_STROBE: + ch->output_pin = 1; + break; default: PrintError("Invalid OP_MODE: %d\n", ch->op_mode); return -1; @@ -434,6 +446,9 @@ static int handle_channel_cmd(struct channel * ch, struct pit_cmd_word cmd) { case SQR_WAVE: ch->output_pin = 1; break; + case SW_STROBE: + ch->output_pin = 1; + break; default: PrintError("Invalid OP_MODE: %d\n", cmd.op_mode); return -1;