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 (16 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.
file annotate diff log raw
nkeynes@1
     1
#include <assert.h>
nkeynes@1
     2
#include "dream.h"
nkeynes@1
     3
#include "mem.h"
nkeynes@1
     4
#include "asic.h"
nkeynes@1
     5
#include "maple.h"
nkeynes@1
     6
nkeynes@1
     7
void maple_handle_buffer( uint32_t address ) {
nkeynes@1
     8
    uint32_t *buf = (uint32_t *)mem_get_region(address);
nkeynes@1
     9
    if( buf == NULL ) {
nkeynes@1
    10
        ERROR( "Invalid or unmapped buffer passed to maple (0x%08X)", address );
nkeynes@1
    11
    } else {
nkeynes@1
    12
        int last, port, length, cmd, recv_addr, send_addr, add_length;
nkeynes@1
    13
        int i = 0;
nkeynes@1
    14
        do {
nkeynes@1
    15
            last = buf[i]>>31; /* indicates last packet */
nkeynes@1
    16
            port = (buf[i]>>16)&0x03;
nkeynes@1
    17
            length = buf[i]&0x0F; 
nkeynes@1
    18
            uint32_t return_address = buf[i+1];
nkeynes@1
    19
            cmd = buf[i+2]&0xFF;
nkeynes@1
    20
            recv_addr = (buf[i+2]>>8)&0xFF;
nkeynes@1
    21
            send_addr = (buf[i+2]>>16)&0xFF;
nkeynes@1
    22
            add_length = (buf[i+2]>>24)&0xFF;
nkeynes@1
    23
            char *return_buf = mem_get_region(return_address);
nkeynes@1
    24
            
nkeynes@1
    25
        } while( !last );
nkeynes@1
    26
    }
nkeynes@1
    27
}
.