/lk-master/dev/virtio/block/ |
A D | virtio-block.c | 78 bdev_t bdev; member 94 if (!bdev) in virtio_block_init() 100 bdev->dev = dev; in virtio_block_init() 105 bdev->blk_req_phys = vaddr_to_paddr(bdev->blk_req); in virtio_block_init() 107 bdev->blk_req_phys = (uint64_t)(uintptr_t)bdev->blk_req; in virtio_block_init() 112 bdev->blk_response_phys = vaddr_to_paddr(&bdev->blk_response); in virtio_block_init() 145 bio_initialize_bdev(&bdev->bdev, buf, in virtio_block_init() 150 bdev->bdev.read_block = &virtio_bdev_read_block; in virtio_block_init() 151 bdev->bdev.write_block = &virtio_bdev_write_block; in virtio_block_init() 153 bio_register_device(&bdev->bdev); in virtio_block_init() [all …]
|
/lk-master/platform/stm32f4xx/ |
A D | flash.c | 40 bdev_t bdev; member 56 bio_initialize_bdev(&sg_flash.bdev, in stmflash_init() 71 bio_register_device(&sg_flash.bdev); in stmflash_init() 77 static ssize_t stmflash_bdev_read(struct bdev *bdev, void *buf, off_t offset, size_t len) { in stmflash_bdev_read() argument 80 len = bio_trim_range(bdev, offset, len); in stmflash_bdev_read() 89 static ssize_t stmflash_bdev_read_block(struct bdev *bdev, void *buf, bnum_t block, uint count) { in stmflash_bdev_read_block() argument 94 static ssize_t stmflash_bdev_write(struct bdev *bdev, const void *buf, off_t offset, size_t len) { in stmflash_bdev_write() argument 97 len = bio_trim_range(bdev, offset, len); in stmflash_bdev_write() 118 static ssize_t stmflash_bdev_write_block(struct bdev *bdev, const void *_buf, bnum_t block, uint co… in stmflash_bdev_write_block() argument 124 static ssize_t stmflash_bdev_erase(struct bdev *bdev, off_t offset, size_t len) { in stmflash_bdev_erase() argument [all …]
|
/lk-master/platform/stm32f7xx/ |
A D | flash.c | 35 bdev_t bdev; member 43 static ssize_t stm32_flash_bdev_write(struct bdev *bdev, const void *buf, off_t offset, size_t len); 78 flash.bdev.erase_byte = 0xff; in stm32_flash_init() 88 bio_register_device(&flash.bdev); in stm32_flash_init() 91 static ssize_t stm32_flash_bdev_read(struct bdev *bdev, void *buf, off_t offset, size_t len) { in stm32_flash_bdev_read() argument 99 static ssize_t stm32_flash_bdev_read_block(struct bdev *bdev, void *buf, bnum_t block, uint count) { in stm32_flash_bdev_read_block() argument 102 memcpy(buf, (uint8_t *)FLASHAXI_BASE + block * bdev->block_size, count * bdev->block_size); in stm32_flash_bdev_read_block() 104 return count * bdev->block_size; in stm32_flash_bdev_read_block() 107 static ssize_t stm32_flash_bdev_write_block(struct bdev *bdev, const void *buf, bnum_t block, uint … in stm32_flash_bdev_write_block() argument 156 static ssize_t stm32_flash_bdev_erase(struct bdev *bdev, off_t offset, size_t len) { in stm32_flash_bdev_erase() argument [all …]
|
A D | qspi.c | 51 static ssize_t spiflash_bdev_read(struct bdev *device, void *buf, off_t offset, size_t len); 52 static ssize_t spiflash_bdev_read_block(struct bdev *device, void *buf, bnum_t block, uint count); 53 static ssize_t spiflash_bdev_write_block(struct bdev *device, const void *buf, bnum_t block, uint c… 54 static ssize_t spiflash_bdev_erase(struct bdev *device, off_t offset, size_t len); 55 static int spiflash_ioctl(struct bdev *device, int request, void *argp); 299 static ssize_t spiflash_bdev_read_block(struct bdev *device, void *buf, in spiflash_bdev_read_block() 366 static ssize_t spiflash_bdev_write_block(struct bdev *device, const void *_buf, in spiflash_bdev_write_block() 396 static ssize_t spiflash_bdev_erase(struct bdev *device, off_t offset, in spiflash_bdev_erase() 441 static int spiflash_ioctl(struct bdev *device, int request, void *argp) { in spiflash_ioctl()
|
/lk-master/lib/bio/ |
A D | mem.c | 24 static ssize_t mem_bdev_read(bdev_t *bdev, void *buf, off_t offset, size_t len) { in mem_bdev_read() argument 25 mem_bdev_t *mem = (mem_bdev_t *)bdev; in mem_bdev_read() 27 LTRACEF("bdev %s, buf %p, offset %lld, len %zu\n", bdev->name, buf, offset, len); in mem_bdev_read() 34 static ssize_t mem_bdev_read_block(struct bdev *bdev, void *buf, bnum_t block, uint count) { in mem_bdev_read_block() argument 35 mem_bdev_t *mem = (mem_bdev_t *)bdev; in mem_bdev_read_block() 37 LTRACEF("bdev %s, buf %p, block %u, count %u\n", bdev->name, buf, block, count); in mem_bdev_read_block() 45 mem_bdev_t *mem = (mem_bdev_t *)bdev; in mem_bdev_write() 47 LTRACEF("bdev %s, buf %p, offset %lld, len %zu\n", bdev->name, buf, offset, len); in mem_bdev_write() 54 static ssize_t mem_bdev_write_block(struct bdev *bdev, const void *buf, bnum_t block, uint count) { in mem_bdev_write_block() argument 55 mem_bdev_t *mem = (mem_bdev_t *)bdev; in mem_bdev_write_block() [all …]
|
A D | subdev.c | 31 static ssize_t subdev_read(struct bdev *_dev, void *buf, off_t offset, size_t len) { in subdev_read() 37 static ssize_t subdev_read_block(struct bdev *_dev, void *buf, bnum_t block, uint count) { in subdev_read_block() 43 static ssize_t subdev_write(struct bdev *_dev, const void *buf, off_t offset, size_t len) { in subdev_write() 49 static ssize_t subdev_write_block(struct bdev *_dev, const void *buf, bnum_t block, uint count) { in subdev_write_block() 55 static ssize_t subdev_erase(struct bdev *_dev, off_t offset, size_t len) { in subdev_erase() 61 static void subdev_close(struct bdev *_dev) { in subdev_close()
|
A D | bio.c | 33 static ssize_t bio_default_read(struct bdev *dev, void *_buf, off_t offset, size_t len) { in bio_default_read() 129 static ssize_t bio_default_write(struct bdev *dev, const void *_buf, off_t offset, size_t len) { in bio_default_write() 247 static ssize_t bio_default_erase(struct bdev *dev, off_t offset, size_t len) { in bio_default_erase() 274 static ssize_t bio_default_read_block(struct bdev *dev, void *buf, bnum_t block, uint count) { in bio_default_read_block() 278 static ssize_t bio_default_write_block(struct bdev *dev, const void *buf, bnum_t block, uint count)… in bio_default_write_block() 332 bdev_t *bdev = NULL; in bio_open() local 342 bdev = entry; in bio_open() 343 bdev_inc_ref(bdev); in bio_open() 349 return bdev; in bio_open()
|
/lk-master/platform/zynq/ |
A D | spiflash.c | 48 bdev_t bdev; member 291 flash.bdev.read = &spiflash_bdev_read; in spiflash_detect() 296 flash.bdev.ioctl = &spiflash_ioctl; in spiflash_detect() 299 flash.bdev.erase_byte = 0xff; in spiflash_detect() 301 bio_register_device(&flash.bdev); in spiflash_detect() 317 static ssize_t spiflash_bdev_read(struct bdev *bdev, void *buf, off_t offset, size_t len) { in spiflash_bdev_read() argument 332 static ssize_t spiflash_bdev_read_block(struct bdev *bdev, void *buf, bnum_t block, uint count) { in spiflash_bdev_read_block() argument 339 return spiflash_bdev_read(bdev, buf, block << bdev->block_shift, count << bdev->block_shift); in spiflash_bdev_read_block() 342 static ssize_t spiflash_bdev_write_block(struct bdev *bdev, const void *_buf, bnum_t block, uint co… in spiflash_bdev_write_block() argument 368 static ssize_t spiflash_bdev_erase(struct bdev *bdev, off_t offset, size_t len) { in spiflash_bdev_erase() argument [all …]
|
/lk-master/lib/ptable/ |
A D | ptable.c | 42 bdev_t *bdev; member 73 bdev_t *bdev = NULL; in ptable_write() local 80 if (!bdev) in ptable_write() 128 if (bdev->geometry_count && bdev->geometry) { in ptable_write() 132 err = bio_erase(bdev, 0, bdev->total_size); in ptable_write() 152 if (bdev) in ptable_write() 169 bdev_t *bdev; in ptable_unpublish() local 172 if (bdev) { in ptable_unpublish() 322 if (!ptable.bdev->geometry_count || !ptable.bdev->geometry) { in ptable_adjust_request_for_erase_geometry() 391 if (!ptable.bdev) in ptable_allocate() [all …]
|
/lk-master/lib/bio/include/lib/ |
A D | bio.h | 29 typedef struct bdev { struct 49 ssize_t (*read)(struct bdev *, void *buf, off_t offset, size_t len); argument 50 ssize_t (*read_block)(struct bdev *, void *buf, bnum_t block, uint count); argument 51 ssize_t (*write)(struct bdev *, const void *buf, off_t offset, size_t len); argument 52 ssize_t (*write_block)(struct bdev *, const void *buf, bnum_t block, uint count); argument 53 ssize_t (*erase)(struct bdev *, off_t offset, size_t len); argument 54 int (*ioctl)(struct bdev *, int request, void *argp); argument 55 void (*close)(struct bdev *); argument
|
/lk-master/app/lkboot/ |
A D | commands.c | 213 bdev_t *bdev = ptable_get_device(); in do_flash_boot() local 214 if (!bdev) { in do_flash_boot() 220 err = bio_ioctl(bdev, BIO_IOCTL_GET_MEM_MAP, (void *)&ptr); in do_flash_boot() 247 bio_ioctl(bdev, BIO_IOCTL_PUT_MEM_MAP, NULL); in do_flash_boot() 255 bio_ioctl(bdev, BIO_IOCTL_PUT_MEM_MAP, NULL); in do_flash_boot() 274 bdev_t *bdev; in lkb_handle_command() local 294 if (!(bdev = ptable_get_device())) { in lkb_handle_command() 300 if (bio_erase(bdev, entry.offset, entry.length) != (ssize_t)entry.length) { in lkb_handle_command() 308 void *buf = malloc(bdev->block_size); in lkb_handle_command() 316 size_t toread = MIN(len - pos, bdev->block_size); in lkb_handle_command() [all …]
|
/lk-master/lib/sysparam/ |
A D | sysparam.c | 67 bdev_t *bdev; member 149 status_t sysparam_scan(bdev_t *bdev, off_t offset, size_t len) { in sysparam_scan() argument 152 LTRACEF("bdev %p (%s), offset 0x%llx, len 0x%zx\n", bdev, bdev->name, offset, len); in sysparam_scan() 154 DEBUG_ASSERT(bdev); in sysparam_scan() 156 DEBUG_ASSERT(offset + len <= bdev->total_size); in sysparam_scan() 157 DEBUG_ASSERT((offset % bdev->block_size) == 0); in sysparam_scan() 159 params.bdev = bdev; in sysparam_scan() 170 err = bio_read(bdev, buf, offset, len); in sysparam_scan() 231 if (params.bdev == NULL) in sysparam_reload() 297 if (params.bdev == NULL) in sysparam_write() [all …]
|
/lk-master/lib/fs/include/lib/ |
A D | fs.h | 84 struct bdev; 87 status_t (*format)(struct bdev *, const void *); 90 status_t (*mount)(struct bdev *, fscookie **);
|
/lk-master/platform/armemu/ |
A D | blkdev.c | 21 ssize_t read_block(struct bdev *dev, void *buf, bnum_t block, uint count) { in read_block() 36 ssize_t write_block(struct bdev *dev, const void *buf, bnum_t block, uint count) { in write_block()
|
/lk-master/lib/sysparam/include/lib/ |
A D | sysparam.h | 18 status_t sysparam_scan(bdev_t *bdev, off_t offset, size_t len);
|
/lk-master/lib/fs/memfs/ |
A D | memfs.c | 58 static status_t memfs_mount(struct bdev *dev, fscookie **cookie) { in memfs_mount()
|