3 * Copyright (C) 2003 Eric Kohl
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
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 along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <arch/pc/x86common.h>
27 * U32 PnpBiosSupported(VOID);
31 _pnp_bios_entry_point:
33 _pnp_bios_data_segment:
36 PUBLIC _PnpBiosSupported
51 cmp eax, HEX(506E5024) /* "$PnP" */
62 /* first calculate the checksum */
80 /* Calculate the bios entry point (far pointer) */
85 mov _pnp_bios_entry_point, eax
87 /* Store bios data segment */
89 mov _pnp_bios_data_segment, ax
103 * U32 PnpBiosGetDeviceNodeCount(U32 *NodeSize, U32 *NodeCount);
114 PUBLIC _PnpBiosGetDeviceNodeCount
115 _PnpBiosGetDeviceNodeCount:
126 mov ax, word ptr [_pnp_bios_data_segment]
130 mov ax, offset _pnp_node_size
134 mov ax, offset _pnp_node_count
139 call dword ptr [_pnp_bios_entry_point]
150 mov ax, _pnp_node_size
155 mov ax, _pnp_node_count
171 * U32 PnpBiosGetDeviceNode(U8 *NodeId, U8 *NodeBuffer);
183 EXTERN(_PnpBiosGetDeviceNode)
192 /* get current node number */
195 mov _pnp_node_number, al
197 /* convert pointer to node buffer to segment/offset */
201 mov _pnp_buffer_segment, ax
204 mov _pnp_buffer_offset, ax
209 /* push bios segment */
210 mov ax, word ptr [_pnp_bios_data_segment]
213 /* push control flag */
216 /* push pointer to node buffer (segment/offset) */
217 mov ax, word ptr [_pnp_buffer_segment]
219 mov ax, word ptr [_pnp_buffer_offset]
222 /* push pointer to node number (segment/offset) */
224 mov ax, offset _pnp_node_number
227 /* push function number */
230 /* call entry point */
231 call dword ptr [_pnp_bios_entry_point]
240 /* update node number */
242 mov al, _pnp_node_number