1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
use crate::ipc::sf::sm;
use crate::result::*;
use crate::ipc::sf;
use crate::ipc::client;
use crate::service;
pub use crate::ipc::sf::nv::*;
pub trait NvDrvService: client::IClientObject {}
impl<S: NvDrvService> INvDrvServices for S {
fn open(&mut self, path: sf::InMapAliasBuffer<u8>) -> Result<(Fd, ErrorCode)> {
ipc_client_send_request_command!([self.get_info(); 0] (path) => (fd: Fd, error_code: ErrorCode))
}
fn ioctl(&mut self, fd: Fd, id: IoctlId, in_buf: sf::InAutoSelectBuffer<u8>, out_buf: sf::OutAutoSelectBuffer<u8>) -> Result<ErrorCode> {
ipc_client_send_request_command!([self.get_info(); 1] (fd, id, in_buf, out_buf) => (error_code: ErrorCode))
}
fn close(&mut self, fd: Fd) -> Result<ErrorCode> {
ipc_client_send_request_command!([self.get_info(); 2] (fd) => (error_code: ErrorCode))
}
fn initialize(&mut self, transfer_mem_size: u32, self_process_handle: sf::CopyHandle, transfer_mem_handle: sf::CopyHandle) -> Result<ErrorCode> {
ipc_client_send_request_command!([self.get_info(); 3] (transfer_mem_size, self_process_handle, transfer_mem_handle) => (error_code: ErrorCode))
}
}
pub struct ApplicationNvDrvService {
session: sf::Session
}
impl sf::IObject for ApplicationNvDrvService {
ipc_sf_object_impl_default_command_metadata!();
}
impl NvDrvService for ApplicationNvDrvService {}
impl client::IClientObject for ApplicationNvDrvService {
fn new(session: sf::Session) -> Self {
Self { session }
}
fn get_session(&mut self) -> &mut sf::Session {
&mut self.session
}
}
impl service::IService for ApplicationNvDrvService {
fn get_name() -> sm::ServiceName {
sm::ServiceName::new("nvdrv")
}
fn as_domain() -> bool {
false
}
fn post_initialize(&mut self) -> Result<()> {
Ok(())
}
}
pub struct AppletNvDrvService {
session: sf::Session
}
impl sf::IObject for AppletNvDrvService {
ipc_sf_object_impl_default_command_metadata!();
}
impl NvDrvService for AppletNvDrvService {}
impl client::IClientObject for AppletNvDrvService {
fn new(session: sf::Session) -> Self {
Self { session }
}
fn get_session(&mut self) -> &mut sf::Session {
&mut self.session
}
}
impl service::IService for AppletNvDrvService {
fn get_name() -> sm::ServiceName {
sm::ServiceName::new("nvdrv:a")
}
fn as_domain() -> bool {
false
}
fn post_initialize(&mut self) -> Result<()> {
Ok(())
}
}
pub struct SystemNvDrvService {
session: sf::Session
}
impl sf::IObject for SystemNvDrvService {
ipc_sf_object_impl_default_command_metadata!();
}
impl NvDrvService for SystemNvDrvService {}
impl client::IClientObject for SystemNvDrvService {
fn new(session: sf::Session) -> Self {
Self { session }
}
fn get_session(&mut self) -> &mut sf::Session {
&mut self.session
}
}
impl service::IService for SystemNvDrvService {
fn get_name() -> sm::ServiceName {
sm::ServiceName::new("nvdrv:s")
}
fn as_domain() -> bool {
false
}
fn post_initialize(&mut self) -> Result<()> {
Ok(())
}
}