Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
awilliam
GitHub Repository: awilliam/linux-vfio
Path: blob/master/arch/sh/mm/sram.c
10817 views
1
/*
2
* SRAM pool for tiny memories not otherwise managed.
3
*
4
* Copyright (C) 2010 Paul Mundt
5
*
6
* This file is subject to the terms and conditions of the GNU General Public
7
* License. See the file "COPYING" in the main directory of this archive
8
* for more details.
9
*/
10
#include <linux/init.h>
11
#include <linux/kernel.h>
12
#include <asm/sram.h>
13
14
/*
15
* This provides a standard SRAM pool for tiny memories that can be
16
* added either by the CPU or the platform code. Typical SRAM sizes
17
* to be inserted in to the pool will generally be less than the page
18
* size, with anything more reasonably sized handled as a NUMA memory
19
* node.
20
*/
21
struct gen_pool *sram_pool;
22
23
static int __init sram_pool_init(void)
24
{
25
/*
26
* This is a global pool, we don't care about node locality.
27
*/
28
sram_pool = gen_pool_create(1, -1);
29
if (unlikely(!sram_pool))
30
return -ENOMEM;
31
32
return 0;
33
}
34
core_initcall(sram_pool_init);
35
36