| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2011 Texas Instruments Incorporated |
|---|
| 3 | 4 | * Author: Mark Salter <msalter@redhat.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 7 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 | | - * (at your option) any later version. |
|---|
| 9 | 5 | */ |
|---|
| 10 | 6 | |
|---|
| 11 | 7 | #ifndef __ASM_C6X_SYSCALL_H |
|---|
| 12 | 8 | #define __ASM_C6X_SYSCALL_H |
|---|
| 13 | 9 | |
|---|
| 10 | +#include <uapi/linux/audit.h> |
|---|
| 14 | 11 | #include <linux/err.h> |
|---|
| 15 | 12 | #include <linux/sched.h> |
|---|
| 16 | 13 | |
|---|
| .. | .. |
|---|
| 46 | 43 | } |
|---|
| 47 | 44 | |
|---|
| 48 | 45 | static inline void syscall_get_arguments(struct task_struct *task, |
|---|
| 49 | | - struct pt_regs *regs, unsigned int i, |
|---|
| 50 | | - unsigned int n, unsigned long *args) |
|---|
| 46 | + struct pt_regs *regs, |
|---|
| 47 | + unsigned long *args) |
|---|
| 51 | 48 | { |
|---|
| 52 | | - switch (i) { |
|---|
| 53 | | - case 0: |
|---|
| 54 | | - if (!n--) |
|---|
| 55 | | - break; |
|---|
| 56 | | - *args++ = regs->a4; |
|---|
| 57 | | - case 1: |
|---|
| 58 | | - if (!n--) |
|---|
| 59 | | - break; |
|---|
| 60 | | - *args++ = regs->b4; |
|---|
| 61 | | - case 2: |
|---|
| 62 | | - if (!n--) |
|---|
| 63 | | - break; |
|---|
| 64 | | - *args++ = regs->a6; |
|---|
| 65 | | - case 3: |
|---|
| 66 | | - if (!n--) |
|---|
| 67 | | - break; |
|---|
| 68 | | - *args++ = regs->b6; |
|---|
| 69 | | - case 4: |
|---|
| 70 | | - if (!n--) |
|---|
| 71 | | - break; |
|---|
| 72 | | - *args++ = regs->a8; |
|---|
| 73 | | - case 5: |
|---|
| 74 | | - if (!n--) |
|---|
| 75 | | - break; |
|---|
| 76 | | - *args++ = regs->b8; |
|---|
| 77 | | - case 6: |
|---|
| 78 | | - if (!n--) |
|---|
| 79 | | - break; |
|---|
| 80 | | - default: |
|---|
| 81 | | - BUG(); |
|---|
| 82 | | - } |
|---|
| 49 | + *args++ = regs->a4; |
|---|
| 50 | + *args++ = regs->b4; |
|---|
| 51 | + *args++ = regs->a6; |
|---|
| 52 | + *args++ = regs->b6; |
|---|
| 53 | + *args++ = regs->a8; |
|---|
| 54 | + *args = regs->b8; |
|---|
| 83 | 55 | } |
|---|
| 84 | 56 | |
|---|
| 85 | 57 | static inline void syscall_set_arguments(struct task_struct *task, |
|---|
| 86 | 58 | struct pt_regs *regs, |
|---|
| 87 | | - unsigned int i, unsigned int n, |
|---|
| 88 | 59 | const unsigned long *args) |
|---|
| 89 | 60 | { |
|---|
| 90 | | - switch (i) { |
|---|
| 91 | | - case 0: |
|---|
| 92 | | - if (!n--) |
|---|
| 93 | | - break; |
|---|
| 94 | | - regs->a4 = *args++; |
|---|
| 95 | | - case 1: |
|---|
| 96 | | - if (!n--) |
|---|
| 97 | | - break; |
|---|
| 98 | | - regs->b4 = *args++; |
|---|
| 99 | | - case 2: |
|---|
| 100 | | - if (!n--) |
|---|
| 101 | | - break; |
|---|
| 102 | | - regs->a6 = *args++; |
|---|
| 103 | | - case 3: |
|---|
| 104 | | - if (!n--) |
|---|
| 105 | | - break; |
|---|
| 106 | | - regs->b6 = *args++; |
|---|
| 107 | | - case 4: |
|---|
| 108 | | - if (!n--) |
|---|
| 109 | | - break; |
|---|
| 110 | | - regs->a8 = *args++; |
|---|
| 111 | | - case 5: |
|---|
| 112 | | - if (!n--) |
|---|
| 113 | | - break; |
|---|
| 114 | | - regs->a9 = *args++; |
|---|
| 115 | | - case 6: |
|---|
| 116 | | - if (!n) |
|---|
| 117 | | - break; |
|---|
| 118 | | - default: |
|---|
| 119 | | - BUG(); |
|---|
| 120 | | - } |
|---|
| 61 | + regs->a4 = *args++; |
|---|
| 62 | + regs->b4 = *args++; |
|---|
| 63 | + regs->a6 = *args++; |
|---|
| 64 | + regs->b6 = *args++; |
|---|
| 65 | + regs->a8 = *args++; |
|---|
| 66 | + regs->a9 = *args; |
|---|
| 67 | +} |
|---|
| 68 | + |
|---|
| 69 | +static inline int syscall_get_arch(struct task_struct *task) |
|---|
| 70 | +{ |
|---|
| 71 | + return IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) |
|---|
| 72 | + ? AUDIT_ARCH_C6XBE : AUDIT_ARCH_C6X; |
|---|
| 121 | 73 | } |
|---|
| 122 | 74 | |
|---|
| 123 | 75 | #endif /* __ASM_C6X_SYSCALLS_H */ |
|---|