diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/CREDITS linuxppc64_2_4/CREDITS
--- ../kernel.org/linux-2.4.19/CREDITS Fri Apr 19 11:00:43 2002
+++ linuxppc64_2_4/CREDITS Mon Apr 22 10:35:08 2002
@@ -986,6 +986,14 @@
S: 80050-430 - Curitiba - Paraná
S: Brazil
+N: Tom Gall
+E: tom_gall@vnet.ibm.com
+E: tgall@rochcivictheatre.org
+D: ppc64, ppc
+S: 710 Walnut St
+S: Mantorville, MN 55955
+S: USA
+
N: Nigel Gamble
E: nigel@nrg.org
E: nigel@sgi.com
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/Documentation/Configure.help linuxppc64_2_4/Documentation/Configure.help
--- ../kernel.org/linux-2.4.19/Documentation/Configure.help Mon Apr 22 11:34:25 2002
+++ linuxppc64_2_4/Documentation/Configure.help Tue Apr 23 09:37:22 2002
@@ -232,6 +232,13 @@
CPU and the single-board computers built around it, targeted for
network and embedded applications. For more information see the
Axis Communication site, .
+PowerPC64 processor
+CONFIG_PPC64
+ The PowerPC architecture was designed for both 32 bit and 64 bit
+ processor implementations. 64 bit PowerPC processors are in many
+ ways a superset of their 32 bit PowerPC cousins. Each 64 bit PowerPC
+ processor also has a 32 bit mode to allow for 32 bit compatibility.
+ The home of the PowerPC 64 Linux project is at
Multiquad support for NUMA systems
CONFIG_MULTIQUAD
@@ -15232,6 +15239,20 @@
hard drives and ADFS-formatted floppy disks. This is experimental
codes, so if you're unsure, say N.
+JFS filesystem support
+CONFIG_JFS_FS
+ This is a port of IBM's Journaled Filesystem . More information is
+ available in the file Documentation/filesystems/jfs.txt.
+
+ If you do not intend to use the JFS filesystem, say N.
+
+JFS Debugging
+CONFIG_JFS_DEBUG
+ If you are experiencing any problems with the JFS filesystem, say
+ Y here. This will result in additional debugging messages to be
+ written to the system log. Under normal circumstances, this
+ results in very little overhead.
+
/dev/pts file system for Unix98 PTYs
CONFIG_DEVPTS_FS
You should say Y here if you said Y to "Unix98 PTY support" above.
@@ -16401,6 +16422,19 @@
. The module will be called
isicom.o.
+IBM Multiport Serial Adapter
+CONFIG_ICOM
+ This driver is for a family of multiport serial adapters including
+ 2 port RVX (iSeries 2745), 2 port modem (iSeries
+ 2772) and 1 port RVX + 1 port modem (iSeries 2771). The
+ module is called iCom.o
+CONFIG_ICOM_MODEM_CC
+ This field entry enables the device driver to configure the modem
+ for appropriate operations based on country code. If you do not
+ have an internal modem card then a blank entry is recommended.
+ If you do have an internal modem card, look for the comment in iCom.c
+ indicating which value relates to your country.
+
Unix98 PTY support
CONFIG_UNIX98_PTYS
A pseudo terminal (PTY) is a software device consisting of two
@@ -21073,6 +21107,12 @@
Select APUS if configuring for a PowerUP Amiga.
More information is available at:
.
+# Choice: i or p
+Platform support
+CONFIG_PPC_ISERIES
+ Linux runs on certain models of the IBM AS/400, now known as the
+ IBM iSeries. Generally if you can run LPAR (Logical Partitioning)
+ on your iSeries you can run Linux in a partition on your machine.
AltiVec kernel support
CONFIG_ALTIVEC
@@ -21136,6 +21176,16 @@
You may also want to compile the dma sound driver as a module and
have it autoloaded. The act of removing the module shuts down the
sound hardware for more power savings.
+Platform support
+CONFIG_PPC_PSERIES
+ Linux runs on most models of IBM pSeries hardware. (pSeries used
+ to be known as the RS/6000)
+
+ See for exact model information for the
+ 64 bit PowerPC kernel.
+
+ pSeries Linux information from IBM can be found at:
+
APM emulation
CONFIG_PMAC_APM_EMU
@@ -21424,6 +21474,12 @@
Date of Release: early 2001 (?)
End of life: -
URL:
+Support for Large Memory
+CONFIG_MSCHUNKS
+ MsChunks stands for Main Store Chunks and specifically allows the
+ 64 bit PowerPC Linux kernel to optimize for machines with sparse
+ discontiguous memory. iSeries kernels need to have this on.
+ It is recommended that for pSeries hardware that you answer N.
ADB raw keycode support
CONFIG_MAC_ADBKEYCODES
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/Documentation/cachetlb.txt linuxppc64_2_4/Documentation/cachetlb.txt
--- ../kernel.org/linux-2.4.19/Documentation/cachetlb.txt Fri Apr 19 11:00:11 2002
+++ linuxppc64_2_4/Documentation/cachetlb.txt Mon Apr 22 10:24:05 2002
@@ -260,8 +260,9 @@
Here is the new interface:
- void copy_user_page(void *to, void *from, unsigned long address)
- void clear_user_page(void *to, unsigned long address)
+ void copy_user_page(struct page *to, struct page *from,
+ unsigned long address)
+ void clear_user_page(struct page *to, unsigned long address)
These two routines store data in user anonymous or COW
pages. It allows a port to efficiently avoid D-cache alias
@@ -279,6 +280,11 @@
If D-cache aliasing is not an issue, these two routines may
simply call memcpy/memset directly and do nothing more.
+
+ There are default versions of these procedures supplied in
+ include/linux/highmem.h. If a port does not want to use the
+ default versions it should declare them and define the symbol
+ __HAVE_ARCH_USER_PAGE in include/asm/page.h.
void flush_dcache_page(struct page *page)
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/Documentation/filesystems/00-INDEX linuxppc64_2_4/Documentation/filesystems/00-INDEX
--- ../kernel.org/linux-2.4.19/Documentation/filesystems/00-INDEX Fri Apr 19 10:30:50 2002
+++ linuxppc64_2_4/Documentation/filesystems/00-INDEX Thu Sep 13 14:29:38 2001
@@ -22,6 +22,8 @@
- info and mount options for the OS/2 HPFS.
isofs.txt
- info and mount options for the ISO 9660 (CDROM) filesystem.
+jfs.txt
+ - info and mount options for the JFS filesystem.
ncpfs.txt
- info on Novell Netware(tm) filesystem using NCP protocol.
ntfs.txt
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/Documentation/filesystems/changelog.jfs linuxppc64_2_4/Documentation/filesystems/changelog.jfs
--- ../kernel.org/linux-2.4.19/Documentation/filesystems/changelog.jfs Wed Dec 31 18:00:00 1969
+++ linuxppc64_2_4/Documentation/filesystems/changelog.jfs Tue Apr 23 11:25:34 2002
@@ -0,0 +1,234 @@
+IBM's Journaled File System (JFS) for Linux version 1.0.17
+Team members
+Steve Best sbest@us.ibm.com
+Dave Kleikamp shaggy@austin.ibm.com
+Barry Arndt barndt@us.ibm.com
+Christoph Hellwig hch@infradead.org
+
+
+Release April 2, 2002 (version 1.0.17)
+
+This is our fifty-fifth release of IBM's Enterprise JFS technology port to Linux.
+Beta 1 was release 0.1.0 on 12/8/2000, Beta 2 was release 0.2.0 on 3/7/2001,
+Beta 3 was release 0.3.0 on 4/30/2001, and release 1.0.0 on 6/28/2001.
+
+
+Function and Fixes in drop 55 (1.0.17)
+ - Call sb_set_blocksize instead of set_blocksize in 2.5 (Christoph Hellwig)
+ - Replace strtok by strsep (Christoph Hellwig)
+ - Store entire device number in log superblock rather than just the minor.
+ - Include file clean (Christoph Hellwig)
+ - Fix race introduced by thread handling cleanups (Christoph Hellwig)
+ - Detect dtree corruption to avoid infinite loop
+ - JFS needs to include completion.h
+ - Support external log(journal) device file system work part 1 (Christoph Hellwig)
+
+Function and Fixes in drop 54 (1.0.16)
+ - Limit readdir offset to signed integer for NFSv2 (Christoph Hellwig)
+ - missing static in jfs_imap.c (Christoph Hellwig)
+ - Fix infinite loop in jfs_readdir
+ weren't updating the directory index table completely (bug # 2591)
+ - Sync up 2.4 tree with 2.5 -- (Christoph Hellwig & Shaggy)
+ move to completions, provide back-compact for pre-2.4.7
+ remove dead code
+ add kdev_t conversion, that should have been in 2.4 anyway
+ move one-time inode initialization into slab constructor
+ - Remove non-core files from CVS
+
+Function and Fixes in drop 53 (1.0.15)
+ - Fix trap when appending to very large file
+ - Moving jfs headers into fs/jfs at Linus' request
+ - Move up to linux-2.5.4
+ - Fix file size limit on 32-bit (Andi Kleen)
+ - make changelog more read-able and include only 1.0.0 and above (Christoph Hellwig)
+ - Don't allocate metadata pages from high memory. JFS keeps them kmapped too long causing deadlock.
+ - Fix xtree corruption when creating file with >= 64 GB of physically contiguous dasd
+ - Replace semaphore with struct completion for thread startup/shutdown (Benedikt Spranger)
+ - cleanup Tx alloc/free (Christoph Hellwig)
+ - Move up to linux-2.5.3
+ - thread cleanups (Christoph Hellwig)
+ - First step toward making tblocks and tlocks dynamically allocated. Intro tid_t and lid_t to
+ insulate the majority of the code from future changes. Also hide TxBlock and TxLock arrays
+ by using macros to get from tids and lids to real structures.
+ - minor list-handling cleanup (Christoph Hellwig)
+ - Replace altnext and altprev with struct list_head
+ - Clean up the debugging code and add support for collecting statistics (Christoph Hellwig)
+
+
+Function and Fixes in drop 52 (1.0.14)
+ - Fix hang in invalidate_metapages when jfs.o is built as a module
+ - Fix anon_list removal logic in txLock
+
+Function and Fixes in drop 51 (1.0.13)
+ - chmod changes on newly created directories are lost after umount (bug 2535)
+ - Page locking race fixes
+ - Improve metapage locking
+ - Fix timing window. Lock page while metapage is active to avoid page going
+ away before the metadata is released. (Fixed crash during mount/umount testing)
+ - Make changes for 2.5.2 kernel
+ - Fix race condition truncating large files
+
+Function and Fixes in drop50 (1.0.12)
+ - Add O_DIRECT support
+ - Add support for 2.4.17 kernel
+ - Make sure COMMIT_STALE gets reset before the inode is unlocked. Fixing
+ this gets rid of XT_GETPAGE errors
+ - Remove invalid __exit keyword from metapage_exit and txExit.
+ - fix assert(log->cqueue.head == NULL by waiting longer
+
+Function and Fixes in drop49 (1.0.11)
+ - Readdir was not handling multibyte codepages correctly.
+ - Make mount option parsing more robust.
+ - Add iocharset mount option.
+ - Journalling of symlinks incorrect, resulting in logredo failure of -265.
+ - Add jfsutils information to Changes file
+ - Improve recoverability of the file system when metadata corruption is detected.
+ - Fix kernel OOPS when root inode is corrupted
+
+Function and Fixes in drop48 (1.0.10)
+ - put inodes later on hash queues
+ - Fix boundary case in xtTruncate
+ - When invalidating metadata, try to flush the dirty buffers rather than sync them.
+ - Add another sanity check to avoid trapping when imap is corrupt
+ - Fix file truncate while removing large file (assert(cmp == 0))
+ - read_cache_page returns ERR_PTR, not NULL on error
+ - Add dtSearchNode and dtRelocate
+ - JFS needs to use generic_file_open & generic_file_llseek
+ - Remove lazyQwait, etc. It created an unnecessary bottleneck in TxBegin.
+
+Function and Fixes in drop47 (1.0.9)
+ - Fix data corruption problem when creating files while deleting others. (jitterbug 183)
+ - Make sure all metadata is written before finalizing the log
+ - Fix serialization problem in shutdown by setting i_size of directory sooner. (bugzilla #334)
+ - JFS should quit whining when special files are marked dirty during read-only mount.
+ - Must always check rc after DT_GETPAGE
+ - Add diExtendFS
+ - Removing defconfig form JFS source - not really needed
+
+Function and Fixes in drop46 (1.0.8)
+ - Synclist was being built backwards causing logredo to quit too early
+ - jfs_compat.h needs to include module.h
+ - uncomment EXPORTS_NO_SYMBOLS in super.c
+ - Minor code cleanup
+ - xtree of zero-truncated file not being logged
+ - Fix logging on file truncate
+ - remove unused metapage fields
+
+Function and Fixes in drop45 (1.0.7)
+ - cleanup remove IS_KIOBUFIO define.
+ - cleanup remove TRUNC_NO_TOSS define.
+ - have jFYI's use the name directly from dentry
+ - Remove nul _ALLOC and _FREE macros and also make spinlocks static.
+ - cleanup add externs where needed in the header files
+ - jfs_write_inode is a bad place to call iput. Also limit warnings.
+ - More truncate cleanup
+ - Truncate cleanup
+ - Add missing statics in jfs_metapage.c
+ - fsync fixes
+ - Clean up symlink code - use page_symlink_inode_operations
+ - unicode handling cleanup
+ - cleanup replace UniChar with wchar_t
+ - Get rid of CDLL_* macros - use list.h instead
+ - 2.4.11-prex mount problem Call new_inode instead of get_empty_inode
+ - use kernel min/max macros
+ - Add MODULE_LICENSE stub for older kernels
+ - IA64/gcc3 fixes
+ - Log Manager fixes, introduce __SLEEP_COND macro
+ - Mark superblock dirty when some errors detected (forcing fsck to be run).
+ - More robust remounting from r/o to r/w.
+ - Misc. cleanup add static where appropriate
+ - small cleanup in jfs_umount_rw
+ - add MODULE_ stuff
+ - Set *dropped_lock in alloc_metapage
+ - Get rid of unused log list
+ - cleanup jfs_imap.c to remove _OLD_STUFF and _NO_MORE_MOUNT_INODE defines
+ - Log manager cleanup
+ - Transaction manager cleanup
+ - correct memory allocations flags
+ - Better handling of iterative truncation
+ - Change continue to break, otherwise we don't re-acquire LAZY_LOCK
+
+Function and Fixes in drop44 (1.0.6)
+ - Create jfs_incore.h which merges linux/jfs_fs.h, linux/jfs_fs_i.h, and jfs_fs_sb.h
+ - Create a configuration option to handle JFS_DEBUG define
+ - Fixed a few cases where positive error codes were returned to the VFS.
+ - Replace jfs_dir_read by generic_read_dir.
+ - jfs_fsync_inode is only called by jfs_fsync_file, merge the two and rename to jfs_fsync.
+ - Add a bunch of missing externs.
+ - jfs_rwlock_lock is unused, nuke it.
+ - Always use atomic set/test_bit operations to protect jfs_ip->cflag
+ - Combine jfs_ip->flag with jfs_ip->cflag
+ - Fixed minor format errors reported by fsck
+ - cflags should be long so bitops always works correctly
+ - Use GFP_NOFS for runtime memory allocations
+ - Support VM changes in 2.4.10 of the kernel
+ - Remove ifdefs supporting older 2.4 kernels. JFS now requires at least 2.4.3 or 2.4.2-ac2
+ - Simplify and remove one use of IWRITE_TRYLOCK
+ - jfs_truncate was not passing tid to xtTruncate
+ - removed obsolete extent_page workaround
+ - correct recovery from failed diAlloc call (disk full)
+ - In write_metapage, don't call commit_write if prepare_write failed
+
+Function and Fixes in drop43 (1.0.5)
+ - Allow separate allocation of JFS-private superblock/inode data.
+ - Remove checks in namei.c that are already done by the VFS.
+ - Remove redundant mutex defines.
+ - Replace all occurrences of #include with #include
+ - Work around race condition in remount -fixes OOPS during shutdown
+ - Truncate large files incrementally ( affects directories too)
+
+Function and Fixes in drop42 (1.0.4)
+ - Fixed compiler warnings in the FS when building on 64 bits systems
+ - Fixed deadlock where jfsCommit hung in hold_metapage
+ - Fixed problems with remount
+ - Reserve metapages for jfsCommit thread
+ - Get rid of buggy invalidate_metapage & use discard_metapage
+ - Don't hand metapages to jfsIOthread (too many context switches) (jitterbug 125, bugzilla 238)
+ - Fix error message in jfs_strtoUCS
+
+Function and Fixes in drop41 (1.0.3)
+ - Patch to move from previous release to latest release needs to update the version number in super.c
+ - Jitterbug problems (134,140,152) removing files have been fixed
+ - Set rc=ENOSPC if ialloc fails in jfs_create and jfs_mkdir
+ - Fixed jfs_txnmgr.c 775! assert
+ - Fixed jfs_txnmgr.c 884! assert(mp->nohomeok==0)
+ - Fix hang - prevent tblocks from being exhausted
+ - Fix oops trying to mount reiserfs
+ - Fail more gracefully in jfs_imap.c
+ - Print more information when char2uni fails
+ - Fix timing problem between Block map and metapage cache - jitterbug 139
+ - Code Cleanup (removed many ifdef's, obsolete code, ran code through indent) Mostly 2.4 tree
+ - Split source tree (Now have a separate source tree for 2.2, 2.4, and jfsutils)
+
+Function and Fixes in drop40 (1.0.2)
+ - Fixed multiple truncate hang
+ - Fixed hang on unlink a file and sync happening at the same time
+ - Improved handling of kmalloc error conditions
+ - Fixed hang in blk_get_queue and SMP deadlock: bh_end_io call generic_make_request
+ (jitterbug 145 and 146)
+ - stbl was not set correctly set in dtDelete
+ - changed trap to printk in dbAllocAG to avoid system hang
+
+Function and Fixes in drop 39 (1.0.1)
+ - Fixed hang during copying files on 2.2.x series
+ - Fixed TxLock compile problem
+ - Fixed to correctly update the number of blocks for directories (this was causing the FS
+ to show fsck error after compiling mozilla).
+ - Fixed to prevent old data from being written to disk from the page cache.
+
+Function and Fixes in drop 38 (1.0.0)
+ - Fixed some general log problems
+
+Please send bugs, comments, cards and letters to linuxjfs@us.ibm.com.
+
+The JFS mailing list can be subscribed to by using the link labeled "Mail list Subscribe"
+at our web page http://oss.software.ibm.com/jfs/.
+
+
+
+
+
+
+
+
+
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/Documentation/filesystems/jfs.txt linuxppc64_2_4/Documentation/filesystems/jfs.txt
--- ../kernel.org/linux-2.4.19/Documentation/filesystems/jfs.txt Wed Dec 31 18:00:00 1969
+++ linuxppc64_2_4/Documentation/filesystems/jfs.txt Tue Apr 23 11:25:34 2002
@@ -0,0 +1,10 @@
+IBM's Journaled File System (JFS) for Linux
+
+The JFS utilities can be found at the JFS homepage at
+http://oss.software.ibm.com/jfs
+
+Team members
+Steve Best sbest@us.ibm.com
+Dave Kleikamp shaggy@austin.ibm.com
+Barry Arndt barndt@us.ibm.com
+Christoph Hellwig hch@infradead.org
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/MAINTAINERS linuxppc64_2_4/MAINTAINERS
--- ../kernel.org/linux-2.4.19/MAINTAINERS Mon Apr 22 11:34:25 2002
+++ linuxppc64_2_4/MAINTAINERS Tue Apr 23 09:37:19 2002
@@ -852,6 +852,13 @@
W: http://sources.redhat.com/jffs2/
S: Maintained
+JFS FILESYSTEM
+P: Dave Kleikamp
+M: shaggy@austin.ibm.com
+L: jfs-discussion@oss.software.ibm.com
+W: http://oss.software.ibm.com/developerworks/opensource/jfs/
+S: Supported
+
JOYSTICK DRIVER
P: Vojtech Pavlik
M: vojtech@suse.cz
@@ -925,6 +932,13 @@
W: http://www.linuxppc.org/
L: linuxppc-dev@lists.linuxppc.org
S: Maintained
+
+LINUX FOR 64BIT POWERPC
+P: David Engebretsen
+M: engebret@us.ibm.com
+W: http://linuxppc64.org
+L: linuxppc64-dev@lists.linuxppc.org
+S: Supported
LINUX FOR 64BIT POWERPC
P: David Engebretsen
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/Makefile linuxppc64_2_4/Makefile
--- ../kernel.org/linux-2.4.19/Makefile Mon Apr 22 11:34:25 2002
+++ linuxppc64_2_4/Makefile Tue Apr 23 09:37:19 2002
@@ -5,7 +5,8 @@
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+#ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+ARCH := ppc64
KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -19,7 +20,7 @@
HOSTCC = gcc
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-CROSS_COMPILE =
+CROSS_COMPILE = /usr/local/ppc64-current3.0/bin/powerpc64-linux-
#
# Include the make variables (CC, etc...)
@@ -154,6 +155,7 @@
DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsidrv.o
DRIVERS-$(CONFIG_FUSION_BOOT) += drivers/message/fusion/fusion.o
DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394drv.o
+DRIVERS-$(CONFIG_PPC_ISERIES) += drivers/iseries/iseries.o
ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR)$(CONFIG_PARIDE_PCD),)
DRIVERS-y += drivers/cdrom/driver.o
@@ -170,7 +172,6 @@
DRIVERS-$(CONFIG_SBUS) += drivers/sbus/sbus_all.o
DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/driver.o
DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
-DRIVERS-$(CONFIG_PPC) += drivers/macintosh/macintosh.o
DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o
DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o
DRIVERS-$(CONFIG_SGI_IP22) += drivers/sgi/sgi.a
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/arm/mach-mx1ads/cpu.c linuxppc64_2_4/arch/arm/mach-mx1ads/cpu.c
--- ../kernel.org/linux-2.4.19/arch/arm/mach-mx1ads/cpu.c Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/arm/mach-mx1ads/cpu.c Mon Apr 22 14:12:27 2002
@@ -3,7 +3,7 @@
*
* Copyright (C) 2001 Deep Blue Solutions Ltd.
*
- * $Id: cpu.c,v 1.2 2001/09/22 12:11:17 rmk Exp $
+ * $Id: cpu.c,v 1.1 2002/04/22 19:12:27 tgall Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/arm/mach-sa1100/leds-system3.c linuxppc64_2_4/arch/arm/mach-sa1100/leds-system3.c
--- ../kernel.org/linux-2.4.19/arch/arm/mach-sa1100/leds-system3.c Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/arm/mach-sa1100/leds-system3.c Mon Apr 22 14:12:27 2002
@@ -5,13 +5,21 @@
*
* Original (leds-footbridge.c) by Russell King
*
- * $Id: leds-system3.c,v 1.1.6.1 2001/12/04 15:19:26 seletz Exp $
+ * $Id: leds-system3.c,v 1.1 2002/04/22 19:12:27 tgall Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* $Log: leds-system3.c,v $
+ * Revision 1.1 2002/04/22 19:12:27 tgall
+ * TAG: adds and deletes up to 2.4.19-pre6 now
+ *
+ *
+ * Code Origin : Myself
+ * License : Same as project
+ * Copyright : IBM
+ *
* Revision 1.1.6.1 2001/12/04 15:19:26 seletz
* - merged from linux_2_4_13_ac5_rmk2
*
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/arm/mach-sa1100/system3.c linuxppc64_2_4/arch/arm/mach-sa1100/system3.c
--- ../kernel.org/linux-2.4.19/arch/arm/mach-sa1100/system3.c Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/arm/mach-sa1100/system3.c Mon Apr 22 14:12:27 2002
@@ -3,7 +3,7 @@
*
* Copyright (C) 2001 Stefan Eletzhofer
*
- * $Id: system3.c,v 1.1.6.1 2001/12/04 17:28:06 seletz Exp $
+ * $Id: system3.c,v 1.1 2002/04/22 19:12:27 tgall Exp $
*
* This file contains all PT Sytsem 3 tweaks. Based on original work from
* Nicolas Pitre's assabet fixes
@@ -13,6 +13,14 @@
* published by the Free Software Foundation.
*
* $Log: system3.c,v $
+ * Revision 1.1 2002/04/22 19:12:27 tgall
+ * TAG: adds and deletes up to 2.4.19-pre6 now
+ *
+ *
+ * Code Origin : Myself
+ * License : Same as project
+ * Copyright : IBM
+ *
* Revision 1.1.6.1 2001/12/04 17:28:06 seletz
* - merged from previous branch
*
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/fakeprom/klgraph_init.c linuxppc64_2_4/arch/ia64/sn/fakeprom/klgraph_init.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/fakeprom/klgraph_init.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/fakeprom/klgraph_init.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: klgraph_init.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: klgraph_init.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/ate_utils.c linuxppc64_2_4/arch/ia64/sn/io/ate_utils.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/ate_utils.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/ate_utils.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: ate_utils.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: ate_utils.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/ifconfig_net.c linuxppc64_2_4/arch/ia64/sn/io/ifconfig_net.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/ifconfig_net.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/ifconfig_net.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: ifconfig_net.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: ifconfig_net.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/hub_intr.c linuxppc64_2_4/arch/ia64/sn/io/sn1/hub_intr.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/hub_intr.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/sn1/hub_intr.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: hub_intr.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: hub_intr.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/hubcounters.c linuxppc64_2_4/arch/ia64/sn/io/sn1/hubcounters.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/hubcounters.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/sn1/hubcounters.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: hubcounters.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: hubcounters.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/huberror.c linuxppc64_2_4/arch/ia64/sn/io/sn1/huberror.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/huberror.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/sn1/huberror.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: huberror.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: huberror.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/mem_refcnt.c linuxppc64_2_4/arch/ia64/sn/io/sn1/mem_refcnt.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/mem_refcnt.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/sn1/mem_refcnt.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: mem_refcnt.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: mem_refcnt.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/ml_SN_intr.c linuxppc64_2_4/arch/ia64/sn/io/sn1/ml_SN_intr.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn1/ml_SN_intr.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/sn1/ml_SN_intr.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: ml_SN_intr.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: ml_SN_intr.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn2/bte_error.c linuxppc64_2_4/arch/ia64/sn/io/sn2/bte_error.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn2/bte_error.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/sn2/bte_error.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: bte_error.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: bte_error.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn2/ml_SN_intr.c linuxppc64_2_4/arch/ia64/sn/io/sn2/ml_SN_intr.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn2/ml_SN_intr.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/sn2/ml_SN_intr.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: ml_SN_intr.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: ml_SN_intr.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn2/shub_intr.c linuxppc64_2_4/arch/ia64/sn/io/sn2/shub_intr.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn2/shub_intr.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/sn2/shub_intr.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: shub_intr.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: shub_intr.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn2/shuberror.c linuxppc64_2_4/arch/ia64/sn/io/sn2/shuberror.c
--- ../kernel.org/linux-2.4.19/arch/ia64/sn/io/sn2/shuberror.c Fri Apr 19 10:59:47 2002
+++ linuxppc64_2_4/arch/ia64/sn/io/sn2/shuberror.c Mon Apr 22 13:25:20 2002
@@ -1,4 +1,4 @@
-/* $Id: shuberror.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
+/* $Id: shuberror.c,v 1.1 2002/04/22 18:25:20 tgall Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/mips64/sgi-ip32/ip32-reset.c linuxppc64_2_4/arch/mips64/sgi-ip32/ip32-reset.c
--- ../kernel.org/linux-2.4.19/arch/mips64/sgi-ip32/ip32-reset.c Fri Apr 19 10:59:51 2002
+++ linuxppc64_2_4/arch/mips64/sgi-ip32/ip32-reset.c Wed Dec 31 18:00:00 1969
@@ -1,34 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 Keith M Wesolowski
- * Copyright (C) 2001 Paul Mundt
- */
-#include
-
-#include
-#include
-
-static void ip32_machine_restart(char *cmd)
-{
- ArcReboot();
-}
-
-static inline void ip32_machine_halt(void)
-{
- ArcEnterInteractiveMode();
-}
-
-static void ip32_machine_power_off(void)
-{
- ip32_machine_halt();
-}
-
-void __init ip32_reboot_setup(void)
-{
- _machine_restart = ip32_machine_restart;
- _machine_halt = ip32_machine_halt;
- _machine_power_off = ip32_machine_power_off;
-}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/Makefile linuxppc64_2_4/arch/ppc64/boot/Makefile
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/Makefile Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/ppc64/boot/Makefile Wed Apr 10 12:21:34 2002
@@ -27,7 +27,9 @@
BOOTCFLAGS = $(HOSTCFLAGS) -I$(HPATH)
BOOTLD = $(CROSS32_COMPILE)ld
BOOTAS = $(CROSS32_COMPILE)as
-BOOTAFLAGS = -D__ASSEMBLY__ $(HOSTCFLAGS)
+BOOTAFLAGS = -D__ASSEMBLY__ $(HOSTCFLAGS) -I$(HPATH)
+
+OBJCOPYFLAGS = contents,alloc,load,readonly,data
.c.o:
$(BOOTCC) $(BOOTCFLAGS) -c -o $*.o $<
@@ -37,7 +39,7 @@
CFLAGS = $(CPPFLAGS) -O -fno-builtin -DSTDC_HEADERS
LD_ARGS = -Ttext 0x00400000 -e _start
-OBJS = crt0.o start.o main.o zlib.o image.o imagesize.o
+OBJS = crt0.o string.o prom.o zImage.o zlib.o imagesize.o
#LIBS = $(TOPDIR)/lib/lib.a
LIBS =
@@ -83,43 +85,37 @@
znetboot.initrd: zImage.initrd
cp zImage.initrd $(TFTPIMAGE)
-floppy: zImage
- mcopy zImage a:zImage
-
-piggyback: piggyback.c
- $(HOSTCC) $(HOSTCFLAGS) -DKERNELBASE=$(KERNELBASE) -o piggyback piggyback.c
-
addnote: addnote.c
$(HOSTCC) $(HOSTCFLAGS) -o addnote addnote.c
-image.o: piggyback vmlinux.gz
- ./piggyback image < vmlinux.gz | $(BOOTAS) -o image.o
-
-sysmap.o: piggyback ../../../System.map
- ./piggyback sysmap < ../../../System.map | $(BOOTAS) -o sysmap.o
-initrd.o: ramdisk.image.gz piggyback
- ./piggyback initrd < ramdisk.image.gz | $(BOOTAS) -o initrd.o
+imagesize.c: $(TOPDIR)/vmlinux
+ ls -l $(TOPDIR)/vmlinux | awk '{printf "/* generated -- do not edit! */\nunsigned long vmlinux_filesize = %d;\n", $$5}' > imagesize.c
+ $(CROSS_COMPILE)nm -n $(TOPDIR)/vmlinux | tail -1 | awk '{printf "unsigned long vmlinux_memsize = 0x%s;\n", substr($$1,8)}' >> imagesize.c
+
+vmlinux .config System.map: % : $(TOPDIR)/%
+ gzip -cvf9 $(TOPDIR)/$@ > kernel-$@.gz
+ $(OBJCOPY) zImage.o \
+ --add-section=.kernel:$@=kernel-$@.gz \
+ --set-section-flags=.kernel:$@=$(OBJCOPYFLAGS)
+
+initrd: ramdisk.image.gz
+ $(OBJCOPY) zImage.o \
+ --add-section=.kernel:$@=ramdisk.image.gz \
+ --set-section-flags=.kernel:$@=$(OBJCOPYFLAGS)
-zImage: $(OBJS) no_initrd.o addnote
- $(BOOTLD) $(LD_ARGS) -T zImage.lds -o $@ $(OBJS) no_initrd.o $(LIBS)
+zImage: $(OBJS) addnote vmlinux .config System.map
+ $(BOOTLD) $(LD_ARGS) -T zImage.lds -o $@ $(OBJS) $(LIBS)
./addnote $@
-zImage.initrd: $(OBJS) initrd.o addnote
- $(BOOTLD) $(LD_ARGS) -T zImage.lds -o $@ $(OBJS) initrd.o $(LIBS)
+zImage.initrd: $(OBJS) addnote vmlinux .config System.map initrd
+ $(BOOTLD) $(LD_ARGS) -T zImage.lds -o $@ $(OBJS) $(LIBS)
./addnote $@
-
-vmlinux.gz: $(TOPDIR)/vmlinux
- $(OBJCOPY) -S -O binary $(TOPDIR)/vmlinux vmlinux
- ls -l vmlinux | awk '{printf "/* generated -- do not edit! */\nint uncompressed_size = %d;\n", $$5}' > imagesize.c
- $(CROSS_COMPILE)nm -n $(TOPDIR)/vmlinux | tail -1 | awk '{printf "long vmlinux_end = 0x%s;\n", substr($$1,8)}' >> imagesize.c
- gzip -vf9 vmlinux
-
-imagesize.c: vmlinux.gz
-
clean:
- rm -f piggyback note addnote $(OBJS) zImage zImage.initrd vmlinux.gz no_initrd.o imagesize.c addSystemMap vmlinux.sm addRamDisk vmlinux.initrd vmlinux.sminitrd
+ rm -f add{note,RamDisk,SystemMap} $(OBJS) initrd.o \
+ vmlinux.{sm,initrd} zImage{,.initrd} imagesize.c \
+ kernel-{vmlinux,.config,System.map}.gz
fastdep:
$(TOPDIR)/scripts/mkdep *.[Sch] > .depend
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/crt0.S linuxppc64_2_4/arch/ppc64/boot/crt0.S
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/crt0.S Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/ppc64/boot/crt0.S Wed Apr 10 12:21:34 2002
@@ -8,258 +8,41 @@
*
* NOTE: this code runs in 32 bit mode and is packaged as ELF32.
*/
+
+#include
+
.text
.globl _start
_start:
- lis 9,_start@h
- lis 8,_etext@ha
- addi 8,8,_etext@l
-1: dcbf 0,9
- icbi 0,9
- addi 9,9,0x20
- cmplwi 0,9,8
+ lis r9,_start@h
+ lis r8,_etext@ha
+ addi r8,r8,_etext@l
+1: dcbf r0,r9
+ icbi r0,r9
+ addi r9,r9,0x20
+ cmplwi 0,r9,8
blt 1b
sync
isync
## Clear out the BSS as per ANSI C requirements
- lis 7,_end@ha
- addi 7,7,_end@l # r7 = &_end
- lis 8,__bss_start@ha #
- addi 8,8,__bss_start@l # r8 = &_bss_start
+ lis r7,_end@ha
+ addi r7,r7,_end@l # r7 = &_end
+ lis r8,__bss_start@ha #
+ addi r8,r8,__bss_start@l # r8 = &_bss_start
## Determine how large an area, in number of words, to clear
- subf 7,8,7 # r7 = &_end - &_bss_start + 1
- addi 7,7,3 # r7 += 3
- srwi. 7,7,2 # r7 = size in words.
- beq 3f # If the size is zero, do not bother
- addi 8,8,-4 # r8 -= 4
- mtctr 7 # SPRN_CTR = number of words to clear
- li 0,0 # r0 = 0
-2: stwu 0,4(8) # Clear out a word
- bdnz 2b # If we are not done yet, keep clearing
+ subf r7,r8,r7 # r7 = &_end - &_bss_start + 1
+ addi r7,r7,3 # r7 += 3
+ srwi. r7,r7,2 # r7 = size in words.
+ beq 3f # If the size is zero, don't bother
+ addi r8,r8,-4 # r8 -= 4
+ mtctr r7 # SPRN_CTR = number of words to clear
+ li r0,0 # r0 = 0
+2: stwu r0,4(r8) # Clear out a word
+ bdnz 2b # Keep clearing until done
3:
-
-
b start
-
-
-/*
- * Flush the dcache and invalidate the icache for a range of addresses.
- *
- * flush_cache(addr, len)
- */
- .global flush_cache
-flush_cache:
- addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */
- rlwinm. 4,4,27,5,31
- mtctr 4
- beqlr
-1: dcbf 0,3
- icbi 0,3
- addi 3,3,0x20
- bdnz 1b
- sync
- isync
- blr
-
-
-#define r0 0
-#define r3 3
-#define r4 4
-#define r5 5
-#define r6 6
-#define r7 7
-#define r8 8
-
- .globl strcpy
-strcpy:
- addi r5,r3,-1
- addi r4,r4,-1
-1: lbzu r0,1(r4)
- cmpwi 0,r0,0
- stbu r0,1(r5)
- bne 1b
- blr
-
- .globl strncpy
-strncpy:
- cmpwi 0,r5,0
- beqlr
- mtctr r5
- addi r6,r3,-1
- addi r4,r4,-1
-1: lbzu r0,1(r4)
- cmpwi 0,r0,0
- stbu r0,1(r6)
- bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
- blr
-
- .globl strcat
-strcat:
- addi r5,r3,-1
- addi r4,r4,-1
-1: lbzu r0,1(r5)
- cmpwi 0,r0,0
- bne 1b
- addi r5,r5,-1
-1: lbzu r0,1(r4)
- cmpwi 0,r0,0
- stbu r0,1(r5)
- bne 1b
- blr
-
- .globl strcmp
-strcmp:
- addi r5,r3,-1
- addi r4,r4,-1
-1: lbzu r3,1(r5)
- cmpwi 1,r3,0
- lbzu r0,1(r4)
- subf. r3,r0,r3
- beqlr 1
- beq 1b
- blr
-
- .globl strlen
-strlen:
- addi r4,r3,-1
-1: lbzu r0,1(r4)
- cmpwi 0,r0,0
- bne 1b
- subf r3,r3,r4
- blr
-
- .globl memset
-memset:
- rlwimi r4,r4,8,16,23
- rlwimi r4,r4,16,0,15
- addi r6,r3,-4
- cmplwi 0,r5,4
- blt 7f
- stwu r4,4(r6)
- beqlr
- andi. r0,r6,3
- add r5,r0,r5
- subf r6,r0,r6
- rlwinm r0,r5,32-2,2,31
- mtctr r0
- bdz 6f
-1: stwu r4,4(r6)
- bdnz 1b
-6: andi. r5,r5,3
-7: cmpwi 0,r5,0
- beqlr
- mtctr r5
- addi r6,r6,3
-8: stbu r4,1(r6)
- bdnz 8b
- blr
-
- .globl bcopy
-bcopy:
- mr r6,r3
- mr r3,r4
- mr r4,r6
- b memcpy
-
- .globl memmove
-memmove:
- cmplw 0,r3,r4
- bgt backwards_memcpy
- /* fall through */
-
- .globl memcpy
-memcpy:
- rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
- addi r6,r3,-4
- addi r4,r4,-4
- beq 2f /* if less than 8 bytes to do */
- andi. r0,r6,3 /* get dest word aligned */
- mtctr r7
- bne 5f
-1: lwz r7,4(r4)
- lwzu r8,8(r4)
- stw r7,4(r6)
- stwu r8,8(r6)
- bdnz 1b
- andi. r5,r5,7
-2: cmplwi 0,r5,4
- blt 3f
- lwzu r0,4(r4)
- addi r5,r5,-4
- stwu r0,4(r6)
-3: cmpwi 0,r5,0
- beqlr
- mtctr r5
- addi r4,r4,3
- addi r6,r6,3
-4: lbzu r0,1(r4)
- stbu r0,1(r6)
- bdnz 4b
- blr
-5: subfic r0,r0,4
- mtctr r0
-6: lbz r7,4(r4)
- addi r4,r4,1
- stb r7,4(r6)
- addi r6,r6,1
- bdnz 6b
- subf r5,r0,r5
- rlwinm. r7,r5,32-3,3,31
- beq 2b
- mtctr r7
- b 1b
-
- .globl backwards_memcpy
-backwards_memcpy:
- rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
- add r6,r3,r5
- add r4,r4,r5
- beq 2f
- andi. r0,r6,3
- mtctr r7
- bne 5f
-1: lwz r7,-4(r4)
- lwzu r8,-8(r4)
- stw r7,-4(r6)
- stwu r8,-8(r6)
- bdnz 1b
- andi. r5,r5,7
-2: cmplwi 0,r5,4
- blt 3f
- lwzu r0,-4(r4)
- subi r5,r5,4
- stwu r0,-4(r6)
-3: cmpwi 0,r5,0
- beqlr
- mtctr r5
-4: lbzu r0,-1(r4)
- stbu r0,-1(r6)
- bdnz 4b
- blr
-5: mtctr r0
-6: lbzu r7,-1(r4)
- stbu r7,-1(r6)
- bdnz 6b
- subf r5,r0,r5
- rlwinm. r7,r5,32-3,3,31
- beq 2b
- mtctr r7
- b 1b
-
- .globl memcmp
-memcmp:
- cmpwi 0,r5,0
- blelr
- mtctr r5
- addi r6,r3,-1
- addi r4,r4,-1
-1: lbzu r3,1(r6)
- lbzu r0,1(r4)
- subf. r3,r0,r3
- bdnzt 2,1b
- blr
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/main.c linuxppc64_2_4/arch/ppc64/boot/main.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/main.c Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/ppc64/boot/main.c Wed Dec 31 18:00:00 1969
@@ -1,292 +0,0 @@
-/*
- * Copyright (C) Paul Mackerras 1997.
- *
- * Updates for PPC64 by Todd Inglett & Dave Engebretsen.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-#define __KERNEL__
-#include "zlib.h"
-#include
-#include
-#include
-
-void memmove(void *dst, void *im, int len);
-
-extern void *finddevice(const char *);
-extern int getprop(void *, const char *, void *, int);
-extern void printf(const char *fmt, ...);
-extern int sprintf(char *buf, const char *fmt, ...);
-void gunzip(void *, int, unsigned char *, int *);
-void *claim(unsigned int, unsigned int, unsigned int);
-void flush_cache(void *, int);
-void pause(void);
-static struct bi_record *make_bi_recs(unsigned long);
-
-#define RAM_START 0x00000000
-#define RAM_END (64<<20)
-
-#define BOOT_START ((unsigned long)_start)
-#define BOOT_END ((unsigned long)_end)
-
-/* Value picked to match that used by yaboot */
-#define PROG_START 0x01400000
-
-char *avail_ram;
-char *begin_avail, *end_avail;
-char *avail_high;
-unsigned int heap_use;
-unsigned int heap_max;
-unsigned long initrd_start = 0;
-unsigned long initrd_size = 0;
-
-extern char _end[];
-extern char image_data[];
-extern int image_len;
-extern char initrd_data[];
-extern int initrd_len;
-extern char sysmap_data[];
-extern int sysmap_len;
-extern int uncompressed_size;
-extern long vmlinux_end;
-
-static char scratch[128<<10]; /* 128kB of scratch space for gunzip */
-
-typedef void (*kernel_entry_t)( unsigned long,
- unsigned long,
- void *,
- struct bi_record *);
-
-void
-chrpboot(unsigned long a1, unsigned long a2, void *prom)
-{
- unsigned len;
- void *dst = (void *)-1;
- unsigned long claim_addr;
- unsigned char *im;
- extern char _start;
- struct bi_record *bi_recs;
- kernel_entry_t kernel_entry;
-
- printf("chrpboot starting: loaded at 0x%x\n\r", (unsigned)&_start);
-
- if (initrd_len) {
- initrd_size = initrd_len;
- initrd_start = (RAM_END - initrd_size) & ~0xFFF;
- a1 = a2 = 0;
- claim(initrd_start, RAM_END - initrd_start, 0);
- printf("initial ramdisk moving 0x%lx <- 0x%lx (%lx bytes)\n\r",
- initrd_start, (unsigned long)initrd_data, initrd_size);
- memcpy((void *)initrd_start, (void *)initrd_data, initrd_size);
- }
-
- im = image_data;
- len = image_len;
- uncompressed_size = PAGE_ALIGN(uncompressed_size);
-
- for(claim_addr = PROG_START;
- claim_addr <= PROG_START * 8;
- claim_addr += 0x100000) {
- printf(" trying: 0x%08lx\n\r", claim_addr);
- dst = claim(claim_addr, uncompressed_size, 0);
- if (dst != (void *)-1) break;
- }
- if (dst == (void *)-1) {
- printf("claim error, can't allocate kernel memory\n\r");
- return;
- }
-
- if (im[0] == 0x1f && im[1] == 0x8b) {
- avail_ram = scratch;
- begin_avail = avail_high = avail_ram;
- end_avail = scratch + sizeof(scratch);
- printf("gunzipping (0x%x <- 0x%x:0x%0x)...",
- (unsigned)dst, (unsigned)im, (unsigned)im+len);
- gunzip(dst, uncompressed_size, im, &len);
- printf("done %u bytes\n\r", len);
- printf("%u bytes of heap consumed, max in use %u\n\r",
- (unsigned)(avail_high - begin_avail), heap_max);
- } else {
- memmove(dst, im, len);
- }
-
- flush_cache(dst, len);
-
- bi_recs = make_bi_recs((unsigned long)dst + vmlinux_end);
-
- kernel_entry = (kernel_entry_t)dst;
- printf( "kernel:\n\r"
- " entry addr = 0x%lx\n\r"
- " a1 = 0x%lx,\n\r"
- " a2 = 0x%lx,\n\r"
- " prom = 0x%lx,\n\r"
- " bi_recs = 0x%lx,\n\r",
- (unsigned long)kernel_entry, a1, a2,
- (unsigned long)prom, (unsigned long)bi_recs);
-
- kernel_entry( a1, a2, prom, bi_recs );
-
- printf("returned?\n\r");
-
- pause();
-}
-
-static struct bi_record *
-make_bi_recs(unsigned long addr)
-{
- struct bi_record *bi_recs;
- struct bi_record *rec;
-
- bi_recs = rec = bi_rec_init(addr);
-
- rec = bi_rec_alloc(rec, 2);
- rec->tag = BI_FIRST;
- /* rec->data[0] = ...; # Written below before return */
- /* rec->data[1] = ...; # Written below before return */
-
- rec = bi_rec_alloc_bytes(rec, strlen("chrpboot")+1);
- rec->tag = BI_BOOTLOADER_ID;
- sprintf( (char *)rec->data, "chrpboot");
-
- rec = bi_rec_alloc(rec, 2);
- rec->tag = BI_MACHTYPE;
- rec->data[0] = _MACH_pSeries;
- rec->data[1] = 1;
-
- if ( initrd_size > 0 ) {
- rec = bi_rec_alloc(rec, 2);
- rec->tag = BI_INITRD;
- rec->data[0] = initrd_start;
- rec->data[1] = initrd_size;
- }
-
-#if 0
- if ( sysmap_len > 0 ) {
- rec = bi_rec_alloc(rec, 2);
- rec->tag = BI_SYSMAP;
- rec->data[0] = (unsigned long)sysmap_data;
- rec->data[1] = sysmap_len;
- }
-#endif
-
- rec = bi_rec_alloc(rec, 1);
- rec->tag = BI_LAST;
- rec->data[0] = (bi_rec_field)bi_recs;
-
- /* Save the _end_ address of the bi_rec's in the first bi_rec
- * data field for easy access by the kernel.
- */
- bi_recs->data[0] = (bi_rec_field)rec;
- bi_recs->data[1] = (bi_rec_field)rec + rec->size - (bi_rec_field)bi_recs;
-
- return bi_recs;
-}
-
-struct memchunk {
- unsigned int size;
- unsigned int pad;
- struct memchunk *next;
-};
-
-static struct memchunk *freechunks;
-
-void *zalloc(void *x, unsigned items, unsigned size)
-{
- void *p;
- struct memchunk **mpp, *mp;
-
- size *= items;
- size = _ALIGN(size, sizeof(struct memchunk));
- heap_use += size;
- if (heap_use > heap_max)
- heap_max = heap_use;
- for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
- if (mp->size == size) {
- *mpp = mp->next;
- return mp;
- }
- }
- p = avail_ram;
- avail_ram += size;
- if (avail_ram > avail_high)
- avail_high = avail_ram;
- if (avail_ram > end_avail) {
- printf("oops... out of memory\n\r");
- pause();
- }
- return p;
-}
-
-void zfree(void *x, void *addr, unsigned nb)
-{
- struct memchunk *mp = addr;
-
- nb = _ALIGN(nb, sizeof(struct memchunk));
- heap_use -= nb;
- if (avail_ram == addr + nb) {
- avail_ram = addr;
- return;
- }
- mp->size = nb;
- mp->next = freechunks;
- freechunks = mp;
-}
-
-#define HEAD_CRC 2
-#define EXTRA_FIELD 4
-#define ORIG_NAME 8
-#define COMMENT 0x10
-#define RESERVED 0xe0
-
-#define DEFLATED 8
-
-void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
-{
- z_stream s;
- int r, i, flags;
-
- /* skip header */
- i = 10;
- flags = src[3];
- if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
- printf("bad gzipped data\n\r");
- exit();
- }
- if ((flags & EXTRA_FIELD) != 0)
- i = 12 + src[10] + (src[11] << 8);
- if ((flags & ORIG_NAME) != 0)
- while (src[i++] != 0)
- ;
- if ((flags & COMMENT) != 0)
- while (src[i++] != 0)
- ;
- if ((flags & HEAD_CRC) != 0)
- i += 2;
- if (i >= *lenp) {
- printf("gunzip: ran out of data in header\n\r");
- exit();
- }
-
- s.zalloc = zalloc;
- s.zfree = zfree;
- r = inflateInit2(&s, -MAX_WBITS);
- if (r != Z_OK) {
- printf("inflateInit2 returned %d\n\r", r);
- exit();
- }
- s.next_in = src + i;
- s.avail_in = *lenp - i;
- s.next_out = dst;
- s.avail_out = dstlen;
- r = inflate(&s, Z_FINISH);
- if (r != Z_OK && r != Z_STREAM_END) {
- printf("inflate returned %d msg: %s\n\r", r, s.msg);
- exit();
- }
- *lenp = s.next_out - (unsigned char *) dst;
- inflateEnd(&s);
-}
-
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/no_initrd.c linuxppc64_2_4/arch/ppc64/boot/no_initrd.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/no_initrd.c Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/ppc64/boot/no_initrd.c Wed Dec 31 18:00:00 1969
@@ -1,2 +0,0 @@
-char initrd_data[1];
-int initrd_len = 0;
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/piggyback.c linuxppc64_2_4/arch/ppc64/boot/piggyback.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/piggyback.c Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/ppc64/boot/piggyback.c Wed Dec 31 18:00:00 1969
@@ -1,74 +0,0 @@
-/*
- * Copyright 2001 IBM Corp
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-#include
-#include
-
-extern long ce_exec_config[];
-
-int main(int argc, char *argv[])
-{
- int i, cnt, pos, len;
- unsigned int cksum, val;
- unsigned char *lp;
- unsigned char buf[8192];
- if (argc != 2)
- {
- fprintf(stderr, "usage: %s name out-file\n",
- argv[0]);
- exit(1);
- }
- fprintf(stdout, "#\n");
- fprintf(stdout, "# Miscellaneous data structures:\n");
- fprintf(stdout, "# WARNING - this file is automatically generated!\n");
- fprintf(stdout, "#\n");
- fprintf(stdout, "\n");
- fprintf(stdout, "\t.data\n");
- fprintf(stdout, "\t.globl %s_data\n", argv[1]);
- fprintf(stdout, "%s_data:\n", argv[1]);
- pos = 0;
- cksum = 0;
- while ((len = read(0, buf, sizeof(buf))) > 0)
- {
- cnt = 0;
- lp = (unsigned char *)buf;
- len = (len + 3) & ~3; /* Round up to longwords */
- for (i = 0; i < len; i += 4)
- {
- if (cnt == 0)
- {
- fprintf(stdout, "\t.long\t");
- }
- fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);
- val = *(unsigned long *)lp;
- cksum ^= val;
- lp += 4;
- if (++cnt == 4)
- {
- cnt = 0;
- fprintf(stdout, " # %x \n", pos+i-12);
- fflush(stdout);
- } else
- {
- fprintf(stdout, ",");
- }
- }
- if (cnt)
- {
- fprintf(stdout, "0\n");
- }
- pos += len;
- }
- fprintf(stdout, "\t.globl %s_len\n", argv[1]);
- fprintf(stdout, "%s_len:\t.long\t0x%x\n", argv[1], pos);
- fflush(stdout);
- fclose(stdout);
- fprintf(stderr, "cksum = %x\n", cksum);
- exit(0);
-}
-
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/ppc32-types.h linuxppc64_2_4/arch/ppc64/boot/ppc32-types.h
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/ppc32-types.h Wed Dec 31 18:00:00 1969
+++ linuxppc64_2_4/arch/ppc64/boot/ppc32-types.h Wed Apr 10 12:21:34 2002
@@ -0,0 +1,30 @@
+#ifndef _PPC64_TYPES_H
+#define _PPC64_TYPES_H
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+typedef signed long long s64;
+typedef unsigned long long u64;
+
+#define BITS_PER_LONG 32
+
+#endif /* _PPC64_TYPES_H */
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/prom.c linuxppc64_2_4/arch/ppc64/boot/prom.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/prom.c Wed Dec 31 18:00:00 1969
+++ linuxppc64_2_4/arch/ppc64/boot/prom.c Wed Apr 10 12:21:34 2002
@@ -0,0 +1,636 @@
+/*
+ * Copyright (C) Paul Mackerras 1997.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include
+#include
+#include
+#include
+
+#include
+
+int (*prom)(void *);
+
+void *chosen_handle;
+void *stdin;
+void *stdout;
+void *stderr;
+
+void exit(void);
+void *finddevice(const char *name);
+int getprop(void *phandle, const char *name, void *buf, int buflen);
+void chrpboot(int a1, int a2, void *prom); /* in main.c */
+
+void printk(char *fmt, ...);
+
+int
+write(void *handle, void *ptr, int nb)
+{
+ struct prom_args {
+ char *service;
+ int nargs;
+ int nret;
+ void *ihandle;
+ void *addr;
+ int len;
+ int actual;
+ } args;
+
+ args.service = "write";
+ args.nargs = 3;
+ args.nret = 1;
+ args.ihandle = handle;
+ args.addr = ptr;
+ args.len = nb;
+ args.actual = -1;
+ (*prom)(&args);
+ return args.actual;
+}
+
+int
+read(void *handle, void *ptr, int nb)
+{
+ struct prom_args {
+ char *service;
+ int nargs;
+ int nret;
+ void *ihandle;
+ void *addr;
+ int len;
+ int actual;
+ } args;
+
+ args.service = "read";
+ args.nargs = 3;
+ args.nret = 1;
+ args.ihandle = handle;
+ args.addr = ptr;
+ args.len = nb;
+ args.actual = -1;
+ (*prom)(&args);
+ return args.actual;
+}
+
+void
+exit()
+{
+ struct prom_args {
+ char *service;
+ } args;
+
+ for (;;) {
+ args.service = "exit";
+ (*prom)(&args);
+ }
+}
+
+void
+pause(void)
+{
+ struct prom_args {
+ char *service;
+ } args;
+
+ args.service = "enter";
+ (*prom)(&args);
+}
+
+void *
+finddevice(const char *name)
+{
+ struct prom_args {
+ char *service;
+ int nargs;
+ int nret;
+ const char *devspec;
+ void *phandle;
+ } args;
+
+ args.service = "finddevice";
+ args.nargs = 1;
+ args.nret = 1;
+ args.devspec = name;
+ args.phandle = (void *) -1;
+ (*prom)(&args);
+ return args.phandle;
+}
+
+void *
+claim(unsigned long virt, unsigned long size, unsigned long align)
+{
+ struct prom_args {
+ char *service;
+ int nargs;
+ int nret;
+ unsigned int virt;
+ unsigned int size;
+ unsigned int align;
+ void *ret;
+ } args;
+
+ args.service = "claim";
+ args.nargs = 3;
+ args.nret = 1;
+ args.virt = virt;
+ args.size = size;
+ args.align = align;
+ (*prom)(&args);
+ return args.ret;
+}
+
+int
+getprop(void *phandle, const char *name, void *buf, int buflen)
+{
+ struct prom_args {
+ char *service;
+ int nargs;
+ int nret;
+ void *phandle;
+ const char *name;
+ void *buf;
+ int buflen;
+ int size;
+ } args;
+
+ args.service = "getprop";
+ args.nargs = 4;
+ args.nret = 1;
+ args.phandle = phandle;
+ args.name = name;
+ args.buf = buf;
+ args.buflen = buflen;
+ args.size = -1;
+ (*prom)(&args);
+ return args.size;
+}
+
+int
+putc(int c, void *f)
+{
+ char ch = c;
+
+ if (c == '\n')
+ putc('\r', f);
+ return write(f, &ch, 1) == 1? c: -1;
+}
+
+int
+putchar(int c)
+{
+ return putc(c, stdout);
+}
+
+int
+fputs(char *str, void *f)
+{
+ int n = strlen(str);
+
+ return write(f, str, n) == n? 0: -1;
+}
+
+int
+readchar(void)
+{
+ char ch;
+
+ for (;;) {
+ switch (read(stdin, &ch, 1)) {
+ case 1:
+ return ch;
+ case -1:
+ printk("read(stdin) returned -1\r\n");
+ return -1;
+ }
+ }
+}
+
+static char line[256];
+static char *lineptr;
+static int lineleft;
+
+int
+getchar(void)
+{
+ int c;
+
+ if (lineleft == 0) {
+ lineptr = line;
+ for (;;) {
+ c = readchar();
+ if (c == -1 || c == 4)
+ break;
+ if (c == '\r' || c == '\n') {
+ *lineptr++ = '\n';
+ putchar('\n');
+ break;
+ }
+ switch (c) {
+ case 0177:
+ case '\b':
+ if (lineptr > line) {
+ putchar('\b');
+ putchar(' ');
+ putchar('\b');
+ --lineptr;
+ }
+ break;
+ case 'U' & 0x1F:
+ while (lineptr > line) {
+ putchar('\b');
+ putchar(' ');
+ putchar('\b');
+ --lineptr;
+ }
+ break;
+ default:
+ if (lineptr >= &line[sizeof(line) - 1])
+ putchar('\a');
+ else {
+ putchar(c);
+ *lineptr++ = c;
+ }
+ }
+ }
+ lineleft = lineptr - line;
+ lineptr = line;
+ }
+ if (lineleft == 0)
+ return -1;
+ --lineleft;
+ return *lineptr++;
+}
+
+
+
+/* String functions lifted from lib/vsprintf.c and lib/ctype.c */
+unsigned char _ctype[] = {
+_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */
+_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */
+_C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */
+_C,_C,_C,_C,_C,_C,_C,_C, /* 24-31 */
+_S|_SP,_P,_P,_P,_P,_P,_P,_P, /* 32-39 */
+_P,_P,_P,_P,_P,_P,_P,_P, /* 40-47 */
+_D,_D,_D,_D,_D,_D,_D,_D, /* 48-55 */
+_D,_D,_P,_P,_P,_P,_P,_P, /* 56-63 */
+_P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U, /* 64-71 */
+_U,_U,_U,_U,_U,_U,_U,_U, /* 72-79 */
+_U,_U,_U,_U,_U,_U,_U,_U, /* 80-87 */
+_U,_U,_U,_P,_P,_P,_P,_P, /* 88-95 */
+_P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L, /* 96-103 */
+_L,_L,_L,_L,_L,_L,_L,_L, /* 104-111 */
+_L,_L,_L,_L,_L,_L,_L,_L, /* 112-119 */
+_L,_L,_L,_P,_P,_P,_P,_C, /* 120-127 */
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */
+_S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 160-175 */
+_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 176-191 */
+_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */
+_U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L, /* 208-223 */
+_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */
+_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */
+
+size_t strnlen(const char * s, size_t count)
+{
+ const char *sc;
+
+ for (sc = s; count-- && *sc != '\0'; ++sc)
+ /* nothing */;
+ return sc - s;
+}
+
+unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
+{
+ unsigned long result = 0,value;
+
+ if (!base) {
+ base = 10;
+ if (*cp == '0') {
+ base = 8;
+ cp++;
+ if ((*cp == 'x') && isxdigit(cp[1])) {
+ cp++;
+ base = 16;
+ }
+ }
+ }
+ while (isxdigit(*cp) &&
+ (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) {
+ result = result*base + value;
+ cp++;
+ }
+ if (endp)
+ *endp = (char *)cp;
+ return result;
+}
+
+long simple_strtol(const char *cp,char **endp,unsigned int base)
+{
+ if(*cp=='-')
+ return -simple_strtoul(cp+1,endp,base);
+ return simple_strtoul(cp,endp,base);
+}
+
+static int skip_atoi(const char **s)
+{
+ int i=0;
+
+ while (isdigit(**s))
+ i = i*10 + *((*s)++) - '0';
+ return i;
+}
+
+#define ZEROPAD 1 /* pad with zero */
+#define SIGN 2 /* unsigned/signed long */
+#define PLUS 4 /* show plus */
+#define SPACE 8 /* space if plus */
+#define LEFT 16 /* left justified */
+#define SPECIAL 32 /* 0x */
+#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
+
+static char * number(char * str, long long num, int base, int size, int precision, int type)
+{
+ char c,sign,tmp[66];
+ const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
+ int i;
+
+ if (type & LARGE)
+ digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ if (type & LEFT)
+ type &= ~ZEROPAD;
+ if (base < 2 || base > 36)
+ return 0;
+ c = (type & ZEROPAD) ? '0' : ' ';
+ sign = 0;
+ if (type & SIGN) {
+ if (num < 0) {
+ sign = '-';
+ num = -num;
+ size--;
+ } else if (type & PLUS) {
+ sign = '+';
+ size--;
+ } else if (type & SPACE) {
+ sign = ' ';
+ size--;
+ }
+ }
+ if (type & SPECIAL) {
+ if (base == 16)
+ size -= 2;
+ else if (base == 8)
+ size--;
+ }
+ i = 0;
+ if (num == 0)
+ tmp[i++]='0';
+ else while (num != 0)
+ tmp[i++] = digits[do_div(num,base)];
+ if (i > precision)
+ precision = i;
+ size -= precision;
+ if (!(type&(ZEROPAD+LEFT)))
+ while(size-->0)
+ *str++ = ' ';
+ if (sign)
+ *str++ = sign;
+ if (type & SPECIAL) {
+ if (base==8)
+ *str++ = '0';
+ else if (base==16) {
+ *str++ = '0';
+ *str++ = digits[33];
+ }
+ }
+ if (!(type & LEFT))
+ while (size-- > 0)
+ *str++ = c;
+ while (i < precision--)
+ *str++ = '0';
+ while (i-- > 0)
+ *str++ = tmp[i];
+ while (size-- > 0)
+ *str++ = ' ';
+ return str;
+}
+
+/* Forward decl. needed for IP address printing stuff... */
+int sprintf(char * buf, const char *fmt, ...);
+
+int vsprintf(char *buf, const char *fmt, va_list args)
+{
+ int len;
+ unsigned long long num;
+ int i, base;
+ char * str;
+ const char *s;
+
+ int flags; /* flags to number() */
+
+ int field_width; /* width of output field */
+ int precision; /* min. # of digits for integers; max
+ number of chars for from string */
+ int qualifier; /* 'h', 'l', or 'L' for integer fields */
+ /* 'z' support added 23/7/1999 S.H. */
+ /* 'z' changed to 'Z' --davidm 1/25/99 */
+
+
+ for (str=buf ; *fmt ; ++fmt) {
+ if (*fmt != '%') {
+ *str++ = *fmt;
+ continue;
+ }
+
+ /* process flags */
+ flags = 0;
+ repeat:
+ ++fmt; /* this also skips first '%' */
+ switch (*fmt) {
+ case '-': flags |= LEFT; goto repeat;
+ case '+': flags |= PLUS; goto repeat;
+ case ' ': flags |= SPACE; goto repeat;
+ case '#': flags |= SPECIAL; goto repeat;
+ case '0': flags |= ZEROPAD; goto repeat;
+ }
+
+ /* get field width */
+ field_width = -1;
+ if (isdigit(*fmt))
+ field_width = skip_atoi(&fmt);
+ else if (*fmt == '*') {
+ ++fmt;
+ /* it's the next argument */
+ field_width = va_arg(args, int);
+ if (field_width < 0) {
+ field_width = -field_width;
+ flags |= LEFT;
+ }
+ }
+
+ /* get the precision */
+ precision = -1;
+ if (*fmt == '.') {
+ ++fmt;
+ if (isdigit(*fmt))
+ precision = skip_atoi(&fmt);
+ else if (*fmt == '*') {
+ ++fmt;
+ /* it's the next argument */
+ precision = va_arg(args, int);
+ }
+ if (precision < 0)
+ precision = 0;
+ }
+
+ /* get the conversion qualifier */
+ qualifier = -1;
+ if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') {
+ qualifier = *fmt;
+ ++fmt;
+ }
+
+ /* default base */
+ base = 10;
+
+ switch (*fmt) {
+ case 'c':
+ if (!(flags & LEFT))
+ while (--field_width > 0)
+ *str++ = ' ';
+ *str++ = (unsigned char) va_arg(args, int);
+ while (--field_width > 0)
+ *str++ = ' ';
+ continue;
+
+ case 's':
+ s = va_arg(args, char *);
+ if (!s)
+ s = "";
+
+ len = strnlen(s, precision);
+
+ if (!(flags & LEFT))
+ while (len < field_width--)
+ *str++ = ' ';
+ for (i = 0; i < len; ++i)
+ *str++ = *s++;
+ while (len < field_width--)
+ *str++ = ' ';
+ continue;
+
+ case 'p':
+ if (field_width == -1) {
+ field_width = 2*sizeof(void *);
+ flags |= ZEROPAD;
+ }
+ str = number(str,
+ (unsigned long) va_arg(args, void *), 16,
+ field_width, precision, flags);
+ continue;
+
+
+ case 'n':
+ if (qualifier == 'l') {
+ long * ip = va_arg(args, long *);
+ *ip = (str - buf);
+ } else if (qualifier == 'Z') {
+ size_t * ip = va_arg(args, size_t *);
+ *ip = (str - buf);
+ } else {
+ int * ip = va_arg(args, int *);
+ *ip = (str - buf);
+ }
+ continue;
+
+ case '%':
+ *str++ = '%';
+ continue;
+
+ /* integer number formats - set up the flags and "break" */
+ case 'o':
+ base = 8;
+ break;
+
+ case 'X':
+ flags |= LARGE;
+ case 'x':
+ base = 16;
+ break;
+
+ case 'd':
+ case 'i':
+ flags |= SIGN;
+ case 'u':
+ break;
+
+ default:
+ *str++ = '%';
+ if (*fmt)
+ *str++ = *fmt;
+ else
+ --fmt;
+ continue;
+ }
+ if (qualifier == 'L')
+ num = va_arg(args, long long);
+ else if (qualifier == 'l') {
+ num = va_arg(args, unsigned long);
+ if (flags & SIGN)
+ num = (signed long) num;
+ } else if (qualifier == 'Z') {
+ num = va_arg(args, size_t);
+ } else if (qualifier == 'h') {
+ num = (unsigned short) va_arg(args, int);
+ if (flags & SIGN)
+ num = (signed short) num;
+ } else {
+ num = va_arg(args, unsigned int);
+ if (flags & SIGN)
+ num = (signed int) num;
+ }
+ str = number(str, num, base, field_width, precision, flags);
+ }
+ *str = '\0';
+ return str-buf;
+}
+
+int sprintf(char * buf, const char *fmt, ...)
+{
+ va_list args;
+ int i;
+
+ va_start(args, fmt);
+ i=vsprintf(buf,fmt,args);
+ va_end(args);
+ return i;
+}
+
+static char sprint_buf[1024];
+
+void
+printk(char *fmt, ...)
+{
+ va_list args;
+ int n;
+
+ va_start(args, fmt);
+ n = vsprintf(sprint_buf, fmt, args);
+ va_end(args);
+ write(stdout, sprint_buf, n);
+}
+
+int
+printf(char *fmt, ...)
+{
+ va_list args;
+ int n;
+
+ va_start(args, fmt);
+ n = vsprintf(sprint_buf, fmt, args);
+ va_end(args);
+ write(stdout, sprint_buf, n);
+ return n;
+}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/start.c linuxppc64_2_4/arch/ppc64/boot/start.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/start.c Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/ppc64/boot/start.c Wed Dec 31 18:00:00 1969
@@ -1,654 +0,0 @@
-/*
- * Copyright (C) Paul Mackerras 1997.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-#include
-#include
-#include
-#include
-
-#include
-
-int (*prom)(void *);
-
-void *chosen_handle;
-void *stdin;
-void *stdout;
-void *stderr;
-
-void exit(void);
-void *finddevice(const char *name);
-int getprop(void *phandle, const char *name, void *buf, int buflen);
-void chrpboot(int a1, int a2, void *prom); /* in main.c */
-
-void printk(char *fmt, ...);
-
-void
-start(int a1, int a2, void *promptr)
-{
- prom = (int (*)(void *)) promptr;
- chosen_handle = finddevice("/chosen");
- if (chosen_handle == (void *) -1)
- exit();
- if (getprop(chosen_handle, "stdout", &stdout, sizeof(stdout)) != 4)
- exit();
- stderr = stdout;
- if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4)
- exit();
-
- chrpboot(a1, a2, promptr);
- for (;;)
- exit();
-}
-
-int
-write(void *handle, void *ptr, int nb)
-{
- struct prom_args {
- char *service;
- int nargs;
- int nret;
- void *ihandle;
- void *addr;
- int len;
- int actual;
- } args;
-
- args.service = "write";
- args.nargs = 3;
- args.nret = 1;
- args.ihandle = handle;
- args.addr = ptr;
- args.len = nb;
- args.actual = -1;
- (*prom)(&args);
- return args.actual;
-}
-
-int
-read(void *handle, void *ptr, int nb)
-{
- struct prom_args {
- char *service;
- int nargs;
- int nret;
- void *ihandle;
- void *addr;
- int len;
- int actual;
- } args;
-
- args.service = "read";
- args.nargs = 3;
- args.nret = 1;
- args.ihandle = handle;
- args.addr = ptr;
- args.len = nb;
- args.actual = -1;
- (*prom)(&args);
- return args.actual;
-}
-
-void
-exit()
-{
- struct prom_args {
- char *service;
- } args;
-
- for (;;) {
- args.service = "exit";
- (*prom)(&args);
- }
-}
-
-void
-pause(void)
-{
- struct prom_args {
- char *service;
- } args;
-
- args.service = "enter";
- (*prom)(&args);
-}
-
-void *
-finddevice(const char *name)
-{
- struct prom_args {
- char *service;
- int nargs;
- int nret;
- const char *devspec;
- void *phandle;
- } args;
-
- args.service = "finddevice";
- args.nargs = 1;
- args.nret = 1;
- args.devspec = name;
- args.phandle = (void *) -1;
- (*prom)(&args);
- return args.phandle;
-}
-
-void *
-claim(unsigned long virt, unsigned long size, unsigned long align)
-{
- struct prom_args {
- char *service;
- int nargs;
- int nret;
- unsigned int virt;
- unsigned int size;
- unsigned int align;
- void *ret;
- } args;
-
- args.service = "claim";
- args.nargs = 3;
- args.nret = 1;
- args.virt = virt;
- args.size = size;
- args.align = align;
- (*prom)(&args);
- return args.ret;
-}
-
-int
-getprop(void *phandle, const char *name, void *buf, int buflen)
-{
- struct prom_args {
- char *service;
- int nargs;
- int nret;
- void *phandle;
- const char *name;
- void *buf;
- int buflen;
- int size;
- } args;
-
- args.service = "getprop";
- args.nargs = 4;
- args.nret = 1;
- args.phandle = phandle;
- args.name = name;
- args.buf = buf;
- args.buflen = buflen;
- args.size = -1;
- (*prom)(&args);
- return args.size;
-}
-
-int
-putc(int c, void *f)
-{
- char ch = c;
-
- if (c == '\n')
- putc('\r', f);
- return write(f, &ch, 1) == 1? c: -1;
-}
-
-int
-putchar(int c)
-{
- return putc(c, stdout);
-}
-
-int
-fputs(char *str, void *f)
-{
- int n = strlen(str);
-
- return write(f, str, n) == n? 0: -1;
-}
-
-int
-readchar(void)
-{
- char ch;
-
- for (;;) {
- switch (read(stdin, &ch, 1)) {
- case 1:
- return ch;
- case -1:
- printk("read(stdin) returned -1\r\n");
- return -1;
- }
- }
-}
-
-static char line[256];
-static char *lineptr;
-static int lineleft;
-
-int
-getchar(void)
-{
- int c;
-
- if (lineleft == 0) {
- lineptr = line;
- for (;;) {
- c = readchar();
- if (c == -1 || c == 4)
- break;
- if (c == '\r' || c == '\n') {
- *lineptr++ = '\n';
- putchar('\n');
- break;
- }
- switch (c) {
- case 0177:
- case '\b':
- if (lineptr > line) {
- putchar('\b');
- putchar(' ');
- putchar('\b');
- --lineptr;
- }
- break;
- case 'U' & 0x1F:
- while (lineptr > line) {
- putchar('\b');
- putchar(' ');
- putchar('\b');
- --lineptr;
- }
- break;
- default:
- if (lineptr >= &line[sizeof(line) - 1])
- putchar('\a');
- else {
- putchar(c);
- *lineptr++ = c;
- }
- }
- }
- lineleft = lineptr - line;
- lineptr = line;
- }
- if (lineleft == 0)
- return -1;
- --lineleft;
- return *lineptr++;
-}
-
-
-
-/* String functions lifted from lib/vsprintf.c and lib/ctype.c */
-unsigned char _ctype[] = {
-_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */
-_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */
-_C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */
-_C,_C,_C,_C,_C,_C,_C,_C, /* 24-31 */
-_S|_SP,_P,_P,_P,_P,_P,_P,_P, /* 32-39 */
-_P,_P,_P,_P,_P,_P,_P,_P, /* 40-47 */
-_D,_D,_D,_D,_D,_D,_D,_D, /* 48-55 */
-_D,_D,_P,_P,_P,_P,_P,_P, /* 56-63 */
-_P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U, /* 64-71 */
-_U,_U,_U,_U,_U,_U,_U,_U, /* 72-79 */
-_U,_U,_U,_U,_U,_U,_U,_U, /* 80-87 */
-_U,_U,_U,_P,_P,_P,_P,_P, /* 88-95 */
-_P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L, /* 96-103 */
-_L,_L,_L,_L,_L,_L,_L,_L, /* 104-111 */
-_L,_L,_L,_L,_L,_L,_L,_L, /* 112-119 */
-_L,_L,_L,_P,_P,_P,_P,_C, /* 120-127 */
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */
-_S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 160-175 */
-_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 176-191 */
-_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */
-_U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L, /* 208-223 */
-_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */
-_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */
-
-size_t strnlen(const char * s, size_t count)
-{
- const char *sc;
-
- for (sc = s; count-- && *sc != '\0'; ++sc)
- /* nothing */;
- return sc - s;
-}
-
-unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
-{
- unsigned long result = 0,value;
-
- if (!base) {
- base = 10;
- if (*cp == '0') {
- base = 8;
- cp++;
- if ((*cp == 'x') && isxdigit(cp[1])) {
- cp++;
- base = 16;
- }
- }
- }
- while (isxdigit(*cp) &&
- (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) {
- result = result*base + value;
- cp++;
- }
- if (endp)
- *endp = (char *)cp;
- return result;
-}
-
-long simple_strtol(const char *cp,char **endp,unsigned int base)
-{
- if(*cp=='-')
- return -simple_strtoul(cp+1,endp,base);
- return simple_strtoul(cp,endp,base);
-}
-
-static int skip_atoi(const char **s)
-{
- int i=0;
-
- while (isdigit(**s))
- i = i*10 + *((*s)++) - '0';
- return i;
-}
-
-#define ZEROPAD 1 /* pad with zero */
-#define SIGN 2 /* unsigned/signed long */
-#define PLUS 4 /* show plus */
-#define SPACE 8 /* space if plus */
-#define LEFT 16 /* left justified */
-#define SPECIAL 32 /* 0x */
-#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
-
-static char * number(char * str, long long num, int base, int size, int precision, int type)
-{
- char c,sign,tmp[66];
- const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
- int i;
-
- if (type & LARGE)
- digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- if (type & LEFT)
- type &= ~ZEROPAD;
- if (base < 2 || base > 36)
- return 0;
- c = (type & ZEROPAD) ? '0' : ' ';
- sign = 0;
- if (type & SIGN) {
- if (num < 0) {
- sign = '-';
- num = -num;
- size--;
- } else if (type & PLUS) {
- sign = '+';
- size--;
- } else if (type & SPACE) {
- sign = ' ';
- size--;
- }
- }
- if (type & SPECIAL) {
- if (base == 16)
- size -= 2;
- else if (base == 8)
- size--;
- }
- i = 0;
- if (num == 0)
- tmp[i++]='0';
- else while (num != 0)
- tmp[i++] = digits[do_div(num,base)];
- if (i > precision)
- precision = i;
- size -= precision;
- if (!(type&(ZEROPAD+LEFT)))
- while(size-->0)
- *str++ = ' ';
- if (sign)
- *str++ = sign;
- if (type & SPECIAL) {
- if (base==8)
- *str++ = '0';
- else if (base==16) {
- *str++ = '0';
- *str++ = digits[33];
- }
- }
- if (!(type & LEFT))
- while (size-- > 0)
- *str++ = c;
- while (i < precision--)
- *str++ = '0';
- while (i-- > 0)
- *str++ = tmp[i];
- while (size-- > 0)
- *str++ = ' ';
- return str;
-}
-
-/* Forward decl. needed for IP address printing stuff... */
-int sprintf(char * buf, const char *fmt, ...);
-
-int vsprintf(char *buf, const char *fmt, va_list args)
-{
- int len;
- unsigned long long num;
- int i, base;
- char * str;
- const char *s;
-
- int flags; /* flags to number() */
-
- int field_width; /* width of output field */
- int precision; /* min. # of digits for integers; max
- number of chars for from string */
- int qualifier; /* 'h', 'l', or 'L' for integer fields */
- /* 'z' support added 23/7/1999 S.H. */
- /* 'z' changed to 'Z' --davidm 1/25/99 */
-
-
- for (str=buf ; *fmt ; ++fmt) {
- if (*fmt != '%') {
- *str++ = *fmt;
- continue;
- }
-
- /* process flags */
- flags = 0;
- repeat:
- ++fmt; /* this also skips first '%' */
- switch (*fmt) {
- case '-': flags |= LEFT; goto repeat;
- case '+': flags |= PLUS; goto repeat;
- case ' ': flags |= SPACE; goto repeat;
- case '#': flags |= SPECIAL; goto repeat;
- case '0': flags |= ZEROPAD; goto repeat;
- }
-
- /* get field width */
- field_width = -1;
- if (isdigit(*fmt))
- field_width = skip_atoi(&fmt);
- else if (*fmt == '*') {
- ++fmt;
- /* it's the next argument */
- field_width = va_arg(args, int);
- if (field_width < 0) {
- field_width = -field_width;
- flags |= LEFT;
- }
- }
-
- /* get the precision */
- precision = -1;
- if (*fmt == '.') {
- ++fmt;
- if (isdigit(*fmt))
- precision = skip_atoi(&fmt);
- else if (*fmt == '*') {
- ++fmt;
- /* it's the next argument */
- precision = va_arg(args, int);
- }
- if (precision < 0)
- precision = 0;
- }
-
- /* get the conversion qualifier */
- qualifier = -1;
- if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') {
- qualifier = *fmt;
- ++fmt;
- }
-
- /* default base */
- base = 10;
-
- switch (*fmt) {
- case 'c':
- if (!(flags & LEFT))
- while (--field_width > 0)
- *str++ = ' ';
- *str++ = (unsigned char) va_arg(args, int);
- while (--field_width > 0)
- *str++ = ' ';
- continue;
-
- case 's':
- s = va_arg(args, char *);
- if (!s)
- s = "";
-
- len = strnlen(s, precision);
-
- if (!(flags & LEFT))
- while (len < field_width--)
- *str++ = ' ';
- for (i = 0; i < len; ++i)
- *str++ = *s++;
- while (len < field_width--)
- *str++ = ' ';
- continue;
-
- case 'p':
- if (field_width == -1) {
- field_width = 2*sizeof(void *);
- flags |= ZEROPAD;
- }
- str = number(str,
- (unsigned long) va_arg(args, void *), 16,
- field_width, precision, flags);
- continue;
-
-
- case 'n':
- if (qualifier == 'l') {
- long * ip = va_arg(args, long *);
- *ip = (str - buf);
- } else if (qualifier == 'Z') {
- size_t * ip = va_arg(args, size_t *);
- *ip = (str - buf);
- } else {
- int * ip = va_arg(args, int *);
- *ip = (str - buf);
- }
- continue;
-
- case '%':
- *str++ = '%';
- continue;
-
- /* integer number formats - set up the flags and "break" */
- case 'o':
- base = 8;
- break;
-
- case 'X':
- flags |= LARGE;
- case 'x':
- base = 16;
- break;
-
- case 'd':
- case 'i':
- flags |= SIGN;
- case 'u':
- break;
-
- default:
- *str++ = '%';
- if (*fmt)
- *str++ = *fmt;
- else
- --fmt;
- continue;
- }
- if (qualifier == 'L')
- num = va_arg(args, long long);
- else if (qualifier == 'l') {
- num = va_arg(args, unsigned long);
- if (flags & SIGN)
- num = (signed long) num;
- } else if (qualifier == 'Z') {
- num = va_arg(args, size_t);
- } else if (qualifier == 'h') {
- num = (unsigned short) va_arg(args, int);
- if (flags & SIGN)
- num = (signed short) num;
- } else {
- num = va_arg(args, unsigned int);
- if (flags & SIGN)
- num = (signed int) num;
- }
- str = number(str, num, base, field_width, precision, flags);
- }
- *str = '\0';
- return str-buf;
-}
-
-int sprintf(char * buf, const char *fmt, ...)
-{
- va_list args;
- int i;
-
- va_start(args, fmt);
- i=vsprintf(buf,fmt,args);
- va_end(args);
- return i;
-}
-
-static char sprint_buf[1024];
-
-void
-printk(char *fmt, ...)
-{
- va_list args;
- int n;
-
- va_start(args, fmt);
- n = vsprintf(sprint_buf, fmt, args);
- va_end(args);
- write(stdout, sprint_buf, n);
-}
-
-int
-printf(char *fmt, ...)
-{
- va_list args;
- int n;
-
- va_start(args, fmt);
- n = vsprintf(sprint_buf, fmt, args);
- va_end(args);
- write(stdout, sprint_buf, n);
- return n;
-}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/string.S linuxppc64_2_4/arch/ppc64/boot/string.S
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/string.S Wed Dec 31 18:00:00 1969
+++ linuxppc64_2_4/arch/ppc64/boot/string.S Wed Apr 10 12:21:34 2002
@@ -0,0 +1,223 @@
+/*
+ * Copyright (C) Paul Mackerras 1997.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * NOTE: this code runs in 32 bit mode and is packaged as ELF32.
+ */
+
+#include
+
+ .text
+ .globl strcpy
+strcpy:
+ addi r5,r3,-1
+ addi r4,r4,-1
+1: lbzu r0,1(r4)
+ cmpwi 0,r0,0
+ stbu r0,1(r5)
+ bne 1b
+ blr
+
+ .globl strncpy
+strncpy:
+ cmpwi 0,r5,0
+ beqlr
+ mtctr r5
+ addi r6,r3,-1
+ addi r4,r4,-1
+1: lbzu r0,1(r4)
+ cmpwi 0,r0,0
+ stbu r0,1(r6)
+ bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
+ blr
+
+ .globl strcat
+strcat:
+ addi r5,r3,-1
+ addi r4,r4,-1
+1: lbzu r0,1(r5)
+ cmpwi 0,r0,0
+ bne 1b
+ addi r5,r5,-1
+1: lbzu r0,1(r4)
+ cmpwi 0,r0,0
+ stbu r0,1(r5)
+ bne 1b
+ blr
+
+ .globl strcmp
+strcmp:
+ addi r5,r3,-1
+ addi r4,r4,-1
+1: lbzu r3,1(r5)
+ cmpwi 1,r3,0
+ lbzu r0,1(r4)
+ subf. r3,r0,r3
+ beqlr 1
+ beq 1b
+ blr
+
+ .globl strlen
+strlen:
+ addi r4,r3,-1
+1: lbzu r0,1(r4)
+ cmpwi 0,r0,0
+ bne 1b
+ subf r3,r3,r4
+ blr
+
+ .globl memset
+memset:
+ rlwimi r4,r4,8,16,23
+ rlwimi r4,r4,16,0,15
+ addi r6,r3,-4
+ cmplwi 0,r5,4
+ blt 7f
+ stwu r4,4(r6)
+ beqlr
+ andi. r0,r6,3
+ add r5,r0,r5
+ subf r6,r0,r6
+ rlwinm r0,r5,32-2,2,31
+ mtctr r0
+ bdz 6f
+1: stwu r4,4(r6)
+ bdnz 1b
+6: andi. r5,r5,3
+7: cmpwi 0,r5,0
+ beqlr
+ mtctr r5
+ addi r6,r6,3
+8: stbu r4,1(r6)
+ bdnz 8b
+ blr
+
+ .globl bcopy
+bcopy:
+ mr r6,r3
+ mr r3,r4
+ mr r4,r6
+ b memcpy
+
+ .globl memmove
+memmove:
+ cmplw 0,r3,r4
+ bgt backwards_memcpy
+ /* fall through */
+
+ .globl memcpy
+memcpy:
+ rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
+ addi r6,r3,-4
+ addi r4,r4,-4
+ beq 2f /* if less than 8 bytes to do */
+ andi. r0,r6,3 /* get dest word aligned */
+ mtctr r7
+ bne 5f
+1: lwz r7,4(r4)
+ lwzu r8,8(r4)
+ stw r7,4(r6)
+ stwu r8,8(r6)
+ bdnz 1b
+ andi. r5,r5,7
+2: cmplwi 0,r5,4
+ blt 3f
+ lwzu r0,4(r4)
+ addi r5,r5,-4
+ stwu r0,4(r6)
+3: cmpwi 0,r5,0
+ beqlr
+ mtctr r5
+ addi r4,r4,3
+ addi r6,r6,3
+4: lbzu r0,1(r4)
+ stbu r0,1(r6)
+ bdnz 4b
+ blr
+5: subfic r0,r0,4
+ mtctr r0
+6: lbz r7,4(r4)
+ addi r4,r4,1
+ stb r7,4(r6)
+ addi r6,r6,1
+ bdnz 6b
+ subf r5,r0,r5
+ rlwinm. r7,r5,32-3,3,31
+ beq 2b
+ mtctr r7
+ b 1b
+
+ .globl backwards_memcpy
+backwards_memcpy:
+ rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
+ add r6,r3,r5
+ add r4,r4,r5
+ beq 2f
+ andi. r0,r6,3
+ mtctr r7
+ bne 5f
+1: lwz r7,-4(r4)
+ lwzu r8,-8(r4)
+ stw r7,-4(r6)
+ stwu r8,-8(r6)
+ bdnz 1b
+ andi. r5,r5,7
+2: cmplwi 0,r5,4
+ blt 3f
+ lwzu r0,-4(r4)
+ subi r5,r5,4
+ stwu r0,-4(r6)
+3: cmpwi 0,r5,0
+ beqlr
+ mtctr r5
+4: lbzu r0,-1(r4)
+ stbu r0,-1(r6)
+ bdnz 4b
+ blr
+5: mtctr r0
+6: lbzu r7,-1(r4)
+ stbu r7,-1(r6)
+ bdnz 6b
+ subf r5,r0,r5
+ rlwinm. r7,r5,32-3,3,31
+ beq 2b
+ mtctr r7
+ b 1b
+
+ .globl memcmp
+memcmp:
+ cmpwi 0,r5,0
+ blelr
+ mtctr r5
+ addi r6,r3,-1
+ addi r4,r4,-1
+1: lbzu r3,1(r6)
+ lbzu r0,1(r4)
+ subf. r3,r0,r3
+ bdnzt 2,1b
+ blr
+
+
+/*
+ * Flush the dcache and invalidate the icache for a range of addresses.
+ *
+ * flush_cache(addr, len)
+ */
+ .global flush_cache
+flush_cache:
+ addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */
+ rlwinm. 4,4,27,5,31
+ mtctr 4
+ beqlr
+1: dcbf 0,3
+ icbi 0,3
+ addi 3,3,0x20
+ bdnz 1b
+ sync
+ isync
+ blr
+
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/zImage.c linuxppc64_2_4/arch/ppc64/boot/zImage.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/zImage.c Wed Dec 31 18:00:00 1969
+++ linuxppc64_2_4/arch/ppc64/boot/zImage.c Wed Apr 10 12:21:34 2002
@@ -0,0 +1,362 @@
+/*
+ * Copyright (C) Paul Mackerras 1997.
+ *
+ * Updates for PPC64 by Todd Inglett, Dave Engebretsen & Peter Bergner.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#define __KERNEL__
+#include "ppc32-types.h"
+#include "zlib.h"
+#include
+#include
+#include
+#include
+
+void memmove(void *dst, void *im, int len);
+
+extern void *finddevice(const char *);
+extern int getprop(void *, const char *, void *, int);
+extern void printk(char *fmt, ...);
+extern void printf(const char *fmt, ...);
+extern int sprintf(char *buf, const char *fmt, ...);
+void gunzip(void *, int, unsigned char *, int *);
+void *claim(unsigned int, unsigned int, unsigned int);
+void flush_cache(void *, unsigned long);
+void pause(void);
+extern void exit(void);
+
+static struct bi_record *make_bi_recs(unsigned long);
+
+#define RAM_START 0x00000000
+#define RAM_END (64<<20)
+
+/* Value picked to match that used by yaboot */
+#define PROG_START 0x01400000
+
+char *avail_ram;
+char *begin_avail, *end_avail;
+char *avail_high;
+unsigned int heap_use;
+unsigned int heap_max;
+
+extern char _end[];
+extern char _vmlinux_start[];
+extern char _vmlinux_end[];
+extern char _sysmap_start[];
+extern char _sysmap_end[];
+extern char _initrd_start[];
+extern char _initrd_end[];
+extern unsigned long vmlinux_filesize;
+extern unsigned long vmlinux_memsize;
+
+struct addr_range {
+ unsigned long addr;
+ unsigned long size;
+ unsigned long memsize;
+};
+struct addr_range vmlinux = {0, 0, 0};
+struct addr_range vmlinuz = {0, 0, 0};
+struct addr_range sysmap = {0, 0, 0};
+struct addr_range initrd = {0, 0, 0};
+
+static char scratch[128<<10]; /* 128kB of scratch space for gunzip */
+
+typedef void (*kernel_entry_t)( unsigned long,
+ unsigned long,
+ void *,
+ struct bi_record *);
+
+
+int (*prom)(void *);
+
+void *chosen_handle;
+void *stdin;
+void *stdout;
+void *stderr;
+
+
+void
+start(unsigned long a1, unsigned long a2, void *promptr)
+{
+ unsigned long i, claim_addr, claim_size;
+ extern char _start;
+ struct bi_record *bi_recs;
+ kernel_entry_t kernel_entry;
+ Elf64_Ehdr *elf64;
+ Elf64_Phdr *elf64ph;
+
+ prom = (int (*)(void *)) promptr;
+ chosen_handle = finddevice("/chosen");
+ if (chosen_handle == (void *) -1)
+ exit();
+ if (getprop(chosen_handle, "stdout", &stdout, sizeof(stdout)) != 4)
+ exit();
+ stderr = stdout;
+ if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4)
+ exit();
+
+ printf("zImage starting: loaded at 0x%x\n\r", (unsigned)&_start);
+
+#if 0
+ sysmap.size = (unsigned long)(_sysmap_end - _sysmap_start);
+ sysmap.memsize = sysmap.size;
+ if ( sysmap.size > 0 ) {
+ sysmap.addr = (RAM_END - sysmap.size) & ~0xFFF;
+ claim(sysmap.addr, RAM_END - sysmap.addr, 0);
+ printf("initial ramdisk moving 0x%lx <- 0x%lx (%lx bytes)\n\r",
+ sysmap.addr, (unsigned long)_sysmap_start, sysmap.size);
+ memcpy((void *)sysmap.addr, (void *)_sysmap_start, sysmap.size);
+ }
+#endif
+
+ initrd.size = (unsigned long)(_initrd_end - _initrd_start);
+ initrd.memsize = initrd.size;
+ if ( initrd.size > 0 ) {
+ initrd.addr = (RAM_END - initrd.size) & ~0xFFF;
+ a1 = a2 = 0;
+ claim(initrd.addr, RAM_END - initrd.addr, 0);
+ printf("initial ramdisk moving 0x%lx <- 0x%lx (%lx bytes)\n\r",
+ initrd.addr, (unsigned long)_initrd_start, initrd.size);
+ memcpy((void *)initrd.addr, (void *)_initrd_start, initrd.size);
+ }
+
+ vmlinuz.addr = (unsigned long)_vmlinux_start;
+ vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start);
+ vmlinux.addr = (unsigned long)(void *)-1;
+ vmlinux.size = PAGE_ALIGN(vmlinux_filesize);
+ vmlinux.memsize = vmlinux_memsize;
+
+ claim_size = vmlinux.memsize /* PPPBBB: + fudge for bi_recs */;
+ for(claim_addr = PROG_START;
+ claim_addr <= PROG_START * 8;
+ claim_addr += 0x100000) {
+ printf(" trying: 0x%08lx\n\r", claim_addr);
+ vmlinux.addr = (unsigned long)claim(claim_addr, claim_size, 0);
+ if ((void *)vmlinux.addr != (void *)-1) break;
+ }
+ if ((void *)vmlinux.addr == (void *)-1) {
+ printf("claim error, can't allocate kernel memory\n\r");
+ exit();
+ }
+
+ /* PPPBBB: should kernel always be gziped? */
+ if (*(unsigned short *)vmlinuz.addr == 0x1f8b) {
+ avail_ram = scratch;
+ begin_avail = avail_high = avail_ram;
+ end_avail = scratch + sizeof(scratch);
+ printf("gunzipping (0x%lx <- 0x%lx:0x%0lx)...",
+ vmlinux.addr, vmlinuz.addr, vmlinuz.addr+vmlinuz.size);
+ gunzip((void *)vmlinux.addr, vmlinux.size,
+ (unsigned char *)vmlinuz.addr, (int *)&vmlinuz.size);
+ printf("done %lu bytes\n\r", vmlinuz.size);
+ printf("%u bytes of heap consumed, max in use %u\n\r",
+ (unsigned)(avail_high - begin_avail), heap_max);
+ } else {
+ memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size);
+ }
+
+ /* Skip over the ELF header */
+ elf64 = (Elf64_Ehdr *)vmlinux.addr;
+ if ( elf64->e_ident[EI_MAG0] != ELFMAG0 ||
+ elf64->e_ident[EI_MAG1] != ELFMAG1 ||
+ elf64->e_ident[EI_MAG2] != ELFMAG2 ||
+ elf64->e_ident[EI_MAG3] != ELFMAG3 ||
+ elf64->e_ident[EI_CLASS] != ELFCLASS64 ||
+ elf64->e_ident[EI_DATA] != ELFDATA2MSB ||
+ elf64->e_type != ET_EXEC ||
+ elf64->e_machine != EM_PPC64 )
+ {
+ printf("Error: not a valid PPC64 ELF file!\n\r");
+ exit();
+ }
+
+ elf64ph = (Elf64_Phdr *)((unsigned long)elf64 +
+ (unsigned long)elf64->e_phoff);
+ for(i=0; i < (unsigned int)elf64->e_phnum ;i++,elf64ph++) {
+ if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0)
+ break;
+ }
+ printf("... skipping 0x%lx bytes of ELF header\n\r",
+ (unsigned long)elf64ph->p_offset);
+ vmlinux.addr += (unsigned long)elf64ph->p_offset;
+ vmlinux.size -= (unsigned long)elf64ph->p_offset;
+
+ flush_cache((void *)vmlinux.addr, vmlinux.memsize);
+
+ bi_recs = make_bi_recs(vmlinux.addr + vmlinux.memsize);
+
+ kernel_entry = (kernel_entry_t)vmlinux.addr;
+ printf( "kernel:\n\r"
+ " entry addr = 0x%lx\n\r"
+ " a1 = 0x%lx,\n\r"
+ " a2 = 0x%lx,\n\r"
+ " prom = 0x%lx,\n\r"
+ " bi_recs = 0x%lx,\n\r",
+ (unsigned long)kernel_entry, a1, a2,
+ (unsigned long)prom, (unsigned long)bi_recs);
+
+ kernel_entry( a1, a2, prom, bi_recs );
+
+ printf("Error: Linux kernel returned to zImage bootloader!\n\r");
+
+ exit();
+}
+
+static struct bi_record *
+make_bi_recs(unsigned long addr)
+{
+ struct bi_record *bi_recs;
+ struct bi_record *rec;
+
+ bi_recs = rec = bi_rec_init(addr);
+
+ rec = bi_rec_alloc(rec, 2);
+ rec->tag = BI_FIRST;
+ /* rec->data[0] = ...; # Written below before return */
+ /* rec->data[1] = ...; # Written below before return */
+
+ rec = bi_rec_alloc_bytes(rec, strlen("chrpboot")+1);
+ rec->tag = BI_BOOTLOADER_ID;
+ sprintf( (char *)rec->data, "chrpboot");
+
+ rec = bi_rec_alloc(rec, 2);
+ rec->tag = BI_MACHTYPE;
+ rec->data[0] = _MACH_pSeries;
+ rec->data[1] = 1;
+
+ if ( initrd.size > 0 ) {
+ rec = bi_rec_alloc(rec, 2);
+ rec->tag = BI_INITRD;
+ rec->data[0] = initrd.addr;
+ rec->data[1] = initrd.size;
+ }
+
+ if ( sysmap.size > 0 ) {
+ rec = bi_rec_alloc(rec, 2);
+ rec->tag = BI_SYSMAP;
+ rec->data[0] = (unsigned long)sysmap.addr;
+ rec->data[1] = (unsigned long)sysmap.size;
+ }
+
+ rec = bi_rec_alloc(rec, 1);
+ rec->tag = BI_LAST;
+ rec->data[0] = (bi_rec_field)bi_recs;
+
+ /* Save the _end_ address of the bi_rec's in the first bi_rec
+ * data field for easy access by the kernel.
+ */
+ bi_recs->data[0] = (bi_rec_field)rec;
+ bi_recs->data[1] = (bi_rec_field)rec + rec->size - (bi_rec_field)bi_recs;
+
+ return bi_recs;
+}
+
+struct memchunk {
+ unsigned int size;
+ unsigned int pad;
+ struct memchunk *next;
+};
+
+static struct memchunk *freechunks;
+
+void *zalloc(void *x, unsigned items, unsigned size)
+{
+ void *p;
+ struct memchunk **mpp, *mp;
+
+ size *= items;
+ size = _ALIGN(size, sizeof(struct memchunk));
+ heap_use += size;
+ if (heap_use > heap_max)
+ heap_max = heap_use;
+ for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
+ if (mp->size == size) {
+ *mpp = mp->next;
+ return mp;
+ }
+ }
+ p = avail_ram;
+ avail_ram += size;
+ if (avail_ram > avail_high)
+ avail_high = avail_ram;
+ if (avail_ram > end_avail) {
+ printf("oops... out of memory\n\r");
+ pause();
+ }
+ return p;
+}
+
+void zfree(void *x, void *addr, unsigned nb)
+{
+ struct memchunk *mp = addr;
+
+ nb = _ALIGN(nb, sizeof(struct memchunk));
+ heap_use -= nb;
+ if (avail_ram == addr + nb) {
+ avail_ram = addr;
+ return;
+ }
+ mp->size = nb;
+ mp->next = freechunks;
+ freechunks = mp;
+}
+
+#define HEAD_CRC 2
+#define EXTRA_FIELD 4
+#define ORIG_NAME 8
+#define COMMENT 0x10
+#define RESERVED 0xe0
+
+#define DEFLATED 8
+
+void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
+{
+ z_stream s;
+ int r, i, flags;
+
+ /* skip header */
+ i = 10;
+ flags = src[3];
+ if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
+ printf("bad gzipped data\n\r");
+ exit();
+ }
+ if ((flags & EXTRA_FIELD) != 0)
+ i = 12 + src[10] + (src[11] << 8);
+ if ((flags & ORIG_NAME) != 0)
+ while (src[i++] != 0)
+ ;
+ if ((flags & COMMENT) != 0)
+ while (src[i++] != 0)
+ ;
+ if ((flags & HEAD_CRC) != 0)
+ i += 2;
+ if (i >= *lenp) {
+ printf("gunzip: ran out of data in header\n\r");
+ exit();
+ }
+
+ s.zalloc = zalloc;
+ s.zfree = zfree;
+ r = inflateInit2(&s, -MAX_WBITS);
+ if (r != Z_OK) {
+ printf("inflateInit2 returned %d\n\r", r);
+ exit();
+ }
+ s.next_in = src + i;
+ s.avail_in = *lenp - i;
+ s.next_out = dst;
+ s.avail_out = dstlen;
+ r = inflate(&s, Z_FINISH);
+ if (r != Z_OK && r != Z_STREAM_END) {
+ printf("inflate returned %d msg: %s\n\r", r, s.msg);
+ exit();
+ }
+ *lenp = s.next_out - (unsigned char *) dst;
+ inflateEnd(&s);
+}
+
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/zImage.lds linuxppc64_2_4/arch/ppc64/boot/zImage.lds
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/zImage.lds Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/ppc64/boot/zImage.lds Wed Apr 10 12:21:34 2002
@@ -57,6 +57,27 @@
*(.dynamic)
CONSTRUCTORS
}
+
+ . = ALIGN(4096);
+ _vmlinux_start = .;
+ .kernel:vmlinux : { *(.kernel:vmlinux) }
+ _vmlinux_end = .;
+
+ . = ALIGN(4096);
+ _dotconfig_start = .;
+ .kernel:.config : { *(.kernel:.config) }
+ _dotconfig_end = .;
+
+ . = ALIGN(4096);
+ _sysmap_start = .;
+ .kernel:System.map : { *(.kernel:System.map) }
+ _sysmap_end = .;
+
+ . = ALIGN(4096);
+ _initrd_start = .;
+ .kernel:initrd : { *(.kernel:initrd) }
+ _initrd_end = .;
+
. = ALIGN(4096);
_edata = .;
PROVIDE (edata = .);
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/boot/zlib.c linuxppc64_2_4/arch/ppc64/boot/zlib.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/boot/zlib.c Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/ppc64/boot/zlib.c Wed Apr 10 12:21:34 2002
@@ -671,11 +671,6 @@
/* load local pointers */
#define LOAD {LOADIN LOADOUT}
-/*
- * The IBM 150 firmware munges the data right after _etext[]. This
- * protects it. -- Cort
- */
-local uInt protect_mask[] = {0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0 ,0};
/* And'ing with mask[n] masks the lower n bits */
local uInt inflate_mask[] = {
0x0000,
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/config.in linuxppc64_2_4/arch/ppc64/config.in
--- ../kernel.org/linux-2.4.19/arch/ppc64/config.in Fri Apr 19 11:00:32 2002
+++ linuxppc64_2_4/arch/ppc64/config.in Fri Mar 29 10:18:26 2002
@@ -31,7 +31,6 @@
bool ' Distribute interrupts on all CPUs by default' CONFIG_IRQ_ALL_CPUS
if [ "$CONFIG_PPC_PSERIES" = "y" ]; then
bool ' Hardware multithreading' CONFIG_HMT
- bool ' PCI Enhanced Error Handling' CONFIG_PPC_EEH
fi
fi
if [ "$CONFIG_PPC_ISERIES" = "y" ]; then
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/configs/pSeries_defconfig linuxppc64_2_4/arch/ppc64/configs/pSeries_defconfig
--- ../kernel.org/linux-2.4.19/arch/ppc64/configs/pSeries_defconfig Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/configs/pSeries_defconfig Fri Mar 29 10:18:26 2002
@@ -24,7 +24,6 @@
CONFIG_SMP=y
CONFIG_IRQ_ALL_CPUS=y
# CONFIG_HMT is not set
-# CONFIG_PPC_EEH is not set
# CONFIG_MSCHUNKS is not set
#
@@ -72,7 +71,6 @@
#
# CONFIG_PNP is not set
# CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
#
# Block devices
@@ -106,8 +104,6 @@
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
-CONFIG_NETLINK=y
-# CONFIG_RTNETLINK is not set
# CONFIG_NETLINK_DEV is not set
# CONFIG_NETFILTER is not set
CONFIG_FILTER=y
@@ -119,11 +115,13 @@
CONFIG_NET_IPIP=y
# 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_IPV6 is not set
# CONFIG_KHTTPD is not set
# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
#
#
@@ -260,6 +258,7 @@
# CONFIG_SCSI_AHA152X is not set
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
+# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_DPT_I2O is not set
@@ -281,6 +280,7 @@
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_NCR53C7xx is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_NCR53C8XX is not set
CONFIG_SCSI_SYM53C8XX=y
CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
@@ -304,8 +304,6 @@
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
# CONFIG_SCSI_DEBUG is not set
-# CONFIG_SCSI_MESH is not set
-# CONFIG_SCSI_MAC53C94 is not set
#
# IEEE 1394 (FireWire) support (EXPERIMENTAL)
@@ -334,12 +332,10 @@
# CONFIG_MACE is not set
# CONFIG_BMAC is not set
# CONFIG_GMAC is not set
-# CONFIG_OAKNET is not set
# CONFIG_SUNLANCE is not set
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNBMAC is not set
# CONFIG_SUNQE is not set
-# CONFIG_SUNLANCE is not set
# CONFIG_SUNGEM is not set
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_LANCE is not set
@@ -368,11 +364,13 @@
# CONFIG_8139TOO_PIO is not set
# CONFIG_8139TOO_TUNE_TWISTER is not set
# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_NEW_RX_RESET is not set
# CONFIG_SIS900 is not set
# CONFIG_EPIC100 is not set
# CONFIG_SUNDANCE is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_RHINE_MMIO is not set
# CONFIG_WINBOND_840 is not set
# CONFIG_NET_POCKET is not set
@@ -382,6 +380,7 @@
CONFIG_ACENIC=y
# CONFIG_ACENIC_OMIT_TIGON_I is not set
# CONFIG_DL2K is not set
+CONFIG_E1000=y
# CONFIG_MYRI_SBUS is not set
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
@@ -467,6 +466,7 @@
# CONFIG_FB_SIS is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FBCON_ADVANCED is not set
CONFIG_FBCON_CFB8=y
@@ -480,6 +480,15 @@
# CONFIG_FONT_SUN8x16 is not set
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
CONFIG_VIOPATH=y
#
@@ -513,36 +522,14 @@
# Joysticks
#
# CONFIG_INPUT_GAMEPORT is not set
-# CONFIG_INPUT_NS558 is not set
-# CONFIG_INPUT_LIGHTNING is not set
-# CONFIG_INPUT_PCIGAME is not set
-# CONFIG_INPUT_CS461X is not set
-# CONFIG_INPUT_EMU10K1 is not set
-# CONFIG_INPUT_SERIO is not set
-# CONFIG_INPUT_SERPORT is not set
#
-# Joysticks
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
#
-# CONFIG_INPUT_ANALOG is not set
-# CONFIG_INPUT_A3D is not set
-# CONFIG_INPUT_ADI is not set
-# CONFIG_INPUT_COBRA is not set
-# CONFIG_INPUT_GF2K is not set
-# CONFIG_INPUT_GRIP is not set
-# CONFIG_INPUT_INTERACT is not set
-# CONFIG_INPUT_TMDC is not set
-# CONFIG_INPUT_SIDEWINDER is not set
-# CONFIG_INPUT_IFORCE_USB is not set
-# CONFIG_INPUT_IFORCE_232 is not set
-# CONFIG_INPUT_WARRIOR is not set
-# CONFIG_INPUT_MAGELLAN is not set
-# CONFIG_INPUT_SPACEORB is not set
-# CONFIG_INPUT_SPACEBALL is not set
-# CONFIG_INPUT_STINGER is not set
-# CONFIG_INPUT_DB9 is not set
-# CONFIG_INPUT_GAMECON is not set
-# CONFIG_INPUT_TURBOGRAFX is not set
# CONFIG_QIC02_TAPE is not set
#
@@ -550,9 +537,9 @@
#
# CONFIG_WATCHDOG is not set
# CONFIG_INTEL_RNG is not set
-CONFIG_NVRAM=y
-CONFIG_RTC=y
-CONFIG_RTC=y
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -563,7 +550,6 @@
# CONFIG_FTAPE is not set
# CONFIG_AGP is not set
# CONFIG_DRM is not set
-# CONFIG_MWAVE is not set
#
# File systems
@@ -573,11 +559,15 @@
# CONFIG_AUTOFS4_FS is not set
CONFIG_REISERFS_FS=y
# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
# CONFIG_ADFS_FS is not set
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
+CONFIG_EXT3_FS=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
# CONFIG_UMSDOS_FS is not set
@@ -590,6 +580,7 @@
# CONFIG_RAMFS is not set
CONFIG_ISO9660_FS=y
# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_JFS_DEBUG is not set
@@ -616,6 +607,7 @@
# Network File Systems
#
# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_ROOT_NFS is not set
@@ -635,6 +627,8 @@
# CONFIG_NCPFS_SMALLDOS is not set
# CONFIG_NCPFS_NLS is not set
# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+# CONFIG_ZLIB_FS_INFLATE is not set
#
# Partition Types
@@ -669,6 +663,7 @@
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
@@ -722,11 +717,10 @@
#
# USB Human Interface Devices (HID)
#
-# CONFIG_USB_HID is not set
-# CONFIG_USB_HIDDEV is not set
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_WACOM is not set
+
+#
+# Input core support is needed for USB HID
+#
#
# USB Imaging devices
@@ -744,6 +738,8 @@
# CONFIG_USB_OV511 is not set
# CONFIG_USB_PWC is not set
# CONFIG_USB_SE401 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_VICAM is not set
# CONFIG_USB_DSBR is not set
# CONFIG_USB_DABUSB is not set
@@ -772,6 +768,7 @@
# CONFIG_USB_SERIAL_EMPEG is not set
# CONFIG_USB_SERIAL_FTDI_SIO is not set
# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
# CONFIG_USB_SERIAL_IR is not set
# CONFIG_USB_SERIAL_EDGEPORT is not set
# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
@@ -785,6 +782,7 @@
# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_KLSI is not set
# CONFIG_USB_SERIAL_PL2303 is not set
# CONFIG_USB_SERIAL_CYBERJACK is not set
# CONFIG_USB_SERIAL_XIRCOM is not set
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/defconfig linuxppc64_2_4/arch/ppc64/defconfig
--- ../kernel.org/linux-2.4.19/arch/ppc64/defconfig Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/defconfig Fri Mar 29 10:18:26 2002
@@ -24,7 +24,6 @@
CONFIG_SMP=y
CONFIG_IRQ_ALL_CPUS=y
# CONFIG_HMT is not set
-# CONFIG_PPC_EEH is not set
# CONFIG_MSCHUNKS is not set
#
@@ -72,7 +71,6 @@
#
# CONFIG_PNP is not set
# CONFIG_ISAPNP is not set
-# CONFIG_PNPBIOS is not set
#
# Block devices
@@ -106,8 +104,6 @@
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
-CONFIG_NETLINK=y
-# CONFIG_RTNETLINK is not set
# CONFIG_NETLINK_DEV is not set
# CONFIG_NETFILTER is not set
CONFIG_FILTER=y
@@ -119,11 +115,13 @@
CONFIG_NET_IPIP=y
# 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_IPV6 is not set
# CONFIG_KHTTPD is not set
# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
#
#
@@ -260,6 +258,7 @@
# CONFIG_SCSI_AHA152X is not set
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
+# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_DPT_I2O is not set
@@ -281,6 +280,7 @@
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_NCR53C7xx is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_NCR53C8XX is not set
CONFIG_SCSI_SYM53C8XX=y
CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
@@ -304,8 +304,6 @@
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
# CONFIG_SCSI_DEBUG is not set
-# CONFIG_SCSI_MESH is not set
-# CONFIG_SCSI_MAC53C94 is not set
#
# IEEE 1394 (FireWire) support (EXPERIMENTAL)
@@ -334,12 +332,10 @@
# CONFIG_MACE is not set
# CONFIG_BMAC is not set
# CONFIG_GMAC is not set
-# CONFIG_OAKNET is not set
# CONFIG_SUNLANCE is not set
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNBMAC is not set
# CONFIG_SUNQE is not set
-# CONFIG_SUNLANCE is not set
# CONFIG_SUNGEM is not set
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_LANCE is not set
@@ -368,11 +364,13 @@
# CONFIG_8139TOO_PIO is not set
# CONFIG_8139TOO_TUNE_TWISTER is not set
# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_NEW_RX_RESET is not set
# CONFIG_SIS900 is not set
# CONFIG_EPIC100 is not set
# CONFIG_SUNDANCE is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_RHINE_MMIO is not set
# CONFIG_WINBOND_840 is not set
# CONFIG_NET_POCKET is not set
@@ -382,6 +380,7 @@
CONFIG_ACENIC=y
# CONFIG_ACENIC_OMIT_TIGON_I is not set
# CONFIG_DL2K is not set
+CONFIG_E1000=y
# CONFIG_MYRI_SBUS is not set
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
@@ -467,6 +466,7 @@
# CONFIG_FB_SIS is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FBCON_ADVANCED is not set
CONFIG_FBCON_CFB8=y
@@ -480,6 +480,15 @@
# CONFIG_FONT_SUN8x16 is not set
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
CONFIG_VIOPATH=y
#
@@ -513,36 +522,14 @@
# Joysticks
#
# CONFIG_INPUT_GAMEPORT is not set
-# CONFIG_INPUT_NS558 is not set
-# CONFIG_INPUT_LIGHTNING is not set
-# CONFIG_INPUT_PCIGAME is not set
-# CONFIG_INPUT_CS461X is not set
-# CONFIG_INPUT_EMU10K1 is not set
-# CONFIG_INPUT_SERIO is not set
-# CONFIG_INPUT_SERPORT is not set
#
-# Joysticks
+# Input core support is needed for gameports
+#
+
+#
+# Input core support is needed for joysticks
#
-# CONFIG_INPUT_ANALOG is not set
-# CONFIG_INPUT_A3D is not set
-# CONFIG_INPUT_ADI is not set
-# CONFIG_INPUT_COBRA is not set
-# CONFIG_INPUT_GF2K is not set
-# CONFIG_INPUT_GRIP is not set
-# CONFIG_INPUT_INTERACT is not set
-# CONFIG_INPUT_TMDC is not set
-# CONFIG_INPUT_SIDEWINDER is not set
-# CONFIG_INPUT_IFORCE_USB is not set
-# CONFIG_INPUT_IFORCE_232 is not set
-# CONFIG_INPUT_WARRIOR is not set
-# CONFIG_INPUT_MAGELLAN is not set
-# CONFIG_INPUT_SPACEORB is not set
-# CONFIG_INPUT_SPACEBALL is not set
-# CONFIG_INPUT_STINGER is not set
-# CONFIG_INPUT_DB9 is not set
-# CONFIG_INPUT_GAMECON is not set
-# CONFIG_INPUT_TURBOGRAFX is not set
# CONFIG_QIC02_TAPE is not set
#
@@ -550,9 +537,9 @@
#
# CONFIG_WATCHDOG is not set
# CONFIG_INTEL_RNG is not set
-CONFIG_NVRAM=y
-CONFIG_RTC=y
-CONFIG_RTC=y
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
@@ -563,7 +550,6 @@
# CONFIG_FTAPE is not set
# CONFIG_AGP is not set
# CONFIG_DRM is not set
-# CONFIG_MWAVE is not set
#
# File systems
@@ -573,11 +559,15 @@
# CONFIG_AUTOFS4_FS is not set
CONFIG_REISERFS_FS=y
# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
# CONFIG_ADFS_FS is not set
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
+CONFIG_EXT3_FS=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
# CONFIG_UMSDOS_FS is not set
@@ -590,6 +580,7 @@
# CONFIG_RAMFS is not set
CONFIG_ISO9660_FS=y
# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_JFS_DEBUG is not set
@@ -616,6 +607,7 @@
# Network File Systems
#
# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_ROOT_NFS is not set
@@ -635,6 +627,8 @@
# CONFIG_NCPFS_SMALLDOS is not set
# CONFIG_NCPFS_NLS is not set
# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+# CONFIG_ZLIB_FS_INFLATE is not set
#
# Partition Types
@@ -669,6 +663,7 @@
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
@@ -722,11 +717,10 @@
#
# USB Human Interface Devices (HID)
#
-# CONFIG_USB_HID is not set
-# CONFIG_USB_HIDDEV is not set
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_WACOM is not set
+
+#
+# Input core support is needed for USB HID
+#
#
# USB Imaging devices
@@ -744,6 +738,8 @@
# CONFIG_USB_OV511 is not set
# CONFIG_USB_PWC is not set
# CONFIG_USB_SE401 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_VICAM is not set
# CONFIG_USB_DSBR is not set
# CONFIG_USB_DABUSB is not set
@@ -772,6 +768,7 @@
# CONFIG_USB_SERIAL_EMPEG is not set
# CONFIG_USB_SERIAL_FTDI_SIO is not set
# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
# CONFIG_USB_SERIAL_IR is not set
# CONFIG_USB_SERIAL_EDGEPORT is not set
# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
@@ -785,6 +782,7 @@
# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_KLSI is not set
# CONFIG_USB_SERIAL_PL2303 is not set
# CONFIG_USB_SERIAL_CYBERJACK is not set
# CONFIG_USB_SERIAL_XIRCOM is not set
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ItLpQueue.c linuxppc64_2_4/arch/ppc64/kernel/ItLpQueue.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ItLpQueue.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/ItLpQueue.c Tue Apr 9 11:30:17 2002
@@ -12,7 +12,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/LparData.c linuxppc64_2_4/arch/ppc64/kernel/LparData.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/LparData.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/LparData.c Fri Apr 19 12:43:08 2002
@@ -14,13 +14,13 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -61,8 +61,8 @@
struct HvReleaseData hvReleaseData = {
0xc8a5d9c4, /* desc = "HvRD" ebcdic */
sizeof(struct HvReleaseData),
- offsetof(struct Naca, xItVpdAreas),
- (struct Naca *)(KERNELBASE+0x4000), /* 64-bit Naca address */
+ offsetof(struct naca_struct, xItVpdAreas),
+ (struct naca_struct *)(KERNELBASE+0x4000), /* 64-bit Naca address */
0x6000, /* offset of LparMap within loadarea (see head.S) */
0,
1, /* tags inactive */
@@ -144,7 +144,9 @@
struct ItIplParmsReal xItIplParmsReal = {};
-struct IoHriProcessorVpd xIoHriProcessorVpd[maxProcessors] = {
+#define maxPhysicalProcessors 32
+
+struct IoHriProcessorVpd xIoHriProcessorVpd[maxPhysicalProcessors] = {
{
xInstCacheOperandSize: 32,
xDataCacheOperandSize: 32,
@@ -172,7 +174,7 @@
0, 0,
26, /* # VPD array entries */
10, /* # DMA array entries */
- maxProcessors*2, maxProcessors, /* Max logical, physical procs */
+ MAX_PROCESSORS*2, maxPhysicalProcessors, /* Max logical, physical procs */
offsetof(struct ItVpdAreas,xPlicDmaToks),/* offset to DMA toks */
offsetof(struct ItVpdAreas,xSlicVpdAdrs),/* offset to VPD addrs */
offsetof(struct ItVpdAreas,xPlicDmaLens),/* offset to DMA lens */
@@ -184,7 +186,7 @@
{0}, /* DMA tokens */
{ /* VPD lengths */
0,0,0,0, /* 0 - 3 */
- sizeof(struct Paca), /* 4 length of Paca */
+ sizeof(struct paca_struct), /* 4 length of Paca */
0, /* 5 */
sizeof(struct ItIplParmsReal),/* 6 length of IPL parms */
26992, /* 7 length of MS VPD */
@@ -201,7 +203,7 @@
},
{ /* VPD addresses */
0,0,0,0, /* 0 - 3 */
- &xPaca[0], /* 4 first Paca */
+ &paca[0], /* 4 first Paca */
0, /* 5 */
&xItIplParmsReal, /* 6 IPL parms */
&xMsVpd, /* 7 MS Vpd */
@@ -217,10 +219,6 @@
0,0
}
};
-
-
-/* Data area used in flush_hash_page */
-long long flush_hash_page_hpte[2];
struct msChunks msChunks = {0, 0, 0, 0, NULL};
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/Makefile linuxppc64_2_4/arch/ppc64/kernel/Makefile
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/Makefile Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/Makefile Fri Mar 29 10:18:26 2002
@@ -30,25 +30,19 @@
rtc.o
obj-$(CONFIG_PCI) += pci.o pci_dn.o pci_dma.o
-obj-$(CONFIG_PPC_EEH) += eeh.o
ifeq ($(CONFIG_PPC_ISERIES),y)
obj-$(CONFIG_PCI) += iSeries_pci.o iSeries_pci_reset.o iSeries_IoMmTable.o iSeries_irq.o iSeries_VpdInfo.o XmPciLpEvent.o
endif
ifeq ($(CONFIG_PPC_PSERIES),y)
-obj-$(CONFIG_PCI) += pSeries_pci.o pSeries_lpar.o pSeries_hvCall.o
+obj-$(CONFIG_PCI) += pSeries_pci.o pSeries_lpar.o pSeries_hvCall.o eeh.o
-obj-y += rtasd.o
+obj-y += rtasd.o nvram.o
endif
obj-$(CONFIG_KGDB) += ppc-stub.o
obj-$(CONFIG_SMP) += smp.o
-
-# tibit: for matrox_init2()
-ifeq ($(CONFIG_NVRAM),y)
- obj-$(CONFIG_NVRAM) += pmac_nvram.o
-endif
obj-y += prom.o lmb.o rtas.o rtas-proc.o chrp_setup.o i8259.o
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/align.c linuxppc64_2_4/arch/ppc64/kernel/align.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/align.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/align.c Mon Mar 11 13:08:46 2002
@@ -1,12 +1,12 @@
-/*
- * align.c - handle alignment exceptions for the Power PC.
+/* align.c - handle alignment exceptions for the Power PC.
*
* Copyright (c) 1996 Paul Mackerras
* Copyright (c) 1998-1999 TiVo, Inc.
* PowerPC 403GCX modifications.
* Copyright (c) 1999 Grant Erickson
* PowerPC 403GCX/405GP modifications.
- * Copyright (c) 2001 PPC64 team, IBM Corp
+ * Copyright (c) 2001-2002 PPC64 team, IBM Corp
+ * 64-bit and Power4 support
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -27,10 +27,8 @@
unsigned char flags;
};
-#define OPCD(inst) (((inst) & 0xFC000000) >> 26)
-#define RS(inst) (((inst) & 0x03E00000) >> 21)
-#define RA(inst) (((inst) & 0x001F0000) >> 16)
-#define IS_DFORM(code) ((code) >= 32 && (code) <= 47)
+#define IS_XFORM(inst) (((inst) >> 26) == 31)
+#define IS_DSFORM(inst) (((inst) >> 26) >= 56)
#define INVALID { 0, 0 }
@@ -40,9 +38,7 @@
#define F 8 /* to/from fp regs */
#define U 0x10 /* update index register */
#define M 0x20 /* multiple load/store */
-#define S 0x40 /* single-precision fp, or byte-swap value */
-#define HARD 0x80 /* string, stwcx. */
-#define D 0x100 /* double-word load/store */
+#define SW 0x40 /* byte swap */
#define DCBZ 0x5f /* 8xx/82xx dcbz faults when cache not enabled */
@@ -61,9 +57,9 @@
{ 2, LD+SE }, /* 00 0 0101: lha */
{ 2, ST }, /* 00 0 0110: sth */
{ 4, LD+M }, /* 00 0 0111: lmw */
- { 4, LD+F+S }, /* 00 0 1000: lfs */
+ { 4, LD+F }, /* 00 0 1000: lfs */
{ 8, LD+F }, /* 00 0 1001: lfd */
- { 4, ST+F+S }, /* 00 0 1010: stfs */
+ { 4, ST+F }, /* 00 0 1010: stfs */
{ 8, ST+F }, /* 00 0 1011: stfd */
INVALID, /* 00 0 1100 */
{ 8, LD }, /* 00 0 1101: ld */
@@ -77,12 +73,12 @@
{ 2, LD+SE+U }, /* 00 1 0101: lhau */
{ 2, ST+U }, /* 00 1 0110: sthu */
{ 4, ST+M }, /* 00 1 0111: stmw */
- { 4, LD+F+S+U }, /* 00 1 1000: lfsu */
+ { 4, LD+F+U }, /* 00 1 1000: lfsu */
{ 8, LD+F+U }, /* 00 1 1001: lfdu */
- { 4, ST+F+S+U }, /* 00 1 1010: stfsu */
+ { 4, ST+F+U }, /* 00 1 1010: stfsu */
{ 8, ST+F+U }, /* 00 1 1011: stfdu */
INVALID, /* 00 1 1100 */
- { 8, ST }, /* 00 1 1101: std */
+ INVALID, /* 00 1 1101 */
INVALID, /* 00 1 1110 */
INVALID, /* 00 1 1111 */
{ 8, LD }, /* 01 0 0000: ldx */
@@ -90,13 +86,13 @@
{ 8, ST }, /* 01 0 0010: stdx */
INVALID, /* 01 0 0011 */
INVALID, /* 01 0 0100 */
- INVALID, /* 01 0 0101: lwax?? */
+ { 4, LD+SE }, /* 01 0 0101: lwax */
INVALID, /* 01 0 0110 */
INVALID, /* 01 0 0111 */
- { 0, LD+HARD }, /* 01 0 1000: lswx */
- { 0, LD+HARD }, /* 01 0 1001: lswi */
- { 0, ST+HARD }, /* 01 0 1010: stswx */
- { 0, ST+HARD }, /* 01 0 1011: stswi */
+ { 0, LD }, /* 01 0 1000: lswx */
+ { 0, LD }, /* 01 0 1001: lswi */
+ { 0, ST }, /* 01 0 1010: stswx */
+ { 0, ST }, /* 01 0 1011: stswi */
INVALID, /* 01 0 1100 */
{ 8, LD+U }, /* 01 0 1101: ldu */
INVALID, /* 01 0 1110 */
@@ -106,7 +102,7 @@
{ 8, ST+U }, /* 01 1 0010: stdux */
INVALID, /* 01 1 0011 */
INVALID, /* 01 1 0100 */
- INVALID, /* 01 1 0101: lwaux?? */
+ { 4, LD+SE+U }, /* 01 1 0101: lwaux */
INVALID, /* 01 1 0110 */
INVALID, /* 01 1 0111 */
INVALID, /* 01 1 1000 */
@@ -119,19 +115,19 @@
INVALID, /* 01 1 1111 */
INVALID, /* 10 0 0000 */
INVALID, /* 10 0 0001 */
- { 0, ST+HARD }, /* 10 0 0010: stwcx. */
+ { 0, ST }, /* 10 0 0010: stwcx. */
INVALID, /* 10 0 0011 */
INVALID, /* 10 0 0100 */
INVALID, /* 10 0 0101 */
INVALID, /* 10 0 0110 */
INVALID, /* 10 0 0111 */
- { 4, LD+S }, /* 10 0 1000: lwbrx */
+ { 4, LD+SW }, /* 10 0 1000: lwbrx */
INVALID, /* 10 0 1001 */
- { 4, ST+S }, /* 10 0 1010: stwbrx */
+ { 4, ST+SW }, /* 10 0 1010: stwbrx */
INVALID, /* 10 0 1011 */
- { 2, LD+S }, /* 10 0 1100: lhbrx */
- INVALID, /* 10 0 1101 */
- { 2, ST+S }, /* 10 0 1110: sthbrx */
+ { 2, LD+SW }, /* 10 0 1100: lhbrx */
+ { 4, LD+SE }, /* 10 0 1101 lwa */
+ { 2, ST+SW }, /* 10 0 1110: sthbrx */
INVALID, /* 10 0 1111 */
INVALID, /* 10 1 0000 */
INVALID, /* 10 1 0001 */
@@ -148,7 +144,7 @@
INVALID, /* 10 1 1100 */
INVALID, /* 10 1 1101 */
INVALID, /* 10 1 1110 */
- { 0, ST+HARD }, /* 10 1 1111: dcbz */
+ { L1_CACHE_BYTES, ST }, /* 10 1 1111: dcbz */
{ 4, LD }, /* 11 0 0000: lwzx */
INVALID, /* 11 0 0001 */
{ 4, ST }, /* 11 0 0010: stwx */
@@ -157,14 +153,14 @@
{ 2, LD+SE }, /* 11 0 0101: lhax */
{ 2, ST }, /* 11 0 0110: sthx */
INVALID, /* 11 0 0111 */
- { 4, LD+F+S }, /* 11 0 1000: lfsx */
+ { 4, LD+F }, /* 11 0 1000: lfsx */
{ 8, LD+F }, /* 11 0 1001: lfdx */
- { 4, ST+F+S }, /* 11 0 1010: stfsx */
+ { 4, ST+F }, /* 11 0 1010: stfsx */
{ 8, ST+F }, /* 11 0 1011: stfdx */
INVALID, /* 11 0 1100 */
- INVALID, /* 11 0 1101 */
+ { 8, LD+M }, /* 11 0 1101: lmd */
INVALID, /* 11 0 1110 */
- INVALID, /* 11 0 1111 */
+ { 8, ST+M }, /* 11 0 1111: stmd */
{ 4, LD+U }, /* 11 1 0000: lwzux */
INVALID, /* 11 1 0001 */
{ 4, ST+U }, /* 11 1 0010: stwux */
@@ -173,9 +169,9 @@
{ 2, LD+SE+U }, /* 11 1 0101: lhaux */
{ 2, ST+U }, /* 11 1 0110: sthux */
INVALID, /* 11 1 0111 */
- { 4, LD+F+S+U }, /* 11 1 1000: lfsux */
+ { 4, LD+F+U }, /* 11 1 1000: lfsux */
{ 8, LD+F+U }, /* 11 1 1001: lfdux */
- { 4, ST+F+S+U }, /* 11 1 1010: stfsux */
+ { 4, ST+F+U }, /* 11 1 1010: stfsux */
{ 8, ST+F+U }, /* 11 1 1011: stfdux */
INVALID, /* 11 1 1100 */
INVALID, /* 11 1 1101 */
@@ -185,178 +181,203 @@
#define SWAP(a, b) (t = (a), (a) = (b), (b) = t)
+unsigned static inline make_dsisr( unsigned instr )
+{
+ unsigned dsisr;
+
+ /* create a DSISR value from the instruction */
+ dsisr = (instr & 0x03ff0000) >> 16; /* bits 6:15 --> 22:31 */
+
+ if ( IS_XFORM(instr) ) {
+ dsisr |= (instr & 0x00000006) << 14; /* bits 29:30 --> 15:16 */
+ dsisr |= (instr & 0x00000040) << 8; /* bit 25 --> 17 */
+ dsisr |= (instr & 0x00000780) << 3; /* bits 21:24 --> 18:21 */
+ }
+ else {
+ dsisr |= (instr & 0x04000000) >> 12; /* bit 5 --> 17 */
+ dsisr |= (instr & 0x78000000) >> 17; /* bits 1: 4 --> 18:21 */
+ if ( IS_DSFORM(instr) ) {
+ dsisr |= (instr & 0x00000003) << 18; /* bits 30:31 --> 12:13 */
+ }
+ }
+
+ return dsisr;
+}
+
int
fix_alignment(struct pt_regs *regs)
{
- int instr, nb, flags;
- int opcode, f1, f2, f3;
- int i, t;
- int reg, areg;
- unsigned char *addr;
+ unsigned int instr, nb, flags;
+ int t;
+ unsigned long reg, areg;
+ unsigned long i;
+ int ret;
+ unsigned dsisr;
+ unsigned char *addr, *p;
+ unsigned long *lp;
union {
- int l;
long ll;
- float f;
- double d;
+ double dd;
unsigned char v[8];
+ struct {
+ unsigned hi32;
+ int low32;
+ } x32;
+ struct {
+ unsigned char hi48[6];
+ short low16;
+ } x16;
} data;
- if (__is_processor(PV_POWER4)) {
- /*
- * The POWER4 has a DSISR register but doesn't set it on
- * an alignment fault. -- paulus
- */
-
- instr = *((unsigned int *)regs->nip);
- opcode = OPCD(instr);
- reg = RS(instr);
- areg = RA(instr);
-
- if (IS_DFORM(opcode)) {
- f1 = 0;
- f2 = (instr & 0x04000000) >> 26;
- f3 = (instr & 0x78000000) >> 27;
- } else {
- f1 = (instr & 0x00000006) >> 1;
- f2 = (instr & 0x00000040) >> 6;
- f3 = (instr & 0x00000780) >> 7;
- }
-
- instr = ((f1 << 5) | (f2 << 4) | f3);
- } else {
- reg = (regs->dsisr >> 5) & 0x1f; /* source/dest register */
- areg = regs->dsisr & 0x1f; /* register to update */
- instr = (regs->dsisr >> 10) & 0x7f;
- instr |= (regs->dsisr >> 13) & 0x60;
- }
+ /*
+ * Return 1 on success
+ * Return 0 if unable to handle the interrupt
+ * Return -EFAULT if data address is bad
+ */
+
+ dsisr = regs->dsisr;
+
+ /* Power4 doesn't set DSISR for an alignment interrupt */
+ if (__is_processor(PV_POWER4))
+ dsisr = make_dsisr( *((unsigned *)regs->nip) );
+
+ /* extract the operation and registers from the dsisr */
+ reg = (dsisr >> 5) & 0x1f; /* source/dest register */
+ areg = dsisr & 0x1f; /* register to update */
+ instr = (dsisr >> 10) & 0x7f;
+ instr |= (dsisr >> 13) & 0x60;
+ /* Lookup the operation in our table */
nb = aligninfo[instr].len;
- if (nb == 0) {
- long *p;
- int i;
-
- if (instr != DCBZ)
- return 0; /* too hard or invalid instruction */
- /*
- * The dcbz (data cache block zero) instruction
- * gives an alignment fault if used on non-cacheable
- * memory. We handle the fault mainly for the
- * case when we are running with the cache disabled
- * for debugging.
- */
- p = (long *) (regs->dar & -L1_CACHE_BYTES);
- for (i = 0; i < L1_CACHE_BYTES / sizeof(long); ++i)
- p[i] = 0;
- return 1;
- }
-
flags = aligninfo[instr].flags;
+
+ /* DAR has the operand effective address */
addr = (unsigned char *)regs->dar;
+ /* A size of 0 indicates an instruction we don't support */
+ /* we also don't support the multiples (lmw, stmw, lmd, stmd) */
+ if ((nb == 0) || (flags & M))
+ return 0; /* too hard or invalid instruction */
+
+ /*
+ * Special handling for dcbz
+ * dcbz may give an alignment exception for accesses to caching inhibited
+ * storage
+ */
+ if (instr == DCBZ)
+ addr = (unsigned char *) ((unsigned long)addr & -L1_CACHE_BYTES);
+
/* Verify the address of the operand */
if (user_mode(regs)) {
if (verify_area((flags & ST? VERIFY_WRITE: VERIFY_READ), addr, nb))
return -EFAULT; /* bad address */
}
+ /* Force the fprs into the save area so we can reference them */
if ((flags & F) && (regs->msr & MSR_FP))
giveup_fpu(current);
- if (flags & M)
- return 0; /* too hard for now */
-
- /* If we read the operand, copy it in */
+
+ /* If we are loading, get the data from user space */
if (flags & LD) {
- if (nb == 2) {
- data.v[0] = data.v[1] = 0;
- if (__get_user(data.v[2], addr)
- || __get_user(data.v[3], addr+1))
+ data.ll = 0;
+ ret = 0;
+ p = addr;
+ switch (nb) {
+ case 8:
+ ret |= __get_user(data.v[0], p++);
+ ret |= __get_user(data.v[1], p++);
+ ret |= __get_user(data.v[2], p++);
+ ret |= __get_user(data.v[3], p++);
+ case 4:
+ ret |= __get_user(data.v[4], p++);
+ ret |= __get_user(data.v[5], p++);
+ case 2:
+ ret |= __get_user(data.v[6], p++);
+ ret |= __get_user(data.v[7], p++);
+ if (ret)
return -EFAULT;
- } else {
- for (i = 0; i < nb; ++i)
- if (__get_user(data.v[i], addr+i))
- return -EFAULT;
}
}
- /* Unfortunately D (== 0x100) doesn't fit in the aligninfo[n].flags
- field. So synthesize it here. */
- if ((flags & F) == 0 && nb == 8)
- flags |= D;
-
- switch (flags & ~U) {
- case LD+SE:
- if (data.v[2] >= 0x80)
- data.v[0] = data.v[1] = -1;
- /* fall through */
- case LD:
- regs->gpr[reg] = data.l;
- break;
- case LD+D:
- regs->gpr[reg] = data.ll;
- break;
- case LD+S:
- if (nb == 2) {
- SWAP(data.v[2], data.v[3]);
- } else {
- SWAP(data.v[0], data.v[3]);
- SWAP(data.v[1], data.v[2]);
+
+ /* If we are storing, get the data from the saved gpr or fpr */
+ if (flags & ST) {
+ if (flags & F) {
+ if (nb == 4) {
+ /* Doing stfs, have to convert to single */
+ enable_kernel_fp();
+ cvt_df(¤t->thread.fpr[reg], (float *)&data.v[4], ¤t->thread.fpscr);
+ }
+ else
+ data.dd = current->thread.fpr[reg];
}
- regs->gpr[reg] = data.l;
- break;
- case ST:
- data.l = regs->gpr[reg];
- break;
- case ST+D:
- data.ll = regs->gpr[reg];
- break;
- case ST+S:
- data.l = regs->gpr[reg];
- if (nb == 2) {
- SWAP(data.v[2], data.v[3]);
- } else {
- SWAP(data.v[0], data.v[3]);
- SWAP(data.v[1], data.v[2]);
+ else
+ data.ll = regs->gpr[reg];
+ }
+
+ /* Swap bytes as needed */
+ if (flags & SW) {
+ if (nb == 2)
+ SWAP(data.v[6], data.v[7]);
+ else { /* nb must be 4 */
+ SWAP(data.v[4], data.v[7]);
+ SWAP(data.v[5], data.v[6]);
}
- break;
- case LD+F:
- current->thread.fpr[reg] = data.d;
- break;
- case ST+F:
- data.d = current->thread.fpr[reg];
- break;
- /* these require some floating point conversions... */
- /* we'd like to use the assignment, but we have to compile
- * the kernel with -msoft-float so it doesn't use the
- * fp regs for copying 8-byte objects. */
- case LD+F+S:
- enable_kernel_fp();
- cvt_fd(&data.f, ¤t->thread.fpr[reg], ¤t->thread.fpscr);
- /* current->thread.fpr[reg] = data.f; */
- break;
- case ST+F+S:
- enable_kernel_fp();
- cvt_df(¤t->thread.fpr[reg], &data.f, ¤t->thread.fpscr);
- /* data.f = current->thread.fpr[reg]; */
- break;
- default:
- printk("align: can't handle flags=%x\n", flags);
- return 0;
}
-
+
+ /* Sign extend as needed */
+ if (flags & SE) {
+ if ( nb == 2 )
+ data.ll = data.x16.low16;
+ else /* nb must be 4 */
+ data.ll = data.x32.low32;
+ }
+
+ /* If we are loading, move the data to the gpr or fpr */
+ if (flags & LD) {
+ if (flags & F) {
+ if (nb == 4) {
+ /* Doing lfs, have to convert to double */
+ enable_kernel_fp();
+ cvt_fd((float *)&data.v[4], ¤t->thread.fpr[reg], ¤t->thread.fpscr);
+ }
+ else
+ current->thread.fpr[reg] = data.dd;
+ }
+ else
+ regs->gpr[reg] = data.ll;
+ }
+
+ /* If we are storing, copy the data to the user */
if (flags & ST) {
- if (nb == 2) {
- if (__put_user(data.v[2], addr)
- || __put_user(data.v[3], addr+1))
- return -EFAULT;
- } else {
- for (i = 0; i < nb; ++i)
- if (__put_user(data.v[i], addr+i))
- return -EFAULT;
+ ret = 0;
+ p = addr;
+ switch (nb) {
+ case 128: /* Special case - must be dcbz */
+ lp = (unsigned long *)p;
+ for (i = 0; i < L1_CACHE_BYTES / sizeof(long); ++i)
+ ret |= __put_user(0, lp++);
+ break;
+ case 8:
+ ret |= __put_user(data.v[0], p++);
+ ret |= __put_user(data.v[1], p++);
+ ret |= __put_user(data.v[2], p++);
+ ret |= __put_user(data.v[3], p++);
+ case 4:
+ ret |= __put_user(data.v[4], p++);
+ ret |= __put_user(data.v[5], p++);
+ case 2:
+ ret |= __put_user(data.v[6], p++);
+ ret |= __put_user(data.v[7], p++);
}
+ if (ret)
+ return -EFAULT;
}
-
+
+ /* Update RA as needed */
if (flags & U) {
regs->gpr[areg] = regs->dar;
}
return 1;
}
+
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/chrp_setup.c linuxppc64_2_4/arch/ppc64/kernel/chrp_setup.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/chrp_setup.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/chrp_setup.c Thu Apr 18 09:38:23 2002
@@ -57,7 +57,7 @@
#include
#include
#include
-#include
+#include
#include
#include "local_irq.h"
@@ -67,7 +67,6 @@
#include
extern volatile unsigned char *chrp_int_ack_special;
-extern struct Naca *naca;
void chrp_setup_pci_ptrs(void);
void chrp_progress(char *, unsigned short);
@@ -91,6 +90,9 @@
extern void pSeries_get_rtc_time(struct rtc_time *rtc_time);
extern int pSeries_set_rtc_time(struct rtc_time *rtc_time);
void pSeries_calibrate_decr(void);
+static void fwnmi_init(void);
+extern void SystemReset_FWNMI(void), MachineCheck_FWNMI(void); /* from head.S */
+int fwnmi_active; /* TRUE if an FWNMI handler is present */
kdev_t boot_dev;
unsigned long virtPython0Facilities = 0; // python0 facility area (memory mapped io) (64-bit format) VIRTUAL address.
@@ -153,6 +155,8 @@
printk("Boot arguments: %s\n", cmd_line);
+ fwnmi_init();
+
/* Find and initialize PCI host bridges */
/* iSeries needs to be done much later. */
#ifndef CONFIG_PPC_ISERIES
@@ -190,6 +194,23 @@
ppc_md.progress(UTS_RELEASE, 0x7777);
}
+/* Initialize firmware assisted non-maskable interrupts if
+ * the firmware supports this feature.
+ *
+ */
+static void __init fwnmi_init(void)
+{
+ long ret;
+ int ibm_nmi_register = rtas_token("ibm,nmi-register");
+ if (ibm_nmi_register == RTAS_UNKNOWN_SERVICE)
+ return;
+ ret = rtas_call(ibm_nmi_register, 2, 1, NULL,
+ __pa((unsigned long)SystemReset_FWNMI),
+ __pa((unsigned long)MachineCheck_FWNMI));
+ if (ret == 0)
+ fwnmi_active = 1;
+}
+
/* Early initialization. Relocation is on but do not reference unbolted pages */
void __init pSeries_init_early(void)
@@ -230,7 +251,7 @@
#endif /* CONFIG_BLK_DEV_INITRD */
#endif
- ppc_md.ppc_machine = _machine;
+ ppc_md.ppc_machine = naca->platform;
ppc_md.setup_arch = chrp_setup_arch;
ppc_md.setup_residual = NULL;
@@ -296,7 +317,7 @@
if (hex)
udbg_printf(" %s\n", s);
- if (!rtas.base || (_machine != _MACH_pSeries))
+ if (!rtas.base || (naca->platform != PLATFORM_PSERIES))
return;
if (max_width == 0) {
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/eeh.c linuxppc64_2_4/arch/ppc64/kernel/eeh.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/eeh.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/eeh.c Thu Apr 18 09:38:09 2002
@@ -26,9 +26,9 @@
#include
#include
#include
-#include
+#include
#include
-#include
+#include
#include
#include "pci.h"
@@ -36,7 +36,6 @@
#define BUID_LO(buid) ((buid) & 0xffffffff)
#define CONFIG_ADDR(busno, devfn) (((((busno) & 0xff) << 8) | ((devfn) & 0xf8)) << 8)
-unsigned long eeh_total_mmio_reads;
unsigned long eeh_total_mmio_ffs;
unsigned long eeh_false_positives;
/* RTAS tokens */
@@ -44,11 +43,11 @@
static int ibm_set_slot_reset;
static int ibm_read_slot_reset_state;
-static int eeh_implemented;
+int eeh_implemented;
#define EEH_MAX_OPTS 4096
static char *eeh_opts;
static int eeh_opts_last;
-static int eeh_check_opts_config(struct pci_dev *dev);
+static int eeh_check_opts_config(struct pci_dev *dev, int default_state);
unsigned long eeh_token(unsigned long phb, unsigned long bus, unsigned long devfn, unsigned long offset)
@@ -86,33 +85,58 @@
panic("EEH: checking token %p phb index of %ld is greater than max of %d\n", token, phbidx, global_phb_number-1);
}
phb = phbtab[phbidx];
- eeh_false_positives++;
ret = rtas_call(ibm_read_slot_reset_state, 3, 3, rets,
config_addr, BUID_HI(phb->buid), BUID_LO(phb->buid));
- if (ret == 0 && rets[1] == 1 && rets[2] != 0) {
+ if (ret == 0 && rets[1] == 1 && rets[0] >= 2) {
struct pci_dev *dev;
int bus = ((unsigned long)token >> 40) & 0xffff; /* include PHB# in bus */
int devfn = (config_addr >> 8) & 0xff;
dev = pci_find_slot(bus, devfn);
- if (dev)
+ if (dev) {
+ udbg_printf("EEH: MMIO failure (%ld) on device:\n %s %s\n",
+ rets[0], dev->slot_name, dev->name);
+ printk("EEH: MMIO failure (%ld) on device:\n %s %s\n",
+ rets[0], dev->slot_name, dev->name);
+ PPCDBG_ENTER_DEBUGGER();
panic("EEH: MMIO failure (%ld) on device:\n %s %s\n",
- rets[2], dev->slot_name, dev->name);
- else
- panic("EEH: MMIO failure (%ld) on device buid %lx, config_addr %lx\n", rets[2], phb->buid, config_addr);
+ rets[0], dev->slot_name, dev->name);
+ } else {
+ udbg_printf("EEH: MMIO failure (%ld) on device buid %lx, config_addr %lx\n", rets[0], phb->buid, config_addr);
+ printk("EEH: MMIO failure (%ld) on device buid %lx, config_addr %lx\n", rets[0], phb->buid, config_addr);
+ PPCDBG_ENTER_DEBUGGER();
+ panic("EEH: MMIO failure (%ld) on device buid %lx, config_addr %lx\n", rets[0], phb->buid, config_addr);
+ }
}
+ eeh_false_positives++;
return val; /* good case */
}
void eeh_init(void) {
+ extern char cmd_line[]; /* Very early cmd line parse. Cheap, but works. */
+ char *eeh_force_off = strstr(cmd_line, "eeh-force-off");
+ char *eeh_force_on = strstr(cmd_line, "eeh-force-on");
+
ibm_set_eeh_option = rtas_token("ibm,set-eeh-option");
ibm_set_slot_reset = rtas_token("ibm,set-slot-reset");
ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state");
- if (ibm_set_eeh_option != RTAS_UNKNOWN_SERVICE) {
- printk("PCI Enhanced I/O Error Handling Enabled\n");
+ if (ibm_set_eeh_option != RTAS_UNKNOWN_SERVICE && naca->platform == PLATFORM_PSERIES_LPAR)
eeh_implemented = 1;
+
+ if (eeh_force_off > eeh_force_on) {
+ /* User is forcing EEH off. Be noisy if it is implemented. */
+ if (eeh_implemented)
+ printk("EEH: WARNING: PCI Enhanced I/O Error Handling is user disabled\n");
+ eeh_implemented = 0;
+ return;
}
+
+ if (eeh_force_on > eeh_force_off)
+ eeh_implemented = 1; /* User is forcing it on. */
+
+ if (eeh_implemented)
+ printk("EEH: PCI Enhanced I/O Error Handling Enabled\n");
}
@@ -124,27 +148,35 @@
struct device_node *dn = pci_device_to_OF_node(dev);
struct pci_controller *phb = PCI_GET_PHB_PTR(dev);
unsigned long ret, rets[2];
+ int eeh_capable;
+ int default_state = 1; /* default enable EEH if we can. */
- if (dn == NULL || phb == NULL || phb->buid == 0 || !eeh_implemented)
+ if (dn == NULL || phb == NULL || !eeh_implemented)
return 0;
- /* Hack: turn off eeh for display class devices.
+ /* Hack: turn off eeh for display class devices by default.
* This fixes matrox accel framebuffer.
*/
if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY)
- return 0;
+ default_state = 0;
- if (!eeh_check_opts_config(dev))
+ /* Ignore known PHBs and EADs bridges */
+ if (dev->vendor == PCI_VENDOR_ID_IBM &&
+ (dev->device == 0x0102 || dev->device == 0x008b))
+ default_state = 0;
+
+ if (!eeh_check_opts_config(dev, default_state)) {
+ if (default_state)
+ printk("EEH: %s %s user requested to run without EEH.\n", dev->slot_name, dev->name);
return 0;
+ }
ret = rtas_call(ibm_read_slot_reset_state, 3, 3, rets,
CONFIG_ADDR(dn->busno, dn->devfn),
BUID_HI(phb->buid), BUID_LO(phb->buid));
- if (ret == 0 && rets[1] == 1) {
- printk("EEH: %s %s is EEH capable.\n", dev->slot_name, dev->name);
- return 1;
- }
- return 0;
+ eeh_capable = (ret == 0 && rets[1] == 1);
+ printk("EEH: %s %s is%s EEH capable.\n", dev->slot_name, dev->name, eeh_capable ? "" : " not");
+ return eeh_capable;
}
int eeh_set_option(struct pci_dev *dev, int option)
@@ -166,41 +198,41 @@
{
int len;
len = sprintf(page, "eeh_false_positives=%ld\n"
- "eeh_total_mmio_ffs=%ld\n"
- "eeh_total_mmio_reads=%ld\n",
- eeh_false_positives, eeh_total_mmio_ffs, eeh_total_mmio_reads);
+ "eeh_total_mmio_ffs=%ld\n",
+ eeh_false_positives, eeh_total_mmio_ffs);
return len;
}
/* Implementation of /proc/ppc64/eeh
* For now it is one file showing false positives.
*/
-void eeh_init_proc(struct proc_dir_entry *top)
+static int __init eeh_init_proc(void)
{
- struct proc_dir_entry *ent = create_proc_entry("eeh", S_IRUGO, top);
+ struct proc_dir_entry *ent = create_proc_entry("ppc64/eeh", S_IRUGO, 0);
if (ent) {
ent->nlink = 1;
ent->data = NULL;
ent->read_proc = (void *)eeh_proc_falsepositive_read;
}
+ return 0;
}
/*
* Test if "dev" should be configured on or off.
- * This processes the options literally from right to left.
+ * This processes the options literally from left to right.
* This lets the user specify stupid combinations of options,
* but at least the result should be very predictable.
*/
-static int eeh_check_opts_config(struct pci_dev *dev)
+static int eeh_check_opts_config(struct pci_dev *dev, int default_state)
{
struct device_node *dn = pci_device_to_OF_node(dev);
struct pci_controller *phb = PCI_GET_PHB_PTR(dev);
char devname[32], classname[32], phbname[32];
char *strs[8], *s;
int nstrs, i;
- int ret = 0;
+ int ret = default_state;
- if (dn == NULL || phb == NULL || phb->buid == 0 || !eeh_implemented)
+ if (dn == NULL || phb == NULL)
return 0;
/* Build list of strings to match */
nstrs = 0;
@@ -221,7 +253,7 @@
for (s = eeh_opts; s && (s < (eeh_opts + eeh_opts_last)); s += strlen(s)+1) {
for (i = 0; i < nstrs; i++) {
if (strcasecmp(strs[i], s+1) == 0) {
- ret = (strs[0] == '+') ? 1 : 0;
+ ret = (strs[i][0] == '+') ? 1 : 0;
}
}
}
@@ -234,7 +266,7 @@
* eeh-off=loc1,loc2,loc3...
*
* and this option can be repeated so
- * eeh-off=loc1,loc2 eeh=loc3
+ * eeh-off=loc1,loc2 eeh-off=loc3
* is the same as eeh-off=loc1,loc2,loc3
*
* loc is an IBM location code that can be found in a manual or
@@ -285,7 +317,6 @@
curend = cur + strlen(cur);
if (*cur) {
int curlen = curend-cur;
- char *sym = eeh_opts+eeh_opts_last;
if (eeh_opts_last + curlen > EEH_MAX_OPTS-2) {
printk("EEH: sorry...too many eeh cmd line options\n");
return 1;
@@ -308,6 +339,6 @@
return eeh_parm(str, 1);
}
-
+__initcall(eeh_init_proc);
__setup("eeh-off", eehoff_parm);
__setup("eeh-on", eehon_parm);
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/entry.S linuxppc64_2_4/arch/ppc64/kernel/entry.S
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/entry.S Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/entry.S Mon Apr 15 21:05:04 2002
@@ -1,7 +1,5 @@
/*
- * arch/ppc/kernel/entry.S
- *
- *
+ * arch/ppc64/kernel/entry.S
*
* PowerPC version
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
@@ -20,10 +18,8 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
- *
*/
-
#include "ppc_asm.h"
#include
#include
@@ -246,8 +242,8 @@
* SAVE_REGS macro), you'll have to change the fork code also.
*
* The code which creates the new task context is in 'copy_thread'
- * in arch/ppc/kernel/process.c
- */
+ * in arch/ppc64/kernel/process.c
+ */
_GLOBAL(_switch)
stdu r1,-INT_FRAME_SIZE(r1)
ld r6,0(r1)
@@ -523,7 +519,6 @@
mtlr r0
blr /* return to caller */
-
_GLOBAL(enter_prom)
mflr r0
std r0,16(r1)
@@ -613,4 +608,3 @@
mtlr r0
blr /* return to caller */
-
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/head.S linuxppc64_2_4/arch/ppc64/kernel/head.S
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/head.S Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/head.S Thu Apr 18 10:33:27 2002
@@ -1,8 +1,6 @@
/*
* arch/ppc64/kernel/head.S
*
- *
- *
* PowerPC version
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
*
@@ -23,7 +21,6 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
- *
*/
#define SECONDARY_PROCESSORS
@@ -34,12 +31,19 @@
#include
#include
#include
+// #include
#ifdef CONFIG_PPC_ISERIES
#define DO_SOFT_DISABLE
#endif
/*
+ * hcall interface to pSeries LPAR
+ */
+#define HSC .long 0x44000022
+#define H_SET_ASR 0x30
+
+/*
* We layout physical memory as follows:
* 0x0000 - 0x00ff : Secondary processor spin code
* 0x0100 - 0x2fff : pSeries Interrupt prologs
@@ -47,7 +51,6 @@
* 0x4000 - 0x4fff : NACA
* 0x5000 - 0x5fff : Initial segment table
* 0x6000 : iSeries and common interrupt prologs
- *
*/
/*
@@ -58,7 +61,7 @@
* SPRG0 reserved for hypervisor
* SPRG1 temp - used to save gpr
* SPRG2 temp - used to save gpr
- * SPRG3 virt addr of Paca
+ * SPRG3 virt addr of paca
*/
/*
@@ -167,14 +170,18 @@
#define EX_R23 40
#define EX_DAR 48
#define EX_DSISR 56
+#define EX_CCR 60
+#define EX_TRAP 60
-#define EXCEPTION_PROLOG_PSERIES(label) \
+#define EXCEPTION_PROLOG_PSERIES(n,label) \
mtspr SPRG2,r20; /* use SPRG2 as scratch reg */ \
mtspr SPRG1,r21; /* save r21 */ \
- mfspr r20,SPRG3; /* get Paca virt addr */ \
+ mfspr r20,SPRG3; /* get paca virt addr */ \
ld r21,PACAEXCSP(r20); /* get exception stack ptr */ \
addi r21,r21,EXC_FRAME_SIZE; /* make exception frame */ \
std r22,EX_R22(r21); /* Save r22 in exc. frame */ \
+ li r22,n; /* Save the ex # in exc. frame*/ \
+ stw r22,EX_TRAP(r21); /* */ \
std r23,EX_R23(r21); /* Save r23 in exc. frame */ \
mfspr r22,SRR0; /* EA of interrupted instr */ \
std r22,EX_SRR0(r21); /* Save SRR0 in exc. frame */ \
@@ -196,19 +203,21 @@
* This is the start of the interrupt handlers for i_series
* This code runs with relocation on.
*/
-#define EXCEPTION_PROLOG_ISERIES \
- mtspr SPRG2,r20; /* use SPRG2 as scratch reg */\
- mtspr SPRG1,r21; /* save r21 */\
- mfspr r20,SPRG3; /* get Paca */\
- ld r21,PACAEXCSP(r20); /* get exception stack ptr */\
- addi r21,r21,EXC_FRAME_SIZE; /* make exception frame */\
- std r22,EX_R22(r21); /* save r22 on exception frame */\
- std r23,EX_R23(r21); /* Save r23 in exc. frame */\
- ld r22,LPPACA+LPPACASRR0(r20); /* Get SRR0 from ItLpPaca */\
- std r22,EX_SRR0(r21); /* save SRR0 in exc. frame */\
- ld r23,LPPACA+LPPACASRR1(r20); /* Get SRR1 from ItLpPaca */\
- std r23,EX_SRR1(r21); /* save SRR1 in exc. frame */\
- mfcr r23; /* save CR in r23 */
+#define EXCEPTION_PROLOG_ISERIES(n) \
+ mtspr SPRG2,r20; /* use SPRG2 as scratch reg */ \
+ mtspr SPRG1,r21; /* save r21 */ \
+ mfspr r20,SPRG3; /* get Paca */ \
+ ld r21,PACAEXCSP(r20); /* get exception stack ptr */ \
+ addi r21,r21,EXC_FRAME_SIZE; /* make exception frame */ \
+ std r22,EX_R22(r21); /* save r22 on exception frame */ \
+ li r22,n; /* Save the ex # in exc. frame */ \
+ stw r22,EX_TRAP(r21); /* */ \
+ std r23,EX_R23(r21); /* Save r23 in exc. frame */ \
+ ld r22,LPPACA+LPPACASRR0(r20); /* Get SRR0 from ItLpPaca */ \
+ std r22,EX_SRR0(r21); /* save SRR0 in exc. frame */ \
+ ld r23,LPPACA+LPPACASRR1(r20); /* Get SRR1 from ItLpPaca */ \
+ std r23,EX_SRR1(r21); /* save SRR1 in exc. frame */ \
+ mfcr r23; /* save CR in r23 */
/*
* The common exception prolog is used for all except a few exceptions
@@ -219,54 +228,54 @@
* On entry r20 points to the paca and r21 points to the exception
* frame on entry, r23 contains the saved CR, and relocation is on.
*/
-#define EXCEPTION_PROLOG_COMMON \
- mfspr r22,SPRG2; /* Save r20 in exc. frame */ \
- std r22,EX_R20(r21); \
- mfspr r22,SPRG1; /* Save r21 in exc. frame */ \
- std r22,EX_R21(r21); \
- mfspr r22,DAR; /* Save DAR in exc. frame */ \
- std r22,EX_DAR(r21); \
- std r21,PACAEXCSP(r20); /* update exception stack ptr */ \
- /* iff no protection flt */ \
- mfspr r22,DSISR; /* Save DSISR in exc. frame */ \
- std r22,EX_DSISR(r21); \
- ld r22,EX_SRR1(r21); /* Get SRR1 from exc. frame */ \
- andi. r22,r22,MSR_PR; /* Set CR for later branch */ \
- mr r22,r1; /* Save r1 */ \
- subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \
- beq- 1f; \
- ld r1,PACAKSAVE(r20); /* kernel stack to use */ \
-1: std r22,GPR1(r1); /* save r1 in stackframe */ \
- std r22,0(r1); /* make stack chain pointer */ \
- std r23,_CCR(r1); /* save CR in stackframe */ \
- ld r22,EX_R20(r21); /* move r20 to stackframe */ \
- std r22,GPR20(r1); \
- ld r23,EX_R21(r21); /* move r21 to stackframe */ \
- std r23,GPR21(r1); \
- ld r22,EX_R22(r21); /* move r22 to stackframe */ \
- std r22,GPR22(r1); \
- ld r23,EX_R23(r21); /* move r23 to stackframe */ \
- std r23,GPR23(r1); \
- mflr r22; /* save LR in stackframe */ \
- std r22,_LINK(r1); \
- mfctr r23; /* save CTR in stackframe */ \
- std r23,_CTR(r1); \
- mfspr r22,XER; /* save XER in stackframe */ \
- std r22,_XER(r1); \
- ld r23,EX_DAR(r21); /* move DAR to stackframe */ \
- std r23,_DAR(r1); \
- ld r22,EX_DSISR(r21); /* move DSISR to stackframe */ \
- std r22,_DSISR(r1); \
- lbz r22,PACAPROCENABLED(r20); \
- std r22,SOFTE(r1); \
- ld r22,EX_SRR0(r21); /* get SRR0 from exc. frame */ \
- ld r23,EX_SRR1(r21); /* get SRR1 from exc. frame */ \
- addi r21,r21,-EXC_FRAME_SIZE;/* pop off exception frame */ \
- std r21,PACAEXCSP(r20); \
- SAVE_GPR(0, r1); /* save r0 in stackframe */ \
+#define EXCEPTION_PROLOG_COMMON \
+ mfspr r22,SPRG2; /* Save r20 in exc. frame */ \
+ std r22,EX_R20(r21); \
+ mfspr r22,SPRG1; /* Save r21 in exc. frame */ \
+ std r22,EX_R21(r21); \
+ mfspr r22,DAR; /* Save DAR in exc. frame */ \
+ std r22,EX_DAR(r21); \
+ std r21,PACAEXCSP(r20); /* update exception stack ptr */ \
+ /* iff no protection flt */ \
+ mfspr r22,DSISR; /* Save DSISR in exc. frame */ \
+ stw r22,EX_DSISR(r21); \
+ ld r22,EX_SRR1(r21); /* Get SRR1 from exc. frame */ \
+ andi. r22,r22,MSR_PR; /* Set CR for later branch */ \
+ mr r22,r1; /* Save r1 */ \
+ subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \
+ beq- 1f; \
+ ld r1,PACAKSAVE(r20); /* kernel stack to use */ \
+1: std r22,GPR1(r1); /* save r1 in stackframe */ \
+ std r22,0(r1); /* make stack chain pointer */ \
+ std r23,_CCR(r1); /* save CR in stackframe */ \
+ ld r22,EX_R20(r21); /* move r20 to stackframe */ \
+ std r22,GPR20(r1); \
+ ld r23,EX_R21(r21); /* move r21 to stackframe */ \
+ std r23,GPR21(r1); \
+ ld r22,EX_R22(r21); /* move r22 to stackframe */ \
+ std r22,GPR22(r1); \
+ ld r23,EX_R23(r21); /* move r23 to stackframe */ \
+ std r23,GPR23(r1); \
+ mflr r22; /* save LR in stackframe */ \
+ std r22,_LINK(r1); \
+ mfctr r23; /* save CTR in stackframe */ \
+ std r23,_CTR(r1); \
+ mfspr r22,XER; /* save XER in stackframe */ \
+ std r22,_XER(r1); \
+ ld r23,EX_DAR(r21); /* move DAR to stackframe */ \
+ std r23,_DAR(r1); \
+ lwz r22,EX_DSISR(r21); /* move DSISR to stackframe */ \
+ std r22,_DSISR(r1); \
+ lbz r22,PACAPROCENABLED(r20); \
+ std r22,SOFTE(r1); \
+ ld r22,EX_SRR0(r21); /* get SRR0 from exc. frame */ \
+ ld r23,EX_SRR1(r21); /* get SRR1 from exc. frame */ \
+ addi r21,r21,-EXC_FRAME_SIZE;/* pop off exception frame */ \
+ std r21,PACAEXCSP(r20); \
+ SAVE_GPR(0, r1); /* save r0 in stackframe */ \
SAVE_8GPRS(2, r1); /* save r2 - r13 in stackframe */ \
- SAVE_4GPRS(10, r1); \
- ld r2,PACATOC(r20); \
+ SAVE_4GPRS(10, r1); \
+ ld r2,PACATOC(r20); \
ld r13,PACACURRENT(r20)
/*
@@ -281,18 +290,18 @@
. = n; \
.globl label##_Pseries; \
label##_Pseries: \
- EXCEPTION_PROLOG_PSERIES( label##_common )
+ EXCEPTION_PROLOG_PSERIES( n, label##_common )
-#define STD_EXCEPTION_ISERIES( label ) \
+#define STD_EXCEPTION_ISERIES( n, label ) \
.globl label##_Iseries; \
label##_Iseries: \
- EXCEPTION_PROLOG_ISERIES; \
+ EXCEPTION_PROLOG_ISERIES( n ); \
b label##_common
-#define MASKABLE_EXCEPTION_ISERIES( label ) \
+#define MASKABLE_EXCEPTION_ISERIES( n, label ) \
.globl label##_Iseries; \
label##_Iseries: \
- EXCEPTION_PROLOG_ISERIES; \
+ EXCEPTION_PROLOG_ISERIES( n ); \
lbz r22,PACAPROFENABLED(r20); \
cmpi 0,r22,0; \
bne- label##_Iseries_profile; \
@@ -348,26 +357,26 @@
STD_EXCEPTION_PSERIES( 0xf00, PerformanceMonitor )
STD_EXCEPTION_PSERIES( 0x1300, InstructionBreakpoint )
+ /* Space for the naca. Architected to be located at real address
+ * 0x4000. Various tools rely on this location being fixed.
+ * The first dword of the Naca is required by iSeries LPAR to
+ * point to itVpdAreas. On pSeries native, this value is not used.
+ */
. = 0x4000
.globl __end_interupts
.globl __start_naca
__end_interupts:
__start_naca:
- /* Save space for naca.
- * The first dword of the Naca is required by iSeries LPAR to
- * point to itVpdAreas. On pSeries native, this value is not used.
- */
.llong itVpdAreas
.llong 0x0
.llong 0x0
- .llong xPaca
+ .llong paca
/*
* Space for the initial segment table
* For LPAR, the hypervisor must fill in at least one entry
* before we get control (with relocate on)
*/
-
. = 0x5000
.globl __end_naca
.globl __start_stab
@@ -406,26 +415,26 @@
/*** ISeries-LPAR interrupt handlers ***/
- STD_EXCEPTION_ISERIES( MachineCheck )
- STD_EXCEPTION_ISERIES( DataAccess )
- STD_EXCEPTION_ISERIES( DataAccessSLB )
- STD_EXCEPTION_ISERIES( InstructionAccess )
- STD_EXCEPTION_ISERIES( InstructionAccessSLB )
- MASKABLE_EXCEPTION_ISERIES( HardwareInterrupt )
- STD_EXCEPTION_ISERIES( Alignment )
- STD_EXCEPTION_ISERIES( ProgramCheck )
- STD_EXCEPTION_ISERIES( FPUnavailable )
- MASKABLE_EXCEPTION_ISERIES( Decrementer )
- STD_EXCEPTION_ISERIES( Trap_0a )
- STD_EXCEPTION_ISERIES( Trap_0b )
- STD_EXCEPTION_ISERIES( SystemCall )
- STD_EXCEPTION_ISERIES( SingleStep )
- STD_EXCEPTION_ISERIES( Trap_0e )
- STD_EXCEPTION_ISERIES( PerformanceMonitor )
+ STD_EXCEPTION_ISERIES( 0x200, MachineCheck )
+ STD_EXCEPTION_ISERIES( 0x300, DataAccess )
+ STD_EXCEPTION_ISERIES( 0x380, DataAccessSLB )
+ STD_EXCEPTION_ISERIES( 0x400, InstructionAccess )
+ STD_EXCEPTION_ISERIES( 0x480, InstructionAccessSLB )
+ MASKABLE_EXCEPTION_ISERIES( 0x500, HardwareInterrupt )
+ STD_EXCEPTION_ISERIES( 0x600, Alignment )
+ STD_EXCEPTION_ISERIES( 0x700, ProgramCheck )
+ STD_EXCEPTION_ISERIES( 0x800, FPUnavailable )
+ MASKABLE_EXCEPTION_ISERIES( 0x900, Decrementer )
+ STD_EXCEPTION_ISERIES( 0xa00, Trap_0a )
+ STD_EXCEPTION_ISERIES( 0xb00, Trap_0b )
+ STD_EXCEPTION_ISERIES( 0xc00, SystemCall )
+ STD_EXCEPTION_ISERIES( 0xd00, SingleStep )
+ STD_EXCEPTION_ISERIES( 0xe00, Trap_0e )
+ STD_EXCEPTION_ISERIES( 0xf00, PerformanceMonitor )
.globl SystemReset_Iseries
SystemReset_Iseries:
- mfspr 25,SPRG3 /* Get Paca address */
+ mfspr 25,SPRG3 /* Get paca address */
lhz r24,PACAPACAINDEX(r25) /* Get processor # */
cmpi 0,r24,0 /* Are we processor 0? */
beq .__start_initialization_iSeries /* Start up the first processor */
@@ -493,6 +502,24 @@
mfspr r20,SPRG2
rfid
+/*
+ * Data area reserved for FWNMI option.
+ */
+ .= 0x7000
+ .globl fwnmi_data_area
+fwnmi_data_area:
+
+/*
+ * Vectors for the FWNMI option. Share common code.
+ */
+ . = 0x8000
+ .globl SystemReset_FWNMI
+SystemReset_FWNMI:
+ EXCEPTION_PROLOG_PSERIES(0x100, SystemReset_common)
+ .globl MachineCheck_FWNMI
+MachineCheck_FWNMI:
+ EXCEPTION_PROLOG_PSERIES(0x200, MachineCheck_common)
+
/*** Common interrupt handlers ***/
STD_EXCEPTION_COMMON( 0x100, SystemReset, .SystemResetException )
@@ -528,7 +555,6 @@
ld r1,GPR1(r1)
rfid
-
/*
* Here r20 points to the PACA, r21 to the exception frame,
* r23 contains the saved CR.
@@ -539,9 +565,10 @@
mfspr r22,DAR
srdi r22,r22,60
cmpi 0,r22,0xc
-
- /* Segment fault on a bolted segment. Go off and map that segment. */
beq .do_stab_bolted
+ cmpi 0,r22,0xb
+ beq .do_stab_bolted
+
stab_bolted_user_return:
EXCEPTION_PROLOG_COMMON
ld r3,_DSISR(r1)
@@ -576,8 +603,8 @@
mfspr r22,DAR
srdi r22,r22,60
cmpi 0,r22,0xc
-
- /* Segment fault on a bolted segment. Go off and map that segment. */
+ beq .do_slb_bolted
+ cmpi 0,r22,0xb
beq .do_slb_bolted
EXCEPTION_PROLOG_COMMON
@@ -663,9 +690,9 @@
/* */
/* The call to do_irq will preserve the value of r14 - r31 */
/* */
- mfspr r20,SPRG3 /* get Paca */
+ mfspr r20,SPRG3 /* get paca */
lbz r21,PACAHRDWINTCOUNT(r20) /* get hardware interrupt cnt */
- cmpi 0,r21,1 /* */
+ cmpi 0,r21,0 /* */
addi r21,r21,1 /* incr hardware interrupt cnt*/
stb r21,PACAHRDWINTCOUNT(r20) /* */
bne 2f /* */
@@ -825,7 +852,7 @@
* We assume we aren't going to take any exceptions during this procedure.
*/
_GLOBAL(do_stab_bolted)
- std r23,EX_DAR(r21) /* save CR in exc. frame */
+ stw r23,EX_CCR(r21) /* save CR in exc. frame */
mfspr r22,DSISR
andis. r22,r22,0x0020
@@ -931,7 +958,7 @@
mfsprg r20,3 /* Load the PACA pointer */
ld r21,PACAEXCSP(r20) /* Get the exception frame pointer */
addi r21,r21,EXC_FRAME_SIZE
- ld r23,EX_DAR(r21) /* get saved CR */
+ lwz r23,EX_CCR(r21) /* get saved CR */
/* note that this is almost identical to maskable_exception_exit */
mtcr r23 /* restore CR */
ld r22,EX_SRR0(r21) /* Get SRR0 from exc. frame */
@@ -952,7 +979,7 @@
* We assume we aren't going to take any exceptions during this procedure.
*/
_GLOBAL(do_slb_bolted)
- std r23,48(r21) /* save CR in exc. frame */
+ stw r23,EX_CCR(r21) /* save CR in exc. frame */
/* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */
mfspr r21,DAR
@@ -1018,7 +1045,7 @@
mfsprg r20,3 /* Load the PACA pointer */
ld r21,PACAEXCSP(r20) /* Get the exception frame pointer */
addi r21,r21,EXC_FRAME_SIZE
- ld r23,EX_DAR(r21) /* get saved CR */
+ lwz r23,EX_CCR(r21) /* get saved CR */
/* note that this is almost identical to maskable_exception_exit */
mtcr r23 /* restore CR */
ld r22,EX_SRR0(r21) /* Get SRR0 from exc. frame */
@@ -1137,7 +1164,7 @@
isync
/* Set up a Paca value for this processor. */
- LOADADDR(r24, xPaca) /* Get base vaddr of Paca array */
+ LOADADDR(r24, paca) /* Get base vaddr of Paca array */
mulli r25,r3,PACA_SIZE /* Calculate vaddr of right Paca */
add r25,r25,r24 /* for this processor. */
@@ -1288,7 +1315,7 @@
/* this includes the code being */
/* executed here. */
- li r0,4f@l /* Jump to the copy of this code */
+ LOADADDR(r0, 4f) /* Jump to the copy of this code */
mtctr r0 /* that we just made */
bctr
@@ -1439,8 +1466,6 @@
#endif /* CONFIG_SMP */
blr
-
-
#ifdef CONFIG_SMP
/*
* This function is called after the master CPU has released the
@@ -1497,7 +1522,17 @@
ori r3,r3,4 /* 0x8000000000000004 */
sc /* HvCall_setASR */
#else
+ /* set the ASR */
+ addi r3,0,0x4000 /* r3 = ptr to naca */
+ lhz r3,PLATFORM(r3) /* r3 = platform flags */
+ cmpldi r3,PLATFORM_PSERIES_LPAR
+ bne 98f
+ li r3,H_SET_ASR /* hcall = H_SET_ASR */
+ HSC /* Invoking hcall */
+ b 99f
+98: /* This is not a hypervisor machine */
mtasr r4 /* set the stab location */
+99:
#endif
li r7,0
mtlr r7
@@ -1552,7 +1587,6 @@
isync
blr
-
/*
* This is where the main kernel code starts.
*/
@@ -1586,7 +1620,7 @@
#ifdef CONFIG_SMP
/* All secondary cpus are now spinning on a common
* spinloop, release them all now so they can start
- * to spin on their individual Paca spinloops.
+ * to spin on their individual paca spinloops.
* For non SMP kernels, the secondary cpus never
* get out of the common spinloop.
*/
@@ -1623,12 +1657,25 @@
/* Get the pointer to the segment table which is used by */
/* stab_initialize */
li r27,0x4000
- ld r6,PACA(r27) /* Get the base Paca pointer */
+ ld r6,PACA(r27) /* Get the base paca pointer */
sub r6,r6,r26 /* convert to physical addr */
mtspr SPRG3,r6 /* PPPBBB: Temp... -Peter */
ld r3,PACASTABREAL(r6)
ori r4,r3,1 /* turn on valid bit */
+
+ /* set the ASR */
+ addi r3,0,0x4000 /* r3 = ptr to naca */
+ lhz r3,PLATFORM(r3) /* r3 = platform flags */
+ cmpldi r3,PLATFORM_PSERIES_LPAR
+ bne 98f
+ li r3,H_SET_ASR /* hcall = H_SET_ASR */
+ HSC /* Invoking hcall */
+ b 99f
+98: /* This is not a hypervisor machine */
mtasr r4 /* set the stab location */
+99:
+ mfspr r6,SPRG3
+ ld r3,PACASTABREAL(r6) /* restore r3 for stab_initialize */
/* Initialize an initial memory mapping and turn on relocation. */
bl .stab_initialize
@@ -1713,10 +1760,7 @@
li r3,0
stb r3,PACAHRDWINTCOUNT(r4)
-
- /*
- * Restore the parms passed in from the bootloader.
- */
+ /* Restore the parms passed in from the bootloader. */
mr r3,r31
mr r4,r30
mr r5,r29
@@ -1831,15 +1875,19 @@
ioremap_dir:
.space 4096
+ .globl bolted_dir
+bolted_dir:
+ .space 4096
+
.globl hardware_int_paca0
hardware_int_paca0:
.space 8*4096
-
-/* 4096 * 31 bytes of storage */
+/* 1 page segment table per cpu (max 48, cpu0 allocated at 0x5000) */
.globl stab_array
stab_array:
- .space 131072
+ .space 4096 * (48 - 1)
+
/*
* This space gets a copy of optional info passed to us by the bootstrap
* Used to pass parameters into the kernel like root=/dev/sda1, etc.
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/htab.c linuxppc64_2_4/arch/ppc64/kernel/htab.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/htab.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/htab.c Thu Apr 18 09:37:52 2002
@@ -37,14 +37,12 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
#include
-#ifdef CONFIG_PPC_EEH
#include
-#endif
/* For iSeries */
#include
@@ -69,7 +67,6 @@
extern unsigned long _SDR1;
extern unsigned long klimit;
-extern struct Naca *naca;
extern unsigned long _ASR;
extern inline void make_ste(unsigned long stab,
@@ -77,7 +74,7 @@
extern char _stext[], _etext[], __start_naca[], __end_stab[];
-static spinlock_t hash_table_lock ____cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
+static spinlock_t hash_table_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
#define PTRRELOC(x) ((typeof(x))((unsigned long)(x) - offset))
#define PTRUNRELOC(x) ((typeof(x))((unsigned long)(x) + offset))
@@ -117,7 +114,7 @@
unsigned long pteg_count;
unsigned long mode_ro, mode_rw, mask;
unsigned long offset = reloc_offset();
- struct Naca *_naca = RELOC(naca);
+ struct naca_struct *_naca = RELOC(naca);
HTAB *_htab_data = PTRRELOC(&htab_data);
/*
@@ -136,7 +133,7 @@
_htab_data->htab_num_ptegs = pteg_count;
_htab_data->htab_hash_mask = pteg_count - 1;
- if(_machine == _MACH_pSeries) {
+ if(_naca->platform == PLATFORM_PSERIES) {
/* Find storage for the HPT. Must be contiguous in
* the absolute address space.
*/
@@ -203,7 +200,7 @@
unsigned long vpn;
#ifdef CONFIG_PPC_PSERIES
- if(_machine == _MACH_pSeriesLP) {
+ if(naca->platform == PLATFORM_PSERIES_LPAR) {
make_pte_LPAR(htab, va, pa, mode, hash_mask, large);
return;
}
@@ -827,13 +824,11 @@
mm = &init_mm;
vsid = get_kernel_vsid( ea );
break;
-#ifdef CONFIG_PPC_EEH
case IO_UNMAPPED_REGION_ID:
udbg_printf("EEH Error ea = 0x%lx\n", ea);
PPCDBG_ENTER_DEBUGGER();
panic("EEH Error ea = 0x%lx\n", ea);
break;
-#endif
case KERNEL_REGION_ID:
/* As htab_initialize is now, we shouldn't ever get here since
* we're bolting the entire 0xC0... region.
@@ -990,6 +985,10 @@
*/
slot = ppc_md.hpte_selectslot( vpn );
+ /* If hpte_selectslot returns 0x8000000000000000 that means
+ * that there was already an entry in the HPT even though
+ * the linux PTE said there couldn't be.
+ */
/* Debug code */
if ( slot == 0x8000000000000000 ) {
unsigned long xold_pte = pte_val(old_pte);
@@ -1004,7 +1003,6 @@
panic("hash_page: hpte already exists\n");
}
-
hash_ind = 0;
if ( slot < 0 ) {
slot = -slot;
@@ -1046,7 +1044,7 @@
return rc;
}
-void flush_hash_page( unsigned long context, unsigned long ea, pte_t pte )
+void flush_hash_page( unsigned long context, unsigned long ea, pte_t *ptep )
{
unsigned long vsid, vpn, va, hash, secondary, slot, flags;
/* Local copy of first doubleword of HPTE */
@@ -1054,6 +1052,7 @@
unsigned long d;
Hpte_dword0 h;
} hpte_dw0;
+ pte_t pte;
if ( (ea >= USER_START ) && ( ea <= USER_END ) )
vsid = get_vsid( context, ea );
@@ -1062,39 +1061,42 @@
va = (vsid << 28) | (ea & 0x0fffffff);
vpn = va >> PAGE_SHIFT;
hash = hpt_hash(vpn, 0);
- secondary = (pte_val(pte) & _PAGE_SECONDARY) >> 15;
- if ( secondary )
- hash = ~hash;
- slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
- slot += (pte_val(pte) & _PAGE_GROUP_IX) >> 12;
- /* If there is an HPTE for this page it is indexed by slot */
spin_lock_irqsave( &hash_table_lock, flags);
- hpte_dw0.d = ppc_md.hpte_getword0( slot );
- if ( (hpte_dw0.h.avpn == (vpn >> 11) ) &&
- (hpte_dw0.h.v) &&
- (hpte_dw0.h.h == secondary ) ){
- /* HPTE matches */
- ppc_md.hpte_invalidate( slot );
- }
- else {
- unsigned k;
- /* Temporarily lets check for the hpte in all possible slots */
- for ( secondary = 0; secondary < 2; ++secondary ) {
- hash = hpt_hash(vpn, 0);
- if ( secondary )
- hash = ~hash;
- slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
- for ( k=0; k<8; ++k ) {
- hpte_dw0.d = ppc_md.hpte_getword0( slot+k );
- if ( ( hpte_dw0.h.avpn == (vpn >> 11) ) &&
- ( hpte_dw0.h.v ) &&
- ( hpte_dw0.h.h == secondary ) ) {
- while (1) ;
+ pte = __pte(pte_update(ptep, _PAGE_HPTEFLAGS, 0));
+ if ( pte_val(pte) & _PAGE_HASHPTE ) {
+ secondary = (pte_val(pte) & _PAGE_SECONDARY) >> 15;
+ if ( secondary )
+ hash = ~hash;
+ slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
+ slot += (pte_val(pte) & _PAGE_GROUP_IX) >> 12;
+ /* If there is an HPTE for this page it is indexed by slot */
+
+ hpte_dw0.d = ppc_md.hpte_getword0( slot );
+ if ( (hpte_dw0.h.avpn == (vpn >> 11) ) &&
+ (hpte_dw0.h.v) &&
+ (hpte_dw0.h.h == secondary ) ){
+ /* HPTE matches */
+ ppc_md.hpte_invalidate( slot );
+ }
+ else {
+ unsigned k;
+ /* Temporarily lets check for the hpte in all possible slots */
+ for ( secondary = 0; secondary < 2; ++secondary ) {
+ hash = hpt_hash(vpn, 0);
+ if ( secondary )
+ hash = ~hash;
+ slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
+ for ( k=0; k<8; ++k ) {
+ hpte_dw0.d = ppc_md.hpte_getword0( slot+k );
+ if ( ( hpte_dw0.h.avpn == (vpn >> 11) ) &&
+ ( hpte_dw0.h.v ) &&
+ ( hpte_dw0.h.h == secondary ) ) {
+ while (1) ;
+ }
}
}
}
-
}
spin_unlock_irqrestore( &hash_table_lock, flags );
}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/i8259.c linuxppc64_2_4/arch/ppc64/kernel/i8259.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/i8259.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/i8259.c Fri Mar 15 20:55:44 2002
@@ -20,7 +20,7 @@
#define cached_A1 (cached_8259[0])
#define cached_21 (cached_8259[1])
-static spinlock_t i8259_lock ____cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
+static spinlock_t i8259_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
int i8259_pic_irq_offset;
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/iSeries_VpdInfo.c linuxppc64_2_4/arch/ppc64/kernel/iSeries_VpdInfo.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/iSeries_VpdInfo.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/iSeries_VpdInfo.c Tue Apr 23 08:10:33 2002
@@ -146,7 +146,7 @@
int device_Location(struct pci_dev* PciDev,char* BufPtr)
{
struct iSeries_Device_Node* DevNode = (struct iSeries_Device_Node*)PciDev->sysdata;
- return sprintf(BufPtr,"PCI: Bus%3d, Device%3d, Vendor %04X, Location %s",
+ return sprintf(BufPtr,"PCI: Bus%3d, AgentId%3d, Vendor %04X, Location %s",
DevNode->DsaAddr.busNumber,
DevNode->AgentId,
DevNode->Vendor,
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/iSeries_pci.c linuxppc64_2_4/arch/ppc64/kernel/iSeries_pci.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/iSeries_pci.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/iSeries_pci.c Fri Apr 19 15:56:26 2002
@@ -35,7 +35,7 @@
#include
#include
#include
-#include
+#include
#include
#include
@@ -55,7 +55,6 @@
extern int global_phb_number;
extern int panic_timeout;
-extern struct Naca *naca;
extern struct device_node *allnodes;
extern unsigned long phb_tce_table_init(struct pci_controller *phb);
extern unsigned long iSeries_Base_Io_Memory;
@@ -449,7 +448,7 @@
HvSubBusNumber SubBus = BridgeInfo->subBusNumber;
u16 VendorId = 0;
int HvRc = 0;
- int Irq = 0;
+ u8 Irq = 0;
int IdSel = ISERIES_GET_DEVICE_FROM_SUBBUS(SubBus);
int Function = ISERIES_GET_FUNCTION_FROM_SUBBUS(SubBus);
HvAgentId AgentId = ISERIES_PCI_AGENTID(IdSel, Function);
@@ -476,9 +475,14 @@
/**********************************************************/
/* FoundDevice: 0x18.28.10 = 0x12AE */
/**********************************************************/
- HvCallPci_configStore8(Bus, SubBus, AgentId, PCI_INTERRUPT_LINE, Irq);
PPCDBG(PPCDBG_BUSWALK,"PCI:- FoundDevice: 0x%02X.%02X.%02X = 0x%04X\n",
Bus, SubBus, AgentId, VendorId);
+
+ HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId, PCI_INTERRUPT_LINE, Irq);
+ if( HvRc != 0) {
+ pci_Log_Error("PciCfgStore Irq Failed!",Bus,SubBus,AgentId,HvRc);
+ }
+
++DeviceCount;
DeviceNode = build_device_node(Bus, SubBus, EADsIdSel, Function);
DeviceNode->Vendor = VendorId;
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/iSeries_rtc.c linuxppc64_2_4/arch/ppc64/kernel/iSeries_rtc.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/iSeries_rtc.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/iSeries_rtc.c Wed Dec 31 18:00:00 1969
@@ -1,264 +0,0 @@
-/*
- * Real Time Clock interface for IBM iSeries
- *
- * Based on rtc.c by Paul Gortmaker
- *
- * This driver allows use of the real time clock
- * from user space. It exports the /dev/rtc
- * interface supporting various ioctl() and also the
- * /proc/driver/rtc pseudo-file for status information.
- *
- * iSeries does not support RTC interrupts nor an alarm.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * 1.0 Mike Corrigan: IBM iSeries rtc support
- */
-
-#define RTC_VERSION "1.0"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-#include
-
-/*
- * We sponge a minor off of the misc major. No need slurping
- * up another valuable major dev number for this. If you add
- * an ioctl, make sure you don't conflict with SPARC's RTC
- * ioctls.
- */
-
-static loff_t rtc_llseek(struct file *file, loff_t offset, int origin);
-
-static ssize_t rtc_read(struct file *file, char *buf,
- size_t count, loff_t *ppos);
-
-static int rtc_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg);
-
-static void get_rtc_time (struct rtc_time *rtc_tm);
-
-static int rtc_read_proc(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-
-/*
- * If this driver ever becomes modularised, it will be really nice
- * to make the epoch retain its value across module reload...
- */
-
-static unsigned long epoch = 1900; /* year corresponding to 0x00 */
-
-static const unsigned char days_in_mo[] =
-{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-
-/*
- * Now all the various file operations that we export.
- */
-
-static loff_t rtc_llseek(struct file *file, loff_t offset, int origin)
-{
- return -ESPIPE;
-}
-
-static ssize_t rtc_read(struct file *file, char *buf,
- size_t count, loff_t *ppos)
-{
- return -EIO;
-}
-
-static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
- unsigned long arg)
-{
- struct rtc_time wtime;
-
- switch (cmd) {
- case RTC_RD_TIME: /* Read the time/date from RTC */
- {
- get_rtc_time(&wtime);
- break;
- }
- case RTC_SET_TIME: /* Set the RTC */
- {
- struct rtc_time rtc_tm;
- unsigned char mon, day, hrs, min, sec, leap_yr;
- unsigned int yrs;
-
- if (!capable(CAP_SYS_TIME))
- return -EACCES;
-
- if (copy_from_user(&rtc_tm, (struct rtc_time*)arg,
- sizeof(struct rtc_time)))
- return -EFAULT;
-
- yrs = rtc_tm.tm_year;
- mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */
- day = rtc_tm.tm_mday;
- hrs = rtc_tm.tm_hour;
- min = rtc_tm.tm_min;
- sec = rtc_tm.tm_sec;
-
- if (yrs < 70)
- return -EINVAL;
-
- leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400));
-
- if ((mon > 12) || (day == 0))
- return -EINVAL;
-
- if (day > (days_in_mo[mon] + ((mon == 2) && leap_yr)))
- return -EINVAL;
-
- if ((hrs >= 24) || (min >= 60) || (sec >= 60))
- return -EINVAL;
-
- if ( yrs > 169 )
- return -EINVAL;
-
- mf_setRtc( &rtc_tm );
-
- return 0;
- }
- case RTC_EPOCH_READ: /* Read the epoch. */
- {
- return put_user (epoch, (unsigned long *)arg);
- }
- case RTC_EPOCH_SET: /* Set the epoch. */
- {
- /*
- * There were no RTC clocks before 1900.
- */
- if (arg < 1900)
- return -EINVAL;
-
- if (!capable(CAP_SYS_TIME))
- return -EACCES;
-
- epoch = arg;
- return 0;
- }
- default:
- return -EINVAL;
- }
- return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
-}
-
-static int rtc_open(struct inode *inode, struct file *file)
-{
- return 0;
-}
-
-static int rtc_release(struct inode *inode, struct file *file)
-{
- return 0;
-}
-
-/*
- * The various file operations we support.
- */
-
-static struct file_operations rtc_fops = {
- owner: THIS_MODULE,
- llseek: rtc_llseek,
- read: rtc_read,
- ioctl: rtc_ioctl,
- open: rtc_open,
- release: rtc_release,
-};
-
-static struct miscdevice rtc_dev=
-{
- RTC_MINOR,
- "rtc",
- &rtc_fops
-};
-
-static int __init rtc_init(void)
-{
- misc_register(&rtc_dev);
- create_proc_read_entry ("driver/rtc", 0, 0, rtc_read_proc, NULL);
-
- printk(KERN_INFO "iSeries Real Time Clock Driver v" RTC_VERSION "\n");
-
- return 0;
-}
-
-static void __exit rtc_exit (void)
-{
- remove_proc_entry ("driver/rtc", NULL);
- misc_deregister(&rtc_dev);
-}
-
-module_init(rtc_init);
-module_exit(rtc_exit);
-EXPORT_NO_SYMBOLS;
-
-/*
- * Info exported via "/proc/driver/rtc".
- */
-
-static int rtc_proc_output (char *buf)
-{
-
- char *p;
- struct rtc_time tm;
-
- p = buf;
-
- get_rtc_time(&tm);
-
- /*
- * There is no way to tell if the luser has the RTC set for local
- * time or for Universal Standard Time (GMT). Probably local though.
- */
- p += sprintf(p,
- "rtc_time\t: %02d:%02d:%02d\n"
- "rtc_date\t: %04d-%02d-%02d\n"
- "rtc_epoch\t: %04lu\n",
- tm.tm_hour, tm.tm_min, tm.tm_sec,
- tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, epoch);
-
- p += sprintf(p,
- "DST_enable\t: no\n"
- "BCD\t\t: yes\n"
- "24hr\t\t: yes\n" );
-
- return p - buf;
-}
-
-static int rtc_read_proc(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len = rtc_proc_output (page);
- if (len <= off+count) *eof = 1;
- *start = page + off;
- len -= off;
- if (len>count) len = count;
- if (len<0) len = 0;
- return len;
-}
-
-static void get_rtc_time(struct rtc_time *rtc_tm)
-{
- mf_getRtc( rtc_tm );
-
- rtc_tm->tm_mon--;
-}
-
-
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/iSeries_setup.c linuxppc64_2_4/arch/ppc64/kernel/iSeries_setup.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/iSeries_setup.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/iSeries_setup.c Tue Apr 9 11:23:18 2002
@@ -37,8 +37,8 @@
#include
#include "iSeries_setup.h"
-#include
-#include
+#include
+#include
#include
#include
#include
@@ -85,7 +85,6 @@
extern char _end[];
-extern struct Naca *naca;
extern int rd_size; /* Defined in drivers/block/rd.c */
extern unsigned long klimit;
extern unsigned long embedded_sysmap_start;
@@ -889,13 +888,13 @@
{
if ( dprof_buffer ) {
unsigned i;
- for (i=0; ixLpPaca.xIntDword.xFields.xDecrInt = 1;
+ lpaca->xLpPaca.xIntDword.xFields.xDecrInt = 1;
process_iSeries_events();
}
#endif /* CONFIG_PPC_ISERIES */
int idled(void)
{
- struct Paca *paca;
+ struct paca_struct *lpaca;
long oldval;
#ifdef CONFIG_PPC_ISERIES
unsigned long CTRL;
@@ -89,12 +88,12 @@
#endif
init_idle();
- paca = (struct Paca *)mfspr(SPRG3);
+ lpaca = get_paca();
for (;;) {
#ifdef CONFIG_PPC_ISERIES
- if ( paca->xLpPaca.xSharedProc ) {
- if ( ItLpQueue_isLpIntPending( paca->lpQueuePtr ) )
+ if ( lpaca->xLpPaca.xSharedProc ) {
+ if ( ItLpQueue_isLpIntPending( lpaca->lpQueuePtr ) )
process_iSeries_events();
if ( !current->need_resched )
yield_shared_processor();
@@ -108,7 +107,7 @@
while(current->need_resched == -1) {
#ifdef CONFIG_PPC_ISERIES
HMT_medium();
- if ( ItLpQueue_isLpIntPending( paca->lpQueuePtr ) )
+ if ( ItLpQueue_isLpIntPending( lpaca->lpQueuePtr ) )
process_iSeries_events();
#endif
HMT_low();
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ioctl32.c linuxppc64_2_4/arch/ppc64/kernel/ioctl32.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ioctl32.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/ioctl32.c Tue Apr 23 09:37:25 2002
@@ -102,19 +102,9 @@
#include
#include
#include
+#include
#include
-/* Use this to get at 32-bit user passed pointers.
- See sys_sparc32.c for description about these. */
-#define A(__x) ((unsigned long)(__x))
-#define AA(__x) \
-({ unsigned long __ret; \
- __asm__ ("clrldi %0, %0, 32" \
- : "=r" (__ret) \
- : "0" (__x)); \
- __ret; \
-})
-
/* Aiee. Someone does not find a difference between int and long */
#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int)
#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int)
@@ -4159,8 +4149,6 @@
COMPATIBLE_IOCTL(HCIDEVUP),
COMPATIBLE_IOCTL(HCIDEVDOWN),
COMPATIBLE_IOCTL(HCIDEVRESET),
-COMPATIBLE_IOCTL(HCIRESETSTAT),
-COMPATIBLE_IOCTL(HCIGETINFO),
COMPATIBLE_IOCTL(HCIGETDEVLIST),
COMPATIBLE_IOCTL(HCISETRAW),
COMPATIBLE_IOCTL(HCISETSCAN),
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/irq.c linuxppc64_2_4/arch/ppc64/kernel/irq.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/irq.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/irq.c Thu Apr 18 09:37:39 2002
@@ -55,6 +55,7 @@
#include
#include
#include
+#include
#include "local_irq.h"
@@ -557,14 +558,14 @@
{
int cpu = smp_processor_id();
int irq;
- struct Paca * paca;
+ struct paca_struct *lpaca;
struct ItLpQueue * lpq;
/* if(cpu) udbg_printf("Entering do_IRQ\n"); */
irq_enter(cpu);
- if ( _machine != _MACH_iSeries ) {
+ if (naca->platform != PLATFORM_ISERIES_LPAR) {
/* every arch is required to have a get_irq -- Cort */
irq = ppc_md.get_irq( regs );
@@ -584,23 +585,23 @@
}
/* if on iSeries partition */
else {
- paca = (struct Paca *)mfspr(SPRG3);
+ lpaca = get_paca();
#ifdef CONFIG_SMP
- if ( paca->xLpPaca.xIntDword.xFields.xIpiCnt ) {
- paca->xLpPaca.xIntDword.xFields.xIpiCnt = 0;
+ if ( lpaca->xLpPaca.xIntDword.xFields.xIpiCnt ) {
+ lpaca->xLpPaca.xIntDword.xFields.xIpiCnt = 0;
iSeries_smp_message_recv( regs );
}
#endif /* CONFIG_SMP */
- lpq = paca->lpQueuePtr;
+ lpq = lpaca->lpQueuePtr;
if ( lpq && ItLpQueue_isLpIntPending( lpq ) )
lpEvent_count += ItLpQueue_process( lpq, regs );
}
irq_exit(cpu);
- if ( _machine == _MACH_iSeries ) {
- if ( paca->xLpPaca.xIntDword.xFields.xDecrInt ) {
- paca->xLpPaca.xIntDword.xFields.xDecrInt = 0;
+ if (naca->platform == PLATFORM_ISERIES_LPAR) {
+ if ( lpaca->xLpPaca.xIntDword.xFields.xDecrInt ) {
+ lpaca->xLpPaca.xIntDword.xFields.xDecrInt = 0;
/* Signal a fake decrementer interrupt */
timer_interrupt( regs );
}
@@ -899,11 +900,11 @@
#ifdef CONFIG_PPC_ISERIES
{
unsigned i;
- for (i=0; i>= 1;
}
}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/lmb.c linuxppc64_2_4/arch/ppc64/kernel/lmb.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/lmb.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/lmb.c Mon Apr 15 21:12:43 2002
@@ -76,12 +76,15 @@
void
lmb_analyze(void)
{
- unsigned long i, physbase = 0;
+ unsigned long i;
unsigned long mem_size = 0;
unsigned long io_size = 0;
unsigned long size_mask = 0;
unsigned long offset = reloc_offset();
struct lmb *_lmb = PTRRELOC(&lmb);
+#ifdef CONFIG_MSCHUNKS
+ unsigned long physbase = 0;
+#endif
for (i=0; i < _lmb->memory.cnt ;i++) {
unsigned long lmb_type = _lmb->memory.region[i].type;
@@ -102,6 +105,7 @@
size_mask |= lmb_size;
}
+#ifdef CONFIG_MSCHUNKS
for (i=0; i < _lmb->memory.cnt ;i++) {
unsigned long lmb_type = _lmb->memory.region[i].type;
unsigned long lmb_size;
@@ -111,15 +115,12 @@
lmb_size = _lmb->memory.region[i].size;
-#ifdef CONFIG_MSCHUNKS
_lmb->memory.region[i].physbase = physbase;
physbase += lmb_size;
-#else
- _lmb->memory.region[i].physbase = _lmb->memory.region[i].base;
-#endif
io_size += lmb_size;
size_mask |= lmb_size;
}
+#endif /* CONFIG_MSCHUNKS */
_lmb->memory.size = mem_size;
_lmb->memory.iosize = io_size;
@@ -138,6 +139,7 @@
}
+#ifdef CONFIG_MSCHUNKS
/* This routine called with relocation disabled. */
long
lmb_add_io(unsigned long base, unsigned long size)
@@ -149,6 +151,7 @@
return lmb_add_region(_rgn, base, size, LMB_IO_AREA);
}
+#endif /* CONFIG_MSCHUNKS */
long
lmb_reserve(unsigned long base, unsigned long size)
@@ -282,7 +285,16 @@
{
unsigned long offset = reloc_offset();
struct lmb *_lmb = PTRRELOC(&lmb);
+#ifdef CONFIG_MSCHUNKS
return _lmb->memory.size;
+#else
+ struct lmb_region *_mem = &(_lmb->memory);
+ unsigned long idx = _mem->cnt-1;
+ unsigned long lastbase = _mem->region[idx].physbase;
+ unsigned long lastsize = _mem->region[idx].size;
+
+ return (lastbase + lastsize);
+#endif /* CONFIG_MSCHUNKS */
}
unsigned long
@@ -291,10 +303,9 @@
unsigned long offset = reloc_offset();
struct lmb *_lmb = PTRRELOC(&lmb);
struct lmb_region *_mem = &(_lmb->memory);
- unsigned long idx = _mem->cnt-1;
+ unsigned long idx;
for(idx=_mem->cnt-1; idx >= 0 ;idx--) {
- unsigned long lastbase, lastsize;
if ( _mem->region[idx].type != LMB_MEMORY_AREA )
continue;
#ifdef CONFIG_MSCHUNKS
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/mf.c linuxppc64_2_4/arch/ppc64/kernel/mf.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/mf.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/mf.c Wed Apr 17 13:14:54 2002
@@ -1003,7 +1003,7 @@
}
}
- pci_unmap_single(iSeries_vio_dev, dma_addr, *size, PCI_DMA_FROMDEVICE);
+ pci_unmap_single(iSeries_vio_dev, dma_addr, len, PCI_DMA_FROMDEVICE);
return rc;
}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/mf_proc.c linuxppc64_2_4/arch/ppc64/kernel/mf_proc.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/mf_proc.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/mf_proc.c Wed Apr 17 13:14:54 2002
@@ -71,12 +71,12 @@
ent->read_proc = proc_mf_dump_cmdline;
ent->write_proc = proc_mf_change_cmdline;
- ent = create_proc_entry("vmlinux", S_IFREG|S_IRUSR|S_IWUSR, mf_a);
+ ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf_a);
if (!ent) return;
ent->nlink = 1;
ent->data = (void *)0;
- ent->read_proc = proc_mf_dump_vmlinux;
ent->write_proc = proc_mf_change_vmlinux;
+ ent->read_proc = NULL;
mf_b = proc_mkdir("B", mf_proc_root);
if (!mf_b) return;
@@ -88,12 +88,12 @@
ent->read_proc = proc_mf_dump_cmdline;
ent->write_proc = proc_mf_change_cmdline;
- ent = create_proc_entry("vmlinux", S_IFREG|S_IRUSR|S_IWUSR, mf_b);
+ ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf_b);
if (!ent) return;
ent->nlink = 1;
ent->data = (void *)1;
- ent->read_proc = proc_mf_dump_vmlinux;
ent->write_proc = proc_mf_change_vmlinux;
+ ent->read_proc = NULL;
mf_c = proc_mkdir("C", mf_proc_root);
if (!mf_c) return;
@@ -105,12 +105,12 @@
ent->read_proc = proc_mf_dump_cmdline;
ent->write_proc = proc_mf_change_cmdline;
- ent = create_proc_entry("vmlinux", S_IFREG|S_IRUSR|S_IWUSR, mf_c);
+ ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf_c);
if (!ent) return;
ent->nlink = 1;
ent->data = (void *)2;
- ent->read_proc = proc_mf_dump_vmlinux;
ent->write_proc = proc_mf_change_vmlinux;
+ ent->read_proc = NULL;
mf_d = proc_mkdir("D", mf_proc_root);
if (!mf_d) return;
@@ -122,14 +122,14 @@
ent->data = (void *)3;
ent->read_proc = proc_mf_dump_cmdline;
ent->write_proc = proc_mf_change_cmdline;
-
+#if 0
ent = create_proc_entry("vmlinux", S_IFREG|S_IRUSR, mf_d);
if (!ent) return;
ent->nlink = 1;
ent->data = (void *)3;
ent->read_proc = proc_mf_dump_vmlinux;
ent->write_proc = NULL;
-
+#endif
ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
if (!ent) return;
ent->nlink = 1;
@@ -191,20 +191,16 @@
if (sizeToGet != 0)
{
*start = page + off;
- printk("mf_proc.c: got count %d off %d\n", sizeToGet, (int)off);
return sizeToGet;
} else {
- printk("mf_proc.c: eof\n");
*eof = 1;
return 0;
}
} else {
- printk("mf_proc.c: eof\n");
*eof = 1;
return 0;
}
}
-
int proc_mf_dump_side
(char *page, char **start, off_t off, int count, int *eof, void *data)
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/misc.S linuxppc64_2_4/arch/ppc64/kernel/misc.S
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/misc.S Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/misc.S Mon Apr 8 08:53:11 2002
@@ -519,8 +519,7 @@
#ifdef CONFIG_BINFMT_ELF32
/* Why isn't this a) automatic, b) written in 'C'? */
- .data
- .align 8
+ .balign 8
_GLOBAL(sys_call_table32)
.llong .sys_ni_syscall /* 0 - old "setup()" system call */
.llong .sys32_exit
@@ -729,12 +728,28 @@
.llong .sys32_fcntl64 /* 204 */
.llong .sys_madvise /* 205 */
.llong .sys_mincore /* 206 */
- .rept NR_syscalls-206
+ .llong .sys_gettid /* 207 */
+#if 0 /* Reserved syscalls */
+ .llong .sys_tkill /* 208 */
+ .llong .sys_setxattr
+ .llong .sys_lsetxattr /* 210 */
+ .llong .sys_fsetxattr
+ .llong .sys_getxattr
+ .llong .sys_lgetxattr
+ .llong .sys_fgetxattr
+ .llong .sys_listxattr /* 215 */
+ .llong .sys_llistxattr
+ .llong .sys_flistxattr
+ .llong .sys_removexattr
+ .llong .sys_lremovexattr
+ .llong .sys_fremovexattr /* 220 */
+ .llong .sys_futex
+#endif
+ .rept NR_syscalls-221
.llong .sys_ni_syscall
.endr
#endif
- .data
- .align 8
+ .balign 8
_GLOBAL(sys_call_table)
.llong .sys_ni_syscall /* 0 - old "setup()" system call */
.llong .sys_exit
@@ -943,6 +958,23 @@
.llong .sys_ni_syscall /* 204 */
.llong .sys_madvise /* 205 */
.llong .sys_mincore /* 206 */
- .rept NR_syscalls-206
+ .llong .sys_gettid /* 207 */
+#if 0 /* Reserved syscalls */
+ .llong .sys_tkill /* 208 */
+ .llong .sys_setxattr
+ .llong .sys_lsetxattr /* 210 */
+ .llong .sys_fsetxattr
+ .llong .sys_getxattr
+ .llong .sys_lgetxattr
+ .llong .sys_fgetxattr
+ .llong .sys_listxattr /* 215 */
+ .llong .sys_llistxattr
+ .llong .sys_flistxattr
+ .llong .sys_removexattr
+ .llong .sys_lremovexattr
+ .llong .sys_fremovexattr /* 220 */
+ .llong .sys_futex
+#endif
+ .rept NR_syscalls-221
.llong .sys_ni_syscall
.endr
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/mk_defs.c linuxppc64_2_4/arch/ppc64/kernel/mk_defs.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/mk_defs.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/mk_defs.c Thu Apr 18 09:36:18 2002
@@ -30,8 +30,8 @@
#include
#include
-#include
-#include
+#include
+#include
#include
#include
#include
@@ -50,44 +50,45 @@
DEFINE(TASK_STRUCT_SIZE, sizeof(struct task_struct));
DEFINE(KSP, offsetof(struct thread_struct, ksp));
- DEFINE(PACA, offsetof(struct Naca, paca));
- DEFINE(PACA_SIZE, sizeof(struct Paca));
+ DEFINE(PACA, offsetof(struct naca_struct, paca));
+ DEFINE(PACA_SIZE, sizeof(struct paca_struct));
- DEFINE(DCACHEL1LINESIZE, offsetof(struct Naca, dCacheL1LineSize));
- DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct Naca, dCacheL1LogLineSize));
- DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct Naca, dCacheL1LinesPerPage));
-
- DEFINE(ICACHEL1LINESIZE, offsetof(struct Naca, iCacheL1LineSize));
- DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct Naca, iCacheL1LogLineSize));
- DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct Naca, iCacheL1LinesPerPage));
- DEFINE(SLBSIZE, offsetof(struct Naca, slb_size));
-
- DEFINE(PACAPACAINDEX, offsetof(struct Paca, xPacaIndex));
- DEFINE(PACAPROCSTART, offsetof(struct Paca, xProcStart));
- DEFINE(PACAKSAVE, offsetof(struct Paca, xKsave));
- DEFINE(PACACURRENT, offsetof(struct Paca, xCurrent));
- DEFINE(PACASAVEDMSR, offsetof(struct Paca, xSavedMsr));
- DEFINE(PACASTABREAL, offsetof(struct Paca, xStab_data.real));
- DEFINE(PACASTABVIRT, offsetof(struct Paca, xStab_data.virt));
- DEFINE(PACASTABRR, offsetof(struct Paca, xStab_data.next_round_robin));
- DEFINE(PACAR1, offsetof(struct Paca, xR1));
- DEFINE(PACALPQUEUE, offsetof(struct Paca, lpQueuePtr));
- DEFINE(PACATOC, offsetof(struct Paca, xTOC));
- DEFINE(PACAEXCSP, offsetof(struct Paca, exception_sp));
- DEFINE(PACAHRDWINTSTACK, offsetof(struct Paca, xHrdIntStack));
- DEFINE(PACAPROCENABLED, offsetof(struct Paca, xProcEnabled));
- DEFINE(PACAHRDWINTCOUNT, offsetof(struct Paca, xHrdIntCount));
- DEFINE(PACADEFAULTDECR, offsetof(struct Paca, default_decr));
- DEFINE(PACAPROFENABLED, offsetof(struct Paca, prof_enabled));
- DEFINE(PACAPROFLEN, offsetof(struct Paca, prof_len));
- DEFINE(PACAPROFSHIFT, offsetof(struct Paca, prof_shift));
- DEFINE(PACAPROFBUFFER, offsetof(struct Paca, prof_buffer));
- DEFINE(PACAPROFSTEXT, offsetof(struct Paca, prof_stext));
- DEFINE(PACALPPACA, offsetof(struct Paca, xLpPaca));
- DEFINE(LPPACA, offsetof(struct Paca, xLpPaca));
- DEFINE(PACAREGSAV, offsetof(struct Paca, xRegSav));
- DEFINE(PACAEXC, offsetof(struct Paca, exception_stack));
- DEFINE(PACAGUARD, offsetof(struct Paca, guard));
+ DEFINE(DCACHEL1LINESIZE, offsetof(struct naca_struct, dCacheL1LineSize));
+ DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct naca_struct, dCacheL1LogLineSize));
+ DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct naca_struct, dCacheL1LinesPerPage));
+
+ DEFINE(ICACHEL1LINESIZE, offsetof(struct naca_struct, iCacheL1LineSize));
+ DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct naca_struct, iCacheL1LogLineSize));
+ DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct naca_struct, iCacheL1LinesPerPage));
+ DEFINE(SLBSIZE, offsetof(struct naca_struct, slb_size));
+ DEFINE(PLATFORM, offsetof(struct naca_struct, platform));
+
+ DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, xPacaIndex));
+ DEFINE(PACAPROCSTART, offsetof(struct paca_struct, xProcStart));
+ DEFINE(PACAKSAVE, offsetof(struct paca_struct, xKsave));
+ DEFINE(PACACURRENT, offsetof(struct paca_struct, xCurrent));
+ DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, xSavedMsr));
+ DEFINE(PACASTABREAL, offsetof(struct paca_struct, xStab_data.real));
+ DEFINE(PACASTABVIRT, offsetof(struct paca_struct, xStab_data.virt));
+ DEFINE(PACASTABRR, offsetof(struct paca_struct, xStab_data.next_round_robin));
+ DEFINE(PACAR1, offsetof(struct paca_struct, xR1));
+ DEFINE(PACALPQUEUE, offsetof(struct paca_struct, lpQueuePtr));
+ DEFINE(PACATOC, offsetof(struct paca_struct, xTOC));
+ DEFINE(PACAEXCSP, offsetof(struct paca_struct, exception_sp));
+ DEFINE(PACAHRDWINTSTACK, offsetof(struct paca_struct, xHrdIntStack));
+ DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, xProcEnabled));
+ DEFINE(PACAHRDWINTCOUNT, offsetof(struct paca_struct, xHrdIntCount));
+ DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr));
+ DEFINE(PACAPROFENABLED, offsetof(struct paca_struct, prof_enabled));
+ DEFINE(PACAPROFLEN, offsetof(struct paca_struct, prof_len));
+ DEFINE(PACAPROFSHIFT, offsetof(struct paca_struct, prof_shift));
+ DEFINE(PACAPROFBUFFER, offsetof(struct paca_struct, prof_buffer));
+ DEFINE(PACAPROFSTEXT, offsetof(struct paca_struct, prof_stext));
+ DEFINE(PACALPPACA, offsetof(struct paca_struct, xLpPaca));
+ DEFINE(LPPACA, offsetof(struct paca_struct, xLpPaca));
+ DEFINE(PACAREGSAV, offsetof(struct paca_struct, xRegSav));
+ DEFINE(PACAEXC, offsetof(struct paca_struct, exception_stack));
+ DEFINE(PACAGUARD, offsetof(struct paca_struct, guard));
DEFINE(LPPACASRR0, offsetof(struct ItLpPaca, xSavedSrr0));
DEFINE(LPPACASRR1, offsetof(struct ItLpPaca, xSavedSrr1));
DEFINE(LPPACAANYINT, offsetof(struct ItLpPaca, xIntDword.xAnyInt));
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/nvram.c linuxppc64_2_4/arch/ppc64/kernel/nvram.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/nvram.c Wed Dec 31 18:00:00 1969
+++ linuxppc64_2_4/arch/ppc64/kernel/nvram.c Fri Mar 1 13:28:29 2002
@@ -0,0 +1,140 @@
+/*
+ * c 2001 PPC 64 Team, IBM Corp
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * /dev/nvram driver for PPC64
+ *
+ * This perhaps should live in drivers/char
+ */
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+static unsigned int rtas_nvram_size;
+static unsigned int nvram_fetch, nvram_store;
+static char nvram_buf[4]; /* assume this is in the first 4GB */
+
+static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
+{
+ switch (origin) {
+ case 1:
+ offset += file->f_pos;
+ break;
+ case 2:
+ offset += rtas_nvram_size;
+ break;
+ }
+ if (offset < 0)
+ return -EINVAL;
+ file->f_pos = offset;
+ return file->f_pos;
+}
+
+
+static ssize_t read_nvram(struct file *file, char *buf,
+ size_t count, loff_t *ppos)
+{
+ unsigned int i;
+ unsigned long len;
+ char *p = buf;
+
+ if (verify_area(VERIFY_WRITE, buf, count))
+ return -EFAULT;
+ if (*ppos >= rtas_nvram_size)
+ return 0;
+ for (i = *ppos; count > 0 && i < rtas_nvram_size; ++i, ++p, --count) {
+ if ((rtas_call(nvram_fetch, 3, 2, &len, i, __pa(nvram_buf), 1) != 0) ||
+ len != 1)
+ return -EIO;
+ if (__put_user(nvram_buf[0], p))
+ return -EFAULT;
+ }
+ *ppos = i;
+ return p - buf;
+}
+
+static ssize_t write_nvram(struct file *file, const char *buf,
+ size_t count, loff_t *ppos)
+{
+ unsigned int i;
+ unsigned long len;
+ const char *p = buf;
+ char c;
+
+ if (verify_area(VERIFY_READ, buf, count))
+ return -EFAULT;
+ if (*ppos >= rtas_nvram_size)
+ return 0;
+ for (i = *ppos; count > 0 && i < rtas_nvram_size; ++i, ++p, --count) {
+ if (__get_user(c, p))
+ return -EFAULT;
+ nvram_buf[0] = c;
+ if ((rtas_call(nvram_store, 3, 2, &len, i, __pa(nvram_buf), 1) != 0) ||
+ len != 1)
+ return -EIO;
+ }
+ *ppos = i;
+ return p - buf;
+}
+
+static int nvram_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return -EINVAL;
+}
+
+struct file_operations nvram_fops = {
+ owner: THIS_MODULE,
+ llseek: nvram_llseek,
+ read: read_nvram,
+ write: write_nvram,
+ ioctl: nvram_ioctl,
+};
+
+static struct miscdevice nvram_dev = {
+ NVRAM_MINOR,
+ "nvram",
+ &nvram_fops
+};
+
+int __init nvram_init(void)
+{
+ struct device_node *nvram;
+ unsigned int *nbytes_p, proplen;
+ if ((nvram = find_type_devices("nvram")) != NULL) {
+ nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen);
+ if (nbytes_p && proplen == sizeof(unsigned int)) {
+ rtas_nvram_size = *nbytes_p;
+ }
+ }
+ nvram_fetch = rtas_token("nvram-fetch");
+ nvram_store = rtas_token("nvram-store");
+ printk(KERN_INFO "PPC64 nvram contains %d bytes\n", rtas_nvram_size);
+
+ misc_register(&nvram_dev);
+ return 0;
+}
+
+void __exit nvram_cleanup(void)
+{
+ misc_deregister( &nvram_dev );
+}
+
+module_init(nvram_init);
+module_exit(nvram_cleanup);
+MODULE_LICENSE("GPL");
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pSeries_lpar.c linuxppc64_2_4/arch/ppc64/kernel/pSeries_lpar.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pSeries_lpar.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/pSeries_lpar.c Fri Apr 19 13:38:07 2002
@@ -32,7 +32,7 @@
#include
#include
#include
-#include
+#include
/* Status return values */
#define H_Success 0
@@ -532,7 +532,7 @@
local_hpte.dw0.dw0.avpn = va >> 23;
local_hpte.dw0.dw0.bolted = 1; /* bolted */
if (large)
- local_hpte.dw0.dw0.l = 1; /* large page */
+ local_hpte.dw0.dw0.l = 1; /* large page */
local_hpte.dw0.dw0.v = 1;
/* Set CEC cookie to 0 */
@@ -577,7 +577,7 @@
static void tce_build_pSeriesLP(struct TceTable *tbl, long tcenum,
unsigned long uaddr, int direction )
{
- u64 setTceRc;
+ u64 set_tce_rc;
union Tce tce;
PPCDBG(PPCDBG_TCE, "build_tce: uaddr = 0x%lx\n", uaddr);
@@ -590,90 +590,35 @@
tce.tceBits.readWrite = 1;
if ( direction != PCI_DMA_TODEVICE ) tce.tceBits.pciWrite = 1;
- setTceRc = plpar_tce_put((u64)tbl->index,
+ set_tce_rc = plpar_tce_put((u64)tbl->index,
(u64)tcenum << 12,
tce.wholeTce );
- /* Make sure the update is visible to hardware.
- * ToDo: sync after setting *all* the tce's.
- */
- __asm__ __volatile__ ("sync" : : : "memory");
- if(setTceRc) {
- PPCDBG(PPCDBG_TCE, "setTce failed. rc=%ld\n", setTceRc);
- PPCDBG(PPCDBG_TCE, "\tindex = 0x%lx\n", (u64)tbl->index);
- PPCDBG(PPCDBG_TCE, "\ttcenum = 0x%lx\n", (u64)tcenum);
- PPCDBG(PPCDBG_TCE, "\ttce val = 0x%lx\n", tce.wholeTce );
+ if(set_tce_rc) {
+ printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n", set_tce_rc);
+ printk("\tindex = 0x%lx\n", (u64)tbl->index);
+ printk("\ttcenum = 0x%lx\n", (u64)tcenum);
+ printk("\ttce val = 0x%lx\n", tce.wholeTce );
}
}
-static inline void free_tce_range(struct TceTable *tbl,
- long tcenum, unsigned order )
+static void tce_free_one_pSeriesLP(struct TceTable *tbl, long tcenum)
{
- unsigned long flags;
-
- /* Lock the tce allocation bitmap */
- spin_lock_irqsave( &(tbl->lock), flags );
-
- /* Do the actual work */
- free_tce_range_nolock( tbl, tcenum, order );
-
- /* Unlock the tce allocation bitmap */
- spin_unlock_irqrestore( &(tbl->lock), flags );
-
-}
-
-static void tce_free_pSeriesLP(struct TceTable *tbl, dma_addr_t dma_addr,
- unsigned order, unsigned numPages)
-{
- u64 setTceRc;
- long tcenum, freeTce, maxTcenum;
- unsigned i;
+ u64 set_tce_rc;
union Tce tce;
- maxTcenum = (tbl->size * (PAGE_SIZE / sizeof(union Tce))) - 1;
-
- tcenum = dma_addr >> PAGE_SHIFT;
-
- freeTce = tcenum - tbl->startOffset;
-
- if ( freeTce > maxTcenum ) {
- printk("free_tces: tcenum > maxTcenum\n");
- printk("\ttcenum = 0x%lx\n", tcenum);
- printk("\tfreeTce = 0x%lx\n", freeTce);
- printk("\tmaxTcenum = 0x%lx\n", maxTcenum);
- printk("\tTCE Table = 0x%lx\n", (u64)tbl);
- printk("\tbus# = 0x%lx\n",
- (u64)tbl->busNumber );
- printk("\tsize = 0x%lx\n", (u64)tbl->size);
- printk("\tstartOff = 0x%lx\n",
- (u64)tbl->startOffset );
- printk("\tindex = 0x%lx\n", (u64)tbl->index);
- return;
- }
-
- for (i=0; iindex,
- (u64)tcenum << 12, /* note: not freeTce */
- tce.wholeTce );
- if ( setTceRc ) {
- printk("tce_free: setTce failed\n");
- printk("\trc = %ld\n", setTceRc);
- printk("\tindex = 0x%lx\n",
- (u64)tbl->index);
- printk("\ttcenum = 0x%lx\n", (u64)tcenum);
- printk("\tfreeTce = 0x%lx\n", (u64)freeTce);
- printk("\ttce val = 0x%lx\n",
- tce.wholeTce );
- }
-
- ++tcenum;
+ tce.wholeTce = 0;
+ set_tce_rc = plpar_tce_put((u64)tbl->index,
+ (u64)tcenum << 12,
+ tce.wholeTce );
+ if ( set_tce_rc ) {
+ printk("tce_free_one_pSeriesLP: plpar_tce_put failed\n");
+ printk("\trc = %ld\n", set_tce_rc);
+ printk("\tindex = 0x%lx\n", (u64)tbl->index);
+ printk("\ttcenum = 0x%lx\n", (u64)tcenum);
+ printk("\ttce val = 0x%lx\n", tce.wholeTce );
}
- /* Make sure the update is visible to hardware. */
- __asm__ __volatile__ ("sync" : : : "memory");
-
- free_tce_range( tbl, freeTce, order );
}
/* PowerPC Interrupts for lpar. */
@@ -769,8 +714,13 @@
/* get some more chars. */
inbuflen = 0;
rc = plpar_get_term_char(vtermno, &inbuflen, buf);
- if (inbuflen == 0 && rc == H_Success)
- return -1;
+ if (rc != H_Success)
+ inbuflen = 0; /* otherwise inbuflen is garbage */
+ }
+ if (inbuflen <= 0 || inbuflen > 16) {
+ /* Catch error case as well as other oddities (corruption) */
+ inbuflen = 0;
+ return -1;
}
ch = buf[0];
for (i = 1; i < inbuflen; i++) /* shuffle them down. */
@@ -810,7 +760,7 @@
ppc_md.hpte_find = hpte_find_pSeriesLP;
ppc_md.tce_build = tce_build_pSeriesLP;
- ppc_md.tce_free = tce_free_pSeriesLP;
+ ppc_md.tce_free_one = tce_free_one_pSeriesLP;
#ifdef CONFIG_SMP
smp_init_pSeries();
@@ -846,7 +796,7 @@
}
}
-/* Confidential code for hvc_console. Should move it back eventually. */
+/* Code for hvc_console. Should move it back eventually. */
int hvc_get_chars(int index, char *buf, int count)
{
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pSeries_pci.c linuxppc64_2_4/arch/ppc64/kernel/pSeries_pci.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pSeries_pci.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/pSeries_pci.c Mon Apr 22 16:50:19 2002
@@ -39,11 +39,9 @@
#include
#include
#include
-#include
+#include
#include
-#ifdef CONFIG_PPC_EEH
#include
-#endif
#include "xics.h"
#include "open_pic.h"
@@ -130,7 +128,10 @@
} \
int __chrp \
rtas_pci_write_config_##size(struct pci_dev *dev, int offset, type val) { \
- return rtas_write_config_##size(pci_device_to_OF_node(dev), offset, val); \
+ struct device_node* dn = pci_device_to_OF_node(dev); \
+ int ret = rtas_write_config_##size(dn, offset, val); \
+ /* udbg_printf("write bus=%x, devfn=%x, ret=%d phb=%lx, dn=%lx\n", dev->bus->number, dev->devfn, ret, dn ? dn->phb : 0, dn); */ \
+ return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; \
}
RTAS_PCI_READ_OP(byte, u8 *, 1)
@@ -256,9 +257,8 @@
write_pci_config = rtas_token("write-pci-config");
ibm_read_pci_config = rtas_token("ibm,read-pci-config");
ibm_write_pci_config = rtas_token("ibm,write-pci-config");
-#ifdef CONFIG_PPC_EEH
+
eeh_init();
-#endif
if (naca->interrupt_controller == IC_OPEN_PIC) {
opprop = (unsigned int *)get_property(find_path_device("/"),
@@ -358,24 +358,24 @@
res = &phb->io_resource;
res->name = Pci_Node->full_name;
res->flags = IORESOURCE_IO;
-#ifdef CONFIG_PPC_EEH
- if (!isa_io_base && has_isa) {
- /* map a page for ISA ports. Not EEH protected. */
- isa_io_base = (unsigned long)__ioremap(phb->io_base_phys, PAGE_SIZE, _PAGE_NO_CACHE);
- }
- res->start = phb->io_base_virt = eeh_token(index, 0, 0, 0);
- res->end = eeh_token(index, 0xff, 0xff, 0xffffffff);
-#else
- phb->io_base_virt = ioremap(phb->io_base_phys, range.size);
- if (!pci_io_base) {
- pci_io_base = (unsigned long)phb->io_base_virt;
- if (has_isa)
- isa_io_base = pci_io_base;
+ if (is_eeh_implemented()) {
+ if (!isa_io_base && has_isa) {
+ /* map a page for ISA ports. Not EEH protected. */
+ isa_io_base = (unsigned long)__ioremap(phb->io_base_phys, PAGE_SIZE, _PAGE_NO_CACHE);
+ }
+ res->start = phb->io_base_virt = eeh_token(index, 0, 0, 0);
+ res->end = eeh_token(index, 0xff, 0xff, 0xffffffff);
+ } else {
+ phb->io_base_virt = ioremap(phb->io_base_phys, range.size);
+ if (!pci_io_base) {
+ pci_io_base = (unsigned long)phb->io_base_virt;
+ if (has_isa)
+ isa_io_base = pci_io_base;
+ }
+ res->start = ((((unsigned long) range.child_addr.a_mid) << 32) | (range.child_addr.a_lo));
+ res->start += (unsigned long)phb->io_base_virt;
+ res->end = res->start + range.size - 1;
}
- res->start = ((((unsigned long) range.child_addr.a_mid) << 32) | (range.child_addr.a_lo));
- res->start += (unsigned long)phb->io_base_virt;
- res->end = res->start + range.size - 1;
-#endif
res->parent = NULL;
res->sibling = NULL;
res->child = NULL;
@@ -399,13 +399,13 @@
++memno;
res->name = Pci_Node->full_name;
res->flags = IORESOURCE_MEM;
-#ifdef CONFIG_PPC_EEH
- res->start = eeh_token(index, 0, 0, 0);
- res->end = eeh_token(index, 0xff, 0xff, 0xffffffff);
-#else
- res->start = range.parent_addr;
- res->end = range.parent_addr + range.size - 1;
-#endif
+ if (is_eeh_implemented()) {
+ res->start = eeh_token(index, 0, 0, 0);
+ res->end = eeh_token(index, 0xff, 0xff, 0xffffffff);
+ } else {
+ res->start = range.parent_addr;
+ res->end = range.parent_addr + range.size - 1;
+ }
res->parent = NULL;
res->sibling = NULL;
res->child = NULL;
@@ -515,13 +515,15 @@
/***************************************************************
* Speedwagon
+ * include Winnipeg as well for the time being.
***************************************************************/
- } else if (strstr(model, "Speedwagon")) {
+ } else if ((strstr(model, "Speedwagon")) ||
+ (strstr(model, "Winnipeg"))) {
PPCDBG(PPCDBG_PHBINIT, "\tCreate speedwagon\n");
phb = pci_alloc_pci_controller("PHB SW",phb_type_speedwagon);
if (phb == NULL) return NULL;
- if (_machine == _MACH_pSeries) {
+ if (naca->platform == PLATFORM_PSERIES) {
phb->cfg_addr = (volatile unsigned long *)
ioremap(reg_struct.address + 0x140, PAGE_SIZE);
phb->cfg_data = (char*)(phb->cfg_addr - 0x02); /* minus is correct */
@@ -603,7 +605,6 @@
{
int i;
struct pci_controller *phb = PCI_GET_PHB_PTR(dev);
-#ifdef CONFIG_PPC_EEH
struct device_node *dn;
unsigned long eeh_disable_bit;
@@ -622,19 +623,19 @@
}
}
- if (is_eeh_configured(dev)) {
- eeh_disable_bit = 0;
- printk("PCI: eeh configured for %s %s\n", dev->slot_name, dev->name);
- if (eeh_set_option(dev, EEH_ENABLE) != 0) {
- printk("PCI: failed to enable eeh for %s %s\n", dev->slot_name, dev->name);
+ if (is_eeh_implemented()) {
+ if (is_eeh_configured(dev)) {
+ eeh_disable_bit = 0;
+ if (eeh_set_option(dev, EEH_ENABLE) != 0) {
+ printk("PCI: failed to enable EEH for %s %s\n", dev->slot_name, dev->name);
+ eeh_disable_bit = EEH_TOKEN_DISABLED;
+ }
+ } else {
+ /* Assume device is by default EEH_DISABLE'd */
+ printk("PCI: eeh NOT configured for %s %s\n", dev->slot_name, dev->name);
eeh_disable_bit = EEH_TOKEN_DISABLED;
}
- } else {
- /* Assume device is by default EEH_DISABLE'd */
- printk("PCI: eeh NOT configured for %s %s\n", dev->slot_name, dev->name);
- eeh_disable_bit = EEH_TOKEN_DISABLED;
}
-#endif
PPCDBG(PPCDBG_PHBINIT, "fixup_resources:\n");
PPCDBG(PPCDBG_PHBINIT, "\tphb = 0x%016LX\n", phb);
@@ -659,19 +660,19 @@
}
if (dev->resource[i].flags & IORESOURCE_IO) {
-#ifdef CONFIG_PPC_EEH
- unsigned int busno = dev->bus ? dev->bus->number : 0;
- unsigned long size = dev->resource[i].end - dev->resource[i].start;
- unsigned long addr = (unsigned long)__ioremap(dev->resource[i].start + phb->io_base_phys, size, _PAGE_NO_CACHE);
- if (!addr)
- panic("fixup_resources: ioremap failed!\n");
- dev->resource[i].start = eeh_token(phb->global_number, busno, dev->devfn, addr) | eeh_disable_bit;
- dev->resource[i].end = dev->resource[i].start + size;
-#else
- unsigned long offset = (unsigned long)phb->io_base_virt;
- dev->resource[i].start += offset;
- dev->resource[i].end += offset;
-#endif
+ if (is_eeh_implemented()) {
+ unsigned int busno = dev->bus ? dev->bus->number : 0;
+ unsigned long size = dev->resource[i].end - dev->resource[i].start;
+ unsigned long addr = (unsigned long)__ioremap(dev->resource[i].start + phb->io_base_phys, size, _PAGE_NO_CACHE);
+ if (!addr)
+ panic("fixup_resources: ioremap failed!\n");
+ dev->resource[i].start = eeh_token(phb->global_number, busno, dev->devfn, addr) | eeh_disable_bit;
+ dev->resource[i].end = dev->resource[i].start + size;
+ } else {
+ unsigned long offset = (unsigned long)phb->io_base_virt;
+ dev->resource[i].start += offset;
+ dev->resource[i].end += offset;
+ }
PPCDBG(PPCDBG_PHBINIT, "\t\t-> now [%lx .. %lx]\n",
dev->resource[i].start, dev->resource[i].end);
} else if (dev->resource[i].flags & IORESOURCE_MEM) {
@@ -679,18 +680,18 @@
/* Bogus. Probably an unused bridge. */
dev->resource[i].end = 0;
} else {
-#ifdef CONFIG_PPC_EEH
- unsigned int busno = dev->bus ? dev->bus->number : 0;
- unsigned long size = dev->resource[i].end - dev->resource[i].start;
- unsigned long addr = (unsigned long)__ioremap(dev->resource[i].start + phb->pci_mem_offset, size, _PAGE_NO_CACHE);
- if (!addr)
- panic("fixup_resources: ioremap failed!\n");
- dev->resource[i].start = eeh_token(phb->global_number, busno, dev->devfn, addr) | eeh_disable_bit;
- dev->resource[i].end = dev->resource[i].start + size;
-#else
- dev->resource[i].start += phb->pci_mem_offset;
- dev->resource[i].end += phb->pci_mem_offset;
-#endif
+ if (is_eeh_implemented()) {
+ unsigned int busno = dev->bus ? dev->bus->number : 0;
+ unsigned long size = dev->resource[i].end - dev->resource[i].start;
+ unsigned long addr = (unsigned long)__ioremap(dev->resource[i].start + phb->pci_mem_offset, size, _PAGE_NO_CACHE);
+ if (!addr)
+ panic("fixup_resources: ioremap failed!\n");
+ dev->resource[i].start = eeh_token(phb->global_number, busno, dev->devfn, addr) | eeh_disable_bit;
+ dev->resource[i].end = dev->resource[i].start + size;
+ } else {
+ dev->resource[i].start += phb->pci_mem_offset;
+ dev->resource[i].end += phb->pci_mem_offset;
+ }
}
PPCDBG(PPCDBG_PHBINIT, "\t\t-> now [%lx..%lx]\n",
dev->resource[i].start, dev->resource[i].end);
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pacaData.c linuxppc64_2_4/arch/ppc64/kernel/pacaData.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pacaData.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/pacaData.c Tue Apr 9 11:23:18 2002
@@ -7,7 +7,7 @@
* 2 of the License, or (at your option) any later version.
*/
-#define __KERNEL__ 1
+#define __KERNEL__
#include
#include
#include
@@ -17,8 +17,10 @@
#include
#include
-#include
+#include
+#include
+struct naca_struct *naca;
/* The Paca is an array with one entry per processor. Each contains an
* ItLpPaca, which contains the information shared between the
@@ -32,8 +34,8 @@
*/
#define PACAINITDATA(number,start,lpq,asrr,asrv) \
{ \
- xLpPacaPtr: &xPaca[number].xLpPaca, \
- xLpRegSavePtr: &xPaca[number].xRegSav, \
+ xLpPacaPtr: &paca[number].xLpPaca, \
+ xLpRegSavePtr: &paca[number].xRegSav, \
xPacaIndex: (number), /* Paca Index */ \
default_decr: 0x00ff0000, /* Initial Decr */ \
xStab_data: { \
@@ -42,9 +44,9 @@
next_round_robin: 1 /* Round robin index */ \
}, \
lpQueuePtr: (lpq), /* &xItLpQueue, */ \
- xRtas: { \
+ /* xRtas: { \
lock: SPIN_LOCK_UNLOCKED \
- }, \
+ }, */ \
xProcStart: (start), /* Processor start */ \
xLpPaca: { \
xDesc: 0xd397d781, /* "LpPa" */ \
@@ -59,10 +61,10 @@
xSize: sizeof(struct ItLpRegSave) \
}, \
exception_sp: \
- (&xPaca[number].exception_stack[0]) - EXC_FRAME_SIZE, \
+ (&paca[number].exception_stack[0]) - EXC_FRAME_SIZE, \
}
-struct Paca xPaca[maxPacas] __page_aligned = {
+struct paca_struct paca[MAX_PACAS] __page_aligned = {
#ifdef CONFIG_PPC_ISERIES
PACAINITDATA( 0, 1, &xItLpQueue, 0, 0xc000000000005000),
#else
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pci.c linuxppc64_2_4/arch/ppc64/kernel/pci.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pci.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/pci.c Wed Apr 17 08:05:39 2002
@@ -30,12 +30,10 @@
#include
#include
#include
-#include
+#include
#include
#include
-#ifdef CONFIG_PPC_EEH
#include
-#endif
#include "pci.h"
@@ -61,11 +59,7 @@
void iSeries_pcibios_init(void);
void pSeries_pcibios_init(void);
-
-extern struct Naca *naca;
-
-int pci_assign_all_busses = 0;
-
+int pci_assign_all_busses = 0;
struct pci_controller* hose_head;
struct pci_controller** hose_tail = &hose_head;
@@ -550,23 +544,23 @@
/* Transparent resource -- don't try to "fix" it. */
continue;
}
-#ifdef CONFIG_PPC_EEH
- if (res->flags & (IORESOURCE_IO|IORESOURCE_MEM)) {
- res->start = eeh_token(phb->global_number, bus->number, 0, 0);
- res->end = eeh_token(phb->global_number, bus->number, 0xff, 0xffffffff);
- }
-#else
- if (res->flags & IORESOURCE_IO) {
- res->start += (unsigned long)phb->io_base_virt;
- res->end += (unsigned long)phb->io_base_virt;
- } else if (phb->pci_mem_offset
- && (res->flags & IORESOURCE_MEM)) {
- if (res->start < phb->pci_mem_offset) {
- res->start += phb->pci_mem_offset;
- res->end += phb->pci_mem_offset;
+ if (is_eeh_implemented()) {
+ if (res->flags & (IORESOURCE_IO|IORESOURCE_MEM)) {
+ res->start = eeh_token(phb->global_number, bus->number, 0, 0);
+ res->end = eeh_token(phb->global_number, bus->number, 0xff, 0xffffffff);
+ }
+ } else {
+ if (res->flags & IORESOURCE_IO) {
+ res->start += (unsigned long)phb->io_base_virt;
+ res->end += (unsigned long)phb->io_base_virt;
+ } else if (phb->pci_mem_offset
+ && (res->flags & IORESOURCE_MEM)) {
+ if (res->start < phb->pci_mem_offset) {
+ res->start += phb->pci_mem_offset;
+ res->end += phb->pci_mem_offset;
+ }
}
}
-#endif
}
}
#endif
@@ -759,8 +753,7 @@
/* XXX would be nice to have a way to ask for write-through */
prot |= _PAGE_NO_CACHE;
- if (!write_combine)
- prot |= _PAGE_GUARDED;
+ prot |= _PAGE_GUARDED;
vma->vm_page_prot = __pgprot(prot);
}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pci_dma.c linuxppc64_2_4/arch/ppc64/kernel/pci_dma.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pci_dma.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/pci_dma.c Fri Apr 19 13:38:07 2002
@@ -146,7 +146,7 @@
dev = ppc64_isabridge_dev;
if (!dev)
return NULL;
- if ( _machine == _MACH_iSeries ) {
+ if (naca->platform == PLATFORM_ISERIES_LPAR) {
return ISERIES_DEVNODE(dev)->DevTceTable;
} else {
return PCI_GET_DN(dev)->tce_table;
@@ -213,8 +213,6 @@
tce_addr = ((union Tce *)tbl->base) + tcenum;
*tce_addr = (union Tce)tce.wholeTce;
- /* Make sure the update is visible to hardware. */
- __asm__ __volatile__ ("sync" : : : "memory");
}
/*
@@ -427,7 +425,7 @@
unsigned char * map, * bytep;
if (order >= NUM_TCE_LEVELS) {
- panic("PCI_DMA: free_tce_range: invalid order: %d\n",order);
+ panic("PCI_DMA: free_tce_range: invalid order: 0x%x\n",order);
return;
}
@@ -475,7 +473,8 @@
* we are freeing the last block we can't buddy up
* Don't buddy up if it's in the first 1/4 of the level
*/
- if (( block > (tbl->mlbm.level[order].numBits/4) ) &&
+ if (( order < tbl->mlbm.maxLevel ) &&
+ ( block > (tbl->mlbm.level[order].numBits/4) ) &&
(( block < tbl->mlbm.level[order].numBits-1 ) ||
( 0 == ( tbl->mlbm.level[order].numBits & 1)))) {
/* See if we can buddy up the block we just freed */
@@ -549,6 +548,11 @@
++tcenum;
uaddr += PAGE_SIZE;
}
+ /* Make sure the update is visible to hardware.
+ sync required to synchronize the update to
+ the TCE table with the MMIO that will send
+ the bus address to the IOA */
+ __asm__ __volatile__ ("sync" : : : "memory");
}
else {
panic("PCI_DMA: Tce Allocation failure in get_tces. 0x%p\n",tbl);
@@ -557,88 +561,65 @@
return retTce;
}
-static void tce_free_iSeries(struct TceTable *tbl, dma_addr_t dma_addr,
- unsigned order, unsigned numPages)
+static void tce_free_one_iSeries( struct TceTable *tbl, long tcenum )
{
- u64 setTceRc;
- long tcenum, freeTce, maxTcenum;
- unsigned i;
+ u64 set_tce_rc;
union Tce tce;
+ tce.wholeTce = 0;
+ set_tce_rc = HvCallXm_setTce((u64)tbl->index,
+ (u64)tcenum,
+ tce.wholeTce);
+ if ( set_tce_rc )
+ panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", set_tce_rc);
- maxTcenum = (tbl->size * (PAGE_SIZE / sizeof(union Tce))) - 1;
-
- tcenum = dma_addr >> PAGE_SHIFT;
+}
- freeTce = tcenum - tbl->startOffset;
+static void tce_free_one_pSeries( struct TceTable *tbl, long tcenum )
+{
+ union Tce tce;
+ union Tce *tce_addr;
- if ( freeTce > maxTcenum ) {
- PPCDBG(PPCDBG_TCE, "free_tces: tcenum > maxTcenum\n");
- PPCDBG(PPCDBG_TCE, "\ttcenum = 0x%lx\n", tcenum);
- PPCDBG(PPCDBG_TCE, "\tmaxTcenum = 0x%lx\n", maxTcenum);
- PPCDBG(PPCDBG_TCE, "\tTCE Table = 0x%lx\n", (u64)tbl);
- PPCDBG(PPCDBG_TCE, "\tbus# = 0x%lx\n", (u64)tbl->busNumber );
- PPCDBG(PPCDBG_TCE, "\tsize = 0x%lx\n", (u64)tbl->size);
- PPCDBG(PPCDBG_TCE, "\tstartOff = 0x%lx\n", (u64)tbl->startOffset );
- PPCDBG(PPCDBG_TCE, "\tindex = 0x%lx\n", (u64)tbl->index);
- return;
- }
-
- for (i=0; iindex,
- (u64)tcenum,
- tce.wholeTce );
+ tce.wholeTce = 0;
+
+ tce_addr = ((union Tce *)tbl->base) + tcenum;
+ *tce_addr = (union Tce)tce.wholeTce;
- if ( setTceRc ) {
- panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", setTceRc);
- }
- ++tcenum;
- }
- free_tce_range( tbl, freeTce, order );
}
-static void tce_free_pSeries(struct TceTable *tbl, dma_addr_t dma_addr,
- unsigned order, unsigned numPages)
+static void tce_free(struct TceTable *tbl, dma_addr_t dma_addr,
+ unsigned order, unsigned num_pages)
{
- long tcenum, freeTce, maxTcenum;
+ long tcenum, total_tces, free_tce;
unsigned i;
- union Tce tce;
- union Tce *tce_addr;
- maxTcenum = (tbl->size * (PAGE_SIZE / sizeof(union Tce))) - 1;
+ total_tces = (tbl->size * (PAGE_SIZE / sizeof(union Tce)));
tcenum = dma_addr >> PAGE_SHIFT;
- // tcenum -= tbl->startOffset;
+ free_tce = tcenum - tbl->startOffset;
- freeTce = tcenum - tbl->startOffset;
-
- if ( freeTce > maxTcenum ) {
- PPCDBG(PPCDBG_TCE, "free_tces: tcenum > maxTcenum\n");
- PPCDBG(PPCDBG_TCE, "\ttcenum = 0x%lx\n", tcenum);
- PPCDBG(PPCDBG_TCE, "\tmaxTcenum = 0x%lx\n", maxTcenum);
- PPCDBG(PPCDBG_TCE, "\tTCE Table = 0x%lx\n", (u64)tbl);
- PPCDBG(PPCDBG_TCE, "\tbus# = 0x%lx\n",
- (u64)tbl->busNumber );
- PPCDBG(PPCDBG_TCE, "\tsize = 0x%lx\n", (u64)tbl->size);
- PPCDBG(PPCDBG_TCE, "\tstartOff = 0x%lx\n",
- (u64)tbl->startOffset );
- PPCDBG(PPCDBG_TCE, "\tindex = 0x%lx\n", (u64)tbl->index);
+ if ( ( (free_tce + num_pages) > total_tces ) ||
+ ( tcenum < tbl->startOffset ) ) {
+ printk("tce_free: invalid tcenum\n");
+ printk("\ttcenum = 0x%lx\n", tcenum);
+ printk("\tTCE Table = 0x%lx\n", (u64)tbl);
+ printk("\tbus# = 0x%lx\n", (u64)tbl->busNumber );
+ printk("\tsize = 0x%lx\n", (u64)tbl->size);
+ printk("\tstartOff = 0x%lx\n", (u64)tbl->startOffset );
+ printk("\tindex = 0x%lx\n", (u64)tbl->index);
return;
}
- for (i=0; ibase) + tcenum;
- *tce_addr = (union Tce)tce.wholeTce;
-
+ for (i=0; iplatform == PLATFORM_PSERIES_LPAR) {
create_tce_tables_for_busesLP(&pci_root_buses);
}
else {
@@ -795,7 +776,7 @@
/* - Tce Table Share between buses, */
/* - Tce Table per logical slot. */
/*****************************************************************/
- if(_machine == _MACH_iSeries) {
+ if(naca->platform == PLATFORM_ISERIES_LPAR) {
struct iSeries_Device_Node* DevNode = (struct iSeries_Device_Node*)token;
getTceTableParmsiSeries(DevNode,newTceTable);
@@ -819,7 +800,7 @@
dn = (struct device_node *)token;
phb = dn->phb;
- if (_machine == _MACH_pSeries)
+ if (naca->platform == PLATFORM_PSERIES)
getTceTableParmsPSeries(phb, dn, newTceTable);
else
getTceTableParmsPSeriesLP(phb, dn, newTceTable);
@@ -890,6 +871,11 @@
pciBusTceTableParms->startOffset,
pciBusTceTableParms->size);
+ if(pciBusTceTableParms->size == 0) {
+ printk("PCI_DMA: Possible Structure mismatch, 0x%p\n",pciBusTceTableParms);
+ panic( "PCI_DMA: pciBusTceTableParms->size is zero, halt here!");
+ }
+
newTceTable->size = pciBusTceTableParms->size;
newTceTable->busNumber = pciBusTceTableParms->busNumber;
newTceTable->startOffset = pciBusTceTableParms->startOffset;
@@ -1026,6 +1012,13 @@
order = get_order(size);
nPages = 1 << order;
+ /* Client asked for way to much space. This is checked later anyway */
+ /* It is easier to debug here for the drivers than in the tce tables.*/
+ if(order >= NUM_TCE_LEVELS) {
+ printk("PCI_DMA: pci_alloc_consistent size to large: 0x%lx \n",size);
+ return (void *)NO_TCE;
+ }
+
tbl = get_tce_table(hwdev);
if ( tbl ) {
@@ -1068,14 +1061,17 @@
order = get_order(size);
nPages = 1 << order;
- if ( order > 10 )
- PPCDBG(PPCDBG_TCE, "pci_free_consistent: order=%d, size=%d, nPages=%d, dma_handle=%016lx, vaddr=%016lx\n",
- order, size, nPages, (unsigned long)dma_handle, (unsigned long)vaddr );
+ /* Client asked for way to much space. This is checked later anyway */
+ /* It is easier to debug here for the drivers than in the tce tables.*/
+ if(order >= NUM_TCE_LEVELS) {
+ printk("PCI_DMA: pci_free_consistent size to large: 0x%lx \n",size);
+ return;
+ }
tbl = get_tce_table(hwdev);
if ( tbl ) {
- ppc_md.tce_free(tbl, dma_handle, order, nPages);
+ tce_free(tbl, dma_handle, order, nPages);
free_pages( (unsigned long)vaddr, order );
}
}
@@ -1104,6 +1100,13 @@
order = get_order( nPages & PAGE_MASK );
nPages >>= PAGE_SHIFT;
+ /* Client asked for way to much space. This is checked later anyway */
+ /* It is easier to debug here for the drivers than in the tce tables.*/
+ if(order >= NUM_TCE_LEVELS) {
+ printk("PCI_DMA: pci_map_single size to large: 0x%lx \n",size);
+ return NO_TCE;
+ }
+
tbl = get_tce_table(hwdev);
if ( tbl ) {
@@ -1128,14 +1131,17 @@
order = get_order( nPages & PAGE_MASK );
nPages >>= PAGE_SHIFT;
- if ( order > 10 )
- PPCDBG(PPCDBG_TCE, "pci_unmap_single: order=%d, size=%d, nPages=%d, dma_handle=%016lx\n",
- order, size, nPages, (unsigned long)dma_handle );
+ /* Client asked for way to much space. This is checked later anyway */
+ /* It is easier to debug here for the drivers than in the tce tables.*/
+ if(order >= NUM_TCE_LEVELS) {
+ printk("PCI_DMA: pci_unmap_single size to large: 0x%lx \n",size);
+ return;
+ }
tbl = get_tce_table(hwdev);
if ( tbl )
- ppc_md.tce_free(tbl, dma_handle, order, nPages);
+ tce_free(tbl, dma_handle, order, nPages);
}
@@ -1283,6 +1289,13 @@
dmaAddr = NO_TCE;
order = get_order( numTces << PAGE_SHIFT );
+ /* Client asked for way to much space. This is checked later anyway */
+ /* It is easier to debug here for the drivers than in the tce tables.*/
+ if(order >= NUM_TCE_LEVELS) {
+ printk("PCI_DMA: create_tces_sg size to large: 0x%x \n",(numTces << PAGE_SHIFT));
+ return NO_TCE;
+ }
+
/* allocate a block of tces */
tcenum = alloc_tce_range( tbl, order );
if ( tcenum != -1 ) {
@@ -1313,10 +1326,16 @@
++tcenum;
uaddr += PAGE_SIZE;
}
-
+
prevEndPage = endPage;
sg++;
}
+ /* Make sure the update is visible to hardware.
+ sync required to synchronize the update to
+ the TCE table with the MMIO that will send
+ the bus address to the IOA */
+ __asm__ __volatile__ ("sync" : : : "memory");
+
if ((tcenum - starttcenum) != numTces)
PPCDBG(PPCDBG_TCE, "create_tces_sg: numTces %d, tces used %d\n",
numTces, (unsigned)(tcenum - starttcenum));
@@ -1386,14 +1405,17 @@
numTces = ((dma_end_page - dma_start_page ) >> PAGE_SHIFT) + 1;
order = get_order( numTces << PAGE_SHIFT );
- if ( order > 10 )
- PPCDBG(PPCDBG_TCE, "pci_unmap_sg: order=%d, numTces=%d, nelms=%d, dma_start_page=%016lx, dma_end_page=%016lx\n",
- order, numTces, nelms, (unsigned long)dma_start_page, (unsigned long)dma_end_page );
+ /* Client asked for way to much space. This is checked later anyway */
+ /* It is easier to debug here for the drivers than in the tce tables.*/
+ if(order >= NUM_TCE_LEVELS) {
+ printk("PCI_DMA: pci_unmap_sg size to large: 0x%x \n",(numTces << PAGE_SHIFT));
+ return;
+ }
tbl = get_tce_table(hwdev);
if ( tbl )
- ppc_md.tce_free( tbl, dma_start_page, order, numTces );
+ tce_free( tbl, dma_start_page, order, numTces );
}
@@ -1464,11 +1486,11 @@
void tce_init_pSeries(void)
{
ppc_md.tce_build = tce_build_pSeries;
- ppc_md.tce_free = tce_free_pSeries;
+ ppc_md.tce_free_one = tce_free_one_pSeries;
}
void tce_init_iSeries(void)
{
ppc_md.tce_build = tce_build_iSeries;
- ppc_md.tce_free = tce_free_iSeries;
+ ppc_md.tce_free_one = tce_free_one_iSeries;
}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pci_dn.c linuxppc64_2_4/arch/ppc64/kernel/pci_dn.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pci_dn.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/pci_dn.c Tue Apr 9 11:23:18 2002
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
@@ -37,7 +36,7 @@
#include
#include
#include
-#include
+#include
#include
#include "pci.h"
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pmc.c linuxppc64_2_4/arch/ppc64/kernel/pmc.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/pmc.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/pmc.c Wed Apr 17 11:07:51 2002
@@ -19,22 +19,27 @@
/* Change Activity:
* 2001/06/05 : engebret : Created.
+ * 2002/04/11 : engebret : Add btmalloc code.
* End Change Activity
*/
#include
-#include
+#include
#include
#include
#include
#include
#include
+#include
+#include
#include
#include
-#include
-
-extern struct Naca *naca;
+#include
+#include
+#include
+#include
+#include
struct _pmc_sw pmc_sw_system = {
0
@@ -51,6 +56,19 @@
struct _pmc_sw_text pmc_sw_text;
struct _pmc_hw_text pmc_hw_text;
+extern pte_t *find_linux_pte( pgd_t * pgdir, unsigned long ea );
+extern pgd_t *bolted_pgd;
+
+static struct vm_struct *get_btm_area(unsigned long size, unsigned long flags);
+static int local_free_bolted_pages(unsigned long ea, unsigned long num);
+
+extern pgd_t bolted_dir[];
+pgd_t *bolted_pgd = (pgd_t *)&bolted_dir;
+
+struct vm_struct *btmlist = NULL;
+struct mm_struct btmalloc_mm = {pgd : bolted_dir,
+ page_table_lock : SPIN_LOCK_UNLOCKED};
+
char *
ppc64_pmc_stab(int file)
{
@@ -164,4 +182,166 @@
}
return(pmc_hw_text.buffer);
+}
+
+/*
+ * Manage allocations of storage which is bolted in the HPT and low fault
+ * overhead in the segment tables. Intended to be used for buffers used
+ * to collect performance data.
+ *
+ * Remaining Issues:
+ * - Power4 is not tested at all, 0xB regions will always be castout of slb
+ * - On Power3, 0xB00000000 esid is left in the stab for all time,
+ * other 0xB segments are castout, but not explicitly removed.
+ * - Error path checking is weak at best, wrong at worst.
+ *
+ * btmalloc - Allocate a buffer which is bolted in the HPT and (eventually)
+ * the segment table.
+ *
+ * Input : unsigned long size: bytes of storage to allocate.
+ * Return: void * : pointer to the kernal address of the buffer.
+ */
+void* btmalloc (unsigned long size) {
+ pgd_t *pgdp;
+ pmd_t *pmdp;
+ pte_t *ptep;
+ unsigned long ea_base, ea;
+ struct vm_struct *area;
+ unsigned long pa, pg_count, page, vsid;
+
+ size = PAGE_ALIGN(size);
+ if (!size || (size >> PAGE_SHIFT) > num_physpages) return NULL;
+
+ spin_lock(&btmalloc_mm.page_table_lock);
+
+ /* Get a virtual address region in the bolted space */
+ area = get_btm_area(size, 0);
+ if (!area) {
+ spin_unlock(&btmalloc_mm.page_table_lock);
+ return NULL;
+ }
+
+ ea_base = (unsigned long) area->addr;
+ pg_count = (size >> PAGE_SHIFT);
+
+ /* Create a Linux page table entry and an HPTE for each page */
+ for(page = 0; page < pg_count; page++) {
+ pa = get_free_page(GFP_KERNEL) - PAGE_OFFSET;
+ ea = ea_base + (page * PAGE_SIZE);
+
+ /* Get a pointer to the linux page table entry for this page
+ * allocating pmd or pte pages along the way as needed. Note
+ * that the pmd & pte pages are not themselfs bolted.
+ */
+ pgdp = pgd_offset_b(ea);
+ pmdp = pmd_alloc(&btmalloc_mm, pgdp, ea);
+ ptep = pte_alloc(&btmalloc_mm, pmdp, ea);
+
+ /* Clear any old hpte and set the new linux pte */
+ set_pte(ptep, mk_pte_phys(pa & PAGE_MASK, PAGE_KERNEL));
+
+ vsid = get_kernel_vsid(ea);
+ build_valid_hpte(vsid, ea, pa, ptep,
+ _PAGE_ACCESSED|_PAGE_COHERENT|PP_RWXX, 1);
+ }
+
+ spin_unlock(&btmalloc_mm.page_table_lock);
+ return (void*)ea_base;
+}
+
+/*
+ * Free a range of bolted pages that were allocated with btmalloc
+ */
+void btfree(void *ea) {
+ struct vm_struct **p, *tmp;
+ unsigned long size = 0;
+
+ if ((!ea) || ((PAGE_SIZE-1) & (unsigned long)ea)) {
+ printk(KERN_ERR "Trying to btfree() bad address (%p)\n", ea);
+ return;
+ }
+
+ spin_lock(&btmalloc_mm.page_table_lock);
+
+ /* Scan the bolted memory list for an entry matching
+ * the address to be freed, get the size (in bytes)
+ * and free the entry. The list lock is not dropped
+ * until the page table entries are removed.
+ */
+ for(p = &btmlist; (tmp = *p); p = &tmp->next ) {
+ if ( tmp->addr == ea ) {
+ size = tmp->size;
+ break;
+ }
+ }
+
+ /* If no entry found, it is an error */
+ if ( !size ) {
+ printk(KERN_ERR "Trying to btfree() bad address (%p)\n", ea);
+ spin_unlock(&btmalloc_mm.page_table_lock);
+ return;
+ }
+
+ /* Free up the bolted pages and remove the page table entries */
+ if(local_free_bolted_pages((unsigned long)ea, size >> PAGE_SHIFT)) {
+ *p = tmp->next;
+ kfree(tmp);
+ }
+
+ spin_unlock(&btmalloc_mm.page_table_lock);
+}
+
+static int local_free_bolted_pages(unsigned long ea, unsigned long num) {
+ int i;
+ pte_t pte;
+
+ for(i=0; inext) {
+ if (size + addr < (unsigned long) tmp->addr)
+ break;
+ addr = tmp->size + (unsigned long) tmp->addr;
+ if (addr + size > BTMALLOC_END) {
+ kfree(area);
+ return NULL;
+ }
+ }
+
+ if (addr + size > BTMALLOC_END) {
+ kfree(area);
+ return NULL;
+ }
+ area->flags = flags;
+ area->addr = (void *)addr;
+ area->size = size;
+ area->next = *p;
+ *p = area;
+ return area;
}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ppc_asm.h linuxppc64_2_4/arch/ppc64/kernel/ppc_asm.h
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ppc_asm.h Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/ppc_asm.h Wed Apr 10 12:22:27 2002
@@ -1,5 +1,5 @@
/*
- * arch/ppc/kernel/ppc_asm.h
+ * arch/ppc64/kernel/ppc_asm.h
*
* Definitions used by various bits of low-level assembly code on PowerPC.
*
@@ -13,7 +13,7 @@
#include
-#include "ppc_asm.tmpl"
+#include
#include "ppc_defs.h"
/*
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ppc_asm.tmpl linuxppc64_2_4/arch/ppc64/kernel/ppc_asm.tmpl
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ppc_asm.tmpl Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/ppc_asm.tmpl Wed Dec 31 18:00:00 1969
@@ -1,115 +0,0 @@
-/* Condition Register Bit Fields */
-
-#define cr0 0
-#define cr1 1
-#define cr2 2
-#define cr3 3
-#define cr4 4
-#define cr5 5
-#define cr6 6
-#define cr7 7
-
-
-/* General Purpose Registers (GPRs) */
-
-#define r0 0
-#define r1 1
-#define r2 2
-#define r3 3
-#define r4 4
-#define r5 5
-#define r6 6
-#define r7 7
-#define r8 8
-#define r9 9
-#define r10 10
-#define r11 11
-#define r12 12
-#define r13 13
-#define r14 14
-#define r15 15
-#define r16 16
-#define r17 17
-#define r18 18
-#define r19 19
-#define r20 20
-#define r21 21
-#define r22 22
-#define r23 23
-#define r24 24
-#define r25 25
-#define r26 26
-#define r27 27
-#define r28 28
-#define r29 29
-#define r30 30
-#define r31 31
-
-
-/* Floating Point Registers (FPRs) */
-
-#define fr0 0
-#define fr1 1
-#define fr2 2
-#define fr3 3
-#define fr4 4
-#define fr5 5
-#define fr6 6
-#define fr7 7
-#define fr8 8
-#define fr9 9
-#define fr10 10
-#define fr11 11
-#define fr12 12
-#define fr13 13
-#define fr14 14
-#define fr15 15
-#define fr16 16
-#define fr17 17
-#define fr18 18
-#define fr19 19
-#define fr20 20
-#define fr21 21
-#define fr22 22
-#define fr23 23
-#define fr24 24
-#define fr25 25
-#define fr26 26
-#define fr27 27
-#define fr28 28
-#define fr29 29
-#define fr30 30
-#define fr31 31
-
-#define vr0 0
-#define vr1 1
-#define vr2 2
-#define vr3 3
-#define vr4 4
-#define vr5 5
-#define vr6 6
-#define vr7 7
-#define vr8 8
-#define vr9 9
-#define vr10 10
-#define vr11 11
-#define vr12 12
-#define vr13 13
-#define vr14 14
-#define vr15 15
-#define vr16 16
-#define vr17 17
-#define vr18 18
-#define vr19 19
-#define vr20 20
-#define vr21 21
-#define vr22 22
-#define vr23 23
-#define vr24 24
-#define vr25 25
-#define vr26 26
-#define vr27 27
-#define vr28 28
-#define vr29 29
-#define vr30 30
-#define vr31 31
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ppc_ksyms.c linuxppc64_2_4/arch/ppc64/kernel/ppc_ksyms.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/ppc_ksyms.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/ppc_ksyms.c Thu Apr 18 09:36:37 2002
@@ -15,7 +15,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -33,9 +32,6 @@
#include
#include
#include
-#include
-#include
-#include
#include
#include
#include
@@ -74,7 +70,6 @@
long long __ashldi3(long long, int);
long long __lshrdi3(long long, int);
int abs(int);
-extern unsigned long ret_to_user_hook;
extern struct pci_dev * iSeries_veth_dev;
extern struct pci_dev * iSeries_vio_dev;
@@ -199,11 +194,10 @@
EXPORT_SYMBOL(iSeries_Read_Byte);
EXPORT_SYMBOL(iSeries_Write_Byte);
#endif /* CONFIG_PPC_ISERIES */
-#ifdef CONFIG_PPC_EEH
+#ifndef CONFIG_PPC_ISERIES
EXPORT_SYMBOL(eeh_check_failure);
EXPORT_SYMBOL(eeh_total_mmio_ffs);
-EXPORT_SYMBOL(eeh_total_mmio_reads);
-#endif /* CONFIG_PPC_EEH */
+#endif /* CONFIG_PPC_ISERIES */
#endif /* CONFIG_PCI */
EXPORT_SYMBOL(iSeries_veth_dev);
@@ -233,9 +227,6 @@
#endif
#endif
-#ifndef CONFIG_MACH_SPECIFIC
-EXPORT_SYMBOL(_machine);
-#endif
EXPORT_SYMBOL(ppc_md);
EXPORT_SYMBOL(find_devices);
@@ -249,12 +240,7 @@
#ifndef CONFIG_PPC_ISERIES
EXPORT_SYMBOL(kd_mksound);
-EXPORT_SYMBOL_NOVERS(sys_ctrler); /* tibit */
#endif
-#ifdef CONFIG_NVRAM
-EXPORT_SYMBOL(nvram_read_byte);
-EXPORT_SYMBOL(nvram_write_byte);
-#endif /* CONFIG_NVRAM */
EXPORT_SYMBOL_NOVERS(__ashrdi3);
EXPORT_SYMBOL_NOVERS(__ashldi3);
@@ -300,7 +286,5 @@
#ifdef CONFIG_SMP
EXPORT_SYMBOL(atomic_dec_and_lock);
#endif
-
-EXPORT_SYMBOL(ret_to_user_hook);
EXPORT_SYMBOL(tb_ticks_per_usec);
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/proc_pmc.c linuxppc64_2_4/arch/ppc64/kernel/proc_pmc.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/proc_pmc.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/proc_pmc.c Tue Apr 9 11:23:18 2002
@@ -26,7 +26,7 @@
*/
#include
-#include
+#include
#include
#include
#include
@@ -40,7 +40,7 @@
#include
#include
#include
-#include
+#include
/* pci Flight Recorder AHT */
extern void proc_pciFr_init(struct proc_dir_entry *proc_ppc64_root);
@@ -53,9 +53,9 @@
static struct proc_dir_entry *proc_ppc64_pmc_cpu_root[NR_CPUS] = {NULL, };
static spinlock_t proc_ppc64_lock;
-
-extern struct Naca *naca;
-
+static int proc_ppc64_page_read(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+static void proc_ppc64_create_paca(int num, struct proc_dir_entry *paca_dir);
int proc_ppc64_pmc_find_file(void *data);
int proc_ppc64_pmc_read(char *page, char **start, off_t off,
int count, int *eof, char *buffer);
@@ -107,13 +107,18 @@
if (!proc_ppc64_root) return;
spin_unlock(&proc_ppc64_lock);
+ /* /proc/ppc64/naca -- raw naca contents. Only readable to root */
+ create_proc_read_entry("naca", S_IRUSR, proc_ppc64_root, proc_ppc64_page_read, naca);
+ /* /proc/ppc64/paca/XX -- raw paca contents. Only readable to root */
+ ent = proc_mkdir("paca", proc_ppc64_root);
+ if (ent) {
+ for (i = 0; i < naca->processorCount; i++)
+ proc_ppc64_create_paca(i, ent);
+ }
+
/* Create the /proc/ppc64/pcifr for the Pci Flight Recorder. */
proc_pciFr_init(proc_ppc64_root);
-#ifdef CONFIG_PPC_EEH
- eeh_init_proc(proc_ppc64_root);
-#endif
-
proc_ppc64_pmc_root = proc_mkdir("pmc", proc_ppc64_root);
proc_ppc64_pmc_system_root = proc_mkdir("system", proc_ppc64_pmc_root);
@@ -184,6 +189,44 @@
}
}
+/* Read a page of raw data. "data" points to the start addr.
+ * Intended as a proc read function.
+ */
+static int proc_ppc64_page_read(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ int len = PAGE_SIZE - off;
+ char *p = (char *)data;
+
+ if (len > count)
+ len = count;
+ if (len <= 0)
+ return 0;
+ /* Rely on a "hack" in fs/proc/generic.c.
+ * If we could return a ptr to our own data this would be
+ * trivial (currently *start must be either an offset, or
+ * point into the given page).
+ */
+ memcpy(page, p+off, len);
+ *start = (char *)len;
+ return len;
+}
+
+/* NOTE: since paca data is always in flux the values will never be a consistant set.
+ * In theory it could be made consistent if we made the corresponding cpu
+ * copy the page for us (via an IPI). Probably not worth it.
+ *
+ */
+static void proc_ppc64_create_paca(int num, struct proc_dir_entry *paca_dir)
+{
+ struct proc_dir_entry *ent;
+ struct paca_struct *lpaca = paca + num;
+ char buf[16];
+
+ sprintf(buf, "%02x", num);
+ ent = create_proc_read_entry(buf, S_IRUSR, paca_dir, proc_ppc64_page_read, lpaca);
+}
+
/*
* Find the requested 'file' given a proc token.
*
@@ -392,7 +435,7 @@
len += sprintf( page+len, "\n events processed by processor:\n" );
for (i=0; iprocessorCount; ++i) {
len += sprintf( page+len, " CPU%02d %10u\n",
- i, xPaca[i].lpEvent_count );
+ i, paca[i].lpEvent_count );
}
return pmc_calc_metrics( page, start, off, count, eof, len );
@@ -594,7 +637,7 @@
proc_pmc_control_mode = PMC_CONTROL_CPI;
/* Indicate to hypervisor that we are using the PMCs */
- ((struct Paca *)mfspr(SPRG3))->xLpPacaPtr->xPMCRegsInUse = 1;
+ get_paca()->xLpPacaPtr->xPMCRegsInUse = 1;
/* Freeze all counters */
mtspr( MMCR0, 0x80000000 );
@@ -645,7 +688,7 @@
proc_pmc_control_mode = PMC_CONTROL_TLB;
/* Indicate to hypervisor that we are using the PMCs */
- ((struct Paca *)mfspr(SPRG3))->xLpPacaPtr->xPMCRegsInUse = 1;
+ get_paca()->xLpPacaPtr->xPMCRegsInUse = 1;
/* Freeze all counters */
mtspr( MMCR0, 0x80000000 );
@@ -695,9 +738,9 @@
v = proc_pmc_conv_int( buffer, count );
v = v & ~0x04000000; /* Don't allow interrupts for now */
if ( v & ~0x80000000 ) /* Inform hypervisor we are using PMCs */
- ((struct Paca *)mfspr(SPRG3))->xLpPacaPtr->xPMCRegsInUse = 1;
+ get_paca()->xLpPacaPtr->xPMCRegsInUse = 1;
else
- ((struct Paca *)mfspr(SPRG3))->xLpPacaPtr->xPMCRegsInUse = 0;
+ get_paca()->xLpPacaPtr->xPMCRegsInUse = 0;
mtspr( MMCR0, v );
return count;
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/process.c linuxppc64_2_4/arch/ppc64/kernel/process.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/process.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/process.c Tue Apr 9 11:23:18 2002
@@ -1,7 +1,5 @@
/*
- *
- *
- * linux/arch/ppc/kernel/process.c
+ * linux/arch/ppc64/kernel/process.c
*
* Derived from "arch/i386/kernel/process.c"
* Copyright (C) 1995 Linus Torvalds
@@ -16,7 +14,6 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
- *
*/
#include
@@ -47,7 +44,6 @@
#include
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs);
-extern unsigned long _get_SP(void);
struct task_struct *last_task_used_math = NULL;
static struct fs_struct init_fs = INIT_FS;
@@ -73,84 +69,6 @@
extern char __toc_start;
#undef SHOW_TASK_SWITCHES
-#undef CHECK_STACK
-
-#if defined(CHECK_STACK)
-unsigned long
-kernel_stack_top(struct task_struct *tsk)
-{
- return ((unsigned long)tsk) + sizeof(union task_union);
-}
-
-unsigned long
-task_top(struct task_struct *tsk)
-{
- return ((unsigned long)tsk) + sizeof(struct task_struct);
-}
-
-/* check to make sure the kernel stack is healthy */
-int check_stack(struct task_struct *tsk)
-{
- unsigned long stack_top = kernel_stack_top(tsk);
- unsigned long tsk_top = task_top(tsk);
- int ret = 0;
-
-#if 0
- /* check thread magic */
- if ( tsk->thread.magic != THREAD_MAGIC )
- {
- ret |= 1;
- printk("thread.magic bad: %08x\n", tsk->thread.magic);
- }
-#endif
-
- if ( !tsk )
- printk("check_stack(): tsk bad tsk %p\n",tsk);
-
- /* check if stored ksp is bad */
- if ( (tsk->thread.ksp > stack_top) || (tsk->thread.ksp < tsk_top) )
- {
- printk("stack out of bounds: %s/%d\n"
- " tsk_top %08lx ksp %08lx stack_top %08lx\n",
- tsk->comm,tsk->pid,
- tsk_top, tsk->thread.ksp, stack_top);
- ret |= 2;
- }
-
- /* check if stack ptr RIGHT NOW is bad */
- if ( (tsk == current) && ((_get_SP() > stack_top ) || (_get_SP() < tsk_top)) )
- {
- printk("current stack ptr out of bounds: %s/%d\n"
- " tsk_top %08lx sp %08lx stack_top %08lx\n",
- current->comm,current->pid,
- tsk_top, _get_SP(), stack_top);
- ret |= 4;
- }
-
-#if 0
- /* check amount of free stack */
- for ( i = (unsigned long *)task_top(tsk) ; i < kernel_stack_top(tsk) ; i++ )
- {
- if ( !i )
- printk("check_stack(): i = %p\n", i);
- if ( *i != 0 )
- {
- /* only notify if it's less than 900 bytes */
- if ( (i - (unsigned long *)task_top(tsk)) < 900 )
- printk("%d bytes free on stack\n",
- i - task_top(tsk));
- break;
- }
- }
-#endif
-
- if (ret)
- {
- panic("bad kernel stack");
- }
- return(ret);
-}
-#endif /* defined(CHECK_STACK) */
void
enable_kernel_fp(void)
@@ -183,10 +101,6 @@
__save_flags(s);
__cli();
-#if CHECK_STACK
- check_stack(prev);
- check_stack(new);
-#endif
#ifdef SHOW_TASK_SWITCHES
printk("%s/%d -> %s/%d NIP %08lx cpu %d root %x/%x\n",
@@ -465,7 +379,7 @@
void initialize_paca_hardware_interrupt_stack(void)
{
- extern struct Naca *naca;
+ extern struct naca_struct *naca;
int i;
unsigned long stack;
@@ -482,8 +396,8 @@
/* Store the stack value in the PACA for the processor */
- xPaca[i].xHrdIntStack = stack + (8*PAGE_SIZE) - STACK_FRAME_OVERHEAD;
- xPaca[i].xHrdIntCount = 0;
+ paca[i].xHrdIntStack = stack + (8*PAGE_SIZE) - STACK_FRAME_OVERHEAD;
+ paca[i].xHrdIntCount = 0;
}
@@ -496,7 +410,7 @@
for (i=0; i < naca->processorCount; i++) {
/* set page at the top of stack to be protected - prevent overflow */
- end_of_stack = xPaca[i].xHrdIntStack - (8*PAGE_SIZE - STACK_FRAME_OVERHEAD);
+ end_of_stack = paca[i].xHrdIntStack - (8*PAGE_SIZE - STACK_FRAME_OVERHEAD);
ppc_md.hpte_updateboltedpp(PP_RXRX,end_of_stack);
}
}
diff -uNr --exclude=CVS ../kernel.org/linux-2.4.19/arch/ppc64/kernel/prom.c linuxppc64_2_4/arch/ppc64/kernel/prom.c
--- ../kernel.org/linux-2.4.19/arch/ppc64/kernel/prom.c Fri Apr 19 11:00:33 2002
+++ linuxppc64_2_4/arch/ppc64/kernel/prom.c Mon Apr 22 16:50:19 2002
@@ -64,7 +64,7 @@
#include
#include
#include
-#include
+#include