PageRenderTime 29ms CodeModel.GetById 22ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/unicore32/include/asm/memblock.h

http://github.com/mirrors/linux
C Header | 43 lines | 23 code | 9 blank | 11 comment | 1 complexity | 2eb5a0704312d6b6b1e8e3dd19de9bcf MD5 | raw file
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * linux/arch/unicore32/include/asm/memblock.h
 4 *
 5 * Code specific to PKUnity SoC and UniCore ISA
 6 *
 7 * Copyright (C) 2001-2010 GUAN Xue-tao
 8 */
 9
10#ifndef __UNICORE_MEMBLOCK_H__
11#define __UNICORE_MEMBLOCK_H__
12
13/*
14 * Memory map description
15 */
16# define NR_BANKS 8
17
18struct membank {
19	unsigned long start;
20	unsigned long size;
21	unsigned int highmem;
22};
23
24struct meminfo {
25	int nr_banks;
26	struct membank bank[NR_BANKS];
27};
28
29extern struct meminfo meminfo;
30
31#define for_each_bank(iter, mi)				\
32	for (iter = 0; iter < (mi)->nr_banks; iter++)
33
34#define bank_pfn_start(bank)	__phys_to_pfn((bank)->start)
35#define bank_pfn_end(bank)	__phys_to_pfn((bank)->start + (bank)->size)
36#define bank_pfn_size(bank)	((bank)->size >> PAGE_SHIFT)
37#define bank_phys_start(bank)	((bank)->start)
38#define bank_phys_end(bank)	((bank)->start + (bank)->size)
39#define bank_phys_size(bank)	((bank)->size)
40
41extern void uc32_memblock_init(struct meminfo *);
42
43#endif