aboutsummaryrefslogtreecommitdiffstats
path: root/runlist_procfs.c
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2023-06-29 17:09:54 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2023-06-29 17:14:49 -0400
commita3fe3788535dd099d15e0ddca455be58e1d63156 (patch)
tree414b93951935d9e434c78c68326af1f59fa54d5a /runlist_procfs.c
parent7e8fc4f9ae9fb4424aab73622cd9d7b89390dcb3 (diff)
Hacky support for Linux 5.6+ and the Jetson AGX Orin
Works around change in parameters to proc initialization functions via a hacky function which rewrites the layout. This also required making all the struct file_operations writable. Also start reducing dependency on nvgpu headers. Known issues: - Incorrect message printed in log after module is loaded. Unclear if this is because the register detection logic is broken, or if the layout of the data at NV_MC_BOOT_0 has changed. - Not tested
Diffstat (limited to 'runlist_procfs.c')
-rw-r--r--runlist_procfs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/runlist_procfs.c b/runlist_procfs.c
index a6b0d94..a0e71b0 100644
--- a/runlist_procfs.c
+++ b/runlist_procfs.c
@@ -171,7 +171,7 @@ static int runlist_file_open(struct inode *inode, struct file *f) {
171 return seq_open(f, &runlist_file_seq_ops); 171 return seq_open(f, &runlist_file_seq_ops);
172} 172}
173 173
174const struct file_operations runlist_file_ops = { 174struct file_operations runlist_file_ops = {
175 .open = runlist_file_open, 175 .open = runlist_file_open,
176 .read = seq_read, 176 .read = seq_read,
177 .llseek = seq_lseek, 177 .llseek = seq_lseek,
@@ -199,7 +199,7 @@ ssize_t preempt_tsg_file_write(struct file *f, const char __user *buffer,
199 return count; 199 return count;
200} 200}
201 201
202const struct file_operations preempt_tsg_file_ops = { 202struct file_operations preempt_tsg_file_ops = {
203 .write = preempt_tsg_file_write, 203 .write = preempt_tsg_file_write,
204}; 204};
205 205
@@ -236,7 +236,7 @@ ssize_t disable_channel_file_write(struct file *f, const char __user *buffer,
236 return count; 236 return count;
237} 237}
238 238
239const struct file_operations disable_channel_file_ops = { 239struct file_operations disable_channel_file_ops = {
240 .write = disable_channel_file_write, 240 .write = disable_channel_file_write,
241}; 241};
242 242
@@ -262,7 +262,7 @@ ssize_t enable_channel_file_write(struct file *f, const char __user *buffer,
262 return count; 262 return count;
263} 263}
264 264
265const struct file_operations enable_channel_file_ops = { 265struct file_operations enable_channel_file_ops = {
266 .write = enable_channel_file_write, 266 .write = enable_channel_file_write,
267}; 267};
268 268
@@ -317,6 +317,6 @@ ssize_t switch_to_tsg_file_write(struct file *f, const char __user *buffer,
317 return count; 317 return count;
318} 318}
319 319
320const struct file_operations switch_to_tsg_file_ops = { 320struct file_operations switch_to_tsg_file_ops = {
321 .write = switch_to_tsg_file_write, 321 .write = switch_to_tsg_file_write,
322}; 322};