1 /** Tests a few features of a driver struct - a struct with
2 many function pointers.
7 /* Set to one to show the bug */
14 typedef unsigned char uchar
;
16 /* Originally from UZIX - http://uzix.sourceforge.net/
19 typedef struct s_devsw
{
20 uchar minors
; /* # of minor device numbers */
21 int (*dev_init
)(uchar
NAME(minor
)) __reentrant
;
22 int (*dev_open
)(uchar
NAME(minor
)) __reentrant
;
23 int (*dev_close
)(uchar
NAME(minor
)) __reentrant
;
24 int (*dev_read
)(uchar
NAME(minor
), uchar
NAME(w
)) __reentrant
;
25 int (*dev_write
)(uchar
NAME(minor
), uchar
NAME(w
)) __reentrant
;
26 int (*dev_ioctl
)(uchar
NAME(minor
), int cmd
, void *__data
) __reentrant
;
30 _init (uchar minor
) __reentrant
35 static devsw_t _sillyDriver
= {
38 NULL
, NULL
, NULL
, NULL
, NULL
42 initProxy (devsw_t
*pdrv
)
44 return (*pdrv
->dev_init
)(5);
48 testDriverStruct (void)
50 ASSERT (initProxy(&_sillyDriver
) == 5);