Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2247 → Rev 2248

/branches/fs/uspace/rd/rd.c
45,8 → 45,20
#include <bool.h>
#include <errno.h>
#include <async.h>
#include <stdlib.h>
#include <unistd.h>
#include <align.h>
#include <async.h>
#include <ddi.h>
#include <sysinfo.h>
#include <libarch/ddi.h>
 
#include "rd.h"
 
#define EOK 0
 
static void * rd_addr;
 
static void rd_connection(ipc_callid_t iid, ipc_call_t *icall)
{
ipc_callid_t callid;
54,6 → 66,8
int retval;
 
ipc_answer_fast(iid, 0, 0, 0);
int block_size = 512;
ipcarg_t dst, offset;
 
while (1) {
callid = async_get_call(&call);
61,6 → 75,14
case IPC_M_PHONE_HUNGUP:
ipc_answer_fast(callid, 0,0,0);
return;
case BD_READ_BLOCK:
//returnt the block data
dst = IPC_GET_ARG1(call);
offset = IPC_GET_ARG2(call);
//copy_from_uspace(dst, rd_addr+offset,block_size);
memcpy((void *) dst, rd_addr+offset, block_size);
retval = EOK;
break;
default:
retval = EINVAL;
}
78,7 → 100,7
if (rd_size == 0)
return false;
void * rd_addr = as_get_mappable_page(rd_size, rd_color);
rd_addr = as_get_mappable_page(rd_size, rd_color);
physmem_map(rd_ph_addr, rd_addr, ALIGN_UP(rd_size, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE);