Changeset 39580667 in mainline for uspace/srv/bd/gxe_bd/gxe_bd.c


Ignore:
Timestamp:
2009-05-28T19:55:56Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6b2f4c1
Parents:
0c0b800
Message:

Large I/O areas actually work as expected. Fix the definition of the gxe_bd device and pio_enable() the whole I/O area at once.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/gxe_bd/gxe_bd.c

    r0c0b800 r39580667  
    7373        uint32_t status;
    7474
    75 /*      FIXME: Need to fix pio_enable() to support >= page_size areas.
    76 
    7775        uint32_t pad4[3];
    78         uint32_t pad5[0x3fc0];
    79 
    80         uint8_t buffer[512];*/
     76        uint8_t pad5[0x3fc0];
     77
     78        uint8_t buffer[512];
    8179} gxe_bd_t;
    8280
    83 typedef struct {
    84         uint8_t buffer[512];
    85 } gxe_buf_t;
    8681
    8782static const size_t block_size = 512;
     
    9085static uintptr_t dev_physical = 0x13000000;
    9186static gxe_bd_t *dev;
    92 static gxe_buf_t *devbuf;
    9387
    9488static uint32_t disk_id = 0;
     
    135129
    136130        dev = vaddr;
    137 
    138         rc = pio_enable((void *) dev_physical + 0x4000, sizeof(gxe_buf_t), &vaddr);
    139         if (rc != EOK) {
    140                 printf(NAME ": Could not initialize device I/O space.\n");
    141                 return rc;
    142         }
    143 
    144         devbuf = vaddr;
    145131
    146132        rc = devmap_device_register("disk0", &dev_handle);
     
    253239
    254240        for (i = 0; i < size; i++) {
    255                 ((uint8_t *) buf)[i] = w =
    256                     pio_read_8(&devbuf->buffer[i]);
     241                ((uint8_t *) buf)[i] = w = pio_read_8(&dev->buffer[i]);
    257242        }
    258243
     
    268253
    269254        for (i = 0; i < size; i++) {
    270                 pio_write_8(&devbuf->buffer[i], ((const uint8_t *) buf)[i]);
     255                pio_write_8(&dev->buffer[i], ((const uint8_t *) buf)[i]);
    271256        }
    272257
Note: See TracChangeset for help on using the changeset viewer.