Operating Systems/OS_Assg2_pipes-main/myexpos/xsm/disk.c
xsm_word *disk_get_block(int block)
{
    char *addr, *block_base;
    size_t offset;

    addr = (char *)_disk_mem_copy;
    offset = block * XSM_DISK_BLOCK_SIZE * XSM_WORD_SIZE;
    block_base = addr + offset;

    return (xsm_word *)block_base;
}
/* Retrieve the block for the given block number */
Retrieve the block for the given block number
Retrieve the block for the given block number
xsm_word *disk_get_block(int block)
{
    char *addr, *block_base;
    size_t offset;
    addr = (char *)_disk_mem_copy;
    offset = block * XSM_DISK_BLOCK_SIZE * XSM_WORD_SIZE;
    block_base = addr + offset;
    return (xsm_word *)block_base;
}
xsm_word * disk_get_block ( int block ) { char * addr , * block_base ; size_t offset ; addr = ( char * ) _disk_mem_copy ; offset = block * XSM_DISK_BLOCK_SIZE * XSM_WORD_SIZE ; block_base = addr + offset ; return ( xsm_word * ) block_base ; }
Retrieve the block for the given block number
Retrieve the block for the given block number