Search
lxdream.org :: lxdream/src/maple/maple.c
lxdream 0.9.1
released Jun 29
Download Now
filename src/maple/maple.c
changeset 1:eea311cfd33e
next2:42349f6ea216
author nkeynes
date Sat Mar 13 00:03:32 2004 +0000 (15 years ago)
permissions -rw-r--r--
last change This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.
view annotate diff log raw
     1 #include <assert.h>
     2 #include "dream.h"
     3 #include "mem.h"
     4 #include "asic.h"
     5 #include "maple.h"
     7 void maple_handle_buffer( uint32_t address ) {
     8     uint32_t *buf = (uint32_t *)mem_get_region(address);
     9     if( buf == NULL ) {
    10         ERROR( "Invalid or unmapped buffer passed to maple (0x%08X)", address );
    11     } else {
    12         int last, port, length, cmd, recv_addr, send_addr, add_length;
    13         int i = 0;
    14         do {
    15             last = buf[i]>>31; /* indicates last packet */
    16             port = (buf[i]>>16)&0x03;
    17             length = buf[i]&0x0F; 
    18             uint32_t return_address = buf[i+1];
    19             cmd = buf[i+2]&0xFF;
    20             recv_addr = (buf[i+2]>>8)&0xFF;
    21             send_addr = (buf[i+2]>>16)&0xFF;
    22             add_length = (buf[i+2]>>24)&0xFF;
    23             char *return_buf = mem_get_region(return_address);
    25         } while( !last );
    26     }
    27 }
.