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...> - 2003-08-11 16:42:00
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video In directory sc8-pr-cvs1:/tmp/cvs-serv30601/video Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video added to the repository |
From: James S. <jsi...@us...> - 2003-08-11 16:42:00
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux In directory sc8-pr-cvs1:/tmp/cvs-serv30762/linux Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux added to the repository |
From: James S. <jsi...@us...> - 2003-08-11 16:38:09
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1:/tmp/cvs-serv30919/ruby-2.6/drivers/char Added Files: Kconfig Makefile console_macros.h consolemap.c decvte.c keyboard.c n_tty.c selection.c sysrq.c tty_io.c vc_screen.c vt.c vt_ioctl.c Log Message: Synced to 2.6.0-test3 --- NEW FILE: Kconfig --- # # Character device configuration # menu "Character devices" config VT bool "Virtual terminal" if EMBEDDED requires INPUT=y default y ---help--- If you say Y here, you will get support for terminal devices with display and keyboard devices. These are called "virtual" because you can run several virtual terminals (also called virtual consoles) on one physical terminal. This is rather useful, for example one virtual terminal can collect system messages and warnings, another one can be used for a text-mode user session, and a third could run an X session, all in parallel. Switching between virtual terminals is done with certain key combinations, usually Alt-<function key>. [...977 lines suppressed...] Semiconductor SCx200 processors. If compiled as a module, it will be called scx200_gpio. config RAW_DRIVER tristate "RAW driver (/dev/raw/rawN)" help The raw driver permits block devices to be bound to /dev/raw/rawN. Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O. See the raw(8) manpage for more details. config HANGCHECK_TIMER tristate "Hangcheck timer" help The hangcheck-timer module detects when the system has gone out to lunch past a certain margin. It can reboot the system or merely print a warning. endmenu --- NEW FILE: Makefile --- # # Makefile for the kernel character device drivers. # # # This file contains the font map for the default (hardware) font # FONTMAPFILE = cp437.uni obj-y += mem.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o random.o obj-$(CONFIG_VT) += vt_ioctl.o decvte.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o obj-$(CONFIG_ROCKETPORT) += rocket.o obj-$(CONFIG_MOXA_SMARTIO) += mxser.o obj-$(CONFIG_MOXA_INTELLIO) += moxa.o obj-$(CONFIG_DIGI) += pcxx.o obj-$(CONFIG_DIGIEPCA) += epca.o obj-$(CONFIG_CYCLADES) += cyclades.o obj-$(CONFIG_STALLION) += stallion.o obj-$(CONFIG_ISTALLION) += istallion.o obj-$(CONFIG_COMPUTONE) += ip2.o ip2main.o obj-$(CONFIG_RISCOM8) += riscom8.o obj-$(CONFIG_ISI) += isicom.o obj-$(CONFIG_ESPSERIAL) += esp.o obj-$(CONFIG_SYNCLINK) += synclink.o obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o obj-$(CONFIG_N_HDLC) += n_hdlc.o obj-$(CONFIG_SPECIALIX) += specialix.o obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o obj-$(CONFIG_SX) += sx.o generic_serial.o obj-$(CONFIG_RIO) += rio/ generic_serial.o obj-$(CONFIG_SH_SCI) += sh-sci.o generic_serial.o obj-$(CONFIG_SERIAL167) += serial167.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_HVC_CONSOLE) += hvc_console.o obj-$(CONFIG_RAW_DRIVER) += raw.o obj-$(CONFIG_PRINTER) += lp.o obj-$(CONFIG_TIPAR) += tipar.o obj-$(CONFIG_PC9800_OLDLP) += lp_old98.o obj-$(CONFIG_BUSMOUSE) += busmouse.o obj-$(CONFIG_DTLK) += dtlk.o obj-$(CONFIG_R3964) += n_r3964.o obj-$(CONFIG_APPLICOM) += applicom.o obj-$(CONFIG_SONYPI) += sonypi.o obj-$(CONFIG_RTC) += rtc.o obj-$(CONFIG_GEN_RTC) += genrtc.o obj-$(CONFIG_EFI_RTC) += efirtc.o ifeq ($(CONFIG_PPC),) obj-$(CONFIG_NVRAM) += nvram.o endif obj-$(CONFIG_TOSHIBA) += toshiba.o 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_H8) += h8.o obj-$(CONFIG_PPDEV) += ppdev.o obj-$(CONFIG_DZ) += dz.o obj-$(CONFIG_NWBUTTON) += nwbutton.o obj-$(CONFIG_NWFLASH) += nwflash.o obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o obj-$(CONFIG_WATCHDOG) += watchdog/ obj-$(CONFIG_MWAVE) += mwave/ obj-$(CONFIG_AGP) += agp/ obj-$(CONFIG_DRM) += drm/ obj-$(CONFIG_PCMCIA) += pcmcia/ obj-$(CONFIG_IPMI_HANDLER) += ipmi/ obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o # Files generated that shall be removed upon make clean clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c quiet_cmd_conmk = CONMK $@ cmd_conmk = scripts/conmakehash $< > $@ $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE) $(call cmd,conmk) $(obj)/defkeymap.o: $(obj)/defkeymap.c $(obj)/qtronixmap.o: $(obj)/qtronixmap.c # Uncomment if you're changing the keymap and have an appropriate # loadkeys version for the map. By default, we'll use the shipped # versions. # GENERATE_KEYMAP := 1 ifdef GENERATE_KEYMAP $(obj)/defkeymap.c $(obj)/qtronixmap.c: $(obj)/%.c: $(src)/%.map loadkeys --mktable $< > $@.tmp sed -e 's/^static *//' $@.tmp > $@ rm $@.tmp endif --- NEW FILE: console_macros.h --- #define cons_num (vc->vc_num) #define video_num_columns (vc->vc_cols) #define video_num_lines (vc->vc_rows) #define video_scan_lines (vc->vc_scan_lines) #define video_size_row (vc->vc_size_row) #define vcmode (vc->vc_mode) #define can_do_color (vc->vc_can_do_color) #define screenbuf (vc->vc_screenbuf) #define screenbuf_size (vc->vc_screenbuf_size) #define screensize (vc->vc_screensize) #define scrollback (vc->vc_scrollback) #define origin (vc->vc_origin) #define scr_top (vc->vc_scr_top) #define visible_origin (vc->vc_visible_origin) #define scr_end (vc->vc_scr_end) #define pos (vc->vc_pos) #define top (vc->vc_top) #define bottom (vc->vc_bottom) #define x (vc->vc_x) #define y (vc->vc_y) #define vc_state (vc->vc_state) #define npar (vc->vc_npar) #define par (vc->vc_par) #define ques (vc->vc_ques) #define attr (vc->vc_attr) #define saved_x (vc->vc_saved_x) #define saved_y (vc->vc_saved_y) #define translate (vc->vc_translate) #define G0_charset (vc->vc_G0_charset) #define G1_charset (vc->vc_G1_charset) #define saved_G0 (vc->vc_saved_G0) #define saved_G1 (vc->vc_saved_G1) #define utf (vc->vc_utf) #define utf_count (vc->vc_utf_count) #define utf_char (vc->vc_utf_char) #define video_erase_char (vc->vc_video_erase_char) #define disp_ctrl (vc->vc_disp_ctrl) #define toggle_meta (vc->vc_toggle_meta) #define decscnm (vc->vc_decscnm) #define decom (vc->vc_decom) #define decawm (vc->vc_decawm) #define deccm (vc->vc_deccm) #define decim (vc->vc_decim) #define deccolm (vc->vc_deccolm) #define need_wrap (vc->vc_need_wrap) #define report_mouse (vc->vc_report_mouse) #define color (vc->vc_color) #define s_color (vc->vc_s_color) #define def_color (vc->vc_def_color) #define foreground (color & 0x0f) #define background (color & 0xf0) #define charset (vc->vc_charset) #define s_charset (vc->vc_s_charset) #define intensity (vc->vc_intensity) #define underline (vc->vc_underline) #define blink (vc->vc_blink) #define reverse (vc->vc_reverse) #define s_intensity (vc->vc_s_intensity) #define s_underline (vc->vc_s_underline) #define s_blink (vc->vc_s_blink) #define s_reverse (vc->vc_s_reverse) #define ulcolor (vc->vc_ulcolor) #define halfcolor (vc->vc_halfcolor) #define tab_stop (vc->vc_tab_stop) #define palette (vc->vc_palette) #define bell_pitch (vc->vc_bell_pitch) #define bell_duration (vc->vc_bell_duration) #define cursor_type (vc->vc_cursor_type) #define complement_mask (vc->vc_complement_mask) #define s_complement_mask (vc->vc_s_complement_mask) #define hi_font_mask (vc->vc_hi_font_mask) #define softcursor_original (vc->display_fg->cursor_original) #define sw (vc->display_fg->vt_sw) #define dectcem (vc->vc_dectcem) #define decscl (vc->vc_decscl) #define c8bit (vc->vc_c8bit) #define d8bit (vc->vc_d8bit) #define shift (vc->vc_shift) #define priv1 (vc->vc_priv1) #define priv2 (vc->vc_priv2) #define priv3 (vc->vc_priv3) #define priv4 (vc->vc_priv4) #define decckm (vc->vc_decckm) #define decsclm (vc->vc_decsclm) #define decarm (vc->vc_decarm) #define decnrcm (vc->vc_decnrcm) #define decnkm (vc->vc_decnkm) #define kam (vc->vc_kam) #define crm (vc->vc_crm) #define lnm (vc->vc_lnm) #define irm (vc->vc_irm) #define GL_charset (vc->vc_GL_charset) #define GR_charset (vc->vc_GR_charset) #define G2_charset (vc->vc_G2_charset) #define G3_charset (vc->vc_G3_charset) #define GS_charset (vc->vc_GS_charset) #define saved_G2 (vc->vc_saved_G2) #define saved_G3 (vc->vc_saved_G3) #define saved_GS (vc->vc_saved_GS) --- NEW FILE: consolemap.c --- /* * consolemap.c * * Mapping from internal code (such as Latin-1 or Unicode or IBM PC code) * to font positions. * * aeb, 950210 * * Support for multiple unimaps by Jakub Jelinek <jj...@ul...>, July 1998 * * Fix bug in inverse translation. Stanislav Voronyi <st...@cn...>, Dec 1998 */ #include <linux/errno.h> #include <linux/mm.h> #include <linux/slab.h> #include <linux/init.h> #include <asm/uaccess.h> #include <linux/consolemap.h> #include <linux/vt_kern.h> static unsigned short translations[][256] = { /* 8-bit Latin-1 mapped to Unicode -- trivial mapping */ { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff }, /* VT100 graphics mapped to Unicode */ { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x2192, 0x2190, 0x2191, 0x2193, 0x002f, 0x2588, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 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, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff }, /* IBM Codepage 437 mapped to Unicode */ { 0x0000, 0x263a, 0x263b, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022, 0x25d8, 0x25cb, 0x25d9, 0x2642, 0x2640, 0x266a, 0x266b, 0x263c, 0x25b6, 0x25c0, 0x2195, 0x203c, 0x00b6, 0x00a7, 0x25ac, 0x21a8, 0x2191, 0x2193, 0x2192, 0x2190, 0x221f, 0x2194, 0x25b2, 0x25bc, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x2302, 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5, 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9, 0x00ff, 0x00d6, 0x00dc, 0x00a2, 0x00a3, 0x00a5, 0x20a7, 0x0192, 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba, 0x00bf, 0x2310, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb, 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510, 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f, 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567, 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b, 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580, 0x03b1, 0x00df, 0x0393, 0x03c0, 0x03a3, 0x03c3, 0x00b5, 0x03c4, 0x03a6, 0x0398, 0x03a9, 0x03b4, 0x221e, 0x03c6, 0x03b5, 0x2229, 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, 0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0 }, /* User mapping -- default to codes for direct font mapping */ { 0xf000, 0xf001, 0xf002, 0xf003, 0xf004, 0xf005, 0xf006, 0xf007, 0xf008, 0xf009, 0xf00a, 0xf00b, 0xf00c, 0xf00d, 0xf00e, 0xf00f, 0xf010, 0xf011, 0xf012, 0xf013, 0xf014, 0xf015, 0xf016, 0xf017, 0xf018, 0xf019, 0xf01a, 0xf01b, 0xf01c, 0xf01d, 0xf01e, 0xf01f, 0xf020, 0xf021, 0xf022, 0xf023, 0xf024, 0xf025, 0xf026, 0xf027, 0xf028, 0xf029, 0xf02a, 0xf02b, 0xf02c, 0xf02d, 0xf02e, 0xf02f, 0xf030, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037, 0xf038, 0xf039, 0xf03a, 0xf03b, 0xf03c, 0xf03d, 0xf03e, 0xf03f, 0xf040, 0xf041, 0xf042, 0xf043, 0xf044, 0xf045, 0xf046, 0xf047, 0xf048, 0xf049, 0xf04a, 0xf04b, 0xf04c, 0xf04d, 0xf04e, 0xf04f, 0xf050, 0xf051, 0xf052, 0xf053, 0xf054, 0xf055, 0xf056, 0xf057, 0xf058, 0xf059, 0xf05a, 0xf05b, 0xf05c, 0xf05d, 0xf05e, 0xf05f, 0xf060, 0xf061, 0xf062, 0xf063, 0xf064, 0xf065, 0xf066, 0xf067, 0xf068, 0xf069, 0xf06a, 0xf06b, 0xf06c, 0xf06d, 0xf06e, 0xf06f, 0xf070, 0xf071, 0xf072, 0xf073, 0xf074, 0xf075, 0xf076, 0xf077, 0xf078, 0xf079, 0xf07a, 0xf07b, 0xf07c, 0xf07d, 0xf07e, 0xf07f, 0xf080, 0xf081, 0xf082, 0xf083, 0xf084, 0xf085, 0xf086, 0xf087, 0xf088, 0xf089, 0xf08a, 0xf08b, 0xf08c, 0xf08d, 0xf08e, 0xf08f, 0xf090, 0xf091, 0xf092, 0xf093, 0xf094, 0xf095, 0xf096, 0xf097, 0xf098, 0xf099, 0xf09a, 0xf09b, 0xf09c, 0xf09d, 0xf09e, 0xf09f, 0xf0a0, 0xf0a1, 0xf0a2, 0xf0a3, 0xf0a4, 0xf0a5, 0xf0a6, 0xf0a7, 0xf0a8, 0xf0a9, 0xf0aa, 0xf0ab, 0xf0ac, 0xf0ad, 0xf0ae, 0xf0af, 0xf0b0, 0xf0b1, 0xf0b2, 0xf0b3, 0xf0b4, 0xf0b5, 0xf0b6, 0xf0b7, 0xf0b8, 0xf0b9, 0xf0ba, 0xf0bb, 0xf0bc, 0xf0bd, 0xf0be, 0xf0bf, 0xf0c0, 0xf0c1, 0xf0c2, 0xf0c3, 0xf0c4, 0xf0c5, 0xf0c6, 0xf0c7, 0xf0c8, 0xf0c9, 0xf0ca, 0xf0cb, 0xf0cc, 0xf0cd, 0xf0ce, 0xf0cf, 0xf0d0, 0xf0d1, 0xf0d2, 0xf0d3, 0xf0d4, 0xf0d5, 0xf0d6, 0xf0d7, 0xf0d8, 0xf0d9, 0xf0da, 0xf0db, 0xf0dc, 0xf0dd, 0xf0de, 0xf0df, 0xf0e0, 0xf0e1, 0xf0e2, 0xf0e3, 0xf0e4, 0xf0e5, 0xf0e6, 0xf0e7, 0xf0e8, 0xf0e9, 0xf0ea, 0xf0eb, 0xf0ec, 0xf0ed, 0xf0ee, 0xf0ef, 0xf0f0, 0xf0f1, 0xf0f2, 0xf0f3, 0xf0f4, 0xf0f5, 0xf0f6, 0xf0f7, 0xf0f8, 0xf0f9, 0xf0fa, 0xf0fb, 0xf0fc, 0xf0fd, 0xf0fe, 0xf0ff } }; /* The standard kernel character-to-font mappings are not invertible -- this is just a best effort. */ #define MAX_GLYPH 512 /* Max possible glyph value */ static int inv_translate[MAX_NR_CONSOLES]; struct uni_pagedir { u16 **uni_pgdir[32]; unsigned long refcount; unsigned long sum; unsigned char *inverse_translations[4]; int readonly; }; static struct uni_pagedir *dflt; static void set_inverse_transl(struct vc_data *vc, struct uni_pagedir *p, int i) { int j, glyph; unsigned short *t = translations[i]; unsigned char *q; if (!p) return; q = p->inverse_translations[i]; if (!q) { q = p->inverse_translations[i] = (unsigned char *) kmalloc(MAX_GLYPH, GFP_KERNEL); if (!q) return; } memset(q, 0, MAX_GLYPH); for (j = 0; j < E_TABSZ; j++) { glyph = conv_uni_to_pc(vc, t[j]); if (glyph >= 0 && glyph < MAX_GLYPH && q[glyph] < 32) { /* prefer '-' above SHY etc. */ q[glyph] = j; } } } void set_translate(struct vc_data *vc, int m) { inv_translate[vc->vc_num] = m; vc->vc_translate = translations[m]; } /* * Inverse translation is impossible for several reasons: * 1. The font<->character maps are not 1-1. * 2. The text may have been written while a different translation map * was active, or using Unicode. * Still, it is now possible to a certain extent to cut and paste non-ASCII. */ unsigned char inverse_translate(struct vc_data *vc, int glyph) { struct uni_pagedir *p; if (glyph < 0 || glyph >= MAX_GLYPH) return 0; else if (!(p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc) || !p->inverse_translations[inv_translate[vc->vc_num]]) return glyph; else return p->inverse_translations[inv_translate[vc->vc_num]][glyph]; } static void update_user_maps(struct vc_data *vc) { struct uni_pagedir *p, *q = NULL; int i; for (i = 0; i < MAX_NR_USER_CONSOLES; i++) { struct vc_data *tmp = vc->display_fg->vc_cons[i]; if (!tmp) continue; p = (struct uni_pagedir *)*tmp->vc_uni_pagedir_loc; if (p && p != q) { set_inverse_transl(tmp, p, USER_MAP); q = p; } } } /* * Load customizable translation table * arg points to a 256 byte translation table. * * The "old" variants are for translation directly to font (using the * 0xf000-0xf0ff "transparent" Unicodes) whereas the "new" variants set * Unicodes explicitly. */ int con_set_trans_old(struct vc_data *vc, unsigned char * arg) { int i; unsigned short *p = translations[USER_MAP]; i = verify_area(VERIFY_READ, (void *)arg, E_TABSZ); if (i) return i; for (i=0; i<E_TABSZ ; i++) { unsigned char uc; __get_user(uc, arg+i); p[i] = UNI_DIRECT_BASE | uc; } update_user_maps(vc); return 0; } int con_get_trans_old(struct vc_data *vc, unsigned char * arg) { int i, ch; unsigned short *p = translations[USER_MAP]; i = verify_area(VERIFY_WRITE, (void *)arg, E_TABSZ); if (i) return i; for (i=0; i<E_TABSZ ; i++) { ch = conv_uni_to_pc(vc, p[i]); __put_user((ch & ~0xff) ? 0 : ch, arg+i); } return 0; } int con_set_trans_new(struct vc_data *vc, ushort * arg) { int i; unsigned short *p = translations[USER_MAP]; i = verify_area(VERIFY_READ, (void *)arg, E_TABSZ*sizeof(unsigned short)); if (i) return i; for (i=0; i<E_TABSZ ; i++) { unsigned short us; __get_user(us, arg+i); p[i] = us; } update_user_maps(vc); return 0; } int con_get_trans_new(struct vc_data *vc, ushort * arg) { int i; unsigned short *p = translations[USER_MAP]; i = verify_area(VERIFY_WRITE, (void *)arg, E_TABSZ*sizeof(unsigned short)); if (i) return i; for (i=0; i<E_TABSZ ; i++) __put_user(p[i], arg+i); return 0; } /* * Unicode -> current font conversion * * A font has at most 512 chars, usually 256. * But one font position may represent several Unicode chars. * A hashtable is somewhat of a pain to deal with, so use a * "paged table" instead. Simulation has shown the memory cost of * this 3-level paged table scheme to be comparable to a hash table. */ extern u8 dfont_unicount[]; /* Defined in console_defmap.c */ extern u16 dfont_unitable[]; static void con_release_unimap(struct uni_pagedir *p) { u16 **p1; int i, j; if (p == dflt) dflt = NULL; for (i = 0; i < 32; i++) { if ((p1 = p->uni_pgdir[i]) != NULL) { for (j = 0; j < 32; j++) if (p1[j]) kfree(p1[j]); kfree(p1); } p->uni_pgdir[i] = NULL; } for (i = 0; i < 4; i++) if (p->inverse_translations[i]) { kfree(p->inverse_translations[i]); p->inverse_translations[i] = NULL; } } void con_free_unimap(struct vc_data *vc) { struct uni_pagedir *p; p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (!p) return; *vc->vc_uni_pagedir_loc = 0; if (--p->refcount) return; con_release_unimap(p); kfree(p); } static int con_unify_unimap(struct vc_data *vc, struct uni_pagedir *p) { struct uni_pagedir *q; int i, j, k; for (i = 0; i < MAX_NR_USER_CONSOLES; i++) { struct vc_data *tmp = vc->display_fg->vc_cons[i]; if (!tmp) continue; q = (struct uni_pagedir *)*tmp->vc_uni_pagedir_loc; if (!q || q == p || q->sum != p->sum) continue; for (j = 0; j < 32; j++) { u16 **p1, **q1; p1 = p->uni_pgdir[j]; q1 = q->uni_pgdir[j]; if (!p1 && !q1) continue; if (!p1 || !q1) break; for (k = 0; k < 32; k++) { if (!p1[k] && !q1[k]) continue; if (!p1[k] || !q1[k]) break; if (memcmp(p1[k], q1[k], 64*sizeof(u16))) break; } if (k < 32) break; } if (j == 32) { q->refcount++; *vc->vc_uni_pagedir_loc = (unsigned long)q; con_release_unimap(p); kfree(p); return 1; } } return 0; } static int con_insert_unipair(struct uni_pagedir *p, u_short unicode, u_short fontpos) { int i, n; u16 **p1, *p2; if (!(p1 = p->uni_pgdir[n = unicode >> 11])) { p1 = p->uni_pgdir[n] = kmalloc(32*sizeof(u16 *), GFP_KERNEL); if (!p1) return -ENOMEM; for (i = 0; i < 32; i++) p1[i] = NULL; } if (!(p2 = p1[n = (unicode >> 6) & 0x1f])) { p2 = p1[n] = kmalloc(64*sizeof(u16), GFP_KERNEL); if (!p2) return -ENOMEM; memset(p2, 0xff, 64*sizeof(u16)); /* No glyphs for the characters (yet) */ } p2[unicode & 0x3f] = fontpos; p->sum += (fontpos << 20) + unicode; return 0; } /* ui is a leftover from using a hashtable, but might be used again */ int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui) { struct uni_pagedir *p, *q; p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p && p->readonly) return -EIO; if (!p || --p->refcount) { q = (struct uni_pagedir *)kmalloc(sizeof(*p), GFP_KERNEL); if (!q) { if (p) p->refcount++; return -ENOMEM; } memset(q, 0, sizeof(*q)); q->refcount=1; *vc->vc_uni_pagedir_loc = (unsigned long)q; } else { if (p == dflt) dflt = NULL; p->refcount++; p->sum = 0; con_release_unimap(p); } return 0; } int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair *list) { struct uni_pagedir *p, *q; int err = 0, err1, i; p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p->readonly) return -EIO; if (!ct) return 0; if (p->refcount > 1) { int j, k; u16 **p1, *p2, l; err1 = con_clear_unimap(vc, NULL); if (err1) return err1; q = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; for (i = 0, l = 0; i < 32; i++) if ((p1 = p->uni_pgdir[i])) for (j = 0; j < 32; j++) if ((p2 = p1[j])) for (k = 0; k < 64; k++, l++) if (p2[k] != 0xffff) { err1 = con_insert_unipair(q, l, p2[k]); if (err1) { p->refcount++; *vc->vc_uni_pagedir_loc = (unsigned long)p; con_release_unimap(q); kfree(q); return err1; } } p = q; } else if (p == dflt) dflt = NULL; while (ct--) { unsigned short unicode, fontpos; __get_user(unicode, &list->unicode); __get_user(fontpos, &list->fontpos); if ((err1 = con_insert_unipair(p, unicode,fontpos)) != 0) err = err1; list++; } if (con_unify_unimap(vc, p)) return err; for (i = 0; i <= 3; i++) set_inverse_transl(vc, p, i); /* Update all inverse translations */ return err; } /* Loads the unimap for the hardware font, as defined in uni_hash.tbl. The representation used was the most compact I could come up 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 i, j, err = 0, err1; u16 *q; struct uni_pagedir *p; if (dflt) { p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if (p == dflt) return 0; dflt->refcount++; *vc->vc_uni_pagedir_loc = (unsigned long)dflt; if (p && --p->refcount) { con_release_unimap(p); kfree(p); } return 0; } /* The default font is always 256 characters */ err = con_clear_unimap(vc, NULL); if (err) return err; p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; q = dfont_unitable; for (i = 0; i < 256; i++) for (j = dfont_unicount[i]; j; j--) { err1 = con_insert_unipair(p, *(q++), i); if (err1) err = err1; } if (con_unify_unimap(vc, p)) { dflt = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; return err; } for (i = 0; i <= 3; i++) set_inverse_transl(vc, p, i); /* Update all inverse translations */ dflt = p; return err; } int con_copy_unimap(struct vc_data *dst, struct vc_data *src) { struct uni_pagedir *q; if (!src || !*src->vc_uni_pagedir_loc) return -EINVAL; if (*dst->vc_uni_pagedir_loc == *src->vc_uni_pagedir_loc) return 0; con_free_unimap(dst); q = (struct uni_pagedir *)*src->vc_uni_pagedir_loc; q->refcount++; *dst->vc_uni_pagedir_loc = (long)q; return 0; } int con_get_unimap(struct vc_data *vc, ushort ct, ushort *uct, struct unipair *list) { int i, j, k, ect; u16 **p1, *p2; struct uni_pagedir *p; ect = 0; if (*vc->vc_uni_pagedir_loc) { p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; for (i = 0; i < 32; i++) if ((p1 = p->uni_pgdir[i])) for (j = 0; j < 32; j++) if ((p2 = *(p1++))) for (k = 0; k < 64; k++) { if (*p2 < MAX_GLYPH && ect++ < ct) { __put_user((u_short)((i<<11)+(j<<6)+k), &list->unicode); __put_user((u_short) *p2, &list->fontpos); list++; } p2++; } } __put_user(ect, uct); return ((ect <= ct) ? 0 : -ENOMEM); } void con_protect_unimap(struct vc_data *vc, int rdonly) { struct uni_pagedir *p = (struct uni_pagedir *) *vc->vc_uni_pagedir_loc; if (p) p->readonly = rdonly; } int conv_uni_to_pc(struct vc_data *vc, long ucs) { int h; u16 **p1, *p2; struct uni_pagedir *p; /* Only 16-bit codes supported at this time */ if (ucs > 0xffff) ucs = 0xfffd; /* U+FFFD: REPLACEMENT CHARACTER */ else if (ucs < 0x20 || ucs >= 0xfffe) return -1; /* Not a printable character */ else if (ucs == 0xfeff || (ucs >= 0x200a && ucs <= 0x200f)) return -2; /* Zero-width space */ /* * UNI_DIRECT_BASE indicates the start of the region in the User Zone * which always has a 1:1 mapping to the currently loaded font. The * UNI_DIRECT_MASK indicates the bit span of the region. */ else if ((ucs & ~UNI_DIRECT_MASK) == UNI_DIRECT_BASE) return ucs & UNI_DIRECT_MASK; if (!*vc->vc_uni_pagedir_loc) return -3; p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; if ((p1 = p->uni_pgdir[ucs >> 11]) && (p2 = p1[(ucs >> 6) & 0x1f]) && (h = p2[ucs & 0x3f]) < MAX_GLYPH) return h; return -4; /* not found */ } /* * This is called at sys_setup time, after memory and the console are * initialized. It must be possible to call kmalloc(..., GFP_KERNEL) * from this function, hence the call from sys_setup. */ void __init console_map_init(void) { struct vt_struct *vt = vt_cons; int i; for (i = 0; i < MAX_NR_USER_CONSOLES; i++) { struct vc_data *vc = vt->vc_cons[i]; if (vc && !*vc->vc_uni_pagedir_loc) con_set_default_unimap(vc); } } --- NEW FILE: decvte.c --- /* * decvte.c - DEC VT terminal emulation code. * Copyright (C) 2002 James Simmons (jsi...@in...) * * 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 * a TTY besides the video system. People can also change the makefile to * support a different emulation if they wanted. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * [...2026 lines suppressed...] G3_charset = LAT1_MAP; break; case 'B': /* ASCII */ G3_charset = LAT1_MAP; break; case 'U': G3_charset = IBMPC_MAP; break; case 'K': G3_charset = USER_MAP; break; } if (charset == 1) set_translate(vc, G3_charset); vc_state = ESinit; return; default: vc_state = ESinit; } } --- NEW FILE: keyboard.c --- /* * linux/drivers/char/keyboard.c * * Written for linux by Johan Myreen as a translation from * the assembly version by Linus (with diacriticals added) * * Some additional features added by Christoph Niemann (ChN), March 1993 * * Loadable keymaps by Risto Kankkunen, May 1993 * * Diacriticals redone & other small changes, ae...@cw..., June 1993 * Added decr/incr_console, dynamic keymaps, Unicode support, * dynamic function/string keys, led setting, Sept 1994 * `Sticky' modifier keys, 951006. * * 11-11-96: SAK should now work in the raw mode (Martin Mares) * * Modified to provide 'generic' keyboard support by Hamish Macdonald * Merge with the m68k keyboard driver and split-off of the PC low-level [...1165 lines suppressed...] { }, /* Terminating entry */ }; MODULE_DEVICE_TABLE(input, kbd_ids); static struct input_handler kbd_handler = { .event = kbd_event, .connect = kbd_connect, .disconnect = kbd_disconnect, .name = "kbd", .id_table = kbd_ids, }; int __init kbd_init(void) { input_register_handler(&kbd_handler); tasklet_enable(&keyboard_tasklet); tasklet_schedule(&keyboard_tasklet); return 0; } --- NEW FILE: n_tty.c --- /* * n_tty.c --- implements the N_TTY line discipline. * * This code used to be in tty_io.c, but things are getting hairy * enough that it made sense to split things off. (The N_TTY * processing has changed so much that it's hardly recognizable, * anyway...) * * Note that the open routine for N_TTY is guaranteed never to return * an error. This is because Linux will fall back to setting a line * to N_TTY if it can not switch to any other line discipline. * * Written by Theodore Ts'o, Copyright 1994. * * This file also contains code originally written by Linus Torvalds, * Copyright 1991, 1992, 1993, and by Julian Cowley, Copyright 1994. * * This file may be redistributed under the terms of the GNU General Public * License. [...1235 lines suppressed...] struct tty_ldisc tty_ldisc_N_TTY = { TTY_LDISC_MAGIC, /* magic */ "n_tty", /* name */ 0, /* num */ 0, /* flags */ n_tty_open, /* open */ n_tty_close, /* close */ n_tty_flush_buffer, /* flush_buffer */ n_tty_chars_in_buffer, /* chars_in_buffer */ read_chan, /* read */ write_chan, /* write */ n_tty_ioctl, /* ioctl */ n_tty_set_termios, /* set_termios */ normal_poll, /* poll */ n_tty_receive_buf, /* receive_buf */ n_tty_receive_room, /* receive_room */ n_tty_write_wakeup /* write_wakeup */ }; --- NEW FILE: selection.c --- /* * linux/drivers/char/selection.c * * This module exports the functions: * * 'int set_selection(const unsigned long arg)' * 'void clear_selection(void)' * 'int paste_selection(struct tty_struct *tty)' * 'int sel_loadlut(const unsigned long arg)' * * Now that /dev/vcs exists, most of this can disappear again. */ #include <linux/module.h> #include <linux/tty.h> #include <linux/sched.h> #include <linux/mm.h> #include <linux/slab.h> #include <linux/types.h> #include <asm/uaccess.h> #include <linux/vt_kern.h> #include <linux/consolemap.h> #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) == ' ') /* Variables for selection control. */ /* Use a dynamic buffer, instead of static (Dec 1994) */ int 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; static char *sel_buffer; /* clear_selection, highlight and highlight_pointer can be called 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(vt_cons->vc_cons[sel_cons], s, e-s+2, 1); } u16 screen_glyph(struct vc_data *vc, int offset) { u16 w = scr_readw(screenpos(vc, offset, 1)); u16 c = w & 0xff; if (w & vc->vc_hi_font_mask) c |= 0x100; return c; } /* use complementary color to show the pointer */ inline static void highlight_pointer(const int where) { complement_pos(vt_cons->vc_cons[sel_cons], where); } static unsigned char sel_pos(int n) { return inverse_translate(vt_cons->vc_cons[sel_cons], screen_glyph(vt_cons->vc_cons[sel_cons], n)); } /* * remove the current selection highlight, if any, * from the console holding the selection. */ void clear_selection(void) { highlight_pointer(-1); /* hide the pointer */ if (sel_start != -1) { highlight(sel_start, sel_end); sel_start = -1; } } /* * User settable table: what characters are to be considered alphabetic? * 256 bits */ static u32 inwordLut[8]={ 0x00000000, /* control chars */ 0x03FF0000, /* digits */ 0x87FFFFFE, /* uppercase and '_' */ 0x07FFFFFE, /* lowercase */ 0x00000000, 0x00000000, 0xFF7FFFFF, /* latin-1 accented letters, not multiplication sign */ 0xFF7FFFFF /* latin-1 accented letters, not division sign */ }; static inline int inword(const unsigned char c) { return ( inwordLut[c>>5] >> (c & 0x1F) ) & 1; } /* set inwordLut contents. Invoked by ioctl(). */ int sel_loadlut(const unsigned long arg) { return copy_from_user(inwordLut, (u32 *)(arg+4), 32) ? -EFAULT : 0; } /* does screen address p correspond to character at LH/RH edge of screen? */ static inline int atedge(const int p, int size_row) { return (!(p % size_row) || !((p + 2) % size_row)); } /* constrain v such that v <= u */ static inline unsigned short limit(const unsigned short v, const unsigned short u) { return (v > u) ? u : v; } /* set the current selection. Invoked by ioctl() or by kernel code. */ int set_selection(const struct tiocl_selection *sel, struct tty_struct *tty, int user) { struct vc_data *vc = (struct vc_data *) tty->driver_data; int sel_mode, new_sel_start, new_sel_end, spc; char *bp, *obp; int i, ps, pe; poke_blanked_console(vc->display_fg); { unsigned short xs, ys, xe, ye; if (user) { if (verify_area(VERIFY_READ, sel, sizeof(*sel))) return -EFAULT; __get_user(xs, &sel->xs); __get_user(ys, &sel->ys); __get_user(xe, &sel->xe); __get_user(ye, &sel->ye); __get_user(sel_mode, &sel->sel_mode); } else { xs = sel->xs; /* set selection from kernel */ ys = sel->ys; xe = sel->xe; ye = sel->ye; sel_mode = sel->sel_mode; } xs--; ys--; xe--; ye--; xs = limit(xs, vc->vc_cols - 1); ys = limit(ys, vc->vc_rows - 1); xe = limit(xe, vc->vc_cols - 1); ye = limit(ye, vc->vc_rows - 1); ps = ys * vc->vc_size_row + (xs << 1); pe = ye * vc->vc_size_row + (xe << 1); if (sel_mode == TIOCL_SELCLEAR) { /* useful for screendump without selection highlights */ clear_selection(); return 0; } if (mouse_reporting(vc) && (sel_mode & TIOCL_SELMOUSEREPORT)) { mouse_report(vc, sel_mode & TIOCL_SELBUTTONMASK, xs, ys); return 0; } } if (ps > pe) /* make sel_start <= sel_end */ { int tmp = ps; ps = pe; pe = tmp; } if (sel_cons != vc->display_fg->fg_console->vc_num) { clear_selection(); sel_cons = vc->display_fg->fg_console->vc_num; } switch (sel_mode) { case TIOCL_SELCHAR: /* character-by-character selection */ new_sel_start = ps; new_sel_end = pe; break; case TIOCL_SELWORD: /* word-by-word selection */ spc = isspace(sel_pos(ps)); for (new_sel_start = ps; ; ps -= 2) { if ((spc && !isspace(sel_pos(ps))) || (!spc && !inword(sel_pos(ps)))) break; new_sel_start = ps; if (!(ps % vc->vc_size_row)) break; } spc = isspace(sel_pos(pe)); for (new_sel_end = pe; ; pe += 2) { if ((spc && !isspace(sel_pos(pe))) || (!spc && !inword(sel_pos(pe)))) break; new_sel_end = pe; if (!((pe + 2) % vc->vc_size_row)) break; } break; case TIOCL_SELLINE: /* line-by-line selection */ new_sel_start = ps - ps % vc->vc_size_row; new_sel_end = pe + vc->vc_size_row - pe % vc->vc_size_row - 2; break; case TIOCL_SELPOINTER: highlight_pointer(pe); return 0; default: return -EINVAL; } /* remove the pointer */ highlight_pointer(-1); /* select to end of line if on trailing space */ if (new_sel_end > new_sel_start && !atedge(new_sel_end, vc->vc_size_row) && isspace(sel_pos(new_sel_end))) { for (pe = new_sel_end + 2; ; pe += 2) if (!isspace(sel_pos(pe)) || atedge(pe, vc->vc_size_row)) break; if (isspace(sel_pos(pe))) new_sel_end = pe; } if (sel_start == -1) /* no current selection */ highlight(new_sel_start, new_sel_end); else if (new_sel_start == sel_start) { if (new_sel_end == sel_end) /* no action required */ return 0; else if (new_sel_end > sel_end) /* extend to right */ highlight(sel_end + 2, new_sel_end); else /* contract from right */ highlight(new_sel_end + 2, sel_end); } else if (new_sel_end == sel_end) { if (new_sel_start < sel_start) /* extend to left */ highlight(new_sel_start, sel_start - 2); else /* contract from left */ highlight(sel_start, new_sel_start - 2); } else /* some other case; start selection from scratch */ { clear_selection(); highlight(new_sel_start, new_sel_end); } sel_start = new_sel_start; sel_end = new_sel_end; /* Allocate a new buffer before freeing the old one ... */ bp = kmalloc((sel_end-sel_start)/2+1, GFP_KERNEL); if (!bp) { printk(KERN_WARNING "selection: kmalloc() failed\n"); clear_selection(); return -ENOMEM; } if (sel_buffer) kfree(sel_buffer); sel_buffer = bp; obp = bp; for (i = sel_start; i <= sel_end; i += 2) { *bp = sel_pos(i); if (!isspace(*bp++)) obp = bp; if (! ((i + 2) % vc->vc_size_row)) { /* strip trailing blanks from line and add newline, unless non-space at end of line. */ if (obp != bp) { bp = obp; *bp++ = '\r'; } obp = bp; } } sel_buffer_lth = bp - sel_buffer; return 0; } /* Insert the contents of the selection buffer into the * queue of the tty associated with the current console. * Invoked by ioctl(). */ int paste_selection(struct tty_struct *tty) { struct vc_data *vc = (struct vc_data *) tty->driver_data; int pasted = 0, count; DECLARE_WAITQUEUE(wait, current); poke_blanked_console(vc->display_fg); add_wait_queue(&vc->paste_wait, &wait); while (sel_buffer && sel_buffer_lth > pasted) { set_current_state(TASK_INTERRUPTIBLE); if (test_bit(TTY_THROTTLED, &tty->flags)) { schedule(); continue; } count = sel_buffer_lth - pasted; 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); return 0; } EXPORT_SYMBOL(set_selection); EXPORT_SYMBOL(paste_selection); --- NEW FILE: sysrq.c --- /* -*- linux-c -*- * * $Id: sysrq.c,v 1.1 2003/08/11 16:26:46 jsimmons Exp $ * * Linux Magic System Request Key Hacks * * (c) 1997 Martin Mares <mj...@at...> * based on ideas by Pavel Machek <pa...@at...> * * (c) 2000 Crutcher Dunnavant <cru...@da...> * overhauled to use key registration * based upon discusions in irc://irc.openprojects.net/#kernelnewbies */ #include <linux/config.h> #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/mm.h> #include <linux/fs.h> #include <linux/tty.h> #include <linux/mount.h> #include <linux/kdev_t.h> #include <linux/major.h> #include <linux/reboot.h> #include <linux/sysrq.h> #include <linux/vt_kern.h> #include <linux/quotaops.h> #include <linux/smp_lock.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/suspend.h> #include <linux/writeback.h> #include <linux/buffer_head.h> /* for fsync_bdev() */ #include <linux/spinlock.h> #include <asm/ptrace.h> extern struct list_head super_blocks; /* 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) { int i; i = key - '0'; console_loglevel = 7; printk("Loglevel set to %d\n", i); console_loglevel = i; } static struct sysrq_key_op sysrq_loglevel_op = { .handler = sysrq_handle_loglevel, .help_msg = "loglevel0-8", .action_msg = "Changing Loglevel", }; /* SAK sysrq handler */ #ifdef CONFIG_VT 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); } static struct sysrq_key_op sysrq_SAK_op = { .handler = sysrq_handle_SAK, .help_msg = "saK", .action_msg = "SAK", }; /* 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) && 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", }; #endif /* CONFIG_VT */ /* reboot sysrq handler */ static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { machine_restart(NULL); } static struct sysrq_key_op sysrq_reboot_op = { .handler = sysrq_handle_reboot, .help_msg = "reBoot", .action_msg = "Resetting", }; static void sysrq_handle_sync(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { emergency_sync(); } static struct sysrq_key_op sysrq_sync_op = { .handler = sysrq_handle_sync, .help_msg = "Sync", .action_msg = "Emergency Sync", }; static void sysrq_handle_mountro(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { emergency_remount(); } static struct sysrq_key_op sysrq_mountro_op = { .handler = sysrq_handle_mountro, .help_msg = "Unmount", .action_msg = "Emergency Remount R/O", }; /* END SYNC SYSRQ HANDLERS BLOCK */ /* SHOW SYSRQ HANDLERS BLOCK */ static void sysrq_handle_showregs(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { if (pt_regs) show_regs(pt_regs); } static struct sysrq_key_op sysrq_showregs_op = { .handler = sysrq_handle_showregs, .help_msg = "showPc", .action_msg = "Show Regs", }; static void sysrq_handle_showstate(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { show_state(); } static struct sysrq_key_op sysrq_showstate_op = { .handler = sysrq_handle_showstate, .help_msg = "showTasks", .action_msg = "Show State", }; static void sysrq_handle_showmem(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { show_mem(); } static struct sysrq_key_op sysrq_showmem_op = { .handler = sysrq_handle_showmem, .help_msg = "showMem", .action_msg = "Show Memory", }; /* SHOW SYSRQ HANDLERS BLOCK */ /* SIGNAL SYSRQ HANDLERS BLOCK */ /* signal sysrq helper function * Sends a signal to all user processes */ static void send_sig_all(int sig) { struct task_struct *p; for_each_process(p) { if (p->mm && p->pid != 1) /* Not swapper, init nor kernel thread */ force_sig(sig, p); } } static void sysrq_handle_term(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { send_sig_all(SIGTERM); console_loglevel = 8; } static struct sysrq_key_op sysrq_term_op = { .handler = sysrq_handle_term, .help_msg = "tErm", .action_msg = "Terminate All Tasks", }; static void sysrq_handle_kill(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { send_sig_all(SIGKILL); console_loglevel = 8; } static struct sysrq_key_op sysrq_kill_op = { .handler = sysrq_handle_kill, .help_msg = "kIll", .action_msg = "Kill All Tasks", }; /* END SIGNAL SYSRQ HANDLERS BLOCK */ /* Key Operations table and lock */ static spinlock_t sysrq_key_table_lock = SPIN_LOCK_UNLOCKED; #define SYSRQ_KEY_TABLE_LENGTH 36 static struct sysrq_key_op *sysrq_key_table[SYSRQ_KEY_TABLE_LENGTH] = { /* 0 */ &sysrq_loglevel_op, /* 1 */ &sysrq_loglevel_op, /* 2 */ &sysrq_loglevel_op, /* 3 */ &sysrq_loglevel_op, /* 4 */ &sysrq_loglevel_op, /* 5 */ &sysrq_loglevel_op, /* 6 */ &sysrq_loglevel_op, /* 7 */ &sysrq_loglevel_op, /* 8 */ &sysrq_loglevel_op, /* 9 */ &sysrq_loglevel_op, /* a */ NULL, /* Don't use for system provided sysrqs, it is handled specially on the sparc and will never arrive */ /* b */ &sysrq_reboot_op, /* c */ NULL, /* d */ NULL, /* e */ &sysrq_term_op, /* f */ NULL, /* g */ NULL, /* h */ NULL, /* i */ &sysrq_kill_op, /* j */ NULL, #ifdef CONFIG_VT /* k */ &sysrq_SAK_op, #else /* k */ NULL, #endif /* l */ NULL, /* m */ &sysrq_showmem_op, /* n */ NULL, /* o */ NULL, /* This will often be registered as 'Off' at init time */ /* p */ &sysrq_showregs_op, /* q */ NULL, #ifdef CONFIG_VT /* r */ &sysrq_unraw_op, #else /* r */ NULL, #endif /* s */ &sysrq_sync_op, /* t */ &sysrq_showstate_op, /* u */ &sysrq_mountro_op, /* v */ NULL, /* May be assigned at init time by SMP VOYAGER */ /* w */ NULL, /* x */ NULL, /* y */ NULL, /* z */ NULL }; /* key2index calculation, -1 on invalid index */ static __inline__ int sysrq_key_table_key2index(int key) { int retval; if ((key >= '0') & (key <= '9')) { retval = key - '0'; } else if ((key >= 'a') & (key <= 'z')) { retval = key + 10 - 'a'; } else { retval = -1; } return retval; } /* * 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. */ struct sysrq_key_op *__sysrq_get_key_op (int key) { struct sysrq_key_op *op_p; int i; i = sysrq_key_table_key2index(key); op_p = (i == -1) ? NULL : sysrq_key_table[i]; return op_p; } void __sysrq_put_key_op (int key, struct sysrq_key_op *op_p) { int i; i = sysrq_key_table_key2index(key); if (i != -1) sysrq_key_table[i] = op_p; } /* * This function is called by the keyboard handler when SysRq is pressed * and any other keycode arrives. */ void handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { if (!sysrq_enabled) return; __sysrq_lock_table(); __handle_sysrq_nolock(key, pt_regs, tty); __sysrq_unlock_table(); } /* * This is the non-locking version of handle_sysrq * It must/can only be called by sysrq key handlers, * as they are inside of the lock */ void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { struct sysrq_key_op *op_p; int orig_log_level; int i, j; if (!sysrq_enabled) return; 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); } else { printk("HELP : "); /* Only print the help msg once per handler */ for (i=0; i<SYSRQ_KEY_TABLE_LENGTH; i++) if (sysrq_key_table[i]) { for (j=0; sysrq_key_table[i] != sysrq_key_table[j]; j++); if (j == i) printk ("%s ", sysrq_key_table[i]->help_msg); } printk ("\n"); console_loglevel = orig_log_level; } } EXPORT_SYMBOL(handle_sysrq); EXPORT_SYMBOL(__handle_sysrq_nolock); EXPORT_SYMBOL(__sysrq_lock_table); EXPORT_SYMBOL(__sysrq_unlock_table); EXPORT_SYMBOL(__sysrq_get_key_op); EXPORT_SYMBOL(__sysrq_put_key_op); --- NEW FILE: tty_io.c --- /* * linux/drivers/char/tty_io.c * * Copyright (C) 1991, 1992 Linus Torvalds */ /* * 'tty_io.c' gives an orthogonal feeling to tty's, be they consoles * or rs-channels. It also implements echoing, cooked mode etc. * * Kill-line thanks to John T Kohl, who also corrected VMIN = VTIME = 0. * * Modified by Theodore Ts'o, 9/14/92, to dynamically allocate the * tty_struct and tty_queue structures. Previously there was an array * of 256 tty_struct's which was statically allocated, and the * tty_queue structures were allocated at boot time. Both are now * dynamically allocated only when the tty is open. * * Also restructured routines so that there is more of a separation [...2461 lines suppressed...] #ifdef CONFIG_DIGIEPCA pc_init(); #endif #ifdef CONFIG_SPECIALIX specialix_init(); #endif #if (defined(CONFIG_8xx) || defined(CONFIG_8260)) rs_8xx_init(); #endif /* CONFIG_8xx */ pty_init(); #ifdef CONFIG_MOXA_INTELLIO moxa_init(); #endif #ifdef CONFIG_TN3270 tub3270_init(); #endif #ifdef CONFIG_A2232 a2232board_init(); #endif } --- NEW FILE: vc_screen.c --- /* * linux/drivers/char/vc_screen.c * * Provide access to virtual console memory. * /dev/vcs0: the screen as it is being viewed right now (possibly scrolled) * /dev/vcsN: the screen of /dev/ttyN (1 <= N <= 63) * [minor: N] * * /dev/vcsaN: idem, but including attributes, and prefixed with * the 4 bytes lines,columns,x,y (as screendump used to give). * Attribute/character pair is in native endianity. * [minor: N+128] * * This replaces screendump and part of selection, so that the system * administrator can control access using file system permissions. * * ae...@cw... - efter Friedas begravelse - 950211 * * ma...@k3... - modified not to send characters to wrong console * - fixed some fatal off-by-one bugs (0-- no longer == -1 -> looping and looping and looping...) * - making it shorter - scr_readw are macros which expand in PRETTY long code */ #include <linux/config.h> #include <linux/kernel.h> #include <linux/major.h> #include <linux/errno.h> #include <linux/tty.h> #include <linux/devfs_fs_kernel.h> #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/mm.h> #include <linux/init.h> #include <linux/vt_kern.h> #include <linux/selection.h> #include <linux/console.h> #include <linux/smp_lock.h> #include <asm/uaccess.h> #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) { return screenpos(vc, 2 * w_offset, viewed); } void getconsxy(struct vc_data *vc, char *p) { p[0] = vc->vc_x; p[1] = vc->vc_y; } void putconsxy(struct vc_data *vc, char *p) { gotoxy(vc, p[0], p[1]); set_cursor(vc); } u16 vcs_scr_readw(struct vc_data *vc, const u16 *org) { if ((unsigned long)org == vc->vc_pos && vc->display_fg->cursor_original != -1) return vc->display_fg->cursor_original; return scr_readw(org); } void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org) { scr_writew(val, org); if ((unsigned long)org == vc->vc_pos) { vc->display_fg->cursor_original = -1; add_softcursor(vc); } } static int vcs_size(struct inode *inode) { int minor = minor(inode->i_rdev); 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; if (minor & 128) size = 2*size + HEADER_SIZE; return size; } static loff_t vcs_lseek(struct file *file, loff_t offset, int orig) { int size; lock_kernel(); size = vcs_size(file->f_dentry->d_inode); switch (orig) { default: unlock_kernel(); return -EINVAL; case 2: offset += size; break; case 1: offset += file->f_pos; case 0: break; } if (offset < 0 || offset > size) { unlock_kernel(); return -EINVAL; } file->f_pos = offset; unlock_kernel(); return file->f_pos; } /* We share this temporary buffer with the console write code * so that we can easily avoid touching user space while holding the * console spinlock. */ extern char con_buf[PAGE_SIZE]; #define CON_BUF_SIZE PAGE_SIZE extern struct semaphore con_buf_sem; static ssize_t vcs_read(struct file *file, char *buf, size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; unsigned int currcons = minor(inode->i_rdev); struct vc_data *vc; long pos = *ppos; long viewed, attr, read; int col, maxcol; unsigned short *org = NULL; ssize_t ret; down(&con_buf_sem); /* 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) { viewed = 1; } else { viewed = 0; } ret = -ENXIO; vc = find_vc(currcons); if (!vc) goto unlock_out; ret = -EINVAL; if (pos < 0) goto unlock_out; read = 0; ret = 0; while (count) { char *con_buf0, *con_buf_start; long this_round, size; ssize_t orig_count; long p = pos; /* Check whether we are above size each round, * as copy_to_user at the end of this loop * could sleep. */ size = vcs_size(inode); 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; /* Perform the whole read into the local con_buf. * Then we can drop the console spinlock and safely * attempt to move it to userspace. */ con_buf_start = con_buf0 = con_buf; orig_count = this_round; maxcol = vc->vc_cols; if (!attr) { org = screen_pos(vc, p, viewed); col = p % maxcol; p += maxcol - col; while (this_round-- > 0) { *con_buf0++ = (vcs_scr_readw(vc, org++) & 0xff); if (++col == maxcol) { org = screen_pos(vc, p, viewed); col = 0; p += maxcol; } } } else { if (p < HEADER_SIZE) { size_t tmp_count; con_buf0[0] = (char) vc->vc_rows; con_buf0[1] = (char) vc->vc_cols; getconsxy(vc, con_buf0 + 2); con_buf_start += p; this_round += p; if (this_round > CON_BUF_SIZE) { this_round = CON_BUF_SIZE; orig_count = this_round - p; } tmp_count = HEADER_SIZE; if (tmp_count > this_round) tmp_count = this_round; /* Advance state pointers and move on. */ this_round -= tmp_count; p = HEADER_SIZE; con_buf0 = con_buf + HEADER_SIZE; /* If this_round >= 0, then p is even... */ } else if (p & 1) { /* Skip first byte for output if start address is odd * Update region sizes up/down depending on free * space in buffer. */ con_buf_start++; if (this_round < CON_BUF_SIZE) this_round++; else orig_count--; } if (this_round > 0) { unsigned short *tmp_buf = (unsigned short *)con_buf0; p -= HEADER_SIZE; p /= 2; col = p % maxcol; org = screen_pos(vc, p, viewed); p += maxcol - col; /* Buffer has even length, so we can always copy * character + attribute. We do not copy last byte * to userspace if this_round is odd. */ this_round = (this_round + 1) >> 1; while (this_round) { *tmp_buf++ = vcs_scr_readw(vc, org++); this_round --; if (++col == maxcol) { org = screen_pos(vc, p, viewed); col = 0; p += maxcol; } } } } /* Finally, release the console semaphore while we push * all the data to userspace from our temporary buffer. * * AKPM: Even though it's a semaphore, we should drop it because * the pagefault handling code may want to call printk(). */ release_console_sem(); ret = copy_to_user(buf, con_buf_start, orig_count); acquire_console_sem(); if (ret) { read += (orig_count - ret); ret = -EFAULT; break; } buf += orig_count; pos += orig_count; read += orig_count; count -= orig_count; } *ppos += read; if (read) ret = read; unlock_out: release_console_sem(); up(&con_buf_sem); return ret; } static ssize_t vcs_write(struct file *file, const char *buf, size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; unsigned int currcons = minor(inode->i_rdev); struct vc_data *vc; long pos = *ppos; long viewed, attr, size, written; char *con_buf0; int col, maxcol; u16 *org0 = NULL, *org = NULL; size_t ret; down(&con_buf_sem); /* 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) { viewed = 1; } else { viewed = 0; } ret = -ENXIO; vc = find_vc(currcons); if (!vc) goto unlock_out; size = vcs_size(inode); ret = -EINVAL; if (pos < 0 || pos > size) goto unlock_out; if (count > size - pos) count = size - pos; written = 0; while (count) { long this_round = count; size_t orig_count; long p; if (this_round > CON_BUF_SIZE) this_round = CON_BUF_SIZE; /* Temporarily drop the console lock so that we can read * in the write data from userspace safely. */ release_console_sem(); ret = copy_from_user(con_buf, buf, this_round); acquire_console_sem(); if (ret) { this_round -= ret; if (!this_round) { /* Abort loop if no data were copied. Otherwise * fail with -EFAULT. */ if (written) break; ret = -EFAULT; goto unlock_out; } } /* 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); if (pos >= size) break; if (this_round > size - ... [truncated message content] |
From: James S. <jsi...@us...> - 2003-08-11 16:38:08
|
Update of /cvsroot/linuxconsole/ruby In directory sc8-pr-cvs1:/tmp/cvs-serv30919 Added Files: AGAINST-2.6.0-test3 Removed Files: AGAINST-2.5.59 Log Message: Synced to 2.6.0-test3 --- NEW FILE: AGAINST-2.6.0-test3 --- --- AGAINST-2.5.59 DELETED --- |
From: James S. <jsi...@us...> - 2003-08-11 16:38:08
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv30919/ruby-2.6/arch/i386/kernel Added Files: setup.c Log Message: Synced to 2.6.0-test3 --- NEW FILE: setup.c --- /* * linux/arch/i386/kernel/setup.c * * Copyright (C) 1995 Linus Torvalds * * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 * * Memory region support * David Parsons <or...@pe...>, July-August 1999 * * Added E820 sanitization routine (removes overlapping memory regions); * Brian Moyle <bm...@mv...>, February 2001 * * Moved CPU detection code to cpu/${cpu}.c * Patrick Mochel <mo...@os...>, March 2002 * * Provisions for empty E820 memory regions (reported by certain BIOSes). * Alex Achenbach <xe...@sl...>, December 2002. * [...967 lines suppressed...] #ifdef CONFIG_X86_LOCAL_APIC if (smp_found_config) get_smp_config(); #endif #ifdef CONFIG_X86_SUMMIT setup_summit(); #endif register_memory(max_low_pfn); } #include "setup_arch_post.h" /* * Local Variables: * mode:c * c-file-style:"k&r" * c-basic-offset:8 * End: */ |
From: James S. <jsi...@us...> - 2003-08-11 16:33:40
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console In directory sc8-pr-cvs1:/tmp/cvs-serv30919/ruby-2.6/drivers/video/console Added Files: dummycon.c vgacon.c Log Message: Synced to 2.6.0-test3 --- NEW FILE: dummycon.c --- /* * linux/drivers/video/dummycon.c -- A dummy console driver * * To be used if there's no other console driver (e.g. for plain VGA text) * available, usually until fbcon takes console over. */ #include <linux/types.h> #include <linux/kdev_t.h> #include <linux/tty.h> #include <linux/console.h> #include <linux/vt_kern.h> #include <linux/init.h> /* * Dummy console driver */ #if defined(__arm__) #define DUMMY_COLUMNS ORIG_VIDEO_COLS #define DUMMY_ROWS ORIG_VIDEO_LINES #elif defined(__hppa__) /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */ #include <linux/config.h> #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS #define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS #else #define DUMMY_COLUMNS 80 #define DUMMY_ROWS 25 #endif static struct vt_struct dummy_vt; static struct vc_data default_mode; static const char *dummycon_startup(struct vt_struct *vt, int init) { vt->default_mode = &default_mode; return "dummy device"; } static void dummycon_init(struct vc_data *vc, int init) { vc->vc_can_do_color = 1; if (init) { vc->vc_cols = DUMMY_COLUMNS; vc->vc_rows = DUMMY_ROWS; } else vc_resize(vc, DUMMY_COLUMNS, DUMMY_ROWS); } static int dummycon_dummy(void) { return 0; } #define DUMMY (void *)dummycon_dummy /* * The console `switch' structure for the dummy console * * Most of the operations are dummies. */ const struct consw dummy_con = { .con_startup = dummycon_startup, .con_init = dummycon_init, .con_deinit = DUMMY, .con_clear = DUMMY, .con_putc = DUMMY, .con_putcs = DUMMY, .con_cursor = DUMMY, .con_scroll_region = DUMMY, .con_bmove = DUMMY, .con_switch = DUMMY, .con_blank = DUMMY, .con_font_op = DUMMY, .con_set_palette = DUMMY, .con_scroll = DUMMY, }; int __init dumbcon_init(void) { const char *display_desc = NULL; memset(&dummy_vt, 0, sizeof(struct vt_struct)); dummy_vt.kmalloced = 0; dummy_vt.vt_sw = &dummy_con; display_desc = vt_map_display(&dummy_vt, 1); if (!display_desc) return -ENODEV; printk("Console: mono %s %dx%d\n", display_desc, dummy_vt.default_mode->vc_cols, dummy_vt.default_mode->vc_rows); return 0; } --- NEW FILE: vgacon.c --- /* * linux/drivers/video/vgacon.c -- Low level VGA based console driver * * Created 28 Sep 1997 by Geert Uytterhoeven * * Rewritten by Martin Mares <mj...@uc...>, July 1998 * * This file is based on the old console.c, vga.c and vesa_blank.c drivers. * * Copyright (C) 1991, 1992 Linus Torvalds * 1995 Jay Estabrook * * User definable mapping table and font loading by Eugene G. Crosser, * <cr...@av...> * * Improved loadable font/UTF-8 support by H. Peter Anvin * Feb-Sep 1995 <pet...@li...> * * Colour palette handling, by Simon Tatham [...1064 lines suppressed...] .con_invert_region = vgacon_invert_region, }; int __init vga_console_init(void) { const char *display_desc = NULL; memset(&vga_vt, 0, sizeof(struct vt_struct)); vga_vt.kmalloced = 0; vga_vt.vt_sw = &vga_con; display_desc = vt_map_display(&vga_vt, 1); if (!display_desc) return -ENODEV; printk("Console: %s %s %dx%d\n", vga_vt.default_mode->vc_can_do_color ? "Colour" : "Mono", display_desc, vga_vt.default_mode->vc_cols, vga_vt.default_mode->vc_rows); return 0; } MODULE_LICENSE("GPL"); |
From: James S. <jsi...@us...> - 2003-08-11 16:33:40
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/include/linux In directory sc8-pr-cvs1:/tmp/cvs-serv30919/ruby-2.6/include/linux Added Files: console.h consolemap.h kbd_kern.h selection.h tty.h vt_kern.h Log Message: Synced to 2.6.0-test3 --- NEW FILE: console.h --- /* * linux/include/linux/console.h * * Copyright (C) 1993 Hamish Macdonald * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive * for more details. * * Changed: * 10-Mar-94: Arno Griffioen: Conversion for vt100 emulator port from PC LINUX */ #ifndef _LINUX_CONSOLE_H_ #define _LINUX_CONSOLE_H_ 1 #include <linux/types.h> #include <linux/kdev_t.h> #include <linux/spinlock.h> /* * Array of consoles built from command line options (console=) */ struct console_cmdline { char name[8]; /* Name of the driver */ int index; /* Minor dev. to use */ char *options; /* Options for the driver */ }; #define MAX_CMDLINECONSOLES 8 extern struct console_cmdline console_list[MAX_CMDLINECONSOLES]; /* * The interface for a console, or any other device that * wants to capture console messages (printer driver?) */ #define CON_PRINTBUFFER (1) #define CON_CONSDEV (2) /* Last on the command line */ #define CON_ENABLED (4) struct console { char name[8]; void (*write)(struct console *, const char *, unsigned); int (*read)(struct console *, char *, unsigned); struct tty_driver *(*device)(struct console *, int *); void (*unblank)(void); int (*setup)(struct console *, char *); short flags; short index; int cflag; void *data; struct console *next; }; extern void register_console(struct console *); extern int unregister_console(struct console *); extern struct console *console_drivers; extern void acquire_console_sem(void); extern void release_console_sem(void); extern void console_conditional_schedule(void); extern void console_unblank(void); /* VESA Blanking Levels */ #define VESA_NO_BLANKING 0 #define VESA_VSYNC_SUSPEND 1 #define VESA_HSYNC_SUSPEND 2 #define VESA_POWERDOWN 3 #endif /* _LINUX_CONSOLE_H */ --- NEW FILE: consolemap.h --- /* * consolemap.h * * Interface between console.c, selection.c and consolemap.c */ #define LAT1_MAP 0 #define GRAF_MAP 1 #define IBMPC_MAP 2 #define USER_MAP 3 struct vc_data; extern unsigned char inverse_translate(struct vc_data *vc, int glyph); extern void set_translate(struct vc_data *vc, int m); extern int conv_uni_to_pc(struct vc_data *vc, long ucs); --- NEW FILE: kbd_kern.h --- #ifndef _KBD_KERN_H #define _KBD_KERN_H #include <linux/tty.h> #include <linux/kd.h> #include <linux/interrupt.h> #include <linux/keyboard.h> extern struct tasklet_struct keyboard_tasklet; extern int shift_state; extern char *func_table[MAX_NR_FUNC]; extern char func_buf[]; extern char *funcbufptr; extern int funcbufsize, funcbufleft; #define KBD_DEFMODE ((1 << VC_REPEAT) | (1 << VC_META)) /* * Some laptops take the 789uiojklm,. keys as number pad when NumLock is on. * This seems a good reason to start with NumLock off. On PC9800 and HIL keyboards * of PARISC machines however there is no NumLock key and everyone expects the keypad * to be used for numbers. */ #if defined(CONFIG_X86_PC9800) #define KBD_DEFLEDS (1 << VC_NUMLOCK) #else #define KBD_DEFLEDS 0 #endif #define KBD_DEFLOCK 0 struct vc_data; /* * kbd->xxx contains the VC-local things (flag settings etc..) * * Note: externally visible are LED_SCR, LED_NUM, LED_CAP defined in kd.h * The code in KDGETLED / KDSETLED depends on the internal and * external order being the same. * * Note: lockstate is used as index in the array key_map. */ struct kbd_struct { unsigned char lockstate; /* 8 modifiers - the names do not have any meaning at all; they can be associated to arbitrarily chosen keys */ #define VC_SHIFTLOCK KG_SHIFT /* shift lock mode */ #define VC_ALTGRLOCK KG_ALTGR /* altgr lock mode */ #define VC_CTRLLOCK KG_CTRL /* control lock mode */ #define VC_ALTLOCK KG_ALT /* alt lock mode */ #define VC_SHIFTLLOCK KG_SHIFTL /* shiftl lock mode */ #define VC_SHIFTRLOCK KG_SHIFTR /* shiftr lock mode */ #define VC_CTRLLLOCK KG_CTRLL /* ctrll lock mode */ #define VC_CTRLRLOCK KG_CTRLR /* ctrlr lock mode */ unsigned char slockstate; /* for `sticky' Shift, Ctrl, etc. */ unsigned char ledmode:2; /* one 2-bit value */ #define LED_SHOW_FLAGS 0 /* traditional state */ #define LED_SHOW_IOCTL 1 /* only change leds upon ioctl */ #define LED_SHOW_MEM 2 /* `heartbeat': peek into memory */ unsigned char ledflagstate:4; /* flags, not lights */ unsigned char default_ledflagstate:4; #define VC_SCROLLOCK 0 /* scroll-lock mode */ #define VC_NUMLOCK 1 /* numeric lock mode */ #define VC_CAPSLOCK 2 /* capslock mode */ #define VC_KANALOCK 3 /* kanalock mode */ unsigned char kbdmode:2; /* one 2-bit value */ #define VC_XLATE 0 /* translate keycodes using keymap */ #define VC_MEDIUMRAW 1 /* medium raw (keycode) mode */ #define VC_RAW 2 /* raw (scancode) mode */ #define VC_UNICODE 3 /* Unicode mode */ unsigned char modeflags:5; #define VC_APPLIC 0 /* application key mode */ #define VC_CKMODE 1 /* cursor key mode */ #define VC_REPEAT 2 /* keyboard repeat */ #define VC_CRLF 3 /* 0 - enter sends CR, 1 - enter sends CRLF */ #define VC_META 4 /* 0 - meta, 1 - meta=prefix with ESC */ }; extern int kbd_init(void); extern unsigned char getledstate(struct vc_data *vc); extern void setledstate(struct vc_data *vc, unsigned int led); extern int do_poke_blanked_console; extern void (*kbd_ledfunc) (unsigned int led); static inline void set_leds(void) { tasklet_schedule(&keyboard_tasklet); } static inline int get_kbd_mode(struct kbd_struct kbd, int flag) { return ((kbd.modeflags >> flag) & 1); } static inline int get_kbd_led(struct kbd_struct kbd, int flag) { return ((kbd.ledflagstate >> flag) & 1); } static inline void set_kbd_mode(struct kbd_struct kbd, int flag) { kbd.modeflags |= 1 << flag; } static inline void set_kbd_led(struct kbd_struct kbd, int flag) { kbd.ledflagstate |= 1 << flag; } static inline void clr_kbd_mode(struct kbd_struct kbd, int flag) { kbd.modeflags &= ~(1 << flag); } static inline void clr_kbd_led(struct kbd_struct kbd, int flag) { kbd.ledflagstate &= ~(1 << flag); } static inline void chg_kbd_lock(struct kbd_struct kbd, int flag) { kbd.lockstate ^= 1 << flag; } static inline void chg_kbd_slock(struct kbd_struct kbd, int flag) { kbd.slockstate ^= 1 << flag; } static inline void chg_kbd_mode(struct kbd_struct kbd, int flag) { kbd.modeflags ^= 1 << flag; } static inline void chg_kbd_led(struct kbd_struct kbd, int flag) { kbd.ledflagstate ^= 1 << flag; } #define U(x) ((x) ^ 0xf000) /* keyboard.c */ struct vc_data; int getkeycode(struct input_handle *handle, unsigned int scancode); int setkeycode(struct input_handle *handle, unsigned int scancode, unsigned int keycode); void kd_mksound(struct input_handle *handle, unsigned int hz, unsigned int ticks); void kd_nosound(unsigned long private); int kbd_rate(struct input_handle *handle, struct kbd_repeat *rep); void puts_queue(struct vc_data *vc, char *cp); void compute_shiftstate(void); /* defkeymap.c */ extern unsigned int keymap_count; #endif --- NEW FILE: selection.h --- /* * selection.h * * Interface between console.c, tty_io.c, vt.c, vc_screen.c and selection.c */ #ifndef _LINUX_SELECTION_H_ #define _LINUX_SELECTION_H_ #include <linux/tiocl.h> #include <linux/vt_buffer.h> extern int sel_cons; extern void clear_selection(void); extern int set_selection(const struct tiocl_selection *sel, struct tty_struct *tty, int user); extern int paste_selection(struct tty_struct *tty); extern int sel_loadlut(const unsigned long arg); extern int mouse_reporting(struct vc_data *vc); extern void mouse_report(struct vc_data *vc, int butt, int mrx, int mry); extern unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed); extern u16 screen_glyph(struct vc_data *vc, int offset); extern void complement_pos(struct vc_data *vc, int offset); extern void invert_screen(struct vc_data *vc, int offset, int count, int shift); extern void getconsxy(struct vc_data *vc, char *p); extern void putconsxy(struct vc_data *vc, char *p); extern u16 vcs_scr_readw(struct vc_data *vc, const u16 *org); extern void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org); #endif --- NEW FILE: tty.h --- #ifndef _LINUX_TTY_H #define _LINUX_TTY_H /* * 'tty.h' defines some structures used by tty_io.c and some defines. */ #ifdef __KERNEL__ #include <linux/config.h> #include <linux/fs.h> #include <linux/major.h> #include <linux/termios.h> #include <linux/workqueue.h> #include <linux/tty_driver.h> #include <linux/tty_ldisc.h> #include <asm/system.h> /* * Note: don't mess with NR_PTYS until you understand the tty minor * number allocation game... * (Note: the *_driver.minor_start values 1, 64, 128, 192 are * hardcoded at present.) */ #define NR_PTYS 256 /* ptys/major */ #define NR_LDISCS 16 /* * Unix98 PTY's can be defined as any multiple of NR_PTYS up to * UNIX98_PTY_MAJOR_COUNT; this section defines what we need from the * config options */ #ifdef CONFIG_UNIX98_PTYS # define UNIX98_NR_MAJORS ((CONFIG_UNIX98_PTY_COUNT+NR_PTYS-1)/NR_PTYS) # if UNIX98_NR_MAJORS <= 0 # undef CONFIG_UNIX98_PTYS # elif UNIX98_NR_MAJORS > UNIX98_PTY_MAJOR_COUNT # error Too many Unix98 ptys defined # undef UNIX98_NR_MAJORS # define UNIX98_NR_MAJORS UNIX98_PTY_MAJOR_COUNT # endif #endif /* * These are set up by the setup-routine at boot-time: */ struct screen_info { u8 orig_x; /* 0x00 */ u8 orig_y; /* 0x01 */ u16 dontuse1; /* 0x02 -- EXT_MEM_K sits here */ u16 orig_video_page; /* 0x04 */ u8 orig_video_mode; /* 0x06 */ u8 orig_video_cols; /* 0x07 */ u16 unused2; /* 0x08 */ u16 orig_video_ega_bx; /* 0x0a */ u16 unused3; /* 0x0c */ u8 orig_video_lines; /* 0x0e */ u8 orig_video_isVGA; /* 0x0f */ u16 orig_video_points; /* 0x10 */ /* VESA graphic mode -- linear frame buffer */ u16 lfb_width; /* 0x12 */ u16 lfb_height; /* 0x14 */ u16 lfb_depth; /* 0x16 */ u32 lfb_base; /* 0x18 */ u32 lfb_size; /* 0x1c */ u16 dontuse2, dontuse3; /* 0x20 -- CL_MAGIC and CL_OFFSET here */ u16 lfb_linelength; /* 0x24 */ u8 red_size; /* 0x26 */ u8 red_pos; /* 0x27 */ u8 green_size; /* 0x28 */ u8 green_pos; /* 0x29 */ u8 blue_size; /* 0x2a */ u8 blue_pos; /* 0x2b */ u8 rsvd_size; /* 0x2c */ u8 rsvd_pos; /* 0x2d */ u16 vesapm_seg; /* 0x2e */ u16 vesapm_off; /* 0x30 */ u16 pages; /* 0x32 */ u16 vesa_attributes; /* 0x34 */ /* 0x36 -- 0x3f reserved for future expansion */ }; extern struct screen_info screen_info; #define ORIG_X (screen_info.orig_x) #define ORIG_Y (screen_info.orig_y) #define ORIG_VIDEO_MODE (screen_info.orig_video_mode) #define ORIG_VIDEO_COLS (screen_info.orig_video_cols) #define ORIG_VIDEO_EGA_BX (screen_info.orig_video_ega_bx) #define ORIG_VIDEO_LINES (screen_info.orig_video_lines) #define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA) #define ORIG_VIDEO_POINTS (screen_info.orig_video_points) #define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ #define VIDEO_TYPE_CGA 0x11 /* CGA Display */ #define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */ #define VIDEO_TYPE_EGAC 0x21 /* EGA in Color Mode */ #define VIDEO_TYPE_VGAC 0x22 /* VGA+ in Color Mode */ #define VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */ #define VIDEO_TYPE_PICA_S3 0x30 /* ACER PICA-61 local S3 video */ #define VIDEO_TYPE_MIPS_G364 0x31 /* MIPS Magnum 4000 G364 video */ #define VIDEO_TYPE_SNI_RM 0x32 /* SNI RM200 PCI video */ #define VIDEO_TYPE_SGI 0x33 /* Various SGI graphics hardware */ #define VIDEO_TYPE_TGAC 0x40 /* DEC TGA */ #define VIDEO_TYPE_SUN 0x50 /* Sun frame buffer. */ #define VIDEO_TYPE_SUNPCI 0x51 /* Sun PCI based frame buffer. */ #define VIDEO_TYPE_PMAC 0x60 /* PowerMacintosh frame buffer. */ /* * This character is the same as _POSIX_VDISABLE: it cannot be used as * a c_cc[] character, but indicates that a particular special character * isn't in use (eg VINTR has no character etc) */ #define __DISABLED_CHAR '\0' /* * This is the flip buffer used for the tty driver. The buffer is * located in the tty structure, and is used as a high speed interface * between the tty driver and the tty line discipline. */ #define TTY_FLIPBUF_SIZE 512 struct tty_flip_buffer { struct work_struct work; struct semaphore pty_sem; char *char_buf_ptr; unsigned char *flag_buf_ptr; int count; int buf_num; unsigned char char_buf[2*TTY_FLIPBUF_SIZE]; char flag_buf[2*TTY_FLIPBUF_SIZE]; unsigned char slop[4]; /* N.B. bug overwrites buffer by 1 */ }; /* * The pty uses char_buf and flag_buf as a contiguous buffer */ #define PTY_BUF_SIZE 4*TTY_FLIPBUF_SIZE /* * When a break, frame error, or parity error happens, these codes are * stuffed into the flags buffer. */ #define TTY_NORMAL 0 #define TTY_BREAK 1 #define TTY_FRAME 2 #define TTY_PARITY 3 #define TTY_OVERRUN 4 #define INTR_CHAR(tty) ((tty)->termios->c_cc[VINTR]) #define QUIT_CHAR(tty) ((tty)->termios->c_cc[VQUIT]) #define ERASE_CHAR(tty) ((tty)->termios->c_cc[VERASE]) #define KILL_CHAR(tty) ((tty)->termios->c_cc[VKILL]) #define EOF_CHAR(tty) ((tty)->termios->c_cc[VEOF]) #define TIME_CHAR(tty) ((tty)->termios->c_cc[VTIME]) #define MIN_CHAR(tty) ((tty)->termios->c_cc[VMIN]) #define SWTC_CHAR(tty) ((tty)->termios->c_cc[VSWTC]) #define START_CHAR(tty) ((tty)->termios->c_cc[VSTART]) #define STOP_CHAR(tty) ((tty)->termios->c_cc[VSTOP]) #define SUSP_CHAR(tty) ((tty)->termios->c_cc[VSUSP]) #define EOL_CHAR(tty) ((tty)->termios->c_cc[VEOL]) #define REPRINT_CHAR(tty) ((tty)->termios->c_cc[VREPRINT]) #define DISCARD_CHAR(tty) ((tty)->termios->c_cc[VDISCARD]) #define WERASE_CHAR(tty) ((tty)->termios->c_cc[VWERASE]) #define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) #define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2]) #define _I_FLAG(tty,f) ((tty)->termios->c_iflag & (f)) #define _O_FLAG(tty,f) ((tty)->termios->c_oflag & (f)) #define _C_FLAG(tty,f) ((tty)->termios->c_cflag & (f)) #define _L_FLAG(tty,f) ((tty)->termios->c_lflag & (f)) #define I_IGNBRK(tty) _I_FLAG((tty),IGNBRK) #define I_BRKINT(tty) _I_FLAG((tty),BRKINT) #define I_IGNPAR(tty) _I_FLAG((tty),IGNPAR) #define I_PARMRK(tty) _I_FLAG((tty),PARMRK) #define I_INPCK(tty) _I_FLAG((tty),INPCK) #define I_ISTRIP(tty) _I_FLAG((tty),ISTRIP) #define I_INLCR(tty) _I_FLAG((tty),INLCR) #define I_IGNCR(tty) _I_FLAG((tty),IGNCR) #define I_ICRNL(tty) _I_FLAG((tty),ICRNL) #define I_IUCLC(tty) _I_FLAG((tty),IUCLC) #define I_IXON(tty) _I_FLAG((tty),IXON) #define I_IXANY(tty) _I_FLAG((tty),IXANY) #define I_IXOFF(tty) _I_FLAG((tty),IXOFF) #define I_IMAXBEL(tty) _I_FLAG((tty),IMAXBEL) #define O_OPOST(tty) _O_FLAG((tty),OPOST) #define O_OLCUC(tty) _O_FLAG((tty),OLCUC) #define O_ONLCR(tty) _O_FLAG((tty),ONLCR) #define O_OCRNL(tty) _O_FLAG((tty),OCRNL) #define O_ONOCR(tty) _O_FLAG((tty),ONOCR) #define O_ONLRET(tty) _O_FLAG((tty),ONLRET) #define O_OFILL(tty) _O_FLAG((tty),OFILL) #define O_OFDEL(tty) _O_FLAG((tty),OFDEL) #define O_NLDLY(tty) _O_FLAG((tty),NLDLY) #define O_CRDLY(tty) _O_FLAG((tty),CRDLY) #define O_TABDLY(tty) _O_FLAG((tty),TABDLY) #define O_BSDLY(tty) _O_FLAG((tty),BSDLY) #define O_VTDLY(tty) _O_FLAG((tty),VTDLY) #define O_FFDLY(tty) _O_FLAG((tty),FFDLY) #define C_BAUD(tty) _C_FLAG((tty),CBAUD) #define C_CSIZE(tty) _C_FLAG((tty),CSIZE) #define C_CSTOPB(tty) _C_FLAG((tty),CSTOPB) #define C_CREAD(tty) _C_FLAG((tty),CREAD) #define C_PARENB(tty) _C_FLAG((tty),PARENB) #define C_PARODD(tty) _C_FLAG((tty),PARODD) #define C_HUPCL(tty) _C_FLAG((tty),HUPCL) #define C_CLOCAL(tty) _C_FLAG((tty),CLOCAL) #define C_CIBAUD(tty) _C_FLAG((tty),CIBAUD) #define C_CRTSCTS(tty) _C_FLAG((tty),CRTSCTS) #define L_ISIG(tty) _L_FLAG((tty),ISIG) #define L_ICANON(tty) _L_FLAG((tty),ICANON) #define L_XCASE(tty) _L_FLAG((tty),XCASE) #define L_ECHO(tty) _L_FLAG((tty),ECHO) #define L_ECHOE(tty) _L_FLAG((tty),ECHOE) #define L_ECHOK(tty) _L_FLAG((tty),ECHOK) #define L_ECHONL(tty) _L_FLAG((tty),ECHONL) #define L_NOFLSH(tty) _L_FLAG((tty),NOFLSH) #define L_TOSTOP(tty) _L_FLAG((tty),TOSTOP) #define L_ECHOCTL(tty) _L_FLAG((tty),ECHOCTL) #define L_ECHOPRT(tty) _L_FLAG((tty),ECHOPRT) #define L_ECHOKE(tty) _L_FLAG((tty),ECHOKE) #define L_FLUSHO(tty) _L_FLAG((tty),FLUSHO) #define L_PENDIN(tty) _L_FLAG((tty),PENDIN) #define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) struct device; /* * Where all of the state associated with a tty is kept while the tty * is open. Since the termios state should be kept even if the tty * has been closed --- for things like the baud rate, etc --- it is * not stored here, but rather a pointer to the real state is stored * here. Possible the winsize structure should have the same * treatment, but (1) the default 80x24 is usually right and (2) it's * most often used by a windowing system, which will set the correct * size each time the window is created or resized anyway. * - TYT, 9/14/92 */ struct tty_struct { int magic; struct tty_driver *driver; int index; struct tty_ldisc ldisc; struct termios *termios, *termios_locked; char name[64]; int pgrp; int session; dev_t device; unsigned long flags; int count; struct winsize winsize; unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; unsigned char low_latency:1, warned:1; unsigned char ctrl_status; struct tty_struct *link; struct fasync_struct *fasync; struct tty_flip_buffer flip; int max_flip_cnt; int alt_speed; /* For magic substitution of 38400 bps */ wait_queue_head_t write_wait; wait_queue_head_t read_wait; struct work_struct hangup_work; void *disc_data; void *driver_data; struct list_head tty_files; #define N_TTY_BUF_SIZE 4096 /* * The following is data for the N_TTY line discipline. For * historical reasons, this is included in the tty structure. */ unsigned int column; unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; unsigned char closing:1; unsigned short minimum_to_wake; unsigned long overrun_time; int num_overrun; unsigned long process_char_map[256/(8*sizeof(unsigned long))]; char *read_buf; int read_head; int read_tail; int read_cnt; unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))]; int canon_data; unsigned long canon_head; unsigned int canon_column; struct semaphore atomic_read; struct semaphore atomic_write; spinlock_t read_lock; /* If the tty has a pending do_SAK, queue it here - akpm */ struct work_struct SAK_work; }; /* tty magic number */ #define TTY_MAGIC 0x5401 /* * These bits are used in the flags field of the tty structure. * * So that interrupts won't be able to mess up the queues, * copy_to_cooked must be atomic with respect to itself, as must * tty->write. Thus, you must use the inline functions set_bit() and * clear_bit() to make things atomic. */ #define TTY_THROTTLED 0 #define TTY_IO_ERROR 1 #define TTY_OTHER_CLOSED 2 #define TTY_EXCLUSIVE 3 #define TTY_DEBUG 4 #define TTY_DO_WRITE_WAKEUP 5 #define TTY_PUSH 6 #define TTY_CLOSING 7 #define TTY_DONT_FLIP 8 #define TTY_HW_COOK_OUT 14 #define TTY_HW_COOK_IN 15 #define TTY_PTY_LOCK 16 #define TTY_NO_WRITE_SPLIT 17 #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) extern void tty_write_flush(struct tty_struct *); extern struct termios tty_std_termios; extern struct tty_ldisc ldiscs[]; extern void console_init(void); extern int lp_init(void); extern int pty_init(void); extern void tty_init(void); extern int mxser_init(void); extern int moxa_init(void); extern int ip2_init(void); extern int pcxe_init(void); extern int pc_init(void); extern int vcs_init(void); extern int rp_init(void); extern int cy_init(void); extern int stl_init(void); extern int stli_init(void); extern int specialix_init(void); extern int espserial_init(void); extern int macserial_init(void); extern int a2232board_init(void); extern int vty_init(void); extern int tty_paranoia_check(struct tty_struct *tty, kdev_t device, const char *routine); extern char *tty_name(struct tty_struct *tty, char *buf); extern void tty_wait_until_sent(struct tty_struct * tty, long timeout); extern int tty_check_change(struct tty_struct * tty); extern void stop_tty(struct tty_struct * tty); extern void start_tty(struct tty_struct * tty); extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); extern int tty_register_driver(struct tty_driver *driver); extern int tty_unregister_driver(struct tty_driver *driver); extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); extern void tty_unregister_device(struct tty_driver *driver, unsigned index); extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, int buflen); extern void tty_write_message(struct tty_struct *tty, char *msg); extern int is_orphaned_pgrp(int pgrp); extern int is_ignored(int sig); extern int tty_signal(int sig, struct tty_struct *tty); extern void tty_hangup(struct tty_struct * tty); extern void tty_vhangup(struct tty_struct * tty); extern void tty_unhangup(struct file *filp); extern int tty_hung_up_p(struct file * filp); extern void do_SAK(struct tty_struct *tty); extern void disassociate_ctty(int priv); extern void tty_flip_buffer_push(struct tty_struct *tty); extern int tty_get_baud_rate(struct tty_struct *tty); extern int tty_termios_baud_rate(struct termios *termios); /* n_tty.c */ extern struct tty_ldisc tty_ldisc_N_TTY; /* tty_ioctl.c */ extern int n_tty_ioctl(struct tty_struct * tty, struct file * file, unsigned int cmd, unsigned long arg); /* serial.c */ extern void serial_console_init(void); /* pcxx.c */ extern int pcxe_open(struct tty_struct *tty, struct file *filp); /* printk.c */ extern void console_print(const char *); /* vt.c */ extern int vt_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg); #endif /* __KERNEL__ */ #endif --- NEW FILE: vt_kern.h --- #ifndef _VT_KERN_H #define _VT_KERN_H /* * All the data structs defining the VT tty system. */ #include <linux/config.h> #include <linux/pm.h> #include <linux/vt.h> #include <linux/kbd_kern.h> #define MIN_NR_CONSOLES 1 /* must be at least 1 */ #define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ #define MAX_NR_USER_CONSOLES 16 /* number of VCs per VT */ /* scroll */ #define SM_UP (1) #define SM_DOWN (2) /* cursor */ #define CM_DRAW (1) #define CM_ERASE (2) #define CM_CHANGE (3) #define CM_MOVE (4) #define CUR_DEF 0 #define CUR_NONE 1 #define CUR_UNDERLINE 2 #define CUR_LOWER_THIRD 3 #define CUR_LOWER_HALF 4 #define CUR_TWO_THIRDS 5 #define CUR_BLOCK 6 #define CUR_HWMASK 0x0f #define CUR_SWMASK 0xfff0 #define CUR_DEFAULT CUR_UNDERLINE /* * Low-Level Functions */ #define IS_VISIBLE (vc == vc->display_fg->fg_console) /* * Presently, a lot of graphics programs do not restore the contents of * the higher font pages. Defining this flag will avoid use of them, but * will lose support for PIO_FONTRESET. Note that many font operations are * not likely to work with these programs anyway; they need to be * fixed. The linux/Documentation directory includes a code snippet * to save and restore the text font. */ #ifdef CONFIG_VGA_CONSOLE #define BROKEN_GRAPHICS_PROGRAMS 1 #endif extern unsigned char color_table[]; extern int default_red[]; extern int default_grn[]; extern int default_blu[]; /* * Data structure describing single virtual console * * Fields marked with [#] must be set by the low-level driver. * Fields marked with [!] can be changed by the low-level driver * to achieve effects such as fast scrolling by changing the origin. */ #define NPAR 16 struct vc_data { unsigned short vc_num; /* Console number */ unsigned int vc_cols; /* [#] Console size */ unsigned int vc_rows; unsigned int vc_size_row; /* Bytes per row */ unsigned int vc_scan_lines; /* # of scan lines */ unsigned int vc_screensize; /* Size of screen */ unsigned char vc_mode; /* KD_TEXT, ... */ unsigned long vc_origin; /* [!] Start of real screen */ unsigned long vc_scr_end; /* [!] End of real screen */ unsigned long vc_visible_origin;/* [!] Top of visible window */ unsigned int vc_scrollback; /* [!] Scrollback size */ unsigned int vc_top, vc_bottom; /* Scrolling region */ unsigned short *vc_screenbuf; /* In-memory character/attribute buffer */ unsigned int vc_screenbuf_size; unsigned char vc_attr; /* Current attributes */ unsigned char vc_def_color; /* Default colors */ unsigned char vc_color; /* Foreground & background */ unsigned char vc_s_color; /* Saved foreground & background */ unsigned char vc_ulcolor; /* Color for underline mode */ unsigned char vc_halfcolor; /* Color for half intensity mode */ /* cursor */ unsigned int vc_cursor_type; unsigned short vc_complement_mask; /* [#] Xor mask for mouse pointer */ unsigned short vc_s_complement_mask; /* Saved mouse pointer mask */ unsigned short vc_video_erase_char; /* Background erase character */ unsigned int vc_x, vc_y; /* Cursor position */ unsigned long vc_pos; /* Cursor address */ unsigned int vc_saved_x; unsigned int vc_saved_y; unsigned int vc_state; /* Escape sequence parser state */ unsigned int vc_npar, vc_par[NPAR]; /* Parameters of current escape sequence */ unsigned char vc_ledstate; unsigned char vc_ledioctl; struct kbd_struct kbd_table; /* VC keyboard state */ unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */ struct console_font_op vc_font; /* VC current font set */ struct vt_struct *display_fg; /* Ptr to display */ struct tty_struct *vc_tty; /* TTY we are attached to */ /* data for manual vt switching */ struct vt_mode vt_mode; int vt_pid; int vt_newvt; /* mode flags */ unsigned int vc_charset:1; /* Character set G0 / G1 */ unsigned int vc_s_charset:1; /* Saved character set */ unsigned int vc_disp_ctrl:1; /* Display chars < 32? */ unsigned int vc_toggle_meta:1; /* Toggle high bit? */ unsigned int vc_decscnm:1; /* Screen Mode */ unsigned int vc_decom:1; /* Origin Mode */ unsigned int vc_decawm:1; /* Autowrap Mode */ unsigned int vc_dectcem:1; /* Text Cursor Enable */ unsigned int vc_irm:1; /* Insert/Replace Mode */ unsigned int vc_deccolm:1; /* 80/132 Column Mode */ /* attribute flags */ unsigned int vc_intensity:2; /* 0=half-bright, 1=normal, 2=bold */ unsigned int vc_underline:1; unsigned int vc_blink:1; unsigned int vc_reverse:1; unsigned int vc_s_intensity:2; /* saved rendition */ unsigned int vc_s_underline:1; unsigned int vc_s_blink:1; unsigned int vc_s_reverse:1; /* misc */ unsigned int vc_priv1:1; /* indicating a private control function */ unsigned int vc_priv2:1; /* indicating a private control function */ unsigned int vc_priv3:1; /* indicating a private control function */ unsigned int vc_priv4:1; /* indicating a private control function (used to be called "ques") */ unsigned int vc_need_wrap:1; unsigned int vc_can_do_color:1; unsigned int vc_report_mouse:2; unsigned char vc_utf:1; /* Unicode UTF-8 encoding */ unsigned char vc_utf_count; int vc_utf_char; unsigned int vc_tab_stop[8]; /* Tab stops. 256 columns. */ unsigned char vc_palette[16 * 3]; /* Colour palette for VGA+ */ unsigned short *vc_translate; unsigned char vc_G0_charset; unsigned char vc_G1_charset; unsigned char vc_saved_G0; unsigned char vc_saved_G1; unsigned int vc_bell_pitch; /* Console bell pitch */ unsigned int vc_bell_duration; /* Console bell duration */ unsigned long vc_uni_pagedir; unsigned long *vc_uni_pagedir_loc;/* [!] Location of uni_pagedir variable for this console */ wait_queue_head_t paste_wait; /* For selections */ /* Internal flags */ unsigned int vc_decscl; /* operating level */ unsigned int vc_c8bit:1; /* 8-bit controls */ unsigned int vc_d8bit:1; /* 8-bit data */ unsigned int vc_shift:1; /* single shift */ /* Private modes */ unsigned int vc_decckm:1; /* Cursor Keys */ unsigned int vc_decsclm:1; /* Scrolling */ unsigned int vc_decarm:1; /* Autorepeat */ unsigned int vc_decnrcm:1; /* National Replacement Character Set */ unsigned int vc_decnkm:1; /* Numeric Keypad */ /* ANSI / ISO mode flags */ unsigned int vc_kam:1; /* Keyboard Action */ unsigned int vc_crm:1; /* Console Representation */ unsigned int vc_lnm:1; /* Line feed/New line */ /* Charset mappings */ unsigned char vc_GL_charset; unsigned char vc_GR_charset; unsigned char vc_G2_charset; unsigned char vc_G3_charset; unsigned char vc_GS_charset; unsigned char vc_saved_G2; unsigned char vc_saved_G3; unsigned char vc_saved_GS; }; struct consw { const char *(*con_startup)(struct vt_struct *, int); void (*con_init)(struct vc_data *, int); void (*con_deinit)(struct vc_data *); void (*con_clear)(struct vc_data *, int, int, int, int); void (*con_putc)(struct vc_data *, int, int, int); void (*con_putcs)(struct vc_data *, const unsigned short *, int, int, int); void (*con_cursor)(struct vc_data *, int); int (*con_scroll_region)(struct vc_data *, int, int, int, int); void (*con_bmove)(struct vc_data *, int, int, int, int, int, int); int (*con_switch)(struct vc_data *); int (*con_blank)(struct vc_data *, int); int (*con_font_op)(struct vc_data *, struct console_font_op *); int (*con_resize)(struct vc_data *, unsigned int, unsigned int); int (*con_set_palette)(struct vc_data *, unsigned char *); int (*con_scroll)(struct vc_data *, int); int (*con_set_origin)(struct vc_data *); void (*con_save_screen)(struct vc_data *); u8 (*con_build_attr)(struct vc_data *, u8, u8, u8, u8, u8); void (*con_invert_region)(struct vc_data *, u16 *, int); u16* (*con_screen_pos)(struct vc_data *, int); unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); }; struct vt_struct { struct vc_data *fg_console; /* VC being displayed */ struct vc_data *last_console; /* VC we last switched from */ struct vc_data *want_vc; /* VC we want to switch to */ int scrollback_delta; int cursor_original; char kmalloced; /* Did we use kmalloced ? */ char vt_dont_switch; /* VC switching flag */ char vt_blanked; /* Is this display blanked */ int blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */ int blank_interval; /* How long before blanking */ int off_interval; struct timer_list timer; /* Timer for VT blanking */ struct timer_list beep; /* Timer for adjusting console beeping */ struct pm_dev *pm_con; /* power management */ /* * This is a temporary buffer used to prepare a tty console write * so that we can easily avoid touching user space while holding the * console spinlock. It is shared by with vc_screen read/write tty * calls. */ struct semaphore lock; /* Lock for con_buf */ char con_buf[PAGE_SIZE]; const struct consw *vt_sw; /* Display driver for VT */ struct vc_data *default_mode; /* Default mode */ struct work_struct vt_work; /* VT work queue */ struct input_handle *keyboard; /* Keyboard attached */ struct input_handle *beeper; /* Bell noise support */ void *data_hook; /* Hook for driver data */ unsigned int first_vc; struct vc_data *vc_cons[MAX_NR_USER_CONSOLES]; /* VT's VC pool */ struct vt_struct *next; }; extern struct vt_struct *vt_cons; extern struct vt_struct *admin_vt; /* universal VT emulation functions */ void vte_ris(struct vc_data *vc, int do_clear); inline void vte_cr(struct vc_data *vc); void vte_lf(struct vc_data *vc); inline void vte_bs(struct vc_data *vc); void vte_ed(struct vc_data *vc, int vpar); void vte_decsc(struct vc_data *vc); void terminal_emulation(struct tty_struct *tty, int c); /* vt.c */ const char *vt_map_display(struct vt_struct *vt, int init); void vt_map_input(struct vt_struct *vt); struct vc_data *find_vc(int currcons); struct vc_data *vc_allocate(unsigned int console); inline void set_console(struct vc_data *vc); int vc_resize(struct vc_data *vc, unsigned int lines, unsigned int cols); int vc_disallocate(struct vc_data *vc); void reset_vc(struct vc_data *vc); void add_softcursor(struct vc_data *vc); void set_cursor(struct vc_data *vc); void hide_cursor(struct vc_data *vc); void gotoxy(struct vc_data *vc, int new_x, int new_y); inline void gotoxay(struct vc_data *vc, int new_x, int new_y); void reset_palette(struct vc_data *vc); void set_palette(struct vc_data *vc); void scroll_up(struct vc_data *vc, int); void scroll_down(struct vc_data *vc, int); void scroll_region_up(struct vc_data *vc, unsigned int t, unsigned int b, int nr); void scroll_region_down(struct vc_data *vc, unsigned int t, unsigned int b, int nr); void default_attr(struct vc_data *vc); void update_attr(struct vc_data *vc); void insert_char(struct vc_data *vc, unsigned int nr); void delete_char(struct vc_data *vc, unsigned int nr); void insert_line(struct vc_data *vc, unsigned int nr); void delete_line(struct vc_data *vc, unsigned int nr); void set_origin(struct vc_data *vc); inline void clear_region(struct vc_data *vc, int x, int y, int width, int height); void do_update_region(struct vc_data *vc, unsigned long start, int count); void update_region(struct vc_data *vc, unsigned long start, int count); void update_screen(struct vc_data *vc); inline int resize_screen(struct vc_data *vc, int width, int height); inline unsigned short *screenpos(struct vc_data *vc, int offset, int viewed); inline void save_screen(struct vc_data *vc); void do_blank_screen(int gfx_mode); void unblank_screen(void); void poke_blanked_console(struct vt_struct *vt); int con_font_op(struct vc_data *vc, struct console_font_op *op); void take_over_console(struct vt_struct *vt, const struct consw *sw); int tioclinux(struct tty_struct *tty, unsigned long arg); /* consolemap.c */ struct unimapinit; struct unipair; int con_set_trans_old(struct vc_data *vc, unsigned char *table); int con_get_trans_old(struct vc_data *vc, unsigned char *table); int con_set_trans_new(struct vc_data *vc, unsigned short *table); int con_get_trans_new(struct vc_data *vc, unsigned short *table); int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui); int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair *list); int con_get_unimap(struct vc_data *vc, ushort ct, ushort * uct, struct unipair *list); int con_set_default_unimap(struct vc_data *vc); void con_free_unimap(struct vc_data *vc); void con_protect_unimap(struct vc_data *vc, int rdonly); int con_copy_unimap(struct vc_data *dst, struct vc_data *src); /* vt_ioctl.c */ void complete_change_console(struct vc_data *new_vc, struct vc_data *old_vc); void change_console(struct vc_data *new_vc, struct vc_data *old_vc); #endif /* _VT_KERN_H */ |
From: James S. <jsi...@us...> - 2003-08-11 16:33:40
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/fs In directory sc8-pr-cvs1:/tmp/cvs-serv30919/ruby-2.6/fs Added Files: compat_ioctl.c Log Message: Synced to 2.6.0-test3 --- NEW FILE: compat_ioctl.c --- /* * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997-2000 Jakub Jelinek (ja...@re...) * Copyright (C) 1998 Eddie C. Dost (ec...@sk...) * Copyright (C) 2001,2002 Andi Kleen, SuSE Labs * Copyright (C) 2003 Pavel Machek (pa...@su...) * * These routines maintain argument size conversion between 32bit and 64bit * ioctls. */ #ifdef INCLUDES #include <linux/config.h> #include <linux/types.h> #include <linux/compat.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/smp.h> [...2426 lines suppressed...] HANDLE_IOCTL(ATM_GETSTAT32, do_atm_ioctl) HANDLE_IOCTL(ATM_GETSTATZ32, do_atm_ioctl) HANDLE_IOCTL(ATM_GETLOOP32, do_atm_ioctl) HANDLE_IOCTL(ATM_SETLOOP32, do_atm_ioctl) HANDLE_IOCTL(ATM_QUERYLOOP32, do_atm_ioctl) HANDLE_IOCTL(SONET_GETSTAT, do_atm_ioctl) HANDLE_IOCTL(SONET_GETSTATZ, do_atm_ioctl) HANDLE_IOCTL(SONET_GETDIAG, do_atm_ioctl) HANDLE_IOCTL(SONET_SETDIAG, do_atm_ioctl) HANDLE_IOCTL(SONET_CLRDIAG, do_atm_ioctl) HANDLE_IOCTL(SONET_SETFRAMING, do_atm_ioctl) HANDLE_IOCTL(SONET_GETFRAMING, do_atm_ioctl) HANDLE_IOCTL(SONET_GETFRSENSE, do_atm_ioctl) /* block stuff */ HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget) HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset) HANDLE_IOCTL(BLKGETSIZE64_32, do_blkgetsize64) #undef DECLARES #endif |
From: James S. <jsi...@us...> - 2003-08-11 16:33:39
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6 In directory sc8-pr-cvs1:/tmp/cvs-serv30919/ruby-2.6 Added Files: Makefile Log Message: Synced to 2.6.0-test3 --- NEW FILE: Makefile --- VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 0 EXTRAVERSION = -test3-ruby # *DOCUMENTATION* # To see a list of typical targets execute "make help" # More info can be located in ./README # Comments in this file are targeted only to the developer, do not # expect to learn how to build the kernel reading this file. # We are using a recursive build, so we need to do a little thinking # to get the ordering right. # # Most importantly: sub-Makefiles should only ever modify files in # their own directory. If in some directory we have a dependency on # a file in another dir (which doesn't happen often, but it's of # unavoidable when linking the built-in.o targets which finally # turn into vmlinux), we will call a sub make in that other dir, and # after that we are sure that everything which is in that other dir # is now up to date. # # The only cases where we need to modify files which have global # effects are thus separated out and done before the recursive # descending is started. They are now explicitly listed as the # prepare rule. KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) # SUBARCH tells the usermode build what the underlying arch is. That is set # first, and if a usermode build is happening, the "ARCH=um" on the command # line overrides the setting of ARCH below. If a native build is happening, # then ARCH is assigned, getting whatever value it gets normally, and # SUBARCH is subsequently ignored. SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ -e s/arm.*/arm/ -e s/sa110/arm/ \ -e s/s390x/s390/ -e s/parisc64/parisc/ ) # Remove hyphens since they have special meaning in RPM filenames KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE)) # Cross compiling and selecting different set of gcc/bin-utils # --------------------------------------------------------------------------- # # When performing cross compilation for other architectures ARCH shall be set # to the target architecture. (See arch/* for the possibilities). # ARCH can be set during invocation of make: # make ARCH=ia64 # Another way is to have ARCH set in the environment. # The default ARCH is the host where make is executed. # CROSS_COMPILE specify the prefix used for all executables used # during compilation. Only gcc and related bin-utils executables # are prefixed with $(CROSS_COMPILE). # CROSS_COMPILE can be set on the command line # make CROSS_COMPILE=ia64-linux- # Alternatively CROSS_COMPILE can be set in the environment. # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile ARCH ?= $(SUBARCH) CROSS_COMPILE ?= # Architecture as present in compile.h UTS_MACHINE := $(ARCH) # SHELL used by kbuild CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ else echo sh; fi ; fi) TOPDIR := $(CURDIR) HOSTCC = gcc HOSTCXX = g++ HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer HOSTCXXFLAGS = -O2 # That's our default target when none is given on the command line # Note that 'modules' will be added as a prerequisite as well, # in the CONFIG_MODULES part below all: vmlinux # Decide whether to build built-in, modular, or both. # Normally, just do built-in. KBUILD_MODULES := KBUILD_BUILTIN := 1 # If we have only "make modules", don't compile built-in objects. # When we're building modules with modversions, we need to consider # the built-in objects during the descend as well, in order to # make sure the checksums are uptodate before we record them. ifeq ($(MAKECMDGOALS),modules) KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1) endif # If we have "make <whatever> modules", compile modules # in addition to whatever we do anyway. # Just "make" or "make all" shall build modules as well ifneq ($(filter all modules,$(MAKECMDGOALS)),) KBUILD_MODULES := 1 endif ifeq ($(MAKECMDGOALS),) KBUILD_MODULES := 1 endif export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE KBUILD_CHECKSRC # To put more focus on warnings, less verbose as default # Use 'make V=1' to see the full commands ifdef V ifeq ("$(origin V)", "command line") KBUILD_VERBOSE = $(V) endif endif ifndef KBUILD_VERBOSE KBUILD_VERBOSE = 0 endif # Call sparse as part of compilation of C files # Use 'make C=1' to enable sparse checking ifdef C ifeq ("$(origin C)", "command line") KBUILD_CHECKSRC = $(C) endif endif ifndef KBUILD_CHECKSRC KBUILD_CHECKSRC = 0 endif # Do not print 'Entering directory ...' MAKEFLAGS += --no-print-directory # For maximum performance (+ possibly random breakage, uncomment # the following) #MAKEFLAGS += -rR # Beautify output # --------------------------------------------------------------------------- # # Normally, we echo the whole command before executing it. By making # that echo $($(quiet)$(cmd)), we now have the possibility to set # $(quiet) to choose other forms of output instead, e.g. # # quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@ # cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< # # If $(quiet) is empty, the whole command will be printed. # If it is set to "quiet_", only the short version will be printed. # If it is set to "silent_", nothing wil be printed at all, since # the variable $(silent_cmd_cc_o_c) doesn't exist. # # A simple variant is to prefix commands with $(Q) - that's usefull # for commands that shall be hidden in non-verbose mode. # # $(Q)ln $@ :< # # If KBUILD_VERBOSE equals 0 then the above command will be hidden. # If KBUILD_VERBOSE equals 1 then the above command is displayed. ifeq ($(KBUILD_VERBOSE),1) quiet = Q = else quiet=quiet_ Q = @ endif # If the user is running make -s (silent mode), suppress echoing of # commands ifneq ($(findstring s,$(MAKEFLAGS)),) quiet=silent_ endif export quiet Q KBUILD_VERBOSE # Paths to obj / src tree src := . obj := . srctree := . objtree := . export srctree objtree # Make variables (CC, etc...) AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld CC = $(CROSS_COMPILE)gcc CPP = $(CC) -E AR = $(CROSS_COMPILE)ar NM = $(CROSS_COMPILE)nm STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump AWK = awk RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ else echo rpm; fi) GENKSYMS = scripts/genksyms/genksyms DEPMOD = /sbin/depmod KALLSYMS = scripts/kallsyms PERL = perl CHECK = sparse MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS) LDFLAGS_MODULE = -r CFLAGS_KERNEL = AFLAGS_KERNEL = NOSTDINC_FLAGS = -nostdinc -iwithprefix include CPPFLAGS := -D__KERNEL__ -Iinclude CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ -fno-strict-aliasing -fno-common AFLAGS := -D__ASSEMBLY__ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ CONFIG_SHELL TOPDIR HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE export MODVERDIR := .tmp_versions # The temporary file to save gcc -MD generated dependencies must not # contain a comma comma := , depfile = $(subst $(comma),_,$(@D)/.$(@F).d) noconfig_targets := xconfig gconfig menuconfig config oldconfig randconfig \ defconfig allyesconfig allnoconfig allmodconfig \ clean mrproper distclean rpm \ help tags TAGS cscope %docs \ checkconfig checkhelp checkincludes RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \) -prune -o RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS # Helpers built in scripts/ # --------------------------------------------------------------------------- scripts/docproc scripts/fixdep scripts/split-include : scripts ; .PHONY: scripts scripts: $(Q)$(MAKE) $(build)=scripts # Objects we will link into vmlinux / subdirs we need to visit # --------------------------------------------------------------------------- init-y := init/ drivers-y := drivers/ sound/ net-y := net/ libs-y := lib/ core-y := usr/ SUBDIRS := ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) export include_config := 1 -include .config endif include arch/$(ARCH)/Makefile # Let architecture Makefiles change CPPFLAGS if needed CFLAGS += $(CPPFLAGS) $(CFLAGS) AFLAGS += $(CPPFLAGS) $(AFLAGS) core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ SUBDIRS += $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ $(net-y) $(net-m) $(libs-y) $(libs-m))) ALL_SUBDIRS := $(sort $(SUBDIRS) $(patsubst %/,%,$(filter %/, \ $(init-n) $(init-) \ $(core-n) $(core-) $(drivers-n) $(drivers-) \ $(net-n) $(net-) $(libs-n) $(libs-)))) init-y := $(patsubst %/, %/built-in.o, $(init-y)) core-y := $(patsubst %/, %/built-in.o, $(core-y)) drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y)) net-y := $(patsubst %/, %/built-in.o, $(net-y)) libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) libs-y := $(libs-y1) $(libs-y2) ifdef include_config # Here goes the main Makefile # =========================================================================== # # If the user gave a *config target, it'll be handled in another # section below, since in this case we cannot include .config # Same goes for other targets like clean/mrproper etc, which # don't need .config, either # In this section, we need .config -include .config.cmd ifndef CONFIG_FRAME_POINTER CFLAGS += -fomit-frame-pointer endif ifdef CONFIG_DEBUG_INFO CFLAGS += -g endif # # INSTALL_PATH specifies where to place the updated kernel and system map # images. Uncomment if you want to place them anywhere other than root. # #export INSTALL_PATH=/boot # # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory # relocations required by build roots. This is not defined in the # makefile but the arguement can be passed to make if needed. # MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) export MODLIB # Build vmlinux # --------------------------------------------------------------------------- # This is a bit tricky: If we need to relink vmlinux, we want # the version number incremented, which means recompile init/version.o # and relink init/init.o. However, we cannot do this during the # normal descending-into-subdirs phase, since at that time # we cannot yet know if we will need to relink vmlinux. # So we descend into init/ inside the rule for vmlinux again. head-y += $(HEAD) vmlinux-objs := $(head-y) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y) quiet_cmd_vmlinux__ = LD $@ define cmd_vmlinux__ $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) $(head-y) $(init-y) \ --start-group \ $(core-y) \ $(libs-y) \ $(drivers-y) \ $(net-y) \ --end-group \ $(filter .tmp_kallsyms%,$^) \ -o $@ endef # set -e makes the rule exit immediately on error define rule_vmlinux__ +set -e; \ $(if $(filter .tmp_kallsyms%,$^),, \ echo ' GEN .version'; \ . $(srctree)/scripts/mkversion > .tmp_version; \ mv -f .tmp_version .version; \ $(MAKE) $(build)=init; \ ) \ $(if $($(quiet)cmd_vmlinux__), \ echo ' $($(quiet)cmd_vmlinux__)' &&) \ $(cmd_vmlinux__); \ echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd endef define rule_vmlinux $(rule_vmlinux__); \ $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map endef LDFLAGS_vmlinux += -T arch/$(ARCH)/vmlinux.lds.s # Generate section listing all symbols and add it into vmlinux # It's a three stage process: # o .tmp_vmlinux1 has all symbols and sections, but __kallsyms is # empty # Running kallsyms on that gives us .tmp_kallsyms1.o with # the right size # o .tmp_vmlinux2 now has a __kallsyms section of the right size, # but due to the added section, some addresses have shifted # From here, we generate a correct .tmp_kallsyms2.o # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. ifdef CONFIG_KALLSYMS kallsyms.o := .tmp_kallsyms2.o quiet_cmd_kallsyms = KSYM $@ cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) > $@ .tmp_kallsyms1.o .tmp_kallsyms2.o: %.o: %.S scripts FORCE $(call if_changed_dep,as_o_S) .tmp_kallsyms%.S: .tmp_vmlinux% $(call cmd,kallsyms) .tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/vmlinux.lds.s FORCE +$(call if_changed_rule,vmlinux__) .tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/vmlinux.lds.s FORCE $(call if_changed_rule,vmlinux__) endif # Finally the vmlinux rule vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/vmlinux.lds.s FORCE $(call if_changed_rule,vmlinux) # The actual objects are generated when descending, # make sure no implicit rule kicks in $(sort $(vmlinux-objs)): $(SUBDIRS) ; # Handle descending into subdirectories listed in $(SUBDIRS) .PHONY: $(SUBDIRS) $(SUBDIRS): prepare $(Q)$(MAKE) $(build)=$@ # Things we need done before we descend to build or make # module versions are listed in "prepare" .PHONY: prepare prepare: include/linux/version.h include/asm include/config/MARKER ifdef KBUILD_MODULES ifeq ($(origin SUBDIRS),file) $(Q)rm -rf $(MODVERDIR) else @echo '*** Warning: Overriding SUBDIRS on the command line can cause' @echo '*** inconsistencies' endif endif $(if $(CONFIG_MODULES),$(Q)mkdir -p $(MODVERDIR)) # This can be used by arch/$ARCH/Makefile to preprocess # their vmlinux.lds.S file AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH) arch/$(ARCH)/vmlinux.lds.s: %.s: %.S scripts FORCE $(call if_changed_dep,as_s_S) targets += arch/$(ARCH)/vmlinux.lds.s # Single targets # --------------------------------------------------------------------------- %.s: %.c scripts FORCE $(Q)$(MAKE) $(build)=$(@D) $@ %.i: %.c scripts FORCE $(Q)$(MAKE) $(build)=$(@D) $@ %.o: %.c scripts FORCE $(Q)$(MAKE) $(build)=$(@D) $@ %/: scripts prepare FORCE $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D) %.lst: %.c scripts FORCE $(Q)$(MAKE) $(build)=$(@D) $@ %.s: %.S scripts FORCE $(Q)$(MAKE) $(build)=$(@D) $@ %.o: %.S scripts FORCE $(Q)$(MAKE) $(build)=$(@D) $@ # FIXME: The asm symlink changes when $(ARCH) changes. That's # hard to detect, but I suppose "make mrproper" is a good idea # before switching between archs anyway. include/asm: @echo ' Making asm->asm-$(ARCH) symlink' @ln -s asm-$(ARCH) $@ # Split autoconf.h into include/linux/config/* include/config/MARKER: scripts/split-include include/linux/autoconf.h @echo ' SPLIT include/linux/autoconf.h -> include/config/*' @scripts/split-include include/linux/autoconf.h include/config @touch $@ # if .config is newer than include/linux/autoconf.h, someone tinkered # with it and forgot to run make oldconfig include/linux/autoconf.h: .config scripts/fixdep $(Q)$(MAKE) $(build)=scripts/kconfig scripts/kconfig/conf ./scripts/kconfig/conf -s arch/$(ARCH)/Kconfig # Generate some files # --------------------------------------------------------------------------- # version.h changes when $(KERNELRELEASE) etc change, as defined in # this Makefile uts_len := 64 define filechk_version.h if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \ echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ exit 1; \ fi; \ (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \ echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \ ) endef include/linux/version.h: Makefile $(call filechk,version.h) # --------------------------------------------------------------------------- .PHONY: depend dep depend dep: @echo '*** Warning: make $@ is unnecessary now.' # --------------------------------------------------------------------------- # Modules ifdef CONFIG_MODULES # By default, build modules as well all: modules # Build modules .PHONY: modules modules: $(SUBDIRS) $(if $(KBUILD_BUILTIN),vmlinux) @echo ' Building modules, stage 2.'; $(Q)$(MAKE) -rR -f scripts/Makefile.modpost # Install modules .PHONY: modules_install modules_install: _modinst_ _modinst_post .PHONY: _modinst_ _modinst_: @rm -rf $(MODLIB)/kernel @rm -f $(MODLIB)/build @mkdir -p $(MODLIB)/kernel @ln -s $(TOPDIR) $(MODLIB)/build $(Q)$(MAKE) -rR -f scripts/Makefile.modinst # If System.map exists, run depmod. This deliberately does not have a # dependency on System.map since that would run the dependency tree on # vmlinux. This depmod is only for convenience to give the initial # boot a modules.dep even before / is mounted read-write. However the # boot script depmod is the master version. ifeq "$(strip $(INSTALL_MOD_PATH))" "" depmod_opts := else depmod_opts := -b $(INSTALL_MOD_PATH) -r endif .PHONY: _modinst_post _modinst_post: _modinst_ if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi else # CONFIG_MODULES # Modules not configured # --------------------------------------------------------------------------- modules modules_install: FORCE @echo @echo "The present kernel configuration has modules disabled." @echo "Type 'make config' and enable loadable module support." @echo "Then build a kernel with module support enabled." @echo @exit 1 endif # CONFIG_MODULES # Generate asm-offsets.h # --------------------------------------------------------------------------- define filechk_gen-asm-offsets (set -e; \ echo "#ifndef __ASM_OFFSETS_H__"; \ echo "#define __ASM_OFFSETS_H__"; \ echo "/*"; \ echo " * DO NOT MODIFY."; \ echo " *"; \ echo " * This file was generated by arch/$(ARCH)/Makefile"; \ echo " *"; \ echo " */"; \ echo ""; \ sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ echo ""; \ echo "#endif" ) endef else # ifdef include_config ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),) # Targets which don't need .config # =========================================================================== # # These targets basically have their own Makefile - not quite, but at # least its own exclusive section in the same Makefile. The reason for # this is the following: # To know the configuration, the main Makefile has to include # .config. That's a obviously a problem when .config doesn't exist # yet, but that could be kludged around with only including it if it # exists. # However, the larger problem is: If you run make *config, make will # include the old .config, then execute your *config. It will then # notice that a piece it included (.config) did change and restart from # scratch. Which will cause execution of *config again. You get the # picture. # If we don't explicitly let the Makefile know that .config is changed # by *config (the old way), it won't reread .config after *config, # thus working with possibly stale values - we don't that either. # # So we divide things: This part here is for making *config targets, # and other targets which should work when no .config exists yet. # The main part above takes care of the rest after a .config exists. # Kernel configuration # --------------------------------------------------------------------------- .PHONY: oldconfig xconfig gconfig menuconfig config \ make_with_config rpm scripts/kconfig/conf scripts/kconfig/mconf scripts/kconfig/qconf scripts/kconfig/gconf: scripts/fixdep FORCE $(Q)$(MAKE) $(build)=scripts/kconfig $@ xconfig: scripts/kconfig/qconf ./scripts/kconfig/qconf arch/$(ARCH)/Kconfig gconfig: scripts/kconfig/gconf ./scripts/kconfig/gconf arch/$(ARCH)/Kconfig menuconfig: scripts/kconfig/mconf $(Q)$(MAKE) $(build)=scripts/lxdialog ./scripts/kconfig/mconf arch/$(ARCH)/Kconfig config: scripts/kconfig/conf ./scripts/kconfig/conf arch/$(ARCH)/Kconfig oldconfig: scripts/kconfig/conf ./scripts/kconfig/conf -o arch/$(ARCH)/Kconfig randconfig: scripts/kconfig/conf ./scripts/kconfig/conf -r arch/$(ARCH)/Kconfig allyesconfig: scripts/kconfig/conf ./scripts/kconfig/conf -y arch/$(ARCH)/Kconfig allnoconfig: scripts/kconfig/conf ./scripts/kconfig/conf -n arch/$(ARCH)/Kconfig allmodconfig: scripts/kconfig/conf ./scripts/kconfig/conf -m arch/$(ARCH)/Kconfig defconfig: scripts/kconfig/conf ./scripts/kconfig/conf -d arch/$(ARCH)/Kconfig ### # Cleaning is done on three levels. # make clean Delete all automatically generated files, including # tools and firmware. # make mrproper Delete the current configuration, and related files # Any core files spread around are deleted as well # make distclean Remove editor backup files, patch leftover files and the like # Files removed with 'make clean' CLEAN_FILES += vmlinux System.map MC* # Files removed with 'make mrproper' MRPROPER_FILES += \ include/linux/autoconf.h include/linux/version.h \ .version .config .config.old config.in config.old \ .menuconfig.log \ include/asm \ .hdepend include/linux/modversions.h \ tags TAGS cscope kernel.spec \ .tmp* # Directories removed with 'make mrproper' MRPROPER_DIRS += \ $(MODVERDIR) \ .tmp_export-objs \ include/config \ include/linux/modules # clean - Delete all intermediate files # clean-dirs += $(addprefix _clean_,$(ALL_SUBDIRS) Documentation/DocBook scripts) .PHONY: $(clean-dirs) clean archclean mrproper archmrproper distclean $(clean-dirs): $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) quiet_cmd_rmclean = RM $$(CLEAN_FILES) cmd_rmclean = rm -f $(CLEAN_FILES) clean: archclean $(clean-dirs) $(call cmd,rmclean) @find . $(RCS_FIND_IGNORE) \ \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ -type f -print | xargs rm -f # mrproper - delete configuration + modules + core files # quiet_cmd_mrproper = RM $$(MRPROPER_DIRS) + $$(MRPROPER_FILES) cmd_mrproper = rm -rf $(MRPROPER_DIRS) && rm -f $(MRPROPER_FILES) mrproper distclean: clean archmrproper @echo ' Making $@ in the srctree' @find . $(RCS_FIND_IGNORE) \ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ -o -name '.*.rej' -o -size 0 \ -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ -type f -print | xargs rm -f $(call cmd,mrproper) # Generate tags for editors # --------------------------------------------------------------------------- define all-sources ( find . $(RCS_FIND_IGNORE) \ \( -name include -o -name arch \) -prune -o \ -name '*.[chS]' -print; \ find arch/$(ARCH) $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ find include $(RCS_FIND_IGNORE) \ \( -name config -o -name 'asm-*' \) -prune \ -o -name '*.[chS]' -print; \ find include/asm-$(ARCH) $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ find include/asm-generic $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print ) endef quiet_cmd_cscope = MAKE $@ cmd_cscope = $(all-sources) | cscope -k -b -i - quiet_cmd_TAGS = MAKE $@ cmd_TAGS = $(all-sources) | etags - # Exuberant ctags works better with -I quiet_cmd_tags = MAKE $@ define cmd_tags rm -f $@; \ CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \ $(all-sources) | xargs ctags $$CTAGSF -a endef cscope: FORCE $(call cmd,cscope) TAGS: FORCE $(call cmd,TAGS) tags: FORCE $(call cmd,tags) # RPM target # --------------------------------------------------------------------------- # If you do a make spec before packing the tarball you can rpm -ta it spec: . $(srctree)/scripts/mkspec >kernel.spec # Build a tar ball, generate an rpm from it and pack the result # There are two bits of magic here # 1) The use of /. to avoid tar packing just the symlink # 2) Removing the .dep files as they have source paths in them that # will become invalid rpm: clean spec find . $(RCS_FIND_IGNORE) \ \( -size 0 -o -name .depend -o -name .hdepend \) \ -type f -print | xargs rm -f set -e; \ cd $(TOPDIR)/.. ; \ ln -sf $(TOPDIR) $(KERNELPATH) ; \ tar -cvz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \ rm $(KERNELPATH) ; \ cd $(TOPDIR) ; \ $(CONFIG_SHELL) $(srctree)/scripts/mkversion > .tmp_version ; \ mv -f .tmp_version .version; \ $(RPM) -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \ rm $(TOPDIR)/../$(KERNELPATH).tar.gz # Brief documentation of the typical targets used # --------------------------------------------------------------------------- help: @echo 'Cleaning targets:' @echo ' clean - remove most generated files but keep the config' @echo ' mrproper - remove all generated files + config + various backup files' @echo '' @echo 'Configuration targets:' @echo ' oldconfig - Update current config utilising a line-oriented program' @echo ' menuconfig - Update current config utilising a menu based program' @echo ' xconfig - Update current config utilising a QT based front-end' @echo ' gconfig - Update current config utilising a GTK based front-end' @echo ' defconfig - New config with default answer to all options' @echo ' allmodconfig - New config selecting modules when possible' @echo ' allyesconfig - New config where all options are accepted with yes' @echo ' allnoconfig - New minimal config' @echo '' @echo 'Other generic targets:' @echo ' all - Build all targets marked with [*]' @echo '* vmlinux - Build the bare kernel' @echo '* modules - Build all modules' @echo ' modules_install - Install all modules' @echo ' dir/ - Build all files in dir and below' @echo ' dir/file.[ois] - Build specified target only' @echo ' rpm - Build a kernel as an RPM package' @echo ' tags/TAGS - Generate tags file for editors' @echo '' @echo 'Documentation targets:' @$(MAKE) --no-print-directory -f Documentation/DocBook/Makefile dochelp @echo '' @echo 'Architecture specific targets ($(ARCH)):' @$(if $(archhelp),$(archhelp),\ echo ' No architecture specific help defined for $(ARCH)') @echo '' @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' @echo ' make C=1 [targets] Check all c source with checker tool' @echo '' @echo 'Execute "make" or "make all" to build all targets marked with [*] ' @echo 'For further info see the ./README file' # Documentation targets # --------------------------------------------------------------------------- %docs: scripts/docproc FORCE $(Q)$(MAKE) $(build)=Documentation/DocBook $@ # Scripts to check various things for consistency # --------------------------------------------------------------------------- checkconfig: find * $(RCS_FIND_IGNORE) \ -name '*.[hcS]' -type f -print | sort \ | xargs $(PERL) -w scripts/checkconfig.pl checkincludes: find * $(RCS_FIND_IGNORE) \ -name '*.[hcS]' -type f -print | sort \ | xargs $(PERL) -w scripts/checkincludes.pl else # ifneq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),) # We're called with both targets which do and do not need # .config included. Handle them one after the other. # =========================================================================== %:: FORCE $(Q)$(MAKE) $@ endif # ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),) endif # ifdef include_config # FIXME Should go into a make.lib or something # =========================================================================== a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) $(NOSTDINC_FLAGS) \ $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) quiet_cmd_as_s_S = CPP $@ cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< quiet_cmd_as_o_S = AS $@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< # read all saved command lines targets := $(wildcard $(sort $(targets))) cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) ifneq ($(cmd_files),) include $(cmd_files) endif # execute the command and also postprocess generated .d dependencies # file if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ $(filter-out $(cmd_$(1)),$(cmd_$@))\ $(filter-out $(cmd_$@),$(cmd_$(1)))),\ @set -e; \ $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ $(cmd_$(1)); \ scripts/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ rm -f $(depfile); \ mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) # Usage: $(call if_changed_rule,foo) # will check if $(cmd_foo) changed, or any of the prequisites changed, # and if so will execute $(rule_foo) if_changed_rule = $(if $(strip $? \ $(filter-out $(cmd_$(1)),$(cmd_$(@F)))\ $(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\ @$(rule_$(1))) # If quiet is set, only print short version of command cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) # filechk is used to check if the content of a generated file is updated. # Sample usage: # define filechk_sample # echo $KERNELRELEASE # endef # version.h : Makefile # $(call filechk,sample) # The rule defined shall write to stdout the content of the new file. # The existing file will be compared with the new one. # - If no file exist it is created # - If the content differ the new file is used # - If they are equal no change, and no timestamp update define filechk @set -e; \ echo ' CHK $@'; \ $(filechk_$(1)) < $< > $@.tmp; \ if [ -r $@ ] && cmp -s $@ $@.tmp; then \ rm -f $@.tmp; \ else \ echo ' UPD $@'; \ mv -f $@.tmp $@; \ fi endef # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=dir # Usage: # $(Q)$(MAKE) $(build)=dir build := -f scripts/Makefile.build obj # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir # Usage: # $(Q)$(MAKE) $(clean)=dir clean := -f scripts/Makefile.clean obj # $(call descend,<dir>,<target>) # Recursively call a sub-make in <dir> with target <target> # Usage is deprecated, because make does not see this as an invocation of make. descend =$(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2) FORCE: |
From: James S. <jsi...@us...> - 2003-08-11 16:33:13
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/fs In directory sc8-pr-cvs1:/tmp/cvs-serv30404/fs Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/fs added to the repository |
From: James S. <jsi...@us...> - 2003-08-11 16:33:13
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers In directory sc8-pr-cvs1:/tmp/cvs-serv30404/drivers Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/drivers added to the repository |
From: James S. <jsi...@us...> - 2003-08-11 16:28:13
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/include In directory sc8-pr-cvs1:/tmp/cvs-serv30404/include Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/include added to the repository |
From: James S. <jsi...@us...> - 2003-08-11 16:25:31
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1:/tmp/cvs-serv30580/char Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char added to the repository |
From: James S. <jsi...@us...> - 2003-08-11 16:24:28
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console In directory sc8-pr-cvs1:/tmp/cvs-serv30629/console Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console added to the repository |
From: James S. <jsi...@us...> - 2003-08-11 16:23:36
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386 In directory sc8-pr-cvs1:/tmp/cvs-serv30484/i386 Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/arch/i386 added to the repository |
From: James S. <jsi...@us...> - 2003-08-11 16:23:14
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/arch In directory sc8-pr-cvs1:/tmp/cvs-serv30404/arch Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6/arch added to the repository |
From: James S. <jsi...@us...> - 2003-08-05 18:46:58
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6 In directory sc8-pr-cvs1:/tmp/cvs-serv3780/ruby-2.6 Log Message: Directory /cvsroot/linuxconsole/ruby/ruby-2.6 added to the repository |
From: James S. <jsi...@us...> - 2003-02-01 18:57:52
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/um/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv15026/linux/arch/um/kernel Modified Files: um_arch.c Log Message: Synced to 2.5.59 Index: um_arch.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/um/kernel/um_arch.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- um_arch.c 23 Nov 2002 00:55:49 -0000 1.1 +++ um_arch.c 1 Feb 2003 18:57:13 -0000 1.2 @@ -34,17 +34,21 @@ #include "initrd.h" #include "init.h" #include "os.h" +#include "choose-mode.h" +#include "mode_kern.h" +#include "mode.h" #define DEFAULT_COMMAND_LINE "root=6200" struct cpuinfo_um boot_cpu_data = { - .loops_per_jiffy = 0, - .ipi_pipe = { -1, -1 } + .loops_per_jiffy = 0, + .ipi_pipe = { -1, -1 } }; unsigned long thread_saved_pc(struct task_struct *task) { - return(os_process_pc(task->thread.extern_pid)); + return(os_process_pc(CHOOSE_MODE_PROC(thread_pid_tt, thread_pid_skas, + task))); } static int show_cpuinfo(struct seq_file *m, void *v) @@ -93,47 +97,11 @@ return(NULL); } -extern void start_kernel(void); - -extern int debug; -extern int debug_stop; - -static int start_kernel_proc(void *unused) -{ - int pid; - - block_signals(); - pid = os_getpid(); - - cpu_tasks[0].pid = pid; - cpu_tasks[0].task = current; -#ifdef CONFIG_SMP - cpu_online_map = 1; -#endif - if(debug) os_stop_process(pid); - start_kernel(); - return(0); -} - -#ifdef CONFIG_HOST_2G_2G -#define TOP 0x80000000 -#else -#define TOP 0xc0000000 -#endif - -#define SIZE ((CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS) * 0x20000000) -#define START (TOP - SIZE) - -/* Set in main */ +/* Set in linux_main */ unsigned long host_task_size; unsigned long task_size; -void set_task_sizes(int arg) -{ - /* Round up to the nearest 4M */ - host_task_size = ROUND_4M((unsigned long) &arg); - task_size = START; -} +unsigned long uml_start; /* Set in early boot */ unsigned long uml_physmem; @@ -156,7 +124,8 @@ void set_cmdline(char *cmd) { char *umid, *ptr; - if(honeypot) return; + + if(CHOOSE_MODE(honeypot, 0)) return; umid = get_umid(1); if(umid != NULL){ @@ -215,11 +184,48 @@ __uml_setup("ncpus=", uml_ncpus_setup, "ncpus=<# of desired CPUs>\n" -" This tells an SMP kernel how many virtual processors to start.\n" -" Currently, this has no effect because SMP isn't enabled.\n\n" +" This tells an SMP kernel how many virtual processors to start.\n\n" ); #endif +int force_tt = 0; + +#if defined(CONFIG_MODE_TT) && defined(CONFIG_MODE_SKAS) +#define DEFAULT_TT 0 + +static int __init mode_tt_setup(char *line, int *add) +{ + force_tt = 1; + return(0); +} + +__uml_setup("mode=tt", mode_tt_setup, +"mode=tt\n" +" When both CONFIG_MODE_TT and CONFIG_MODE_SKAS are enabled, this option\n" +" forces UML to run in tt (tracing thread) mode. It is not the default\n" +" because it's slower and less secure than skas mode.\n\n" +); + +#else +#ifdef CONFIG_MODE_SKAS + +#define DEFAULT_TT 0 + +#else +#ifdef CONFIG_MODE_TT + +#define DEFAULT_TT 1 + +#else + +#error Either CONFIG_MODE_TT or CONFIG_MODE_SKAS must be enabled + +#endif +#endif +#endif + +int mode_tt = DEFAULT_TT; + static int __init Usage(char *line, int *add) { const char **p; @@ -267,8 +273,6 @@ return; } -extern int debug_trace; - /* Set during early boot */ unsigned long brk_start; static struct vm_reserved kernel_vm_reserved; @@ -280,7 +284,6 @@ unsigned long avail; unsigned long virtmem_size, max_physmem; unsigned int i, add, err; - void *sp; for (i = 1; i < argc; i++){ if((i == 1) && (argv[i][0] == ' ')) continue; @@ -290,13 +293,14 @@ } if(have_root == 0) add_arg(saved_command_line, DEFAULT_COMMAND_LINE); - if(!jail || debug) - remap_data(ROUND_DOWN(&_stext), ROUND_UP(&_etext), 1); - remap_data(ROUND_DOWN(&_sdata), ROUND_UP(&_edata), 1); + mode_tt = force_tt ? 1 : !can_do_skas(); + uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, + &host_task_size, &task_size); + brk_start = (unsigned long) sbrk(0); - remap_data(ROUND_DOWN(&__bss_start), ROUND_UP(brk_start), 1); + CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start); - uml_physmem = START; + uml_physmem = uml_start; /* Reserve up to 4M after the current brk */ uml_reserved = ROUND_4M(brk_start) + (1 << 22); @@ -331,8 +335,10 @@ virtmem_size); err = reserve_vm(high_physmem, end_vm, &kernel_vm_reserved); - if(err) - tracer_panic("Failed to reserve VM area for kernel VM\n"); + if(err){ + printf("Failed to reserve VM area for kernel VM\n"); + exit(1); + } uml_postsetup(); @@ -340,9 +346,8 @@ 2 * PAGE_SIZE; task_protections((unsigned long) &init_thread_info); - sp = (void *) init_task.thread.kernel_stack + 2 * PAGE_SIZE - - sizeof(unsigned long); - return(signals(start_kernel_proc, sp)); + + return(CHOOSE_MODE(start_uml_tt(), start_uml_skas())); } static int panic_exit(struct notifier_block *self, unsigned long unused1, |
From: James S. <jsi...@us...> - 2003-02-01 18:57:47
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/sparc64/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv15026/linux/arch/sparc64/kernel Modified Files: ioctl32.c Log Message: Synced to 2.5.59 Index: ioctl32.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/sparc64/kernel/ioctl32.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ioctl32.c 10 Dec 2002 21:06:09 -0000 1.6 +++ ioctl32.c 1 Feb 2003 18:57:13 -0000 1.7 @@ -450,13 +450,13 @@ struct ifmap32 ifru_map; char ifru_slave[IFNAMSIZ]; /* Just fits the size */ char ifru_newname[IFNAMSIZ]; - __kernel_caddr_t32 ifru_data; + compat_caddr_t ifru_data; } ifr_ifru; }; struct ifconf32 { int ifc_len; /* size of buffer */ - __kernel_caddr_t32 ifcbuf; + compat_caddr_t ifcbuf; }; #ifdef CONFIG_NET @@ -973,8 +973,8 @@ mm_segment_t old_fs = get_fs(); ret = copy_from_user (&f, (struct fbcursor32 *)arg, 2 * sizeof (short) + 2 * sizeof(struct fbcurpos)); - ret |= __get_user(f.size.fbx, &(((struct fbcursor32 *)arg)->size.fbx)); - ret |= __get_user(f.size.fby, &(((struct fbcursor32 *)arg)->size.fby)); + ret |= __get_user(f.size.x, &(((struct fbcursor32 *)arg)->size.x)); + ret |= __get_user(f.size.y, &(((struct fbcursor32 *)arg)->size.y)); ret |= __get_user(f.cmap.index, &(((struct fbcursor32 *)arg)->cmap.index)); ret |= __get_user(f.cmap.count, &(((struct fbcursor32 *)arg)->cmap.count)); ret |= __get_user(r, &(((struct fbcursor32 *)arg)->cmap.red)); @@ -985,10 +985,10 @@ if (ret) return -EFAULT; if (f.set & FB_CUR_SETCMAP) { - if ((uint) f.size.fby > 32) + if ((uint) f.size.y > 32) return -EINVAL; - ret = copy_from_user (mask, (char *)A(m), f.size.fby * 4); - ret |= copy_from_user (image, (char *)A(i), f.size.fby * 4); + ret = copy_from_user (mask, (char *)A(m), f.size.y * 4); + ret |= copy_from_user (image, (char *)A(i), f.size.y * 4); if (ret) return -EFAULT; f.image = image; f.mask = mask; @@ -1009,7 +1009,7 @@ struct fb_fix_screeninfo32 { char id[16]; - __kernel_caddr_t32 smem_start; + compat_caddr_t smem_start; __u32 smem_len; __u32 type; __u32 type_aux; @@ -1018,7 +1018,7 @@ __u16 ypanstep; __u16 ywrapstep; __u32 line_length; - __kernel_caddr_t32 mmio_start; + compat_caddr_t mmio_start; __u32 mmio_len; __u32 accel; __u16 reserved[3]; @@ -1027,10 +1027,10 @@ struct fb_cmap32 { __u32 start; __u32 len; - __kernel_caddr_t32 red; - __kernel_caddr_t32 green; - __kernel_caddr_t32 blue; - __kernel_caddr_t32 transp; + compat_caddr_t red; + compat_caddr_t green; + compat_caddr_t blue; + compat_caddr_t transp; }; static int fb_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) @@ -1169,7 +1169,7 @@ unsigned char rate; unsigned char spec1; unsigned char fmt_gap; - const __kernel_caddr_t32 name; + const compat_caddr_t name; }; struct floppy_drive_params32 { @@ -1208,7 +1208,7 @@ int fd_ref; int fd_device; int last_checked; - __kernel_caddr_t32 dmabuf; + compat_caddr_t dmabuf; int bufblocks; }; @@ -1732,7 +1732,7 @@ } struct ppp_option_data32 { - __kernel_caddr_t32 ptr; + compat_caddr_t ptr; __u32 length; int transmit; }; @@ -1813,8 +1813,8 @@ __u32 mt_dsreg; __u32 mt_gstat; __u32 mt_erreg; - __kernel_daddr_t32 mt_fileno; - __kernel_daddr_t32 mt_blkno; + compat_daddr_t mt_fileno; + compat_daddr_t mt_blkno; }; #define MTIOCGET32 _IOR('m', 2, struct mtget32) @@ -1932,7 +1932,7 @@ struct cdrom_read32 { int cdread_lba; - __kernel_caddr_t32 cdread_bufaddr; + compat_caddr_t cdread_bufaddr; int cdread_buflen; }; @@ -1940,16 +1940,16 @@ union cdrom_addr addr; u_char addr_format; int nframes; - __kernel_caddr_t32 buf; + compat_caddr_t buf; }; struct cdrom_generic_command32 { unsigned char cmd[CDROM_PACKET_SIZE]; - __kernel_caddr_t32 buffer; + compat_caddr_t buffer; unsigned int buflen; int stat; - __kernel_caddr_t32 sense; - __kernel_caddr_t32 reserved[3]; + compat_caddr_t sense; + compat_caddr_t reserved[3]; }; static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) @@ -1958,7 +1958,7 @@ struct cdrom_read cdread; struct cdrom_read_audio cdreadaudio; struct cdrom_generic_command cgc; - __kernel_caddr_t32 addr; + compat_caddr_t addr; char *data = 0; void *karg; int err = 0; @@ -2041,9 +2041,9 @@ struct loop_info32 { int lo_number; /* ioctl r/o */ - __kernel_dev_t32 lo_device; /* ioctl r/o */ + compat_dev_t lo_device; /* ioctl r/o */ unsigned int lo_inode; /* ioctl r/o */ - __kernel_dev_t32 lo_rdevice; /* ioctl r/o */ + compat_dev_t lo_rdevice; /* ioctl r/o */ int lo_offset; int lo_encrypt_type; int lo_encrypt_key_size; /* ioctl w/o */ @@ -2248,7 +2248,7 @@ set_fs(old_fs); if (err >= 0) - err = put_user(kuid, (__kernel_uid_t32 *)arg); + err = put_user(kuid, (compat_uid_t *)arg); return err; } @@ -2256,7 +2256,7 @@ struct ncp_ioctl_request_32 { unsigned int function; unsigned int size; - __kernel_caddr_t32 data; + compat_caddr_t data; }; struct ncp_fs_info_v2_32 { @@ -2277,13 +2277,13 @@ { int auth_type; unsigned int object_name_len; - __kernel_caddr_t32 object_name; /* an userspace data, in most cases user name */ + compat_caddr_t object_name; /* an userspace data, in most cases user name */ }; struct ncp_privatedata_ioctl_32 { unsigned int len; - __kernel_caddr_t32 data; /* ~1000 for NDS */ + compat_caddr_t data; /* ~1000 for NDS */ }; #define NCP_IOC_NCPREQUEST_32 _IOR('n', 1, struct ncp_ioctl_request_32) @@ -2557,12 +2557,12 @@ struct atmif_sioc32 { int number; int length; - __kernel_caddr_t32 arg; + compat_caddr_t arg; }; struct atm_iobuf32 { int length; - __kernel_caddr_t32 buffer; + compat_caddr_t buffer; }; #define ATM_GETLINKRATE32 _IOW('a', ATMIOC_ITF+1, struct atmif_sioc32) @@ -2623,7 +2623,7 @@ iobuf.length = iobuf32.length; - if (iobuf32.buffer == (__kernel_caddr_t32) NULL || iobuf32.length == 0) { + if (iobuf32.buffer == (compat_caddr_t) NULL || iobuf32.length == 0) { iobuf.buffer = (void*)(unsigned long)iobuf32.buffer; } else { iobuf.buffer = kmalloc(iobuf.length, GFP_KERNEL); @@ -2677,7 +2677,7 @@ sioc.number = sioc32.number; sioc.length = sioc32.length; - if (sioc32.arg == (__kernel_caddr_t32) NULL || sioc32.length == 0) { + if (sioc32.arg == (compat_caddr_t) NULL || sioc32.length == 0) { sioc.arg = (void*)(unsigned long)sioc32.arg; } else { sioc.arg = kmalloc(sioc.length, GFP_KERNEL); @@ -2835,7 +2835,7 @@ } lv_status_byindex_req32_t; typedef struct { - __kernel_dev_t32 dev; + compat_dev_t dev; u32 lv; } lv_status_bydev_req32_t; @@ -4244,22 +4244,10 @@ } /* Fix sizeof(sizeof()) breakage */ -#define BLKELVGET_32 _IOR(0x12,106,int) -#define BLKELVSET_32 _IOW(0x12,107,int) #define BLKBSZGET_32 _IOR(0x12,112,int) #define BLKBSZSET_32 _IOW(0x12,113,int) #define BLKGETSIZE64_32 _IOR(0x12,114,int) -static int do_blkelvget(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - return sys_ioctl(fd, BLKELVGET, arg); -} - -static int do_blkelvset(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - return sys_ioctl(fd, BLKELVSET, arg); -} - static int do_blkbszget(unsigned int fd, unsigned int cmd, unsigned long arg) { return sys_ioctl(fd, BLKBSZGET, arg); @@ -4346,11 +4334,6 @@ COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO) COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO) COMPATIBLE_IOCTL(FBIOPAN_DISPLAY) -COMPATIBLE_IOCTL(FBIOGET_FCURSORINFO) -COMPATIBLE_IOCTL(FBIOGET_VCURSORINFO) -COMPATIBLE_IOCTL(FBIOPUT_VCURSORINFO) -COMPATIBLE_IOCTL(FBIOGET_CURSORSTATE) -COMPATIBLE_IOCTL(FBIOPUT_CURSORSTATE) COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP) COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP) /* Little f */ @@ -5133,7 +5116,7 @@ HANDLE_IOCTL(VIDIOCGFREQ32, do_video_ioctl) HANDLE_IOCTL(VIDIOCSFREQ32, do_video_ioctl) /* One SMB ioctl needs translations. */ -#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, __kernel_uid_t32) +#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid) /* NCPFS */ HANDLE_IOCTL(NCP_IOC_NCPREQUEST_32, do_ncp_ncprequest) @@ -5208,9 +5191,6 @@ HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb) HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal) /* take care of sizeof(sizeof()) breakage */ -/* elevator */ -HANDLE_IOCTL(BLKELVGET_32, do_blkelvget) -HANDLE_IOCTL(BLKELVSET_32, do_blkelvset) /* block stuff */ HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget) HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset) |
From: James S. <jsi...@us...> - 2003-02-01 18:57:47
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/x86_64/ia32 In directory sc8-pr-cvs1:/tmp/cvs-serv15026/linux/arch/x86_64/ia32 Modified Files: ia32_ioctl.c Log Message: Synced to 2.5.59 Index: ia32_ioctl.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/x86_64/ia32/ia32_ioctl.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ia32_ioctl.c 10 Dec 2002 21:06:12 -0000 1.9 +++ ia32_ioctl.c 1 Feb 2003 18:57:13 -0000 1.10 @@ -11,6 +11,7 @@ #include <linux/config.h> #include <linux/types.h> +#include <linux/compat.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/smp.h> @@ -405,14 +406,9 @@ return err; } -struct timeval32 { - int tv_sec; - int tv_usec; -}; - static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg) { - struct timeval32 *up = (struct timeval32 *)arg; + struct compat_timeval *up = (struct compat_timeval *)arg; struct timeval ktv; mm_segment_t old_fs = get_fs(); int err; @@ -454,13 +450,13 @@ struct ifmap32 ifru_map; char ifru_slave[IFNAMSIZ]; /* Just fits the size */ char ifru_newname[IFNAMSIZ]; - __kernel_caddr_t32 ifru_data; + compat_caddr_t ifru_data; } ifr_ifru; }; struct ifconf32 { int ifc_len; /* size of buffer */ - __kernel_caddr_t32 ifcbuf; + compat_caddr_t ifcbuf; }; #ifdef CONFIG_NET @@ -880,7 +876,7 @@ struct fb_fix_screeninfo32 { char id[16]; - __kernel_caddr_t32 smem_start; + compat_caddr_t smem_start; __u32 smem_len; __u32 type; __u32 type_aux; @@ -889,7 +885,7 @@ __u16 ypanstep; __u16 ywrapstep; __u32 line_length; - __kernel_caddr_t32 mmio_start; + compat_caddr_t mmio_start; __u32 mmio_len; __u32 accel; __u16 reserved[3]; @@ -898,10 +894,10 @@ struct fb_cmap32 { __u32 start; __u32 len; - __kernel_caddr_t32 red; - __kernel_caddr_t32 green; - __kernel_caddr_t32 blue; - __kernel_caddr_t32 transp; + compat_caddr_t red; + compat_caddr_t green; + compat_caddr_t blue; + compat_caddr_t transp; }; static int fb_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) @@ -1040,7 +1036,7 @@ unsigned char rate; unsigned char spec1; unsigned char fmt_gap; - const __kernel_caddr_t32 name; + const compat_caddr_t name; }; struct floppy_drive_params32 { @@ -1079,7 +1075,7 @@ int fd_ref; int fd_device; int last_checked; - __kernel_caddr_t32 dmabuf; + compat_caddr_t dmabuf; int bufblocks; }; @@ -1604,15 +1600,15 @@ } struct ppp_option_data32 { - __kernel_caddr_t32 ptr; + compat_caddr_t ptr; __u32 length; int transmit; }; #define PPPIOCSCOMPRESS32 _IOW('t', 77, struct ppp_option_data32) struct ppp_idle32 { - __kernel_time_t32 xmit_idle; - __kernel_time_t32 recv_idle; + compat_time_t xmit_idle; + compat_time_t recv_idle; }; #define PPPIOCGIDLE32 _IOR('t', 63, struct ppp_idle32) @@ -1685,8 +1681,8 @@ __u32 mt_dsreg; __u32 mt_gstat; __u32 mt_erreg; - __kernel_daddr_t32 mt_fileno; - __kernel_daddr_t32 mt_blkno; + compat_daddr_t mt_fileno; + compat_daddr_t mt_blkno; }; #define MTIOCGET32 _IOR('m', 2, struct mtget32) @@ -1804,7 +1800,7 @@ struct cdrom_read32 { int cdread_lba; - __kernel_caddr_t32 cdread_bufaddr; + compat_caddr_t cdread_bufaddr; int cdread_buflen; }; @@ -1812,16 +1808,16 @@ union cdrom_addr addr; u_char addr_format; int nframes; - __kernel_caddr_t32 buf; + compat_caddr_t buf; }; struct cdrom_generic_command32 { unsigned char cmd[CDROM_PACKET_SIZE]; - __kernel_caddr_t32 buffer; + compat_caddr_t buffer; unsigned int buflen; int stat; - __kernel_caddr_t32 sense; - __kernel_caddr_t32 reserved[3]; + compat_caddr_t sense; + compat_caddr_t reserved[3]; }; static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) @@ -1830,7 +1826,7 @@ struct cdrom_read cdread; struct cdrom_read_audio cdreadaudio; struct cdrom_generic_command cgc; - __kernel_caddr_t32 addr; + compat_caddr_t addr; char *data = 0; void *karg; int err = 0; @@ -1913,9 +1909,9 @@ struct loop_info32 { int lo_number; /* ioctl r/o */ - __kernel_dev_t32 lo_device; /* ioctl r/o */ + compat_dev_t lo_device; /* ioctl r/o */ unsigned int lo_inode; /* ioctl r/o */ - __kernel_dev_t32 lo_rdevice; /* ioctl r/o */ + compat_dev_t lo_rdevice; /* ioctl r/o */ int lo_offset; int lo_encrypt_type; int lo_encrypt_key_size; /* ioctl w/o */ @@ -2120,7 +2116,7 @@ set_fs(old_fs); if (err >= 0) - err = put_user(kuid, (__kernel_uid_t32 *)arg); + err = put_user(kuid, (compat_pid_t *)arg); return err; } @@ -2128,12 +2124,12 @@ struct atmif_sioc32 { int number; int length; - __kernel_caddr_t32 arg; + compat_caddr_t arg; }; struct atm_iobuf32 { int length; - __kernel_caddr_t32 buffer; + compat_caddr_t buffer; }; #define ATM_GETLINKRATE32 _IOW('a', ATMIOC_ITF+1, struct atmif_sioc32) @@ -2194,7 +2190,7 @@ iobuf.length = iobuf32.length; - if (iobuf32.buffer == (__kernel_caddr_t32) NULL || iobuf32.length == 0) { + if (iobuf32.buffer == (compat_caddr_t) NULL || iobuf32.length == 0) { iobuf.buffer = (void*)(unsigned long)iobuf32.buffer; } else { iobuf.buffer = kmalloc(iobuf.length, GFP_KERNEL); @@ -2248,7 +2244,7 @@ sioc.number = sioc32.number; sioc.length = sioc32.length; - if (sioc32.arg == (__kernel_caddr_t32) NULL || sioc32.length == 0) { + if (sioc32.arg == (compat_caddr_t) NULL || sioc32.length == 0) { sioc.arg = (void*)(unsigned long)sioc32.arg; } else { sioc.arg = kmalloc(sioc.length, GFP_KERNEL); @@ -2779,543 +2775,6 @@ } #endif -#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE) -/* This really belongs in include/linux/drm.h -DaveM */ -#include "../../../drivers/char/drm/drm.h" - -typedef struct drm32_version { - int version_major; /* Major version */ - int version_minor; /* Minor version */ - int version_patchlevel;/* Patch level */ - int name_len; /* Length of name buffer */ - u32 name; /* Name of driver */ - int date_len; /* Length of date buffer */ - u32 date; /* User-space buffer to hold date */ - int desc_len; /* Length of desc buffer */ - u32 desc; /* User-space buffer to hold desc */ -} drm32_version_t; -#define DRM32_IOCTL_VERSION DRM_IOWR(0x00, drm32_version_t) - -static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - drm32_version_t *uversion = (drm32_version_t *)arg; - char *name_ptr, *date_ptr, *desc_ptr; - u32 tmp1, tmp2, tmp3; - drm_version_t kversion; - mm_segment_t old_fs; - int ret; - - memset(&kversion, 0, sizeof(kversion)); - if (get_user(kversion.name_len, &uversion->name_len) || - get_user(kversion.date_len, &uversion->date_len) || - get_user(kversion.desc_len, &uversion->desc_len) || - get_user(tmp1, &uversion->name) || - get_user(tmp2, &uversion->date) || - get_user(tmp3, &uversion->desc)) - return -EFAULT; - - name_ptr = (char *) A(tmp1); - date_ptr = (char *) A(tmp2); - desc_ptr = (char *) A(tmp3); - - ret = -ENOMEM; - if (kversion.name_len && name_ptr) { - kversion.name = kmalloc(kversion.name_len, GFP_KERNEL); - if (!kversion.name) - goto out; - } - if (kversion.date_len && date_ptr) { - kversion.date = kmalloc(kversion.date_len, GFP_KERNEL); - if (!kversion.date) - goto out; - } - if (kversion.desc_len && desc_ptr) { - kversion.desc = kmalloc(kversion.desc_len, GFP_KERNEL); - if (!kversion.desc) - goto out; - } - - old_fs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_ioctl (fd, DRM_IOCTL_VERSION, (unsigned long)&kversion); - set_fs(old_fs); - - if (!ret) { - if ((kversion.name && - copy_to_user(name_ptr, kversion.name, kversion.name_len)) || - (kversion.date && - copy_to_user(date_ptr, kversion.date, kversion.date_len)) || - (kversion.desc && - copy_to_user(desc_ptr, kversion.desc, kversion.desc_len))) - ret = -EFAULT; - if (put_user(kversion.version_major, &uversion->version_major) || - put_user(kversion.version_minor, &uversion->version_minor) || - put_user(kversion.version_patchlevel, &uversion->version_patchlevel) || - put_user(kversion.name_len, &uversion->name_len) || - put_user(kversion.date_len, &uversion->date_len) || - put_user(kversion.desc_len, &uversion->desc_len)) - ret = -EFAULT; - } - -out: - if (kversion.name) - kfree(kversion.name); - if (kversion.date) - kfree(kversion.date); - if (kversion.desc) - kfree(kversion.desc); - return ret; -} - -typedef struct drm32_unique { - int unique_len; /* Length of unique */ - u32 unique; /* Unique name for driver instantiation */ -} drm32_unique_t; -#define DRM32_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm32_unique_t) -#define DRM32_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm32_unique_t) - -static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - drm32_unique_t *uarg = (drm32_unique_t *)arg; - drm_unique_t karg; - mm_segment_t old_fs; - char *uptr; - u32 tmp; - int ret; - - if (get_user(karg.unique_len, &uarg->unique_len)) - return -EFAULT; - karg.unique = NULL; - - if (get_user(tmp, &uarg->unique)) - return -EFAULT; - - uptr = (char *) A(tmp); - - if (uptr) { - karg.unique = kmalloc(karg.unique_len, GFP_KERNEL); - if (!karg.unique) - return -ENOMEM; - if (cmd == DRM32_IOCTL_SET_UNIQUE && - copy_from_user(karg.unique, uptr, karg.unique_len)) { - kfree(karg.unique); - return -EFAULT; - } - } - - old_fs = get_fs(); - set_fs(KERNEL_DS); - if (cmd == DRM32_IOCTL_GET_UNIQUE) - ret = sys_ioctl (fd, DRM_IOCTL_GET_UNIQUE, (unsigned long)&karg); - else - ret = sys_ioctl (fd, DRM_IOCTL_SET_UNIQUE, (unsigned long)&karg); - set_fs(old_fs); - - if (!ret) { - if (cmd == DRM32_IOCTL_GET_UNIQUE && - uptr != NULL && - copy_to_user(uptr, karg.unique, karg.unique_len)) - ret = -EFAULT; - if (put_user(karg.unique_len, &uarg->unique_len)) - ret = -EFAULT; - } - - if (karg.unique != NULL) - kfree(karg.unique); - - return ret; -} - -typedef struct drm32_map { - u32 offset; /* Requested physical address (0 for SAREA)*/ - u32 size; /* Requested physical size (bytes) */ - drm_map_type_t type; /* Type of memory to map */ - drm_map_flags_t flags; /* Flags */ - u32 handle; /* User-space: "Handle" to pass to mmap */ - /* Kernel-space: kernel-virtual address */ - int mtrr; /* MTRR slot used */ - /* Private data */ -} drm32_map_t; -#define DRM32_IOCTL_ADD_MAP DRM_IOWR(0x15, drm32_map_t) - -static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - drm32_map_t *uarg = (drm32_map_t *) arg; - drm_map_t karg; - mm_segment_t old_fs; - u32 tmp; - int ret; - - ret = get_user(karg.offset, &uarg->offset); - ret |= get_user(karg.size, &uarg->size); - ret |= get_user(karg.type, &uarg->type); - ret |= get_user(karg.flags, &uarg->flags); - ret |= get_user(tmp, &uarg->handle); - ret |= get_user(karg.mtrr, &uarg->mtrr); - if (ret) - return -EFAULT; - - karg.handle = (void *) A(tmp); - - old_fs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_ioctl(fd, DRM_IOCTL_ADD_MAP, (unsigned long) &karg); - set_fs(old_fs); - - if (!ret) { - ret = put_user(karg.offset, &uarg->offset); - ret |= put_user(karg.size, &uarg->size); - ret |= put_user(karg.type, &uarg->type); - ret |= put_user(karg.flags, &uarg->flags); - tmp = (u32) (long)karg.handle; - ret |= put_user(tmp, &uarg->handle); - ret |= put_user(karg.mtrr, &uarg->mtrr); - if (ret) - ret = -EFAULT; - } - - return ret; -} - -typedef struct drm32_buf_info { - int count; /* Entries in list */ - u32 list; /* (drm_buf_desc_t *) */ -} drm32_buf_info_t; -#define DRM32_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm32_buf_info_t) - -static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - drm32_buf_info_t *uarg = (drm32_buf_info_t *)arg; - drm_buf_desc_t *ulist; - drm_buf_info_t karg; - mm_segment_t old_fs; - int orig_count, ret; - u32 tmp; - - if (get_user(karg.count, &uarg->count) || - get_user(tmp, &uarg->list)) - return -EFAULT; - - ulist = (drm_buf_desc_t *) A(tmp); - - orig_count = karg.count; - - karg.list = kmalloc(karg.count * sizeof(drm_buf_desc_t), GFP_KERNEL); - if (!karg.list) - return -EFAULT; - - old_fs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_ioctl(fd, DRM_IOCTL_INFO_BUFS, (unsigned long) &karg); - set_fs(old_fs); - - if (!ret) { - if (karg.count <= orig_count && - (copy_to_user(ulist, karg.list, - karg.count * sizeof(drm_buf_desc_t)))) - ret = -EFAULT; - if (put_user(karg.count, &uarg->count)) - ret = -EFAULT; - } - - kfree(karg.list); - - return ret; -} - -typedef struct drm32_buf_free { - int count; - u32 list; /* (int *) */ -} drm32_buf_free_t; -#define DRM32_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm32_buf_free_t) - -static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - drm32_buf_free_t *uarg = (drm32_buf_free_t *)arg; - drm_buf_free_t karg; - mm_segment_t old_fs; - int *ulist; - int ret; - u32 tmp; - - if (get_user(karg.count, &uarg->count) || - get_user(tmp, &uarg->list)) - return -EFAULT; - - ulist = (int *) A(tmp); - - karg.list = kmalloc(karg.count * sizeof(int), GFP_KERNEL); - if (!karg.list) - return -ENOMEM; - - ret = -EFAULT; - if (copy_from_user(karg.list, ulist, (karg.count * sizeof(int)))) - goto out; - - old_fs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_ioctl(fd, DRM_IOCTL_FREE_BUFS, (unsigned long) &karg); - set_fs(old_fs); - -out: - kfree(karg.list); - - return ret; -} - -typedef struct drm32_buf_pub { - int idx; /* Index into master buflist */ - int total; /* Buffer size */ - int used; /* Amount of buffer in use (for DMA) */ - u32 address; /* Address of buffer (void *) */ -} drm32_buf_pub_t; - -typedef struct drm32_buf_map { - int count; /* Length of buflist */ - u32 virtual; /* Mmaped area in user-virtual (void *) */ - u32 list; /* Buffer information (drm_buf_pub_t *) */ -} drm32_buf_map_t; -#define DRM32_IOCTL_MAP_BUFS DRM_IOWR(0x19, drm32_buf_map_t) - -static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - drm32_buf_map_t *uarg = (drm32_buf_map_t *)arg; - drm32_buf_pub_t *ulist; - drm_buf_map_t karg; - mm_segment_t old_fs; - int orig_count, ret, i; - u32 tmp1, tmp2; - - if (get_user(karg.count, &uarg->count) || - get_user(tmp1, &uarg->virtual) || - get_user(tmp2, &uarg->list)) - return -EFAULT; - - karg.virtual = (void *) A(tmp1); - ulist = (drm32_buf_pub_t *) A(tmp2); - - orig_count = karg.count; - - karg.list = kmalloc(karg.count * sizeof(drm_buf_pub_t), GFP_KERNEL); - if (!karg.list) - return -ENOMEM; - - ret = -EFAULT; - for (i = 0; i < karg.count; i++) { - if (get_user(karg.list[i].idx, &ulist[i].idx) || - get_user(karg.list[i].total, &ulist[i].total) || - get_user(karg.list[i].used, &ulist[i].used) || - get_user(tmp1, &ulist[i].address)) - goto out; - - karg.list[i].address = (void *) A(tmp1); - } - - old_fs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_ioctl(fd, DRM_IOCTL_MAP_BUFS, (unsigned long) &karg); - set_fs(old_fs); - - if (!ret) { - for (i = 0; i < orig_count; i++) { - tmp1 = (u32) (long) karg.list[i].address; - if (put_user(karg.list[i].idx, &ulist[i].idx) || - put_user(karg.list[i].total, &ulist[i].total) || - put_user(karg.list[i].used, &ulist[i].used) || - put_user(tmp1, &ulist[i].address)) { - ret = -EFAULT; - goto out; - } - } - if (put_user(karg.count, &uarg->count)) - ret = -EFAULT; - } - -out: - kfree(karg.list); - return ret; -} - -typedef struct drm32_dma { - /* Indices here refer to the offset into - buflist in drm_buf_get_t. */ - int context; /* Context handle */ - int send_count; /* Number of buffers to send */ - u32 send_indices; /* List of handles to buffers (int *) */ - u32 send_sizes; /* Lengths of data to send (int *) */ - drm_dma_flags_t flags; /* Flags */ - int request_count; /* Number of buffers requested */ - int request_size; /* Desired size for buffers */ - u32 request_indices; /* Buffer information (int *) */ - u32 request_sizes; /* (int *) */ - int granted_count; /* Number of buffers granted */ -} drm32_dma_t; -#define DRM32_IOCTL_DMA DRM_IOWR(0x29, drm32_dma_t) - -/* RED PEN The DRM layer blindly dereferences the send/request - * indice/size arrays even though they are userland - * pointers. -DaveM - */ -static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - drm32_dma_t *uarg = (drm32_dma_t *) arg; - int *u_si, *u_ss, *u_ri, *u_rs; - drm_dma_t karg; - mm_segment_t old_fs; - int ret; - u32 tmp1, tmp2, tmp3, tmp4; - - karg.send_indices = karg.send_sizes = NULL; - karg.request_indices = karg.request_sizes = NULL; - - if (get_user(karg.context, &uarg->context) || - get_user(karg.send_count, &uarg->send_count) || - get_user(tmp1, &uarg->send_indices) || - get_user(tmp2, &uarg->send_sizes) || - get_user(karg.flags, &uarg->flags) || - get_user(karg.request_count, &uarg->request_count) || - get_user(karg.request_size, &uarg->request_size) || - get_user(tmp3, &uarg->request_indices) || - get_user(tmp4, &uarg->request_sizes) || - get_user(karg.granted_count, &uarg->granted_count)) - return -EFAULT; - - u_si = (int *) A(tmp1); - u_ss = (int *) A(tmp2); - u_ri = (int *) A(tmp3); - u_rs = (int *) A(tmp4); - - if (karg.send_count) { - karg.send_indices = kmalloc(karg.send_count * sizeof(int), GFP_KERNEL); - karg.send_sizes = kmalloc(karg.send_count * sizeof(int), GFP_KERNEL); - - ret = -ENOMEM; - if (!karg.send_indices || !karg.send_sizes) - goto out; - - ret = -EFAULT; - if (copy_from_user(karg.send_indices, u_si, - (karg.send_count * sizeof(int))) || - copy_from_user(karg.send_sizes, u_ss, - (karg.send_count * sizeof(int)))) - goto out; - } - - if (karg.request_count) { - karg.request_indices = kmalloc(karg.request_count * sizeof(int), GFP_KERNEL); - karg.request_sizes = kmalloc(karg.request_count * sizeof(int), GFP_KERNEL); - - ret = -ENOMEM; - if (!karg.request_indices || !karg.request_sizes) - goto out; - - ret = -EFAULT; - if (copy_from_user(karg.request_indices, u_ri, - (karg.request_count * sizeof(int))) || - copy_from_user(karg.request_sizes, u_rs, - (karg.request_count * sizeof(int)))) - goto out; - } - - old_fs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_ioctl(fd, DRM_IOCTL_DMA, (unsigned long) &karg); - set_fs(old_fs); - - if (!ret) { - if (put_user(karg.context, &uarg->context) || - put_user(karg.send_count, &uarg->send_count) || - put_user(karg.flags, &uarg->flags) || - put_user(karg.request_count, &uarg->request_count) || - put_user(karg.request_size, &uarg->request_size) || - put_user(karg.granted_count, &uarg->granted_count)) - ret = -EFAULT; - - if (karg.send_count) { - if (copy_to_user(u_si, karg.send_indices, - (karg.send_count * sizeof(int))) || - copy_to_user(u_ss, karg.send_sizes, - (karg.send_count * sizeof(int)))) - ret = -EFAULT; - } - if (karg.request_count) { - if (copy_to_user(u_ri, karg.request_indices, - (karg.request_count * sizeof(int))) || - copy_to_user(u_rs, karg.request_sizes, - (karg.request_count * sizeof(int)))) - ret = -EFAULT; - } - } - -out: - if (karg.send_indices) - kfree(karg.send_indices); - if (karg.send_sizes) - kfree(karg.send_sizes); - if (karg.request_indices) - kfree(karg.request_indices); - if (karg.request_sizes) - kfree(karg.request_sizes); - - return ret; -} - -typedef struct drm32_ctx_res { - int count; - u32 contexts; /* (drm_ctx_t *) */ -} drm32_ctx_res_t; -#define DRM32_IOCTL_RES_CTX DRM_IOWR(0x26, drm32_ctx_res_t) - -static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - drm32_ctx_res_t *uarg = (drm32_ctx_res_t *) arg; - drm_ctx_t *ulist; - drm_ctx_res_t karg; - mm_segment_t old_fs; - int orig_count, ret; - u32 tmp; - - karg.contexts = NULL; - if (get_user(karg.count, &uarg->count) || - get_user(tmp, &uarg->contexts)) - return -EFAULT; - - ulist = (drm_ctx_t *) A(tmp); - - orig_count = karg.count; - if (karg.count && ulist) { - karg.contexts = kmalloc((karg.count * sizeof(drm_ctx_t)), GFP_KERNEL); - if (!karg.contexts) - return -ENOMEM; - if (copy_from_user(karg.contexts, ulist, - (karg.count * sizeof(drm_ctx_t)))) { - kfree(karg.contexts); - return -EFAULT; - } - } - - old_fs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_ioctl(fd, DRM_IOCTL_RES_CTX, (unsigned long) &karg); - set_fs(old_fs); - - if (!ret) { - if (orig_count) { - if (copy_to_user(ulist, karg.contexts, - (orig_count * sizeof(drm_ctx_t)))) - ret = -EFAULT; - } - if (put_user(karg.count, &uarg->count)) - ret = -EFAULT; - } - - if (karg.contexts) - kfree(karg.contexts); - - return ret; -} - -#endif static int ret_einval(unsigned int fd, unsigned int cmd, unsigned long arg) { @@ -3491,7 +2950,7 @@ struct dirent32 { unsigned int d_ino; - __kernel_off_t32 d_off; + compat_off_t d_off; unsigned short d_reclen; char d_name[256]; /* We must not include limits.h! */ }; @@ -3566,22 +3025,10 @@ } /* Fix sizeof(sizeof()) breakage */ -#define BLKELVGET_32 _IOR(0x12,106,int) -#define BLKELVSET_32 _IOW(0x12,107,int) #define BLKBSZGET_32 _IOR(0x12,112,int) #define BLKBSZSET_32 _IOW(0x12,113,int) #define BLKGETSIZE64_32 _IOR(0x12,114,int) -static int do_blkelvget(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - return sys_ioctl(fd, BLKELVGET, arg); -} - -static int do_blkelvset(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - return sys_ioctl(fd, BLKELVSET, arg); -} - static int do_blkbszget(unsigned int fd, unsigned int cmd, unsigned long arg) { return sys_ioctl(fd, BLKBSZGET, arg); @@ -4189,11 +3636,6 @@ COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO) COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO) COMPATIBLE_IOCTL(FBIOPAN_DISPLAY) -COMPATIBLE_IOCTL(FBIOGET_FCURSORINFO) -COMPATIBLE_IOCTL(FBIOGET_VCURSORINFO) -COMPATIBLE_IOCTL(FBIOPUT_VCURSORINFO) -COMPATIBLE_IOCTL(FBIOGET_CURSORSTATE) -COMPATIBLE_IOCTL(FBIOPUT_CURSORSTATE) COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP) COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP) /* Little f */ @@ -4696,27 +4138,6 @@ COMPATIBLE_IOCTL(LV_BMAP) COMPATIBLE_IOCTL(LV_SNAPSHOT_USE_RATE) #endif /* LVM */ -#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE) -COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC) -COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID) -COMPATIBLE_IOCTL(DRM_IOCTL_AUTH_MAGIC) -COMPATIBLE_IOCTL(DRM_IOCTL_BLOCK) -COMPATIBLE_IOCTL(DRM_IOCTL_UNBLOCK) -COMPATIBLE_IOCTL(DRM_IOCTL_CONTROL) -COMPATIBLE_IOCTL(DRM_IOCTL_ADD_BUFS) -COMPATIBLE_IOCTL(DRM_IOCTL_MARK_BUFS) -COMPATIBLE_IOCTL(DRM_IOCTL_ADD_CTX) -COMPATIBLE_IOCTL(DRM_IOCTL_RM_CTX) -COMPATIBLE_IOCTL(DRM_IOCTL_MOD_CTX) -COMPATIBLE_IOCTL(DRM_IOCTL_GET_CTX) -COMPATIBLE_IOCTL(DRM_IOCTL_SWITCH_CTX) -COMPATIBLE_IOCTL(DRM_IOCTL_NEW_CTX) -COMPATIBLE_IOCTL(DRM_IOCTL_ADD_DRAW) -COMPATIBLE_IOCTL(DRM_IOCTL_RM_DRAW) -COMPATIBLE_IOCTL(DRM_IOCTL_LOCK) -COMPATIBLE_IOCTL(DRM_IOCTL_UNLOCK) -COMPATIBLE_IOCTL(DRM_IOCTL_FINISH) -#endif /* DRM */ #ifdef CONFIG_AUTOFS_FS COMPATIBLE_IOCTL(AUTOFS_IOC_READY) COMPATIBLE_IOCTL(AUTOFS_IOC_FAIL) @@ -4941,7 +4362,7 @@ HANDLE_IOCTL(VIDIOCGFREQ32, do_video_ioctl) HANDLE_IOCTL(VIDIOCSFREQ32, do_video_ioctl) /* One SMB ioctl needs translations. */ -#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, __kernel_uid_t32) +#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_pid_t) HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid) HANDLE_IOCTL(ATM_GETLINKRATE32, do_atm_ioctl) HANDLE_IOCTL(ATM_GETNAMES32, do_atm_ioctl) @@ -4984,17 +4405,6 @@ HANDLE_IOCTL(VG_CREATE_OLD, do_lvm_ioctl) HANDLE_IOCTL(LV_STATUS_BYDEV, do_lvm_ioctl) #endif /* LVM */ -#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE) -HANDLE_IOCTL(DRM32_IOCTL_VERSION, drm32_version) -HANDLE_IOCTL(DRM32_IOCTL_GET_UNIQUE, drm32_getsetunique) -HANDLE_IOCTL(DRM32_IOCTL_SET_UNIQUE, drm32_getsetunique) -HANDLE_IOCTL(DRM32_IOCTL_ADD_MAP, drm32_addmap) -HANDLE_IOCTL(DRM32_IOCTL_INFO_BUFS, drm32_info_bufs) -HANDLE_IOCTL(DRM32_IOCTL_FREE_BUFS, drm32_free_bufs) -HANDLE_IOCTL(DRM32_IOCTL_MAP_BUFS, drm32_map_bufs) -HANDLE_IOCTL(DRM32_IOCTL_DMA, drm32_dma) -HANDLE_IOCTL(DRM32_IOCTL_RES_CTX, drm32_res_ctx) -#endif /* DRM */ /* VFAT */ HANDLE_IOCTL(VFAT_IOCTL_READDIR_BOTH32, vfat_ioctl32) HANDLE_IOCTL(VFAT_IOCTL_READDIR_SHORT32, vfat_ioctl32) @@ -5005,9 +4415,6 @@ HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb) HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal) /* take care of sizeof(sizeof()) breakage */ -/* elevator */ -HANDLE_IOCTL(BLKELVGET_32, do_blkelvget) -HANDLE_IOCTL(BLKELVSET_32, do_blkelvset) /* block stuff */ HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget) HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset) @@ -5179,7 +4586,7 @@ EXPORT_SYMBOL(register_ioctl32_conversion); EXPORT_SYMBOL(unregister_ioctl32_conversion); -asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) +asmlinkage long sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) { struct file * filp; int error = -EBADF; |
From: James S. <jsi...@us...> - 2003-02-01 18:57:46
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/sh/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv15026/linux/arch/sh/kernel Modified Files: setup.c Log Message: Synced to 2.5.59 Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/sh/kernel/setup.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 |
From: James S. <jsi...@us...> - 2003-02-01 18:57:46
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/sparc/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv15026/linux/arch/sparc/kernel Modified Files: setup.c Log Message: Synced to 2.5.59 Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/sparc/kernel/setup.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 |
From: James S. <jsi...@us...> - 2003-02-01 18:57:46
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv15026/linux/arch/ppc64/kernel Modified Files: chrp_setup.c ioctl32.c Log Message: Synced to 2.5.59 Index: chrp_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/chrp_setup.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- chrp_setup.c 10 Dec 2002 21:06:03 -0000 1.6 +++ chrp_setup.c 1 Feb 2003 18:57:12 -0000 1.7 @@ -59,7 +59,7 @@ #include "i8259.h" #include "open_pic.h" -#include "xics.h" +#include <asm/xics.h> #include <asm/ppcdebug.h> extern volatile unsigned char *chrp_int_ack_special; Index: ioctl32.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/ioctl32.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ioctl32.c 10 Dec 2002 21:06:04 -0000 1.8 +++ ioctl32.c 1 Feb 2003 18:57:13 -0000 1.9 @@ -442,13 +442,13 @@ struct ifmap32 ifru_map; char ifru_slave[IFNAMSIZ]; /* Just fits the size */ char ifru_newname[IFNAMSIZ]; - __kernel_caddr_t32 ifru_data; + compat_caddr_t ifru_data; } ifr_ifru; }; struct ifconf32 { int ifc_len; /* size of buffer */ - __kernel_caddr_t32 ifcbuf; + compat_caddr_t ifcbuf; }; #ifdef CONFIG_NET @@ -884,7 +884,7 @@ unsigned char rate; unsigned char spec1; unsigned char fmt_gap; - const __kernel_caddr_t32 name; + const compat_caddr_t name; }; struct floppy_drive_params32 { @@ -923,7 +923,7 @@ int fd_ref; int fd_device; int last_checked; - __kernel_caddr_t32 dmabuf; + compat_caddr_t dmabuf; int bufblocks; }; @@ -1413,7 +1413,7 @@ } struct ppp_option_data32 { - __kernel_caddr_t32 ptr; + compat_caddr_t ptr; __u32 length; int transmit; }; @@ -1494,8 +1494,8 @@ __u32 mt_dsreg; __u32 mt_gstat; __u32 mt_erreg; - __kernel_daddr_t32 mt_fileno; - __kernel_daddr_t32 mt_blkno; + compat_daddr_t mt_fileno; + compat_daddr_t mt_blkno; }; #define MTIOCGET32 _IOR('m', 2, struct mtget32) @@ -1613,7 +1613,7 @@ struct cdrom_read32 { int cdread_lba; - __kernel_caddr_t32 cdread_bufaddr; + compat_caddr_t cdread_bufaddr; int cdread_buflen; }; @@ -1621,16 +1621,16 @@ union cdrom_addr addr; u_char addr_format; int nframes; - __kernel_caddr_t32 buf; + compat_caddr_t buf; }; struct cdrom_generic_command32 { unsigned char cmd[CDROM_PACKET_SIZE]; - __kernel_caddr_t32 buffer; + compat_caddr_t buffer; unsigned int buflen; int stat; - __kernel_caddr_t32 sense; - __kernel_caddr_t32 reserved[3]; + compat_caddr_t sense; + compat_caddr_t reserved[3]; }; static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) @@ -1639,7 +1639,7 @@ struct cdrom_read cdread; struct cdrom_read_audio cdreadaudio; struct cdrom_generic_command cgc; - __kernel_caddr_t32 addr; + compat_caddr_t addr; char *data = 0; void *karg; int err = 0; @@ -1722,9 +1722,9 @@ struct loop_info32 { int lo_number; /* ioctl r/o */ - __kernel_dev_t32 lo_device; /* ioctl r/o */ + compat_dev_t lo_device; /* ioctl r/o */ unsigned int lo_inode; /* ioctl r/o */ - __kernel_dev_t32 lo_rdevice; /* ioctl r/o */ + compat_dev_t lo_rdevice; /* ioctl r/o */ int lo_offset; int lo_encrypt_type; int lo_encrypt_key_size; /* ioctl w/o */ @@ -2061,7 +2061,7 @@ set_fs(old_fs); if (err >= 0) - err = put_user(kuid, (__kernel_uid_t32 *)arg); + err = put_user(kuid, (compat_uid_t *)arg); return err; } @@ -2069,7 +2069,7 @@ struct ncp_ioctl_request_32 { unsigned int function; unsigned int size; - __kernel_caddr_t32 data; + compat_caddr_t data; }; struct ncp_fs_info_v2_32 { @@ -2090,13 +2090,13 @@ { int auth_type; unsigned int object_name_len; - __kernel_caddr_t32 object_name; /* an userspace data, in most cases user name */ + compat_caddr_t object_name; /* an userspace data, in most cases user name */ }; struct ncp_privatedata_ioctl_32 { unsigned int len; - __kernel_caddr_t32 data; /* ~1000 for NDS */ + compat_caddr_t data; /* ~1000 for NDS */ }; #define NCP_IOC_NCPREQUEST_32 _IOR('n', 1, struct ncp_ioctl_request_32) @@ -2369,12 +2369,12 @@ struct atmif_sioc32 { int number; int length; - __kernel_caddr_t32 arg; + compat_caddr_t arg; }; struct atm_iobuf32 { int length; - __kernel_caddr_t32 buffer; + compat_caddr_t buffer; }; #define ATM_GETLINKRATE32 _IOW('a', ATMIOC_ITF+1, struct atmif_sioc32) @@ -2435,7 +2435,7 @@ iobuf.length = iobuf32.length; - if (iobuf32.buffer == (__kernel_caddr_t32) NULL || iobuf32.length == 0) { + if (iobuf32.buffer == (compat_caddr_t) NULL || iobuf32.length == 0) { iobuf.buffer = (void*)(unsigned long)iobuf32.buffer; } else { iobuf.buffer = kmalloc(iobuf.length, GFP_KERNEL); @@ -2489,7 +2489,7 @@ sioc.number = sioc32.number; sioc.length = sioc32.length; - if (sioc32.arg == (__kernel_caddr_t32) NULL || sioc32.length == 0) { + if (sioc32.arg == (compat_caddr_t) NULL || sioc32.length == 0) { sioc.arg = (void*)(unsigned long)sioc32.arg; } else { sioc.arg = kmalloc(sioc.length, GFP_KERNEL); @@ -3620,22 +3620,10 @@ } /* Fix sizeof(sizeof()) breakage */ -#define BLKELVGET_32 _IOR(0x12,106,int) -#define BLKELVSET_32 _IOW(0x12,107,int) #define BLKBSZGET_32 _IOR(0x12,112,int) #define BLKBSZSET_32 _IOW(0x12,113,int) #define BLKGETSIZE64_32 _IOR(0x12,114,int) -static int do_blkelvget(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - return sys_ioctl(fd, BLKELVGET, arg); -} - -static int do_blkelvset(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - return sys_ioctl(fd, BLKELVSET, arg); -} - static int do_blkbszget(unsigned int fd, unsigned int cmd, unsigned long arg) { return sys_ioctl(fd, BLKBSZGET, arg); @@ -3663,7 +3651,7 @@ #define HANDLE_IOCTL(cmd,handler) { cmd, (unsigned long)handler, 0 } #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int) -#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, __kernel_uid_t32) +#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) static struct ioctl_trans ioctl_translations[] = { /* List here explicitly which ioctl's need translation, @@ -3716,11 +3704,6 @@ COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO), COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO), COMPATIBLE_IOCTL(FBIOPAN_DISPLAY), -COMPATIBLE_IOCTL(FBIOGET_FCURSORINFO), -COMPATIBLE_IOCTL(FBIOGET_VCURSORINFO), -COMPATIBLE_IOCTL(FBIOPUT_VCURSORINFO), -COMPATIBLE_IOCTL(FBIOGET_CURSORSTATE), -COMPATIBLE_IOCTL(FBIOPUT_CURSORSTATE), COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP), COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP), #if 0 @@ -3772,6 +3755,8 @@ COMPATIBLE_IOCTL(BLKFLSBUF), COMPATIBLE_IOCTL(BLKSECTSET), COMPATIBLE_IOCTL(BLKSSZGET), +COMPATIBLE_IOCTL(BLKRASET), +COMPATIBLE_IOCTL(BLKFRASET), /* RAID */ COMPATIBLE_IOCTL(RAID_VERSION), COMPATIBLE_IOCTL(GET_ARRAY_INFO), @@ -4363,6 +4348,8 @@ HANDLE_IOCTL(HDIO_GETGEO, hdio_getgeo), HANDLE_IOCTL(HDIO_GETGEO_BIG_RAW, hdio_getgeo_big), HANDLE_IOCTL(BLKGETSIZE, w_long), +HANDLE_IOCTL(BLKRAGET, w_long), +HANDLE_IOCTL(BLKFRAGET, w_long), HANDLE_IOCTL(0x1260, broken_blkgetsize), HANDLE_IOCTL(BLKSECTGET, w_long), HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans), @@ -4475,9 +4462,6 @@ HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb), HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal), /* take care of sizeof(sizeof()) breakage */ -/* elevator */ -HANDLE_IOCTL(BLKELVGET_32, do_blkelvget), -HANDLE_IOCTL(BLKELVSET_32, do_blkelvset), /* block stuff */ HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget), HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset), @@ -4526,10 +4510,9 @@ { int i; if (!additional_ioctls) { - additional_ioctls = module_map(PAGE_SIZE); + additional_ioctls = get_zeroed_page(GFP_KERNEL); if (!additional_ioctls) return -ENOMEM; - memset(additional_ioctls, 0, PAGE_SIZE); } for (i = 0; i < PAGE_SIZE/sizeof(struct ioctl_trans); i++) { if (!additional_ioctls[i].cmd) |
From: James S. <jsi...@us...> - 2003-02-01 18:57:46
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms In directory sc8-pr-cvs1:/tmp/cvs-serv15026/linux/arch/ppc/platforms Modified Files: k2_setup.c lopec_setup.c mcpn765_setup.c menf1_setup.c mvme5100_setup.c pcore_setup.c pplus_setup.c prep_setup.c prpmc750_setup.c prpmc800_setup.c sandpoint_setup.c spruce_setup.c Log Message: Synced to 2.5.59 Index: k2_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/k2_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- k2_setup.c 23 Nov 2002 00:55:48 -0000 1.1 +++ k2_setup.c 1 Feb 2003 18:57:12 -0000 1.2 @@ -5,12 +5,10 @@ * * Author: Matt Porter <mp...@mv...> * - * Copyright 2001 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. + * 2001 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ #include <linux/config.h> @@ -314,12 +312,6 @@ i8259_init(NULL); } -static int -k2_get_irq(struct pt_regs *regs) -{ - return i8259_poll(); -} - void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { @@ -332,7 +324,7 @@ ppc_md.setup_arch = k2_setup_arch; ppc_md.show_cpuinfo = k2_show_cpuinfo; ppc_md.init_IRQ = k2_init_irq; - ppc_md.get_irq = k2_get_irq; + ppc_md.get_irq = i8259_irq; ppc_md.find_end_of_memory = k2_find_end_of_memory; ppc_md.setup_io_mappings = k2_map_io; Index: lopec_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/lopec_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- lopec_setup.c 23 Nov 2002 00:55:48 -0000 1.1 +++ lopec_setup.c 1 Feb 2003 18:57:12 -0000 1.2 @@ -6,12 +6,10 @@ * Author: Dan Cox * da...@mv... * - * Copyright 2001-2002 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. + * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ #include <linux/config.h> Index: mcpn765_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/mcpn765_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mcpn765_setup.c 23 Nov 2002 00:55:48 -0000 1.1 +++ mcpn765_setup.c 1 Feb 2003 18:57:12 -0000 1.2 @@ -6,12 +6,10 @@ * Author: Mark A. Greer * mg...@mv... * - * Copyright 2001-2002 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. + * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ /* Index: menf1_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/menf1_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- menf1_setup.c 23 Nov 2002 00:55:48 -0000 1.1 +++ menf1_setup.c 1 Feb 2003 18:57:12 -0000 1.2 @@ -1,16 +1,14 @@ /* * arch/ppc/platforms/menf1_setup.c - + * * Board setup routines for MEN F1 * * Author: Matt Porter <mp...@mv...> * - * Copyright 2001 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. + * 2001 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ #include <linux/config.h> @@ -144,11 +142,6 @@ i8259_init(NULL); } -static int menf1_get_irq(struct pt_regs *regs) -{ - return i8259_poll(); -} - /* * Set BAT 3 to map 0xF0000000. */ @@ -253,7 +246,7 @@ ppc_md.setup_arch = menf1_setup_arch; ppc_md.show_cpuinfo = menf1_show_cpuinfo; ppc_md.init_IRQ = menf1_init_IRQ; - ppc_md.get_irq = menf1_get_irq; + ppc_md.get_irq = i8259_irq; ppc_md.find_end_of_memory = menf1_find_end_of_memory; ppc_md.setup_io_mappings = menf1_map_io; Index: mvme5100_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/mvme5100_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mvme5100_setup.c 23 Nov 2002 00:55:48 -0000 1.1 +++ mvme5100_setup.c 1 Feb 2003 18:57:12 -0000 1.2 @@ -5,12 +5,10 @@ * * Author: Matt Porter <mp...@mv...> * - * Copyright 2001 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. + * 2001 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ #include <linux/config.h> Index: pcore_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/pcore_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pcore_setup.c 23 Nov 2002 00:55:48 -0000 1.1 +++ pcore_setup.c 1 Feb 2003 18:57:12 -0000 1.2 @@ -5,12 +5,10 @@ * * Author: Matt Porter <mp...@mv...> * - * Copyright 2001 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. + * 2001 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ #include <linux/config.h> Index: pplus_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/pplus_setup.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- pplus_setup.c 23 Nov 2002 00:55:48 -0000 1.5 +++ pplus_setup.c 1 Feb 2003 18:57:12 -0000 1.6 @@ -9,16 +9,10 @@ * Cort Dougan, Johnnie Peters, Matt Porter, and * Troy Benjegerdes. * - * Copyright 2001-2002 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. + * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ #include <linux/config.h> @@ -220,12 +214,6 @@ } } -static int -pplus_get_irq(struct pt_regs *regs) -{ - return i8259_poll(); -} - static void __init pplus_init_IRQ(void) { @@ -480,7 +468,7 @@ ppc_md.irq_cannonicalize = pplus_irq_cannonicalize; ppc_md.init_IRQ = pplus_init_IRQ; /* this gets changed later on if we have an OpenPIC -- Cort */ - ppc_md.get_irq = pplus_get_irq; + ppc_md.get_irq = i8259_irq; ppc_md.init = pplus_init2; ppc_md.restart = pplus_restart; Index: prep_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/prep_setup.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- prep_setup.c 23 Nov 2002 00:55:48 -0000 1.8 +++ prep_setup.c 1 Feb 2003 18:57:12 -0000 1.9 @@ -56,6 +56,7 @@ #include <asm/mpc10x.h> #include <asm/i8259.h> #include <asm/open_pic.h> +#include <asm/pci-bridge.h> unsigned char ucSystemType; unsigned char ucBoardRev; @@ -987,12 +988,24 @@ prep_init_IRQ(void) { int i; + unsigned int pci_viddid, pci_did; if (OpenPIC_Addr != NULL) openpic_init(NUM_8259_INTERRUPTS); for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ ) irq_desc[i].handler = &i8259_pic; - i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR); + /* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory + * controller, we poll (as they have a different int-ack address). */ + early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &pci_viddid); + pci_did = (pci_viddid & 0xffff0000) >> 16; + if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA) + && ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN) + || (pci_did == PCI_DEVICE_ID_MOTOROLA_HAWK))) + i8259_init(0); + else + /* PCI interrupt ack address given in section 6.1.8 of the + * PReP specification. */ + i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR); } #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) Index: prpmc750_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/prpmc750_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- prpmc750_setup.c 23 Nov 2002 00:55:48 -0000 1.1 +++ prpmc750_setup.c 1 Feb 2003 18:57:12 -0000 1.2 @@ -5,12 +5,10 @@ * * Author: Matt Porter <mp...@mv...> * - * Copyright 2001 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. + * 2001 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ #include <linux/config.h> @@ -194,12 +192,6 @@ prpmc750_power_off(void) { prpmc750_halt(); -} - -/* Resolves the open_pic.c build without including i8259.c */ -int i8259_poll(void) -{ - return 0; } static void __init Index: prpmc800_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/prpmc800_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- prpmc800_setup.c 23 Nov 2002 00:55:48 -0000 1.1 +++ prpmc800_setup.c 1 Feb 2003 18:57:12 -0000 1.2 @@ -2,12 +2,10 @@ * * Author: Dale Farnsworth <dal...@mv...> * - * Copyright 2001 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. + * 2001 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ #include <linux/config.h> @@ -188,12 +186,6 @@ prpmc800_power_off(void) { prpmc800_halt(); -} - -/* Resolves the open_pic.c build without including i8259.c */ -int i8259_poll() -{ - return 0; } static void __init Index: sandpoint_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/sandpoint_setup.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- sandpoint_setup.c 23 Nov 2002 00:55:48 -0000 1.6 +++ sandpoint_setup.c 1 Feb 2003 18:57:12 -0000 1.7 @@ -6,12 +6,10 @@ * Author: Mark A. Greer * mg...@mv... * - * Copyright 2000-2002 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. + * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ /* @@ -331,7 +329,7 @@ irq = openpic_irq(); if (irq == SANDPOINT_SIO_IRQ) { - cascade_irq = i8259_poll(); + cascade_irq = i8259_irq(regs); if (cascade_irq != -1) { irq = cascade_irq; Index: spruce_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc/platforms/spruce_setup.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- spruce_setup.c 23 Nov 2002 00:55:48 -0000 1.4 +++ spruce_setup.c 1 Feb 2003 18:57:12 -0000 1.5 @@ -6,27 +6,10 @@ * Authors: Johnnie Peters <jp...@mv...> * Matt Porter <mp...@mv...> * - * Copyright 2001-2002 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. + * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2.1. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. */ #include <linux/config.h> |
From: James S. <jsi...@us...> - 2003-02-01 18:57:45
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/i386/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv15026/linux/arch/i386/kernel Modified Files: setup.c Log Message: Synced to 2.5.59 Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/i386/kernel/setup.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- setup.c 23 Nov 2002 00:55:45 -0000 1.48 +++ setup.c 1 Feb 2003 18:57:11 -0000 1.49 @@ -40,6 +40,8 @@ #include <asm/arch_hooks.h> #include "setup_arch_pre.h" +int disable_pse __initdata = 0; + static inline char * __init machine_specific_memory_setup(void); /* @@ -47,6 +49,9 @@ */ char ignore_irq13; /* set if exception 16 works */ +/* cpu data as detected by the assembly code in head.S */ +struct cpuinfo_x86 new_cpu_data __initdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; +/* common cpu data for all cpus */ struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; unsigned long mmu_cr4_features; @@ -522,6 +527,7 @@ if (!memcmp(from+4, "nopentium", 9)) { from += 9+4; clear_bit(X86_FEATURE_PSE, boot_cpu_data.x86_capability); + disable_pse = 1; } else if (!memcmp(from+4, "exactmap", 8)) { from += 8+4; e820.nr_map = 0; @@ -836,6 +842,7 @@ { unsigned long max_low_pfn; + memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); pre_setup_arch_hook(); early_cpu_init(); |