Changeset d061efe in mainline
- Timestamp:
- 2009-08-31T21:55:50Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7d01790
- Parents:
- cfa8738 (diff), 00b1d20e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/amd64/Makefile.inc
rcfa8738 rd061efe 52 52 $(USPACEDIR)/srv/fs/fat/fat \ 53 53 $(USPACEDIR)/srv/bd/ata_bd/ata_bd \ 54 $(USPACEDIR)/srv/bd/file_bd/file_bd 54 $(USPACEDIR)/srv/bd/file_bd/file_bd \ 55 $(USPACEDIR)/srv/part/mbr_part/mbr_part 55 56 56 57 RD_APPS = \ -
boot/arch/arm32/loader/Makefile
rcfa8738 rd061efe 93 93 $(USPACEDIR)/srv/fs/tmpfs/tmpfs \ 94 94 $(USPACEDIR)/srv/fs/fat/fat \ 95 $(USPACEDIR)/srv/bd/file_bd/file_bd 95 $(USPACEDIR)/srv/bd/file_bd/file_bd \ 96 $(USPACEDIR)/srv/part/mbr_part/mbr_part 96 97 ifeq ($(MACHINE),testarm) 97 98 RD_SRVS += \ -
boot/arch/ia32/Makefile.inc
rcfa8738 rd061efe 52 52 $(USPACEDIR)/srv/fs/fat/fat \ 53 53 $(USPACEDIR)/srv/bd/ata_bd/ata_bd \ 54 $(USPACEDIR)/srv/bd/file_bd/file_bd 54 $(USPACEDIR)/srv/bd/file_bd/file_bd \ 55 $(USPACEDIR)/srv/part/mbr_part/mbr_part 55 56 56 57 RD_APPS = \ -
boot/arch/ia64/loader/Makefile
rcfa8738 rd061efe 104 104 $(USPACEDIR)/srv/fs/tmpfs/tmpfs \ 105 105 $(USPACEDIR)/srv/fs/fat/fat \ 106 $(USPACEDIR)/srv/bd/file_bd/file_bd 106 $(USPACEDIR)/srv/bd/file_bd/file_bd \ 107 $(USPACEDIR)/srv/part/mbr_part/mbr_part 107 108 108 109 RD_APPS = \ -
boot/arch/mips32/loader/Makefile
rcfa8738 rd061efe 106 106 $(USPACEDIR)/srv/fs/fat/fat \ 107 107 $(USPACEDIR)/srv/bd/file_bd/file_bd \ 108 $(USPACEDIR)/srv/bd/gxe_bd/gxe_bd 108 $(USPACEDIR)/srv/bd/gxe_bd/gxe_bd \ 109 $(USPACEDIR)/srv/part/mbr_part/mbr_part 109 110 110 111 RD_APPS = \ -
boot/arch/ppc32/loader/Makefile
rcfa8738 rd061efe 94 94 $(USPACEDIR)/srv/fs/tmpfs/tmpfs \ 95 95 $(USPACEDIR)/srv/fs/fat/fat \ 96 $(USPACEDIR)/srv/bd/file_bd/file_bd 96 $(USPACEDIR)/srv/bd/file_bd/file_bd \ 97 $(USPACEDIR)/srv/part/mbr_part/mbr_part 97 98 98 99 RD_APPS = \ -
boot/arch/sparc64/loader/Makefile
rcfa8738 rd061efe 104 104 $(USPACEDIR)/srv/fs/devfs/devfs \ 105 105 $(USPACEDIR)/srv/fs/tmpfs/tmpfs \ 106 $(USPACEDIR)/srv/bd/file_bd/file_bd 106 $(USPACEDIR)/srv/bd/file_bd/file_bd \ 107 $(USPACEDIR)/srv/part/mbr_part/mbr_part 107 108 108 109 ifeq ($(MACHINE),generic) -
uspace/Makefile
rcfa8738 rd061efe 52 52 srv/vfs \ 53 53 srv/devmap \ 54 srv/part/mbr_part \ 54 55 app/tetris \ 55 56 app/tester \ -
uspace/lib/libblock/libblock.c
rcfa8738 rd061efe 86 86 static int read_blocks(devcon_t *devcon, bn_t ba, size_t cnt); 87 87 static int write_blocks(devcon_t *devcon, bn_t ba, size_t cnt); 88 static size_t get_block_size(int dev_phone, size_t *bsize);88 static int get_block_size(int dev_phone, size_t *bsize); 89 89 90 90 static devcon_t *devcon_search(dev_handle_t dev_handle) … … 652 652 } 653 653 654 /** Read blocks directly from device (bypass cache). 655 * 656 * @param dev_handle Device handle of the block device. 657 * @param ba Address of first block. 658 * @param cnt Number of blocks. 659 * @param src Buffer for storing the data. 660 * 661 * @return EOK on success or negative error code on failure. 662 */ 663 int block_read_direct(dev_handle_t dev_handle, bn_t ba, size_t cnt, void *buf) 664 { 665 devcon_t *devcon; 666 int rc; 667 668 devcon = devcon_search(dev_handle); 669 assert(devcon); 670 671 fibril_mutex_lock(&devcon->comm_area_lock); 672 673 rc = read_blocks(devcon, ba, cnt); 674 if (rc == EOK) 675 memcpy(buf, devcon->comm_area, devcon->pblock_size * cnt); 676 677 fibril_mutex_unlock(&devcon->comm_area_lock); 678 679 return rc; 680 } 681 682 /** Write blocks directly to device (bypass cache). 683 * 684 * @param dev_handle Device handle of the block device. 685 * @param ba Address of first block. 686 * @param cnt Number of blocks. 687 * @param src The data to be written. 688 * 689 * @return EOK on success or negative error code on failure. 690 */ 691 int block_write_direct(dev_handle_t dev_handle, bn_t ba, size_t cnt, 692 const void *data) 693 { 694 devcon_t *devcon; 695 int rc; 696 697 devcon = devcon_search(dev_handle); 698 assert(devcon); 699 700 fibril_mutex_lock(&devcon->comm_area_lock); 701 702 memcpy(devcon->comm_area, data, devcon->pblock_size * cnt); 703 rc = read_blocks(devcon, ba, cnt); 704 705 fibril_mutex_unlock(&devcon->comm_area_lock); 706 707 return rc; 708 } 709 710 /** Get device block size. 711 * 712 * @param dev_handle Device handle of the block device. 713 * @param bsize Output block size. 714 * 715 * @return EOK on success or negative error code on failure. 716 */ 717 int block_get_bsize(dev_handle_t dev_handle, size_t *bsize) 718 { 719 devcon_t *devcon; 720 721 devcon = devcon_search(dev_handle); 722 assert(devcon); 723 724 return get_block_size(devcon->dev_phone, bsize); 725 } 726 654 727 /** Read blocks from block device. 655 728 * … … 691 764 692 765 /** Get block size used by the device. */ 693 static size_t get_block_size(int dev_phone, size_t *bsize)766 static int get_block_size(int dev_phone, size_t *bsize) 694 767 { 695 768 ipcarg_t bs; -
uspace/lib/libblock/libblock.h
rcfa8738 rd061efe 109 109 size_t); 110 110 111 extern int block_get_bsize(dev_handle_t, size_t *); 112 extern int block_read_direct(dev_handle_t, bn_t, size_t, void *); 113 extern int block_write_direct(dev_handle_t, bn_t, size_t, const void *); 114 111 115 #endif 112 116
Note:
See TracChangeset
for help on using the changeset viewer.