2 * This file is part of the coreboot project.
4 * Copyright (C) 2008-2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 /* AMD64 SMM State-Save Area
27 /* used only by C programs so far */
28 #define SMM_BASE 0xa0000
123 } __attribute__((packed)) amd64_smm_state_save_area_t;
126 /* Intel Core 2 (EM64T) SMM State-Save Area
156 u16 autohalt_restart;
201 } __attribute__((packed)) em64t_smm_state_save_area_t;
204 /* Legacy x86 SMM State-Save Area
213 u16 autohalt_restart;
241 } __attribute__((packed)) legacy_smm_state_save_area_t;
251 save_state_type_t type;
253 amd64_smm_state_save_area_t *amd64_state_save;
254 em64t_smm_state_save_area_t *em64t_state_save;
255 legacy_smm_state_save_area_t *legacy_state_save;
257 } smm_state_save_area_t;
260 #define APM_CNT_CST_CONTROL 0x85
261 #define APM_CNT_PST_CONTROL 0x80
262 #define APM_CNT_ACPI_DISABLE 0x1e
263 #define APM_CNT_ACPI_ENABLE 0xe1
264 #define APM_CNT_MBI_UPDATE 0xeb
265 #define APM_CNT_GNVS_UPDATE 0xea
268 /* SMI handler function prototypes */
269 void smi_handler(u32 smm_revision);
271 void io_trap_handler(int smif);
272 int southbridge_io_trap_handler(int smif);
273 int __attribute__((weak)) mainboard_io_trap_handler(int smif);
275 void southbridge_smi_set_eos(void);
277 void __attribute__((weak)) cpu_smi_handler(unsigned int node, smm_state_save_area_t *state_save);
278 void __attribute__((weak)) northbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_save);
279 void __attribute__((weak)) southbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_save);
281 void __attribute__((weak)) mainboard_smi_gpi(u16 gpi_sts);
282 int __attribute__((weak)) mainboard_apm_cnt(u8 data);
284 void smi_release_lock(void);