Ronald G. Minnich | e0e784a | 2014-11-26 19:25:47 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 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 as published by |
| 6 | * the Free Software Foundation; version 2 of the License. |
| 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. |
Ronald G. Minnich | e0e784a | 2014-11-26 19:25:47 +0000 | [diff] [blame] | 12 | */ |
| 13 | |
| 14 | #include <cbmem.h> |
Jonathan Neuschäfer | fc5e6c6 | 2016-11-24 08:25:29 +0100 | [diff] [blame] | 15 | #include <commonlib/configstring.h> |
Ronald G. Minnich | e0e784a | 2014-11-26 19:25:47 +0000 | [diff] [blame] | 16 | |
| 17 | void *cbmem_top(void) |
| 18 | { |
Jonathan Neuschäfer | fc5e6c6 | 2016-11-24 08:25:29 +0100 | [diff] [blame] | 19 | uintptr_t base; |
| 20 | size_t size; |
| 21 | |
| 22 | query_mem(configstring(), &base, &size); |
| 23 | |
| 24 | return (void *)(base + size); |
Ronald G. Minnich | e0e784a | 2014-11-26 19:25:47 +0000 | [diff] [blame] | 25 | } |