diff options
author | Jesper Nilsson <jesper@jni.nu> | 2018-03-11 11:05:23 +0100 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2018-03-16 10:56:05 +0100 |
commit | c690eddc2f3b44b24520f4a77cc3a4c9bde7d571 (patch) | |
tree | b7ba2caa6ebb2e36a529f9bf7182c9e0a73d53c4 /arch/cris/kernel/profile.c | |
parent | arch: remove tile port (diff) | |
download | linux-c690eddc2f3b44b24520f4a77cc3a4c9bde7d571.tar.xz linux-c690eddc2f3b44b24520f4a77cc3a4c9bde7d571.zip |
CRIS: Drop support for the CRIS port
The port was added back in 2000 so it's no longer even a good source
of inspiration for newer ports (if it ever was)
The last SoC (ARTPEC-3) with a CRIS main CPU was launched in 2008.
Coupled with time and working developer board hardware being
in low supply, it's time to drop the port from Linux.
So long and thanks for all the fish!
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/cris/kernel/profile.c')
-rw-r--r-- | arch/cris/kernel/profile.c | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c deleted file mode 100644 index d2f978ad129a..000000000000 --- a/arch/cris/kernel/profile.c +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include <linux/init.h> -#include <linux/errno.h> -#include <linux/kernel.h> -#include <linux/proc_fs.h> -#include <linux/slab.h> -#include <linux/types.h> -#include <asm/ptrace.h> -#include <linux/uaccess.h> - -#define SAMPLE_BUFFER_SIZE 8192 - -static char *sample_buffer; -static char *sample_buffer_pos; -static int prof_running = 0; - -void cris_profile_sample(struct pt_regs *regs) -{ - if (!prof_running) - return; - - if (user_mode(regs)) - *(unsigned int*)sample_buffer_pos = current->pid; - else - *(unsigned int*)sample_buffer_pos = 0; - - *(unsigned int *)(sample_buffer_pos + 4) = instruction_pointer(regs); - sample_buffer_pos += 8; - - if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE) - sample_buffer_pos = sample_buffer; -} - -static ssize_t -read_cris_profile(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - unsigned long p = *ppos; - ssize_t ret; - - ret = simple_read_from_buffer(buf, count, ppos, sample_buffer, - SAMPLE_BUFFER_SIZE); - if (ret < 0) - return ret; - - memset(sample_buffer + p, 0, ret); - - return ret; -} - -static ssize_t -write_cris_profile(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - sample_buffer_pos = sample_buffer; - memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); - return count < SAMPLE_BUFFER_SIZE ? count : SAMPLE_BUFFER_SIZE; -} - -static const struct file_operations cris_proc_profile_operations = { - .read = read_cris_profile, - .write = write_cris_profile, - .llseek = default_llseek, -}; - -static int __init init_cris_profile(void) -{ - struct proc_dir_entry *entry; - - sample_buffer = kmalloc(SAMPLE_BUFFER_SIZE, GFP_KERNEL); - if (!sample_buffer) { - return -ENOMEM; - } - - sample_buffer_pos = sample_buffer; - - entry = proc_create("system_profile", S_IWUSR | S_IRUGO, NULL, - &cris_proc_profile_operations); - if (entry) { - proc_set_size(entry, SAMPLE_BUFFER_SIZE); - } - prof_running = 1; - - return 0; -} -__initcall(init_cris_profile); - |