diff options
Diffstat (limited to 'include/binder/MemoryHeapBase.h')
-rw-r--r-- | include/binder/MemoryHeapBase.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/binder/MemoryHeapBase.h b/include/binder/MemoryHeapBase.h index 2f2e31b..bbbda9c 100644 --- a/include/binder/MemoryHeapBase.h +++ b/include/binder/MemoryHeapBase.h @@ -27,7 +27,7 @@ namespace android { // --------------------------------------------------------------------------- -class MemoryHeapBase : public virtual BnMemoryHeap +class MemoryHeapBase : public virtual BnMemoryHeap { public: enum { @@ -38,12 +38,12 @@ public: NO_CACHING = 0x00000200 }; - /* + /* * maps the memory referenced by fd. but DOESN'T take ownership * of the filedescriptor (it makes a copy with dup() */ MemoryHeapBase(int fd, size_t size, uint32_t flags = 0, uint32_t offset = 0); - + /* * maps memory from the given device */ @@ -61,9 +61,10 @@ public: virtual void* getBase() const; virtual size_t getSize() const; virtual uint32_t getFlags() const; + virtual uint32_t getOffset() const; const char* getDevice() const; - + /* this closes this heap -- use carefully */ void dispose(); @@ -74,12 +75,12 @@ public: mDevice = device; return mDevice ? NO_ERROR : ALREADY_EXISTS; } - + protected: MemoryHeapBase(); // init() takes ownership of fd status_t init(int fd, void *base, int size, - int flags = 0, const char* device = NULL); + int flags = 0, const char* device = NULL); private: status_t mapfd(int fd, size_t size, uint32_t offset = 0); @@ -90,6 +91,7 @@ private: uint32_t mFlags; const char* mDevice; bool mNeedUnmap; + uint32_t mOffset; }; // --------------------------------------------------------------------------- |