3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; version 2 of the License.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include <sys/types.h>
23 #include <sys/ioctl.h>
26 #include "ps3hvc_dev.h"
28 int ps3hvc_dev_open(const char *path
)
30 return open(path
, O_RDWR
);
33 int ps3hvc_dev_close(int fd
)
38 int ps3hvc_dev_hvcall(int fd
, uint64_t number
, uint64_t in_args
,
39 uint64_t out_args
, uint64_t args
[], uint64_t *result
)
41 struct ps3hvc_ioctl_hvcall
*arg
;
44 size
= sizeof(struct ps3hvc_ioctl_hvcall
) + (in_args
+ out_args
) * sizeof(uint64_t);
52 arg
->in_args
= in_args
;
53 arg
->out_args
= out_args
;
54 memcpy(arg
->args
, args
, in_args
);
56 error
= ioctl(fd
, PS3HVC_IOCTL_HVCALL
, arg
);
59 *result
= arg
->result
;