Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/block/libblock.h

    ra6ba0c9 r08cba4b  
    11/*
    22 * Copyright (c) 2008 Jakub Jermar
    3  * Copyright (c) 2008 Martin Decky
     3 * Copyright (c) 2008 Martin Decky
     4 * Copyright (c) 2011 Martin Sucha
    45 * All rights reserved.
    56 *
     
    3940
    4041#include <stdint.h>
     42#include <async.h>
    4143#include "../../srv/vfs/vfs.h"
    4244#include <fibril_synch.h>
     
    7173        /** Readers / Writer lock protecting the contents of the block. */
    7274        fibril_rwlock_t contents_lock;
    73         /** Handle of the device where the block resides. */
    74         devmap_handle_t devmap_handle;
     75        /** Service ID of service providing the block device. */
     76        service_id_t service_id;
    7577        /** Logical block address */
    7678        aoff64_t lba;
     
    9597};
    9698
    97 extern int block_init(devmap_handle_t, size_t);
    98 extern void block_fini(devmap_handle_t);
     99typedef struct {
     100        uint16_t size;
     101        uint8_t first_session;
     102        uint8_t last_session;
     103       
     104        uint8_t res0;
     105        uint8_t adr_ctrl;
     106        uint8_t first_track;
     107        uint8_t res1;
     108       
     109        uint32_t first_lba;
     110} __attribute__((packed)) toc_block_t;
    99111
    100 extern int block_bb_read(devmap_handle_t, aoff64_t);
    101 extern void *block_bb_get(devmap_handle_t);
     112extern int block_init(exch_mgmt_t, service_id_t, size_t);
     113extern void block_fini(service_id_t);
    102114
    103 extern int block_cache_init(devmap_handle_t, size_t, unsigned, enum cache_mode);
    104 extern int block_cache_fini(devmap_handle_t);
     115extern int block_bb_read(service_id_t, aoff64_t);
     116extern void *block_bb_get(service_id_t);
    105117
    106 extern int block_get(block_t **, devmap_handle_t, aoff64_t, int);
     118extern int block_cache_init(service_id_t, size_t, unsigned, enum cache_mode);
     119extern int block_cache_fini(service_id_t);
     120
     121extern int block_get(block_t **, service_id_t, aoff64_t, int);
    107122extern int block_put(block_t *);
    108123
    109 extern int block_seqread(devmap_handle_t, size_t *, size_t *, aoff64_t *, void *,
     124extern int block_seqread(service_id_t, size_t *, size_t *, aoff64_t *, void *,
    110125    size_t);
    111126
    112 extern int block_get_bsize(devmap_handle_t, size_t *);
    113 extern int block_get_nblocks(devmap_handle_t, aoff64_t *);
    114 extern int block_read_direct(devmap_handle_t, aoff64_t, size_t, void *);
    115 extern int block_write_direct(devmap_handle_t, aoff64_t, size_t, const void *);
     127extern int block_get_bsize(service_id_t, size_t *);
     128extern int block_get_nblocks(service_id_t, aoff64_t *);
     129extern toc_block_t *block_get_toc(service_id_t, uint8_t);
     130extern int block_read_direct(service_id_t, aoff64_t, size_t, void *);
     131extern int block_read_bytes_direct(service_id_t, aoff64_t, size_t, void *);
     132extern int block_write_direct(service_id_t, aoff64_t, size_t, const void *);
    116133
    117134#endif
     
    119136/** @}
    120137 */
    121 
Note: See TracChangeset for help on using the changeset viewer.