/trusty/user/base/lib/hwasan/ |
D | hwasan.c | 74 static void check_address(uintptr_t ptr, size_t size) { in check_address() argument 77 if (!ptr || size == 0) { in check_address() 85 uint8_t* last_tag = (uint8_t*)mem_to_shadow(ptr + size - 1); in check_address() 103 void* __hwasan_memset(uintptr_t ptr, int val, size_t size) { in __hwasan_memset() argument 104 check_address(ptr, size); in __hwasan_memset() 105 return memset((void*)ptr, val, size); in __hwasan_memset() 108 void* __hwasan_memcpy(uintptr_t dst, const uintptr_t src, size_t size) { in __hwasan_memcpy() argument 109 check_address(dst, size); in __hwasan_memcpy() 110 check_address(src, size); in __hwasan_memcpy() 111 return memcpy((void*)dst, (void*)src, size); in __hwasan_memcpy() [all …]
|
D | hwasan.h | 29 void* __hwasan_memset(uintptr_t ptr, int val, size_t size); 30 void* __hwasan_memcpy(uintptr_t dst, const uintptr_t src, size_t size); 31 void* __hwasan_memmove(uintptr_t dst, const uintptr_t src, size_t size); 33 void __hwasan_loadN(uintptr_t ptr, size_t size); 34 void __hwasan_storeN(uintptr_t ptr, size_t size);
|
/trusty/kernel/app/memorytest/ |
D | memorytest.c | 7 static uintptr_t expected_malloc_alignment(size_t size) { in expected_malloc_alignment() argument 9 if (size >= 16) { in expected_malloc_alignment() 11 } else if (size >= 8) { in expected_malloc_alignment() 13 } else if (size >= 4) { in expected_malloc_alignment() 15 } else if (size >= 2) { in expected_malloc_alignment() 23 for (int size = 2; size < 256; size++) { in TEST() local 24 const uintptr_t alignment_mask = expected_malloc_alignment(size) - 1; in TEST() 25 void* ptr1 = malloc(size); in TEST() 26 void* ptr2 = malloc(size / 2); /* Try to shake up the alignment. */ in TEST() 27 void* ptr3 = malloc(size); in TEST() [all …]
|
/trusty/user/app/avb/test/ |
D | secure_storage_fake.h | 27 int read(uint64_t off, void* buf, size_t size) const override { in read() argument 29 return size; in read() 31 int get_file_size(uint64_t* size) const override { in get_file_size() argument 32 *size = sizeof(uint64_t) * kRollbackSlotMax; in get_file_size() 35 int write(uint64_t off, const void* buf, size_t size) const override { in write() argument 36 return size; in write()
|
/trusty/user/app/sample/hwcrypto-unittest/ |
D | main.c | 113 static const size_t size = sizeof(src_data); in TEST_F() local 120 long rc = hwkey_derive(invalid, &kdf_version, src_data, dest, size); in TEST_F() 126 static const uint32_t size = sizeof(src_data); in TEST_F() local 137 rc = hwkey_derive(session, &kdf_version, src_data, dest, size); in TEST_F() 145 static const size_t size = sizeof(dest); in TEST_F() local 152 .context_len = size, in TEST_F() 155 memset(dest, 0, size); in TEST_F() 156 memset(dest2, 0, size); in TEST_F() 160 size); in TEST_F() 167 size); in TEST_F() [all …]
|
/trusty/kernel/lib/libc-ext/ |
D | scnprintf.c | 6 int scnprintf(char* buf, size_t size, const char* fmt, ...) { in scnprintf() argument 10 int vscn_ret = vscnprintf(buf, size, fmt, args); in scnprintf() 16 int vscnprintf(char* buf, size_t size, const char* fmt, va_list args) { in vscnprintf() argument 17 if (size == 0) { in vscnprintf() 20 int would_write = vsnprintf(buf, size, fmt, args); in vscnprintf() 24 size_t max_write = size - 1; in vscnprintf()
|
/trusty/user/base/lib/dlmalloc/test/ |
D | dlmalloc_test.c | 153 static uintptr_t expected_malloc_alignment(size_t size) { in expected_malloc_alignment() argument 155 if (size >= 16) { in expected_malloc_alignment() 157 } else if (size >= 8) { in expected_malloc_alignment() 159 } else if (size >= 4) { in expected_malloc_alignment() 161 } else if (size >= 2) { in expected_malloc_alignment() 169 for (int size = 2; size < 256; size++) { in TEST_F() local 170 const uintptr_t alignment_mask = expected_malloc_alignment(size) - 1; in TEST_F() 171 void* ptr1 = malloc(size); in TEST_F() 172 void* ptr2 = malloc(size / 2); /* Try to shake up the alignment. */ in TEST_F() 173 void* ptr3 = malloc(size); in TEST_F() [all …]
|
/trusty/kernel/lib/vmm_obj_service/ |
D | vmm_obj_service.c | 36 size_t size; member 43 size_t size, in vmm_obj_service_create_ro() argument 58 if (!IS_PAGE_ALIGNED(size)) { in vmm_obj_service_create_ro() 59 TRACEF("unaligned size: %zd\n", size); in vmm_obj_service_create_ro() 63 if (size != (uint64_t)size) { in vmm_obj_service_create_ro() 64 TRACEF("size too big: %zd\n", size); in vmm_obj_service_create_ro() 76 rc = memref_create_from_vmm_obj(obj, offset, size, MMAP_FLAG_PROT_READ, in vmm_obj_service_create_ro() 88 srv->size = size; in vmm_obj_service_create_ro() 131 uint64_t out_size = (uint64_t)srv->size; in vmm_obj_service_handle_connect()
|
/trusty/kernel/lib/trusty/ |
D | syscall.c | 96 static bool valid_address(vaddr_t addr, const u_int size) { in valid_address() argument 97 u_int rsize = round_up(size + (addr & (PAGE_SIZE - 1)), PAGE_SIZE); in valid_address() 101 if (rsize < size) { in valid_address() 180 size_t size = round_up(trusty_app->end_brk - trusty_app->start_brk, in sys_brk() local 184 trusty_app->aspace, "brk_heap", size, in sys_brk() 252 uint32_t size, in sys_mmap() argument 268 ret = trusty_app_setup_mmio(trusty_app, handle_id, &uaddr, size); in sys_mmap() 311 ret = vmm_alloc(trusty_app->aspace, "mmap", size, &ptr, 0, vmm_flags, in sys_mmap() 327 ret = handle_mmap(handle, 0, size, flags, &uaddr); in sys_mmap() 338 long sys_munmap(user_addr_t uaddr, uint32_t size) { in sys_munmap() argument [all …]
|
D | memref.c | 69 user_size_t size, in memref_mmap() argument 86 if (!IS_PAGE_ALIGNED(size)) { in memref_mmap() 91 if (offset > memref->slice.size) { in memref_mmap() 96 if (size > memref->slice.size - offset) { in memref_mmap() 113 memref->slice.offset + offset, size, &vaddr, 0, 0, in memref_mmap() 145 if (!IS_PAGE_ALIGNED(slice->size) || !IS_PAGE_ALIGNED(slice->offset)) { in check_slice() 167 size_t size, in memref_create_from_vmm_obj() argument 177 vmm_obj_slice_bind(&memref->slice, obj, offset, size); in memref_create_from_vmm_obj() 195 size_t size, in memref_create_from_aspace() argument 206 status_t rc = vmm_get_obj(aspace, vaddr, size, &memref->slice); in memref_create_from_aspace()
|
/trusty/user/app/sample/manifest-test/ |
D | manifest_test.c | 43 bool compare_memory_map(uint8_t* va_base, uint64_t phy_addr, uint32_t size) { in compare_memory_map() argument 50 ret = prepare_dma((void*)va_base, size, flags, &pmem); in compare_memory_map() 52 ret = finish_dma((void*)va_base, size, flags); in compare_memory_map() 56 ASSERT_EQ(size, pmem.size); in compare_memory_map() 118 uint32_t size = 0x400; in TEST_F() local 120 va_base = mmap(NULL, size, PROT_READ | PROT_WRITE, MMAP_FLAG_IO_HANDLE, in TEST_F() 123 ret = compare_memory_map(va_base, TEST1_PHY_BASE_ADDR, size); in TEST_F() 129 munmap(va_base, size); in TEST_F() 135 uint32_t size = 0x2000; in TEST_F() local 137 va_base = mmap(NULL, size, PROT_READ | PROT_WRITE, MMAP_FLAG_IO_HANDLE, in TEST_F() [all …]
|
/trusty/user/app/storage/storage_mock/ |
D | storage_mock.c | 33 size_t size; member 170 file_info_p->size = 0; in storage_open_file() 270 size_t size) { in storage_read() argument 279 if (off > file_info->size) { in storage_read() 282 size_t copy_size = size; in storage_read() 283 if (off + copy_size > file_info->size) { in storage_read() 284 copy_size = file_info->size - off; in storage_read() 293 size_t size, in storage_write() argument 303 if (off + size > FILE_BUFFER_MAX) { in storage_write() 306 if (off > file_info->size) { in storage_write() [all …]
|
/trusty/user/base/lib/libc-trusty/ |
D | mman.c | 32 size_t size, in mmap() argument 48 result = (void*)_trusty_mmap(uaddr, size, (uint32_t)prot | flags, in mmap() 59 result = hwasan_tag_memory(result, size); in mmap() 64 int munmap(void* uaddr, size_t size) { in munmap() argument 69 return _trusty_munmap(uaddr, size); in munmap() 73 uint32_t size, in prepare_dma() argument 79 return _trusty_prepare_dma(uaddr, size, flags, pmem); in prepare_dma() 82 int finish_dma(void* uaddr, uint32_t size, uint32_t flags) { in finish_dma() argument 86 return _trusty_finish_dma(uaddr, size, flags); in finish_dma()
|
D | memref.c | 9 int memref_create(void* addr, size_t size, uint32_t mmap_prot) { in memref_create() argument 15 if (size > UINT32_MAX) { in memref_create() 18 return _trusty_memref_create(addr, size, mmap_prot); in memref_create()
|
/trusty/user/app/storage/ |
D | block_mac.c | 25 size_t size = fs->block_num_size; in block_mac_block_size() local 26 assert(size); in block_mac_block_size() 27 assert(size <= sizeof(data_block_t)); in block_mac_block_size() 28 return size; in block_mac_block_size() 32 size_t size = fs->mac_size; in block_mac_mac_size() local 33 assert(size); in block_mac_mac_size() 34 assert(size <= sizeof(struct mac)); in block_mac_mac_size() 35 return size; in block_mac_mac_size()
|
/trusty/user/app/avb/ |
D | secure_storage.cpp | 48 int SecureStorage::read(uint64_t off, void* buf, size_t size) const { in read() 52 return storage_read(file_handle_, off, buf, size); in read() 55 int SecureStorage::get_file_size(uint64_t* size) const { in get_file_size() 59 return storage_get_file_size(file_handle_, size); in get_file_size() 62 int SecureStorage::write(uint64_t off, const void* buf, size_t size) const { in write() 66 return storage_write(file_handle_, off, buf, size, STORAGE_OP_COMPLETE); in write()
|
D | secure_storage.h | 32 int read(uint64_t off, void* buf, size_t size) const override; 33 int get_file_size(uint64_t* size) const override; 34 int write(uint64_t off, const void* buf, size_t size) const override;
|
D | secure_storage_interface.h | 49 virtual int read(uint64_t off, void* buf, size_t size) const = 0; 55 virtual int get_file_size(uint64_t* size) const = 0; 62 virtual int write(uint64_t off, const void* buf, size_t size) const = 0;
|
/trusty/user/base/lib/trusty-std/src/ |
D | alloc.rs | 204 match layout.size() { in alloc_impl() 207 size => unsafe { in alloc_impl() 214 Ok(NonNull::slice_from_raw_parts(ptr, size)) in alloc_impl() 229 new_layout.size() >= old_layout.size(), in grow_impl() 233 match old_layout.size() { in grow_impl() 240 let new_size = new_layout.size(); in grow_impl() 243 intrinsics::assume(new_size >= old_layout.size()); in grow_impl() 283 if layout.size() != 0 { in deallocate() 320 new_layout.size() <= old_layout.size(), in shrink() 324 match new_layout.size() { in shrink() [all …]
|
/trusty/user/app/sample/storage-test/ |
D | storage-test.c | 32 static int write_file(size_t size) { in write_file() argument 35 if (size > sizeof(data)) { in write_file() 36 size = sizeof(data); in write_file() 39 TLOGI("writing size %zu\n", size); in write_file() 57 memset(data, 0, size); in write_file() 58 rc = storage_write(handle, 0, data, size, STORAGE_OP_COMPLETE); in write_file()
|
/trusty/hardware/nxp/platform/imx/ |
D | platform.c | 53 .size = MEMSIZE, 58 .size = SOC_REGS_SIZE, 66 .size = MEMSIZE, 81 ram_arena.size = m->size; in platform_init_mmu_mappings() 93 size_t size) { in generic_arm64_map_regs() argument 98 vmm_get_kernel_aspace(), name, size, &vaddrp, 0, paddr, in generic_arm64_map_regs()
|
/trusty/user/base/lib/apploader_package/include/apploader/ |
D | cbor.h | 102 if (a.size() < b.size()) in keyLess() 104 if (a.size() > b.size()) in keyLess() 119 if (!encMap.size()) { in populateMap() 125 CborInInit(encMap.data(), encMap.size(), &in); in populateMap() 148 CborOutInit(encKey.data(), encKey.size(), &out); in populateMap() 187 size_t outputSize = encodedSizeOf(map.size()); in mergeMaps() 189 outputSize += key.size() + value.size(); in mergeMaps() 194 CborOutInit(output.data(), output.size(), &out); in mergeMaps() 195 CborWriteMap(map.size(), &out); in mergeMaps() 198 std::memcpy(output.data() + out.cursor, key.data(), key.size()); in mergeMaps() [all …]
|
/trusty/kernel/platform/vexpress-a15/ |
D | platform.c | 57 .size = MEMSIZE, 63 .size = 0x00100000, 69 .size = 0x00100000, 75 .size = 0x00100000, 84 .size = MEMSIZE, 110 ram_arena.size = m->size; in platform_init_mmu_mappings()
|
/trusty/kernel/platform/generic-x86_64/ |
D | platform.c | 42 .size = MEMSIZE, 51 .size = 0, 66 ram_arena.size = m->size; in platform_init_mmu_mappings()
|
/trusty/user/base/app/acvp/ |
D | acvp.cpp | 122 static inline size_t AlignUpToPage(size_t size) { in AlignUpToPage() argument 123 return (size + (ACVP_PAGE_SIZE - 1)) & ~(ACVP_PAGE_SIZE - 1); in AlignUpToPage() 135 if (out_len_bytes.size() != sizeof(out_len)) { in KAS_HKDF() 141 int res = HKDF(out.data(), out.size(), HashFunc(), secret.data(), in KAS_HKDF() 142 secret.size(), salt.data(), salt.size(), info.data(), in KAS_HKDF() 143 info.size()); in KAS_HKDF() 189 if (spans.empty() || spans.size() > bssl::acvp::kMaxArgs) { in WriteReply() 194 resp.num_spans = spans.size(); in WriteReply() 196 for (size_t i = 0; i < spans.size(); i++) { in WriteReply() 198 resp.lengths[i] = span.size(); in WriteReply() [all …]
|