| /* |
| * Copyright 2017, Data61, CSIRO (ABN 41 687 119 230) |
| * |
| * SPDX-License-Identifier: BSD-2-Clause |
| */ |
| |
| /** |
| * This interface defines presents an RPC interface to ia32 I/O ports. The |
| * camkes port configured with this interface should be connected using a |
| * HardwareIOPorts connector to a hardware component. |
| */ |
| |
| procedure IOPort { |
| include <stdint.h>; |
| |
| uint8_t in8(in uint16_t ioport); |
| uint16_t in16(in uint16_t ioport); |
| uint32_t in32(in uint16_t ioport); |
| |
| uint8_t in8_offset(in uint16_t offset); |
| uint16_t in16_offset(in uint16_t offset); |
| uint32_t in32_offset(in uint16_t offset); |
| |
| void out8(in uint16_t ioport, in uint8_t value); |
| void out16(in uint16_t ioport, in uint16_t value); |
| void out32(in uint16_t ioport, in uint32_t value); |
| |
| void out8_offset(in uint16_t offset, in uint8_t value); |
| void out16_offset(in uint16_t offset, in uint16_t value); |
| void out32_offset(in uint16_t offset, in uint32_t value); |
| |
| /* This function is expected to return 0 if the given port does not fall in |
| * the addressable range of this interface, or non-zero if it does. |
| */ |
| int in_range(in unsigned int port); |
| } |