Path: blob/master/arch/mips/powertv/asic/prealloc.h
10818 views
/*1* Definitions for memory preallocations2*3* Copyright (C) 2005-2009 Scientific-Atlanta, Inc.4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA18*/1920#ifndef _ARCH_MIPS_POWERTV_ASIC_PREALLOC_H21#define _ARCH_MIPS_POWERTV_ASIC_PREALLOC_H2223#define KIBIBYTE(n) ((n) * 1024) /* Number of kibibytes */24#define MEBIBYTE(n) ((n) * KIBIBYTE(1024)) /* Number of mebibytes */2526/* "struct resource" array element definition */27#define PREALLOC(NAME, START, END, FLAGS) { \28.name = (NAME), \29.start = (START), \30.end = (END), \31.flags = (FLAGS) \32},3334/* Individual resources in the preallocated resource arrays are defined using35* macros. These macros are conditionally defined based on their36* corresponding kernel configuration flag:37* - CONFIG_PREALLOC_NORMAL: preallocate resources for a normal settop box38* - CONFIG_PREALLOC_TFTP: preallocate the TFTP download resource39* - CONFIG_PREALLOC_DOCSIS: preallocate the DOCSIS resource40* - CONFIG_PREALLOC_PMEM: reserve space for persistent memory41*/42#ifdef CONFIG_PREALLOC_NORMAL43#define PREALLOC_NORMAL(name, start, end, flags) \44PREALLOC(name, start, end, flags)45#else46#define PREALLOC_NORMAL(name, start, end, flags)47#endif4849#ifdef CONFIG_PREALLOC_TFTP50#define PREALLOC_TFTP(name, start, end, flags) \51PREALLOC(name, start, end, flags)52#else53#define PREALLOC_TFTP(name, start, end, flags)54#endif5556#ifdef CONFIG_PREALLOC_DOCSIS57#define PREALLOC_DOCSIS(name, start, end, flags) \58PREALLOC(name, start, end, flags)59#else60#define PREALLOC_DOCSIS(name, start, end, flags)61#endif6263#ifdef CONFIG_PREALLOC_PMEM64#define PREALLOC_PMEM(name, start, end, flags) \65PREALLOC(name, start, end, flags)66#else67#define PREALLOC_PMEM(name, start, end, flags)68#endif69#endif707172