/ohos5.0/commonlibrary/c_utils/base/src/rust/ |
H A D | ashmem.rs | 59 pub type Ashmem; typedef 63 pub fn CloseAshmem(self: &Ashmem) -> (); in CloseAshmem() argument 75 pub fn UnmapAshmem(self: &Ashmem) -> (); in UnmapAshmem() argument 91 self: &Ashmem, in WriteToAshmem() argument 104 pub fn GetAshmemFd(self: &Ashmem) -> i32; in GetAshmemFd() 109 pub struct Ashmem { struct 110 c_ashmem: SharedPtr<ffi::Ashmem>, argument 114 impl Ashmem { implementation 116 pub fn new(c_ashmem: SharedPtr<ffi::Ashmem>) -> Ashmem { in new() argument 117 Ashmem { c_ashmem } in new() [all …]
|
/ohos5.0/commonlibrary/c_utils/base/src/ |
H A D | ashmem.cpp | 148 Ashmem::Ashmem(int fd, int32_t size) : memoryFd_(fd), memorySize_(size), flag_(0), startAddr_(nullp… in Ashmem() function in OHOS::Ashmem 152 Ashmem::~Ashmem() in ~Ashmem() 158 sptr<Ashmem> Ashmem::CreateAshmem(const char *name, int32_t size) in CreateAshmem() 171 return new Ashmem(fd, size); in CreateAshmem() 180 int Ashmem::GetProtection() const in GetProtection() 191 void Ashmem::CloseAshmem() const in CloseAshmem() 193 void Ashmem::CloseAshmem() in CloseAshmem() 208 bool Ashmem::MapAshmem(int mapType) in MapAshmem() 235 bool Ashmem::MapReadOnlyAshmem() in MapReadOnlyAshmem() 242 void Ashmem::UnmapAshmem() const in UnmapAshmem() [all …]
|
/ohos5.0/commonlibrary/c_utils/docs/zh-cn/ |
H A D | c_utils_guide_rust_ashmem.md | 1 # Rust侧-匿名共享内存(Ashmem, Anonymous Shared Memory) 14 `struct Ashmem` 20 | Option< Ashmem > | **create_ashmem_instance**(name: &str, size: i32)<br> 创建Rust侧Ashmem结构体对象。 | 21 | void | **close_ashmem**(self: &Ashmem)<br>通过内部维护的文件描述符关闭当前ashmem。 | 22 | int | **get_ashmem_fd**(self: &Ashmem)<br>获取内核中对应ashmem的文件描述符。 | 23 | int32_t | **get_ashmem_size**(self: &Ashmem)<br>获取内核中ashmem区域的大小。 | 24 | int | **get_protection**(self: &Ashmem)<br>获取内核中的ashmem区域的保护权限值。 | 27 | void | **unmap_ashmem**(self: &Ashmem)<br>解除ashmem映射。 | 45 | SharedPtr< Ashmem > | **CreateAshmemStd**(name: *const c_char, size: i32)<br>使用指定名称及大小创建Ashmem对象。… 47 | int | **GetAshmemFd**(self: &Ashmem)<br>获取内核中对应ashmem的文件描述符。 | [all …]
|
H A D | c-utils-guide-ashmem.md | 1 # 使用匿名共享内存(Ashmem, Anonymous Shared Memory) 8 ### OHOS::Ashmem 10 C++公共基础库中的Ashmem实现,用于操作匿名共享内存(Ashmem)。 15 class OHOS::Ashmem; 18 **提示**: 尽管被智能指针管理,Ashmem对象仍需手动解除映射并关闭。 29 | sptr< Ashmem > | **CreateAshmem**(const char* name, int32_t size)<br>使用指定名称及大小创建Ashmem对象。 | 30 | | **Ashmem**(int fd, int32_t size)<br>构造Ashmem对象。 | 31 | | **~Ashmem**() override | 50 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); 76 1. Ashmem对象使用结束后**需要手动解除映射并关闭** [all …]
|
/ohos5.0/docs/zh-cn/release-notes/api-diff/v3.1-Release/ |
H A D | js-apidiff-soft-bus.md | 12 | ohos.rpc | Ashmem | mapReadOnlyAshmem(): boolean; | 新增 | 15 | ohos.rpc | Ashmem | getAshmemSize(): number; | 新增 | 16 | ohos.rpc | Ashmem | unmapAshmem(): void; | 新增 | 17 | ohos.rpc | Ashmem | closeAshmem(): void; | 新增 | 18 | ohos.rpc | Ashmem | static createAshmemFromExisting(ashmem: Ashmem): Ashmem; | 新增 | 19 | ohos.rpc | Ashmem | static createAshmem(name: string, size: number): Ashmem; | 新增 | 20 | ohos.rpc | Ashmem | PROT_WRITE = 2; | 新增 | 21 | ohos.rpc | Ashmem | PROT_READ = 1; | 新增 | 22 | ohos.rpc | Ashmem | PROT_NONE = 0; | 新增 | 23 | ohos.rpc | Ashmem | PROT_EXEC = 4; | 新增 | [all …]
|
/ohos5.0/docs/en/release-notes/api-diff/v3.1-Release/ |
H A D | js-apidiff-soft-bus.md | 12 | ohos.rpc | Ashmem | mapReadOnlyAshmem(): boolean; | Added| 15 | ohos.rpc | Ashmem | getAshmemSize(): number; | Added| 16 | ohos.rpc | Ashmem | unmapAshmem(): void; | Added| 17 | ohos.rpc | Ashmem | closeAshmem(): void; | Added| 18 | ohos.rpc | Ashmem | static createAshmemFromExisting(ashmem: Ashmem): Ashmem; | Added| 19 | ohos.rpc | Ashmem | static createAshmem(name: string, size: number): Ashmem; | Added| 20 | ohos.rpc | Ashmem | PROT_WRITE = 2; | Added| 21 | ohos.rpc | Ashmem | PROT_READ = 1; | Added| 22 | ohos.rpc | Ashmem | PROT_NONE = 0; | Added| 23 | ohos.rpc | Ashmem | PROT_EXEC = 4; | Added| [all …]
|
/ohos5.0/commonlibrary/c_utils/base/test/benchmarktest/ashemem_benchmark_test/ |
H A D | ashemem_benchmark_test.cpp | 75 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); in BENCHMARK_F() 98 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); in BENCHMARK_F() 139 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); in BENCHMARK_F() 178 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); in BENCHMARK_F() 220 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); in BENCHMARK_F() 258 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), -1); in BENCHMARK_F() 281 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); in BENCHMARK_F() 301 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); in BENCHMARK_F() 327 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); in BENCHMARK_F() 355 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); in BENCHMARK_F() [all …]
|
/ohos5.0/commonlibrary/c_utils/base/test/unittest/common/ |
H A D | utils_ashmem_test.cpp | 67 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); 85 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); 120 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); 154 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); 191 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); 223 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), -1); 242 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); 258 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); 280 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); 304 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(MEMORY_NAME.c_str(), MEMORY_SIZE); [all …]
|
/ohos5.0/docs/en/application-dev/reference/apis-driverdevelopment-kit/ |
H A D | _base_ddk.md | 6 Provides APIs for creating, mapping, unmapping, and destroying an **Ashmem** object. 84 Creates an **Ashmem** object. 90 | name | Name of the **Ashmem** object.| 91 | size | Buffer size of the **Ashmem** object.| 92 | ashmem | Pointer to the **Ashmem** object.| 110 Maps an **Ashmem** object. 116 | ashmem | Pointer to the **Ashmem** object.| 117 | ashmemMapType | Mapping type for the **Ashmem** object.| 136 Unmaps an **Ashmem** object. 142 | ashmem | Pointer to the **Ashmem** object.| [all …]
|
H A D | _ddk_ashmem.md | 6 Defines the data structure of **Ashmem** objects. 24 | [ashmemFd](#ashmemfd) | File descriptor of the **Ashmem** object.| 25 | [address](#address) | Mapping address of the **Ashmem** object.| 44 File descriptor of the **Ashmem** object. 56 Mapping address of the **Ashmem** object.
|
H A D | ddk_api.md | 24 …) (const uint8_t *name, [DDK_Ashmem](_ddk_ashmem.md) \*\*ashmem) | Creates an **Ashmem** object. | 25 …DDK_Ashmem](_ddk_ashmem.md) \*ashmem), const uint8_t ashmemMapType) | Maps an **Ashmem** object. | 26 …dk.md#oh_ddk_unmapashmem) ([DDK_Ashmem](_ddk_ashmem.md) \*ashmem) | Unmaps an **Ashmem** object. | 27 …d#oh_ddk_destoryashmem) ([DDK_Ashmem](_ddk_ashmem.md) \*ashmem) | Destroys an **Ashmem** object. |
|
/ohos5.0/commonlibrary/c_utils/base/include/ |
H A D | ashmem.h | 35 class Ashmem; variable 41 std::shared_ptr<Ashmem> CreateAshmemStd(const char *name, int32_t size); 82 class Ashmem : public virtual RefBase { 98 static sptr<Ashmem> CreateAshmem(const char *name, int32_t size); 106 Ashmem(int fd, int32_t size); 107 ~Ashmem() override;
|
/ohos5.0/docs/zh-cn/release-notes/changelogs/OpenHarmony_3.2.8.1/ |
H A D | changelogs-dsoftbus.md | 89 | MessageParcel | writeAshmem(ashmem: Ashmem): boolean | MessageSequence | writeAshmem(ashmem: Ashm… 90 | MessageParcel | readAshmem(): Ashmem | MessageSequence | readAshmem(): Ashmem | 122 | Ashmem | static createAshmem(name: string, size: number): Ashmem | NA | static create(name: strin… 123 | Ashmem | static createAshmemFromExisting(ashmem: Ashmem): Ashmem | NA | static create(ashmem: As… 124 | Ashmem | mapAshmem(mapType: number): boolean | NA | mapTypedAshmem(mapType: number): void | 125 | Ashmem | mapReadAndWriteAshmem(): boolean | NA | mapReadWriteAshmem(): void | 126 | Ashmem | mapReadOnlyAshmem(): boolean | NA | mapReadonlyAshmem(): void | 127 | Ashmem | setProtection(protectionType: number): boolean | NA | setProtectionType(protectionType:… 128 | Ashmem | writeToAshmem(buf: number[], size: number, offset: number): boolean | NA | writeAshmem(… 129 | Ashmem | readFromAshmem(size: number, offset: number): number[] | NA | readAshmem(size: number, …
|
/ohos5.0/foundation/ai/intelligent_voice_framework/services/intell_voice_engine/server/base/ |
H A D | data_operation_callback.cpp | 28 const sptr<Ashmem> &inBuffer, in OnIntellVoiceDataOprEvent() 29 sptr<Ashmem> &outBuffer) in OnIntellVoiceDataOprEvent() 84 const sptr<Ashmem> &ashmem) in CreateArrayBufferFromAshmem() 111 sptr<Ashmem> DataOperationCallback::CreateAshmemFromArrayBuffer( in CreateAshmemFromArrayBuffer() 124 …sptr<Ashmem> ashmem = OHOS::Ashmem::CreateAshmem(name.c_str(), buffer->GetSize() * sizeof(uint8_t)… in CreateAshmemFromArrayBuffer()
|
H A D | data_operation_callback.h | 33 int32_t OnIntellVoiceDataOprEvent(IntellVoiceDataOprType type, const sptr<Ashmem> &inBuffer, 34 sptr<Ashmem> &outBuffer) override; 37 …<OHOS::IntellVoiceUtils::Uint8ArrayBuffer> CreateArrayBufferFromAshmem(const sptr<Ashmem> &ashmem); 38 …sptr<Ashmem> CreateAshmemFromArrayBuffer(const std::unique_ptr<OHOS::IntellVoiceUtils::Uint8ArrayB…
|
/ohos5.0/foundation/graphic/graphic_2d/rosen/modules/platform/utils/ |
H A D | ashmem.h | 67 class Ashmem : public virtual RefBase { 81 static sptr<Ashmem> CreateAshmem(const char *name, int32_t size); 183 Ashmem(int fd, int32_t size); 184 ~Ashmem() override;
|
/ohos5.0/docs/en/release-notes/changelogs/OpenHarmony_3.2.8.1/ |
H A D | changelogs-dsoftbus.md | 89 | MessageParcel | writeAshmem(ashmem: Ashmem): boolean | MessageSequence | writeAshmem(ashmem: Ashm… 90 | MessageParcel | readAshmem(): Ashmem | MessageSequence | readAshmem(): Ashmem | 122 | Ashmem | static createAshmem(name: string, size: number): Ashmem | NA | static create(name: strin… 123 | Ashmem | static createAshmemFromExisting(ashmem: Ashmem): Ashmem | NA | static create(ashmem: As… 124 | Ashmem | mapAshmem(mapType: number): boolean | NA | mapTypedAshmem(mapType: number): void | 125 | Ashmem | mapReadAndWriteAshmem(): boolean | NA | mapReadWriteAshmem(): void | 126 | Ashmem | mapReadOnlyAshmem(): boolean | NA | mapReadonlyAshmem(): void | 127 | Ashmem | setProtection(protectionType: number): boolean | NA | setProtectionType(protectionType:… 128 | Ashmem | writeToAshmem(buf: number[], size: number, offset: number): boolean | NA | writeAshmem(… 129 | Ashmem | readFromAshmem(size: number, offset: number): number[] | NA | readAshmem(size: number, …
|
/ohos5.0/base/hiviewdfx/hisysevent/adapter/native/idl/include/ |
H A D | ash_mem_utils.h | 27 … static sptr<Ashmem> WriteBulkData(MessageParcel& parcel, const std::vector<std::u16string>& src); 29 static void CloseAshmem(sptr<Ashmem> ashmem); 32 static sptr<Ashmem> GetAshmem();
|
/ohos5.0/base/hiviewdfx/hiview/adapter/plugins/eventservice/service/idl/include/ |
H A D | ash_mem_utils.h | 27 … static sptr<Ashmem> WriteBulkData(MessageParcel& parcel, const std::vector<std::u16string>& src); 29 static void CloseAshmem(sptr<Ashmem> ashmem); 32 static sptr<Ashmem> GetAshmem();
|
/ohos5.0/foundation/ability/form_fwk/test/unittest/fms_form_ashmem_test/ |
H A D | mock_message_parcel.cpp | 145 bool MessageParcel::WriteAshmem(sptr<Ashmem> ashmem) in WriteAshmem() 150 sptr<Ashmem> MessageParcel::ReadAshmem() in ReadAshmem() 155 sptr<Ashmem> ashmem = new (std::nothrow) Ashmem(fd, size); in ReadAshmem()
|
H A D | fms_form_ashmem_test.cpp | 74 form_ashmem_->ashmem_ = new (std::nothrow) Ashmem(fd, size); 138 form_ashmem_->ashmem_ = new (std::nothrow) Ashmem(fd, size); 155 form_ashmem_->ashmem_ = new (std::nothrow) Ashmem(fd, size); 228 form_ashmem_->ashmem_ = new (std::nothrow) Ashmem(fd, size); 248 form_ashmem_->ashmem_ = new (std::nothrow) Ashmem(fd, size); 268 form_ashmem_->ashmem_ = new (std::nothrow) Ashmem(fd, size);
|
/ohos5.0/base/tee/tee_client/interfaces/kits/c/src/ |
H A D | tee_client.h | 123 TEEC_Result CopyTeecOptMem(TEEC_Operation *operation, size_t optMemSize, sptr<Ashmem> &optMem); 124 TEEC_Result TeecOptEncode(TEEC_Operation *operation, sptr<Ashmem> &optMem, size_t dataSize); 125 …TEEC_Result TeecOptEncodeTempMem(const TEEC_Parameter *param, sptr<Ashmem> &optMem, size_t *dataSi… 126 …TEEC_Result GetTeecOptMem(TEEC_Operation *operation, size_t optMemSize, sptr<Ashmem> &optMem, Mess… 133 uint32_t paramType, sptr<Ashmem> &optMem, size_t *dataSize); 134 bool CovertEncodePtr(sptr<Ashmem> &optMem, size_t *sizeLeft, TEEC_SharedMemory *shm);
|
/ohos5.0/foundation/ai/neural_network_runtime/example/drivers/nnrt/v1_0/hdi_cpu_service/include/ |
H A D | prepared_model_service.h | 54 sptr<Ashmem> ParseBuffer(const SharedBuffer& buffer); 64 sptr<Ashmem> m_cacheBuffer {nullptr}; 65 std::vector<sptr<Ashmem>> m_inputAshmems; 67 std::vector<sptr<Ashmem>> m_outputAshmems;
|
/ohos5.0/drivers/peripheral/codec/hal/idl_service/src/ |
H A D | codec_share_buffer.cpp | 33 void CodecShareBuffer::SetAshMem(std::shared_ptr<OHOS::Ashmem> shMem) in SetAshMem() 45 std::shared_ptr<OHOS::Ashmem> sharedMem = std::make_shared<OHOS::Ashmem>(codecBuffer.fd, size); in Create() 72 std::shared_ptr<Ashmem> sharedMemory = std::make_shared<Ashmem>(sharedFD, codecBuffer.allocLen); in Allocate()
|
/ohos5.0/foundation/ai/neural_network_runtime/example/drivers/nnrt/v2_0/hdi_cpu_service/include/ |
H A D | prepared_model_service.h | 57 sptr<Ashmem> ParseBuffer(const SharedBuffer& buffer); 67 sptr<Ashmem> m_cacheBuffer {nullptr}; 68 std::vector<sptr<Ashmem>> m_inputAshmems; 70 std::vector<sptr<Ashmem>> m_outputAshmems;
|