Changeset db6e419 in mainline for uspace/lib
- Timestamp:
- 2011-08-16T18:53:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 49160c4
- Parents:
- e0e922d (diff), 45058baa (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. - Location:
- uspace/lib
- Files:
-
- 41 added
- 1 deleted
- 63 edited
- 3 moved
-
block/libblock.c (modified) (36 diffs)
-
block/libblock.h (modified) (3 diffs)
-
c/Makefile (modified) (5 diffs)
-
c/arch/abs32le/include/barrier.h (added)
-
c/arch/abs32le/include/context_offset.h (added)
-
c/arch/abs32le/include/elf.h (added)
-
c/arch/abs32le/include/istate.h (modified) (1 diff, 1 prop)
-
c/arch/abs32le/include/syscall.h (modified) (1 diff)
-
c/arch/amd64/include/barrier.h (added)
-
c/arch/amd64/include/context_offset.h (added)
-
c/arch/amd64/include/elf.h (added)
-
c/arch/amd64/include/elf_linux.h (modified) (2 diffs)
-
c/arch/amd64/include/istate.h (modified) (1 diff, 1 prop)
-
c/arch/amd64/src/fibril.S (modified) (1 diff)
-
c/arch/arm32/include/barrier.h (added)
-
c/arch/arm32/include/elf.h (added)
-
c/arch/arm32/include/elf_linux.h (modified) (2 diffs)
-
c/arch/arm32/include/istate.h (modified) (1 diff, 1 prop)
-
c/arch/arm32/include/regutils.h (added)
-
c/arch/ia32/include/barrier.h (added)
-
c/arch/ia32/include/context_offset.h (added)
-
c/arch/ia32/include/elf.h (added)
-
c/arch/ia32/include/elf_linux.h (modified) (3 diffs)
-
c/arch/ia32/include/istate.h (modified) (1 diff, 1 prop)
-
c/arch/ia32/include/syscall.h (modified) (1 diff)
-
c/arch/ia32/src/fibril.S (modified) (1 diff)
-
c/arch/ia32/src/setjmp.S (modified) (1 diff)
-
c/arch/ia64/include/barrier.h (added)
-
c/arch/ia64/include/elf.h (added)
-
c/arch/ia64/include/istate.h (modified) (1 diff, 1 prop)
-
c/arch/ia64/include/register.h (added)
-
c/arch/mips32/include/barrier.h (added)
-
c/arch/mips32/include/context_offset.h (added)
-
c/arch/mips32/include/cp0.h (added)
-
c/arch/mips32/include/elf.h (added)
-
c/arch/mips32/include/elf_linux.h (modified) (2 diffs)
-
c/arch/mips32/include/istate.h (modified) (1 diff, 1 prop)
-
c/arch/mips32/include/regname.h (added)
-
c/arch/mips32/src/fibril.S (modified) (1 diff)
-
c/arch/mips32eb/include/barrier.h (added)
-
c/arch/mips32eb/include/context_offset.h (added)
-
c/arch/mips32eb/include/cp0.h (added)
-
c/arch/mips32eb/include/elf.h (added)
-
c/arch/mips32eb/include/regname.h (added)
-
c/arch/mips64/include/barrier.h (added)
-
c/arch/mips64/include/context_offset.h (added)
-
c/arch/mips64/include/cp0.h (added)
-
c/arch/mips64/include/elf.h (added)
-
c/arch/mips64/include/istate.h (modified) (1 diff, 1 prop)
-
c/arch/mips64/include/regname.h (added)
-
c/arch/mips64/src/fibril.S (modified) (1 diff)
-
c/arch/ppc32/include/barrier.h (added)
-
c/arch/ppc32/include/context_offset.h (added)
-
c/arch/ppc32/include/elf.h (added)
-
c/arch/ppc32/include/elf_linux.h (modified) (2 diffs)
-
c/arch/ppc32/include/istate.h (modified) (1 diff, 1 prop)
-
c/arch/ppc32/include/msr.h (added)
-
c/arch/ppc32/src/fibril.S (modified) (1 diff)
-
c/arch/sparc64/include/barrier.h (added)
-
c/arch/sparc64/include/context_offset.h (added)
-
c/arch/sparc64/include/elf.h (added)
-
c/arch/sparc64/include/istate.h (modified) (1 diff, 1 prop)
-
c/arch/sparc64/include/regdef.h (added)
-
c/arch/sparc64/include/syscall.h (modified) (1 diff)
-
c/arch/sparc64/src/fibril.S (modified) (1 diff)
-
c/generic/async.c (modified) (1 diff)
-
c/generic/ddi.c (modified) (2 diffs)
-
c/generic/devmap.c (deleted)
-
c/generic/event.c (modified) (1 diff)
-
c/generic/fibril.c (modified) (1 diff)
-
c/generic/io/io.c (modified) (1 diff)
-
c/generic/loc.c (added)
-
c/generic/ns_obsolete.c (modified) (1 diff)
-
c/generic/private/thread.h (modified) (1 diff)
-
c/generic/thread.c (modified) (1 diff)
-
c/generic/time.c (modified) (1 diff)
-
c/generic/udebug.c (modified) (1 diff)
-
c/generic/vfs/vfs.c (modified) (12 diffs)
-
c/include/as.h (modified) (1 diff)
-
c/include/ddi.h (modified) (1 diff)
-
c/include/elf/elf.h (modified) (1 diff)
-
c/include/elf/elf_load.h (modified) (2 diffs)
-
c/include/errno.h (modified) (1 diff)
-
c/include/event.h (modified) (1 diff)
-
c/include/ipc/common.h (modified) (1 diff)
-
c/include/ipc/devman.h (modified) (1 diff)
-
c/include/ipc/fb.h (modified) (1 diff)
-
c/include/ipc/ipc.h (modified) (1 diff)
-
c/include/ipc/loc.h (moved) (moved from uspace/lib/c/include/ipc/devmap.h ) (2 diffs)
-
c/include/ipc/services.h (modified) (1 diff)
-
c/include/libc.h (modified) (1 diff)
-
c/include/loc.h (moved) (moved from uspace/lib/c/include/devmap.h ) (1 diff)
-
c/include/rtld/elf_dyn.h (modified) (1 diff)
-
c/include/stats.h (modified) (1 diff)
-
c/include/sys/stat.h (modified) (2 diffs)
-
c/include/syscall.h (modified) (1 diff)
-
c/include/udebug.h (modified) (1 diff)
-
c/include/vfs/vfs.h (modified) (2 diffs)
-
drv/include/ddf/interrupt.h (modified) (1 diff)
-
ext2/libext2_filesystem.c (modified) (3 diffs)
-
ext2/libext2_filesystem.h (modified) (2 diffs)
-
ext2/libext2_superblock.c (modified) (2 diffs)
-
ext2/libext2_superblock.h (modified) (1 diff)
-
fs/libfs.c (modified) (33 diffs)
-
fs/libfs.h (modified) (4 diffs)
-
imgmap/Makefile (added)
-
imgmap/imgmap.c (added)
-
imgmap/imgmap.h (moved) (moved from uspace/lib/c/include/typedefs.h ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/block/libblock.c
re0e922d rdb6e419 39 39 #include "libblock.h" 40 40 #include "../../srv/vfs/vfs.h" 41 #include <ipc/ devmap.h>41 #include <ipc/loc.h> 42 42 #include <ipc/bd.h> 43 43 #include <ipc/services.h> … … 78 78 typedef struct { 79 79 link_t link; 80 devmap_handle_t devmap_handle;80 service_id_t service_id; 81 81 async_sess_t *sess; 82 82 fibril_mutex_t comm_area_lock; … … 95 95 static aoff64_t ba_ltop(devcon_t *, aoff64_t); 96 96 97 static devcon_t *devcon_search( devmap_handle_t devmap_handle)97 static devcon_t *devcon_search(service_id_t service_id) 98 98 { 99 99 fibril_mutex_lock(&dcl_lock); … … 101 101 list_foreach(dcl, cur) { 102 102 devcon_t *devcon = list_get_instance(cur, devcon_t, link); 103 if (devcon-> devmap_handle == devmap_handle) {103 if (devcon->service_id == service_id) { 104 104 fibril_mutex_unlock(&dcl_lock); 105 105 return devcon; … … 111 111 } 112 112 113 static int devcon_add( devmap_handle_t devmap_handle, async_sess_t *sess,113 static int devcon_add(service_id_t service_id, async_sess_t *sess, 114 114 size_t bsize, void *comm_area, size_t comm_size) 115 115 { … … 124 124 125 125 link_initialize(&devcon->link); 126 devcon-> devmap_handle = devmap_handle;126 devcon->service_id = service_id; 127 127 devcon->sess = sess; 128 128 fibril_mutex_initialize(&devcon->comm_area_lock); … … 137 137 list_foreach(dcl, cur) { 138 138 devcon_t *d = list_get_instance(cur, devcon_t, link); 139 if (d-> devmap_handle == devmap_handle) {139 if (d->service_id == service_id) { 140 140 fibril_mutex_unlock(&dcl_lock); 141 141 free(devcon); … … 155 155 } 156 156 157 int block_init(exch_mgmt_t mgmt, devmap_handle_t devmap_handle,157 int block_init(exch_mgmt_t mgmt, service_id_t service_id, 158 158 size_t comm_size) 159 159 { … … 163 163 return ENOMEM; 164 164 165 async_sess_t *sess = devmap_device_connect(mgmt, devmap_handle,165 async_sess_t *sess = loc_service_connect(mgmt, service_id, 166 166 IPC_FLAG_BLOCKING); 167 167 if (!sess) { … … 190 190 } 191 191 192 rc = devcon_add( devmap_handle, sess, bsize, comm_area, comm_size);192 rc = devcon_add(service_id, sess, bsize, comm_area, comm_size); 193 193 if (rc != EOK) { 194 194 munmap(comm_area, comm_size); … … 200 200 } 201 201 202 void block_fini( devmap_handle_t devmap_handle)203 { 204 devcon_t *devcon = devcon_search( devmap_handle);202 void block_fini(service_id_t service_id) 203 { 204 devcon_t *devcon = devcon_search(service_id); 205 205 assert(devcon); 206 206 207 207 if (devcon->cache) 208 (void) block_cache_fini( devmap_handle);208 (void) block_cache_fini(service_id); 209 209 210 210 devcon_remove(devcon); … … 219 219 } 220 220 221 int block_bb_read( devmap_handle_t devmap_handle, aoff64_t ba)221 int block_bb_read(service_id_t service_id, aoff64_t ba) 222 222 { 223 223 void *bb_buf; 224 224 int rc; 225 225 226 devcon_t *devcon = devcon_search( devmap_handle);226 devcon_t *devcon = devcon_search(service_id); 227 227 if (!devcon) 228 228 return ENOENT; … … 249 249 } 250 250 251 void *block_bb_get( devmap_handle_t devmap_handle)252 { 253 devcon_t *devcon = devcon_search( devmap_handle);251 void *block_bb_get(service_id_t service_id) 252 { 253 devcon_t *devcon = devcon_search(service_id); 254 254 assert(devcon); 255 255 return devcon->bb_buf; … … 277 277 }; 278 278 279 int block_cache_init( devmap_handle_t devmap_handle, size_t size, unsigned blocks,279 int block_cache_init(service_id_t service_id, size_t size, unsigned blocks, 280 280 enum cache_mode mode) 281 281 { 282 devcon_t *devcon = devcon_search( devmap_handle);282 devcon_t *devcon = devcon_search(service_id); 283 283 cache_t *cache; 284 284 if (!devcon) … … 315 315 } 316 316 317 int block_cache_fini( devmap_handle_t devmap_handle)318 { 319 devcon_t *devcon = devcon_search( devmap_handle);317 int block_cache_fini(service_id_t service_id) 318 { 319 devcon_t *devcon = devcon_search(service_id); 320 320 cache_t *cache; 321 321 int rc; … … 387 387 * @param block Pointer to where the function will store the 388 388 * block pointer on success. 389 * @param devmap_handle Device handleof the block device.389 * @param service_id Service ID of the block device. 390 390 * @param ba Block address (logical). 391 391 * @param flags If BLOCK_FLAGS_NOREAD is specified, block_get() … … 395 395 * @return EOK on success or a negative error code. 396 396 */ 397 int block_get(block_t **block, devmap_handle_t devmap_handle, aoff64_t ba, int flags)397 int block_get(block_t **block, service_id_t service_id, aoff64_t ba, int flags) 398 398 { 399 399 devcon_t *devcon; … … 408 408 int rc; 409 409 410 devcon = devcon_search( devmap_handle);410 devcon = devcon_search(service_id); 411 411 412 412 assert(devcon); … … 536 536 537 537 block_initialize(b); 538 b-> devmap_handle = devmap_handle;538 b->service_id = service_id; 539 539 b->size = cache->lblock_size; 540 540 b->lba = ba; … … 586 586 int block_put(block_t *block) 587 587 { 588 devcon_t *devcon = devcon_search(block-> devmap_handle);588 devcon_t *devcon = devcon_search(block->service_id); 589 589 cache_t *cache; 590 590 unsigned blocks_cached; … … 687 687 /** Read sequential data from a block device. 688 688 * 689 * @param devmap_handle Device handleof the block device.689 * @param service_id Service ID of the block device. 690 690 * @param bufpos Pointer to the first unread valid offset within the 691 691 * communication buffer. … … 699 699 * @return EOK on success or a negative return code on failure. 700 700 */ 701 int block_seqread( devmap_handle_t devmap_handle, size_t *bufpos, size_t *buflen,701 int block_seqread(service_id_t service_id, size_t *bufpos, size_t *buflen, 702 702 aoff64_t *pos, void *dst, size_t size) 703 703 { … … 707 707 devcon_t *devcon; 708 708 709 devcon = devcon_search( devmap_handle);709 devcon = devcon_search(service_id); 710 710 assert(devcon); 711 711 block_size = devcon->pblock_size; … … 753 753 /** Read blocks directly from device (bypass cache). 754 754 * 755 * @param devmap_handle Device handleof the block device.755 * @param service_id Service ID of the block device. 756 756 * @param ba Address of first block (physical). 757 757 * @param cnt Number of blocks. … … 760 760 * @return EOK on success or negative error code on failure. 761 761 */ 762 int block_read_direct( devmap_handle_t devmap_handle, aoff64_t ba, size_t cnt, void *buf)762 int block_read_direct(service_id_t service_id, aoff64_t ba, size_t cnt, void *buf) 763 763 { 764 764 devcon_t *devcon; 765 765 int rc; 766 766 767 devcon = devcon_search( devmap_handle);767 devcon = devcon_search(service_id); 768 768 assert(devcon); 769 769 … … 781 781 /** Write blocks directly to device (bypass cache). 782 782 * 783 * @param devmap_handle Device handleof the block device.783 * @param service_id Service ID of the block device. 784 784 * @param ba Address of first block (physical). 785 785 * @param cnt Number of blocks. … … 788 788 * @return EOK on success or negative error code on failure. 789 789 */ 790 int block_write_direct( devmap_handle_t devmap_handle, aoff64_t ba, size_t cnt,790 int block_write_direct(service_id_t service_id, aoff64_t ba, size_t cnt, 791 791 const void *data) 792 792 { … … 794 794 int rc; 795 795 796 devcon = devcon_search( devmap_handle);796 devcon = devcon_search(service_id); 797 797 assert(devcon); 798 798 … … 809 809 /** Get device block size. 810 810 * 811 * @param devmap_handle Device handleof the block device.811 * @param service_id Service ID of the block device. 812 812 * @param bsize Output block size. 813 813 * 814 814 * @return EOK on success or negative error code on failure. 815 815 */ 816 int block_get_bsize( devmap_handle_t devmap_handle, size_t *bsize)816 int block_get_bsize(service_id_t service_id, size_t *bsize) 817 817 { 818 818 devcon_t *devcon; 819 819 820 devcon = devcon_search( devmap_handle);820 devcon = devcon_search(service_id); 821 821 assert(devcon); 822 822 … … 826 826 /** Get number of blocks on device. 827 827 * 828 * @param devmap_handle Device handleof the block device.828 * @param service_id Service ID of the block device. 829 829 * @param nblocks Output number of blocks. 830 830 * 831 831 * @return EOK on success or negative error code on failure. 832 832 */ 833 int block_get_nblocks( devmap_handle_t devmap_handle, aoff64_t *nblocks)834 { 835 devcon_t *devcon = devcon_search( devmap_handle);833 int block_get_nblocks(service_id_t service_id, aoff64_t *nblocks) 834 { 835 devcon_t *devcon = devcon_search(service_id); 836 836 assert(devcon); 837 837 … … 841 841 /** Read bytes directly from the device (bypass cache) 842 842 * 843 * @param devmap_handle Device handleof the block device.843 * @param service_id Service ID of the block device. 844 844 * @param abs_offset Absolute offset in bytes where to start reading 845 845 * @param bytes Number of bytes to read … … 848 848 * @return EOK on success or negative error code on failure. 849 849 */ 850 int block_read_bytes_direct( devmap_handle_t devmap_handle, aoff64_t abs_offset,850 int block_read_bytes_direct(service_id_t service_id, aoff64_t abs_offset, 851 851 size_t bytes, void *data) 852 852 { … … 860 860 size_t offset; 861 861 862 rc = block_get_bsize( devmap_handle, &phys_block_size);862 rc = block_get_bsize(service_id, &phys_block_size); 863 863 if (rc != EOK) { 864 864 return rc; … … 878 878 } 879 879 880 rc = block_read_direct( devmap_handle, first_block, blocks, buffer);880 rc = block_read_direct(service_id, first_block, blocks, buffer); 881 881 if (rc != EOK) { 882 882 free(buffer); … … 912 912 printf("Error %d reading %zu blocks starting at block %" PRIuOFF64 913 913 " from device handle %" PRIun "\n", rc, cnt, ba, 914 devcon-> devmap_handle);914 devcon->service_id); 915 915 #ifndef NDEBUG 916 916 stacktrace_print(); … … 941 941 if (rc != EOK) { 942 942 printf("Error %d writing %zu blocks starting at block %" PRIuOFF64 943 " to device handle %" PRIun "\n", rc, cnt, ba, devcon-> devmap_handle);943 " to device handle %" PRIun "\n", rc, cnt, ba, devcon->service_id); 944 944 #ifndef NDEBUG 945 945 stacktrace_print(); -
uspace/lib/block/libblock.h
re0e922d rdb6e419 1 1 /* 2 2 * Copyright (c) 2008 Jakub Jermar 3 * Copyright (c) 2008 Martin Decky 4 * Copyright (c) 2011 Martin Sucha 3 * Copyright (c) 2008 Martin Decky 4 * Copyright (c) 2011 Martin Sucha 5 5 * All rights reserved. 6 6 * … … 73 73 /** Readers / Writer lock protecting the contents of the block. */ 74 74 fibril_rwlock_t contents_lock; 75 /** Handle of the device where the block resides. */76 devmap_handle_t devmap_handle;75 /** Service ID of service providing the block device. */ 76 service_id_t service_id; 77 77 /** Logical block address */ 78 78 aoff64_t lba; … … 97 97 }; 98 98 99 extern int block_init(exch_mgmt_t, devmap_handle_t, size_t);100 extern void block_fini( devmap_handle_t);99 extern int block_init(exch_mgmt_t, service_id_t, size_t); 100 extern void block_fini(service_id_t); 101 101 102 extern int block_bb_read( devmap_handle_t, aoff64_t);103 extern void *block_bb_get( devmap_handle_t);102 extern int block_bb_read(service_id_t, aoff64_t); 103 extern void *block_bb_get(service_id_t); 104 104 105 extern int block_cache_init( devmap_handle_t, size_t, unsigned, enum cache_mode);106 extern int block_cache_fini( devmap_handle_t);105 extern int block_cache_init(service_id_t, size_t, unsigned, enum cache_mode); 106 extern int block_cache_fini(service_id_t); 107 107 108 extern int block_get(block_t **, devmap_handle_t, aoff64_t, int);108 extern int block_get(block_t **, service_id_t, aoff64_t, int); 109 109 extern int block_put(block_t *); 110 110 111 extern int block_seqread( devmap_handle_t, size_t *, size_t *, aoff64_t *, void *,111 extern int block_seqread(service_id_t, size_t *, size_t *, aoff64_t *, void *, 112 112 size_t); 113 113 114 extern int block_get_bsize( devmap_handle_t, size_t *);115 extern int block_get_nblocks( devmap_handle_t, aoff64_t *);116 extern int block_read_direct( devmap_handle_t, aoff64_t, size_t, void *);117 extern int block_read_bytes_direct( devmap_handle_t, aoff64_t, size_t, void *);118 extern int block_write_direct( devmap_handle_t, aoff64_t, size_t, const void *);114 extern int block_get_bsize(service_id_t, size_t *); 115 extern int block_get_nblocks(service_id_t, aoff64_t *); 116 extern int block_read_direct(service_id_t, aoff64_t, size_t, void *); 117 extern int block_read_bytes_direct(service_id_t, aoff64_t, size_t, void *); 118 extern int block_write_direct(service_id_t, aoff64_t, size_t, const void *); 119 119 120 120 #endif -
uspace/lib/c/Makefile
re0e922d rdb6e419 31 31 ROOT_PATH = $(USPACE_PREFIX)/.. 32 32 33 INCLUDE_KERNEL = include/kernel 34 INCLUDE_ARCH = include/arch 33 INCLUDE_ABI = include/abi 35 34 INCLUDE_LIBARCH = include/libarch 36 35 … … 47 46 $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld 48 47 49 PRE_DEPEND = $(INCLUDE_ KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH)48 PRE_DEPEND = $(INCLUDE_ABI) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH) 50 49 EXTRA_OUTPUT = $(LINKER_SCRIPTS) 51 EXTRA_CLEAN = $(INCLUDE_ KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH) $(LINKER_SCRIPTS)50 EXTRA_CLEAN = $(INCLUDE_ABI) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH) $(LINKER_SCRIPTS) 52 51 LIBRARY = libc 53 52 SLIBRARY = libc.so.0.0 … … 65 64 generic/cap.c \ 66 65 generic/clipboard.c \ 67 generic/devmap.c \68 66 generic/devman.c \ 69 67 generic/device/hw_res.c \ … … 72 70 generic/event.c \ 73 71 generic/errno.c \ 72 generic/loc.c \ 74 73 generic/mem.c \ 75 74 generic/str.c \ … … 144 143 include $(USPACE_PREFIX)/Makefile.common 145 144 146 $(INCLUDE_ARCH): $(INCLUDE_KERNEL) $(INCLUDE_KERNEL)/arch147 ln -sfn kernel/arch $@148 149 145 $(INCLUDE_LIBARCH): arch/$(UARCH)/include 150 146 ln -sfn ../$< $@ 151 147 152 $(INCLUDE_KERNEL)/arch: ../../../kernel/generic/include/arch $(INCLUDE_KERNEL) 153 154 $(INCLUDE_KERNEL): ../../../kernel/generic/include/ 148 $(INCLUDE_ABI): ../../../abi/include/ 155 149 ln -sfn ../$< $@ 156 150 -
uspace/lib/c/arch/abs32le/include/istate.h
-
Property mode
changed from
100644to120000
re0e922d rdb6e419 1 /* 2 * Copyright (c) 2010 Martin Decky 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** @addtogroup debug 30 * @{ 31 */ 32 /** @file 33 */ 34 35 #ifndef LIBC_abs32le__ISTATE_H_ 36 #define LIBC_abs32le__ISTATE_H_ 37 38 #include <arch/istate.h> 39 40 #endif 41 42 /** @} 43 */ 1 ../../../../../../kernel/arch/abs32le/include/istate.h -
Property mode
changed from
-
uspace/lib/c/arch/abs32le/include/syscall.h
re0e922d rdb6e419 38 38 39 39 #include <sys/types.h> 40 #include < kernel/syscall/syscall.h>40 #include <abi/syscall.h> 41 41 42 42 #define __syscall0 __syscall -
uspace/lib/c/arch/amd64/include/elf_linux.h
re0e922d rdb6e419 30 30 * @{ 31 31 */ 32 /** @file 32 /** @file Definitions needed to write core files in Linux-ELF format. 33 33 */ 34 34 … … 39 39 #include <sys/types.h> 40 40 41 /** Linux kernel struct pt_regs structure. 42 * 43 * We need this to save register state to a core file in Linux format 44 * (readable by GDB configured for Linux target). 45 */ 41 46 typedef struct { 42 /* TODO */ 43 uint64_t pad[16]; 47 uint64_t r15; 48 uint64_t r14; 49 uint64_t r13; 50 uint64_t r12; 51 uint64_t rbp; 52 uint64_t rbx; 53 uint64_t r11; 54 uint64_t r10; 55 uint64_t r9; 56 uint64_t r8; 57 uint64_t rax; 58 uint64_t rcx; 59 uint64_t rdx; 60 uint64_t rsi; 61 uint64_t rdi; 62 uint64_t old_rax; 63 uint64_t rip; 64 uint64_t cs; 65 uint64_t rflags; 66 uint64_t rsp; 67 uint64_t ss; 44 68 } elf_regs_t; 45 69 70 /** Convert istate_t to elf_regs_t. */ 46 71 static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs) 47 72 { 48 /* TODO */ 49 (void) istate; (void) elf_regs; 73 elf_regs->r15 = istate->r15; 74 elf_regs->r14 = istate->r14; 75 elf_regs->r13 = istate->r13; 76 elf_regs->r12 = istate->r12; 77 elf_regs->rbp = istate->rbp; 78 elf_regs->rbx = istate->rbx; 79 elf_regs->r11 = istate->r11; 80 elf_regs->r10 = istate->r10; 81 elf_regs->r9 = istate->r9; 82 elf_regs->r8 = istate->r8; 83 elf_regs->rax = istate->rax; 84 elf_regs->rcx = istate->rcx; 85 elf_regs->rdx = istate->rdx; 86 elf_regs->rsi = istate->rsi; 87 elf_regs->rdi = istate->rdi; 88 elf_regs->rip = istate->rip; 89 elf_regs->cs = istate->cs; 90 elf_regs->rflags = istate->rflags; 91 elf_regs->rsp = istate->rsp; 92 elf_regs->ss = istate->ss; 50 93 } 51 94 -
uspace/lib/c/arch/amd64/include/istate.h
-
Property mode
changed from
100644to120000
re0e922d rdb6e419 1 /* 2 * Copyright (c) 2010 Jiri Svoboda 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** @addtogroup libcamd64 30 * @{ 31 */ 32 /** @file 33 */ 34 35 #ifndef LIBC_amd64_ISTATE_H_ 36 #define LIBC_amd64_ISTATE_H_ 37 38 #include <arch/istate.h> 39 40 #endif 41 42 /** @} 43 */ 1 ../../../../../../kernel/arch/amd64/include/istate.h -
Property mode
changed from
-
uspace/lib/c/arch/amd64/src/fibril.S
re0e922d rdb6e419 32 32 .global context_restore 33 33 34 #include < kernel/arch/context_offset.h>34 #include <libarch/context_offset.h> 35 35 36 36 ## Save current CPU context -
uspace/lib/c/arch/arm32/include/elf_linux.h
re0e922d rdb6e419 30 30 * @{ 31 31 */ 32 /** @file 32 /** @file Definitions needed to write core files in Linux-ELF format. 33 33 */ 34 34 … … 39 39 #include <sys/types.h> 40 40 41 /** Linux kernel struct pt_regs structure. 42 * 43 * We need this to save register state to a core file in Linux format 44 * (readable by GDB configured for Linux target). 45 */ 41 46 typedef struct { 42 /* TODO */ 43 uint32_t pad[16]; 47 uint32_t r0; 48 uint32_t r1; 49 uint32_t r2; 50 uint32_t r3; 51 uint32_t r4; 52 uint32_t r5; 53 uint32_t r6; 54 uint32_t r7; 55 uint32_t r8; 56 uint32_t r9; 57 uint32_t r10; 58 uint32_t fp; 59 uint32_t r12; 60 uint32_t sp; 61 uint32_t lr; 62 uint32_t pc; 63 uint32_t cpsr; 64 uint32_t old_r0; 44 65 } elf_regs_t; 45 66 67 /** Convert istate_t to elf_regs_t. */ 46 68 static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs) 47 69 { 48 /* TODO */ 49 (void) istate; (void) elf_regs; 70 elf_regs->r0 = istate->r0; 71 elf_regs->r1 = istate->r1; 72 elf_regs->r2 = istate->r2; 73 elf_regs->r3 = istate->r3; 74 elf_regs->r4 = istate->r4; 75 elf_regs->r5 = istate->r5; 76 elf_regs->r6 = istate->r6; 77 elf_regs->r7 = istate->r7; 78 elf_regs->r8 = istate->r8; 79 elf_regs->r9 = istate->r9; 80 elf_regs->r10 = istate->r10; 81 82 elf_regs->fp = istate->fp; 83 elf_regs->r12 = istate->r12; 84 elf_regs->sp = istate->sp; 85 elf_regs->lr = istate->lr; 86 elf_regs->pc = istate->pc; 87 elf_regs->cpsr = istate->spsr; 88 elf_regs->old_r0 = 0; 50 89 } 51 90 -
uspace/lib/c/arch/arm32/include/istate.h
-
Property mode
changed from
100644to120000
re0e922d rdb6e419 1 /* 2 * Copyright (c) 2010 Jiri Svoboda 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** @addtogroup libcarm32 30 * @{ 31 */ 32 /** @file 33 */ 34 35 #ifndef LIBC_arm32__ISTATE_H_ 36 #define LIBC_arm32__ISTATE_H_ 37 38 #include <arch/istate.h> 39 40 #endif 41 42 /** @} 43 */ 1 ../../../../../../kernel/arch/arm32/include/istate.h -
Property mode
changed from
-
uspace/lib/c/arch/ia32/include/elf_linux.h
re0e922d rdb6e419 30 30 * @{ 31 31 */ 32 /** @file 32 /** @file Definitions needed to write core files in Linux-ELF format. 33 33 */ 34 34 … … 39 39 #include <sys/types.h> 40 40 41 /** Linux kernel struct pt_regs structure. 42 * 43 * We need this to save register state to a core file in Linux format 44 * (readable by GDB configured for Linux target). 45 */ 41 46 typedef struct { 42 47 uint32_t ebx; … … 59 64 } elf_regs_t; 60 65 66 /** Convert istate_t to elf_regs_t. */ 61 67 static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs) 62 68 { -
uspace/lib/c/arch/ia32/include/istate.h
-
Property mode
changed from
100644to120000
re0e922d rdb6e419 1 /* 2 * Copyright (c) 2010 Jiri Svoboda 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** @addtogroup debug 30 * @{ 31 */ 32 /** @file 33 */ 34 35 #ifndef LIBC_ia32__ISTATE_H_ 36 #define LIBC_ia32__ISTATE_H_ 37 38 #include <arch/istate.h> 39 40 #endif 41 42 /** @} 43 */ 1 ../../../../../../kernel/arch/ia32/include/istate.h -
Property mode
changed from
-
uspace/lib/c/arch/ia32/include/syscall.h
re0e922d rdb6e419 38 38 39 39 #include <sys/types.h> 40 #include < kernel/syscall/syscall.h>40 #include <abi/syscall.h> 41 41 42 42 #define __syscall0 __syscall_fast_func -
uspace/lib/c/arch/ia32/src/fibril.S
re0e922d rdb6e419 27 27 # 28 28 29 #include < kernel/arch/context_offset.h>29 #include <libarch/context_offset.h> 30 30 31 31 .text -
uspace/lib/c/arch/ia32/src/setjmp.S
re0e922d rdb6e419 27 27 # 28 28 29 #include < kernel/arch/context_offset.h>29 #include <libarch/context_offset.h> 30 30 31 31 .text -
uspace/lib/c/arch/ia64/include/istate.h
-
Property mode
changed from
100644to120000
re0e922d rdb6e419 1 /* 2 * Copyright (c) 2010 Jiri Svoboda 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** @addtogroup libcsparc64 30 * @{ 31 */ 32 /** @file 33 */ 34 35 #ifndef LIBC_ia64_ISTATE_H_ 36 #define LIBC_ia64_ISTATE_H_ 37 38 #include <arch/istate.h> 39 40 #endif 41 42 /** @} 43 */ 1 ../../../../../../kernel/arch/ia64/include/istate.h -
Property mode
changed from
-
uspace/lib/c/arch/mips32/include/elf_linux.h
re0e922d rdb6e419 30 30 * @{ 31 31 */ 32 /** @file 32 /** @file Definitions needed to write core files in Linux-ELF format. 33 33 */ 34 34 … … 39 39 #include <sys/types.h> 40 40 41 /** Linux kernel struct pt_regs structure. 42 * 43 * We need this to save register state to a core file in Linux format 44 * (readable by GDB configured for Linux target). 45 */ 41 46 typedef struct { 42 /* TODO */ 43 uint32_t pad[16]; 47 uint32_t pad0[6]; 48 49 uint32_t r0; 50 uint32_t r1; 51 uint32_t r2; 52 uint32_t r3; 53 uint32_t r4; 54 uint32_t r5; 55 uint32_t r6; 56 uint32_t r7; 57 uint32_t r8; 58 uint32_t r9; 59 uint32_t r10; 60 uint32_t r11; 61 uint32_t r12; 62 uint32_t r13; 63 uint32_t r14; 64 uint32_t r15; 65 uint32_t r16; 66 uint32_t r17; 67 uint32_t r18; 68 uint32_t r19; 69 uint32_t r20; 70 uint32_t r21; 71 uint32_t r22; 72 uint32_t r23; 73 uint32_t r24; 74 uint32_t r25; 75 uint32_t r26; 76 uint32_t r27; 77 uint32_t r28; 78 uint32_t r29; 79 uint32_t r30; 80 uint32_t r31; 81 82 uint32_t cp0_status; 83 uint32_t hi; 84 uint32_t lo; 85 uint32_t cp0_badvaddr; 86 uint32_t cp0_cause; 87 uint32_t cp0_epc; 44 88 } elf_regs_t; 45 89 90 /** Convert istate_t to elf_regs_t. */ 46 91 static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs) 47 92 { 48 /* TODO */ 49 (void) istate; (void) elf_regs; 93 elf_regs->r1 = istate->at; 94 elf_regs->r2 = istate->v0; 95 elf_regs->r3 = istate->v1; 96 elf_regs->r4 = istate->a0; 97 elf_regs->r5 = istate->a1; 98 elf_regs->r6 = istate->a2; 99 elf_regs->r7 = istate->a3; 100 elf_regs->r8 = istate->t0; 101 elf_regs->r9 = istate->t1; 102 elf_regs->r10 = istate->t2; 103 elf_regs->r11 = istate->t3; 104 elf_regs->r12 = istate->t4; 105 elf_regs->r13 = istate->t5; 106 elf_regs->r14 = istate->t6; 107 elf_regs->r15 = istate->t7; 108 elf_regs->r16 = istate->s0; 109 elf_regs->r17 = istate->s1; 110 elf_regs->r18 = istate->s2; 111 elf_regs->r19 = istate->s3; 112 elf_regs->r20 = istate->s4; 113 elf_regs->r21 = istate->s5; 114 elf_regs->r22 = istate->s6; 115 elf_regs->r23 = istate->s7; 116 elf_regs->r24 = istate->t8; 117 elf_regs->r25 = istate->t9; 118 elf_regs->r26 = istate->kt0; 119 elf_regs->r27 = istate->kt1; 120 elf_regs->r28 = istate->gp; 121 elf_regs->r29 = istate->sp; 122 elf_regs->r30 = istate->s8; 123 elf_regs->r31 = istate->ra; 124 125 elf_regs->cp0_status = istate->status; 126 elf_regs->hi = istate->hi; 127 elf_regs->lo = istate->lo; 128 elf_regs->cp0_epc = istate->epc; 50 129 } 51 130 -
uspace/lib/c/arch/mips32/include/istate.h
-
Property mode
changed from
100644to120000
re0e922d rdb6e419 1 /* 2 * Copyright (c) 2010 Jiri Svoboda 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** @addtogroup libcmips32 30 * @{ 31 */ 32 /** @file 33 */ 34 35 #ifndef LIBC_mips32__ISTATE_H_ 36 #define LIBC_mips32__ISTATE_H_ 37 38 #include <arch/istate.h> 39 40 #endif 41 42 /** @} 43 */ 1 ../../../../../../kernel/arch/mips32/include/istate.h -
Property mode
changed from
-
uspace/lib/c/arch/mips32/src/fibril.S
re0e922d rdb6e419 32 32 .set noreorder 33 33 34 #include < arch/context_offset.h>34 #include <libarch/context_offset.h> 35 35 36 36 .global context_save -
uspace/lib/c/arch/mips64/include/istate.h
-
Property mode
changed from
100644to120000
re0e922d rdb6e419 1 /* 2 * Copyright (c) 2010 Jiri Svoboda 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** @addtogroup libcmips64 30 * @{ 31 */ 32 /** @file 33 */ 34 35 #ifndef LIBC_mips64__ISTATE_H_ 36 #define LIBC_mips64__ISTATE_H_ 37 38 #include <arch/istate.h> 39 40 #endif 41 42 /** @} 43 */ 1 ../../../../../../kernel/arch/mips64/include/istate.h -
Property mode
changed from
-
uspace/lib/c/arch/mips64/src/fibril.S
re0e922d rdb6e419 32 32 .set noreorder 33 33 34 #include < arch/context_offset.h>34 #include <libarch/context_offset.h> 35 35 36 36 .global context_save -
uspace/lib/c/arch/ppc32/include/elf_linux.h
re0e922d rdb6e419 30 30 * @{ 31 31 */ 32 /** @file 32 /** @file Definitions needed to write core files in Linux-ELF format. 33 33 */ 34 34 … … 39 39 #include <sys/types.h> 40 40 41 /** Linux kernel struct pt_regs structure. 42 * 43 * We need this to save register state to a core file in Linux format 44 * (readable by GDB configured for Linux target). 45 */ 41 46 typedef struct { 42 /* TODO */ 43 uint32_t pad[16]; 47 uint32_t r0; 48 uint32_t r1; 49 uint32_t r2; 50 uint32_t r3; 51 uint32_t r4; 52 uint32_t r5; 53 uint32_t r6; 54 uint32_t r7; 55 uint32_t r8; 56 uint32_t r9; 57 uint32_t r10; 58 uint32_t r11; 59 uint32_t r12; 60 uint32_t r13; 61 uint32_t r14; 62 uint32_t r15; 63 uint32_t r16; 64 uint32_t r17; 65 uint32_t r18; 66 uint32_t r19; 67 uint32_t r20; 68 uint32_t r21; 69 uint32_t r22; 70 uint32_t r23; 71 uint32_t r24; 72 uint32_t r25; 73 uint32_t r26; 74 uint32_t r27; 75 uint32_t r28; 76 uint32_t r29; 77 uint32_t r30; 78 uint32_t r31; 79 80 uint32_t nip; 81 uint32_t msr; 82 uint32_t old_r3; 83 uint32_t ctr; 84 uint32_t link; 85 uint32_t xer; 86 uint32_t ccr; 87 uint32_t mq; 88 uint32_t trap; 89 uint32_t dar; 90 uint32_t dsisr; 91 uint32_t result; 44 92 } elf_regs_t; 45 93 94 /** Convert istate_t to elf_regs_t. */ 46 95 static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs) 47 96 { 48 /* TODO */ 49 (void) istate; (void) elf_regs; 97 elf_regs->r0 = istate->r0; 98 elf_regs->r1 = istate->sp; 99 elf_regs->r2 = istate->r2; 100 elf_regs->r3 = istate->r3; 101 elf_regs->r4 = istate->r4; 102 elf_regs->r5 = istate->r5; 103 elf_regs->r6 = istate->r6; 104 elf_regs->r7 = istate->r7; 105 elf_regs->r8 = istate->r8; 106 elf_regs->r9 = istate->r9; 107 elf_regs->r10 = istate->r10; 108 elf_regs->r11 = istate->r11; 109 elf_regs->r12 = istate->r12; 110 elf_regs->r13 = istate->r13; 111 elf_regs->r14 = istate->r14; 112 elf_regs->r15 = istate->r15; 113 elf_regs->r16 = istate->r16; 114 elf_regs->r17 = istate->r17; 115 elf_regs->r18 = istate->r18; 116 elf_regs->r19 = istate->r19; 117 elf_regs->r20 = istate->r20; 118 elf_regs->r21 = istate->r21; 119 elf_regs->r22 = istate->r22; 120 elf_regs->r23 = istate->r23; 121 elf_regs->r24 = istate->r24; 122 elf_regs->r25 = istate->r25; 123 elf_regs->r26 = istate->r26; 124 elf_regs->r27 = istate->r27; 125 elf_regs->r28 = istate->r28; 126 elf_regs->r29 = istate->r29; 127 elf_regs->r30 = istate->r30; 128 elf_regs->r31 = istate->r31; 129 130 elf_regs->ctr = istate->ctr; 131 elf_regs->link = istate->lr; 132 elf_regs->xer = istate->xer; 133 elf_regs->ccr = istate->cr; 134 elf_regs->dar = istate->dar; 50 135 } 51 136 -
uspace/lib/c/arch/ppc32/include/istate.h
-
Property mode
changed from
100644to120000
re0e922d rdb6e419 1 /* 2 * Copyright (c) 2010 Jiri Svoboda 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** @addtogroup libcppc32 30 * @{ 31 */ 32 /** @file 33 */ 34 35 #ifndef LIBC_ppc32_ISTATE_H_ 36 #define LIBC_ppc32_ISTATE_H_ 37 38 #include <sys/types.h> 39 40 /** Interrupt context. 41 * 42 * This is a copy of the kernel definition with which it must be kept in sync. 43 */ 44 typedef struct istate { 45 uint32_t r0; 46 uint32_t r2; 47 uint32_t r3; 48 uint32_t r4; 49 uint32_t r5; 50 uint32_t r6; 51 uint32_t r7; 52 uint32_t r8; 53 uint32_t r9; 54 uint32_t r10; 55 uint32_t r11; 56 uint32_t r13; 57 uint32_t r14; 58 uint32_t r15; 59 uint32_t r16; 60 uint32_t r17; 61 uint32_t r18; 62 uint32_t r19; 63 uint32_t r20; 64 uint32_t r21; 65 uint32_t r22; 66 uint32_t r23; 67 uint32_t r24; 68 uint32_t r25; 69 uint32_t r26; 70 uint32_t r27; 71 uint32_t r28; 72 uint32_t r29; 73 uint32_t r30; 74 uint32_t r31; 75 uint32_t cr; 76 uint32_t pc; 77 uint32_t srr1; 78 uint32_t lr; 79 uint32_t ctr; 80 uint32_t xer; 81 uint32_t dar; 82 uint32_t r12; 83 uint32_t sp; 84 } istate_t; 85 86 static inline uintptr_t istate_get_pc(istate_t *istate) 87 { 88 return istate->pc; 89 } 90 91 static inline uintptr_t istate_get_fp(istate_t *istate) 92 { 93 return istate->sp; 94 } 95 96 #endif 97 98 /** @} 99 */ 1 ../../../../../../kernel/arch/ppc32/include/istate.h -
Property mode
changed from
-
uspace/lib/c/arch/ppc32/src/fibril.S
re0e922d rdb6e419 33 33 34 34 #include <libarch/regname.h> 35 #include < arch/context_offset.h>35 #include <libarch/context_offset.h> 36 36 37 37 context_save: -
uspace/lib/c/arch/sparc64/include/istate.h
-
Property mode
changed from
100644to120000
re0e922d rdb6e419 1 /* 2 * Copyright (c) 2010 Jiri Svoboda 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** @addtogroup libcsparc64 30 * @{ 31 */ 32 /** @file 33 */ 34 35 #ifndef LIBC_sparc64_ISTATE_H_ 36 #define LIBC_sparc64_ISTATE_H_ 37 38 #include <arch/istate.h> 39 40 #endif 41 42 /** @} 43 */ 1 ../../../../../../kernel/arch/sparc64/include/istate.h -
Property mode
changed from
-
uspace/lib/c/arch/sparc64/include/syscall.h
re0e922d rdb6e419 37 37 38 38 #include <sys/types.h> 39 #include < kernel/syscall/syscall.h>39 #include <abi/syscall.h> 40 40 41 41 #define __syscall0 __syscall -
uspace/lib/c/arch/sparc64/src/fibril.S
re0e922d rdb6e419 27 27 # 28 28 29 #include < kernel/arch/context_offset.h>29 #include <libarch/context_offset.h> 30 30 31 .text 31 .text 32 32 33 33 .global context_save -
uspace/lib/c/generic/async.c
re0e922d rdb6e419 107 107 #include <errno.h> 108 108 #include <sys/time.h> 109 #include < arch/barrier.h>109 #include <libarch/barrier.h> 110 110 #include <bool.h> 111 111 #include <malloc.h> -
uspace/lib/c/generic/ddi.c
re0e922d rdb6e419 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 #include <sys/types.h> 36 #include <abi/ddi/arg.h> 35 37 #include <ddi.h> 36 38 #include <libarch/ddi.h> … … 40 42 #include <align.h> 41 43 #include <libarch/config.h> 42 #include <kernel/ddi/ddi_arg.h>43 44 44 45 /** Return unique device number. -
uspace/lib/c/generic/event.c
re0e922d rdb6e419 39 39 #include <libc.h> 40 40 #include <event.h> 41 #include <kernel/ipc/event_types.h>42 41 43 42 /** Subscribe event notifications. -
uspace/lib/c/generic/fibril.c
re0e922d rdb6e419 41 41 #include <unistd.h> 42 42 #include <stdio.h> 43 #include < arch/barrier.h>43 #include <libarch/barrier.h> 44 44 #include <libarch/faddr.h> 45 45 #include <futex.h> -
uspace/lib/c/generic/io/io.c
re0e922d rdb6e419 45 45 #include <vfs/vfs.h> 46 46 #include <vfs/vfs_sess.h> 47 #include <ipc/ devmap.h>47 #include <ipc/loc.h> 48 48 #include <adt/list.h> 49 49 #include "../private/io.h" -
uspace/lib/c/generic/ns_obsolete.c
re0e922d rdb6e419 36 36 #include <async_obsolete.h> 37 37 #include <ns_obsolete.h> 38 #include < kernel/ipc/ipc_methods.h>38 #include <abi/ipc/methods.h> 39 39 40 40 int service_obsolete_connect(sysarg_t service, sysarg_t arg2, sysarg_t arg3) -
uspace/lib/c/generic/private/thread.h
re0e922d rdb6e419 36 36 #define LIBC_PRIVATE_THREAD_H_ 37 37 38 #include < kernel/proc/uarg.h>38 #include <abi/proc/uarg.h> 39 39 40 40 extern void __thread_entry(void); -
uspace/lib/c/generic/thread.c
re0e922d rdb6e419 37 37 #include <stdlib.h> 38 38 #include <libarch/faddr.h> 39 #include < kernel/proc/uarg.h>39 #include <abi/proc/uarg.h> 40 40 #include <fibril.h> 41 41 #include <str.h> -
uspace/lib/c/generic/time.c
re0e922d rdb6e419 36 36 #include <time.h> 37 37 #include <bool.h> 38 #include < arch/barrier.h>38 #include <libarch/barrier.h> 39 39 #include <macros.h> 40 40 #include <errno.h> -
uspace/lib/c/generic/udebug.c
re0e922d rdb6e419 35 35 #include <udebug.h> 36 36 #include <sys/types.h> 37 #include < kernel/ipc/ipc_methods.h>37 #include <abi/ipc/methods.h> 38 38 #include <async.h> 39 39 -
uspace/lib/c/generic/vfs/vfs.c
re0e922d rdb6e419 51 51 #include <assert.h> 52 52 #include <str.h> 53 #include < devmap.h>53 #include <loc.h> 54 54 #include <ipc/vfs.h> 55 #include <ipc/ devmap.h>55 #include <ipc/loc.h> 56 56 57 57 static FIBRIL_MUTEX_INITIALIZE(vfs_mutex); … … 142 142 } 143 143 144 int mount(const char *fs_name, const char *mp, const char *fq dn,144 int mount(const char *fs_name, const char *mp, const char *fqsn, 145 145 const char *opts, unsigned int flags) 146 146 { 147 147 int null_id = -1; 148 char null[ DEVMAP_NAME_MAXLEN];149 150 if (str_cmp(fq dn, "") == 0) {148 char null[LOC_NAME_MAXLEN]; 149 150 if (str_cmp(fqsn, "") == 0) { 151 151 /* No device specified, create a fresh 152 152 null/%d device instead */ 153 null_id = devmap_null_create();153 null_id = loc_null_create(); 154 154 155 155 if (null_id == -1) 156 156 return ENOMEM; 157 157 158 snprintf(null, DEVMAP_NAME_MAXLEN, "null/%d", null_id);159 fq dn = null;160 } 161 162 devmap_handle_t devmap_handle;163 int res = devmap_device_get_handle(fqdn, &devmap_handle, flags);158 snprintf(null, LOC_NAME_MAXLEN, "null/%d", null_id); 159 fqsn = null; 160 } 161 162 service_id_t service_id; 163 int res = loc_service_get_id(fqsn, &service_id, flags); 164 164 if (res != EOK) { 165 165 if (null_id != -1) 166 devmap_null_destroy(null_id);166 loc_null_destroy(null_id); 167 167 168 168 return res; … … 173 173 if (!mpa) { 174 174 if (null_id != -1) 175 devmap_null_destroy(null_id);175 loc_null_destroy(null_id); 176 176 177 177 return ENOMEM; … … 181 181 182 182 sysarg_t rc_orig; 183 aid_t req = async_send_2(exch, VFS_IN_MOUNT, devmap_handle, flags, NULL);183 aid_t req = async_send_2(exch, VFS_IN_MOUNT, service_id, flags, NULL); 184 184 sysarg_t rc = async_data_write_start(exch, (void *) mpa, mpa_size); 185 185 if (rc != EOK) { … … 189 189 190 190 if (null_id != -1) 191 devmap_null_destroy(null_id);191 loc_null_destroy(null_id); 192 192 193 193 if (rc_orig == EOK) … … 204 204 205 205 if (null_id != -1) 206 devmap_null_destroy(null_id);206 loc_null_destroy(null_id); 207 207 208 208 if (rc_orig == EOK) … … 219 219 220 220 if (null_id != -1) 221 devmap_null_destroy(null_id);221 loc_null_destroy(null_id); 222 222 223 223 if (rc_orig == EOK) … … 235 235 236 236 if (null_id != -1) 237 devmap_null_destroy(null_id);237 loc_null_destroy(null_id); 238 238 239 239 if (rc_orig == EOK) … … 248 248 249 249 if ((rc != EOK) && (null_id != -1)) 250 devmap_null_destroy(null_id);250 loc_null_destroy(null_id); 251 251 252 252 return (int) rc; … … 335 335 ipc_call_t answer; 336 336 aid_t req = async_send_4(exch, VFS_IN_OPEN_NODE, node->fs_handle, 337 node-> devmap_handle, node->index, oflag, &answer);337 node->service_id, node->index, oflag, &answer); 338 338 339 339 vfs_exchange_end(exch); … … 811 811 } 812 812 813 if (!stat. device) {813 if (!stat.service) { 814 814 errno = ENOENT; 815 815 return NULL; 816 816 } 817 817 818 return devmap_device_connect(mgmt, stat.device, 0);818 return loc_service_connect(mgmt, stat.service, 0); 819 819 } 820 820 … … 826 826 if (rc == EOK) { 827 827 node->fs_handle = stat.fs_handle; 828 node-> devmap_handle = stat.devmap_handle;828 node->service_id = stat.service_id; 829 829 node->index = stat.index; 830 830 } -
uspace/lib/c/include/as.h
re0e922d rdb6e419 37 37 38 38 #include <sys/types.h> 39 #include <abi/mm/as.h> 39 40 #include <task.h> 40 #include <kernel/mm/as.h>41 41 #include <libarch/config.h> 42 42 -
uspace/lib/c/include/ddi.h
re0e922d rdb6e419 37 37 38 38 #include <sys/types.h> 39 #include < kernel/ddi/irq.h>39 #include <abi/ddi/irq.h> 40 40 #include <task.h> 41 41 -
uspace/lib/c/include/elf/elf.h
re0e922d rdb6e419 36 36 #define LIBC_ELF_H_ 37 37 38 #include <kernel/lib/elf.h> 38 #include <sys/types.h> 39 #include <abi/elf.h> 40 #include <libarch/elf.h> 39 41 40 42 #endif -
uspace/lib/c/include/elf/elf_load.h
re0e922d rdb6e419 38 38 #define ELF_LOAD_H_ 39 39 40 #include <arch/elf.h>41 40 #include <elf/elf.h> 42 41 #include <sys/types.h> … … 48 47 #define EE_OK 0 /* No error */ 49 48 #define EE_INVALID 1 /* Invalid ELF image */ 50 #define EE_MEMORY 2 /* Cannot allocate address space */49 #define EE_MEMORY 2 /* Cannot allocate address space */ 51 50 #define EE_INCOMPATIBLE 3 /* ELF image is not compatible with current architecture */ 52 51 #define EE_UNSUPPORTED 4 /* Non-supported ELF (e.g. dynamic ELFs) */ -
uspace/lib/c/include/errno.h
re0e922d rdb6e419 36 36 #define LIBC_ERRNO_H_ 37 37 38 #include < kernel/errno.h>38 #include <abi/errno.h> 39 39 #include <fibril.h> 40 40 -
uspace/lib/c/include/event.h
re0e922d rdb6e419 36 36 #define LIBC_EVENT_H_ 37 37 38 #include < kernel/ipc/event_types.h>38 #include <abi/ipc/event.h> 39 39 40 40 extern int event_subscribe(event_type_t, sysarg_t); -
uspace/lib/c/include/ipc/common.h
re0e922d rdb6e419 37 37 38 38 #include <sys/types.h> 39 #include <abi/ipc/ipc.h> 39 40 #include <atomic.h> 40 #include <kernel/ipc/ipc.h>41 41 42 42 #define IPC_FLAG_BLOCKING 0x01 -
uspace/lib/c/include/ipc/devman.h
re0e922d rdb6e419 130 130 DEVMAN_CLIENT, 131 131 DEVMAN_CONNECT_TO_DEVICE, 132 DEVMAN_CONNECT_FROM_ DEVMAP,132 DEVMAN_CONNECT_FROM_LOC, 133 133 DEVMAN_CONNECT_TO_PARENTS_DEVICE 134 134 } devman_interface_t; -
uspace/lib/c/include/ipc/fb.h
re0e922d rdb6e419 55 55 FB_DRAW_TEXT_DATA, 56 56 FB_FLUSH, 57 FB_DRAW_ PPM,57 FB_DRAW_IMGMAP, 58 58 FB_PREPARE_SHM, 59 59 FB_DROP_SHM, 60 FB_SHM2 PIXMAP,61 FB_VP_DRAW_ PIXMAP,62 FB_VP2 PIXMAP,63 FB_DROP_ PIXMAP,60 FB_SHM2IMGMAP, 61 FB_VP_DRAW_IMGMAP, 62 FB_VP2IMGMAP, 63 FB_DROP_IMGMAP, 64 64 FB_ANIM_CREATE, 65 65 FB_ANIM_DROP, 66 FB_ANIM_ADD PIXMAP,66 FB_ANIM_ADDIMGMAP, 67 67 FB_ANIM_CHGVP, 68 68 FB_ANIM_START, -
uspace/lib/c/include/ipc/ipc.h
re0e922d rdb6e419 42 42 #include <sys/types.h> 43 43 #include <ipc/common.h> 44 #include < kernel/ipc/ipc_methods.h>45 #include < kernel/synch/synch.h>44 #include <abi/ipc/methods.h> 45 #include <abi/synch.h> 46 46 #include <task.h> 47 47 -
uspace/lib/c/include/ipc/loc.h
re0e922d rdb6e419 1 1 /* 2 2 * Copyright (c) 2007 Josef Cejka 3 * Copyright (c) 2011 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 27 28 */ 28 29 29 /** @addtogroup devmap30 /** @addtogroup loc 30 31 * @{ 31 32 */ 32 33 33 #ifndef LIBC_IPC_ DEVMAP_H_34 #define LIBC_IPC_ DEVMAP_H_34 #ifndef LIBC_IPC_LOC_H_ 35 #define LIBC_IPC_LOC_H_ 35 36 36 37 #include <ipc/common.h> 37 38 38 #define DEVMAP_NAME_MAXLEN 25539 #define LOC_NAME_MAXLEN 255 39 40 40 typedef sysarg_t devmap_handle_t; 41 typedef sysarg_t service_id_t; 42 typedef sysarg_t category_id_t; 41 43 42 44 typedef enum { 43 DEV_HANDLE_NONE,44 DEV_HANDLE_NAMESPACE,45 DEV_HANDLE_DEVICE46 } devmap_handle_type_t;45 LOC_OBJECT_NONE, 46 LOC_OBJECT_NAMESPACE, 47 LOC_OBJECT_SERVICE 48 } loc_object_type_t; 47 49 48 50 typedef enum { 49 DEVMAP_DRIVER_REGISTER = IPC_FIRST_USER_METHOD, 50 DEVMAP_DRIVER_UNREGISTER, 51 DEVMAP_DEVICE_REGISTER, 52 DEVMAP_DEVICE_UNREGISTER, 53 DEVMAP_DEVICE_GET_HANDLE, 54 DEVMAP_NAMESPACE_GET_HANDLE, 55 DEVMAP_HANDLE_PROBE, 56 DEVMAP_NULL_CREATE, 57 DEVMAP_NULL_DESTROY, 58 DEVMAP_GET_NAMESPACE_COUNT, 59 DEVMAP_GET_DEVICE_COUNT, 60 DEVMAP_GET_NAMESPACES, 61 DEVMAP_GET_DEVICES 62 } devmap_request_t; 51 LOC_SERVER_REGISTER = IPC_FIRST_USER_METHOD, 52 LOC_SERVER_UNREGISTER, 53 LOC_SERVICE_ADD_TO_CAT, 54 LOC_SERVICE_REGISTER, 55 LOC_SERVICE_UNREGISTER, 56 LOC_SERVICE_GET_ID, 57 LOC_SERVICE_GET_NAME, 58 LOC_NAMESPACE_GET_ID, 59 LOC_CATEGORY_GET_ID, 60 LOC_CATEGORY_GET_SVCS, 61 LOC_ID_PROBE, 62 LOC_NULL_CREATE, 63 LOC_NULL_DESTROY, 64 LOC_GET_NAMESPACE_COUNT, 65 LOC_GET_SERVICE_COUNT, 66 LOC_GET_CATEGORIES, 67 LOC_GET_NAMESPACES, 68 LOC_GET_SERVICES 69 } loc_request_t; 63 70 64 /** Interface provided by devmap.71 /** Ports provided by location service. 65 72 * 66 * Every process that connects to devmapmust ask one of following67 * interfacesotherwise connection will be refused.73 * Every process that connects to loc must ask one of following 74 * ports, otherwise connection will be refused. 68 75 * 69 76 */ 70 77 typedef enum { 71 /** Connect as device driver*/72 DEVMAP_DRIVER = 1,73 /** Connect as client */74 DEVMAP_CLIENT,78 /** Service supplier (server) port */ 79 LOC_PORT_SUPPLIER = 1, 80 /** Service consumer (client) port */ 81 LOC_PORT_CONSUMER, 75 82 /** Create new connection to instance of device that 76 83 is specified by second argument of call. */ 77 DEVMAP_CONNECT_TO_DEVICE78 } devmap_interface_t;84 LOC_CONNECT_TO_SERVICE 85 } loc_interface_t; 79 86 80 87 typedef struct { 81 devmap_handle_t handle;82 char name[ DEVMAP_NAME_MAXLEN + 1];83 } dev_desc_t;88 service_id_t id; 89 char name[LOC_NAME_MAXLEN + 1]; 90 } loc_sdesc_t; 84 91 85 92 #endif -
uspace/lib/c/include/ipc/services.h
re0e922d rdb6e419 45 45 SERVICE_VIDEO = FOURCC('v', 'i', 'd', ' '), 46 46 SERVICE_VFS = FOURCC('v', 'f', 's', ' '), 47 SERVICE_ DEVMAP = FOURCC('d', 'e', 'v', 'p'),47 SERVICE_LOC = FOURCC('l', 'o', 'c', ' '), 48 48 SERVICE_DEVMAN = FOURCC('d', 'e', 'v', 'n'), 49 49 SERVICE_IRC = FOURCC('i', 'r', 'c', ' '), -
uspace/lib/c/include/libc.h
re0e922d rdb6e419 37 37 38 38 #include <sys/types.h> 39 #include < kernel/syscall/syscall.h>39 #include <abi/syscall.h> 40 40 #include <libarch/syscall.h> 41 41 -
uspace/lib/c/include/loc.h
re0e922d rdb6e419 33 33 */ 34 34 35 #ifndef LIBC_ DEVMAP_H_36 #define LIBC_ DEVMAP_H_35 #ifndef LIBC_LOC_H_ 36 #define LIBC_LOC_H_ 37 37 38 #include <ipc/ devmap.h>38 #include <ipc/loc.h> 39 39 #include <async.h> 40 40 #include <bool.h> 41 41 42 extern async_exch_t * devmap_exchange_begin_blocking(devmap_interface_t);43 extern async_exch_t * devmap_exchange_begin(devmap_interface_t);44 extern void devmap_exchange_end(async_exch_t *);42 extern async_exch_t *loc_exchange_begin_blocking(loc_interface_t); 43 extern async_exch_t *loc_exchange_begin(loc_interface_t); 44 extern void loc_exchange_end(async_exch_t *); 45 45 46 extern int devmap_driver_register(const char *, async_client_conn_t);47 extern int devmap_device_register(const char *, devmap_handle_t *);48 extern int devmap_device_register_with_iface(const char *, devmap_handle_t *,46 extern int loc_server_register(const char *, async_client_conn_t); 47 extern int loc_service_register(const char *, service_id_t *); 48 extern int loc_service_register_with_iface(const char *, service_id_t *, 49 49 sysarg_t); 50 extern int loc_service_add_to_cat(service_id_t, category_id_t); 50 51 51 extern int devmap_device_get_handle(const char *, devmap_handle_t *,52 extern int loc_service_get_id(const char *, service_id_t *, 52 53 unsigned int); 53 extern int devmap_namespace_get_handle(const char *, devmap_handle_t *, 54 extern int loc_service_get_name(service_id_t, char **); 55 extern int loc_namespace_get_id(const char *, service_id_t *, 54 56 unsigned int); 55 extern devmap_handle_type_t devmap_handle_probe(devmap_handle_t); 57 extern int loc_category_get_id(const char *, category_id_t *, 58 unsigned int); 59 extern int loc_category_get_name(category_id_t, char **); 60 extern int loc_category_get_svcs(category_id_t, category_id_t **, size_t *); 61 extern loc_object_type_t loc_id_probe(service_id_t); 56 62 57 extern async_sess_t * devmap_device_connect(exch_mgmt_t, devmap_handle_t,63 extern async_sess_t *loc_service_connect(exch_mgmt_t, service_id_t, 58 64 unsigned int); 59 65 60 extern int devmap_null_create(void);61 extern void devmap_null_destroy(int);66 extern int loc_null_create(void); 67 extern void loc_null_destroy(int); 62 68 63 extern size_t devmap_count_namespaces(void);64 extern size_t devmap_count_devices(devmap_handle_t);69 extern size_t loc_count_namespaces(void); 70 extern size_t loc_count_services(service_id_t); 65 71 66 extern size_t devmap_get_namespaces(dev_desc_t **); 67 extern size_t devmap_get_devices(devmap_handle_t, dev_desc_t **); 72 extern size_t loc_get_namespaces(loc_sdesc_t **); 73 extern size_t loc_get_services(service_id_t, loc_sdesc_t **); 74 extern int loc_get_categories(category_id_t **, size_t *); 75 68 76 69 77 #endif -
uspace/lib/c/include/rtld/elf_dyn.h
re0e922d rdb6e419 36 36 #define LIBC_RTLD_ELF_DYN_H_ 37 37 38 #include <arch/elf.h>39 38 #include <sys/types.h> 40 41 39 #include <elf/elf.h> 42 40 #include <libarch/rtld/elf_dyn.h> -
uspace/lib/c/include/stats.h
re0e922d rdb6e419 40 40 #include <stdint.h> 41 41 #include <bool.h> 42 #include <kernel/sysinfo/abi.h> 42 #include <sys/types.h> 43 #include <abi/sysinfo.h> 43 44 44 45 extern stats_cpu_t *stats_get_cpus(size_t *); -
uspace/lib/c/include/sys/stat.h
re0e922d rdb6e419 39 39 #include <bool.h> 40 40 #include <ipc/vfs.h> 41 #include <ipc/ devmap.h>41 #include <ipc/loc.h> 42 42 43 43 struct stat { 44 44 fs_handle_t fs_handle; 45 devmap_handle_t devmap_handle;45 service_id_t service_id; 46 46 fs_index_t index; 47 47 unsigned int lnkcnt; … … 49 49 bool is_directory; 50 50 aoff64_t size; 51 devmap_handle_t device;51 service_id_t service; 52 52 }; 53 53 -
uspace/lib/c/include/syscall.h
re0e922d rdb6e419 45 45 46 46 #include <sys/types.h> 47 #include < kernel/syscall/syscall.h>47 #include <abi/syscall.h> 48 48 49 49 #define __syscall0 __syscall -
uspace/lib/c/include/udebug.h
re0e922d rdb6e419 36 36 #define LIBC_UDEBUG_H_ 37 37 38 #include < kernel/udebug/udebug.h>38 #include <abi/udebug.h> 39 39 #include <sys/types.h> 40 40 #include <async.h> -
uspace/lib/c/include/vfs/vfs.h
re0e922d rdb6e419 38 38 #include <sys/types.h> 39 39 #include <ipc/vfs.h> 40 #include <ipc/ devmap.h>40 #include <ipc/loc.h> 41 41 #include <stdio.h> 42 42 … … 49 49 typedef struct { 50 50 fs_handle_t fs_handle; 51 devmap_handle_t devmap_handle;51 service_id_t service_id; 52 52 fs_index_t index; 53 53 } fdi_node_t; -
uspace/lib/drv/include/ddf/interrupt.h
re0e922d rdb6e419 36 36 #define DDF_INTERRUPT_H_ 37 37 38 #include < kernel/ddi/irq.h>38 #include <abi/ddi/irq.h> 39 39 #include <adt/list.h> 40 40 #include <ddi.h> -
uspace/lib/ext2/libext2_filesystem.c
re0e922d rdb6e419 50 50 * 51 51 * @param fs Pointer to ext2_filesystem_t to initialize 52 * @param devmap_handle Device handleof the block device53 * 54 * @return EOK on success or negative error code on failure 55 */ 56 int ext2_filesystem_init(ext2_filesystem_t *fs, devmap_handle_t devmap_handle)52 * @param service_id Service ID of the block device 53 * 54 * @return EOK on success or negative error code on failure 55 */ 56 int ext2_filesystem_init(ext2_filesystem_t *fs, service_id_t service_id) 57 57 { 58 58 int rc; … … 60 60 size_t block_size; 61 61 62 fs->device = devmap_handle;62 fs->device = service_id; 63 63 64 64 rc = block_init(EXCHANGE_SERIALIZE, fs->device, 2048); … … 80 80 } 81 81 82 rc = block_cache_init( devmap_handle, block_size, 0, CACHE_MODE_WT);82 rc = block_cache_init(service_id, block_size, 0, CACHE_MODE_WT); 83 83 if (rc != EOK) { 84 84 block_fini(fs->device); -
uspace/lib/ext2/libext2_filesystem.h
re0e922d rdb6e419 43 43 44 44 typedef struct ext2_filesystem { 45 devmap_handle_t device;45 service_id_t device; 46 46 ext2_superblock_t * superblock; 47 47 } ext2_filesystem_t; … … 59 59 #define EXT2_SUPPORTED_READ_ONLY_FEATURES 0 60 60 61 extern int ext2_filesystem_init(ext2_filesystem_t *, devmap_handle_t);61 extern int ext2_filesystem_init(ext2_filesystem_t *, service_id_t); 62 62 extern int ext2_filesystem_check_sanity(ext2_filesystem_t *); 63 63 extern int ext2_filesystem_check_flags(ext2_filesystem_t *, bool *); -
uspace/lib/ext2/libext2_superblock.c
re0e922d rdb6e419 321 321 /** Read a superblock directly from device (i.e. no libblock cache) 322 322 * 323 * @param devmap_handle Device handleof the block device.323 * @param service_id Service ID of the block device. 324 324 * @param superblock Pointer where to store pointer to new superblock 325 325 * 326 326 * @return EOK on success or negative error code on failure. 327 327 */ 328 int ext2_superblock_read_direct( devmap_handle_t devmap_handle,328 int ext2_superblock_read_direct(service_id_t service_id, 329 329 ext2_superblock_t **superblock) 330 330 { … … 337 337 } 338 338 339 rc = block_read_bytes_direct( devmap_handle, EXT2_SUPERBLOCK_OFFSET,339 rc = block_read_bytes_direct(service_id, EXT2_SUPERBLOCK_OFFSET, 340 340 EXT2_SUPERBLOCK_SIZE, data); 341 341 if (rc != EOK) { -
uspace/lib/ext2/libext2_superblock.h
re0e922d rdb6e419 110 110 extern uint32_t ext2_superblock_get_features_read_only(ext2_superblock_t *); 111 111 112 extern int ext2_superblock_read_direct( devmap_handle_t, ext2_superblock_t **);112 extern int ext2_superblock_read_direct(service_id_t, ext2_superblock_t **); 113 113 extern int ext2_superblock_check_sanity(ext2_superblock_t *); 114 114 -
uspace/lib/fs/libfs.c
re0e922d rdb6e419 77 77 static void vfs_out_mounted(ipc_callid_t rid, ipc_call_t *req) 78 78 { 79 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);79 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 80 80 char *opts; 81 81 int rc; … … 91 91 aoff64_t size; 92 92 unsigned lnkcnt; 93 rc = vfs_out_ops->mounted( devmap_handle, opts, &index, &size, &lnkcnt);93 rc = vfs_out_ops->mounted(service_id, opts, &index, &size, &lnkcnt); 94 94 95 95 if (rc == EOK) … … 109 109 static void vfs_out_unmounted(ipc_callid_t rid, ipc_call_t *req) 110 110 { 111 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);111 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 112 112 int rc; 113 113 114 rc = vfs_out_ops->unmounted( devmap_handle);114 rc = vfs_out_ops->unmounted(service_id); 115 115 116 116 async_answer_0(rid, rc); … … 130 130 static void vfs_out_read(ipc_callid_t rid, ipc_call_t *req) 131 131 { 132 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);132 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 133 133 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 134 134 aoff64_t pos = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*req), … … 137 137 int rc; 138 138 139 rc = vfs_out_ops->read( devmap_handle, index, pos, &rbytes);139 rc = vfs_out_ops->read(service_id, index, pos, &rbytes); 140 140 141 141 if (rc == EOK) … … 147 147 static void vfs_out_write(ipc_callid_t rid, ipc_call_t *req) 148 148 { 149 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);149 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 150 150 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 151 151 aoff64_t pos = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*req), … … 155 155 int rc; 156 156 157 rc = vfs_out_ops->write( devmap_handle, index, pos, &wbytes, &nsize);157 rc = vfs_out_ops->write(service_id, index, pos, &wbytes, &nsize); 158 158 159 159 if (rc == EOK) … … 165 165 static void vfs_out_truncate(ipc_callid_t rid, ipc_call_t *req) 166 166 { 167 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);167 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 168 168 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 169 169 aoff64_t size = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*req), … … 171 171 int rc; 172 172 173 rc = vfs_out_ops->truncate( devmap_handle, index, size);173 rc = vfs_out_ops->truncate(service_id, index, size); 174 174 175 175 async_answer_0(rid, rc); … … 178 178 static void vfs_out_close(ipc_callid_t rid, ipc_call_t *req) 179 179 { 180 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);180 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 181 181 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 182 182 int rc; 183 183 184 rc = vfs_out_ops->close( devmap_handle, index);184 rc = vfs_out_ops->close(service_id, index); 185 185 186 186 async_answer_0(rid, rc); … … 189 189 static void vfs_out_destroy(ipc_callid_t rid, ipc_call_t *req) 190 190 { 191 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);191 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 192 192 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 193 193 int rc; 194 194 195 rc = vfs_out_ops->destroy( devmap_handle, index);195 rc = vfs_out_ops->destroy(service_id, index); 196 196 197 197 async_answer_0(rid, rc); … … 210 210 static void vfs_out_sync(ipc_callid_t rid, ipc_call_t *req) 211 211 { 212 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);212 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 213 213 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 214 214 int rc; 215 215 216 rc = vfs_out_ops->sync( devmap_handle, index);216 rc = vfs_out_ops->sync(service_id, index); 217 217 218 218 async_answer_0(rid, rc); … … 380 380 ipc_call_t *req) 381 381 { 382 devmap_handle_t mp_devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);382 service_id_t mp_service_id = (service_id_t) IPC_GET_ARG1(*req); 383 383 fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*req); 384 384 fs_handle_t mr_fs_handle = (fs_handle_t) IPC_GET_ARG3(*req); 385 devmap_handle_t mr_devmap_handle = (devmap_handle_t) IPC_GET_ARG4(*req);385 service_id_t mr_service_id = (service_id_t) IPC_GET_ARG4(*req); 386 386 387 387 async_sess_t *mountee_sess = async_clone_receive(EXCHANGE_PARALLEL); … … 392 392 393 393 fs_node_t *fn; 394 int res = ops->node_get(&fn, mp_ devmap_handle, mp_fs_index);394 int res = ops->node_get(&fn, mp_service_id, mp_fs_index); 395 395 if ((res != EOK) || (!fn)) { 396 396 async_hangup(mountee_sess); … … 422 422 ipc_call_t answer; 423 423 int rc = async_data_write_forward_1_1(exch, VFS_OUT_MOUNTED, 424 mr_ devmap_handle, &answer);424 mr_service_id, &answer); 425 425 async_exchange_end(exch); 426 426 … … 428 428 fn->mp_data.mp_active = true; 429 429 fn->mp_data.fs_handle = mr_fs_handle; 430 fn->mp_data. devmap_handle = mr_devmap_handle;430 fn->mp_data.service_id = mr_service_id; 431 431 fn->mp_data.sess = mountee_sess; 432 432 } … … 441 441 void libfs_unmount(libfs_ops_t *ops, ipc_callid_t rid, ipc_call_t *req) 442 442 { 443 devmap_handle_t mp_devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);443 service_id_t mp_service_id = (service_id_t) IPC_GET_ARG1(*req); 444 444 fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*req); 445 445 fs_node_t *fn; 446 446 int res; 447 447 448 res = ops->node_get(&fn, mp_ devmap_handle, mp_fs_index);448 res = ops->node_get(&fn, mp_service_id, mp_fs_index); 449 449 if ((res != EOK) || (!fn)) { 450 450 async_answer_0(rid, combine_rc(res, ENOENT)); … … 465 465 */ 466 466 async_exch_t *exch = async_exchange_begin(fn->mp_data.sess); 467 res = async_req_1_0(exch, VFS_OUT_UNMOUNTED, fn->mp_data. devmap_handle);467 res = async_req_1_0(exch, VFS_OUT_UNMOUNTED, fn->mp_data.service_id); 468 468 async_exchange_end(exch); 469 469 … … 475 475 fn->mp_data.mp_active = false; 476 476 fn->mp_data.fs_handle = 0; 477 fn->mp_data. devmap_handle= 0;477 fn->mp_data.service_id = 0; 478 478 fn->mp_data.sess = NULL; 479 479 … … 510 510 unsigned int last = IPC_GET_ARG2(*req); 511 511 unsigned int next = first; 512 devmap_handle_t devmap_handle= IPC_GET_ARG3(*req);512 service_id_t service_id = IPC_GET_ARG3(*req); 513 513 int lflag = IPC_GET_ARG4(*req); 514 514 fs_index_t index = IPC_GET_ARG5(*req); … … 524 524 fs_node_t *tmp = NULL; 525 525 526 rc = ops->root_get(&cur, devmap_handle);526 rc = ops->root_get(&cur, service_id); 527 527 on_error(rc, goto out_with_answer); 528 528 … … 530 530 async_exch_t *exch = async_exchange_begin(cur->mp_data.sess); 531 531 async_forward_slow(rid, exch, VFS_OUT_LOOKUP, next, last, 532 cur->mp_data. devmap_handle, lflag, index,532 cur->mp_data.service_id, lflag, index, 533 533 IPC_FF_ROUTE_FROM_ME); 534 534 async_exchange_end(exch); … … 591 591 async_exch_t *exch = async_exchange_begin(tmp->mp_data.sess); 592 592 async_forward_slow(rid, exch, VFS_OUT_LOOKUP, next, 593 last, tmp->mp_data. devmap_handle, lflag, index,593 last, tmp->mp_data.service_id, lflag, index, 594 594 IPC_FF_ROUTE_FROM_ME); 595 595 async_exchange_end(exch); … … 620 620 fs_node_t *fn; 621 621 if (lflag & L_CREATE) 622 rc = ops->create(&fn, devmap_handle,622 rc = ops->create(&fn, service_id, 623 623 lflag); 624 624 else 625 rc = ops->node_get(&fn, devmap_handle,625 rc = ops->node_get(&fn, service_id, 626 626 index); 627 627 on_error(rc, goto out_with_answer); … … 638 638 aoff64_t size = ops->size_get(fn); 639 639 async_answer_5(rid, fs_handle, 640 devmap_handle,640 service_id, 641 641 ops->index_get(fn), 642 642 LOWER32(size), … … 706 706 fs_node_t *fn; 707 707 if (lflag & L_CREATE) 708 rc = ops->create(&fn, devmap_handle, lflag);708 rc = ops->create(&fn, service_id, lflag); 709 709 else 710 rc = ops->node_get(&fn, devmap_handle, index);710 rc = ops->node_get(&fn, service_id, index); 711 711 on_error(rc, goto out_with_answer); 712 712 … … 722 722 aoff64_t size = ops->size_get(fn); 723 723 async_answer_5(rid, fs_handle, 724 devmap_handle,724 service_id, 725 725 ops->index_get(fn), 726 726 LOWER32(size), … … 748 748 if (rc == EOK) { 749 749 aoff64_t size = ops->size_get(cur); 750 async_answer_5(rid, fs_handle, devmap_handle,750 async_answer_5(rid, fs_handle, service_id, 751 751 ops->index_get(cur), LOWER32(size), UPPER32(size), 752 752 old_lnkcnt); … … 786 786 if (rc == EOK) { 787 787 aoff64_t size = ops->size_get(cur); 788 async_answer_5(rid, fs_handle, devmap_handle,788 async_answer_5(rid, fs_handle, service_id, 789 789 ops->index_get(cur), LOWER32(size), UPPER32(size), 790 790 ops->lnkcnt_get(cur)); … … 810 810 ipc_call_t *request) 811 811 { 812 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);812 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 813 813 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 814 814 815 815 fs_node_t *fn; 816 int rc = ops->node_get(&fn, devmap_handle, index);816 int rc = ops->node_get(&fn, service_id, index); 817 817 on_error(rc, answer_and_return(rid, rc)); 818 818 … … 831 831 832 832 stat.fs_handle = fs_handle; 833 stat. devmap_handle = devmap_handle;833 stat.service_id = service_id; 834 834 stat.index = index; 835 835 stat.lnkcnt = ops->lnkcnt_get(fn); … … 837 837 stat.is_directory = ops->is_directory(fn); 838 838 stat.size = ops->size_get(fn); 839 stat. device = ops->device_get(fn);839 stat.service = ops->device_get(fn); 840 840 841 841 ops->node_put(fn); … … 856 856 ipc_call_t *request) 857 857 { 858 devmap_handle_t devmap_handle= IPC_GET_ARG1(*request);858 service_id_t service_id = IPC_GET_ARG1(*request); 859 859 fs_index_t index = IPC_GET_ARG2(*request); 860 860 861 861 fs_node_t *fn; 862 int rc = ops->node_get(&fn, devmap_handle, index);862 int rc = ops->node_get(&fn, service_id, index); 863 863 on_error(rc, answer_and_return(rid, rc)); 864 864 -
uspace/lib/fs/libfs.h
re0e922d rdb6e419 40 40 #include <stdint.h> 41 41 #include <async.h> 42 #include < devmap.h>42 #include <loc.h> 43 43 44 44 typedef struct { 45 int (* mounted)( devmap_handle_t, const char *, fs_index_t *, aoff64_t *,45 int (* mounted)(service_id_t, const char *, fs_index_t *, aoff64_t *, 46 46 unsigned *); 47 int (* unmounted)( devmap_handle_t);48 int (* read)( devmap_handle_t, fs_index_t, aoff64_t, size_t *);49 int (* write)( devmap_handle_t, fs_index_t, aoff64_t, size_t *,47 int (* unmounted)(service_id_t); 48 int (* read)(service_id_t, fs_index_t, aoff64_t, size_t *); 49 int (* write)(service_id_t, fs_index_t, aoff64_t, size_t *, 50 50 aoff64_t *); 51 int (* truncate)( devmap_handle_t, fs_index_t, aoff64_t);52 int (* close)( devmap_handle_t, fs_index_t);53 int (* destroy)( devmap_handle_t, fs_index_t);54 int (* sync)( devmap_handle_t, fs_index_t);51 int (* truncate)(service_id_t, fs_index_t, aoff64_t); 52 int (* close)(service_id_t, fs_index_t); 53 int (* destroy)(service_id_t, fs_index_t); 54 int (* sync)(service_id_t, fs_index_t); 55 55 } vfs_out_ops_t; 56 56 … … 59 59 async_sess_t *sess; 60 60 fs_handle_t fs_handle; 61 devmap_handle_t devmap_handle;61 service_id_t service_id; 62 62 } mp_data_t; 63 63 … … 73 73 * argument holds the output argument. 74 74 */ 75 int (* root_get)(fs_node_t **, devmap_handle_t);75 int (* root_get)(fs_node_t **, service_id_t); 76 76 int (* match)(fs_node_t **, fs_node_t *, const char *); 77 int (* node_get)(fs_node_t **, devmap_handle_t, fs_index_t);77 int (* node_get)(fs_node_t **, service_id_t, fs_index_t); 78 78 int (* node_open)(fs_node_t *); 79 79 int (* node_put)(fs_node_t *); 80 int (* create)(fs_node_t **, devmap_handle_t, int);80 int (* create)(fs_node_t **, service_id_t, int); 81 81 int (* destroy)(fs_node_t *); 82 82 int (* link)(fs_node_t *, fs_node_t *, const char *); … … 92 92 bool (* is_directory)(fs_node_t *); 93 93 bool (* is_file)(fs_node_t *); 94 devmap_handle_t (* device_get)(fs_node_t *);94 service_id_t (* device_get)(fs_node_t *); 95 95 } libfs_ops_t; 96 96 -
uspace/lib/imgmap/imgmap.h
re0e922d rdb6e419 1 1 /* 2 * Copyright (c) 2011 Jiri Svoboda2 * Copyright (c) 2011 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup generic29 /** @addtogroup imgmap 30 30 * @{ 31 31 */ 32 /** @file 33 * 34 * This header allows including a kernel header using typedefs.h from 35 * libc. User-space code should use sys/types.h directly. 32 /** 33 * @file 36 34 */ 37 35 38 #ifndef LIBC_TYPEDEFS_H_39 #define LIBC_TYPEDEFS_H_36 #ifndef IMGMAP_IMGMAP_H_ 37 #define IMGMAP_IMGMAP_H_ 40 38 41 39 #include <sys/types.h> 40 #include <abi/fb/visuals.h> 41 42 typedef struct { 43 size_t size; 44 sysarg_t width; 45 sysarg_t height; 46 visual_t visual; 47 uint8_t data[]; 48 } imgmap_t; 49 50 extern imgmap_t *imgmap_decode_tga(void *, size_t); 42 51 43 52 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
