Praneeth Paladugu | 6e6fbdb | 2017-01-16 15:43:01 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef __VMEM_H__ |
| 15 | #define __VMEM_H__ |
| 16 | |
| 17 | #define VMEM_ERROR(value) \ |
| 18 | do { \ |
| 19 | pr_info("%s : Fatal Level = %d\n", KBUILD_MODNAME, value);\ |
| 20 | BUG_ON(value); \ |
| 21 | } while (0) |
| 22 | |
| 23 | #if (defined CONFIG_MSM_VIDC_VMEM) || (defined CONFIG_MSM_VIDC_VMEM_MODULE) |
| 24 | |
| 25 | int vmem_allocate(size_t size, phys_addr_t *addr); |
| 26 | void vmem_free(phys_addr_t to_free); |
| 27 | |
| 28 | #else |
| 29 | |
| 30 | static inline int vmem_allocate(size_t size, phys_addr_t *addr) |
| 31 | { |
| 32 | return -ENODEV; |
| 33 | } |
| 34 | |
| 35 | static inline void vmem_free(phys_addr_t to_free) |
| 36 | { |
| 37 | } |
| 38 | |
| 39 | #endif |
| 40 | |
| 41 | #endif /* __VMEM_H__ */ |