diff options
author | Sidath Senanayake <sidaths@google.com> | 2017-07-11 16:57:40 +0200 |
---|---|---|
committer | Sidath Senanayake <sidaths@google.com> | 2017-07-11 16:57:40 +0200 |
commit | ea23e535ae857c92d45cb11bdd5dba7c27579726 (patch) | |
tree | e1bcda85e529f9be3f02202b81fb3e8f6ab73129 /mali_kbase/mali_kbase_mem_lowlevel.h | |
parent | 6f5ab3baed824941f168ab133469f997d4450146 (diff) | |
download | gpu-ea23e535ae857c92d45cb11bdd5dba7c27579726.tar.gz |
Mali Bifrost DDK r7p0 KMD
Provenance:
cbfad67c8 (collaborate/EAC/b_r7p0)
BX304L01B-BU-00000-r7p0-01rel0
BX304L06A-BU-00000-r7p0-01rel0
BX304X07X-BU-00000-r7p0-01rel0
Signed-off-by: Sidath Senanayake <sidaths@google.com>
Change-Id: Icdf8b47a48b829cc228f4df3035f7b539da58104
Diffstat (limited to 'mali_kbase/mali_kbase_mem_lowlevel.h')
-rw-r--r-- | mali_kbase/mali_kbase_mem_lowlevel.h | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/mali_kbase/mali_kbase_mem_lowlevel.h b/mali_kbase/mali_kbase_mem_lowlevel.h index 9725fd3..f4e8849 100644 --- a/mali_kbase/mali_kbase_mem_lowlevel.h +++ b/mali_kbase/mali_kbase_mem_lowlevel.h @@ -1,6 +1,6 @@ /* * - * (C) COPYRIGHT 2012-2014, 2017 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2012-2014,2017 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -42,4 +42,48 @@ enum kbase_sync_type { KBASE_SYNC_TO_DEVICE }; -#endif /* _KBASE_LOWLEVEL_H */ +struct tagged_addr { phys_addr_t tagged_addr; }; + +#define HUGE_PAGE (1u << 0) +#define HUGE_HEAD (1u << 1) +#define FROM_PARTIAL (1u << 2) + +static inline phys_addr_t as_phys_addr_t(struct tagged_addr t) +{ + return t.tagged_addr & PAGE_MASK; +} + +static inline struct tagged_addr as_tagged(phys_addr_t phys) +{ + struct tagged_addr t; + + t.tagged_addr = phys & PAGE_MASK; + return t; +} + +static inline struct tagged_addr as_tagged_tag(phys_addr_t phys, int tag) +{ + struct tagged_addr t; + + t.tagged_addr = (phys & PAGE_MASK) | (tag & ~PAGE_MASK); + return t; +} + +static inline bool is_huge(struct tagged_addr t) +{ + return t.tagged_addr & HUGE_PAGE; +} + +static inline bool is_huge_head(struct tagged_addr t) +{ + int mask = HUGE_HEAD | HUGE_PAGE; + + return mask == (t.tagged_addr & mask); +} + +static inline bool is_partial(struct tagged_addr t) +{ + return t.tagged_addr & FROM_PARTIAL; +} + +#endif /* _KBASE_LOWLEVEL_H */ |