iPXE
pci_autoboot.c
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2014 Red Hat Inc.
00003  *      Alex Williamson <alex.williamson@redhat.com>
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License as
00007  * published by the Free Software Foundation; either version 2 of the
00008  * License, or any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018  * 02110-1301, USA.
00019  *
00020  * You can also choose to distribute this program under the terms of
00021  * the Unmodified Binary Distribution Licence (as given in the file
00022  * COPYING.UBDL), provided that you have satisfied its requirements.
00023  */
00024 
00025 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00026 
00027 #include <stdint.h>
00028 #include <ipxe/device.h>
00029 #include <ipxe/init.h>
00030 #include <realmode.h>
00031 #include <usr/autoboot.h>
00032 
00033 uint16_t __bss16 ( autoboot_busdevfn );
00034 #define autoboot_busdevfn __use_data16 ( autoboot_busdevfn )
00035 
00036 /**
00037  * Initialise PCI autoboot device
00038  */
00039 static void pci_autoboot_init ( void ) {
00040 
00041         if ( autoboot_busdevfn )
00042                 set_autoboot_busloc ( BUS_TYPE_PCI, autoboot_busdevfn );
00043 }
00044 
00045 /** PCI autoboot device initialisation function */
00046 struct init_fn pci_autoboot_init_fn __init_fn ( INIT_NORMAL ) = {
00047         .initialise = pci_autoboot_init,
00048 };