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.
26 #include <arch/pc/x86common.h>
30 * U32 PnpBiosSupported(VOID);
34 _pnp_bios_entry_point:
36 _pnp_bios_data_segment:
39 EXTERN(PnpBiosSupported)
54 cmp eax, 0x506E5024 /* "$PnP" */
65 /* first calculate the checksum */
83 /* Calculate the bios entry point (far pointer) */
88 mov _pnp_bios_entry_point, eax
90 /* Store bios data segment */
92 mov _pnp_bios_data_segment, ax
106 * U32 PnpBiosGetDeviceNodeCount(U32 *NodeSize, U32 *NodeCount);
117 EXTERN(PnpBiosGetDeviceNodeCount)
126 call x86_64_SwitchToReal
129 mov ax, _pnp_bios_data_segment
133 mov ax, _pnp_node_size
137 mov ax, _pnp_node_count
142 call [_pnp_bios_entry_point]
148 call x86_16_SwitchToLong
151 mov esi, [rbp + 0x08]
152 mov ax, _pnp_node_size
156 mov rsi, [ebp + 0x0C]
157 mov ax, _pnp_node_count
174 * U32 PnpBiosGetDeviceNode(U8 *NodeId, U8 *NodeBuffer);
186 EXTERN(PnpBiosGetDeviceNode)
195 /* get current node number */
196 mov rsi, [rbp + 0x08]
198 mov _pnp_node_number, al
200 /* convert pointer to node buffer to segment/offset */
201 mov eax, [rbp + 0x0C]
204 mov _pnp_buffer_segment , ax
205 mov eax, [rbp + 0x0C]
207 mov _pnp_buffer_offset, ax
209 call x86_64_SwitchToReal
212 /* push bios segment */
213 mov ax, _pnp_bios_data_segment
216 /* push control flag */
219 /* push pointer to node buffer (segment/offset) */
220 mov ax, _pnp_buffer_segment
222 mov ax, _pnp_buffer_offset
225 /* push pointer to node number (segment/offset) */
227 mov ax, _pnp_node_number
230 /* push function number */
233 /* call entry point */
234 call [_pnp_bios_entry_point]
240 call x86_16_SwitchToLong
243 /* update node number */
244 mov rsi, [rbp + 0x08]
245 mov al, _pnp_node_number