aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-go32.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1995-02-03 19:35:54 +0000
committerStu Grossman <grossman@cygnus>1995-02-03 19:35:54 +0000
commita76ef70a1469a892f712549afda41511220462cf (patch)
treef77e4d17351335833522af284cd2546c95b99545 /gdb/ser-go32.c
parent1b552670ac82a18385c05fb51fe51b6384a44e29 (diff)
downloadgdb-a76ef70a1469a892f712549afda41511220462cf.zip
gdb-a76ef70a1469a892f712549afda41511220462cf.tar.gz
gdb-a76ef70a1469a892f712549afda41511220462cf.tar.bz2
* core.c (dis_asm_read_memory), defs.h, gdbtk.c (gdb_disassemble),
top.c : Get rid of dis_asm_read_memory_hook. We can now call the disassemblers directly and have no need for this hook anymore. * defs.h, printcmd.c: Make print_insn be static. * ser-go32.c (dos_comisr): Make this 8 bit clean. * (dos_open dos_close): Allow multiple opens to the same device. Use a ref count to prevent unwanted deallocations. * sparcl-tdep.c: Put #ifdefs around all socket stuff to make GO32 happy. * (sparclite_ops): Switch to download_stratum. * target.h (enum strata): Move download_stratum before process_stratum so that executable targets get pushed on top of download targets.
Diffstat (limited to 'gdb/ser-go32.c')
-rw-r--r--gdb/ser-go32.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c
index a1c0b6e..b4a7591 100644
--- a/gdb/ser-go32.c
+++ b/gdb/ser-go32.c
@@ -196,6 +196,7 @@ static struct dos_ttystate
{
int base;
int irq;
+ int refcnt;
struct intrupt *intrupt;
int fifo;
int baudrate;
@@ -311,7 +312,7 @@ dos_comisr (irq)
port->oflo++;
}
- if (dos_putc (c & 0x7f, port) < 0)
+ if (dos_putc (c, port) < 0)
{
COUNT (CNT_ORUN);
}
@@ -474,11 +475,11 @@ dos_open (scb, name)
fd = name[3] - '1';
port = &ports[fd];
- if (port->intrupt)
+ if (port->refcnt++ > 0)
{
- /* already open (EBUSY not defined!) */
- errno = EACCES;
- return -1;
+ /* Device already opened another user. Just point at it. */
+ scb->fd = fd;
+ return 0;
}
/* force access to ID reg */
@@ -559,6 +560,10 @@ dos_close (scb)
return;
port = &ports[scb->fd];
+
+ if (port->refcnt-- > 1)
+ return;
+
if (!(intrupt = port->intrupt))
return;