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.5 by gbeauche, 2005-01-30T21:48:19Z

# Line 1 | Line 1
1   /*
2   *  serial.cpp - Serial device driver
3   *
4 < *  SheepShaver (C) 1997-2004 Marc Hellwig and Christian Bauer
4 > *  SheepShaver (C) 1997-2005 Marc Hellwig and Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# 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