## Automatically generated incremental diff ## From: linux-2.6.5-rc3 ## To: linux-2.6.5 ## Robot: $Id: make-incremental-diff,v 1.12 2004/01/06 07:19:36 hpa Exp $ diff -urN linux-2.6.5-rc3/CREDITS linux-2.6.5/CREDITS --- linux-2.6.5-rc3/CREDITS 2004-04-03 20:19:53.000000000 -0800 +++ linux-2.6.5/CREDITS 2004-04-03 20:20:00.000000000 -0800 @@ -3511,9 +3511,9 @@ W: http://www.yoshifuji.org/~hideaki/ P: 1024D/E0620EEA 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA D: IPv6 and other networking related stuff -D: USAGI/WIDE Project, The University of Tokyo -S: Green House #102, 1-15-5, Nishikata, -S: Bunkyo, Tokyo 113-0024 +D: USAGI/WIDE Project, Keio University +S: Jeunet Palace Kawasaki #1-201, 10-2, Furukawa-cho, Saiwai-ku +S: Kawasaki, Kanagawa 212-0025 S: Japan N: Eric Youngdale diff -urN linux-2.6.5-rc3/Documentation/arm/memory.txt linux-2.6.5/Documentation/arm/memory.txt --- linux-2.6.5-rc3/Documentation/arm/memory.txt 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.5/Documentation/arm/memory.txt 2004-04-03 20:20:01.000000000 -0800 @@ -0,0 +1,74 @@ + Kernel Memory Layout on ARM Linux + + Russell King + April 27, 2003 (2.5.68) + +This document describes the virtual memory layout which the Linux +kernel uses for ARM processors. It indicates which regions are +free for platforms to use, and which are used by generic code. + +The ARM CPU is capable of addressing a maximum of 4GB virtual memory +space, and this must be shared between user space processes, the +kernel, and hardware devices. + +As the ARM architecture matures, it becomes necessary to reserve +certain regions of VM space for use for new facilities; therefore +this document may reserve more VM space over time. + +Start End Use +-------------------------------------------------------------------------- +ffff8000 ffffffff copy_user_page / clear_user_page use. + For SA11xx and Xscale, this is used to + setup a minicache mapping. + +ffff1000 ffff7fff Reserved. + Platforms must not use this address range. + +ffff0000 ffff0fff CPU vector page. + The CPU vectors are mapped here if the + CPU supports vector relocation (control + register V bit.) + +ffe00000 fffeffff Free for platform use, not recommended. + +ffc00000 ffdfffff 2MB consistent memory mapping. + Memory returned by the consistent_alloc + low level function will be dynamically + mapped here. + +ff000000 ffbfffff Free for platform use, not recommended. + +VMALLOC_END ff000000 Free for platform use, recommended. + +VMALLOC_START VMALLOC_END vmalloc() / ioremap() space. + Memory returned by vmalloc/ioremap will + be dynamically placed in this region. + VMALLOC_START may be based upon the value + of the high_memory variable. + +PAGE_OFFSET high_memory Kernel direct-mapped RAM region. + This maps the platforms RAM, and typically + maps all platform RAM in a 1:1 relationship. + +TASK_SIZE PAGE_OFFSET Kernel module space + Kernel modules inserted via insmod are + placed here using dynamic mappings. + +00001000 TASK_SIZE User space mappings + Per-thread mappings are placed here via + the mmap() system call. + +00000000 00000fff CPU vector page / null pointer trap + CPUs which do not support vector remapping + place their vector page here. NULL pointer + dereferences by both the kernel and user + space are also caught via this mapping. + +Please note that mappings which collide with the above areas may result +in a non-bootable kernel, or may cause the kernel to (eventually) panic +at run time. + +Since future CPUs may impact the kernel mapping layout, user programs +must not access any memory which is not mapped inside their 0x0001000 +to TASK_SIZE address range. If they wish to access these areas, they +must set up their own mappings using open() and mmap(). diff -urN linux-2.6.5-rc3/Documentation/kbuild/makefiles.txt linux-2.6.5/Documentation/kbuild/makefiles.txt --- linux-2.6.5-rc3/Documentation/kbuild/makefiles.txt 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/Documentation/kbuild/makefiles.txt 2004-04-03 20:20:01.000000000 -0800 @@ -119,7 +119,7 @@ obj-y += foo.o This tell kbuild that there is one object in that directory named - foo.o. foo.o will be build from foo.c or foo.S. + foo.o. foo.o will be built from foo.c or foo.S. If foo.o shall be built as a module, the variable obj-m is used. Therefore the following pattern is often used: @@ -334,7 +334,7 @@ --- 3.9 Dependency tracking - Kbuild track dependencies on the following: + Kbuild tracks dependencies on the following: 1) All prerequisite files (both *.c and *.h) 2) CONFIG_ options used in all prerequisite files 3) Command-line used to compile target @@ -411,7 +411,7 @@ --- 4.2 Composite Host Programs Host programs can be made up based on composite objects. - The syntax used to define composite objetcs for host programs is + The syntax used to define composite objects for host programs is similar to the syntax used for kernel objects. $(-objs) list all objects used to link the final executable. @@ -811,7 +811,7 @@ extra-y - extra-y specify additional targets created in current + extra-y specify additional targets created in the current directory, in addition to any targets specified by obj-*. Listing all targets in extra-y is required for two purposes: @@ -829,7 +829,7 @@ --- 6.6 Commands useful for building a boot image - Kbuild provide a few macros that are useful when building a + Kbuild provides a few macros that are useful when building a boot image. if_changed @@ -872,7 +872,7 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE $(call if_changed,ld) - In this example there is two possible targets, requiring different + In this example there are two possible targets, requiring different options to the linker. the linker options are specified using the LDFLAGS_$@ syntax - one for each potential target. $(targets) are assinged all potential targets, herby kbuild knows diff -urN linux-2.6.5-rc3/Documentation/networking/packet_mmap.txt linux-2.6.5/Documentation/networking/packet_mmap.txt --- linux-2.6.5-rc3/Documentation/networking/packet_mmap.txt 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.5/Documentation/networking/packet_mmap.txt 2004-04-03 20:20:01.000000000 -0800 @@ -0,0 +1,412 @@ + +DaveM: + +If you agree with it I will send two small patches to modify +kernel's configure help. + + Ulisses + +-------------------------------------------------------------------------------- ++ ABSTRACT +-------------------------------------------------------------------------------- + +This file documents the CONFIG_PACKET_MMAP option available with the PACKET +socket interface on 2.4 and 2.6 kernels. This type of sockets is used for +capture network traffic with utilities like tcpdump or any other that uses +the libpcap library. + +You can find the latest version of this document at + + http://pusa.uv.es/~ulisses/packet_mmap/ + +Please send me your comments to + + Ulisses Alonso Camaró + +------------------------------------------------------------------------------- ++ Why use PACKET_MMAP +-------------------------------------------------------------------------------- + +In Linux 2.4/2.6 if PACKET_MMAP is not enabled, the capture process is very +inefficient. It uses very limited buffers and requires one system call +to capture each packet, it requires two if you want to get packet's +timestamp (like libpcap always does). + +In the other hand PACKET_MMAP is very efficient. PACKET_MMAP provides a size +configurable circular buffer mapped in user space. This way reading packets just +needs to wait for them, most of the time there is no need to issue a single +system call. By using a shared buffer between the kernel and the user +also has the benefit of minimizing packet copies. + +It's fine to use PACKET_MMAP to improve the performance of the capture process, +but it isn't everything. At least, if you are capturing at high speeds (this +is relative to the cpu speed), you should check if the device driver of your +network interface card supports some sort of interrupt load mitigation or +(even better) if it supports NAPI, also make sure it is enabled. + +-------------------------------------------------------------------------------- ++ How to use CONFIG_PACKET_MMAP +-------------------------------------------------------------------------------- + +From the user standpoint, you should use the higher level libpcap library, wich +is a de facto standard, portable across nearly all operating systems +including Win32. + +Said that, at time of this writing, official libpcap 0.8.1 is out and doesn't include +support for PACKET_MMAP, and also probably the libpcap included in your distribution. + +I'm aware of two implementations of PACKET_MMAP in libpcap: + + http://pusa.uv.es/~ulisses/packet_mmap/ (by Simon Patarin, based on libpcap 0.6.2) + http://public.lanl.gov/cpw/ (by Phil Wood, based on lastest libpcap) + +The rest of this document is intended for people who want to understand +the low level details or want to improve libpcap by including PACKET_MMAP +support. + +-------------------------------------------------------------------------------- ++ How to use CONFIG_PACKET_MMAP directly +-------------------------------------------------------------------------------- + +From the system calls stand point, the use of PACKET_MMAP involves +the following process: + + +[setup] socket() -------> creation of the capture socket + setsockopt() ---> allocation of the circular buffer (ring) + mmap() ---------> maping of the allocated buffer to the + user process + +[capture] poll() ---------> to wait for incoming packets + +[shutdown] close() --------> destruction of the capture socket and + deallocation of all associated + resources. + + +socket creation and destruction is straight forward, and is done +the same way with or without PACKET_MMAP: + +int fd; + +fd= socket(PF_PACKET, mode, htons(ETH_P_ALL)) + +where mode is SOCK_RAW for the raw interface were link level +information can be captured or SOCK_DGRAM for the cooked +interface where link level information capture is not +supported and a link level pseudo-header is provided +by the kernel. + +The destruction of the socket and all associated resources +is done by a simple call to close(fd). + +Next I will describe PACKET_MMAP settings and it's constraints, +also the maping of the circular buffer in the user process and +the use of this buffer. + +-------------------------------------------------------------------------------- ++ PACKET_MMAP settings +-------------------------------------------------------------------------------- + + +To setup PACKET_MMAP from user level code is done with a call like + + setsockopt(fd, SOL_PACKET, PACKET_RX_RING, (void *) &req, sizeof(req)) + +The most significant argument in the previous call is the req parameter, +this parameter must to have the following structure: + + struct tpacket_req + { + unsigned int tp_block_size; /* Minimal size of contiguous block */ + unsigned int tp_block_nr; /* Number of blocks */ + unsigned int tp_frame_size; /* Size of frame */ + unsigned int tp_frame_nr; /* Total number of frames */ + }; + +This structure is defined in /usr/include/linux/if_packet.h and establishes a +circular buffer (ring) of unswappable memory mapped in the capture process. +Being mapped in the capture process allows reading the captured frames and +related meta-information like timestamps without requiring a system call. + +Captured frames are grouped in blocks. Each block is a physically contiguous +region of memory and holds tp_block_size/tp_frame_size frames. The total number +of blocks is tp_block_nr. Note that tp_frame_nr is a redundant parameter because + + frames_per_block = tp_block_size/tp_frame_size + +indeed, packet_set_ring checks that the following condition is true + + frames_per_block * tp_block_nr == tp_frame_nr + + +Lets see an example, with the following values: + + tp_block_size= 4096 + tp_frame_size= 2048 + tp_block_nr = 4 + tp_frame_nr = 8 + +we will get the following buffer structure: + + block #1 block #2 ++---------+---------+ +---------+---------+ +| frame 1 | frame 2 | | frame 3 | frame 4 | ++---------+---------+ +---------+---------+ + + block #3 block #4 ++---------+---------+ +---------+---------+ +| frame 5 | frame 6 | | frame 7 | frame 8 | ++---------+---------+ +---------+---------+ + +A frame can be of any size with the only condition it can fit in a block. A block +can only hold an integer number of frames, or in other words, a frame cannot +be spawn accross two blocks so there are some datails you have to take into +account when choosing the frame_size. See "Maping and use of the circular +buffer (ring)". + + +-------------------------------------------------------------------------------- ++ PACKET_MMAP setting constraints +-------------------------------------------------------------------------------- + +In kernel versions prior to 2.4.26 (for the 2.4 branch) and 2.6.5 (2.6 branch), +the PACKET_MMAP buffer could hold only 32768 frames in a 32 bit architecture or +16384 in a 64 bit architecture. For information on these kernel versions +see http://pusa.uv.es/~ulisses/packet_mmap/packet_mmap.pre-2.4.26_2.6.5.txt + + Block size limit +------------------ + +As stated earlier, each block is a contiguous physical region of memory. These +memory regions are allocated with calls to the __get_free_pages() function. As +the name indicates, this function allocates pages of memory, and the second +argument is "order" or a power of two number of pages, that is +(for PAGE_SIZE == 4096) order=0 ==> 4096 bytes, order=1 ==> 8192 bytes, +order=2 ==> 16384 bytes, etc. The maximum size of a +region allocated by __get_free_pages is determined by the MAX_ORDER macro. More +precisely the limit can be calculated as: + + PAGE_SIZE << MAX_ORDER + + In a i386 architecture PAGE_SIZE is 4096 bytes + In a 2.4/i386 kernel MAX_ORDER is 10 + In a 2.6/i386 kernel MAX_ORDER is 11 + +So get_free_pages can allocate as much as 4MB or 8MB in a 2.4/2.6 kernel +respectively, with an i386 architecture. + +User space programs can include /usr/include/sys/user.h and +/usr/include/linux/mmzone.h to get PAGE_SIZE MAX_ORDER declarations. + +The pagesize can also be determined dynamically with the getpagesize (2) +system call. + + + Block number limit +-------------------- + +To understand the constraints of PACKET_MMAP, we have to see the structure +used to hold the pointers to each block. + +Currently, this structure is a dynamically allocated vector with kmalloc +called pg_vec, its size limits the number of blocks that can be allocated. + + +---+---+---+---+ + | x | x | x | x | + +---+---+---+---+ + | | | | + | | | v + | | v block #4 + | v block #3 + v block #2 + block #1 + + +kmalloc allocates any number of bytes of phisically contiguous memory from +a pool of pre-determined sizes. This pool of memory is mantained by the slab +allocator wich is at the end the responsible for doing the allocation and +hence wich imposes the maximum memory that kmalloc can allocate. + +In a 2.4/2.6 kernel and the i386 architecture, the limit is 131072 bytes. The +predetermined sizes that kmalloc uses can be checked in the "size-" +entries of /proc/slabinfo + +In a 32 bit architecture, pointers are 4 bytes long, so the total number of +pointers to blocks is + + 131072/4 = 32768 blocks + + + PACKET_MMAP buffer size calculator +------------------------------------ + +Definitions: + + : is the maximum size of allocable with kmalloc (see /proc/slabinfo) +: depends on the architecture -- sizeof(void *) + : depends on the architecture -- PAGE_SIZE or getpagesize (2) + : is the value defined with MAX_ORDER + : it's an upper bound of frame's capture size (more on this later) + +from these definitions we will derive + + = / + = << + +so, the max buffer size is + + * + +and, the number of frames be + + * / + +Suposse the following parameters, wich apply for 2.6 kernel and an +i386 architecture: + + = 131072 bytes + = 4 bytes + = 4096 bytes + = 11 + +and a value for of 2048 byteas. These parameters will yield + + = 131072/4 = 32768 blocks + = 4096 << 11 = 8 MiB. + +and hence the buffer will have a 262144 MiB size. So it can hold +262144 MiB / 2048 bytes = 134217728 frames + + +Actually, this buffer size is not possible with an i386 architecture. +Remember that the memory is allocated in kernel space, in the case of +an i386 kernel's memory size is limited to 1GiB. + +All memory allocations are not freed until the socket is closed. The memory +allocations are done with GFP_KERNEL priority, this basically means that +the allocation can wait and swap other process' memory in order to allocate +the nececessary memory, so normally limits can be reached. + + Other constraints +------------------- + +If you check the source code you will see that what I draw here as a frame +is not only the link level frame. At the begining of each frame there is a +header called struct tpacket_hdr used in PACKET_MMAP to hold link level's frame +meta information like timestamp. So what we draw here a frame it's really +the following (from include/linux/if_packet.h): + +/* + Frame structure: + + - Start. Frame must be aligned to TPACKET_ALIGNMENT=16 + - struct tpacket_hdr + - pad to TPACKET_ALIGNMENT=16 + - struct sockaddr_ll + - Gap, chosen so that packet data (Start+tp_net) alignes to + TPACKET_ALIGNMENT=16 + - Start+tp_mac: [ Optional MAC header ] + - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16. + - Pad to align to TPACKET_ALIGNMENT=16 + */ + + + The following are conditions that are checked in packet_set_ring + + tp_block_size must be a multiple of PAGE_SIZE (1) + tp_frame_size must be greater than TPACKET_HDRLEN (obvious) + tp_frame_size must be a multiple of TPACKET_ALIGNMENT + tp_frame_nr must be exactly frames_per_block*tp_block_nr + +Note that tp_block_size should be choosed to be a power of two or there will +be a waste of memory. + +-------------------------------------------------------------------------------- ++ Maping and use of the circular buffer (ring) +-------------------------------------------------------------------------------- + +The maping of the buffer in the user process is done with the conventional +mmap function. Even the circular buffer is compound of several physically +discontiguous blocks of memory, they are contiguous to the user space, hence +just one call to mmap is needed: + + mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + +If tp_frame_size is a divisor of tp_block_size frames will be +contiguosly spaced by tp_frame_size bytes. If not, each +tp_block_size/tp_frame_size frames there will be a gap between +the frames. This is because a frame cannot be spawn across two +blocks. + +At the beginning of each frame there is an status field (see +struct tpacket_hdr). If this field is 0 means that the frame is ready +to be used for the kernel, If not, there is a frame the user can read +and the following flags apply: + + from include/linux/if_packet.h + + #define TP_STATUS_COPY 2 + #define TP_STATUS_LOSING 4 + #define TP_STATUS_CSUMNOTREADY 8 + + +TP_STATUS_COPY : This flag indicates that the frame (and associated + meta information) has been truncated because it's + larger than tp_frame_size. This packet can be + read entirely with recvfrom(). + + In order to make this work it must to be + enabled previously with setsockopt() and + the PACKET_COPY_THRESH option. + + The number of frames than can be buffered to + be read with recvfrom is limited like a normal socket. + See the SO_RCVBUF option in the socket (7) man page. + +TP_STATUS_LOSING : indicates there were packet drops from last time + statistics where checked with getsockopt() and + the PACKET_STATISTICS option. + +TP_STATUS_CSUMNOTREADY: currently it's used for outgoing IP packets wich + it's checksum will be done in hardware. So while + reading the packet we should not try to check the + checksum. + +for convenience there are also the following defines: + + #define TP_STATUS_KERNEL 0 + #define TP_STATUS_USER 1 + +The kernel initializes all frames to TP_STATUS_KERNEL, when the kernel +receives a packet it puts in the buffer and updates the status with +at least the TP_STATUS_USER flag. Then the user can read the packet, +once the packet is read the user must zero the status field, so the kernel +can use again that frame buffer. + +The user can use poll (any other variant should apply too) to check if new +packets are in the ring: + + struct pollfd pfd; + + pfd.fd = fd; + pfd.revents = 0; + pfd.events = POLLIN|POLLRDNORM|POLLERR; + + if (status == TP_STATUS_KERNEL) + retval = poll(&pfd, 1, timeout); + +It doesn't incur in a race condition to first check the status value and +then poll for frames. + +-------------------------------------------------------------------------------- ++ THANKS +-------------------------------------------------------------------------------- + + Jesse Brandeburg, for fixing my grammathical/spelling errors + +>>> EOF +- +To unsubscribe from this list: send the line "unsubscribe linux-net" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html \ No newline at end of file diff -urN linux-2.6.5-rc3/Documentation/sound/alsa/ALSA-Configuration.txt linux-2.6.5/Documentation/sound/alsa/ALSA-Configuration.txt --- linux-2.6.5-rc3/Documentation/sound/alsa/ALSA-Configuration.txt 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/Documentation/sound/alsa/ALSA-Configuration.txt 2004-04-03 20:20:01.000000000 -0800 @@ -611,6 +611,8 @@ * Digigram VX442 omni - Omni I/O support for MidiMan M-Audio Delta44/66 + cs8427_timeout - reset timeout for the CS8427 chip (S/PDIF transciever) + in msec resolution, default value is 500 (0.5 sec) Module supports up to 8 cards and autoprobe. Note: The consumer part is not used with all Envy24 based cards (for example in the MidiMan Delta diff -urN linux-2.6.5-rc3/Documentation/sound/alsa/Procfile.txt linux-2.6.5/Documentation/sound/alsa/Procfile.txt --- linux-2.6.5-rc3/Documentation/sound/alsa/Procfile.txt 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.5/Documentation/sound/alsa/Procfile.txt 2004-04-03 20:20:01.000000000 -0800 @@ -0,0 +1,185 @@ + Proc Files of ALSA Drivers + ========================== + Takashi Iwai + +General +------- + +ALSA has its own proc tree, /proc/asound. Many useful information are +found in this tree. When you encounter a problem and need debugging, +check the files listed in the following sections. + +Each card has its subtree cardX, where X is from 0 to 7. The +card-specific files are stored in the card* subdirectories. + + +Global Information +------------------ + +cards + Shows the list of currently configured ALSA drivers, + index, the id string, short and long descriptions. + +version + Shows the version string and compile date. + +modules + Lists the module of each card + +devices + Lists the ALSA native device mappings. + +meminfo + Shows the status of allocated pages via ALSA drivers. + Appears only when CONFIG_SND_DEBUG=y. + +hwdep + Lists the currently available hwdep devices in format of + -: + +pcm + Lists the currently available PCM devices in format of + -: : : + +timer + Lists the currently available timer devices + + +oss/devices + Lists the OSS device mappings. + +oss/sndstat + Provides the output compatible with /dev/sndstat. + You can symlink this to /dev/sndstat. + + +Card Specific Files +------------------- + +The card-specific files are found in /proc/asound/card* directories. +Some drivers (e.g. cmipci) have their own proc entries for the +register dump, etc (e.g. /proc/asound/card*/cmipci shows the register +dump). These files would be really helpful for debugging. + +When PCM devices are available on this card, you can see directories +like pcm0p or pcm1c. They hold the PCM information for each PCM +stream. The number after 'pcm' is the PCM device number from 0, and +the last 'p' or 'c' means playback or capture direction. The files in +this subtree is described later. + +The status of MIDI I/O is found in midi* files. It shows the device +name and the received/transmitted bytes through the MIDI device. + +When the card is equipped with AC97 codecs, there are codec97#* +subdirectories (desribed later). + +When the OSS mixer emulation is enabled (and the module is loaded), +oss_mixer file appears here, too. This shows the current mapping of +OSS mixer elements to the ALSA control elements. You can change the +mapping by writing to this device. Read OSS-Emulation.txt for +details. + + +PCM Proc Files +-------------- + +card*/pcm*/info + The general information of this PCM device: card #, device #, + substreams, etc. + +card*/pcm*/xrun_debug + This file appears when CONFIG_SND_DEBUG=y. + This shows the status of xrun (= buffer overrun/xrun) debug of + ALSA PCM middle layer, as an integer from 0 to 2. The value + can be changed by writing to this file, such as + + # cat 2 > /proc/asound/card0/pcm0p/xrun_debug + + When this value is greater than 0, the driver will show the + messages to kernel log when an xrun is detected. The debug + message is shown also when the invalid H/W pointer is detected + at the update of periods (usually called from the interrupt + handler). + + When this value is greater than 1, the driver will show the + stack trace additionally. This may help the debugging. + +card*/pcm*/sub*/info + The general information of this PCM sub-stream. + +card*/pcm*/sub*/status + The current status of this PCM sub-stream, elapsed time, + H/W position, etc. + +card*/pcm*/sub*/hw_params + The hardware parameters set for this sub-stream. + +card*/pcm*/sub*/sw_params + The soft parameters set for this sub-stream. + +card*/pcm*/sub*/prealloc + The buffer pre-allocation information. + + +AC97 Codec Information +---------------------- + +card*/codec97#*/ac97#?-? + Shows the general information of this AC97 codec chip, such as + name, capabilities, set up. + +card*/codec97#0/ac97#?-?+regs + Shows the AC97 register dump. Useful for debugging. + + +Sequencer Information +--------------------- + +seq/drivers + Lists the currently available ALSA sequencer drivers. + +seq/clients + Shows the list of currently available sequencer clinets and + ports. The connection status and the running status are shown + in this file, too. + +seq/queues + Lists the currently allocated/running sequener queues. + +seq/timer + Lists the currently allocated/running sequencer timers. + +seq/oss + Lists the OSS-compatible sequencer stuffs. + + +Help For Debugging? +------------------- + +When the problem is related with PCM, first try to turn on xrun_debug +mode. This will give you the kernel messages when and where xrun +happened. + +If it's really a bug, report it with the following information + + - the name of the driver/card, show in /proc/asound/cards + - the reigster dump, if available (e.g. card*/cmipci) + +when it's a PCM problem, + + - set-up of PCM, shown in hw_parms, sw_params, and status in the PCM + sub-stream directory + +when it's a mixer problem, + + - AC97 proc files, codec97#*/* files + +for USB audio/midi, + + - output of lsusb -v + - stream* files in card directory + + +The ALSA bug-tracking system is found at: + + https://bugtrack.alsa-project.org/alsa-bug/ diff -urN linux-2.6.5-rc3/Documentation/sysctl/vm.txt linux-2.6.5/Documentation/sysctl/vm.txt --- linux-2.6.5-rc3/Documentation/sysctl/vm.txt 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/Documentation/sysctl/vm.txt 2004-04-03 20:20:01.000000000 -0800 @@ -22,6 +22,7 @@ - dirty_background_ratio - dirty_expire_centisecs - dirty_writeback_centisecs +- max_map_count - min_free_kbytes ============================================================== @@ -77,6 +78,21 @@ ============================================================== +max_map_count: + +This file contains the maximum number of memory map areas a process +may have. Memory map areas are used as a side-effect of calling +malloc, directly by mmap and mprotect, and also when loading shared +libraries. + +While most applications need less than a thousand maps, certain +programs, particularly malloc debuggers, may consume lots of them, +e.g., up to one or two maps per allocation. + +The default value is 65536. + +============================================================== + min_free_kbytes: This is used to force the Linux VM to keep a minimum number diff -urN linux-2.6.5-rc3/Makefile linux-2.6.5/Makefile --- linux-2.6.5-rc3/Makefile 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/Makefile 2004-04-03 20:20:01.000000000 -0800 @@ -1,8 +1,8 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 5 -EXTRAVERSION =-rc3 -NAME=Feisty Dunnart +EXTRAVERSION = +NAME=Zonked Quokka # *DOCUMENTATION* # To see a list of typical targets execute "make help" @@ -107,6 +107,16 @@ # We process the rest of the Makefile if this is the final invocation of make ifeq ($(skip-makefile),) +# Make sure we're not wasting cpu-cycles doing locale handling, yet do make +# sure error messages appear in the user-desired language +ifdef LC_ALL +LANG := $(LC_ALL) +LC_ALL := +endif +LC_COLLATE := C +LC_CTYPE := C +export LANG LC_ALL LC_COLLATE LC_CTYPE + srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) TOPDIR := $(srctree) # FIXME - TOPDIR is obsolete, use srctree/objtree @@ -652,7 +662,7 @@ uts_len := 64 define filechk_version.h - if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \ + if ((`echo -n "$(KERNELRELEASE)" | wc -c ` > $(uts_len))); then \ echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ exit 1; \ fi; \ @@ -911,6 +921,7 @@ @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 ' cscope - Generate cscope index' @echo '' @echo 'Documentation targets:' @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp diff -urN linux-2.6.5-rc3/arch/alpha/boot/misc.c linux-2.6.5/arch/alpha/boot/misc.c --- linux-2.6.5-rc3/arch/alpha/boot/misc.c 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/arch/alpha/boot/misc.c 2004-04-03 20:20:01.000000000 -0800 @@ -25,7 +25,7 @@ #define memzero(s,n) memset ((s),0,(n)) #define puts srm_printk extern long srm_printk(const char *, ...) - __attribute__ ((format (printf, 1, 2)));; + __attribute__ ((format (printf, 1, 2))); /* * gzip delarations diff -urN linux-2.6.5-rc3/arch/alpha/kernel/setup.c linux-2.6.5/arch/alpha/kernel/setup.c --- linux-2.6.5-rc3/arch/alpha/kernel/setup.c 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/arch/alpha/kernel/setup.c 2004-04-03 20:20:01.000000000 -0800 @@ -38,8 +38,9 @@ #include #include #endif - #include +#include + extern struct notifier_block *panic_notifier_list; static int alpha_panic_event(struct notifier_block *, unsigned long, void *); static struct notifier_block alpha_panic_block = { @@ -64,6 +65,11 @@ struct hwrpb_struct *hwrpb; unsigned long srm_hae; +int alpha_l1i_cacheshape; +int alpha_l1d_cacheshape; +int alpha_l2_cacheshape; +int alpha_l3_cacheshape; + #ifdef CONFIG_VERBOSE_MCHECK /* 0=minimum, 1=verbose, 2=all */ /* These can be overridden via the command line, ie "verbose_mcheck=2") */ @@ -113,6 +119,7 @@ static struct alpha_machine_vector *get_sysvec_byname(const char *); static void get_sysnames(unsigned long, unsigned long, unsigned long, char **, char **); +static void determine_cpu_caches (unsigned int); static char command_line[COMMAND_LINE_SIZE]; char saved_command_line[COMMAND_LINE_SIZE]; @@ -672,6 +679,9 @@ /* Find our memory. */ setup_memory(kernel_end); + /* First guess at cpu cache sizes. Do this before init_arch. */ + determine_cpu_caches(cpu->type); + /* Initialize the machine. Usually has to do with setting up DMA windows and the like. */ if (alpha_mv.init_arch) @@ -1156,6 +1166,18 @@ return count; } +static void +show_cache_size (struct seq_file *f, const char *which, int shape) +{ + if (shape == -1) + seq_printf (f, "%s\t\t: n/a\n", which); + else if (shape == 0) + seq_printf (f, "%s\t\t: unknown\n", which); + else + seq_printf (f, "%s\t\t: %dK, %d-way, %db line\n", + which, shape >> 10, shape & 15, + 1 << ((shape >> 4) & 15)); +} static int show_cpuinfo(struct seq_file *f, void *slot) @@ -1229,9 +1251,202 @@ num_online_cpus(), cpu_present_mask); #endif + show_cache_size (f, "L1 Icache", alpha_l1i_cacheshape); + show_cache_size (f, "L1 Dcache", alpha_l1d_cacheshape); + show_cache_size (f, "L2 cache", alpha_l2_cacheshape); + show_cache_size (f, "L3 cache", alpha_l3_cacheshape); + return 0; } +static int __init +read_mem_block(int *addr, int stride, int size) +{ + long nloads = size / stride, cnt, tmp; + + __asm__ __volatile__( + " rpcc %0\n" + "1: ldl %3,0(%2)\n" + " subq %1,1,%1\n" + /* Next two XORs introduce an explicit data dependency between + consecutive loads in the loop, which will give us true load + latency. */ + " xor %3,%2,%2\n" + " xor %3,%2,%2\n" + " addq %2,%4,%2\n" + " bne %1,1b\n" + " rpcc %3\n" + " subl %3,%0,%0\n" + : "=&r" (cnt), "=&r" (nloads), "=&r" (addr), "=&r" (tmp) + : "r" (stride), "1" (nloads), "2" (addr)); + + return cnt / (size / stride); +} + +#define CSHAPE(totalsize, linesize, assoc) \ + ((totalsize & ~0xff) | (linesize << 4) | assoc) + +/* ??? EV5 supports up to 64M, but did the systems with more than + 16M of BCACHE ever exist? */ +#define MAX_BCACHE_SIZE 16*1024*1024 + +/* Note that the offchip caches are direct mapped on all Alphas. */ +static int __init +external_cache_probe(int minsize, int width) +{ + int cycles, prev_cycles = 1000000; + int stride = 1 << width; + long size = minsize, maxsize = MAX_BCACHE_SIZE * 2; + + if (maxsize > (max_low_pfn + 1) << PAGE_SHIFT) + maxsize = 1 << (floor_log2(max_low_pfn + 1) + PAGE_SHIFT); + + /* Get the first block cached. */ + read_mem_block(__va(0), stride, size); + + while (size < maxsize) { + /* Get an average load latency in cycles. */ + cycles = read_mem_block(__va(0), stride, size); + if (cycles > prev_cycles * 2) { + /* Fine, we exceed the cache. */ + printk("%ldK Bcache detected; load hit latency %d " + "cycles, load miss latency %d cycles\n", + size >> 11, prev_cycles, cycles); + return CSHAPE(size >> 1, width, 1); + } + /* Try to get the next block cached. */ + read_mem_block(__va(size), stride, size); + prev_cycles = cycles; + size <<= 1; + } + return -1; /* No BCACHE found. */ +} + +static void __init +determine_cpu_caches (unsigned int cpu_type) +{ + int L1I, L1D, L2, L3; + + switch (cpu_type) { + case EV4_CPU: + case EV45_CPU: + { + if (cpu_type == EV4_CPU) + L1I = CSHAPE(8*1024, 5, 1); + else + L1I = CSHAPE(16*1024, 5, 1); + L1D = L1I; + L3 = -1; + + /* BIU_CTL is a write-only Abox register. PALcode has a + shadow copy, and may be available from some versions + of the CSERVE PALcall. If we can get it, then + + unsigned long biu_ctl, size; + size = 128*1024 * (1 << ((biu_ctl >> 28) & 7)); + L2 = CSHAPE (size, 5, 1); + + Unfortunately, we can't rely on that. + */ + L2 = external_cache_probe(128*1024, 5); + break; + } + + case LCA4_CPU: + { + unsigned long car, size; + + L1I = L1D = CSHAPE(8*1024, 5, 1); + L3 = -1; + + car = *(vuip) phys_to_virt (0x120000078); + size = 64*1024 * (1 << ((car >> 5) & 7)); + /* No typo -- 8 byte cacheline size. Whodathunk. */ + L2 = (car & 1 ? CSHAPE (size, 3, 1) : -1); + break; + } + + case EV5_CPU: + case EV56_CPU: + { + unsigned long sc_ctl, width; + + L1I = L1D = CSHAPE(8*1024, 5, 1); + + /* Check the line size of the Scache. */ + sc_ctl = *(vulp) phys_to_virt (0xfffff000a8); + width = sc_ctl & 0x1000 ? 6 : 5; + L2 = CSHAPE (96*1024, width, 3); + + /* BC_CONTROL and BC_CONFIG are write-only IPRs. PALcode + has a shadow copy, and may be available from some versions + of the CSERVE PALcall. If we can get it, then + + unsigned long bc_control, bc_config, size; + size = 1024*1024 * (1 << ((bc_config & 7) - 1)); + L3 = (bc_control & 1 ? CSHAPE (size, width, 1) : -1); + + Unfortunately, we can't rely on that. + */ + L3 = external_cache_probe(1024*1024, width); + break; + } + + case PCA56_CPU: + case PCA57_CPU: + { + unsigned long cbox_config, size; + + if (cpu_type == PCA56_CPU) { + L1I = CSHAPE(16*1024, 6, 1); + L1D = CSHAPE(8*1024, 5, 1); + } else { + L1I = CSHAPE(32*1024, 6, 2); + L1D = CSHAPE(16*1024, 5, 1); + } + L3 = -1; + + cbox_config = *(vulp) phys_to_virt (0xfffff00008); + size = 512*1024 * (1 << ((cbox_config >> 12) & 3)); + +#if 0 + L2 = ((cbox_config >> 31) & 1 ? CSHAPE (size, 6, 1) : -1); +#else + L2 = external_cache_probe(512*1024, 6); +#endif + break; + } + + case EV6_CPU: + case EV67_CPU: + case EV68CB_CPU: + case EV68AL_CPU: + case EV68CX_CPU: + case EV69_CPU: + L1I = L1D = CSHAPE(64*1024, 6, 2); + L2 = external_cache_probe(1024*1024, 6); + L3 = -1; + break; + + case EV7_CPU: + case EV79_CPU: + L1I = L1D = CSHAPE(64*1024, 6, 2); + L2 = CSHAPE(7*1024*1024/4, 6, 7); + L3 = -1; + break; + + default: + /* Nothing known about this cpu type. */ + L1I = L1D = L2 = L3 = 0; + break; + } + + alpha_l1i_cacheshape = L1I; + alpha_l1d_cacheshape = L1D; + alpha_l2_cacheshape = L2; + alpha_l3_cacheshape = L3; +} + /* * We show only CPU #0 info. */ @@ -1260,9 +1475,8 @@ }; -static int alpha_panic_event(struct notifier_block *this, - unsigned long event, - void *ptr) +static int +alpha_panic_event(struct notifier_block *this, unsigned long event, void *ptr) { #if 1 /* FIXME FIXME FIXME */ diff -urN linux-2.6.5-rc3/arch/alpha/kernel/sys_nautilus.c linux-2.6.5/arch/alpha/kernel/sys_nautilus.c --- linux-2.6.5-rc3/arch/alpha/kernel/sys_nautilus.c 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/arch/alpha/kernel/sys_nautilus.c 2004-04-03 20:20:01.000000000 -0800 @@ -225,11 +225,13 @@ if (request_resource(&iomem_resource, bus->resource[1]) < 0) printk(KERN_ERR "Failed to request MEM on hose 0\n"); - if (pci_mem < memtop && pci_mem > alpha_mv.min_mem_address) { + if (pci_mem < memtop) + memtop = pci_mem; + if (memtop > alpha_mv.min_mem_address) { free_reserved_mem(__va(alpha_mv.min_mem_address), - __va(pci_mem)); + __va(memtop)); printk("nautilus_init_pci: %ldk freed\n", - (pci_mem - alpha_mv.min_mem_address) >> 10); + (memtop - alpha_mv.min_mem_address) >> 10); } if ((IRONGATE0->dev_vendor >> 16) > 0x7006) /* Albacore? */ diff -urN linux-2.6.5-rc3/arch/alpha/lib/dec_and_lock.c linux-2.6.5/arch/alpha/lib/dec_and_lock.c --- linux-2.6.5-rc3/arch/alpha/lib/dec_and_lock.c 2004-03-10 18:55:24.000000000 -0800 +++ linux-2.6.5/arch/alpha/lib/dec_and_lock.c 2004-04-03 20:20:01.000000000 -0800 @@ -30,7 +30,7 @@ .previous \n\ .end atomic_dec_and_lock"); -static int __attribute__((unused)) +static int __attribute_used__ atomic_dec_and_lock_1(atomic_t *atomic, spinlock_t *lock) { /* Slow path */ diff -urN linux-2.6.5-rc3/arch/alpha/mm/numa.c linux-2.6.5/arch/alpha/mm/numa.c --- linux-2.6.5-rc3/arch/alpha/mm/numa.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/arch/alpha/mm/numa.c 2004-04-03 20:20:01.000000000 -0800 @@ -158,8 +158,10 @@ if (!nid && (node_max_pfn < end_kernel_pfn || node_min_pfn > start_kernel_pfn)) panic("kernel loaded out of ram"); - /* Zone start phys-addr must be 2^(MAX_ORDER-1) aligned */ - node_min_pfn = (node_min_pfn + ((1UL << (MAX_ORDER-1))-1)) & ~((1UL << (MAX_ORDER-1))-1); + /* Zone start phys-addr must be 2^(MAX_ORDER-1) aligned. + Note that we round this down, not up - node memory + has much larger alignment than 8Mb, so it's safe. */ + node_min_pfn &= ~((1UL << (MAX_ORDER-1))-1); /* We need to know how many physically contiguous pages we'll need for the bootmap. */ diff -urN linux-2.6.5-rc3/arch/arm/Makefile linux-2.6.5/arch/arm/Makefile --- linux-2.6.5-rc3/arch/arm/Makefile 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/arm/Makefile 2004-04-03 20:20:01.000000000 -0800 @@ -36,7 +36,7 @@ # Note that GCC does not numerically define an architecture version # macro, but instead defines a whole series of macros which makes # testing for a specific architecture or later rather impossible. -arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 -march=armv5t -Wa,-march=armv6 +arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call check_gcc,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call check_gcc,-march=armv5te,-march=armv4) arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4 arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3 @@ -54,20 +54,13 @@ tune-$(CONFIG_CPU_V6) :=-mtune=strongarm # Need -Uarm for gcc < 3.x -CFLAGS_BOOT :=-mapcs-32 $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu #Default value DATAADDR := . -PROCESSOR := armv head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o -ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) - LDFLAGS_BLOB += --oformat elf32-bigarm -else - LDFLAGS_BLOB += --oformat elf32-littlearm -endif textaddr-y := 0xC0008000 machine-$(CONFIG_ARCH_ARCA5K) := arc @@ -99,14 +92,13 @@ machine-$(CONFIG_ARCH_IOP3XX) := iop3xx machine-$(CONFIG_ARCH_ADIFCC) := adifcc -MACHINE := $(machine-y) TEXTADDR := $(textaddr-y) ifeq ($(incdir-y),) -incdir-y := $(MACHINE) +incdir-y := $(machine-y) endif INCDIR := $(incdir-y) -export MACHINE PROCESSOR TEXTADDR GZFLAGS CFLAGS_BOOT +export TEXTADDR GZFLAGS # Do we have FASTFPE? FASTFPE :=arch/arm/fastfpe @@ -116,8 +108,8 @@ # If we have a machine-specific directory, then include it in the build. core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ -ifneq ($(MACHINE),) -core-y += arch/arm/mach-$(MACHINE)/ +ifneq ($(machine-y),) +core-y += arch/arm/mach-$(machine-y)/ endif core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/ core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) @@ -134,20 +126,18 @@ boot := arch/arm/boot # Update machine arch and proc symlinks if something which affects -# them changed. We use .arch and .proc to indicate when they were -# updated last, otherwise make uses the target directory mtime. +# them changed. We use .arch to indicate when they were updated +# last, otherwise make uses the target directory mtime. -include/asm-arm/.arch: $(wildcard include/config/arch/*.h) - @echo ' Making asm-arm/arch -> asm-arm/arch-$(INCDIR) symlink' - @rm -f include/asm-arm/arch - @ln -sf arch-$(INCDIR) include/asm-arm/arch +include/asm-arm/.arch: $(wildcard include/config/arch/*.h) include/config/MARKER + @echo ' SYMLINK include/asm-arm/arch -> include/asm-arm/arch-$(INCDIR)' + @ln -fsn arch-$(INCDIR) include/asm-arm/arch @touch $@ -prepare: maketools +prepare: maketools include/asm-arm/.arch .PHONY: maketools FORCE -maketools: include/asm-arm/.arch \ - include/asm-arm/constants.h include/linux/version.h FORCE +maketools: include/asm-arm/constants.h include/linux/version.h FORCE $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h # Convert bzImage to zImage @@ -160,8 +150,8 @@ zinstall install: vmlinux $(Q)$(MAKE) $(build)=$(boot) $@ -CLEAN_FILES += include/asm-arm/constants.h* include/asm-arm/mach-types.h -MRPROPER_FILES += include/asm-arm/arch include/asm-arm/.arch +CLEAN_FILES += include/asm-arm/constants.h* include/asm-arm/mach-types.h \ + include/asm-arm/arch include/asm-arm/.arch # We use MRPROPER_FILES and CLEAN_FILES now archclean: @@ -175,8 +165,7 @@ zi:; $(Q)$(MAKE) $(build)=$(boot) zinstall arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ - include/asm-arm/.arch \ - include/config/MARKER + include/asm-arm/.arch include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s $(call filechk,gen-asm-offsets) diff -urN linux-2.6.5-rc3/arch/arm/boot/compressed/Makefile linux-2.6.5/arch/arm/boot/compressed/Makefile --- linux-2.6.5-rc3/arch/arm/boot/compressed/Makefile 2004-03-10 18:55:22.000000000 -0800 +++ linux-2.6.5/arch/arm/boot/compressed/Makefile 2004-04-03 20:20:01.000000000 -0800 @@ -59,7 +59,7 @@ targets := vmlinux vmlinux.lds piggy piggy.gz piggy.o \ font.o head.o $(OBJS) -EXTRA_CFLAGS := $(CFLAGS_BOOT) -fpic +EXTRA_CFLAGS := -fpic EXTRA_AFLAGS := -traditional LDFLAGS_vmlinux := -p -X \ diff -urN linux-2.6.5-rc3/arch/arm/kernel/Makefile linux-2.6.5/arch/arm/kernel/Makefile --- linux-2.6.5-rc3/arch/arm/kernel/Makefile 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.5/arch/arm/kernel/Makefile 2004-04-03 20:20:01.000000000 -0800 @@ -20,7 +20,7 @@ obj-$(CONFIG_ISA_DMA) += dma-isa.o obj-$(CONFIG_PCI) += bios32.o -ifneq ($(MACHINE),ebsa110) +ifneq ($(CONFIG_ARCH_EBSA110),y) obj-y += io.o endif diff -urN linux-2.6.5-rc3/arch/arm/kernel/sys_arm.c linux-2.6.5/arch/arm/kernel/sys_arm.c --- linux-2.6.5-rc3/arch/arm/kernel/sys_arm.c 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/arch/arm/kernel/sys_arm.c 2004-04-03 20:20:01.000000000 -0800 @@ -100,7 +100,7 @@ struct mmap_arg_struct a; if (copy_from_user(&a, arg, sizeof(a))) - goto out;; + goto out; error = -EINVAL; if (a.offset & ~PAGE_MASK) diff -urN linux-2.6.5-rc3/arch/arm/lib/Makefile linux-2.6.5/arch/arm/lib/Makefile --- linux-2.6.5-rc3/arch/arm/lib/Makefile 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/arch/arm/lib/Makefile 2004-04-03 20:20:01.000000000 -0800 @@ -11,30 +11,20 @@ strnlen_user.o strchr.o strrchr.o testchangebit.o \ testclearbit.o testsetbit.o uaccess.o getuser.o \ putuser.o ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ - ucmpdi2.o udivdi3.o lib1funcs.o div64.o - -lib-arc := ecard.o io-acorn.o floppydma.o -lib-rpc := ecard.o io-acorn.o floppydma.o -lib-clps7500 := io-acorn.o -lib-l7200 := io-acorn.o -lib-shark := io-shark.o -lib-edb7211 := io-acorn.o - -lib-y += $(lib-$(MACHINE)) + ucmpdi2.o udivdi3.o lib1funcs.o div64.o \ + io-readsb.o io-writesb.o io-writesl.o ifeq ($(CONFIG_CPU_32v3),y) - v3 := y - v4 := n + lib-y += io-readsw-armv3.o io-writesw-armv3.o io-readsl-armv3.o else - v3 := n - v4 := y + lib-y += io-readsw-armv4.o io-writesw-armv4.o io-readsl-armv4.o endif -lib-y += io-readsb.o io-writesb.o -lib-$(v3) += io-readsw-armv3.o io-writesw-armv3.o io-readsl-armv3.o -lib-$(v4) += io-readsw-armv4.o io-writesw-armv4.o io-readsl-armv4.o -lib-y += io-writesl.o +lib-$(CONFIG_ARCH_RPC) += ecard.o io-acorn.o floppydma.o +lib-$(CONFIG_ARCH_CLPS7500) += io-acorn.o +lib-$(CONFIG_ARCH_L7200) += io-acorn.o +lib-$(CONFIG_ARCH_SHARK) += io-shark.o +lib-$(CONFIG_ARCH_CLPS711X) += io-acorn.o $(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S $(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S - diff -urN linux-2.6.5-rc3/arch/arm26/kernel/sys_arm.c linux-2.6.5/arch/arm26/kernel/sys_arm.c --- linux-2.6.5-rc3/arch/arm26/kernel/sys_arm.c 2004-03-10 18:55:33.000000000 -0800 +++ linux-2.6.5/arch/arm26/kernel/sys_arm.c 2004-04-03 20:20:01.000000000 -0800 @@ -101,7 +101,7 @@ struct mmap_arg_struct a; if (copy_from_user(&a, arg, sizeof(a))) - goto out;; + goto out; error = -EINVAL; if (a.offset & ~PAGE_MASK) diff -urN linux-2.6.5-rc3/arch/i386/kernel/acpi/boot.c linux-2.6.5/arch/i386/kernel/acpi/boot.c --- linux-2.6.5-rc3/arch/i386/kernel/acpi/boot.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/i386/kernel/acpi/boot.c 2004-04-03 20:20:01.000000000 -0800 @@ -67,6 +67,10 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; #endif +#ifndef __HAVE_ARCH_CMPXCHG +#warning ACPI uses CMPXCHG, i486 and later hardware +#endif + /* -------------------------------------------------------------------------- Boot-time Configuration -------------------------------------------------------------------------- */ diff -urN linux-2.6.5-rc3/arch/i386/kernel/apm.c linux-2.6.5/arch/i386/kernel/apm.c --- linux-2.6.5-rc3/arch/i386/kernel/apm.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/arch/i386/kernel/apm.c 2004-04-03 20:20:01.000000000 -0800 @@ -1435,7 +1435,7 @@ return 0; } -static ssize_t do_read(struct file *fp, char *buf, size_t count, loff_t *ppos) +static ssize_t do_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos) { struct apm_user * as; int i; diff -urN linux-2.6.5-rc3/arch/i386/kernel/io_apic.c linux-2.6.5/arch/i386/kernel/io_apic.c --- linux-2.6.5-rc3/arch/i386/kernel/io_apic.c 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/arch/i386/kernel/io_apic.c 2004-04-03 20:20:01.000000000 -0800 @@ -2440,7 +2440,11 @@ entry.polarity = active_high_low; entry.mask = 1; - add_pin_to_irq(irq, ioapic, pin); + /* + * IRQs < 16 are already in the irq_2_pin[] map + */ + if (irq >= 16) + add_pin_to_irq(irq, ioapic, pin); entry.vector = assign_irq_vector(irq); diff -urN linux-2.6.5-rc3/arch/i386/kernel/setup.c linux-2.6.5/arch/i386/kernel/setup.c --- linux-2.6.5-rc3/arch/i386/kernel/setup.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/i386/kernel/setup.c 2004-04-03 20:20:01.000000000 -0800 @@ -560,7 +560,7 @@ } } -#ifdef CONFIG_SMP +#ifdef CONFIG_X86_SMP /* * If the BIOS enumerates physical processors before logical, * maxcpus=N at enumeration-time can be used to disable HT. diff -urN linux-2.6.5-rc3/arch/i386/mm/hugetlbpage.c linux-2.6.5/arch/i386/mm/hugetlbpage.c --- linux-2.6.5-rc3/arch/i386/mm/hugetlbpage.c 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.5/arch/i386/mm/hugetlbpage.c 2004-04-03 20:20:01.000000000 -0800 @@ -527,6 +527,13 @@ return (size + ~HPAGE_MASK)/HPAGE_SIZE <= htlbpagemem; } +/* Return the number pages of memory we physically have, in PAGE_SIZE units. */ +unsigned long hugetlb_total_pages(void) +{ + return htlbzone_pages * (HPAGE_SIZE / PAGE_SIZE); +} +EXPORT_SYMBOL(hugetlb_total_pages); + /* * We cannot handle pagefaults against hugetlb pages at all. They cause * handle_mm_fault() to try to instantiate regular-sized pages in the diff -urN linux-2.6.5-rc3/arch/ia64/mm/hugetlbpage.c linux-2.6.5/arch/ia64/mm/hugetlbpage.c --- linux-2.6.5-rc3/arch/ia64/mm/hugetlbpage.c 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/arch/ia64/mm/hugetlbpage.c 2004-04-03 20:20:01.000000000 -0800 @@ -592,6 +592,13 @@ return 1; } +/* Return the number pages of memory we physically have, in PAGE_SIZE units. */ +unsigned long hugetlb_total_pages(void) +{ + return htlbzone_pages * (HPAGE_SIZE / PAGE_SIZE); +} +EXPORT_SYMBOL(hugetlb_total_pages); + static struct page *hugetlb_nopage(struct vm_area_struct * area, unsigned long address, int *unused) { BUG(); diff -urN linux-2.6.5-rc3/arch/ia64/sn/fakeprom/fw-emu.c linux-2.6.5/arch/ia64/sn/fakeprom/fw-emu.c --- linux-2.6.5-rc3/arch/ia64/sn/fakeprom/fw-emu.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/arch/ia64/sn/fakeprom/fw-emu.c 2004-04-03 20:20:01.000000000 -0800 @@ -397,7 +397,7 @@ fix_virt_function_pointer((void**)&runtime->set_variable); fix_virt_function_pointer((void**)&runtime->get_next_high_mono_count); fix_virt_function_pointer((void**)&runtime->reset_system); - return EFI_SUCCESS;; + return EFI_SUCCESS; } void diff -urN linux-2.6.5-rc3/arch/ia64/sn/io/sn2/pciio.c linux-2.6.5/arch/ia64/sn/io/sn2/pciio.c --- linux-2.6.5-rc3/arch/ia64/sn/io/sn2/pciio.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ia64/sn/io/sn2/pciio.c 2004-04-03 20:20:01.000000000 -0800 @@ -926,7 +926,7 @@ win_alloc->wa_pages = size; } - return new_res->start;; + return new_res->start; } /* diff -urN linux-2.6.5-rc3/arch/ia64/sn/io/sn2/pic.c linux-2.6.5/arch/ia64/sn/io/sn2/pic.c --- linux-2.6.5-rc3/arch/ia64/sn/io/sn2/pic.c 2004-03-10 18:55:34.000000000 -0800 +++ linux-2.6.5/arch/ia64/sn/io/sn2/pic.c 2004-04-03 20:20:01.000000000 -0800 @@ -685,7 +685,7 @@ /* Block off the range used by PROM. */ res->start = prom_base_addr; - res->end = prom_base_addr + (prom_base_size - 1);; + res->end = prom_base_addr + (prom_base_size - 1); status = request_resource(&pcibr_soft->bs_mem_win_root_resource, res); if (status) panic("PCIBR:Unable to request_resource()\n"); diff -urN linux-2.6.5-rc3/arch/m68k/mvme16x/16xints.c linux-2.6.5/arch/m68k/mvme16x/16xints.c --- linux-2.6.5-rc3/arch/m68k/mvme16x/16xints.c 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.5/arch/m68k/mvme16x/16xints.c 2004-04-03 20:20:01.000000000 -0800 @@ -98,7 +98,7 @@ printk("%s: Removing probably wrong IRQ %d from %s\n", __FUNCTION__, irq, irq_tab[irq-64].devname); - irq_tab[irq-64].handler = mvme16x_defhand;; + irq_tab[irq-64].handler = mvme16x_defhand; irq_tab[irq-64].flags = IRQ_FLG_STD; irq_tab[irq-64].dev_id = NULL; irq_tab[irq-64].devname = NULL; diff -urN linux-2.6.5-rc3/arch/mips/kernel/sysirix.c linux-2.6.5/arch/mips/kernel/sysirix.c --- linux-2.6.5-rc3/arch/mips/kernel/sysirix.c 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.5/arch/mips/kernel/sysirix.c 2004-04-03 20:20:01.000000000 -0800 @@ -1249,9 +1249,9 @@ ks.st_atime.tv_sec = (s32) stat->atime.tv_sec; ks.st_atime.tv_nsec = stat->atime.tv_nsec; ks.st_mtime.tv_sec = (s32) stat->mtime.tv_sec; - ks.st_mtime.tv_nsec = stat->mtime.tv_nsec;; + ks.st_mtime.tv_nsec = stat->mtime.tv_nsec; ks.st_ctime.tv_sec = (s32) stat->ctime.tv_sec; - ks.st_ctime.tv_nsec = stat->ctime.tv_nsec;; + ks.st_ctime.tv_nsec = stat->ctime.tv_nsec; ks.st_blksize = (s32) stat->blksize; ks.st_blocks = (long long) stat->blocks; diff -urN linux-2.6.5-rc3/arch/ppc/Kconfig linux-2.6.5/arch/ppc/Kconfig --- linux-2.6.5-rc3/arch/ppc/Kconfig 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc/Kconfig 2004-04-03 20:20:01.000000000 -0800 @@ -696,14 +696,10 @@ config PREEMPT bool "Preemptible Kernel" - depends on !SMP help This option reduces the latency of the kernel when reacting to real-time or interactive events by allowing a low priority process to be preempted even if it is in kernel mode executing a system call. - Unfortunately the kernel code has some race conditions if both - CONFIG_SMP and CONFIG_PREEMPT are enabled, so this option is - currently disabled if you are building an SMP kernel. Say Y here if you are building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. diff -urN linux-2.6.5-rc3/arch/ppc/boot/simple/relocate.S linux-2.6.5/arch/ppc/boot/simple/relocate.S --- linux-2.6.5-rc3/arch/ppc/boot/simple/relocate.S 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc/boot/simple/relocate.S 2004-04-03 20:20:01.000000000 -0800 @@ -196,9 +196,9 @@ /* * Start at the begining. */ +#ifdef CONFIG_PPC_MULTIPLATFORM li r9,0xc mtlr r9 -#ifdef CONFIG_PPC_MULTIPLATFORM /* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD, * and tell the kernel to start on the 4th instruction since we * overwrite the first 3 sometimes (which are 'nop'). @@ -207,6 +207,9 @@ ori r10,r10,0xdeadc0de@l li r9,0 stw r10,0(r9) +#else + li r9,0 + mtlr r9 #endif blr diff -urN linux-2.6.5-rc3/arch/ppc/configs/ebony_defconfig linux-2.6.5/arch/ppc/configs/ebony_defconfig --- linux-2.6.5-rc3/arch/ppc/configs/ebony_defconfig 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/arch/ppc/configs/ebony_defconfig 2004-04-03 20:20:01.000000000 -0800 @@ -6,6 +6,7 @@ CONFIG_HAVE_DEC_LOCK=y CONFIG_PPC=y CONFIG_PPC32=y +CONFIG_GENERIC_NVRAM=y # # Code maturity level options @@ -23,14 +24,16 @@ # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set # CONFIG_IKCONFIG is not set -# CONFIG_EMBEDDED is not set +CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # # Loadable module support @@ -62,9 +65,9 @@ # CONFIG_OCOTEA is not set CONFIG_440GP=y CONFIG_440=y -CONFIG_PIN_TLB=y CONFIG_BOOKE=y CONFIG_IBM_OCP=y +CONFIG_PPC_OCP=y # CONFIG_PM is not set CONFIG_NOT_COHERENT_CACHE=y @@ -88,12 +91,6 @@ CONFIG_PCI_DOMAINS=y # CONFIG_PCI_LEGACY_PROC is not set # CONFIG_PCI_NAMES is not set -# CONFIG_HOTPLUG is not set - -# -# Parallel port support -# -# CONFIG_PARPORT is not set # # Advanced setup @@ -110,8 +107,13 @@ CONFIG_BOOT_LOAD=0x01000000 # +# Device Drivers +# + +# # Generic Driver Options # +# CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) @@ -119,29 +121,29 @@ # CONFIG_MTD is not set # +# Parallel port support +# +# CONFIG_PARPORT is not set + +# # Plug and Play support # -# CONFIG_PNP is not set # # Block devices # +# CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_CARMEL is not set # CONFIG_BLK_DEV_RAM is not set -# CONFIG_BLK_DEV_INITRD is not set CONFIG_LBD=y # -# Multi-device support (RAID and LVM) -# -# CONFIG_MD is not set - -# # ATA/ATAPI/MFM/RLL support # # CONFIG_IDE is not set @@ -152,11 +154,17 @@ # CONFIG_SCSI is not set # +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# # Fusion MPT device support # +# CONFIG_FUSION is not set # -# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# IEEE 1394 (FireWire) support # # CONFIG_IEEE1394 is not set @@ -166,6 +174,10 @@ # CONFIG_I2O is not set # +# Macintosh device drivers +# + +# # Networking support # CONFIG_NET=y @@ -188,7 +200,6 @@ # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set -# CONFIG_INET_ECN is not set # CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set @@ -217,7 +228,6 @@ # # SCTP Configuration (EXPERIMENTAL) # -CONFIG_IPV6_SCTP__=y # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set # CONFIG_VLAN_8021Q is not set @@ -291,6 +301,7 @@ # CONFIG_TR is not set # CONFIG_RCPCI is not set # CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set # # Wan interfaces @@ -311,23 +322,18 @@ # Bluetooth support # # CONFIG_BT is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set # # ISDN subsystem # -# CONFIG_ISDN_BOOL is not set - -# -# Graphics support -# -# CONFIG_FB is not set +# CONFIG_ISDN is not set # -# Console display driver support +# Telephony Support # -# CONFIG_VGA_CONSOLE is not set -# CONFIG_MDA_CONSOLE is not set -CONFIG_DUMMY_CONSOLE=y +# CONFIG_PHONE is not set # # Input device support @@ -367,15 +373,9 @@ # CONFIG_INPUT_MISC is not set # -# Macintosh device drivers -# - -# # Character devices # -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_HW_CONSOLE=y +# CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set # @@ -397,30 +397,8 @@ CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 - -# -# I2C support -# -# CONFIG_I2C is not set - -# -# I2C Algorithms -# - -# -# I2C Hardware Bus support -# - -# -# I2C Hardware Sensors Chip support -# -# CONFIG_I2C_SENSOR is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_QIC02_TAPE is not set # @@ -447,6 +425,15 @@ # CONFIG_RAW_DRIVER is not set # +# I2C support +# +# CONFIG_I2C is not set + +# +# Misc devices +# + +# # Multimedia devices # # CONFIG_VIDEO_DEV is not set @@ -457,6 +444,26 @@ # CONFIG_DVB is not set # +# Graphics support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# # File systems # # CONFIG_EXT2_FS is not set @@ -489,7 +496,6 @@ CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y # CONFIG_DEVFS_FS is not set -CONFIG_DEVPTS_FS=y # CONFIG_DEVPTS_FS_XATTR is not set # CONFIG_TMPFS is not set # CONFIG_HUGETLB_PAGE is not set @@ -501,6 +507,7 @@ # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set @@ -517,12 +524,13 @@ CONFIG_NFS_FS=y # CONFIG_NFS_V3 is not set # CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set CONFIG_ROOT_NFS=y CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y -# CONFIG_SUNRPC_GSS is not set +# CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -537,15 +545,9 @@ CONFIG_MSDOS_PARTITION=y # -# Sound +# Native Language Support # -# CONFIG_SOUND is not set - -# -# USB support -# -# CONFIG_USB is not set -# CONFIG_USB_GADGET is not set +# CONFIG_NLS is not set # # Library routines diff -urN linux-2.6.5-rc3/arch/ppc/configs/walnut_defconfig linux-2.6.5/arch/ppc/configs/walnut_defconfig --- linux-2.6.5-rc3/arch/ppc/configs/walnut_defconfig 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/arch/ppc/configs/walnut_defconfig 2004-04-03 20:20:01.000000000 -0800 @@ -6,6 +6,7 @@ CONFIG_HAVE_DEC_LOCK=y CONFIG_PPC=y CONFIG_PPC32=y +CONFIG_GENERIC_NVRAM=y # # Code maturity level options @@ -23,6 +24,7 @@ # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set @@ -31,6 +33,7 @@ CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # # Loadable module support @@ -59,24 +62,20 @@ # IBM 4xx options # # CONFIG_ASH is not set -# CONFIG_BEECH is not set -# CONFIG_CEDAR is not set # CONFIG_CPCI405 is not set # CONFIG_EP405 is not set # CONFIG_OAK is not set -# CONFIG_REDWOOD_4 is not set # CONFIG_REDWOOD_5 is not set # CONFIG_REDWOOD_6 is not set # CONFIG_SYCAMORE is not set -# CONFIG_TIVO is not set CONFIG_WALNUT=y CONFIG_IBM405_ERR77=y CONFIG_IBM405_ERR51=y CONFIG_IBM_OCP=y +CONFIG_PPC_OCP=y CONFIG_BIOS_FIXUP=y CONFIG_405GP=y CONFIG_IBM_OPENBIOS=y -# CONFIG_405_DMA is not set # CONFIG_PM is not set CONFIG_UART0_TTYS0=y # CONFIG_UART0_TTYS1 is not set @@ -101,12 +100,6 @@ CONFIG_PCI_DOMAINS=y CONFIG_PCI_LEGACY_PROC=y # CONFIG_PCI_NAMES is not set -# CONFIG_HOTPLUG is not set - -# -# Parallel port support -# -# CONFIG_PARPORT is not set # # Advanced setup @@ -123,6 +116,10 @@ CONFIG_BOOT_LOAD=0x00400000 # +# Device Drivers +# + +# # Generic Driver Options # @@ -132,13 +129,18 @@ # CONFIG_MTD is not set # +# Parallel port support +# +# CONFIG_PARPORT is not set + +# # Plug and Play support # -# CONFIG_PNP is not set # # Block devices # +# CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set @@ -146,17 +148,13 @@ CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_CARMEL is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y # CONFIG_LBD is not set # -# Multi-device support (RAID and LVM) -# -# CONFIG_MD is not set - -# # ATA/ATAPI/MFM/RLL support # # CONFIG_IDE is not set @@ -167,11 +165,17 @@ # CONFIG_SCSI is not set # +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# # Fusion MPT device support # +# CONFIG_FUSION is not set # -# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# IEEE 1394 (FireWire) support # # CONFIG_IEEE1394 is not set @@ -181,6 +185,10 @@ # CONFIG_I2O is not set # +# Macintosh device drivers +# + +# # Networking support # CONFIG_NET=y @@ -203,7 +211,6 @@ # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set -# CONFIG_INET_ECN is not set CONFIG_SYN_COOKIES=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set @@ -216,7 +223,6 @@ # # SCTP Configuration (EXPERIMENTAL) # -CONFIG_IPV6_SCTP__=y # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set # CONFIG_VLAN_8021Q is not set @@ -302,6 +308,7 @@ # CONFIG_TR is not set # CONFIG_RCPCI is not set # CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set # # Wan interfaces @@ -322,16 +329,18 @@ # Bluetooth support # # CONFIG_BT is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set # # ISDN subsystem # -# CONFIG_ISDN_BOOL is not set +# CONFIG_ISDN is not set # -# Graphics support +# Telephony Support # -# CONFIG_FB is not set +# CONFIG_PHONE is not set # # Input device support @@ -368,10 +377,6 @@ # CONFIG_INPUT_MISC is not set # -# Macintosh device drivers -# - -# # Character devices # # CONFIG_VT is not set @@ -391,53 +396,8 @@ CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 - -# -# I2C support -# -CONFIG_I2C=y -# CONFIG_I2C_CHARDEV is not set - -# -# I2C Algorithms -# -# CONFIG_I2C_ALGOBIT is not set -# CONFIG_I2C_ALGOPCF is not set - -# -# I2C Hardware Bus support -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_I801 is not set -CONFIG_I2C_IBM_IIC=y -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_PIIX4 is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIAPRO is not set - -# -# I2C Hardware Sensors Chip support -# -# CONFIG_I2C_SENSOR is not set -# CONFIG_SENSORS_ADM1021 is not set -# CONFIG_SENSORS_EEPROM is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_LM75 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_VIA686A is not set -# CONFIG_SENSORS_W83781D is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_QIC02_TAPE is not set # @@ -464,6 +424,15 @@ # CONFIG_RAW_DRIVER is not set # +# I2C support +# +# CONFIG_I2C is not set + +# +# Misc devices +# + +# # Multimedia devices # # CONFIG_VIDEO_DEV is not set @@ -474,6 +443,26 @@ # CONFIG_DVB is not set # +# Graphics support +# +# CONFIG_FB is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# # File systems # CONFIG_EXT2_FS=y @@ -507,7 +496,6 @@ CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y # CONFIG_DEVFS_FS is not set -CONFIG_DEVPTS_FS=y # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y # CONFIG_HUGETLB_PAGE is not set @@ -519,6 +507,7 @@ # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set @@ -535,12 +524,13 @@ CONFIG_NFS_FS=y # CONFIG_NFS_V3 is not set # CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set CONFIG_ROOT_NFS=y CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y -# CONFIG_SUNRPC_GSS is not set +# CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -566,21 +556,15 @@ # CONFIG_EFI_PARTITION is not set # -# Sound +# Native Language Support # -# CONFIG_SOUND is not set +# CONFIG_NLS is not set # # IBM 40x options # # -# USB support -# -# CONFIG_USB is not set -# CONFIG_USB_GADGET is not set - -# # Library routines # CONFIG_CRC32=y diff -urN linux-2.6.5-rc3/arch/ppc/kernel/align.c linux-2.6.5/arch/ppc/kernel/align.c --- linux-2.6.5-rc3/arch/ppc/kernel/align.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc/kernel/align.c 2004-04-03 20:20:01.000000000 -0800 @@ -325,14 +325,18 @@ * the kernel with -msoft-float so it doesn't use the * fp regs for copying 8-byte objects. */ case LD+F+S: + preempt_disable(); enable_kernel_fp(); cvt_fd(&data.f, ¤t->thread.fpr[reg], ¤t->thread.fpscr); /* current->thread.fpr[reg] = data.f; */ + preempt_enable(); break; case ST+F+S: + preempt_disable(); enable_kernel_fp(); cvt_df(¤t->thread.fpr[reg], &data.f, ¤t->thread.fpscr); /* data.f = current->thread.fpr[reg]; */ + preempt_enable(); break; default: printk("align: can't handle flags=%x\n", flags); diff -urN linux-2.6.5-rc3/arch/ppc/kernel/cputable.c linux-2.6.5/arch/ppc/kernel/cputable.c --- linux-2.6.5-rc3/arch/ppc/kernel/cputable.c 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/arch/ppc/kernel/cputable.c 2004-04-03 20:20:01.000000000 -0800 @@ -476,6 +476,20 @@ 32, 32, 0, /*__setup_cpu_440 */ }, + { /* 440GX Rev. B */ + 0xf0000fff, 0x50000851, "440GX Rev. B", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + 32, 32, + 0, /*__setup_cpu_440 */ + }, + { /* 440GX Rev. B1 (2.1) */ + 0xf0000fff, 0x50000852, "440GX Rev. B1 (2.1)", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + 32, 32, + 0, /*__setup_cpu_440 */ + }, #endif /* CONFIG_44x */ #if !CLASSIC_PPC { /* default match */ diff -urN linux-2.6.5-rc3/arch/ppc/kernel/entry.S linux-2.6.5/arch/ppc/kernel/entry.S --- linux-2.6.5-rc3/arch/ppc/kernel/entry.S 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc/kernel/entry.S 2004-04-03 20:20:01.000000000 -0800 @@ -469,10 +469,19 @@ stw r10,_CCR(r1) stw r1,KSP(r3) /* Set old stack pointer */ +#ifdef CONFIG_SMP + /* We need a sync somewhere here to make sure that if the + * previous task gets rescheduled on another CPU, it sees all + * stores it has performed on this one. + */ + sync +#endif /* CONFIG_SMP */ + tophys(r0,r4) CLR_TOP32(r0) mtspr SPRG3,r0 /* Update current THREAD phys addr */ lwz r1,KSP(r4) /* Load new stack pointer */ + /* save the old current 'last' for return value */ mr r3,r2 addi r2,r4,-THREAD /* Update current */ diff -urN linux-2.6.5-rc3/arch/ppc/kernel/head.S linux-2.6.5/arch/ppc/kernel/head.S --- linux-2.6.5-rc3/arch/ppc/kernel/head.S 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc/kernel/head.S 2004-04-03 20:20:01.000000000 -0800 @@ -1436,11 +1436,8 @@ stw r4, 0x4(r5) #endif li r4,0 -BEGIN_FTR_SECTION - dssall - sync -END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) -3: isync + isync +3: #ifdef CONFIG_PPC64BRIDGE slbie r4 #endif /* CONFIG_PPC64BRIDGE */ diff -urN linux-2.6.5-rc3/arch/ppc/kernel/head_44x.S linux-2.6.5/arch/ppc/kernel/head_44x.S --- linux-2.6.5-rc3/arch/ppc/kernel/head_44x.S 2004-03-10 18:55:24.000000000 -0800 +++ linux-2.6.5/arch/ppc/kernel/head_44x.S 2004-04-03 20:20:01.000000000 -0800 @@ -860,6 +860,7 @@ lis r13, tlb_44x_index@ha lwz r14, tlb_44x_index@l(r13) /* Load the TLB high watermark */ + lis r13, tlb_44x_hwater@ha lwz r11, tlb_44x_hwater@l(r13) /* Increment, rollover, and store TLB index */ @@ -869,6 +870,7 @@ li r14, 0 7: /* Store the next available TLB index */ + lis r13, tlb_44x_index@ha stw r14, tlb_44x_index@l(r13) lwz r13, 0(r12) /* Get MS word of PTE */ diff -urN linux-2.6.5-rc3/arch/ppc/kernel/pci.c linux-2.6.5/arch/ppc/kernel/pci.c --- linux-2.6.5-rc3/arch/ppc/kernel/pci.c 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/arch/ppc/kernel/pci.c 2004-04-03 20:20:01.000000000 -0800 @@ -159,7 +159,6 @@ ppc_md.pcibios_fixup_resources(dev); } - void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res) @@ -1522,51 +1521,43 @@ { struct pci_controller *hose = (struct pci_controller *) dev->sysdata; unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; - unsigned long io_offset = 0; - int i, res_bit; + unsigned long size = vma->vm_end - vma->vm_start; + unsigned long base; + struct resource *res; + int i; + int ret = -EINVAL; if (hose == 0) return -EINVAL; /* should never happen */ + if (offset + size <= offset) + return -EINVAL; - /* If memory, add on the PCI bridge address offset */ if (mmap_state == pci_mmap_mem) { + /* PCI memory space */ + base = hose->pci_mem_offset; + for (i = 0; i < 3; ++i) { + res = &hose->mem_resources[i]; + if (res->flags == 0) + continue; + if (offset >= res->start - base + && offset + size - 1 <= res->end - base) { + ret = 0; + break; + } + } offset += hose->pci_mem_offset; - res_bit = IORESOURCE_MEM; } else { - io_offset = (unsigned long)hose->io_base_virt - isa_io_base; - offset += io_offset; - res_bit = IORESOURCE_IO; + /* PCI I/O space */ + base = (unsigned long)hose->io_base_virt - isa_io_base; + res = &hose->io_resource; + if (offset >= res->start - base + && offset + size - 1 <= res->end - base) + ret = 0; + offset += hose->io_base_phys; } - /* - * Check that the offset requested corresponds to one of the - * resources of the device. - */ - for (i = 0; i <= PCI_ROM_RESOURCE; i++) { - struct resource *rp = &dev->resource[i]; - int flags = rp->flags; - - /* treat ROM as memory (should be already) */ - if (i == PCI_ROM_RESOURCE) - flags |= IORESOURCE_MEM; - - /* Active and same type? */ - if ((flags & res_bit) == 0) - continue; - - /* In the range of this resource? */ - if (offset < (rp->start & PAGE_MASK) || offset > rp->end) - continue; - - /* found it! construct the final physical address */ - if (mmap_state == pci_mmap_io) - offset += hose->io_base_phys - io_offset; - - vma->vm_pgoff = offset >> PAGE_SHIFT; - return 0; - } - - return -EINVAL; + vma->vm_pgoff = offset >> PAGE_SHIFT; + return ret; } /* diff -urN linux-2.6.5-rc3/arch/ppc/kernel/ppc_ksyms.c linux-2.6.5/arch/ppc/kernel/ppc_ksyms.c --- linux-2.6.5-rc3/arch/ppc/kernel/ppc_ksyms.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc/kernel/ppc_ksyms.c 2004-04-03 20:20:01.000000000 -0800 @@ -192,7 +192,6 @@ EXPORT_SYMBOL(flush_instruction_cache); EXPORT_SYMBOL(giveup_fpu); -EXPORT_SYMBOL(enable_kernel_fp); EXPORT_SYMBOL(flush_icache_range); EXPORT_SYMBOL(flush_dcache_range); EXPORT_SYMBOL(flush_icache_user_range); diff -urN linux-2.6.5-rc3/arch/ppc/kernel/process.c linux-2.6.5/arch/ppc/kernel/process.c --- linux-2.6.5-rc3/arch/ppc/kernel/process.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc/kernel/process.c 2004-04-03 20:20:01.000000000 -0800 @@ -163,7 +163,8 @@ void enable_kernel_altivec(void) { - preempt_disable(); + WARN_ON(current_thread_info()->preempt_count == 0 && !irqs_disabled()); + #ifdef CONFIG_SMP if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) giveup_altivec(current); @@ -172,14 +173,15 @@ #else giveup_altivec(last_task_used_altivec); #endif /* __SMP __ */ - preempt_enable(); } +EXPORT_SYMBOL(enable_kernel_altivec); #endif /* CONFIG_ALTIVEC */ void enable_kernel_fp(void) { - preempt_disable(); + WARN_ON(current_thread_info()->preempt_count == 0 && !irqs_disabled()); + #ifdef CONFIG_SMP if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) giveup_fpu(current); @@ -188,8 +190,8 @@ #else giveup_fpu(last_task_used_math); #endif /* CONFIG_SMP */ - preempt_enable(); } +EXPORT_SYMBOL(enable_kernel_fp); int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs) diff -urN linux-2.6.5-rc3/arch/ppc/mm/cachemap.c linux-2.6.5/arch/ppc/mm/cachemap.c --- linux-2.6.5-rc3/arch/ppc/mm/cachemap.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc/mm/cachemap.c 2004-04-03 20:20:01.000000000 -0800 @@ -148,7 +148,7 @@ case DMA_FROM_DEVICE: /* invalidate only */ invalidate_dcache_range(start, end); break; - case DMA_TODEVICE: /* writeback only */ + case DMA_TO_DEVICE: /* writeback only */ clean_dcache_range(start, end); break; case DMA_BIDIRECTIONAL: /* writeback and invalidate */ diff -urN linux-2.6.5-rc3/arch/ppc/mm/pgtable.c linux-2.6.5/arch/ppc/mm/pgtable.c --- linux-2.6.5-rc3/arch/ppc/mm/pgtable.c 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/arch/ppc/mm/pgtable.c 2004-04-03 20:20:01.000000000 -0800 @@ -143,7 +143,7 @@ void * ioremap(phys_addr_t addr, unsigned long size) { - phys_addr_t addr64 = fixup_bigphys_addr(addr, size);; + phys_addr_t addr64 = fixup_bigphys_addr(addr, size); return ioremap64(addr64, size); } diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/HvCall.c linux-2.6.5/arch/ppc64/kernel/HvCall.c --- linux-2.6.5-rc3/arch/ppc64/kernel/HvCall.c 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/HvCall.c 2004-04-03 20:20:01.000000000 -0800 @@ -19,7 +19,7 @@ { struct HvLpBufferList hv_buf; u64 left_this_page; - u64 cur = virt_to_absolute((unsigned long)buffer); + u64 cur = virt_to_abs(buffer); while (len) { hv_buf.addr = cur; @@ -29,7 +29,7 @@ hv_buf.len = left_this_page; len -= left_this_page; HvCall2(HvCallBaseWriteLogBuffer, - virt_to_absolute((unsigned long)&hv_buf), + virt_to_abs(&hv_buf), left_this_page); cur = (cur & PAGE_MASK) + PAGE_SIZE; } diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/entry.S linux-2.6.5/arch/ppc64/kernel/entry.S --- linux-2.6.5-rc3/arch/ppc64/kernel/entry.S 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/entry.S 2004-04-03 20:20:01.000000000 -0800 @@ -194,7 +194,7 @@ _GLOBAL(ret_from_syscall_2) std r3,RESULT(r1) /* Save result */ li r10,-_LAST_ERRNO - cmpl 0,r3,r10 + cmpld 0,r3,r10 blt 60f neg r3,r3 57: ld r10,_CCR(r1) /* Set SO bit in CR */ @@ -289,6 +289,14 @@ std r23,_CCR(r1) std r1,KSP(r3) /* Set old stack pointer */ +#ifdef CONFIG_SMP + /* We need a sync somewhere here to make sure that if the + * previous task gets rescheduled on another CPU, it sees all + * stores it has performed on this one. + */ + sync +#endif /* CONFIG_SMP */ + addi r6,r4,-THREAD /* Convert THREAD to 'current' */ std r6,PACACURRENT(r13) /* Set new 'current' */ diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/head.S linux-2.6.5/arch/ppc64/kernel/head.S --- linux-2.6.5-rc3/arch/ppc64/kernel/head.S 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/head.S 2004-04-03 20:20:01.000000000 -0800 @@ -496,6 +496,9 @@ .globl SystemReset_Iseries SystemReset_Iseries: mfspr r13,SPRG3 /* Get paca address */ + mfmsr r24 + ori r24,r24,MSR_RI + mtmsrd r24 /* RI on */ lhz r24,PACAPACAINDEX(r13) /* Get processor # */ cmpi 0,r24,0 /* Are we processor 0? */ beq .__start_initialization_iSeries /* Start up the first processor */ diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/iSeries_VpdInfo.c linux-2.6.5/arch/ppc64/kernel/iSeries_VpdInfo.c --- linux-2.6.5-rc3/arch/ppc64/kernel/iSeries_VpdInfo.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/iSeries_VpdInfo.c 2004-04-03 20:20:01.000000000 -0800 @@ -293,7 +293,8 @@ return; } BusVpdLen = HvCallPci_getBusVpd(ISERIES_BUS(DevNode), - REALADDR(BusVpdPtr), BUS_VPDSIZE); + ISERIES_HV_ADDR(BusVpdPtr), + BUS_VPDSIZE); if (BusVpdLen == 0) { kfree(BusVpdPtr); printk("PCI: Bus VPD Buffer zero length.\n"); diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/iSeries_iommu.c linux-2.6.5/arch/ppc64/kernel/iSeries_iommu.c --- linux-2.6.5-rc3/arch/ppc64/kernel/iSeries_iommu.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/iSeries_iommu.c 2004-04-03 20:20:01.000000000 -0800 @@ -76,7 +76,7 @@ while (npages--) { tce.te_word = 0; - tce.te_bits.tb_rpn = (virt_to_absolute(uaddr)) >> PAGE_SHIFT; + tce.te_bits.tb_rpn = virt_to_abs(uaddr) >> PAGE_SHIFT; if (tbl->it_type == TCE_VB) { /* Virtual Bus */ @@ -130,7 +130,7 @@ cb.itc_busno = 255; /* Bus 255 is the virtual bus */ cb.itc_virtbus = 0xff; /* Ask for virtual bus */ - cbp = virt_to_absolute((unsigned long)&cb); + cbp = virt_to_abs(&cb); HvCallXm_getTceTableParms(cbp); veth_iommu_table.it_size = cb.itc_size / 2; @@ -209,7 +209,7 @@ parms->itc_slotno = dn->LogicalSlot; parms->itc_virtbus = 0; - HvCallXm_getTceTableParms(REALADDR(parms)); + HvCallXm_getTceTableParms(ISERIES_HV_ADDR(parms)); if (parms->itc_size == 0) panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms); diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/iSeries_pci.c linux-2.6.5/arch/ppc64/kernel/iSeries_pci.c --- linux-2.6.5-rc3/arch/ppc64/kernel/iSeries_pci.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/iSeries_pci.c 2004-04-03 20:20:01.000000000 -0800 @@ -277,7 +277,7 @@ */ for (IdSel = 1; IdSel < MaxAgents; ++IdSel) { HvRc = HvCallPci_getDeviceInfo(bus, SubBus, IdSel, - REALADDR(DevInfo), + ISERIES_HV_ADDR(DevInfo), sizeof(struct HvCallPci_DeviceInfo)); if (HvRc == 0) { if (DevInfo->deviceType == HvCallPci_NodeDevice) @@ -318,7 +318,7 @@ "PCI:Connect EADs: 0x%02X.%02X.%02X\n", bus, SubBus, AgentId); HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId, - REALADDR(BridgeInfo), + ISERIES_HV_ADDR(BridgeInfo), sizeof(struct HvCallPci_BridgeInfo)); if (HvRc == 0) { printk("bridge info: type %x subbus %x maxAgents %x maxsubbus %x logslot %x\n", diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/iSeries_setup.c linux-2.6.5/arch/ppc64/kernel/iSeries_setup.c --- linux-2.6.5-rc3/arch/ppc64/kernel/iSeries_setup.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/iSeries_setup.c 2004-04-03 20:20:01.000000000 -0800 @@ -658,8 +658,7 @@ HvCallHpt_setPp(slot, PP_RWXX); } else /* No HPTE exists, so create a new bolted one */ - iSeries_make_pte(va, (unsigned long)__v2a(ea), - mode_rw); + iSeries_make_pte(va, phys_to_abs(pa), mode_rw); } } diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/iommu.c linux-2.6.5/arch/ppc64/kernel/iommu.c --- linux-2.6.5-rc3/arch/ppc64/kernel/iommu.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/iommu.c 2004-04-03 20:20:01.000000000 -0800 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -73,7 +74,7 @@ if (unlikely(npages) == 0) { if (printk_ratelimit()) WARN_ON(1); - return PCI_DMA_ERROR_CODE; + return DMA_ERROR_CODE; } if (handle && *handle) @@ -110,7 +111,7 @@ goto again; } else { /* Third failure, give up */ - return PCI_DMA_ERROR_CODE; + return DMA_ERROR_CODE; } } @@ -144,15 +145,15 @@ unsigned int npages, int direction) { unsigned long entry, flags; - dma_addr_t ret = PCI_DMA_ERROR_CODE; + dma_addr_t ret = DMA_ERROR_CODE; spin_lock_irqsave(&(tbl->it_lock), flags); entry = iommu_range_alloc(tbl, npages, NULL); - if (unlikely(entry == PCI_DMA_ERROR_CODE)) { + if (unlikely(entry == DMA_ERROR_CODE)) { spin_unlock_irqrestore(&(tbl->it_lock), flags); - return PCI_DMA_ERROR_CODE; + return DMA_ERROR_CODE; } entry += tbl->it_offset; /* Offset into real TCE table */ @@ -263,7 +264,7 @@ DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); /* Handle failure */ - if (unlikely(entry == PCI_DMA_ERROR_CODE)) { + if (unlikely(entry == DMA_ERROR_CODE)) { if (printk_ratelimit()) printk(KERN_INFO "iommu_alloc failed, tbl %p vaddr %lx" " npages %lx\n", tbl, vaddr, npages); @@ -327,7 +328,7 @@ */ if (outcount < nelems) { outs++; - outs->dma_address = PCI_DMA_ERROR_CODE; + outs->dma_address = DMA_ERROR_CODE; outs->dma_length = 0; } return outcount; diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/mf.c linux-2.6.5/arch/ppc64/kernel/mf.c --- linux-2.6.5-rc3/arch/ppc64/kernel/mf.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/mf.c 2004-04-03 20:20:02.000000000 -0800 @@ -763,14 +763,10 @@ ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex(); ev->event.data.vsp_cmd.result_code = 0xFF; ev->event.data.vsp_cmd.reserved = 0; - ev->event.data.vsp_cmd.sub_data.page[0] = - (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[0])); - ev->event.data.vsp_cmd.sub_data.page[1] = - (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[1])); - ev->event.data.vsp_cmd.sub_data.page[2] = - (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[2])); - ev->event.data.vsp_cmd.sub_data.page[3] = - (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[3])); + ev->event.data.vsp_cmd.sub_data.page[0] = ISERIES_HV_ADDR(pages[0]); + ev->event.data.vsp_cmd.sub_data.page[1] = ISERIES_HV_ADDR(pages[1]); + ev->event.data.vsp_cmd.sub_data.page[2] = ISERIES_HV_ADDR(pages[2]); + ev->event.data.vsp_cmd.sub_data.page[3] = ISERIES_HV_ADDR(pages[3]); mb(); if (signal_event(ev) != 0) return; diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/pSeries_iommu.c linux-2.6.5/arch/ppc64/kernel/pSeries_iommu.c --- linux-2.6.5-rc3/arch/ppc64/kernel/pSeries_iommu.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/pSeries_iommu.c 2004-04-03 20:20:02.000000000 -0800 @@ -61,7 +61,7 @@ while (npages--) { /* can't move this out since we might cross LMB boundary */ - t.te_rpn = (virt_to_absolute(uaddr)) >> PAGE_SHIFT; + t.te_rpn = (virt_to_abs(uaddr)) >> PAGE_SHIFT; tp->te_word = t.te_word; diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/pSeries_lpar.c linux-2.6.5/arch/ppc64/kernel/pSeries_lpar.c --- linux-2.6.5-rc3/arch/ppc64/kernel/pSeries_lpar.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/pSeries_lpar.c 2004-04-03 20:20:02.000000000 -0800 @@ -36,6 +36,7 @@ #include #include #include +#include /* in pSeries_hvCall.S */ EXPORT_SYMBOL(plpar_hcall); @@ -135,7 +136,7 @@ union tce_entry tce; tce.te_word = 0; - tce.te_rpn = (virt_to_absolute(uaddr)) >> PAGE_SHIFT; + tce.te_rpn = (virt_to_abs(uaddr)) >> PAGE_SHIFT; tce.te_rdwr = 1; if (direction != PCI_DMA_TODEVICE) tce.te_pciwr = 1; diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/pci_dma_direct.c linux-2.6.5/arch/ppc64/kernel/pci_dma_direct.c --- linux-2.6.5-rc3/arch/ppc64/kernel/pci_dma_direct.c 2004-03-10 18:55:20.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/pci_dma_direct.c 2004-04-03 20:20:02.000000000 -0800 @@ -37,7 +37,7 @@ ret = (void *)__get_free_pages(GFP_ATOMIC, get_order(size)); if (ret != NULL) { memset(ret, 0, size); - *dma_handle = virt_to_absolute((unsigned long)ret); + *dma_handle = virt_to_abs(ret); } return ret; } @@ -51,7 +51,7 @@ static dma_addr_t pci_direct_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) { - return virt_to_absolute((unsigned long)ptr); + return virt_to_abs(ptr); } static void pci_direct_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/pci_iommu.c linux-2.6.5/arch/ppc64/kernel/pci_iommu.c --- linux-2.6.5-rc3/arch/ppc64/kernel/pci_iommu.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/pci_iommu.c 2004-04-03 20:20:02.000000000 -0800 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -82,7 +83,7 @@ if (order >= IOMAP_MAX_ORDER) { printk("PCI_DMA: pci_alloc_consistent size too large: 0x%lx\n", size); - return (void *)PCI_DMA_ERROR_CODE; + return (void *)DMA_ERROR_CODE; } tbl = devnode_table(hwdev); @@ -101,7 +102,7 @@ /* Set up tces to cover the allocated range */ mapping = iommu_alloc(tbl, ret, npages, PCI_DMA_BIDIRECTIONAL); - if (mapping == PCI_DMA_ERROR_CODE) { + if (mapping == DMA_ERROR_CODE) { free_pages((unsigned long)ret, order); ret = NULL; } else @@ -139,7 +140,7 @@ size_t size, int direction) { struct iommu_table * tbl; - dma_addr_t dma_handle = PCI_DMA_ERROR_CODE; + dma_addr_t dma_handle = DMA_ERROR_CODE; unsigned long uaddr; unsigned int npages; @@ -153,7 +154,7 @@ if (tbl) { dma_handle = iommu_alloc(tbl, vaddr, npages, direction); - if (dma_handle == PCI_DMA_ERROR_CODE) { + if (dma_handle == DMA_ERROR_CODE) { if (printk_ratelimit()) { printk(KERN_INFO "iommu_alloc failed, tbl %p vaddr %p npages %d\n", tbl, vaddr, npages); diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/pmac_iommu.c linux-2.6.5/arch/ppc64/kernel/pmac_iommu.c --- linux-2.6.5-rc3/arch/ppc64/kernel/pmac_iommu.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/pmac_iommu.c 2004-04-03 20:20:02.000000000 -0800 @@ -154,7 +154,7 @@ * out of the loop. */ while (npages--) { - rpn = (virt_to_absolute(uaddr)) >> PAGE_SHIFT; + rpn = virt_to_abs(uaddr) >> PAGE_SHIFT; *(dp++) = DARTMAP_VALID | (rpn & DARTMAP_RPNMASK); @@ -210,7 +210,7 @@ if (tmp == 0) panic("U3-DART: Cannot allocate spare page !"); dart_emptyval = DARTMAP_VALID | - ((virt_to_absolute(tmp) >> PAGE_SHIFT) & DARTMAP_RPNMASK); + ((virt_to_abs(tmp) >> PAGE_SHIFT) & DARTMAP_RPNMASK); /* Map in DART registers. FIXME: Use device node to get base address */ dart = ioremap(DART_BASE, 0x7000); @@ -225,7 +225,7 @@ (((dart_tablesize >> PAGE_SHIFT) & DARTCNTL_SIZE_MASK) << DARTCNTL_SIZE_SHIFT); p = virt_to_page(dart_tablebase); - dart_vbase = ioremap(virt_to_absolute(dart_tablebase), dart_tablesize); + dart_vbase = ioremap(virt_to_abs(dart_tablebase), dart_tablesize); /* Fill initial table */ for (i = 0; i < dart_tablesize/4; i++) diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/prom.c linux-2.6.5/arch/ppc64/kernel/prom.c --- linux-2.6.5-rc3/arch/ppc64/kernel/prom.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/prom.c 2004-04-03 20:20:02.000000000 -0800 @@ -900,7 +900,7 @@ prom_panic(RELOC("ERROR, cannot find space for TCE table.\n")); } - vbase = absolute_to_virt(base); + vbase = (unsigned long)abs_to_virt(base); /* Save away the TCE table attributes for later use. */ prom_tce_table[table].node = node; @@ -1007,9 +1007,12 @@ extern void __secondary_hold(void); extern unsigned long __secondary_hold_spinloop; extern unsigned long __secondary_hold_acknowledge; - unsigned long *spinloop = __v2a(&__secondary_hold_spinloop); - unsigned long *acknowledge = __v2a(&__secondary_hold_acknowledge); - unsigned long secondary_hold = (unsigned long)__v2a(*PTRRELOC((unsigned long *)__secondary_hold)); + unsigned long *spinloop + = (void *)virt_to_abs(&__secondary_hold_spinloop); + unsigned long *acknowledge + = (void *)virt_to_abs(&__secondary_hold_acknowledge); + unsigned long secondary_hold + = virt_to_abs(*PTRRELOC((unsigned long *)__secondary_hold)); struct systemcfg *_systemcfg = RELOC(systemcfg); struct paca_struct *_xPaca = PTRRELOC(&paca[0]); struct prom_t *_prom = PTRRELOC(&prom); diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/rtas.c linux-2.6.5/arch/ppc64/kernel/rtas.c --- linux-2.6.5-rc3/arch/ppc64/kernel/rtas.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/rtas.c 2004-04-03 20:20:02.000000000 -0800 @@ -361,7 +361,7 @@ */ rtas_firmware_flash_list.num_blocks = 0; flist = (struct flash_block_list *)&rtas_firmware_flash_list; - rtas_block_list = virt_to_absolute((unsigned long)flist); + rtas_block_list = virt_to_abs(flist); if (rtas_block_list >= (4UL << 20)) { printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n"); return; @@ -373,13 +373,13 @@ for (f = flist; f; f = next) { /* Translate data addrs to absolute */ for (i = 0; i < f->num_blocks; i++) { - f->blocks[i].data = (char *)virt_to_absolute((unsigned long)f->blocks[i].data); + f->blocks[i].data = (char *)virt_to_abs(f->blocks[i].data); image_size += f->blocks[i].length; } next = f->next; /* Don't translate NULL pointer for last entry */ - if(f->next) - f->next = (struct flash_block_list *)virt_to_absolute((unsigned long)f->next); + if (f->next) + f->next = (struct flash_block_list *)virt_to_abs(f->next); else f->next = 0LL; /* make num_blocks into the version/length field */ diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/smp.c linux-2.6.5/arch/ppc64/kernel/smp.c --- linux-2.6.5-rc3/arch/ppc64/kernel/smp.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/smp.c 2004-04-03 20:20:02.000000000 -0800 @@ -629,7 +629,7 @@ tmp = &stab_array[PAGE_SIZE * cpu]; memset(tmp, 0, PAGE_SIZE); paca[cpu].xStab_data.virt = (unsigned long)tmp; - paca[cpu].xStab_data.real = (unsigned long)__v2a(tmp); + paca[cpu].xStab_data.real = virt_to_abs(tmp); } /* create a process for the processor */ diff -urN linux-2.6.5-rc3/arch/ppc64/kernel/vio.c linux-2.6.5/arch/ppc64/kernel/vio.c --- linux-2.6.5-rc3/arch/ppc64/kernel/vio.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/kernel/vio.c 2004-04-03 20:20:02.000000000 -0800 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -419,7 +420,7 @@ size_t size, int direction ) { struct iommu_table *tbl; - dma_addr_t dma_handle = PCI_DMA_ERROR_CODE; + dma_addr_t dma_handle = DMA_ERROR_CODE; unsigned long uaddr; unsigned int npages; @@ -504,7 +505,7 @@ /* It is easier to debug here for the drivers than in the tce tables.*/ if(order >= IOMAP_MAX_ORDER) { printk("VIO_DMA: vio_alloc_consistent size to large: 0x%lx \n", size); - return (void *)PCI_DMA_ERROR_CODE; + return (void *)DMA_ERROR_CODE; } tbl = dev->iommu_table; @@ -517,7 +518,7 @@ memset(ret, 0, npages << PAGE_SHIFT); /* Set up tces to cover the allocated range */ tce = iommu_alloc(tbl, ret, npages, PCI_DMA_BIDIRECTIONAL); - if (tce == PCI_DMA_ERROR_CODE) { + if (tce == DMA_ERROR_CODE) { PPCDBG(PPCDBG_TCE, "vio_alloc_consistent: iommu_alloc failed\n" ); free_pages((unsigned long)ret, order); ret = NULL; diff -urN linux-2.6.5-rc3/arch/ppc64/mm/hash_utils.c linux-2.6.5/arch/ppc64/mm/hash_utils.c --- linux-2.6.5-rc3/arch/ppc64/mm/hash_utils.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/mm/hash_utils.c 2004-04-03 20:20:02.000000000 -0800 @@ -48,6 +48,8 @@ #include #include #include +#include + /* * Note: pte --> Linux PTE * HPTE --> PowerPC Hashed Page Table Entry @@ -107,11 +109,11 @@ if (systemcfg->platform == PLATFORM_PSERIES_LPAR) ret = pSeries_lpar_hpte_insert(hpteg, va, - (unsigned long)__v2a(addr) >> PAGE_SHIFT, + virt_to_abs(addr) >> PAGE_SHIFT, 0, mode, 1, large); else ret = pSeries_hpte_insert(hpteg, va, - (unsigned long)__v2a(addr) >> PAGE_SHIFT, + virt_to_abs(addr) >> PAGE_SHIFT, 0, mode, 1, large); if (ret == -1) { @@ -154,7 +156,7 @@ ppc64_terminate_msg(0x20, "hpt space"); loop_forever(); } - htab_data.htab = (HPTE *)__a2v(table); + htab_data.htab = abs_to_virt(table); /* htab absolute addr + encoded htabsize */ _SDR1 = table + __ilog2(pteg_count) - 11; diff -urN linux-2.6.5-rc3/arch/ppc64/mm/hugetlbpage.c linux-2.6.5/arch/ppc64/mm/hugetlbpage.c --- linux-2.6.5-rc3/arch/ppc64/mm/hugetlbpage.c 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/arch/ppc64/mm/hugetlbpage.c 2004-04-03 20:20:02.000000000 -0800 @@ -190,6 +190,9 @@ BUG_ON(!in_hugepage_area(mm->context, addr)); pgd = pgd_offset(mm, addr); + if (pgd_none(*pgd)) + return NULL; + pmd = pmd_offset(pgd, addr); /* We shouldn't find a (normal) PTE page pointer here */ @@ -250,8 +253,11 @@ /* Check no VMAs are in the region */ vma = find_vma(mm, TASK_HPAGE_BASE_32); - if (vma && (vma->vm_start < TASK_HPAGE_END_32)) + if (vma && (vma->vm_start < TASK_HPAGE_END_32)) { + printk(KERN_DEBUG "Low HTLB region busy: PID=%d vma @ %lx-%lx\n", + current->pid, vma->vm_start, vma->vm_end); return -EBUSY; + } /* Clean up any leftover PTE pages in the region */ spin_lock(&mm->page_table_lock); @@ -292,6 +298,16 @@ return 0; } +int prepare_hugepage_range(unsigned long addr, unsigned long len) +{ + if (is_hugepage_high_range(addr, len)) + return 0; + else if (is_hugepage_low_range(addr, len)) + return open_32bit_htlbpage_range(current->mm); + + return -EINVAL; +} + int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma) { @@ -912,6 +928,13 @@ return (size + ~HPAGE_MASK)/HPAGE_SIZE <= htlbpage_free; } +/* Return the number pages of memory we physically have, in PAGE_SIZE units. */ +unsigned long hugetlb_total_pages(void) +{ + return htlbpage_total * (HPAGE_SIZE / PAGE_SIZE); +} +EXPORT_SYMBOL(hugetlb_total_pages); + /* * We cannot handle pagefaults against hugetlb pages at all. They cause * handle_mm_fault() to try to instantiate regular-sized pages in the diff -urN linux-2.6.5-rc3/arch/ppc64/mm/init.c linux-2.6.5/arch/ppc64/mm/init.c --- linux-2.6.5-rc3/arch/ppc64/mm/init.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/ppc64/mm/init.c 2004-04-03 20:20:02.000000000 -0800 @@ -60,6 +60,7 @@ #include #include #include +#include struct mmu_context_queue_t mmu_context_queue; @@ -153,7 +154,7 @@ pmdp = pmd_alloc(&ioremap_mm, pgdp, ea); ptep = pte_alloc_kernel(&ioremap_mm, pmdp, ea); - pa = absolute_to_phys(pa); + pa = abs_to_phys(pa); set_pte(ptep, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags))); spin_unlock(&ioremap_mm.page_table_lock); } else { @@ -539,7 +540,7 @@ */ bootmap_pages = bootmem_bootmap_pages(total_pages); - start = (unsigned long)__a2p(lmb_alloc(bootmap_pages<> PAGE_SHIFT, total_pages); diff -urN linux-2.6.5-rc3/arch/sh/mm/hugetlbpage.c linux-2.6.5/arch/sh/mm/hugetlbpage.c --- linux-2.6.5-rc3/arch/sh/mm/hugetlbpage.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/sh/mm/hugetlbpage.c 2004-04-03 20:20:02.000000000 -0800 @@ -501,6 +501,13 @@ return (size + ~HPAGE_MASK)/HPAGE_SIZE <= htlbpagemem; } +/* Return the number pages of memory we physically have, in PAGE_SIZE units. */ +unsigned long hugetlb_total_pages(void) +{ + return htlbzone_pages * (HPAGE_SIZE / PAGE_SIZE); +} +EXPORT_SYMBOL(hugetlb_total_pages); + /* * We cannot handle pagefaults against hugetlb pages at all. They cause * handle_mm_fault() to try to instantiate regular-sized pages in the diff -urN linux-2.6.5-rc3/arch/sparc/defconfig linux-2.6.5/arch/sparc/defconfig --- linux-2.6.5-rc3/arch/sparc/defconfig 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/arch/sparc/defconfig 2004-04-03 20:20:02.000000000 -0800 @@ -10,6 +10,9 @@ # Code maturity level options # CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_STANDALONE=y +CONFIG_BROKEN_ON_SMP=y # # General setup @@ -19,6 +22,16 @@ # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +# CONFIG_IKCONFIG is not set +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # # Loadable module support @@ -50,9 +63,8 @@ # CONFIG_PCI_LEGACY_PROC is not set # CONFIG_PCI_NAMES is not set CONFIG_SUN_OPENPROMFS=m -CONFIG_KCORE_ELF=y -CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_MISC=m CONFIG_SUNOS_EMUL=y @@ -62,6 +74,11 @@ # CONFIG_PARPORT is not set # +# Generic Driver Options +# +# CONFIG_DEBUG_DRIVER is not set + +# # Graphics support # # CONFIG_FB is not set @@ -69,7 +86,6 @@ # # Console display driver support # -# CONFIG_VGA_CONSOLE is not set # CONFIG_MDA_CONSOLE is not set # CONFIG_PROM_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y @@ -89,7 +105,9 @@ # CONFIG_SERIAL_SUNCORE=y CONFIG_SERIAL_SUNZILOG=y +CONFIG_SERIAL_SUNZILOG_CONSOLE=y CONFIG_SERIAL_SUNSU=y +CONFIG_SERIAL_SUNSU_CONSOLE=y # CONFIG_SERIAL_SUNSAB is not set CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y @@ -111,13 +129,14 @@ # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m # CONFIG_BLK_DEV_NBD is not set - -# -# Multi-device support (RAID and LVM) -# -# CONFIG_MD is not set +# CONFIG_BLK_DEV_CARMEL is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y @@ -130,12 +149,13 @@ # # ISDN subsystem # -# CONFIG_ISDN_BOOL is not set +# CONFIG_ISDN is not set # -# SCSI support +# SCSI device support # CONFIG_SCSI=y +CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) @@ -156,6 +176,12 @@ # CONFIG_SCSI_LOGGING is not set # +# SCSI Transport Attributes +# +CONFIG_SCSI_SPI_ATTRS=m +# CONFIG_SCSI_FC_ATTRS is not set + +# # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set @@ -164,10 +190,9 @@ # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_ADVANSYS is not set -# CONFIG_SCSI_AM53C974 is not set # CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_DMX3191D is not set @@ -175,21 +200,22 @@ # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set -# CONFIG_SCSI_GENERIC_NCR5380 is not set -# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set -# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_NCR53C8XX is not set -# CONFIG_SCSI_PCI2000 is not set -# CONFIG_SCSI_PCI2220I is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set CONFIG_SCSI_QLOGICPTI=m +CONFIG_SCSI_QLA2XXX=y +# CONFIG_SCSI_QLA21XX is not set +# CONFIG_SCSI_QLA22XX is not set +# CONFIG_SCSI_QLA2300 is not set +# CONFIG_SCSI_QLA2322 is not set +# CONFIG_SCSI_QLA6312 is not set +# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set -# CONFIG_SCSI_U14_34F is not set # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set CONFIG_SCSI_SUNESP=y @@ -200,6 +226,11 @@ # CONFIG_FC4 is not set # +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# # Networking support # CONFIG_NET=y @@ -210,8 +241,6 @@ CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set CONFIG_NETLINK_DEV=y -# CONFIG_NETFILTER is not set -# CONFIG_FILTER is not set CONFIG_UNIX=y CONFIG_NET_KEY=m CONFIG_INET=y @@ -224,26 +253,36 @@ # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set -# CONFIG_INET_ECN is not set # CONFIG_SYN_COOKIES is not set CONFIG_INET_AH=y CONFIG_INET_ESP=y -CONFIG_XFRM_USER=m +CONFIG_INET_IPCOMP=y CONFIG_IPV6=m +CONFIG_IPV6_PRIVACY=y +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +CONFIG_IPV6_TUNNEL=m +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_NETFILTER is not set +CONFIG_XFRM=y +CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) # -CONFIG_IPV6_SCTP__=y CONFIG_IP_SCTP=m -# CONFIG_SCTP_ADLER32 is not set # CONFIG_SCTP_DBG_MSG is not set CONFIG_SCTP_DBG_OBJCNT=y +# CONFIG_SCTP_HMAC_NONE is not set +# CONFIG_SCTP_HMAC_SHA1 is not set +CONFIG_SCTP_HMAC_MD5=y # CONFIG_ATM is not set # CONFIG_VLAN_8021Q is not set -# CONFIG_LLC is not set -# CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set @@ -261,22 +300,79 @@ # Network testing # CONFIG_NET_PKTGEN=m +CONFIG_NETDEVICES=y # -# Network device support +# ARCnet devices # -CONFIG_NETDEVICES=y +# CONFIG_ARCNET is not set CONFIG_DUMMY=m # CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set CONFIG_TUN=m -# CONFIG_PPP is not set -# CONFIG_SLIP is not set -CONFIG_SUNLANCE=m -CONFIG_HAPPYMEAL=y -# CONFIG_SUNBMAC is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=m +CONFIG_SUNLANCE=y +CONFIG_HAPPYMEAL=m +CONFIG_SUNBMAC=m CONFIG_SUNQE=m +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set + +# +# Tulip family network device support +# +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +# CONFIG_NET_PCI is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set # CONFIG_MYRI_SBUS is not set -CONFIG_VORTEX=m +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SIS190 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set + +# +# Ethernet (10000 Mbit) +# +# CONFIG_IXGB is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set # # Amateur Radio support @@ -284,6 +380,18 @@ # CONFIG_HAMRADIO is not set # +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# Bluetooth support +# +# CONFIG_BT is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# # Unix98 PTY support # CONFIG_UNIX98_PTYS=y @@ -297,7 +405,7 @@ # # Userland interfaces # -CONFIG_INPUT_MOUSEDEV=m +CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 @@ -315,6 +423,7 @@ # CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=m # CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_PCIPS2 is not set # # Input Device Drivers @@ -322,11 +431,13 @@ CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=m CONFIG_KEYBOARD_SUNKBD=m +# CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=m CONFIG_MOUSE_SERIAL=m +# CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set @@ -334,68 +445,93 @@ # # File systems # +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=m +CONFIG_XFS_RT=y +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +# CONFIG_MINIX_FS is not set +CONFIG_ROMFS_FS=m # CONFIG_QUOTA is not set CONFIG_QUOTACTL=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m -# CONFIG_REISERFS_FS is not set + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +# CONFIG_JOLIET is not set +# CONFIG_ZISOFS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_FAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +# CONFIG_DEVFS_FS is not set +CONFIG_DEVPTS_FS_XATTR=y +# CONFIG_DEVPTS_FS_SECURITY is not set +# CONFIG_TMPFS is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set CONFIG_BEFS_FS=m # CONFIG_BEFS_DEBUG is not set # CONFIG_BFS_FS is not set -# CONFIG_EXT3_FS is not set -# CONFIG_JBD is not set -# CONFIG_FAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set -# CONFIG_TMPFS is not set -CONFIG_RAMFS=y -CONFIG_ISO9660_FS=m -# CONFIG_JOLIET is not set -# CONFIG_ZISOFS is not set -# CONFIG_JFS_FS is not set -# CONFIG_MINIX_FS is not set # CONFIG_VXFS_FS is not set -# CONFIG_NTFS_FS is not set # CONFIG_HPFS_FS is not set -CONFIG_PROC_FS=y -# CONFIG_DEVFS_FS is not set -CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set -CONFIG_ROMFS_FS=m -CONFIG_EXT2_FS=y -CONFIG_EXT2_FS_XATTR=y -CONFIG_EXT2_FS_POSIX_ACL=y # CONFIG_SYSV_FS is not set -# CONFIG_UDF_FS is not set # CONFIG_UFS_FS is not set -CONFIG_XFS_FS=m -CONFIG_XFS_RT=y -CONFIG_XFS_QUOTA=y -CONFIG_XFS_POSIX_ACL=y # # Network File Systems # -# CONFIG_CODA_FS is not set -# CONFIG_INTERMEZZO_FS is not set CONFIG_NFS_FS=y # CONFIG_NFS_V3 is not set # CONFIG_NFS_V4 is not set -CONFIG_ROOT_NFS=y +# CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set -CONFIG_SUNRPC=y +CONFIG_ROOT_NFS=y CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set -CONFIG_CIFS=m +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=m +CONFIG_RPCSEC_GSS_KRB5=m # CONFIG_SMB_FS is not set +CONFIG_CIFS=m # CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set CONFIG_AFS_FS=m CONFIG_RXRPC=m -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=y # # Partition Types @@ -403,11 +539,11 @@ # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y CONFIG_SUN_PARTITION=y -CONFIG_NLS=y # # Native Language Support # +CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_CODEPAGE_437 is not set # CONFIG_NLS_CODEPAGE_737 is not set @@ -448,7 +584,7 @@ # CONFIG_NLS_UTF8 is not set # -# Sound card support +# Sound # # CONFIG_SOUND is not set @@ -456,26 +592,28 @@ # USB support # # CONFIG_USB is not set -# CONFIG_USB_GADGET is not set # -# Bluetooth support +# USB Gadget Support # -# CONFIG_BT is not set +# CONFIG_USB_GADGET is not set # -# Watchdog +# Watchdog Cards # -# CONFIG_SOFT_WATCHDOG is not set +# CONFIG_WATCHDOG is not set # # Kernel hacking # -CONFIG_DEBUG_SLAB=y +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_SLAB is not set CONFIG_MAGIC_SYSRQ=y -CONFIG_DEBUG_SPINLOCK=y +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_HIGHMEM is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set -CONFIG_DEBUG_BUGVERBOSE=y +# CONFIG_DEBUG_BUGVERBOSE is not set # # Security options @@ -492,13 +630,22 @@ CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_MICHAEL_MIC=m # CONFIG_CRYPTO_TEST is not set # # Library routines # CONFIG_CRC32=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y diff -urN linux-2.6.5-rc3/arch/sparc/kernel/entry.S linux-2.6.5/arch/sparc/kernel/entry.S --- linux-2.6.5-rc3/arch/sparc/kernel/entry.S 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/sparc/kernel/entry.S 2004-04-03 20:20:02.000000000 -0800 @@ -288,10 +288,9 @@ wr %l0, PSR_ET, %psr WRITE_PAUSE - mov %l7, %o0 ! trap number - mov %l0, %o1 ! psr + add %sp, STACKFRAME_SZ, %o0 ! pt_regs call do_hw_interrupt - mov %l1, %o2 ! pc + mov %l7, %o1 ! trap number RESTORE_ALL @@ -350,21 +349,15 @@ * for cross calls. That has a separate entry point below. */ maybe_smp4m_msg: - GET_PROCESSOR_MID(o3) + GET_PROCESSOR4M_ID(o3) set sun4m_interrupts, %l5 ld [%l5], %o5 - sethi %hi(0x60000000), %o4 + sethi %hi(0x40000000), %o2 sll %o3, 12, %o3 ld [%o5 + %o3], %o1 - andcc %o1, %o4, %g0 + andcc %o1, %o2, %g0 be,a smp4m_ticker cmp %l7, 14 - sethi %hi(0x40000000), %o2 - add %o5, %o3, %o5 - andcc %o1, %o2, %g0 - be,a 1f - sethi %hi(0x20000000), %o2 -1: st %o2, [%o5 + 0x4] WRITE_PAUSE ld [%o5], %g0 @@ -374,15 +367,9 @@ WRITE_PAUSE wr %l4, PSR_ET, %psr WRITE_PAUSE - srl %o2, (16+14), %o2 - tst %o2 - bne 2f - nop call smp_reschedule_irq - add %o7, 8, %o7 -2: - call smp_stop_cpu_irq nop + RESTORE_ALL .align 4 @@ -390,7 +377,7 @@ linux_trap_ipi15_sun4m: SAVE_ALL sethi %hi(0x80000000), %o2 - GET_PROCESSOR_MID(o0) + GET_PROCESSOR4M_ID(o0) set sun4m_interrupts, %l5 ld [%l5], %o5 sll %o0, 12, %o0 diff -urN linux-2.6.5-rc3/arch/sparc/kernel/head.S linux-2.6.5/arch/sparc/kernel/head.S --- linux-2.6.5-rc3/arch/sparc/kernel/head.S 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/arch/sparc/kernel/head.S 2004-04-03 20:20:02.000000000 -0800 @@ -746,9 +746,6 @@ jmpl %g1, %g0 nop - /* This is to align init_thread_union properly, be careful. -DaveM */ - .align 8192 - /* The code above should be at beginning and we have to take care about * short jumps, as branching to .text.init section from .text is usually * impossible */ diff -urN linux-2.6.5-rc3/arch/sparc/kernel/init_task.c linux-2.6.5/arch/sparc/kernel/init_task.c --- linux-2.6.5-rc3/arch/sparc/kernel/init_task.c 2004-03-10 18:55:33.000000000 -0800 +++ linux-2.6.5/arch/sparc/kernel/init_task.c 2004-04-03 20:20:02.000000000 -0800 @@ -21,5 +21,7 @@ * If this is not aligned on a 8k boundry, then you should change code * in etrap.S which assumes it. */ -__asm__(".section \".text\",#alloc\n"); -union thread_union init_thread_union = { INIT_THREAD_INFO(init_task) }; +union thread_union init_thread_union + __attribute__((section (".text"))) + __attribute__((aligned (THREAD_SIZE))) + = { INIT_THREAD_INFO(init_task) }; diff -urN linux-2.6.5-rc3/arch/sparc/kernel/module.c linux-2.6.5/arch/sparc/kernel/module.c --- linux-2.6.5-rc3/arch/sparc/kernel/module.c 2004-03-10 18:55:20.000000000 -0800 +++ linux-2.6.5/arch/sparc/kernel/module.c 2004-04-03 20:20:02.000000000 -0800 @@ -36,7 +36,9 @@ table entries. */ } -/* Make generic code ignore STT_REGISTER dummy undefined symbols. */ +/* Make generic code ignore STT_REGISTER dummy undefined symbols, + * and replace references to .func with func as in ppc64's dedotify. + */ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings, @@ -44,7 +46,7 @@ { unsigned int symidx; Elf32_Sym *sym; - const char *strtab; + char *strtab; int i; for (symidx = 0; sechdrs[symidx].sh_type != SHT_SYMTAB; symidx++) { @@ -57,9 +59,15 @@ strtab = (char *)sechdrs[sechdrs[symidx].sh_link].sh_addr; for (i = 1; i < sechdrs[symidx].sh_size / sizeof(Elf_Sym); i++) { - if (sym[i].st_shndx == SHN_UNDEF && - ELF32_ST_TYPE(sym[i].st_info) == STT_REGISTER) - sym[i].st_shndx = SHN_ABS; + if (sym[i].st_shndx == SHN_UNDEF) { + if (ELF32_ST_TYPE(sym[i].st_info) == STT_REGISTER) + sym[i].st_shndx = SHN_ABS; + else { + char *name = strtab + sym[i].st_name; + if (name[0] == '.') + memmove(name, name+1, strlen(name)); + } + } } return 0; } diff -urN linux-2.6.5-rc3/arch/sparc/kernel/signal.c linux-2.6.5/arch/sparc/kernel/signal.c --- linux-2.6.5-rc3/arch/sparc/kernel/signal.c 2004-03-10 18:55:36.000000000 -0800 +++ linux-2.6.5/arch/sparc/kernel/signal.c 2004-04-03 20:20:02.000000000 -0800 @@ -1128,9 +1128,9 @@ /* Now see if we want to update the new state. */ if (ssptr) { - void *ss_sp; + char *ss_sp; - if (get_user((long)ss_sp, &ssptr->the_stack)) + if (get_user(ss_sp, &ssptr->the_stack)) goto out; /* If the current stack was set with sigaltstack, don't swap stacks while we are on it. */ diff -urN linux-2.6.5-rc3/arch/sparc/kernel/sparc_ksyms.c linux-2.6.5/arch/sparc/kernel/sparc_ksyms.c --- linux-2.6.5-rc3/arch/sparc/kernel/sparc_ksyms.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/sparc/kernel/sparc_ksyms.c 2004-04-03 20:20:02.000000000 -0800 @@ -92,31 +92,21 @@ extern void ___clear_bit(void); extern void ___change_bit(void); -/* One thing to note is that the way the symbols of the mul/div - * support routines are named is a mess, they all start with - * a '.' which makes it a bitch to export, here is the trick: +/* Alias functions whose names begin with "." and export the aliases. + * The module references will be fixed up by module_frob_arch_sections. */ +#define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \ + extern __ret __x(__arg1, __arg2) \ + __attribute__((weak, alias("." # __x))); + +DOT_ALIAS2(int, div, int, int) +DOT_ALIAS2(int, mul, int, int) +DOT_ALIAS2(int, rem, int, int) +DOT_ALIAS2(unsigned, udiv, unsigned, unsigned) +DOT_ALIAS2(unsigned, umul, unsigned, unsigned) +DOT_ALIAS2(unsigned, urem, unsigned, unsigned) -/* If the interface of any of these special functions does ever - * change in an incompatible way, you must modify this. - */ -#define DOT_PROTO(sym) extern int __dot_##sym(int, int) - -#ifdef __GENKSYMS__ -#define EXPORT_SYMBOL_DOT(sym) \ - DOT_PROTO(sym); \ - EXPORT_SYMBOL(__dot_ ## sym) -#else /* !__GENKSYMS__ */ -#define EXPORT_SYMBOL_DOT(sym) \ - DOT_PROTO(sym) __asm__("." # sym); \ - __CRC_SYMBOL(__dot_##sym, "") \ - static const char __kstrtab___dot_##sym[] \ - __attribute__((section("__ksymtab_strings"))) \ - = "." #sym; \ - static const struct kernel_symbol __ksymtab___dot_##sym \ - __attribute__((section("__ksymtab"))) \ - = { (unsigned long)&__dot_##sym, __kstrtab___dot_##sym } -#endif +#undef DOT_ALIAS2 /* used by various drivers */ EXPORT_SYMBOL(sparc_cpu_model); @@ -180,21 +170,20 @@ /* EXPORT_SYMBOL(iounit_map_dma_init); */ /* EXPORT_SYMBOL(iounit_map_dma_page); */ -/* Btfixup stuff cannot have versions, it would be complicated too much */ #ifndef CONFIG_SMP -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(___xchg32)); +EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32)); #else -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(__smp_processor_id)); +EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id)); #endif -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(enable_irq)); -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(disable_irq)); -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(__irq_itoa)); -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(mmu_unlockarea)); -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(mmu_lockarea)); -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(mmu_get_scsi_sgl)); -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(mmu_get_scsi_one)); -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(mmu_release_scsi_sgl)); -EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(mmu_release_scsi_one)); +EXPORT_SYMBOL(BTFIXUP_CALL(enable_irq)); +EXPORT_SYMBOL(BTFIXUP_CALL(disable_irq)); +EXPORT_SYMBOL(BTFIXUP_CALL(__irq_itoa)); +EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea)); +EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea)); +EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl)); +EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one)); +EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl)); +EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one)); #ifdef CONFIG_SBUS EXPORT_SYMBOL(sbus_root); @@ -271,15 +260,15 @@ /* sparc library symbols */ EXPORT_SYMBOL(bcopy); EXPORT_SYMBOL(memchr); -EXPORT_SYMBOL_NOVERS(memscan); -EXPORT_SYMBOL_NOVERS(strlen); +EXPORT_SYMBOL(memscan); +EXPORT_SYMBOL(strlen); EXPORT_SYMBOL(strnlen); EXPORT_SYMBOL(strcpy); EXPORT_SYMBOL(strncpy); EXPORT_SYMBOL(strcat); EXPORT_SYMBOL(strncat); EXPORT_SYMBOL(strcmp); -EXPORT_SYMBOL_NOVERS(strncmp); +EXPORT_SYMBOL(strncmp); EXPORT_SYMBOL(strchr); EXPORT_SYMBOL(strrchr); EXPORT_SYMBOL(strpbrk); @@ -309,28 +298,24 @@ /* Cache flushing. */ EXPORT_SYMBOL(sparc_flush_page_to_ram); -/* No version information on this, heavily used in inline asm, - * and will always be 'void __ret_efault(void)'. - */ -EXPORT_SYMBOL_NOVERS(__ret_efault); +EXPORT_SYMBOL(__ret_efault); -/* No version information on these, as gcc produces such symbols. */ -EXPORT_SYMBOL_NOVERS(memcmp); -EXPORT_SYMBOL_NOVERS(memcpy); -EXPORT_SYMBOL_NOVERS(memset); -EXPORT_SYMBOL_NOVERS(memmove); -EXPORT_SYMBOL_NOVERS(__ashrdi3); -EXPORT_SYMBOL_NOVERS(__ashldi3); -EXPORT_SYMBOL_NOVERS(__lshrdi3); -EXPORT_SYMBOL_NOVERS(__muldi3); -EXPORT_SYMBOL_NOVERS(__divdi3); - -EXPORT_SYMBOL_DOT(rem); -EXPORT_SYMBOL_DOT(urem); -EXPORT_SYMBOL_DOT(mul); -EXPORT_SYMBOL_DOT(umul); -EXPORT_SYMBOL_DOT(div); -EXPORT_SYMBOL_DOT(udiv); +EXPORT_SYMBOL(memcmp); +EXPORT_SYMBOL(memcpy); +EXPORT_SYMBOL(memset); +EXPORT_SYMBOL(memmove); +EXPORT_SYMBOL(__ashrdi3); +EXPORT_SYMBOL(__ashldi3); +EXPORT_SYMBOL(__lshrdi3); +EXPORT_SYMBOL(__muldi3); +EXPORT_SYMBOL(__divdi3); + +EXPORT_SYMBOL(rem); +EXPORT_SYMBOL(urem); +EXPORT_SYMBOL(mul); +EXPORT_SYMBOL(umul); +EXPORT_SYMBOL(div); +EXPORT_SYMBOL(udiv); #ifdef CONFIG_DEBUG_BUGVERBOSE EXPORT_SYMBOL(do_BUG); diff -urN linux-2.6.5-rc3/arch/sparc/kernel/sys_sunos.c linux-2.6.5/arch/sparc/kernel/sys_sunos.c --- linux-2.6.5-rc3/arch/sparc/kernel/sys_sunos.c 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/arch/sparc/kernel/sys_sunos.c 2004-04-03 20:20:02.000000000 -0800 @@ -343,7 +343,7 @@ put_user(reclen, &dirent->d_reclen); copy_to_user(dirent->d_name, name, namlen); put_user(0, dirent->d_name + namlen); - ((char *) dirent) += reclen; + dirent = (void *)dirent + reclen; buf->curr = dirent; buf->count -= reclen; return 0; @@ -422,7 +422,7 @@ put_user(reclen, &dirent->d_reclen); copy_to_user(dirent->d_name, name, namlen); put_user(0, dirent->d_name + namlen); - ((char *) dirent) += reclen; + dirent = (void *)dirent + reclen; buf->curr = dirent; buf->count -= reclen; return 0; diff -urN linux-2.6.5-rc3/arch/sparc/kernel/traps.c linux-2.6.5/arch/sparc/kernel/traps.c --- linux-2.6.5-rc3/arch/sparc/kernel/traps.c 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/arch/sparc/kernel/traps.c 2004-04-03 20:20:02.000000000 -0800 @@ -131,23 +131,23 @@ do_exit(SIGSEGV); } -void do_hw_interrupt(unsigned long type, unsigned long psr, unsigned long pc) +void do_hw_interrupt(struct pt_regs *regs, unsigned long type) { siginfo_t info; if(type < 0x80) { /* Sun OS's puke from bad traps, Linux survives! */ printk("Unimplemented Sparc TRAP, type = %02lx\n", type); - die_if_kernel("Whee... Hello Mr. Penguin", current->thread.kregs); + die_if_kernel("Whee... Hello Mr. Penguin", regs); } - if(psr & PSR_PS) - die_if_kernel("Kernel bad trap", current->thread.kregs); + if(regs->psr & PSR_PS) + die_if_kernel("Kernel bad trap", regs); info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLTRP; - info.si_addr = (void *)pc; + info.si_addr = (void *)regs->pc; info.si_trapno = type - 0x80; force_sig_info(SIGILL, &info, current); } diff -urN linux-2.6.5-rc3/arch/sparc/lib/Makefile linux-2.6.5/arch/sparc/lib/Makefile --- linux-2.6.5-rc3/arch/sparc/lib/Makefile 2004-03-10 18:55:49.000000000 -0800 +++ linux-2.6.5/arch/sparc/lib/Makefile 2004-04-03 20:20:02.000000000 -0800 @@ -7,5 +7,7 @@ lib-y := mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o memcpy.o memset.o \ strlen.o checksum.o blockops.o memscan.o memcmp.o strncmp.o \ strncpy_from_user.o divdi3.o udivdi3.o strlen_user.o \ - copy_user.o locks.o atomic.o atomic32.o bitops.o debuglocks.o \ + copy_user.o locks.o atomic.o atomic32.o bitops.o \ lshrdi3.o ashldi3.o rwsem.o muldi3.o bitext.o + +lib-$(CONFIG_DEBUG_SPINLOCK) += debuglocks.o diff -urN linux-2.6.5-rc3/arch/sparc/lib/debuglocks.c linux-2.6.5/arch/sparc/lib/debuglocks.c --- linux-2.6.5-rc3/arch/sparc/lib/debuglocks.c 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/arch/sparc/lib/debuglocks.c 2004-04-03 20:20:02.000000000 -0800 @@ -12,8 +12,7 @@ #include #include -/* To enable this code, just define SPIN_LOCK_DEBUG in asm/spinlock.h */ -#ifdef SPIN_LOCK_DEBUG +#ifdef CONFIG_SMP /* Some notes on how these debugging routines work. When a lock is acquired * an extra debugging member lock->owner_pc is set to the caller of the lock @@ -200,4 +199,4 @@ rw->lock = 0; } -#endif /* SPIN_LOCK_DEBUG */ +#endif /* SMP */ diff -urN linux-2.6.5-rc3/arch/sparc/math-emu/math.c linux-2.6.5/arch/sparc/math-emu/math.c --- linux-2.6.5-rc3/arch/sparc/math-emu/math.c 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/arch/sparc/math-emu/math.c 2004-04-03 20:20:02.000000000 -0800 @@ -327,6 +327,7 @@ #ifdef DEBUG_MATHEMU printk("unknown FPop1: %03lx\n",(insn>>5)&0x1ff); #endif + break; } } else if ((insn & 0xc1f80000) == 0x81a80000) /* FPOP2 */ { switch ((insn >> 5) & 0x1ff) { @@ -340,6 +341,7 @@ #ifdef DEBUG_MATHEMU printk("unknown FPop2: %03lx\n",(insn>>5)&0x1ff); #endif + break; } } diff -urN linux-2.6.5-rc3/arch/sparc64/kernel/sparc64_ksyms.c linux-2.6.5/arch/sparc64/kernel/sparc64_ksyms.c --- linux-2.6.5-rc3/arch/sparc64/kernel/sparc64_ksyms.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/arch/sparc64/kernel/sparc64_ksyms.c 2004-04-03 20:20:02.000000000 -0800 @@ -91,6 +91,7 @@ extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *); extern long sparc32_open(const char * filename, int flags, int mode); extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space); +extern void (*prom_palette)(int); extern int __ashrdi3(int, int); @@ -388,3 +389,5 @@ EXPORT_SYMBOL(xor_vis_3); EXPORT_SYMBOL(xor_vis_4); EXPORT_SYMBOL(xor_vis_5); + +EXPORT_SYMBOL(prom_palette); diff -urN linux-2.6.5-rc3/arch/sparc64/mm/hugetlbpage.c linux-2.6.5/arch/sparc64/mm/hugetlbpage.c --- linux-2.6.5-rc3/arch/sparc64/mm/hugetlbpage.c 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/arch/sparc64/mm/hugetlbpage.c 2004-04-03 20:20:02.000000000 -0800 @@ -497,6 +497,13 @@ return (size + ~HPAGE_MASK)/HPAGE_SIZE <= htlbpagemem; } +/* Return the number pages of memory we physically have, in PAGE_SIZE units. */ +unsigned long hugetlb_total_pages(void) +{ + return htlbzone_pages * (HPAGE_SIZE / PAGE_SIZE); +} +EXPORT_SYMBOL(hugetlb_total_pages); + /* * We cannot handle pagefaults against hugetlb pages at all. They cause * handle_mm_fault() to try to instantiate regular-sized pages in the diff -urN linux-2.6.5-rc3/arch/sparc64/solaris/timod.c linux-2.6.5/arch/sparc64/solaris/timod.c --- linux-2.6.5-rc3/arch/sparc64/solaris/timod.c 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/arch/sparc64/solaris/timod.c 2004-04-03 20:20:02.000000000 -0800 @@ -296,7 +296,7 @@ SOLD("calling GETSOCKOPT"); set_fs(KERNEL_DS); error = sys_socketcall(SYS_GETSOCKOPT, args); - set_fs(old_fs);; + set_fs(old_fs); if (error) { failed = TBADOPT; break; diff -urN linux-2.6.5-rc3/arch/x86_64/kernel/io_apic.c linux-2.6.5/arch/x86_64/kernel/io_apic.c --- linux-2.6.5-rc3/arch/x86_64/kernel/io_apic.c 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/arch/x86_64/kernel/io_apic.c 2004-04-03 20:20:02.000000000 -0800 @@ -1891,7 +1891,11 @@ entry.polarity = active_high_low; entry.mask = 1; /* Disabled (masked) */ - add_pin_to_irq(irq, ioapic, pin); + /* + * IRQs < 16 are already in the irq_2_pin[] map + */ + if (irq >= 16) + add_pin_to_irq(irq, ioapic, pin); entry.vector = assign_irq_vector(irq); diff -urN linux-2.6.5-rc3/drivers/acorn/char/Makefile linux-2.6.5/drivers/acorn/char/Makefile --- linux-2.6.5-rc3/drivers/acorn/char/Makefile 2004-03-10 18:55:22.000000000 -0800 +++ linux-2.6.5/drivers/acorn/char/Makefile 2004-04-03 20:20:03.000000000 -0800 @@ -4,4 +4,3 @@ obj-$(CONFIG_ARCH_ACORN) += i2c.o pcf8583.o obj-$(CONFIG_L7200_KEYB) += defkeymap-l7200.o keyb_l7200.o -obj-y += $(obj-$(MACHINE)) diff -urN linux-2.6.5-rc3/drivers/acpi/bus.c linux-2.6.5/drivers/acpi/bus.c --- linux-2.6.5-rc3/drivers/acpi/bus.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/acpi/bus.c 2004-04-03 20:20:03.000000000 -0800 @@ -615,6 +615,11 @@ #ifdef CONFIG_X86 if (!acpi_ioapic) { extern acpi_interrupt_flags acpi_sci_flags; + + /* compatible (0) means level (3) */ + if (acpi_sci_flags.trigger == 0) + acpi_sci_flags.trigger = 3; + /* Set PIC-mode SCI trigger type */ acpi_pic_sci_set_trigger(acpi_fadt.sci_int, acpi_sci_flags.trigger); } else { diff -urN linux-2.6.5-rc3/drivers/acpi/osl.c linux-2.6.5/drivers/acpi/osl.c --- linux-2.6.5-rc3/drivers/acpi/osl.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/acpi/osl.c 2004-04-03 20:20:03.000000000 -0800 @@ -1057,15 +1057,15 @@ * Run-time events on the same GPE this flag is available * to tell Linux to keep the wake-time GPEs enabled at run-time. */ -int __init -acpi_wake_gpes_always_on_setup(char *str) +static int __init +acpi_leave_gpes_disabled_setup(char *str) { - printk(KERN_INFO PREFIX "wake GPEs not disabled\n"); + printk(KERN_INFO PREFIX "leave wake GPEs disabled\n"); - acpi_gbl_leave_wake_gpes_disabled = FALSE; + acpi_gbl_leave_wake_gpes_disabled = TRUE; return 1; } -__setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup); +__setup("acpi_leave_gpes_disabled", acpi_leave_gpes_disabled_setup); diff -urN linux-2.6.5-rc3/drivers/acpi/pci_irq.c linux-2.6.5/drivers/acpi/pci_irq.c --- linux-2.6.5-rc3/drivers/acpi/pci_irq.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/acpi/pci_irq.c 2004-04-03 20:20:03.000000000 -0800 @@ -273,11 +273,6 @@ return_VALUE(entry->irq); } -/* - * current thinking is that acpi_pci_irq_derive() adds no value - * and should be deleted, so warn if it actually does something. - */ - static int acpi_pci_irq_derive ( struct pci_dev *dev, @@ -285,6 +280,7 @@ { struct pci_dev *bridge = dev; int irq = 0; + u8 bridge_pin = 0; ACPI_FUNCTION_TRACE("acpi_pci_irq_derive"); @@ -293,11 +289,25 @@ /* * Attempt to derive an IRQ for this device from a parent bridge's - * PCI interrupt routing entry (a.k.a. the "bridge swizzle"). + * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). */ while (!irq && bridge->bus->self) { pin = (pin + PCI_SLOT(bridge->devfn)) % 4; bridge = bridge->bus->self; + + if ((bridge->class >> 8) == PCI_CLASS_BRIDGE_CARDBUS) { + /* PC card has the same IRQ as its cardbridge */ + pci_read_config_byte(bridge, PCI_INTERRUPT_PIN, &bridge_pin); + if (!bridge_pin) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "No interrupt pin configured for device %s\n", pci_name(bridge))); + return_VALUE(0); + } + /* Pin is from 0 to 3 */ + bridge_pin --; + pin = bridge_pin; + } + irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn), pin); } @@ -307,7 +317,7 @@ return_VALUE(0); } - ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Derive IRQ %d for device %s from %s\n", + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n", irq, pci_name(dev), pci_name(bridge))); return_VALUE(irq); @@ -345,13 +355,6 @@ irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin); /* - * Check if the device has an IRQ, - * Hotplug devices may get IRQs by scanning - */ - if (!irq && dev->irq) - irq = dev->irq; - - /* * If no PRT entry was found, we'll try to derive an IRQ from the * device's parent bridge. */ diff -urN linux-2.6.5-rc3/drivers/acpi/sleep/proc.c linux-2.6.5/drivers/acpi/sleep/proc.c --- linux-2.6.5-rc3/drivers/acpi/sleep/proc.c 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/drivers/acpi/sleep/proc.c 2004-04-03 20:20:03.000000000 -0800 @@ -99,7 +99,7 @@ if (acpi_gbl_FADT->mon_alrm) mo = CMOS_READ(acpi_gbl_FADT->mon_alrm); else - mo = CMOS_READ(RTC_MONTH);; + mo = CMOS_READ(RTC_MONTH); if (acpi_gbl_FADT->century) yr = CMOS_READ(acpi_gbl_FADT->century) * 100 + CMOS_READ(RTC_YEAR); else diff -urN linux-2.6.5-rc3/drivers/acpi/utilities/utglobal.c linux-2.6.5/drivers/acpi/utilities/utglobal.c --- linux-2.6.5-rc3/drivers/acpi/utilities/utglobal.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/acpi/utilities/utglobal.c 2004-04-03 20:20:03.000000000 -0800 @@ -787,7 +787,6 @@ acpi_gbl_create_osi_method = TRUE; acpi_gbl_all_methods_serialized = FALSE; - acpi_gbl_leave_wake_gpes_disabled = TRUE; /* Memory allocation and cache lists */ diff -urN linux-2.6.5-rc3/drivers/block/carmel.c linux-2.6.5/drivers/block/carmel.c --- linux-2.6.5-rc3/drivers/block/carmel.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/block/carmel.c 2004-04-03 20:20:05.000000000 -0800 @@ -994,7 +994,8 @@ } printk(KERN_INFO DRV_NAME "(%s): port %u device %Lu sectors\n", - pci_name(host->pdev), port->port_no, port->capacity); + pci_name(host->pdev), port->port_no, + (unsigned long long) port->capacity); printk(KERN_INFO DRV_NAME "(%s): port %u device \"%s\"\n", pci_name(host->pdev), port->port_no, port->name); diff -urN linux-2.6.5-rc3/drivers/block/cpqarray.c linux-2.6.5/drivers/block/cpqarray.c --- linux-2.6.5-rc3/drivers/block/cpqarray.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/block/cpqarray.c 2004-04-03 20:20:06.000000000 -0800 @@ -1738,7 +1738,7 @@ return; } - info_p->log_drives = id_ctlr_buf->nr_drvs;; + info_p->log_drives = id_ctlr_buf->nr_drvs; for(i=0;i<4;i++) info_p->firm_rev[i] = id_ctlr_buf->firm_rev[i]; info_p->ctlr_sig = id_ctlr_buf->cfg_sig; diff -urN linux-2.6.5-rc3/drivers/block/elevator.c linux-2.6.5/drivers/block/elevator.c --- linux-2.6.5-rc3/drivers/block/elevator.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/drivers/block/elevator.c 2004-04-03 20:20:06.000000000 -0800 @@ -210,10 +210,14 @@ rq = NULL; break; } else if (ret == BLKPREP_KILL) { + int nr_bytes = rq->hard_nr_sectors << 9; + + if (!nr_bytes) + nr_bytes = rq->data_len; + blkdev_dequeue_request(rq); rq->flags |= REQ_QUIET; - while (end_that_request_first(rq, 0, rq->nr_sectors)) - ; + end_that_request_chunk(rq, 0, nr_bytes); end_that_request_last(rq); } else { printk("%s: bad return=%d\n", __FUNCTION__, ret); diff -urN linux-2.6.5-rc3/drivers/block/loop.c linux-2.6.5/drivers/block/loop.c --- linux-2.6.5-rc3/drivers/block/loop.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/block/loop.c 2004-04-03 20:20:06.000000000 -0800 @@ -677,7 +677,6 @@ lo->transfer = NULL; lo->ioctl = NULL; lo->lo_sizelimit = 0; - bd_set_size(bdev,(loff_t)get_capacity(disks[lo->lo_number])<<9); lo->old_gfp_mask = mapping_gfp_mask(mapping); mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS)); @@ -691,6 +690,7 @@ lo->lo_queue->queuedata = lo; set_capacity(disks[lo->lo_number], size); + bd_set_size(bdev, size << 9); set_blocksize(bdev, lo_blocksize); diff -urN linux-2.6.5-rc3/drivers/cdrom/sbpcd.c linux-2.6.5/drivers/cdrom/sbpcd.c --- linux-2.6.5-rc3/drivers/cdrom/sbpcd.c 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/drivers/cdrom/sbpcd.c 2004-04-03 20:20:09.000000000 -0800 @@ -5120,7 +5120,7 @@ for ( ; try!=0;try--) { j=inb(CDi_status); - if (!(j&s_not_data_ready)) break;; + if (!(j&s_not_data_ready)) break; if (!(j&s_not_result_ready)) break; if (fam0LV_drive) if (j&s_attention) break; } diff -urN linux-2.6.5-rc3/drivers/char/drm/drm_memory_debug.h linux-2.6.5/drivers/char/drm/drm_memory_debug.h --- linux-2.6.5-rc3/drivers/char/drm/drm_memory_debug.h 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/drivers/char/drm/drm_memory_debug.h 2004-04-03 20:20:09.000000000 -0800 @@ -385,7 +385,7 @@ if (!handle) { DRM_MEM_ERROR(DRM_MEM_TOTALAGP, "Attempt to free NULL AGP handle\n"); - return retval;; + return retval; } if (DRM(agp_free_memory)(handle)) { diff -urN linux-2.6.5-rc3/drivers/char/drm/gamma_context.h linux-2.6.5/drivers/char/drm/gamma_context.h --- linux-2.6.5-rc3/drivers/char/drm/gamma_context.h 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/drivers/char/drm/gamma_context.h 2004-04-03 20:20:09.000000000 -0800 @@ -84,7 +84,7 @@ } wake_up_interruptible(&dev->buf_writers); - return DRM_MIN(avail, count);; + return DRM_MIN(avail, count); } diff -urN linux-2.6.5-rc3/drivers/char/dz.c linux-2.6.5/drivers/char/dz.c --- linux-2.6.5-rc3/drivers/char/dz.c 2004-03-10 18:55:22.000000000 -0800 +++ linux-2.6.5/drivers/char/dz.c 2004-04-03 20:20:09.000000000 -0800 @@ -431,7 +431,7 @@ static void do_serial_hangup (void *private_data) { struct dz_serial *info = (struct dz_serial *) private_data; - struct tty_struct *tty = info->tty;; + struct tty_struct *tty = info->tty; if (!tty) return; diff -urN linux-2.6.5-rc3/drivers/char/ftape/compressor/lzrw3.c linux-2.6.5/drivers/char/ftape/compressor/lzrw3.c --- linux-2.6.5-rc3/drivers/char/ftape/compressor/lzrw3.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/drivers/char/ftape/compressor/lzrw3.c 2004-04-03 20:20:09.000000000 -0800 @@ -701,7 +701,7 @@ /* been postponed for lack of bytes. */ if (literals>0) { - register UBYTE *r=p_ziv-literals;; + register UBYTE *r=p_ziv-literals; hash[HASH(r)]=r; if (literals==2) {r++; hash[HASH(r)]=r;} diff -urN linux-2.6.5-rc3/drivers/char/mwave/smapi.c linux-2.6.5/drivers/char/mwave/smapi.c --- linux-2.6.5-rc3/drivers/char/mwave/smapi.c 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.5/drivers/char/mwave/smapi.c 2004-04-03 20:20:10.000000000 -0800 @@ -447,7 +447,7 @@ if (bRC) goto exit_smapi_request_error; if (mwave_3780i_io) { - usDI = dspio_index;; + usDI = dspio_index; } if (mwave_3780i_irq) { usSI = (usSI & 0xff00) | mwave_3780i_irq; diff -urN linux-2.6.5-rc3/drivers/char/qtronix.c linux-2.6.5/drivers/char/qtronix.c --- linux-2.6.5-rc3/drivers/char/qtronix.c 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/drivers/char/qtronix.c 2004-04-03 20:20:10.000000000 -0800 @@ -206,7 +206,7 @@ unsigned char int_status; cir = (struct cir_port *)dev_id; - int_status = get_int_status(cir);; + int_status = get_int_status(cir); if (int_status & 0x4) { clear_fifo(cir); return; diff -urN linux-2.6.5-rc3/drivers/char/vt.c linux-2.6.5/drivers/char/vt.c --- linux-2.6.5-rc3/drivers/char/vt.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/char/vt.c 2004-04-03 20:20:11.000000000 -0800 @@ -2315,7 +2315,7 @@ break; case TIOCL_SETVESABLANK: set_vesa_blanking(arg); - break;; + break; case TIOCL_SETKMSGREDIRECT: if (!capable(CAP_SYS_ADMIN)) { ret = -EPERM; diff -urN linux-2.6.5-rc3/drivers/fc4/soc.h linux-2.6.5/drivers/fc4/soc.h --- linux-2.6.5-rc3/drivers/fc4/soc.h 2004-03-10 18:55:20.000000000 -0800 +++ linux-2.6.5/drivers/fc4/soc.h 2004-04-03 20:20:11.000000000 -0800 @@ -114,18 +114,22 @@ static inline void xram_copy_from (void *p, xram_p x, int len) { for (len >>= 2; len > 0; len--, x += sizeof(u32)) { - u32 val; + u32 val, *p32 = p; val = ((sbus_readw(x + 0x00UL) << 16) | (sbus_readw(x + 0x02UL))); - *((u32 *)p)++ = val; + *p32++ = val; + p = p32; } } static inline void xram_copy_to (xram_p x, void *p, int len) { for (len >>= 2; len > 0; len--, x += sizeof(u32)) { - u32 tmp = *((u32 *)p)++; + u32 tmp, *p32 = p; + + tmp = *p32++; + p = p32; sbus_writew(tmp >> 16, x + 0x00UL); sbus_writew(tmp, x + 0x02UL); } diff -urN linux-2.6.5-rc3/drivers/ide/pci/trm290.c linux-2.6.5/drivers/ide/pci/trm290.c --- linux-2.6.5-rc3/drivers/ide/pci/trm290.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/ide/pci/trm290.c 2004-04-03 20:20:11.000000000 -0800 @@ -280,7 +280,7 @@ static int trm290_ide_dma_end (ide_drive_t *drive) { ide_hwif_t *hwif = HWIF(drive); - u16 status = 0;; + u16 status = 0; drive->waiting_for_dma = 0; /* purge DMA mappings */ diff -urN linux-2.6.5-rc3/drivers/input/joystick/gf2k.c linux-2.6.5/drivers/input/joystick/gf2k.c --- linux-2.6.5-rc3/drivers/input/joystick/gf2k.c 2004-03-10 18:55:36.000000000 -0800 +++ linux-2.6.5/drivers/input/joystick/gf2k.c 2004-04-03 20:20:12.000000000 -0800 @@ -109,7 +109,7 @@ local_irq_save(flags); gameport_trigger(gameport); - v = gameport_read(gameport);; + v = gameport_read(gameport); while (t > 0 && i < length) { t--; u = v; diff -urN linux-2.6.5-rc3/drivers/isdn/hardware/eicon/capifunc.c linux-2.6.5/drivers/isdn/hardware/eicon/capifunc.c --- linux-2.6.5-rc3/drivers/isdn/hardware/eicon/capifunc.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/isdn/hardware/eicon/capifunc.c 2004-04-03 20:20:12.000000000 -0800 @@ -1,4 +1,4 @@ -/* $Id: capifunc.c,v 1.60 2004/03/22 16:28:27 armin Exp $ +/* $Id: capifunc.c,v 1.61 2004/03/26 19:48:48 armin Exp $ * * ISDN interface module for Eicon active cards DIVA. * CAPI Interface common functions @@ -893,7 +893,10 @@ return CAPI_REGOSRESOURCEERR; } + diva_os_enter_spin_lock(&api_lock, &old_irql, "send message"); + if (!this->Id) { + diva_os_leave_spin_lock(&api_lock, &old_irql, "send message"); return CAPI_ILLAPPNR; } @@ -901,8 +904,6 @@ msg->header.controller = ControllerMap[card->Id] | (msg->header.controller & 0x80); /* preserve external controller bit */ - diva_os_enter_spin_lock(&api_lock, &old_irql, "send message"); - switch (command) { default: xlog("\x00\x02", msg, 0x80, clength); diff -urN linux-2.6.5-rc3/drivers/isdn/hardware/eicon/divasmain.c linux-2.6.5/drivers/isdn/hardware/eicon/divasmain.c --- linux-2.6.5-rc3/drivers/isdn/hardware/eicon/divasmain.c 2004-04-03 20:19:54.000000000 -0800 +++ linux-2.6.5/drivers/isdn/hardware/eicon/divasmain.c 2004-04-03 20:20:13.000000000 -0800 @@ -1,4 +1,4 @@ -/* $Id: divasmain.c,v 1.52 2004/03/21 17:26:01 armin Exp $ +/* $Id: divasmain.c,v 1.54 2004/04/02 18:59:22 armin Exp $ * * Low level driver for Eicon DIVA Server ISDN cards. * @@ -41,7 +41,7 @@ #include "diva_dma.h" #include "diva_pci.h" -static char *main_revision = "$Revision: 1.52 $"; +static char *main_revision = "$Revision: 1.54 $"; static int major; @@ -594,11 +594,6 @@ int diva_os_cancel_soft_isr(diva_os_soft_isr_t * psoft_isr) { - if (psoft_isr && psoft_isr->object) { - diva_os_thread_dpc_t *pdpc = - (diva_os_thread_dpc_t *) psoft_isr->object; - tasklet_kill(&pdpc->divas_task); - } return (0); } diff -urN linux-2.6.5-rc3/drivers/isdn/hardware/eicon/message.c linux-2.6.5/drivers/isdn/hardware/eicon/message.c --- linux-2.6.5-rc3/drivers/isdn/hardware/eicon/message.c 2004-03-10 18:55:34.000000000 -0800 +++ linux-2.6.5/drivers/isdn/hardware/eicon/message.c 2004-04-03 20:20:13.000000000 -0800 @@ -14821,7 +14821,7 @@ for(i=0;iisac.priv = adapter; switch (adapter->type) { case AVM_FRITZ_PCIV2: - adapter->isac.read_isac = &fcpci2_read_isac;; + adapter->isac.read_isac = &fcpci2_read_isac; adapter->isac.write_isac = &fcpci2_write_isac; adapter->isac.read_isac_fifo = &fcpci2_read_isac_fifo; adapter->isac.write_isac_fifo = &fcpci2_write_isac_fifo; @@ -771,7 +771,7 @@ adapter->write_ctrl = &fcpci2_write_ctrl; break; case AVM_FRITZ_PCI: - adapter->isac.read_isac = &fcpci_read_isac;; + adapter->isac.read_isac = &fcpci_read_isac; adapter->isac.write_isac = &fcpci_write_isac; adapter->isac.read_isac_fifo = &fcpci_read_isac_fifo; adapter->isac.write_isac_fifo = &fcpci_write_isac_fifo; @@ -780,7 +780,7 @@ adapter->write_ctrl = &fcpci_write_ctrl; break; case AVM_FRITZ_PNP: - adapter->isac.read_isac = &fcpci_read_isac;; + adapter->isac.read_isac = &fcpci_read_isac; adapter->isac.write_isac = &fcpci_write_isac; adapter->isac.read_isac_fifo = &fcpci_read_isac_fifo; adapter->isac.write_isac_fifo = &fcpci_write_isac_fifo; diff -urN linux-2.6.5-rc3/drivers/isdn/hisax/niccy.c linux-2.6.5/drivers/isdn/hisax/niccy.c --- linux-2.6.5-rc3/drivers/isdn/hisax/niccy.c 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/drivers/isdn/hisax/niccy.c 2004-04-03 20:20:13.000000000 -0800 @@ -271,7 +271,7 @@ } card->para[1] = pnp_port_start(pnp_d, 0); card->para[2] = pnp_port_start(pnp_d, 1); - card->para[0] = pnp_irq(pnp_d, 0);; + card->para[0] = pnp_irq(pnp_d, 0); if (!card->para[0] || !card->para[1] || !card->para[2]) { printk(KERN_ERR "NiccyPnP:some resources are missing %ld/%lx/%lx\n", card->para[0], card->para[1], card->para[2]); diff -urN linux-2.6.5-rc3/drivers/isdn/hisax/nj_s.c linux-2.6.5/drivers/isdn/hisax/nj_s.c --- linux-2.6.5-rc3/drivers/isdn/hisax/nj_s.c 2004-03-10 18:55:24.000000000 -0800 +++ linux-2.6.5/drivers/isdn/hisax/nj_s.c 2004-04-03 20:20:13.000000000 -0800 @@ -80,7 +80,7 @@ printk(KERN_WARNING "nj LOCK_ATOMIC s0val %x->%x\n", cs->hw.njet.last_is0, s0val); spin_unlock_irqrestore(&cs->lock, flags); - return IRQ_HANDLED;; + return IRQ_HANDLED; } cs->hw.njet.irqstat0 = s0val; if ((cs->hw.njet.irqstat0 & NETJET_IRQM0_READ) != diff -urN linux-2.6.5-rc3/drivers/media/video/zoran_driver.c linux-2.6.5/drivers/media/video/zoran_driver.c --- linux-2.6.5-rc3/drivers/media/video/zoran_driver.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/drivers/media/video/zoran_driver.c 2004-04-03 20:20:14.000000000 -0800 @@ -2815,7 +2815,7 @@ fh->jpg_settings.TmpDcm); fmt->fmt.pix.sizeimage = zoran_v4l2_calc_bufsize(&fh-> - jpg_settings);; + jpg_settings); fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_MJPEG; if (fh->jpg_settings.TmpDcm == 1) diff -urN linux-2.6.5-rc3/drivers/mtd/nand/nand.c linux-2.6.5/drivers/mtd/nand/nand.c --- linux-2.6.5-rc3/drivers/mtd/nand/nand.c 2004-03-10 18:55:56.000000000 -0800 +++ linux-2.6.5/drivers/mtd/nand/nand.c 2004-04-03 20:20:15.000000000 -0800 @@ -1060,7 +1060,7 @@ goto out; /* Update written bytes count */ - written += mtd->oobblock;; + written += mtd->oobblock; /* Increment page address */ page++; @@ -1192,7 +1192,7 @@ nand_deselect (); spin_unlock_bh (&this->chip_lock); - ret = instr->state == MTD_ERASE_DONE ? 0 : -EIO;; + ret = instr->state == MTD_ERASE_DONE ? 0 : -EIO; /* Do call back function */ if (!ret && instr->callback) instr->callback (instr); diff -urN linux-2.6.5-rc3/drivers/net/acenic.h linux-2.6.5/drivers/net/acenic.h --- linux-2.6.5-rc3/drivers/net/acenic.h 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/drivers/net/acenic.h 2004-04-03 20:20:15.000000000 -0800 @@ -696,7 +696,7 @@ char name[48]; #ifdef INDEX_DEBUG spinlock_t debug_lock - __attribute__ ((aligned (SMP_CACHE_BYTES)));; + __attribute__ ((aligned (SMP_CACHE_BYTES))); u32 last_tx, last_std_rx, last_mini_rx; #endif struct net_device_stats stats; diff -urN linux-2.6.5-rc3/drivers/net/fealnx.c linux-2.6.5/drivers/net/fealnx.c --- linux-2.6.5-rc3/drivers/net/fealnx.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/net/fealnx.c 2004-04-03 20:20:16.000000000 -0800 @@ -1303,14 +1303,15 @@ /* for the last tx descriptor */ np->tx_ring[i - 1].next_desc = np->tx_ring_dma; np->tx_ring[i - 1].next_desc_logical = &np->tx_ring[0]; - - return; } static int start_tx(struct sk_buff *skb, struct net_device *dev) { struct netdev_private *np = dev->priv; + unsigned long flags; + + spin_lock_irqsave(&np->lock, flags); np->cur_tx_copy->skbuff = skb; @@ -1377,6 +1378,7 @@ writel(0, dev->base_addr + TXPDR); dev->trans_start = jiffies; + spin_unlock_irqrestore(&np->lock, flags); return 0; } @@ -1423,6 +1425,8 @@ unsigned int num_tx = 0; int handled = 0; + spin_lock(&np->lock); + writel(0, dev->base_addr + IMR); ioaddr = dev->base_addr; @@ -1565,6 +1569,8 @@ writel(np->imrvalue, ioaddr + IMR); + spin_unlock(&np->lock); + return IRQ_RETVAL(handled); } diff -urN linux-2.6.5-rc3/drivers/net/hamradio/hdlcdrv.c linux-2.6.5/drivers/net/hamradio/hdlcdrv.c --- linux-2.6.5-rc3/drivers/net/hamradio/hdlcdrv.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/drivers/net/hamradio/hdlcdrv.c 2004-04-03 20:20:16.000000000 -0800 @@ -737,7 +737,7 @@ static const struct hdlcdrv_channel_params dflt_ch_params = { 20, 2, 10, 40, 0 }; - struct hdlcdrv_state *s = dev->priv;; + struct hdlcdrv_state *s = dev->priv; /* * initialize the hdlcdrv_state struct diff -urN linux-2.6.5-rc3/drivers/net/ibmveth.c linux-2.6.5/drivers/net/ibmveth.c --- linux-2.6.5-rc3/drivers/net/ibmveth.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/net/ibmveth.c 2004-04-03 20:20:16.000000000 -0800 @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -60,9 +61,6 @@ #include "ibmveth.h" -#warning remove NO_TCE usage from ibmveth.c -#define NO_TCE PCI_DMA_ERROR_CODE - #define DEBUG 1 #define ibmveth_printk(fmt, args...) \ @@ -407,27 +405,27 @@ static void ibmveth_cleanup(struct ibmveth_adapter *adapter) { if(adapter->buffer_list_addr != NULL) { - if(adapter->buffer_list_dma != NO_TCE) { + if(!vio_dma_mapping_error(adapter->buffer_list_dma)) { vio_unmap_single(adapter->vdev, adapter->buffer_list_dma, 4096, PCI_DMA_BIDIRECTIONAL); - adapter->buffer_list_dma = NO_TCE; + adapter->buffer_list_dma = DMA_ERROR_CODE; } free_page((unsigned long)adapter->buffer_list_addr); adapter->buffer_list_addr = NULL; } if(adapter->filter_list_addr != NULL) { - if(adapter->filter_list_dma != NO_TCE) { + if(!vio_dma_mapping_error(adapter->filter_list_dma)) { vio_unmap_single(adapter->vdev, adapter->filter_list_dma, 4096, PCI_DMA_BIDIRECTIONAL); - adapter->filter_list_dma = NO_TCE; + adapter->filter_list_dma = DMA_ERROR_CODE; } free_page((unsigned long)adapter->filter_list_addr); adapter->filter_list_addr = NULL; } if(adapter->rx_queue.queue_addr != NULL) { - if(adapter->rx_queue.queue_dma != NO_TCE) { + if(!vio_dma_mapping_error(adapter->rx_queue.queue_dma)) { vio_unmap_single(adapter->vdev, adapter->rx_queue.queue_dma, adapter->rx_queue.queue_len, PCI_DMA_BIDIRECTIONAL); - adapter->rx_queue.queue_dma = NO_TCE; + adapter->rx_queue.queue_dma = DMA_ERROR_CODE; } kfree(adapter->rx_queue.queue_addr); adapter->rx_queue.queue_addr = NULL; @@ -476,9 +474,9 @@ adapter->filter_list_dma = vio_map_single(adapter->vdev, adapter->filter_list_addr, 4096, PCI_DMA_BIDIRECTIONAL); adapter->rx_queue.queue_dma = vio_map_single(adapter->vdev, adapter->rx_queue.queue_addr, adapter->rx_queue.queue_len, PCI_DMA_BIDIRECTIONAL); - if((adapter->buffer_list_dma == NO_TCE) || - (adapter->filter_list_dma == NO_TCE) || - (adapter->rx_queue.queue_dma == NO_TCE)) { + if((vio_dma_mapping_error(adapter->buffer_list_dma) ) || + (vio_dma_mapping_error(adapter->filter_list_dma)) || + (vio_dma_mapping_error(adapter->rx_queue.queue_dma))) { ibmveth_error_printk("unable to map filter or buffer list pages\n"); ibmveth_cleanup(adapter); return -ENOMEM; @@ -647,7 +645,7 @@ desc[0].fields.address = vio_map_single(adapter->vdev, skb->data, desc[0].fields.length, PCI_DMA_TODEVICE); desc[0].fields.valid = 1; - if(desc[0].fields.address == NO_TCE) { + if(vio_dma_mapping_error(desc[0].fields.address)) { ibmveth_error_printk("tx: unable to map initial fragment\n"); adapter->tx_map_failed++; adapter->stats.tx_dropped++; @@ -666,7 +664,7 @@ desc[curfrag+1].fields.length = frag->size; desc[curfrag+1].fields.valid = 1; - if(desc[curfrag+1].fields.address == NO_TCE) { + if(vio_dma_mapping_error(desc[curfrag+1].fields.address)) { ibmveth_error_printk("tx: unable to map fragment %d\n", curfrag); adapter->tx_map_failed++; adapter->stats.tx_dropped++; @@ -947,9 +945,9 @@ INIT_WORK(&adapter->replenish_task, (void*)ibmveth_replenish_task, (void*)adapter); - adapter->buffer_list_dma = NO_TCE; - adapter->filter_list_dma = NO_TCE; - adapter->rx_queue.queue_dma = NO_TCE; + adapter->buffer_list_dma = DMA_ERROR_CODE; + adapter->filter_list_dma = DMA_ERROR_CODE; + adapter->rx_queue.queue_dma = DMA_ERROR_CODE; atomic_set(&adapter->not_replenishing, 1); diff -urN linux-2.6.5-rc3/drivers/net/mace.c linux-2.6.5/drivers/net/mace.c --- linux-2.6.5-rc3/drivers/net/mace.c 2004-03-10 18:55:24.000000000 -0800 +++ linux-2.6.5/drivers/net/mace.c 2004-04-03 20:20:16.000000000 -0800 @@ -202,7 +202,7 @@ rc = -ENOMEM; goto err_unmap_tx_dma; } - mp->rx_dma_intr = macio_irq(mdev, 2);; + mp->rx_dma_intr = macio_irq(mdev, 2); mp->tx_cmds = (volatile struct dbdma_cmd *) DBDMA_ALIGN(mp + 1); mp->rx_cmds = mp->tx_cmds + NCMDS_TX * N_TX_RING + 1; diff -urN linux-2.6.5-rc3/drivers/net/sk98lin/skgepnmi.c linux-2.6.5/drivers/net/sk98lin/skgepnmi.c --- linux-2.6.5-rc3/drivers/net/sk98lin/skgepnmi.c 2004-03-10 18:55:36.000000000 -0800 +++ linux-2.6.5/drivers/net/sk98lin/skgepnmi.c 2004-04-03 20:20:16.000000000 -0800 @@ -7684,7 +7684,7 @@ to the low-power state. A miniport driver must always return NDIS_STATUS_SUCCESS to a query of OID_PNP_QUERY_POWER. */ - *pLen = sizeof(SK_DEVICE_POWER_STATE);; + *pLen = sizeof(SK_DEVICE_POWER_STATE); RetCode = SK_PNMI_ERR_OK; break; diff -urN linux-2.6.5-rc3/drivers/net/typhoon.c linux-2.6.5/drivers/net/typhoon.c --- linux-2.6.5-rc3/drivers/net/typhoon.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/net/typhoon.c 2004-04-03 20:20:16.000000000 -0800 @@ -1318,7 +1318,7 @@ tp->rxHiRing.ringBase = (u8 *) tp->shared->rxHi; tp->rxBuffRing.ringBase = (u8 *) tp->shared->rxBuff; tp->cmdRing.ringBase = (u8 *) tp->shared->cmd; - tp->respRing.ringBase = (u8 *) tp->shared->resp;; + tp->respRing.ringBase = (u8 *) tp->shared->resp; tp->txLoRing.writeRegister = TYPHOON_REG_TX_LO_READY; tp->txHiRing.writeRegister = TYPHOON_REG_TX_HI_READY; diff -urN linux-2.6.5-rc3/drivers/net/wan/pc300_drv.c linux-2.6.5/drivers/net/wan/pc300_drv.c --- linux-2.6.5-rc3/drivers/net/wan/pc300_drv.c 2004-03-10 18:55:45.000000000 -0800 +++ linux-2.6.5/drivers/net/wan/pc300_drv.c 2004-04-03 20:20:16.000000000 -0800 @@ -3661,7 +3661,7 @@ release_mem_region(card->hw.falcphys, card->hw.falcsize); } for (i = 0; i < card->hw.nchan; i++) - if (card->chan[i].d.dev); + if (card->chan[i].d.dev) free_netdev(card->chan[i].d.dev); if (card->hw.irq) free_irq(card->hw.irq, card); diff -urN linux-2.6.5-rc3/drivers/net/wireless/arlan-main.c linux-2.6.5/drivers/net/wireless/arlan-main.c --- linux-2.6.5-rc3/drivers/net/wireless/arlan-main.c 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/drivers/net/wireless/arlan-main.c 2004-04-03 20:20:16.000000000 -0800 @@ -1281,7 +1281,7 @@ priv->retransmissions = 0; if (priv->Conf->tx_delay_ms) { - priv->tx_done_delayed = jiffies + (priv->Conf->tx_delay_ms * HZ) / 1000 + 1;; + priv->tx_done_delayed = jiffies + (priv->Conf->tx_delay_ms * HZ) / 1000 + 1; } else { diff -urN linux-2.6.5-rc3/drivers/net/wireless/atmel.c linux-2.6.5/drivers/net/wireless/atmel.c --- linux-2.6.5-rc3/drivers/net/wireless/atmel.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/net/wireless/atmel.c 2004-04-03 20:20:16.000000000 -0800 @@ -537,7 +537,7 @@ int channel; int reg_domain; int tx_rate; - int auto_tx_rate;; + int auto_tx_rate; int rts_threshold; int frag_threshold; int long_retry, short_retry; diff -urN linux-2.6.5-rc3/drivers/net/wireless/hermes.h linux-2.6.5/drivers/net/wireless/hermes.h --- linux-2.6.5-rc3/drivers/net/wireless/hermes.h 2004-03-10 18:55:22.000000000 -0800 +++ linux-2.6.5/drivers/net/wireless/hermes.h 2004-04-03 20:20:16.000000000 -0800 @@ -364,7 +364,7 @@ /* Note that for the next two, the count is in 16-bit words, not bytes */ static inline void hermes_read_words(struct hermes *hw, int off, void *buf, unsigned count) { - off = off << hw->reg_spacing;; + off = off << hw->reg_spacing; if (hw->io_space) { insw(hw->iobase + off, buf, count); diff -urN linux-2.6.5-rc3/drivers/pci/hotplug/cpqphp_core.c linux-2.6.5/drivers/pci/hotplug/cpqphp_core.c --- linux-2.6.5-rc3/drivers/pci/hotplug/cpqphp_core.c 2004-03-10 18:55:20.000000000 -0800 +++ linux-2.6.5/drivers/pci/hotplug/cpqphp_core.c 2004-04-03 20:20:16.000000000 -0800 @@ -1342,7 +1342,7 @@ cpqhp_rom_start = ioremap(ROM_PHY_ADDR, ROM_PHY_LEN); if (!cpqhp_rom_start) { err ("Could not ioremap memory region for ROM\n"); - retval = -EIO;; + retval = -EIO; goto error; } @@ -1353,14 +1353,14 @@ smbios_table = detect_SMBIOS_pointer(cpqhp_rom_start, cpqhp_rom_start + ROM_PHY_LEN); if (!smbios_table) { err ("Could not find the SMBIOS pointer in memory\n"); - retval = -EIO;; + retval = -EIO; goto error; } smbios_start = ioremap(readl(smbios_table + ST_ADDRESS), readw(smbios_table + ST_LENGTH)); if (!smbios_start) { err ("Could not ioremap memory region taken from SMBIOS values\n"); - retval = -EIO;; + retval = -EIO; goto error; } diff -urN linux-2.6.5-rc3/drivers/pci/hotplug/pciehp_hpc.c linux-2.6.5/drivers/pci/hotplug/pciehp_hpc.c --- linux-2.6.5-rc3/drivers/pci/hotplug/pciehp_hpc.c 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/drivers/pci/hotplug/pciehp_hpc.c 2004-04-03 20:20:16.000000000 -0800 @@ -915,7 +915,7 @@ rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_CTRL, temp_word); if (rc) { err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__); - return IRQ_NONE;; + return IRQ_NONE; } temp_word = (temp_word & ~HP_INTR_ENABLE) | 0x00; @@ -923,7 +923,7 @@ rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_CTRL, temp_word); if (rc) { err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__); - return IRQ_NONE;; + return IRQ_NONE; } } diff -urN linux-2.6.5-rc3/drivers/pcmcia/sa1100_pangolin.c linux-2.6.5/drivers/pcmcia/sa1100_pangolin.c --- linux-2.6.5-rc3/drivers/pcmcia/sa1100_pangolin.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/drivers/pcmcia/sa1100_pangolin.c 2004-04-03 20:20:17.000000000 -0800 @@ -54,7 +54,7 @@ pangolin_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state *state) { - unsigned long levels = GPLR;; + unsigned long levels = GPLR; state->detect=((levels & GPIO_PCMCIA_CD)==0)?1:0; state->ready=(levels & GPIO_PCMCIA_IRQ)?1:0; diff -urN linux-2.6.5-rc3/drivers/s390/net/qeth.c linux-2.6.5/drivers/s390/net/qeth.c --- linux-2.6.5-rc3/drivers/s390/net/qeth.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/s390/net/qeth.c 2004-04-03 20:20:17.000000000 -0800 @@ -5930,7 +5930,7 @@ LOW_WATERMARK_PACK); /* first_element is the last buffer that we got back from hydra */ if (!switch_state && !last_pci_hit) - return;; + return; QETH_DBF_CARD3(0, trace, "stchcw", card); if (atomic_swap(&card->outbound_ringbuffer_lock[queue], QETH_LOCK_FLUSH) == QETH_LOCK_UNLOCKED) { @@ -6883,7 +6883,7 @@ card->portname_required = ((!QETH_IDX_NO_PORTNAME_REQUIRED(card->dma_stuff->recbuf)) && - (card->type == QETH_CARD_TYPE_OSAE));; + (card->type == QETH_CARD_TYPE_OSAE)); /* * however, as the portname indication of OSA is wrong, we have to diff -urN linux-2.6.5-rc3/drivers/s390/scsi/zfcp_erp.c linux-2.6.5/drivers/s390/scsi/zfcp_erp.c --- linux-2.6.5-rc3/drivers/s390/scsi/zfcp_erp.c 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/drivers/s390/scsi/zfcp_erp.c 2004-04-03 20:20:17.000000000 -0800 @@ -2706,7 +2706,7 @@ ZFCP_LOG_INFO("error: Exchange of configuration data between " "the adapter %s and the device driver failed.\n", zfcp_get_busid_by_adapter(adapter)); - retval = ZFCP_ERP_FAILED;; + retval = ZFCP_ERP_FAILED; } return retval; diff -urN linux-2.6.5-rc3/drivers/scsi/aic7xxx/aic7770.c linux-2.6.5/drivers/scsi/aic7xxx/aic7770.c --- linux-2.6.5-rc3/drivers/scsi/aic7xxx/aic7770.c 2004-03-10 18:55:51.000000000 -0800 +++ linux-2.6.5/drivers/scsi/aic7xxx/aic7770.c 2004-04-03 20:20:17.000000000 -0800 @@ -64,7 +64,7 @@ static int aic7770_resume(struct ahc_softc *ahc); static int aha2840_load_seeprom(struct ahc_softc *ahc); static ahc_device_setup_t ahc_aic7770_VL_setup; -static ahc_device_setup_t ahc_aic7770_EISA_setup;; +static ahc_device_setup_t ahc_aic7770_EISA_setup; static ahc_device_setup_t ahc_aic7770_setup; struct aic7770_identity aic7770_ident_table[] = diff -urN linux-2.6.5-rc3/drivers/scsi/cpqfcTSinit.c linux-2.6.5/drivers/scsi/cpqfcTSinit.c --- linux-2.6.5-rc3/drivers/scsi/cpqfcTSinit.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/scsi/cpqfcTSinit.c 2004-04-03 20:20:18.000000000 -0800 @@ -216,7 +216,7 @@ cpqfcHBAdata->fcChip.InitializeTachyon = CpqTsInitializeTachLite; cpqfcHBAdata->fcChip.LaserControl = CpqTsLaserControl; cpqfcHBAdata->fcChip.ProcessIMQEntry = CpqTsProcessIMQEntry; - cpqfcHBAdata->fcChip.InitializeFrameManager = CpqTsInitializeFrameManager;; + cpqfcHBAdata->fcChip.InitializeFrameManager = CpqTsInitializeFrameManager; cpqfcHBAdata->fcChip.ReadWriteWWN = CpqTsReadWriteWWN; cpqfcHBAdata->fcChip.ReadWriteNVRAM = CpqTsReadWriteNVRAM; diff -urN linux-2.6.5-rc3/drivers/scsi/dec_esp.c linux-2.6.5/drivers/scsi/dec_esp.c --- linux-2.6.5-rc3/drivers/scsi/dec_esp.c 2004-03-10 18:55:36.000000000 -0800 +++ linux-2.6.5/drivers/scsi/dec_esp.c 2004-04-03 20:20:18.000000000 -0800 @@ -378,7 +378,7 @@ static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd * sp) { - return sp->SCp.this_residual;; + return sp->SCp.this_residual; } static void dma_dump_state(struct NCR_ESP *esp) diff -urN linux-2.6.5-rc3/drivers/scsi/dpt_i2o.c linux-2.6.5/drivers/scsi/dpt_i2o.c --- linux-2.6.5-rc3/drivers/scsi/dpt_i2o.c 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/drivers/scsi/dpt_i2o.c 2004-04-03 20:20:18.000000000 -0800 @@ -2161,7 +2161,7 @@ (adpt_hba*)(host->hostdata[0]) = pHba; pHba->host = host; - host->irq = pHba->pDev->irq;; + host->irq = pHba->pDev->irq; /* no IO ports, so don't have to set host->io_port and * host->n_io_port */ diff -urN linux-2.6.5-rc3/drivers/scsi/gdth.c linux-2.6.5/drivers/scsi/gdth.c --- linux-2.6.5-rc3/drivers/scsi/gdth.c 2004-03-10 18:55:34.000000000 -0800 +++ linux-2.6.5/drivers/scsi/gdth.c 2004-04-03 20:20:19.000000000 -0800 @@ -1358,7 +1358,7 @@ /* disable board interrupts, deinit services */ gdth_writeb(0xff, &dp6_ptr->io.irqdel); - gdth_writeb(0x00, &dp6_ptr->io.irqen);; + gdth_writeb(0x00, &dp6_ptr->io.irqen); gdth_writeb(0x00, &dp6_ptr->u.ic.S_Status); gdth_writeb(0x00, &dp6_ptr->u.ic.Cmd_Index); diff -urN linux-2.6.5-rc3/drivers/scsi/i91uscsi.c linux-2.6.5/drivers/scsi/i91uscsi.c --- linux-2.6.5-rc3/drivers/scsi/i91uscsi.c 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/drivers/scsi/i91uscsi.c 2004-04-03 20:20:19.000000000 -0800 @@ -2133,7 +2133,7 @@ tul_append_done_scb(pCurHcb, pCurScb); } for (i = 0; i < pCurHcb->HCS_MaxTar; i++) { - pCurHcb->HCS_Tcs[i].TCS_Flags &= ~(TCF_SYNC_DONE | TCF_WDTR_DONE);; + pCurHcb->HCS_Tcs[i].TCS_Flags &= ~(TCF_SYNC_DONE | TCF_WDTR_DONE); } return (-1); } diff -urN linux-2.6.5-rc3/drivers/scsi/in2000.c linux-2.6.5/drivers/scsi/in2000.c --- linux-2.6.5-rc3/drivers/scsi/in2000.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/drivers/scsi/in2000.c 2004-04-03 20:20:19.000000000 -0800 @@ -2288,7 +2288,7 @@ return 0; /* return 0 to signal end-of-file */ } if (off > 0x40000) /* ALWAYS stop after 256k bytes have been read */ - stop = 1;; + stop = 1; if (hd->proc & PR_STOP) /* stop every other time */ stop = 1; return strlen(bp); diff -urN linux-2.6.5-rc3/drivers/scsi/mac53c94.c linux-2.6.5/drivers/scsi/mac53c94.c --- linux-2.6.5-rc3/drivers/scsi/mac53c94.c 2004-03-10 18:55:22.000000000 -0800 +++ linux-2.6.5/drivers/scsi/mac53c94.c 2004-04-03 20:20:19.000000000 -0800 @@ -25,8 +25,11 @@ #include #include -#include "scsi.h" -#include "hosts.h" +#include +#include +#include +#include + #include "mac53c94.h" enum fsc_phase { @@ -44,9 +47,9 @@ int dmaintr; int clk_freq; struct Scsi_Host *host; - Scsi_Cmnd *request_q; - Scsi_Cmnd *request_qtail; - Scsi_Cmnd *current_req; /* req we're currently working on */ + struct scsi_cmnd *request_q; + struct scsi_cmnd *request_qtail; + struct scsi_cmnd *current_req; /* req we're currently working on */ enum fsc_phase phase; /* what we're currently trying to do */ struct dbdma_cmd *dma_cmds; /* space for dbdma commands, aligned */ void *dma_cmd_space; @@ -60,15 +63,15 @@ static void mac53c94_interrupt(int, void *, struct pt_regs *); static irqreturn_t do_mac53c94_interrupt(int, void *, struct pt_regs *); static void cmd_done(struct fsc_state *, int result); -static void set_dma_cmds(struct fsc_state *, Scsi_Cmnd *); +static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *); -static int mac53c94_queue(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) +static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct fsc_state *state; #if 0 - if (cmd->sc_data_direction == SCSI_DATA_WRITE) { + if (cmd->sc_data_direction == DMA_TO_DEVICE) { int i; printk(KERN_DEBUG "mac53c94_queue %p: command is", cmd); for (i = 0; i < cmd->cmd_len; ++i) @@ -95,12 +98,12 @@ return 0; } -static int mac53c94_abort(Scsi_Cmnd *cmd) +static int mac53c94_abort(struct scsi_cmnd *cmd) { - return SCSI_ABORT_SNOOZE; + return FAILED; } -static int mac53c94_host_reset(Scsi_Cmnd *cmd) +static int mac53c94_host_reset(struct scsi_cmnd *cmd) { struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata; struct mac53c94_regs *regs = state->regs; @@ -139,7 +142,7 @@ */ static void mac53c94_start(struct fsc_state *state) { - Scsi_Cmnd *cmd; + struct scsi_cmnd *cmd; struct mac53c94_regs *regs = state->regs; int i; @@ -148,7 +151,7 @@ if (state->request_q == NULL) return; state->current_req = cmd = state->request_q; - state->request_q = (Scsi_Cmnd *) cmd->host_scribble; + state->request_q = (struct scsi_cmnd *) cmd->host_scribble; /* Off we go */ writeb(0, ®s->count_lo); @@ -190,10 +193,9 @@ struct fsc_state *state = (struct fsc_state *) dev_id; struct mac53c94_regs *regs = state->regs; struct dbdma_regs *dma = state->dma; - Scsi_Cmnd *cmd = state->current_req; + struct scsi_cmnd *cmd = state->current_req; int nb, stat, seq, intr; static int mac53c94_errors; - int dma_dir; /* * Apparently, reading the interrupt register unlatches @@ -308,14 +310,13 @@ printk(KERN_DEBUG "intr %x before data xfer complete\n", intr); } writel(RUN << 16, &dma->control); /* stop dma */ - dma_dir = scsi_to_pci_dma_dir(cmd->sc_data_direction); if (cmd->use_sg != 0) { pci_unmap_sg(state->pdev, (struct scatterlist *)cmd->request_buffer, - cmd->use_sg, dma_dir); + cmd->use_sg, cmd->sc_data_direction); } else { pci_unmap_single(state->pdev, state->dma_addr, - cmd->request_bufflen, dma_dir); + cmd->request_bufflen, cmd->sc_data_direction); } /* should check dma status */ writeb(CMD_I_COMPLETE, ®s->command); @@ -347,7 +348,7 @@ static void cmd_done(struct fsc_state *state, int result) { - Scsi_Cmnd *cmd; + struct scsi_cmnd *cmd; cmd = state->current_req; if (cmd != 0) { @@ -362,24 +363,24 @@ /* * Set up DMA commands for transferring data. */ -static void set_dma_cmds(struct fsc_state *state, Scsi_Cmnd *cmd) +static void set_dma_cmds(struct fsc_state *state, struct scsi_cmnd *cmd) { int i, dma_cmd, total; struct scatterlist *scl; struct dbdma_cmd *dcmds; dma_addr_t dma_addr; u32 dma_len; - int dma_dir = scsi_to_pci_dma_dir(cmd->sc_data_direction); - dma_cmd = cmd->sc_data_direction == SCSI_DATA_WRITE? OUTPUT_MORE: - INPUT_MORE; + dma_cmd = cmd->sc_data_direction == DMA_TO_DEVICE ? + OUTPUT_MORE : INPUT_MORE; dcmds = state->dma_cmds; if (cmd->use_sg > 0) { int nseg; total = 0; scl = (struct scatterlist *) cmd->buffer; - nseg = pci_map_sg(state->pdev, scl, cmd->use_sg, dma_dir); + nseg = pci_map_sg(state->pdev, scl, cmd->use_sg, + cmd->sc_data_direction); for (i = 0; i < nseg; ++i) { dma_addr = sg_dma_address(scl); dma_len = sg_dma_len(scl); @@ -398,7 +399,7 @@ if (total > 0xffff) panic("mac53c94: transfer size >= 64k"); dma_addr = pci_map_single(state->pdev, cmd->request_buffer, - total, dma_dir); + total, cmd->sc_data_direction); state->dma_addr = dma_addr; st_le16(&dcmds->req_count, total); st_le32(&dcmds->phy_addr, dma_addr); @@ -411,7 +412,7 @@ cmd->SCp.this_residual = total; } -static Scsi_Host_Template mac53c94_template = { +static struct scsi_host_template mac53c94_template = { .proc_name = "53c94", .name = "53C94", .queuecommand = mac53c94_queue, diff -urN linux-2.6.5-rc3/drivers/scsi/mesh.c linux-2.6.5/drivers/scsi/mesh.c --- linux-2.6.5-rc3/drivers/scsi/mesh.c 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/drivers/scsi/mesh.c 2004-04-03 20:20:19.000000000 -0800 @@ -44,8 +44,11 @@ #include #include -#include "scsi.h" -#include "hosts.h" +#include +#include +#include +#include + #include "mesh.h" #if 1 @@ -131,7 +134,7 @@ enum sdtr_phase sdtr_state; int sync_params; int data_goes_out; /* guess as to data direction */ - Scsi_Cmnd *current_req; + struct scsi_cmnd *current_req; u32 saved_ptr; #ifdef MESH_DBG int log_ix; @@ -147,12 +150,12 @@ int dmaintr; struct Scsi_Host *host; struct mesh_state *next; - Scsi_Cmnd *request_q; - Scsi_Cmnd *request_qtail; + struct scsi_cmnd *request_q; + struct scsi_cmnd *request_qtail; enum mesh_phase phase; /* what we're currently trying to do */ enum msg_phase msgphase; int conn_tgt; /* target we're connected to */ - Scsi_Cmnd *current_req; /* req we're currently working on */ + struct scsi_cmnd *current_req; /* req we're currently working on */ int data_ptr; int dma_started; int dma_count; @@ -185,7 +188,7 @@ static void mesh_done(struct mesh_state *ms, int start_next); static void mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs); static void cmd_complete(struct mesh_state *ms); -static void set_dma_cmds(struct mesh_state *ms, Scsi_Cmnd *cmd); +static void set_dma_cmds(struct mesh_state *ms, struct scsi_cmnd *cmd); static void halt_dma(struct mesh_state *ms); static void phase_mismatch(struct mesh_state *ms); @@ -344,7 +347,7 @@ /* * Complete a SCSI command */ -static void mesh_completed(struct mesh_state *ms, Scsi_Cmnd *cmd) +static void mesh_completed(struct mesh_state *ms, struct scsi_cmnd *cmd) { (*cmd->scsi_done)(cmd); } @@ -402,14 +405,14 @@ } -static void mesh_start_cmd(struct mesh_state *ms, Scsi_Cmnd *cmd) +static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd) { volatile struct mesh_regs *mr = ms->mesh; int t, id; id = cmd->device->id; ms->current_req = cmd; - ms->tgts[id].data_goes_out = cmd->sc_data_direction == SCSI_DATA_WRITE; + ms->tgts[id].data_goes_out = cmd->sc_data_direction == DMA_TO_DEVICE; ms->tgts[id].current_req = cmd; #if 1 @@ -558,7 +561,7 @@ */ static void mesh_start(struct mesh_state *ms) { - Scsi_Cmnd *cmd, *prev, *next; + struct scsi_cmnd *cmd, *prev, *next; if (ms->phase != idle || ms->current_req != NULL) { printk(KERN_ERR "inappropriate mesh_start (phase=%d, ms=%p)", @@ -568,14 +571,14 @@ while (ms->phase == idle) { prev = NULL; - for (cmd = ms->request_q; ; cmd = (Scsi_Cmnd *) cmd->host_scribble) { + for (cmd = ms->request_q; ; cmd = (struct scsi_cmnd *) cmd->host_scribble) { if (cmd == NULL) return; if (ms->tgts[cmd->device->id].current_req == NULL) break; prev = cmd; } - next = (Scsi_Cmnd *) cmd->host_scribble; + next = (struct scsi_cmnd *) cmd->host_scribble; if (prev == NULL) ms->request_q = next; else @@ -589,7 +592,7 @@ static void mesh_done(struct mesh_state *ms, int start_next) { - Scsi_Cmnd *cmd; + struct scsi_cmnd *cmd; struct mesh_target *tp = &ms->tgts[ms->conn_tgt]; cmd = ms->current_req; @@ -679,7 +682,7 @@ int i, seq, nb; volatile struct mesh_regs *mr = ms->mesh; volatile struct dbdma_regs *md = ms->dma; - Scsi_Cmnd *cmd = ms->current_req; + struct scsi_cmnd *cmd = ms->current_req; struct mesh_target *tp = &ms->tgts[ms->conn_tgt]; dlog(ms, "start_phase nmo/exc/fc/seq = %.8x", @@ -854,7 +857,7 @@ static void reselected(struct mesh_state *ms) { volatile struct mesh_regs *mr = ms->mesh; - Scsi_Cmnd *cmd; + struct scsi_cmnd *cmd; struct mesh_target *tp; int b, t, prev; @@ -985,7 +988,7 @@ { int tgt; struct mesh_target *tp; - Scsi_Cmnd *cmd; + struct scsi_cmnd *cmd; volatile struct mesh_regs *mr = ms->mesh; for (tgt = 0; tgt < 8; ++tgt) { @@ -1000,7 +1003,7 @@ } ms->current_req = NULL; while ((cmd = ms->request_q) != NULL) { - ms->request_q = (Scsi_Cmnd *) cmd->host_scribble; + ms->request_q = (struct scsi_cmnd *) cmd->host_scribble; cmd->result = DID_RESET << 16; mesh_completed(ms, cmd); } @@ -1154,7 +1157,7 @@ static void handle_msgin(struct mesh_state *ms) { int i, code; - Scsi_Cmnd *cmd = ms->current_req; + struct scsi_cmnd *cmd = ms->current_req; struct mesh_target *tp = &ms->tgts[ms->conn_tgt]; if (ms->n_msgin == 0) @@ -1252,7 +1255,7 @@ /* * Set up DMA commands for transferring data. */ -static void set_dma_cmds(struct mesh_state *ms, Scsi_Cmnd *cmd) +static void set_dma_cmds(struct mesh_state *ms, struct scsi_cmnd *cmd) { int i, dma_cmd, total, off, dtot; struct scatterlist *scl; @@ -1270,7 +1273,7 @@ scl = (struct scatterlist *) cmd->buffer; off = ms->data_ptr; nseg = pci_map_sg(ms->pdev, scl, cmd->use_sg, - scsi_to_pci_dma_dir(cmd ->sc_data_direction)); + cmd->sc_data_direction); for (i = 0; i dma; volatile struct mesh_regs *mr = ms->mesh; - Scsi_Cmnd *cmd = ms->current_req; + struct scsi_cmnd *cmd = ms->current_req; int t, nb; if (!ms->tgts[ms->conn_tgt].data_goes_out) { @@ -1364,8 +1367,7 @@ if (cmd->use_sg != 0) { struct scatterlist *sg; sg = (struct scatterlist *)cmd->request_buffer; - pci_unmap_sg(ms->pdev, sg, cmd->use_sg, - scsi_to_pci_dma_dir(cmd->sc_data_direction)); + pci_unmap_sg(ms->pdev, sg, cmd->use_sg, cmd->sc_data_direction); } ms->dma_started = 0; } @@ -1452,7 +1454,7 @@ static void cmd_complete(struct mesh_state *ms) { volatile struct mesh_regs *mr = ms->mesh; - Scsi_Cmnd *cmd = ms->current_req; + struct scsi_cmnd *cmd = ms->current_req; struct mesh_target *tp = &ms->tgts[ms->conn_tgt]; int seq, n, t; @@ -1635,7 +1637,7 @@ * Called by midlayer with host locked to queue a new * request */ -static int mesh_queue(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) +static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct mesh_state *ms; @@ -1692,7 +1694,7 @@ * queue if it isn't connected yet, and for pending command, assert * ATN until the bus gets freed. */ -static int mesh_abort(Scsi_Cmnd *cmd) +static int mesh_abort(struct scsi_cmnd *cmd) { struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata; @@ -1700,7 +1702,7 @@ mesh_dump_regs(ms); dumplog(ms, cmd->device->id); dumpslog(ms); - return SCSI_ABORT_SNOOZE; + return FAILED; } /* @@ -1709,7 +1711,7 @@ * The midlayer will wait for devices to come back, we don't need * to do that ourselves */ -static int mesh_host_reset(Scsi_Cmnd *cmd) +static int mesh_host_reset(struct scsi_cmnd *cmd) { struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata; volatile struct mesh_regs *mr = ms->mesh; @@ -1832,7 +1834,7 @@ return 0; } -static Scsi_Host_Template mesh_template = { +static struct scsi_host_template mesh_template = { .proc_name = "mesh", .name = "MESH", .queuecommand = mesh_queue, diff -urN linux-2.6.5-rc3/drivers/scsi/pci2000.c linux-2.6.5/drivers/scsi/pci2000.c --- linux-2.6.5-rc3/drivers/scsi/pci2000.c 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/drivers/scsi/pci2000.c 2004-04-03 20:20:19.000000000 -0800 @@ -320,7 +320,7 @@ outb_p (0xFF, padapter->tag); // clear the op interrupt outb_p (CMD_DONE, padapter->cmd); // complete the op - goto irq_return;; // done, but, with what? + goto irq_return; // done, but, with what? unmapProceed:; if ( !bus ) diff -urN linux-2.6.5-rc3/drivers/scsi/pci2220i.c linux-2.6.5/drivers/scsi/pci2220i.c --- linux-2.6.5-rc3/drivers/scsi/pci2220i.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/drivers/scsi/pci2220i.c 2004-04-03 20:20:19.000000000 -0800 @@ -1389,7 +1389,7 @@ (pdev->DiskMirror[0].pairIdentifier == (pdev->DiskMirror[1].pairIdentifier ^ 1)) ) { if ( (pdev->DiskMirror[0].status & UCBF_MATCHED) && (pdev->DiskMirror[1].status & UCBF_MATCHED) ) - break;; + break; if ( pdev->DiskMirror[0].status & UCBF_SURVIVOR ) // is first drive survivor? testsize = SetReconstruct (pdev, 0); @@ -2613,7 +2613,7 @@ if ( ++Installed < MAXADAPTER ) continue; - break;; + break; unregister:; scsi_unregister (pshost); } @@ -2747,7 +2747,7 @@ if ( ++Installed < MAXADAPTER ) continue; - break;; + break; unregister1:; scsi_unregister (pshost); } diff -urN linux-2.6.5-rc3/drivers/scsi/qlogicfas.c linux-2.6.5/drivers/scsi/qlogicfas.c --- linux-2.6.5-rc3/drivers/scsi/qlogicfas.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/scsi/qlogicfas.c 2004-04-03 20:20:19.000000000 -0800 @@ -501,7 +501,7 @@ release_region(qbase, 0x10); } if (qbase == 0x430) - return NULL;; + return NULL; } else printk(KERN_INFO "Ql: Using preset base address of %03x\n", qbase); diff -urN linux-2.6.5-rc3/drivers/scsi/qlogicfc.c linux-2.6.5/drivers/scsi/qlogicfc.c --- linux-2.6.5-rc3/drivers/scsi/qlogicfc.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/drivers/scsi/qlogicfc.c 2004-04-03 20:20:19.000000000 -0800 @@ -1778,7 +1778,7 @@ LEAVE("isp2x00_reset"); - return return_status;; + return return_status; } diff -urN linux-2.6.5-rc3/drivers/scsi/qlogicisp.c linux-2.6.5/drivers/scsi/qlogicisp.c --- linux-2.6.5-rc3/drivers/scsi/qlogicisp.c 2004-03-10 18:55:51.000000000 -0800 +++ linux-2.6.5/drivers/scsi/qlogicisp.c 2004-04-03 20:20:20.000000000 -0800 @@ -1230,7 +1230,7 @@ LEAVE("isp1020_reset"); - return return_status;; + return return_status; } diff -urN linux-2.6.5-rc3/drivers/scsi/sata_via.c linux-2.6.5/drivers/scsi/sata_via.c --- linux-2.6.5-rc3/drivers/scsi/sata_via.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/scsi/sata_via.c 2004-04-03 20:20:20.000000000 -0800 @@ -39,9 +39,10 @@ enum { via_sata = 0, - SATA_CHAN_ENAB = 0x40, - SATA_INT_GATE = 0x41, - SATA_NATIVE_MODE = 0x42, + SATA_CHAN_ENAB = 0x40, /* SATA channel enable */ + SATA_INT_GATE = 0x41, /* SATA interrupt gating */ + SATA_NATIVE_MODE = 0x42, /* Native mode enable */ + SATA_PATA_SHARING = 0x49, /* PATA/SATA sharing func ctrl */ PORT0 = (1 << 1), PORT1 = (1 << 0), @@ -51,6 +52,9 @@ INT_GATE_ALL = PORT0 | PORT1, NATIVE_MODE_ALL = (1 << 7) | (1 << 6) | (1 << 5) | (1 << 4), + + SATA_EXT_PHY = (1 << 6), /* 0==use PATA, 1==ext phy */ + SATA_2DEV = (1 << 5), /* SATA is master/slave */ }; static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); @@ -136,13 +140,7 @@ static unsigned long svia_scr_addr(unsigned long addr, unsigned int port) { - if (port >= 4) - return 0; /* invalid port */ - - addr &= ~((1 << 7) | (1 << 6)); - addr |= ((unsigned long)port << 6); - - return addr; + return addr + (port * 128); } /** @@ -175,6 +173,13 @@ if (rc) goto err_out; + pci_read_config_byte(pdev, SATA_PATA_SHARING, &tmp8); + if (tmp8 & SATA_2DEV) { + printk(KERN_ERR DRV_NAME "(%s): SATA master/slave not supported (0x%x)\n", + pci_name(pdev), (int) tmp8); + rc = -EIO; + goto err_out_regions; + } for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++) if ((pci_resource_start(pdev, i) == 0) || diff -urN linux-2.6.5-rc3/drivers/scsi/scsiiom.c linux-2.6.5/drivers/scsi/scsiiom.c --- linux-2.6.5-rc3/drivers/scsi/scsiiom.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/drivers/scsi/scsiiom.c 2004-04-03 20:20:21.000000000 -0800 @@ -1674,7 +1674,7 @@ #endif psrb = psrb2; } - pdcb->GoingSRBCnt = 0;; + pdcb->GoingSRBCnt = 0; pdcb->pGoingSRB = NULL; pdcb->TagMask = 0; pdcb = pdcb->pNextDCB; diff -urN linux-2.6.5-rc3/drivers/scsi/wd33c93.c linux-2.6.5/drivers/scsi/wd33c93.c --- linux-2.6.5-rc3/drivers/scsi/wd33c93.c 2004-03-10 18:55:36.000000000 -0800 +++ linux-2.6.5/drivers/scsi/wd33c93.c 2004-04-03 20:20:22.000000000 -0800 @@ -2056,7 +2056,7 @@ return 0; } if (off > 0x40000) /* ALWAYS stop after 256k bytes have been read */ - stop = 1;; + stop = 1; if (hd->proc & PR_STOP) /* stop every other time */ stop = 1; return strlen(bp); diff -urN linux-2.6.5-rc3/drivers/usb/media/se401.c linux-2.6.5/drivers/usb/media/se401.c --- linux-2.6.5-rc3/drivers/usb/media/se401.c 2004-03-10 18:55:24.000000000 -0800 +++ linux-2.6.5/drivers/usb/media/se401.c 2004-04-03 20:20:24.000000000 -0800 @@ -369,7 +369,7 @@ se401->scratch_overflow=0; se401->scratch_next++; if (se401->scratch_next>=SE401_NUMSCRATCH) - se401->scratch_next=0;; + se401->scratch_next=0; break; } } diff -urN linux-2.6.5-rc3/drivers/usb/media/stv680.c linux-2.6.5/drivers/usb/media/stv680.c --- linux-2.6.5-rc3/drivers/usb/media/stv680.c 2004-03-10 18:55:36.000000000 -0800 +++ linux-2.6.5/drivers/usb/media/stv680.c 2004-04-03 20:20:24.000000000 -0800 @@ -641,7 +641,7 @@ stv680->scratch_overflow = 0; stv680->scratch_next++; if (stv680->scratch_next >= STV680_NUMSCRATCH) - stv680->scratch_next = 0;; + stv680->scratch_next = 0; break; } /* switch */ } else { diff -urN linux-2.6.5-rc3/drivers/usb/serial/empeg.c linux-2.6.5/drivers/usb/serial/empeg.c --- linux-2.6.5-rc3/drivers/usb/serial/empeg.c 2004-03-10 18:55:51.000000000 -0800 +++ linux-2.6.5/drivers/usb/serial/empeg.c 2004-04-03 20:20:24.000000000 -0800 @@ -155,7 +155,7 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp) { struct usb_serial *serial = port->serial; - int result = 0;; + int result = 0; if (port_paranoia_check (port, __FUNCTION__)) return -ENODEV; diff -urN linux-2.6.5-rc3/drivers/usb/serial/mct_u232.c linux-2.6.5/drivers/usb/serial/mct_u232.c --- linux-2.6.5-rc3/drivers/usb/serial/mct_u232.c 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/drivers/usb/serial/mct_u232.c 2004-04-03 20:20:25.000000000 -0800 @@ -511,7 +511,7 @@ /* only do something if we have a bulk out endpoint */ if (!serial->num_bulk_out) - return(0);; + return(0); /* another write is still pending? */ if (port->write_urb->status == -EINPROGRESS) { diff -urN linux-2.6.5-rc3/drivers/video/aty/radeon_monitor.c linux-2.6.5/drivers/video/aty/radeon_monitor.c --- linux-2.6.5-rc3/drivers/video/aty/radeon_monitor.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/video/aty/radeon_monitor.c 2004-04-03 20:20:25.000000000 -0800 @@ -640,21 +640,21 @@ #ifdef CONFIG_PPC_OF /* iBook2's */ if (machine_is_compatible("PowerBook4,3")) { - rinfo->panel_info.ref_divider = rinfo->pll.ref_div;; + rinfo->panel_info.ref_divider = rinfo->pll.ref_div; rinfo->panel_info.post_divider = 0x6; rinfo->panel_info.fbk_divider = 0xad; rinfo->panel_info.use_bios_dividers = 1; } /* Aluminium PowerBook 17" */ if (machine_is_compatible("PowerBook5,3")) { - rinfo->panel_info.ref_divider = rinfo->pll.ref_div;; + rinfo->panel_info.ref_divider = rinfo->pll.ref_div; rinfo->panel_info.post_divider = 0x4; rinfo->panel_info.fbk_divider = 0x80; rinfo->panel_info.use_bios_dividers = 1; } /* iBook G4 */ if (machine_is_compatible("PowerBook6,3")) { - rinfo->panel_info.ref_divider = rinfo->pll.ref_div;; + rinfo->panel_info.ref_divider = rinfo->pll.ref_div; rinfo->panel_info.post_divider = 0x6; rinfo->panel_info.fbk_divider = 0xad; rinfo->panel_info.use_bios_dividers = 1; diff -urN linux-2.6.5-rc3/drivers/video/fbmon.c linux-2.6.5/drivers/video/fbmon.c --- linux-2.6.5-rc3/drivers/video/fbmon.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/drivers/video/fbmon.c 2004-04-03 20:20:25.000000000 -0800 @@ -899,7 +899,7 @@ */ static u32 fb_get_hblank_by_dclk(u32 dclk, u32 xres) { - u32 duty_cycle, h_period, hblank;; + u32 duty_cycle, h_period, hblank; dclk /= 1000; h_period = 100 - C_VAL; diff -urN linux-2.6.5-rc3/drivers/video/i810/i810_main.c linux-2.6.5/drivers/video/i810/i810_main.c --- linux-2.6.5-rc3/drivers/video/i810/i810_main.c 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/drivers/video/i810/i810_main.c 2004-04-03 20:20:25.000000000 -0800 @@ -281,7 +281,7 @@ static void i810_load_2d(struct i810fb_par *par) { u32 tmp; - u8 tmp8, *mmio = par->mmio_start_virtual;; + u8 tmp8, *mmio = par->mmio_start_virtual; i810_writel(FW_BLC, mmio, par->watermark); tmp = i810_readl(PIXCONF, mmio); diff -urN linux-2.6.5-rc3/drivers/video/sis/init301.c linux-2.6.5/drivers/video/sis/init301.c --- linux-2.6.5-rc3/drivers/video/sis/init301.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/drivers/video/sis/init301.c 2004-04-03 20:20:25.000000000 -0800 @@ -2313,7 +2313,7 @@ #ifdef SIS315H - unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01);; + unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); /* The following is nearly unpreditable and varies from machine * to machine. Especially the 301DH seems to be a real trouble diff -urN linux-2.6.5-rc3/fs/aio.c linux-2.6.5/fs/aio.c --- linux-2.6.5-rc3/fs/aio.c 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/fs/aio.c 2004-04-03 20:20:25.000000000 -0800 @@ -798,8 +798,8 @@ static int read_events(struct kioctx *ctx, long min_nr, long nr, - struct io_event *event, - struct timespec *timeout) + struct io_event __user *event, + struct timespec __user *timeout) { long start_jiffies = jiffies; struct task_struct *tsk = current; @@ -991,7 +991,7 @@ struct kiocb *req; struct file *file; ssize_t ret; - char *buf; + char __user *buf; /* enforce forwards compatibility on users */ if (unlikely(iocb->aio_reserved1 || iocb->aio_reserved2 || @@ -1032,7 +1032,7 @@ req->ki_user_data = iocb->aio_data; req->ki_pos = iocb->aio_offset; - buf = (char *)(unsigned long)iocb->aio_buf; + buf = (char __user *)(unsigned long)iocb->aio_buf; switch (iocb->aio_lio_opcode) { case IOCB_CMD_PREAD: @@ -1148,7 +1148,7 @@ * Finds a given iocb for cancellation. * MUST be called with ctx->ctx_lock held. */ -struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb *iocb, u32 key) +struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, u32 key) { struct list_head *pos; /* TODO: use a hash or array, this sucks. */ @@ -1170,8 +1170,8 @@ * invalid. May fail with -EAGAIN if the iocb specified was not * cancelled. Will fail with -ENOSYS if not implemented. */ -asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb *iocb, - struct io_event *result) +asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, + struct io_event __user *result) { int (*cancel)(struct kiocb *iocb, struct io_event *res); struct kioctx *ctx; @@ -1234,17 +1234,15 @@ asmlinkage long sys_io_getevents(aio_context_t ctx_id, long min_nr, long nr, - struct io_event *events, - struct timespec *timeout) + struct io_event __user *events, + struct timespec __user *timeout) { struct kioctx *ioctx = lookup_ioctx(ctx_id); long ret = -EINVAL; - if (unlikely(min_nr > nr || min_nr < 0 || nr < 0)) - return ret; - - if (likely(NULL != ioctx)) { - ret = read_events(ioctx, min_nr, nr, events, timeout); + if (likely(ioctx)) { + if (likely(min_nr <= nr && min_nr >= 0 && nr >= 0)) + ret = read_events(ioctx, min_nr, nr, events, timeout); put_ioctx(ioctx); } diff -urN linux-2.6.5-rc3/fs/bio.c linux-2.6.5/fs/bio.c --- linux-2.6.5-rc3/fs/bio.c 2004-03-10 18:55:33.000000000 -0800 +++ linux-2.6.5/fs/bio.c 2004-04-03 20:20:25.000000000 -0800 @@ -701,11 +701,12 @@ { struct bio_pair *bp = container_of(bi, struct bio_pair, bio1); - if (bi->bi_size) - return 1; if (err) bp->error = err; + if (bi->bi_size) + return 1; + bio_pair_release(bp); return 0; } @@ -714,11 +715,12 @@ { struct bio_pair *bp = container_of(bi, struct bio_pair, bio2); - if (bi->bi_size) - return 1; if (err) bp->error = err; + if (bi->bi_size) + return 1; + bio_pair_release(bp); return 0; } diff -urN linux-2.6.5-rc3/fs/cifs/connect.c linux-2.6.5/fs/cifs/connect.c --- linux-2.6.5-rc3/fs/cifs/connect.c 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.5/fs/cifs/connect.c 2004-04-03 20:20:25.000000000 -0800 @@ -116,7 +116,7 @@ if(server->ssocket) { cFYI(1,("State: 0x%x Flags: 0x%lx", server->ssocket->state, server->ssocket->flags)); - server->ssocket->ops->shutdown(server->ssocket,SEND_SHUTDOWN);; + server->ssocket->ops->shutdown(server->ssocket,SEND_SHUTDOWN); cFYI(1,("Post shutdown state: 0x%x Flags: 0x%lx", server->ssocket->state, server->ssocket->flags)); sock_release(server->ssocket); diff -urN linux-2.6.5-rc3/fs/intermezzo/file.c linux-2.6.5/fs/intermezzo/file.c --- linux-2.6.5-rc3/fs/intermezzo/file.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/fs/intermezzo/file.c 2004-04-03 20:20:25.000000000 -0800 @@ -82,7 +82,7 @@ info.remote_generation = dd->remote_generation; } else CERROR("get_fileid failed %d, ino: %Lx, fetching by name\n", rc, - dd->remote_ino); + (unsigned long long) dd->remote_ino); rc = izo_upc_open(minor, pathlen, path, fset->fset_name, &info); PRESTO_FREE(buffer, PAGE_SIZE); @@ -380,7 +380,7 @@ << file->f_dentry->d_inode->i_sb->s_blocksize_bits); error = presto_reserve_space(fset->fset_cache, res_size); - CDEBUG(D_INODE, "Reserved %Ld for %d\n", res_size, size); + CDEBUG(D_INODE, "Reserved %Ld for %Zd\n", res_size, size); if ( error ) { EXIT; return -ENOSPC; @@ -440,7 +440,7 @@ fops = filter_c2cffops(cache->cache_filter); res = fops->write(file, buf, size, off); if ( res != size ) { - CDEBUG(D_FILE, "file write returns short write: size %d, res %d\n", size, res); + CDEBUG(D_FILE, "file write returns short write: size %Zd, res %Zd\n", size, res); } if ( (res > 0) && fdata ) diff -urN linux-2.6.5-rc3/fs/intermezzo/fileset.c linux-2.6.5/fs/intermezzo/fileset.c --- linux-2.6.5-rc3/fs/intermezzo/fileset.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/fs/intermezzo/fileset.c 2004-04-03 20:20:25.000000000 -0800 @@ -647,8 +647,9 @@ CDEBUG(D_FILE,"de:%p dd:%p\n", dentry, dd); if (dd->remote_ino != 0) { - CERROR("remote_ino already set? %Lx:%Lx\n", dd->remote_ino, - dd->remote_generation); + CERROR("remote_ino already set? %Lx:%Lx\n", + (unsigned long long) dd->remote_ino, + (unsigned long long) dd->remote_generation); rc = 0; EXIT; goto out_close; @@ -656,8 +657,9 @@ CDEBUG(D_FILE,"setting %p %p, %s to %Lx:%Lx\n", dentry, dd, - buf, data->ioc_ino, - data->ioc_generation); + buf, + (unsigned long long) data->ioc_ino, + (unsigned long long) data->ioc_generation); dd->remote_ino = data->ioc_ino; dd->remote_generation = data->ioc_generation; diff -urN linux-2.6.5-rc3/fs/intermezzo/journal.c linux-2.6.5/fs/intermezzo/journal.c --- linux-2.6.5-rc3/fs/intermezzo/journal.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/fs/intermezzo/journal.c 2004-04-03 20:20:25.000000000 -0800 @@ -1470,7 +1470,7 @@ return 0; } - CDEBUG(D_JOURNAL, "reading prefix: off %ld, size %d\n", + CDEBUG(D_JOURNAL, "reading prefix: off %ld, size %Zd\n", (long)lml_offset, sizeof(record)); rc = presto_fread(fset->fset_lml.fd_file, (char *)&record, sizeof(record), &offset); @@ -1621,7 +1621,7 @@ /* journal_log_suffix expects journal_log to set this */ suffix->recno = 0; - CDEBUG(D_FILE, "actual kml size: %d\n", logrecord - record); + CDEBUG(D_FILE, "actual kml size: %Zd\n", logrecord - record); CDEBUG(D_FILE, "get fileid: uid %d, gid %d, path: %s\n", uid, gid,path); error = izo_upc_get_fileid(minor, size, record, diff -urN linux-2.6.5-rc3/fs/intermezzo/journal_xfs.c linux-2.6.5/fs/intermezzo/journal_xfs.c --- linux-2.6.5-rc3/fs/intermezzo/journal_xfs.c 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/fs/intermezzo/journal_xfs.c 2004-04-03 20:20:25.000000000 -0800 @@ -57,7 +57,7 @@ VFS_STATVFS(vfsp, &stat, NULL, rc); avail = statp.f_bfree; - return sbp->sb_fdblocks;; + return sbp->sb_fdblocks; #endif return 0x0fffffff; } diff -urN linux-2.6.5-rc3/fs/intermezzo/kml_reint.c linux-2.6.5/fs/intermezzo/kml_reint.c --- linux-2.6.5-rc3/fs/intermezzo/kml_reint.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/fs/intermezzo/kml_reint.c 2004-04-03 20:20:25.000000000 -0800 @@ -162,7 +162,8 @@ */ if (error == ENOENT) { CDEBUG(D_KML, "manually updating remote offset uuid %s" - "recno %d offset %Lu\n", info.uuid, info.recno, info.kml_offset); + "recno %d offset %Lu\n", info.uuid, info.recno, + (unsigned long long) info.kml_offset); error = izo_rcvd_upd_remote(fset, info.uuid, info.recno, info.kml_offset); if(error) CERROR("izo_rcvd_upd_remote error %d\n", error); @@ -528,7 +529,7 @@ if (rec.suffix->recno != lr_rec.lr_remote_recno + 1) { CERROR("KML record number %Lu expected, not %d\n", - lr_rec.lr_remote_recno + 1, + (unsigned long long) (lr_rec.lr_remote_recno + 1), rec.suffix->recno); #if 0 @@ -631,8 +632,9 @@ data->ioc_generation = file->f_dentry->d_inode->i_generation; filp_close(file, 0); - CDEBUG(D_FILE, "%s ino %Lx, gen %Lx\n", rec.path, - data->ioc_ino, data->ioc_generation); + CDEBUG(D_FILE, "%s ino %Lx, gen %Lx\n", rec.path, + (unsigned long long) data->ioc_ino, + (unsigned long long) data->ioc_generation); out: if (buf) diff -urN linux-2.6.5-rc3/fs/intermezzo/psdev.c linux-2.6.5/fs/intermezzo/psdev.c --- linux-2.6.5-rc3/fs/intermezzo/psdev.c 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/fs/intermezzo/psdev.c 2004-04-03 20:20:25.000000000 -0800 @@ -227,7 +227,7 @@ /* move data into response buffer. */ if (req->rq_bufsize < count) { - CERROR("psdev_write: too much cnt: %d, cnt: %d, " + CERROR("psdev_write: too much cnt: %d, cnt: %Zd, " "opc: %d, uniq: %d.\n", req->rq_bufsize, count, hdr.opcode, hdr.unique); count = req->rq_bufsize; /* don't have more space! */ @@ -281,7 +281,7 @@ } if (count < req->rq_bufsize) { - CERROR ("psdev_read: buffer too small, read %d of %d bytes\n", + CERROR ("psdev_read: buffer too small, read %Zd of %d bytes\n", count, req->rq_bufsize); } @@ -592,8 +592,8 @@ req->rq_opcode, jiffies - req->rq_posttime, req->rq_unique, req->rq_rep_size); CDEBUG(D_UPCALL, - "..process %d woken up by Lento for req at 0x%x, data at %x\n", - current->pid, (int)req, (int)req->rq_data); + "..process %d woken up by Lento for req at 0x%p, data at %p\n", + current->pid, req, req->rq_data); if (channel->uc_pid) { /* i.e. Lento is still alive */ /* Op went through, interrupt or not we go on */ diff -urN linux-2.6.5-rc3/fs/intermezzo/upcall.c linux-2.6.5/fs/intermezzo/upcall.c --- linux-2.6.5-rc3/fs/intermezzo/upcall.c 2004-03-10 18:55:54.000000000 -0800 +++ linux-2.6.5/fs/intermezzo/upcall.c 2004-04-03 20:20:25.000000000 -0800 @@ -142,7 +142,10 @@ CDEBUG(D_UPCALL, "KML: fileset %s, offset %Lu, length %Lu, " "first %u, last %d; minor %d\n", - fsetname, hdr->u_offset, hdr->u_length, hdr->u_first_recno, + fsetname, + (unsigned long long) hdr->u_offset, + (unsigned long long) hdr->u_length, + hdr->u_first_recno, hdr->u_last_recno, minor); error = izo_upc_upcall(minor, &size, hdr, ASYNCHRONOUS); @@ -174,7 +177,9 @@ CDEBUG(D_UPCALL, "KML TRUNCATE: fileset %s, length %Lu, " "last recno %d, minor %d\n", - fsetname, hdr->u_length, hdr->u_last_recno, minor); + fsetname, + (unsigned long long) hdr->u_length, + hdr->u_last_recno, minor); error = izo_upc_upcall(minor, &size, hdr, ASYNCHRONOUS); diff -urN linux-2.6.5-rc3/fs/jfs/jfs_logmgr.c linux-2.6.5/fs/jfs/jfs_logmgr.c --- linux-2.6.5-rc3/fs/jfs/jfs_logmgr.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/fs/jfs/jfs_logmgr.c 2004-04-03 20:20:25.000000000 -0800 @@ -1371,14 +1371,13 @@ le32_to_cpu(logsuper->end), log->page, log->eor, le16_to_cpu(lp->h.eor)); - /* if current page is full, move on to next page */ - if (log->eor >= LOGPSIZE - LOGPTLRSIZE) - lmNextPage(log); - log->bp = bp; bp->l_pn = log->page; bp->l_eor = log->eor; + /* if current page is full, move on to next page */ + if (log->eor >= LOGPSIZE - LOGPTLRSIZE) + lmNextPage(log); /* * initialize log syncpoint diff -urN linux-2.6.5-rc3/fs/readdir.c linux-2.6.5/fs/readdir.c --- linux-2.6.5-rc3/fs/readdir.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/fs/readdir.c 2004-04-03 20:20:25.000000000 -0800 @@ -162,7 +162,7 @@ if (__put_user(d_type, (char *) dirent + reclen - 1)) goto efault; buf->previous = dirent; - dirent = (void *)dirent + reclen; + dirent = (void __user *)dirent + reclen; buf->current_dir = dirent; buf->count -= reclen; return 0; @@ -248,7 +248,7 @@ if (__put_user(0, dirent->d_name + namlen)) goto efault; buf->previous = dirent; - dirent = (void *)dirent + reclen; + dirent = (void __user *)dirent + reclen; buf->current_dir = dirent; buf->count -= reclen; return 0; diff -urN linux-2.6.5-rc3/fs/smbfs/sock.c linux-2.6.5/fs/smbfs/sock.c --- linux-2.6.5-rc3/fs/smbfs/sock.c 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/fs/smbfs/sock.c 2004-04-03 20:20:25.000000000 -0800 @@ -350,7 +350,7 @@ fs = get_fs(); set_fs(get_ds()); - flags = MSG_DONTWAIT | MSG_NOSIGNAL;; + flags = MSG_DONTWAIT | MSG_NOSIGNAL; msg.msg_flags = flags; msg.msg_name = NULL; msg.msg_namelen = 0; diff -urN linux-2.6.5-rc3/fs/sysfs/dir.c linux-2.6.5/fs/sysfs/dir.c --- linux-2.6.5-rc3/fs/sysfs/dir.c 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/fs/sysfs/dir.c 2004-04-03 20:20:25.000000000 -0800 @@ -20,18 +20,6 @@ return 0; } -static void sysfs_d_iput(struct dentry * dentry, struct inode * inode) -{ - struct kobject * kobj = dentry->d_fsdata; - - if (kobj) - kobject_put(kobj); - iput(inode); -} - -static struct dentry_operations sysfs_dentry_operations = { - .d_iput = &sysfs_d_iput, -}; static int create_dir(struct kobject * k, struct dentry * p, const char * n, struct dentry ** d) @@ -45,8 +33,7 @@ S_IFDIR| S_IRWXU | S_IRUGO | S_IXUGO, init_dir); if (!error) { - (*d)->d_op = &sysfs_dentry_operations; - (*d)->d_fsdata = kobject_get(k); + (*d)->d_fsdata = k; p->d_inode->i_nlink++; } dput(*d); diff -urN linux-2.6.5-rc3/fs/xfs/linux/kmem.h linux-2.6.5/fs/xfs/linux/kmem.h --- linux-2.6.5-rc3/fs/xfs/linux/kmem.h 2004-03-10 18:55:58.000000000 -0800 +++ linux-2.6.5/fs/xfs/linux/kmem.h 2004-04-03 20:20:25.000000000 -0800 @@ -55,15 +55,23 @@ typedef unsigned long xfs_pflags_t; -#define PFLAGS_TEST_FSTRANS() (current->flags & PF_FSTRANS) +#define PFLAGS_TEST_FSTRANS() (current->flags & PF_FSTRANS) +/* these could be nested, so we save state */ #define PFLAGS_SET_FSTRANS(STATEP) do { \ *(STATEP) = current->flags; \ current->flags |= PF_FSTRANS; \ } while (0) -#define PFLAGS_RESTORE(STATEP) do { \ - current->flags = *(STATEP); \ +#define PFLAGS_CLEAR_FSTRANS(STATEP) do { \ + *(STATEP) = current->flags; \ + current->flags &= ~PF_FSTRANS; \ +} while (0) + +/* Restore the PF_FSTRANS state to what was saved in STATEP */ +#define PFLAGS_RESTORE_FSTRANS(STATEP) do { \ + current->flags = ((current->flags & ~PF_FSTRANS) | \ + (*(STATEP) & PF_FSTRANS)); \ } while (0) #define PFLAGS_DUP(OSTATEP, NSTATEP) do { \ diff -urN linux-2.6.5-rc3/fs/xfs/linux/mrlock.h linux-2.6.5/fs/xfs/linux/mrlock.h --- linux-2.6.5-rc3/fs/xfs/linux/mrlock.h 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/fs/xfs/linux/mrlock.h 2004-04-03 20:20:25.000000000 -0800 @@ -88,6 +88,7 @@ downgrade_write(&mrp->mr_lock); } +#ifdef DEBUG /* * Debug-only routine, without some platform-specific asm code, we can * now only answer requests regarding whether we hold the lock for write @@ -96,9 +97,10 @@ */ static inline int ismrlocked(mrlock_t *mrp, int type) { - if (type == MR_UPDATE) + if (mrp && type == MR_UPDATE) return mrp->mr_writer; return 1; } +#endif #endif /* __XFS_SUPPORT_MRLOCK_H__ */ diff -urN linux-2.6.5-rc3/fs/xfs/linux/xfs_aops.c linux-2.6.5/fs/xfs/linux/xfs_aops.c --- linux-2.6.5-rc3/fs/xfs/linux/xfs_aops.c 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.5/fs/xfs/linux/xfs_aops.c 2004-04-03 20:20:25.000000000 -0800 @@ -717,7 +717,8 @@ struct buffer_head *bh_arr[MAX_BUF_PER_PAGE], *bh, *head; xfs_iomap_t *iomp, iomap; unsigned long p_offset = 0, end_index; - loff_t offset, end_offset; + loff_t offset; + unsigned long long end_offset; int len, err, i, cnt = 0, uptodate = 1; int flags = startio ? 0 : BMAPI_TRYLOCK; int page_dirty = 1; @@ -734,9 +735,8 @@ } offset = (loff_t)page->index << PAGE_CACHE_SHIFT; - end_offset = offset + PAGE_CACHE_SIZE; - if (end_offset > i_size_read(inode)) - end_offset = i_size_read(inode); + end_offset = min_t(unsigned long long, + offset + PAGE_CACHE_SIZE, i_size_read(inode)); bh = head = page_buffers(page); iomp = NULL; diff -urN linux-2.6.5-rc3/fs/xfs/linux/xfs_file.c linux-2.6.5/fs/xfs/linux/xfs_file.c --- linux-2.6.5-rc3/fs/xfs/linux/xfs_file.c 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/fs/xfs/linux/xfs_file.c 2004-04-03 20:20:25.000000000 -0800 @@ -68,16 +68,15 @@ { struct iovec iov = {buf, count}; struct file *file = iocb->ki_filp; - vnode_t *vp; - int error; + vnode_t *vp = LINVFS_GET_VP(file->f_dentry->d_inode); + ssize_t rval; BUG_ON(iocb->ki_pos != pos); if (unlikely(file->f_flags & O_DIRECT)) ioflags |= IO_ISDIRECT; - vp = LINVFS_GET_VP(file->f_dentry->d_inode); - VOP_READ(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL, error); - return error; + VOP_READ(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL, rval); + return rval; } @@ -114,20 +113,21 @@ struct file *file = iocb->ki_filp; struct inode *inode = file->f_mapping->host; vnode_t *vp = LINVFS_GET_VP(inode); - int error; + ssize_t rval; BUG_ON(iocb->ki_pos != pos); if (unlikely(file->f_flags & O_DIRECT)) { ioflags |= IO_ISDIRECT; VOP_WRITE(vp, iocb, &iov, 1, &iocb->ki_pos, - ioflags, NULL, error); + ioflags, NULL, rval); } else { down(&inode->i_sem); VOP_WRITE(vp, iocb, &iov, 1, &iocb->ki_pos, - ioflags, NULL, error); + ioflags, NULL, rval); up(&inode->i_sem); } - return error; + + return rval; } @@ -163,19 +163,19 @@ struct inode *inode = file->f_mapping->host; vnode_t *vp = LINVFS_GET_VP(inode); struct kiocb kiocb; - int error; + ssize_t rval; init_sync_kiocb(&kiocb, file); kiocb.ki_pos = *ppos; if (unlikely(file->f_flags & O_DIRECT)) ioflags |= IO_ISDIRECT; - VOP_READ(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, ioflags, NULL, error); - if (-EIOCBQUEUED == error) - error = wait_on_sync_kiocb(&kiocb); - *ppos = kiocb.ki_pos; + VOP_READ(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, ioflags, NULL, rval); + if (rval == -EIOCBQUEUED) + rval = wait_on_sync_kiocb(&kiocb); - return error; + *ppos = kiocb.ki_pos; + return rval; } STATIC ssize_t @@ -210,25 +210,26 @@ struct inode *inode = file->f_mapping->host; vnode_t *vp = LINVFS_GET_VP(inode); struct kiocb kiocb; - int error; + ssize_t rval; init_sync_kiocb(&kiocb, file); kiocb.ki_pos = *ppos; if (unlikely(file->f_flags & O_DIRECT)) { ioflags |= IO_ISDIRECT; VOP_WRITE(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, - ioflags, NULL, error); + ioflags, NULL, rval); } else { down(&inode->i_sem); VOP_WRITE(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, - ioflags, NULL, error); + ioflags, NULL, rval); up(&inode->i_sem); } - if (-EIOCBQUEUED == error) - error = wait_on_sync_kiocb(&kiocb); - *ppos = kiocb.ki_pos; - return error; + if (rval == -EIOCBQUEUED) + rval = wait_on_sync_kiocb(&kiocb); + + *ppos = kiocb.ki_pos; + return rval; } diff -urN linux-2.6.5-rc3/fs/xfs/linux/xfs_ioctl.c linux-2.6.5/fs/xfs/linux/xfs_ioctl.c --- linux-2.6.5-rc3/fs/xfs/linux/xfs_ioctl.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/fs/xfs/linux/xfs_ioctl.c 2004-04-03 20:20:25.000000000 -0800 @@ -850,6 +850,9 @@ case XFS_IOC_ERROR_INJECTION: { xfs_error_injection_t in; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + if (copy_from_user(&in, (char *)arg, sizeof(in))) return -XFS_ERROR(EFAULT); @@ -858,6 +861,9 @@ } case XFS_IOC_ERROR_CLEARALL: + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + error = xfs_errortag_clearall(mp); return -error; @@ -882,7 +888,7 @@ if (vp->v_inode.i_flags & (S_IMMUTABLE|S_APPEND)) return -XFS_ERROR(EPERM); - if (filp->f_flags & O_RDONLY) + if (!(filp->f_flags & FMODE_WRITE)) return -XFS_ERROR(EBADF); if (vp->v_type != VREG) diff -urN linux-2.6.5-rc3/fs/xfs/linux/xfs_iops.c linux-2.6.5/fs/xfs/linux/xfs_iops.c --- linux-2.6.5-rc3/fs/xfs/linux/xfs_iops.c 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/fs/xfs/linux/xfs_iops.c 2004-04-03 20:20:25.000000000 -0800 @@ -536,6 +536,10 @@ if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) flags = ATTR_UTIME; +#ifdef ATTR_NO_BLOCK + if ((ia_valid & ATTR_NO_BLOCK)) + flags |= ATTR_NONBLOCK; +#endif VOP_SETATTR(vp, &vattr, flags, NULL, error); if (error) diff -urN linux-2.6.5-rc3/fs/xfs/xfs_attr_leaf.c linux-2.6.5/fs/xfs/xfs_attr_leaf.c --- linux-2.6.5-rc3/fs/xfs/xfs_attr_leaf.c 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_attr_leaf.c 2004-04-03 20:20:25.000000000 -0800 @@ -575,8 +575,8 @@ for ( ; i < nsbuf; i++, sbp++) { attrnames_t *namesp; - namesp = (sfe->flags & XFS_ATTR_SECURE) ? &attr_secure : - ((sfe->flags & XFS_ATTR_ROOT) ? &attr_trusted : + namesp = (sbp->flags & XFS_ATTR_SECURE) ? &attr_secure : + ((sbp->flags & XFS_ATTR_ROOT) ? &attr_trusted : &attr_user); if (cursor->hashval != INT_GET(sbp->hash, ARCH_CONVERT)) { @@ -587,8 +587,7 @@ ASSERT(context->flags & ATTR_KERNAMELS); context->count += namesp->attr_namelen + sbp->namelen + 1; - } - else { + } else { if (xfs_attr_put_listent(context, namesp, sbp->name, sbp->namelen, INT_GET(sbp->valuelen, ARCH_CONVERT))) diff -urN linux-2.6.5-rc3/fs/xfs/xfs_dfrag.c linux-2.6.5/fs/xfs/xfs_dfrag.c --- linux-2.6.5-rc3/fs/xfs/xfs_dfrag.c 2004-03-10 18:55:22.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_dfrag.c 2004-04-03 20:20:25.000000000 -0800 @@ -119,6 +119,11 @@ tip = XFS_BHVTOI(tbdp); } + if (ip->i_mount != tip->i_mount) { + error = XFS_ERROR(EINVAL); + goto error0; + } + if (ip->i_ino == tip->i_ino) { error = XFS_ERROR(EINVAL); goto error0; @@ -147,20 +152,17 @@ xfs_lock_inodes(ips, 2, 0, lock_flags); /* Check permissions */ - if ((error = _MAC_XFS_IACCESS(ip, MACWRITE, NULL))) { - goto error0; - } - if ((error = _MAC_XFS_IACCESS(tip, MACWRITE, NULL))) { + error = xfs_iaccess(ip, S_IWUSR, NULL); + if (error) goto error0; - } - if ((current_fsuid(cred) != ip->i_d.di_uid) && - (error = xfs_iaccess(ip, S_IWUSR, NULL)) && - !capable_cred(NULL, CAP_FOWNER)) { + + error = xfs_iaccess(tip, S_IWUSR, NULL); + if (error) goto error0; - } - if ((current_fsuid(cred) != tip->i_d.di_uid) && - (error = xfs_iaccess(tip, S_IWUSR, NULL)) && - !capable_cred(NULL, CAP_FOWNER)) { + + /* Verify that both files have the same format */ + if ((ip->i_d.di_mode & S_IFMT) != (tip->i_d.di_mode & S_IFMT)) { + error = XFS_ERROR(EINVAL); goto error0; } diff -urN linux-2.6.5-rc3/fs/xfs/xfs_inode.c linux-2.6.5/fs/xfs/xfs_inode.c --- linux-2.6.5-rc3/fs/xfs/xfs_inode.c 2004-03-10 18:55:50.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_inode.c 2004-04-03 20:20:25.000000000 -0800 @@ -3707,14 +3707,13 @@ * Read/write DACs are always overridable. * Executable DACs are overridable if at least one exec bit is set. */ - if (!(orgmode & S_IXUSR) || (inode->i_mode & S_IXUGO) || - (ip->i_d.di_mode & S_IFMT) == S_IFDIR) + if (!(orgmode & S_IXUSR) || + (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode)) if (capable_cred(cr, CAP_DAC_OVERRIDE)) return 0; if ((orgmode == S_IRUSR) || - (((ip->i_d.di_mode & S_IFMT) == S_IFDIR) && - (!(orgmode & ~(S_IWUSR|S_IXUSR))))) { + (S_ISDIR(inode->i_mode) && (!(orgmode & S_IWUSR)))) { if (capable_cred(cr, CAP_DAC_READ_SEARCH)) return 0; #ifdef NOISE diff -urN linux-2.6.5-rc3/fs/xfs/xfs_log.c linux-2.6.5/fs/xfs/xfs_log.c --- linux-2.6.5-rc3/fs/xfs/xfs_log.c 2004-03-10 18:55:54.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_log.c 2004-04-03 20:20:25.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -940,7 +940,8 @@ void xlog_iodone(xfs_buf_t *bp) { - xlog_in_core_t *iclog; + xlog_in_core_t *iclog; + xlog_t *l; int aborted; iclog = XFS_BUF_FSPRIVATE(bp, xlog_in_core_t *); @@ -949,18 +950,19 @@ aborted = 0; /* + * Some versions of cpp barf on the recursive definition of + * ic_log -> hic_fields.ic_log and expand ic_log twice when + * it is passed through two macros. Workaround broken cpp. + */ + l = iclog->ic_log; + + /* * Race to shutdown the filesystem if we see an error. */ - if (XFS_BUF_GETERROR(bp)) { - /* Some versions of cpp barf on the recursive definition of - * ic_log -> hic_fields.ic_log and expand ic_log twice when - * it is passed through two macros. Workaround for broken cpp - */ - struct log *l; - xfs_ioerror_alert("xlog_iodone", - iclog->ic_log->l_mp, bp, XFS_BUF_ADDR(bp)); + if (XFS_TEST_ERROR((XFS_BUF_GETERROR(bp)), l->l_mp, + XFS_ERRTAG_IODONE_IOERR, XFS_RANDOM_IODONE_IOERR)) { + xfs_ioerror_alert("xlog_iodone", l->l_mp, bp, XFS_BUF_ADDR(bp)); XFS_BUF_STALE(bp); - l = iclog->ic_log; xfs_force_shutdown(l->l_mp, XFS_LOG_IO_ERROR); /* * This flag will be propagated to the trans-committed @@ -3158,6 +3160,7 @@ uint xflags) { xlog_ticket_t *tic; + uint num_headers; SPLDECL(s); alloc: @@ -3181,21 +3184,30 @@ * in the log. A unit in this case is the amount of space for one * of these log operations. Normal reservations have a cnt of 1 * and their unit amount is the total amount of space required. - * The following line of code adds one log record header length - * for each part of an operation which may fall on a different - * log record. * - * One more XLOG_HEADER_SIZE is added to account for possible - * round off errors when syncing a LR to disk. The bytes are - * subtracted if the thread using this ticket is the first writer - * to a new LR. - * - * We add an extra log header for the possibility that the commit - * record is the first data written to a new log record. In this - * case it is separate from the rest of the transaction data and - * will be charged for the log record header. + * The following lines of code account for non-transaction data + * which occupy space in the on-disk log. */ - unit_bytes += log->l_iclog_hsize * (XLOG_BTOLRBB(unit_bytes) + 2); + + /* for start-rec */ + unit_bytes += sizeof(xlog_op_header_t); + + /* for padding */ + if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) && + log->l_mp->m_sb.sb_logsunit > 1) { + /* log su roundoff */ + unit_bytes += log->l_mp->m_sb.sb_logsunit; + } else { + /* BB roundoff */ + unit_bytes += BBSIZE; + } + + /* for commit-rec */ + unit_bytes += sizeof(xlog_op_header_t); + + /* for LR headers */ + num_headers = ((unit_bytes + log->l_iclog_size-1) >> log->l_iclog_size_log); + unit_bytes += log->l_iclog_hsize * num_headers; tic->t_unit_res = unit_bytes; tic->t_curr_res = unit_bytes; diff -urN linux-2.6.5-rc3/fs/xfs/xfs_log_priv.h linux-2.6.5/fs/xfs/xfs_log_priv.h --- linux-2.6.5-rc3/fs/xfs/xfs_log_priv.h 2004-03-10 18:55:22.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_log_priv.h 2004-04-03 20:20:25.000000000 -0800 @@ -57,12 +57,6 @@ #define XLOG_RECORD_BSHIFT 14 /* 16384 == 1 << 14 */ #define XLOG_BIG_RECORD_BSHIFT 15 /* 32k == 1 << 15 */ #define XLOG_MAX_RECORD_BSHIFT 18 /* 256k == 1 << 18 */ -#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XLOG_BTOLRBB) -int xlog_btolrbb(int b); -#define XLOG_BTOLRBB(b) xlog_btolrbb(b) -#else -#define XLOG_BTOLRBB(b) (((b)+XLOG_RECORD_BSIZE-1) >> XLOG_RECORD_BSHIFT) -#endif #define XLOG_BTOLSUNIT(log, b) (((b)+(log)->l_mp->m_sb.sb_logsunit-1) / \ (log)->l_mp->m_sb.sb_logsunit) #define XLOG_LSUNITTOB(log, su) ((su) * (log)->l_mp->m_sb.sb_logsunit) @@ -560,6 +554,7 @@ extern int xlog_bread(xlog_t *, xfs_daddr_t, int, struct xfs_buf *); extern xfs_caddr_t xlog_align(xlog_t *, xfs_daddr_t, int, struct xfs_buf *); +/* iclog tracing */ #define XLOG_TRACE_GRAB_FLUSH 1 #define XLOG_TRACE_REL_FLUSH 2 #define XLOG_TRACE_SLEEP_FLUSH 3 diff -urN linux-2.6.5-rc3/fs/xfs/xfs_macros.c linux-2.6.5/fs/xfs/xfs_macros.c --- linux-2.6.5-rc3/fs/xfs/xfs_macros.c 2004-03-10 18:55:24.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_macros.c 2004-04-03 20:20:25.000000000 -0800 @@ -2219,14 +2219,6 @@ } #endif -#if XFS_WANT_FUNCS_C || (XFS_WANT_SPACE_C && XFSSO_XLOG_BTOLRBB) -int -xlog_btolrbb(int b) -{ - return XLOG_BTOLRBB(b); -} -#endif - #if XFS_WANT_FUNCS_C || (XFS_WANT_SPACE_C && XFSSO_XLOG_GRANT_ADD_SPACE) void xlog_grant_add_space(xlog_t *log, int bytes, int type) @@ -2242,3 +2234,12 @@ XLOG_GRANT_SUB_SPACE(log, bytes, type); } #endif + +#if XFS_WANT_FUNCS_C || (XFS_WANT_SPACE_C && XFSSO_XFS_SB_VERSION_HASMOREBITS) +int +xfs_sb_version_hasmorebits(xfs_sb_t *sbp) +{ + return XFS_SB_VERSION_HASMOREBITS(sbp); +} +#endif + diff -urN linux-2.6.5-rc3/fs/xfs/xfs_mount.c linux-2.6.5/fs/xfs/xfs_mount.c --- linux-2.6.5-rc3/fs/xfs/xfs_mount.c 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_mount.c 2004-04-03 20:20:25.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -117,6 +117,7 @@ { offsetof(xfs_sb_t, sb_logsectlog), 0 }, { offsetof(xfs_sb_t, sb_logsectsize),0 }, { offsetof(xfs_sb_t, sb_logsunit), 0 }, + { offsetof(xfs_sb_t, sb_features2), 0 }, { sizeof(xfs_sb_t), 0 } }; diff -urN linux-2.6.5-rc3/fs/xfs/xfs_sb.h linux-2.6.5/fs/xfs/xfs_sb.h --- linux-2.6.5-rc3/fs/xfs/xfs_sb.h 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_sb.h 2004-04-03 20:20:25.000000000 -0800 @@ -60,6 +60,7 @@ #define XFS_SB_VERSION_SECTORBIT 0x0800 #define XFS_SB_VERSION_EXTFLGBIT 0x1000 #define XFS_SB_VERSION_DIRV2BIT 0x2000 +#define XFS_SB_VERSION_MOREBITSBIT 0x8000 #define XFS_SB_VERSION_OKSASHFBITS \ (XFS_SB_VERSION_EXTFLGBIT | \ XFS_SB_VERSION_DIRV2BIT) @@ -80,17 +81,46 @@ (XFS_SB_VERSION_NUMBITS | \ XFS_SB_VERSION_OKREALFBITS | \ XFS_SB_VERSION_OKSASHFBITS) -#define XFS_SB_VERSION_MKFS(ia,dia,extflag,dirv2,na,sflag) \ - (((ia) || (dia) || (extflag) || (dirv2) || (na) || (sflag)) ? \ +#define XFS_SB_VERSION_MKFS(ia,dia,extflag,dirv2,na,sflag,morebits) \ + (((ia) || (dia) || (extflag) || (dirv2) || (na) || (sflag) || \ + (morebits)) ? \ (XFS_SB_VERSION_4 | \ ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \ ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \ ((extflag) ? XFS_SB_VERSION_EXTFLGBIT : 0) | \ ((dirv2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \ ((na) ? XFS_SB_VERSION_LOGV2BIT : 0) | \ - ((sflag) ? XFS_SB_VERSION_SECTORBIT : 0)) : \ + ((sflag) ? XFS_SB_VERSION_SECTORBIT : 0) | \ + ((morebits) ? XFS_SB_VERSION_MOREBITSBIT : 0)) : \ XFS_SB_VERSION_1) +/* + * There are two words to hold XFS "feature" bits: the original + * word, sb_versionnum, and sb_features2. Whenever a bit is set in + * sb_features2, the feature bit XFS_SB_VERSION_MOREBITSBIT must be set. + * + * These defines represent bits in sb_features2. + */ +#define XFS_SB_VERSION2_REALFBITS 0x00ffffff /* Mask: features */ +#define XFS_SB_VERSION2_RESERVED1BIT 0x00000001 +#define XFS_SB_VERSION2_SASHFBITS 0xff000000 /* Mask: features that + require changing + PROM and SASH */ + +#define XFS_SB_VERSION2_OKREALFBITS \ + (0) +#define XFS_SB_VERSION2_OKSASHFBITS \ + (0) +#define XFS_SB_VERSION2_OKREALBITS \ + (XFS_SB_VERSION2_OKREALFBITS | \ + XFS_SB_VERSION2_OKSASHFBITS ) + +/* + * mkfs macro to set up sb_features2 word + */ +#define XFS_SB_VERSION2_MKFS(xyz) \ + ((xyz) ? 0 : 0) + typedef struct xfs_sb { __uint32_t sb_magicnum; /* magic number == XFS_SB_MAGIC */ @@ -146,6 +176,7 @@ __uint8_t sb_logsectlog; /* log2 of the log sector size */ __uint16_t sb_logsectsize; /* sector size for the log, bytes */ __uint32_t sb_logsunit; /* stripe unit size for the log */ + __uint32_t sb_features2; /* additonal feature bits */ } xfs_sb_t; /* @@ -164,6 +195,7 @@ XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN, XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG, XFS_SBS_LOGSECTLOG, XFS_SBS_LOGSECTSIZE, XFS_SBS_LOGSUNIT, + XFS_SBS_FEATURES2, XFS_SBS_FIELDCOUNT } xfs_sb_field_t; @@ -217,8 +249,11 @@ #define XFS_SB_GOOD_VERSION_INT(sbp) \ ((((sbp)->sb_versionnum >= XFS_SB_VERSION_1) && \ ((sbp)->sb_versionnum <= XFS_SB_VERSION_3)) || \ - ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ - !((sbp)->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) + ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ + !(((sbp)->sb_versionnum & ~XFS_SB_VERSION_OKREALBITS) && \ + ((sbp)->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) && \ + ((sbp)->sb_features2 & ~XFS_SB_VERSION2_OKREALBITS)) + #ifdef __KERNEL__ #define XFS_SB_GOOD_VERSION(sbp) \ (XFS_SB_GOOD_VERSION_INT(sbp) && \ @@ -453,6 +488,25 @@ ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT)) #endif +#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_SB_VERSION_HASMOREBITSBIT) +int xfs_sb_version_hasmorebits(xfs_sb_t *sbp); +#define XFS_SB_VERSION_HASMOREBITS(sbp) xfs_sb_version_hasmorebits(sbp) +#else +#define XFS_SB_VERSION_HASMOREBITS(sbp) \ + ((XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ + ((sbp)->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT)) +#endif + +/* + * sb_features2 bit version macros. + * + * For example, for a bit defined as XFS_SB_VERSION2_YBIT, has a macro: + * + * SB_VERSION_HASYBIT(xfs_sb_t *sbp) + * ((XFS_SB_VERSION_HASMOREBITS(sbp) && + * ((sbp)->sb_versionnum & XFS_SB_VERSION2_YBIT) + */ + /* * end of superblock version macros */ diff -urN linux-2.6.5-rc3/fs/xfs/xfs_trans.c linux-2.6.5/fs/xfs/xfs_trans.c --- linux-2.6.5-rc3/fs/xfs/xfs_trans.c 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_trans.c 2004-04-03 20:20:25.000000000 -0800 @@ -250,7 +250,7 @@ error = xfs_mod_incore_sb(tp->t_mountp, XFS_SBS_FDBLOCKS, -blocks, rsvd); if (error != 0) { - PFLAGS_RESTORE(&tp->t_pflags); + PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); return (XFS_ERROR(ENOSPC)); } tp->t_blk_res += blocks; @@ -323,7 +323,7 @@ tp->t_blk_res = 0; } - PFLAGS_RESTORE(&tp->t_pflags); + PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); return (error); } @@ -734,7 +734,7 @@ if (commit_lsn == -1 && !shutdown) shutdown = XFS_ERROR(EIO); } - PFLAGS_RESTORE(&tp->t_pflags); + PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); xfs_trans_free_items(tp, shutdown? XFS_TRANS_ABORT : 0); xfs_trans_free_busy(tp); xfs_trans_free(tp); @@ -823,7 +823,7 @@ * had pinned, clean up, free trans structure, and return error. */ if (error || commit_lsn == -1) { - PFLAGS_RESTORE(&tp->t_pflags); + PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); xfs_trans_uncommit(tp, flags|XFS_TRANS_ABORT); return XFS_ERROR(EIO); } @@ -862,7 +862,7 @@ error = xfs_log_notify(mp, commit_iclog, &(tp->t_logcb)); /* mark this thread as no longer being in a transaction */ - PFLAGS_RESTORE(&tp->t_pflags); + PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); /* * Once all the items of the transaction have been copied @@ -1100,7 +1100,7 @@ } /* mark this thread as no longer being in a transaction */ - PFLAGS_RESTORE(&tp->t_pflags); + PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); xfs_trans_free_items(tp, flags); xfs_trans_free_busy(tp); diff -urN linux-2.6.5-rc3/fs/xfs/xfs_trans.h linux-2.6.5/fs/xfs/xfs_trans.h --- linux-2.6.5-rc3/fs/xfs/xfs_trans.h 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_trans.h 2004-04-03 20:20:25.000000000 -0800 @@ -535,6 +535,8 @@ * the super block to reflect the freed blocks: sector size * worst case split in allocation btrees per extent assuming 4 extents: * 4 exts * 2 trees * (2 * max depth - 1) * block size + * the inode btree: max depth * blocksize + * the allocation btrees: 2 trees * (max depth - 1) * block size */ #define XFS_CALC_ITRUNCATE_LOG_RES(mp) \ (MAX( \ @@ -545,7 +547,11 @@ (4 * (mp)->m_sb.sb_sectsize) + \ (mp)->m_sb.sb_sectsize + \ XFS_ALLOCFREE_LOG_RES(mp, 4) + \ - (128 * (9 + XFS_ALLOCFREE_LOG_COUNT(mp, 4)))))) + (128 * (9 + XFS_ALLOCFREE_LOG_COUNT(mp, 4))) + \ + (128 * 5) + \ + XFS_ALLOCFREE_LOG_RES(mp, 1) + \ + (128 * (2 + XFS_IALLOC_BLOCKS(mp) + XFS_IN_MAXLEVELS(mp) + \ + XFS_ALLOCFREE_LOG_COUNT(mp, 1)))))) #define XFS_ITRUNCATE_LOG_RES(mp) ((mp)->m_reservations.tr_itruncate) @@ -713,6 +719,7 @@ XFS_FSB_TO_B((mp), 1) + \ MAX((__uint16_t)XFS_FSB_TO_B((mp), 1), XFS_INODE_CLUSTER_SIZE(mp)) + \ (128 * 5) + \ + XFS_ALLOCFREE_LOG_RES(mp, 1) + \ (128 * (2 + XFS_IALLOC_BLOCKS(mp) + XFS_IN_MAXLEVELS(mp) + \ XFS_ALLOCFREE_LOG_COUNT(mp, 1)))) diff -urN linux-2.6.5-rc3/fs/xfs/xfs_vfsops.c linux-2.6.5/fs/xfs/xfs_vfsops.c --- linux-2.6.5-rc3/fs/xfs/xfs_vfsops.c 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_vfsops.c 2004-04-03 20:20:25.000000000 -0800 @@ -1,7 +1,7 @@ /* * XFS filesystem operations. * - * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -229,7 +229,10 @@ mp->m_swidth = ap->swidth; } - if (ap->logbufs != 0 && ap->logbufs != -1 && + if (ap->logbufs != -1 && +#if defined(DEBUG) || defined(XLOG_NOLOG) + ap->logbufs != 0 && +#endif (ap->logbufs < XLOG_MIN_ICLOGS || ap->logbufs > XLOG_MAX_ICLOGS)) { cmn_err(CE_WARN, @@ -1484,8 +1487,10 @@ */ if (XFS_BUF_ISPINNED(bp)) xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); - if (!(flags & SYNC_WAIT)) - XFS_BUF_BFLAGS(bp) |= XFS_B_ASYNC; + if (flags & SYNC_WAIT) + XFS_BUF_UNASYNC(bp); + else + XFS_BUF_ASYNC(bp); error = xfs_bwrite(mp, bp); } if (error) { diff -urN linux-2.6.5-rc3/fs/xfs/xfs_vnodeops.c linux-2.6.5/fs/xfs/xfs_vnodeops.c --- linux-2.6.5-rc3/fs/xfs/xfs_vnodeops.c 2004-03-10 18:55:55.000000000 -0800 +++ linux-2.6.5/fs/xfs/xfs_vnodeops.c 2004-04-03 20:20:25.000000000 -0800 @@ -1106,14 +1106,11 @@ xfs_off_t stop) { xfs_inode_t *ip; - int error; - int error2; - int syncall; - vnode_t *vp; xfs_trans_t *tp; + int error; - vp = BHV_TO_VNODE(bdp); - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); + vn_trace_entry(BHV_TO_VNODE(bdp), + __FUNCTION__, (inst_t *)__return_address); ip = XFS_BHVTOI(bdp); @@ -1122,44 +1119,6 @@ if (XFS_FORCED_SHUTDOWN(ip->i_mount)) return XFS_ERROR(EIO); - xfs_ilock(ip, XFS_IOLOCK_EXCL); - - syncall = error = error2 = 0; - - if (stop == -1) { - ASSERT(start >= 0); - if (start == 0) - syncall = 1; - stop = xfs_file_last_byte(ip); - } - - /* - * If we're invalidating, always flush since we want to - * tear things down. Otherwise, don't flush anything if - * we're not dirty. - */ - if (flag & FSYNC_INVAL) { - if (ip->i_df.if_flags & XFS_IFEXTENTS && - ip->i_df.if_bytes > 0) { - VOP_FLUSHINVAL_PAGES(vp, start, -1, FI_REMAPF_LOCKED); - } - ASSERT(syncall == 0 || (VN_CACHED(vp) == 0)); - } else { - /* - * In the non-invalidating case, calls to fsync() do not - * flush all the dirty mmap'd pages. That requires a - * call to msync(). - */ - VOP_FLUSH_PAGES(vp, start, -1, - (flag & FSYNC_WAIT) ? 0 : XFS_B_ASYNC, - FI_NONE, error2); - } - - if (error2) { - xfs_iunlock(ip, XFS_IOLOCK_EXCL); - return XFS_ERROR(error2); - } - /* * We always need to make sure that the required inode state * is safe on disk. The vnode might be clean but because @@ -1199,7 +1158,7 @@ * be pinned. If it is, force the log. */ - xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_SHARED); + xfs_iunlock(ip, XFS_ILOCK_SHARED); if (xfs_ipincount(ip)) { xfs_log_force(ip->i_mount, (xfs_lsn_t)0, @@ -1222,7 +1181,6 @@ XFS_FSYNC_TS_LOG_RES(ip->i_mount), 0, 0, 0))) { xfs_trans_cancel(tp, 0); - xfs_iunlock(ip, XFS_IOLOCK_EXCL); return error; } xfs_ilock(ip, XFS_ILOCK_EXCL); @@ -1237,68 +1195,18 @@ * inode in another recent transaction. So we * play it safe and fire off the transaction anyway. */ - xfs_trans_ijoin(tp, ip, XFS_IOLOCK_EXCL|XFS_ILOCK_EXCL); + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_ihold(tp, ip); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); if (flag & FSYNC_WAIT) xfs_trans_set_sync(tp); error = xfs_trans_commit(tp, 0, NULL); - xfs_iunlock(ip, XFS_IOLOCK_EXCL|XFS_ILOCK_EXCL); + xfs_iunlock(ip, XFS_ILOCK_EXCL); } return error; } - -#if 0 -/* - * This is a utility routine for xfs_inactive. It is called when a - * transaction attempting to free up the disk space for a file encounters - * an error. It cancels the old transaction and starts up a new one - * to be used to free up the inode. It also sets the inode size and extent - * counts to 0 and frees up any memory being used to store inline data, - * extents, or btree roots. - */ -STATIC void -xfs_itruncate_cleanup( - xfs_trans_t **tpp, - xfs_inode_t *ip, - int commit_flags, - int fork) -{ - xfs_mount_t *mp; - /* REFERENCED */ - int error; - - mp = ip->i_mount; - if (*tpp) { - xfs_trans_cancel(*tpp, commit_flags | XFS_TRANS_ABORT); - } - xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); - *tpp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); - error = xfs_trans_reserve(*tpp, 0, XFS_IFREE_LOG_RES(mp), 0, 0, - XFS_DEFAULT_LOG_COUNT); - if (error) { - return; - } - - xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); - xfs_trans_ijoin(*tpp, ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); - xfs_trans_ihold(*tpp, ip); - - xfs_idestroy_fork(ip, fork); - - if (fork == XFS_DATA_FORK) { - ip->i_d.di_nblocks = 0; - ip->i_d.di_nextents = 0; - ip->i_d.di_size = 0; - } else { - ip->i_d.di_anextents = 0; - } - xfs_trans_log_inode(*tpp, ip, XFS_ILOG_CORE); -} -#endif - /* * This is called by xfs_inactive to free any blocks beyond eof, * when the link count isn't zero. diff -urN linux-2.6.5-rc3/include/asm-alpha/elf.h linux-2.6.5/include/asm-alpha/elf.h --- linux-2.6.5-rc3/include/asm-alpha/elf.h 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/include/asm-alpha/elf.h 2004-04-03 20:20:25.000000000 -0800 @@ -137,10 +137,44 @@ : amask (AMASK_CIX) ? "ev6" : "ev67"); \ }) +/* Reserve these numbers for any future use of a VDSO. */ +#if 0 +#define AT_SYSINFO 32 +#define AT_SYSINFO_EHDR 33 +#endif + +/* More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the + value is -1, then the cache doesn't exist. Otherwise: + + bit 0-3: Cache set-associativity; 0 means fully associative. + bit 4-7: Log2 of cacheline size. + bit 8-31: Size of the entire cache >> 8. + bit 32-63: Reserved. +*/ + +#define AT_L1I_CACHESHAPE 34 +#define AT_L1D_CACHESHAPE 35 +#define AT_L2_CACHESHAPE 36 +#define AT_L3_CACHESHAPE 37 + #ifdef __KERNEL__ + #define SET_PERSONALITY(EX, IBCS2) \ set_personality(((EX).e_flags & EF_ALPHA_32BIT) \ ? PER_LINUX_32BIT : (IBCS2) ? PER_SVR4 : PER_LINUX) -#endif -#endif +extern int alpha_l1i_cacheshape; +extern int alpha_l1d_cacheshape; +extern int alpha_l2_cacheshape; +extern int alpha_l3_cacheshape; + +#define ARCH_DLINFO \ + do { \ + NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape); \ + NEW_AUX_ENT(AT_L1D_CACHESHAPE, alpha_l1d_cacheshape); \ + NEW_AUX_ENT(AT_L2_CACHESHAPE, alpha_l2_cacheshape); \ + NEW_AUX_ENT(AT_L3_CACHESHAPE, alpha_l3_cacheshape); \ + } while (0) + +#endif /* __KERNEL__ */ +#endif /* __ASM_ALPHA_ELF_H */ diff -urN linux-2.6.5-rc3/include/asm-alpha/module.h linux-2.6.5/include/asm-alpha/module.h --- linux-2.6.5-rc3/include/asm-alpha/module.h 2004-03-10 18:55:22.000000000 -0800 +++ linux-2.6.5/include/asm-alpha/module.h 2004-04-03 20:20:25.000000000 -0800 @@ -17,7 +17,7 @@ #define ARCH_SHF_SMALL SHF_ALPHA_GPREL #ifdef MODULE -asm(".section .got,\"aws\",@nobits; .align 3; .previous"); +asm(".section .got,\"aws\",@progbits; .align 3; .previous"); #endif #endif /*_ALPHA_MODULE_H*/ diff -urN linux-2.6.5-rc3/include/asm-alpha/pci.h linux-2.6.5/include/asm-alpha/pci.h --- linux-2.6.5-rc3/include/asm-alpha/pci.h 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/include/asm-alpha/pci.h 2004-04-03 20:20:25.000000000 -0800 @@ -85,10 +85,10 @@ extern void pci_free_consistent(struct pci_dev *, size_t, void *, dma_addr_t); -/* Map a single buffer of the indicate size for PCI DMA in streaming - mode. The 32-bit PCI bus mastering address to use is returned. - Once the device is given the dma address, the device owns this memory - until either pci_unmap_single or pci_dma_sync_single_for_cpu is performed. */ +/* Map a single buffer of the indicate size for PCI DMA in streaming mode. + The 32-bit PCI bus mastering address to use is returned. Once the device + is given the dma address, the device owns this memory until either + pci_unmap_single or pci_dma_sync_single_for_cpu is performed. */ extern dma_addr_t pci_map_single(struct pci_dev *, void *, size_t, int); @@ -96,6 +96,14 @@ extern dma_addr_t pci_map_page(struct pci_dev *, struct page *, unsigned long, size_t, int); +/* Test for pci_map_single or pci_map_page having generated an error. */ + +static inline int +pci_dma_mapping_error(dma_addr_t dma_addr) +{ + return dma_addr == 0; +} + /* Unmap a single streaming mode DMA translation. The DMA_ADDR and SIZE must match what was provided for in a previous pci_map_single call. All other usages are undefined. After this call, reads by @@ -153,15 +161,15 @@ the buffer. */ static inline void -pci_dma_sync_single_for_cpu(struct pci_dev *dev, dma_addr_t dma_addr, long size, - int direction) +pci_dma_sync_single_for_cpu(struct pci_dev *dev, dma_addr_t dma_addr, + long size, int direction) { /* Nothing to do. */ } static inline void -pci_dma_sync_single_for_device(struct pci_dev *dev, dma_addr_t dma_addr, long size, - int direction) +pci_dma_sync_single_for_device(struct pci_dev *dev, dma_addr_t dma_addr, + long size, int direction) { /* Nothing to do. */ } @@ -171,15 +179,15 @@ but for a scatter-gather list, same rules and usage. */ static inline void -pci_dma_sync_sg_for_cpu(struct pci_dev *dev, struct scatterlist *sg, int nents, - int direction) +pci_dma_sync_sg_for_cpu(struct pci_dev *dev, struct scatterlist *sg, + int nents, int direction) { /* Nothing to do. */ } static inline void -pci_dma_sync_sg_for_device(struct pci_dev *dev, struct scatterlist *sg, int nents, - int direction) +pci_dma_sync_sg_for_device(struct pci_dev *dev, struct scatterlist *sg, + int nents, int direction) { /* Nothing to do. */ } @@ -196,29 +204,32 @@ extern int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask); /* Convert to/from DAC dma address and struct page. */ -extern dma64_addr_t pci_dac_page_to_dma(struct pci_dev *, struct page *, unsigned long, int); +extern dma64_addr_t pci_dac_page_to_dma(struct pci_dev *, struct page *, + unsigned long, int); extern struct page *pci_dac_dma_to_page(struct pci_dev *, dma64_addr_t); extern unsigned long pci_dac_dma_to_offset(struct pci_dev *, dma64_addr_t); static inline void -pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction) +pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, + size_t len, int direction) { /* Nothing to do. */ } static inline void -pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction) +pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, + size_t len, int direction) { /* Nothing to do. */ } -extern void -pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, - struct resource *res); +extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *, + struct resource *); #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index -static inline int pci_name_bus(char *name, struct pci_bus *bus) +static inline int +pci_name_bus(char *name, struct pci_bus *bus) { struct pci_controller *hose = bus->sysdata; @@ -230,7 +241,8 @@ return 0; } -static inline void pcibios_add_platform_entries(struct pci_dev *dev) +static inline void +pcibios_add_platform_entries(struct pci_dev *dev) { } diff -urN linux-2.6.5-rc3/include/asm-alpha/unistd.h linux-2.6.5/include/asm-alpha/unistd.h --- linux-2.6.5-rc3/include/asm-alpha/unistd.h 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/include/asm-alpha/unistd.h 2004-04-03 20:20:26.000000000 -0800 @@ -616,16 +616,16 @@ #endif /* __KERNEL_SYSCALLS__ */ -/* - * "Conditional" syscalls - * - * What we want is __attribute__((weak,alias("sys_ni_syscall"))), - * but it doesn't work on all toolchains, so we just do it by hand. - * - * Note that we do *not* provide a parameter list to avoid - * conflicting with one of the syscall declarations in some - * of the relevant header files (including this one). - */ -#define cond_syscall(x) asmlinkage long x() __attribute__((weak,alias("sys_ni_syscall"))); +/* "Conditional" syscalls. What we want is + + __attribute__((weak,alias("sys_ni_syscall"))) + + but that raises the problem of what type to give the symbol. If we use + a prototype, it'll conflict with the definition given in this file and + others. If we use __typeof, we discover that not all symbols actually + have declarations. If we use no prototype, then we get warnings from + -Wstrict-prototypes. Ho hum. */ + +#define cond_syscall(x) asm(".weak\t" #x "\n" #x " = sys_ni_syscall"); #endif /* _ALPHA_UNISTD_H */ diff -urN linux-2.6.5-rc3/include/asm-generic/siginfo.h linux-2.6.5/include/asm-generic/siginfo.h --- linux-2.6.5-rc3/include/asm-generic/siginfo.h 2004-03-10 18:55:24.000000000 -0800 +++ linux-2.6.5/include/asm-generic/siginfo.h 2004-04-03 20:20:26.000000000 -0800 @@ -26,8 +26,13 @@ #define __ARCH_SI_UID_T uid_t #endif +/* + * The default "si_band" type is "long", as specified by POSIX. + * However, some architectures want to override this to "int" + * for historical compatibility reasons, so we allow that. + */ #ifndef __ARCH_SI_BAND_T -#define __ARCH_SI_BAND_T int +#define __ARCH_SI_BAND_T long #endif #ifndef HAVE_ARCH_SIGINFO_T diff -urN linux-2.6.5-rc3/include/asm-i386/acpi.h linux-2.6.5/include/asm-i386/acpi.h --- linux-2.6.5-rc3/include/asm-i386/acpi.h 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/include/asm-i386/acpi.h 2004-04-03 20:20:26.000000000 -0800 @@ -54,15 +54,6 @@ #define ACPI_ENABLE_IRQS() local_irq_enable() #define ACPI_FLUSH_CPU_CACHE() wbinvd() -/* - * A brief explanation as GNU inline assembly is a bit hairy - * %0 is the output parameter in EAX ("=a") - * %1 and %2 are the input parameters in ECX ("c") - * and an immediate value ("i") respectively - * All actual register references are preceded with "%%" as in "%%edx" - * Immediate values in the assembly are preceded by "$" as in "$0x1" - * The final asm parameter are the operation altered non-output registers. - */ static inline int __acpi_acquire_global_lock (unsigned int *lock) diff -urN linux-2.6.5-rc3/include/asm-i386/system.h linux-2.6.5/include/asm-i386/system.h --- linux-2.6.5-rc3/include/asm-i386/system.h 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/include/asm-i386/system.h 2004-04-03 20:20:26.000000000 -0800 @@ -241,6 +241,7 @@ #ifdef CONFIG_X86_CMPXCHG #define __HAVE_ARCH_CMPXCHG 1 +#endif static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) @@ -273,10 +274,6 @@ ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ (unsigned long)(n),sizeof(*(ptr)))) -#else -/* Compiling for a 386 proper. Is it worth implementing via cli/sti? */ -#endif - #ifdef __KERNEL__ struct alt_instr { __u8 *instr; /* original instruction */ diff -urN linux-2.6.5-rc3/include/asm-ppc/cputable.h linux-2.6.5/include/asm-ppc/cputable.h --- linux-2.6.5-rc3/include/asm-ppc/cputable.h 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/include/asm-ppc/cputable.h 2004-04-03 20:20:27.000000000 -0800 @@ -90,11 +90,25 @@ .long 99b; \ .previous -#define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) -#define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) +#else + +#define BEGIN_FTR_SECTION "98:\n" +#define END_FTR_SECTION(msk, val) \ +"99:\n" \ +" .section __ftr_fixup,\"a\";\n" \ +" .align 2;\n" \ +" .long "#msk";\n" \ +" .long "#val";\n" \ +" .long 98b;\n" \ +" .long 99b;\n" \ +" .previous\n" + #endif /* __ASSEMBLY__ */ +#define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) +#define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) + #endif /* __ASM_PPC_CPUTABLE_H */ #endif /* __KERNEL__ */ diff -urN linux-2.6.5-rc3/include/asm-ppc/mmu_context.h linux-2.6.5/include/asm-ppc/mmu_context.h --- linux-2.6.5-rc3/include/asm-ppc/mmu_context.h 2004-03-10 18:55:28.000000000 -0800 +++ linux-2.6.5/include/asm-ppc/mmu_context.h 2004-04-03 20:20:27.000000000 -0800 @@ -6,6 +6,7 @@ #include #include #include +#include /* * On 32-bit PowerPC 6xx/7xx/7xxx CPUs, we use a set of 16 VSIDs @@ -155,7 +156,24 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) { +#ifdef CONFIG_ALTIVEC + asm volatile ( + BEGIN_FTR_SECTION + "dssall;\n" +#ifndef CONFIG_POWER4 + "sync;\n" /* G4 needs a sync here, G5 apparently not */ +#endif + END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) + : : ); +#endif /* CONFIG_ALTIVEC */ + tsk->thread.pgdir = next->pgd; + + /* No need to flush userspace segments if the mm doesnt change */ + if (prev == next) + return; + + /* Setup new userspace context */ get_mmu_context(next); set_context(next->context, next->pgd); } @@ -166,12 +184,7 @@ * After we have set current->mm to a new value, this activates * the context for the new mm so we see the new mappings. */ -static inline void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm) -{ - current->thread.pgdir = mm->pgd; - get_mmu_context(mm); - set_context(mm->context, mm->pgd); -} +#define activate_mm(active_mm, mm) switch_mm(active_mm, mm, current) extern void mmu_context_init(void); diff -urN linux-2.6.5-rc3/include/asm-ppc/reg.h linux-2.6.5/include/asm-ppc/reg.h --- linux-2.6.5-rc3/include/asm-ppc/reg.h 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/include/asm-ppc/reg.h 2004-04-03 20:20:28.000000000 -0800 @@ -442,7 +442,9 @@ #define PVR_440GP_RB 0x40120440 #define PVR_440GP_RC1 0x40120481 #define PVR_440GP_RC2 0x40200481 -#define PVR_440GX_RC1 0x51b21850 +#define PVR_440GX_RA 0x51b21850 +#define PVR_440GX_RB 0x51b21851 +#define PVR_440GX_RB1 0x51b21852 #define PVR_601 0x00010000 #define PVR_602 0x00050000 #define PVR_603 0x00030000 diff -urN linux-2.6.5-rc3/include/asm-ppc/reg_booke.h linux-2.6.5/include/asm-ppc/reg_booke.h --- linux-2.6.5-rc3/include/asm-ppc/reg_booke.h 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/include/asm-ppc/reg_booke.h 2004-04-03 20:20:28.000000000 -0800 @@ -55,8 +55,6 @@ /* Special Purpose Registers (SPRNs)*/ #define SPRN_DECAR 0x036 /* Decrementer Auto Reload Register */ -#define SPRN_CSRR0 0x03A /* Critical Save and Restore Register 0 */ -#define SPRN_CSRR1 0x03B /* Critical Save and Restore Register 1 */ #define SPRN_IVPR 0x03F /* Interrupt Vector Prefix Register */ #define SPRN_USPRG0 0x100 /* User Special Purpose Register General 0 */ #define SPRN_SPRG4R 0x104 /* Special Purpose Register General 4 Read */ @@ -108,6 +106,8 @@ */ #ifdef CONFIG_BOOKE #define SPRN_PID 0x030 /* Process ID */ +#define SPRN_CSRR0 0x03A /* Critical Save and Restore Register 0 */ +#define SPRN_CSRR1 0x03B /* Critical Save and Restore Register 1 */ #define SPRN_DEAR 0x03D /* Data Error Address Register */ #define SPRN_ESR 0x03E /* Exception Syndrome Register */ #define SPRN_PIR 0x11E /* Processor Identification Register */ diff -urN linux-2.6.5-rc3/include/asm-ppc64/abs_addr.h linux-2.6.5/include/asm-ppc64/abs_addr.h --- linux-2.6.5-rc3/include/asm-ppc64/abs_addr.h 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.5/include/asm-ppc64/abs_addr.h 2004-04-03 20:20:28.000000000 -0800 @@ -71,26 +71,22 @@ return PTRRELOC(_msChunks->abs)[pchunk]; } - -static inline unsigned long -phys_to_absolute(unsigned long pa) -{ - return chunk_to_addr(abs_chunk(addr_to_chunk(pa))) + chunk_offset(pa); -} +/* A macro so it can take pointers or unsigned long. */ +#define phys_to_abs(pa) \ + ({ unsigned long _pa = (unsigned long)(pa); \ + chunk_to_addr(abs_chunk(addr_to_chunk(_pa))) + chunk_offset(_pa); \ + }) static inline unsigned long physRpn_to_absRpn(unsigned long rpn) { unsigned long pa = rpn << PAGE_SHIFT; - unsigned long aa = phys_to_absolute(pa); + unsigned long aa = phys_to_abs(pa); return (aa >> PAGE_SHIFT); } -static inline unsigned long -absolute_to_phys(unsigned long aa) -{ - return lmb_abs_to_phys(aa); -} +/* A macro so it can take pointers or unsigned long. */ +#define abs_to_phys(aa) lmb_abs_to_phys((unsigned long)(aa)) #else /* !CONFIG_MSCHUNKS */ @@ -99,23 +95,14 @@ #define chunk_offset(addr) (0) #define abs_chunk(pchunk) (pchunk) -#define phys_to_absolute(pa) (pa) +#define phys_to_abs(pa) (pa) #define physRpn_to_absRpn(rpn) (rpn) -#define absolute_to_phys(aa) (aa) +#define abs_to_phys(aa) (aa) #endif /* !CONFIG_MSCHUNKS */ - -static inline unsigned long -virt_to_absolute(unsigned long ea) -{ - return phys_to_absolute(__pa(ea)); -} - -static inline unsigned long -absolute_to_virt(unsigned long aa) -{ - return (unsigned long)__va(absolute_to_phys(aa)); -} +/* Convenience macros */ +#define virt_to_abs(va) phys_to_abs(__pa(va)) +#define abs_to_virt(aa) __va(abs_to_phys(aa)) #endif /* _ABS_ADDR_H */ diff -urN linux-2.6.5-rc3/include/asm-ppc64/dma-mapping.h linux-2.6.5/include/asm-ppc64/dma-mapping.h --- linux-2.6.5-rc3/include/asm-ppc64/dma-mapping.h 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/include/asm-ppc64/dma-mapping.h 2004-04-03 20:20:28.000000000 -0800 @@ -15,6 +15,8 @@ #include #include +#define DMA_ERROR_CODE (~(dma_addr_t)0x0) + extern int dma_supported(struct device *dev, u64 mask); extern int dma_set_mask(struct device *dev, u64 dma_mask); extern void *dma_alloc_coherent(struct device *dev, size_t size, @@ -72,4 +74,9 @@ BUG(); } +static inline int dma_mapping_error(dma_addr_t dma_addr) +{ + return (dma_addr == DMA_ERROR_CODE); +} + #endif /* _ASM_DMA_MAPPING_H */ diff -urN linux-2.6.5-rc3/include/asm-ppc64/iSeries/HvCallEvent.h linux-2.6.5/include/asm-ppc64/iSeries/HvCallEvent.h --- linux-2.6.5-rc3/include/asm-ppc64/iSeries/HvCallEvent.h 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/include/asm-ppc64/iSeries/HvCallEvent.h 2004-04-03 20:20:28.000000000 -0800 @@ -100,7 +100,7 @@ { u64 abs_addr; - abs_addr = virt_to_absolute((unsigned long)eventStackAddr); + abs_addr = virt_to_abs(eventStackAddr); HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr, eventStackSize); // getPaca()->adjustHmtForNoOfSpinLocksHeld(); @@ -123,7 +123,7 @@ printk("HvCallEvent_signalLpEvent: *event = %016lx\n ", (unsigned long)event); #endif - abs_addr = virt_to_absolute((unsigned long)event); + abs_addr = virt_to_abs(event); retVal = (HvLpEvent_Rc)HvCall1(HvCallEventSignalLpEvent, abs_addr); // getPaca()->adjustHmtForNoOfSpinLocksHeld(); return retVal; @@ -164,7 +164,7 @@ u64 abs_addr; HvLpEvent_Rc retVal; - abs_addr = virt_to_absolute((unsigned long)event); + abs_addr = virt_to_abs(event); retVal = (HvLpEvent_Rc)HvCall1(HvCallEventAckLpEvent, abs_addr); // getPaca()->adjustHmtForNoOfSpinLocksHeld(); return retVal; @@ -175,7 +175,7 @@ u64 abs_addr; HvLpEvent_Rc retVal; - abs_addr = virt_to_absolute((unsigned long)event); + abs_addr = virt_to_abs(event); retVal = (HvLpEvent_Rc)HvCall1(HvCallEventCancelLpEvent, abs_addr); // getPaca()->adjustHmtForNoOfSpinLocksHeld(); return retVal; @@ -286,7 +286,7 @@ u64 abs_addr; HvLpDma_Rc retVal; - abs_addr = virt_to_absolute((unsigned long)local); + abs_addr = virt_to_abs(local); retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaToSp, abs_addr, remote, length, dir); // getPaca()->adjustHmtForNoOfSpinLocksHeld(); diff -urN linux-2.6.5-rc3/include/asm-ppc64/iSeries/iSeries_pci.h linux-2.6.5/include/asm-ppc64/iSeries/iSeries_pci.h --- linux-2.6.5-rc3/include/asm-ppc64/iSeries/iSeries_pci.h 2004-03-10 18:55:22.000000000 -0800 +++ linux-2.6.5/include/asm-ppc64/iSeries/iSeries_pci.h 2004-04-03 20:20:28.000000000 -0800 @@ -31,6 +31,7 @@ /************************************************************************/ #include +#include struct pci_dev; /* For Forward Reference */ struct iSeries_Device_Node; @@ -71,7 +72,7 @@ /* Converts Virtual Address to Real Address for Hypervisor calls */ /************************************************************************/ -#define REALADDR(virtaddr) (0x8000000000000000 | (virt_to_absolute((u64)virtaddr) )) +#define ISERIES_HV_ADDR(virtaddr) (0x8000000000000000 | virt_to_abs(virtaddr)) /************************************************************************/ /* iSeries Device Information */ diff -urN linux-2.6.5-rc3/include/asm-ppc64/page.h linux-2.6.5/include/asm-ppc64/page.h --- linux-2.6.5-rc3/include/asm-ppc64/page.h 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/include/asm-ppc64/page.h 2004-04-03 20:20:28.000000000 -0800 @@ -38,10 +38,17 @@ #define TASK_HPAGE_END_32 (0xc0000000UL) #define ARCH_HAS_HUGEPAGE_ONLY_RANGE +#define ARCH_HAS_PREPARE_HUGEPAGE_RANGE + +#define is_hugepage_low_range(addr, len) \ + (((addr) > (TASK_HPAGE_BASE_32-(len))) && ((addr) < TASK_HPAGE_END_32)) +#define is_hugepage_high_range(addr, len) \ + (((addr) > (TASK_HPAGE_BASE-(len))) && ((addr) < TASK_HPAGE_END)) + #define is_hugepage_only_range(addr, len) \ - ( ((addr > (TASK_HPAGE_BASE-len)) && (addr < TASK_HPAGE_END)) || \ - (current->mm->context.low_hpages && \ - (addr > (TASK_HPAGE_BASE_32-len)) && (addr < TASK_HPAGE_END_32)) ) + (is_hugepage_high_range((addr), (len)) || \ + (current->mm->context.low_hpages \ + && is_hugepage_low_range((addr), (len)))) #define hugetlb_free_pgtables free_pgtables #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA @@ -212,19 +219,6 @@ #define __va(x) ((void *)((unsigned long)(x) + KERNELBASE)) -/* Given that physical addresses do not map 1-1 to absolute addresses, we - * use these macros to better specify exactly what we want to do. - * The only restriction on their use is that the absolute address - * macros cannot be used until after the LMB structure has been - * initialized in prom.c. -Peter - */ -#define __v2p(x) ((void *) __pa(x)) -#define __v2a(x) ((void *) phys_to_absolute(__pa(x))) -#define __p2a(x) ((void *) phys_to_absolute(x)) -#define __p2v(x) ((void *) __va(x)) -#define __a2p(x) ((void *) absolute_to_phys(x)) -#define __a2v(x) ((void *) __va(absolute_to_phys(x))) - #ifdef CONFIG_DISCONTIGMEM #define page_to_pfn(page) discontigmem_page_to_pfn(page) #define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn) diff -urN linux-2.6.5-rc3/include/asm-ppc64/pci.h linux-2.6.5/include/asm-ppc64/pci.h --- linux-2.6.5-rc3/include/asm-ppc64/pci.h 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/include/asm-ppc64/pci.h 2004-04-03 20:20:28.000000000 -0800 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -169,10 +170,9 @@ return 0; } -#define PCI_DMA_ERROR_CODE (~(dma_addr_t)0x0) static inline int pci_dma_mapping_error(dma_addr_t dma_addr) { - return (dma_addr == PCI_DMA_ERROR_CODE); + return dma_mapping_error(dma_addr); } extern int pci_domain_nr(struct pci_bus *bus); diff -urN linux-2.6.5-rc3/include/asm-ppc64/vio.h linux-2.6.5/include/asm-ppc64/vio.h --- linux-2.6.5-rc3/include/asm-ppc64/vio.h 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/include/asm-ppc64/vio.h 2004-04-03 20:20:28.000000000 -0800 @@ -11,13 +11,14 @@ * 2 of the License, or (at your option) any later version. */ -#ifndef _VIO_H -#define _VIO_H +#ifndef _ASM_VIO_H +#define _ASM_VIO_H #include #include #include #include +#include #include #include #include @@ -137,4 +138,9 @@ return container_of(dev, struct vio_dev, dev); } -#endif /* _PHYP_H */ +static inline int vio_dma_mapping_error(dma_addr_t dma_addr) +{ + return dma_mapping_error(dma_addr); +} + +#endif /* _ASM_VIO_H */ diff -urN linux-2.6.5-rc3/include/asm-s390/pgtable.h linux-2.6.5/include/asm-s390/pgtable.h --- linux-2.6.5-rc3/include/asm-s390/pgtable.h 2004-03-10 18:55:42.000000000 -0800 +++ linux-2.6.5/include/asm-s390/pgtable.h 2004-04-03 20:20:28.000000000 -0800 @@ -719,14 +719,14 @@ * information in the lowcore. * Bit 21 and bit 22 are the page invalid bit and the page protection * bit. We set both to indicate a swapped page. - * Bit 31 is used as the software page present bit. If a page is - * swapped this obviously has to be zero. - * This leaves the bits 1-19 and bits 24-30 to store type and offset. - * We use the 7 bits from 24-30 for the type and the 19 bits from 1-19 - * for the offset. - * 0| offset |0110|type |0 - * 00000000001111111111222222222233 - * 01234567890123456789012345678901 + * Bit 30 and 31 are used to distinguish the different page types. For + * a swapped page these bits need to be zero. + * This leaves the bits 1-19 and bits 24-29 to store type and offset. + * We use the 5 bits from 25-29 for the type and the 20 bits from 1-19 + * plus 24 for the offset. + * 0| offset |0110|o|type |00| + * 0 0000000001111111111 2222 2 22222 33 + * 0 1234567890123456789 0123 4 56789 01 * * 64 bit swap entry format: * A page-table entry has some bits we have to treat in a special way. @@ -736,29 +736,25 @@ * information in the lowcore. * Bit 53 and bit 54 are the page invalid bit and the page protection * bit. We set both to indicate a swapped page. - * Bit 63 is used as the software page present bit. If a page is - * swapped this obviously has to be zero. - * This leaves the bits 0-51 and bits 56-62 to store type and offset. - * We use the 7 bits from 56-62 for the type and the 52 bits from 0-51 - * for the offset. - * | offset |0110|type |0 - * 0000000000111111111122222222223333333333444444444455555555556666 - * 0123456789012345678901234567890123456789012345678901234567890123 + * Bit 62 and 63 are used to distinguish the different page types. For + * a swapped page these bits need to be zero. + * This leaves the bits 0-51 and bits 56-61 to store type and offset. + * We use the 5 bits from 57-61 for the type and the 53 bits from 0-51 + * plus 56 for the offset. + * | offset |0110|o|type |00| + * 0000000000111111111122222222223333333333444444444455 5555 5 55566 66 + * 0123456789012345678901234567890123456789012345678901 2345 6 78901 23 */ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) { pte_t pte; - pte_val(pte) = (type << 1) | (offset << 12) | _PAGE_INVALID_SWAP; -#ifndef __s390x__ - BUG_ON((pte_val(pte) & 0x80000901) != 0); -#else /* __s390x__ */ - BUG_ON((pte_val(pte) & 0x901) != 0); -#endif /* __s390x__ */ + pte_val(pte) = _PAGE_INVALID_SWAP | ((type & 0x1f) << 2) | + ((offset & 1) << 7) | ((offset & 0xffffe) << 11); return pte; } -#define __swp_type(entry) (((entry).val >> 1) & 0x3f) -#define __swp_offset(entry) ((entry).val >> 12) +#define __swp_type(entry) (((entry).val >> 2) & 0x1f) +#define __swp_offset(entry) (((entry).val >> 11) | (((entry).val >> 7) & 1)) #define __swp_entry(type,offset) ((swp_entry_t) { pte_val(mk_swap_pte((type),(offset))) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) diff -urN linux-2.6.5-rc3/include/asm-sparc/asmmacro.h linux-2.6.5/include/asm-sparc/asmmacro.h --- linux-2.6.5-rc3/include/asm-sparc/asmmacro.h 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/include/asm-sparc/asmmacro.h 2004-04-03 20:20:29.000000000 -0800 @@ -18,17 +18,6 @@ #define GET_PROCESSOR4D_ID(reg) \ lda [%g0] ASI_M_VIKING_TMP1, %reg; -/* Blackbox */ -#define GET_PROCESSOR_ID(reg) \ - sethi %hi(___b_smp_processor_id), %reg; \ - sethi %hi(boot_cpu_id), %reg; \ - ldub [%reg + %lo(boot_cpu_id)], %reg; - -#define GET_PROCESSOR_MID(reg) \ - rd %tbr, %reg; \ - srl %reg, 12, %reg; \ - and %reg, 3, %reg; - /* All trap entry points _must_ begin with this macro or else you * lose. It makes sure the kernel has a proper window so that * c-code can be called. diff -urN linux-2.6.5-rc3/include/asm-sparc/smp.h linux-2.6.5/include/asm-sparc/smp.h --- linux-2.6.5-rc3/include/asm-sparc/smp.h 2004-04-03 20:19:55.000000000 -0800 +++ linux-2.6.5/include/asm-sparc/smp.h 2004-04-03 20:20:29.000000000 -0800 @@ -53,8 +53,8 @@ BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) BTFIXUPDEF_CALL(void, smp_message_pass, int, int, unsigned long, int) -BTFIXUPDEF_CALL(int, __smp_processor_id, void) -BTFIXUPDEF_BLACKBOX(smp_processor_id) +BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void) +BTFIXUPDEF_BLACKBOX(hard_smp_processor_id) BTFIXUPDEF_BLACKBOX(load_current) #define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) @@ -129,7 +129,7 @@ "=&r" (cpuid)); See btfixup.h and btfixupprep.c to understand how a blackbox works. */ - __asm__ __volatile__("sethi %%hi(___b_smp_processor_id), %0\n\t" + __asm__ __volatile__("sethi %%hi(___b_hard_smp_processor_id), %0\n\t" "sethi %%hi(boot_cpu_id), %0\n\t" "ldub [%0 + %%lo(boot_cpu_id)], %0\n\t" : "=&r" (cpuid)); @@ -141,7 +141,7 @@ int cpuid; __asm__ __volatile__("mov %%o7, %%g1\n\t" - "call ___f___smp_processor_id\n\t" + "call ___f___hard_smp_processor_id\n\t" " nop\n\t" "mov %%g2, %0\n\t" : "=r"(cpuid) : : "g1", "g2"); return cpuid; diff -urN linux-2.6.5-rc3/include/asm-sparc64/siginfo.h linux-2.6.5/include/asm-sparc64/siginfo.h --- linux-2.6.5-rc3/include/asm-sparc64/siginfo.h 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/include/asm-sparc64/siginfo.h 2004-04-03 20:20:29.000000000 -0800 @@ -8,6 +8,7 @@ #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) #define __ARCH_SI_TRAPNO +#define __ARCH_SI_BAND_T int #include diff -urN linux-2.6.5-rc3/include/asm-x86_64/siginfo.h linux-2.6.5/include/asm-x86_64/siginfo.h --- linux-2.6.5-rc3/include/asm-x86_64/siginfo.h 2004-03-10 18:56:03.000000000 -0800 +++ linux-2.6.5/include/asm-x86_64/siginfo.h 2004-04-03 20:20:29.000000000 -0800 @@ -3,8 +3,6 @@ #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) -#define __ARCH_SI_BAND_T long - #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4) #include diff -urN linux-2.6.5-rc3/include/linux/aio.h linux-2.6.5/include/linux/aio.h --- linux-2.6.5-rc3/include/linux/aio.h 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/include/linux/aio.h 2004-04-03 20:20:29.000000000 -0800 @@ -59,7 +59,7 @@ struct list_head ki_list; /* the aio core uses this * for cancellation */ - void *ki_user_obj; /* pointer to userland's iocb */ + void __user *ki_user_obj; /* pointer to userland's iocb */ __u64 ki_user_data; /* user's data for completion */ loff_t ki_pos; diff -urN linux-2.6.5-rc3/include/linux/hugetlb.h linux-2.6.5/include/linux/hugetlb.h --- linux-2.6.5-rc3/include/linux/hugetlb.h 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/include/linux/hugetlb.h 2004-04-03 20:20:30.000000000 -0800 @@ -19,6 +19,7 @@ void huge_page_release(struct page *); int hugetlb_report_meminfo(char *); int is_hugepage_mem_enough(size_t); +unsigned long hugetlb_total_pages(void); struct page *follow_huge_addr(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write); struct vm_area_struct *hugepage_vma(struct mm_struct *mm, @@ -42,12 +43,23 @@ #define hugetlb_free_pgtables(tlb, prev, start, end) do { } while (0) #endif +#ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE +#define prepare_hugepage_range(addr, len) \ + is_aligned_hugepage_range(addr, len) +#else +int prepare_hugepage_range(unsigned long addr, unsigned long len); +#endif + #else /* !CONFIG_HUGETLB_PAGE */ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) { return 0; } +static inline unsigned long hugetlb_total_pages(void) +{ + return 0; +} #define follow_hugetlb_page(m,v,p,vs,a,b,i) ({ BUG(); 0; }) #define follow_huge_addr(mm, vma, addr, write) 0 @@ -62,6 +74,7 @@ #define mark_mm_hugetlb(mm, vma) do { } while (0) #define follow_huge_pmd(mm, addr, pmd, write) 0 #define is_aligned_hugepage_range(addr, len) 0 +#define prepare_hugepage_range(addr, len) (-EINVAL) #define pmd_huge(x) 0 #define is_hugepage_only_range(addr, len) 0 #define hugetlb_free_pgtables(tlb, prev, start, end) do { } while (0) diff -urN linux-2.6.5-rc3/include/linux/inetdevice.h linux-2.6.5/include/linux/inetdevice.h --- linux-2.6.5-rc3/include/linux/inetdevice.h 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/include/linux/inetdevice.h 2004-03-10 18:55:35.000000000 -0800 @@ -36,8 +36,6 @@ rwlock_t lock; int dead; struct in_ifaddr *ifa_list; /* IP ifaddr chain */ - int mc_initted; - struct ip_mc_list *mc_list; /* IP multicast filter chain */ rwlock_t mc_lock; /* for mc_tomb */ struct ip_mc_list *mc_tomb; diff -urN linux-2.6.5-rc3/include/linux/mm.h linux-2.6.5/include/linux/mm.h --- linux-2.6.5-rc3/include/linux/mm.h 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/include/linux/mm.h 2004-04-03 20:20:30.000000000 -0800 @@ -112,6 +112,9 @@ #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ +/* It makes sense to apply VM_ACCOUNT to this vma. */ +#define VM_MAYACCT(vma) (!!((vma)->vm_flags & VM_HUGETLB)) + #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS #endif diff -urN linux-2.6.5-rc3/include/linux/mmzone.h linux-2.6.5/include/linux/mmzone.h --- linux-2.6.5-rc3/include/linux/mmzone.h 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/include/linux/mmzone.h 2004-04-03 20:20:30.000000000 -0800 @@ -299,7 +299,7 @@ struct ctl_table; struct file; int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, - void *, size_t *); + void __user *, size_t *); #include /* Returns the number of the current Node. */ diff -urN linux-2.6.5-rc3/include/linux/netfilter_ipv4/ip_conntrack.h linux-2.6.5/include/linux/netfilter_ipv4/ip_conntrack.h --- linux-2.6.5-rc3/include/linux/netfilter_ipv4/ip_conntrack.h 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.5/include/linux/netfilter_ipv4/ip_conntrack.h 2004-04-03 20:20:30.000000000 -0800 @@ -156,7 +156,8 @@ union ip_conntrack_expect_help help; }; -#include +struct ip_conntrack_helper; + struct ip_conntrack { /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, diff -urN linux-2.6.5-rc3/include/linux/pci_ids.h linux-2.6.5/include/linux/pci_ids.h --- linux-2.6.5-rc3/include/linux/pci_ids.h 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/include/linux/pci_ids.h 2004-04-03 20:20:30.000000000 -0800 @@ -1634,8 +1634,9 @@ #define PCI_SUBDEVICE_ID_CHASE_PCIRAS8 0xF010 #define PCI_VENDOR_ID_AUREAL 0x12eb -#define PCI_DEVICE_ID_AUREAL_VORTEX_1 0x0001 -#define PCI_DEVICE_ID_AUREAL_VORTEX_2 0x0002 +#define PCI_DEVICE_ID_AUREAL_VORTEX 0x0001 +#define PCI_DEVICE_ID_AUREAL_VORTEX2 0x0002 +#define PCI_DEVICE_ID_AUREAL_ADVANTAGE 0x0003 #define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8 #define PCI_DEVICE_ID_LML_33R10 0x8a02 diff -urN linux-2.6.5-rc3/include/linux/sched.h linux-2.6.5/include/linux/sched.h --- linux-2.6.5-rc3/include/linux/sched.h 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/include/linux/sched.h 2004-04-03 20:20:30.000000000 -0800 @@ -179,7 +179,9 @@ struct namespace; /* Maximum number of active map areas.. This is a random (large) number */ -#define MAX_MAP_COUNT (65536) +#define DEFAULT_MAX_MAP_COUNT 65536 + +extern int sysctl_max_map_count; #include diff -urN linux-2.6.5-rc3/include/linux/swapops.h linux-2.6.5/include/linux/swapops.h --- linux-2.6.5-rc3/include/linux/swapops.h 2004-03-10 18:55:20.000000000 -0800 +++ linux-2.6.5/include/linux/swapops.h 2004-04-03 20:20:31.000000000 -0800 @@ -15,11 +15,11 @@ /* * Store a type+offset into a swp_entry_t in an arch-independent format */ -static inline swp_entry_t swp_entry(unsigned type, pgoff_t offset) +static inline swp_entry_t swp_entry(unsigned long type, pgoff_t offset) { swp_entry_t ret; - ret.val = ((unsigned long)type << SWP_TYPE_SHIFT(ret)) | + ret.val = (type << SWP_TYPE_SHIFT(ret)) | (offset & SWP_OFFSET_MASK(ret)); return ret; } diff -urN linux-2.6.5-rc3/include/linux/syscalls.h linux-2.6.5/include/linux/syscalls.h --- linux-2.6.5-rc3/include/linux/syscalls.h 2004-03-10 18:55:54.000000000 -0800 +++ linux-2.6.5/include/linux/syscalls.h 2004-04-03 20:20:31.000000000 -0800 @@ -60,8 +60,8 @@ #include #include -asmlinkage long sys_time(int *tloc); -asmlinkage long sys_stime(time_t *tptr); +asmlinkage long sys_time(int __user *tloc); +asmlinkage long sys_stime(time_t __user *tptr); asmlinkage long sys_gettimeofday(struct timeval __user *tv, struct timezone __user *tz); asmlinkage long sys_settimeofday(struct timeval __user *tv, @@ -71,7 +71,7 @@ asmlinkage long sys_times(struct tms __user *tbuf); asmlinkage long sys_gettid(void); -asmlinkage long sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp); +asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp); asmlinkage unsigned long sys_alarm(unsigned int seconds); asmlinkage long sys_getpid(void); asmlinkage long sys_getppid(void); @@ -79,8 +79,8 @@ asmlinkage long sys_geteuid(void); asmlinkage long sys_getgid(void); asmlinkage long sys_getegid(void); -asmlinkage long sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); -asmlinkage long sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); +asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid); +asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid); asmlinkage long sys_getpgid(pid_t pid); asmlinkage long sys_getpgrp(void); asmlinkage long sys_getsid(pid_t pid); @@ -98,7 +98,7 @@ asmlinkage long sys_setsid(void); asmlinkage long sys_setgroups(int gidsetsize, gid_t __user *grouplist); -asmlinkage long sys_acct(const char *name); +asmlinkage long sys_acct(const char __user *name); asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr); asmlinkage long sys_capset(cap_user_header_t header, @@ -157,8 +157,8 @@ asmlinkage long sys_exit(int error_code); asmlinkage void sys_exit_group(int error_code); asmlinkage long sys_wait4(pid_t pid, unsigned int *stat_addr, - int options, struct rusage *ru); -asmlinkage long sys_waitpid(pid_t pid, unsigned int *stat_addr, int options); + int options, struct rusage __user *ru); +asmlinkage long sys_waitpid(pid_t pid, unsigned int __user *stat_addr, int options); asmlinkage long sys_set_tid_address(int __user *tidptr); asmlinkage long sys_futex(u32 __user *uaddr, int op, int val, struct timespec __user *utime, u32 __user *uaddr2); @@ -274,7 +274,7 @@ unsigned dev); asmlinkage long sys_link(const char __user *oldname, const char __user *newname); -asmlinkage long sys_symlink(const char *old, const char *new); +asmlinkage long sys_symlink(const char __user *old, const char __user *new); asmlinkage long sys_unlink(const char __user *pathname); asmlinkage long sys_rename(const char __user *oldname, const char __user *newname); @@ -292,17 +292,17 @@ asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); asmlinkage long sys_flock(unsigned int fd, unsigned int cmd); -asmlinkage long sys_io_setup(unsigned nr_reqs, aio_context_t *ctx); +asmlinkage long sys_io_setup(unsigned nr_reqs, aio_context_t __user *ctx); asmlinkage long sys_io_destroy(aio_context_t ctx); asmlinkage long sys_io_getevents(aio_context_t ctx_id, long min_nr, long nr, - struct io_event *events, - struct timespec *timeout); + struct io_event __user *events, + struct timespec __user *timeout); asmlinkage long sys_io_submit(aio_context_t, long, - struct iocb __user **); -asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb *iocb, - struct io_event *result); + struct iocb __user * __user *); +asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, + struct io_event __user *result); asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, size_t count); asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, @@ -321,9 +321,9 @@ uid_t user, gid_t group); asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group); #ifdef CONFIG_UID16 -asmlinkage long sys_chown16(const char *filename, +asmlinkage long sys_chown16(const char __user *filename, old_uid_t user, old_gid_t group); -asmlinkage long sys_lchown16(const char *filename, +asmlinkage long sys_lchown16(const char __user *filename, old_uid_t user, old_gid_t group); asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group); asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid); @@ -331,11 +331,11 @@ asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid); asmlinkage long sys_setuid16(old_uid_t uid); asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid); -asmlinkage long sys_getresuid16(old_uid_t *ruid, - old_uid_t *euid, old_uid_t *suid); +asmlinkage long sys_getresuid16(old_uid_t __user *ruid, + old_uid_t __user *euid, old_uid_t __user *suid); asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid); -asmlinkage long sys_getresgid16(old_gid_t *rgid, - old_gid_t *egid, old_gid_t *sgid); +asmlinkage long sys_getresgid16(old_gid_t __user *rgid, + old_gid_t __user *egid, old_gid_t __user *sgid); asmlinkage long sys_setfsuid16(old_uid_t uid); asmlinkage long sys_setfsgid16(old_gid_t gid); asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist); @@ -375,8 +375,8 @@ asmlinkage long sys_chdir(const char __user *filename); asmlinkage long sys_fchdir(unsigned int fd); asmlinkage long sys_rmdir(const char __user *pathname); -asmlinkage long sys_lookup_dcookie(u64 cookie64, char *buf, size_t len); -asmlinkage long sys_quotactl(unsigned int cmd, const char *special, +asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user *buf, size_t len); +asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t id, caddr_t addr); asmlinkage long sys_getdents(unsigned int fd, struct linux_dirent __user *dirent, @@ -445,7 +445,7 @@ unsigned nsops, const struct timespec __user *timeout); asmlinkage long sys_shmat(int shmid, char __user *shmaddr, - int shmflg, unsigned long *addr); + int shmflg, unsigned long __user *addr); asmlinkage long sys_shmget(key_t key, size_t size, int flag); asmlinkage long sys_shmdt(char __user *shmaddr); asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); @@ -453,10 +453,10 @@ asmlinkage long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn); asmlinkage long sys_pciconfig_read(unsigned long bus, unsigned long dfn, unsigned long off, unsigned long len, - void *buf); + void __user *buf); asmlinkage long sys_pciconfig_write(unsigned long bus, unsigned long dfn, unsigned long off, unsigned long len, - void *buf); + void __user *buf); asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5); diff -urN linux-2.6.5-rc3/include/linux/sysctl.h linux-2.6.5/include/linux/sysctl.h --- linux-2.6.5-rc3/include/linux/sysctl.h 2004-03-10 18:55:28.000000000 -0800 +++ linux-2.6.5/include/linux/sysctl.h 2004-04-03 20:20:31.000000000 -0800 @@ -158,6 +158,7 @@ VM_SWAPPINESS=19, /* Tendency to steal mapped memory */ VM_LOWER_ZONE_PROTECTION=20,/* Amount of protection of lower zones */ VM_MIN_FREE_KBYTES=21, /* Minimum free kilobytes to maintain */ + VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */ }; diff -urN linux-2.6.5-rc3/include/sound/ac97_codec.h linux-2.6.5/include/sound/ac97_codec.h --- linux-2.6.5-rc3/include/sound/ac97_codec.h 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/include/sound/ac97_codec.h 2004-04-03 20:20:32.000000000 -0800 @@ -460,7 +460,7 @@ } static inline int ac97_is_rev22(ac97_t * ac97) { - return (ac97->ext_id & AC97_EI_REV_MASK) == AC97_EI_REV_22; + return (ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_22; } static inline int ac97_can_amap(ac97_t * ac97) { diff -urN linux-2.6.5-rc3/include/sound/cs8427.h linux-2.6.5/include/sound/cs8427.h --- linux-2.6.5-rc3/include/sound/cs8427.h 2004-03-10 18:55:34.000000000 -0800 +++ linux-2.6.5/include/sound/cs8427.h 2004-04-03 20:20:32.000000000 -0800 @@ -187,7 +187,8 @@ #define CS8427_VER8427A 0x71 int snd_cs8427_detect(snd_i2c_bus_t *bus, unsigned char addr); -int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr, snd_i2c_device_t **r_cs8427); +int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr, + unsigned int reset_timeout, snd_i2c_device_t **r_cs8427); void snd_cs8427_reset(snd_i2c_device_t *cs8427); int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned char val); int snd_cs8427_reg_read(snd_i2c_device_t *device, unsigned char reg); diff -urN linux-2.6.5-rc3/include/sound/pcm.h linux-2.6.5/include/sound/pcm.h --- linux-2.6.5-rc3/include/sound/pcm.h 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/include/sound/pcm.h 2004-04-03 20:20:32.000000000 -0800 @@ -428,7 +428,7 @@ snd_info_entry_t *proc_root; snd_info_entry_t *proc_info_entry; #ifdef CONFIG_SND_DEBUG - unsigned int xrun_debug: 1; + unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ snd_info_entry_t *proc_xrun_debug_entry; #endif }; diff -urN linux-2.6.5-rc3/include/sound/version.h linux-2.6.5/include/sound/version.h --- linux-2.6.5-rc3/include/sound/version.h 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/include/sound/version.h 2004-04-03 20:20:32.000000000 -0800 @@ -1,3 +1,3 @@ /* include/version.h. Generated by configure. */ -#define CONFIG_SND_VERSION "1.0.3" -#define CONFIG_SND_DATE " (Mon Mar 01 10:12:14 2004 UTC)" +#define CONFIG_SND_VERSION "1.0.4rc2" +#define CONFIG_SND_DATE " (Tue Mar 30 08:19:30 2004 UTC)" diff -urN linux-2.6.5-rc3/init/main.c linux-2.6.5/init/main.c --- linux-2.6.5-rc3/init/main.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/init/main.c 2004-04-03 20:20:32.000000000 -0800 @@ -409,6 +409,7 @@ * enable them */ lock_kernel(); + page_address_init(); printk(linux_banner); setup_arch(&command_line); setup_per_cpu_areas(); @@ -452,7 +453,6 @@ initrd_start = 0; } #endif - page_address_init(); mem_init(); kmem_cache_init(); if (late_time_init) diff -urN linux-2.6.5-rc3/kernel/exec_domain.c linux-2.6.5/kernel/exec_domain.c --- linux-2.6.5-rc3/kernel/exec_domain.c 2004-03-10 18:55:34.000000000 -0800 +++ linux-2.6.5/kernel/exec_domain.c 2004-04-03 20:20:32.000000000 -0800 @@ -170,7 +170,7 @@ fsp = copy_fs_struct(current->fs); if (fsp == NULL) { module_put(ep->module); - return -ENOMEM;; + return -ENOMEM; } task_lock(current); @@ -213,7 +213,7 @@ asmlinkage long sys_personality(u_long personality) { - u_long old = current->personality;; + u_long old = current->personality; if (personality != 0xffffffff) { set_personality(personality); diff -urN linux-2.6.5-rc3/kernel/signal.c linux-2.6.5/kernel/signal.c --- linux-2.6.5-rc3/kernel/signal.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/kernel/signal.c 2004-04-03 20:20:32.000000000 -0800 @@ -157,7 +157,7 @@ sigtestsetmask(¤t->signal->shared_pending.signal, \ M(SIGCONT) | M(SIGKILL))) -static inline int sig_ignored(struct task_struct *t, int sig) +static int sig_ignored(struct task_struct *t, int sig) { void * handler; @@ -532,7 +532,7 @@ * No need to set need_resched since signal event passing * goes through ->blocked */ -inline void signal_wake_up(struct task_struct *t, int resume) +void signal_wake_up(struct task_struct *t, int resume) { unsigned int mask; @@ -837,7 +837,7 @@ && (task_curr(p) || !signal_pending(p))) -static inline void +static void __group_complete_signal(int sig, struct task_struct *p, unsigned int mask) { struct task_struct *t; @@ -940,7 +940,7 @@ return; } -static inline int +static int __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) { unsigned int mask; @@ -1375,7 +1375,7 @@ * Joy. Or not. Pthread wants us to wake up every thread * in our parent group. */ -static inline void __wake_up_parent(struct task_struct *p, +static void __wake_up_parent(struct task_struct *p, struct task_struct *parent) { struct task_struct *tsk = parent; diff -urN linux-2.6.5-rc3/kernel/softirq.c linux-2.6.5/kernel/softirq.c --- linux-2.6.5-rc3/kernel/softirq.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/kernel/softirq.c 2004-04-03 20:20:32.000000000 -0800 @@ -331,7 +331,7 @@ cond_resched(); } - __set_current_state(TASK_INTERRUPTIBLE); + set_current_state(TASK_INTERRUPTIBLE); } __set_current_state(TASK_RUNNING); return 0; @@ -339,10 +339,10 @@ wait_to_die: preempt_enable(); /* Wait for kthread_stop */ - __set_current_state(TASK_INTERRUPTIBLE); + set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { schedule(); - __set_current_state(TASK_INTERRUPTIBLE); + set_current_state(TASK_INTERRUPTIBLE); } __set_current_state(TASK_RUNNING); return 0; diff -urN linux-2.6.5-rc3/kernel/stop_machine.c linux-2.6.5/kernel/stop_machine.c --- linux-2.6.5-rc3/kernel/stop_machine.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/kernel/stop_machine.c 2004-04-03 20:20:32.000000000 -0800 @@ -149,10 +149,12 @@ complete(&smdata->done); /* Wait for kthread_stop */ + __set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { - __set_current_state(TASK_INTERRUPTIBLE); schedule(); + __set_current_state(TASK_INTERRUPTIBLE); } + __set_current_state(TASK_RUNNING); return ret; } diff -urN linux-2.6.5-rc3/kernel/sysctl.c linux-2.6.5/kernel/sysctl.c --- linux-2.6.5-rc3/kernel/sysctl.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/kernel/sysctl.c 2004-04-03 20:20:32.000000000 -0800 @@ -736,6 +736,14 @@ .strategy = &sysctl_intvec, .extra1 = &zero, }, + { + .ctl_name = VM_MAX_MAP_COUNT, + .procname = "max_map_count", + .data = &sysctl_max_map_count, + .maxlen = sizeof(sysctl_max_map_count), + .mode = 0644, + .proc_handler = &proc_dointvec + }, { .ctl_name = 0 } }; diff -urN linux-2.6.5-rc3/kernel/timer.c linux-2.6.5/kernel/timer.c --- linux-2.6.5-rc3/kernel/timer.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/kernel/timer.c 2004-04-03 20:20:32.000000000 -0800 @@ -1059,7 +1059,7 @@ static long nanosleep_restart(struct restart_block *restart) { unsigned long expire = restart->arg0, now = jiffies; - struct timespec *rmtp = (struct timespec *) restart->arg1; + struct timespec __user *rmtp = (struct timespec __user *) restart->arg1; long ret; /* Did it expire while we handled signals? */ @@ -1082,7 +1082,7 @@ return ret; } -asmlinkage long sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp) +asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp) { struct timespec t; unsigned long expire; diff -urN linux-2.6.5-rc3/kernel/uid16.c linux-2.6.5/kernel/uid16.c --- linux-2.6.5-rc3/kernel/uid16.c 2004-03-10 18:55:28.000000000 -0800 +++ linux-2.6.5/kernel/uid16.c 2004-04-03 20:20:32.000000000 -0800 @@ -17,12 +17,12 @@ #include -asmlinkage long sys_chown16(const char * filename, old_uid_t user, old_gid_t group) +asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gid_t group) { return sys_chown(filename, low2highuid(user), low2highgid(group)); } -asmlinkage long sys_lchown16(const char * filename, old_uid_t user, old_gid_t group) +asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_gid_t group) { return sys_lchown(filename, low2highuid(user), low2highgid(group)); } @@ -58,7 +58,7 @@ low2highuid(suid)); } -asmlinkage long sys_getresuid16(old_uid_t *ruid, old_uid_t *euid, old_uid_t *suid) +asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, old_uid_t __user *suid) { int retval; @@ -75,7 +75,7 @@ low2highgid(sgid)); } -asmlinkage long sys_getresgid16(old_gid_t *rgid, old_gid_t *egid, old_gid_t *sgid) +asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, old_gid_t __user *sgid) { int retval; diff -urN linux-2.6.5-rc3/lib/bitmap.c linux-2.6.5/lib/bitmap.c --- linux-2.6.5-rc3/lib/bitmap.c 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/lib/bitmap.c 2004-04-03 20:20:33.000000000 -0800 @@ -47,7 +47,7 @@ int bitmap_equal(const unsigned long *bitmap1, unsigned long *bitmap2, int bits) { - int k, lim = bits/BITS_PER_LONG;; + int k, lim = bits/BITS_PER_LONG; for (k = 0; k < lim; ++k) if (bitmap1[k] != bitmap2[k]) return 0; diff -urN linux-2.6.5-rc3/mm/mmap.c linux-2.6.5/mm/mmap.c --- linux-2.6.5-rc3/mm/mmap.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/mm/mmap.c 2004-04-03 20:20:33.000000000 -0800 @@ -54,10 +54,12 @@ int sysctl_overcommit_memory = 0; /* default is heuristic overcommit */ int sysctl_overcommit_ratio = 50; /* default is 50% */ +int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT; atomic_t vm_committed_space = ATOMIC_INIT(0); EXPORT_SYMBOL(sysctl_overcommit_memory); EXPORT_SYMBOL(sysctl_overcommit_ratio); +EXPORT_SYMBOL(sysctl_max_map_count); EXPORT_SYMBOL(vm_committed_space); /* @@ -489,9 +491,13 @@ int correct_wcount = 0; int error; struct rb_node ** rb_link, * rb_parent; + int accountable = 1; unsigned long charged = 0; if (file) { + if (is_file_hugepages(file)) + accountable = 0; + if (!file->f_op || !file->f_op->mmap) return -ENODEV; @@ -512,7 +518,7 @@ return -EINVAL; /* Too many mappings? */ - if (mm->map_count > MAX_MAP_COUNT) + if (mm->map_count > sysctl_max_map_count) return -ENOMEM; /* Obtain the address to map to. we verify (or select) it and ensure @@ -608,7 +614,8 @@ > current->rlim[RLIMIT_AS].rlim_cur) return -ENOMEM; - if (!(flags & MAP_NORESERVE) || sysctl_overcommit_memory > 1) { + if (accountable && (!(flags & MAP_NORESERVE) || + sysctl_overcommit_memory > 1)) { if (vm_flags & VM_SHARED) { /* Check memory availability in shmem_file_setup? */ vm_flags |= VM_ACCOUNT; @@ -807,9 +814,10 @@ return -EINVAL; if (file && is_file_hugepages(file)) { /* - * Make sure that addr and length are properly aligned. + * Check if the given range is hugepage aligned, and + * can be made suitable for hugepages. */ - ret = is_aligned_hugepage_range(addr, len); + ret = prepare_hugepage_range(addr, len); } else { /* * Ensure that a normal request is not falling in a @@ -1197,7 +1205,7 @@ struct vm_area_struct *new; struct address_space *mapping = NULL; - if (mm->map_count >= MAX_MAP_COUNT) + if (mm->map_count >= sysctl_max_map_count) return -ENOMEM; new = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); @@ -1375,7 +1383,7 @@ > current->rlim[RLIMIT_AS].rlim_cur) return -ENOMEM; - if (mm->map_count > MAX_MAP_COUNT) + if (mm->map_count > sysctl_max_map_count) return -ENOMEM; if (security_vm_enough_memory(len >> PAGE_SHIFT)) diff -urN linux-2.6.5-rc3/mm/mprotect.c linux-2.6.5/mm/mprotect.c --- linux-2.6.5-rc3/mm/mprotect.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/mm/mprotect.c 2004-04-03 20:20:33.000000000 -0800 @@ -173,7 +173,8 @@ * a MAP_NORESERVE private mapping to writable will now reserve. */ if (newflags & VM_WRITE) { - if (!(vma->vm_flags & (VM_ACCOUNT|VM_WRITE|VM_SHARED))) { + if (!(vma->vm_flags & (VM_ACCOUNT|VM_WRITE|VM_SHARED)) + && VM_MAYACCT(vma)) { charged = (end - start) >> PAGE_SHIFT; if (security_vm_enough_memory(charged)) return -ENOMEM; diff -urN linux-2.6.5-rc3/mm/page_alloc.c linux-2.6.5/mm/page_alloc.c --- linux-2.6.5-rc3/mm/page_alloc.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/mm/page_alloc.c 2004-04-03 20:20:33.000000000 -0800 @@ -1044,13 +1044,16 @@ K(nr_free_highpages())); printk("Active:%lu inactive:%lu dirty:%lu writeback:%lu " - "unstable:%lu free:%u\n", + "unstable:%lu free:%u slab:%lu mapped:%lu pagetables:%lu\n", active, inactive, ps.nr_dirty, ps.nr_writeback, ps.nr_unstable, - nr_free_pages()); + nr_free_pages(), + ps.nr_slab, + ps.nr_mapped, + ps.nr_page_table_pages); for_each_zone(zone) { show_node(zone); diff -urN linux-2.6.5-rc3/mm/pdflush.c linux-2.6.5/mm/pdflush.c --- linux-2.6.5-rc3/mm/pdflush.c 2004-03-10 18:55:55.000000000 -0800 +++ linux-2.6.5/mm/pdflush.c 2004-04-03 20:20:33.000000000 -0800 @@ -172,6 +172,12 @@ static int pdflush(void *dummy) { struct pdflush_work my_work; + + /* + * pdflush can spend a lot of time doing encryption via dm-crypt. We + * don't want to do that at keventd's priority. + */ + set_user_nice(current, 0); return __pdflush(&my_work); } diff -urN linux-2.6.5-rc3/mm/swapfile.c linux-2.6.5/mm/swapfile.c --- linux-2.6.5-rc3/mm/swapfile.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/mm/swapfile.c 2004-04-03 20:20:33.000000000 -0800 @@ -1242,7 +1242,19 @@ if (!(p->flags & SWP_USED)) break; error = -EPERM; - if (type >= MAX_SWAPFILES) { + /* + * Test if adding another swap device is possible. There are + * two limiting factors: 1) the number of bits for the swap + * type swp_entry_t definition and 2) the number of bits for + * the swap type in the swap ptes as defined by the different + * architectures. To honor both limitations a swap entry + * with swap offset 0 and swap type ~0UL is created, encoded + * to a swap pte, decoded to a swp_entry_t again and finally + * the swap type part is extracted. This will mask all bits + * from the initial ~0UL that can't be encoded in either the + * swp_entry_t or the architecture definition of a swap pte. + */ + if (type > swp_type(pte_to_swp_entry(swp_entry_to_pte(swp_entry(~0UL,0))))) { swap_list_unlock(); goto out; } @@ -1364,7 +1376,21 @@ } p->lowest_bit = 1; - maxpages = swp_offset(swp_entry(0,~0UL)) - 1; + /* + * Find out how many pages are allowed for a single swap + * device. There are two limiting factors: 1) the number of + * bits for the swap offset in the swp_entry_t type and + * 2) the number of bits in the a swap pte as defined by + * the different architectures. In order to find the + * largest possible bit mask a swap entry with swap type 0 + * and swap offset ~0UL is created, encoded to a swap pte, + * decoded to a swp_entry_t again and finally the swap + * offset is extracted. This will mask all the bits from + * the initial ~0UL mask that can't be encoded in either + * the swp_entry_t or the architecture definition of a + * swap pte. + */ + maxpages = swp_offset(pte_to_swp_entry(swp_entry_to_pte(swp_entry(0,~0UL)))) - 1; if (maxpages > swap_header->info.last_page) maxpages = swap_header->info.last_page; p->highest_bit = maxpages - 1; diff -urN linux-2.6.5-rc3/net/Makefile linux-2.6.5/net/Makefile --- linux-2.6.5-rc3/net/Makefile 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/net/Makefile 2004-04-03 20:20:33.000000000 -0800 @@ -16,7 +16,9 @@ obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/ obj-$(CONFIG_INET) += ipv4/ xfrm/ obj-$(CONFIG_UNIX) += unix/ -obj-$(CONFIG_IPV6) += ipv6/ +ifneq ($(CONFIG_IPV6),) +obj-y += ipv6/ +endif obj-$(CONFIG_PACKET) += packet/ obj-$(CONFIG_NET_KEY) += key/ obj-$(CONFIG_NET_SCHED) += sched/ diff -urN linux-2.6.5-rc3/net/atm/mpoa_proc.c linux-2.6.5/net/atm/mpoa_proc.c --- linux-2.6.5-rc3/net/atm/mpoa_proc.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/net/atm/mpoa_proc.c 2004-04-03 20:20:33.000000000 -0800 @@ -103,7 +103,7 @@ size_t count, loff_t *pos){ unsigned long page = 0; unsigned char *temp; - ssize_t length = 0; + int length = 0; int i = 0; struct mpoa_client *mpc = mpcs; in_cache_entry *in_entry; diff -urN linux-2.6.5-rc3/net/ipv4/devinet.c linux-2.6.5/net/ipv4/devinet.c --- linux-2.6.5-rc3/net/ipv4/devinet.c 2004-03-10 18:55:23.000000000 -0800 +++ linux-2.6.5/net/ipv4/devinet.c 2004-04-03 20:20:33.000000000 -0800 @@ -165,6 +165,7 @@ #ifdef CONFIG_SYSCTL devinet_sysctl_register(in_dev, &in_dev->cnf); #endif + ip_mc_init_dev(in_dev); if (dev->flags & IFF_UP) ip_mc_up(in_dev); out: diff -urN linux-2.6.5-rc3/net/ipv4/igmp.c linux-2.6.5/net/ipv4/igmp.c --- linux-2.6.5-rc3/net/ipv4/igmp.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/net/ipv4/igmp.c 2004-04-03 20:20:33.000000000 -0800 @@ -1217,8 +1217,8 @@ ASSERT_RTNL(); - if (!in_dev->mc_initted) - return; + for (i=in_dev->mc_list; i; i=i->next) + igmp_group_dropped(i); #ifdef CONFIG_IP_MULTICAST in_dev->mr_ifc_count = 0; @@ -1227,24 +1227,14 @@ in_dev->mr_gq_running = 0; if (del_timer(&in_dev->mr_gq_timer)) __in_dev_put(in_dev); -#endif - - for (i=in_dev->mc_list; i; i=i->next) - igmp_group_dropped(i); - -#ifdef CONFIG_IP_MULTICAST igmpv3_clear_delrec(in_dev); #endif ip_mc_dec_group(in_dev, IGMP_ALL_HOSTS); } -/* Device going up */ - -void ip_mc_up(struct in_device *in_dev) +void ip_mc_init_dev(struct in_device *in_dev) { - struct ip_mc_list *i; - ASSERT_RTNL(); in_dev->mc_tomb = 0; @@ -1261,12 +1251,20 @@ #endif in_dev->mc_lock = RW_LOCK_UNLOCKED; +} + +/* Device going up */ + +void ip_mc_up(struct in_device *in_dev) +{ + struct ip_mc_list *i; + + ASSERT_RTNL(); + ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); for (i=in_dev->mc_list; i; i=i->next) igmp_group_added(i); - - in_dev->mc_initted = 1; } /* diff -urN linux-2.6.5-rc3/net/ipv4/netfilter/ip_nat_snmp_basic.c linux-2.6.5/net/ipv4/netfilter/ip_nat_snmp_basic.c --- linux-2.6.5-rc3/net/ipv4/netfilter/ip_nat_snmp_basic.c 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/net/ipv4/netfilter/ip_nat_snmp_basic.c 2004-04-03 20:20:34.000000000 -0800 @@ -899,10 +899,10 @@ goto err_addr_free; if (cls != ASN1_UNI || con != ASN1_PRI || tag != ASN1_INT) - goto err_addr_free;; + goto err_addr_free; if (!asn1_uint_decode(ctx, end, &trap->general)) - goto err_addr_free;; + goto err_addr_free; if (!asn1_header_decode(ctx, &end, &cls, &con, &tag)) goto err_addr_free; diff -urN linux-2.6.5-rc3/net/ipv4/netfilter/ip_nat_standalone.c linux-2.6.5/net/ipv4/netfilter/ip_nat_standalone.c --- linux-2.6.5-rc3/net/ipv4/netfilter/ip_nat_standalone.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/net/ipv4/netfilter/ip_nat_standalone.c 2004-04-03 20:20:34.000000000 -0800 @@ -124,7 +124,16 @@ WRITE_LOCK(&ip_nat_lock); /* Seen it before? This can happen for loopback, retrans, or local packets.. */ - if (!(info->initialized & (1 << maniptype))) { + if (!(info->initialized & (1 << maniptype)) +#ifndef CONFIG_IP_NF_NAT_LOCAL + /* If this session has already been confirmed we must not + * touch it again even if there is no mapping set up. + * Can only happen on local->local traffic with + * CONFIG_IP_NF_NAT_LOCAL disabled. + */ + && !(ct->status & IPS_CONFIRMED) +#endif + ) { unsigned int ret; if (ct->master diff -urN linux-2.6.5-rc3/net/ipv4/netfilter/ipt_MASQUERADE.c linux-2.6.5/net/ipv4/netfilter/ipt_MASQUERADE.c --- linux-2.6.5-rc3/net/ipv4/netfilter/ipt_MASQUERADE.c 2004-03-10 18:55:34.000000000 -0800 +++ linux-2.6.5/net/ipv4/netfilter/ipt_MASQUERADE.c 2004-04-03 20:20:34.000000000 -0800 @@ -45,7 +45,7 @@ const struct ip_nat_multi_range *mr = targinfo; if (strcmp(tablename, "nat") != 0) { - DEBUGP("masquerade_check: bad table `%s'.\n", table); + DEBUGP("masquerade_check: bad table `%s'.\n", tablename); return 0; } if (targinfosize != IPT_ALIGN(sizeof(*mr))) { diff -urN linux-2.6.5-rc3/net/ipv4/netfilter/ipt_REJECT.c linux-2.6.5/net/ipv4/netfilter/ipt_REJECT.c --- linux-2.6.5-rc3/net/ipv4/netfilter/ipt_REJECT.c 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/net/ipv4/netfilter/ipt_REJECT.c 2004-04-03 20:20:34.000000000 -0800 @@ -24,6 +24,9 @@ #include #include #include +#ifdef CONFIG_BRIDGE_NETFILTER +#include +#endif MODULE_LICENSE("GPL"); MODULE_AUTHOR("Netfilter Core Team "); @@ -56,7 +59,13 @@ struct flowi fl = {}; struct rtable *rt; - if (hook != NF_IP_FORWARD) { + /* We don't require ip forwarding to be enabled to be able to + * send a RST reply for bridged traffic. */ + if (hook != NF_IP_FORWARD +#ifdef CONFIG_BRIDGE_NETFILTER + || (skb->nf_bridge && skb->nf_bridge->mask & BRNF_BRIDGED) +#endif + ) { fl.nl_u.ip4_u.daddr = iph->saddr; if (hook == NF_IP_LOCAL_IN) fl.nl_u.ip4_u.saddr = iph->daddr; diff -urN linux-2.6.5-rc3/net/ipv4/tcp_ipv4.c linux-2.6.5/net/ipv4/tcp_ipv4.c --- linux-2.6.5-rc3/net/ipv4/tcp_ipv4.c 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/net/ipv4/tcp_ipv4.c 2004-04-03 20:20:34.000000000 -0800 @@ -1596,7 +1596,7 @@ newinet->id = newtp->write_seq ^ jiffies; tcp_sync_mss(newsk, dst_pmtu(dst)); - newtp->advmss = dst_metric(dst, RTAX_ADVMSS);; + newtp->advmss = dst_metric(dst, RTAX_ADVMSS); tcp_initialize_rcv_mss(newsk); __tcp_v4_hash(newsk, 0); @@ -1825,12 +1825,15 @@ goto discard_it; do_time_wait: - if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) - goto discard_and_relse; + if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { + tcp_tw_put((struct tcp_tw_bucket *) sk); + goto discard_it; + } if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) { TCP_INC_STATS_BH(TcpInErrs); - goto discard_and_relse; + tcp_tw_put((struct tcp_tw_bucket *) sk); + goto discard_it; } switch (tcp_timewait_state_process((struct tcp_tw_bucket *)sk, skb, th, skb->len)) { diff -urN linux-2.6.5-rc3/net/ipv6/Makefile linux-2.6.5/net/ipv6/Makefile --- linux-2.6.5-rc3/net/ipv6/Makefile 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/net/ipv6/Makefile 2004-04-03 20:20:34.000000000 -0800 @@ -19,3 +19,5 @@ obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o + +obj-y += exthdrs_core.o diff -urN linux-2.6.5-rc3/net/ipv6/exthdrs.c linux-2.6.5/net/ipv6/exthdrs.c --- linux-2.6.5-rc3/net/ipv6/exthdrs.c 2004-03-10 18:55:21.000000000 -0800 +++ linux-2.6.5/net/ipv6/exthdrs.c 2004-04-03 20:20:34.000000000 -0800 @@ -633,105 +633,3 @@ } return opt2; } - - -/* - * find out if nexthdr is a well-known extension header or a protocol - */ - -int ipv6_ext_hdr(u8 nexthdr) -{ - /* - * find out if nexthdr is an extension header or a protocol - */ - return ( (nexthdr == NEXTHDR_HOP) || - (nexthdr == NEXTHDR_ROUTING) || - (nexthdr == NEXTHDR_FRAGMENT) || - (nexthdr == NEXTHDR_AUTH) || - (nexthdr == NEXTHDR_NONE) || - (nexthdr == NEXTHDR_DEST) ); -} - -/* - * Skip any extension headers. This is used by the ICMP module. - * - * Note that strictly speaking this conflicts with RFC 2460 4.0: - * ...The contents and semantics of each extension header determine whether - * or not to proceed to the next header. Therefore, extension headers must - * be processed strictly in the order they appear in the packet; a - * receiver must not, for example, scan through a packet looking for a - * particular kind of extension header and process that header prior to - * processing all preceding ones. - * - * We do exactly this. This is a protocol bug. We can't decide after a - * seeing an unknown discard-with-error flavour TLV option if it's a - * ICMP error message or not (errors should never be send in reply to - * ICMP error messages). - * - * But I see no other way to do this. This might need to be reexamined - * when Linux implements ESP (and maybe AUTH) headers. - * --AK - * - * This function parses (probably truncated) exthdr set "hdr" - * of length "len". "nexthdrp" initially points to some place, - * where type of the first header can be found. - * - * It skips all well-known exthdrs, and returns pointer to the start - * of unparsable area i.e. the first header with unknown type. - * If it is not NULL *nexthdr is updated by type/protocol of this header. - * - * NOTES: - if packet terminated with NEXTHDR_NONE it returns NULL. - * - it may return pointer pointing beyond end of packet, - * if the last recognized header is truncated in the middle. - * - if packet is truncated, so that all parsed headers are skipped, - * it returns NULL. - * - First fragment header is skipped, not-first ones - * are considered as unparsable. - * - ESP is unparsable for now and considered like - * normal payload protocol. - * - Note also special handling of AUTH header. Thanks to IPsec wizards. - * - * --ANK (980726) - */ - -int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, int len) -{ - u8 nexthdr = *nexthdrp; - - while (ipv6_ext_hdr(nexthdr)) { - struct ipv6_opt_hdr hdr; - int hdrlen; - - if (len < (int)sizeof(struct ipv6_opt_hdr)) - return -1; - if (nexthdr == NEXTHDR_NONE) - return -1; - if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) - BUG(); - if (nexthdr == NEXTHDR_FRAGMENT) { - unsigned short frag_off; - if (skb_copy_bits(skb, - start+offsetof(struct frag_hdr, - frag_off), - &frag_off, - sizeof(frag_off))) { - return -1; - } - - if (ntohs(frag_off) & ~0x7) - break; - hdrlen = 8; - } else if (nexthdr == NEXTHDR_AUTH) - hdrlen = (hdr.hdrlen+2)<<2; - else - hdrlen = ipv6_optlen(&hdr); - - nexthdr = hdr.nexthdr; - len -= hdrlen; - start += hdrlen; - } - - *nexthdrp = nexthdr; - return start; -} - diff -urN linux-2.6.5-rc3/net/ipv6/exthdrs_core.c linux-2.6.5/net/ipv6/exthdrs_core.c --- linux-2.6.5-rc3/net/ipv6/exthdrs_core.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.5/net/ipv6/exthdrs_core.c 2004-04-03 20:20:34.000000000 -0800 @@ -0,0 +1,108 @@ +/* + * IPv6 library code, needed by static components when full IPv6 support is + * not configured or static. + */ +#include + +/* + * find out if nexthdr is a well-known extension header or a protocol + */ + +int ipv6_ext_hdr(u8 nexthdr) +{ + /* + * find out if nexthdr is an extension header or a protocol + */ + return ( (nexthdr == NEXTHDR_HOP) || + (nexthdr == NEXTHDR_ROUTING) || + (nexthdr == NEXTHDR_FRAGMENT) || + (nexthdr == NEXTHDR_AUTH) || + (nexthdr == NEXTHDR_NONE) || + (nexthdr == NEXTHDR_DEST) ); +} + +/* + * Skip any extension headers. This is used by the ICMP module. + * + * Note that strictly speaking this conflicts with RFC 2460 4.0: + * ...The contents and semantics of each extension header determine whether + * or not to proceed to the next header. Therefore, extension headers must + * be processed strictly in the order they appear in the packet; a + * receiver must not, for example, scan through a packet looking for a + * particular kind of extension header and process that header prior to + * processing all preceding ones. + * + * We do exactly this. This is a protocol bug. We can't decide after a + * seeing an unknown discard-with-error flavour TLV option if it's a + * ICMP error message or not (errors should never be send in reply to + * ICMP error messages). + * + * But I see no other way to do this. This might need to be reexamined + * when Linux implements ESP (and maybe AUTH) headers. + * --AK + * + * This function parses (probably truncated) exthdr set "hdr" + * of length "len". "nexthdrp" initially points to some place, + * where type of the first header can be found. + * + * It skips all well-known exthdrs, and returns pointer to the start + * of unparsable area i.e. the first header with unknown type. + * If it is not NULL *nexthdr is updated by type/protocol of this header. + * + * NOTES: - if packet terminated with NEXTHDR_NONE it returns NULL. + * - it may return pointer pointing beyond end of packet, + * if the last recognized header is truncated in the middle. + * - if packet is truncated, so that all parsed headers are skipped, + * it returns NULL. + * - First fragment header is skipped, not-first ones + * are considered as unparsable. + * - ESP is unparsable for now and considered like + * normal payload protocol. + * - Note also special handling of AUTH header. Thanks to IPsec wizards. + * + * --ANK (980726) + */ + +int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp, int len) +{ + u8 nexthdr = *nexthdrp; + + while (ipv6_ext_hdr(nexthdr)) { + struct ipv6_opt_hdr hdr; + int hdrlen; + + if (len < (int)sizeof(struct ipv6_opt_hdr)) + return -1; + if (nexthdr == NEXTHDR_NONE) + return -1; + if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) + BUG(); + if (nexthdr == NEXTHDR_FRAGMENT) { + unsigned short frag_off; + if (skb_copy_bits(skb, + start+offsetof(struct frag_hdr, + frag_off), + &frag_off, + sizeof(frag_off))) { + return -1; + } + + if (ntohs(frag_off) & ~0x7) + break; + hdrlen = 8; + } else if (nexthdr == NEXTHDR_AUTH) + hdrlen = (hdr.hdrlen+2)<<2; + else + hdrlen = ipv6_optlen(&hdr); + + nexthdr = hdr.nexthdr; + len -= hdrlen; + start += hdrlen; + } + + *nexthdrp = nexthdr; + return start; +} + +EXPORT_SYMBOL(ipv6_ext_hdr); +EXPORT_SYMBOL(ipv6_skip_exthdr); diff -urN linux-2.6.5-rc3/net/ipv6/ipv6_syms.c linux-2.6.5/net/ipv6/ipv6_syms.c --- linux-2.6.5-rc3/net/ipv6/ipv6_syms.c 2004-03-10 18:55:36.000000000 -0800 +++ linux-2.6.5/net/ipv6/ipv6_syms.c 2004-04-03 20:20:34.000000000 -0800 @@ -41,9 +41,7 @@ #endif EXPORT_SYMBOL(rt6_lookup); EXPORT_SYMBOL(fl6_sock_lookup); -EXPORT_SYMBOL(ipv6_ext_hdr); EXPORT_SYMBOL(ip6_append_data); EXPORT_SYMBOL(ip6_flush_pending_frames); EXPORT_SYMBOL(ip6_push_pending_frames); EXPORT_SYMBOL(ipv6_push_nfrag_opts); -EXPORT_SYMBOL(ipv6_skip_exthdr); diff -urN linux-2.6.5-rc3/net/ipv6/tcp_ipv6.c linux-2.6.5/net/ipv6/tcp_ipv6.c --- linux-2.6.5-rc3/net/ipv6/tcp_ipv6.c 2004-03-10 18:55:28.000000000 -0800 +++ linux-2.6.5/net/ipv6/tcp_ipv6.c 2004-04-03 20:20:34.000000000 -0800 @@ -1639,7 +1639,7 @@ no_tcp_socket: if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) - goto discard_and_relse; + goto discard_it; if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) { bad_packet: @@ -1662,12 +1662,14 @@ goto discard_it; do_time_wait: - if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) - goto discard_and_relse; + if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { + tcp_tw_put((struct tcp_tw_bucket *) sk); + goto discard_it; + } if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) { TCP_INC_STATS_BH(TcpInErrs); - sock_put(sk); + tcp_tw_put((struct tcp_tw_bucket *) sk); goto discard_it; } diff -urN linux-2.6.5-rc3/net/irda/irlan/irlan_filter.c linux-2.6.5/net/irda/irlan/irlan_filter.c --- linux-2.6.5-rc3/net/irda/irlan/irlan_filter.c 2004-03-10 18:55:45.000000000 -0800 +++ linux-2.6.5/net/irda/irlan/irlan_filter.c 2004-04-03 20:20:34.000000000 -0800 @@ -53,7 +53,7 @@ self->provider.mac_address[4] = self->provider.send_arb_val & 0xff; self->provider.mac_address[5] = - (self->provider.send_arb_val >> 8) & 0xff;; + (self->provider.send_arb_val >> 8) & 0xff; } else { /* Just generate something for now */ get_random_bytes(self->provider.mac_address+4, 1); diff -urN linux-2.6.5-rc3/net/irda/irttp.c linux-2.6.5/net/irda/irttp.c --- linux-2.6.5-rc3/net/irda/irttp.c 2004-03-10 18:55:33.000000000 -0800 +++ linux-2.6.5/net/irda/irttp.c 2004-04-03 20:20:34.000000000 -0800 @@ -1271,7 +1271,7 @@ lsap = (struct lsap_cb *) sap; - self->max_seg_size = max_seg_size - TTP_HEADER;; + self->max_seg_size = max_seg_size - TTP_HEADER; self->max_header_size = max_header_size+TTP_HEADER; IRDA_DEBUG(4, "%s(), TSAP sel=%02x\n", __FUNCTION__, self->stsap_sel); diff -urN linux-2.6.5-rc3/net/key/af_key.c linux-2.6.5/net/key/af_key.c --- linux-2.6.5-rc3/net/key/af_key.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/net/key/af_key.c 2004-04-03 20:20:34.000000000 -0800 @@ -1699,7 +1699,7 @@ sin6->sin6_port = xp->selector.sport; sin6->sin6_flowinfo = 0; memcpy(&sin6->sin6_addr, xp->selector.saddr.a6, - sizeof(struct in6_addr));; + sizeof(struct in6_addr)); sin6->sin6_scope_id = 0; } #endif diff -urN linux-2.6.5-rc3/net/packet/af_packet.c linux-2.6.5/net/packet/af_packet.c --- linux-2.6.5-rc3/net/packet/af_packet.c 2004-03-10 18:55:35.000000000 -0800 +++ linux-2.6.5/net/packet/af_packet.c 2004-04-03 20:20:34.000000000 -0800 @@ -34,6 +34,8 @@ * Alexey Kuznetsov : Untied from IPv4 stack. * Cyrus Durgin : Fixed kerneld for kmod. * Michal Ostrowski : Module initialization cleanup. + * Ulises Alonso : Frame number limit removal and + * packet_set_ring memory leak. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -168,30 +170,47 @@ struct packet_opt { + struct tpacket_stats stats; +#ifdef CONFIG_PACKET_MMAP + unsigned long *pg_vec; + unsigned int head; + unsigned int frames_per_block; + unsigned int frame_size; + unsigned int frame_max; + int copy_thresh; +#endif struct packet_type prot_hook; spinlock_t bind_lock; char running; /* prot_hook is attached*/ int ifindex; /* bound device */ unsigned short num; - struct tpacket_stats stats; #ifdef CONFIG_PACKET_MULTICAST struct packet_mclist *mclist; #endif #ifdef CONFIG_PACKET_MMAP atomic_t mapped; - unsigned long *pg_vec; - unsigned int pg_vec_order; + unsigned int pg_vec_order; unsigned int pg_vec_pages; unsigned int pg_vec_len; - - struct tpacket_hdr **iovec; - unsigned int frame_size; - unsigned int iovmax; - unsigned int head; - int copy_thresh; #endif }; +#ifdef CONFIG_PACKET_MMAP + +static inline unsigned long packet_lookup_frame(struct packet_opt *po, unsigned int position) +{ + unsigned int pg_vec_pos, frame_offset; + unsigned long frame; + + pg_vec_pos = position / po->frames_per_block; + frame_offset = position % po->frames_per_block; + + frame = (unsigned long) (po->pg_vec[pg_vec_pos] + (frame_offset * po->frame_size)); + + return frame; +} +#endif + #define pkt_sk(__sk) ((struct packet_opt *)(__sk)->sk_protinfo) void packet_sock_destruct(struct sock *sk) @@ -586,11 +605,11 @@ snaplen = skb->len-skb->data_len; spin_lock(&sk->sk_receive_queue.lock); - h = po->iovec[po->head]; - + h = (struct tpacket_hdr *)packet_lookup_frame(po, po->head); + if (h->tp_status) goto ring_is_full; - po->head = po->head != po->iovmax ? po->head+1 : 0; + po->head = po->head != po->frame_max ? po->head+1 : 0; po->stats.tp_packets++; if (copy_skb) { status |= TP_STATUS_COPY; @@ -1485,10 +1504,13 @@ unsigned int mask = datagram_poll(file, sock, wait); spin_lock_bh(&sk->sk_receive_queue.lock); - if (po->iovec) { - unsigned last = po->head ? po->head-1 : po->iovmax; + if (po->pg_vec) { + unsigned last = po->head ? po->head-1 : po->frame_max; + struct tpacket_hdr *h; - if (po->iovec[last]->tp_status) + h = (struct tpacket_hdr *)packet_lookup_frame(po, last); + + if (h->tp_status) mask |= POLLIN | POLLRDNORM; } spin_unlock_bh(&sk->sk_receive_queue.lock); @@ -1548,16 +1570,18 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing) { unsigned long *pg_vec = NULL; - struct tpacket_hdr **io_vec = NULL; struct packet_opt *po = pkt_sk(sk); int was_running, num, order = 0; int err = 0; - + if (req->tp_block_nr) { int i, l; - int frames_per_block; /* Sanity tests and some calculations */ + + if (po->pg_vec) + return -EBUSY; + if ((int)req->tp_block_size <= 0) return -EINVAL; if (req->tp_block_size&(PAGE_SIZE-1)) @@ -1566,10 +1590,11 @@ return -EINVAL; if (req->tp_frame_size&(TPACKET_ALIGNMENT-1)) return -EINVAL; - frames_per_block = req->tp_block_size/req->tp_frame_size; - if (frames_per_block <= 0) + + po->frames_per_block = req->tp_block_size/req->tp_frame_size; + if (po->frames_per_block <= 0) return -EINVAL; - if (frames_per_block*req->tp_block_nr != req->tp_frame_nr) + if (po->frames_per_block*req->tp_block_nr != req->tp_frame_nr) return -EINVAL; /* OK! */ @@ -1596,20 +1621,16 @@ } /* Page vector is allocated */ - /* Draw frames */ - io_vec = kmalloc(req->tp_frame_nr*sizeof(struct tpacket_hdr*), GFP_KERNEL); - if (io_vec == NULL) - goto out_free_pgvec; - memset(io_vec, 0, req->tp_frame_nr*sizeof(struct tpacket_hdr*)); - l = 0; for (i=0; itp_block_nr; i++) { unsigned long ptr = pg_vec[i]; + struct tpacket_hdr *header; int k; - for (k=0; ktp_status = TP_STATUS_KERNEL; + for (k=0; kframes_per_block; k++) { + + header = (struct tpacket_hdr*)ptr; + header->tp_status = TP_STATUS_KERNEL; ptr += req->tp_frame_size; } } @@ -1642,8 +1663,7 @@ spin_lock_bh(&sk->sk_receive_queue.lock); pg_vec = XC(po->pg_vec, pg_vec); - io_vec = XC(po->iovec, io_vec); - po->iovmax = req->tp_frame_nr-1; + po->frame_max = req->tp_frame_nr-1; po->head = 0; po->frame_size = req->tp_frame_size; spin_unlock_bh(&sk->sk_receive_queue.lock); @@ -1652,7 +1672,7 @@ req->tp_block_nr = XC(po->pg_vec_len, req->tp_block_nr); po->pg_vec_pages = req->tp_block_size/PAGE_SIZE; - po->prot_hook.func = po->iovec ? tpacket_rcv : packet_rcv; + po->prot_hook.func = po->pg_vec ? tpacket_rcv : packet_rcv; skb_queue_purge(&sk->sk_receive_queue); #undef XC if (atomic_read(&po->mapped)) @@ -1670,9 +1690,6 @@ release_sock(sk); - if (io_vec) - kfree(io_vec); - out_free_pgvec: if (pg_vec) free_pg_vec(pg_vec, order, req->tp_block_nr); diff -urN linux-2.6.5-rc3/net/sched/sch_hfsc.c linux-2.6.5/net/sched/sch_hfsc.c --- linux-2.6.5-rc3/net/sched/sch_hfsc.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/net/sched/sch_hfsc.c 2004-04-03 20:20:34.000000000 -0800 @@ -1562,7 +1562,7 @@ struct tc_hfsc_qopt *qopt; if (opt == NULL || RTA_PAYLOAD(opt) < sizeof(*qopt)) - return -EINVAL;; + return -EINVAL; qopt = RTA_DATA(opt); sch_tree_lock(sch); diff -urN linux-2.6.5-rc3/net/sctp/bind_addr.c linux-2.6.5/net/sctp/bind_addr.c --- linux-2.6.5-rc3/net/sctp/bind_addr.c 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/net/sctp/bind_addr.c 2004-04-03 20:20:34.000000000 -0800 @@ -292,7 +292,7 @@ if (retval) { /* Can't finish building the list, clean up. */ sctp_bind_addr_clean(bp); - break;; + break; } len = ntohs(param->length); diff -urN linux-2.6.5-rc3/net/sctp/sm_make_chunk.c linux-2.6.5/net/sctp/sm_make_chunk.c --- linux-2.6.5-rc3/net/sctp/sm_make_chunk.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/net/sctp/sm_make_chunk.c 2004-04-03 20:20:34.000000000 -0800 @@ -1467,7 +1467,7 @@ struct __sctp_missing { __u32 num_missing; __u16 type; -} __attribute__((packed));; +} __attribute__((packed)); /* * Report a missing mandatory parameter. diff -urN linux-2.6.5-rc3/net/sctp/socket.c linux-2.6.5/net/sctp/socket.c --- linux-2.6.5-rc3/net/sctp/socket.c 2004-03-10 18:55:58.000000000 -0800 +++ linux-2.6.5/net/sctp/socket.c 2004-04-03 20:20:34.000000000 -0800 @@ -4490,7 +4490,7 @@ * 3) Peeling off non-partial delivery; move pd_lobby to recieve_queue. */ skb_queue_head_init(&newsp->pd_lobby); - sctp_sk(newsk)->pd_mode = assoc->ulpq.pd_mode;; + sctp_sk(newsk)->pd_mode = assoc->ulpq.pd_mode; if (sctp_sk(oldsk)->pd_mode) { struct sk_buff_head *queue; diff -urN linux-2.6.5-rc3/net/sunrpc/auth_gss/svcauth_gss.c linux-2.6.5/net/sunrpc/auth_gss/svcauth_gss.c --- linux-2.6.5-rc3/net/sunrpc/auth_gss/svcauth_gss.c 2004-03-10 18:55:26.000000000 -0800 +++ linux-2.6.5/net/sunrpc/auth_gss/svcauth_gss.c 2004-04-03 20:20:34.000000000 -0800 @@ -193,7 +193,7 @@ len = qword_get(&mesg, buf, mlen); status = -EINVAL; if (len < 0) - goto out;; + goto out; status = -ENOMEM; if (dup_to_netobj(&rsii.in_token, buf, len)) goto out; diff -urN linux-2.6.5-rc3/scripts/Makefile.modpost linux-2.6.5/scripts/Makefile.modpost --- linux-2.6.5-rc3/scripts/Makefile.modpost 2004-03-10 18:55:28.000000000 -0800 +++ linux-2.6.5/scripts/Makefile.modpost 2004-04-03 20:20:34.000000000 -0800 @@ -14,7 +14,7 @@ modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) ifneq ($(filter-out $(modules),$(__modules)),) - $(warning Trouble: $(__modules) ) + $(warning Trouble: $(filter-out $(modules),$(__modules))) $(warning *** Uh-oh, you have stale module entries. You messed with SUBDIRS,) $(warning do not complain if something goes wrong.) endif diff -urN linux-2.6.5-rc3/scripts/basic/fixdep.c linux-2.6.5/scripts/basic/fixdep.c --- linux-2.6.5-rc3/scripts/basic/fixdep.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/scripts/basic/fixdep.c 2004-04-03 20:20:34.000000000 -0800 @@ -38,7 +38,7 @@ * * The idea above dates, by the way, back to Michael E Chastain, AFAIK. * - * So to get dependencies right, there two issues: + * So to get dependencies right, there are two issues: * o if any of the files the compiler read changed, we need to rebuild * o if the command line given to the compile the file changed, we * better rebuild as well. diff -urN linux-2.6.5-rc3/scripts/modpost.c linux-2.6.5/scripts/modpost.c --- linux-2.6.5-rc3/scripts/modpost.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/scripts/modpost.c 2004-04-03 20:20:35.000000000 -0800 @@ -141,26 +141,14 @@ symbolhash[hash] = new; } -#define DOTSYM_PFX "__dot_" - struct symbol * find_symbol(const char *name) { struct symbol *s; - char dotname[64 + sizeof(DOTSYM_PFX)]; - /* .foo matches foo. PPC64 needs this. */ - if (name[0] == '.') { + /* For our purposes, .foo matches foo. PPC64 needs this. */ + if (name[0] == '.') name++; - strcpy(dotname, DOTSYM_PFX); - strncat(dotname, name, sizeof(dotname) - sizeof(DOTSYM_PFX) - 1); - dotname[sizeof(dotname)-1] = 0; - /* Sparc32 wants .foo to match __dot_foo, try this first. */ - for (s = symbolhash[tdb_hash(dotname) % SYMBOL_HASH_SIZE]; s; s=s->next) { - if (strcmp(s->name, dotname) == 0) - return s; - } - } for (s = symbolhash[tdb_hash(name) % SYMBOL_HASH_SIZE]; s; s=s->next) { if (strcmp(s->name, name) == 0) diff -urN linux-2.6.5-rc3/security/commoncap.c linux-2.6.5/security/commoncap.c --- linux-2.6.5-rc3/security/commoncap.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/security/commoncap.c 2004-04-03 20:20:35.000000000 -0800 @@ -22,6 +22,7 @@ #include #include #include +#include int cap_capable (struct task_struct *tsk, int cap) { @@ -358,7 +359,8 @@ return -ENOMEM; } - allowed = totalram_pages * sysctl_overcommit_ratio / 100; + allowed = (totalram_pages - hugetlb_total_pages()) + * sysctl_overcommit_ratio / 100; allowed += total_swap_pages; if (atomic_read(&vm_committed_space) < allowed) diff -urN linux-2.6.5-rc3/security/dummy.c linux-2.6.5/security/dummy.c --- linux-2.6.5-rc3/security/dummy.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/security/dummy.c 2004-04-03 20:20:35.000000000 -0800 @@ -25,6 +25,7 @@ #include #include #include +#include static int dummy_ptrace (struct task_struct *parent, struct task_struct *child) { @@ -146,7 +147,8 @@ return -ENOMEM; } - allowed = totalram_pages * sysctl_overcommit_ratio / 100; + allowed = (totalram_pages - hugetlb_total_pages()) + * sysctl_overcommit_ratio / 100; allowed += total_swap_pages; if (atomic_read(&vm_committed_space) < allowed) diff -urN linux-2.6.5-rc3/security/selinux/hooks.c linux-2.6.5/security/selinux/hooks.c --- linux-2.6.5-rc3/security/selinux/hooks.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/security/selinux/hooks.c 2004-04-03 20:20:35.000000000 -0800 @@ -59,6 +59,7 @@ #include /* for Unix socket types */ #include #include +#include #include "avc.h" #include "objsec.h" @@ -1453,7 +1454,7 @@ static int selinux_quota_on(struct file *f) { - return file_has_perm(current, f, FILE__QUOTAON);; + return file_has_perm(current, f, FILE__QUOTAON); } static int selinux_syslog(int type) @@ -1544,7 +1545,8 @@ return -ENOMEM; } - allowed = totalram_pages * sysctl_overcommit_ratio / 100; + allowed = (totalram_pages - hugetlb_total_pages()) + * sysctl_overcommit_ratio / 100; allowed += total_swap_pages; if (atomic_read(&vm_committed_space) < allowed) diff -urN linux-2.6.5-rc3/sound/core/ioctl32/timer32.c linux-2.6.5/sound/core/ioctl32/timer32.c --- linux-2.6.5-rc3/sound/core/ioctl32/timer32.c 2004-03-10 18:55:28.000000000 -0800 +++ linux-2.6.5/sound/core/ioctl32/timer32.c 2004-04-03 20:20:35.000000000 -0800 @@ -88,8 +88,18 @@ { SNDRV_TIMER_IOCTL_INFO32, AP(timer_info) }, MAP_COMPAT(SNDRV_TIMER_IOCTL_PARAMS), { SNDRV_TIMER_IOCTL_STATUS32, AP(timer_status) }, +#if 0 + /* ** FIXME ** + * The following four entries are disabled because they conflict + * with the TCOC* definitions. + * Unfortunately, the current ioctl32 wrapper uses a single + * hash table for all devices. Once when the wrapper is fixed + * with the table based on devices, they'll be back again. + */ MAP_COMPAT(SNDRV_TIMER_IOCTL_START), MAP_COMPAT(SNDRV_TIMER_IOCTL_STOP), MAP_COMPAT(SNDRV_TIMER_IOCTL_CONTINUE), + MAP_COMPAT(SNDRV_TIMER_IOCTL_PAUSE), +#endif { 0 }, }; diff -urN linux-2.6.5-rc3/sound/core/pcm.c linux-2.6.5/sound/core/pcm.c --- linux-2.6.5-rc3/sound/core/pcm.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/sound/core/pcm.c 2004-04-03 20:20:36.000000000 -0800 @@ -403,7 +403,7 @@ snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data; char line[64]; if (!snd_info_get_line(buffer, line, sizeof(line))) - pstr->xrun_debug = !!simple_strtoul(line, NULL, 10); + pstr->xrun_debug = simple_strtoul(line, NULL, 10); } #endif diff -urN linux-2.6.5-rc3/sound/core/pcm_lib.c linux-2.6.5/sound/core/pcm_lib.c --- linux-2.6.5-rc3/sound/core/pcm_lib.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/sound/core/pcm_lib.c 2004-04-03 20:20:36.000000000 -0800 @@ -167,7 +167,8 @@ substream->pcm->card->number, substream->pcm->device, substream->stream ? 'c' : 'p'); - dump_stack(); + if (substream->pstr->xrun_debug > 1) + dump_stack(); } #endif return -EPIPE; @@ -194,8 +195,11 @@ if (delta > 0) { if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { #ifdef CONFIG_SND_DEBUG - if (runtime->periods > 1) + if (runtime->periods > 1 && substream->pstr->xrun_debug) { snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); + if (substream->pstr->xrun_debug > 1) + dump_stack(); + } #endif return 0; } @@ -232,8 +236,11 @@ if (delta > 0) { if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { #ifdef CONFIG_SND_DEBUG - if (runtime->periods > 2) + if (runtime->periods > 2 && substream->pstr->xrun_debug) { snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); + if (substream->pstr->xrun_debug > 1) + dump_stack(); + } #endif return 0; } diff -urN linux-2.6.5-rc3/sound/core/pcm_timer.c linux-2.6.5/sound/core/pcm_timer.c --- linux-2.6.5-rc3/sound/core/pcm_timer.c 2004-03-10 18:55:51.000000000 -0800 +++ linux-2.6.5/sound/core/pcm_timer.c 2004-04-03 20:20:36.000000000 -0800 @@ -32,9 +32,9 @@ */ /* Greatest common divisor */ -static int gcd(int a, int b) +static unsigned long gcd(unsigned long a, unsigned long b) { - int r; + unsigned long r; if (a < b) { r = a; a = b; @@ -49,7 +49,7 @@ void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream) { - unsigned int rate, mult, fsize, l; + unsigned long rate, mult, fsize, l; snd_pcm_runtime_t *runtime = substream->runtime; mult = 1000000000; @@ -67,7 +67,11 @@ mult /= 2; rate /= 2; } - snd_assert(rate != 0, return); + if (rate == 0) { + snd_printk(KERN_ERR "pcm timer resolution out of range (rate = %u, period_size = %lu)\n", runtime->rate, runtime->period_size); + runtime->timer_resolution = -1; + return; + } runtime->timer_resolution = mult * fsize / rate; } diff -urN linux-2.6.5-rc3/sound/core/seq/oss/seq_oss_synth.h linux-2.6.5/sound/core/seq/oss/seq_oss_synth.h --- linux-2.6.5-rc3/sound/core/seq/oss/seq_oss_synth.h 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/sound/core/seq/oss/seq_oss_synth.h 2004-04-03 20:20:36.000000000 -0800 @@ -37,7 +37,7 @@ void snd_seq_oss_synth_cleanup(seq_oss_devinfo_t *dp); void snd_seq_oss_synth_reset(seq_oss_devinfo_t *dp, int dev); -int snd_seq_oss_synth_load_patch(seq_oss_devinfo_t *dp, int dev, int fmt, const char *buf, int p, int c); +int snd_seq_oss_synth_load_patch(seq_oss_devinfo_t *dp, int dev, int fmt, const char __user *buf, int p, int c); int snd_seq_oss_synth_is_valid(seq_oss_devinfo_t *dp, int dev); int snd_seq_oss_synth_sysex(seq_oss_devinfo_t *dp, int dev, unsigned char *buf, snd_seq_event_t *ev); int snd_seq_oss_synth_addr(seq_oss_devinfo_t *dp, int dev, snd_seq_event_t *ev); diff -urN linux-2.6.5-rc3/sound/i2c/cs8427.c linux-2.6.5/sound/i2c/cs8427.c --- linux-2.6.5-rc3/sound/i2c/cs8427.c 2004-04-03 20:19:56.000000000 -0800 +++ linux-2.6.5/sound/i2c/cs8427.c 2004-04-03 20:20:36.000000000 -0800 @@ -50,6 +50,7 @@ typedef struct { unsigned char regmap[0x14]; /* map of first 1 + 13 registers */ unsigned int rate; + unsigned int reset_timeout; cs8427_stream_t playback; cs8427_stream_t capture; } cs8427_t; @@ -163,6 +164,7 @@ int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr, + unsigned int reset_timeout, snd_i2c_device_t **r_cs8427) { static unsigned char initvals1[] = { @@ -256,6 +258,9 @@ snd_i2c_unlock(bus); /* turn on run bit and rock'n'roll */ + if (reset_timeout < 1) + reset_timeout = 1; + chip->reset_timeout = reset_timeout; snd_cs8427_reset(device); #if 0 // it's nice for read tests @@ -301,7 +306,7 @@ snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, chip->regmap[CS8427_REG_CLOCKSOURCE]); udelay(200); snd_i2c_unlock(cs8427->bus); - end_time = jiffies + HZ / 2; + end_time = jiffies + chip->reset_timeout; while (time_after_eq(end_time, jiffies)) { snd_i2c_lock(cs8427->bus); data = snd_cs8427_reg_read(cs8427, CS8427_REG_RECVERRORS); @@ -309,7 +314,7 @@ if (!(data & CS8427_UNLOCK)) break; set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/100); + schedule_timeout(1); } snd_i2c_lock(cs8427->bus); chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~CS8427_RXDMASK; diff -urN linux-2.6.5-rc3/sound/oss/cs46xx.c linux-2.6.5/sound/oss/cs46xx.c --- linux-2.6.5-rc3/sound/oss/cs46xx.c 2004-03-10 18:55:20.000000000 -0800 +++ linux-2.6.5/sound/oss/cs46xx.c 2004-04-03 20:20:36.000000000 -0800 @@ -3253,7 +3253,7 @@ if (dmabuf->channel == NULL) { kfree (card->states[0]); - card->states[0] = NULL;; + card->states[0] = NULL; return -ENODEV; } @@ -3324,7 +3324,7 @@ if (dmabuf->channel == NULL) { kfree (card->states[1]); - card->states[1] = NULL;; + card->states[1] = NULL; return -ENODEV; } diff -urN linux-2.6.5-rc3/sound/oss/i810_audio.c linux-2.6.5/sound/oss/i810_audio.c --- linux-2.6.5-rc3/sound/oss/i810_audio.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/sound/oss/i810_audio.c 2004-04-03 20:20:36.000000000 -0800 @@ -2471,7 +2471,7 @@ if(file->f_mode & FMODE_READ) { if((dmabuf->read_channel = card->alloc_rec_pcm_channel(card)) == NULL) { kfree (card->states[i]); - card->states[i] = NULL;; + card->states[i] = NULL; return -EBUSY; } dmabuf->trigger |= PCM_ENABLE_INPUT; @@ -2483,7 +2483,7 @@ if(file->f_mode & FMODE_READ) card->free_pcm_channel(card,dmabuf->read_channel->num); kfree (card->states[i]); - card->states[i] = NULL;; + card->states[i] = NULL; return -EBUSY; } /* Initialize to 8kHz? What if we don't support 8kHz? */ diff -urN linux-2.6.5-rc3/sound/oss/nec_vrc5477.c linux-2.6.5/sound/oss/nec_vrc5477.c --- linux-2.6.5-rc3/sound/oss/nec_vrc5477.c 2004-03-10 18:55:37.000000000 -0800 +++ linux-2.6.5/sound/oss/nec_vrc5477.c 2004-04-03 20:20:37.000000000 -0800 @@ -293,7 +293,7 @@ spin_unlock_irqrestore(&s->lock, flags); - return result & 0xffff;; + return result & 0xffff; } diff -urN linux-2.6.5-rc3/sound/oss/rme96xx.c linux-2.6.5/sound/oss/rme96xx.c --- linux-2.6.5-rc3/sound/oss/rme96xx.c 2004-03-10 18:55:25.000000000 -0800 +++ linux-2.6.5/sound/oss/rme96xx.c 2004-04-03 20:20:37.000000000 -0800 @@ -1320,7 +1320,7 @@ count = rme96xx_getispace(dma,val); abinfo.fragsize = (s->fragsize*dma->inchannels)>>dma->formatshift; - abinfo.bytes = (count*dma->inchannels)>>dma->formatshift;; + abinfo.bytes = (count*dma->inchannels)>>dma->formatshift; abinfo.fragstotal = 2; abinfo.fragments = count > s->fragsize; return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; @@ -1348,7 +1348,7 @@ return -EINVAL; val = rme96xx_gethwptr(dma->s,0); spin_lock_irqsave(&s->lock,flags); - cinfo.bytes = s->fragsize<<1;; + cinfo.bytes = s->fragsize<<1; count = val - dma->readptr; if (count < 0) count += s->fragsize<<1; @@ -1368,7 +1368,7 @@ return -EINVAL; val = rme96xx_gethwptr(dma->s,0); spin_lock_irqsave(&s->lock,flags); - cinfo.bytes = s->fragsize<<1;; + cinfo.bytes = s->fragsize<<1; count = val - dma->writeptr; if (count < 0) count += s->fragsize<<1; diff -urN linux-2.6.5-rc3/sound/oss/soundcard.c linux-2.6.5/sound/oss/soundcard.c --- linux-2.6.5-rc3/sound/oss/soundcard.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/oss/soundcard.c 2004-04-03 20:20:37.000000000 -0800 @@ -706,7 +706,7 @@ void sound_stop_timer(void) { - del_timer(&seq_timer);; + del_timer(&seq_timer); } void conf_printf(char *name, struct address_info *hw_config) diff -urN linux-2.6.5-rc3/sound/oss/sys_timer.c linux-2.6.5/sound/oss/sys_timer.c --- linux-2.6.5-rc3/sound/oss/sys_timer.c 2004-03-10 18:55:27.000000000 -0800 +++ linux-2.6.5/sound/oss/sys_timer.c 2004-04-03 20:20:37.000000000 -0800 @@ -116,7 +116,7 @@ def_tmr_close(int dev) { opened = tmr_running = 0; - del_timer(&def_tmr);; + del_timer(&def_tmr); } static int diff -urN linux-2.6.5-rc3/sound/parisc/harmony.c linux-2.6.5/sound/parisc/harmony.c --- linux-2.6.5-rc3/sound/parisc/harmony.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/parisc/harmony.c 2004-04-03 20:20:37.000000000 -0800 @@ -544,7 +544,7 @@ case SNDRV_PCM_TRIGGER_STOP: if (harmony->cap_stopped) return -EBUSY; - harmony->cap_stopped = 1;; + harmony->cap_stopped = 1; snd_harmony_disable_interrupts(harmony); break; case SNDRV_PCM_TRIGGER_START: diff -urN linux-2.6.5-rc3/sound/pci/ac97/ac97_codec.c linux-2.6.5/sound/pci/ac97/ac97_codec.c --- linux-2.6.5-rc3/sound/pci/ac97/ac97_codec.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pci/ac97/ac97_codec.c 2004-04-03 20:20:37.000000000 -0800 @@ -396,11 +396,14 @@ ac97->spec.ad18xx.pcmreg[codec] = new; spin_unlock(&ac97->reg_lock); /* select single codec */ - ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); + ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, + (ac97->regs[AC97_AD_SERIAL_CFG] & ~0x7000) | + ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); /* update PCM bits */ ac97->bus->write(ac97, AC97_PCM, new); /* select all codecs */ - ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, 0x7000); + ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, + ac97->regs[AC97_AD_SERIAL_CFG] | 0x7000); } else spin_unlock(&ac97->reg_lock); up(&ac97->spec.ad18xx.mutex); @@ -2032,11 +2035,12 @@ if (! ac97->spec.ad18xx.id[codec]) continue; /* select single codec */ - ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, + ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); ac97->bus->write(ac97, AC97_AD_CODEC_CFG, ac97->spec.ad18xx.codec_cfg[codec]); } /* select all codecs */ - ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, 0x7000); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); } /* restore ac97 status */ @@ -2055,12 +2059,13 @@ if (! ac97->spec.ad18xx.id[codec]) continue; /* select single codec */ - ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, + ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); /* update PCM bits */ ac97->bus->write(ac97, AC97_PCM, ac97->spec.ad18xx.pcmreg[codec]); } /* select all codecs */ - ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, 0x7000); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); continue; } else if (i == AC97_AD_TEST || i == AC97_AD_CODEC_CFG || diff -urN linux-2.6.5-rc3/sound/pci/ac97/ac97_patch.c linux-2.6.5/sound/pci/ac97/ac97_patch.c --- linux-2.6.5-rc3/sound/pci/ac97/ac97_patch.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pci/ac97/ac97_patch.c 2004-04-03 20:20:37.000000000 -0800 @@ -562,8 +562,11 @@ */ int patch_ad1819(ac97_t * ac97) { + unsigned short scfg; + // patch for Analog Devices - snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, 0x7000); /* select all codecs */ + scfg = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG); + snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x7000); /* select all codecs */ return 0; } @@ -572,7 +575,7 @@ unsigned short val; // test for unchained codec - snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, mask); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, mask); snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0000); /* ID0C, ID1C, SDIE = off */ val = snd_ac97_read(ac97, AC97_VENDOR_ID2); if ((val & 0xff40) != 0x5340) @@ -588,7 +591,7 @@ static int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 }; unsigned short val; - snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, cfg_bits[idx]); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, cfg_bits[idx]); snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0004); // SDIE val = snd_ac97_read(ac97, AC97_VENDOR_ID2); if ((val & 0xff40) != 0x5340) @@ -611,7 +614,8 @@ if (cidx1 < 0 && cidx2 < 0) return; // test for chained codecs - snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[unchained_idx]); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, + ac97->spec.ad18xx.unchained[unchained_idx]); snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0002); // ID1C ac97->spec.ad18xx.codec_cfg[unchained_idx] = 0x0002; if (cidx1 >= 0) { @@ -634,10 +638,13 @@ // patch for Analog Devices unsigned short codecs[3]; + unsigned short val; int idx, num; init_MUTEX(&ac97->spec.ad18xx.mutex); + val = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG); + snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, val); codecs[0] = patch_ad1881_unchained(ac97, 0, (1<<12)); codecs[1] = patch_ad1881_unchained(ac97, 1, (1<<14)); codecs[2] = patch_ad1881_unchained(ac97, 2, (1<<13)); @@ -659,7 +666,7 @@ __end: /* select all codecs */ - snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, 0x7000); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); /* check if only one codec is present */ for (idx = num = 0; idx < 3; idx++) if (ac97->spec.ad18xx.id[idx]) @@ -1003,6 +1010,7 @@ { unsigned short misc; + patch_ad1881(ac97); ac97->build_ops = &patch_ad1985_build_ops; misc = snd_ac97_read(ac97, AC97_AD_MISC); /* switch front/surround line-out/hp-out */ diff -urN linux-2.6.5-rc3/sound/pci/ac97/ac97_pcm.c linux-2.6.5/sound/pci/ac97/ac97_pcm.c --- linux-2.6.5-rc3/sound/pci/ac97/ac97_pcm.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pci/ac97/ac97_pcm.c 2004-04-03 20:20:37.000000000 -0800 @@ -89,7 +89,7 @@ 0xff, /* slot 6 */ AC97_PCM_LFE_DAC_RATE, /* slot 7 */ AC97_PCM_LFE_DAC_RATE, /* slot 8 */ - AC97_PCM_FRONT_DAC_RATE, /* slot 9 */ + 0xff, /* slot 9 */ AC97_PCM_FRONT_DAC_RATE, /* slot 10 */ AC97_PCM_FRONT_DAC_RATE, /* slot 11 */ }, @@ -140,7 +140,7 @@ 0xff, /* slot 6 */ AC97_PCM_LFE_DAC_RATE, /* slot 7 */ AC97_PCM_LFE_DAC_RATE, /* slot 8 */ - AC97_PCM_FRONT_DAC_RATE, /* slot 9 */ + 0xff, /* slot 9 */ AC97_PCM_FRONT_DAC_RATE, /* slot 10 */ AC97_PCM_FRONT_DAC_RATE, /* slot 11 */ } diff -urN linux-2.6.5-rc3/sound/pci/ac97/ac97_proc.c linux-2.6.5/sound/pci/ac97/ac97_proc.c --- linux-2.6.5-rc3/sound/pci/ac97/ac97_proc.c 2004-03-10 18:55:54.000000000 -0800 +++ linux-2.6.5/sound/pci/ac97/ac97_proc.c 2004-04-03 20:20:37.000000000 -0800 @@ -241,12 +241,13 @@ for (idx = 0; idx < 3; idx++) if (ac97->spec.ad18xx.id[idx]) { /* select single codec */ - snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, + ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); snd_ac97_proc_read_main(ac97, buffer, idx); snd_iprintf(buffer, "\n\n"); } /* select all codecs */ - snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, 0x7000); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); up(&ac97->spec.ad18xx.mutex); snd_iprintf(buffer, "\nAD18XX configuration\n"); @@ -285,11 +286,12 @@ for (idx = 0; idx < 3; idx++) if (ac97->spec.ad18xx.id[idx]) { /* select single codec */ - snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, + ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); snd_ac97_proc_regs_read_main(ac97, buffer, idx); } /* select all codecs */ - snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, 0x7000); + snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000); up(&ac97->spec.ad18xx.mutex); } else { snd_ac97_proc_regs_read_main(ac97, buffer, 0); diff -urN linux-2.6.5-rc3/sound/pci/au88x0/au88x0.h linux-2.6.5/sound/pci/au88x0/au88x0.h --- linux-2.6.5-rc3/sound/pci/au88x0/au88x0.h 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pci/au88x0/au88x0.h 2004-04-03 20:20:37.000000000 -0800 @@ -17,7 +17,6 @@ #ifndef __SOUND_AU88X0_H #define __SOUND_AU88X0_H -#ifdef __KERNEL__ #include #include #include @@ -29,22 +28,6 @@ #include #include - -#ifndef PCI_VENDOR_ID_AUREAL -#define PCI_VENDOR_ID_AUREAL 0x12eb -#endif -#ifndef PCI_DEVICE_ID_AUREAL_VORTEX -#define PCI_DEVICE_ID_AUREAL_VORTEX 0x0001 -#endif -#ifndef PCI_DEVICE_ID_AUREAL_VORTEX2 -#define PCI_DEVICE_ID_AUREAL_VORTEX2 0x0002 -#endif -#ifndef PCI_DEVICE_ID_AUREAL_ADVANTAGE -#define PCI_DEVICE_ID_AUREAL_ADVANTAGE 0x0003 -#endif - -#endif - #ifndef CHIP_AU8820 #include "au88x0_eq.h" #include "au88x0_a3d.h" diff -urN linux-2.6.5-rc3/sound/pci/au88x0/au88x0_synth.c linux-2.6.5/sound/pci/au88x0/au88x0_synth.c --- linux-2.6.5-rc3/sound/pci/au88x0/au88x0_synth.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pci/au88x0/au88x0_synth.c 2004-04-03 20:20:37.000000000 -0800 @@ -155,7 +155,7 @@ return hwread(vortex->mmio, WT_PARM(wt, 3)); } if (reg == 7) { - return hwread(vortex->mmio, WT_GMODE(wt));; + return hwread(vortex->mmio, WT_GMODE(wt)); } return 0; diff -urN linux-2.6.5-rc3/sound/pci/cs46xx/cs46xx.c linux-2.6.5/sound/pci/cs46xx/cs46xx.c --- linux-2.6.5-rc3/sound/pci/cs46xx/cs46xx.c 2004-03-10 18:55:51.000000000 -0800 +++ linux-2.6.5/sound/pci/cs46xx/cs46xx.c 2004-04-03 20:20:37.000000000 -0800 @@ -51,7 +51,7 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ static int external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; static int thinkpad[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; -static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; +static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM_DESC(index, "Index value for the CS46xx soundcard."); @@ -70,7 +70,7 @@ MODULE_PARM_SYNTAX(thinkpad, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC); MODULE_PARM(mmap_valid, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM_DESC(mmap_valid, "Support OSS mmap."); -MODULE_PARM_SYNTAX(mmap_valid, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC); +MODULE_PARM_SYNTAX(mmap_valid, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC); static struct pci_device_id snd_cs46xx_ids[] = { { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */ @@ -219,7 +219,7 @@ #ifndef MODULE -/* format is: snd-cs46xx=enable,index,id */ +/* format is: snd-cs46xx=enable,index,id,mmap_valid,external_amp,thinkpad */ static int __init alsa_card_cs46xx_setup(char *str) { @@ -229,7 +229,10 @@ return 0; (void)(get_option(&str,&enable[nr_dev]) == 2 && get_option(&str,&index[nr_dev]) == 2 && - get_id(&str,&id[nr_dev]) == 2); + get_id(&str,&id[nr_dev]) == 2 && + get_option(&str,&mmap_valid[nr_dev]) == 2 && + get_option(&str,&external_amp[nr_dev]) == 2 && + get_option(&str,&thinkpad[nr_dev]) == 2); nr_dev++; return 1; } diff -urN linux-2.6.5-rc3/sound/pci/cs46xx/dsp_spos.c linux-2.6.5/sound/pci/cs46xx/dsp_spos.c --- linux-2.6.5-rc3/sound/pci/cs46xx/dsp_spos.c 2004-03-10 18:55:43.000000000 -0800 +++ linux-2.6.5/sound/pci/cs46xx/dsp_spos.c 2004-04-03 20:20:38.000000000 -0800 @@ -823,7 +823,7 @@ entry->private_data = chip; entry->mode = S_IFREG | S_IRUGO | S_IWUSR; entry->c.text.read_size = 512; - entry->c.text.read = cs46xx_dsp_proc_task_tree_read;; + entry->c.text.read = cs46xx_dsp_proc_task_tree_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); entry = NULL; @@ -836,7 +836,7 @@ entry->private_data = chip; entry->mode = S_IFREG | S_IRUGO | S_IWUSR; entry->c.text.read_size = 1024; - entry->c.text.read = cs46xx_dsp_proc_scb_read;; + entry->c.text.read = cs46xx_dsp_proc_scb_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); entry = NULL; diff -urN linux-2.6.5-rc3/sound/pci/ice1712/delta.c linux-2.6.5/sound/pci/ice1712/delta.c --- linux-2.6.5-rc3/sound/pci/ice1712/delta.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pci/ice1712/delta.c 2004-04-03 20:20:39.000000000 -0800 @@ -90,6 +90,7 @@ tmp |= ICE1712_DELTA_1010LT_CCLK | ICE1712_DELTA_1010LT_CS_CS8427; break; case ICE1712_SUBDEVICE_AUDIOPHILE: + case ICE1712_SUBDEVICE_DELTA410: tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC; tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL; break; @@ -112,6 +113,7 @@ tmp |= ICE1712_DELTA_1010LT_CS_NONE; break; case ICE1712_SUBDEVICE_AUDIOPHILE: + case ICE1712_SUBDEVICE_DELTA410: tmp |= ICE1712_DELTA_AP_CS_DIGITAL; break; case ICE1712_SUBDEVICE_VX442: diff -urN linux-2.6.5-rc3/sound/pci/ice1712/ice1712.c linux-2.6.5/sound/pci/ice1712/ice1712.c --- linux-2.6.5-rc3/sound/pci/ice1712/ice1712.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pci/ice1712/ice1712.c 2004-04-03 20:20:39.000000000 -0800 @@ -82,6 +82,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ static int omni[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0}; /* Delta44 & 66 Omni I/O support */ +static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 500}; /* CS8427 S/PDIF transciever reset timeout value in msec */ MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM_DESC(index, "Index value for ICE1712 soundcard."); @@ -95,6 +96,9 @@ MODULE_PARM(omni, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM_DESC(omni, "Enable Midiman M-Audio Delta Omni I/O support."); MODULE_PARM_SYNTAX(omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC); +MODULE_PARM(cs8427_timeout, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); +MODULE_PARM_DESC(cs8427_timeout, "Define reset timeout for cs8427 chip in msec resolution."); +MODULE_PARM_SYNTAX(cs8427_timeout, SNDRV_ENABLED ", allows:{{1,1000}},default=500,skill:advanced"); #ifndef PCI_VENDOR_ID_ICE #define PCI_VENDOR_ID_ICE 0x1412 @@ -386,7 +390,9 @@ { int err; - if ((err = snd_cs8427_create(ice->i2c, addr, &ice->cs8427)) < 0) { + if ((err = snd_cs8427_create(ice->i2c, addr, + (ice->cs8427_timeout * HZ) / 1000, + &ice->cs8427)) < 0) { snd_printk("CS8427 initialization failed\n"); return err; } @@ -1505,10 +1511,10 @@ static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice) { int err; + ac97_t ac97; + ac97_bus_t bus, *pbus; if (ice_has_con_ac97(ice)) { - ac97_bus_t bus, *pbus; - ac97_t ac97; memset(&bus, 0, sizeof(bus)); bus.write = snd_ice1712_ac97_write; bus.read = snd_ice1712_ac97_read; @@ -1527,8 +1533,6 @@ } if (! (ice->eeprom.data[ICE_EEP1_ACLINK] & ICE1712_CFG_PRO_I2S)) { - ac97_bus_t bus, *pbus; - ac97_t ac97; memset(&bus, 0, sizeof(bus)); bus.write = snd_ice1712_pro_ac97_write; bus.read = snd_ice1712_pro_ac97_read; @@ -2404,6 +2408,7 @@ static int __devinit snd_ice1712_create(snd_card_t * card, struct pci_dev *pci, int omni, + int cs8427_timeout, ice1712_t ** r_ice1712) { ice1712_t *ice; @@ -2428,6 +2433,11 @@ if (ice == NULL) return -ENOMEM; ice->omni = omni ? 1 : 0; + if (cs8427_timeout < 1) + cs8427_timeout = 1; + else if (cs8427_timeout > 1000) + cs8427_timeout = 1000; + ice->cs8427_timeout = cs8427_timeout; spin_lock_init(&ice->reg_lock); init_MUTEX(&ice->gpio_mutex); init_MUTEX(&ice->open_mutex); @@ -2547,7 +2557,7 @@ strcpy(card->driver, "ICE1712"); strcpy(card->shortname, "ICEnsemble ICE1712"); - if ((err = snd_ice1712_create(card, pci, omni[dev], &ice)) < 0) { + if ((err = snd_ice1712_create(card, pci, omni[dev], cs8427_timeout[dev], &ice)) < 0) { snd_card_free(card); return err; } diff -urN linux-2.6.5-rc3/sound/pci/ice1712/ice1712.h linux-2.6.5/sound/pci/ice1712/ice1712.h --- linux-2.6.5-rc3/sound/pci/ice1712/ice1712.h 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pci/ice1712/ice1712.h 2004-04-03 20:20:39.000000000 -0800 @@ -346,6 +346,7 @@ snd_i2c_bus_t *i2c; /* I2C bus */ snd_i2c_device_t *cs8404; /* CS8404A I2C device */ snd_i2c_device_t *cs8427; /* CS8427 I2C device */ + unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */ snd_i2c_device_t *i2cdevs[2]; /* additional i2c devices */ struct ice1712_gpio { diff -urN linux-2.6.5-rc3/sound/pci/intel8x0.c linux-2.6.5/sound/pci/intel8x0.c --- linux-2.6.5-rc3/sound/pci/intel8x0.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pci/intel8x0.c 2004-04-03 20:20:39.000000000 -0800 @@ -96,7 +96,7 @@ MODULE_PARM_SYNTAX(ac97_clock, SNDRV_ENABLED ",default:0"); MODULE_PARM(ac97_quirk, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); -MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1,3}},dialog:list,default:-1"); +MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1,4}},dialog:list,default:-1"); #ifdef SUPPORT_JOYSTICK MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM_DESC(joystick, "Enable joystick for Intel i8x0 soundcard."); @@ -824,19 +824,16 @@ spin_lock(&chip->reg_lock); status = igetdword(chip, chip->int_sta_reg); if ((status & chip->int_sta_mask) == 0) { - static int err_count = 10; if (status) { /* ack */ iputdword(chip, chip->int_sta_reg, status); + /* some Nforce[2] boards have problems when + IRQ_NONE is returned here. + */ if (chip->device_type != DEVICE_NFORCE) - status ^= igetdword(chip, chip->int_sta_reg); + status = 0; } spin_unlock(&chip->reg_lock); - if (chip->device_type != DEVICE_NFORCE && status && err_count) { - err_count--; - snd_printd("intel8x0: unknown IRQ bits 0x%x (sta_mask=0x%x)\n", - status, chip->int_sta_mask); - } return IRQ_RETVAL(status); } @@ -1690,6 +1687,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { { + .vendor = 0x0e11, + .device = 0x00b8, + .name = "Compaq Evo D510C", + .type = AC97_TUNE_HP_ONLY + }, + { .vendor = 0x1014, .device = 0x1f00, .name = "MS-9128", @@ -2739,6 +2742,7 @@ pci_read_config_word(pci, 0xe6, &val); #ifdef SUPPORT_JOYSTICK + val &= ~0x100; if (joystick[dev]) { if (! request_region(ich_gameport.io, 8, "ICH gameport")) { printk(KERN_WARNING "intel8x0: cannot grab gameport 0x%x\n", ich_gameport.io); @@ -2751,6 +2755,7 @@ } #endif #ifdef SUPPORT_MIDI + val &= ~0x20; if (mpu_port[dev] > 0) { if (mpu_port[dev] == 0x300 || mpu_port[dev] == 0x330) { u8 b; diff -urN linux-2.6.5-rc3/sound/pcmcia/pdaudiocf/pdaudiocf.c linux-2.6.5/sound/pcmcia/pdaudiocf/pdaudiocf.c --- linux-2.6.5-rc3/sound/pcmcia/pdaudiocf/pdaudiocf.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pcmcia/pdaudiocf/pdaudiocf.c 2004-04-03 20:20:40.000000000 -0800 @@ -25,7 +25,6 @@ #include #include #include "pdaudiocf.h" -#define SNDRV_GET_ID #include /* diff -urN linux-2.6.5-rc3/sound/pcmcia/pdaudiocf/pdaudiocf_core.c linux-2.6.5/sound/pcmcia/pdaudiocf/pdaudiocf_core.c --- linux-2.6.5-rc3/sound/pcmcia/pdaudiocf/pdaudiocf_core.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pcmcia/pdaudiocf/pdaudiocf_core.c 2004-04-03 20:20:40.000000000 -0800 @@ -23,7 +23,6 @@ #include #include #include "pdaudiocf.h" -#define SNDRV_GET_ID #include /* diff -urN linux-2.6.5-rc3/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c linux-2.6.5/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c --- linux-2.6.5-rc3/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c 2004-04-03 20:20:40.000000000 -0800 @@ -21,7 +21,6 @@ #include #include #include "pdaudiocf.h" -#define SNDRV_GET_ID #include /* diff -urN linux-2.6.5-rc3/sound/ppc/powermac.c linux-2.6.5/sound/ppc/powermac.c --- linux-2.6.5-rc3/sound/ppc/powermac.c 2004-03-10 18:55:54.000000000 -0800 +++ linux-2.6.5/sound/ppc/powermac.c 2004-04-03 20:20:40.000000000 -0800 @@ -36,7 +36,7 @@ static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ -static int enable = 1; +/* static int enable = 1; */ #ifdef PMAC_SUPPORT_PCM_BEEP static int enable_beep = 1; #endif @@ -47,9 +47,9 @@ MODULE_PARM(id, "s"); MODULE_PARM_DESC(id, "ID string for " CHIP_NAME " soundchip."); MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC); -MODULE_PARM(enable, "i"); -MODULE_PARM_DESC(enable, "Enable this soundchip."); -MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); +/* MODULE_PARM(enable, "i"); + MODULE_PARM_DESC(enable, "Enable this soundchip."); + MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); */ #ifdef PMAC_SUPPORT_PCM_BEEP MODULE_PARM(enable_beep, "i"); MODULE_PARM_DESC(enable_beep, "Enable beep using PCM."); @@ -183,6 +183,8 @@ static int __init alsa_card_pmac_setup(char *str) { + int __attribute__ ((__unused__)) enable = 1; + (void)(get_option(&str,&enable) == 2 && get_option(&str,&index) == 2 && get_id(&str,&id) == 2 diff -urN linux-2.6.5-rc3/sound/usb/usbaudio.c linux-2.6.5/sound/usb/usbaudio.c --- linux-2.6.5-rc3/sound/usb/usbaudio.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/usb/usbaudio.c 2004-04-03 20:20:40.000000000 -0800 @@ -104,6 +104,7 @@ */ #define MAX_PACKS 10 +#define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */ #define MAX_URBS 5 /* max. 20ms long packets */ #define SYNC_URBS 2 /* always two urbs for sync */ #define MIN_PACKS_URB 1 /* minimum 1 packet per urb */ @@ -161,8 +162,8 @@ unsigned int datapipe; /* the data i/o pipe */ unsigned int syncpipe; /* 1 - async out or adaptive in */ unsigned int syncinterval; /* P for adaptive mode, 0 otherwise */ - unsigned int freqn; /* nominal sampling rate in USB format, i.e. fs/1000 in Q10.14 */ - unsigned int freqm; /* momentary sampling rate in USB format, i.e. fs/1000 in Q10.14 */ + unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */ + unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */ unsigned int freqmax; /* maximum sampling rate, used for buffer management */ unsigned int phase; /* phase accumulator */ unsigned int maxpacksize; /* max packet size in bytes */ @@ -184,7 +185,7 @@ unsigned int nurbs; /* # urbs */ snd_urb_ctx_t dataurb[MAX_URBS]; /* data urb table */ snd_urb_ctx_t syncurb[SYNC_URBS]; /* sync urb table */ - char syncbuf[SYNC_URBS * MAX_PACKS * 3]; /* sync buffer; it's so small - let's get static */ + char syncbuf[SYNC_URBS * MAX_PACKS * 4]; /* sync buffer; it's so small - let's get static */ char *tmpbuf; /* temporary buffer for playback */ u64 formats; /* format bitmasks (all or'ed) */ @@ -218,17 +219,38 @@ /* - * convert a sampling rate into USB format (fs/1000 in Q10.14) - * this will overflow at approx 2MSPS + * convert a sampling rate into our full speed format (fs/1000 in Q16.16) + * this will overflow at approx 524 kHz */ -inline static unsigned get_usb_rate(unsigned int rate) +inline static unsigned get_usb_full_speed_rate(unsigned int rate) { - return ((rate << 11) + 62) / 125; + return ((rate << 13) + 62) / 125; +} + +/* + * convert a sampling rate into USB high speed format (fs/8000 in Q16.16) + * this will overflow at approx 4 MHz + */ +inline static unsigned get_usb_high_speed_rate(unsigned int rate) +{ + return ((rate << 10) + 62) / 125; +} + +/* convert our full speed USB rate into sampling rate in Hz */ +inline static unsigned get_full_speed_hz(unsigned int usb_rate) +{ + return (usb_rate * 125 + (1 << 12)) >> 13; +} + +/* convert our high speed USB rate into sampling rate in Hz */ +inline static unsigned get_high_speed_hz(unsigned int usb_rate) +{ + return (usb_rate * 125 + (1 << 9)) >> 10; } /* - * prepare urb for capture sync pipe + * prepare urb for full speed capture sync pipe * * fill the length and offset of each urb descriptor. * the fixed 10.14 frequency is passed through the pipe. @@ -243,14 +265,40 @@ urb->number_of_packets = ctx->packets; urb->dev = ctx->subs->dev; /* we need to set this at each time */ - for (i = offs = 0; i < urb->number_of_packets; i++, offs += 3, cp += 3) { + for (i = offs = 0; i < urb->number_of_packets; i++, offs += 4, cp += 4) { urb->iso_frame_desc[i].length = 3; urb->iso_frame_desc[i].offset = offs; + cp[0] = subs->freqn >> 2; + cp[1] = subs->freqn >> 10; + cp[2] = subs->freqn >> 18; + } + return 0; +} + +/* + * prepare urb for high speed capture sync pipe + * + * fill the length and offset of each urb descriptor. + * the fixed 12.13 frequency is passed as 16.16 through the pipe. + */ +static int prepare_capture_sync_urb_hs(snd_usb_substream_t *subs, + snd_pcm_runtime_t *runtime, + struct urb *urb) +{ + unsigned char *cp = urb->transfer_buffer; + snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; + int i, offs; + + urb->number_of_packets = ctx->packets; + urb->dev = ctx->subs->dev; /* we need to set this at each time */ + for (i = offs = 0; i < urb->number_of_packets; i++, offs += 4, cp += 4) { + urb->iso_frame_desc[i].length = 4; + urb->iso_frame_desc[i].offset = offs; cp[0] = subs->freqn; cp[1] = subs->freqn >> 8; cp[2] = subs->freqn >> 16; + cp[3] = subs->freqn >> 24; } - urb->interval = 1; return 0; } @@ -301,7 +349,6 @@ spin_unlock_irqrestore(&subs->lock, flags); urb->transfer_buffer = ctx->buf; urb->transfer_buffer_length = offs; - urb->interval = 1; #if 0 // for check if (! urb->bandwidth) { int bustime; @@ -372,7 +419,7 @@ /* - * prepare urb for playback sync pipe + * prepare urb for full speed playback sync pipe * * set up the offset and length to receive the current frequency. */ @@ -386,16 +433,37 @@ urb->number_of_packets = ctx->packets; urb->dev = ctx->subs->dev; /* we need to set this at each time */ - for (i = offs = 0; i < urb->number_of_packets; i++, offs += 3) { + for (i = offs = 0; i < urb->number_of_packets; i++, offs += 4) { urb->iso_frame_desc[i].length = 3; urb->iso_frame_desc[i].offset = offs; } - urb->interval = 1; return 0; } /* - * process after playback sync complete + * prepare urb for high speed playback sync pipe + * + * set up the offset and length to receive the current frequency. + */ + +static int prepare_playback_sync_urb_hs(snd_usb_substream_t *subs, + snd_pcm_runtime_t *runtime, + struct urb *urb) +{ + int i, offs; + snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context; + + urb->number_of_packets = ctx->packets; + urb->dev = ctx->subs->dev; /* we need to set this at each time */ + for (i = offs = 0; i < urb->number_of_packets; i++, offs += 4) { + urb->iso_frame_desc[i].length = 4; + urb->iso_frame_desc[i].offset = offs; + } + return 0; +} + +/* + * process after full speed playback sync complete * * retrieve the current 10.14 frequency from pipe, and set it. * the value is referred in prepare_playback_urb(). @@ -410,11 +478,11 @@ unsigned long flags; found = 0; - for (i = 0; i < urb->number_of_packets; i++, cp += 3) { + for (i = 0; i < urb->number_of_packets; i++, cp += 4) { if (urb->iso_frame_desc[i].status || urb->iso_frame_desc[i].actual_length < 3) continue; - f = combine_triple(cp); + f = combine_triple(cp) << 2; #if 0 if (f < subs->freqn - (subs->freqn>>3) || f > subs->freqmax) { snd_printd(KERN_WARNING "requested frequency %d (%u,%03uHz) out of range (current nominal %d (%u,%03uHz))\n", @@ -435,6 +503,37 @@ } /* + * process after high speed playback sync complete + * + * retrieve the current 12.13 frequency from pipe, and set it. + * the value is referred in prepare_playback_urb(). + */ +static int retire_playback_sync_urb_hs(snd_usb_substream_t *subs, + snd_pcm_runtime_t *runtime, + struct urb *urb) +{ + int i; + unsigned int found; + unsigned char *cp = urb->transfer_buffer; + unsigned long flags; + + found = 0; + for (i = 0; i < urb->number_of_packets; i++, cp += 4) { + if (urb->iso_frame_desc[i].status || + urb->iso_frame_desc[i].actual_length < 4) + continue; + found = combine_quad(cp) & 0x0fffffff; + } + if (found) { + spin_lock_irqsave(&subs->lock, flags); + subs->freqm = found; + spin_unlock_irqrestore(&subs->lock, flags); + } + + return 0; +} + +/* * prepare urb for playback data pipe * * we copy the data directly from the pcm buffer. @@ -464,8 +563,8 @@ if (subs->fill_max) counts = subs->maxframesize; /* fixed */ else { - subs->phase = (subs->phase & 0x3fff) + subs->freqm; - counts = subs->phase >> 14; + subs->phase = (subs->phase & 0xffff) + subs->freqm; + counts = subs->phase >> 16; if (counts > subs->maxframesize) counts = subs->maxframesize; } @@ -515,7 +614,6 @@ spin_unlock_irqrestore(&subs->lock, flags); urb->transfer_buffer_length = offs * stride; ctx->transfer = offs; - urb->interval = 1; return 0; } @@ -565,6 +663,21 @@ }, }; +static struct snd_urb_ops audio_urb_ops_high_speed[2] = { + { + .prepare = prepare_playback_urb, + .retire = retire_playback_urb, + .prepare_sync = prepare_playback_sync_urb_hs, + .retire_sync = retire_playback_sync_urb_hs, + }, + { + .prepare = prepare_capture_urb, + .retire = retire_capture_urb, + .prepare_sync = prepare_capture_sync_urb_hs, + .retire_sync = retire_capture_sync_urb, + }, +}; + /* * complete callback from data urb */ @@ -822,15 +935,19 @@ { unsigned int maxsize, n, i; int is_playback = subs->direction == SNDRV_PCM_STREAM_PLAYBACK; - unsigned int npacks[MAX_URBS], total_packs; + unsigned int npacks[MAX_URBS], urb_packs, total_packs; - /* calculate the frequency in 10.14 format */ - subs->freqn = subs->freqm = get_usb_rate(rate); + /* calculate the frequency in 16.16 format */ + if (snd_usb_get_speed(subs->dev) == USB_SPEED_FULL) + subs->freqn = get_usb_full_speed_rate(rate); + else + subs->freqn = get_usb_high_speed_rate(rate); + subs->freqm = subs->freqn; subs->freqmax = subs->freqn + (subs->freqn >> 2); /* max. allowed frequency */ subs->phase = 0; /* calculate the max. size of packet */ - maxsize = ((subs->freqmax + 0x3fff) * (frame_bits >> 3)) >> 14; + maxsize = ((subs->freqmax + 0xffff) * (frame_bits >> 3)) >> 16; if (subs->maxpacksize && maxsize > subs->maxpacksize) { //snd_printd(KERN_DEBUG "maxsize %d is greater than defined size %d\n", // maxsize, subs->maxpacksize); @@ -842,9 +959,14 @@ else subs->curpacksize = maxsize; + if (snd_usb_get_speed(subs->dev) == USB_SPEED_FULL) + urb_packs = nrpacks; + else + urb_packs = nrpacks * 8; + /* allocate a temporary buffer for playback */ if (is_playback) { - subs->tmpbuf = kmalloc(maxsize * nrpacks, GFP_KERNEL); + subs->tmpbuf = kmalloc(maxsize * urb_packs, GFP_KERNEL); if (! subs->tmpbuf) { snd_printk(KERN_ERR "cannot malloc tmpbuf\n"); return -ENOMEM; @@ -855,16 +977,16 @@ total_packs = (period_bytes + maxsize - 1) / maxsize; if (total_packs < 2 * MIN_PACKS_URB) total_packs = 2 * MIN_PACKS_URB; - subs->nurbs = (total_packs + nrpacks - 1) / nrpacks; + subs->nurbs = (total_packs + urb_packs - 1) / urb_packs; if (subs->nurbs > MAX_URBS) { /* too much... */ subs->nurbs = MAX_URBS; - total_packs = MAX_URBS * nrpacks; + total_packs = MAX_URBS * urb_packs; } n = total_packs; for (i = 0; i < subs->nurbs; i++) { - npacks[i] = n > nrpacks ? nrpacks : n; - n -= nrpacks; + npacks[i] = n > urb_packs ? urb_packs : n; + n -= urb_packs; } if (subs->nurbs <= 1) { /* too little - we need at least two packets @@ -913,6 +1035,7 @@ u->urb->pipe = subs->datapipe; u->urb->transfer_flags = URB_ISO_ASAP; u->urb->number_of_packets = u->packets; + u->urb->interval = 1; u->urb->context = u; u->urb->complete = snd_usb_complete_callback(snd_complete_urb); } @@ -929,12 +1052,16 @@ release_substream_urbs(subs, 0); return -ENOMEM; } - u->urb->transfer_buffer = subs->syncbuf + i * nrpacks * 3; - u->urb->transfer_buffer_length = nrpacks * 3; + u->urb->transfer_buffer = subs->syncbuf + i * nrpacks * 4; + u->urb->transfer_buffer_length = nrpacks * 4; u->urb->dev = subs->dev; u->urb->pipe = subs->syncpipe; u->urb->transfer_flags = URB_ISO_ASAP; u->urb->number_of_packets = u->packets; + if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH) + u->urb->interval = 8; + else + u->urb->interval = 1; u->urb->context = u; u->urb->complete = snd_usb_complete_callback(snd_complete_sync_urb); } @@ -1099,7 +1226,7 @@ /* set interface */ if (subs->interface != fmt->iface || subs->format != fmt->altset_idx) { - if (usb_set_interface(dev, fmt->iface, fmt->altset_idx) < 0) { + if (usb_set_interface(dev, fmt->iface, fmt->altsetting) < 0) { snd_printk(KERN_ERR "%d:%d:%d: usb_set_interface failed\n", dev->devnum, fmt->iface, fmt->altsetting); return -EIO; @@ -1116,7 +1243,7 @@ else subs->datapipe = usb_rcvisocpipe(dev, ep); subs->syncpipe = subs->syncinterval = 0; - subs->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize; + subs->maxpacksize = fmt->maxpacksize; subs->fill_max = 0; /* we need a sync pipe in async OUT or adaptive IN mode */ @@ -1836,11 +1963,10 @@ snd_iprintf(buffer, "%d ", subs->dataurb[i].packets); snd_iprintf(buffer, "]\n"); snd_iprintf(buffer, " Packet Size = %d\n", subs->curpacksize); - snd_iprintf(buffer, " Momentary freq = %d.%d Hz\n", - (subs->freqm * 125) >> 11, - (subs->freqm >> 10) * 625 - + (((subs->freqm & ((1 << 10) - 1)) * 625) >> 10) - - 10 * ((subs->freqm * 125) >> 11)); + snd_iprintf(buffer, " Momentary freq = %u Hz\n", + snd_usb_get_speed(subs->dev) == USB_SPEED_FULL + ? get_full_speed_hz(subs->freqm) + : get_high_speed_hz(subs->freqm)); } else { snd_iprintf(buffer, " Status: Stop\n"); } @@ -1890,7 +2016,10 @@ subs->stream = as; subs->direction = stream; subs->dev = as->chip->dev; - subs->ops = audio_urb_ops[stream]; + if (snd_usb_get_speed(subs->dev) == USB_SPEED_FULL) + subs->ops = audio_urb_ops[stream]; + else + subs->ops = audio_urb_ops_high_speed[stream]; snd_pcm_lib_preallocate_pages(as->pcm->streams[stream].substream, SNDRV_DMA_TYPE_CONTINUOUS, snd_dma_continuous_data(GFP_KERNEL), @@ -2351,6 +2480,7 @@ fp->altset_idx = i; fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; + /* FIXME: decode wMaxPacketSize of high bandwith endpoints */ fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize; fp->attributes = csep[3]; @@ -2405,7 +2535,7 @@ return err; } /* try to set the interface... */ - usb_set_interface(chip->dev, iface_no, i); + usb_set_interface(chip->dev, iface_no, altno); init_usb_pitch(chip->dev, iface_no, alts, fp); init_usb_sample_rate(chip->dev, iface_no, alts, fp, fp->rate_max); } @@ -2422,7 +2552,6 @@ int idx; snd_usb_stream_t *as; snd_usb_substream_t *subs; - struct list_head *p; as = list_entry(head, snd_usb_stream_t, list); for (idx = 0; idx < 2; idx++) { @@ -2431,11 +2560,6 @@ return; release_substream_urbs(subs, 1); subs->interface = -1; - /* release interfaces */ - list_for_each(p, &subs->fmt_list) { - struct audioformat *fp = list_entry(p, struct audioformat, list); - usb_driver_release_interface(driver, usb_ifnum_to_if(subs->dev, fp->iface)); - } } } @@ -2587,14 +2711,13 @@ struct usb_interface *iface, const snd_usb_audio_quirk_t *quirk) { - struct usb_host_config *config = chip->dev->actconfig; int probed_ifnum = get_iface_desc(iface->altsetting)->bInterfaceNumber; int err; for (quirk = quirk->data; quirk->ifnum >= 0; ++quirk) { - if (quirk->ifnum >= get_cfg_desc(config)->bNumInterfaces) + iface = usb_ifnum_to_if(chip->dev, quirk->ifnum); + if (!iface) continue; - iface = get_iface(config, quirk->ifnum); if (quirk->ifnum != probed_ifnum && usb_interface_claimed(iface)) continue; @@ -2706,9 +2829,6 @@ static int snd_usb_audio_free(snd_usb_audio_t *chip) { - down(®ister_mutex); - usb_chip[chip->index] = NULL; - up(®ister_mutex); snd_magic_kfree(chip); return 0; } @@ -2723,10 +2843,11 @@ /* * create a chip instance and set its names. */ -static int snd_usb_audio_create(snd_card_t *card, struct usb_device *dev, +static int snd_usb_audio_create(struct usb_device *dev, int idx, const snd_usb_audio_quirk_t *quirk, snd_usb_audio_t **rchip) { + snd_card_t *card; snd_usb_audio_t *chip; int err, len; char component[14]; @@ -2735,10 +2856,26 @@ }; *rchip = NULL; + + if (snd_usb_get_speed(dev) != USB_SPEED_FULL && + snd_usb_get_speed(dev) != USB_SPEED_HIGH) { + snd_printk(KERN_ERR "unknown device speed %d\n", snd_usb_get_speed(dev)); + return -ENXIO; + } + + card = snd_card_new(index[idx], id[idx], THIS_MODULE, 0); + if (card == NULL) { + snd_printk(KERN_ERR "cannot create card instance %d\n", idx); + return -ENOMEM; + } + chip = snd_magic_kcalloc(snd_usb_audio_t, 0, GFP_KERNEL); - if (! chip) + if (! chip) { + snd_card_free(card); return -ENOMEM; + } + chip->index = idx; chip->dev = dev; chip->card = card; INIT_LIST_HEAD(&chip->pcm_list); @@ -2746,6 +2883,7 @@ if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { snd_usb_audio_free(chip); + snd_card_free(card); return err; } @@ -2788,6 +2926,10 @@ if (len < sizeof(card->longname)) usb_make_path(dev, card->longname + len, sizeof(card->longname) - len); + strlcat(card->longname, + snd_usb_get_speed(dev) == USB_SPEED_FULL ? ", full speed" : ", high speed", + sizeof(card->longname)); + snd_usb_audio_create_proc(chip); snd_card_set_dev(card, &dev->dev); @@ -2814,7 +2956,6 @@ struct usb_host_config *config = dev->actconfig; const snd_usb_audio_quirk_t *quirk = (const snd_usb_audio_quirk_t *)usb_id->driver_info; int i, err; - snd_card_t *card; snd_usb_audio_t *chip; struct usb_host_interface *alts; int ifnum; @@ -2842,11 +2983,11 @@ down(®ister_mutex); for (i = 0; i < SNDRV_CARDS; i++) { if (usb_chip[i] && usb_chip[i]->dev == dev) { - chip = usb_chip[i]; - if (chip->shutdown) { + if (usb_chip[i]->shutdown) { snd_printk(KERN_ERR "USB device is in the shutdown state, cannot create a card instance\n"); goto __error; } + chip = usb_chip[i]; break; } } @@ -2863,17 +3004,9 @@ if (enable[i] && ! usb_chip[i] && (vid[i] == -1 || vid[i] == dev->descriptor.idVendor) && (pid[i] == -1 || pid[i] == dev->descriptor.idProduct)) { - card = snd_card_new(index[i], id[i], THIS_MODULE, 0); - if (card == NULL) { - snd_printk(KERN_ERR "cannot create a card instance %d\n", i); - goto __error; - } - if (snd_usb_audio_create(card, dev, quirk, &chip) < 0) { - snd_card_free(card); + if (snd_usb_audio_create(dev, i, quirk, &chip) < 0) { goto __error; } - chip->index = i; - usb_chip[i] = chip; break; } if (! chip) { @@ -2899,16 +3032,17 @@ /* we are allowed to call snd_card_register() many times */ if (snd_card_register(chip->card) < 0) { - if (! chip->num_interfaces) - snd_card_free(chip->card); goto __error; } + usb_chip[chip->index] = chip; chip->num_interfaces++; up(®ister_mutex); return chip; __error: + if (chip && !chip->num_interfaces) + snd_card_free(chip->card); up(®ister_mutex); __err_val: return NULL; @@ -2942,6 +3076,7 @@ list_for_each(p, &chip->midi_list) { snd_usbmidi_disconnect(p, &usb_audio_driver); } + usb_chip[chip->index] = NULL; up(®ister_mutex); snd_card_free_in_thread(card); } else { diff -urN linux-2.6.5-rc3/sound/usb/usbaudio.h linux-2.6.5/sound/usb/usbaudio.h --- linux-2.6.5-rc3/sound/usb/usbaudio.h 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/usb/usbaudio.h 2004-04-03 20:20:40.000000000 -0800 @@ -207,7 +207,6 @@ * (conditional for compatibility with the older API) */ #ifndef get_iface_desc -#define get_iface(cfg, num) ((cfg)->interface[(num)]) #define get_iface_desc(iface) (&(iface)->desc) #define get_endpoint(alt,ep) (&(alt)->endpoint[ep].desc) #define get_ep_desc(ep) (&(ep)->desc) @@ -222,4 +221,8 @@ #define snd_usb_complete_callback(x) (x) #endif +#ifndef snd_usb_get_speed +#define snd_usb_get_speed(dev) ((dev)->speed) +#endif + #endif /* __USBAUDIO_H */ diff -urN linux-2.6.5-rc3/sound/usb/usbmidi.c linux-2.6.5/sound/usb/usbmidi.c --- linux-2.6.5-rc3/sound/usb/usbmidi.c 2004-04-03 20:19:57.000000000 -0800 +++ linux-2.6.5/sound/usb/usbmidi.c 2004-04-03 20:20:40.000000000 -0800 @@ -714,7 +714,6 @@ if (ep->in && ep->in->urb) usb_unlink_urb(ep->in->urb); } - usb_driver_release_interface(driver, umidi->iface); } static void snd_usbmidi_rawmidi_free(snd_rawmidi_t* rmidi)