From 91f1cdccb0b70e2bed1ab68a237ba1629c5af5f8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 15 Oct 2012 18:54:50 +0100 Subject: [PATCH] Revert "Add in missed vchiq files" This reverts commit a542809e00a8e14984866a73547e0f1efcce57c3. --- .../interface/vchiq_arm/vchiq_build_info.h | 22 -- .../interface/vchiq_arm/vchiq_genversion | 87 ------- .../interface/vchiq_arm/vchiq_proc.c | 223 ------------------ .../interface/vchiq_arm/vchiq_version.c | 27 --- 4 files changed, 359 deletions(-) delete mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h delete mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion delete mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c delete mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h deleted file mode 100644 index 7c3ab948dd37d..0000000000000 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2010-2011 Broadcom. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -const char *vchiq_get_build_hostname(void); -const char *vchiq_get_build_version(void); -const char *vchiq_get_build_time(void); -const char *vchiq_get_build_date(void); diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion deleted file mode 100644 index 9f5b6344b9b77..0000000000000 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -# -# Generate a version from available information -# - -my $prefix = shift @ARGV; -my $root = shift @ARGV; - - -if ( not defined $root ) { - die "usage: $0 prefix root-dir\n"; -} - -if ( ! -d $root ) { - die "root directory $root not found\n"; -} - -my $version = "unknown"; -my $tainted = ""; - -if ( -d "$root/.git" ) { - # attempt to work out git version. only do so - # on a linux build host, as cygwin builds are - # already slow enough - - if ( -f "/usr/bin/git" || -f "/usr/local/bin/git" ) { - if (not open(F, "git --git-dir $root/.git rev-parse --verify HEAD|")) { - $version = "no git version"; - } - else { - $version = ; - $version =~ s/[ \r\n]*$//; # chomp may not be enough (cygwin). - $version =~ s/^[ \r\n]*//; # chomp may not be enough (cygwin). - } - - if (open(G, "git --git-dir $root/.git status --porcelain|")) { - $tainted = ; - $tainted =~ s/[ \r\n]*$//; # chomp may not be enough (cygwin). - $tainted =~ s/^[ \r\n]*//; # chomp may not be enough (cygwin). - if (length $tainted) { - $version = join ' ', $version, "(tainted)"; - } - else { - $version = join ' ', $version, "(clean)"; - } - } - } -} - -my $hostname = `hostname`; -$hostname =~ s/[ \r\n]*$//; # chomp may not be enough (cygwin). -$hostname =~ s/^[ \r\n]*//; # chomp may not be enough (cygwin). - - -print STDERR "Version $version\n"; -print < - -VC_DEBUG_DECLARE_STRING_VAR( ${prefix}_build_hostname, "$hostname" ); -VC_DEBUG_DECLARE_STRING_VAR( ${prefix}_build_version, "$version" ); -VC_DEBUG_DECLARE_STRING_VAR( ${prefix}_build_time, __TIME__ ); -VC_DEBUG_DECLARE_STRING_VAR( ${prefix}_build_date, __DATE__ ); - -const char *vchiq_get_build_hostname( void ) -{ - return vchiq_build_hostname; -} - -const char *vchiq_get_build_version( void ) -{ - return vchiq_build_version; -} - -const char *vchiq_get_build_date( void ) -{ - return vchiq_build_date; -} - -const char *vchiq_get_build_time( void ) -{ - return vchiq_build_time; -} -EOF diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c deleted file mode 100644 index 6e06c3bd05409..0000000000000 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2012 Broadcom Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include -#include "vchiq_core.h" -#include "vchiq_arm.h" - -struct vchiq_proc_info { - /* Global 'vc' proc entry used by all instances */ - struct proc_dir_entry *vc_cfg_dir; - - /* one entry per client process */ - struct proc_dir_entry *clients; - - /* log categories */ - struct proc_dir_entry *log_categories; -}; - -static struct vchiq_proc_info proc_info; - -struct proc_dir_entry *vchiq_proc_top(void) -{ - BUG_ON(proc_info.vc_cfg_dir == NULL); - return proc_info.vc_cfg_dir; -} - -/**************************************************************************** -* -* log category entries -* -***************************************************************************/ -#define PROC_WRITE_BUF_SIZE 256 - -#define VCHIQ_LOG_ERROR_STR "error" -#define VCHIQ_LOG_WARNING_STR "warning" -#define VCHIQ_LOG_INFO_STR "info" -#define VCHIQ_LOG_TRACE_STR "trace" - -static int log_cfg_read(char *buffer, - char **start, - off_t off, - int count, - int *eof, - void *data) -{ - int len = 0; - char *log_value = NULL; - - switch (*((int *)data)) { - case VCHIQ_LOG_ERROR: - log_value = VCHIQ_LOG_ERROR_STR; - break; - case VCHIQ_LOG_WARNING: - log_value = VCHIQ_LOG_WARNING_STR; - break; - case VCHIQ_LOG_INFO: - log_value = VCHIQ_LOG_INFO_STR; - break; - case VCHIQ_LOG_TRACE: - log_value = VCHIQ_LOG_TRACE_STR; - break; - default: - break; - } - - len += sprintf(buffer + len, - "%s\n", - log_value ? log_value : "(null)"); - - return len; -} - - -static int log_cfg_write(struct file *file, - const char __user *buffer, - unsigned long count, - void *data) -{ - int *log_module = data; - char kbuf[PROC_WRITE_BUF_SIZE + 1]; - - (void)file; - - memset(kbuf, 0, PROC_WRITE_BUF_SIZE + 1); - if (count >= PROC_WRITE_BUF_SIZE) - count = PROC_WRITE_BUF_SIZE; - - if (copy_from_user(kbuf, - buffer, - count) != 0) - return -EFAULT; - kbuf[count - 1] = 0; - - if (strncmp("error", kbuf, strlen("error")) == 0) - *log_module = VCHIQ_LOG_ERROR; - else if (strncmp("warning", kbuf, strlen("warning")) == 0) - *log_module = VCHIQ_LOG_WARNING; - else if (strncmp("info", kbuf, strlen("info")) == 0) - *log_module = VCHIQ_LOG_INFO; - else if (strncmp("trace", kbuf, strlen("trace")) == 0) - *log_module = VCHIQ_LOG_TRACE; - else - *log_module = VCHIQ_LOG_DEFAULT; - - return count; -} - -/* Log category proc entries */ -struct vchiq_proc_log_entry { - const char *name; - int *plevel; - struct proc_dir_entry *dir; -}; - -static struct vchiq_proc_log_entry vchiq_proc_log_entries[] = { - { "core", &vchiq_core_log_level }, - { "msg", &vchiq_core_msg_log_level }, - { "sync", &vchiq_sync_log_level }, - { "arm", &vchiq_arm_log_level }, -}; -static int n_log_entries = - sizeof(vchiq_proc_log_entries)/sizeof(vchiq_proc_log_entries[0]); - -/* create an entry under /proc/vc/log for each log category */ -static int vchiq_proc_create_log_entries(struct proc_dir_entry *top) -{ - struct proc_dir_entry *dir; - size_t i; - int ret = 0; - - dir = proc_mkdir("log", proc_info.vc_cfg_dir); - if (!dir) - return -ENOMEM; - proc_info.log_categories = dir; - - for (i = 0; i < n_log_entries; i++) { - dir = create_proc_entry(vchiq_proc_log_entries[i].name, - 0644, - proc_info.log_categories); - if (!dir) { - ret = -ENOMEM; - break; - } - - dir->read_proc = &log_cfg_read; - dir->write_proc = &log_cfg_write; - dir->data = (void *)vchiq_proc_log_entries[i].plevel; - - vchiq_proc_log_entries[i].dir = dir; - } - return ret; -} - - -int vchiq_proc_init(void) -{ - BUG_ON(proc_info.vc_cfg_dir != NULL); - - proc_info.vc_cfg_dir = proc_mkdir("vc", NULL); - if (proc_info.vc_cfg_dir == NULL) - goto fail; - - proc_info.clients = proc_mkdir("clients", - proc_info.vc_cfg_dir); - if (!proc_info.clients) - goto fail; - - if (vchiq_proc_create_log_entries(proc_info.vc_cfg_dir) != 0) - goto fail; - - return 0; - -fail: - vchiq_proc_deinit(); - vchiq_log_error(vchiq_arm_log_level, - "%s: failed to create proc directory", - __func__); - - return -ENOMEM; -} - -/* remove all the proc entries */ -void vchiq_proc_deinit(void) -{ - /* log category entries */ - if (proc_info.log_categories) { - size_t i; - for (i = 0; i < n_log_entries; i++) - if (vchiq_proc_log_entries[i].dir) - remove_proc_entry( - vchiq_proc_log_entries[i].name, - proc_info.log_categories); - - remove_proc_entry(proc_info.log_categories->name, - proc_info.vc_cfg_dir); - } - if (proc_info.clients) - remove_proc_entry(proc_info.clients->name, - proc_info.vc_cfg_dir); - if (proc_info.vc_cfg_dir) - remove_proc_entry(proc_info.vc_cfg_dir->name, NULL); -} - -struct proc_dir_entry *vchiq_clients_top(void) -{ - return proc_info.clients; -} diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c deleted file mode 100644 index 87bea8bfc0f03..0000000000000 --- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "vchiq_build_info.h" -#include - -VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_hostname, "dc4-arm-01" ); -VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_version, "9245b4c35b99b3870e1f7dc598c5692b3c66a6f0 (tainted)" ); -VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_time, __TIME__ ); -VC_DEBUG_DECLARE_STRING_VAR( vchiq_build_date, __DATE__ ); - -const char *vchiq_get_build_hostname( void ) -{ - return vchiq_build_hostname; -} - -const char *vchiq_get_build_version( void ) -{ - return vchiq_build_version; -} - -const char *vchiq_get_build_date( void ) -{ - return vchiq_build_date; -} - -const char *vchiq_get_build_time( void ) -{ - return vchiq_build_time; -}