File indexing completed on 2025-05-11 08:24:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifdef HAVE_CONFIG_H
0023 #include "config.h"
0024 #endif
0025
0026 #include <rtems.h>
0027 #include <rtems/devnull.h>
0028 #include <rtems/libio.h>
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 uint32_t NULL_major;
0044 static char initialized;
0045
0046 rtems_device_driver null_initialize(
0047 rtems_device_major_number major,
0048 rtems_device_minor_number minor RTEMS_UNUSED,
0049 void *pargp RTEMS_UNUSED
0050 )
0051 {
0052 rtems_device_driver status;
0053
0054 if ( !initialized ) {
0055 initialized = 1;
0056
0057 status = rtems_io_register_name(
0058 "/dev/null",
0059 major,
0060 (rtems_device_minor_number) 0
0061 );
0062
0063 if (status != RTEMS_SUCCESSFUL)
0064 rtems_fatal_error_occurred(status);
0065
0066 NULL_major = major;
0067 }
0068
0069 return RTEMS_SUCCESSFUL;
0070 }
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085 rtems_device_driver null_open(
0086 rtems_device_major_number major RTEMS_UNUSED,
0087 rtems_device_minor_number minor RTEMS_UNUSED,
0088 void *pargp RTEMS_UNUSED
0089 )
0090 {
0091 return NULL_SUCCESSFUL;
0092 }
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108 rtems_device_driver null_close(
0109 rtems_device_major_number major RTEMS_UNUSED,
0110 rtems_device_minor_number minor RTEMS_UNUSED,
0111 void *pargp RTEMS_UNUSED
0112 )
0113 {
0114 return NULL_SUCCESSFUL;
0115 }
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131 rtems_device_driver null_read(
0132 rtems_device_major_number major RTEMS_UNUSED,
0133 rtems_device_minor_number minor RTEMS_UNUSED,
0134 void *pargp RTEMS_UNUSED
0135 )
0136 {
0137 return NULL_SUCCESSFUL;
0138 }
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154 rtems_device_driver null_write(
0155 rtems_device_major_number major RTEMS_UNUSED,
0156 rtems_device_minor_number minor RTEMS_UNUSED,
0157 void *pargp
0158 )
0159 {
0160 rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
0161
0162 if ( rw_args )
0163 rw_args->bytes_moved = rw_args->count;
0164
0165 return NULL_SUCCESSFUL;
0166 }
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182 rtems_device_driver null_control(
0183 rtems_device_major_number major RTEMS_UNUSED,
0184 rtems_device_minor_number minor RTEMS_UNUSED,
0185 void *pargp RTEMS_UNUSED
0186 )
0187 {
0188 return NULL_SUCCESSFUL;
0189 }