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.
32 * U32 PnpBiosSupported(VOID);
36 _pnp_bios_entry_point:
38 _pnp_bios_data_segment:
41 EXTERN(PnpBiosSupported)
56 cmp eax, 0x506E5024 /* "$PnP" */
67 /* first calculate the checksum */
85 /* Calculate the bios entry point (far pointer) */
90 mov _pnp_bios_entry_point, eax
92 /* Store bios data segment */
94 mov _pnp_bios_data_segment, ax
108 * U32 PnpBiosGetDeviceNodeCount(U32 *NodeSize, U32 *NodeCount);
119 EXTERN(PnpBiosGetDeviceNodeCount)
128 call x86_64_SwitchToReal
131 mov ax, _pnp_bios_data_segment
135 mov ax, _pnp_node_size
139 mov ax, _pnp_node_count
144 call [_pnp_bios_entry_point]
150 call x86_16_SwitchToLong
153 mov esi, [rbp + 0x08]
154 mov ax, _pnp_node_size
158 mov rsi, [ebp + 0x0C]
159 mov ax, _pnp_node_count
176 * U32 PnpBiosGetDeviceNode(U8 *NodeId, U8 *NodeBuffer);
188 EXTERN(PnpBiosGetDeviceNode)
197 /* get current node number */
198 mov rsi, [rbp + 0x08]
200 mov _pnp_node_number, al
202 /* convert pointer to node buffer to segment/offset */
203 mov eax, [rbp + 0x0C]
206 mov _pnp_buffer_segment , ax
207 mov eax, [rbp + 0x0C]
209 mov _pnp_buffer_offset, ax
211 call x86_64_SwitchToReal
214 /* push bios segment */
215 mov ax, _pnp_bios_data_segment
218 /* push control flag */
221 /* push pointer to node buffer (segment/offset) */
222 mov ax, _pnp_buffer_segment
224 mov ax, _pnp_buffer_offset
227 /* push pointer to node number (segment/offset) */
229 mov ax, _pnp_node_number
232 /* push function number */
235 /* call entry point */
236 call [_pnp_bios_entry_point]
242 call x86_16_SwitchToLong
245 /* update node number */
246 mov rsi, [rbp + 0x08]
247 mov al, _pnp_node_number