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: James S. <jsi...@us...> - 2005-06-20 23:54:34
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/arch/x86_64/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32711/ruby-2.6/arch/x86_64/kernel Modified Files: setup.c Log Message: Updated to 2.6.12 Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/arch/x86_64/kernel/setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- setup.c 22 Oct 2004 07:46:16 -0000 1.1 +++ setup.c 20 Jun 2005 23:54:24 -0000 1.2 @@ -33,7 +33,6 @@ #include <linux/bootmem.h> #include <linux/module.h> #include <asm/processor.h> -#include <linux/console.h> #include <linux/seq_file.h> #include <linux/root_dev.h> #include <linux/pci.h> @@ -53,9 +52,10 @@ #include <asm/mpspec.h> #include <asm/mmu_context.h> #include <asm/bootsetup.h> -#include <asm/smp.h> #include <asm/proto.h> #include <asm/setup.h> +#include <asm/mach_apic.h> +#include <asm/numa.h> /* * Machine setup.. @@ -64,7 +64,6 @@ struct cpuinfo_x86 boot_cpu_data; unsigned long mmu_cr4_features; -EXPORT_SYMBOL_GPL(mmu_cr4_features); int acpi_disabled; EXPORT_SYMBOL(acpi_disabled); @@ -74,8 +73,10 @@ int __initdata acpi_force = 0; #endif -/* For PCI or other memory-mapped resources */ -unsigned long pci_mem_start = 0x10000000; +int acpi_numa __initdata; + +/* Boot loader ID as an integer, for the benefit of proc_dointvec */ +int bootloader_type; unsigned long saved_video_mode; @@ -97,23 +98,30 @@ struct edid_info edid_info; struct e820map e820; -unsigned char aux_device_present; - extern int root_mountflags; extern char _text, _etext, _edata, _end; char command_line[COMMAND_LINE_SIZE]; struct resource standard_io_resources[] = { - { "dma1", 0x00, 0x1f, IORESOURCE_BUSY | IORESOURCE_IO }, - { "pic1", 0x20, 0x21, IORESOURCE_BUSY | IORESOURCE_IO }, - { "timer0", 0x40, 0x43, IORESOURCE_BUSY | IORESOURCE_IO }, - { "timer1", 0x50, 0x53, IORESOURCE_BUSY | IORESOURCE_IO }, - { "keyboard", 0x60, 0x6f, IORESOURCE_BUSY | IORESOURCE_IO }, - { "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY | IORESOURCE_IO }, - { "pic2", 0xa0, 0xa1, IORESOURCE_BUSY | IORESOURCE_IO }, - { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY | IORESOURCE_IO }, - { "fpu", 0xf0, 0xff, IORESOURCE_BUSY | IORESOURCE_IO } + { .name = "dma1", .start = 0x00, .end = 0x1f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "pic1", .start = 0x20, .end = 0x21, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "timer0", .start = 0x40, .end = 0x43, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "timer1", .start = 0x50, .end = 0x53, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "keyboard", .start = 0x60, .end = 0x6f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "dma page reg", .start = 0x80, .end = 0x8f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "pic2", .start = 0xa0, .end = 0xa1, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "dma2", .start = 0xc0, .end = 0xdf, + .flags = IORESOURCE_BUSY | IORESOURCE_IO }, + { .name = "fpu", .start = 0xf0, .end = 0xff, + .flags = IORESOURCE_BUSY | IORESOURCE_IO } }; #define STANDARD_IO_RESOURCES \ @@ -121,28 +129,66 @@ #define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM) -struct resource data_resource = { "Kernel data", 0, 0, IORESOURCE_RAM }; -struct resource code_resource = { "Kernel code", 0, 0, IORESOURCE_RAM }; +struct resource data_resource = { + .name = "Kernel data", + .start = 0, + .end = 0, + .flags = IORESOURCE_RAM, +}; +struct resource code_resource = { + .name = "Kernel code", + .start = 0, + .end = 0, + .flags = IORESOURCE_RAM, +}; #define IORESOURCE_ROM (IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM) -static struct resource system_rom_resource = { "System ROM", 0xf0000, 0xfffff, IORESOURCE_ROM }; -static struct resource extension_rom_resource = { "Extension ROM", 0xe0000, 0xeffff, IORESOURCE_ROM }; +static struct resource system_rom_resource = { + .name = "System ROM", + .start = 0xf0000, + .end = 0xfffff, + .flags = IORESOURCE_ROM, +}; + +static struct resource extension_rom_resource = { + .name = "Extension ROM", + .start = 0xe0000, + .end = 0xeffff, + .flags = IORESOURCE_ROM, +}; static struct resource adapter_rom_resources[] = { - { "Adapter ROM", 0xc8000, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM }, - { "Adapter ROM", 0, 0, IORESOURCE_ROM } + { .name = "Adapter ROM", .start = 0xc8000, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM }, + { .name = "Adapter ROM", .start = 0, .end = 0, + .flags = IORESOURCE_ROM } }; #define ADAPTER_ROM_RESOURCES \ (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0]) -static struct resource video_rom_resource = { "Video ROM", 0xc0000, 0xc7fff, IORESOURCE_ROM }; -static struct resource video_ram_resource = { "Video RAM area", 0xa0000, 0xbffff, IORESOURCE_RAM }; +static struct resource video_rom_resource = { + .name = "Video ROM", + .start = 0xc0000, + .end = 0xc7fff, + .flags = IORESOURCE_ROM, +}; + +static struct resource video_ram_resource = { + .name = "Video RAM area", + .start = 0xa0000, + .end = 0xbffff, + .flags = IORESOURCE_RAM, +}; #define romsignature(x) (*(unsigned short *)(x) == 0xaa55) @@ -280,6 +326,10 @@ else if (!memcmp(from, "acpi=strict", 11)) { acpi_strict = 1; } +#ifdef CONFIG_X86_IO_APIC + else if (!memcmp(from, "acpi_skip_timer_override", 24)) + acpi_skip_timer_override = 1; +#endif #endif if (!memcmp(from, "nolapic", 7) || @@ -311,6 +361,9 @@ if (!memcmp(from,"oops=panic", 10)) panic_on_oops = 1; + if (!memcmp(from, "noexec=", 7)) + nonx_setup(from + 7); + next_char: c = *(from++); if (!c) @@ -442,15 +495,14 @@ void __init setup_arch(char **cmdline_p) { - unsigned long low_mem_size; unsigned long kernel_end; ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); drive_info = DRIVE_INFO; screen_info = SCREEN_INFO; edid_info = EDID_INFO; - aux_device_present = AUX_DEVICE_INFO; saved_video_mode = SAVED_VIDEO_MODE; + bootloader_type = LOADER_TYPE; #ifdef CONFIG_BLK_DEV_RAM rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; @@ -474,6 +526,8 @@ parse_cmdline_early(cmdline_p); + early_identify_cpu(&boot_cpu_data); + /* * partially used pages are not usable - thus * we are rounding upwards: @@ -482,7 +536,22 @@ check_efer(); - init_memory_mapping(); + init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); + +#ifdef CONFIG_ACPI_BOOT + /* + * Initialize the ACPI boot-time table parser (gets the RSDP and SDT). + * Call this early for SRAT node setup. + */ + acpi_boot_table_init(); +#endif + +#ifdef CONFIG_ACPI_NUMA + /* + * Parse SRAT to discover nodes. + */ + acpi_numa_init(); +#endif #ifdef CONFIG_DISCONTIGMEM numa_initmem_init(0, end_pfn); @@ -550,16 +619,15 @@ #endif paging_init(); - check_ioapic(); + check_ioapic(); + #ifdef CONFIG_ACPI_BOOT - /* - * Initialize the ACPI boot-time table parser (gets the RSDP and SDT). - * Must do this after paging_init (due to reliance on fixmap, and thus - * the bootmem allocator) but before get_smp_config (to allow parsing - * of MADT). - */ + /* + * Read APIC and some other early information from ACPI tables. + */ acpi_boot_init(); #endif + #ifdef CONFIG_X86_LOCAL_APIC /* * get boot-time SMP configuration: @@ -585,13 +653,7 @@ request_resource(&ioport_resource, &standard_io_resources[i]); } - /* Will likely break when you have unassigned resources with more - than 4GB memory and bridges that don't support more than 4GB. - Doing it properly would require to use pci_alloc_consistent - in this case. */ - low_mem_size = ((end_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff; - if (low_mem_size > pci_mem_start) - pci_mem_start = low_mem_size; + e820_setup_gap(); #ifdef CONFIG_GART_IOMMU iommu_hole_init(); @@ -602,7 +664,7 @@ { unsigned int *v; - if (cpuid_eax(0x80000000) < 0x80000004) + if (c->extended_cpuid_level < 0x80000004) return 0; v = (unsigned int *) c->x86_model_id; @@ -618,24 +680,24 @@ { unsigned int n, dummy, eax, ebx, ecx, edx; - n = cpuid_eax(0x80000000); + n = c->extended_cpuid_level; if (n >= 0x80000005) { cpuid(0x80000005, &dummy, &ebx, &ecx, &edx); printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n", edx>>24, edx&0xFF, ecx>>24, ecx&0xFF); - c->x86_cache_size=(ecx>>24)+(edx>>24); - /* DTLB and ITLB together, but only 4K */ - c->x86_tlbsize = ((ebx>>16)&0xff) + (ebx&0xff); + c->x86_cache_size=(ecx>>24)+(edx>>24); + /* On K8 L1 TLB is inclusive, so don't count it */ + c->x86_tlbsize = 0; } if (n >= 0x80000006) { cpuid(0x80000006, &dummy, &ebx, &ecx, &edx); - ecx = cpuid_ecx(0x80000006); - c->x86_cache_size = ecx >> 16; + ecx = cpuid_ecx(0x80000006); + c->x86_cache_size = ecx >> 16; c->x86_tlbsize += ((ebx >> 16) & 0xfff) + (ebx & 0xfff); - printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n", + printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n", c->x86_cache_size, ecx & 0xFF); } @@ -648,6 +710,45 @@ } } +/* + * On a AMD dual core setup the lower bits of the APIC id distingush the cores. + * Assumes number of cores is a power of two. + */ +static void __init amd_detect_cmp(struct cpuinfo_x86 *c) +{ +#ifdef CONFIG_SMP + int cpu = smp_processor_id(); + int node = 0; + unsigned bits; + if (c->x86_num_cores == 1) + return; + + bits = 0; + while ((1 << bits) < c->x86_num_cores) + bits++; + + /* Low order bits define the core id (index of core in socket) */ + cpu_core_id[cpu] = phys_proc_id[cpu] & ((1 << bits)-1); + /* Convert the APIC ID into the socket ID */ + phys_proc_id[cpu] >>= bits; + +#ifdef CONFIG_NUMA + /* When an ACPI SRAT table is available use the mappings from SRAT + instead. */ + if (acpi_numa <= 0) { + node = phys_proc_id[cpu]; + if (!node_online(node)) + node = first_node(node_online_map); + cpu_to_node[cpu] = node; + } else { + node = cpu_to_node[cpu]; + } +#endif + + printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n", + cpu, c->x86_num_cores, node, cpu_core_id[cpu]); +#endif +} static int __init init_amd(struct cpuinfo_x86 *c) { @@ -675,23 +776,12 @@ } display_cacheinfo(c); - if (c->cpuid_level >= 0x80000008) { + if (c->extended_cpuid_level >= 0x80000008) { c->x86_num_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; if (c->x86_num_cores & (c->x86_num_cores - 1)) c->x86_num_cores = 1; -#ifdef CONFIG_NUMA - /* On a dual core setup the lower bits of apic id - distingush the cores. Fix up the CPU<->node mappings - here based on that. - Assumes number of cores is a power of two. */ - if (c->x86_num_cores > 1) { - int cpu = c->x86_apicid; - cpu_to_node[cpu] = cpu >> hweight32(c->x86_num_cores - 1); - printk(KERN_INFO "CPU %d -> Node %d\n", - cpu, cpu_to_node[cpu]); - } -#endif + amd_detect_cmp(c); } return r; @@ -701,11 +791,10 @@ { #ifdef CONFIG_SMP u32 eax, ebx, ecx, edx; - int index_lsb, index_msb, tmp; - int initial_apic_id; + int index_msb, tmp; int cpu = smp_processor_id(); - if (!cpu_has(c, X86_FEATURE_HT)) + if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY)) return; cpuid(1, &eax, &ebx, &ecx, &edx); @@ -714,7 +803,6 @@ if (smp_num_siblings == 1) { printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); } else if (smp_num_siblings > 1) { - index_lsb = 0; index_msb = 31; /* * At this point we only support two siblings per @@ -726,155 +814,65 @@ return; } tmp = smp_num_siblings; - while ((tmp & 1) == 0) { - tmp >>=1 ; - index_lsb++; - } - tmp = smp_num_siblings; while ((tmp & 0x80000000 ) == 0) { tmp <<=1 ; index_msb--; } - if (index_lsb != index_msb ) + if (smp_num_siblings & (smp_num_siblings - 1)) index_msb++; - initial_apic_id = hard_smp_processor_id(); - phys_proc_id[cpu] = initial_apic_id >> index_msb; + phys_proc_id[cpu] = phys_pkg_id(index_msb); printk(KERN_INFO "CPU: Physical Processor ID: %d\n", phys_proc_id[cpu]); + + smp_num_siblings = smp_num_siblings / c->x86_num_cores; + + tmp = smp_num_siblings; + index_msb = 31; + while ((tmp & 0x80000000) == 0) { + tmp <<=1 ; + index_msb--; + } + if (smp_num_siblings & (smp_num_siblings - 1)) + index_msb++; + + cpu_core_id[cpu] = phys_pkg_id(index_msb); + + if (c->x86_num_cores > 1) + printk(KERN_INFO "CPU: Processor Core ID: %d\n", + cpu_core_id[cpu]); } #endif } - -#define LVL_1_INST 1 -#define LVL_1_DATA 2 -#define LVL_2 3 -#define LVL_3 4 -#define LVL_TRACE 5 -struct _cache_table +/* + * find out the number of processor cores on the die + */ +static int __init intel_num_cpu_cores(struct cpuinfo_x86 *c) { - unsigned char descriptor; - char cache_type; - short size; -}; + unsigned int eax; -/* all the cache descriptor types we care about (no TLB or trace cache entries) */ -static struct _cache_table cache_table[] __initdata = -{ - { 0x06, LVL_1_INST, 8 }, - { 0x08, LVL_1_INST, 16 }, - { 0x0a, LVL_1_DATA, 8 }, - { 0x0c, LVL_1_DATA, 16 }, - { 0x22, LVL_3, 512 }, - { 0x23, LVL_3, 1024 }, - { 0x25, LVL_3, 2048 }, - { 0x29, LVL_3, 4096 }, - { 0x2c, LVL_1_DATA, 32 }, - { 0x30, LVL_1_INST, 32 }, - { 0x39, LVL_2, 128 }, - { 0x3b, LVL_2, 128 }, - { 0x3c, LVL_2, 256 }, - { 0x41, LVL_2, 128 }, - { 0x42, LVL_2, 256 }, - { 0x43, LVL_2, 512 }, - { 0x44, LVL_2, 1024 }, - { 0x45, LVL_2, 2048 }, - { 0x60, LVL_1_DATA, 16 }, - { 0x66, LVL_1_DATA, 8 }, - { 0x67, LVL_1_DATA, 16 }, - { 0x68, LVL_1_DATA, 32 }, - { 0x70, LVL_TRACE, 12 }, - { 0x71, LVL_TRACE, 16 }, - { 0x72, LVL_TRACE, 32 }, - { 0x79, LVL_2, 128 }, - { 0x7a, LVL_2, 256 }, - { 0x7b, LVL_2, 512 }, - { 0x7c, LVL_2, 1024 }, - { 0x82, LVL_2, 256 }, - { 0x83, LVL_2, 512 }, - { 0x84, LVL_2, 1024 }, - { 0x85, LVL_2, 2048 }, - { 0x86, LVL_2, 512 }, - { 0x87, LVL_2, 1024 }, - { 0x00, 0, 0} -}; + if (c->cpuid_level < 4) + return 1; + + __asm__("cpuid" + : "=a" (eax) + : "0" (4), "c" (0) + : "bx", "dx"); + + if (eax & 0x1f) + return ((eax >> 26) + 1); + else + return 1; +} static void __init init_intel(struct cpuinfo_x86 *c) { /* Cache sizes */ - unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; unsigned n; - if (c->cpuid_level > 1) { - /* supports eax=2 call */ - int i, j, n; - int regs[4]; - unsigned char *dp = (unsigned char *)regs; - - /* Number of times to iterate */ - n = cpuid_eax(2) & 0xFF; - - for ( i = 0 ; i < n ; i++ ) { - cpuid(2, ®s[0], ®s[1], ®s[2], ®s[3]); - - /* If bit 31 is set, this is an unknown format */ - for ( j = 0 ; j < 3 ; j++ ) { - if ( regs[j] < 0 ) regs[j] = 0; - } - - /* Byte 0 is level count, not a descriptor */ - for ( j = 1 ; j < 16 ; j++ ) { - unsigned char des = dp[j]; - unsigned char k = 0; - - /* look up this descriptor in the table */ - while (cache_table[k].descriptor != 0) - { - if (cache_table[k].descriptor == des) { - switch (cache_table[k].cache_type) { - case LVL_1_INST: - l1i += cache_table[k].size; - break; - case LVL_1_DATA: - l1d += cache_table[k].size; - break; - case LVL_2: - l2 += cache_table[k].size; - break; - case LVL_3: - l3 += cache_table[k].size; - break; - case LVL_TRACE: - trace += cache_table[k].size; - break; - } - - break; - } - - k++; - } - } - } - - if (trace) - printk (KERN_INFO "CPU: Trace cache: %dK uops", trace); - else if (l1i) - printk (KERN_INFO "CPU: L1 I cache: %dK", l1i); - if (l1d) - printk(", L1 D cache: %dK\n", l1d); - else - printk("\n"); - if (l2) - printk(KERN_INFO "CPU: L2 cache: %dK\n", l2); - if (l3) - printk(KERN_INFO "CPU: L3 cache: %dK\n", l3); - - c->x86_cache_size = l2 ? l2 : (l1i+l1d); - } - - n = cpuid_eax(0x80000000); + init_intel_cacheinfo(c); + n = c->extended_cpuid_level; if (n >= 0x80000008) { unsigned eax = cpuid_eax(0x80000008); c->x86_virt_bits = (eax >> 8) & 0xff; @@ -883,6 +881,9 @@ if (c->x86 == 15) c->x86_cache_alignment = c->x86_clflush_size * 2; + if (c->x86 >= 15) + set_bit(X86_FEATURE_CONSTANT_TSC, &c->x86_capability); + c->x86_num_cores = intel_num_cpu_cores(c); } void __init get_cpu_vendor(struct cpuinfo_x86 *c) @@ -919,14 +920,14 @@ c->x86_clflush_size = 64; c->x86_cache_alignment = c->x86_clflush_size; c->x86_num_cores = 1; - c->x86_apicid = c == &boot_cpu_data ? 0 : c - cpu_data; + c->extended_cpuid_level = 0; memset(&c->x86_capability, 0, sizeof c->x86_capability); /* Get vendor name */ - cpuid(0x00000000, &c->cpuid_level, - (int *)&c->x86_vendor_id[0], - (int *)&c->x86_vendor_id[8], - (int *)&c->x86_vendor_id[4]); + cpuid(0x00000000, (unsigned int *)&c->cpuid_level, + (unsigned int *)&c->x86_vendor_id[0], + (unsigned int *)&c->x86_vendor_id[8], + (unsigned int *)&c->x86_vendor_id[4]); get_cpu_vendor(c); @@ -947,11 +948,14 @@ } if (c->x86_capability[0] & (1<<19)) c->x86_clflush_size = ((misc >> 8) & 0xff) * 8; - c->x86_apicid = misc >> 24; } else { /* Have CPUID level 0 only - unheard of */ c->x86 = 4; } + +#ifdef CONFIG_SMP + phys_proc_id[smp_processor_id()] = (cpuid_ebx(1) >> 24) & 0xff; +#endif } /* @@ -966,19 +970,21 @@ /* AMD-defined flags: level 0x80000001 */ xlvl = cpuid_eax(0x80000000); - if ( (xlvl & 0xffff0000) == 0x80000000 ) { - if ( xlvl >= 0x80000001 ) { + c->extended_cpuid_level = xlvl; + if ((xlvl & 0xffff0000) == 0x80000000) { + if (xlvl >= 0x80000001) { c->x86_capability[1] = cpuid_edx(0x80000001); - c->x86_capability[5] = cpuid_ecx(0x80000001); + c->x86_capability[6] = cpuid_ecx(0x80000001); } - if ( xlvl >= 0x80000004 ) + if (xlvl >= 0x80000004) get_model_name(c); /* Default name */ } /* Transmeta-defined flags: level 0x80860001 */ xlvl = cpuid_eax(0x80860000); - if ( (xlvl & 0xffff0000) == 0x80860000 ) { - if ( xlvl >= 0x80860001 ) + if ((xlvl & 0xffff0000) == 0x80860000) { + /* Don't set x86_cpuid_level here for now to not confuse. */ + if (xlvl >= 0x80860001) c->x86_capability[2] = cpuid_edx(0x80860001); } @@ -992,38 +998,43 @@ * At the end of this section, c->x86_capability better * indicate the features this CPU genuinely supports! */ - switch ( c->x86_vendor ) { - - case X86_VENDOR_AMD: - init_amd(c); - break; + switch (c->x86_vendor) { + case X86_VENDOR_AMD: + init_amd(c); + break; - case X86_VENDOR_INTEL: - init_intel(c); - break; + case X86_VENDOR_INTEL: + init_intel(c); + break; - case X86_VENDOR_UNKNOWN: - default: - display_cacheinfo(c); - break; + case X86_VENDOR_UNKNOWN: + default: + display_cacheinfo(c); + break; } select_idle_routine(c); detect_ht(c); - + /* * On SMP, boot_cpu_data holds the common feature set between * all CPUs; so make sure that we indicate which features are * common between the CPUs. The first time this routine gets * executed, c == &boot_cpu_data. */ - if ( c != &boot_cpu_data ) { + if (c != &boot_cpu_data) { /* AND the already accumulated flags with these */ - for ( i = 0 ; i < NCAPINTS ; i++ ) + for (i = 0 ; i < NCAPINTS ; i++) boot_cpu_data.x86_capability[i] &= c->x86_capability[i]; } +#ifdef CONFIG_X86_MCE mcheck_init(c); +#endif +#ifdef CONFIG_NUMA + if (c != &boot_cpu_data) + numa_add_cpu(c - cpu_data); +#endif } @@ -1065,7 +1076,7 @@ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "nx", NULL, "mmxext", NULL, - NULL, NULL, NULL, NULL, NULL, "lm", "3dnowext", "3dnow", + NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow", /* Transmeta-defined */ "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, @@ -1074,7 +1085,8 @@ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* Other (Linux-defined) */ - "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", NULL, NULL, NULL, NULL, + "cxmmx", NULL, "cyrix_arr", "centaur_mcr", NULL, + "constant_tsc", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1084,12 +1096,26 @@ "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + + /* VIA/Cyrix/Centaur-defined */ + NULL, NULL, "rng", "rng_en", NULL, NULL, "ace", "ace_en", + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + + /* AMD-defined (#2) */ + "lahf_lm", "cmp_legacy", NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; static char *x86_power_flags[] = { "ts", /* temperature sensor */ "fid", /* frequency id control */ "vid", /* voltage id control */ "ttp", /* thermal trip */ + "tm", + "stc" }; @@ -1123,10 +1149,14 @@ if (c->x86_cache_size >= 0) seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); -#ifdef CONFIG_X86_HT - if (cpu_has_ht) { - seq_printf(m, "physical id\t: %d\n", phys_proc_id[c - cpu_data]); - seq_printf(m, "siblings\t: %d\n", smp_num_siblings); +#ifdef CONFIG_SMP + if (smp_num_siblings * c->x86_num_cores > 1) { + int cpu = c - cpu_data; + seq_printf(m, "physical id\t: %d\n", phys_proc_id[cpu]); + seq_printf(m, "siblings\t: %d\n", + c->x86_num_cores * smp_num_siblings); + seq_printf(m, "core id\t\t: %d\n", cpu_core_id[cpu]); + seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores); } #endif @@ -1170,10 +1200,7 @@ } } - if (c->x86_num_cores > 1) - seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores); - - seq_printf(m, "\n\n"); + seq_printf(m, "\n\n"); return 0; } |
From: James S. <jsi...@us...> - 2005-06-20 23:54:34
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32711/ruby-2.6/arch/i386/kernel Modified Files: setup.c Log Message: Updated to 2.6.12 Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386/kernel/setup.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- setup.c 5 Apr 2005 18:26:36 -0000 1.13 +++ setup.c 20 Jun 2005 23:54:23 -0000 1.14 @@ -1501,11 +1501,13 @@ if (efi_enabled) efi_map_memmap(); +#ifdef CONFIG_ACPI_BOOT /* * Parse the ACPI tables for possible boot-time SMP configuration. */ acpi_boot_table_init(); acpi_boot_init(); +#endif #ifdef CONFIG_X86_LOCAL_APIC if (smp_found_config) |
From: James S. <jsi...@us...> - 2005-06-02 21:44:33
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7588 Modified Files: vt_ioctl.c Log Message: Test for a valid signal Index: vt_ioctl.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt_ioctl.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- vt_ioctl.c 5 Apr 2005 18:21:53 -0000 1.12 +++ vt_ioctl.c 2 Jun 2005 21:44:24 -0000 1.13 @@ -23,6 +23,7 @@ #include <linux/major.h> #include <linux/fs.h> #include <linux/console.h> +#include <linux/signal.h> #include <asm/io.h> #include <asm/uaccess.h> @@ -1055,7 +1056,7 @@ extern int spawnpid, spawnsig; if (!perm || !capable(CAP_KILL)) return -EPERM; - if (arg < 1 || arg > _NSIG || arg == SIGKILL) + if (!valid_signal(arg) || arg < 1 || arg == SIGKILL) return -EINVAL; spawnpid = current->pid; spawnsig = arg; |
From: Sebastian G. <sga...@ak...> - 2005-05-13 21:49:45
|
Hi everybody I have a multihead computer running Ubuntu GNU/Linux. It sometimes changes keyboard and mice assignment. I'm trying to configure hotplug, in order to assing physical devices to specific consoles, but I couldn't do it. I created /etc/hotplug/kbd.conf, /etc/hotplug/mouse.conf and /etc/hotplug/event.conf according my configuration. Then I restarted hotplug system, but no changes took effect. I have been looking on input.agent file, and it does not reference kbd.conf nor mouse.conf. I also compared it with the example included on the howto and is completly diferent. I think that I have to merge changes to my hotplug scripts. Did somebody try to merge changes to a debian or ubuntu input.agent file? Thanks Sebastian. |
From: James S. <jsi...@us...> - 2005-04-05 18:26:53
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21490 Modified Files: setup.c Log Message: Syned to linus tree. Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386/kernel/setup.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- setup.c 22 Oct 2004 07:46:16 -0000 1.12 +++ setup.c 5 Apr 2005 18:26:36 -0000 1.13 @@ -32,13 +32,14 @@ #include <linux/initrd.h> #include <linux/bootmem.h> #include <linux/seq_file.h> -#include <linux/console.h> +#include <linux/mca.h> #include <linux/root_dev.h> #include <linux/highmem.h> #include <linux/module.h> #include <linux/efi.h> #include <linux/init.h> #include <linux/edd.h> +#include <linux/nodemask.h> #include <video/edid.h> #include <asm/e820.h> #include <asm/mpspec.h> @@ -73,7 +74,6 @@ struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; unsigned long mmu_cr4_features; -EXPORT_SYMBOL_GPL(mmu_cr4_features); #ifdef CONFIG_ACPI_INTERPRETER int acpi_disabled = 0; @@ -87,7 +87,6 @@ extern acpi_interrupt_flags acpi_sci_flags; #endif -int MCA_bus; /* for MCA, but anyone else can use it if they want */ unsigned int machine_id; unsigned int machine_submodel_id; @@ -97,6 +96,9 @@ /* For PCI or other memory-mapped resources */ unsigned long pci_mem_start = 0x10000000; +/* Boot loader ID as an integer, for the benefit of proc_dointvec */ +int bootloader_type; + /* user-defined highmem size */ static unsigned int highmem_pages = -1; @@ -114,8 +116,6 @@ struct ist_info ist_info; struct e820map e820; -unsigned char aux_device_present; - extern void early_cpu_init(void); extern void dmi_scan_machine(void); extern void generic_apic_probe(char *); @@ -424,10 +424,10 @@ struct e820entry *pbios; /* pointer to original bios entry */ unsigned long long addr; /* address for this change point */ }; -struct change_member change_point_list[2*E820MAX] __initdata; -struct change_member *change_point[2*E820MAX] __initdata; -struct e820entry *overlap_list[E820MAX] __initdata; -struct e820entry new_bios[E820MAX] __initdata; +static struct change_member change_point_list[2*E820MAX] __initdata; +static struct change_member *change_point[2*E820MAX] __initdata; +static struct e820entry *overlap_list[E820MAX] __initdata; +static struct e820entry new_bios[E820MAX] __initdata; static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map) { @@ -672,6 +672,8 @@ saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; for (;;) { + if (c != ' ') + goto next_char; /* * "mem=nopentium" disables the 4MB page tables. * "mem=XXX[kKmM]" defines a memory region from HIGH_MEM @@ -682,7 +684,7 @@ * HPA tells me bootloaders need to parse mem=, so no new * option should be mem= [also see Documentation/i386/boot.txt] */ - if (c == ' ' && !memcmp(from, "mem=", 4)) { + if (!memcmp(from, "mem=", 4)) { if (to != command_line) to--; if (!memcmp(from+4, "nopentium", 9)) { @@ -704,7 +706,7 @@ } } - if (c == ' ' && !memcmp(from, "memmap=", 7)) { + else if (!memcmp(from, "memmap=", 7)) { if (to != command_line) to--; if (!memcmp(from+7, "exactmap", 8)) { @@ -737,6 +739,10 @@ } } + else if (!memcmp(from, "noexec=", 7)) + noexec_setup(from + 7); + + #ifdef CONFIG_X86_SMP /* * If the BIOS enumerates physical processors before logical, @@ -812,7 +818,7 @@ * This works even on boxes that have no highmem otherwise. * This also works to reduce highmem size on bigger boxes. */ - if (c == ' ' && !memcmp(from, "highmem=", 8)) + else if (!memcmp(from, "highmem=", 8)) highmem_pages = memparse(from+8, &from) >> PAGE_SHIFT; /* @@ -820,9 +826,10 @@ * bytes. This can be used to increase (or decrease) the * vmalloc area - the default is 128m. */ - if (c == ' ' && !memcmp(from, "vmalloc=", 8)) + else if (!memcmp(from, "vmalloc=", 8)) __VMALLOC_RESERVE = memparse(from+8, &from); + next_char: c = *(from++); if (!c) break; @@ -941,8 +948,6 @@ return max_low_pfn; } -#ifndef CONFIG_DISCONTIGMEM - /* * Free all available memory for boot time allocation. Used * as a callback function by efi_memory_walk() @@ -1016,15 +1021,15 @@ reserve_bootmem(addr, PAGE_SIZE); } +#ifndef CONFIG_DISCONTIGMEM +void __init setup_bootmem_allocator(void); static unsigned long __init setup_memory(void) { - unsigned long bootmap_size, start_pfn, max_low_pfn; - /* * partially used pages are not usable - thus * we are rounding upwards: */ - start_pfn = PFN_UP(init_pg_tables_end); + min_low_pfn = PFN_UP(init_pg_tables_end); find_max_pfn(); @@ -1040,10 +1045,43 @@ #endif printk(KERN_NOTICE "%ldMB LOWMEM available.\n", pages_to_mb(max_low_pfn)); + + setup_bootmem_allocator(); + + return max_low_pfn; +} + +void __init zone_sizes_init(void) +{ + unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; + unsigned int max_dma, low; + + max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; + low = max_low_pfn; + + if (low < max_dma) + zones_size[ZONE_DMA] = low; + else { + zones_size[ZONE_DMA] = max_dma; + zones_size[ZONE_NORMAL] = low - max_dma; +#ifdef CONFIG_HIGHMEM + zones_size[ZONE_HIGHMEM] = highend_pfn - low; +#endif + } + free_area_init(zones_size); +} +#else +extern unsigned long setup_memory(void); +extern void zone_sizes_init(void); +#endif /* !CONFIG_DISCONTIGMEM */ + +void __init setup_bootmem_allocator(void) +{ + unsigned long bootmap_size; /* * Initialize the boot-time allocator (with low memory only): */ - bootmap_size = init_bootmem(start_pfn, max_low_pfn); + bootmap_size = init_bootmem(min_low_pfn, max_low_pfn); register_bootmem_low_pages(max_low_pfn); @@ -1053,7 +1091,7 @@ * the (very unlikely) case of us accidentally initializing the * bootmem allocator with an invalid RAM area. */ - reserve_bootmem(HIGH_MEMORY, (PFN_PHYS(start_pfn) + + reserve_bootmem(HIGH_MEMORY, (PFN_PHYS(min_low_pfn) + bootmap_size + PAGE_SIZE-1) - (HIGH_MEMORY)); /* @@ -1110,11 +1148,25 @@ } } #endif - return max_low_pfn; } -#else -extern unsigned long setup_memory(void); -#endif /* !CONFIG_DISCONTIGMEM */ + +/* + * The node 0 pgdat is initialized before all of these because + * it's needed for bootmem. node>0 pgdats have their virtual + * space allocated before the pagetables are in place to access + * them, so they can't be cleared then. + * + * This should all compile down to nothing when NUMA is off. + */ +void __init remapped_pgdat_init(void) +{ + int nid; + + for_each_online_node(nid) { + if (nid != 0) + memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); + } +} /* * Request address space for all standard RAM and ROM resources @@ -1156,9 +1208,10 @@ /* * Request address space for all standard resources */ -static void __init register_memory(unsigned long max_low_pfn) +static void __init register_memory(void) { - unsigned long low_mem_size; + unsigned long gapstart, gapsize; + unsigned long long last; int i; if (efi_enabled) @@ -1173,10 +1226,46 @@ for (i = 0; i < STANDARD_IO_RESOURCES; i++) request_resource(&ioport_resource, &standard_io_resources[i]); - /* Tell the PCI layer not to allocate too close to the RAM area.. */ - low_mem_size = ((max_low_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff; - if (low_mem_size > pci_mem_start) - pci_mem_start = low_mem_size; + /* + * Search for the bigest gap in the low 32 bits of the e820 + * memory space. + */ + last = 0x100000000ull; + gapstart = 0x10000000; + gapsize = 0x400000; + i = e820.nr_map; + while (--i >= 0) { + unsigned long long start = e820.map[i].addr; + unsigned long long end = start + e820.map[i].size; + + /* + * Since "last" is at most 4GB, we know we'll + * fit in 32 bits if this condition is true + */ + if (last > end) { + unsigned long gap = last - end; + + if (gap > gapsize) { + gapsize = gap; + gapstart = end; + } + } + if (start < last) + last = start; + } + + /* + * Start allocating dynamic PCI memory a bit into the gap, + * aligned up to the nearest megabyte. + * + * Question: should we try to pad it up a bit (do something + * like " + (gapsize >> 3)" in there too?). We now have the + * technology. + */ + pci_mem_start = (gapstart + 0xfffff) & ~0xfffff; + + printk("Allocating PCI resources starting at %08lx (gap: %08lx:%08lx)\n", + pci_mem_start, gapstart, gapsize); } /* Use inline assembly to define this because the nops are defined @@ -1288,6 +1377,15 @@ static char * __init machine_specific_memory_setup(void); +#ifdef CONFIG_MCA +static void set_mca_bus(int x) +{ + MCA_bus = x; +} +#else +static void set_mca_bus(int x) { } +#endif + /* * Determine if we were loaded by an EFI loader. If so, then we have also been * passed the efi memmap, systab, etc., so we should use these data structures @@ -1323,12 +1421,12 @@ ist_info = IST_INFO; saved_videomode = VIDEO_MODE; if( SYS_DESC_TABLE.length != 0 ) { - MCA_bus = SYS_DESC_TABLE.table[3] &0x2; + set_mca_bus(SYS_DESC_TABLE.table[3] & 0x2); machine_id = SYS_DESC_TABLE.table[0]; machine_submodel_id = SYS_DESC_TABLE.table[1]; BIOS_revision = SYS_DESC_TABLE.table[2]; } - aux_device_present = AUX_DEVICE_INFO; + bootloader_type = LOADER_TYPE; #ifdef CONFIG_BLK_DEV_RAM rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; @@ -1375,6 +1473,8 @@ smp_alloc_memory(); /* AP processor realmode stacks in low memory*/ #endif paging_init(); + remapped_pgdat_init(); + zone_sizes_init(); /* * NOTE: at this point the bootmem allocator is fully available. @@ -1404,6 +1504,7 @@ /* * Parse the ACPI tables for possible boot-time SMP configuration. */ + acpi_boot_table_init(); acpi_boot_init(); #ifdef CONFIG_X86_LOCAL_APIC @@ -1411,7 +1512,7 @@ get_smp_config(); #endif - register_memory(max_low_pfn); + register_memory(); } #include "setup_arch_post.h" |
From: James S. <jsi...@us...> - 2005-04-05 18:24:22
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20800 Modified Files: Kconfig Log Message: Kconfig is now synced. Index: Kconfig =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Kconfig,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Kconfig 22 Oct 2004 07:46:16 -0000 1.11 +++ Kconfig 5 Apr 2005 18:24:13 -0000 1.12 @@ -66,7 +66,7 @@ config HW_CONSOLE bool - depends on VT && !S390 && !USERMODE + depends on VT && !S390 && !UML default y config SERIAL_NONSTANDARD @@ -155,26 +155,9 @@ you have a card like this, say Y here and read the file <file:Documentation/digiepca.txt>. - NOTE: There is another, separate driver for the Digiboard PC boards: - "Digiboard PC/Xx Support" below. You should (and can) only select - one of the two drivers. - To compile this driver as a module, choose M here: the module will be called epca. -config DIGI - tristate "Digiboard PC/Xx Support" - depends on SERIAL_NONSTANDARD && DIGIEPCA=n && BROKEN_ON_SMP - help - This is a driver for the Digiboard PC/Xe, PC/Xi, and PC/Xeve cards - that give you many serial ports. You would need something like this - to connect more than two modems to your Linux box, for instance in - order to become a dial-in server. If you have a card like that, say - Y here and read the file <file:Documentation/digiboard.txt>. - - To compile this driver as a module, choose M here: the - module will be called pcxx. - config ESPSERIAL tristate "Hayes ESP serial port support" depends on SERIAL_NONSTANDARD && ISA && BROKEN_ON_SMP @@ -199,7 +182,7 @@ config MOXA_SMARTIO tristate "Moxa SmartIO support" - depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP + depends on SERIAL_NONSTANDARD help Say Y here if you have a Moxa SmartIO multiport serial card. @@ -210,7 +193,7 @@ config ISI tristate "Multi-Tech multiport card support (EXPERIMENTAL)" - depends on SERIAL_NONSTANDARD && PCI && EXPERIMENTAL && BROKEN_ON_SMP && m + depends on SERIAL_NONSTANDARD help This is a driver for the Multi-Tech cards which provide several serial ports. The driver is experimental and can currently only be @@ -271,7 +254,7 @@ config SPECIALIX tristate "Specialix IO8+ card support" - depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP + depends on SERIAL_NONSTANDARD help This is a driver for the Specialix IO8+ multiport card (both the ISA and the PCI version) which gives you many serial ports. You @@ -355,22 +338,6 @@ To compile this driver as a module, choose M here: the module will be called istallion. -config SERIAL_TX3912 - bool "TX3912/PR31700 serial port support" - depends on SERIAL_NONSTANDARD && MIPS && BROKEN_ON_SMP - help - The TX3912 is a Toshiba RISC processor based o the MIPS 3900 core; - see <http://www.toshiba.com/taec/components/Generic/risc/tx3912.htm>. - Say Y here to enable kernel support for the on-board serial port. - -config SERIAL_TX3912_CONSOLE - bool "Console on TX3912/PR31700 serial port" - depends on SERIAL_TX3912 - help - The TX3912 is a Toshiba RISC processor based o the MIPS 3900 core; - see <http://www.toshiba.com/taec/components/Generic/risc/tx3912.htm>. - Say Y here to direct console I/O to the on-board serial port. - config AU1000_UART bool "Enable Au1000 UART Support" depends on SERIAL_NONSTANDARD && MIPS @@ -485,6 +452,7 @@ config LEGACY_PTY_COUNT int "Maximum number of legacy PTY in use" depends on LEGACY_PTYS + range 1 256 default "256" ---help--- The maximum number of legacy PTYs that can be used at any one time. @@ -787,6 +755,27 @@ bool "EFI Real Time Clock Services" depends on IA64 +config DS1302 + tristate "DS1302 RTC support" + depends on M32R && (PLAT_M32700UT || PLAT_OPSPUT) + help + If you say Y here and create a character special file /dev/rtc with + major number 121 and minor number 0 using mknod ("man mknod"), you + will get access to the real time clock (or hardware clock) built + into your computer. + +config S3C2410_RTC + bool "S3C2410 RTC Driver" + depends on ARCH_S3C2410 + help + RTC (Realtime Clock) driver for the clock inbuilt into the + Samsung S3C2410. This can provide periodic interrupt rates + from 1Hz to 64Hz for user programs, and wakeup from Alarm. + +config RTC_VR41XX + tristate "NEC VR4100 series Real Time Clock Support" + depends on CPU_VR41XX + config COBALT_LCD bool "Support for Cobalt LCD" depends on MIPS_COBALT @@ -833,7 +822,7 @@ config SONYPI tristate "Sony Vaio Programmable I/O Control Device support (EXPERIMENTAL)" - depends on EXPERIMENTAL && X86 && PCI && !64BIT + depends on EXPERIMENTAL && X86 && PCI && INPUT && !64BIT ---help--- This driver enables access to the Sony Programmable I/O Control Device which can be found in many (all ?) Sony Vaio laptops. @@ -844,6 +833,10 @@ To compile this driver as a module, choose M here: the module will be called sonypi. +config TANBAC_TB0219 + tristate "TANBAC TB0219 base board support" + depends TANBAC_TB0229 + menu "Ftape, the floppy tape device driver" @@ -996,5 +989,7 @@ The mmtimer device allows direct userspace access to the Altix system timer. +source "drivers/char/tpm/Kconfig" + endmenu |
From: James S. <jsi...@us...> - 2005-04-05 18:23:31
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20608 Modified Files: Makefile Log Message: More syncing Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile 22 Oct 2004 07:46:16 -0000 1.12 +++ Makefile 5 Apr 2005 18:23:22 -0000 1.13 @@ -12,21 +12,19 @@ obj-$(CONFIG_LEGACY_PTYS) += pty.o obj-$(CONFIG_UNIX98_PTYS) += pty.o obj-y += misc.o -obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o \ - consolemap_deftbl.o selection.o keyboard.o vt_proc.o vt_sysfs.o decvte.o +obj-$(CONFIG_VT) += vt_ioctl.o decvte.o vc_screen.o consolemap.o \ + consolemap_deftbl.o selection.o keyboard.o vt_proc.o vt_sysfs.o obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o obj-$(CONFIG_ESPSERIAL) += esp.o obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.o obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o -obj-$(CONFIG_SERIAL_TX3912) += generic_serial.o serial_tx3912.o obj-$(CONFIG_ROCKETPORT) += rocket.o obj-$(CONFIG_SERIAL167) += serial167.o obj-$(CONFIG_CYCLADES) += cyclades.o obj-$(CONFIG_STALLION) += stallion.o obj-$(CONFIG_ISTALLION) += istallion.o -obj-$(CONFIG_DIGI) += pcxx.o obj-$(CONFIG_DIGIEPCA) += epca.o obj-$(CONFIG_SPECIALIX) += specialix.o obj-$(CONFIG_MOXA_INTELLIO) += moxa.o @@ -63,6 +61,9 @@ obj-$(CONFIG_EFI_RTC) += efirtc.o obj-$(CONFIG_SGI_DS1286) += ds1286.o obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o +obj-$(CONFIG_DS1302) += ds1302.o +obj-$(CONFIG_S3C2410_RTC) += s3c2410-rtc.o +obj-$(CONFIG_RTC_VR41XX) += vr41xx_rtc.o ifeq ($(CONFIG_GENERIC_NVRAM),y) obj-$(CONFIG_NVRAM) += generic_nvram.o else @@ -72,13 +73,13 @@ obj-$(CONFIG_I8K) += i8k.o obj-$(CONFIG_DS1620) += ds1620.o obj-$(CONFIG_HW_RANDOM) += hw_random.o -obj-$(CONFIG_QIC02_TAPE) += tpqic02.o obj-$(CONFIG_FTAPE) += ftape/ obj-$(CONFIG_COBALT_LCD) += lcd.o obj-$(CONFIG_PPDEV) += ppdev.o obj-$(CONFIG_NWBUTTON) += nwbutton.o obj-$(CONFIG_NWFLASH) += nwflash.o obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o +obj-$(CONFIG_TANBAC_TB0219) += tb0219.o obj-$(CONFIG_WATCHDOG) += watchdog/ obj-$(CONFIG_MWAVE) += mwave/ @@ -88,7 +89,7 @@ obj-$(CONFIG_IPMI_HANDLER) += ipmi/ obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o - +obj-$(CONFIG_TCG_TPM) += tpm/ # Files generated that shall be removed upon make clean clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c |
From: James S. <jsi...@us...> - 2005-04-05 18:22:02
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20219 Modified Files: keyboard.c vt_ioctl.c Log Message: White space syncing to linus tree. Index: keyboard.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/keyboard.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- keyboard.c 5 Apr 2005 17:54:59 -0000 1.16 +++ keyboard.c 5 Apr 2005 18:21:53 -0000 1.17 @@ -976,9 +976,8 @@ } #endif -static void kbd_rawcode(struct vt_struct *vt, unsigned char data) +static void kbd_rawcode(struct vc_data *vc, unsigned char data) { - struct vc_data *vc = vt->fg_console; if (vc->kbd_table.kbdmode == VC_RAW) put_queue(vc, data); } @@ -1117,7 +1116,7 @@ if (!vt) return; if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev)) - kbd_rawcode(vt, value); + kbd_rawcode(vt->fg_console, value); if (event_type == EV_KEY) kbd_keycode(vt, event_code, value, HW_RAW(handle->dev)); tasklet_schedule(&keyboard_tasklet); @@ -1167,7 +1166,7 @@ * have one. */ if (i != BTN_MISC) { - list_for_each_entry (vt, &vt_list, node) { + list_for_each_entry(vt, &vt_list, node) { if (!vt->keyboard) { vt->keyboard = handle; handle->private = vt; Index: vt_ioctl.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt_ioctl.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- vt_ioctl.c 5 Apr 2005 17:24:29 -0000 1.11 +++ vt_ioctl.c 5 Apr 2005 18:21:53 -0000 1.12 @@ -349,17 +349,16 @@ goto out; c = (font.width+7)/8 * 32 * font.charcount; - + if (op->data && font.charcount > op->charcount) rc = -ENOSPC; if (!(op->flags & KD_FONT_FLAG_OLD)) { - if (font.width > op->width || font.height > op->height) + if (font.width > op->width || font.height > op->height) rc = -ENOSPC; } else { if (font.width != 8) rc = -EIO; - else if ((op->height && font.height > op->height) || - font.height > 32) + else if ((op->height && font.height > op->height) || font.height > 32) rc = -ENOSPC; } if (rc) @@ -393,7 +392,7 @@ int h, i; u8 __user *charmap = op->data; u8 tmp; - + /* If from KDFONTOP ioctl, don't allow things which can be done in userland, so that we can get rid of this soon */ if (!(op->flags & KD_FONT_FLAG_OLD)) @@ -406,7 +405,7 @@ goto nonzero; } return -EINVAL; - nonzero: +nonzero: op->height = h; } if (op->width <= 0 || op->width > 32 || op->height > 32) @@ -547,7 +546,7 @@ if (copy_from_user(&tmp, user_ud, sizeof tmp)) return -EFAULT; if (tmp.entries) - if (!access_ok(VERIFY_WRITE, tmp.entries, + if (!access_ok(VERIFY_WRITE, tmp.entries, tmp.entry_ct*sizeof(struct unipair))) return -EFAULT; switch (cmd) { @@ -778,8 +777,8 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) { - struct vc_data *vc = (struct vc_data *)tty->driver_data; - void __user *up = (void __user *)arg; + struct vc_data *vc = (struct vc_data *) tty->driver_data; + void __user *up = (void __user *) arg; struct console_font_op op; /* used in multiple places */ unsigned char ucval; int i, perm; @@ -877,9 +876,9 @@ * currently, setting the mode from KD_TEXT to KD_GRAPHICS * doesn't do a whole lot. i'm not sure if it should do any * restoration of modes or what... - * - * XXX It should at least call into the driver, fbdev's definitely - * need to restore their engine state. --BenH + * + * XXX It should at least call into the driver, fbdev's definitely + * need to restore their engine state. --BenH */ if (!perm) return -EPERM; @@ -971,7 +970,7 @@ case KDGKBMETA: ucval = (get_kbd_mode(&vc->kbd_table, VC_META) ? K_ESCPREFIX : K_METABIT); setint: - return put_user(ucval, (int __user *)arg); + return put_user(ucval, (int __user *) arg); case KDGETKEYCODE: case KDSETKEYCODE: @@ -1079,7 +1078,7 @@ vc->vt_mode.frsig = 0; vc->vt_pid = current->pid; /* no switch is required -- sa...@sh... */ - vc->vt_newvt = -1; + vc->vt_newvt = -1; release_console_sem(); return 0; } @@ -1209,7 +1208,7 @@ struct vc_data *tmp = find_vc(vc->vt_newvt); acquire_console_sem(); - if (!tmp) { + if (!tmp) { tmp = vc_allocate(vc->vt_newvt); if (!tmp) { i = vc->vt_newvt; |
From: James S. <jsi...@us...> - 2005-04-05 17:55:10
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12641 Modified Files: keyboard.c Log Message: Synced to Linus tree. Index: keyboard.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/keyboard.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- keyboard.c 22 Oct 2004 07:46:16 -0000 1.15 +++ keyboard.c 5 Apr 2005 17:54:59 -0000 1.16 @@ -31,7 +31,6 @@ #include <linux/tty_flip.h> #include <linux/mm.h> #include <linux/string.h> -#include <linux/random.h> #include <linux/init.h> #include <linux/slab.h> @@ -87,6 +86,7 @@ /* * Variables exported for vt.c */ + int shift_state = 0; /* @@ -110,7 +110,7 @@ /* Simple translation table for the SysRq keys */ #ifdef CONFIG_MAGIC_SYSRQ -unsigned char kbd_sysrq_xlate[KEY_MAX] = +unsigned char kbd_sysrq_xlate[KEY_MAX + 1] = "\000\0331234567890-=\177\t" /* 0x00 - 0x0f */ "qwertyuiop[]\r\000as" /* 0x10 - 0x1f */ "dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */ @@ -133,7 +133,7 @@ if (!dev) return -ENODEV; - if (!dev->keycodesize || (scancode < 0 || scancode >= dev->keycodemax)) + if (!dev->keycodesize || scancode >= dev->keycodemax) return -EINVAL; return INPUT_KEYCODE(dev, scancode); @@ -147,25 +147,24 @@ if (!dev) return -ENODEV; - if (!dev->keycodesize || (scancode < 0 || scancode >= dev->keycodemax)) + if (!dev->keycodesize || scancode >= dev->keycodemax || keycode > KEY_MAX) return -EINVAL; - oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode); - - clear_bit(oldkey, dev->keybit); - set_bit(keycode, dev->keybit); + oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode); - for (i = 0; i < dev->keycodemax; i++) - if (INPUT_KEYCODE(dev,i) == oldkey) - set_bit(oldkey, dev->keybit); + clear_bit(oldkey, dev->keybit); + set_bit(keycode, dev->keybit); + for (i = 0; i < dev->keycodemax; i++) + if (INPUT_KEYCODE(dev,i) == oldkey) + set_bit(oldkey, dev->keybit); return 0; } /* * Making beeps and bells. */ -void kd_nosound(unsigned long private) +static void kd_nosound(unsigned long private) { struct input_handle *handle = (struct input_handle *) private; @@ -205,6 +204,7 @@ /* * Setting the keyboard rate. */ + int kbd_rate(struct input_handle *handle, struct kbd_repeat *rep) { struct input_dev *dev = handle->dev; @@ -236,7 +236,7 @@ } } -void puts_queue(struct vc_data *vc, char *cp) +static void puts_queue(struct vc_data *vc, char *cp) { struct tty_struct *tty = vc->vc_tty; @@ -266,7 +266,7 @@ * in utf-8 already. UTF-8 is defined for words of up to 31 bits, * but we need only 16 bits here */ -void to_utf8(struct vc_data *vc, ushort c) +static void to_utf8(struct vc_data *vc, ushort c) { if (c < 0x80) /* 0******* */ @@ -290,7 +290,7 @@ */ void compute_shiftstate(void) { - int i, j, k, sym, val; + unsigned int i, j, k, sym, val; shift_state = 0; memset(shift_down, 0, sizeof(shift_down)); @@ -328,10 +328,10 @@ * Otherwise, conclude that DIACR was not combining after all, * queue it and return CH. */ -unsigned char handle_diacr(struct vc_data *vc, unsigned char ch) +static unsigned char handle_diacr(struct vc_data *vc, unsigned char ch) { + unsigned int i; int d = diacr; - int i; diacr = 0; @@ -599,7 +599,7 @@ static void k_fn(struct vc_data *vc, unsigned char value, char up_flag) { - unsigned v; + unsigned v; if (up_flag) return; @@ -835,9 +835,9 @@ * Aside from timing (which isn't really that important for * keyboard interrupts as they happen often), using the software * interrupt routines for this thing allows us to easily mask - * this when we don't want any of the above to happen. Not yet - * used, but this allows for easy and efficient race-condition - * prevention later on. + * this when we don't want any of the above to happen. + * This allows for easy and efficient race-condition prevention + * for kbd_refresh_leds => input_event(dev, EV_LED, ...) => ... */ static void kbd_bh(unsigned long dummy) @@ -868,7 +868,7 @@ /* * This allows a newly plugged keyboard to pick the LED state. */ -void kbd_refresh_leds(struct input_handle *handle) +static void kbd_refresh_leds(struct input_handle *handle) { struct vt_struct *vt = handle->private; unsigned char leds; @@ -887,8 +887,11 @@ tasklet_enable(&keyboard_tasklet); } } - -#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) + +#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\ + defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) ||\ + defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\ + (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC)) #define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001)) @@ -925,18 +928,18 @@ if (keycode > 255 || !x86_keycodes[keycode]) return -1; - switch (keycode) { - case KEY_PAUSE: - put_queue(vc, 0xe1); - put_queue(vc, 0x1d | up_flag); - put_queue(vc, 0x45 | up_flag); - return 0; + switch (keycode) { + case KEY_PAUSE: + put_queue(vc, 0xe1); + put_queue(vc, 0x1d | up_flag); + put_queue(vc, 0x45 | up_flag); + return 0; case KEY_HANGUEL: - if (!up_flag) put_queue(vc, 0xf1); - return 0; + if (!up_flag) put_queue(vc, 0xf1); + return 0; case KEY_HANJA: - if (!up_flag) put_queue(vc, 0xf2); - return 0; + if (!up_flag) put_queue(vc, 0xf2); + return 0; } if (keycode == KEY_SYSRQ && sysrq_alt) { @@ -973,7 +976,7 @@ } #endif -void kbd_rawcode(struct vt_struct *vt, unsigned char data) +static void kbd_rawcode(struct vt_struct *vt, unsigned char data) { struct vc_data *vc = vt->fg_console; if (vc->kbd_table.kbdmode == VC_RAW) @@ -988,9 +991,6 @@ struct tty_struct *tty; int shift_final; - if (down != 2) - add_keyboard_randomness((keycode << 1) ^ down); - tty = vc->vc_tty; if (tty && (!tty->driver_data)) { @@ -1008,8 +1008,8 @@ rep = (down == 2); #ifdef CONFIG_MAC_EMUMOUSEBTN - if (mac_hid_mouse_emulate_buttons(1, keycode, down)) - return; + if (mac_hid_mouse_emulate_buttons(1, keycode, down)) + return; #endif /* CONFIG_MAC_EMUMOUSEBTN */ if ((raw_mode = (vc->kbd_table.kbdmode == VC_RAW)) && !hw_raw) @@ -1137,7 +1137,7 @@ struct input_dev *dev, struct input_device_id *id) { - struct vt_struct *vt; + struct vt_struct *vt = NULL; struct input_handle *handle; int i; @@ -1150,42 +1150,43 @@ if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL))) return NULL; memset(handle, 0, sizeof(struct input_handle)); + handle->dev = dev; handle->handler = handler; handle->name = kbd_name; input_open_device(handle); + /* - * If we have more keyboards than VTs we still register the handler - * . It is possible someone might add a graphics card thus needing the + * If we have more keyboards than VTs we still register the handler. + * It is possible someone might add a graphics card thus needing the * keyboard later. - * Now in some cases the speaker is built into the - * keyboard. In this case the handler in struct vt_struct is the - * same for both the keyboard and beeper. Now in the case where the + * Now in some cases the speaker is built into the keyboard. + * In this case the handler in struct vt_struct is the same for + * both the keyboard and beeper. Now in the case where the * beeper is independent we can share it with all VTs that don't * have one. */ if (i != BTN_MISC) { - list_for_each_entry (vt, &vt_list, node) { - if (!vt->keyboard) { - vt->keyboard = handle; - handle->private = vt; - printk(KERN_INFO "keyboard.c: [%s] vc:%d-%d\n", - dev->name, vt->first_vc + 1, - vt->first_vc + vt->vc_count); - if(test_bit(EV_SND, dev->evbit)) { + list_for_each_entry (vt, &vt_list, node) { + if (!vt->keyboard) { + vt->keyboard = handle; + handle->private = vt; + printk(KERN_INFO "keyboard.c: [%s] vc:%d-%d\n", + 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); } break; - } - } + } + } kbd_refresh_leds(handle); - } - else if (test_bit(EV_SND, dev->evbit) && admin_vt && !admin_vt->beeper) { + } else if (test_bit(EV_SND, dev->evbit) && admin_vt && !admin_vt->beeper) { admin_vt->beeper = handle; handle->private = admin_vt; vt_map_input(admin_vt); - } + } return handle; } |
From: James S. <jsi...@us...> - 2005-04-05 17:24:39
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3023 Modified Files: vt_ioctl.c Log Message: Updated to latest linus tree. Index: vt_ioctl.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt_ioctl.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- vt_ioctl.c 22 Oct 2004 07:46:16 -0000 1.10 +++ vt_ioctl.c 5 Apr 2005 17:24:29 -0000 1.11 @@ -2,7 +2,7 @@ * linux/drivers/char/vt_ioctl.c * * Copyright (C) 1992 obz under the linux copyright - * 2002 James Simmons <jsi...@us...> + * 2004 James Simmons <jsi...@us...> * * Dynamic diacritical handling - ae...@cw... - Dec 1993 * Dynamic keymap and string allocation - ae...@cw... - May 1994 @@ -33,7 +33,7 @@ #include <linux/font.h> #define VT_IS_IN_USE(vc)(vc->vc_tty && vc->vc_tty->count) -#define VT_BUSY(vc) (VT_IS_IN_USE(vc) || IS_VISIBLE || vc->vc_num == sel_cons) +#define VT_BUSY(vc) (VT_IS_IN_USE(vc) || IS_VISIBLE || vc == sel_cons) /* * Console (vt and kd) routines, as defined by USL SVR4 manual, and by @@ -48,11 +48,6 @@ * to the current console is done by the main ioctl code. */ -/* Keyboard type: Default is KB_101, but can be set by machine - * specific code. - */ -unsigned char keyboard_type = KB_101; - #ifdef CONFIG_X86 #include <linux/syscalls.h> #endif @@ -105,7 +100,6 @@ static inline int do_kdsk_ioctl(struct vc_data *vc, int cmd, struct kbentry __user *user_kbe, int perm) { - struct kbd_struct *kbd = &vc->kbd_table; ushort *key_map, val, ov; struct kbentry tmp; @@ -117,7 +111,7 @@ key_map = key_maps[s]; if (key_map) { val = U(key_map[i]); - if (kbd->kbdmode != VC_UNICODE && KTYP(val) >= NR_TYPES) + if (vc->kbd_table.kbdmode != VC_UNICODE && KTYP(val) >= NR_TYPES) val = K_HOLE; } else val = (i ? K_HOLE : K_NOSUCHMAP); @@ -141,7 +135,7 @@ if (KTYP(v) < NR_TYPES) { if (KVAL(v) > max_vals[KTYP(v)]) return -EINVAL; - } else if (kbd->kbdmode != VC_UNICODE) + } else if (vc->kbd_table.kbdmode != VC_UNICODE) return -EINVAL; /* ++Geert: non-PC keyboards may generate keycode zero */ @@ -215,8 +209,8 @@ char *first_free, *fj, *fnw, *p; int i, j, k, delta, sz, ret; struct kbsentry *kbs; - u_char *q; u_char __user *up; + u_char *q; kbs = kmalloc(sizeof(*kbs), GFP_KERNEL); if (!kbs) { @@ -332,8 +326,7 @@ int con_font_get(struct vc_data *vc, struct console_font_op *op) { struct console_font font; - int rc = -EINVAL; - int c; + int c, rc = -EINVAL; if (vc->vc_mode != KD_TEXT) return -EINVAL; @@ -372,6 +365,10 @@ if (rc) goto out; + op->height = font.height; + op->width = font.width; + op->charcount = font.charcount; + if (op->data && copy_to_user(op->data, font.data, c)) rc = -EFAULT; @@ -546,21 +543,21 @@ do_unimap_ioctl(struct vc_data *vc, int cmd, struct unimapdesc __user *user_ud, int perm) { struct unimapdesc tmp; - int i = 0; if (copy_from_user(&tmp, user_ud, sizeof tmp)) return -EFAULT; - if (tmp.entries) { - i = verify_area(VERIFY_WRITE, tmp.entries, - tmp.entry_ct*sizeof(struct unipair)); - if (i) return i; - } + if (tmp.entries) + if (!access_ok(VERIFY_WRITE, tmp.entries, + tmp.entry_ct*sizeof(struct unipair))) + return -EFAULT; switch (cmd) { case PIO_UNIMAP: if (!perm) return -EPERM; return con_set_unimap(vc, tmp.entry_ct, tmp.entries); case GIO_UNIMAP: + if (!perm && !IS_VISIBLE) + return -EPERM; return con_get_unimap(vc, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries); } return 0; @@ -575,6 +572,8 @@ int red[16], green[16], blue[16]; int i, j, k; + WARN_CONSOLE_UNLOCKED(); + for (i = 0; i < 16; i++) { get_user(red[i], arg++); get_user(green[i], arg++); @@ -615,8 +614,7 @@ hide_cursor(old_vc); if (old_vc != new_vc) { int update; - int old_was_color = old_vc->vc_can_do_color; - + new_vc->display_fg->fg_console = new_vc; save_screen(old_vc); set_origin(old_vc); @@ -624,16 +622,6 @@ set_origin(new_vc); update = new_vc->display_fg->vt_sw->con_switch(new_vc); set_palette(new_vc); - /* - * If console changed from mono<->color, the best we can do - * is to clear the buffer attributes. As it currently stands, - * rebuilding new attributes from the old buffer is not doable - * without overly complex code. - */ - if (old_was_color != new_vc->vc_can_do_color) { - update_attr(new_vc); - clear_buffer_attributes(new_vc); - } if (update && new_vc->vc_mode != KD_GRAPHICS) do_update_region(new_vc, new_vc->vc_origin, new_vc->vc_screenbuf_size/2); @@ -735,10 +723,12 @@ * controlling process is gone and we've called reset_vc. */ if (old_vc_mode != new_vc->vc_mode) { + acquire_console_sem(); if (new_vc->vc_mode == KD_TEXT) unblank_vt(new_vc->display_fg); else do_blank_screen(new_vc->display_fg, 1); + release_console_sem(); } /* @@ -789,9 +779,9 @@ unsigned int cmd, unsigned long arg) { struct vc_data *vc = (struct vc_data *)tty->driver_data; + void __user *up = (void __user *)arg; struct console_font_op op; /* used in multiple places */ unsigned char ucval; - void __user *up = (void __user *)arg; int i, perm; if (!vc) /* impossible? */ @@ -836,16 +826,16 @@ /* * this is naive. */ - ucval = keyboard_type; + ucval = KB_101; goto setchar; -#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips__) && !defined(__arm__) && !defined(__sh__) /* * These cannot be implemented on any machine that implements * ioperm() in user level (such as Alpha PCs) or not at all. * - * XXX: you should never use them, just call ioperm directly.. + * XXX: you should never use these, just call ioperm directly.. */ +#ifdef CONFIG_X86 case KDADDIO: case KDDELIO: /* @@ -999,7 +989,7 @@ case KDGKBDIACR: { - struct kbdiacrs *a = up; + struct kbdiacrs __user *a = up; if (put_user(accent_table_size, &a->kb_cnt)) return -EFAULT; @@ -1097,14 +1087,11 @@ case VT_GETMODE: { struct vt_mode tmp; - int rc; acquire_console_sem(); - memcpy(&tmp, &(vc->vt_mode), sizeof(struct vt_mode)); + memcpy(&tmp, &vc->vt_mode, sizeof(struct vt_mode)); release_console_sem(); - - rc = copy_to_user(up, &tmp, sizeof(struct vt_mode)); - return rc ? -EFAULT : 0; + return copy_to_user(up, &tmp, sizeof(struct vt_mode)) ? -EFAULT : 0; } /* @@ -1114,7 +1101,7 @@ */ case VT_GETSTATE: { - struct vt_stat *vtstat = up; + struct vt_stat __user *vtstat = up; unsigned short mask, state = 0; struct vc_data *tmp; @@ -1301,12 +1288,12 @@ case VT_RESIZEX: { - struct vt_consize *vtconsize = up; + struct vt_consize __user *vtconsize = up; ushort ll,cc,vlin,clin,vcol,ccol; if (!perm) return -EPERM; - if (verify_area(VERIFY_READ, vtconsize, + if (!access_ok(VERIFY_READ, vtconsize, sizeof(struct vt_consize))) return -EFAULT; __get_user(ll, &vtconsize->v_rows); |
From: James S. <jsi...@us...> - 2005-03-30 03:23:23
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1059 Modified Files: tty_io.c Log Message: Synced to linus tree Index: tty_io.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/tty_io.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- tty_io.c 22 Oct 2004 07:46:16 -0000 1.13 +++ tty_io.c 30 Mar 2005 03:23:03 -0000 1.14 @@ -81,7 +81,6 @@ #include <linux/console.h> #include <linux/timer.h> #include <linux/ctype.h> -#include <linux/kd.h> #include <linux/mm.h> #include <linux/string.h> #include <linux/slab.h> @@ -93,14 +92,12 @@ #include <linux/device.h> #include <linux/idr.h> #include <linux/wait.h> +#include <linux/bitops.h> #include <asm/uaccess.h> #include <asm/system.h> -#include <asm/bitops.h> -#include <linux/kbd_kern.h> #include <linux/vt_kern.h> -#include <linux/selection.h> #include <linux/devfs_fs_kernel.h> #include <linux/kmod.h> @@ -136,6 +133,7 @@ extern int pty_limit; /* Config limit on Unix98 ptys */ static DEFINE_IDR(allocated_ptys); static DECLARE_MUTEX(allocated_ptys_lock); +static int ptmx_open(struct inode *, struct file *); #endif extern void disable_early_printk(void); @@ -147,7 +145,6 @@ ssize_t redirected_tty_write(struct file *, const char __user *, size_t, loff_t *); static unsigned int tty_poll(struct file *, poll_table *); static int tty_open(struct inode *, struct file *); -static int ptmx_open(struct inode *, struct file *); static int tty_release(struct inode *, struct file *); int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); @@ -168,6 +165,7 @@ static inline void free_tty_struct(struct tty_struct *tty) { + kfree(tty->write_buf); kfree(tty); } @@ -248,7 +246,7 @@ * callers who will do ldisc lookups and cannot sleep. */ -static spinlock_t tty_ldisc_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(tty_ldisc_lock); static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_wait); static struct tty_ldisc tty_ldiscs[NR_LDISCS]; /* line disc dispatch table */ @@ -326,7 +324,7 @@ EXPORT_SYMBOL_GPL(tty_ldisc_put); -void tty_ldisc_assign(struct tty_struct *tty, struct tty_ldisc *ld) +static void tty_ldisc_assign(struct tty_struct *tty, struct tty_ldisc *ld) { tty->ldisc = *ld; tty->ldisc.refcount = 0; @@ -582,7 +580,7 @@ /* * This routine returns a tty driver structure, given a device number */ -struct tty_driver *get_tty_driver(dev_t device, int *index) +static struct tty_driver *get_tty_driver(dev_t device, int *index) { struct tty_driver *p; @@ -689,7 +687,7 @@ .release = tty_release, }; -static spinlock_t redirect_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(redirect_lock); static struct file *redirect; /** @@ -743,7 +741,7 @@ * but doesn't hold any locks, so we need to make sure we have the appropriate * locks for what we're doing.. */ -void do_tty_hangup(void *data) +static void do_tty_hangup(void *data) { struct tty_struct *tty = (struct tty_struct *) data; struct file * cons_filp = NULL; @@ -917,9 +915,11 @@ lock_kernel(); + down(&tty_sem); tty = current->signal->tty; if (tty) { tty_pgrp = tty->pgrp; + up(&tty_sem); if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY) tty_vhangup(tty); } else { @@ -927,6 +927,7 @@ kill_pg(current->signal->tty_old_pgrp, SIGHUP, on_exit); kill_pg(current->signal->tty_old_pgrp, SIGCONT, on_exit); } + up(&tty_sem); unlock_kernel(); return; } @@ -936,15 +937,19 @@ kill_pg(tty_pgrp, SIGCONT, on_exit); } + /* Must lock changes to tty_old_pgrp */ + down(&tty_sem); current->signal->tty_old_pgrp = 0; tty->session = 0; tty->pgrp = -1; + /* Now clear signal->tty under the lock */ read_lock(&tasklist_lock); do_each_task_pid(current->signal->session, PIDTYPE_SID, p) { p->signal->tty = NULL; } while_each_task_pid(current->signal->session, PIDTYPE_SID, p); read_unlock(&tasklist_lock); + up(&tty_sem); unlock_kernel(); } @@ -1010,7 +1015,7 @@ tty_ldisc_deref(ld); unlock_kernel(); if (i > 0) - inode->i_atime = CURRENT_TIME; + inode->i_atime = current_fs_time(inode->i_sb); return i; } @@ -1019,44 +1024,81 @@ * denial-of-service type attacks */ static inline ssize_t do_tty_write( - ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char __user *, size_t), + ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char *, size_t), struct tty_struct *tty, struct file *file, - const unsigned char __user *buf, + const char __user *buf, size_t count) { ssize_t ret = 0, written = 0; + unsigned int chunk; if (down_interruptible(&tty->atomic_write)) { return -ERESTARTSYS; } - if ( test_bit(TTY_NO_WRITE_SPLIT, &tty->flags) ) { + + /* + * We chunk up writes into a temporary buffer. This + * simplifies low-level drivers immensely, since they + * don't have locking issues and user mode accesses. + * + * But if TTY_NO_WRITE_SPLIT is set, we should use a + * big chunk-size.. + * + * The default chunk-size is 2kB, because the NTTY + * layer has problems with bigger chunks. It will + * claim to be able to handle more characters than + * it actually does. + */ + chunk = 2048; + if (test_bit(TTY_NO_WRITE_SPLIT, &tty->flags)) + chunk = 65536; + if (count < chunk) + chunk = count; + + /* write_buf/write_cnt is protected by the atomic_write semaphore */ + if (tty->write_cnt < chunk) { + unsigned char *buf; + + if (chunk < 1024) + chunk = 1024; + + buf = kmalloc(chunk, GFP_KERNEL); + if (!buf) { + up(&tty->atomic_write); + return -ENOMEM; + } + kfree(tty->write_buf); + tty->write_cnt = chunk; + tty->write_buf = buf; + } + + /* Do the write .. */ + for (;;) { + size_t size = count; + if (size > chunk) + size = chunk; + ret = -EFAULT; + if (copy_from_user(tty->write_buf, buf, size)) + break; lock_kernel(); - written = write(tty, file, buf, count); + ret = write(tty, file, tty->write_buf, size); unlock_kernel(); - } else { - for (;;) { - unsigned long size = max((unsigned long)PAGE_SIZE*2, 16384UL); - if (size > count) - size = count; - lock_kernel(); - ret = write(tty, file, buf, size); - unlock_kernel(); - if (ret <= 0) - break; - written += ret; - buf += ret; - count -= ret; - if (!count) - break; - ret = -ERESTARTSYS; - if (signal_pending(current)) - break; - cond_resched(); - } + if (ret <= 0) + break; + written += ret; + buf += ret; + count -= ret; + if (!count) + break; + ret = -ERESTARTSYS; + if (signal_pending(current)) + break; + cond_resched(); } if (written) { - file->f_dentry->d_inode->i_mtime = CURRENT_TIME; + struct inode *inode = file->f_dentry->d_inode; + inode->i_mtime = current_fs_time(inode->i_sb); ret = written; } up(&tty->atomic_write); @@ -1082,8 +1124,7 @@ if (!ld->write) ret = -EIO; else - ret = do_tty_write(ld->write, tty, file, - (const unsigned char __user *)buf, count); + ret = do_tty_write(ld->write, tty, file, buf, count); tty_ldisc_deref(ld); return ret; } @@ -1140,12 +1181,6 @@ struct termios *ltp, **ltp_loc, *o_ltp, **o_ltp_loc; int retval=0; - /* - * Check whether we need to acquire the tty semaphore to avoid - * race conditions. For now, play it safe. - */ - down(&tty_sem); - /* check whether we're reopening an existing tty */ if (driver->flags & TTY_DRIVER_DEVPTS_MEM) { tty = devpts_get_tty(idx); @@ -1334,7 +1369,6 @@ /* All paths come through here to release the semaphore */ end_init: - up(&tty_sem); return retval; /* Release locally allocated memory ... nothing placed in slots */ @@ -1530,9 +1564,14 @@ * each iteration we avoid any problems. */ while (1) { + /* Guard against races with tty->count changes elsewhere and + opens on /dev/tty */ + + down(&tty_sem); tty_closing = tty->count <= 1; o_tty_closing = o_tty && (o_tty->count <= (pty_master ? 1 : 0)); + up(&tty_sem); do_sleep = 0; if (tty_closing) { @@ -1568,6 +1607,8 @@ * both sides, and we've completed the last operation that could * block, so it's safe to proceed with closing. */ + + down(&tty_sem); if (pty_master) { if (--o_tty->count < 0) { printk(KERN_WARNING "release_dev: bad pty slave count " @@ -1581,7 +1622,8 @@ tty->count, tty_name(tty, buf)); tty->count = 0; } - + up(&tty_sem); + /* * We've decremented tty->count, so we need to remove this file * descriptor off the tty->tty_files list; this serves two @@ -1728,10 +1770,14 @@ noctty = filp->f_flags & O_NOCTTY; index = -1; retval = 0; + + down(&tty_sem); if (device == MKDEV(TTYAUX_MAJOR,0)) { - if (!current->signal->tty) + if (!current->signal->tty) { + up(&tty_sem); return -ENXIO; + } driver = current->signal->tty->driver; index = current->signal->tty->index; filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */ @@ -1765,14 +1811,18 @@ noctty = 1; goto got_driver; } + up(&tty_sem); return -ENODEV; } driver = get_tty_driver(device, &index); - if (!driver) + if (!driver) { + up(&tty_sem); return -ENODEV; + } got_driver: retval = init_dev(driver, index, &tty); + up(&tty_sem); if (retval) return retval; @@ -1810,7 +1860,7 @@ /* * Need to reset f_op in case a hangup happened. */ - /*if (filp->f_op == &hung_up_tty_fops) FIXME brave ruby*/ + if (filp->f_op == &hung_up_tty_fops) filp->f_op = &tty_fops; goto retry_open; } @@ -1858,7 +1908,10 @@ } up(&allocated_ptys_lock); + down(&tty_sem); retval = init_dev(ptm_driver, index, &tty); + up(&tty_sem); + if (retval) goto out; @@ -1969,14 +2022,11 @@ return 0; #ifdef CONFIG_VT if (tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) { - struct vc_data *vc = (struct vc_data *) tty->driver_data; - int rc = 0; + int rc; - if (!vc) { - acquire_console_sem(); - rc = vc_resize(vc, tmp_ws.ws_col, tmp_ws.ws_row); - release_console_sem(); - } + acquire_console_sem(); + rc = vc_resize(tty->driver_data, tmp_ws.ws_col, tmp_ws.ws_row); + release_console_sem(); if (rc) return -ENXIO; } @@ -1992,10 +2042,10 @@ static int tioccons(struct file *file) { + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; if (file->f_op->write == redirected_tty_write) { struct file *f; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; spin_lock(&redirect_lock); f = redirect; redirect = NULL; @@ -2128,11 +2178,11 @@ static int send_break(struct tty_struct *tty, int duration) { - set_current_state(TASK_INTERRUPTIBLE); - tty->driver->break_ctl(tty, -1); - if (!signal_pending(current)) + if (!signal_pending(current)) { + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(duration); + } tty->driver->break_ctl(tty, 0); if (signal_pending(current)) return -EINTR; @@ -2484,28 +2534,6 @@ } /* - * Call the ldisc flush directly from a driver. This function may - * return an error and need retrying by the user. - */ - -int tty_push_data(struct tty_struct *tty, unsigned char *cp, unsigned char *fp, int count) -{ - int ret = 0; - struct tty_ldisc *disc; - - disc = tty_ldisc_ref(tty); - if(test_bit(TTY_DONT_FLIP, &tty->flags)) - ret = -EAGAIN; - else if(disc == NULL) - ret = -EIO; - else - disc->receive_buf(tty, cp, fp, count); - tty_ldisc_deref(disc); - return ret; - -} - -/* * Routine which returns the baud rate of the tty * * Note that the baud_table needs to be kept in sync with the @@ -2609,6 +2637,7 @@ tty->magic = TTY_MAGIC; tty_ldisc_assign(tty, tty_ldisc_get(N_TTY)); tty->pgrp = -1; + tty->overrun_time = jiffies; tty->flip.char_buf_ptr = tty->flip.char_buf; tty->flip.flag_buf_ptr = tty->flip.flag_buf; INIT_WORK(&tty->flip.work, flush_to_ldisc, tty); @@ -2629,7 +2658,7 @@ */ static void tty_default_put_char(struct tty_struct *tty, unsigned char ch) { - tty->driver->write(tty, 0, &ch, 1); + tty->driver->write(tty, &ch, 1); } static struct class_simple *tty_class; @@ -2883,8 +2912,8 @@ So I haven't moved it. dwmw2 */ rs_360_init(); #endif - call = &__con_initcall_start; - while (call < &__con_initcall_end) { + call = __con_initcall_start; + while (call < __con_initcall_end) { (*call)(); call++; } |
From: Vojtech P. <vo...@us...> - 2005-03-22 13:12:55
|
Update of /cvsroot/linuxconsole/ruby/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699 Modified Files: inputattach.c jstest.c Log Message: Update utilities. Index: inputattach.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/inputattach.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- inputattach.c 6 Feb 2005 13:49:09 -0000 1.22 +++ inputattach.c 22 Mar 2005 13:12:29 -0000 1.23 @@ -342,6 +342,7 @@ int speed; int flags; unsigned long type; + unsigned long id; unsigned long extra; int flush; int (*init)(int fd, long *id, long *extra); @@ -349,29 +350,33 @@ struct input_types input_types[] = { -{ "--sunkbd", "-skb", B1200, CS8, SERIO_SUNKBD, 0x00, 1, NULL }, -{ "--lkkbd", "-lk", B4800, CS8|CSTOPB, SERIO_LKKBD, 0x00, 1, NULL }, -{ "--vsxxx-aa", "-vs", B4800, CS8|CSTOPB|PARENB|PARODD,SERIO_VSXXXAA, 0x00, 1, NULL }, -{ "--spaceorb", "-orb", B9600, CS8, SERIO_SPACEORB, 0x00, 1, NULL }, -{ "--spaceball", "-sbl", B9600, CS8, SERIO_SPACEBALL,0x00, 0, spaceball_init }, -{ "--magellan", "-mag", B9600, CS8 | CSTOPB | CRTSCTS, SERIO_MAGELLAN, 0x00, 1, magellan_init }, -{ "--warrior", "-war", B1200, CS7 | CSTOPB, SERIO_WARRIOR, 0x00, 1, warrior_init }, -{ "--stinger", "-sting", B1200, CS8, SERIO_STINGER, 0x00, 1, stinger_init }, -{ "--mousesystems", "-msc", B1200, CS8, SERIO_MSC, 0x01, 1, NULL }, -{ "--sunmouse", "-sun", B1200, CS8, SERIO_SUN, 0x01, 1, NULL }, -{ "--microsoft", "-bare", B1200, CS7, SERIO_MS, 0x00, 1, NULL }, -{ "--mshack", "-ms", B1200, CS7, SERIO_MS, 0x01, 1, NULL }, -{ "--mouseman", "-mman", B1200, CS7, SERIO_MP, 0x01, 1, NULL }, -{ "--intellimouse", "-ms3", B1200, CS7, SERIO_MZ, 0x11, 1, NULL }, -{ "--mmwheel", "-mmw", B1200, CS7 | CSTOPB, SERIO_MZP, 0x13, 1, mzp_init }, -{ "--iforce", "-ifor", B38400, CS8, SERIO_IFORCE, 0x00, 0, NULL }, -{ "--newtonkbd", "-newt", B9600, CS8, SERIO_NEWTON, 0x00, 0, newton_init }, -{ "--h3600ts", "-ipaq", B115200, CS8, SERIO_H3600, 0x00, 0, NULL }, -{ "--stowawaykbd", "-ipaqkbd", B115200, CS8, SERIO_STOWAWAY, 0x00, 0, NULL }, -{ "--ps2serkbd", "-ps2ser", B1200, CS8, SERIO_PS2SER, 0x00, 1, NULL }, -{ "--twiddler", "-twid", B2400, CS8, SERIO_TWIDKBD, 0x00, 0, twiddler_init }, -{ "--twiddler-joy", "-twidjoy", B2400, CS8, SERIO_TWIDJOY, 0x00, 0, twiddler_init }, -{ "--dump", "-dump", B2400, CS8, 0, 0x00, 0, dump_init }, +{ "--sunkbd", "-skb", B1200, CS8, SERIO_SUNKBD, 0, 0, 1, NULL }, +{ "--lkkbd", "-lk", B4800, CS8|CSTOPB, SERIO_LKKBD, 0, 0, 1, NULL }, +{ "--vsxxx-aa", "-vs", B4800, CS8|CSTOPB|PARENB|PARODD,SERIO_VSXXXAA, 0, 0, 1, NULL }, +{ "--spaceorb", "-orb", B9600, CS8, SERIO_SPACEORB, 0, 0, 1, NULL }, +{ "--spaceball", "-sbl", B9600, CS8, SERIO_SPACEBALL,0, 0, 0, spaceball_init }, +{ "--magellan", "-mag", B9600, CS8 | CSTOPB | CRTSCTS, SERIO_MAGELLAN, 0, 0, 1, magellan_init }, +{ "--warrior", "-war", B1200, CS7 | CSTOPB, SERIO_WARRIOR, 0, 0, 1, warrior_init }, +{ "--stinger", "-sting", B1200, CS8, SERIO_STINGER, 0, 0, 1, stinger_init }, +{ "--mousesystems", "-msc", B1200, CS8, SERIO_MSC, 0, 0x01, 1, NULL }, +{ "--sunmouse", "-sun", B1200, CS8, SERIO_SUN, 0, 0x01, 1, NULL }, +{ "--microsoft", "-bare", B1200, CS7, SERIO_MS, 0, 0, 1, NULL }, +{ "--mshack", "-ms", B1200, CS7, SERIO_MS, 0, 0x01, 1, NULL }, +{ "--mouseman", "-mman", B1200, CS7, SERIO_MP, 0, 0x01, 1, NULL }, +{ "--intellimouse", "-ms3", B1200, CS7, SERIO_MZ, 0, 0x11, 1, NULL }, +{ "--mmwheel", "-mmw", B1200, CS7 | CSTOPB, SERIO_MZP, 0, 0x13, 1, mzp_init }, +{ "--iforce", "-ifor", B38400, CS8, SERIO_IFORCE, 0, 0, 0, NULL }, +{ "--newtonkbd", "-newt", B9600, CS8, SERIO_NEWTON, 0, 0, 0, newton_init }, +{ "--h3600ts", "-ipaq", B115200, CS8, SERIO_H3600, 0, 0, 0, NULL }, +{ "--stowawaykbd", "-ipaqkbd", B115200, CS8, SERIO_STOWAWAY, 0, 0, 0, NULL }, +{ "--ps2serkbd", "-ps2ser", B1200, CS8, SERIO_PS2SER, 0, 0, 1, NULL }, +{ "--twiddler", "-twid", B2400, CS8, SERIO_TWIDKBD, 0, 0, 0, twiddler_init }, +{ "--twiddler-joy", "-twidjoy", B2400, CS8, SERIO_TWIDJOY, 0, 0, 0, twiddler_init }, +{ "--elotouch", "-elo", B9600, CS8 | CRTSCTS, SERIO_ELO, 0, 0, 0, NULL }, +{ "--elo4002", "-elo6b", B9600, CS8 | CRTSCTS, SERIO_ELO, 1, 0, 0, NULL }, +{ "--elo271-140", "-elo4b", B9600, CS8 | CRTSCTS, SERIO_ELO, 2, 0, 0, NULL }, +{ "--elo261-280", "-elo3b", B9600, CS8 | CRTSCTS, SERIO_ELO, 3, 0, 0, NULL }, +{ "--dump", "-dump", B2400, CS8, 0, 0, 0, 0, dump_init }, { "", "", 0, 0 } }; @@ -436,7 +441,7 @@ if (input_types[type].flush) while (!readchar(fd, &c, 100)); - id = 0; + id = input_types[type].id; extra = input_types[type].extra; if (input_types[type].init && input_types[type].init(fd, &id, &extra)) { Index: jstest.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/jstest.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- jstest.c 19 Oct 2004 07:51:52 -0000 1.7 +++ jstest.c 22 Mar 2005 13:12:30 -0000 1.8 @@ -44,18 +44,38 @@ #include <errno.h> #include <string.h> #include <stdlib.h> +#include <stdint.h> +#include <linux/input.h> #include <linux/joystick.h> +char *axis_names[ABS_MAX + 1] = { +"X", "Y", "Z", "Rx", "Ry", "Rz", "Throttle", "Rudder", +"Wheel", "Gas", "Brake", "?", "?", "?", "?", "?", +"Hat0X", "Hat0Y", "Hat1X", "Hat1Y", "Hat2X", "Hat2Y", "Hat3X", "Hat3Y", +"?", "?", "?", "?", "?", "?", "?", +}; + +char *button_names[KEY_MAX - BTN_MISC + 1] = { +"Btn0", "Btn1", "Btn2", "Btn3", "Btn4", "Btn5", "Btn6", "Btn7", "Btn8", "Btn9", "?", "?", "?", "?", "?", "?", +"LeftBtn", "RightBtn", "MiddleBtn", "SideBtn", "ExtraBtn", "ForwardBtn", "BackBtn", "TaskBtn", "?", "?", "?", "?", "?", "?", "?", "?", +"Trigger", "ThumbBtn", "ThumbBtn2", "TopBtn", "TopBtn2", "PinkieBtn", "BaseBtn", "BaseBtn2", "BaseBtn3", "BaseBtn4", "BaseBtn5", "BaseBtn6", "BtnDead", +"BtnA", "BtnB", "BtnC", "BtnX", "BtnY", "BtnZ", "BtnTL", "BtnTR", "BtnTL2", "BtnTR2", "BtnSelect", "BtnStart", "BtnMode", "BtnThumbL", "BtnThumbR", "?", +"?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", +"WheelBtn", "Gear up", +}; + #define NAME_LENGTH 128 int main (int argc, char **argv) { - int fd; + int fd, i; unsigned char axes = 2; unsigned char buttons = 2; int version = 0x000800; char name[NAME_LENGTH] = "Unknown"; + uint16_t btnmap[KEY_MAX - BTN_MISC + 1]; + uint8_t axmap[ABS_MAX + 1]; if (argc < 2 || argc > 3 || !strcmp("--help", argv[1])) { puts(""); @@ -79,9 +99,23 @@ ioctl(fd, JSIOCGAXES, &axes); ioctl(fd, JSIOCGBUTTONS, &buttons); ioctl(fd, JSIOCGNAME(NAME_LENGTH), name); + ioctl(fd, JSIOCGAXMAP, axmap); + ioctl(fd, JSIOCGBTNMAP, btnmap); + + + printf("Driver version is %d.%d.%d.\n", + version >> 16, (version >> 8) & 0xff, version & 0xff); + + printf("Joystick (%s) has %d axes (", name, axes); + for (i = 0; i < axes; i++) + printf("%s%s", i > 0 ? ", " : "", axis_names[axmap[i]]); + puts(")"); + + printf("and %d buttons (", buttons); + for (i = 0; i < buttons; i++) + printf("%s%s", i > 0 ? ", " : "", button_names[btnmap[i] - BTN_MISC]); + puts(")."); - printf("Joystick (%s) has %d axes and %d buttons. Driver version is %d.%d.%d.\n", - name, axes, buttons, version >> 16, (version >> 8) & 0xff, version & 0xff); printf("Testing ... (interrupt to exit)\n"); /* |
From: James S. <jsi...@us...> - 2005-03-21 20:26:39
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25343 Modified Files: vc_screen.c Log Message: VCSA now updated to linus tree. I should send a patch with this work to linus. Index: vc_screen.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vc_screen.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- vc_screen.c 24 Aug 2004 05:31:53 -0000 1.7 +++ vc_screen.c 21 Mar 2005 20:26:31 -0000 1.8 @@ -40,9 +40,6 @@ #include <asm/byteorder.h> #include <asm/unaligned.h> -#undef attr -#undef org -#undef addr #define HEADER_SIZE 4 unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed) @@ -78,36 +75,28 @@ } } - static int -vcs_size(struct inode *inode) +vcs_size(struct vc_data *vc, unsigned long attr) { - int minor = iminor(inode); - int currcons = minor & 127; - struct vc_data *vc; - int size; - - vc = find_vc(currcons); - - if (!vc) - return -ENXIO; - - size = vc->vc_rows * vc->vc_cols; + int size = vc->vc_rows * vc->vc_cols; - if (minor & 128) + if (attr) size = 2*size + HEADER_SIZE; return size; } static loff_t vcs_lseek(struct file *file, loff_t offset, int orig) { + struct inode *inode = file->f_dentry->d_inode; + struct vc_data *vc = file->private_data; + long attr = iminor(inode) & 128; int size; - down(&con_buf_sem); - size = vcs_size(file->f_dentry->d_inode); + down(&vc->display_fg->lock); + size = vcs_size(vc, attr); switch (orig) { default: - up(&con_buf_sem); + up(&vc->display_fg->lock); return -EINVAL; case 2: offset += size; @@ -118,11 +107,11 @@ break; } if (offset < 0 || offset > size) { - up(&con_buf_sem); + up(&vc->display_fg->lock); return -EINVAL; } file->f_pos = offset; - up(&con_buf_sem); + up(&vc->display_fg->lock); return file->f_pos; } @@ -130,36 +119,29 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; - unsigned int currcons = iminor(inode); - struct vc_data *vc; - long pos; - long viewed, attr, read; - int col, maxcol; + struct vc_data *vc = file->private_data; + long attr = iminor(inode) & 128; unsigned short *org = NULL; - ssize_t ret; - - down(&con_buf_sem); + long viewed, read, pos; + ssize_t ret = -ENXIO; + int col, maxcol; + if (!vc) + return ret; + down(&vc->display_fg->lock); + pos = *ppos; - - /* Select the proper current console and verify + /* + * Select the proper current console and verify * sanity of the situation under the console lock. */ acquire_console_sem(); - attr = (currcons & 128); - currcons = (currcons & 127); - if (currcons == 0) { + if (IS_VISIBLE) { viewed = 1; } else { viewed = 0; } - ret = -ENXIO; - - vc = find_vc(currcons); - - if (!vc) - goto unlock_out; ret = -EINVAL; if (pos < 0) @@ -176,15 +158,15 @@ * as copy_to_user at the end of this loop * could sleep. */ - size = vcs_size(inode); + size = vcs_size(vc, attr); if (pos >= size) break; if (count > size - pos) count = size - pos; this_round = count; - if (this_round > CON_BUF_SIZE) - this_round = CON_BUF_SIZE; + if (this_round > BUF_SIZE) + this_round = BUF_SIZE; /* Perform the whole read into the local con_buf. * Then we can drop the console spinlock and safely @@ -216,8 +198,8 @@ con_buf_start += p; this_round += p; - if (this_round > CON_BUF_SIZE) { - this_round = CON_BUF_SIZE; + if (this_round > BUF_SIZE) { + this_round = BUF_SIZE; orig_count = this_round - p; } @@ -236,7 +218,7 @@ * space in buffer. */ con_buf_start++; - if (this_round < CON_BUF_SIZE) + if (this_round < BUF_SIZE) this_round++; else orig_count--; @@ -295,7 +277,7 @@ ret = read; unlock_out: release_console_sem(); - up(&con_buf_sem); + up(&vc->display_fg->lock); return ret; } @@ -303,40 +285,32 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; - unsigned int currcons = iminor(inode); - struct vc_data *vc; - long pos; - long viewed, attr, size, written; - char *con_buf0; - int col, maxcol; + struct vc_data *vc = file->private_data; + long viewed, size, written, pos; + long attr = iminor(inode) & 128; u16 *org0 = NULL, *org = NULL; - size_t ret; - - down(&con_buf_sem); + size_t ret = -ENXIO; + int col, maxcol; + char *con_buf0; - pos = *ppos; + if (!vc) + return ret; + down(&vc->display_fg->lock); - /* Select the proper current console and verify + /* + * Select the proper current console and verify * sanity of the situation under the console lock. */ acquire_console_sem(); - attr = (currcons & 128); - currcons = (currcons & 127); - - if (currcons == 0) { + pos = *ppos; + if (IS_VISIBLE) { viewed = 1; } else { viewed = 0; } - ret = -ENXIO; - vc = find_vc(currcons); - - if (!vc) - goto unlock_out; - - size = vcs_size(inode); + size = vcs_size(vc, attr); ret = -EINVAL; if (pos < 0 || pos > size) goto unlock_out; @@ -348,8 +322,8 @@ size_t orig_count; long p; - if (this_round > CON_BUF_SIZE) - this_round = CON_BUF_SIZE; + if (this_round > BUF_SIZE) + this_round = BUF_SIZE; /* Temporarily drop the console lock so that we can read * in the write data from userspace safely. @@ -371,11 +345,12 @@ } } - /* The vcs_size might have changed while we slept to grab + /* + * The vcs_size might have changed while we slept to grab * the user buffer, so recheck. * Return data written up to now on failure. */ - size = vcs_size(inode); + size = vcs_size(vc, attr); if (pos >= size) break; if (this_round > size - pos) @@ -481,9 +456,7 @@ unlock_out: release_console_sem(); - - up(&con_buf_sem); - + up(&vc->display_fg->lock); return ret; } @@ -491,9 +464,11 @@ vcs_open(struct inode *inode, struct file *filp) { unsigned int currcons = iminor(inode) & 127; + struct vc_data *vc = find_vc(currcons); - if (currcons && !find_vc(currcons)) + if (!vc) return -ENXIO; + filp->private_data = vc; return 0; } |
From: James S. <jsi...@us...> - 2005-03-21 19:27:40
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30347 Modified Files: sysrq.c Log Message: New sysrq code. Index: sysrq.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/sysrq.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sysrq.c 17 Jun 2004 10:44:52 -0000 1.5 +++ sysrq.c 21 Mar 2005 19:27:08 -0000 1.6 @@ -36,13 +36,9 @@ #include <asm/ptrace.h> - /* Whether we react on sysrq keys or just ignore them */ int sysrq_enabled = 1; -/* Machine specific power off function */ -void (*sysrq_power_off)(void); - /* Loglevel sysrq handler */ static void sysrq_handle_loglevel(int key, struct pt_regs *pt_regs, struct tty_struct *tty) @@ -57,6 +53,7 @@ .handler = sysrq_handle_loglevel, .help_msg = "loglevel0-8", .action_msg = "Changing Loglevel", + .enable_mask = SYSRQ_ENABLE_LOG, }; @@ -65,32 +62,36 @@ static void sysrq_handle_SAK(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { - struct vc_data *vc = (struct vc_data *) tty->driver_data; - if (tty) do_SAK(tty); - if ((tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) && vc) - reset_vc(vc); + + if (tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) { + struct vc_data *vc = (struct vc_data *) tty->driver_data; + if (vc) reset_vc(vc); + } } static struct sysrq_key_op sysrq_SAK_op = { .handler = sysrq_handle_SAK, .help_msg = "saK", .action_msg = "SAK", + .enable_mask = SYSRQ_ENABLE_KEYBOARD, }; /* unraw sysrq handler */ static void sysrq_handle_unraw(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { - struct vc_data *vc = (struct vc_data *) tty->driver_data; + if (tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) { + struct vc_data *vc = (struct vc_data *) tty->driver_data; - if ((tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) && vc) - vc->kbd_table.kbdmode = VC_XLATE; + if (vc) vc->kbd_table.kbdmode = VC_XLATE; + } } static struct sysrq_key_op sysrq_unraw_op = { .handler = sysrq_handle_unraw, .help_msg = "unRaw", .action_msg = "Keyboard mode set to XLATE", + .enable_mask = SYSRQ_ENABLE_KEYBOARD, }; #endif /* CONFIG_VT */ @@ -98,6 +99,7 @@ static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { + local_irq_enable(); machine_restart(NULL); } @@ -105,6 +107,7 @@ .handler = sysrq_handle_reboot, .help_msg = "reBoot", .action_msg = "Resetting", + .enable_mask = SYSRQ_ENABLE_BOOT, }; static void sysrq_handle_sync(int key, struct pt_regs *pt_regs, @@ -117,6 +120,7 @@ .handler = sysrq_handle_sync, .help_msg = "Sync", .action_msg = "Emergency Sync", + .enable_mask = SYSRQ_ENABLE_SYNC, }; static void sysrq_handle_mountro(int key, struct pt_regs *pt_regs, @@ -129,6 +133,7 @@ .handler = sysrq_handle_mountro, .help_msg = "Unmount", .action_msg = "Emergency Remount R/O", + .enable_mask = SYSRQ_ENABLE_REMOUNT, }; /* END SYNC SYSRQ HANDLERS BLOCK */ @@ -146,6 +151,7 @@ .handler = sysrq_handle_showregs, .help_msg = "showPc", .action_msg = "Show Regs", + .enable_mask = SYSRQ_ENABLE_DUMP, }; @@ -158,6 +164,7 @@ .handler = sysrq_handle_showstate, .help_msg = "showTasks", .action_msg = "Show State", + .enable_mask = SYSRQ_ENABLE_DUMP, }; @@ -170,6 +177,7 @@ .handler = sysrq_handle_showmem, .help_msg = "showMem", .action_msg = "Show Memory", + .enable_mask = SYSRQ_ENABLE_DUMP, }; /* SHOW SYSRQ HANDLERS BLOCK */ @@ -200,6 +208,7 @@ .handler = sysrq_handle_term, .help_msg = "tErm", .action_msg = "Terminate All Tasks", + .enable_mask = SYSRQ_ENABLE_SIGNAL, }; static void sysrq_handle_kill(int key, struct pt_regs *pt_regs, @@ -212,13 +221,25 @@ .handler = sysrq_handle_kill, .help_msg = "kIll", .action_msg = "Kill All Tasks", + .enable_mask = SYSRQ_ENABLE_SIGNAL, }; /* END SIGNAL SYSRQ HANDLERS BLOCK */ +static void sysrq_handle_unrt(int key, struct pt_regs *pt_regs, + struct tty_struct *tty) +{ + normalize_rt_tasks(); +} +static struct sysrq_key_op sysrq_unrt_op = { + .handler = sysrq_handle_unrt, + .help_msg = "Nice", + .action_msg = "Nice All RT Tasks", + .enable_mask = SYSRQ_ENABLE_RTNICE, +}; /* Key Operations table and lock */ -static spinlock_t sysrq_key_table_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sysrq_key_table_lock); #define SYSRQ_KEY_TABLE_LENGTH 36 static struct sysrq_key_op *sysrq_key_table[SYSRQ_KEY_TABLE_LENGTH] = { /* 0 */ &sysrq_loglevel_op, @@ -250,7 +271,7 @@ #endif /* l */ NULL, /* m */ &sysrq_showmem_op, -/* n */ NULL, +/* n */ &sysrq_unrt_op, /* o */ NULL, /* This will often be registered as 'Off' at init time */ /* p */ &sysrq_showregs_op, @@ -284,14 +305,6 @@ } /* - * table lock and unlocking functions, exposed to modules - */ - -void __sysrq_lock_table (void) { spin_lock(&sysrq_key_table_lock); } - -void __sysrq_unlock_table (void) { spin_unlock(&sysrq_key_table_lock); } - -/* * get and put functions for the table, exposed to modules. */ @@ -318,22 +331,30 @@ * as they are inside of the lock */ -void __handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty) +void __handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty, int check_mask) { struct sysrq_key_op *op_p; int orig_log_level; int i, j; + unsigned long flags; - __sysrq_lock_table(); + spin_lock_irqsave(&sysrq_key_table_lock, flags); orig_log_level = console_loglevel; console_loglevel = 7; printk(KERN_INFO "SysRq : "); op_p = __sysrq_get_key_op(key); if (op_p) { - printk ("%s\n", op_p->action_msg); - console_loglevel = orig_log_level; - op_p->handler(key, pt_regs, tty); + /* Should we check for enabled operations (/proc/sysrq-trigger should not) + * and is the invoked operation enabled? */ + if (!check_mask || sysrq_enabled == 1 || + (sysrq_enabled & op_p->enable_mask)) { + printk ("%s\n", op_p->action_msg); + console_loglevel = orig_log_level; + op_p->handler(key, pt_regs, tty); + } + else + printk("This sysrq operation is disabled.\n"); } else { printk("HELP : "); /* Only print the help msg once per handler */ @@ -346,7 +367,7 @@ printk ("\n"); console_loglevel = orig_log_level; } - __sysrq_unlock_table(); + spin_unlock_irqrestore(&sysrq_key_table_lock, flags); } /* @@ -358,11 +379,37 @@ { if (!sysrq_enabled) return; - __handle_sysrq(key, pt_regs, tty); + __handle_sysrq(key, pt_regs, tty, 1); +} + +int __sysrq_swap_key_ops(int key, struct sysrq_key_op *insert_op_p, + struct sysrq_key_op *remove_op_p) { + + int retval; + unsigned long flags; + + spin_lock_irqsave(&sysrq_key_table_lock, flags); + if (__sysrq_get_key_op(key) == remove_op_p) { + __sysrq_put_key_op(key, insert_op_p); + retval = 0; + } else { + retval = -1; + } + spin_unlock_irqrestore(&sysrq_key_table_lock, flags); + + return retval; +} + +int register_sysrq_key(int key, struct sysrq_key_op *op_p) +{ + return __sysrq_swap_key_ops(key, op_p, NULL); +} + +int unregister_sysrq_key(int key, struct sysrq_key_op *op_p) +{ + return __sysrq_swap_key_ops(key, NULL, op_p); } EXPORT_SYMBOL(handle_sysrq); -EXPORT_SYMBOL(__sysrq_lock_table); -EXPORT_SYMBOL(__sysrq_unlock_table); -EXPORT_SYMBOL(__sysrq_get_key_op); -EXPORT_SYMBOL(__sysrq_put_key_op); +EXPORT_SYMBOL(register_sysrq_key); +EXPORT_SYMBOL(unregister_sysrq_key); |
From: James S. <jsi...@us...> - 2005-03-21 19:21:51
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27488 Modified Files: selection.c Log Message: Merged to linus tree. Index: selection.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/selection.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- selection.c 22 Oct 2004 07:46:16 -0000 1.6 +++ selection.c 21 Mar 2005 19:21:39 -0000 1.7 @@ -12,7 +12,6 @@ */ #include <linux/module.h> -#include <linux/console.h> #include <linux/tty.h> #include <linux/sched.h> #include <linux/mm.h> @@ -25,13 +24,14 @@ #include <linux/consolemap.h> #include <linux/selection.h> #include <linux/tiocl.h> +#include <linux/console.h> /* Don't take this from <ctype.h>: 011-015 on the screen aren't spaces */ #define isspace(c) ((c) == ' ') /* Variables for selection control. */ /* Use a dynamic buffer, instead of static (Dec 1994) */ - int sel_cons; /* must not be disallocated */ +struct vc_data *sel_cons; /* must not be disallocated */ static volatile int sel_start = -1; /* cleared by clear_selection */ static int sel_end; static int sel_buffer_lth; @@ -41,9 +41,9 @@ from interrupt (via scrollback/front) */ /* set reverse video on characters s-e of console with selection. */ -inline static void -highlight(const int s, const int e) { - invert_screen(find_vc(sel_cons), s, e-s+2, 1); +static inline void highlight(const int s, const int e) +{ + invert_screen(sel_cons, s, e-s+2, 1); } u16 screen_glyph(struct vc_data *vc, int offset) @@ -56,16 +56,16 @@ return c; } - /* use complementary color to show the pointer */ -inline static void -highlight_pointer(const int where) { - complement_pos(find_vc(sel_cons), where); +static inline void highlight_pointer(const int where) +{ + complement_pos(sel_cons, where); } -static unsigned char sel_pos(int n) +static unsigned char +sel_pos(int n) { - return inverse_translate(find_vc(sel_cons), screen_glyph(find_vc(sel_cons), n)); + return inverse_translate(sel_cons, screen_glyph(sel_cons, n)); } /* @@ -130,7 +130,7 @@ { unsigned short xs, ys, xe, ye; - if (verify_area(VERIFY_READ, sel, sizeof(*sel))) + if (!access_ok(VERIFY_READ, sel, sizeof(*sel))) return -EFAULT; __get_user(xs, &sel->xs); __get_user(ys, &sel->ys); @@ -164,9 +164,9 @@ pe = tmp; } - if (sel_cons != vc->display_fg->fg_console->vc_num) { + if (sel_cons != vc->display_fg->fg_console) { clear_selection(); - sel_cons = vc->display_fg->fg_console->vc_num; + sel_cons = vc->display_fg->fg_console; } switch (sel_mode) @@ -285,14 +285,14 @@ */ int paste_selection(struct tty_struct *tty) { - struct vc_data *vc = (struct vc_data *) tty->driver_data; + struct vc_data *vc = (struct vc_data *) tty->driver_data; + struct tty_ldisc *ld; int pasted = 0, count; - struct tty_ldisc *ld; DECLARE_WAITQUEUE(wait, current); - acquire_console_sem(); + acquire_console_sem(); poke_blanked_console(vc->display_fg); - release_console_sem(); + release_console_sem(); ld = tty_ldisc_ref_wait(tty); @@ -305,15 +305,11 @@ } count = sel_buffer_lth - pasted; count = min(count, tty->ldisc.receive_room(tty)); - tty->ldisc.receive_buf(tty, sel_buffer + pasted, 0, count); + tty->ldisc.receive_buf(tty, sel_buffer + pasted, NULL, count); pasted += count; } remove_wait_queue(&vc->paste_wait, &wait); set_current_state(TASK_RUNNING); - tty_ldisc_deref(ld); return 0; } - -EXPORT_SYMBOL(set_selection); -EXPORT_SYMBOL(paste_selection); |
From: James S. <jsi...@us...> - 2005-03-21 19:17:46
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25421 Modified Files: decvte.c Log Message: Killed off the console_macros for this file. Index: decvte.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/decvte.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- decvte.c 30 Apr 2004 06:04:19 -0000 1.3 +++ decvte.c 21 Mar 2005 19:17:24 -0000 1.4 @@ -1,6 +1,6 @@ /* * decvte.c - DEC VT terminal emulation code. - * Copyright (C) 2002 James Simmons (jsi...@in...) + * Copyright (C) 2002 James Simmons (jsi...@ww...) * * I moved all the VT emulation code out of console.c to here. It makes life * much easier and the code smaller. It also allows other devices to emulate @@ -47,8 +47,6 @@ #include <asm/uaccess.h> #include <asm/bitops.h> [...1975 lines suppressed...] - G3_charset = IBMPC_MAP; + vc->vc_G3_charset = IBMPC_MAP; break; case 'K': - G3_charset = USER_MAP; + vc->vc_G3_charset = USER_MAP; break; } - if (charset == 1) - set_translate(vc, G3_charset); - vc_state = ESinit; + if (vc->vc_charset == 1) + set_translate(vc, vc->vc_G3_charset); + vc->vc_state = ESinit; return; default: - vc_state = ESinit; + vc->vc_state = ESinit; } } |
From: James S. <jsi...@us...> - 2005-03-21 19:15:15
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24292 Modified Files: consolemap.c Log Message: Update to the last mainline tree. All the verify_area functions have been replaced by access_ok. Also some mapping code as been added to the translations map. Index: consolemap.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/consolemap.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- consolemap.c 17 Jun 2004 10:44:52 -0000 1.5 +++ consolemap.c 21 Mar 2005 19:14:59 -0000 1.6 @@ -70,8 +70,8 @@ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x00a0, 0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, - 0x2591, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0xf800, - 0xf801, 0x2500, 0xf803, 0xf804, 0x251c, 0x2524, 0x2534, 0x252c, + 0x2591, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba, + 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, @@ -255,14 +255,13 @@ * 0xf000-0xf0ff "transparent" Unicodes) whereas the "new" variants set * Unicodes explicitly. */ -int con_set_trans_old(struct vc_data *vc, unsigned char __user * arg) +int con_set_trans_old(struct vc_data *vc, unsigned char __user *arg) { - int i; unsigned short *p = translations[USER_MAP]; + int i; - i = verify_area(VERIFY_READ, arg, E_TABSZ); - if (i) - return i; + if (!access_ok(VERIFY_READ, arg, E_TABSZ)) + return -EFAULT; for (i=0; i<E_TABSZ ; i++) { unsigned char uc; @@ -274,14 +273,13 @@ return 0; } -int con_get_trans_old(struct vc_data *vc, unsigned char __user * arg) +int con_get_trans_old(struct vc_data *vc, unsigned char __user *arg) { - int i, ch; unsigned short *p = translations[USER_MAP]; + int i, ch; - i = verify_area(VERIFY_WRITE, arg, E_TABSZ); - if (i) - return i; + if (!access_ok(VERIFY_WRITE, arg, E_TABSZ)) + return -EFAULT; for (i=0; i<E_TABSZ ; i++) { @@ -291,14 +289,13 @@ return 0; } -int con_set_trans_new(struct vc_data *vc, ushort __user * arg) +int con_set_trans_new(struct vc_data *vc, ushort __user *arg) { - int i; unsigned short *p = translations[USER_MAP]; + int i; - i = verify_area(VERIFY_READ, arg, E_TABSZ*sizeof(unsigned short)); - if (i) - return i; + if (!access_ok(VERIFY_READ, arg, E_TABSZ*sizeof(unsigned short))) + return -EFAULT; for (i=0; i<E_TABSZ ; i++) { unsigned short us; @@ -310,18 +307,17 @@ return 0; } -int con_get_trans_new(struct vc_data *vc, ushort __user * arg) +int con_get_trans_new(struct vc_data *vc, ushort __user *arg) { - int i; unsigned short *p = translations[USER_MAP]; + int i; - i = verify_area(VERIFY_WRITE, arg, E_TABSZ*sizeof(unsigned short)); - if (i) - return i; + if (!access_ok(VERIFY_WRITE, arg, E_TABSZ*sizeof(unsigned short))) + return -EFAULT; for (i=0; i<E_TABSZ ; i++) __put_user(p[i], arg+i); - + return 0; } @@ -465,8 +461,7 @@ return 0; } -int -con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list) +int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list) { struct uni_pagedir *p, *q; int err = 0, err1, i; @@ -525,8 +520,7 @@ with. This routine is executed at sys_setup time, and when the PIO_FONTRESET ioctl is called. */ -int -con_set_default_unimap(struct vc_data *vc) +int con_set_default_unimap(struct vc_data *vc) { int i, j, err = 0, err1; u16 *q; @@ -571,8 +565,7 @@ } EXPORT_SYMBOL(con_set_default_unimap); -int -con_copy_unimap(struct vc_data *dst, struct vc_data *src) +int con_copy_unimap(struct vc_data *dst, struct vc_data *src) { struct uni_pagedir *q; @@ -587,8 +580,7 @@ return 0; } -int -con_get_unimap(struct vc_data *vc, ushort ct, ushort *uct, struct unipair __user *list) +int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, struct unipair __user *list) { int i, j, k, ect; u16 **p1, *p2; @@ -618,9 +610,8 @@ void con_protect_unimap(struct vc_data *vc, int rdonly) { - struct uni_pagedir *p = (struct uni_pagedir *) - *vc->vc_uni_pagedir_loc; - + struct uni_pagedir *p = (struct uni_pagedir *) *vc->vc_uni_pagedir_loc; + if (p) p->readonly = rdonly; } @@ -668,8 +659,8 @@ { struct vt_struct *vt; int i; - - vt = list_entry(vt_list.next, typeof(*vt), node); + + vt = list_entry(vt_list.next, typeof(*vt), node); for (i = 0; i < vt->vc_count; i++) { struct vc_data *vc = vt->vc_cons[i]; |
From: James S. <jsi...@us...> - 2005-03-17 20:38:45
|
Update of /cvsroot/linuxconsole/ruby/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23442 Modified Files: remove-obsolete-files Log Message: adb_mouse.h is gone. Using input api instead. Index: remove-obsolete-files =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/remove-obsolete-files,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- remove-obsolete-files 9 Mar 2005 00:36:41 -0000 1.37 +++ remove-obsolete-files 17 Mar 2005 20:38:35 -0000 1.38 @@ -6,7 +6,6 @@ rm -fv drivers/tc/lk201.c rm -fv drivers/tc/lk201-remap.c rm -rf drivers/tc/lk201-map.map -rm -fv include/asm-m68k/adb_mouse.h rm -fv include/asm-m68k/atari_joystick.h rm -fv include/asm-m68k/mac_mouse.h rm -fv include/asm-m68k/atarikb.h |
From: James S. <jsi...@us...> - 2005-03-09 00:36:53
|
Update of /cvsroot/linuxconsole/ruby/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19915 Modified Files: remove-obsolete-files Log Message: Update the remove obsolete files. Most of the input stuff has gone in. Index: remove-obsolete-files =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/remove-obsolete-files,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- remove-obsolete-files 10 Dec 2002 18:26:09 -0000 1.36 +++ remove-obsolete-files 9 Mar 2005 00:36:41 -0000 1.37 @@ -1,18 +1,7 @@ #!/bin/sh rm -fv arch/m68k/hp300/hp300map.map -rm -fv arch/mips/jazz/kbd-jazz.c -rm -fv arch/mips/lib/kbd-no.c -rm -fv arch/mips/lib/kbd-std.c -rm -fv arch/mips64/lib/kbd-no.c -rm -fv arch/mips64/lib/kbd-std.c -rm -fv drivers/acorn/char/keyb_arc.c -rm -fv drivers/acorn/char/mouse_ps2.c -rm -rf drivers/acorn/char/defkeymap-acorn.c -rm -rf drivers/acorn/char/defkeymap-acorn.map rm -rf drivers/acorn/char/defkeymap-l7200.c -rm -fv drivers/char/busmouse.c -rm -fv drivers/char/busmouse.h rm -fv drivers/char/ec3104_keyb.c rm -fv drivers/tc/lk201.c rm -fv drivers/tc/lk201-remap.c @@ -21,7 +10,4 @@ rm -fv include/asm-m68k/atari_joystick.h rm -fv include/asm-m68k/mac_mouse.h rm -fv include/asm-m68k/atarikb.h -rm -fv include/linux/adb_mouse.h -rm -fv include/linux/kbd_ll.h -rm -fv include/linux/pc_keyb.h rm -fv include/linux/console_struct.h |
From: James S. <jsi...@ww...> - 2005-03-08 21:40:47
|
Where is the latest patch against 2.6.11-mm2. I'm syncing up the ruby BK tree with linus tree. On Mon, 7 Mar 2005, Sebastian Galletto wrote: > Hi everybody > > I been trying to fetch ruby-2.6.11-rc4.diff patch from Aivils site > ( http://www.ltn.lv/~aivils/files/test/5_ruby-2.6.11-rc4.diff ) and got > a forbidden access error. Is this file available at another location? is > this the last patch set for the 2.6.11 tree? > > Thanks! > > > Sebastian. > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Linuxconsole-commit mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linuxconsole-commit > |
From: Sebastian G. <sga...@ak...> - 2005-03-07 15:31:32
|
Hi everybody I been trying to fetch ruby-2.6.11-rc4.diff patch from Aivils site ( http://www.ltn.lv/~aivils/files/test/5_ruby-2.6.11-rc4.diff ) and got a forbidden access error. Is this file available at another location? is this the last patch set for the 2.6.11 tree? Thanks! Sebastian. |
From: Vojtech P. <vo...@us...> - 2005-02-06 13:52:01
|
Update of /cvsroot/linuxconsole/ruby/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20709 Modified Files: evtest.c Log Message: Print scancodes in HEX. Index: evtest.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/evtest.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- evtest.c 19 Oct 2004 07:53:31 -0000 1.22 +++ evtest.c 6 Feb 2005 13:51:42 -0000 1.23 @@ -370,7 +370,7 @@ if (ev[i].type == EV_SYN) { printf("Event: time %ld.%06ld, -------------- %s ------------\n", ev[i].time.tv_sec, ev[i].time.tv_usec, ev[i].code ? "Config Sync" : "Report Sync" ); - } else if (ev[i].type == EV_MSC && ev[i].code == MSC_RAW) { + } else if (ev[i].type == EV_MSC && (ev[i].code == MSC_RAW || ev[i].code == MSC_SCAN)) { printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %02x\n", ev[i].time.tv_sec, ev[i].time.tv_usec, ev[i].type, events[ev[i].type] ? events[ev[i].type] : "?", |
From: Vojtech P. <vo...@us...> - 2005-02-06 13:49:22
|
Update of /cvsroot/linuxconsole/ruby/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20124 Modified Files: inputattach.c Log Message: Add LK401 keyboard and VSXXX-AA mouse support. From: Jan-Benedict Glaw <jb...@lu...> Index: inputattach.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/inputattach.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- inputattach.c 10 Jul 2002 22:34:01 -0000 1.21 +++ inputattach.c 6 Feb 2005 13:49:09 -0000 1.22 @@ -350,6 +350,8 @@ struct input_types input_types[] = { { "--sunkbd", "-skb", B1200, CS8, SERIO_SUNKBD, 0x00, 1, NULL }, +{ "--lkkbd", "-lk", B4800, CS8|CSTOPB, SERIO_LKKBD, 0x00, 1, NULL }, +{ "--vsxxx-aa", "-vs", B4800, CS8|CSTOPB|PARENB|PARODD,SERIO_VSXXXAA, 0x00, 1, NULL }, { "--spaceorb", "-orb", B9600, CS8, SERIO_SPACEORB, 0x00, 1, NULL }, { "--spaceball", "-sbl", B9600, CS8, SERIO_SPACEBALL,0x00, 0, spaceball_init }, { "--magellan", "-mag", B9600, CS8 | CSTOPB | CRTSCTS, SERIO_MAGELLAN, 0x00, 1, magellan_init }, @@ -389,6 +391,8 @@ puts(""); puts("Modes:"); puts(" --sunkbd -skb Sun Type 4 and Type 5 keyboards"); + puts(" --lkkbd -lk DEC LK201 / LK401 keyboards"); + puts(" --vsxxx-aa -vs DEC VSXXX-AA / VSXXX-GA mouse and VSXXX-AB tablet"); puts(" --spaceorb -orb SpaceOrb 360 / SpaceBall Avenger"); puts(" --spaceball -sbl SpaceBall 2003 / 3003 / 4000 FLX"); puts(" --magellan -mag Magellan / SpaceMouse"); |
From: Aivils S. <ai...@us...> - 2004-10-22 07:46:30
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1411/ruby-2.6/drivers/char Modified Files: Kconfig Makefile keyboard.c selection.c tty_io.c vt.c vt_ioctl.c Log Message: sync to 2.6.9 Index: Kconfig =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Kconfig,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Kconfig 24 Aug 2004 05:31:53 -0000 1.10 +++ Kconfig 22 Oct 2004 07:46:16 -0000 1.11 @@ -66,7 +66,7 @@ config HW_CONSOLE bool - depends on VT && !S390 && !UM + depends on VT && !S390 && !USERMODE default y config SERIAL_NONSTANDARD @@ -431,6 +431,14 @@ will also be built as a module. This has to be loaded before "ser_a2232". If you want to do this, answer M here. +config SGI_SNSC + bool "SGI Altix system controller communication support" + depends on (IA64_SGI_SN2 || IA64_GENERIC) + help + If you have an SGI Altix and you want to enable system + controller communication from user space (you want this!), + say Y. Otherwise, say N. + source "drivers/serial/Kconfig" config UNIX98_PTYS @@ -594,39 +602,6 @@ which will also be compiled when this driver is built as a module. -config QIC02_TAPE - tristate "QIC-02 tape support" - help - If you have a non-SCSI tape drive like that, say Y. - - To compile this driver as a module, choose M here: the - module will be called tpqic02. - -config QIC02_DYNCONF - bool "Do you want runtime configuration for QIC-02" - depends on QIC02_TAPE - help - You can either configure this driver once and for all by editing a - header file (<file:include/linux/tpqic02.h>), in which case you - should say N, or you can fetch a program via anonymous FTP which is - able to configure this driver during runtime. The program to do - this is called 'qic02conf' and it is part of the - tpqic02-support-X.Y.tar.gz support package. - - If you want to use the qic02conf program, say Y. - -comment "Edit configuration parameters in ./include/linux/tpqic02.h!" - depends on QIC02_TAPE && !QIC02_DYNCONF - -comment "Setting runtime QIC-02 configuration is done with qic02conf" - depends on QIC02_TAPE && QIC02_DYNCONF - -comment "from the tpqic02-support package. It is available at" - depends on QIC02_TAPE && QIC02_DYNCONF - -comment "metalab.unc.edu or ftp://titus.cfw.com/pub/Linux/util/" - depends on QIC02_TAPE && QIC02_DYNCONF - source "drivers/char/ipmi/Kconfig" source "drivers/char/watchdog/Kconfig" @@ -785,7 +760,7 @@ config GEN_RTC tristate "Generic /dev/rtc emulation" - depends on RTC!=y && !IA64 + depends on RTC!=y && !IA64 && !ARM ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you @@ -1013,5 +988,13 @@ out to lunch past a certain margin. It can reboot the system or merely print a warning. +config MMTIMER + tristate "MMTIMER Memory mapped RTC for SGI Altix" + depends on IA64_GENERIC || IA64_SGI_SN2 + default y + help + The mmtimer device allows direct userspace access to the + Altix system timer. + endmenu Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile 24 Aug 2004 05:31:53 -0000 1.11 +++ Makefile 22 Oct 2004 07:46:16 -0000 1.12 @@ -7,10 +7,13 @@ # FONTMAPFILE = cp437.uni -obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o +obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o -obj-$(CONFIG_VT) += vt_ioctl.o decvte.o vc_screen.o consolemap.o \ - consolemap_deftbl.o selection.o keyboard.o vt_proc.o vt_sysfs.o +obj-$(CONFIG_LEGACY_PTYS) += pty.o +obj-$(CONFIG_UNIX98_PTYS) += pty.o +obj-y += misc.o +obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o \ + consolemap_deftbl.o selection.o keyboard.o vt_proc.o vt_sysfs.o decvte.o obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o obj-$(CONFIG_ESPSERIAL) += esp.o @@ -39,8 +42,10 @@ obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o obj-$(CONFIG_SX) += sx.o generic_serial.o obj-$(CONFIG_RIO) += rio/ generic_serial.o -obj-$(CONFIG_HVC_CONSOLE) += hvc_console.o +obj-$(CONFIG_HVC_CONSOLE) += hvc_console.o hvsi.o obj-$(CONFIG_RAW_DRIVER) += raw.o +obj-$(CONFIG_SGI_SNSC) += snsc.o +obj-$(CONFIG_MMTIMER) += mmtimer.o obj-$(CONFIG_VIOCONS) += viocons.o obj-$(CONFIG_VIOTAPE) += viotape.o obj-$(CONFIG_HVCS) += hvcs.o Index: keyboard.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/keyboard.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- keyboard.c 24 Aug 2004 05:31:53 -0000 1.14 +++ keyboard.c 22 Oct 2004 07:46:16 -0000 1.15 @@ -94,7 +94,7 @@ */ static struct input_handler kbd_handler; -static unsigned long key_down[256/BITS_PER_LONG]; /* keyboard key bitmap */ +static unsigned long key_down[NBITS(KEY_MAX)]; /* keyboard key bitmap */ static unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */ static int dead_key_next; static int npadch = -1; /* -1 or number assembled on pad */ @@ -110,7 +110,7 @@ /* Simple translation table for the SysRq keys */ #ifdef CONFIG_MAGIC_SYSRQ -unsigned char kbd_sysrq_xlate[128] = +unsigned char kbd_sysrq_xlate[KEY_MAX] = "\000\0331234567890-=\177\t" /* 0x00 - 0x0f */ "qwertyuiop[]\r\000as" /* 0x10 - 0x1f */ "dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */ @@ -890,6 +890,9 @@ #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) +#define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ + ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001)) + static unsigned short x86_keycodes[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -956,6 +959,8 @@ #else +#define HW_RAW(dev) 0 + #warning "Cannot generate rawmode keyboard for your architecture yet." static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char up_flag) @@ -968,7 +973,14 @@ } #endif -void kbd_keycode(struct vt_struct *vt, unsigned int keycode, int down) +void kbd_rawcode(struct vt_struct *vt, unsigned char data) +{ + struct vc_data *vc = vt->fg_console; + if (vc->kbd_table.kbdmode == VC_RAW) + put_queue(vc, data); +} + +void kbd_keycode(struct vt_struct *vt, unsigned int keycode, int down, int hw_raw) { struct vc_data *vc = vt->fg_console; unsigned short keysym, *key_map; @@ -1000,7 +1012,7 @@ return; #endif /* CONFIG_MAC_EMUMOUSEBTN */ - if ((raw_mode = (vc->kbd_table.kbdmode == VC_RAW))) + if ((raw_mode = (vc->kbd_table.kbdmode == VC_RAW)) && !hw_raw) if (emulate_raw(vc, keycode, !down << 7)) if (keycode < BTN_MISC) printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode); @@ -1066,6 +1078,9 @@ return; } + if (keycode > NR_KEYS) + return; + keysym = key_map[keycode]; type = KTYP(keysym); @@ -1095,13 +1110,16 @@ } static void kbd_event(struct input_handle *handle, unsigned int event_type, - unsigned int keycode, int down) + unsigned int event_code, int value) { struct vt_struct *vt = handle->private; - - if ((event_type != EV_KEY) || !vt) + + if (!vt) return; - kbd_keycode(vt, keycode, down); + if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev)) + kbd_rawcode(vt, value); + if (event_type == EV_KEY) + kbd_keycode(vt, event_code, value, HW_RAW(handle->dev)); tasklet_schedule(&keyboard_tasklet); do_poke_blanked_console = 1; schedule_work(&vt->vt_work); Index: selection.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/selection.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- selection.c 17 Jun 2004 10:44:52 -0000 1.5 +++ selection.c 22 Oct 2004 07:46:16 -0000 1.6 @@ -26,10 +26,6 @@ #include <linux/selection.h> #include <linux/tiocl.h> -#ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /* Don't take this from <ctype.h>: 011-015 on the screen aren't spaces */ #define isspace(c) ((c) == ' ') @@ -291,12 +287,15 @@ { struct vc_data *vc = (struct vc_data *) tty->driver_data; int pasted = 0, count; + struct tty_ldisc *ld; DECLARE_WAITQUEUE(wait, current); acquire_console_sem(); poke_blanked_console(vc->display_fg); release_console_sem(); + ld = tty_ldisc_ref_wait(tty); + add_wait_queue(&vc->paste_wait, &wait); while (sel_buffer && sel_buffer_lth > pasted) { set_current_state(TASK_INTERRUPTIBLE); @@ -305,12 +304,14 @@ continue; } count = sel_buffer_lth - pasted; - count = MIN(count, tty->ldisc.receive_room(tty)); + count = min(count, tty->ldisc.receive_room(tty)); tty->ldisc.receive_buf(tty, sel_buffer + pasted, 0, count); pasted += count; } remove_wait_queue(&vc->paste_wait, &wait); set_current_state(TASK_RUNNING); + + tty_ldisc_deref(ld); return 0; } Index: tty_io.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/tty_io.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- tty_io.c 24 Aug 2004 05:31:53 -0000 1.12 +++ tty_io.c 22 Oct 2004 07:46:16 -0000 1.13 @@ -92,6 +92,7 @@ #include <linux/smp_lock.h> #include <linux/device.h> #include <linux/idr.h> +#include <linux/wait.h> #include <asm/uaccess.h> #include <asm/system.h> @@ -120,10 +121,14 @@ EXPORT_SYMBOL(tty_std_termios); [...1273 lines suppressed...] - char name[64]; + if (driver->type == TTY_DRIVER_TYPE_PTY) + pty_line_name(driver, index, name); + else tty_line_name(driver, index, name); - class_simple_device_add(tty_class, dev, device, name); - } + class_simple_device_add(tty_class, dev, device, name); } /** @@ -2452,7 +2935,7 @@ class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); #ifdef CONFIG_UNIX98_PTYS - cdev_init(&ptmx_cdev, &tty_fops); + cdev_init(&ptmx_cdev, &ptmx_fops); if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) panic("Couldn't register /dev/ptmx driver\n"); Index: vt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- vt.c 24 Aug 2004 05:31:53 -0000 1.21 +++ vt.c 22 Oct 2004 07:46:16 -0000 1.22 @@ -424,7 +424,7 @@ video_erase_char = (build_attr(vc, color, intensity, 0, 0, decscnm) << 8) | ' '; } -static void clear_buffer_attributes(struct vc_data *vc) +void clear_buffer_attributes(struct vc_data *vc) { unsigned short *p = (unsigned short *) origin; int count = screenbuf_size/2; @@ -1775,6 +1775,8 @@ if (current_vc + vc_count - 1 > MAX_NR_CONSOLES) return NULL; + vt->first_vc = current_vc; + vt->vc_count = vc_count; display_desc = vt->vt_sw->con_startup(vt, init); if (!display_desc) return NULL; @@ -1783,8 +1785,6 @@ init_MUTEX(&vt->lock); vt->vt_num = current_vt; vt->display_desc = (char *)display_desc; - vt->first_vc = current_vc; - vt->vc_count = vc_count; list_add_tail(&vt->node, &vt_list); vt->vt_dont_switch = 0; vt->scrollback_delta = 0; Index: vt_ioctl.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt_ioctl.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- vt_ioctl.c 24 Aug 2004 05:31:53 -0000 1.9 +++ vt_ioctl.c 22 Oct 2004 07:46:16 -0000 1.10 @@ -615,7 +615,8 @@ hide_cursor(old_vc); if (old_vc != new_vc) { int update; - + int old_was_color = old_vc->vc_can_do_color; + new_vc->display_fg->fg_console = new_vc; save_screen(old_vc); set_origin(old_vc); @@ -623,7 +624,17 @@ set_origin(new_vc); update = new_vc->display_fg->vt_sw->con_switch(new_vc); set_palette(new_vc); - if (update && new_vc->vc_mode != KD_GRAPHICS) + /* + * If console changed from mono<->color, the best we can do + * is to clear the buffer attributes. As it currently stands, + * rebuilding new attributes from the old buffer is not doable + * without overly complex code. + */ + if (old_was_color != new_vc->vc_can_do_color) { + update_attr(new_vc); + clear_buffer_attributes(new_vc); + } + if (update && new_vc->vc_mode != KD_GRAPHICS) do_update_region(new_vc, new_vc->vc_origin, new_vc->vc_screenbuf_size/2); } @@ -942,8 +953,7 @@ default: return -EINVAL; } - if (tty->ldisc.flush_buffer) - tty->ldisc.flush_buffer(tty); + tty_ldisc_flush(tty); return 0; case KDGKBMODE: |
From: Aivils S. <ai...@us...> - 2004-10-22 07:46:30
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1411/ruby-2.6/drivers/video/console Modified Files: fbcon.c fbcon.h Log Message: sync to 2.6.9 Index: fbcon.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/fbcon.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- fbcon.c 24 Aug 2004 05:31:54 -0000 1.11 +++ fbcon.c 22 Oct 2004 07:46:17 -0000 1.12 @@ -294,6 +294,87 @@ /* * Accelerated handlers. */ +static inline int get_color(struct vc_data *vc, struct fb_info *info, + u16 c, int is_fg) +{ + int depth = fb_get_color_depth(info); + int color = 0; + + if (depth != 1) + color = (is_fg) ? attr_fgcol((vc->vc_hi_font_mask) ? 9 : 8, c) + : attr_bgcol((vc->vc_hi_font_mask) ? 13 : 12, c); + + switch (depth) { + case 1: + { + /* 0 or 1 */ + int fg = (info->fix.visual != FB_VISUAL_MONO01) ? 1 : 0; + int bg = (info->fix.visual != FB_VISUAL_MONO01) ? 0 : 1; + + color = (is_fg) ? fg : bg; + break; + } + case 2: + /* + * Scale down 16-colors to 4 colors. Default 4-color palette + * is grayscale. + */ + color /= 4; + break; + case 3: + /* + * Last 8 entries of default 16-color palette is a more intense + * version of the first 8 (i.e., same chrominance, different + * luminance). + */ + color &= 7; + break; + } + + return color; +} + +#define FBCON_ATTRIBUTE_UNDERLINE 1 +#define FBCON_ATTRIBUTE_REVERSE 2 +#define FBCON_ATTRIBUTE_BOLD 4 + +static inline int get_attribute(struct fb_info *info, u16 c) +{ + int attribute = 0; + + if (fb_get_color_depth(info) == 1) { + if (attr_underline(c)) + attribute |= FBCON_ATTRIBUTE_UNDERLINE; + if (attr_reverse(c)) + attribute |= FBCON_ATTRIBUTE_REVERSE; + if (attr_bold(c)) + attribute |= FBCON_ATTRIBUTE_BOLD; + } + + return attribute; +} + +static inline void fbcon_update_attr(u8 *dst, u8 *src, int attribute, + struct vc_data *vc) +{ + int i, offset = (vc->vc_font.height < 10) ? 1 : 2; + int width = (vc->vc_font.width + 7) >> 3; + unsigned int cellsize = vc->vc_font.height * width; + u8 c; + + offset = cellsize - (offset * width); + for (i = 0; i < cellsize; i++) { + c = src[i]; + if (attribute & FBCON_ATTRIBUTE_UNDERLINE && i >= offset) + c = 0xff; + if (attribute & FBCON_ATTRIBUTE_BOLD) + c |= c >> 1; + if (attribute & FBCON_ATTRIBUTE_REVERSE) + c = ~c; + dst[i] = c; + } +} + void accel_bmove(struct vc_data *vc, struct fb_info *info, int sy, int sx, int dy, int dx, int height, int width) { @@ -344,13 +425,19 @@ unsigned int shift_low = 0, mod = vc->vc_font.width % 8; unsigned int shift_high = 8, pitch, cnt, size, k; unsigned int idx = vc->vc_font.width >> 3; + unsigned int attribute = get_attribute(info, scr_readw(s)); struct fb_image image; - u8 *src, *dst; + u8 *src, *dst, *buf = NULL; + + if (attribute) { + buf = kmalloc(cellsize, GFP_KERNEL); + if (!buf) + return; + } + + image.fg_color = get_color(vc, info, scr_readw(s), 1); + image.bg_color = get_color(vc, info, scr_readw(s), 0); - image.fg_color = attr_fgcol((vc->vc_hi_font_mask) ? 9 : 8, - scr_readw(s)); - image.bg_color = attr_bgcol((vc->vc_hi_font_mask) ? 13 : 12, - scr_readw(s)); image.dx = xx * vc->vc_font.width; image.dy = yy * vc->vc_font.height; image.height = vc->vc_font.height; @@ -380,6 +467,12 @@ while (k--) { src = vc->vc_font.data + (scr_readw(s++)& charmask)*cellsize; + + if (attribute) { + fbcon_update_attr(buf, src, attribute, vc); + src = buf; + } + move_unaligned(info, &info->pixmap, dst, pitch, src, idx, image.height, shift_high, shift_low, mod); @@ -392,6 +485,12 @@ while (k--) { src = vc->vc_font.data + (scr_readw(s++)& charmask)*cellsize; + + if (attribute) { + fbcon_update_attr(buf, src, attribute, vc); + src = buf; + } + move_aligned(info, &info->pixmap, dst, pitch, src, idx, image.height); dst += width; @@ -401,6 +500,9 @@ image.dx += cnt * vc->vc_font.width; count -= cnt; } + + if (buf) + kfree(buf); } void accel_clear_margins(struct vc_data *vc, struct fb_info *info, @@ -439,8 +541,50 @@ * Low Level Operations */ /* NOTE: fbcon cannot be __init: it may be called from take_over_console later */ +static int var_to_display(struct display *disp, + struct fb_var_screeninfo *var, + struct fb_info *info) +{ + disp->xres_virtual = var->xres_virtual; + disp->yres_virtual = var->yres_virtual; + disp->bits_per_pixel = var->bits_per_pixel; + disp->grayscale = var->grayscale; + disp->nonstd = var->nonstd; + disp->accel_flags = var->accel_flags; + disp->height = var->height; + disp->width = var->width; + disp->red = var->red; + disp->green = var->green; + disp->blue = var->blue; + disp->transp = var->transp; + disp->mode = fb_match_mode(var, &info->modelist); + if (disp->mode == NULL) + /* This should not happen */ + return -EINVAL; + return 0; +} + +static void display_to_var(struct fb_var_screeninfo *var, + struct display *disp) +{ + fb_videomode_to_var(var, disp->mode); + var->xres_virtual = disp->xres_virtual; + var->yres_virtual = disp->yres_virtual; + var->bits_per_pixel = disp->bits_per_pixel; + var->grayscale = disp->grayscale; + var->nonstd = disp->nonstd; + var->accel_flags = disp->accel_flags; + var->height = disp->height; + var->width = disp->width; + var->red = disp->red; + var->green = disp->green; + var->blue = disp->blue; + var->transp = disp->transp; +} + static const char *fbcon_startup(struct vt_struct *vt, int init) { + struct display *p = &fb_display[vt->first_vc]; struct vc_data *vc = vt->default_mode; struct font_desc *font = NULL; struct module *owner; @@ -494,17 +638,19 @@ } /* Setup default font */ - if (!fontname[0] || !(font = find_font(fontname))) - font = get_default_font(info->var.xres, - info->var.yres); - vc->vc_font.width = font->width; - vc->vc_font.height = font->height; - vc->vc_font.data = font->data; - vc->vc_font.charcount = 256; /* FIXME Need to support more fonts */ + if (!p->fontdata) { + if (!fontname[0] || !(font = find_font(fontname))) + font = get_default_font(info->var.xres, + info->var.yres); + vc->vc_font.width = font->width; + vc->vc_font.height = font->height; + vc->vc_font.data = p->fontdata = font->data; + vc->vc_font.charcount = 256; /* FIXME Need to support more fonts */ + } vc->vc_cols = info->var.xres/vc->vc_font.width; vc->vc_rows = info->var.yres/vc->vc_font.height; - vc->vc_can_do_color = info->var.bits_per_pixel != 1; + vc->vc_can_do_color = (fb_get_color_depth(info) != 1); DPRINTK("mode: %s\n", info->fix.id); DPRINTK("visual: %d\n", info->fix.visual); @@ -606,6 +752,9 @@ info->var.xoffset = info->var.yoffset = p->yscroll = 0; /* reset wrap/pan */ + if (var_to_display(p, &info->var, info)) + return; + /* If we are not the first console on this fb, copy the font from that console */ t = &fb_display[vc->display_fg->fg_console->vc_num]; @@ -665,9 +814,15 @@ if (logo) { /* Need to make room for the logo */ - int cnt; + int cnt, erase = vc->vc_video_erase_char; int step; + /* + * remove underline attribute from erase character + * if black and white framebuffer. + */ + if (fb_get_color_depth(info) == 1) + erase &= ~0x400; logo_height = fb_prepare_logo(info); logo_lines = (logo_height + vc->vc_font.height - 1) / vc->vc_font.height; @@ -681,8 +836,7 @@ save = kmalloc(logo_lines * new_cols * 2, GFP_KERNEL); if (save) { int i = cols < new_cols ? cols : new_cols; - scr_memsetw(save, vc->vc_video_erase_char, - logo_lines * new_cols * 2); + scr_memsetw(save, erase, logo_lines * new_cols * 2); r = q - step; for (cnt = 0; cnt < logo_lines; cnt++, r += i) scr_memcpyw(save + cnt * new_cols, r, 2 * i); @@ -702,7 +856,7 @@ } } scr_memsetw((unsigned short *) vc->vc_origin, - vc->vc_video_erase_char, + erase, vc->vc_size_row * logo_lines); if (IS_VISIBLE && vc->vc_mode == KD_TEXT) { @@ -810,55 +964,6 @@ } -static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) -{ - struct fb_info *info = (struct fb_info *)vc->display_fg->data_hook; - unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; - unsigned int scan_align = info->pixmap.scan_align - 1; - unsigned int buf_align = info->pixmap.buf_align - 1; - unsigned int width = (vc->vc_font.width + 7) >> 3; - int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; - int fgshift = (vc->vc_hi_font_mask) ? 9 : 8; - struct display *p = &fb_display[vc->vc_num]; - unsigned int size, pitch; - struct fb_image image; - u8 *src, *dst; - - if (!info->fbops->fb_blank && vc->display_fg->vt_blanked) - return; - if (info->state != FBINFO_STATE_RUNNING) - return; - - if (vc->vc_mode != KD_TEXT) - return; - - image.dx = xpos * vc->vc_font.width; - image.dy = real_y(p, ypos) * vc->vc_font.height; - image.width = vc->vc_font.width; - image.height = vc->vc_font.height; - image.fg_color = attr_fgcol(fgshift, c); - image.bg_color = attr_bgcol(bgshift, c); - image.depth = 1; - - src = vc->vc_font.data + (c & charmask) * vc->vc_font.height * width; - - pitch = width + scan_align; - pitch &= ~scan_align; - size = pitch * vc->vc_font.height; - size += buf_align; - size &= ~buf_align; - - dst = fb_get_buffer_offset(info, &info->pixmap, size); - image.data = dst; - - if (info->pixmap.outbuf) - fb_iomove_buf_aligned(info, &info->pixmap, dst, pitch, src, width, image.height); - else - fb_sysmove_buf_aligned(info, &info->pixmap, dst, pitch, src, width, image.height); - - info->fbops->fb_imageblit(info, &image); -} - static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, int count, int ypos, int xpos) { @@ -876,16 +981,21 @@ accel_putcs(vc, info, s, count, real_y(p, ypos), xpos); } +static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) +{ + fbcon_putcs(vc, (const unsigned short *) &c, 1, ypos, xpos); +} + static void fbcon_cursor(struct vc_data *vc, int mode) { + struct fb_cursor cursor; struct fb_info *info = (struct fb_info *)vc->display_fg->data_hook; unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; - int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; - int fgshift = (vc->vc_hi_font_mask) ? 9 : 8; struct display *p = &fb_display[vc->vc_num]; int w = (vc->vc_font.width + 7) >> 3, c; - int y = real_y(p, vc->vc_y); - struct fb_cursor cursor; + int y = real_y(p, vc->vc_y), fg, bg; + int attribute; + u8 *src; if (mode & CM_SOFTBACK) { mode &= ~CM_SOFTBACK; @@ -899,8 +1009,22 @@ fbcon_set_origin(vc); c = scr_readw((u16 *) vc->vc_pos); + attribute = get_attribute(info, c); + src = vc->vc_font.data + ((c & charmask) * (w * vc->vc_font.height)); + if (attribute) { + u8 *dst; - cursor.image.data = vc->vc_font.data + ((c & charmask) * (w * vc->vc_font.height)); + dst = kmalloc(w * vc->vc_font.height, GFP_ATOMIC); + if (!dst) + return; + if (info->cursor.data) + kfree(info->cursor.data); + info->cursor.data = dst; + fbcon_update_attr(dst, src, attribute, vc); + src = dst; + } + + cursor.image.data = src; cursor.set = FB_CUR_SETCUR; cursor.image.depth = 1; @@ -915,11 +1039,13 @@ case CM_MOVE: case CM_DRAW: info->cursor.enable = 1; - - if (info->cursor.image.fg_color != attr_fgcol(fgshift, c) || - info->cursor.image.bg_color != attr_bgcol(bgshift, c)) { - cursor.image.fg_color = attr_fgcol(fgshift, c); - cursor.image.bg_color = attr_bgcol(bgshift, c); + fg = get_color(vc, info, c, 1); + bg = get_color(vc, info, c, 0); + + if (info->cursor.image.fg_color != fg || + info->cursor.image.bg_color != bg) { + cursor.image.fg_color = fg; + cursor.image.bg_color = bg; cursor.set |= FB_CUR_SETCMAP; } @@ -942,17 +1068,19 @@ cursor.set |= FB_CUR_SETHOT; } - if ((cursor.set & FB_CUR_SETSIZE) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape) + if ((cursor.set & FB_CUR_SETSIZE) || + ((vc->vc_cursor_type & 0x0f) != p->cursor_shape) || info->cursor.mask == NULL) { char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC); int cur_height, size, i = 0; + u8 msk = 0xff; - if (!mask) return; + if (!mask) + return; if (info->cursor.mask) kfree(info->cursor.mask); info->cursor.mask = mask; - p->cursor_shape = vc->vc_cursor_type & 0x0f; cursor.set |= FB_CUR_SETSHAPE; @@ -979,10 +1107,10 @@ } size = (vc->vc_font.height - cur_height) * w; while (size--) - mask[i++] = 0; + mask[i++] = ~msk; size = cur_height * w; while (size--) - mask[i++] = 0xff; + mask[i++] = msk; } info->cursor.rop = ROP_XOR; info->fbops->fb_cursor(info, &cursor); @@ -1646,7 +1774,7 @@ struct fb_info *info = (struct fb_info *)vc->display_fg->data_hook; struct display *p = &fb_display[vc->vc_num]; struct fb_var_screeninfo var = info->var; - int err; int x_diff, y_diff; + int x_diff, y_diff; int fw = vc->vc_font.width; int fh = vc->vc_font.height; @@ -1655,15 +1783,31 @@ x_diff = info->var.xres - var.xres; y_diff = info->var.yres - var.yres; if (x_diff < 0 || x_diff > fw || (y_diff < 0 || y_diff > fh)) { - char mode[40]; + struct fb_videomode *mode; DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); - snprintf(mode, 40, "%ix%i", var.xres, var.yres); - err = fb_find_mode(&var, info, mode, info->monspecs.modedb, - info->monspecs.modedb_len, NULL, - info->var.bits_per_pixel); - if (!err || width > var.xres/fw || height > var.yres/fh) + mode = fb_find_best_mode(&var, &info->modelist); + if (mode == NULL) return -EINVAL; + fb_videomode_to_var(&var, mode); + if (width > var.xres/fw || height > var.yres/fh) + return -EINVAL; + /* + * The following can probably have any value... Do we need to + * set all of them? + */ + var.bits_per_pixel = p->bits_per_pixel; + var.xres_virtual = p->xres_virtual; + var.yres_virtual = p->yres_virtual; + var.accel_flags = p->accel_flags; + var.width = p->width; + var.height = p->height; + var.red = p->red; + var.green = p->green; + var.blue = p->blue; + var.transp = p->transp; + var.nonstd = p->nonstd; + DPRINTK("resize now %ix%i\n", var.xres, var.yres); if (IS_VISIBLE) { var.activate = FB_ACTIVATE_NOW | @@ -1671,6 +1815,7 @@ fb_set_var(info, &var); info->flags &= ~FBINFO_MISC_MODESWITCH; } + var_to_display(p, &info->var, info); } updatescrollmode(p, info, vc); return 0; @@ -1714,6 +1859,10 @@ info->flags &= ~FBINFO_MISC_MODESWITCH; } + vc->vc_can_do_color = (fb_get_color_depth(info) != 1); + vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800; + updatescrollmode(p, info, vc); + switch (p->scrollmode) { case SCROLL_WRAP_MOVE: scrollback_phys_max = p->vrows - vc->vc_rows; @@ -2108,26 +2257,31 @@ static int fbcon_set_palette(struct vc_data *vc, unsigned char *table) { struct fb_info *info = (struct fb_info *)vc->display_fg->data_hook; - int i, j, k; + int i, j, k, depth; u8 val; - if (!vc->vc_can_do_color - || (!info->fbops->fb_blank && vc->display_fg->vt_blanked)) + if (!info->fbops->fb_blank && vc->display_fg->vt_blanked) return -EINVAL; - for (i = j = 0; i < 16; i++) { - k = table[i]; - val = vc->vc_palette[j++]; - palette_red[k] = (val << 8) | val; - val = vc->vc_palette[j++]; - palette_green[k] = (val << 8) | val; - val = vc->vc_palette[j++]; - palette_blue[k] = (val << 8) | val; - } - if (info->var.bits_per_pixel <= 4) - palette_cmap.len = 1 << info->var.bits_per_pixel; - else + depth = fb_get_color_depth(info); + if (depth > 3) { + for (i = j = 0; i < 16; i++) { + k = table[i]; + val = vc->vc_palette[j++]; + palette_red[k] = (val << 8) | val; + val = vc->vc_palette[j++]; + palette_green[k] = (val << 8) | val; + val = vc->vc_palette[j++]; + palette_blue[k] = (val << 8) | val; + } palette_cmap.len = 16; - palette_cmap.start = 0; + palette_cmap.start = 0; + /* + * If framebuffer is capable of less than 16 colors, + * use default palette of fbcon. + */ + } else + fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); + return fb_set_cmap(&palette_cmap, info); } @@ -2333,10 +2487,9 @@ p = &fb_display[vc->vc_num]; info->var.xoffset = info->var.yoffset = p->yscroll = 0; - vc->vc_can_do_color = info->var.bits_per_pixel != 1; - vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800; if (IS_VISIBLE) { + var_to_display(p, &info->var, info); cols = info->var.xres / vc->vc_font.width; rows = info->var.yres / vc->vc_font.height; vc_resize(vc, cols, rows); @@ -2359,37 +2512,27 @@ } } -/* - * The console `switch' structure for the frame buffer based console - */ +static int fbcon_mode_deleted(struct fb_info *info, + struct fb_videomode *mode) +{ + struct vt_struct *vt = info->display_fg; + struct display *p; + int i, found = 0; -const struct consw fb_con = { - .owner = THIS_MODULE, - .con_startup = fbcon_startup, - .con_init = fbcon_init, - .con_deinit = fbcon_deinit, - .con_clear = fbcon_clear, - .con_putc = fbcon_putc, - .con_putcs = fbcon_putcs, - .con_cursor = fbcon_cursor, - .con_scroll_region = fbcon_scroll_region, - .con_bmove = fbcon_bmove, - .con_switch = fbcon_switch, - .con_blank = fbcon_blank, - .con_font_set = fbcon_set_font, - .con_font_get = fbcon_get_font, - .con_font_default = fbcon_set_def_font, - .con_font_copy = fbcon_copy_font, - .con_set_palette = fbcon_set_palette, - .con_scroll = fbcon_scroll, - .con_set_origin = fbcon_set_origin, - .con_invert_region = fbcon_invert_region, - .con_screen_pos = fbcon_screen_pos, - .con_getxy = fbcon_getxy, - .con_resize = fbcon_resize, -}; + /* before deletion, ensure that mode is not in use */ + for (i = vt->first_vc; i <= vt->first_vc + vt->vc_count; i++) { + p = &fb_display[i]; + if (!p || !p->mode) + continue; + if (fb_mode_is_equal(p->mode, mode)) { + found = 1; + break; + } + } + return found; +} -int fbcon_add(struct fb_info *info) +static int fbcon_fb_registered(struct fb_info *info) { const char *display_desc = NULL; struct vt_struct *vt; @@ -2440,7 +2583,11 @@ static int fbcon_event_notify(struct notifier_block *self, unsigned long action, void *data) { - struct fb_info *info = (struct fb_info *) data; + struct fb_event *event = (struct fb_event *) data; + struct fb_info *info = event->info; + struct fb_videomode *mode; + struct fb_con2fbmap *con2fb; + int ret = 0; switch(action) { case FB_EVENT_SUSPEND: @@ -2452,25 +2599,68 @@ case FB_EVENT_MODE_CHANGE: fbcon_modechanged(info); break; - case FB_EVENT_ADD_CONSOLE: - fbcon_add(info); + case FB_EVENT_MODE_DELETE: + mode = (struct fb_videomode *) event->data; + ret = fbcon_mode_deleted(info, mode); break; - case FB_EVENT_DELETE_CONSOLE: + case FB_EVENT_FB_REGISTERED: + ret = fbcon_fb_registered(info); + break; + case FB_EVENT_SET_CONSOLE_MAP: + con2fb = (struct fb_con2fbmap *) event->data; + ret = set_con2fb_map(con2fb->console - 1, con2fb->framebuffer); + break; + case FB_EVENT_GET_CONSOLE_MAP: + con2fb = (struct fb_con2fbmap *) event->data; + con2fb->framebuffer = con2fb_map[con2fb->console - 1]; break; } - return 0; + + return ret; } +/* + * The console `switch' structure for the frame buffer based console + */ + +const struct consw fb_con = { + .owner = THIS_MODULE, + .con_startup = fbcon_startup, + .con_init = fbcon_init, + .con_deinit = fbcon_deinit, + .con_clear = fbcon_clear, + .con_putc = fbcon_putc, + .con_putcs = fbcon_putcs, + .con_cursor = fbcon_cursor, + .con_scroll_region = fbcon_scroll_region, + .con_bmove = fbcon_bmove, + .con_switch = fbcon_switch, + .con_blank = fbcon_blank, + .con_font_set = fbcon_set_font, + .con_font_get = fbcon_get_font, + .con_font_default = fbcon_set_def_font, + .con_font_copy = fbcon_copy_font, + .con_set_palette = fbcon_set_palette, + .con_scroll = fbcon_scroll, + .con_set_origin = fbcon_set_origin, + .con_invert_region = fbcon_invert_region, + .con_screen_pos = fbcon_screen_pos, + .con_getxy = fbcon_getxy, + .con_resize = fbcon_resize, +}; + static struct notifier_block fbcon_event_notifer = { .notifier_call = fbcon_event_notify, }; -static int fbcon_event_notifier_registered; - int __init fb_console_init(void) { int unit; + acquire_console_sem(); + fb_register_client(&fbcon_event_notifer); + release_console_sem(); + if(!vt2fb[0]) vt2fb[0] = TAKE_OVER_CONSOLE; @@ -2478,28 +2668,17 @@ if(!vt2fb[unit]) vt2fb[unit] = MAX_NR_USER_CONSOLES; - if (!num_registered_fb) - return -ENODEV; - - for(unit = 0; unit < num_registered_fb; unit++) - fbcon_add(registered_fb[unit]); + if (num_registered_fb) + for(unit = 0; unit < num_registered_fb; unit++) + fbcon_fb_registered(registered_fb[unit]); - acquire_console_sem(); - if (!fbcon_event_notifier_registered) { - fb_register_client(&fbcon_event_notifer); - fbcon_event_notifier_registered = 1; - } - release_console_sem(); return 0; } void __exit fb_console_exit(void) { acquire_console_sem(); - if (fbcon_event_notifier_registered) { - fb_unregister_client(&fbcon_event_notifer); - fbcon_event_notifier_registered = 0; - } + fb_unregister_client(&fbcon_event_notifer); release_console_sem(); // give_up_console(&fb_con); } Index: fbcon.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/fbcon.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- fbcon.h 24 Aug 2004 05:31:54 -0000 1.5 +++ fbcon.h 22 Oct 2004 07:46:17 -0000 1.6 @@ -33,6 +33,19 @@ short yscroll; /* Hardware scrolling */ int vrows; /* number of virtual rows */ int cursor_shape; + u32 xres_virtual; + u32 yres_virtual; + u32 height; + u32 width; + u32 bits_per_pixel; + u32 grayscale; + u32 nonstd; + u32 accel_flags; + struct fb_bitfield red; + struct fb_bitfield green; + struct fb_bitfield blue; + struct fb_bitfield transp; + struct fb_videomode *mode; }; /* drivers/video/console/fbcon.c */ @@ -57,8 +70,8 @@ /* Monochrome */ #define attr_bold(s) \ ((s) & 0x200) -#define attr_reverse(s, inverse) \ - (((s) & 0x800) ^ (inverse ? 0x800 : 0)) +#define attr_reverse(s) \ + ((s) & 0x800) #define attr_underline(s) \ ((s) & 0x400) #define attr_blink(s) \ |