diff options
author | Paul Moore <pmoore@redhat.com> | 2012-03-09 11:19:49 -0500 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2012-03-09 11:53:26 -0500 |
commit | a617f35d34f3831ef09d7a8b47ec6eee0d5e880e (patch) | |
tree | 78bc7a97ccf66a5fe56bed29a7e20e2ae98d1059 /src/arch-x86_64.c | |
parent | 5119c5880fbc5df41acfb2a448b0f24616cb92ec (diff) | |
download | libseccomp-a617f35d34f3831ef09d7a8b47ec6eee0d5e880e.tar.gz |
arch: simplify the arch dependent code quite a bit
In the majority of the cases, we don't need to implement full
functions when a simple #define will work. We also probably don't
need to pass as many arguments as we are at present.
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'src/arch-x86_64.c')
-rw-r--r-- | src/arch-x86_64.c | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/arch-x86_64.c b/src/arch-x86_64.c deleted file mode 100644 index bf72cd0..0000000 --- a/src/arch-x86_64.c +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Enhanced Seccomp x86_64 Specific Code - * - * Copyright (c) 2012 Red Hat <pmoore@redhat.com> - * Author: Paul Moore <pmoore@redhat.com> - */ - -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <stdlib.h> - -#include "arch.h" -#include "arch-x86_64.h" - -/** - * Determine the maximum number of syscall arguments - * @param arch the architecture definition - * - * Determine the maximum number of syscall arguments for the given architecture. - * Returns the number of arguments on success, negative values on failure. - * - */ -int x86_64_arg_count_max(const struct arch_def *arch) -{ - return 6; -} - -/** - * Determine the argument offset for the lower 32 bits - * @param arch the architecture definition - * @param arg the argument number - * - * Determine the correct offset for the low 32 bits of the given argument based - * on the architecture definition. Returns the offset on success, negative - * values on failure. - * - */ -int x86_64_arg_offset_lo(const struct arch_def *arch, unsigned int arg) -{ - return x86_64_arg_offset(arch, arg); -} - -/** - * Determine the argument offset for the high 32 bits - * @param arch the architecture definition - * @param arg the argument number - * - * Determine the correct offset for the high 32 bits of the given argument - * based on the architecture definition. Returns the offset on success, - * negative values on failure. - * - */ -int x86_64_arg_offset_hi(const struct arch_def *arch, unsigned int arg) -{ - return x86_64_arg_offset(arch, arg) + 4; -} - -/** - * Determine the argument offset - * @param arch the architecture definition - * @param arg the argument number - * - * Determine the correct offset of the given argument based on the architecture - * definition. Returns the offset on success, negative values on failure. - * - */ -int x86_64_arg_offset(const struct arch_def *arch, unsigned int arg) -{ - return 8 + (arg * 8); -} |