59 |
|
D(bug("SerialOpen pb %08lx, dce %08lx\n", pb, dce)); |
60 |
|
|
61 |
|
// Get IOCommandIsComplete function |
62 |
< |
iocic_tvect = (uint32)FindLibSymbol("\021DriverServicesLib", "\023IOCommandIsComplete"); |
62 |
> |
iocic_tvect = FindLibSymbol("\021DriverServicesLib", "\023IOCommandIsComplete"); |
63 |
|
D(bug("IOCommandIsComplete TVECT at %08lx\n", iocic_tvect)); |
64 |
|
if (iocic_tvect == 0) { |
65 |
|
printf("FATAL: SerialOpen(): Can't find IOCommandIsComplete()\n"); |
82 |
|
return res; |
83 |
|
|
84 |
|
// Allocate Deferred Task structures |
85 |
< |
uint32 input_dt = the_port->input_dt = (uint32)the_port->dt_store; |
86 |
< |
uint32 output_dt = the_port->output_dt = (uint32)the_port->dt_store + SIZEOF_serdt; |
85 |
> |
if ((the_port->dt_store = Mac_sysalloc(SIZEOF_serdt * 2)) == 0) |
86 |
> |
return openErr; |
87 |
> |
uint32 input_dt = the_port->input_dt = the_port->dt_store; |
88 |
> |
uint32 output_dt = the_port->output_dt = the_port->dt_store + SIZEOF_serdt; |
89 |
|
D(bug(" input_dt %08lx, output_dt %08lx\n", input_dt, output_dt)); |
90 |
|
|
91 |
|
WriteMacInt16(input_dt + qType, dtQType); |
272 |
|
// Close port if open |
273 |
|
SERDPort *the_port = the_serd_port[(-(int16)ReadMacInt16(dce + dCtlRefNum)-6) >> 1]; |
274 |
|
if (the_port->is_open) { |
275 |
+ |
Mac_sysfree(the_port->dt_store); |
276 |
|
int16 res = the_port->close(); |
277 |
|
the_port->is_open = false; |
278 |
|
return res; |