From 784fbf5895e0d0ca8086628a660b0f9c57fa4e80 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 1 May 2011 09:11:52 -0700 Subject: Add copyright information. --- COPYING | 339 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ HEADER | 20 ++++ core-cia.h | 20 ++++ core-typhoon.h | 20 ++++ hwrpb.h | 9 ++ init.c | 20 ++++ memset.c | 23 ++++ osf.h | 270 +++++++++++++++++++++++++++++++++------------ pal.S | 227 +++++--------------------------------- pal.h | 20 ++++ printf.c | 20 ++++ protos.h | 20 ++++ sys-clipper.S | 20 ++++ sys-clipper.h | 20 ++++ sys-sx164.h | 20 ++++ 15 files changed, 795 insertions(+), 273 deletions(-) create mode 100644 COPYING create mode 100644 HEADER diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..00ccfbb --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/HEADER b/HEADER new file mode 100644 index 0000000..9a0dd32 --- /dev/null +++ b/HEADER @@ -0,0 +1,20 @@ +/* Short Description + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + diff --git a/core-cia.h b/core-cia.h index a42cea0..644fbd7 100644 --- a/core-cia.h +++ b/core-cia.h @@ -1,3 +1,23 @@ +/* Memory layout and register descriptions for the CIA/PYXIS chipset. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #ifndef CIA_H #define CIA_H diff --git a/core-typhoon.h b/core-typhoon.h index 70d85af..854d4d0 100644 --- a/core-typhoon.h +++ b/core-typhoon.h @@ -1,3 +1,23 @@ +/* Memory layout and register descriptions for the TSUNAMI/TYPHOON chipset. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #ifndef TYPHOON_H #define TYPHOON_H 1 diff --git a/hwrpb.h b/hwrpb.h index 8e8f871..134bbb0 100644 --- a/hwrpb.h +++ b/hwrpb.h @@ -1,3 +1,12 @@ +/* Layout and contents of the HardWare Resource Parameter Block (HWRPB). + + This file is copied intact from the Linux kernel. As such, it is + covered by the GNU General Public License, v2.0. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #ifndef __ALPHA_HWRPB_H #define __ALPHA_HWRPB_H diff --git a/init.c b/init.c index 6badc67..9827bee 100644 --- a/init.c +++ b/init.c @@ -1,3 +1,23 @@ +/* Initialization of the system and the HWRPB. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #include #include #include "hwrpb.h" diff --git a/memset.c b/memset.c index 4e78ffb..e8481dc 100644 --- a/memset.c +++ b/memset.c @@ -1,3 +1,26 @@ +/* The standard memset function. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + + +#include + void *memset(void *optr, int ival, unsigned long size) { unsigned long val = ival; diff --git a/osf.h b/osf.h index 78e2e70..2794cd7 100644 --- a/osf.h +++ b/osf.h @@ -1,10 +1,114 @@ /* - * Virtual Address Options: 8K byte page size - */ -#define VA_S_SIZE 43 -#define VA_S_OFF 13 -#define VA_S_SEG 10 -#define VA_S_PAGE_SIZE 8192 +***************************************************************************** +** * +** Copyright © 1993, 1994 * +** by Digital Equipment Corporation, Maynard, Massachusetts. * +** * +** All Rights Reserved * +** * +** Permission is hereby granted to use, copy, modify and distribute * +** this software and its documentation, in both source code and * +** object code form, and without fee, for the purpose of distribution * +** of this software or modifications of this software within products * +** incorporating an integrated circuit implementing Digital's AXP * +** architecture, regardless of the source of such integrated circuit, * +** provided that the above copyright notice and this permission notice * +** appear in all copies, and that the name of Digital Equipment * +** Corporation not be used in advertising or publicity pertaining to * +** distribution of the document or software without specific, written * +** prior permission. * +** * +** Digital Equipment Corporation disclaims all warranties and/or * +** guarantees with regard to this software, including all implied * +** warranties of fitness for a particular purpose and merchantability, * +** and makes no representations regarding the use of, or the results * +** of the use of, the software and documentation in terms of correctness, * +** accuracy, reliability, currentness or otherwise; and you rely on * +** the software, documentation and results solely at your own risk. * +** * +** AXP is a trademark of Digital Equipment Corporation. * +** * +***************************************************************************** +*/ + +/* +** Seg0 and Seg1 Virtual Address (VA) Format +** +** Loc Size Name Function +** ----- ---- ---- --------------------------------- +** <42:33> 10 SEG1 First level page table offset +** <32:23> 10 SEG2 Second level page table offset +** <22:13> 10 SEG3 Third level page table offset +** <12:00> 13 OFFSET Byte within page offset +*/ + +#define VA_V_SEG1 33 +#define VA_M_SEG1 (0x3FF< 32 PFN Page Frame Number +** <31:16> 16 SW Reserved for software +** <15:14> 2 RSV0 Reserved for hardware SBZ +** <13> 1 UWE User Write Enable +** <12> 1 KWE Kernel Write Enable +** <11:10> 2 RSV1 Reserved for hardware SBZ +** <9> 1 URE User Read Enable +** <8> 1 KRE Kernel Read Enable +** <7> 1 RSV2 Reserved for hardware SBZ +** <6:5> 2 GH Granularity Hint +** <4> 1 ASM Address Space Match +** <3> 1 FOE Fault On Execute +** <2> 1 FOW Fault On Write +** <1> 1 FOR Fault On Read +** <0> 1 V Valid +*/ + +#define PTE_V_PFN 32 +#define PTE_M_PFN 0xFFFFFFFF00000000 +#define PTE_V_SW 16 +#define PTE_M_SW 0x00000000FFFF0000 +#define PTE_V_UWE 13 +#define PTE_M_UWE (1< 1 CM Current Mode -** <2:0> 3 IPL Interrupt Priority Level -*/ - -#define PS_V_CM 3 -#define PS_M_CM (1< 1 CM Current Mode +** <2:0> 3 IPL Interrupt Priority Level +**/ + +#define PS_V_CM 3 +#define PS_M_CM (1< 8 SWAP Swap PALcode flag -- character 'S' -** <47:32> 16 MCHK Machine Check Error code -** <31:16> 16 SCB System Control Block vector -** <15:08> 8 WHAMI Who-Am-I identifier -** <04:00> 5 MCES Machine Check Error Summary bits -** -*/ - -#define PT16_V_MCES 0 -#define PT16_V_WHAMI 8 -#define PT16_V_SCB 16 -#define PT16_V_MCHK 32 -#define PT16_V_SWAP 48 - -/* ** Who-Am-I (WHAMI) Register Format ** ** Extent Size Name Function @@ -203,11 +337,6 @@ #define WHAMI_K_SWAP 0x53 /* Character 'S' */ -/* System Control Block stuff. */ -#define SCB_Q_SYSMCHK 0x0660 -#define SCB_Q_PROCMCHK 0x0670 - - /* * OSF/1 PAL-code-imposed page table bits */ @@ -220,4 +349,3 @@ #define _PAGE_URE 0x0200 /* xxx */ #define _PAGE_KWE 0x1000 /* used to do the dirty bit in software */ #define _PAGE_UWE 0x2000 /* used to do the dirty bit in software */ - diff --git a/pal.S b/pal.S index 8488bbd..e1e9746 100644 --- a/pal.S +++ b/pal.S @@ -1,3 +1,23 @@ +/* QEMU Emulation PALcode. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + .set noat .set nomacro .text @@ -10,14 +30,6 @@ * Create a standard kernel entry stack frame. */ -#define FRM_Q_PS 0 -#define FRM_Q_PC 8 -#define FRM_Q_GP 16 -#define FRM_Q_A0 24 -#define FRM_Q_A1 32 -#define FRM_Q_A2 40 -#define FRM_K_SIZE 48 - .macro STACK_FRAME save_ps, save_pc, temp, do_ps // Test if we're currently in user mode and \save_ps, PS_M_CM, \temp @@ -109,19 +121,7 @@ ENDFN __start */ .org 0x0080 Pal_Mchk: - mfpr p5, ptMces // Get the error summary - or p5, MCES_M_MIP, p4 // Set machine-check-in-progress - zap p4, 0x3c, p4 // Clear space for MCHK and SCB - mtpr p4, ptMces - - ldah p0, SCB_Q_PROCMCHK - or p4, p0, p4 // Merge in the SCB vector - lda p0, MCHK_K_PROC_HERR - sll p0, PT16_V_MCHK, p0 - or p4, p0, p4 // Merge in the MCHK code - mtpr p4, ptMisc - - br MchkCommon_SaveRegs + halt ENDFN Pal_Mchk /* @@ -1788,31 +1788,8 @@ ENDFN CallPal_OpcDec */ MchkBugCheck: - lda p7, MCHK_K_BUGCHECK - br 1f MchkOSBugCheck: - lda p7, MCHK_K_OS_BUGCHECK -1: sll p7, PT16_V_MCHK, p7 // Move error code into upper longword - - mfpr p4, ptMces // Get and isolate MCES bits - zap p4, 0x3c, p4 - or p4, p7, p4 // Combine MCES and error code - - ldah p7, SCB_Q_PROCMCHK // Combine SCB and MCHK bits - or p4, p7, p7 - or p7, MCES_M_MIP, p7 // Set machine-check-in-progress - mtpr p7, ptMces - -MchkCommon_SaveRegs: - mtpr v0, ptMchk0 // Save temporaries - mtpr t0, ptMchk1 - mtpr t3, ptMchk2 - mtpr t4, ptMchk3 - mtpr t5, ptMchk4 - mtpr p6, ptMchk5 // Save the exception address - - blbs p4, MchkDouble - blbs p6, MchkFromPal + halt ENDFN MchkBugCheck /* @@ -1835,11 +1812,7 @@ ENDFN MchkBugCheck */ MchkCommon: - mov 0, t4 // Assume non-retryable. - - mfpr t5, ptMisc // Load MCHK code - extwl t5, 4, t5 - andnot t5, 1, t5 + halt ENDFN MchkCommon /* @@ -1868,110 +1841,7 @@ ENDFN MchkCommon .endm MchkLogOut: - mfpr p6, ptPgp // Get address of logout frame - lda p6, laf_base(p6) !gprel - - lda t3, $laf_size - stl_p t3, laf_l_size - laf_base(p6) - stl_p t4, laf_l_flag - laf_base(p6) - - lda t3, laf_cpu_base - laf_base - stl_p t3, laf_l_cpu - laf_base(p6) - lda t3, laf_sys_base - laf_base - stl_p t3, laf_l_sys - laf_base(p6) - - STORE_IPR qemu_shadow0, laf_q_shadow - laf_base + 0x00, p6 - STORE_IPR qemu_shadow1, laf_q_shadow - laf_base + 0x08, p6 - STORE_IPR qemu_shadow2, laf_q_shadow - laf_base + 0x10, p6 - STORE_IPR qemu_shadow3, laf_q_shadow - laf_base + 0x18, p6 - STORE_IPR qemu_shadow4, laf_q_shadow - laf_base + 0x20, p6 - STORE_IPR qemu_shadow5, laf_q_shadow - laf_base + 0x28, p6 - STORE_IPR qemu_shadow6, laf_q_shadow - laf_base + 0x30, p6 - STORE_IPR qemu_shadow7, laf_q_shadow - laf_base + 0x38, p6 - - STORE_IPR pt0, laf_q_pt - laf_base + 0x00, p6 - STORE_IPR pt1, laf_q_pt - laf_base + 0x08, p6 - STORE_IPR pt2, laf_q_pt - laf_base + 0x10, p6 - STORE_IPR pt3, laf_q_pt - laf_base + 0x18, p6 - STORE_IPR pt4, laf_q_pt - laf_base + 0x20, p6 - STORE_IPR pt5, laf_q_pt - laf_base + 0x28, p6 - STORE_IPR pt6, laf_q_pt - laf_base + 0x30, p6 - STORE_IPR pt7, laf_q_pt - laf_base + 0x38, p6 - STORE_IPR pt8, laf_q_pt - laf_base + 0x40, p6 - STORE_IPR pt9, laf_q_pt - laf_base + 0x48, p6 - STORE_IPR pt10, laf_q_pt - laf_base + 0x50, p6 - STORE_IPR pt11, laf_q_pt - laf_base + 0x58, p6 - STORE_IPR pt12, laf_q_pt - laf_base + 0x60, p6 - STORE_IPR pt13, laf_q_pt - laf_base + 0x68, p6 - STORE_IPR pt14, laf_q_pt - laf_base + 0x70, p6 - STORE_IPR pt15, laf_q_pt - laf_base + 0x78, p6 - STORE_IPR pt16, laf_q_pt - laf_base + 0x80, p6 - STORE_IPR pt17, laf_q_pt - laf_base + 0x88, p6 - STORE_IPR pt18, laf_q_pt - laf_base + 0x90, p6 - STORE_IPR pt19, laf_q_pt - laf_base + 0x98, p6 - STORE_IPR pt20, laf_q_pt - laf_base + 0xa0, p6 - STORE_IPR pt21, laf_q_pt - laf_base + 0xa8, p6 - STORE_IPR pt22, laf_q_pt - laf_base + 0xb0, p6 - STORE_IPR pt23, laf_q_pt - laf_base + 0xb8, p6 - - mfpr t0, ptMchk1 - mfpr t3, ptMchk2 - mfpr t4, ptMchk3 - mfpr t5, ptMchk4 - mfpr p7, ptMchk5 - stq_p p7, laf_q_exc_addr - laf_base(p6) - - stq_p $31, laf_q_exc_sum - laf_base(p6) - stq_p $31, laf_q_exc_mask - laf_base(p6) - - STORE_IPR qemu_palbr, laf_q_pal_base - laf_base, p6 - - stq_p $31, laf_q_isr - laf_base(p6) - stq_p $31, laf_q_icsr - laf_base(p6) - stq_p $31, laf_q_icperr - laf_base(p6) - stq_p $31, laf_q_dcperr - laf_base(p6) - stq_p $31, laf_q_va - laf_base(p6) - stq_p $31, laf_q_mm_stat - laf_base(p6) - stq_p $31, laf_q_sc_addr - laf_base(p6) - stq_p $31, laf_q_sc_stat - laf_base(p6) - stq_p $31, laf_q_bc_addr - laf_base(p6) - stq_p $31, laf_q_ei_addr - laf_base(p6) - stq_p $31, laf_q_fill_syndrome - laf_base(p6) - stq_p $31, laf_q_ei_stat - laf_base(p6) - stq_p $31, laf_q_ld_lock - laf_base(p6) - - // bsr v0, Sys_MchkLogOut - - mfpr v0, ptMchk0 - - // Build the stack frame on the kernel stack and post the interrupt - mfpr p7, ptMisc - extwl p7, 4, p7 - mov p6, p4 // Stash pointer to logout - lda a1, SCB_Q_SYSMCHK - blbs p7, 0f // Check if stack frame already built - - mfpr p5, qemu_ps - mfpr p6, ptMchk5 // Reload exc_addr for double mchk - - STACK_FRAME p5, p6, p7, 0 - - mov IPL_K_MCHK, p5 // Raise IPL - mtpr p5, qemu_ps - - mfpr a1, ptMisc // Isolate SCB vector - extwl a1, 2, a1 - -0: mfpr p7, ptEntInt - lda a0, INT_K_MCHK - - lda a2, -1 // Load kseg offset - srl a2, VA_S_SIZE-1, a2 - sll a2, VA_S_SIZE-1, a2 - addq a2, p4, a2 // Pass ptr to logout area - - mfpr $gp, ptKgp - hw_ret (p7) + halt ENDFN MchkLogOut MchkDouble: @@ -2032,55 +1902,8 @@ Sys_EnterConsole: halt /* - * Allocate the logout frame. + * Allocate the initial bootup stack. */ - .section .sbss - .type laf_base,@object - .align 3 -laf_base: -laf_l_size: .long 0 -laf_l_flag: .long 0 -laf_l_cpu: .long 0 -laf_l_sys: .long 0 -laf_q_mchk_code: .quad 0 - -$las_size = . - laf_base - -laf_cpu_base: -laf_q_shadow: .skip 8*8 -laf_q_pt: .skip 8*24 -laf_q_exc_addr: .quad 0 -laf_q_exc_sum: .quad 0 -laf_q_exc_mask: .quad 0 -laf_q_pal_base: .quad 0 -laf_q_isr: .quad 0 -laf_q_icsr: .quad 0 -laf_q_icperr: .quad 0 -laf_q_dcperr: .quad 0 -laf_q_va: .quad 0 -laf_q_mm_stat: .quad 0 -laf_q_sc_addr: .quad 0 -laf_q_sc_stat: .quad 0 -laf_q_bc_addr: .quad 0 -laf_q_ei_addr: .quad 0 -laf_q_fill_syndrome: .quad 0 -laf_q_ei_stat: .quad 0 -laf_q_ld_lock: .quad 0 - -laf_sys_base: -laf_q_cpu_err0: .quad 0 -laf_q_cpu_err1: .quad 0 -laf_q_cia_err: .quad 0 -laf_q_err_mask: .quad 0 -laf_q_cia_syn: .quad 0 -laf_q_mem_err0: .quad 0 -laf_q_mem_err1: .quad 0 -laf_q_pci_err0: .quad 0 -laf_q_pci_err1: .quad 0 -laf_q_pci_err2: .quad 0 - -$laf_size = . - laf_base - .size laf_base, . - laf_base .section .bss .align 3 diff --git a/pal.h b/pal.h index 8653c28..7642447 100644 --- a/pal.h +++ b/pal.h @@ -1,3 +1,23 @@ +/* Common definitions for QEMU Emulation PALcode + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #ifndef PAL_H #define PAL_H 1 diff --git a/printf.c b/printf.c index c982353..f5c7545 100644 --- a/printf.c +++ b/printf.c @@ -1,3 +1,23 @@ +/* A reduced version of the printf function. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #include #include #include "uart.h" diff --git a/protos.h b/protos.h index 6bff767..653696d 100644 --- a/protos.h +++ b/protos.h @@ -1,3 +1,23 @@ +/* Declarations common the the C portions of the QEMU PALcode console. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #ifndef PROTOS_H #define PROTOS_H 1 diff --git a/sys-clipper.S b/sys-clipper.S index e3fc6f5..5296c91 100644 --- a/sys-clipper.S +++ b/sys-clipper.S @@ -1,3 +1,23 @@ +/* PALcode and C runtime functions for the CLIPPER system emulation. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #include "pal.h" #include SYSTEM_H diff --git a/sys-clipper.h b/sys-clipper.h index beea346..31094ff 100644 --- a/sys-clipper.h +++ b/sys-clipper.h @@ -1,3 +1,23 @@ +/* Declarations for the CLIPPER system emulation. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #ifndef SYS_CLIPPER_H #define SYS_CLIPPER_H 1 diff --git a/sys-sx164.h b/sys-sx164.h index 8198ae8..2cf6a9b 100644 --- a/sys-sx164.h +++ b/sys-sx164.h @@ -1,3 +1,23 @@ +/* Declarations for the SX164 system emulation. + + Copyright (C) 2011 Richard Henderson + + This file is part of QEMU PALcode. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text + of the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not see + . */ + #ifndef SYS_SX164_H #define SYS_SX164_H 1 -- cgit v1.1