/* * Alignment access counters and corresponding user-space interfaces. * * Copyright (C) 2009 ST Microelectronics * Copyright (C) 2009 - 2010 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details.
*/ #include <linux/module.h> #include <linux/kernel.h> #include <linux/seq_file.h> #include <linux/proc_fs.h> #include <linux/uaccess.h> #include <linux/ratelimit.h> #include <asm/alignment.h> #include <asm/processor.h>
staticunsignedlong se_user; staticunsignedlong se_sys; staticunsignedlong se_half; staticunsignedlong se_word; staticunsignedlong se_dword; staticunsignedlong se_multi; /* bitfield: 1: warn 2: fixup 4: signal -> combinations 2|4 && 1|2|4 are not
valid! */ staticint se_usermode = UM_WARN | UM_FIXUP; /* 0: no warning 1: print a warning message, disabled by default */ staticint se_kernmode_warn;
/* * This defaults to the global policy which can be set from the command * line, while processes can overload their preferences via prctl().
*/ unsignedint unaligned_user_action(void)
{ unsignedint action = se_usermode;
/* * This needs to be done after sysctl_init_bases(), otherwise sys/ will be * overwritten. Actually, this shouldn't be in sys/ at all since * it isn't a sysctl, and it doesn't contain sysctl information. * We now locate it in /proc/cpu/alignment instead.
*/ staticint __init alignment_init(void)
{ struct proc_dir_entry *dir, *res;
dir = proc_mkdir("cpu", NULL); if (!dir) return -ENOMEM;
res = proc_create_data("alignment", S_IWUSR | S_IRUGO, dir,
&alignment_proc_ops, &se_usermode); if (!res) return -ENOMEM;
res = proc_create_data("kernel_alignment", S_IWUSR | S_IRUGO, dir,
&alignment_proc_ops, &se_kernmode_warn); if (!res) return -ENOMEM;
return 0;
}
fs_initcall(alignment_init);
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.