oldlatches.c
来自「Linux内核源代码 为压缩文件 是<<Linux内核>>」· C语言 代码 · 共 66 行
C
66 行
/* * 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()) { latch_a_copy = (latch_a_copy & ~mask) | newdata; printk("Latch: A = 0x%02x\n", latch_a_copy); __raw_writeb(latch_a_copy, LATCHA_BASE); } else BUG();}/* newval=(oldval & ~mask)|newdata */void oldlatch_bupdate(unsigned char mask,unsigned char newdata){ if (machine_is_archimedes()) { latch_b_copy = (latch_b_copy & ~mask) | newdata; printk("Latch: B = 0x%02x\n", latch_b_copy); __raw_writeb(latch_b_copy, LATCHB_BASE); } else BUG();}static void __init oldlatch_init(void){ if (machine_is_archimedes()) { oldlatch_aupdate(0xff, 0xff); /* Thats no FDC reset...*/ oldlatch_bupdate(0xff, LATCHB_FDCRESET); }}initcall(oldlatch_init);EXPORT_SYMBOL(oldlatch_aupdate);EXPORT_SYMBOL(oldlatch_bupdate);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?