/[gxemul]/trunk/src/devices/dev_lpt.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/dev_lpt.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2005-2006  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: dev_lpt.c,v 1.5 2005/11/13 00:14:09 debug Exp $   *  $Id: dev_lpt.c,v 1.8 2006/02/09 20:02:59 debug Exp $
29   *   *
30   *  LPT (parallel printer) controller.   *  LPT (parallel printer) controller.
31   */   */
# Line 50  Line 50 
50  #define DEV_LPT_LENGTH          3  #define DEV_LPT_LENGTH          3
51    
52  struct lpt_data {  struct lpt_data {
         int             in_use;  
53          int             irqnr;          int             irqnr;
54          char            *name;          char            *name;
55          int             console_handle;          int             console_handle;
# Line 74  void dev_lpt_tick(struct cpu *cpu, void Line 73  void dev_lpt_tick(struct cpu *cpu, void
73  /*  /*
74   *  dev_lpt_access():   *  dev_lpt_access():
75   */   */
76  int dev_lpt_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(lpt)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
77  {  {
78          uint64_t idata = 0, odata=0;          uint64_t idata = 0, odata=0;
79          struct lpt_data *d = extra;          struct lpt_data *d = extra;
# Line 118  int dev_lpt_access(struct cpu *cpu, stru Line 115  int dev_lpt_access(struct cpu *cpu, stru
115  }  }
116    
117    
118  /*  DEVINIT(lpt)
  *  devinit_lpt():  
  */  
 int devinit_lpt(struct devinit *devinit)  
119  {  {
120          struct lpt_data *d = malloc(sizeof(struct lpt_data));          struct lpt_data *d = malloc(sizeof(struct lpt_data));
121          size_t nlen;          size_t nlen;
# Line 133  int devinit_lpt(struct devinit *devinit) Line 127  int devinit_lpt(struct devinit *devinit)
127          }          }
128          memset(d, 0, sizeof(struct lpt_data));          memset(d, 0, sizeof(struct lpt_data));
129          d->irqnr        = devinit->irq_nr;          d->irqnr        = devinit->irq_nr;
         d->in_use       = devinit->in_use;  
130          d->name         = devinit->name2 != NULL? devinit->name2 : "";          d->name         = devinit->name2 != NULL? devinit->name2 : "";
131          d->console_handle =          d->console_handle = console_start_slave(devinit->machine, devinit->name,
132              console_start_slave(devinit->machine, devinit->name);              CONSOLE_OUTPUT_ONLY);
133    
134          nlen = strlen(devinit->name) + 10;          nlen = strlen(devinit->name) + 10;
135          if (devinit->name2 != NULL)          if (devinit->name2 != NULL)

Legend:
Removed from v.20  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26