IMemory.hal revision ce07b526090e84e41b9185e81f24518cafbfccc6
1/* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.hidl.memory@1.0; 18 19interface IMemory { 20 21 /** 22 * Notify that you are about to use all of this memory. 23 */ 24 update(); 25 26 /** 27 * Notify that you are about to use the specific range. 28 * 29 * start + length must be < size 30 * 31 * @param start Offset from start of buffer about to be updated. 32 * @param length Number of bytes to be updated. 33 */ 34 updateRange(uint64_t start, uint64_t length); 35 36 /** 37 * Notify that you are done modifying this memory. 38 * 39 * Must commit all previous update's and updateAll's. 40 */ 41 commit(); 42 43 /** 44 * Must return the same value everytime it is called. Must be callable 45 * at any point in or outside of the update/commit process. 46 * 47 * @return ptr Actual pointer to underlying memory. 48 */ 49 getPointer() generates (pointer ptr); 50 51 /** 52 * @return size Size in bytes of underlying memory. 53 */ 54 getSize() generates (uint64_t size); 55 56};