You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(135) |
Nov
(123) |
Dec
(83) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(244) |
Feb
(72) |
Mar
(221) |
Apr
(91) |
May
(104) |
Jun
(93) |
Jul
(78) |
Aug
(1) |
Sep
(1) |
Oct
(29) |
Nov
(98) |
Dec
(20) |
| 2003 |
Jan
|
Feb
(21) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(18) |
Sep
(18) |
Oct
(23) |
Nov
(12) |
Dec
(6) |
| 2004 |
Jan
(2) |
Feb
(32) |
Mar
|
Apr
(12) |
May
(11) |
Jun
(11) |
Jul
|
Aug
(9) |
Sep
|
Oct
(15) |
Nov
|
Dec
|
| 2005 |
Jan
|
Feb
(2) |
Mar
(11) |
Apr
(6) |
May
(1) |
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
(2) |
Mar
|
Apr
(25) |
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
|
Nov
(2) |
Dec
(2) |
| 2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
(10) |
May
(1) |
Jun
(6) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
|
From: Aivils S. <ai...@us...> - 2003-10-02 09:32:26
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/fs In directory sc8-pr-cvs1:/tmp/cvs-serv30336/ruby-2.6/fs Modified Files: compat_ioctl.c Log Message: sync to 2.6.0-test6 Index: compat_ioctl.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/fs/compat_ioctl.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- compat_ioctl.c 11 Aug 2003 16:26:46 -0000 1.1 +++ compat_ioctl.c 2 Oct 2003 09:32:19 -0000 1.2 @@ -56,12 +56,10 @@ #include <linux/elevator.h> #include <linux/rtc.h> #include <linux/pci.h> -#include <linux/rtc.h> #include <linux/module.h> #include <linux/serial.h> #include <linux/reiserfs_fs.h> #include <linux/if_tun.h> -#include <linux/dirent.h> #include <linux/ctype.h> #include <linux/ioctl32.h> #include <linux/ncp_fs.h> @@ -1573,7 +1571,7 @@ return -EINVAL; tty = (struct tty_struct *)file->private_data; - if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl")) + if (tty_paranoia_check(tty, inode, "tty_ioctl")) return -EINVAL; if (tty->driver->ioctl != vt_ioctl) |
|
From: Aivils S. <ai...@us...> - 2003-10-02 09:32:25
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv30336/ruby-2.6/arch/i386/kernel
Modified Files:
setup.c
Log Message:
sync to 2.6.0-test6
Index: setup.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386/kernel/setup.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- setup.c 11 Aug 2003 16:26:46 -0000 1.1
+++ setup.c 2 Oct 2003 09:32:18 -0000 1.2
@@ -32,6 +32,7 @@
#include <linux/initrd.h>
#include <linux/bootmem.h>
#include <linux/seq_file.h>
+#include <linux/console.h>
#include <linux/root_dev.h>
#include <linux/highmem.h>
#include <linux/module.h>
@@ -42,6 +43,8 @@
#include <asm/setup.h>
#include <asm/arch_hooks.h>
#include <asm/sections.h>
+#include <asm/io_apic.h>
+#include <asm/ist.h>
#include "setup_arch_pre.h"
#include "mach_resources.h"
@@ -61,13 +64,21 @@
unsigned long mmu_cr4_features;
EXPORT_SYMBOL_GPL(mmu_cr4_features);
-#ifdef CONFIG_ACPI_HT_ONLY
-int acpi_disabled = 1;
+#ifdef CONFIG_ACPI
+ int acpi_disabled __initdata = 0;
#else
-int acpi_disabled = 0;
+ int acpi_disabled __initdata = 1;
#endif
EXPORT_SYMBOL(acpi_disabled);
+#ifdef CONFIG_ACPI_BOOT
+ int acpi_irq __initdata = 1; /* enable IRQ */
+ int acpi_ht __initdata = 1; /* enable HT */
+#endif
+
+int acpi_force __initdata = 0;
+
+
int MCA_bus;
/* for MCA, but anyone else can use it if they want */
unsigned int machine_id;
@@ -92,6 +103,7 @@
unsigned char table[0];
};
struct edid_info edid_info;
+struct ist_info ist_info;
struct e820map e820;
unsigned char aux_device_present;
@@ -515,13 +527,37 @@
}
}
- /* "acpi=off" disables both ACPI table parsing and interpreter init */
- if (c == ' ' && !memcmp(from, "acpi=off", 8))
+#ifdef CONFIG_ACPI_BOOT
+ /* "acpi=off" disables both ACPI table parsing and interpreter */
+ else if (!memcmp(from, "acpi=off", 8)) {
+ acpi_ht = 0;
acpi_disabled = 1;
+ }
- /* "acpismp=force" turns on ACPI again */
- if (c == ' ' && !memcmp(from, "acpismp=force", 13))
+ /* acpi=force to over-ride black-list */
+ else if (!memcmp(from, "acpi=force", 10)) {
+ acpi_force = 1;
+ acpi_ht=1;
acpi_disabled = 0;
+ }
+
+ /* Limit ACPI just to boot-time to enable HT */
+ else if (!memcmp(from, "acpi=ht", 7)) {
+ acpi_ht = 1;
+ if (!acpi_force) acpi_disabled = 1;
+ }
+
+ /* "pci=noacpi" disables ACPI interrupt routing */
+ else if (!memcmp(from, "pci=noacpi", 10)) {
+ acpi_irq = 0;
+ }
+
+#ifdef CONFIG_X86_LOCAL_APIC
+ /* disable IO-APIC */
+ else if (!memcmp(from, "noapic", 6))
+ disable_ioapic_setup();
+#endif /* CONFIG_X86_LOCAL_APIC */
+#endif /* CONFIG_ACPI_BOOT */
/*
* highmem=size forces highmem to be exactly 'size' bytes.
@@ -921,11 +957,12 @@
pre_setup_arch_hook();
early_cpu_init();
- ROOT_DEV = ORIG_ROOT_DEV;
+ ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO;
edid_info = EDID_INFO;
apm_info.bios = APM_BIOS_INFO;
+ ist_info = IST_INFO;
saved_videomode = VIDEO_MODE;
printk("Video mode to be used for restore is %lx\n", saved_videomode);
if( SYS_DESC_TABLE.length != 0 ) {
@@ -977,23 +1014,17 @@
generic_apic_probe(*cmdline_p);
#endif
-#ifdef CONFIG_ACPI
/*
* Parse the ACPI tables for possible boot-time SMP configuration.
*/
- if (!acpi_disabled)
- acpi_boot_init();
-#endif
+ acpi_boot_init();
+
#ifdef CONFIG_X86_LOCAL_APIC
if (smp_found_config)
get_smp_config();
#endif
-#ifdef CONFIG_X86_SUMMIT
- setup_summit();
-#endif
register_memory(max_low_pfn);
-
}
#include "setup_arch_post.h"
|
|
From: Aivils S. <ai...@us...> - 2003-10-02 09:32:25
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6
In directory sc8-pr-cvs1:/tmp/cvs-serv30336/ruby-2.6
Modified Files:
Makefile
Log Message:
sync to 2.6.0-test6
Index: Makefile
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile 11 Aug 2003 16:26:45 -0000 1.1
+++ Makefile 2 Oct 2003 09:32:18 -0000 1.2
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 0
-EXTRAVERSION = -test3-ruby
+EXTRAVERSION = -test6-ruby
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
@@ -9,6 +9,9 @@
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.
+# Do not print "Entering directory ..."
+MAKEFLAGS += --no-print-directory
+
# We are using a recursive build, so we need to do a little thinking
# to get the ordering right.
#
@@ -25,6 +28,87 @@
# descending is started. They are now explicitly listed as the
# prepare rule.
+# To put more focus on warnings, be less verbose as default
+# Use 'make V=1' to see the full commands
+
+ifdef V
+ ifeq ("$(origin V)", "command line")
+ KBUILD_VERBOSE = $(V)
+ endif
+endif
+ifndef KBUILD_VERBOSE
+ KBUILD_VERBOSE = 0
+endif
+
+# Call sparse as part of compilation of C files
+# Use 'make C=1' to enable sparse checking
+
+ifdef C
+ ifeq ("$(origin C)", "command line")
+ KBUILD_CHECKSRC = $(C)
+ endif
+endif
+ifndef KBUILD_CHECKSRC
+ KBUILD_CHECKSRC = 0
+endif
+
+# kbuild supports saving output files in a separate directory.
+# To locate output files in a separate directory two syntax'es are supported.
+# In both cases the working directory must be the root of the kernel src.
+# 1) O=
+# Use "make O=dir/to/store/output/files/"
+#
+# 2) Set KBUILD_OUTPUT
+# Set the environment variable KBUILD_OUTPUT to point to the directory
+# where the output files shall be placed.
+# export KBUILD_OUTPUT=dir/to/store/output/files/
+# make
+#
+# The O= assigment takes precedence over the KBUILD_OUTPUT environment variable.
+
+
+# KBUILD_SRC is set on invocation of make in OBJ directory
+# KBUILD_SRC is not intended to be used by the regular user (for now)
+ifeq ($(KBUILD_SRC),)
+
+# OK, Make called in directory where kernel src resides
+# Do we want to locate output files in a separate directory?
+ifdef O
+ ifeq ("$(origin O)", "command line")
+ KBUILD_OUTPUT := $(O)
+ endif
+endif
+
+ifneq ($(KBUILD_OUTPUT),)
+# Invoke a second make in the output directory, passing relevant variables
+ KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT); /bin/pwd)
+
+.PHONY: $(MAKECMDGOALS) all
+
+$(MAKECMDGOALS) all:
+ $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
+ KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE) \
+ KBUILD_CHECK=$(KBUILD_CHECK) -f $(CURDIR)/Makefile $(MAKECMDGOALS)
+
+# Leave processing to above invocation of make
+skip-makefile := 1
+endif # ifneq ($(KBUILD_OUTPUT),)
+endif # ifeq ($(KBUILD_SRC),)
+
+# We process the rest of the Makefile if this is the final invocation of make
+ifeq ($(skip-makefile),)
+
+srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
+TOPDIR := $(srctree)
+# FIXME - TOPDIR is obsolete, use srctree/objtree
+objtree := $(CURDIR)
+src := $(srctree)
+obj := $(objtree)
+
+VPATH := $(srctree)
+
+export srctree objtree VPATH TOPDIR
+
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
# SUBARCH tells the usermode build what the underlying arch is. That is set
@@ -37,9 +121,6 @@
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ )
-# Remove hyphens since they have special meaning in RPM filenames
-KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE))
-
# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
#
@@ -69,7 +150,6 @@
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
-TOPDIR := $(CURDIR)
HOSTCC = gcc
HOSTCXX = g++
@@ -110,40 +190,8 @@
KBUILD_MODULES := 1
endif
-export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE KBUILD_CHECKSRC
-
-# To put more focus on warnings, less verbose as default
-# Use 'make V=1' to see the full commands
-
-ifdef V
- ifeq ("$(origin V)", "command line")
- KBUILD_VERBOSE = $(V)
- endif
-endif
-ifndef KBUILD_VERBOSE
- KBUILD_VERBOSE = 0
-endif
-
-# Call sparse as part of compilation of C files
-# Use 'make C=1' to enable sparse checking
-
-ifdef C
- ifeq ("$(origin C)", "command line")
- KBUILD_CHECKSRC = $(C)
- endif
-endif
-ifndef KBUILD_CHECKSRC
- KBUILD_CHECKSRC = 0
-endif
-
-# Do not print 'Entering directory ...'
-
-MAKEFLAGS += --no-print-directory
-
-# For maximum performance (+ possibly random breakage, uncomment
-# the following)
-
-#MAKEFLAGS += -rR
+export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE
+export KBUILD_CHECKSRC KBUILD_SRC
# Beautify output
# ---------------------------------------------------------------------------
@@ -183,16 +231,17 @@
quiet=silent_
endif
-export quiet Q KBUILD_VERBOSE
+check_gcc = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
-# Paths to obj / src tree
+export quiet Q KBUILD_VERBOSE check_gcc
-src := .
-obj := .
-srctree := .
-objtree := .
+# Look for make include files relative to root of kernel src
+MAKEFLAGS += --include-dir=$(srctree)
-export srctree objtree
+# For maximum performance (+ possibly random breakage, uncomment
+# the following)
+
+#MAKEFLAGS += -rR
# Make variables (CC, etc...)
@@ -222,13 +271,15 @@
NOSTDINC_FLAGS = -nostdinc -iwithprefix include
-CPPFLAGS := -D__KERNEL__ -Iinclude
+CPPFLAGS := -D__KERNEL__ -Iinclude \
+ $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
+
CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
- CONFIG_SHELL TOPDIR HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
+ CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK
@@ -243,27 +294,79 @@
comma := ,
depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
-noconfig_targets := xconfig gconfig menuconfig config oldconfig randconfig \
- defconfig allyesconfig allnoconfig allmodconfig \
- clean mrproper distclean rpm \
- help tags TAGS cscope %docs \
- checkconfig checkhelp checkincludes
+# Files to ignore in find ... statements
RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \) -prune -o
RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS
+# ===========================================================================
+# Rules shared between *config targets and build targets
+
# Helpers built in scripts/
-# ---------------------------------------------------------------------------
-scripts/docproc scripts/fixdep scripts/split-include : scripts ;
+scripts/docproc scripts/split-include : scripts ;
-.PHONY: scripts
+.PHONY: scripts scripts/fixdep
scripts:
$(Q)$(MAKE) $(build)=scripts
-# Objects we will link into vmlinux / subdirs we need to visit
-# ---------------------------------------------------------------------------
+scripts/fixdep:
+ $(Q)$(MAKE) $(build)=scripts $@
+
+
+# To make sure we do not include .config for any of the *config targets
+# catch them early, and hand them over to scripts/kconfig/Makefile
+# It is allowed to specify more targets when calling make, including
+# mixing *config targets and build targets.
+# For example 'make oldconfig all'.
+# Detect when mixed targets is specified, and make a second invocation
+# of make so .config is not included in this case either (for *config).
+
+no-dot-config-targets := clean mrproper distclean \
+ cscope TAGS tags help %docs check%
+
+config-targets := 0
+mixed-targets := 0
+dot-config := 1
+
+ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
+ ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
+ dot-config := 0
+ endif
+endif
+
+ifneq ($(filter config %config,$(MAKECMDGOALS)),)
+ config-targets := 1
+ ifneq ($(filter-out config %config,$(MAKECMDGOALS)),)
+ mixed-targets := 1
+ endif
+endif
+
+ifeq ($(mixed-targets),1)
+# ===========================================================================
+# We're called with mixed targets (*config and build targets).
+# Handle them one by one.
+%:: FORCE
+ $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@
+
+else
+ifeq ($(config-targets),1)
+# ===========================================================================
+# *config targets only - make sure prerequisites are updated, and descend
+# in scripts/kconfig to make the *config target
+
+%config: scripts/fixdep FORCE
+ $(Q)$(MAKE) $(build)=scripts/kconfig $@
+config : scripts/fixdep FORCE
+ $(Q)$(MAKE) $(build)=scripts/kconfig $@
+
+else
+# ===========================================================================
+# Build targets only - this includes vmlinux, arch specific targets, clean
+# targets and others. In general all targets except *config targets.
+
+# Objects we will link into vmlinux / subdirs we need to visit
init-y := init/
drivers-y := drivers/ sound/
net-y := net/
@@ -271,19 +374,32 @@
core-y := usr/
SUBDIRS :=
-ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
+ifeq ($(dot-config),1)
+# In this section, we need .config
-export include_config := 1
+# Read in dependencies to all Kconfig* files, make sure to run
+# oldconfig if changes are detected.
+-include .config.cmd
--include .config
+include .config
+
+# If .config needs to be updated, it will be done via the dependency
+# that autoconf has on .config.
+# To avoid any implicit rule to kick in, define an empty command
+.config: ;
+
+# If .config is newer than include/linux/autoconf.h, someone tinkered
+# with it and forgot to run make oldconfig
+include/linux/autoconf.h: .config
+ $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
endif
-include arch/$(ARCH)/Makefile
+include $(srctree)/arch/$(ARCH)/Makefile
# Let architecture Makefiles change CPPFLAGS if needed
-CFLAGS += $(CPPFLAGS) $(CFLAGS)
-AFLAGS += $(CPPFLAGS) $(AFLAGS)
+CFLAGS := $(CPPFLAGS) $(CFLAGS)
+AFLAGS := $(CPPFLAGS) $(AFLAGS)
core-y += kernel/ mm/ fs/ ipc/ security/ crypto/
@@ -304,19 +420,9 @@
libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))
libs-y := $(libs-y1) $(libs-y2)
-ifdef include_config
-
# Here goes the main Makefile
-# ===========================================================================
-#
-# If the user gave a *config target, it'll be handled in another
-# section below, since in this case we cannot include .config
-# Same goes for other targets like clean/mrproper etc, which
-# don't need .config, either
-
-# In this section, we need .config
+# ---------------------------------------------------------------------------
--include .config.cmd
ifndef CONFIG_FRAME_POINTER
CFLAGS += -fomit-frame-pointer
@@ -326,6 +432,9 @@
CFLAGS += -g
endif
+# warn about C99 declaration after statement
+CFLAGS += $(call check_gcc,-Wdeclaration-after-statement,)
+
#
# INSTALL_PATH specifies where to place the updated kernel and system map
# images. Uncomment if you want to place them anywhere other than root.
@@ -388,7 +497,7 @@
$(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
endef
-LDFLAGS_vmlinux += -T arch/$(ARCH)/vmlinux.lds.s
+LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s
# Generate section listing all symbols and add it into vmlinux
# It's a three stage process:
@@ -414,35 +523,55 @@
.tmp_kallsyms%.S: .tmp_vmlinux%
$(call cmd,kallsyms)
-.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/vmlinux.lds.s FORCE
+.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
+$(call if_changed_rule,vmlinux__)
-.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/vmlinux.lds.s FORCE
+.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
$(call if_changed_rule,vmlinux__)
endif
# Finally the vmlinux rule
-vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/vmlinux.lds.s FORCE
+vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
$(call if_changed_rule,vmlinux)
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
-$(sort $(vmlinux-objs)): $(SUBDIRS) ;
+$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(SUBDIRS) ;
# Handle descending into subdirectories listed in $(SUBDIRS)
.PHONY: $(SUBDIRS)
-$(SUBDIRS): prepare
+$(SUBDIRS): prepare-all
$(Q)$(MAKE) $(build)=$@
-# Things we need done before we descend to build or make
-# module versions are listed in "prepare"
+# Things we need to do before we recursively start building the kernel
+# or the modules are listed in "prepare-all".
+# A multi level approach is used. prepare1 is updated first, then prepare0.
+# prepare-all is the collection point for the prepare targets.
-.PHONY: prepare
-prepare: include/linux/version.h include/asm include/config/MARKER
+.PHONY: prepare-all prepare prepare0 prepare1
+
+# prepare1 is used to check if we are building in a separate output directory,
+# and if so do:
+# 1) Check that make has not been executed in the kernel src $(srctree)
+# 2) Create the include2 directory, used for the second asm symlink
+
+prepare1:
+ifneq ($(KBUILD_SRC),)
+ @echo ' Using $(srctree) as source for kernel'
+ $(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \
+ echo " $(srctree) is not clean, please run 'make mrproper'";\
+ echo " in the '$(srctree)' directory.";\
+ /bin/false; \
+ fi;
+ $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi;
+ $(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm
+endif
+
+prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER
ifdef KBUILD_MODULES
ifeq ($(origin SUBDIRS),file)
$(Q)rm -rf $(MODVERDIR)
@@ -453,15 +582,13 @@
endif
$(if $(CONFIG_MODULES),$(Q)mkdir -p $(MODVERDIR))
-# This can be used by arch/$ARCH/Makefile to preprocess
-# their vmlinux.lds.S file
-
-AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH)
+# All the preparing..
+prepare-all: prepare0 prepare
-arch/$(ARCH)/vmlinux.lds.s: %.s: %.S scripts FORCE
- $(call if_changed_dep,as_s_S)
+# Leave this as default for preprocessing vmlinux.lds.S, which is now
+# done in arch/$(ARCH)/kernel/Makefile
-targets += arch/$(ARCH)/vmlinux.lds.s
+export AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH)
# Single targets
# ---------------------------------------------------------------------------
@@ -486,8 +613,9 @@
# before switching between archs anyway.
include/asm:
- @echo ' Making asm->asm-$(ARCH) symlink'
- @ln -s asm-$(ARCH) $@
+ @echo ' SYMLINK $@ -> include/asm-$(ARCH)'
+ $(Q)if [ ! -d include ]; then mkdir -p include; fi;
+ @ln -fsn asm-$(ARCH) $@
# Split autoconf.h into include/linux/config/*
@@ -496,13 +624,6 @@
@scripts/split-include include/linux/autoconf.h include/config
@touch $@
-# if .config is newer than include/linux/autoconf.h, someone tinkered
-# with it and forgot to run make oldconfig
-
-include/linux/autoconf.h: .config scripts/fixdep
- $(Q)$(MAKE) $(build)=scripts/kconfig scripts/kconfig/conf
- ./scripts/kconfig/conf -s arch/$(ARCH)/Kconfig
-
# Generate some files
# ---------------------------------------------------------------------------
@@ -545,7 +666,7 @@
.PHONY: modules
modules: $(SUBDIRS) $(if $(KBUILD_BUILTIN),vmlinux)
@echo ' Building modules, stage 2.';
- $(Q)$(MAKE) -rR -f scripts/Makefile.modpost
+ $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
# Install modules
@@ -554,11 +675,16 @@
.PHONY: _modinst_
_modinst_:
+ @if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \
+ echo "Warning: you may need to install module-init-tools"; \
+ echo "See http://www.codemonkey.org.uk/post-halloween-2.5.txt";\
+ sleep 1; \
+ fi
@rm -rf $(MODLIB)/kernel
@rm -f $(MODLIB)/build
@mkdir -p $(MODLIB)/kernel
@ln -s $(TOPDIR) $(MODLIB)/build
- $(Q)$(MAKE) -rR -f scripts/Makefile.modinst
+ $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
# If System.map exists, run depmod. This deliberately does not have a
# dependency on System.map since that would run the dependency tree on
@@ -608,72 +734,6 @@
echo "#endif" )
endef
-else # ifdef include_config
-
-ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
-
-# Targets which don't need .config
-# ===========================================================================
-#
-# These targets basically have their own Makefile - not quite, but at
-# least its own exclusive section in the same Makefile. The reason for
-# this is the following:
-# To know the configuration, the main Makefile has to include
-# .config. That's a obviously a problem when .config doesn't exist
-# yet, but that could be kludged around with only including it if it
-# exists.
-# However, the larger problem is: If you run make *config, make will
-# include the old .config, then execute your *config. It will then
-# notice that a piece it included (.config) did change and restart from
-# scratch. Which will cause execution of *config again. You get the
-# picture.
-# If we don't explicitly let the Makefile know that .config is changed
-# by *config (the old way), it won't reread .config after *config,
-# thus working with possibly stale values - we don't that either.
-#
-# So we divide things: This part here is for making *config targets,
-# and other targets which should work when no .config exists yet.
-# The main part above takes care of the rest after a .config exists.
-
-# Kernel configuration
-# ---------------------------------------------------------------------------
-
-.PHONY: oldconfig xconfig gconfig menuconfig config \
- make_with_config rpm
-
-scripts/kconfig/conf scripts/kconfig/mconf scripts/kconfig/qconf scripts/kconfig/gconf: scripts/fixdep FORCE
- $(Q)$(MAKE) $(build)=scripts/kconfig $@
-
-xconfig: scripts/kconfig/qconf
- ./scripts/kconfig/qconf arch/$(ARCH)/Kconfig
-
-gconfig: scripts/kconfig/gconf
- ./scripts/kconfig/gconf arch/$(ARCH)/Kconfig
-
-menuconfig: scripts/kconfig/mconf
- $(Q)$(MAKE) $(build)=scripts/lxdialog
- ./scripts/kconfig/mconf arch/$(ARCH)/Kconfig
-
-config: scripts/kconfig/conf
- ./scripts/kconfig/conf arch/$(ARCH)/Kconfig
-
-oldconfig: scripts/kconfig/conf
- ./scripts/kconfig/conf -o arch/$(ARCH)/Kconfig
-
-randconfig: scripts/kconfig/conf
- ./scripts/kconfig/conf -r arch/$(ARCH)/Kconfig
-
-allyesconfig: scripts/kconfig/conf
- ./scripts/kconfig/conf -y arch/$(ARCH)/Kconfig
-
-allnoconfig: scripts/kconfig/conf
- ./scripts/kconfig/conf -n arch/$(ARCH)/Kconfig
-
-allmodconfig: scripts/kconfig/conf
- ./scripts/kconfig/conf -m arch/$(ARCH)/Kconfig
-
-defconfig: scripts/kconfig/conf
- ./scripts/kconfig/conf -d arch/$(ARCH)/Kconfig
###
# Cleaning is done on three levels.
@@ -693,7 +753,7 @@
.menuconfig.log \
include/asm \
.hdepend include/linux/modversions.h \
- tags TAGS cscope kernel.spec \
+ tags TAGS cscope.out kernel.spec \
.tmp*
# Directories removed with 'make mrproper'
@@ -701,7 +761,8 @@
$(MODVERDIR) \
.tmp_export-objs \
include/config \
- include/linux/modules
+ include/linux/modules \
+ include2
# clean - Delete all intermediate files
#
@@ -778,31 +839,34 @@
# RPM target
# ---------------------------------------------------------------------------
+.PHONY: rpm
+
+# Remove hyphens since they have special meaning in RPM filenames
+KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE))
+
# If you do a make spec before packing the tarball you can rpm -ta it
spec:
- . $(srctree)/scripts/mkspec >kernel.spec
+ $(CONFIG_SHELL) $(srctree)/scripts/mkspec > $(objtree)/kernel.spec
-# Build a tar ball, generate an rpm from it and pack the result
-# There are two bits of magic here
-# 1) The use of /. to avoid tar packing just the symlink
-# 2) Removing the .dep files as they have source paths in them that
-# will become invalid
+# a) Build a tar ball
+# b) generate an rpm from it
+# c) and pack the result
+# - Use /. to avoid tar packing just the symlink
rpm: clean spec
- find . $(RCS_FIND_IGNORE) \
- \( -size 0 -o -name .depend -o -name .hdepend \) \
- -type f -print | xargs rm -f
set -e; \
- cd $(TOPDIR)/.. ; \
- ln -sf $(TOPDIR) $(KERNELPATH) ; \
+ cd .. ; \
+ ln -sf $(srctree) $(KERNELPATH) ; \
tar -cvz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
- rm $(KERNELPATH) ; \
- cd $(TOPDIR) ; \
- $(CONFIG_SHELL) $(srctree)/scripts/mkversion > .tmp_version ; \
- mv -f .tmp_version .version; \
- $(RPM) -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
- rm $(TOPDIR)/../$(KERNELPATH).tar.gz
+ rm $(KERNELPATH)
+
+ set -e; \
+ $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version;\
+ mv -f $(objtree)/.tmp_version $(objtree)/.version;
+
+ $(RPM) -ta ../$(KERNELPATH).tar.gz
+ rm ../$(KERNELPATH).tar.gz
# Brief documentation of the typical targets used
# ---------------------------------------------------------------------------
@@ -813,14 +877,7 @@
@echo ' mrproper - remove all generated files + config + various backup files'
@echo ''
@echo 'Configuration targets:'
- @echo ' oldconfig - Update current config utilising a line-oriented program'
- @echo ' menuconfig - Update current config utilising a menu based program'
- @echo ' xconfig - Update current config utilising a QT based front-end'
- @echo ' gconfig - Update current config utilising a GTK based front-end'
- @echo ' defconfig - New config with default answer to all options'
- @echo ' allmodconfig - New config selecting modules when possible'
- @echo ' allyesconfig - New config where all options are accepted with yes'
- @echo ' allnoconfig - New minimal config'
+ @$(MAKE) -f scripts/kconfig/Makefile help
@echo ''
@echo 'Other generic targets:'
@echo ' all - Build all targets marked with [*]'
@@ -833,13 +890,14 @@
@echo ' tags/TAGS - Generate tags file for editors'
@echo ''
@echo 'Documentation targets:'
- @$(MAKE) --no-print-directory -f Documentation/DocBook/Makefile dochelp
+ @$(MAKE) -f Documentation/DocBook/Makefile dochelp
@echo ''
@echo 'Architecture specific targets ($(ARCH)):'
@$(if $(archhelp),$(archhelp),\
echo ' No architecture specific help defined for $(ARCH)')
@echo ''
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
+ @echo ' make O=dir [targets] Locate all output files in "dir", including .config'
@echo ' make C=1 [targets] Check all c source with checker tool'
@echo ''
@echo 'Execute "make" or "make all" to build all targets marked with [*] '
@@ -854,37 +912,31 @@
# Scripts to check various things for consistency
# ---------------------------------------------------------------------------
-checkconfig:
+configcheck:
find * $(RCS_FIND_IGNORE) \
-name '*.[hcS]' -type f -print | sort \
| xargs $(PERL) -w scripts/checkconfig.pl
-checkincludes:
+includecheck:
find * $(RCS_FIND_IGNORE) \
-name '*.[hcS]' -type f -print | sort \
| xargs $(PERL) -w scripts/checkincludes.pl
-else # ifneq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
-
-# We're called with both targets which do and do not need
-# .config included. Handle them one after the other.
-# ===========================================================================
-
-%:: FORCE
- $(Q)$(MAKE) $@
+versioncheck:
+ find * $(RCS_FIND_IGNORE) \
+ -name '*.[hcS]' -type f -print | sort \
+ | xargs $(PERL) -w scripts/checkversion.pl
-endif # ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
-endif # ifdef include_config
+endif #ifeq ($(config-targets),1)
+endif #ifeq ($(mixed-targets),1)
# FIXME Should go into a make.lib or something
# ===========================================================================
-a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) $(NOSTDINC_FLAGS) \
+a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \
+ $(NOSTDINC_FLAGS) $(CPPFLAGS) \
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
-quiet_cmd_as_s_S = CPP $@
-cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
-
quiet_cmd_as_o_S = AS $@
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
@@ -894,6 +946,7 @@
cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
ifneq ($(cmd_files),)
+ $(cmd_files): ; # Do not try to update included dependency files
include $(cmd_files)
endif
@@ -939,6 +992,7 @@
define filechk
@set -e; \
echo ' CHK $@'; \
+ mkdir -p $(dir $@); \
$(filechk_$(1)) < $< > $@.tmp; \
if [ -r $@ ] && cmp -s $@ $@.tmp; then \
rm -f $@.tmp; \
@@ -951,16 +1005,18 @@
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=dir
# Usage:
# $(Q)$(MAKE) $(build)=dir
-build := -f scripts/Makefile.build obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
# Usage:
# $(Q)$(MAKE) $(clean)=dir
-clean := -f scripts/Makefile.clean obj
+clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
# $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target>
# Usage is deprecated, because make does not see this as an invocation of make.
-descend =$(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2)
+descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj=$(1) $(2)
+
+endif # skip-makefile
FORCE:
|
|
From: Aivils S. <ai...@us...> - 2003-10-02 09:32:25
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux
In directory sc8-pr-cvs1:/tmp/cvs-serv30336/ruby-2.6/include/linux
Modified Files:
input.h tty.h
Log Message:
sync to 2.6.0-test6
Index: input.h
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux/input.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- input.h 16 Sep 2003 06:54:42 -0000 1.1
+++ input.h 2 Oct 2003 09:32:19 -0000 1.2
@@ -56,8 +56,6 @@
#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
-#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
-#define EVIOCSREP _IOW('E', 0x03, int[2]) /* get repeat settings */
#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */
#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
@@ -404,6 +402,8 @@
#define BTN_TOUCH 0x14a
#define BTN_STYLUS 0x14b
#define BTN_STYLUS2 0x14c
+#define BTN_TOOL_DOUBLETAP 0x14d
+#define BTN_TOOL_TRIPLETAP 0x14e
#define BTN_WHEEL 0x150
#define BTN_GEAR_DOWN 0x150
@@ -521,6 +521,7 @@
#define ABS_DISTANCE 0x19
#define ABS_TILT_X 0x1a
#define ABS_TILT_Y 0x1b
+#define ABS_TOOL_WIDTH 0x1c
#define ABS_VOLUME 0x20
#define ABS_MISC 0x28
#define ABS_MAX 0x3f
@@ -751,7 +752,7 @@
#define LONG(x) ((x)/BITS_PER_LONG)
#define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
- ((dev->keycodesize == 1) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
+ ((dev->keycodesize == 2) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
#define init_input_dev(dev) do { INIT_LIST_HEAD(&((dev)->h_list)); INIT_LIST_HEAD(&((dev)->node)); } while (0)
Index: tty.h
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux/tty.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- tty.h 11 Aug 2003 16:26:46 -0000 1.1
+++ tty.h 2 Oct 2003 09:32:19 -0000 1.2
@@ -254,7 +254,6 @@
char name[64];
int pgrp;
int session;
- dev_t device;
unsigned long flags;
int count;
struct winsize winsize;
@@ -333,29 +332,11 @@
extern struct termios tty_std_termios;
extern struct tty_ldisc ldiscs[];
-
extern void console_init(void);
-
-extern int lp_init(void);
-extern int pty_init(void);
-extern void tty_init(void);
-extern int mxser_init(void);
-extern int moxa_init(void);
-extern int ip2_init(void);
-extern int pcxe_init(void);
-extern int pc_init(void);
extern int vcs_init(void);
-extern int rp_init(void);
-extern int cy_init(void);
-extern int stl_init(void);
-extern int stli_init(void);
-extern int specialix_init(void);
-extern int espserial_init(void);
-extern int macserial_init(void);
-extern int a2232board_init(void);
extern int vty_init(void);
-extern int tty_paranoia_check(struct tty_struct *tty, kdev_t device,
+extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode,
const char *routine);
extern char *tty_name(struct tty_struct *tty, char *buf);
extern void tty_wait_until_sent(struct tty_struct * tty, long timeout);
@@ -407,6 +388,11 @@
extern int vt_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg);
+
+static inline dev_t tty_devnum(struct tty_struct *tty)
+{
+ return MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index;
+}
#endif /* __KERNEL__ */
#endif
|
|
From: Aivils S. <ai...@us...> - 2003-10-02 09:32:25
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/kernel/power
In directory sc8-pr-cvs1:/tmp/cvs-serv30336/ruby-2.6/kernel/power
Modified Files:
power.h
Log Message:
sync to 2.6.0-test6
Index: power.h
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/kernel/power/power.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- power.h 12 Sep 2003 08:33:21 -0000 1.1
+++ power.h 2 Oct 2003 09:32:19 -0000 1.2
@@ -5,5 +5,35 @@
so bad things might happen.
*/
#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
-//#define SUSPEND_CONSOLE (MAX_NR_USER_CONSOLES-1)
+//#define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
+#endif
+
+
+#ifdef CONFIG_PM_DISK
+extern int pm_suspend_disk(void);
+
+#else
+static inline int pm_suspend_disk(void)
+{
+ return -EPERM;
+}
#endif
+
+extern struct semaphore pm_sem;
+#define power_attr(_name) \
+static struct subsys_attribute _name##_attr = { \
+ .attr = { \
+ .name = __stringify(_name), \
+ .mode = 0644, \
+ }, \
+ .show = _name##_show, \
+ .store = _name##_store, \
+}
+
+extern struct subsystem power_subsys;
+
+extern int freeze_processes(void);
+extern void thaw_processes(void);
+
+extern int pm_prepare_console(void);
+extern void pm_restore_console(void);
|
|
From: Aivils S. <ai...@us...> - 2003-10-02 09:32:25
|
Update of /cvsroot/linuxconsole/ruby In directory sc8-pr-cvs1:/tmp/cvs-serv30336 Added Files: AGAINST-2.6.0-test6 Removed Files: AGAINST-2.6.0-test3 Log Message: sync to 2.6.0-test6 --- NEW FILE: AGAINST-2.6.0-test6 --- --- AGAINST-2.6.0-test3 DELETED --- |
|
From: Aivils S. <ai...@us...> - 2003-09-29 09:12:18
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console
In directory sc8-pr-cvs1:/tmp/cvs-serv15552/ruby-2.6/drivers/video/console
Modified Files:
dummycon.c vgacon.c
Log Message:
reanime /dev/vc/0, keyboard leds
Index: dummycon.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/dummycon.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- dummycon.c 16 Sep 2003 06:54:42 -0000 1.3
+++ dummycon.c 29 Sep 2003 08:50:56 -0000 1.4
@@ -95,7 +95,7 @@
printk("Console: mono %s %dx%d vc:%d-%d\n", display_desc,
dummy_vt.default_mode->vc_cols,
dummy_vt.default_mode->vc_rows,
- dummy_vt.first_vc, dummy_vt.first_vc + dummy_vt.vc_count - 1);
+ dummy_vt.first_vc + 1, dummy_vt.first_vc + dummy_vt.vc_count);
return 0;
}
@@ -119,7 +119,7 @@
printk("Console: mono %s %dx%d vc:%d-%d\n", display_desc,
vt->default_mode->vc_cols,
vt->default_mode->vc_rows,
- vt->first_vc, vt->first_vc + vt->vc_count - 1);
+ vt->first_vc + 1, vt->first_vc + vt->vc_count);
return 0;
}
Index: vgacon.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/vgacon.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- vgacon.c 12 Sep 2003 08:33:21 -0000 1.2
+++ vgacon.c 29 Sep 2003 08:50:56 -0000 1.3
@@ -1099,7 +1099,7 @@
vga_vt.default_mode->vc_can_do_color ? "Colour" : "Mono",
display_desc, vga_vt.default_mode->vc_cols,
vga_vt.default_mode->vc_rows,
- vga_vt.first_vc, vga_vt.first_vc + vga_vt.vc_count - 1);
+ vga_vt.first_vc + 1, vga_vt.first_vc + vga_vt.vc_count);
return 0;
}
|
|
From: Aivils S. <ai...@us...> - 2003-09-29 09:11:59
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char
In directory sc8-pr-cvs1:/tmp/cvs-serv15552/ruby-2.6/drivers/char
Modified Files:
keyboard.c tty_io.c vt.c vt_ioctl.c
Log Message:
reanime /dev/vc/0, keyboard leds
Index: keyboard.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/keyboard.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- keyboard.c 16 Sep 2003 06:54:42 -0000 1.3
+++ keyboard.c 29 Sep 2003 08:50:56 -0000 1.4
@@ -784,13 +784,13 @@
*/
unsigned char getledstate(struct vc_data *vc)
{
- return vc->vc_ledstate;
+ return vc->display_fg->vt_ledstate;
}
void setledstate(struct vc_data *vc, unsigned int led)
{
if (!(led & ~7)) {
- vc->vc_ledioctl = led;
+ vc->display_fg->vt_ledioctl = led;
vc->kbd_table.ledmode = LED_SHOW_IOCTL;
} else
vc->kbd_table.ledmode = LED_SHOW_FLAGS;
@@ -815,7 +815,7 @@
int i;
if (vc->kbd_table.ledmode == LED_SHOW_IOCTL)
- return vc->vc_ledioctl;
+ return vc->display_fg->vt_ledioctl;
leds = vc->kbd_table.ledflagstate;
@@ -857,12 +857,12 @@
if (vt) {
leds = getleds(vt->fg_console);
- if (leds != vt->fg_console->vc_ledstate) {
+ if (leds != vt->vt_ledstate) {
input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02));
input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04));
input_sync(handle->dev);
- vt->fg_console->vc_ledstate = leds;
+ vt->vt_ledstate = leds;
}
}
}
@@ -882,12 +882,12 @@
tasklet_disable(&keyboard_tasklet);
leds = getleds(vt->fg_console);
- if (leds != vt->fg_console->vc_ledstate) {
+ if (leds != vt->vt_ledstate) {
input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02));
input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04));
input_sync(handle->dev);
- vt->fg_console->vc_ledstate = leds;
+ vt->vt_ledstate = leds;
}
tasklet_enable(&keyboard_tasklet);
}
@@ -1155,9 +1155,8 @@
vt->keyboard = handle;
handle->private = vt;
printk(KERN_INFO "keyboard.c: %s vc:%d-%d\n",
- dev->name,
- vt->first_vc,
- vt->first_vc + vt->vc_count - 1);
+ dev->name, vt->first_vc + 1,
+ vt->first_vc + vt->vc_count);
if(test_bit(EV_SND, dev->evbit)) {
vt->beeper = handle;
vt_map_input(vt);
Index: tty_io.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/tty_io.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- tty_io.c 11 Aug 2003 16:26:46 -0000 1.1
+++ tty_io.c 29 Sep 2003 08:50:56 -0000 1.2
@@ -100,6 +100,7 @@
#include <linux/kmod.h>
+#define IS_CONSOLE_DEV(dev) (kdev_val(dev) == __mkdev(TTY_MAJOR,0))
#define IS_TTY_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,0))
#define IS_SYSCONS_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,1))
#define IS_PTMX_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,2))
@@ -1316,7 +1317,21 @@
/* noctty = 1; */
goto got_driver;
}
-
+#ifdef CONFIG_VT
+ if (IS_CONSOLE_DEV(device)) {
+ struct vc_data *vc;
+ extern struct tty_driver *console_driver;
+ if (!current->tty)
+ return -ENXIO;
+ driver = console_driver;
+ vc = (struct vc_data *)current->tty->driver_data;
+ if (!vc)
+ return -ENXIO;
+ index = vc->display_fg->fg_console->vc_num;
+ noctty = 1;
+ goto got_driver;
+ }
+#endif
if (IS_SYSCONS_DEV(device)) {
struct console *c = console_drivers;
for (c = console_drivers; c; c = c->next) {
@@ -2412,6 +2427,9 @@
#ifdef CONFIG_UNIX98_PTYS
static struct cdev ptmx_cdev;
#endif
+#ifdef CONFIG_VT
+static struct cdev vc0_cdev;
+#endif
/*
* Ok, now we can initialize the rest of the tty devices and can count
@@ -2449,6 +2467,14 @@
#endif
#ifdef CONFIG_VT
+ strcpy(vc0_cdev.kobj.name, "dev.vc0");
+ cdev_init(&vc0_cdev, &tty_fops);
+ if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
+ register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
+ panic("Couldn't register /dev/tty0 driver\n");
+ devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0");
+ tty_add_class_device ("tty0", MKDEV(TTY_MAJOR, 0), NULL);
+
vty_init();
#endif
#ifdef CONFIG_ESPSERIAL /* init ESP before rs, so rs doesn't see the port */
Index: vt.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- vt.c 16 Sep 2003 06:54:42 -0000 1.3
+++ vt.c 29 Sep 2003 08:50:56 -0000 1.4
@@ -979,7 +979,7 @@
/* although the numbers above are not valid since long ago, the
point is still up-to-date and the comment still has its value
even if only as a historical artifact. --mj, July 1998 */
- if (vt->vt_kmalloced || !((vt->first_vc + 1)== currcons))
+ if (vt->vt_kmalloced || !((vt->first_vc)== currcons))
vc = (struct vc_data *) kmalloc(sizeof(struct vc_data), GFP_KERNEL);
else
vc = (struct vc_data *) alloc_bootmem(sizeof(struct vc_data));
@@ -992,7 +992,7 @@
cons_num = currcons;
vc->display_fg = vt;
visual_init(vc, 1);
- if (vt->vt_kmalloced || !((vt->first_vc + 1) == currcons)) {
+ if (vt->vt_kmalloced || !((vt->first_vc) == currcons)) {
screenbuf = (unsigned short *) kmalloc(screenbuf_size, GFP_KERNEL);
if (!screenbuf) {
kfree(vc);
@@ -1016,7 +1016,7 @@
}
}
vt->vc_cons[currcons - vt->first_vc] = vc;
- if ((vt->first_vc + 1) == currcons)
+ if ((vt->first_vc) == currcons)
vt->want_vc = vt->fg_console = vt->last_console = vc;
vc_init(vc, 1);
return vc;
@@ -1732,7 +1732,7 @@
{
const char *display_desc;
- if (current_vc + vc_count > MAX_NR_CONSOLES + 1)
+ if (current_vc + vc_count - 1 > MAX_NR_CONSOLES)
return NULL;
display_desc = vt->vt_sw->con_startup(vt, init);
@@ -1757,7 +1757,7 @@
mod_timer(&vt->timer, jiffies + vt->blank_interval);
if (vt->pm_con)
vt->pm_con->data = vt;
- vt->vc_cons[1] = vc_allocate(current_vc+1);
+ vt->vc_cons[0] = vc_allocate(current_vc);
vt->keyboard = NULL;
INIT_WORK(&vt->vt_work, vt_callback, vt);
@@ -1830,9 +1830,9 @@
console_driver->owner = THIS_MODULE;
console_driver->devfs_name = "vc/";
console_driver->name = "tty";
- console_driver->name_base = 0;
+ console_driver->name_base = 1;
console_driver->major = TTY_MAJOR;
- console_driver->minor_start = 0;
+ console_driver->minor_start = 1;
console_driver->type = TTY_DRIVER_TYPE_CONSOLE;
console_driver->init_termios = tty_std_termios;
console_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
Index: vt_ioctl.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt_ioctl.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- vt_ioctl.c 12 Sep 2003 08:33:21 -0000 1.2
+++ vt_ioctl.c 29 Sep 2003 08:50:56 -0000 1.3
@@ -1010,9 +1010,9 @@
unsigned short mask, state = 0;
struct vc_data *tmp;
- if (put_user(vc->display_fg->fg_console->vc_num, &vtstat->v_active))
+ if (put_user(vc->display_fg->fg_console->vc_num + 1, &vtstat->v_active))
return -EFAULT;
- for (i = 0, mask = 0; i < MAX_NR_CONSOLES && mask; ++i, mask <<= 1) {
+ for (i = 0, mask = 0; i < vc->display_fg->vc_count && mask; ++i, mask <<= 1) {
tmp = find_vc(i + vc->display_fg->first_vc);
if (tmp && VT_IS_IN_USE(tmp))
state |= mask;
@@ -1027,7 +1027,7 @@
{
int j = vc->display_fg->first_vc;
- for ((j) ? (i = 0) : (i = j = 1); i < vc->display_fg->vc_count; ++i, j++) {
+ for (i = 0; i < vc->display_fg->vc_count; ++i, j++) {
struct vc_data *tmp = find_vc(j);
if (!tmp || (tmp && !VT_IS_IN_USE(tmp)))
@@ -1047,9 +1047,10 @@
if (!perm)
return -EPERM;
- if (arg > MAX_NR_CONSOLES)
+ if (arg == 0 || arg > MAX_NR_CONSOLES)
return -ENXIO;
+ arg--;
tmp = find_vc(arg);
if (!tmp) {
tmp = vc_allocate(arg);
@@ -1067,7 +1068,7 @@
*/
case VT_WAITACTIVE:
{
- struct vc_data *tmp = find_vc(arg);
+ struct vc_data *tmp = find_vc(arg-1);
if (!perm)
return -EPERM;
@@ -1097,7 +1098,7 @@
* Switching-from response
*/
if (vc->vt_newvt >= 0) {
- if (arg == vc->display_fg->fg_console->vc_num)
+ if (arg == 0)
/*
* Switch disallowed, so forget we were trying
* to do it.
@@ -1147,9 +1148,9 @@
if (arg > MAX_NR_CONSOLES)
return -ENXIO;
- if (arg == vt->fg_console->vc_num) {
+ if (arg == 0) {
/* disallocate all unused consoles, but leave visible VC */
- for (i = 0; i < MAX_NR_CONSOLES; i++) {
+ for (i = 1; i < vt->vc_count; i++) {
tmp = find_vc(i + vt->first_vc);
if (tmp && !VT_BUSY(tmp))
@@ -1157,7 +1158,7 @@
}
} else {
/* disallocate a single console, if possible */
- tmp = find_vc(arg);
+ tmp = find_vc(arg-1);
if (!tmp || VT_BUSY(tmp))
return -EBUSY;
vc_disallocate(tmp);
|
|
From: Aivils S. <ai...@us...> - 2003-09-29 09:10:01
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux
In directory sc8-pr-cvs1:/tmp/cvs-serv15552/ruby-2.6/include/linux
Modified Files:
vt_kern.h
Log Message:
reanime /dev/vc/0, keyboard leds
Index: vt_kern.h
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux/vt_kern.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- vt_kern.h 16 Sep 2003 06:54:42 -0000 1.3
+++ vt_kern.h 29 Sep 2003 08:50:56 -0000 1.4
@@ -10,7 +10,7 @@
#include <linux/vt.h>
#include <linux/kbd_kern.h>
-#define MIN_NR_CONSOLES 2 /* must be at least 2 */
+#define MIN_NR_CONSOLES 1 /* must be at least 1 */
#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
#define MAX_NR_USER_CONSOLES 16 /* number of VCs per VT */
@@ -99,8 +99,6 @@
unsigned int vc_saved_y;
unsigned int vc_state; /* Escape sequence parser state */
unsigned int vc_npar, vc_par[NPAR]; /* Parameters of current escape sequence */
- unsigned char vc_ledstate;
- unsigned char vc_ledioctl;
struct kbd_struct kbd_table; /* VC keyboard state */
unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */
struct console_font_op vc_font; /* VC current font set */
@@ -244,6 +242,8 @@
struct vc_data *vc_cons[MAX_NR_USER_CONSOLES]; /* VT's VC pool */
struct vt_struct *next;
struct proc_dir_entry *procdir;
+ unsigned char vt_ledstate;
+ unsigned char vt_ledioctl;
};
extern struct vt_struct *vt_cons;
|
|
From: Aivils S. <ai...@us...> - 2003-09-29 08:57:55
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console
In directory sc8-pr-cvs1:/tmp/cvs-serv16905/ruby-2.6/drivers/video/console
Added Files:
fbcon.c fbcon.h
Log Message:
fbcon is back
--- NEW FILE: fbcon.c ---
/*
* linux/drivers/video/fbcon.c -- Low level frame buffer based console driver
*
* Copyright (C) 1995 Geert Uytterhoeven
*
*
* This file is based on the original Amiga console driver (amicon.c):
*
* Copyright (C) 1993 Hamish Macdonald
* Greg Harp
* Copyright (C) 1994 David Carter [ca...@co...]
*
* with work by William Rucklidge (wj...@cs...)
* Geert Uytterhoeven
* Jes Sorensen (jd...@ko...)
* Martin Apel
*
* and on the original Atari console driver (atacon.c):
*
[...2272 lines suppressed...]
take_over_console(admin_vt, &fb_con);/*FIXME*/
return 0;
}
void __exit fb_console_exit(void)
{
// give_up_console(&fb_con);
}
module_init(fb_console_init);
module_exit(fb_console_exit);
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fb_display);
EXPORT_SYMBOL(fb_con);
MODULE_LICENSE("GPL");
--- NEW FILE: fbcon.h ---
/*
* linux/drivers/video/console/fbcon.h -- Low level frame buffer based console driver
*
* Copyright (C) 1997 Geert Uytterhoeven
*
* 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.
*/
#ifndef _VIDEO_FBCON_H
#define _VIDEO_FBCON_H
#include <linux/config.h>
#include <linux/types.h>
#include <linux/vt_buffer.h>
#include <linux/vt_kern.h>
#include <asm/io.h>
/*
* This is the interface between the low-level console driver and the
* low-level frame buffer device
*/
struct display {
/* Filled in by the frame buffer device */
u_short inverse; /* != 0 text black on white as default */
/* Filled in by the low-level console driver */
char fontname[40]; /* Font associated to this display */
u_char *fontdata;
int userfont; /* != 0 if fontdata kmalloc()ed */
u_short scrollmode; /* Scroll Method */
short yscroll; /* Hardware scrolling */
int vrows; /* number of virtual rows */
int cursor_shape;
};
/* drivers/video/console/fbcon.c */
extern char con2fb_map[MAX_NR_CONSOLES];
extern int set_con2fb_map(int unit, int newidx);
/*
* Attribute Decoding
*/
/* Color */
#define attr_fgcol(fgshift,s) \
(((s) >> (fgshift)) & 0x0f)
#define attr_bgcol(bgshift,s) \
(((s) >> (bgshift)) & 0x0f)
#define attr_bgcol_ec(bgshift,vc) \
((vc) ? (((vc)->vc_video_erase_char >> (bgshift)) & 0x0f) : 0)
#define attr_fgcol_ec(fgshift,vc) \
((vc) ? (((vc)->vc_video_erase_char >> (fgshift)) & 0x0f) : 0)
/* Monochrome */
#define attr_bold(s) \
((s) & 0x200)
#define attr_reverse(s, inverse) \
(((s) & 0x800) ^ (inverse ? 0x800 : 0))
#define attr_underline(s) \
((s) & 0x400)
#define attr_blink(s) \
((s) & 0x8000)
/*
* Scroll Method
*/
/* Internal flags */
#define __SCROLL_YPAN 0x001
#define __SCROLL_YWRAP 0x002
#define __SCROLL_YMOVE 0x003
#define __SCROLL_YREDRAW 0x004
#define __SCROLL_YMASK 0x00f
#define __SCROLL_YFIXED 0x010
#define __SCROLL_YNOMOVE 0x020
#define __SCROLL_YPANREDRAW 0x040
#define __SCROLL_YNOPARTIAL 0x080
/* Only these should be used by the drivers */
/* Which one should you use? If you have a fast card and slow bus,
then probably just 0 to indicate fbcon should choose between
YWRAP/YPAN+MOVE/YMOVE. On the other side, if you have a fast bus
and even better if your card can do fonting (1->8/32bit painting),
you should consider either SCROLL_YREDRAW (if your card is
able to do neither YPAN/YWRAP), or SCROLL_YNOMOVE.
The best is to test it with some real life scrolling (usually, not
all lines on the screen are filled completely with non-space characters,
and REDRAW performs much better on such lines, so don't cat a file
with every line covering all screen columns, it would not be the right
benchmark).
*/
#define SCROLL_YREDRAW (__SCROLL_YFIXED|__SCROLL_YREDRAW)
#define SCROLL_YNOMOVE (__SCROLL_YNOMOVE|__SCROLL_YPANREDRAW)
/* SCROLL_YNOPARTIAL, used in combination with the above, is for video
cards which can not handle using panning to scroll a portion of the
screen without excessive flicker. Panning will only be used for
whole screens.
*/
/* Namespace consistency */
#define SCROLL_YNOPARTIAL __SCROLL_YNOPARTIAL
extern int fb_console_init(void);
extern const struct consw fb_con;
#endif /* _VIDEO_FBCON_H */
|
|
From: Aivils S. <ai...@us...> - 2003-09-29 08:57:55
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char
In directory sc8-pr-cvs1:/tmp/cvs-serv16905/ruby-2.6/drivers/char
Modified Files:
vt.c
Log Message:
fbcon is back
Index: vt.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- vt.c 29 Sep 2003 08:50:56 -0000 1.4
+++ vt.c 29 Sep 2003 08:57:39 -0000 1.5
@@ -1912,9 +1912,10 @@
vc = vt->fg_console;
update_screen(vc);
- printk("Console: switching to %s %s %dx%d\n",
+ printk("Console: switching to %s %s %dx%d vc:%d-%d\n",
vc->vc_can_do_color ? "colour" : "mono",
- desc, vc->vc_cols, vc->vc_rows);
+ desc, vc->vc_cols, vc->vc_rows,
+ vt->first_vc + 1, vt->first_vc + vt->vc_count);
}
/*
|
|
From: Aivils S. <ai...@us...> - 2003-09-16 06:54:48
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux
In directory sc8-pr-cvs1:/tmp/cvs-serv14542/ruby-2.6/include/linux
Modified Files:
vt_kern.h
Added Files:
input.h
Log Message:
/proc/bus/console, hack of /proc/bus/pci, dummy console 2 VCs
--- NEW FILE: input.h ---
#ifndef _INPUT_H
#define _INPUT_H
/*
* Copyright (c) 1999-2002 Vojtech Pavlik
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#ifdef __KERNEL__
#include <linux/time.h>
#include <linux/list.h>
#else
#include <sys/time.h>
#include <sys/ioctl.h>
#include <asm/types.h>
#endif
/*
* The event structure itself
*/
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};
/*
* Protocol version.
*/
#define EV_VERSION 0x010000
/*
* IOCTLs (0x00 - 0x7f)
*/
struct input_id {
__u16 bustype;
__u16 vendor;
__u16 product;
__u16 version;
};
struct input_absinfo {
__s32 value;
__s32 minimum;
__s32 maximum;
__s32 fuzz;
__s32 flat;
};
#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
#define EVIOCSREP _IOW('E', 0x03, int[2]) /* get repeat settings */
#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */
#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */
#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */
#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */
#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */
#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */
#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
/*
* Event types
*/
#define EV_SYN 0x00
#define EV_KEY 0x01
#define EV_REL 0x02
#define EV_ABS 0x03
#define EV_MSC 0x04
#define EV_LED 0x11
#define EV_SND 0x12
#define EV_REP 0x14
#define EV_FF 0x15
#define EV_PWR 0x16
#define EV_FF_STATUS 0x17
#define EV_MAX 0x1f
/*
* Synchronization events.
*/
#define SYN_REPORT 0
#define SYN_CONFIG 1
/*
* Keys and buttons
*/
#define KEY_RESERVED 0
#define KEY_ESC 1
#define KEY_1 2
#define KEY_2 3
#define KEY_3 4
#define KEY_4 5
#define KEY_5 6
#define KEY_6 7
#define KEY_7 8
#define KEY_8 9
#define KEY_9 10
#define KEY_0 11
#define KEY_MINUS 12
#define KEY_EQUAL 13
#define KEY_BACKSPACE 14
#define KEY_TAB 15
#define KEY_Q 16
#define KEY_W 17
#define KEY_E 18
#define KEY_R 19
#define KEY_T 20
#define KEY_Y 21
#define KEY_U 22
#define KEY_I 23
#define KEY_O 24
#define KEY_P 25
#define KEY_LEFTBRACE 26
#define KEY_RIGHTBRACE 27
#define KEY_ENTER 28
#define KEY_LEFTCTRL 29
#define KEY_A 30
#define KEY_S 31
#define KEY_D 32
#define KEY_F 33
#define KEY_G 34
#define KEY_H 35
#define KEY_J 36
#define KEY_K 37
#define KEY_L 38
#define KEY_SEMICOLON 39
#define KEY_APOSTROPHE 40
#define KEY_GRAVE 41
#define KEY_LEFTSHIFT 42
#define KEY_BACKSLASH 43
#define KEY_Z 44
#define KEY_X 45
#define KEY_C 46
#define KEY_V 47
#define KEY_B 48
#define KEY_N 49
#define KEY_M 50
#define KEY_COMMA 51
#define KEY_DOT 52
#define KEY_SLASH 53
#define KEY_RIGHTSHIFT 54
#define KEY_KPASTERISK 55
#define KEY_LEFTALT 56
#define KEY_SPACE 57
#define KEY_CAPSLOCK 58
#define KEY_F1 59
#define KEY_F2 60
#define KEY_F3 61
#define KEY_F4 62
#define KEY_F5 63
#define KEY_F6 64
#define KEY_F7 65
#define KEY_F8 66
#define KEY_F9 67
#define KEY_F10 68
#define KEY_NUMLOCK 69
#define KEY_SCROLLLOCK 70
#define KEY_KP7 71
#define KEY_KP8 72
#define KEY_KP9 73
#define KEY_KPMINUS 74
#define KEY_KP4 75
#define KEY_KP5 76
#define KEY_KP6 77
#define KEY_KPPLUS 78
#define KEY_KP1 79
#define KEY_KP2 80
#define KEY_KP3 81
#define KEY_KP0 82
#define KEY_KPDOT 83
#define KEY_103RD 84
#define KEY_F13 85
#define KEY_102ND 86
#define KEY_F11 87
#define KEY_F12 88
#define KEY_F14 89
#define KEY_F15 90
#define KEY_F16 91
#define KEY_F17 92
#define KEY_F18 93
#define KEY_F19 94
#define KEY_F20 95
#define KEY_KPENTER 96
#define KEY_RIGHTCTRL 97
#define KEY_KPSLASH 98
#define KEY_SYSRQ 99
#define KEY_RIGHTALT 100
#define KEY_LINEFEED 101
#define KEY_HOME 102
#define KEY_UP 103
#define KEY_PAGEUP 104
#define KEY_LEFT 105
#define KEY_RIGHT 106
#define KEY_END 107
#define KEY_DOWN 108
#define KEY_PAGEDOWN 109
#define KEY_INSERT 110
#define KEY_DELETE 111
#define KEY_MACRO 112
#define KEY_MUTE 113
#define KEY_VOLUMEDOWN 114
#define KEY_VOLUMEUP 115
#define KEY_POWER 116
#define KEY_KPEQUAL 117
#define KEY_KPPLUSMINUS 118
#define KEY_PAUSE 119
#define KEY_F21 120
#define KEY_F22 121
#define KEY_F23 122
#define KEY_F24 123
#define KEY_KPCOMMA 124
#define KEY_LEFTMETA 125
#define KEY_RIGHTMETA 126
#define KEY_COMPOSE 127
#define KEY_STOP 128
#define KEY_AGAIN 129
#define KEY_PROPS 130
#define KEY_UNDO 131
#define KEY_FRONT 132
#define KEY_COPY 133
#define KEY_OPEN 134
#define KEY_PASTE 135
#define KEY_FIND 136
#define KEY_CUT 137
#define KEY_HELP 138
#define KEY_MENU 139
#define KEY_CALC 140
#define KEY_SETUP 141
#define KEY_SLEEP 142
#define KEY_WAKEUP 143
#define KEY_FILE 144
#define KEY_SENDFILE 145
#define KEY_DELETEFILE 146
#define KEY_XFER 147
#define KEY_PROG1 148
#define KEY_PROG2 149
#define KEY_WWW 150
#define KEY_MSDOS 151
#define KEY_COFFEE 152
#define KEY_DIRECTION 153
#define KEY_CYCLEWINDOWS 154
#define KEY_MAIL 155
#define KEY_BOOKMARKS 156
#define KEY_COMPUTER 157
#define KEY_BACK 158
#define KEY_FORWARD 159
#define KEY_CLOSECD 160
#define KEY_EJECTCD 161
#define KEY_EJECTCLOSECD 162
#define KEY_NEXTSONG 163
#define KEY_PLAYPAUSE 164
#define KEY_PREVIOUSSONG 165
#define KEY_STOPCD 166
#define KEY_RECORD 167
#define KEY_REWIND 168
#define KEY_PHONE 169
#define KEY_ISO 170
#define KEY_CONFIG 171
#define KEY_HOMEPAGE 172
#define KEY_REFRESH 173
#define KEY_EXIT 174
#define KEY_MOVE 175
#define KEY_EDIT 176
#define KEY_SCROLLUP 177
#define KEY_SCROLLDOWN 178
#define KEY_KPLEFTPAREN 179
#define KEY_KPRIGHTPAREN 180
#define KEY_INTL1 181
#define KEY_INTL2 182
#define KEY_INTL3 183
#define KEY_INTL4 184
#define KEY_INTL5 185
#define KEY_INTL6 186
#define KEY_INTL7 187
#define KEY_INTL8 188
#define KEY_INTL9 189
#define KEY_LANG1 190
#define KEY_LANG2 191
#define KEY_LANG3 192
#define KEY_LANG4 193
#define KEY_LANG5 194
#define KEY_LANG6 195
#define KEY_LANG7 196
#define KEY_LANG8 197
#define KEY_LANG9 198
#define KEY_PLAYCD 200
#define KEY_PAUSECD 201
#define KEY_PROG3 202
#define KEY_PROG4 203
#define KEY_SUSPEND 205
#define KEY_CLOSE 206
#define KEY_PLAY 207
#define KEY_FASTFORWARD 208
#define KEY_BASSBOOST 209
#define KEY_PRINT 210
#define KEY_HP 211
#define KEY_CAMERA 212
#define KEY_SOUND 213
#define KEY_QUESTION 214
#define KEY_EMAIL 215
#define KEY_CHAT 216
#define KEY_SEARCH 217
#define KEY_CONNECT 218
#define KEY_FINANCE 219
#define KEY_SPORT 220
#define KEY_SHOP 221
#define KEY_ALTERASE 222
#define KEY_CANCEL 223
#define KEY_BRIGHTNESSDOWN 224
#define KEY_BRIGHTNESSUP 225
#define KEY_MEDIA 226
#define KEY_UNKNOWN 240
#define BTN_MISC 0x100
#define BTN_0 0x100
#define BTN_1 0x101
#define BTN_2 0x102
#define BTN_3 0x103
#define BTN_4 0x104
#define BTN_5 0x105
#define BTN_6 0x106
#define BTN_7 0x107
#define BTN_8 0x108
#define BTN_9 0x109
#define BTN_MOUSE 0x110
#define BTN_LEFT 0x110
#define BTN_RIGHT 0x111
#define BTN_MIDDLE 0x112
#define BTN_SIDE 0x113
#define BTN_EXTRA 0x114
#define BTN_FORWARD 0x115
#define BTN_BACK 0x116
#define BTN_TASK 0x117
#define BTN_JOYSTICK 0x120
#define BTN_TRIGGER 0x120
#define BTN_THUMB 0x121
#define BTN_THUMB2 0x122
#define BTN_TOP 0x123
#define BTN_TOP2 0x124
#define BTN_PINKIE 0x125
#define BTN_BASE 0x126
#define BTN_BASE2 0x127
#define BTN_BASE3 0x128
#define BTN_BASE4 0x129
#define BTN_BASE5 0x12a
#define BTN_BASE6 0x12b
#define BTN_DEAD 0x12f
#define BTN_GAMEPAD 0x130
#define BTN_A 0x130
#define BTN_B 0x131
#define BTN_C 0x132
#define BTN_X 0x133
#define BTN_Y 0x134
#define BTN_Z 0x135
#define BTN_TL 0x136
#define BTN_TR 0x137
#define BTN_TL2 0x138
#define BTN_TR2 0x139
#define BTN_SELECT 0x13a
#define BTN_START 0x13b
#define BTN_MODE 0x13c
#define BTN_THUMBL 0x13d
#define BTN_THUMBR 0x13e
#define BTN_DIGI 0x140
#define BTN_TOOL_PEN 0x140
#define BTN_TOOL_RUBBER 0x141
#define BTN_TOOL_BRUSH 0x142
#define BTN_TOOL_PENCIL 0x143
#define BTN_TOOL_AIRBRUSH 0x144
#define BTN_TOOL_FINGER 0x145
#define BTN_TOOL_MOUSE 0x146
#define BTN_TOOL_LENS 0x147
#define BTN_TOUCH 0x14a
#define BTN_STYLUS 0x14b
#define BTN_STYLUS2 0x14c
#define BTN_WHEEL 0x150
#define BTN_GEAR_DOWN 0x150
#define BTN_GEAR_UP 0x151
#define KEY_OK 0x160
#define KEY_SELECT 0x161
#define KEY_GOTO 0x162
#define KEY_CLEAR 0x163
#define KEY_POWER2 0x164
#define KEY_OPTION 0x165
#define KEY_INFO 0x166
#define KEY_TIME 0x167
#define KEY_VENDOR 0x168
#define KEY_ARCHIVE 0x169
#define KEY_PROGRAM 0x16a
#define KEY_CHANNEL 0x16b
#define KEY_FAVORITES 0x16c
#define KEY_EPG 0x16d
#define KEY_PVR 0x16e
#define KEY_MHP 0x16f
#define KEY_LANGUAGE 0x170
#define KEY_TITLE 0x171
#define KEY_SUBTITLE 0x172
#define KEY_ANGLE 0x173
#define KEY_ZOOM 0x174
#define KEY_MODE 0x175
#define KEY_KEYBOARD 0x176
#define KEY_SCREEN 0x177
#define KEY_PC 0x178
#define KEY_TV 0x179
#define KEY_TV2 0x17a
#define KEY_VCR 0x17b
#define KEY_VCR2 0x17c
#define KEY_SAT 0x17d
#define KEY_SAT2 0x17e
#define KEY_CD 0x17f
#define KEY_TAPE 0x180
#define KEY_RADIO 0x181
#define KEY_TUNER 0x182
#define KEY_PLAYER 0x183
#define KEY_TEXT 0x184
#define KEY_DVD 0x185
#define KEY_AUX 0x186
#define KEY_MP3 0x187
#define KEY_AUDIO 0x188
#define KEY_VIDEO 0x189
#define KEY_DIRECTORY 0x18a
#define KEY_LIST 0x18b
#define KEY_MEMO 0x18c
#define KEY_CALENDAR 0x18d
#define KEY_RED 0x18e
#define KEY_GREEN 0x18f
#define KEY_YELLOW 0x190
#define KEY_BLUE 0x191
#define KEY_CHANNELUP 0x192
#define KEY_CHANNELDOWN 0x193
#define KEY_FIRST 0x194
#define KEY_LAST 0x195
#define KEY_AB 0x196
#define KEY_NEXT 0x197
#define KEY_RESTART 0x198
#define KEY_SLOW 0x199
#define KEY_SHUFFLE 0x19a
#define KEY_BREAK 0x19b
#define KEY_PREVIOUS 0x19c
#define KEY_DIGITS 0x19d
#define KEY_TEEN 0x19e
#define KEY_TWEN 0x19f
#define KEY_DEL_EOL 0x1c0
#define KEY_DEL_EOS 0x1c1
#define KEY_INS_LINE 0x1c2
#define KEY_DEL_LINE 0x1c3
#define KEY_MAX 0x1ff
/*
* Relative axes
*/
#define REL_X 0x00
#define REL_Y 0x01
#define REL_Z 0x02
#define REL_HWHEEL 0x06
#define REL_DIAL 0x07
#define REL_WHEEL 0x08
#define REL_MISC 0x09
#define REL_MAX 0x0f
/*
* Absolute axes
*/
#define ABS_X 0x00
#define ABS_Y 0x01
#define ABS_Z 0x02
#define ABS_RX 0x03
#define ABS_RY 0x04
#define ABS_RZ 0x05
#define ABS_THROTTLE 0x06
#define ABS_RUDDER 0x07
#define ABS_WHEEL 0x08
#define ABS_GAS 0x09
#define ABS_BRAKE 0x0a
#define ABS_HAT0X 0x10
#define ABS_HAT0Y 0x11
#define ABS_HAT1X 0x12
#define ABS_HAT1Y 0x13
#define ABS_HAT2X 0x14
#define ABS_HAT2Y 0x15
#define ABS_HAT3X 0x16
#define ABS_HAT3Y 0x17
#define ABS_PRESSURE 0x18
#define ABS_DISTANCE 0x19
#define ABS_TILT_X 0x1a
#define ABS_TILT_Y 0x1b
#define ABS_VOLUME 0x20
#define ABS_MISC 0x28
#define ABS_MAX 0x3f
/*
* Misc events
*/
#define MSC_SERIAL 0x00
#define MSC_PULSELED 0x01
#define MSC_GESTURE 0x02
#define MSC_MAX 0x07
/*
* LEDs
*/
#define LED_NUML 0x00
#define LED_CAPSL 0x01
#define LED_SCROLLL 0x02
#define LED_COMPOSE 0x03
#define LED_KANA 0x04
#define LED_SLEEP 0x05
#define LED_SUSPEND 0x06
#define LED_MUTE 0x07
#define LED_MISC 0x08
#define LED_MAX 0x0f
/*
* Autorepeat values
*/
#define REP_DELAY 0x00
#define REP_PERIOD 0x01
#define REP_MAX 0x01
/*
* Sounds
*/
#define SND_CLICK 0x00
#define SND_BELL 0x01
#define SND_TONE 0x02
#define SND_MAX 0x07
/*
* IDs.
*/
#define ID_BUS 0
#define ID_VENDOR 1
#define ID_PRODUCT 2
#define ID_VERSION 3
#define BUS_PCI 0x01
#define BUS_ISAPNP 0x02
#define BUS_USB 0x03
#define BUS_HIL 0x04
#define BUS_ISA 0x10
#define BUS_I8042 0x11
#define BUS_XTKBD 0x12
#define BUS_RS232 0x13
#define BUS_GAMEPORT 0x14
#define BUS_PARPORT 0x15
#define BUS_AMIGA 0x16
#define BUS_ADB 0x17
#define BUS_I2C 0x18
#define BUS_HOST 0x19
/*
* Values describing the status of an effect
*/
#define FF_STATUS_STOPPED 0x00
#define FF_STATUS_PLAYING 0x01
#define FF_STATUS_MAX 0x01
/*
* Structures used in ioctls to upload effects to a device
* The first structures are not passed directly by using ioctls.
* They are sub-structures of the actually sent structure (called ff_effect)
*/
struct ff_replay {
__u16 length; /* Duration of an effect in ms. All other times are also expressed in ms */
__u16 delay; /* Time to wait before to start playing an effect */
};
struct ff_trigger {
__u16 button; /* Number of button triggering an effect */
__u16 interval; /* Time to wait before an effect can be re-triggered (ms) */
};
struct ff_envelope {
__u16 attack_length; /* Duration of attack (ms) */
__u16 attack_level; /* Level at beginning of attack */
__u16 fade_length; /* Duration of fade (ms) */
__u16 fade_level; /* Level at end of fade */
};
/* FF_CONSTANT */
struct ff_constant_effect {
__s16 level; /* Strength of effect. Negative values are OK */
struct ff_envelope envelope;
};
/* FF_RAMP */
struct ff_ramp_effect {
__s16 start_level;
__s16 end_level;
struct ff_envelope envelope;
};
/* FF_SPRING of FF_FRICTION */
struct ff_condition_effect {
__u16 right_saturation; /* Max level when joystick is on the right */
__u16 left_saturation; /* Max level when joystick in on the left */
__s16 right_coeff; /* Indicates how fast the force grows when the
joystick moves to the right */
__s16 left_coeff; /* Same for left side */
__u16 deadband; /* Size of area where no force is produced */
__s16 center; /* Position of dead zone */
};
/* FF_PERIODIC */
struct ff_periodic_effect {
__u16 waveform; /* Kind of wave (sine, square...) */
__u16 period; /* in ms */
__s16 magnitude; /* Peak value */
__s16 offset; /* Mean value of wave (roughly) */
__u16 phase; /* 'Horizontal' shift */
struct ff_envelope envelope;
/* Only used if waveform == FF_CUSTOM */
__u32 custom_len; /* Number of samples */
__s16 *custom_data; /* Buffer of samples */
/* Note: the data pointed by custom_data is copied by the driver. You can
* therefore dispose of the memory after the upload/update */
};
/* FF_RUMBLE */
/* Some rumble pads have two motors of different weight.
strong_magnitude represents the magnitude of the vibration generated
by the heavy motor.
*/
struct ff_rumble_effect {
__u16 strong_magnitude; /* Magnitude of the heavy motor */
__u16 weak_magnitude; /* Magnitude of the light one */
};
/*
* Structure sent through ioctl from the application to the driver
*/
struct ff_effect {
__u16 type;
/* Following field denotes the unique id assigned to an effect.
* If user sets if to -1, a new effect is created, and its id is returned in the same field
* Else, the user sets it to the effect id it wants to update.
*/
__s16 id;
__u16 direction; /* Direction. 0 deg -> 0x0000 (down)
90 deg -> 0x4000 (left)
180 deg -> 0x8000 (up)
270 deg -> 0xC000 (right)
*/
struct ff_trigger trigger;
struct ff_replay replay;
union {
struct ff_constant_effect constant;
struct ff_ramp_effect ramp;
struct ff_periodic_effect periodic;
struct ff_condition_effect condition[2]; /* One for each axis */
struct ff_rumble_effect rumble;
} u;
};
/*
* Force feedback effect types
*/
#define FF_RUMBLE 0x50
#define FF_PERIODIC 0x51
#define FF_CONSTANT 0x52
#define FF_SPRING 0x53
#define FF_FRICTION 0x54
#define FF_DAMPER 0x55
#define FF_INERTIA 0x56
#define FF_RAMP 0x57
/*
* Force feedback periodic effect types
*/
#define FF_SQUARE 0x58
#define FF_TRIANGLE 0x59
#define FF_SINE 0x5a
#define FF_SAW_UP 0x5b
#define FF_SAW_DOWN 0x5c
#define FF_CUSTOM 0x5d
/*
* Set ff device properties
*/
#define FF_GAIN 0x60
#define FF_AUTOCENTER 0x61
#define FF_MAX 0x7f
#ifdef __KERNEL__
/*
* In-kernel definitions.
*/
#include <linux/fs.h>
#include <linux/timer.h>
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
#define LONG(x) ((x)/BITS_PER_LONG)
#define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
((dev->keycodesize == 1) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
#define init_input_dev(dev) do { INIT_LIST_HEAD(&((dev)->h_list)); INIT_LIST_HEAD(&((dev)->node)); } while (0)
struct input_dev {
void *private;
char *name;
char *phys;
char *uniq;
struct input_id id;
unsigned long evbit[NBITS(EV_MAX)];
unsigned long keybit[NBITS(KEY_MAX)];
unsigned long relbit[NBITS(REL_MAX)];
unsigned long absbit[NBITS(ABS_MAX)];
unsigned long mscbit[NBITS(MSC_MAX)];
unsigned long ledbit[NBITS(LED_MAX)];
unsigned long sndbit[NBITS(SND_MAX)];
unsigned long ffbit[NBITS(FF_MAX)];
int ff_effects_max;
unsigned int keycodemax;
unsigned int keycodesize;
void *keycode;
unsigned int repeat_key;
struct timer_list timer;
struct pm_dev *pm_dev;
struct pt_regs *regs;
int state;
int sync;
int abs[ABS_MAX + 1];
int rep[REP_MAX + 1];
unsigned long key[NBITS(KEY_MAX)];
unsigned long led[NBITS(LED_MAX)];
unsigned long snd[NBITS(SND_MAX)];
int absmax[ABS_MAX + 1];
int absmin[ABS_MAX + 1];
int absfuzz[ABS_MAX + 1];
int absflat[ABS_MAX + 1];
int (*open)(struct input_dev *dev);
void (*close)(struct input_dev *dev);
int (*accept)(struct input_dev *dev, struct file *file);
int (*flush)(struct input_dev *dev, struct file *file);
int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);
int (*upload_effect)(struct input_dev *dev, struct ff_effect *effect);
int (*erase_effect)(struct input_dev *dev, int effect_id);
struct input_handle *grab;
struct list_head h_list;
struct list_head node;
};
/*
* Structure for hotplug & device<->driver matching.
*/
#define INPUT_DEVICE_ID_MATCH_BUS 1
#define INPUT_DEVICE_ID_MATCH_VENDOR 2
#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
#define INPUT_DEVICE_ID_MATCH_VERSION 8
#define INPUT_DEVICE_ID_MATCH_EVBIT 0x010
#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020
#define INPUT_DEVICE_ID_MATCH_RELBIT 0x040
#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080
#define INPUT_DEVICE_ID_MATCH_MSCIT 0x100
#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
#define INPUT_DEVICE_ID_MATCH_DEVICE\
(INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\
(INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION)
struct input_device_id {
unsigned long flags;
struct input_id id;
unsigned long evbit[NBITS(EV_MAX)];
unsigned long keybit[NBITS(KEY_MAX)];
unsigned long relbit[NBITS(REL_MAX)];
unsigned long absbit[NBITS(ABS_MAX)];
unsigned long mscbit[NBITS(MSC_MAX)];
unsigned long ledbit[NBITS(LED_MAX)];
unsigned long sndbit[NBITS(SND_MAX)];
unsigned long ffbit[NBITS(FF_MAX)];
unsigned long driver_info;
};
struct input_handle;
struct input_handler {
void *private;
void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id);
void (*disconnect)(struct input_handle *handle);
struct file_operations *fops;
int minor;
char *name;
struct input_device_id *id_table;
struct list_head h_list;
struct list_head node;
};
struct input_handle {
void *private;
int open;
char *name;
struct input_dev *dev;
struct input_handler *handler;
struct list_head d_node;
struct list_head h_node;
};
#define to_dev(n) container_of(n,struct input_dev,node)
#define to_handler(n) container_of(n,struct input_handler,node);
#define to_handle(n) container_of(n,struct input_handle,d_node)
#define to_handle_h(n) container_of(n,struct input_handle,h_node)
void input_register_device(struct input_dev *);
void input_unregister_device(struct input_dev *);
void input_register_handler(struct input_handler *);
void input_unregister_handler(struct input_handler *);
int input_grab_device(struct input_handle *);
void input_release_device(struct input_handle *);
int input_open_device(struct input_handle *);
void input_close_device(struct input_handle *);
int input_accept_process(struct input_handle *handle, struct file *file);
int input_flush_device(struct input_handle* handle, struct file* file);
void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
struct input_handle *input_find_handle(char *phys_descr);
#define input_report_key(a,b,c) input_event(a, EV_KEY, b, !!(c))
#define input_report_rel(a,b,c) input_event(a, EV_REL, b, c)
#define input_report_abs(a,b,c) input_event(a, EV_ABS, b, c)
#define input_report_ff(a,b,c) input_event(a, EV_FF, b, c)
#define input_report_ff_status(a,b,c) input_event(a, EV_FF_STATUS, b, c)
#define input_regs(a,b) do { (a)->regs = (b); } while (0)
#define input_sync(a) do { input_event(a, EV_SYN, SYN_REPORT, 0); (a)->regs = NULL; } while (0)
extern struct class input_class;
#endif
#endif
Index: vt_kern.h
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux/vt_kern.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- vt_kern.h 12 Sep 2003 08:33:21 -0000 1.2
+++ vt_kern.h 16 Sep 2003 06:54:42 -0000 1.3
@@ -10,7 +10,7 @@
#include <linux/vt.h>
#include <linux/kbd_kern.h>
-#define MIN_NR_CONSOLES 1 /* must be at least 1 */
+#define MIN_NR_CONSOLES 2 /* must be at least 2 */
#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
#define MAX_NR_USER_CONSOLES 16 /* number of VCs per VT */
@@ -210,6 +210,7 @@
};
struct vt_struct {
+ unsigned short vt_num; /* VT id */
struct vc_data *fg_console; /* VC being displayed */
struct vc_data *last_console; /* VC we last switched from */
struct vc_data *want_vc; /* VC we want to switch to */
@@ -242,6 +243,7 @@
unsigned int vc_count;
struct vc_data *vc_cons[MAX_NR_USER_CONSOLES]; /* VT's VC pool */
struct vt_struct *next;
+ struct proc_dir_entry *procdir;
};
extern struct vt_struct *vt_cons;
|
|
From: Aivils S. <ai...@us...> - 2003-09-16 06:54:47
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char
In directory sc8-pr-cvs1:/tmp/cvs-serv14542/ruby-2.6/drivers/char
Modified Files:
Makefile keyboard.c vt.c
Added Files:
vt_proc.c
Log Message:
/proc/bus/console, hack of /proc/bus/pci, dummy console 2 VCs
--- NEW FILE: vt_proc.c ---
/*
* $Id: vt_proc.c,v 1.1 2003/09/16 06:54:42 aivils Exp $
*
* Procfs interface for the VT-handler.
*
* Aivils Stoss <>
*/
#include <linux/config.h>
#ifdef CONFIG_PROC_FS
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/vt_kern.h>
#include <linux/input.h>
#include <asm/uaccess.h>
#include <linux/module.h>
#define VT_PROC_DIR "console"
#define WRITE_BUF_MAX_LEN 256
typedef struct _vt_proc_entry {
char *name;
read_proc_t *read_proc;
write_proc_t *write_proc;
unsigned long offset;
} vt_proc_entry;
static int
generic_read(char *page, char **start, off_t off, int count, int *eof, int len)
{
if (len <= off + count)
*eof = 1;
*start = page + off;
len -= off;
if (len > count)
len = count;
if (len < 0)
len = 0;
return len;
}
static int
read_kbd_phys(char *page, char **start, off_t off, int count, int *eof, void *data)
{
struct vt_struct *vt = (struct vt_struct*) data;
int len;
if(!vt || !vt->keyboard) return 0;
len = sprintf(page, "%s\n", vt->keyboard->dev->phys ? vt->keyboard->dev->phys : "");
return generic_read(page, start, off, count, eof, len);
}
static int
write_kbd_phys(struct file *file, const char *buffer,
unsigned long count, void *data)
{
struct vt_struct *vt = (struct vt_struct*) data;
struct input_handle *handle;
char phys_descr[WRITE_BUF_MAX_LEN + 1];
int add_next = 0;
if (!vt || !buffer)
return -EINVAL;
if (count > WRITE_BUF_MAX_LEN) {
count = WRITE_BUF_MAX_LEN;
}
if (copy_from_user(phys_descr, buffer, count))
return -EFAULT;
if(phys_descr[count-1] == 0x0A) phys_descr[count-1] = '\0';
else phys_descr[count] = '\0';
if(phys_descr[0] == 0x2B) //1st is "+" sign
add_next = 1;
handle = input_find_handle(phys_descr+add_next);
if(handle) {
if(handle->private) ((struct vt_struct*)handle->private)->keyboard = NULL;
if(!add_next) {
if(vt->keyboard) vt->keyboard->private = NULL;
vt->keyboard = handle;
}
handle->private = vt;
}
return count;
}
static vt_proc_entry vt_proc_list[] = {
{"keyboard", read_kbd_phys, write_kbd_phys, 0},
{"", 0, 0, 0}
};
static struct proc_dir_entry *
create_proc_rw(char *name, void *data, struct proc_dir_entry *parent,
read_proc_t * read_proc, write_proc_t * write_proc)
{
struct proc_dir_entry *pdep;
mode_t mode = S_IFREG;
if (write_proc) {
mode |= S_IWUSR;
if (read_proc) {
mode |= S_IRUGO;
}
} else if (read_proc) {
mode |= S_IRUGO;
}
if (!(pdep = create_proc_entry(name, mode, parent)))
return NULL;
pdep->read_proc = read_proc;
pdep->write_proc = write_proc;
pdep->data = data;
return pdep;
}
struct proc_dir_entry *proc_bus_console_dir;
int vt_proc_attach(struct vt_struct *vt)
{
struct proc_dir_entry *de;
vt_proc_entry *pe;
char name[16];
if (!(de = vt->procdir)) {
sprintf(name, "%02x", vt->vt_num);
de = vt->procdir = proc_mkdir(name, proc_bus_console_dir);
if (!de)
return -ENOMEM;
}
for (pe = vt_proc_list; pe->name[0]; pe++) {
if (pe->name[0] == '\n')
continue;
if (!(create_proc_rw(pe->name, (void*) vt, vt->procdir,
pe->read_proc, pe->write_proc))) {
return -ENOMEM;
}
}
return 0;
}
EXPORT_SYMBOL(vt_proc_attach);
int vt_proc_detach(struct vt_struct *vt)
{
struct proc_dir_entry *e;
vt_proc_entry *pe;
if ((e = vt->procdir)) {
for (pe = vt_proc_list; pe->name[0]; pe++) {
if (pe->name[0] == '\n')
continue;
remove_proc_entry(pe->name, vt->procdir);
vt->procdir = NULL;
}
remove_proc_entry(e->name, proc_bus_console_dir);
}
return 0;
}
EXPORT_SYMBOL(vt_proc_detach);
int __init vt_proc_init(void)
{
struct vt_struct *vt=vt_cons;
if (vt) {
proc_bus_console_dir = proc_mkdir(VT_PROC_DIR, proc_bus);
while(vt) {
vt_proc_attach(vt);
vt=vt->next;
}
}
return 0;
}
#endif /* CONFIG_PROC_FS */
Index: Makefile
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile 11 Aug 2003 16:26:46 -0000 1.1
+++ Makefile 16 Sep 2003 06:54:41 -0000 1.2
@@ -9,7 +9,7 @@
obj-y += mem.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o random.o
-obj-$(CONFIG_VT) += vt_ioctl.o decvte.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o
+obj-$(CONFIG_VT) += vt_ioctl.o decvte.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o vt_proc.o
obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o
obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
Index: keyboard.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/keyboard.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- keyboard.c 12 Sep 2003 08:33:21 -0000 1.2
+++ keyboard.c 16 Sep 2003 06:54:42 -0000 1.3
@@ -1145,7 +1145,6 @@
* beeper is independent we can share it with all VTs that don't
* have one.
*/
- //if(strncmp(dev->phys,"isa0061",7))
if (i != BTN_MISC) {
while (vt) {
if (vt->next && !vt->next->keyboard) {
@@ -1159,15 +1158,19 @@
dev->name,
vt->first_vc,
vt->first_vc + vt->vc_count - 1);
+ if(test_bit(EV_SND, dev->evbit)) {
+ vt->beeper = handle;
+ vt_map_input(vt);
+ }
break;
}
vt = vt->next;
}
kbd_refresh_leds(handle);
}
- if (test_bit(EV_SND, dev->evbit)) {
- vt->beeper = handle;
- vt_map_input(vt);
+ else if (test_bit(EV_SND, dev->evbit) && admin_vt && !admin_vt->beeper) {
+ admin_vt->beeper = handle;
+ vt_map_input(admin_vt);
}
return handle;
}
Index: vt.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- vt.c 12 Sep 2003 08:33:21 -0000 1.2
+++ vt.c 16 Sep 2003 06:54:42 -0000 1.3
@@ -128,9 +128,13 @@
#if defined (CONFIG_PROM_CONSOLE)
extern void prom_con_init(void);
#endif
+#ifdef CONFIG_PROC_FS
+extern int vt_proc_init(void);
+#endif
struct tty_driver *console_driver; /* TTY driver for all VT consoles */
static unsigned int current_vc; /* Which /dev/vc/X to allocate next */
+static unsigned int current_vt; /* Which VT to allocate next */
struct vt_struct *admin_vt; /* Administrative VT */
struct vt_struct *vt_cons; /* Head to link list of VTs */
@@ -835,7 +839,7 @@
*/
static int pm_con_request(struct pm_dev *dev, pm_request_t rqst, void *data)
{
- struct vt_struct *vt = vt_cons; /*FIXME*/
+ struct vt_struct *vt = admin_vt; /*FIXME*/
if (vt) {
switch (rqst)
@@ -998,6 +1002,11 @@
kmalloced = 1;
if (!*vc->vc_uni_pagedir_loc)
con_set_default_unimap(vc);
+ if (!vt->pm_con) {
+ vt->pm_con = pm_register(PM_SYS_DEV,
+ PM_SYS_VGA,
+ pm_con_request);
+ }
} else {
screenbuf = (unsigned short *) alloc_bootmem(screenbuf_size);
if (!screenbuf) {
@@ -1010,11 +1019,6 @@
if ((vt->first_vc + 1) == currcons)
vt->want_vc = vt->fg_console = vt->last_console = vc;
vc_init(vc, 1);
-/* if (!vt->pm_con) { */
-/* vt->pm_con = pm_register(PM_SYS_DEV, */
-/* PM_SYS_VGA, */
-/* pm_con_request); */
-/* } */
return vc;
}
@@ -1737,6 +1741,7 @@
/* Now to setup VT */
init_MUTEX(&vt->lock);
+ vt->vt_num = current_vt;
vt->first_vc = current_vc;
vt->vc_count = vc_count;
vt->next = vt_cons;
@@ -1767,6 +1772,7 @@
vte_ed(vt->fg_console, 0);
update_screen(vt->fg_console);
current_vc += vc_count;
+ current_vt += 1;
return display_desc;
}
@@ -1846,6 +1852,9 @@
kbd_init();
console_map_init();
vcs_init();
+#ifdef CONFIG_PROC_FS
+ vt_proc_init();
+#endif
return 0;
}
|
|
From: Aivils S. <ai...@us...> - 2003-09-16 06:54:47
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/pci
In directory sc8-pr-cvs1:/tmp/cvs-serv14542/ruby-2.6/drivers/pci
Added Files:
proc.c
Log Message:
/proc/bus/console, hack of /proc/bus/pci, dummy console 2 VCs
--- NEW FILE: proc.c ---
/*
* $Id: proc.c,v 1.1 2003/09/16 06:54:42 aivils Exp $
*
* Procfs interface for the PCI bus.
*
* Copyright (c) 1997--1999 Martin Mares <mj...@uc...>
*/
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>
#define PCI_CFG_SPACE_SIZE 256
static int proc_initialized; /* = 0 */
//from xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h
#define PCI_CMD_STAT_REG 0x04
#define PCI_CMD_IO_ENABLE 0x01
#define PCI_CMD_MEM_ENABLE 0x02
#define PCI_CMD_MASTER_ENABLE 0x04
static int pci_hackvideo=0;
static loff_t
proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
{
loff_t new = -1;
lock_kernel();
switch (whence) {
case 0:
new = off;
break;
case 1:
new = file->f_pos + off;
break;
case 2:
new = PCI_CFG_SPACE_SIZE + off;
break;
}
unlock_kernel();
if (new < 0 || new > PCI_CFG_SPACE_SIZE)
return -EINVAL;
return (file->f_pos = new);
}
static ssize_t
proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
{
const struct inode *ino = file->f_dentry->d_inode;
const struct proc_dir_entry *dp = PDE(ino);
struct pci_dev *dev = dp->data;
unsigned int pos = *ppos;
unsigned int cnt, size;
/*
* Normal users can read only the standardized portion of the
* configuration space as several chips lock up when trying to read
* undefined locations (think of Intel PIIX4 as a typical example).
*/
if (capable(CAP_SYS_ADMIN))
size = PCI_CFG_SPACE_SIZE;
else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
size = 128;
else
size = 64;
if (pos >= size)
return 0;
if (nbytes >= size)
nbytes = size;
if (pos + nbytes > size)
nbytes = size - pos;
cnt = nbytes;
if (!access_ok(VERIFY_WRITE, buf, cnt))
return -EINVAL;
if ((pos & 1) && cnt) {
unsigned char val;
pci_read_config_byte(dev, pos, &val);
__put_user(val, buf);
buf++;
pos++;
cnt--;
}
if ((pos & 3) && cnt > 2) {
unsigned short val;
pci_read_config_word(dev, pos, &val);
__put_user(cpu_to_le16(val), (unsigned short *) buf);
buf += 2;
pos += 2;
cnt -= 2;
}
while (cnt >= 4) {
unsigned int val;
pci_read_config_dword(dev, pos, &val);
__put_user(cpu_to_le32(val), (unsigned int *) buf);
buf += 4;
pos += 4;
cnt -= 4;
}
if (cnt >= 2) {
unsigned short val;
pci_read_config_word(dev, pos, &val);
__put_user(cpu_to_le16(val), (unsigned short *) buf);
buf += 2;
pos += 2;
cnt -= 2;
}
if (cnt) {
unsigned char val;
pci_read_config_byte(dev, pos, &val);
__put_user(val, buf);
buf++;
pos++;
cnt--;
}
*ppos = pos;
return nbytes;
}
static ssize_t
proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos)
{
const struct inode *ino = file->f_dentry->d_inode;
const struct proc_dir_entry *dp = PDE(ino);
struct pci_dev *dev = dp->data;
int pos = *ppos;
int cnt;
if (pci_hackvideo && (pos == PCI_CMD_STAT_REG) &&
(buf[0] <= PCI_CMD_MASTER_ENABLE) &&
((dev->class>>8) == 0x0300 ||
(dev->class>>8) == 0x0400 ||
(dev->class>>8) == 0x0000 ) )
return -EINVAL;
if (pos >= PCI_CFG_SPACE_SIZE)
return 0;
if (nbytes >= PCI_CFG_SPACE_SIZE)
nbytes = PCI_CFG_SPACE_SIZE;
if (pos + nbytes > PCI_CFG_SPACE_SIZE)
nbytes = PCI_CFG_SPACE_SIZE - pos;
cnt = nbytes;
if (!access_ok(VERIFY_READ, buf, cnt))
return -EINVAL;
if ((pos & 1) && cnt) {
unsigned char val;
__get_user(val, buf);
pci_write_config_byte(dev, pos, val);
buf++;
pos++;
cnt--;
}
if ((pos & 3) && cnt > 2) {
unsigned short val;
__get_user(val, (unsigned short *) buf);
pci_write_config_word(dev, pos, le16_to_cpu(val));
buf += 2;
pos += 2;
cnt -= 2;
}
while (cnt >= 4) {
unsigned int val;
__get_user(val, (unsigned int *) buf);
pci_write_config_dword(dev, pos, le32_to_cpu(val));
buf += 4;
pos += 4;
cnt -= 4;
}
if (cnt >= 2) {
unsigned short val;
__get_user(val, (unsigned short *) buf);
pci_write_config_word(dev, pos, le16_to_cpu(val));
buf += 2;
pos += 2;
cnt -= 2;
}
if (cnt) {
unsigned char val;
__get_user(val, buf);
pci_write_config_byte(dev, pos, val);
buf++;
pos++;
cnt--;
}
*ppos = pos;
return nbytes;
}
struct pci_filp_private {
enum pci_mmap_state mmap_state;
int write_combine;
};
static int proc_bus_pci_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
const struct proc_dir_entry *dp = PDE(inode);
struct pci_dev *dev = dp->data;
#ifdef HAVE_PCI_MMAP
struct pci_filp_private *fpriv = file->private_data;
#endif /* HAVE_PCI_MMAP */
int ret = 0;
switch (cmd) {
case PCIIOC_CONTROLLER:
ret = pci_domain_nr(dev->bus);
break;
#ifdef HAVE_PCI_MMAP
case PCIIOC_MMAP_IS_IO:
fpriv->mmap_state = pci_mmap_io;
break;
case PCIIOC_MMAP_IS_MEM:
fpriv->mmap_state = pci_mmap_mem;
break;
case PCIIOC_WRITE_COMBINE:
if (arg)
fpriv->write_combine = 1;
else
fpriv->write_combine = 0;
break;
#endif /* HAVE_PCI_MMAP */
default:
ret = -EINVAL;
break;
};
return ret;
}
#ifdef HAVE_PCI_MMAP
static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma)
{
struct inode *inode = file->f_dentry->d_inode;
const struct proc_dir_entry *dp = PDE(inode);
struct pci_dev *dev = dp->data;
struct pci_filp_private *fpriv = file->private_data;
int ret;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
ret = pci_mmap_page_range(dev, vma,
fpriv->mmap_state,
fpriv->write_combine);
if (ret < 0)
return ret;
return 0;
}
static int proc_bus_pci_open(struct inode *inode, struct file *file)
{
struct pci_filp_private *fpriv = kmalloc(sizeof(*fpriv), GFP_KERNEL);
if (!fpriv)
return -ENOMEM;
fpriv->mmap_state = pci_mmap_io;
fpriv->write_combine = 0;
file->private_data = fpriv;
return 0;
}
static int proc_bus_pci_release(struct inode *inode, struct file *file)
{
kfree(file->private_data);
file->private_data = NULL;
return 0;
}
#endif /* HAVE_PCI_MMAP */
static struct file_operations proc_bus_pci_operations = {
.llseek = proc_bus_pci_lseek,
.read = proc_bus_pci_read,
.write = proc_bus_pci_write,
.ioctl = proc_bus_pci_ioctl,
#ifdef HAVE_PCI_MMAP
.open = proc_bus_pci_open,
.release = proc_bus_pci_release,
.mmap = proc_bus_pci_mmap,
#ifdef HAVE_ARCH_PCI_GET_UNMAPPED_AREA
.get_unmapped_area = get_pci_unmapped_area,
#endif /* HAVE_ARCH_PCI_GET_UNMAPPED_AREA */
#endif /* HAVE_PCI_MMAP */
};
#if BITS_PER_LONG == 32
#define LONG_FORMAT "\t%08lx"
#else
#define LONG_FORMAT "\t%16lx"
#endif
/* iterator */
static void *pci_seq_start(struct seq_file *m, loff_t *pos)
{
struct pci_dev *dev = NULL;
loff_t n = *pos;
dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
while (n--) {
dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
if (dev == NULL)
goto exit;
}
exit:
return dev;
}
static void *pci_seq_next(struct seq_file *m, void *v, loff_t *pos)
{
struct pci_dev *dev = v;
(*pos)++;
dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
return dev;
}
static void pci_seq_stop(struct seq_file *m, void *v)
{
if (v) {
struct pci_dev *dev = v;
pci_dev_put(dev);
}
}
static int show_device(struct seq_file *m, void *v)
{
const struct pci_dev *dev = v;
const struct pci_driver *drv;
int i;
if (dev == NULL)
return 0;
drv = pci_dev_driver(dev);
seq_printf(m, "%02x%02x\t%04x%04x\t%x",
dev->bus->number,
dev->devfn,
dev->vendor,
dev->device,
dev->irq);
/* Here should be 7 and not PCI_NUM_RESOURCES as we need to preserve compatibility */
for(i=0; i<7; i++)
seq_printf(m, LONG_FORMAT,
dev->resource[i].start |
(dev->resource[i].flags & PCI_REGION_FLAG_MASK));
for(i=0; i<7; i++)
seq_printf(m, LONG_FORMAT,
dev->resource[i].start < dev->resource[i].end ?
dev->resource[i].end - dev->resource[i].start + 1 : 0);
seq_putc(m, '\t');
if (drv)
seq_printf(m, "%s", drv->name);
seq_putc(m, '\n');
return 0;
}
static struct seq_operations proc_bus_pci_devices_op = {
.start = pci_seq_start,
.next = pci_seq_next,
.stop = pci_seq_stop,
.show = show_device
};
struct proc_dir_entry *proc_bus_pci_dir;
int pci_proc_attach_device(struct pci_dev *dev)
{
struct pci_bus *bus = dev->bus;
struct proc_dir_entry *de, *e;
char name[16];
if (!proc_initialized)
return -EACCES;
if (!(de = bus->procdir)) {
if (pci_name_bus(name, bus))
return -EEXIST;
de = bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
if (!de)
return -ENOMEM;
}
sprintf(name, "%02x.%x", PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
e = dev->procent = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, de);
if (!e)
return -ENOMEM;
e->proc_fops = &proc_bus_pci_operations;
e->data = dev;
e->size = PCI_CFG_SPACE_SIZE;
return 0;
}
int pci_proc_detach_device(struct pci_dev *dev)
{
struct proc_dir_entry *e;
if ((e = dev->procent)) {
if (atomic_read(&e->count))
return -EBUSY;
remove_proc_entry(e->name, dev->bus->procdir);
dev->procent = NULL;
}
return 0;
}
int pci_proc_attach_bus(struct pci_bus* bus)
{
struct proc_dir_entry *de = bus->procdir;
if (!proc_initialized)
return -EACCES;
if (!de) {
char name[16];
sprintf(name, "%02x", bus->number);
de = bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
if (!de)
return -ENOMEM;
}
return 0;
}
int pci_proc_detach_bus(struct pci_bus* bus)
{
struct proc_dir_entry *de = bus->procdir;
if (de)
remove_proc_entry(de->name, proc_bus_pci_dir);
return 0;
}
#ifdef CONFIG_PCI_LEGACY_PROC
/*
* Backward compatible /proc/pci interface.
*/
/*
* Convert some of the configuration space registers of the device at
* address (bus,devfn) into a string (possibly several lines each).
* The configuration string is stored starting at buf[len]. If the
* string would exceed the size of the buffer (SIZE), 0 is returned.
*/
static int show_dev_config(struct seq_file *m, void *v)
{
struct pci_dev *dev = v;
struct pci_dev *first_dev;
struct pci_driver *drv;
u32 class_rev;
unsigned char latency, min_gnt, max_lat, *class;
int reg;
first_dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
if (dev == first_dev)
seq_puts(m, "PCI devices found:\n");
pci_dev_put(first_dev);
drv = pci_dev_driver(dev);
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
pci_read_config_byte (dev, PCI_LATENCY_TIMER, &latency);
pci_read_config_byte (dev, PCI_MIN_GNT, &min_gnt);
pci_read_config_byte (dev, PCI_MAX_LAT, &max_lat);
seq_printf(m, " Bus %2d, device %3d, function %2d:\n",
dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
class = pci_class_name(class_rev >> 16);
if (class)
seq_printf(m, " %s", class);
else
seq_printf(m, " Class %04x", class_rev >> 16);
#ifdef CONFIG_PCI_NAMES
seq_printf(m, ": %s", dev->pretty_name);
#else
seq_printf(m, ": PCI device %04x:%04x", dev->vendor, dev->device);
#endif
seq_printf(m, " (rev %d).\n", class_rev & 0xff);
if (dev->irq)
seq_printf(m, " IRQ %d.\n", dev->irq);
if (latency || min_gnt || max_lat) {
seq_printf(m, " Master Capable. ");
if (latency)
seq_printf(m, "Latency=%d. ", latency);
else
seq_puts(m, "No bursts. ");
if (min_gnt)
seq_printf(m, "Min Gnt=%d.", min_gnt);
if (max_lat)
seq_printf(m, "Max Lat=%d.", max_lat);
seq_putc(m, '\n');
}
for (reg = 0; reg < 6; reg++) {
struct resource *res = dev->resource + reg;
unsigned long base, end, flags;
base = res->start;
end = res->end;
flags = res->flags;
if (!end)
continue;
if (flags & PCI_BASE_ADDRESS_SPACE_IO) {
seq_printf(m, " I/O at 0x%lx [0x%lx].\n",
base, end);
} else {
const char *pref, *type = "unknown";
if (flags & PCI_BASE_ADDRESS_MEM_PREFETCH)
pref = "P";
else
pref = "Non-p";
switch (flags & PCI_BASE_ADDRESS_MEM_TYPE_MASK) {
case PCI_BASE_ADDRESS_MEM_TYPE_32:
type = "32 bit"; break;
case PCI_BASE_ADDRESS_MEM_TYPE_1M:
type = "20 bit"; break;
case PCI_BASE_ADDRESS_MEM_TYPE_64:
type = "64 bit"; break;
}
seq_printf(m, " %srefetchable %s memory at "
"0x%lx [0x%lx].\n", pref, type,
base,
end);
}
}
return 0;
}
static struct seq_operations proc_pci_op = {
.start = pci_seq_start,
.next = pci_seq_next,
.stop = pci_seq_stop,
.show = show_dev_config
};
static int proc_pci_open(struct inode *inode, struct file *file)
{
return seq_open(file, &proc_pci_op);
}
static struct file_operations proc_pci_operations = {
.open = proc_pci_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
static void legacy_proc_init(void)
{
struct proc_dir_entry * entry = create_proc_entry("pci", 0, NULL);
if (entry)
entry->proc_fops = &proc_pci_operations;
}
#else
static void legacy_proc_init(void)
{
}
#endif /* CONFIG_PCI_LEGACY_PROC */
static int proc_bus_pci_dev_open(struct inode *inode, struct file *file)
{
return seq_open(file, &proc_bus_pci_devices_op);
}
static struct file_operations proc_bus_pci_dev_operations = {
.open = proc_bus_pci_dev_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
#define PCI_PRINT_PROC(fmt,args...) \
do { \
*len += sprintf(buffer + *len, fmt, ##args); \
if (*begin + *len > offset + size) \
return 0; \
if (*begin + *len < offset) { \
*begin += *len; \
*len = 0; \
} \
} while(0)
#define PCI_PROC_READ_FN(infofp) \
do { \
int len = 0; \
off_t begin = 0; \
*eof = infofp(buffer, &len, &begin, offset, size); \
if (offset >= (begin + len)) \
return 0; \
*start = buffer + offset - begin; \
return (size < (begin + len - offset)) ? \
size : begin + len - offset; \
} while(0)
static int pci_proc_hackvideo_info(char * buffer, int * len, off_t * begin,
off_t offset, int size)
{
PCI_PRINT_PROC("%d\n", pci_hackvideo);
return 1;
}
static int pci_proc_hackvideo_read(char * buffer, char ** start, off_t offset,
int size, int * eof, void * data)
{ PCI_PROC_READ_FN(pci_proc_hackvideo_info); }
static int pci_proc_hackvideo_write(struct file * filp, const char * buffer,
unsigned long count, void * data)
{
int num;
char buff[11];
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
num = (count < 10) ? count : 10;
copy_from_user(buff, buffer, num);
buff[num] = '\0';
pci_hackvideo = simple_strtoul(buff, 0, 10) ? 1 : 0;
return count;
}
static int __init pci_proc_init(void)
{
struct proc_dir_entry *entry;
struct pci_dev *dev = NULL;
proc_bus_pci_dir = proc_mkdir("pci", proc_bus);
entry = create_proc_entry("devices", 0, proc_bus_pci_dir);
if (entry)
entry->proc_fops = &proc_bus_pci_dev_operations;
proc_initialized = 1;
while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
pci_proc_attach_device(dev);
}
legacy_proc_init();
entry = create_proc_entry("hackvideo", S_IRUGO | S_IWUSR, proc_bus_pci_dir);
if (entry) {
entry->read_proc = pci_proc_hackvideo_read;
entry->write_proc = pci_proc_hackvideo_write;
}
return 0;
}
__initcall(pci_proc_init);
#ifdef CONFIG_HOTPLUG
EXPORT_SYMBOL(pci_proc_attach_device);
EXPORT_SYMBOL(pci_proc_attach_bus);
EXPORT_SYMBOL(pci_proc_detach_bus);
EXPORT_SYMBOL(proc_bus_pci_dir);
#endif
|
|
From: Aivils S. <ai...@us...> - 2003-09-16 06:54:47
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console
In directory sc8-pr-cvs1:/tmp/cvs-serv14542/ruby-2.6/drivers/video/console
Modified Files:
dummycon.c
Log Message:
/proc/bus/console, hack of /proc/bus/pci, dummy console 2 VCs
Index: dummycon.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/dummycon.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- dummycon.c 12 Sep 2003 08:33:21 -0000 1.2
+++ dummycon.c 16 Sep 2003 06:54:42 -0000 1.3
@@ -111,7 +111,7 @@
memset(vt, 0, sizeof(struct vt_struct));
vt->vt_kmalloced = 1;
vt->vt_sw = &dummy_con;
- display_desc = vt_map_display(vt, 1, MAX_NR_USER_CONSOLES);
+ display_desc = vt_map_display(vt, 1, MIN_NR_CONSOLES);
if (!display_desc) {
kfree(vt);
return -ENODEV;
|
|
From: Aivils S. <ai...@us...> - 2003-09-16 06:54:47
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/input
In directory sc8-pr-cvs1:/tmp/cvs-serv14542/ruby-2.6/drivers/input
Added Files:
input.c
Log Message:
/proc/bus/console, hack of /proc/bus/pci, dummy console 2 VCs
--- NEW FILE: input.c ---
/*
* The input core
*
* Copyright (c) 1999-2002 Vojtech Pavlik
*/
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/random.h>
#include <linux/major.h>
#include <linux/pm.h>
#include <linux/proc_fs.h>
#include <linux/kmod.h>
#include <linux/interrupt.h>
#include <linux/poll.h>
#include <linux/device.h>
#include <linux/devfs_fs_kernel.h>
MODULE_AUTHOR("Vojtech Pavlik <vo...@su...>");
MODULE_DESCRIPTION("Input core");
MODULE_LICENSE("GPL");
EXPORT_SYMBOL(input_register_device);
EXPORT_SYMBOL(input_unregister_device);
EXPORT_SYMBOL(input_register_handler);
EXPORT_SYMBOL(input_unregister_handler);
EXPORT_SYMBOL(input_grab_device);
EXPORT_SYMBOL(input_release_device);
EXPORT_SYMBOL(input_open_device);
EXPORT_SYMBOL(input_close_device);
EXPORT_SYMBOL(input_accept_process);
EXPORT_SYMBOL(input_flush_device);
EXPORT_SYMBOL(input_event);
EXPORT_SYMBOL(input_class);
#define INPUT_DEVICES 256
static LIST_HEAD(input_dev_list);
static LIST_HEAD(input_handler_list);
static struct input_handler *input_table[8];
#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *proc_bus_input_dir;
DECLARE_WAIT_QUEUE_HEAD(input_devices_poll_wait);
static int input_devices_state;
#endif
void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
struct input_handle *handle;
if (dev->pm_dev)
pm_access(dev->pm_dev);
if (type > EV_MAX || !test_bit(type, dev->evbit))
return;
add_mouse_randomness((type << 4) ^ code ^ (code >> 4) ^ value);
switch (type) {
case EV_SYN:
switch (code) {
case SYN_CONFIG:
if (dev->event) dev->event(dev, type, code, value);
break;
case SYN_REPORT:
if (dev->sync) return;
dev->sync = 1;
break;
}
break;
case EV_KEY:
if (code > KEY_MAX || !test_bit(code, dev->keybit) || !!test_bit(code, dev->key) == value)
return;
if (value == 2)
break;
change_bit(code, dev->key);
if (test_bit(EV_REP, dev->evbit) && dev->rep[REP_PERIOD] && value) {
dev->repeat_key = code;
mod_timer(&dev->timer, jiffies + dev->rep[REP_DELAY]);
}
break;
case EV_ABS:
if (code > ABS_MAX || !test_bit(code, dev->absbit))
return;
if (dev->absfuzz[code]) {
if ((value > dev->abs[code] - (dev->absfuzz[code] >> 1)) &&
(value < dev->abs[code] + (dev->absfuzz[code] >> 1)))
return;
if ((value > dev->abs[code] - dev->absfuzz[code]) &&
(value < dev->abs[code] + dev->absfuzz[code]))
value = (dev->abs[code] * 3 + value) >> 2;
if ((value > dev->abs[code] - (dev->absfuzz[code] << 1)) &&
(value < dev->abs[code] + (dev->absfuzz[code] << 1)))
value = (dev->abs[code] + value) >> 1;
}
if (dev->abs[code] == value)
return;
dev->abs[code] = value;
break;
case EV_REL:
if (code > REL_MAX || !test_bit(code, dev->relbit) || (value == 0))
return;
break;
case EV_MSC:
if (code > MSC_MAX || !test_bit(code, dev->mscbit))
return;
if (dev->event) dev->event(dev, type, code, value);
break;
case EV_LED:
if (code > LED_MAX || !test_bit(code, dev->ledbit) || !!test_bit(code, dev->led) == value)
return;
change_bit(code, dev->led);
if (dev->event) dev->event(dev, type, code, value);
break;
case EV_SND:
if (code > SND_MAX || !test_bit(code, dev->sndbit))
return;
if (dev->event) dev->event(dev, type, code, value);
break;
case EV_REP:
if (code > REP_MAX || dev->rep[code] == value) return;
dev->rep[code] = value;
if (dev->event) dev->event(dev, type, code, value);
break;
case EV_FF:
if (dev->event) dev->event(dev, type, code, value);
break;
}
if (type != EV_SYN)
dev->sync = 0;
if (dev->grab)
dev->grab->handler->event(dev->grab, type, code, value);
else
list_for_each_entry(handle, &dev->h_list, d_node)
if (handle->open)
handle->handler->event(handle, type, code, value);
}
static void input_repeat_key(unsigned long data)
{
struct input_dev *dev = (void *) data;
if (!test_bit(dev->repeat_key, dev->key))
return;
input_event(dev, EV_KEY, dev->repeat_key, 2);
input_sync(dev);
mod_timer(&dev->timer, jiffies + dev->rep[REP_PERIOD]);
}
int input_accept_process(struct input_handle *handle, struct file *file)
{
if (handle->dev->accept)
return handle->dev->accept(handle->dev, file);
return 0;
}
int input_grab_device(struct input_handle *handle)
{
if (handle->dev->grab)
return -EBUSY;
handle->dev->grab = handle;
return 0;
}
void input_release_device(struct input_handle *handle)
{
if (handle->dev->grab == handle)
handle->dev->grab = NULL;
}
int input_open_device(struct input_handle *handle)
{
if (handle->dev->pm_dev)
pm_access(handle->dev->pm_dev);
handle->open++;
if (handle->dev->open)
return handle->dev->open(handle->dev);
return 0;
}
int input_flush_device(struct input_handle* handle, struct file* file)
{
if (handle->dev->flush)
return handle->dev->flush(handle->dev, file);
return 0;
}
void input_close_device(struct input_handle *handle)
{
input_release_device(handle);
if (handle->dev->pm_dev)
pm_dev_idle(handle->dev->pm_dev);
if (handle->dev->close)
handle->dev->close(handle->dev);
handle->open--;
}
static void input_link_handle(struct input_handle *handle)
{
list_add_tail(&handle->d_node, &handle->dev->h_list);
list_add_tail(&handle->h_node, &handle->handler->h_list);
}
#define MATCH_BIT(bit, max) \
for (i = 0; i < NBITS(max); i++) \
if ((id->bit[i] & dev->bit[i]) != id->bit[i]) \
break; \
if (i != NBITS(max)) \
continue;
static struct input_device_id *input_match_device(struct input_device_id *id, struct input_dev *dev)
{
int i;
for (; id->flags || id->driver_info; id++) {
if (id->flags & INPUT_DEVICE_ID_MATCH_BUS)
if (id->id.bustype != dev->id.bustype)
continue;
if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR)
if (id->id.vendor != dev->id.vendor)
continue;
if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT)
if (id->id.product != dev->id.product)
continue;
if (id->flags & INPUT_DEVICE_ID_MATCH_BUS)
if (id->id.version != dev->id.version)
continue;
MATCH_BIT(evbit, EV_MAX);
MATCH_BIT(keybit, KEY_MAX);
MATCH_BIT(relbit, REL_MAX);
MATCH_BIT(absbit, ABS_MAX);
MATCH_BIT(mscbit, MSC_MAX);
MATCH_BIT(ledbit, LED_MAX);
MATCH_BIT(sndbit, SND_MAX);
MATCH_BIT(ffbit, FF_MAX);
return id;
}
return NULL;
}
/*
* Input hotplugging interface - loading event handlers based on
* device bitfields.
*/
#ifdef CONFIG_HOTPLUG
/*
* Input hotplugging invokes what /proc/sys/kernel/hotplug says
* (normally /sbin/hotplug) when input devices get added or removed.
*
* This invokes a user mode policy agent, typically helping to load driver
* or other modules, configure the device, and more. Drivers can provide
* a MODULE_DEVICE_TABLE to help with module loading subtasks.
*
*/
#define SPRINTF_BIT_A(bit, name, max) \
do { \
envp[i++] = scratch; \
scratch += sprintf(scratch, name); \
for (j = NBITS(max) - 1; j >= 0; j--) \
if (dev->bit[j]) break; \
for (; j >= 0; j--) \
scratch += sprintf(scratch, "%lx ", dev->bit[j]); \
scratch++; \
} while (0)
#define SPRINTF_BIT_A2(bit, name, max, ev) \
do { \
if (test_bit(ev, dev->evbit)) \
SPRINTF_BIT_A(bit, name, max); \
} while (0)
static void input_call_hotplug(char *verb, struct input_dev *dev)
{
char *argv[3], **envp, *buf, *scratch;
int i = 0, j, value;
if (!hotplug_path[0]) {
printk(KERN_ERR "input.c: calling hotplug without a hotplug agent defined\n");
return;
}
if (in_interrupt()) {
printk(KERN_ERR "input.c: calling hotplug from interrupt\n");
return;
}
if (!current->fs->root) {
printk(KERN_WARNING "input.c: calling hotplug without valid filesystem\n");
return;
}
if (!(envp = (char **) kmalloc(20 * sizeof(char *), GFP_KERNEL))) {
printk(KERN_ERR "input.c: not enough memory allocating hotplug environment\n");
return;
}
if (!(buf = kmalloc(1024, GFP_KERNEL))) {
kfree (envp);
printk(KERN_ERR "input.c: not enough memory allocating hotplug environment\n");
return;
}
argv[0] = hotplug_path;
argv[1] = "input";
argv[2] = 0;
envp[i++] = "HOME=/";
envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
scratch = buf;
envp[i++] = scratch;
scratch += sprintf(scratch, "ACTION=%s", verb) + 1;
envp[i++] = scratch;
scratch += sprintf(scratch, "PRODUCT=%x/%x/%x/%x",
dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version) + 1;
if (dev->name) {
envp[i++] = scratch;
scratch += sprintf(scratch, "NAME=%s", dev->name) + 1;
}
if (dev->phys) {
envp[i++] = scratch;
scratch += sprintf(scratch, "PHYS=%s", dev->phys) + 1;
}
SPRINTF_BIT_A(evbit, "EV=", EV_MAX);
SPRINTF_BIT_A2(keybit, "KEY=", KEY_MAX, EV_KEY);
SPRINTF_BIT_A2(relbit, "REL=", REL_MAX, EV_REL);
SPRINTF_BIT_A2(absbit, "ABS=", ABS_MAX, EV_ABS);
SPRINTF_BIT_A2(mscbit, "MSC=", MSC_MAX, EV_MSC);
SPRINTF_BIT_A2(ledbit, "LED=", LED_MAX, EV_LED);
SPRINTF_BIT_A2(sndbit, "SND=", SND_MAX, EV_SND);
SPRINTF_BIT_A2(ffbit, "FF=", FF_MAX, EV_FF);
envp[i++] = 0;
#ifdef INPUT_DEBUG
printk(KERN_DEBUG "input.c: calling %s %s [%s %s %s %s %s]\n",
argv[0], argv[1], envp[0], envp[1], envp[2], envp[3], envp[4]);
#endif
value = call_usermodehelper(argv [0], argv, envp, 0);
kfree(buf);
kfree(envp);
#ifdef INPUT_DEBUG
if (value != 0)
printk(KERN_DEBUG "input.c: hotplug returned %d\n", value);
#endif
}
#endif
void input_register_device(struct input_dev *dev)
{
struct input_handle *handle;
struct input_handler *handler;
struct input_device_id *id;
set_bit(EV_SYN, dev->evbit);
init_timer(&dev->timer);
dev->timer.data = (long) dev;
dev->timer.function = input_repeat_key;
dev->rep[REP_DELAY] = HZ/4;
dev->rep[REP_PERIOD] = HZ/33;
INIT_LIST_HEAD(&dev->h_list);
list_add_tail(&dev->node, &input_dev_list);
list_for_each_entry(handler, &input_handler_list, node)
if ((id = input_match_device(handler->id_table, dev)))
if ((handle = handler->connect(handler, dev, id)))
input_link_handle(handle);
#ifdef CONFIG_HOTPLUG
input_call_hotplug("add", dev);
#endif
#ifdef CONFIG_PROC_FS
input_devices_state++;
wake_up(&input_devices_poll_wait);
#endif
}
void input_unregister_device(struct input_dev *dev)
{
struct list_head * node, * next;
if (!dev) return;
if (dev->pm_dev)
pm_unregister(dev->pm_dev);
del_timer_sync(&dev->timer);
list_for_each_safe(node, next, &dev->h_list) {
struct input_handle * handle = to_handle(node);
list_del_init(&handle->d_node);
list_del_init(&handle->h_node);
handle->handler->disconnect(handle);
}
#ifdef CONFIG_HOTPLUG
input_call_hotplug("remove", dev);
#endif
list_del_init(&dev->node);
#ifdef CONFIG_PROC_FS
input_devices_state++;
wake_up(&input_devices_poll_wait);
#endif
}
void input_register_handler(struct input_handler *handler)
{
struct input_dev *dev;
struct input_handle *handle;
struct input_device_id *id;
if (!handler) return;
INIT_LIST_HEAD(&handler->h_list);
if (handler->fops != NULL)
input_table[handler->minor >> 5] = handler;
list_add_tail(&handler->node, &input_handler_list);
list_for_each_entry(dev, &input_dev_list, node)
if ((id = input_match_device(handler->id_table, dev)))
if ((handle = handler->connect(handler, dev, id)))
input_link_handle(handle);
#ifdef CONFIG_PROC_FS
input_devices_state++;
wake_up(&input_devices_poll_wait);
#endif
}
void input_unregister_handler(struct input_handler *handler)
{
struct list_head * node, * next;
list_for_each_safe(node, next, &handler->h_list) {
struct input_handle * handle = to_handle_h(node);
list_del_init(&handle->h_node);
list_del_init(&handle->d_node);
handler->disconnect(handle);
}
list_del_init(&handler->node);
if (handler->fops != NULL)
input_table[handler->minor >> 5] = NULL;
#ifdef CONFIG_PROC_FS
input_devices_state++;
wake_up(&input_devices_poll_wait);
#endif
}
static int input_open_file(struct inode *inode, struct file *file)
{
struct input_handler *handler = input_table[minor(inode->i_rdev) >> 5];
struct file_operations *old_fops, *new_fops = NULL;
int err;
/* No load-on-demand here? */
if (!handler || !(new_fops = fops_get(handler->fops)))
return -ENODEV;
/*
* That's _really_ odd. Usually NULL ->open means "nothing special",
* not "no device". Oh, well...
*/
if (!new_fops->open) {
fops_put(new_fops);
return -ENODEV;
}
old_fops = file->f_op;
file->f_op = new_fops;
err = new_fops->open(inode, file);
if (err) {
fops_put(file->f_op);
file->f_op = fops_get(old_fops);
}
fops_put(old_fops);
return err;
}
static struct file_operations input_fops = {
.owner = THIS_MODULE,
.open = input_open_file,
};
#ifdef CONFIG_PROC_FS
#define SPRINTF_BIT_B(bit, name, max) \
do { \
len += sprintf(buf + len, "B: %s", name); \
for (i = NBITS(max) - 1; i >= 0; i--) \
if (dev->bit[i]) break; \
for (; i >= 0; i--) \
len += sprintf(buf + len, "%lx ", dev->bit[i]); \
len += sprintf(buf + len, "\n"); \
} while (0)
#define SPRINTF_BIT_B2(bit, name, max, ev) \
do { \
if (test_bit(ev, dev->evbit)) \
SPRINTF_BIT_B(bit, name, max); \
} while (0)
static unsigned int input_devices_poll(struct file *file, poll_table *wait)
{
int state = input_devices_state;
poll_wait(file, &input_devices_poll_wait, wait);
if (state != input_devices_state)
return POLLIN | POLLRDNORM;
return 0;
}
static int input_devices_read(char *buf, char **start, off_t pos, int count, int *eof, void *data)
{
struct input_dev *dev;
struct input_handle *handle;
off_t at = 0;
int i, len, cnt = 0;
list_for_each_entry(dev, &input_dev_list, node) {
len = sprintf(buf, "I: Bus=%04x Vendor=%04x Product=%04x Version=%04x\n",
dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version);
len += sprintf(buf + len, "N: Name=\"%s\"\n", dev->name ? dev->name : "");
len += sprintf(buf + len, "P: Phys=%s\n", dev->phys ? dev->phys : "");
len += sprintf(buf + len, "H: Handlers=");
list_for_each_entry(handle, &dev->h_list, d_node)
len += sprintf(buf + len, "%s ", handle->name);
len += sprintf(buf + len, "\n");
SPRINTF_BIT_B(evbit, "EV=", EV_MAX);
SPRINTF_BIT_B2(keybit, "KEY=", KEY_MAX, EV_KEY);
SPRINTF_BIT_B2(relbit, "REL=", REL_MAX, EV_REL);
SPRINTF_BIT_B2(absbit, "ABS=", ABS_MAX, EV_ABS);
SPRINTF_BIT_B2(mscbit, "MSC=", MSC_MAX, EV_MSC);
SPRINTF_BIT_B2(ledbit, "LED=", LED_MAX, EV_LED);
SPRINTF_BIT_B2(sndbit, "SND=", SND_MAX, EV_SND);
SPRINTF_BIT_B2(ffbit, "FF=", FF_MAX, EV_FF);
len += sprintf(buf + len, "\n");
at += len;
if (at >= pos) {
if (!*start) {
*start = buf + (pos - (at - len));
cnt = at - pos;
} else cnt += len;
buf += len;
if (cnt >= count)
break;
}
}
if (&dev->node == &input_dev_list)
*eof = 1;
return (count > cnt) ? cnt : count;
}
static int input_handlers_read(char *buf, char **start, off_t pos, int count, int *eof, void *data)
{
struct input_handler *handler;
off_t at = 0;
int len = 0, cnt = 0;
int i = 0;
list_for_each_entry(handler, &input_handler_list, node) {
if (handler->fops)
len = sprintf(buf, "N: Number=%d Name=%s Minor=%d\n",
i++, handler->name, handler->minor);
else
len = sprintf(buf, "N: Number=%d Name=%s\n",
i++, handler->name);
at += len;
if (at >= pos) {
if (!*start) {
*start = buf + (pos - (at - len));
cnt = at - pos;
} else cnt += len;
buf += len;
if (cnt >= count)
break;
}
}
if (&handler->node == &input_handler_list)
*eof = 1;
return (count > cnt) ? cnt : count;
}
struct input_handle *input_find_handle(char *phys_descr)
{
struct input_dev *dev;
struct input_handle *handle;
list_for_each_entry(dev, &input_dev_list, node) {
list_for_each_entry(handle, &dev->h_list, d_node) {
if(!strcmp(handle->name,"kbd") && !strcmp(phys_descr,dev->phys) )
return handle;
}
}
printk(KERN_WARNING "input: no matching device for \"%s\"\n", phys_descr);
return NULL;
}
#endif
struct class input_class = {
.name = "input",
};
static int __init input_init(void)
{
struct proc_dir_entry *entry;
class_register(&input_class);
#ifdef CONFIG_PROC_FS
proc_bus_input_dir = proc_mkdir("input", proc_bus);
proc_bus_input_dir->owner = THIS_MODULE;
entry = create_proc_read_entry("devices", 0, proc_bus_input_dir, input_devices_read, NULL);
entry->owner = THIS_MODULE;
entry->proc_fops->poll = input_devices_poll;
entry = create_proc_read_entry("handlers", 0, proc_bus_input_dir, input_handlers_read, NULL);
entry->owner = THIS_MODULE;
#endif
if (register_chrdev(INPUT_MAJOR, "input", &input_fops)) {
printk(KERN_ERR "input: unable to register char major %d", INPUT_MAJOR);
return -EBUSY;
}
devfs_mk_dir("input");
return 0;
}
static void __exit input_exit(void)
{
#ifdef CONFIG_PROC_FS
remove_proc_entry("devices", proc_bus_input_dir);
remove_proc_entry("handlers", proc_bus_input_dir);
remove_proc_entry("input", proc_bus);
#endif
devfs_remove("input");
if (unregister_chrdev(INPUT_MAJOR, "input"))
printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR);
class_unregister(&input_class);
}
subsys_initcall(input_init);
module_exit(input_exit);
|
|
From: Aivils S. <ai...@us...> - 2003-09-16 06:50:38
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/pci In directory sc8-pr-cvs1:/tmp/cvs-serv13818/ruby-2.6/drivers/pci Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/pci added to the repository |
|
From: Aivils S. <ai...@us...> - 2003-09-16 06:50:13
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/input In directory sc8-pr-cvs1:/tmp/cvs-serv13736/ruby-2.6/drivers/input Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/input added to the repository |
|
From: Aivils S. <ai...@us...> - 2003-09-12 08:33:25
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char
In directory sc8-pr-cvs1:/tmp/cvs-serv26271/ruby-2.6/drivers/char
Modified Files:
console_macros.h consolemap.c decvte.c keyboard.c selection.c
vc_screen.c vt.c vt_ioctl.c
Log Message:
multiple current tty, variable count of VC per VT, fix screenbuf kmalloced, dummy console configurable, fix dead code.
Index: console_macros.h
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/console_macros.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- console_macros.h 11 Aug 2003 16:26:46 -0000 1.1
+++ console_macros.h 12 Sep 2003 08:33:21 -0000 1.2
@@ -43,6 +43,7 @@
#define decim (vc->vc_decim)
#define deccolm (vc->vc_deccolm)
#define need_wrap (vc->vc_need_wrap)
+#define kmalloced (vc->vc_kmalloced)
#define report_mouse (vc->vc_report_mouse)
#define color (vc->vc_color)
#define s_color (vc->vc_s_color)
Index: consolemap.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/consolemap.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- consolemap.c 11 Aug 2003 16:26:46 -0000 1.1
+++ consolemap.c 12 Sep 2003 08:33:21 -0000 1.2
@@ -234,7 +234,7 @@
struct uni_pagedir *p, *q = NULL;
int i;
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vc->display_fg->vc_count; i++) {
struct vc_data *tmp = vc->display_fg->vc_cons[i];
if (!tmp)
@@ -379,7 +379,7 @@
struct uni_pagedir *q;
int i, j, k;
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vc->display_fg->vc_count; i++) {
struct vc_data *tmp = vc->display_fg->vc_cons[i];
if (!tmp)
@@ -670,7 +670,7 @@
struct vt_struct *vt = vt_cons;
int i;
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vt->vc_count; i++) {
struct vc_data *vc = vt->vc_cons[i];
if (vc && !*vc->vc_uni_pagedir_loc)
Index: decvte.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/decvte.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- decvte.c 11 Aug 2003 16:26:46 -0000 1.1
+++ decvte.c 12 Sep 2003 08:33:21 -0000 1.2
@@ -513,10 +513,10 @@
switch (par[i]) {
case 1: /* DECCKM - Cursor keys mode */
if (on_off)
- set_kbd_mode(vc->kbd_table,
+ set_kbd_mode(&vc->kbd_table,
VC_CKMODE);
else
- clr_kbd_mode(vc->kbd_table,
+ clr_kbd_mode(&vc->kbd_table,
VC_CKMODE);
break;
case 2: /* DECANM - ANSI mode */
@@ -550,10 +550,10 @@
case 8: /* DECARM - Autorepeat mode */
decarm = on_off;
if (on_off)
- set_kbd_mode(vc->kbd_table,
+ set_kbd_mode(&vc->kbd_table,
VC_REPEAT);
else
- clr_kbd_mode(vc->kbd_table,
+ clr_kbd_mode(&vc->kbd_table,
VC_REPEAT);
break;
case 9:
@@ -573,10 +573,10 @@
case 66: /* DECNKM - Numeric keybad mode */
decnkm = on_off;
if (on_off)
- set_kbd_mode(vc->kbd_table,
+ set_kbd_mode(&vc->kbd_table,
VC_APPLIC);
else
- clr_kbd_mode(vc->kbd_table,
+ clr_kbd_mode(&vc->kbd_table,
VC_APPLIC);
break;
case 67: /* DECBKM - Backarrow key mode */
@@ -603,10 +603,10 @@
break;
case 20: /* Lf, Enter == CrLf/Lf */
if (on_off)
- set_kbd_mode(vc->kbd_table,
+ set_kbd_mode(&vc->kbd_table,
VC_CRLF);
else
- clr_kbd_mode(vc->kbd_table,
+ clr_kbd_mode(&vc->kbd_table,
VC_CRLF);
break;
}
@@ -1008,10 +1008,10 @@
irm = 0; /* replace */
lnm = 0; /* line feed */
- set_kbd_mode(vc->kbd_table, VC_REPEAT);
- clr_kbd_mode(vc->kbd_table, VC_CKMODE);
- clr_kbd_mode(vc->kbd_table, VC_APPLIC);
- clr_kbd_mode(vc->kbd_table, VC_CRLF);
+ set_kbd_mode(&vc->kbd_table, VC_REPEAT);
+ clr_kbd_mode(&vc->kbd_table, VC_CKMODE);
+ clr_kbd_mode(&vc->kbd_table, VC_APPLIC);
+ clr_kbd_mode(&vc->kbd_table, VC_CRLF);
vc->kbd_table.lockstate = KBD_DEFLOCK;
vc->kbd_table.slockstate = 0;
vc->kbd_table.ledmode = LED_SHOW_FLAGS;
@@ -1131,7 +1131,7 @@
* DEC VT series processes FF as LF.
*/
vte_lf(vc);
- if (!get_kbd_mode(vc->kbd_table, VC_CRLF))
+ if (!get_kbd_mode(&vc->kbd_table, VC_CRLF))
return;
case 0x0d: /* CR - Carriage return */
vte_cr(vc);
@@ -1305,11 +1305,11 @@
return;
case '=': /* DECKPAM - Keypad application mode */
decnkm = 1;
- set_kbd_mode(vc->kbd_table, VC_APPLIC);
+ set_kbd_mode(&vc->kbd_table, VC_APPLIC);
return;
case '>': /* DECKPNM - Keypad numeric mode */
decnkm = 0;
- clr_kbd_mode(vc->kbd_table, VC_APPLIC);
+ clr_kbd_mode(&vc->kbd_table, VC_APPLIC);
return;
/* ===== C1 control functions ===== */
Index: keyboard.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/keyboard.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- keyboard.c 11 Aug 2003 16:26:46 -0000 1.1
+++ keyboard.c 12 Sep 2003 08:33:21 -0000 1.2
@@ -365,7 +365,7 @@
diacr = 0;
}
put_queue(vc, 13);
- if (get_kbd_mode(vc->kbd_table, VC_CRLF))
+ if (get_kbd_mode(&vc->kbd_table, VC_CRLF))
put_queue(vc, 10);
}
@@ -373,14 +373,14 @@
{
if (rep)
return;
- chg_kbd_led(vc->kbd_table, VC_CAPSLOCK);
+ chg_kbd_led(&vc->kbd_table, VC_CAPSLOCK);
}
static void fn_caps_on(struct vc_data *vc)
{
if (rep)
return;
- set_kbd_led(vc->kbd_table, VC_CAPSLOCK);
+ set_kbd_led(&vc->kbd_table, VC_CAPSLOCK);
}
static void fn_show_ptregs(struct vc_data *vc)
@@ -412,7 +412,7 @@
static void fn_num(struct vc_data *vc)
{
- if (get_kbd_mode(vc->kbd_table, VC_APPLIC))
+ if (get_kbd_mode(&vc->kbd_table, VC_APPLIC))
applkey(vc, 'P', 1);
else
fn_bare_num(vc);
@@ -427,7 +427,7 @@
static void fn_bare_num(struct vc_data *vc)
{
if (!rep)
- chg_kbd_led(vc->kbd_table, VC_NUMLOCK);
+ chg_kbd_led(&vc->kbd_table, VC_NUMLOCK);
}
static void fn_lastcons(struct vc_data *vc)
@@ -444,12 +444,12 @@
for (i = j-1; i != j; i--) {
if (i == -1)
- i = MAX_NR_USER_CONSOLES-1;
+ i = vt->vc_count - 1;
tmp = vt->vc_cons[i];
if (tmp)
break;
}
- set_console(tmp);
+ if(tmp) set_console(tmp);
}
static void fn_inc_console(struct vc_data *vc)
@@ -459,13 +459,13 @@
struct vc_data *tmp = NULL;
for (i = j+1; i != j; i++) {
- if (i == MAX_NR_USER_CONSOLES)
+ if (i == vt->vc_count)
i = 0;
tmp = vt->vc_cons[i];
if (tmp)
break;
}
- set_console(tmp);
+ if(tmp) set_console(tmp);
}
static void fn_send_intr(struct vc_data *vc)
@@ -622,7 +622,7 @@
if (up_flag)
return;
- applkey(vc, cur_chars[value], get_kbd_mode(vc->kbd_table, VC_CKMODE));
+ applkey(vc, cur_chars[value], get_kbd_mode(&vc->kbd_table, VC_CKMODE));
}
static void k_pad(struct vc_data *vc, unsigned char value, char up_flag)
@@ -634,12 +634,12 @@
return; /* no action, if this is a key release */
/* kludge... shift forces cursor/number keys */
- if (get_kbd_mode(vc->kbd_table, VC_APPLIC) && !shift_down[KG_SHIFT]) {
+ if (get_kbd_mode(&vc->kbd_table, VC_APPLIC) && !shift_down[KG_SHIFT]) {
applkey(vc, app_map[value], 1);
return;
}
- if (!get_kbd_led(vc->kbd_table, VC_NUMLOCK))
+ if (!get_kbd_led(&vc->kbd_table, VC_NUMLOCK))
switch (value) {
case KVAL(K_PCOMMA):
case KVAL(K_PDOT):
@@ -673,12 +673,12 @@
k_fn(vc, KVAL(K_PGUP), 0);
return;
case KVAL(K_P5):
- applkey(vc, 'G', get_kbd_mode(vc->kbd_table, VC_APPLIC));
+ applkey(vc, 'G', get_kbd_mode(&vc->kbd_table, VC_APPLIC));
return;
}
put_queue(vc, pad_chars[value]);
- if (value == KVAL(K_PENTER) && get_kbd_mode(vc->kbd_table, VC_CRLF))
+ if (value == KVAL(K_PENTER) && get_kbd_mode(&vc->kbd_table, VC_CRLF))
put_queue(vc, 10);
}
@@ -695,7 +695,7 @@
if (value == KVAL(K_CAPSSHIFT)) {
value = KVAL(K_SHIFT);
if (!up_flag)
- clr_kbd_led(vc->kbd_table, VC_CAPSLOCK);
+ clr_kbd_led(&vc->kbd_table, VC_CAPSLOCK);
}
if (up_flag) {
@@ -728,7 +728,7 @@
if (up_flag)
return;
- if (get_kbd_mode(vc->kbd_table, VC_META)) {
+ if (get_kbd_mode(&vc->kbd_table, VC_META)) {
put_queue(vc, '\033');
put_queue(vc, value);
} else
@@ -761,7 +761,7 @@
{
if (up_flag || rep)
return;
- chg_kbd_lock(vc->kbd_table, value);
+ chg_kbd_lock(&vc->kbd_table, value);
}
static void k_slock(struct vc_data *vc, unsigned char value, char up_flag)
@@ -769,11 +769,11 @@
k_shift(vc, value, up_flag);
if (up_flag || rep)
return;
- chg_kbd_slock(vc->kbd_table, value);
+ chg_kbd_slock(&vc->kbd_table, value);
/* try to make Alt, oops, AltGr and such work */
if (!key_maps[vc->kbd_table.lockstate ^ vc->kbd_table.slockstate]) {
vc->kbd_table.slockstate = 0;
- chg_kbd_slock(vc->kbd_table, value);
+ chg_kbd_slock(&vc->kbd_table, value);
}
}
@@ -1046,7 +1046,7 @@
else
clear_bit(keycode, key_down);
- if (rep && (!get_kbd_mode(vc->kbd_table, VC_REPEAT) || (tty &&
+ if (rep && (!get_kbd_mode(&vc->kbd_table, VC_REPEAT) || (tty &&
(!L_ECHO(tty) && tty->driver->chars_in_buffer(tty))))) {
/*
* Don't repeat a key if the input buffers are not empty and the
@@ -1080,7 +1080,7 @@
if (type == KT_LETTER) {
type = KT_LATIN;
- if (get_kbd_led(vc->kbd_table, VC_CAPSLOCK)) {
+ if (get_kbd_led(&vc->kbd_table, VC_CAPSLOCK)) {
key_map = key_maps[shift_final ^ (1 << KG_SHIFT)];
if (key_map)
keysym = key_map[keycode];
@@ -1145,11 +1145,24 @@
* beeper is independent we can share it with all VTs that don't
* have one.
*/
+ //if(strncmp(dev->phys,"isa0061",7))
if (i != BTN_MISC) {
- if (!vt->keyboard) {
- vt->keyboard = handle;
- handle->private = vt;
- }
+ while (vt) {
+ if (vt->next && !vt->next->keyboard) {
+ vt = vt->next;
+ continue;
+ }
+ if (!vt->keyboard) {
+ vt->keyboard = handle;
+ handle->private = vt;
+ printk(KERN_INFO "keyboard.c: %s vc:%d-%d\n",
+ dev->name,
+ vt->first_vc,
+ vt->first_vc + vt->vc_count - 1);
+ break;
+ }
+ vt = vt->next;
+ }
kbd_refresh_leds(handle);
}
if (test_bit(EV_SND, dev->evbit)) {
Index: selection.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/selection.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- selection.c 11 Aug 2003 16:26:46 -0000 1.1
+++ selection.c 12 Sep 2003 08:33:21 -0000 1.2
@@ -46,7 +46,7 @@
/* set reverse video on characters s-e of console with selection. */
inline static void
highlight(const int s, const int e) {
- invert_screen(vt_cons->vc_cons[sel_cons], s, e-s+2, 1);
+ invert_screen(find_vc(sel_cons), s, e-s+2, 1);
}
u16 screen_glyph(struct vc_data *vc, int offset)
@@ -63,12 +63,12 @@
/* use complementary color to show the pointer */
inline static void
highlight_pointer(const int where) {
- complement_pos(vt_cons->vc_cons[sel_cons], where);
+ complement_pos(find_vc(sel_cons), where);
}
static unsigned char sel_pos(int n)
{
- return inverse_translate(vt_cons->vc_cons[sel_cons], screen_glyph(vt_cons->vc_cons[sel_cons], n));
+ return inverse_translate(find_vc(sel_cons), screen_glyph(find_vc(sel_cons), n));
}
/*
Index: vc_screen.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vc_screen.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- vc_screen.c 11 Aug 2003 16:26:46 -0000 1.1
+++ vc_screen.c 12 Sep 2003 08:33:21 -0000 1.2
@@ -129,7 +129,7 @@
* so that we can easily avoid touching user space while holding the
* console spinlock.
*/
-extern char con_buf[PAGE_SIZE];
+//extern char con_buf[PAGE_SIZE];
#define CON_BUF_SIZE PAGE_SIZE
extern struct semaphore con_buf_sem;
@@ -196,7 +196,7 @@
* attempt to move it to userspace.
*/
- con_buf_start = con_buf0 = con_buf;
+ con_buf_start = con_buf0 = vc->display_fg->con_buf;
orig_count = this_round;
maxcol = vc->vc_cols;
if (!attr) {
@@ -233,7 +233,7 @@
/* Advance state pointers and move on. */
this_round -= tmp_count;
p = HEADER_SIZE;
- con_buf0 = con_buf + HEADER_SIZE;
+ con_buf0 = vc->display_fg->con_buf + HEADER_SIZE;
/* If this_round >= 0, then p is even... */
} else if (p & 1) {
/* Skip first byte for output if start address is odd
@@ -358,7 +358,7 @@
* in the write data from userspace safely.
*/
release_console_sem();
- ret = copy_from_user(con_buf, buf, this_round);
+ ret = copy_from_user(vc->display_fg->con_buf, buf, this_round);
acquire_console_sem();
if (ret) {
@@ -388,7 +388,7 @@
* under the lock using the local kernel buffer.
*/
- con_buf0 = con_buf;
+ con_buf0 = vc->display_fg->con_buf;
orig_count = this_round;
maxcol = vc->vc_cols;
p = pos;
Index: vt.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- vt.c 11 Aug 2003 16:26:46 -0000 1.1
+++ vt.c 12 Sep 2003 08:33:21 -0000 1.2
@@ -122,6 +122,9 @@
#ifdef CONFIG_VGA_CONSOLE
extern int vga_console_init(void);
#endif
+#ifdef CONFIG_DUMMY_CONSOLE
+extern int dumb_console_init(void);
+#endif
#if defined (CONFIG_PROM_CONSOLE)
extern void prom_con_init(void);
#endif
@@ -179,7 +182,6 @@
#endif
static int pm_con_request(struct pm_dev *dev, pm_request_t rqst, void *data);
-static struct pm_dev *pm_con;
/*
* Console cursor handling
@@ -685,6 +687,7 @@
struct vt_struct *vt = (struct vt_struct *) private;
struct vc_data *vc = vt->fg_console;
+ vc->display_fg->timer.data = (long) vt;
vc->display_fg->timer.function = unblank_screen_t;
switch (vc->display_fg->blank_mode) {
case VESA_NO_BLANKING:
@@ -697,9 +700,9 @@
}
}
-static void timer_do_blank_screen(int entering_gfx, int from_timer_handler)
+static void timer_do_blank_screen(struct vt_struct *vt, int entering_gfx, int from_timer_handler)
{
- struct vc_data *vc = vt_cons->fg_console;
+ struct vc_data *vc = vt->fg_console;
int i;
if (vc->display_fg->vt_blanked)
@@ -724,6 +727,7 @@
hide_cursor(vc);
if (!from_timer_handler)
del_timer_sync(&vc->display_fg->timer);
+ vc->display_fg->timer.data = (long) vc->display_fg;
vc->display_fg->timer.function = unblank_screen_t;
save_screen(vc);
@@ -736,6 +740,7 @@
if (console_blank_hook && console_blank_hook(1))
return;
if (vc->display_fg->off_interval) {
+ vc->display_fg->timer.data = (long) vc->display_fg;
vc->display_fg->timer.function = powerdown_screen;
mod_timer(&vc->display_fg->timer, jiffies + vc->display_fg->off_interval);
}
@@ -743,9 +748,9 @@
sw->con_blank(vc, vc->display_fg->blank_mode + 1);
}
-void do_blank_screen(int entering_gfx)
+void do_blank_screen(struct vt_struct *vt, int entering_gfx)
{
- timer_do_blank_screen(entering_gfx, 0);
+ timer_do_blank_screen(vt, entering_gfx, 0);
}
/*
@@ -753,7 +758,7 @@
*/
static void unblank_screen_t(unsigned long dummy)
{
- unblank_screen();
+ unblank_vt((struct vt_struct *) dummy);
}
/*
@@ -761,15 +766,15 @@
*/
static void blank_screen(unsigned long dummy)
{
- timer_do_blank_screen(0, 1);
+ timer_do_blank_screen((struct vt_struct *) dummy, 0, 1);
}
/*
- * Called by timer as well as from vt_console_driver
+ * Called by timer
*/
-void unblank_screen(void)
+void unblank_vt(struct vt_struct *vt)
{
- struct vc_data *vc = vt_cons->fg_console;
+ struct vc_data *vc = vt->fg_console;
ignore_poke = 0;
if (!vc->display_fg->vt_blanked)
@@ -782,6 +787,7 @@
if (vcmode != KD_TEXT)
return; /* but leave vc->vc_display_fg->vt_blanked != 0 */
+ vc->display_fg->timer.data = (long) vt;
vc->display_fg->timer.function = blank_screen;
if (vc->display_fg->blank_interval) {
mod_timer(&vc->display_fg->timer, jiffies + vc->display_fg->blank_interval);
@@ -797,6 +803,19 @@
set_cursor(vc);
}
+/*
+ * Called from vt_console_driver
+ */
+void unblank_screen(void)
+{
+ struct vt_struct *vt = vt_cons;
+
+ while(vt) {
+ unblank_vt(vt);
+ vt = vt->next;
+ }
+}
+
void poke_blanked_console(struct vt_struct *vt)
{
struct vc_data *vc = vt->fg_console;
@@ -816,16 +835,20 @@
*/
static int pm_con_request(struct pm_dev *dev, pm_request_t rqst, void *data)
{
- switch (rqst)
- {
- case PM_RESUME:
- unblank_screen();
- break;
- case PM_SUSPEND:
- do_blank_screen(0);
- break;
- }
- return 0;
+ struct vt_struct *vt = vt_cons; /*FIXME*/
+
+ if (vt) {
+ switch (rqst)
+ {
+ case PM_RESUME:
+ unblank_vt(vt);
+ break;
+ case PM_SUSPEND:
+ do_blank_screen(vt, 0);
+ break;
+ }
+ }
+ return 0;
}
/*
* This is the console switching callback.
@@ -887,6 +910,7 @@
can_do_color = default_mode->vc_can_do_color;
video_num_columns = default_mode->vc_cols;
video_num_lines = default_mode->vc_rows;
+ video_scan_lines = default_mode->vc_scan_lines;
screensize = video_num_columns * video_num_lines;
vc->vc_font = vc->display_fg->default_mode->vc_font;
sw->con_init(vc, init);
@@ -911,9 +935,14 @@
struct vc_data *find_vc(int currcons)
{
- struct vt_struct *vt = vt_cons;
+ struct vt_struct *vt;
- return vt->vc_cons[currcons - vt->first_vc];
+ for (vt = vt_cons; vt != NULL; vt = vt->next) {
+ if ((currcons < vt->first_vc + vt->vc_count) &&
+ currcons >= vt->first_vc)
+ return vt->vc_cons[currcons - vt->first_vc];
+ }
+ return NULL;
}
struct vc_data *vc_allocate(unsigned int currcons)
@@ -927,18 +956,26 @@
}
/* prevent users from taking too much memory */
- if (currcons >= MAX_NR_USER_CONSOLES && !capable(CAP_SYS_RESOURCE)) {
+ if (currcons >= MAX_NR_CONSOLES && !capable(CAP_SYS_RESOURCE)) {
currcons = -EPERM;
return NULL;
}
+ for (vt = vt_cons; vt != NULL; vt = vt->next) {
+ if (currcons < vt->first_vc + vt->vc_count &&
+ currcons >= vt->first_vc)
+ goto found_pool;
+ }
+ currcons = -ENXIO;
+ return NULL;
+ found_pool:
/* due to the granularity of kmalloc, we waste some memory here */
/* the alloc is done in two steps, to optimize the common situation
of a 25x80 console (structsize=216, screenbuf_size=4000) */
/* although the numbers above are not valid since long ago, the
point is still up-to-date and the comment still has its value
even if only as a historical artifact. --mj, July 1998 */
- if (vt->kmalloced || !((vt->first_vc + 1)== currcons))
+ if (vt->vt_kmalloced || !((vt->first_vc + 1)== currcons))
vc = (struct vc_data *) kmalloc(sizeof(struct vc_data), GFP_KERNEL);
else
vc = (struct vc_data *) alloc_bootmem(sizeof(struct vc_data));
@@ -949,15 +986,16 @@
memset(vc, 0, sizeof(struct vc_data));
cons_num = currcons;
- vc->display_fg = vt_cons;
+ vc->display_fg = vt;
visual_init(vc, 1);
- if (vt->kmalloced || !((vt->first_vc + 1) == currcons)) {
+ if (vt->vt_kmalloced || !((vt->first_vc + 1) == currcons)) {
screenbuf = (unsigned short *) kmalloc(screenbuf_size, GFP_KERNEL);
if (!screenbuf) {
kfree(vc);
currcons = -ENOMEM;
return NULL;
}
+ kmalloced = 1;
if (!*vc->vc_uni_pagedir_loc)
con_set_default_unimap(vc);
} else {
@@ -972,6 +1010,11 @@
if ((vt->first_vc + 1) == currcons)
vt->want_vc = vt->fg_console = vt->last_console = vc;
vc_init(vc, 1);
+/* if (!vt->pm_con) { */
+/* vt->pm_con = pm_register(PM_SYS_DEV, */
+/* PM_SYS_VGA, */
+/* pm_con_request); */
+/* } */
return vc;
}
@@ -983,13 +1026,9 @@
if (vc) {
sw->con_deinit(vc);
vt->vc_cons[cons_num - vt->first_vc] = NULL;
- if (vt->kmalloced || !(vt->first_vc == cons_num)) {
+ if (kmalloced)
kfree(screenbuf);
- kfree(vc);
- } else {
- free_bootmem((unsigned long) screenbuf, screenbuf_size);
- free_bootmem((unsigned long) vc, sizeof(struct vc_data));
- }
+ kfree(vc);
}
release_console_sem();
return 0;
@@ -1073,10 +1112,11 @@
}
if (nlend > nl)
scr_memsetw((void *) nl, video_erase_char, nlend - nl);
- if (vc->display_fg->kmalloced)
+ if (kmalloced) {
kfree(screenbuf);
+ }
screenbuf = newscreen;
- vc->display_fg->kmalloced = 1;
+ kmalloced = 1;
screenbuf_size = ss;
set_origin(vc);
@@ -1131,7 +1171,7 @@
* since console_init (and thus con_init) are called before any
* kernel memory allocation is available.
*/
-char con_buf[PAGE_SIZE];
+//char con_buf[PAGE_SIZE];
#define CON_BUF_SIZE PAGE_SIZE
DECLARE_MUTEX(con_buf_sem);
@@ -1171,12 +1211,12 @@
if (count > CON_BUF_SIZE)
count = CON_BUF_SIZE;
console_conditional_schedule();
- if (copy_from_user(con_buf, buf, count)) {
+ if (copy_from_user(&vc->display_fg->con_buf, buf, count)) {
n = 0; /* ?? are error codes legal here ?? */
goto out;
}
- buf = con_buf;
+ buf = vc->display_fg->con_buf;
}
/* At this point 'buf' is guaranteed to be a kernel buffer
@@ -1374,9 +1414,10 @@
static int vt_write(struct tty_struct * tty, int from_user,
const unsigned char *buf, int count)
{
+ struct vc_data *vc = (struct vc_data *) tty->driver_data;
int retval;
- pm_access(pm_con);
+ pm_access(vc->display_fg->pm_con);
retval = do_con_write(tty, from_user, buf, count);
vt_flush_chars(tty);
@@ -1385,9 +1426,11 @@
static void vt_put_char(struct tty_struct *tty, unsigned char ch)
{
+ struct vc_data *vc = (struct vc_data *) tty->driver_data;
+
if (in_interrupt())
return; /* n_r3964 calls put_char() from interrupt context */
- pm_access(pm_con);
+ pm_access(vc->display_fg->pm_con);
do_con_write(tty, 0, &ch, 1);
}
@@ -1400,18 +1443,18 @@
static void vt_flush_chars(struct tty_struct *tty)
{
- struct vc_data *vc;
+ struct vc_data *vc = (struct vc_data *) tty->driver_data;
if (in_interrupt()) /* from flush_to_ldisc */
return;
- pm_access(pm_con);
+ if(!vc) return;
+
+ pm_access(vc->display_fg->pm_con);
/* if we race with vt_close(), vc may be null */
acquire_console_sem();
- vc = (struct vc_data *)tty->driver_data;
- if (vc)
- set_cursor(vc);
+ set_cursor(vc);
release_console_sem();
}
@@ -1433,7 +1476,7 @@
vc = (struct vc_data *)tty->driver_data;
if (!vc)
return;
- set_kbd_led(vc->kbd_table, VC_SCROLLOCK);
+ set_kbd_led(&vc->kbd_table, VC_SCROLLOCK);
set_leds();
}
@@ -1450,7 +1493,7 @@
if (!vc)
return;
- clr_kbd_led(vc->kbd_table, VC_SCROLLOCK);
+ clr_kbd_led(&vc->kbd_table, VC_SCROLLOCK);
set_leds();
}
@@ -1492,8 +1535,10 @@
if (!vc)
vc = admin_vt->fg_console;
+ if (!vc)
+ goto quit;
- pm_access(pm_con);
+ pm_access(vc->display_fg->pm_con);
/* read `x' only after setting currcons properly (otherwise
the `x' macro will read the x of the foreground console). */
@@ -1664,7 +1709,7 @@
break;
case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */
ignore_poke = 1;
- do_blank_screen(0);
+ do_blank_screen(vc->display_fg, 0);
break;
case TIOCL_BLANKEDSCREEN:
ret = vc->display_fg->vt_blanked;
@@ -1679,16 +1724,21 @@
/*
* Mapping and unmapping displays to a VT
*/
-const char *vt_map_display(struct vt_struct *vt, int init)
+const char *vt_map_display(struct vt_struct *vt, int init, int vc_count)
{
- const char *display_desc = vt->vt_sw->con_startup(vt, init);
+ const char *display_desc;
+ if (current_vc + vc_count > MAX_NR_CONSOLES + 1)
+ return NULL;
+
+ display_desc = vt->vt_sw->con_startup(vt, init);
if (!display_desc)
return NULL;
/* Now to setup VT */
init_MUTEX(&vt->lock);
vt->first_vc = current_vc;
+ vt->vc_count = vc_count;
vt->next = vt_cons;
vt_cons = vt;
vt->vt_dont_switch = 0;
@@ -1716,6 +1766,7 @@
gotoxy(vt->fg_console, vt->fg_console->vc_x, vt->fg_console->vc_y);
vte_ed(vt->fg_console, 0);
update_screen(vt->fg_console);
+ current_vc += vc_count;
return display_desc;
}
@@ -1737,8 +1788,10 @@
{
int err = 0;
-#ifdef CONFIG_VGA_CONSOLE
+#if defined (CONFIG_VGA_CONSOLE)
err = vga_console_init();
+#elif defined (CONFIG_DUMMY_CONSOLE)
+ err = dumbcon_init();
#endif
return err;
}
@@ -1787,6 +1840,9 @@
#if defined (CONFIG_FRAMEBUFFER_CONSOLE)
fb_console_init();
#endif
+#if defined (CONFIG_DUMMY_CONSOLE)
+ dumb_console_init();
+#endif
kbd_init();
console_map_init();
vcs_init();
@@ -1808,7 +1864,7 @@
/* First shutdown old console driver */
hide_cursor(vc);
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vt->vc_count; i++) {
vc = vt->vc_cons[i];
if (vc)
sw->con_deinit(vc);
@@ -1824,7 +1880,7 @@
vt->vt_sw = csw;
/* Set the VC states to the new default mode */
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vt->vc_count; i++) {
int old_was_color;
vc = vt->vc_cons[i];
Index: vt_ioctl.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt_ioctl.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- vt_ioctl.c 11 Aug 2003 16:26:46 -0000 1.1
+++ vt_ioctl.c 12 Sep 2003 08:33:21 -0000 1.2
@@ -497,7 +497,7 @@
get_user(green[i], arg++);
get_user(blue[i], arg++);
}
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vc->display_fg->vc_count; i++) {
struct vc_data *tmp = vc->display_fg->vc_cons[i];
if (tmp) {
@@ -642,9 +642,9 @@
*/
if (old_vc_mode != new_vc->vc_mode) {
if (new_vc->vc_mode == KD_TEXT)
- unblank_screen();
+ unblank_vt(new_vc->display_fg);
else
- do_blank_screen(1);
+ do_blank_screen(new_vc->display_fg, 1);
}
/*
@@ -673,9 +673,9 @@
if (old_vc_mode != new_vc->vc_mode) {
if (new_vc->vc_mode == KD_TEXT)
- unblank_screen();
+ unblank_vt(new_vc->display_fg);
else
- do_blank_screen(1);
+ do_blank_screen(new_vc->display_fg, 1);
}
}
}
@@ -815,9 +815,9 @@
* explicitly blank/unblank the screen if switching modes
*/
if (arg == KD_TEXT)
- unblank_screen();
+ unblank_vt(vc->display_fg);
else
- do_blank_screen(1);
+ do_blank_screen(vc->display_fg, 1);
return 0;
case KDGETMODE:
@@ -869,10 +869,10 @@
case KDSKBMETA:
switch(arg) {
case K_METABIT:
- clr_kbd_mode(vc->kbd_table, VC_META);
+ clr_kbd_mode(&vc->kbd_table, VC_META);
break;
case K_ESCPREFIX:
- set_kbd_mode(vc->kbd_table, VC_META);
+ set_kbd_mode(&vc->kbd_table, VC_META);
break;
default:
return -EINVAL;
@@ -880,7 +880,7 @@
return 0;
case KDGKBMETA:
- ucval = (get_kbd_mode(vc->kbd_table, VC_META) ? K_ESCPREFIX : K_METABIT);
+ ucval = (get_kbd_mode(&vc->kbd_table, VC_META) ? K_ESCPREFIX : K_METABIT);
setint:
return put_user(ucval, (int *)arg);
@@ -1027,13 +1027,13 @@
{
int j = vc->display_fg->first_vc;
- for (i = 0; i < MAX_NR_USER_CONSOLES; ++i, j++) {
+ for ((j) ? (i = 0) : (i = j = 1); i < vc->display_fg->vc_count; ++i, j++) {
struct vc_data *tmp = find_vc(j);
if (!tmp || (tmp && !VT_IS_IN_USE(tmp)))
break;
}
- ucval = i < MAX_NR_USER_CONSOLES ? (j) : -1;
+ ucval = i < vc->display_fg->vc_count ? (j) : -1;
goto setint;
}
/*
@@ -1118,7 +1118,7 @@
return i;
}
}
-
+ vc->vt_newvt = -1;
/*
* When we actually do the console switch,
* make sure we are atomic with respect to
@@ -1173,7 +1173,7 @@
if (get_user(ll, &vtsizes->v_rows) ||
get_user(cc, &vtsizes->v_cols))
return -EFAULT;
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vc->display_fg->vc_count; i++) {
struct vc_data *tmp = vc->display_fg->vc_cons[i];
vc_resize(tmp, cc, ll);
@@ -1216,7 +1216,7 @@
if (clin > 32)
return -EINVAL;
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vc->display_fg->vc_count; i++) {
struct vc_data *tmp = vc->display_fg->vc_cons[i];
if (vlin)
|
|
From: Aivils S. <ai...@us...> - 2003-09-12 08:33:25
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/kernel/power In directory sc8-pr-cvs1:/tmp/cvs-serv26271/ruby-2.6/kernel/power Added Files: power.h Log Message: multiple current tty, variable count of VC per VT, fix screenbuf kmalloced, dummy console configurable, fix dead code. --- NEW FILE: power.h --- /* With SUSPEND_CONSOLE defined, it suspend looks *really* cool, but we probably do not take enough locks for switching consoles, etc, so bad things might happen. */ #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) //#define SUSPEND_CONSOLE (MAX_NR_USER_CONSOLES-1) #endif |
|
From: Aivils S. <ai...@us...> - 2003-09-12 08:33:25
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console
In directory sc8-pr-cvs1:/tmp/cvs-serv26271/ruby-2.6/drivers/video/console
Modified Files:
dummycon.c vgacon.c
Log Message:
multiple current tty, variable count of VC per VT, fix screenbuf kmalloced, dummy console configurable, fix dead code.
Index: dummycon.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/dummycon.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dummycon.c 11 Aug 2003 16:26:46 -0000 1.1
+++ dummycon.c 12 Sep 2003 08:33:21 -0000 1.2
@@ -28,13 +28,18 @@
#define DUMMY_COLUMNS 80
#define DUMMY_ROWS 25
#endif
+#define MAX_DUMB_CONSOLES 16
+static unsigned long dumb_num = 0;
+static unsigned long dumb_vc_count = 0;
static struct vt_struct dummy_vt;
static struct vc_data default_mode;
static const char *dummycon_startup(struct vt_struct *vt, int init)
{
- vt->default_mode = &default_mode;
+ vt->default_mode = &default_mode;
+ vt->default_mode->vc_cols = DUMMY_COLUMNS;
+ vt->default_mode->vc_rows = DUMMY_ROWS;
return "dummy device";
}
@@ -83,13 +88,56 @@
const char *display_desc = NULL;
memset(&dummy_vt, 0, sizeof(struct vt_struct));
- dummy_vt.kmalloced = 0;
- dummy_vt.vt_sw = &dummy_con;
- display_desc = vt_map_display(&dummy_vt, 1);
+ dummy_vt.vt_kmalloced = 0;
+ dummy_vt.vt_sw = &dummy_con;
+ display_desc = vt_map_display(&dummy_vt, 1, MAX_NR_USER_CONSOLES);
if (!display_desc) return -ENODEV;
- printk("Console: mono %s %dx%d\n", display_desc,
+ printk("Console: mono %s %dx%d vc:%d-%d\n", display_desc,
dummy_vt.default_mode->vc_cols,
- dummy_vt.default_mode->vc_rows);
+ dummy_vt.default_mode->vc_rows,
+ dummy_vt.first_vc, dummy_vt.first_vc + dummy_vt.vc_count - 1);
return 0;
}
+int dumbcon_add(void)
+{
+ const char *display_desc = NULL;
+ struct vt_struct *vt;
+
+ vt = (struct vt_struct *) kmalloc(sizeof(struct vt_struct),GFP_KERNEL);
+
+ if (!vt) return -ENOMEM;
+
+ memset(vt, 0, sizeof(struct vt_struct));
+ vt->vt_kmalloced = 1;
+ vt->vt_sw = &dummy_con;
+ display_desc = vt_map_display(vt, 1, MAX_NR_USER_CONSOLES);
+ if (!display_desc) {
+ kfree(vt);
+ return -ENODEV;
+ }
+ printk("Console: mono %s %dx%d vc:%d-%d\n", display_desc,
+ vt->default_mode->vc_cols,
+ vt->default_mode->vc_rows,
+ vt->first_vc, vt->first_vc + vt->vc_count - 1);
+ return 0;
+}
+
+int __init dumb_console_init(void)
+{
+ unsigned long i;
+ for(i=0; i<dumb_num && i<MAX_DUMB_CONSOLES; i++ ) {
+ if(dumbcon_add()) return 1;
+ }
+ return 0;
+}
+
+int __init dumbcon_setup(char *options)
+{
+ if (!options || !*options)
+ return 0;
+ dumb_num = simple_strtoul(options, 0, 0);
+ return 0;
+}
+
+__setup("dumbcon=", dumbcon_setup);
Index: vgacon.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/vgacon.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- vgacon.c 11 Aug 2003 16:26:46 -0000 1.1
+++ vgacon.c 12 Sep 2003 08:33:21 -0000 1.2
@@ -830,7 +830,7 @@
int i;
/* attribute controller */
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vga_vt.vc_count; i++) {
struct vc_data *vc = vga_vt.vc_cons[i];
if (vc)
@@ -898,11 +898,13 @@
outb_p(vde, vga_video_port_val);
spin_unlock_irq(&vga_lock);
- for (i = 0; i < MAX_NR_USER_CONSOLES; i++) {
+ for (i = 0; i < vc->display_fg->vc_count; i++) {
struct vc_data *tmp = vc->display_fg->vc_cons[i];
- if (tmp)
+ if (tmp) {
+ tmp->vc_font.height = fontheight;
vc_resize(tmp, 0, rows); /* Adjust console size */
+ }
}
return 0;
}
@@ -1089,14 +1091,15 @@
const char *display_desc = NULL;
memset(&vga_vt, 0, sizeof(struct vt_struct));
- vga_vt.kmalloced = 0;
+ vga_vt.vt_kmalloced = 0;
vga_vt.vt_sw = &vga_con;
- display_desc = vt_map_display(&vga_vt, 1);
+ display_desc = vt_map_display(&vga_vt, 1, MAX_NR_USER_CONSOLES);
if (!display_desc) return -ENODEV;
- printk("Console: %s %s %dx%d\n",
+ printk("Console: %s %s %dx%d vc:%d-%d\n",
vga_vt.default_mode->vc_can_do_color ? "Colour" : "Mono",
display_desc, vga_vt.default_mode->vc_cols,
- vga_vt.default_mode->vc_rows);
+ vga_vt.default_mode->vc_rows,
+ vga_vt.first_vc, vga_vt.first_vc + vga_vt.vc_count - 1);
return 0;
}
|
|
From: Aivils S. <ai...@us...> - 2003-09-12 08:33:25
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux
In directory sc8-pr-cvs1:/tmp/cvs-serv26271/ruby-2.6/include/linux
Modified Files:
kbd_kern.h vt_kern.h
Log Message:
multiple current tty, variable count of VC per VT, fix screenbuf kmalloced, dummy console configurable, fix dead code.
Index: kbd_kern.h
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux/kbd_kern.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- kbd_kern.h 11 Aug 2003 16:26:46 -0000 1.1
+++ kbd_kern.h 12 Sep 2003 08:33:21 -0000 1.2
@@ -96,54 +96,54 @@
tasklet_schedule(&keyboard_tasklet);
}
-static inline int get_kbd_mode(struct kbd_struct kbd, int flag)
+static inline int get_kbd_mode(struct kbd_struct * kbd, int flag)
{
- return ((kbd.modeflags >> flag) & 1);
+ return ((kbd->modeflags >> flag) & 1);
}
-static inline int get_kbd_led(struct kbd_struct kbd, int flag)
+static inline int get_kbd_led(struct kbd_struct * kbd, int flag)
{
- return ((kbd.ledflagstate >> flag) & 1);
+ return ((kbd->ledflagstate >> flag) & 1);
}
-static inline void set_kbd_mode(struct kbd_struct kbd, int flag)
+static inline void set_kbd_mode(struct kbd_struct * kbd, int flag)
{
- kbd.modeflags |= 1 << flag;
+ kbd->modeflags |= 1 << flag;
}
-static inline void set_kbd_led(struct kbd_struct kbd, int flag)
+static inline void set_kbd_led(struct kbd_struct * kbd, int flag)
{
- kbd.ledflagstate |= 1 << flag;
+ kbd->ledflagstate |= 1 << flag;
}
-static inline void clr_kbd_mode(struct kbd_struct kbd, int flag)
+static inline void clr_kbd_mode(struct kbd_struct * kbd, int flag)
{
- kbd.modeflags &= ~(1 << flag);
+ kbd->modeflags &= ~(1 << flag);
}
-static inline void clr_kbd_led(struct kbd_struct kbd, int flag)
+static inline void clr_kbd_led(struct kbd_struct * kbd, int flag)
{
- kbd.ledflagstate &= ~(1 << flag);
+ kbd->ledflagstate &= ~(1 << flag);
}
-static inline void chg_kbd_lock(struct kbd_struct kbd, int flag)
+static inline void chg_kbd_lock(struct kbd_struct * kbd, int flag)
{
- kbd.lockstate ^= 1 << flag;
+ kbd->lockstate ^= 1 << flag;
}
-static inline void chg_kbd_slock(struct kbd_struct kbd, int flag)
+static inline void chg_kbd_slock(struct kbd_struct * kbd, int flag)
{
- kbd.slockstate ^= 1 << flag;
+ kbd->slockstate ^= 1 << flag;
}
-static inline void chg_kbd_mode(struct kbd_struct kbd, int flag)
+static inline void chg_kbd_mode(struct kbd_struct * kbd, int flag)
{
- kbd.modeflags ^= 1 << flag;
+ kbd->modeflags ^= 1 << flag;
}
-static inline void chg_kbd_led(struct kbd_struct kbd, int flag)
+static inline void chg_kbd_led(struct kbd_struct * kbd, int flag)
{
- kbd.ledflagstate ^= 1 << flag;
+ kbd->ledflagstate ^= 1 << flag;
}
#define U(x) ((x) ^ 0xf000)
Index: vt_kern.h
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux/vt_kern.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- vt_kern.h 11 Aug 2003 16:26:46 -0000 1.1
+++ vt_kern.h 12 Sep 2003 08:33:21 -0000 1.2
@@ -142,6 +142,7 @@
unsigned int vc_need_wrap:1;
unsigned int vc_can_do_color:1;
unsigned int vc_report_mouse:2;
+ unsigned int vc_kmalloced:1;
unsigned char vc_utf:1; /* Unicode UTF-8 encoding */
unsigned char vc_utf_count;
int vc_utf_char;
@@ -214,7 +215,7 @@
struct vc_data *want_vc; /* VC we want to switch to */
int scrollback_delta;
int cursor_original;
- char kmalloced; /* Did we use kmalloced ? */
+ char vt_kmalloced; /* Did we use kmalloced ? */
char vt_dont_switch; /* VC switching flag */
char vt_blanked; /* Is this display blanked */
int blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */
@@ -238,6 +239,7 @@
struct input_handle *beeper; /* Bell noise support */
void *data_hook; /* Hook for driver data */
unsigned int first_vc;
+ unsigned int vc_count;
struct vc_data *vc_cons[MAX_NR_USER_CONSOLES]; /* VT's VC pool */
struct vt_struct *next;
};
@@ -255,7 +257,7 @@
void terminal_emulation(struct tty_struct *tty, int c);
/* vt.c */
-const char *vt_map_display(struct vt_struct *vt, int init);
+const char *vt_map_display(struct vt_struct *vt, int init, int vc_count);
void vt_map_input(struct vt_struct *vt);
struct vc_data *find_vc(int currcons);
struct vc_data *vc_allocate(unsigned int console);
@@ -288,7 +290,8 @@
inline int resize_screen(struct vc_data *vc, int width, int height);
inline unsigned short *screenpos(struct vc_data *vc, int offset, int viewed);
inline void save_screen(struct vc_data *vc);
-void do_blank_screen(int gfx_mode);
+void do_blank_screen(struct vt_struct *vt, int gfx_mode);
+void unblank_vt(struct vt_struct *vt);
void unblank_screen(void);
void poke_blanked_console(struct vt_struct *vt);
int con_font_op(struct vc_data *vc, struct console_font_op *op);
|
|
From: Aivils S. <ai...@us...> - 2003-09-12 08:21:41
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv24200/ruby-2.6/kernel Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/kernel added to the repository |
|
From: Aivils S. <ai...@us...> - 2003-09-12 08:21:41
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/kernel/power In directory sc8-pr-cvs1:/tmp/cvs-serv24200/ruby-2.6/kernel/power Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/kernel/power added to the repository |
|
From: James S. <jsi...@us...> - 2003-08-11 16:48:22
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv30504/kernel Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386/kernel added to the repository |