ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/serial.cpp
(Generate patch)

Comparing SheepShaver/src/serial.cpp (file contents):
Revision 1.3 by cebix, 2004-01-12T15:37:19Z vs.
Revision 1.4 by gbeauche, 2004-12-19T09:01:04Z

# Line 59 | Line 59 | int16 SerialOpen(uint32 pb, uint32 dce)
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");
# Line 82 | Line 82 | int16 SerialOpen(uint32 pb, uint32 dce)
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);
# Line 270 | Line 272 | int16 SerialClose(uint32 pb, uint32 dce)
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines