RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
riscv
niosv
niosvc10lp
include
system_device_driver.h
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
3
/*
4
*
5
* Copyright (C) 2024 Kevin Kirspel
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions
9
* are met:
10
* 1. Redistributions of source code must retain the above copyright
11
* notice, this list of conditions and the following disclaimer.
12
* 2. Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in the
14
* documentation and/or other materials provided with the distribution.
15
*
16
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26
* SUCH DAMAGE.
27
*/
28
29
#ifndef _SYSTEM_DRIVER_H
30
#define _SYSTEM_DRIVER_H
31
32
/* Definitions */
33
/* IOCTL Definitions */
34
#define IOCTL_SYSTEM_SOFTWARE_VERSION 0x00
35
#define IOCTL_SYSTEM_RESET 0x01
36
37
#define VERSION_SIZE 20
38
39
/* Global Structure definitions */
40
typedef
struct
SystemControlStruct
41
{
42
char
version[VERSION_SIZE];
43
}system_control_t;
44
45
#ifdef __cplusplus
46
extern
"C"
{
47
#endif
48
49
#define SYSTEM_DRIVER_TABLE_ENTRY \
50
{ system_initialize, system_open, system_close, \
51
system_read, system_write, system_control }
52
53
rtems_device_driver
system_initialize(
54
rtems_device_major_number
,
55
rtems_device_minor_number
,
56
void
*
57
);
58
59
rtems_device_driver
system_open(
60
rtems_device_major_number
,
61
rtems_device_minor_number
,
62
void
*
63
);
64
65
rtems_device_driver
system_close(
66
rtems_device_major_number
,
67
rtems_device_minor_number
,
68
void
*
69
);
70
71
rtems_device_driver
system_read(
72
rtems_device_major_number
,
73
rtems_device_minor_number
,
74
void
*
75
);
76
77
rtems_device_driver
system_write(
78
rtems_device_major_number
,
79
rtems_device_minor_number
,
80
void
*
81
);
82
83
rtems_device_driver
system_control(
84
rtems_device_major_number
,
85
rtems_device_minor_number
,
86
void
*
87
);
88
89
#ifdef __cplusplus
90
}
91
#endif
92
93
#endif
94
/* end of include file */
95
rtems_device_driver
rtems_status_code rtems_device_driver
This type shall be used in device driver entry declarations and definitions.
Definition
io.h:90
rtems_device_major_number
uint32_t rtems_device_major_number
This integer type represents the major number of devices.
Definition
io.h:103
rtems_device_minor_number
uint32_t rtems_device_minor_number
This integer type represents the minor number of devices.
Definition
io.h:115
SystemControlStruct
Definition
system_device_driver.h:41
Generated by
1.18.0