Angel Pons | 118a9c7 | 2020-04-02 23:48:34 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Elyes HAOUAS | e9a0130 | 2018-10-26 15:06:33 +0200 | [diff] [blame] | 3 | |
Aaron Durbin | df3a109 | 2013-03-13 12:41:44 -0500 | [diff] [blame] | 4 | #include <cbmem.h> |
Aaron Durbin | 0dff57d | 2015-03-05 21:18:33 -0600 | [diff] [blame] | 5 | #include <bootstate.h> |
Kyösti Mälkki | 4fbac46 | 2015-01-07 04:48:43 +0200 | [diff] [blame] | 6 | #include <symbols.h> |
Aaron Durbin | df3a109 | 2013-03-13 12:41:44 -0500 | [diff] [blame] | 7 | |
Aaron Durbin | 41607a4 | 2015-06-09 13:54:10 -0500 | [diff] [blame] | 8 | void cbmem_run_init_hooks(int is_recovery) |
Kyösti Mälkki | 823edda | 2014-12-18 18:30:29 +0200 | [diff] [blame] | 9 | { |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 10 | cbmem_init_hook_t *init_hook_ptr = |
| 11 | (cbmem_init_hook_t *)&_cbmem_init_hooks; |
| 12 | cbmem_init_hook_t *einit_hook_ptr = |
| 13 | (cbmem_init_hook_t *)&_ecbmem_init_hooks; |
Kyösti Mälkki | 4d10750 | 2014-12-19 10:17:46 +0200 | [diff] [blame] | 14 | |
Julius Werner | 7e0dea6 | 2019-02-20 18:39:22 -0800 | [diff] [blame] | 15 | if (REGION_SIZE(cbmem_init_hooks) == 0) |
Kyösti Mälkki | 4fbac46 | 2015-01-07 04:48:43 +0200 | [diff] [blame] | 16 | return; |
| 17 | |
| 18 | while (init_hook_ptr != einit_hook_ptr) { |
Aaron Durbin | 41607a4 | 2015-06-09 13:54:10 -0500 | [diff] [blame] | 19 | (*init_hook_ptr)(is_recovery); |
Kyösti Mälkki | 4fbac46 | 2015-01-07 04:48:43 +0200 | [diff] [blame] | 20 | init_hook_ptr++; |
| 21 | } |
Kyösti Mälkki | 823edda | 2014-12-18 18:30:29 +0200 | [diff] [blame] | 22 | } |