Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
oldlatches.c
Package: linux-2.4.20.tar.gz [view]
Upload User: jlfgdled
Upload Date: 2013-04-10
Package Size: 33168k
Code Size: 2k
Category:
Linux-Unix program
Development Platform:
Unix_Linux
- /*
- * linux/arch/arm/kernel/oldlatches.c
- *
- * Copyright (C) David Alan Gilbert 1995/1996,2000
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Support for the latches on the old Archimedes which control the floppy,
- * hard disc and printer
- */
- #include <linux/module.h>
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/sched.h>
- #include <asm/io.h>
- #include <asm/hardware.h>
- #include <asm/mach-types.h>
- #include <asm/arch/oldlatches.h>
- static unsigned char latch_a_copy;
- static unsigned char latch_b_copy;
- /* newval=(oldval & ~mask)|newdata */
- void oldlatch_aupdate(unsigned char mask,unsigned char newdata)
- {
- if (machine_is_archimedes()) {
- unsigned long flags;
- local_save_flags(flags);
- latch_a_copy = (latch_a_copy & ~mask) | newdata;
- __raw_writeb(latch_a_copy, LATCHA_BASE);
- local_restore_flags(flags);
- printk("Latch: A = 0x%02xn", latch_a_copy);
- } else
- BUG();
- }
- /* newval=(oldval & ~mask)|newdata */
- void oldlatch_bupdate(unsigned char mask,unsigned char newdata)
- {
- if (machine_is_archimedes()) {
- unsigned long flags;
- local_save_flags(flags);
- latch_b_copy = (latch_b_copy & ~mask) | newdata;
- __raw_writeb(latch_b_copy, LATCHB_BASE);
- local_restore_flags(flags);
- printk("Latch: B = 0x%02xn", latch_b_copy);
- } else
- BUG();
- }
- static int __init oldlatch_init(void)
- {
- if (machine_is_archimedes()) {
- oldlatch_aupdate(0xff, 0xff);
- /* Thats no FDC reset...*/
- oldlatch_bupdate(0xff, LATCHB_FDCRESET);
- }
- return 0;
- }
- __initcall(oldlatch_init);
- EXPORT_SYMBOL(oldlatch_aupdate);
- EXPORT_SYMBOL(oldlatch_bupdate);