source: rtems/c/src/lib/libbsp/i386/shared/realmode_int/realmode_int.h @ adc1dbeb

4.115
Last change on this file since adc1dbeb was 586c86c7, checked in by Jan Dolezal <dolezj21@…>, on 11/20/14 at 14:00:31

i386/shared/realmode_int: real mode interrupt interface

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/**
2 * @file realmode_int.h
3 *
4 * @ingroup i386_shared
5 *
6 * @brief Definitioins supporting real mode interrupt calls.
7 */
8
9/*
10 *  Interface allows calling given interrupt number with content of the
11 *  registers defined. For passing or receiving higher amounts of the data
12 *  there is a buffer accessible from real mode available. Real mode pointer
13 *  to this buffer is passed to the interrupt in the registers.
14 *
15 * Copyright (C) 2014  Jan DoleÅŸal (dolezj21@fel.cvut.cz)
16 *                     CTU in Prague.
17 *
18 *  The license and distribution terms for this file may be
19 *  found in the file LICENSE in this distribution or at
20 *  http://www.rtems.org/license/LICENSE.
21 */
22
23#ifndef _REALMODE_INT_H
24#define _REALMODE_INT_H
25
26#include <libcpu/cpu.h>
27#include <stdint.h>
28
29#ifndef ASM /* ASM */
30
31#ifdef __cplusplus
32extern "C" {
33#endif /* __cplusplus */
34
35/* --- BIOS service interrupt number --- */
36/* number of interrupt servicing video functions */
37#define INTERRUPT_NO_VIDEO_SERVICES 0x10
38
39typedef struct { /* used for passing parameters, fetching results and preserving values */
40    uint32_t reg_eax;
41    uint32_t reg_ebx;
42    uint32_t reg_ecx;
43    uint32_t reg_edx;
44    uint32_t reg_esi;
45    uint32_t reg_edi;
46    uint16_t reg_ds;
47    uint16_t reg_es;
48    uint16_t reg_fs;
49    uint16_t reg_gs;
50} RTEMS_COMPILER_PACKED_ATTRIBUTE i386_realmode_interrupt_registers;
51
52/**
53 * Provides position to real mode buffer. It is buffer
54 * accessible from real mode context - it is located below
55 * address ~0x100000 in order for it to be accessible
56 * This buffer is meant to be pointed to by segReg:GenPurpReg
57 * and through this get bigger portion of an information to/from
58 * interrupt service routine than just by using register.
59 *
60 * @param size pointer to variable, where the size of buffer
61 *        will be filled
62 * @retval pointer to buffer
63 */
64extern void *i386_get_default_rm_buffer(uint16_t *size);
65
66/**
67 * This function allows calling interrupts in real mode and to set processor
68 * registers as desired before interrupt call is made and to retrieve the
69 * registers content after call was made.
70 *
71 * @param interruptNumber interrupt number to be called
72 * @param ir pointer to structure containing registers to be passed to interrupt
73 *        and to retrieve register content after call was made.
74 * @retval  0 call failed (GDT too small or pagin is on)
75 *          1 call successful
76 */
77extern int i386_real_interrupt_call(uint8_t interruptNumber, i386_realmode_interrupt_registers *ir);
78
79#ifdef __cplusplus
80}
81#endif /* __cplusplus */
82
83#endif /* ASM */
84
85#endif /* _REALMODE_INT_H */
Note: See TracBrowser for help on using the repository browser.