/[gxemul]/trunk/src/devices/dev_8259.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_8259.c

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

revision 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_8259.c,v 1.29 2006/12/30 13:30:57 debug Exp $   *  $Id: dev_8259.c,v 1.30 2007/06/15 18:13:04 debug Exp $
29   *     *  
30   *  8259 Programmable Interrupt Controller.   *  COMMENT: Intel 8259 Programmable Interrupt Controller
31   *   *
32   *  See the following URL for more details:   *  See the following URL for more details:
33   *      http://www.nondot.org/sabre/os/files/MiscHW/8259pic.txt   *      http://www.nondot.org/sabre/os/files/MiscHW/8259pic.txt
# Line 53  Line 53 
53    
54  DEVICE_ACCESS(8259)  DEVICE_ACCESS(8259)
55  {  {
56          struct pic8259_data *d = (struct pic8259_data *) extra;          struct pic8259_data *d = extra;
57          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
58          int i;          int i;
59    
# Line 260  DEVICE_ACCESS(8259) Line 260  DEVICE_ACCESS(8259)
260   */   */
261  DEVINIT(8259)  DEVINIT(8259)
262  {  {
263          struct pic8259_data *d = malloc(sizeof(struct pic8259_data));          struct pic8259_data *d;
264          char *name2;          char *name2;
265          size_t nlen = strlen(devinit->name) + 20;          size_t nlen = strlen(devinit->name) + 20;
266    
267          if (d == NULL) {          CHECK_ALLOCATION(d = malloc(sizeof(struct pic8259_data)));
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
268          memset(d, 0, sizeof(struct pic8259_data));          memset(d, 0, sizeof(struct pic8259_data));
269    
270          INTERRUPT_CONNECT(devinit->interrupt_path, d->irq);          INTERRUPT_CONNECT(devinit->interrupt_path, d->irq);
271    
272          name2 = malloc(nlen);          CHECK_ALLOCATION(name2 = malloc(nlen));
273          snprintf(name2, nlen, "%s", devinit->name);          snprintf(name2, nlen, "%s", devinit->name);
274          if ((devinit->addr & 0xfff) == 0xa0) {          if ((devinit->addr & 0xfff) == 0xa0) {
275                  strlcat(name2, " [secondary]", nlen);                  strlcat(name2, " [secondary]", nlen);

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26