Fix a few whitespace and coding style issues.
[coreboot.git] / src / mainboard / iwave / iWRainbowG6 / mainboard_smi.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2008-2009 coresystems GmbH
5  *
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.
9  *
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.
14  *
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
18  */
19
20 #include <arch/io.h>
21 #include <arch/romcc_io.h>
22 #include <console/console.h>
23 #include <cpu/x86/smm.h>
24 #include "southbridge/intel/i82801gx/nvs.h" // FIXME: this should point to its own copy of nvs
25
26 /*
27  * The southbridge SMI handler checks whether gnvs has a valid pointer before
28  * calling the trap handler.
29  */
30 // extern global_nvs_t *gnvs;
31
32 int mainboard_io_trap_handler(int smif)
33 {
34         switch (smif) {
35         case 0x99:
36                 printk(BIOS_DEBUG, "Sample\n");
37                 // gnvs->smif = 0;
38                 break;
39         default:
40                 return 0;
41         }
42
43         /*
44          * On success, the IO Trap Handler returns 0.
45          * On failure, the IO Trap Handler returns a value != 0.
46          *
47          * For now, we force the return value to 0 and log all traps to
48          * see what's going on.
49          */
50         // gnvs->smif = 0;
51         return 1;
52 }