Search
lxdream.org :: lxdream/src/maple/maple.c :: diff
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.
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/maple/maple.c Sat Mar 13 00:03:32 2004 +0000
1.3 @@ -0,0 +1,27 @@
1.4 +#include <assert.h>
1.5 +#include "dream.h"
1.6 +#include "mem.h"
1.7 +#include "asic.h"
1.8 +#include "maple.h"
1.9 +
1.10 +void maple_handle_buffer( uint32_t address ) {
1.11 + uint32_t *buf = (uint32_t *)mem_get_region(address);
1.12 + if( buf == NULL ) {
1.13 + ERROR( "Invalid or unmapped buffer passed to maple (0x%08X)", address );
1.14 + } else {
1.15 + int last, port, length, cmd, recv_addr, send_addr, add_length;
1.16 + int i = 0;
1.17 + do {
1.18 + last = buf[i]>>31; /* indicates last packet */
1.19 + port = (buf[i]>>16)&0x03;
1.20 + length = buf[i]&0x0F;
1.21 + uint32_t return_address = buf[i+1];
1.22 + cmd = buf[i+2]&0xFF;
1.23 + recv_addr = (buf[i+2]>>8)&0xFF;
1.24 + send_addr = (buf[i+2]>>16)&0xFF;
1.25 + add_length = (buf[i+2]>>24)&0xFF;
1.26 + char *return_buf = mem_get_region(return_address);
1.27 +
1.28 + } while( !last );
1.29 + }
1.30 +}
.