# HG changeset patch # User jlarmour # Date 926421367 0 # Node ID 3111d98ba7b357c20bd412e27a7a315ddf826929 Initial commit of eCos version 1.1 diff --git a/packages/ChangeLog b/packages/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/ChangeLog @@ -0,0 +1,278 @@ +1998-10-23 Jesper Skov + PR 17959 + + * targets: Add wallclock and watchdog devices to SIM and powerpc + default configurations. + +1998-10-21 Jesper Skov + + * targets: Define _SOFT_FLOAT for PPC. Workaround for PR 17809. + +1998-10-16 Bart Veer + + * pkgconf.tcl: + Add a check for versions of Tcl older than 8.0, and produce + a sensible error message in those cases. + +Thu Oct 15 08:55:00 1998 John Dallaway + + * customers: + Fix typo in prebuilts for `public' customer. + +Wed Oct 14 15:50:34 1998 Tim Goodwin + + * customers: + Add prebuilts for `public' customer. + +Tue Oct 13 17:10:46 1998 Jonathan Larmour + + * targets: + Add -Wl,-static to link flags, since the up-and-coming + toolchains after 1.1 will require it. In particular anyone + using the latest devo compilers needs it. + +Tue Oct 13 14:52:50 1998 Tim Goodwin + + * pkgconf.tcl: + Fix missing package name that causes bogus error message. + +1998-10-12 Jesper Skov + + * targets: added -ffunction-sections and -fdata-sections for + powerpc. + +Mon Oct 12 18:52:35 1998 Jonathan Larmour + + * targets: + Add -Winline back into ERRFLAGS for tx39 + For PR 17319 + +1998-10-08 Gary Thomas + + * packages: + * targets: + Add support for new architecture. + +1998-10-06 John Dallaway + + * customers: + Make the PowerPC architecture part of the public release. + +1998-09-25 Bart Veer + + * pkgconf.tcl: + PR 17485: as a temporary workaround header files in the install + tree are now always deleted. This is a sub-optimal solution since + it may cause unnecessary rebuilds of the system and of application + code, but it is safe. A correct solution would require much more + work. + +1998-09-18 Bart Veer + + * pkgconf.tcl: The argument parsing code no longer tries to be + clever when parsing pathnames. Any string is accepted, and if the + filename happens to be illegal then this should result in a + reasonable error message when generating the build tree. + +Thu Sep 17 17:33:44 1998 Jesper Skov + + * targets: TX39 doesn't support GDB_DEVICE. + +Tue Sep 15 19:38:55 1998 Jonathan Larmour + + * targets: + Removed -Winline for tx39 target since this toolchain produces + warnings specific to it about not being able to inline functions + that return something more than 32 bits. + +Tue Sep 15 19:11:20 1998 David Moore + + * pkgconf.tcl: Cleaned up comments. + +Tue Sep 15 13:49:06 1998 Jesper Skov + + * targets: Cleaned up powerpc lines. + +1998-09-14 Bart Veer + + * pkgconf.tcl: + Fixes for PR 17286. After the earlier fixes for PR 17195 pkgconf + had started deleting the makefile.deps files even when it was + not always appropriate to do so. Now makefile.deps files only + get deleted if there has been a change to the configuration's + set of packages. Whenever there is such a change the file + pkgconf/pkgconf.mak gets updated, which should cause everything + to be rebuilt and new makefile.deps files to be generated. + +1998-09-11 Bart Veer + + * packages: + Added more useful aliases for the watchdog and wallclock devices. + + * pkgconf.tcl: + Fixes for PR 17195. + When it becomes necessary to clean out the build tree, + the generated makefile.deps files are now removed as well. + It was possible for these files to reference headers that + are no longer in the configuration. + When a package was disabled and then re-enabled, the + generated makefiles for the include directories would believe + incorrectly that the install/include directory was up to date + because of .stamp files. These generated makefiles no longer + rely on .stamp files for correct operation to avoid any + such problems. + + * targets: + All individual device drivers are now disabled when using + the simulator HAL packages. + +1998-09-08 Bart Veer + + * pkgconf.tcl (pkgconf::produce_misc_files): + * pkgconf/makrules.prv: + * pkgconf/makrules.tst: + * pkgconf/makrules.src: + Allow per-package make rules, for use by configuration tool. + +Tue Sep 8 14:40:57 1998 Tim Goodwin + + * targets: + Turn on selective linking for TX39. Remove `-fno-builtin'. + +Mon Sep 7 18:24:07 1998 Hugo Tyson + + * targets: + Add -finit-priority to mn10300 and tx39 for it is no longer the + default, with our latest lovely tools. + +1998-09-04 Bart Veer + + * pkgconf.tcl: pkgconf::get_current_packages { } + Hardware packages which were inappropriate for the current target + but still explicitly enabled by the user were being ignored. In + such cases the user should be able to override the settings. + + now contains #undef's for packages that are not + present. + +1998-09-03 Bart Veer + + * targets: + The tx39 simulator platform should not have the serial device + enabled. + + * pkgconf.tcl: + Changed the output of --pkgdata to match the needs of the + configuration tool. + +Thu Sep 3 15:13:42 1998 Tim Goodwin + + * packages: + + s/panx/mn10300/g + +1998-09-03 Bart Veer + + * pkgrelease.tcl: + Updated to cope with the HAL packages no longer being special. + Also tidied up some of the Tcl code and removed a few references + to ecc. + +1998-09-02 Bart Veer + + * packages: + Changed a few aliases, to improve consistency. + + * pkgconf.tcl: + Added Windows-specific support for pathnames with spaces. + + * pkgconf.tcl: + * targets: + * packages: + Changed the way HAL packages are handled. At the same time, + improved the handling of device driver packages. + +Wed Sep 2 11:38:58 1998 Tim Goodwin + + * targets: Added -finit-priority to PowerPC CXX flags. + +Mon Aug 31 11:21:10 1998 Jesper Skov + + * targets: Added -finit-priority to PowerPC CXX flags. + +1998-08-27 Bart Veer + + * pkgconf.tcl: Fix read_save_file() to report the filename + correctly. + +1998-08-25 Bart Veer + + * pkgconf.tcl: Fix definitions of array variables to work with Tcl + 8.1 + +Mon Aug 24 17:44:26 1998 Jonathan Larmour + + * packages: + Change capitalisation of error package alias + +1998-08-18 Nick Garnett + + * packages: Added "HAL Common" package. + +Mon Aug 17 22:31:58 1998 Jonathan Larmour + + * pkgconf/makrules.tst, pkgconf/makrules.prv: + Remove all -ltarget and -lgcc as we now specify them in the HAL + linker scripts + +Thu Aug 13 15:35:16 1998 Jonathan Larmour + + * pkgconf/makrules.prv, pkgconf/makrules.tst: + Add extra -ltarget as libgcc needs to have symbols resolved from + the C library + +1998-07-31 Nick Garnett + + * packages: Added watchdog device. + +Mon Jul 27 19:36:53 BST 1998 Chris Provenzano + + * packages: Added gdb pseudo device. + +1998-07-23 Bart Veer + + * pkgconf.tcl: added new argument --pkgdata for internal use only. + This results in a program-friendly listing of the available + packages. + + * Start of consistent usage of ChangeLog files throughout the + project + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/compat/uitron/current/ChangeLog b/packages/compat/uitron/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/ChangeLog @@ -0,0 +1,443 @@ +1998-10-21 Hugo Tyson + + * src/uit_func.cxx: + Provide weakly named dummies for task[1-4], which are the defaults + referred to by the task array, so that the uITRON system can be + initialized even when no uITRON tasks have been provided (so long + as no other changes to the task init configury have been made) + This does not pollute the namespace, for these are weak symbols. + Changing them to cyg_uitron_task... would be possible, but it + carries the false implication that those are cygnus names, when + they are really entirely up to the user. + + * tests/test[123456789].c: + * tests/testcxx.cxx: + * tests/testcx[23456789].cxx: + Undo the previous change: remove dummies for task[1-4] when we + decide not to test anything, they will be provided with weak names + regardles in src/uit_func.cxx. + +1998-10-20 Hugo Tyson + + * tests/test[123456789].c: + * tests/testcxx.cxx: + * tests/testcx[23456789].cxx: + Provide dummies for task[1-4] when we decide not to test anything, + to encourage correct linking. + +1998-10-16 Hugo Tyson + + * tests/testcx*.cxx (cyg_start): + [all the C++ tests] + changed cyg_start to externC so that it truly does override the + default one; this is needed for handling the "I cannot test in + this configuration" failures. Of course the C ones were C to + start with. + +1998-10-16 Hugo Tyson + + * tests/test[123456789].c: + * tests/testcxx.cxx: + * tests/testcx[23456789].cxx: + All tests are now much more self-configuring wrt turning off + if there are no uITRON objects of the right type to manipulate. + The huge (50-line) #if statement is arranged the way it is so that + clauses checking on each feature can be pasted in and out easily. + So yes, the "&& 1" at the end has a purpose. + + Here for the record is a table of feature versus test-used-in: + tsk :: 1 2 3 4 5 6 7 8 9 + sem :: 2 3 5 6 7 8 + flg :: 2 5 6 7 + mbx :: 2 5 6 7 + mpl :: 2 5 7 9 + mpf :: 2 5 7 9 + alm :: 4 + cyc :: 4 + + +1998-10-16 Hugo Tyson + + * tests/test9.c: + * tests/testcx9.cxx: + New tests, test create and delete of memory pools + +1998-10-15 Hugo Tyson + + * include/pkgconf/uitron.h: + Add configury for create/delete of memory pools. + Tidy up naming of initializer macros to use for non-existent + (initially) uITRON objects. + Improve comments in CDL-- info fields. + + * include/uit_func.h: + Add prototypes for cre/del_mpf/mpl(). + + * include/uit_func.inl: + Implement cre/del_mpf/mpl(). + + * src/uit_objs.cxx: + Support CYG_UIT_MEMPOOLFIXED_NOEXS/CYG_UIT_MEMPOOLVAR_NOEXS(...) + mempool construction macros for non-existent (initially) mempools. + Rename _NONE construction macros to _NOEXS which will make a lot + more sense to uITRON folks. + +1998-10-14 Hugo Tyson + + * include/pkgconf/uitron.h: + Add configury for create/delete of tasks. + + * include/uit_func.h: + Add prototypes for cre/del_tsk(); correct comment in exd_tsk(). + + * include/uit_func.inl: + Implement cre/del_tsk() and complete exd_tsk(). + Improve NULL/NADR checking on other cre/del calls. + + * src/uit_func.cxx (cyg_uitron_start): + Deal better with start tasks stuff, for task create/delete. + + * src/uit_objs.cxx: + Support CYG_UIT_TASK_NONE(...) task constructor for those tasks + which do not initially exist + + * tests/PKGconf.mak: + Add new tests test8.c, testcx[678].cxx to the build. + + * tests/test6.c: + Tidy comments, untabify. + + * tests/test7.c: + Tidy comments, untabify, test creation with NADR record pointer. + No impact from the new cre/del_tsk() functionality on test7, since + a task may only be deleted when it is dormant, so deletion is NOT + another way out of a waiting state. + + * tests/test8.c: + New test, tests cre_tsk() and del_tsk() and exd_tsk() ie. the + creation and deletion of tasks. + + * tests/testcx6.cxx: + * tests/testcx7.cxx: + * tests/testcx8.cxx: + New tests, C++ versions of tests 6, 7, and 8. + +1998-10-09 Hugo Tyson + + * tests/test7.c: + Test interactions with deleting objects (as applicable) and + killing, signalling and the like. Also test killing the task + after other treatments more generically. + + * tests/test6.c (task1): + Change "N/A:" to "N/A" in the exit message when we didn't actually + do any testing due to create/delete being disabled for all object + types. + +1998-10-08 Hugo Tyson + + In general, these changes are to support create/delete of uITRON + objects; this requires that an object can be destroyed whilst + there are threads waiting on it, and that they shall be awoken + with a specific return code E_DLT. The implementation uses an + array of pointers in addition to the array of objects: ptrs[N] + should either be NULL or &objs[N] in this version. That + restriction is not checked, in order that in future, true dynamic + allocation can be used, and ptrs[N] could point anywhere. The + implications of this are mainly in the area of getting the + addresses of objects, via the ptr array or from the object array? + The config of whether there is a ptr array is per object type. + + * include/pkgconf/uitron.h: + Configury of the existence or not of create/delete for object + type: initially only SEMAS, MBOXES, FLAGS. + Configury of the number of objects created initially, if cre/del + are enabled. + + * tests/test6.c: + * tests/test7.c: + * tests/PKGconf.mak: + Two new test programs (duh!): test6 tests create and delete of + SEMAS, MBOXES, FLAGS explicitly, for bad params handling, ability + to use after deletion and recreation &c &c. test7 tests the + semantics of sleeping on some synchronization primitive, permed + with suspension, signalling, killing, releasing and so forth. + Both will migrate into C++ versions also in future. + + * include/uit_func.h: + Enable cre/del_{mbx,flg,sem} prototypes. + + * include/uit_func.inl: + Implement cre/del_{mbx,flg,sem} depending on configury, and handle + the pointer arrays generally in other client routines. + + * include/uit_objs.hxx: + Define the pointer arrays for access to created objects. + + * include/uit_type.h: + Enable definitions of the structures used in create calls. + + * src/uit_func.cxx: + Initialization code for the pointer arrays, akin to the task + startup code. + + * src/uit_objs.cxx: + Instantiate the pointer arrays themselves. + + +1998-09-25 Bart Veer + + * include/pkgconf/uitron.h: + PR 17482: added #ifdef protection. If CYGPKG_UITRON_MEMPOOLFIXED + is not defined then the contained option + CYGNUM_UITRON_MEMPOOLFIXED may not be defined either. Ditto for + CYGNUM_UITRON_MEMPOOLVAR which suffers from the same problem. + And ditto for CYGPKG_UITRON_SEMAS + +1998-09-20 Mark Galassi + + * include/pkgconf/uitron.h: added one or two CDL doc strings. + +Tue Sep 15 19:12:28 1998 David Moore + + * include/pkgconf/uitron.h: Cleaned up comments. + +1998-09-12 Mark Galassi +small changes to the descriptive information in the uITRON CDL + +1998-09-12 Mark Galassi + + * include/pkgconf/uitron.h: small editing of the description + fields: renamed things like to NAME, so that it does not + confuse SGML when incorporated into the documentation. + Also added various "doc" fields to the CFG_DATA comments. + +Wed Sep 9 18:36:15 1998 Hugo Tyson + + * include/uit_func.inl: + * include/uit_objs.hxx: + * src/uit_objs.cxx: + Condition features on CYGPKG_UITRON_SEMAS [for example] as well as + 0 < CYG_UITRON_NUM( SEMAS ) so that we get warning free + compilation with no semas enabled. Ditto for flags, mboxes, + mempools fixed and variable, alarms and cyclics. + + * include/pkgconf/uitron.h: + Add a couple of requires statements from cyclics and alarms on the + kernel clock. + Also change some grammar after review. + Add an option (actually a pair, makes it better documentation IMO) + to require strict semantics from the kernel setup. + Add an option to control the optional sema initializer; it was + omitted since the editor way of configury used a #if 0. + +Fri Sep 4 17:54:29 1998 Hugo Tyson + + * include/pkgconf/uitron.h: + Remove redundant and now unnecessary defs of CYGPKG_UITRON. + +Wed Sep 2 19:06:17 1998 Hugo Tyson + + * include/uit_func.inl: + Memory pools and message boxes and flags + and cnt_sem2-type semaphores now all have absolute timeouts + instead of relative ones in the timely wait functions. + We add in the current time here first. + +Wed Sep 2 16:45:40 1998 Hugo Tyson + + * include/pkgconf/uitron.h (CYGDAT_UITRON_TASK_INITIALIZERS): + Use the new kernel thread initializer with priority and thread + name in it. + + * include/uit_func.inl: + * include/uit_objs.hxx: + * src/uit_func.cxx (cyg_uitron_start): + * src/uit_objs.cxx: + Our tasks are now Cyg_Threads rather than a derived class. + Original priorities of tasks are held in an array. An accessor + macro is used for the off-by-one nature of uitron IDs. The array + of original priorities is set up in cyg_uitron_start(), and + created in uit_objs.cxx. + +Wed Sep 2 15:15:26 1998 Hugo Tyson + + * include/pkgconf/uitron.h: + Comment more strongly in the 'description' that the number of + initializers better match the number of things specified. + +Tue Sep 1 19:00:02 1998 Hugo Tyson + + * include/uit_objs.hxx: + Do not include ; it is deprecated. + Instead, include only kernel headers that are needed. + + * include/uit_func.inl (ref_sys): + Use new kernel function Cyg_Interrupt::interrupts_enabled() + instead of a state variable. Tidy up associated code. + Include kernel headers that are needed because they were not + included in uit_objs.hxx for tidiness. + + * src/uit_func.cxx: + Elide state variable that used to be used for tracking interrupt + enabledness state. + + * tests/testcx5.cxx (task1): + * tests/test5.c (task1): + Test interrupt enable and disable stuff, and status reporting. + +Tue Sep 1 15:12:29 1998 Hugo Tyson + + * include/uit_func.inl (ref_mpf): + Change comment "ECC" to "eCos". + +1998-08-28 Bart Veer + + * include/uit_func.inl: + * tests/test1.c, tests/test2.c, tests/test3.c, tests/test4.c, + tests/test5.c, tests/testcxx.cxx, tests/testcx2.cxx, + tests/testcx3.cxx, tests/testcx4.cxx, tests/testcx5.cxx: + + Updated for new kernel configuration option symbol names + + +Fri Aug 28 09:21:55 1998 Jonathan Larmour + + * src/uit_func.cxx (cyg_uitron_start): + Remove call to Cyg_Scheduler::start() and adjust comments to + explain where to call it from + + * tests/test1.c, tests/test2.c, tests/test3.c, tests/test4.c, + tests/test5.c, tests/testcxx.cxx, tests/testcx2.cxx, + tests/testcx3.cxx, tests/testcx4.cxx, tests/testcx5.cxx: + Change the normal entry point at the top to be cyg_package_start() + under the new startup scheme. This overrides the default package + configuration and ensure cyg_uitron_start() gets called. + Change the "default" entry point at the bottom (when the test is + N/A for some reason) to cyg_start() under the new startup scheme. + +Wed Aug 26 18:20:47 1998 Hugo Tyson + + * include/pkgconf/uitron.h: + Initial version of cdl control statements for config options. + All very groovy, and looking good IMO. + A few FIX-MEs remain, no big deal. + +Mon Aug 24 19:05:52 1998 Hugo Tyson + + * include/pkgconf/uitron.h: + Change the names of config options to helpful, positive sense, and + tidy some of the names for inclusion in the GUI tool. Clean up + the namespace too. + + * include/uit_func.h: + * include/uit_func.inl: + * src/uit_func.cxx: + * src/uit_objs.cxx: + Configure according to new option names and object construction + macros. Simple changes but widespread. + + * tests/test[12345].c: + * tests/testcx[x2345].cxx: + Configure according to new option names. + Make it main( void ) to avoid a warning. + +Fri Aug 21 18:45:16 1998 Hugo Tyson + + * tests/testcx4.cxx (task1): + * tests/test4.c (task1): + * include/uit_func.inl (def_alm): + Tidy the alarm and timer funcs in the course of fixing a kernel + bug actually. Test the functionality affected by the kernel + change a bit more. + +Thu Aug 20 14:33:36 1998 Hugo Tyson + + * include/uit_func.inl (ref_alm): + Elide an unused variable following the previous change. + +Mon Aug 17 15:45:07 1998 Hugo Tyson + + * include/pkgconf/uitron.h: + Add the config option CYGSEM_UITRON_PARAMS_CHECK_NADR_ONLY. + + * tests/testcxx.cxx: + * tests/testcx2.cxx: + * tests/testcx4.cxx: + Avoid testing with NULL as a bad parameter when only NADR is + checked. (NADR does not cast to any-pointer in C++ so we don't + test it in these programs) Check for NADR various places as well + as NULL. + + * tests/test1.c (task1): + * tests/test2.c (task1): + * tests/test4.c (task1): + Avoid testing with NULL as a bad parameter when only NADR is + checked. Check for NADR various places as well as NULL, and test + NADR as a bad param as well as NULL. + + +Mon Aug 17 14:45:30 1998 Hugo Tyson + + * include/uit_func.inl: + PR# 16536: Check for dormant tasks various places; E_OBJ + must be returned. All this error checking rather bloats the code, + unfortunately. + + * tests/testcxx.cxx: + * tests/test1.c: + Test the new checks above. + +Fri Aug 14 17:41:35 1998 Hugo Tyson + + * include/uit_func.inl ([t]wai/pol_flg): + Check for zero in a wait-for-flag operation; such a wait can never + be awakened, and so should return E_PAR. + + * tests/testcx2.cxx (task1): + * tests/test2.c (task1): + Test the above new checking. + +Fri Jul 24 17:12:54 1998 Hugo Tyson + + PR#15865 + * include/uit_func.inl: return a bool (strictly 1 or 0) for wtsk + rather than -1 or zero as the spec implies. + ref_flg() ref_sem() only affected. + +Fri Jul 24 13:26:51 1998 Hugo Tyson + + PR#16531 + * include/uit_func.inl: return E_OBJ when (force)resuming a + non-suspended task. + * tests/test1.c: test for that error code. + * tests/testcxx.cxx: test for that error code. + +Fri Jul 24 13:02:46 1998 Hugo Tyson + + * Changelog: Initial ChangeLog entry. + + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/compat/uitron/current/include/pkgconf/uitron.h b/packages/compat/uitron/current/include/pkgconf/uitron.h new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/include/pkgconf/uitron.h @@ -0,0 +1,1077 @@ +#ifndef CYGONCE_PKGCONF_UITRON_H +#define CYGONCE_PKGCONF_UITRON_H +//=========================================================================== +// +// pkgconf/uitron.h +// +// uITRON configuration file +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-16 +// Purpose: uITRON configuration file +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// The layout of the uITRON Compatibility layer source code is documented in +// ...//compat/uitron//include/uit_func.h + + +// First get external global configuration in force: +#include + +// The basic question: is the uITRON package provided at all? + +#ifdef CYGPKG_UITRON + +/* --------------------------------------------------------------------- + * Define an overall package for the UITRON Compatibility layer. Then + * create additional packages for the various different UITRON's currently + * available. + * + * Thought: Can we get a real 'mu' out of this in uITRON throughout? + * It's \265 in C strings, in iso_8859_1 + * + * + * {{CFG_DATA + cdl_package CYGPKG_UITRON { + display "eCos uITRON Compatibility Layer" + type boolean + requires CYGPKG_KERNEL + description "eCos supports a uITRON Compatibility Layer, providing + full Level S (Standard) compliance with Version 3.02 of + the uITRON Standard, plus many Level E (Extended) features. + uITRON is the premier Japanese embedded RTOS standard." + doc ref/ecos-ref/micro-itron-api.html + } + + }}CFG_DATA */ + +// ------------------------------------------------------------------------ +// Conformance check +// ------------------------------------------------------------------------ +/* {{CFG_DATA + cdl_option CYGIMP_UITRON_STRICT_CONFORMANCE { + display "Check Strict uITRON Standards Conformance" + parent CYGPKG_UITRON + type radio + description "Require the rest of the system configuration + to match the needs of strict uITRON standards conformance. + This option can only be set if the rest of the system is + configured correctly for uITRON semantics, for example + there must be a realtime clock, a suitable scheduler, and no + timeslicing. + Of course a system without this selected can be completely + conformant; this is here to help you check." + doc ref/ecos-ref/micro-itron-api.html + requires CYGVAR_KERNEL_COUNTERS_CLOCK + requires CYGSEM_KERNEL_SCHED_MLQUEUE + requires !CYGSEM_KERNEL_SCHED_TIMESLICE + requires CYGFUN_KERNEL_THREADS_TIMER + } + cdl_option CYGIMP_UITRON_LOOSE_CONFORMANCE { + display "System configuration overrides uITRON" + parent CYGPKG_UITRON + type radio + description "Do not require the rest of the system configuration + to match the needs of strict uITRON standards conformance. + For example a bitmap scheduler, or timeslicing, can be used + with the uITRON functions, but such an environment is not + strictly conformant with the uITRON specification. + Of course a system with this selected can be completely + conformant; but it is up to you to configure it correctly." + doc ref/ecos-ref/micro-itron-api.html + } + }}CFG_DATA */ +#undef CYGIMP_UITRON_STRICT_CONFORMANCE +#define CYGIMP_UITRON_LOOSE_CONFORMANCE + +// ------------------------------------------------------------------------ +// uITRON FUNCTION CALLS +// ------------------------------------------------------------------------ + +// If compiling with a C++ compiler, uITRON functions can be inline: +// define this to make it so. + +/* {{CFG_DATA + cdl_option CYGIMP_UITRON_INLINE_FUNCS { + display "Inline Functions" + parent CYGPKG_UITRON + type boolean + description "If compiling your application with a C++ compiler, + uITRON functions can be inline: set this to make it so. + Inlining functions often increases execution speed, + though possibly at the cost of a larger executable, + depending on what functions are used. + Do NOT set this if compiling your application + in plain C." + doc ref/ecos-ref/micro-itron-api.html + } + }}CFG_DATA */ +#undef CYGIMP_UITRON_INLINE_FUNCS + +// If not using inline functions, then uITRON functions are out-of-line; by +// default they have plain 'C' linkage ie. their names are extern 'C' in +// the C++ world and unadorned in the C world. To give them C++ names (NOT +// useable by plain 'C' programs), define this: + +/* {{CFG_DATA + cdl_option CYGIMP_UITRON_CPP_OUTLINE_FUNCS { + display "C++ Function Names" + parent CYGPKG_UITRON + type boolean + description "If compiling your application with a C++ compiler, + uITRON functions can be given C++ style mangled names: + set this to make it so. + This option may make debugging your program easier, + depending on your development environment. + Do NOT set this if compiling your application + in plain C." + doc ref/ecos-ref/micro-itron-api.html + } + }}CFG_DATA */ +#undef CYGIMP_UITRON_CPP_OUTLINE_FUNCS + +// When an application is fully debugged it might be useful to remove the +// code which checks parameters in the uITRON function calls. To use +// asserts [CYG_ASSERT()] instead - which are compiled to nothing in +// release flavored builds - define this: + +/* {{CFG_DATA + cdl_option CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS { + display "Return Error Codes for Bad Params" + parent CYGPKG_UITRON + type boolean + description "When an application is fully debugged there is no need + to check for bad parameters on every system call, for those + parameters which are typically pointers or constants. + Removing the checking code saves space + and improves performance: set this to make it so. + When this option is set, the correctness of parameters + is asserted using CYG_ASSERT() which compiles to + nothing in a non-debug configuration." + doc ref/ecos-ref/micro-itron-api.html + } + }}CFG_DATA */ +#define CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + +// By default both C's NULL and uITRON's NADR are treated as bad addresses; +// but some controllers might have memory at address zero, and want to use +// it. In that case, prevent NULL being bounced by enabling this: + +/* {{CFG_DATA + cdl_option CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR { + display "NULL is a good pointer" + parent CYGPKG_UITRON + type boolean + description "uITRON deliberately defines the constant NADR (-1) for + use as an invalid memory address. + The value -1 is chosen to allow working in microcontrollers + which have real memory at address zero, the traditional 'C' + NULL pointer. + By default, uITRON functions check for both NULL and NADR as + bad addresses: set this option to prevent checking for + NULL and allow pointers to address zero to be used." + doc ref/ecos-ref/micro-itron-api.html + } + }}CFG_DATA */ +#undef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + + +// ------------------------------------------------------------------------ +// uITRON KERNEL OBJECTS +// ------------------------------------------------------------------------ +// First, simple synchronisation objects without complex initialization: +// semaphores, message or mail boxes and flags. Declare how many of each +// will exist in the system. They will be statically created with default +// initialization, ready for use. Their IDs in the uITRON sense are from 1 +// to the value of the appropriate symbol below: + +/* {{CFG_DATA + cdl_component CYGPKG_UITRON_SEMAS { + display "Semaphores" + type boolean + parent CYGPKG_UITRON + description "uITRON Semaphore objects are used with functions + named xxx_sem(); they support traditional semaphore + semantics." + } + cdl_option CYGNUM_UITRON_SEMAS { + display "Number of semaphores" + parent CYGPKG_UITRON_SEMAS + type count + legal_values 1 to 65535 + description "The number of uITRON semaphores + present in the system. + Valid semaphore object IDs will range + from 1 to this value." + } + cdl_component CYGPKG_UITRON_SEMAS_CREATE_DELETE { + display "Support create and delete" + parent CYGPKG_UITRON_SEMAS + type boolean + description "Support + semaphore + create and delete operations + (cre_sem, del_sem). + Otherwise all semaphores are created, + up to the number specified above." + } + cdl_option CYGNUM_UITRON_SEMAS_INITIALLY { + display "Number of semaphores created initially" + parent CYGPKG_UITRON_SEMAS_CREATE_DELETE + type count + legal_values 0 to 65535 + description "The number of uITRON semaphores initially created. + This number should not be more than the number + of semaphores in the system, though setting it to a large + value to mean 'all' is acceptable. + Initially, only semaphores numbered 1 to this number exist; + higher numbered ones must be created before use. + It is only useful to initialize semaphores up to this number; + higher numbered ones must be created in order to use them, + and so they will be re-initialized." + + } + cdl_component CYGPKG_UITRON_SEMAS_ARE_INITIALIZED { + display "Initialize semaphore counts" + parent CYGPKG_UITRON_SEMAS + type boolean + description "Initialize semaphores to specific count values. + Otherwise semaphores are initialized with the count + set to zero." + } + cdl_option CYGDAT_UITRON_SEMA_INITIALIZERS { + display "Static initializers" + parent CYGPKG_UITRON_SEMAS_ARE_INITIALIZED + type multiline + description "A list of initializers separated by commas, + one per line. + An initializer is 'CYG_UIT_SEMA(INITIAL-COUNT)' + or 'CYG_UIT_SEMA_NOEXS' for slots above the number + initially to be created, when create and delete + operations are supported. + Note: this option is invoked in the context of a + C++ array initializer, between curly brackets. + Ensure that the number of initializers here exactly + matches the total number of semaphores specified." + } + }}CFG_DATA */ + +// Counting Semaphores: xxx_sem() ops in uITRON. +#define CYGPKG_UITRON_SEMAS +#define CYGNUM_UITRON_SEMAS 3 +#undef CYGPKG_UITRON_SEMAS_ARE_INITIALIZED + +// Optionally initialize in terms of CYG_UIT_SEMA( initial_count ): +#ifdef CYGPKG_UITRON_SEMAS +#ifdef CYGPKG_UITRON_SEMAS_ARE_INITIALIZED +#if 0 < CYGNUM_UITRON_SEMAS +#define CYGDAT_UITRON_SEMA_INITIALIZERS \ + CYG_UIT_SEMA( 1 ), \ + CYG_UIT_SEMA( 0 ), \ + CYG_UIT_SEMA( 99 ) +#endif +#endif // CYGPKG_UITRON_SEMAS_ARE_INITIALIZED + +#define CYGPKG_UITRON_SEMAS_CREATE_DELETE + +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE +#define CYGNUM_UITRON_SEMAS_INITIALLY 3 +#endif // CYGPKG_UITRON_SEMAS_CREATE_DELETE + +#endif // CYGPKG_UITRON_SEMAS + +/* {{CFG_DATA + cdl_component CYGPKG_UITRON_MBOXES { + display "Mailboxes" + type boolean + parent CYGPKG_UITRON + description "uITRON Mailbox objects are used with functions + named xxx_msg() and xxx_mbx(); they support + passing addresses (of 'messages') between tasks + in a safe manner." + } + cdl_option CYGNUM_UITRON_MBOXES { + display "Number of mailboxes" + parent CYGPKG_UITRON_MBOXES + type count + legal_values 1 to 65535 + description "The number of uITRON mailboxes + present in the system. + Valid mailbox object IDs will range + from 1 to this value." + } + cdl_component CYGPKG_UITRON_MBOXES_CREATE_DELETE { + display "Support create and delete" + parent CYGPKG_UITRON_MBOXES + type boolean + description "Support + mailbox + create and delete operations + (cre_mbx, del_mbx). + Otherwise all mailboxes are created, + up to the number specified above." + } + cdl_option CYGNUM_UITRON_MBOXES_INITIALLY { + display "Number of mailboxes created initially" + parent CYGPKG_UITRON_MBOXES_CREATE_DELETE + type count + legal_values 0 to 65535 + description "The number of uITRON mailboxes initially created. + This number should not be more than the number + of mailboxes in the system, though setting it to a large + value to mean 'all' is acceptable. + Initially, only mailboxes numbered 1 to this number exist; + higher numbered ones must be created before use." + } + }}CFG_DATA */ + +// Message Boxes: xxx_msg() ops in uITRON. +#define CYGPKG_UITRON_MBOXES +#define CYGNUM_UITRON_MBOXES 4 + +#ifdef CYGPKG_UITRON_MBOXES + +#define CYGPKG_UITRON_MBOXES_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE +#define CYGNUM_UITRON_MBOXES_INITIALLY 4 +#endif // CYGPKG_UITRON_MBOXES_CREATE_DELETE +#endif // CYGPKG_UITRON_MBOXES + +/* {{CFG_DATA + cdl_component CYGPKG_UITRON_FLAGS { + display "Eventflags" + type boolean + parent CYGPKG_UITRON + description "uITRON Eventflag objects are used with functions + named xxx_flg(); they support communication between + tasks by means of setting and clearing bits in a word + or flag value. + Waiting for all or any of a set of bits is supported." + } + cdl_option CYGNUM_UITRON_FLAGS { + display "Number of event flags" + parent CYGPKG_UITRON_FLAGS + type count + legal_values 1 to 65535 + description "The number of uITRON eventflag + objects present in the system. + Valid eventflag object IDs will range + from 1 to this value." + } + cdl_component CYGPKG_UITRON_FLAGS_CREATE_DELETE { + display "Support create and delete" + parent CYGPKG_UITRON_FLAGS + type boolean + description "Support + eventflag + create and delete operations + (cre_flg, del_flg). + Otherwise all eventflags are created, + up to the number specified above." + } + cdl_option CYGNUM_UITRON_FLAGS_INITIALLY { + display "Number of eventflags created initially" + parent CYGPKG_UITRON_FLAGS_CREATE_DELETE + type count + legal_values 0 to 65535 + description "The number of uITRON eventflags initially created. + This number should not be more than the number + of eventflags in the system, though setting it to a large + value to mean 'all' is acceptable. + Initially, only eventflags numbered 1 to this number exist; + higher numbered ones must be created before use." + } + }}CFG_DATA */ + +// Flags: xxx_flg ops in uITRON. +#define CYGPKG_UITRON_FLAGS +#define CYGNUM_UITRON_FLAGS 5 + +#ifdef CYGPKG_UITRON_FLAGS + +#define CYGPKG_UITRON_FLAGS_CREATE_DELETE + +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE +#define CYGNUM_UITRON_FLAGS_INITIALLY 5 +#endif // CYGPKG_UITRON_FLAGS_CREATE_DELETE +#endif // CYGPKG_UITRON_FLAGS + +// ------------------------------------------------------------------------ +// Next, uITRON tasks. These must be initialized, and the number of them +// must match the number of entries in the initializer definition. +// +// CYGNUM_UITRON_TASKS defines the number of tasks; they are numbered 1 +// through CYGNUM_UITRON_TASKS. +// +// CYGDAT_UITRON_TASK_EXTERNS is used to declare external symbols which are +// used in the initializations, typically the addresses of the functions who +// implement each of the tasks. Other objects might also be declared, for +// example stack data or scratch data which is used by the tasks. +// +// CYGDAT_UITRON_TASK_INITIALIZERS defines a list of CYG_UIT_TASK() +// initializers, separated by commas. The number of these defines how many +// uITRON tasks exist in the system. +// +// Both of these symbols must be defined. +// +// Task IDs in the uITRON sense are from 1 to the number of uITRON tasks +// which exist in the system, defined by CYGDAT_UITRON_TASK_INITIALIZERS. +// +// Tasks are dormant by default from the start; they must be resumed in +// order to run when the scheduler starts. Code to do this is provided in +// the uITRON package; it is present if this symbol is defined, and can be +// called from plain C code: +// CYGNUM_UITRON_START_TASKS > 0: start tasks 1.. +// CYGNUM_UITRON_START_TASKS = 0: start all uITRON tasks +// ie. 1..CYGNUM_UITRON_TASKS +// +// Alternatively, an expert programmer could start the uITRON tasks +// individually using the C++ system calls on the static array of tasks +// declared in uit_objs.hxx + +/* {{CFG_DATA + cdl_component CYGPKG_UITRON_TASKS { + display "Tasks" + type dummy + parent CYGPKG_UITRON + description "uITRON Tasks are the basic blocks of multi-tasking + in the uITRON world; they are threads or lightweight + processes, sharing the address space and the CPU. + They communicate using the primitives outlined above. + Each has a stack, an entry point (a C or C++ function), + and (where appropriate) a scheduling priority." + } + cdl_option CYGNUM_UITRON_TASKS { + display "Number of tasks" + parent CYGPKG_UITRON_TASKS + type count + legal_values 1 to 65535 + description "The number of uITRON tasks + present in the system. + Valid task object IDs will range + from 1 to this value." + } + cdl_option CYGNUM_UITRON_START_TASKS { + display "Start tasks" + parent CYGPKG_UITRON_TASKS + type count + legal_values 0 to 65535 + description "The number of uITRON tasks + to start automatically. + Tasks from 1 to this value will be started + at the beginning of application execution. + A value of zero here means to start them all. + Tasks started in this way have a start code of + zero, as if they were started by sta_tsk(i,0). + If create and delete operations are supported, + this number should be no greater than the number + of tasks created initially." + } + cdl_component CYGPKG_UITRON_TASKS_CREATE_DELETE { + display "Support create and delete" + parent CYGPKG_UITRON_TASKS + type boolean + description "Support + task + create and delete operations + (cre_tsk, del_tsk). + Otherwise all tasks are created, + up to the number specified above." + } + cdl_option CYGNUM_UITRON_TASKS_INITIALLY { + display "Number of tasks created initially" + parent CYGPKG_UITRON_TASKS_CREATE_DELETE + type count + legal_values 1 to 65535 + description "The number of uITRON tasks initially created. + This number should not be more than the number + of tasks in the system, though setting it to a large + value to mean 'all' is acceptable. + Initially, only tasks numbered 1 to this number exist; + higher numbered ones must be created before use." + } + cdl_option CYGNUM_UITRON_STACK_SIZE { + display "Default stack size" + parent CYGPKG_UITRON_TASKS + type count + legal_values 128 to 0x7FFFFFFF + description "Define a default stack size for uITRON tasks, + for use in the initialization options below." + } + cdl_option CYGDAT_UITRON_TASK_EXTERNS { + display "Externs for initialization" + parent CYGPKG_UITRON_TASKS + type multiline + description "Task initializers may refer to external objects + such as memory for stack or functions to call. + Use this option to define or declare any external + objects needed by the task static initializer below. + Example: create some memory for a stack using + 'static char stack1[CYGNUM_UITRON_STACK_SIZE];' + to set up a chunk of memory of the default stack size. + Note: this option is invoked in the 'outermost' context + of C++ source, where global/static objects are created; + it should contain valid, self-contained, C++ source." + } + cdl_option CYGDAT_UITRON_TASK_INITIALIZERS { + display "Static initializers" + parent CYGPKG_UITRON_TASKS + type multiline + description "Tasks must be statically + initialized: enter a list of initializers + separated by commas, one per line. + An initializer is + 'CYG_UIT_TASK(NAME,PRIO,FUNC,STACK,SIZE)' + where name is a quoted string to name the task, + prio is the initial priority of the task, + func is the name of the entry point, + stack is the address of the task's stack, + and size is the size of the task's stack. + When create and delete operations are supported, + 'CYG_UIT_TASK_NOEXS(NAME,STACK,SIZE)' should be + used for tasks which are not initially created, + in order to tell the system what memory to use + for stacks when these tasks are created later on. + Using 'CYGNUM_UITRON_STACK_SIZE' for size + is recommended, to use the option defined above, + so long as that truly is the size of your stack(s). + Note: this option is invoked in the context of a + C++ array initializer, between curly brackets. + Ensure that the number of initializers here exactly + matches the number of tasks specified." + } + }}CFG_DATA */ + + +// This default configuration has 4 tasks called task1, task2, task3 and +// task4, and only task1 is started up by cyg_uitron_start(). + +// first specify how many tasks we have +// no PKG define, tasks are not optional +#define CYGNUM_UITRON_TASKS 4 + +#define CYGNUM_UITRON_START_TASKS 1 // start task1 only + +#define CYGNUM_UITRON_STACK_SIZE 2048 + +#define CYGDAT_UITRON_TASK_EXTERNS \ +extern "C" void task1( unsigned int ); \ +extern "C" void task2( unsigned int ); \ +extern "C" void task3( unsigned int ); \ +extern "C" void task4( unsigned int ); \ +static char stack1[ CYGNUM_UITRON_STACK_SIZE ], \ + stack2[ CYGNUM_UITRON_STACK_SIZE ], \ + stack3[ CYGNUM_UITRON_STACK_SIZE ], \ + stack4[ CYGNUM_UITRON_STACK_SIZE ]; + +// then initialize in terms of +// CYG_UIT_TASK( "name", prio, func, stackaddress, stacksize ) +// [or CYG_UIT_TASK_NOEXS( "name", stackaddress, stacksize ) ] +// [for create/delete enabled, tasks which are not initially created. ] +#define CYGDAT_UITRON_TASK_INITIALIZERS \ + CYG_UIT_TASK( "t1", 1, task1, &stack1, CYGNUM_UITRON_STACK_SIZE ), \ + CYG_UIT_TASK( "t2", 2, task2, &stack2, CYGNUM_UITRON_STACK_SIZE ), \ + CYG_UIT_TASK( "t3", 3, task3, &stack3, CYGNUM_UITRON_STACK_SIZE ), \ + CYG_UIT_TASK( "t4", 4, task4, &stack4, CYGNUM_UITRON_STACK_SIZE ), \ + +// Do we support create and delete? +#define CYGPKG_UITRON_TASKS_CREATE_DELETE + +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE +#define CYGNUM_UITRON_TASKS_INITIALLY 4 +#endif // CYGPKG_UITRON_TASKS_CREATE_DELETE + +// ------------------------------------------------------------------------ +// Memory Pools, both fixed and variable block: +// +// Any such object must be initialized, so the number of them defined must +// match the number of entries in the initializer much as for tasks. + +// Fixed block allocation memory pools: + +/* {{CFG_DATA + cdl_component CYGPKG_UITRON_MEMPOOLFIXED { + display "Fixed-Size Memorypools " + type boolean + parent CYGPKG_UITRON + description "uITRON supports memory pools for dynamic, task-safe + memory allocation. + Two kinds are supported, fixed-size and variable-size. + There may be multiple of each + type of pool, each with differing characteristics. + This option controls whether there are any fixed-size + memorypools in the system. + A fixed-size memorypool allocates blocks of memory of + its preset fixed size and none other." + } + cdl_option CYGNUM_UITRON_MEMPOOLFIXED { + display "Number of fixed-size memory pools" + parent CYGPKG_UITRON_MEMPOOLFIXED + type count + legal_values 1 to 65535 + description "The number of uITRON Fixed-Size + Memorypools present in the system. + Valid Fixed-Size Memorypool IDs will range + from 1 to this value." + } + cdl_component CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE { + display "Support create and delete" + parent CYGPKG_UITRON_MEMPOOLFIXED + type boolean + description "Support + fixed-size memory pool + create and delete operations + (cre_mpf, del_mpf). + Otherwise all fixed mempools are created, + up to the number specified above." + } + cdl_option CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY { + display "Number of fixed mempools created initially" + parent CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + type count + legal_values 0 to 65535 + description "The number of fixed mempools initially created. + This number should not be more than the number + of fixed mempools in the system, though setting + it to a large value to mean 'all' is acceptable. + Initially, only fixed mempools numbered from + 1 to this number exist; + higher numbered ones must be created before use. + Whilst all mempools must be initialized to tell + the system what memory to use for each pool, + it is only useful to initialize the blocksize of + fixed mempools up to this number; + the blocksize for higher numbered ones + will be defined when they are created." + } + cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS { + display "Externs for initialization" + parent CYGPKG_UITRON_MEMPOOLFIXED + type multiline + description "Fixed mempool initializers may refer to external + objects such as memory for the pool to manage. + Use this option to define or declare any external + objects needed by the pool's static initializer below. + Example: create some memory for a mempool using + 'static char fpool1[2000];' + to set up a chunk of memory of 2000 bytes. + Note: this option is invoked in the 'outermost' context + of C++ source, where global/static objects are created; + it should contain valid, self-contained, C++ source." + } + cdl_option CYGDAT_UITRON_MEMPOOLFIXED_INITIALIZERS { + display "Static initializers" + parent CYGPKG_UITRON_MEMPOOLFIXED + type multiline + description "Fixed block memory pools should be statically + initialized: enter a list of initializers + separated by commas, one per line. + An initializer is + 'CYG_UIT_MEMPOOLFIXED(ADDR,SIZE,BLOCK)' + where addr is the address of memory to manage, + size is the total size of that memory, and + block is the block size for allocation by the pool. + If create and delete operations are supported, + initializers of the form + 'CYG_UIT_MEMPOOLFIXED_NOEXS(ADDR,SIZE)' should be + used for pools which are not initially created, to tell + the system what memory to use for each pool. + Note: this option is invoked in the context of a + C++ array initializer, between curly brackets. + Ensure that the number of initializers here exactly + matches the total number of fixed pools specified." + } + }}CFG_DATA */ + +#define CYGPKG_UITRON_MEMPOOLFIXED +#define CYGNUM_UITRON_MEMPOOLFIXED 3 + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED +#if 0 < CYGNUM_UITRON_MEMPOOLFIXED + +#define CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE +#define CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY 3 +#endif // CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + +#define CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS \ +static char fpool1[ 2000 ], \ + fpool2[ 2000 ], \ + fpool3[ 2000 ]; + +// in terms of CYG_UIT_MEMPOOLFIXED( addr, size, blocksize ); +// [or CYG_UIT_MEMPOOLFIXED_NOEXS( addr, size ) if cre/del supported] +#define CYGDAT_UITRON_MEMPOOLFIXED_INITIALIZERS \ + CYG_UIT_MEMPOOLFIXED( fpool1, 2000, 20 ), \ + CYG_UIT_MEMPOOLFIXED( fpool2, 2000, 100 ), \ + CYG_UIT_MEMPOOLFIXED( fpool3, 2000, 500 ), \ + +#endif +#endif // do we have fixed memory pools? + +// Variable block memory pools: + +/* {{CFG_DATA + cdl_component CYGPKG_UITRON_MEMPOOLVAR { + display "Variable-Size Memorypools " + type boolean + parent CYGPKG_UITRON + description "uITRON supports memory pools for dynamic, task-safe + memory allocation. + Two kinds are supported, fixed-size and variable-size. + There may be multiple of each + type of pool, each with differing characteristics. + This option controls whether there are any variable-size + memorypools in the system. + A variable-size memorypool allocates blocks of memory of + any size requested, resources permitting." + } + cdl_option CYGNUM_UITRON_MEMPOOLVAR { + display "Number of variable-size memory pools" + parent CYGPKG_UITRON_MEMPOOLVAR + type count + legal_values 1 to 65535 + description "The number of uITRON Variable-Size + Memorypools present in the system. + Valid Variable-Size Memorypool IDs will range + from 1 to this value." + } + cdl_component CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE { + display "Support create and delete" + parent CYGPKG_UITRON_MEMPOOLVAR + type boolean + description "Support + variable-size memory pool + create and delete operations + (cre_mpl, del_mpl). + Otherwise all variable-size mempools are created, + up to the number specified above." + } + cdl_option CYGNUM_UITRON_MEMPOOLVAR_INITIALLY { + display "Number of variable-size mempools created initially" + parent CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + type count + legal_values 0 to 65535 + description "The number of variable-size mempools initially created. + This number should not be more than the number + of variable mempools in the system, though setting + it to a large value to mean 'all' is acceptable. + Initially, only variable mempools numbered from + 1 to this number exist; + higher numbered ones must be created before use. + All mempools must be initialized to tell + the system what memory to use for each pool." + } + cdl_option CYGDAT_UITRON_MEMPOOLVAR_EXTERNS { + display "Externs for initialization" + parent CYGPKG_UITRON_MEMPOOLVAR + type multiline + description "Variable mempool initializers may refer to external + objects such as memory for the pool to manage. + Use this option to define or declare any external + objects needed by the pool's static initializer below. + Example: create some memory for a mempool using + 'static char vpool1[2000];' + to set up a chunk of memory of 2000 bytes. + Note: this option is invoked in the 'outermost' context + of C++ source, where global/static objects are created; + it should contain valid, self-contained, C++ source." + } + cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS { + display "Static initializers" + parent CYGPKG_UITRON_MEMPOOLVAR + type multiline + description "Variable block memory pools should be statically + initialized: enter a list of initializers + separated by commas, one per line. + An initializer is + 'CYG_UIT_MEMPOOLVAR(ADDR,SIZE)' + where addr is the address of memory to manage, and + size is the total size of that memory. + If create and delete operations are supported, + initializers of the form + 'CYG_UIT_MEMPOOLVAR_NOEXS(ADDR,SIZE)' should be + used for pools which are not initially created, to tell + the system what memory to use for each pool. + Note: this option is invoked in the context of a + C++ array initializer, between curly brackets. + Ensure that the number of initializers here exactly + matches the total number of variable pools specified." + } + }}CFG_DATA */ + +#define CYGPKG_UITRON_MEMPOOLVAR +#define CYGNUM_UITRON_MEMPOOLVAR 3 + +#ifdef CYGPKG_UITRON_MEMPOOLVAR +#if 0 < CYGNUM_UITRON_MEMPOOLVAR + +#define CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE +#define CYGNUM_UITRON_MEMPOOLVAR_INITIALLY 3 +#endif // CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + +#define CYGDAT_UITRON_MEMPOOLVAR_EXTERNS \ +static char vpool1[ 2000 ], \ + vpool2[ 2000 ], \ + vpool3[ 2000 ]; + +// in terms of CYG_UIT_MEMPOOLVAR( addr, size ); +// [or CYG_UIT_MEMPOOLVAR_NOEXS( addr, size ) if cre/del supported] +#define CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS \ + CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \ + CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \ + CYG_UIT_MEMPOOLVAR( vpool3, 2000 ), \ + +#endif +#endif // do we have variable memory pools? + +// ------------------------------------------------------------------------ +// One-shot Alarm and Cyclic Alarm handlers: +// +// These are declared without uninitialization; they must be defined in +// order to use them. + + +/* {{CFG_DATA + cdl_component CYGPKG_UITRON_ALARMS { + display "Alarm Handlers" + type boolean + parent CYGPKG_UITRON + requires CYGVAR_KERNEL_COUNTERS_CLOCK + description "uITRON Alarm Handlers are used with functions + named def_alm() and ref_alm(); they support + simple timing, with a function callback + at the end of the timed period." + } + cdl_option CYGNUM_UITRON_ALARMS { + display "Number of alarm handlers" + parent CYGPKG_UITRON_ALARMS + type count + legal_values 1 to 65535 + description "The number of uITRON alarm + handlers present in the system. + Valid alarm handler numbers will range + from 1 to this value." + } + }}CFG_DATA */ +#define CYGPKG_UITRON_ALARMS +#define CYGNUM_UITRON_ALARMS 3 +#if 0 // initializers not supported +#if 0 < CYGNUM_UITRON_ALARMS +//#define CYGDAT_UITRON_ALARM_EXTERNS +// in terms of ALARM( ... ) +//#define CYGDAT_UITRON_ALARM_INITIALIZERS +#endif +#endif // NOT SUPPORTED + + +/* {{CFG_DATA + cdl_component CYGPKG_UITRON_CYCLICS { + display "Cyclic Handlers" + type boolean + parent CYGPKG_UITRON + requires CYGVAR_KERNEL_COUNTERS_CLOCK + description "uITRON Cyclic Handlers are used with functions + named xxx_cyc(); they support timing + with a periodic function callback that + can be dynamically turned on or off, and + resynchronized with external events." + } + cdl_option CYGNUM_UITRON_CYCLICS { + display "Number cyclic handlers" + parent CYGPKG_UITRON_CYCLICS + type count + legal_values 1 to 65535 + description "The number of uITRON cyclics + handlers present in the system. + Valid cyclic handler numbers will range + from 1 to this value." + } + }}CFG_DATA */ +#define CYGPKG_UITRON_CYCLICS +#define CYGNUM_UITRON_CYCLICS 3 +#if 0 // initializers not supported +#if 0 < CYGNUM_UITRON_CYCLICS +//#define CYGDAT_UITRON_CYCLIC_EXTERNS +// in terms of CYCLIC( ... ) +//#define CYGDAT_UITRON_CYCLIC_INITIALIZERS +#endif +#endif // NOT SUPPORTED + +// ======================================================================== +// ------------------------------------------------------------------------ +// uITRON VERSION INFORMATION +// ------------------------------------------------------------------------ + +/* {{CFG_DATA + cdl_component CYGPKG_UITRON_VERSION { + display "Version information" + type dummy + parent CYGPKG_UITRON + description "The get_ver() uITRON system call returns + several version related values describing + the vendor, product and CPU in question + as well as the version of the uITRON + standard supported. + These values may be specified here." + } + cdl_option CYGNUM_UITRON_VER_MAKER { + display "OS Maker" + parent CYGPKG_UITRON_VERSION + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'maker' + field of the T_VER structure in + response to a get_ver() system call." + } + cdl_option CYGNUM_UITRON_VER_ID { + display "OS Identification" + parent CYGPKG_UITRON_VERSION + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'id' + field of the T_VER structure in + response to a get_ver() system call." + } + cdl_option CYGNUM_UITRON_VER_SPVER { + display "ITRON Specification" + parent CYGPKG_UITRON_VERSION + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'spver' + field of the T_VER structure in + response to a get_ver() system call. + Do NOT change this value." + } + cdl_option CYGNUM_UITRON_VER_PRVER { + display "OS Product Version" + parent CYGPKG_UITRON_VERSION + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'prver' + field of the T_VER structure in + response to a get_ver() system call." + } + # PRNO fields in own folder + cdl_component CYGPKG_UITRON_VERSION_PRNO { + display "Product Info" + type dummy + parent CYGPKG_UITRON_VERSION + description "The get_ver() uITRON system call returns + several version related values describing + the vendor, product and CPU in question + as well as the version of the uITRON + standard supported. + These values may be specified here." + } + cdl_option CYGNUM_UITRON_VER_PRNO_0 { + display "Field 0" + parent CYGPKG_UITRON_VERSION_PRNO + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'prno[0]' + field of the T_VER structure in + response to a get_ver() system call." + } + cdl_option CYGNUM_UITRON_VER_PRNO_1 { + display "Field 1" + parent CYGPKG_UITRON_VERSION_PRNO + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'prno[1]' + field of the T_VER structure in + response to a get_ver() system call." + } + cdl_option CYGNUM_UITRON_VER_PRNO_2 { + display "Field 2" + parent CYGPKG_UITRON_VERSION_PRNO + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'prno[2]' + field of the T_VER structure in + response to a get_ver() system call." + } + cdl_option CYGNUM_UITRON_VER_PRNO_3 { + display "Field 3" + parent CYGPKG_UITRON_VERSION_PRNO + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'prno[3]' + field of the T_VER structure in + response to a get_ver() system call." + } + # up a level + cdl_option CYGNUM_UITRON_VER_CPU { + display "CPU Information" + parent CYGPKG_UITRON_VERSION + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'cpu' + field of the T_VER structure in + response to a get_ver() system call." + } + cdl_option CYGNUM_UITRON_VER_VAR { + display "System Variant" + parent CYGPKG_UITRON_VERSION + type count + legal_values 0 to 0xFFFF + description "This value is returned in the 'var' + field of the T_VER structure in + response to a get_ver() system call. + Do NOT change this value." + } + }}CFG_DATA + */ + +// these constants are returned by the get_ver API call. + +#define CYGNUM_UITRON_VER_MAKER 0 /* vendor */ +#define CYGNUM_UITRON_VER_ID 0 /* format number */ +#define CYGNUM_UITRON_VER_SPVER 0x5302 /* specification version */ +#define CYGNUM_UITRON_VER_PRVER 0x0100 /* product version */ +#define CYGNUM_UITRON_VER_PRNO_0 0 /* product control information */ +#define CYGNUM_UITRON_VER_PRNO_1 0 +#define CYGNUM_UITRON_VER_PRNO_2 0 +#define CYGNUM_UITRON_VER_PRNO_3 0 +#define CYGNUM_UITRON_VER_CPU 0 /* CPU information */ +#define CYGNUM_UITRON_VER_VAR 0x8000 /* variation descriptor */ + + +#endif // CYGPKG_UITRON + +#endif // CYGONCE_PKGCONF_UITRON_H +// EOF pgkconf/uitron.h diff --git a/packages/compat/uitron/current/include/uit_func.h b/packages/compat/uitron/current/include/uit_func.h new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/include/uit_func.h @@ -0,0 +1,389 @@ +#ifndef CYGONCE_COMPAT_UITRON_UIT_FUNC_H +#define CYGONCE_COMPAT_UITRON_UIT_FUNC_H +//=========================================================================== +// +// uit_func.h +// +// uITRON compatibility functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON compatibility functions +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// ------------------------------------------------------------------------ +// Source Code Organization +// +// First, see pkgconf/uitron.h for details of applicable configuration +// options. +// +// This file uit_func.h provides prototypes for the uITRON API. All the +// uITRON functions are listed here. The prototypes are configurable +// either to have C or C++ linkage, and if being compiled in a C++ +// environment, to be inline. +// +// The function prototypes are all in terms of uITRON type definitions from +// uit_type.h, which is included at the head of uit_func.h. +// +// The implementations of the uITRON functions are in uit_func.inl, which +// is either included at the end of uit_func.h (if functions are inline) or +// in uit_func.cxx (if outline). +// +// uit_func.cxx provides some startup functions plus, if the uITRON +// functions are out of line, uit_func.inl is included to instantiate those +// functions. +// +// uITRON system objects (tasks, semaphores...) are described in +// uit_obj.hxx. This is a C++ file and is used by the implementation of +// the uITRON functions. +// +// The uITRON system objects are instantiated in uit_obj.cxx, which uses +// uit_obj.hxx to define the objects, and the configuration file +// pkgconf/uitron.h to construct them as required. +// +// The include graph from an application, which should only include +// uit_func.h, is similar to the following: +// +// +// [inline uITRON functions:] +// +// +// . uit_func.h ; prototypes for funcs +// . . pkgconf/uitron.h ; configuration info +// . . uit_type.h ; typedefs for func args +// . (function prototypes) +// . . uit_func.inl ; full function bodies +// . . . uit_objs.hxx ; defs of uITRON data +// . . (function implementations) +// +// +// [out-of-line uITRON functions:] +// +// +// . uit_func.h ; prototypes for funcs +// . . pkgconf/uitron.h ; configuration info +// . . uit_type.h ; typedefs for func args +// . (function prototypes) +// +// +// [other uITRON compilation units:] +// +// uit_func.cxx ; out-of-line functions +// . pkgconf/uitron.h ; configuration info +// . uit_func.h ; prototypes for funcs +// . . uit_type.h ; typedefs for func args +// . (function prototypes) +// . . uit_func.inl ; full function bodies +// . . . uit_objs.hxx ; defs of uITRON data +// . . (function implementations) +// +// +// uit_objs.cxx ; static uITRON data objects +// . pkgconf/uitron.h ; configuration info +// . uit_objs.hxx ; defs of uITRON data +// (static uITRON system objects) +// +// +// The various include files are protected against multiple inclusion and +// so may be safely re-included as convenient. +// +// ------------------------------------------------------------------------ + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al + +#ifdef CYGPKG_UITRON + +#include // types; cyg_int32, CYG_ADDRWORD + +#include // uITRON types; ER ID TMO T_MSG + +// ------------------------------------------------------------------------ +// Object operations: +// +// The functions can be inlined in C compiled by C++, or C++ of course, +// and also outlined in extern "C" functions, eg. for taking the address +// of, or for use by a pure C program, or of course outlined in C++ for +// Code size reasons. +// +// +// Summary: +// +// IF compiling in C +// THEN functions must be C linkage and out of line: +// do NOT specify CYGIMP_UITRON_INLINE_FUNCS nor +// CYGIMP_UITRON_CPP_OUTLINE_FUNCS. +// IF compiling in C++ +// THEN functions can be inline: specify CYGIMP_UITRON_INLINE_FUNCS +// OR by default, functions are out of line: +// outline functions can have C++ linkage: +// specify CYGIMP_UITRON_CPP_OUTLINE_FUNCS +// OR by default, outline functions have C linkage. + + +#ifdef __cplusplus +// C++ environment; functions can be inline or not as we please. +// If not inline they might as well be "C" linkage for sharing with +// any pure "C" code present. + +#ifdef CYGIMP_UITRON_INLINE_FUNCS + +#define CYG_UIT_FUNC_EXTERN_BEGIN +#define CYG_UIT_FUNC_EXTERN_END +#define CYG_UIT_FUNC_INLINE inline +#ifndef CYGPRI_UITRON_FUNCS_HERE_AND_NOW +#define CYGPRI_UITRON_FUNCS_HERE_AND_NOW +#endif + +#else + +#ifdef CYGIMP_UITRON_CPP_OUTLINE_FUNCS +#define CYG_UIT_FUNC_EXTERN_BEGIN extern "C++" { +#define CYG_UIT_FUNC_EXTERN_END } +#else +#define CYG_UIT_FUNC_EXTERN_BEGIN extern "C" { +#define CYG_UIT_FUNC_EXTERN_END } +#endif + +#define CYG_UIT_FUNC_INLINE +#endif + +#else // !__cplusplus +// Vanilla "C" environment; external "C" linkage, no inline functions + +#ifdef CYGIMP_UITRON_INLINE_FUNCS +#error "Cannot inline uITRON functions in pure C environment" +#endif +#ifdef CYGIMP_UITRON_CPP_OUTLINE_FUNCS +#error "Cannot use C++ linkage of outline fns in pure C environment" +#endif + +#define CYG_UIT_FUNC_EXTERN_BEGIN +#define CYG_UIT_FUNC_EXTERN_END +#define CYG_UIT_FUNC_INLINE + +#endif // !__cplusplus + +// ======================================================================== +// u I T R O N F U N C T I O N S +// The function declarations themselves: + +CYG_UIT_FUNC_EXTERN_BEGIN + +// this routine is outside the uITRON specification; call it from main() to +// start the uITRON tasks and scheduler. It does not return. + +#ifdef CYGNUM_UITRON_START_TASKS +void cyg_uitron_start( void ); +#endif + +// ****************************************************** +// *** 6.5 C Language Interfaces *** +// ****************************************************** + +// - Task Management Functions + +ER cre_tsk ( ID tskid, T_CTSK *pk_ctsk ); +ER del_tsk ( ID tskid ); +ER sta_tsk ( ID tskid, INT stacd ); +void ext_tsk ( void ); +void exd_tsk ( void ); +ER ter_tsk ( ID tskid ); + +ER dis_dsp ( void ); +ER ena_dsp ( void ); +ER chg_pri ( ID tskid, PRI tskpri ); +ER rot_rdq ( PRI tskpri ); +ER rel_wai ( ID tskid ); +ER get_tid ( ID *p_tskid ); +ER ref_tsk ( T_RTSK *pk_rtsk, ID tskid ); + +// - Task-Dependent Synchronization Functions + +ER sus_tsk ( ID tskid ); +ER rsm_tsk ( ID tskid ); +ER frsm_tsk ( ID tskid ); +ER slp_tsk ( void ); +ER tslp_tsk ( TMO tmout ); +ER wup_tsk ( ID tskid ); +ER can_wup ( INT *p_wupcnt, ID tskid ); + +// - Synchronization and Communication Functions + +ER cre_sem ( ID semid, T_CSEM *pk_csem ); +ER del_sem ( ID semid ); +ER sig_sem ( ID semid ); +ER wai_sem ( ID semid ); +ER preq_sem ( ID semid ); +ER twai_sem ( ID semid, TMO tmout ); +ER ref_sem ( T_RSEM *pk_rsem, ID semid ); + +ER cre_flg ( ID flgid, T_CFLG *pk_cflg ); +ER del_flg ( ID flgid ); +ER set_flg ( ID flgid, UINT setptn ); +ER clr_flg ( ID flgid, UINT clrptn ); +ER wai_flg ( UINT *p_flgptn, ID flgid, UINT waiptn, UINT wfmode ); +ER pol_flg ( UINT *p_flgptn, ID flgid, UINT waiptn, UINT wfmode ); +ER twai_flg ( UINT *p_flgptn, ID flgid, UINT waiptn, UINT wfmode, + TMO tmout ); +ER ref_flg ( T_RFLG *pk_rflg, ID flgid ); + +ER cre_mbx ( ID mbxid, T_CMBX* pk_cmbx ); +ER del_mbx ( ID mbxid ); +ER snd_msg ( ID mbxid, T_MSG *pk_msg ); +ER rcv_msg ( T_MSG **ppk_msg, ID mbxid ); +ER prcv_msg ( T_MSG **ppk_msg, ID mbxid ); +ER trcv_msg ( T_MSG **ppk_msg, ID mbxid, TMO tmout ); +ER ref_mbx ( T_RMBX *pk_rmbx, ID mbxid ); + +// - Extended Synchronization and Communication Functions + +#if 0 // NOT SUPPORTED +ER cre_mbf ( ID mbfid, T_CMBF *pk_cmbf ); +ER del_mbf ( ID mbfid ); +ER snd_mbf ( ID mbfid, VP msg, INT msgsz ); +ER psnd_mbf ( ID mbfid, VP msg, INT msgsz ); +ER tsnd_mbf ( ID mbfid, VP msg, INT msgsz, TMO tmout ); +ER rcv_mbf ( VP msg, INT *p_msgsz, ID mbfid ); +ER prcv_mbf ( VP msg, INT *p_msgsz, ID mbfid ); +ER trcv_mbf ( VP msg, INT *p_msgsz, ID mbfid, TMO tmout ); +ER ref_mbf ( T_RMBF *pk_rmbf, ID mbfid ); +ER cre_por ( ID porid, T_CPOR *pk_cpor ); +ER del_por ( ID porid ); +ER cal_por ( VP msg, INT *p_rmsgsz, ID porid, UINT calptn, INT + cmsgsz ); +ER pcal_por ( VP msg, INT *p_rmsgsz, ID porid, UINT calptn, INT + cmsgsz ); +ER tcal_por ( VP msg, INT *p_rmsgsz, ID porid, UINT calptn, INT + cmsgsz, TMO tmout ); +ER acp_por ( RNO *p_rdvno, VP msg, INT *p_cmsgsz, ID porid, UINT + acpptn ); +ER pacp_por ( RNO *p_rdvno, VP msg, INT *p_cmsgsz, ID porid, UINT + acpptn ); +ER tacp_por ( RNO *p_rdvno, VP msg, INT *p_cmsgsz, ID porid, UINT + acpptn, TMO tmout ); +ER fwd_por ( ID porid, UINT calptn, RNO rdvno, VP msg, INT cmsgsz + ); +ER rpl_rdv ( RNO rdvno, VP msg, INT rmsgsz ); +ER ref_por ( T_RPOR *pk_rpor, ID porid ); +#endif + +// - Interrupt Management Functions + +#if 0 // NOT SUPPORTED +ER def_int ( UINT dintno, T_DINT *pk_dint ); +void ret_wup ( ID tskid ); +#endif +#if 0 +void ret_int ( void ); +#endif +#define ret_int() return +ER loc_cpu ( void ); +ER unl_cpu ( void ); +#if 0 // NOT SUPPORTED +ER dis_int ( UINT eintno ); +ER ena_int ( UINT eintno ); +ER chg_iXX ( UINT iXXXX ); +ER ref_iXX ( UINT *p_iXXXX ); +#endif + +// - Memorypool Management Functions + +ER cre_mpl ( ID mplid, T_CMPL *pk_cmpl ); +ER del_mpl ( ID mplid ); +ER get_blk ( VP *p_blk, ID mplid, INT blksz ); +ER pget_blk ( VP *p_blk, ID mplid, INT blksz ); +ER tget_blk ( VP *p_blk, ID mplid, INT blksz, TMO tmout ); +ER rel_blk ( ID mplid, VP blk ); +ER ref_mpl ( T_RMPL *pk_rmpl, ID mplid ); + +ER cre_mpf ( ID mpfid, T_CMPF *pk_cmpf ); +ER del_mpf ( ID mpfid ); +ER get_blf ( VP *p_blf, ID mpfid ); +ER pget_blf ( VP *p_blf, ID mpfid ); +ER tget_blf ( VP *p_blf, ID mpfid, TMO tmout ); +ER rel_blf ( ID mpfid, VP blf ); +ER ref_mpf ( T_RMPF *pk_rmpf, ID mpfid ); + +// - Time Management Functions + +ER set_tim ( SYSTIME *pk_tim ); +ER get_tim ( SYSTIME *pk_tim ); +ER dly_tsk ( DLYTIME dlytim ); +ER def_cyc ( HNO cycno, T_DCYC *pk_dcyc ); +ER act_cyc ( HNO cycno, UINT cycact ); +ER ref_cyc ( T_RCYC *pk_rcyc, HNO cycno ); +ER def_alm ( HNO almno, T_DALM *pk_dalm ); +ER ref_alm ( T_RALM *pk_ralm, HNO almno ); +#if 0 +void ret_tmr ( void ); +#endif +#define ret_tmr() return + +// - System Management Functions + +ER get_ver ( T_VER *pk_ver ); +ER ref_sys ( T_RSYS *pk_rsys ); +ER ref_cfg ( T_RCFG *pk_rcfg ); +#if 0 // NOT SUPPORTED +ER def_svc ( FN s_fncd, T_DSVC *pk_dsvc ); +ER def_exc ( UINT exckind, T_DEXC *pk_dexc ); +#endif + +// - Network Support Functions + +#if 0 // NOT SUPPORTED +ER nrea_dat ( INT *p_reasz, VP dstadr, NODE srcnode, VP srcadr, + INT datsz ); +ER nwri_dat ( INT *p_wrisz, NODE dstnode, VP dstadr, VP srcadr, + INT datsz ); +ER nget_nod ( NODE *p_node ); +ER nget_ver ( T_VER *pk_ver, NODE node ); +#endif + +CYG_UIT_FUNC_EXTERN_END + +// ======================================================================== + +#ifdef CYGPRI_UITRON_FUNCS_HERE_AND_NOW +// functions are inline OR we are in the outline implementation, so define +// the functions as inlines or plain functions depending on the value of +// CYG_UIT_FUNC_INLINE from above. +#include +#endif // CYGPRI_UITRON_FUNCS_HERE_AND_NOW + +// ------------------------------------------------------------------------ +#endif // CYGPKG_UITRON + +#endif // CYGONCE_COMPAT_UITRON_UIT_FUNC_H +// EOF uit_func.h diff --git a/packages/compat/uitron/current/include/uit_func.inl b/packages/compat/uitron/current/include/uit_func.inl new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/include/uit_func.inl @@ -0,0 +1,1774 @@ +#ifndef CYGONCE_COMPAT_UITRON_UIT_FUNC_INL +#define CYGONCE_COMPAT_UITRON_UIT_FUNC_INL +//=========================================================================== +// +// uit_func.inl +// +// uITRON compatibility functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON compatibility functions +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#ifdef CYGPKG_UITRON + +#ifdef CYGPRI_UITRON_FUNCS_HERE_AND_NOW + +#include // uITRON setup CYGNUM_UITRON_SEMAS + +// kernel facilities only needed here +#include +#include + +// and the implementations of other kernel facilities +#include +#include +#include + +// ------------------------------------------------------------------------ +// Parameter checking; either check the expression and return an error code +// if not true, or assert the truth with a made-up message. + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS +// default: uitron error codes are returned +#define CYG_UIT_PARAMCHECK( _true_, _error_ ) CYG_MACRO_START \ + if ( ! (_true_) ) return (_error_); \ +CYG_MACRO_END +#else +// ...but they are asserted if asserts are on +#define CYG_UIT_PARAMCHECK( _true_, _error_ ) CYG_MACRO_START \ + CYG_ASSERT( (_true_), "CYG_UIT_PARAMCHECK fail: " #_true_ ); \ +CYG_MACRO_END +#endif // else !CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + +// ------------------------------------------------------------------------ +// CYG_UITRON_CHECK_AND_GETP +// +// Macro to rangecheck and do the addressing of a static uitron system +// object; _which_ sort of object is given, and token pasting is used +// horribly to get the static array, limits and the like. +// +// Usage: +// INT snd_msg( ID mbxid, ... ) { +// Cyg_Mbox *p; +// CYG_UITRON_CHECK_AND_GETP_MBOXES( mbxid, p ); +// p->...(...); + +// internal: plain assignment to the object pointer, from static array +#define CYG_UIT_SPTR( _which_, _idx_, _ptr_ ) CYG_MACRO_START \ + (_ptr_) = CYG_UITRON_OBJS( _which_ ) + ((_idx_) - 1); \ +CYG_MACRO_END + +// internal: plain assignment to the object pointer, from pointer array +// with error checking. +#define CYG_UIT_SPTR_PTR( _which_, _idx_, _ptr_ ) CYG_MACRO_START \ + (_ptr_) = CYG_UITRON_PTRS( _which_ )[ ((_idx_) - 1) ]; \ + if ( NULL == (_ptr_) ) return E_NOEXS; \ +CYG_MACRO_END + +#define CYG_UITRON_CHECK_AND_GETP_DIRECT( _which_, _idx_, _ptr_ ) \ +CYG_MACRO_START \ + CYG_UIT_PARAMCHECK( 0 < (_idx_), E_ID ); \ + CYG_UIT_PARAMCHECK( CYG_UITRON_NUM( _which_ ) >= (_idx_), E_ID ); \ + CYG_UIT_SPTR( _which_, _idx_, _ptr_ ); \ +CYG_MACRO_END + +#define CYG_UITRON_CHECK_AND_GETP_INDIRECT( _which_, _idx_, _ptr_ ) \ +CYG_MACRO_START \ + CYG_UIT_PARAMCHECK( 0 < (_idx_), E_ID ); \ + CYG_UIT_PARAMCHECK( CYG_UITRON_NUM( _which_ ) >= (_idx_), E_ID ); \ + CYG_UIT_SPTR_PTR( _which_, _idx_, _ptr_ ); \ +CYG_MACRO_END + +// As above but for handler numbers which return E_PAR when out of range +#define CYG_UITRON_CHECK_AND_GETHDLR( _which_, _num_, _ptr_ ) \ +CYG_MACRO_START \ + CYG_UIT_PARAMCHECK( 0 < (_num_), E_PAR ); \ + CYG_UIT_PARAMCHECK( CYG_UITRON_NUM( _which_ ) >= (_num_), E_PAR ); \ + CYG_UIT_SPTR( _which_, _num_, _ptr_ ); \ +CYG_MACRO_END + +// And a macro to check that creation of an object is OK +#define CYG_UITRON_CHECK_NO_OBJ_LOCK_SCHED( _which_, _idx_ ) \ +CYG_MACRO_START \ + CYG_UIT_PARAMCHECK( 0 < (_idx_), E_ID ); \ + CYG_UIT_PARAMCHECK( CYG_UITRON_NUM( _which_ ) >= (_idx_), E_ID ); \ + Cyg_Scheduler::lock(); \ + if ( NULL != CYG_UITRON_PTRS( _which_ )[ ((_idx_) - 1) ] ) { \ + Cyg_Scheduler::unlock(); \ + return E_OBJ; \ + } \ +CYG_MACRO_END + +// define a magic new operator in order to call constructors +#define CYG_UITRON_NEWFUNCTION( _class_ ) \ +inline void *operator new(size_t size, _class_ *ptr) \ +{ \ + CYG_CHECK_DATA_PTR( ptr, "Bad pointer" ); \ + return ptr; \ +} + +// now configury to support selectable create/delete support ie. an +// array of pointers to the objects themselves. +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE +#define CYG_UITRON_CHECK_AND_GETP_TASKS( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_INDIRECT( TASKS, _idx_, _ptr_ ) +#else +#define CYG_UITRON_CHECK_AND_GETP_TASKS( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_DIRECT( TASKS, _idx_, _ptr_ ) +#endif + +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE +#define CYG_UITRON_CHECK_AND_GETP_SEMAS( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_INDIRECT( SEMAS, _idx_, _ptr_ ) +#else +#define CYG_UITRON_CHECK_AND_GETP_SEMAS( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_DIRECT( SEMAS, _idx_, _ptr_ ) +#endif + +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE +#define CYG_UITRON_CHECK_AND_GETP_MBOXES( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_INDIRECT( MBOXES, _idx_, _ptr_ ) +#else +#define CYG_UITRON_CHECK_AND_GETP_MBOXES( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_DIRECT( MBOXES, _idx_, _ptr_ ) +#endif + +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE +#define CYG_UITRON_CHECK_AND_GETP_FLAGS( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_INDIRECT( FLAGS, _idx_, _ptr_ ) +#else +#define CYG_UITRON_CHECK_AND_GETP_FLAGS( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_DIRECT( FLAGS, _idx_, _ptr_ ) +#endif + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE +#define CYG_UITRON_CHECK_AND_GETP_MEMPOOLFIXED( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_INDIRECT( MEMPOOLFIXED, _idx_, _ptr_ ) +#else +#define CYG_UITRON_CHECK_AND_GETP_MEMPOOLFIXED( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_DIRECT( MEMPOOLFIXED, _idx_, _ptr_ ) +#endif + +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE +#define CYG_UITRON_CHECK_AND_GETP_MEMPOOLVAR( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_INDIRECT( MEMPOOLVAR, _idx_, _ptr_ ) +#else +#define CYG_UITRON_CHECK_AND_GETP_MEMPOOLVAR( _idx_, _ptr_ ) \ + CYG_UITRON_CHECK_AND_GETP_DIRECT( MEMPOOLVAR, _idx_, _ptr_ ) +#endif + +// ------------------------------------------------------------------------ +// Common error checking macros + +#if !defined( CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS ) && \ + !defined( CYGDBG_USE_ASSERTS ) +// if not checking and not asserted, these are removed to avoid usused +// variable warnings. +#define CYG_UITRON_CHECK_TASK_CONTEXT_SELF( _self_ ) CYG_EMPTY_STATEMENT +#define CYG_UITRON_CHECK_TASK_CONTEXT() CYG_EMPTY_STATEMENT +#define CYG_UITRON_CHECK_DISPATCH_ENABLED() CYG_EMPTY_STATEMENT +#define CYG_UITRON_CHECK_DISPATCH_ENABLED_TMO( _tmout_ ) CYG_EMPTY_STATEMENT + +#else +// the default: +// Check a task is actually a uITRON task +#define CYG_UITRON_CHECK_TASK_CONTEXT_SELF( _self_ ) CYG_MACRO_START \ + CYG_UIT_PARAMCHECK( \ + (&cyg_uitron_TASKS[0] <= (_self_)) && \ + ((_self_) < &cyg_uitron_TASKS[CYGNUM_UITRON_TASKS]), \ + E_CTX ); \ +CYG_MACRO_END + +#define CYG_UITRON_CHECK_TASK_CONTEXT() CYG_MACRO_START \ + Cyg_Thread *self = Cyg_Thread::self(); \ + CYG_UITRON_CHECK_TASK_CONTEXT_SELF( self ); \ +CYG_MACRO_END + +// Check dispatching is enabled for calls which might wait +#define CYG_UITRON_CHECK_DISPATCH_ENABLED() CYG_MACRO_START \ + CYG_UIT_PARAMCHECK( 0 == Cyg_Scheduler::get_sched_lock(), E_CTX ); \ +CYG_MACRO_END + +#define CYG_UITRON_CHECK_DISPATCH_ENABLED_TMO(_tmout_) CYG_MACRO_START \ + CYG_UIT_PARAMCHECK( -1 <= (_tmout_), E_PAR ); \ + if ( TMO_POL != (_tmout_) ) \ + CYG_UITRON_CHECK_DISPATCH_ENABLED(); \ +CYG_MACRO_END + +#endif + +#ifdef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR +#define CYG_UIT_PARAMCHECK_PTR( _p_ ) CYG_MACRO_START \ + CYG_UIT_PARAMCHECK( NADR != (_p_), E_PAR ); \ +CYG_MACRO_END +#else // do check for NULL +#define CYG_UIT_PARAMCHECK_PTR( _p_ ) CYG_MACRO_START \ + CYG_UIT_PARAMCHECK( NADR != (_p_), E_PAR ); \ + CYG_UIT_PARAMCHECK( NULL != (_p_), E_PAR ); \ +CYG_MACRO_END +#endif // !CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + +// ------------------------------------------------------------------------ +// CYG_UITRON_FAIL_RETURN +// +// After a call which waits, it might return with success, or due to a +// timeout or a release wait (a forced escape from the waiting condition). +// This macro examines context and finds out which, then executes a return +// with the correct uITRON condition code. + +#define CYG_UITRON_FAIL_RETURN_SELF( _self_ ) CYG_MACRO_START \ + Cyg_Thread::cyg_reason reason = (_self_)->get_wake_reason(); \ + if ( Cyg_Thread::TIMEOUT == reason ) \ + return E_TMOUT; \ + if ( Cyg_Thread::BREAK == reason ) \ + return E_RLWAI; \ + if ( Cyg_Thread::DESTRUCT == reason ) \ + return E_DLT; \ + return E_SYS; /* if no plausible reason was found */ \ +CYG_MACRO_END + +#define CYG_UITRON_FAIL_RETURN() CYG_MACRO_START \ + Cyg_Thread *self = Cyg_Thread::self(); \ + CYG_UITRON_FAIL_RETURN_SELF( self ); \ +CYG_MACRO_END + +// ------------------------------------------------------------------------ +// Interrupts disabled? +#define CYG_UITRON_CHECK_CPU_UNLOC() \ + CYG_UIT_PARAMCHECK( (Cyg_Interrupt::interrupts_enabled()), E_CTX ) + +// ------------------------------------------------------------------------ +// the function definitions themselves: + +// ****************************************************** +// *** 6.5 C Language Interfaces *** +// ****************************************************** + +// - Task Management Functions + +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE +CYG_UITRON_NEWFUNCTION( Cyg_Thread ) + +CYG_UIT_FUNC_INLINE +ER +cre_tsk ( ID tskid, T_CTSK *pk_ctsk ) +{ + ER ret = E_OK; + CYG_UIT_PARAMCHECK_PTR( pk_ctsk ); + CYG_UITRON_CHECK_NO_OBJ_LOCK_SCHED( TASKS, tskid ); + + Cyg_Thread *p = &(CYG_UITRON_OBJS( TASKS )[ tskid - 1 ]); + cyg_uint32 state = p->get_state(); + if ( 0 == (state & Cyg_Thread::EXITED) ) + ret = E_OBJ; // how did it get to be running? + else if ( ((INT)p->get_stack_size()) < pk_ctsk->stksz ) + ret = E_NOMEM; // more stack requested than available + else { + CYG_UITRON_PTRS( TASKS )[ tskid - 1 ] = + new( p ) Cyg_Thread( + (CYG_ADDRWORD) pk_ctsk->itskpri, + (cyg_thread_entry *)pk_ctsk->task, + (CYG_ADDRWORD) 0, + // preserve the original name and stack: +#ifdef CYGVAR_KERNEL_THREADS_NAME + p->get_name(), +#else + NULL, +#endif + p->get_stack_base(), + p->get_stack_size() ); + // but ensure the task state is dormant: + // (it is not constructed dormant, but suspended) + p->kill(); + // and record the initial priority outside the task too. + CYG_UITRON_TASK_INITIAL_PRIORITY( tskid ) = pk_ctsk->itskpri; + } + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +del_tsk ( ID tskid ) +{ + Cyg_Thread *p; + ER ret = E_OK; + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + + Cyg_Scheduler::lock(); + cyg_uint32 state = p->get_state(); + if ( state & Cyg_Thread::EXITED ) + // just disconnect the pointer from its object + CYG_UITRON_PTRS( TASKS )[ tskid - 1 ] = NULL; + else + ret = E_OBJ; + Cyg_Scheduler::unlock(); + return ret; +} +#endif // CYGPKG_UITRON_TASKS_CREATE_DELETE + +CYG_UIT_FUNC_INLINE +ER +sta_tsk ( ID tskid, INT stacd ) +{ + Cyg_Thread *p; + ER ret = E_OK; + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + + Cyg_Scheduler::lock(); + cyg_uint32 state = p->get_state(); +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE + // there is a race condition with deleting the task + // so test it now that we have the scheduler locked + if ( p != CYG_UITRON_PTRS( TASKS )[ tskid - 1 ] ) + ret = E_NOEXS; + else // NOTE dangling else to the next line: +#endif + if ( state & Cyg_Thread::EXITED ) { + p->reinitialize(); +#ifdef CYGIMP_THREAD_PRIORITY + p->set_priority( CYG_UITRON_TASK_INITIAL_PRIORITY( tskid ) ); +#endif + p->set_entry_data( (CYG_ADDRWORD)stacd ); + p->force_resume(); + } + else + ret = E_OBJ; + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +void +ext_tsk ( void ) +{ + Cyg_Thread::exit(); +} + +CYG_UIT_FUNC_INLINE +void +exd_tsk ( void ) +{ +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE + Cyg_Thread *p; + + Cyg_Scheduler::lock(); + p = Cyg_Thread::self(); + ID tskid = (p - (&cyg_uitron_TASKS[0])) + 1; + // just disconnect the pointer from its object + CYG_UITRON_PTRS( TASKS )[ tskid - 1 ] = NULL; + // Any associated storage management, and possibly calling the task + // destructor, is for future versions. +#else + // do nothing - deletion not supported so just exit... +#endif + Cyg_Thread::exit(); + // does not return, does unlock the scheduler for us +} + +CYG_UIT_FUNC_INLINE +ER +ter_tsk ( ID tskid ) +{ + Cyg_Thread *p; + ER ret = E_OK; + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + CYG_UIT_PARAMCHECK( Cyg_Thread::self() != p, E_OBJ ); + Cyg_Scheduler::lock(); + if ( (0 != (Cyg_Thread::EXITED & p->get_state())) || + (Cyg_Thread::EXIT == p->get_wake_reason()) ) + // already dormant + ret = E_OBJ; + else { + p->force_resume(); // let it run + p->kill(); // and set prio high so it runs RIGHT NOW!! +#ifdef CYGIMP_THREAD_PRIORITY + p->set_priority( (cyg_priority) 0 ); +#endif + } + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +dis_dsp ( void ) +{ + CYG_UITRON_CHECK_TASK_CONTEXT(); + CYG_UITRON_CHECK_CPU_UNLOC(); + // Prevent preemption + if ( 0 == Cyg_Scheduler::get_sched_lock() ) + Cyg_Scheduler::lock(); + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +ena_dsp ( void ) +{ + CYG_UITRON_CHECK_TASK_CONTEXT(); + CYG_UITRON_CHECK_CPU_UNLOC(); + // Unlock the scheduler (if locked) and maybe switch threads + if ( 0 < Cyg_Scheduler::get_sched_lock() ) + Cyg_Scheduler::unlock(); + CYG_UITRON_CHECK_DISPATCH_ENABLED(); // NB: afterwards! + return E_OK; +} + + +CYG_UIT_FUNC_INLINE +ER +chg_pri ( ID tskid, PRI tskpri ) +{ + Cyg_Thread *p; + ER ret = E_OK; + if ( 0 == tskid ) { + p = Cyg_Thread::self(); + CYG_UITRON_CHECK_TASK_CONTEXT_SELF( p ); + } + else + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); +#ifdef CYGIMP_THREAD_PRIORITY +#if CYG_THREAD_MAX_PRIORITY < CYG_THREAD_MIN_PRIORITY + CYG_UIT_PARAMCHECK( CYG_THREAD_MAX_PRIORITY <= tskpri && + tskpri <= CYG_THREAD_MIN_PRIORITY, E_PAR ); +#else + CYG_UIT_PARAMCHECK( CYG_THREAD_MAX_PRIORITY >= tskpri && + tskpri >= CYG_THREAD_MIN_PRIORITY, E_PAR ); +#endif + Cyg_Scheduler::lock(); + if ( (p->get_state() & (Cyg_Thread::EXITED | Cyg_Thread::CREATING)) || + (Cyg_Thread::EXIT == p->get_wake_reason()) ) + ret = E_OBJ; // task is dormant + else + p->set_priority( (cyg_priority)tskpri ); + Cyg_Scheduler::unlock(); +#endif // CYGIMP_THREAD_PRIORITY got priorities at all? + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +rot_rdq ( PRI tskpri ) +{ + // zero means our level; easiet way is to yield() the CPU. + if ( 0 == tskpri ) { + Cyg_Thread::yield(); + return E_OK; + } +#ifdef CYGIMP_THREAD_PRIORITY +#if CYG_THREAD_MAX_PRIORITY < CYG_THREAD_MIN_PRIORITY + CYG_UIT_PARAMCHECK( CYG_THREAD_MAX_PRIORITY <= tskpri && + tskpri <= CYG_THREAD_MIN_PRIORITY, E_PAR ); +#else + CYG_UIT_PARAMCHECK( CYG_THREAD_MAX_PRIORITY >= tskpri && + tskpri >= CYG_THREAD_MIN_PRIORITY, E_PAR ); +#endif +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE + Cyg_Thread::rotate_queue( tskpri ); +#endif +#endif // CYGIMP_THREAD_PRIORITY got priorities at all? + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +rel_wai ( ID tskid ) +{ + Cyg_Thread *p; + ER ret = E_OK; + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + CYG_UIT_PARAMCHECK( Cyg_Thread::self() != p, E_OBJ ); + Cyg_Scheduler::lock(); // get an atomic view of the task + if ( (p->get_state() & (Cyg_Thread::EXITED | Cyg_Thread::CREATING)) || + (Cyg_Thread::EXIT == p->get_wake_reason()) ) + ret = E_OBJ; // task is dormant + else { + p->release(); + // return E_OBJ if the thread was not sleeping + if ( Cyg_Thread::BREAK != p->get_wake_reason() ) + ret = E_OBJ; + } + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +get_tid ( ID *p_tskid ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + CYG_UITRON_CHECK_TASK_CONTEXT_SELF( self ); + CYG_UIT_PARAMCHECK_PTR( p_tskid ); + *p_tskid = (self - (&cyg_uitron_TASKS[0])) + 1; + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +ref_tsk ( T_RTSK *pk_rtsk, ID tskid ) +{ + Cyg_Thread *p; + if ( 0 == tskid ) { + p = Cyg_Thread::self(); + CYG_UITRON_CHECK_TASK_CONTEXT_SELF( p ); + tskid = (p - (&cyg_uitron_TASKS[0])) + 1; // it gets used below + } + else + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + + CYG_UIT_PARAMCHECK_PTR( pk_rtsk ); + pk_rtsk->exinf = NADR; + Cyg_Scheduler::lock(); // get an atomic view of the task + cyg_uint32 state = p->get_state(); + if ( (state & (Cyg_Thread::EXITED | Cyg_Thread::CREATING)) || + (Cyg_Thread::EXIT == p->get_wake_reason()) ) + pk_rtsk->tskstat = TTS_DMT; + else if ( state == Cyg_Thread::RUNNING ) + // If it's us, it's running, else it's ready + pk_rtsk->tskstat = (Cyg_Thread::self() == p) + ? TTS_RUN // RUN state (we are it) + : TTS_RDY; // READY state + else if ( state & Cyg_Thread::SUSPENDED ) + pk_rtsk->tskstat = + (state & (Cyg_Thread::COUNTSLEEP | Cyg_Thread::SLEEPING)) + ? TTS_WAS // WAIT-SUSPEND state + : TTS_SUS; // SUSPEND state + else + pk_rtsk->tskstat = + (state & (Cyg_Thread::COUNTSLEEP | Cyg_Thread::SLEEPING)) + ? TTS_WAI // WAIT state + : 0; // Not sure what's happening here! +#ifdef CYGIMP_THREAD_PRIORITY + if ( TTS_DMT == pk_rtsk->tskstat ) + pk_rtsk->tskpri = CYG_UITRON_TASK_INITIAL_PRIORITY( tskid ); + else + pk_rtsk->tskpri = p->get_priority(); +#else + pk_rtsk->tskpri = -1; // Not applicable +#endif + Cyg_Scheduler::unlock(); + return E_OK; +} + +// - Task-Dependent Synchronization Functions + +CYG_UIT_FUNC_INLINE +ER +sus_tsk ( ID tskid ) +{ + Cyg_Thread *p; + ER ret = E_OK; + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + CYG_UIT_PARAMCHECK( Cyg_Thread::self() != p, E_OBJ ); + Cyg_Scheduler::lock(); // get an atomic view of the task + if ( (p->get_state() & (Cyg_Thread::EXITED | Cyg_Thread::CREATING)) || + (Cyg_Thread::EXIT == p->get_wake_reason()) ) + ret = E_OBJ; // task is dormant + else + p->suspend(); + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +rsm_tsk ( ID tskid ) +{ + Cyg_Thread *p; + ER ret = E_OK; + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + CYG_UIT_PARAMCHECK( Cyg_Thread::self() != p, E_OBJ ); + Cyg_Scheduler::lock(); // get an atomic view of the task + cyg_uint32 state = p->get_state(); + if ( 0 == (Cyg_Thread::SUSPENDED & state) ) + ret = E_OBJ; // thread is not suspended + else + p->resume(); + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +frsm_tsk ( ID tskid ) +{ + Cyg_Thread *p; + ER ret = E_OK; + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + CYG_UIT_PARAMCHECK( Cyg_Thread::self() != p, E_OBJ ); + Cyg_Scheduler::lock(); // get an atomic view of the task + cyg_uint32 state = p->get_state(); + if ( 0 == (Cyg_Thread::SUSPENDED & state) ) + ret = E_OBJ; // thread is not suspended + else + p->force_resume(); + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +slp_tsk ( void ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + CYG_UITRON_CHECK_TASK_CONTEXT_SELF( self ); + CYG_UITRON_CHECK_DISPATCH_ENABLED(); + // do this now for the case when no sleeping actually occurs + self->set_wake_reason( Cyg_Thread::DONE ); + Cyg_Thread::counted_sleep(); + if ( Cyg_Thread::DONE != self->get_wake_reason() ) + CYG_UITRON_FAIL_RETURN_SELF( self ); + return E_OK; +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +CYG_UIT_FUNC_INLINE +ER +tslp_tsk ( TMO tmout ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + CYG_UITRON_CHECK_TASK_CONTEXT_SELF( self ); + CYG_UIT_PARAMCHECK( -1 <= tmout, E_PAR ); + CYG_UITRON_CHECK_DISPATCH_ENABLED(); + // do this now for the case when no sleeping actually occurs + self->set_wake_reason( Cyg_Thread::DONE ); + // note that TMO_POL is not treated specially, though it + // happens to work almost as a poll (some sleeping may occur) + if ( TMO_FEVR == tmout ) + Cyg_Thread::counted_sleep(); + else + Cyg_Thread::counted_sleep( (cyg_tick_count)tmout ); + if ( Cyg_Thread::DONE != self->get_wake_reason() ) + CYG_UITRON_FAIL_RETURN_SELF( self ); + return E_OK; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +CYG_UIT_FUNC_INLINE +ER +wup_tsk ( ID tskid ) +{ + Cyg_Thread *p; + ER ret = E_OK; + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + CYG_UIT_PARAMCHECK( Cyg_Thread::self() != p, E_OBJ ); + Cyg_Scheduler::lock(); // get an atomic view of the task + if ( (p->get_state() & (Cyg_Thread::EXITED | Cyg_Thread::CREATING)) || + (Cyg_Thread::EXIT == p->get_wake_reason()) ) + ret = E_OBJ; // task is dormant + else + p->counted_wake(); + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +can_wup ( INT *p_wupcnt, ID tskid ) +{ + Cyg_Thread *p; + ER ret = E_OK; + if ( 0 == tskid ) { + p = Cyg_Thread::self(); + CYG_UITRON_CHECK_TASK_CONTEXT_SELF( p ); + } + else + CYG_UITRON_CHECK_AND_GETP_TASKS( tskid, p ); + CYG_UIT_PARAMCHECK_PTR( p_wupcnt ); + Cyg_Scheduler::lock(); // get an atomic view of the task + if ( (p->get_state() & (Cyg_Thread::EXITED | Cyg_Thread::CREATING)) || + (Cyg_Thread::EXIT == p->get_wake_reason()) ) + ret = E_OBJ; // task is dormant + else { + cyg_uint32 result = p->cancel_counted_wake(); + *p_wupcnt = result; + } + Cyg_Scheduler::unlock(); + return ret; +} + +// - Synchronization and Communication Functions + +#ifdef CYGPKG_UITRON_SEMAS +#if 0 < CYG_UITRON_NUM( SEMAS ) + +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + +CYG_UITRON_NEWFUNCTION( Cyg_Counting_Semaphore2 ) + +CYG_UIT_FUNC_INLINE +ER +cre_sem ( ID semid, T_CSEM *pk_csem ) +{ + ER ret = E_OK; + CYG_UIT_PARAMCHECK_PTR( pk_csem ); + CYG_UITRON_CHECK_NO_OBJ_LOCK_SCHED( SEMAS, semid ); + if ( TA_TFIFO != pk_csem->sematr ) + ret = E_RSATR; + else + CYG_UITRON_PTRS( SEMAS )[ semid - 1 ] = + new( &(CYG_UITRON_OBJS( SEMAS )[ semid - 1 ]) ) + Cyg_Counting_Semaphore2( (cyg_count32)pk_csem->isemcnt ); + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +del_sem ( ID semid ) +{ + Cyg_Counting_Semaphore2 *p; + CYG_UITRON_CHECK_AND_GETP_SEMAS( semid, p ); + Cyg_Scheduler::lock(); + // deal with the race condition here + if ( p != CYG_UITRON_PTRS( SEMAS )[ semid - 1 ] ) { + Cyg_Scheduler::unlock(); + return E_OBJ; + } + CYG_UITRON_PTRS( SEMAS )[ semid - 1 ] = NULL; + p->~Cyg_Counting_Semaphore2(); + Cyg_Scheduler::unlock(); + return E_OK; +} +#endif // CYGPKG_UITRON_SEMAS_CREATE_DELETE + +CYG_UIT_FUNC_INLINE +ER +sig_sem( ID semid ) +{ + Cyg_Counting_Semaphore2 *p; + CYG_UITRON_CHECK_AND_GETP_SEMAS( semid, p ); + p->post(); + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +wai_sem( ID semid ) +{ + Cyg_Counting_Semaphore2 *p; + CYG_UITRON_CHECK_AND_GETP_SEMAS( semid, p ); + CYG_UITRON_CHECK_DISPATCH_ENABLED(); + cyg_bool result = p->wait(); + if ( !result ) + CYG_UITRON_FAIL_RETURN(); + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +preq_sem ( ID semid ) +{ + Cyg_Counting_Semaphore2 *p; + CYG_UITRON_CHECK_AND_GETP_SEMAS( semid, p ); + cyg_bool result = p->trywait(); + if ( !result ) + return E_TMOUT; + return E_OK; +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +CYG_UIT_FUNC_INLINE +ER +twai_sem ( ID semid, TMO tmout ) +{ + Cyg_Counting_Semaphore2 *p; + CYG_UITRON_CHECK_AND_GETP_SEMAS( semid, p ); + CYG_UITRON_CHECK_DISPATCH_ENABLED_TMO( tmout ); + // do this now for the case when no sleeping actually occurs + Cyg_Thread *self = Cyg_Thread::self(); + self->set_wake_reason( Cyg_Thread::TIMEOUT ); + cyg_bool result; + if ( TMO_FEVR == tmout ) + result = p->wait(); + else if ( TMO_POL == tmout ) + result = p->trywait(); + else + result = p->wait( + Cyg_Clock::real_time_clock->current_value() + + (cyg_tick_count)tmout ); + if ( ! result ) + CYG_UITRON_FAIL_RETURN_SELF( self ); + return E_OK; + +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +CYG_UIT_FUNC_INLINE +ER +ref_sem ( T_RSEM *pk_rsem, ID semid ) +{ + Cyg_Counting_Semaphore2 *p; + CYG_UITRON_CHECK_AND_GETP_SEMAS( semid, p ); + CYG_UIT_PARAMCHECK_PTR( pk_rsem ); + pk_rsem->exinf = NADR; + pk_rsem->wtsk = p->waiting(); + pk_rsem->semcnt = p->peek(); + return E_OK; +} + +#endif // 0 < CYG_UITRON_NUM( SEMAS ) +#endif // CYGPKG_UITRON_SEMAS + +#ifdef CYGPKG_UITRON_FLAGS +#if 0 < CYG_UITRON_NUM( FLAGS ) + +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + +CYG_UITRON_NEWFUNCTION( Cyg_Flag ) + +CYG_UIT_FUNC_INLINE +ER +cre_flg ( ID flgid, T_CFLG *pk_cflg ) +{ + ER ret = E_OK; + CYG_UIT_PARAMCHECK_PTR( pk_cflg ); + CYG_UITRON_CHECK_NO_OBJ_LOCK_SCHED( FLAGS, flgid ); + if ( 0 != ((~(TA_WMUL | TA_WSGL)) & pk_cflg->flgatr) ) + ret = E_RSATR; + else + CYG_UITRON_PTRS( FLAGS )[ flgid - 1 ] = + new( &(CYG_UITRON_OBJS( FLAGS )[ flgid - 1 ]) ) + Cyg_Flag( (Cyg_FlagValue) pk_cflg->iflgptn ); + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +del_flg ( ID flgid ) +{ + Cyg_Flag *p; + CYG_UITRON_CHECK_AND_GETP_FLAGS( flgid, p ); + Cyg_Scheduler::lock(); + // deal with the race condition here + if ( p != CYG_UITRON_PTRS( FLAGS )[ flgid - 1 ] ) { + Cyg_Scheduler::unlock(); + return E_OBJ; + } + CYG_UITRON_PTRS( FLAGS )[ flgid - 1 ] = NULL; + p->~Cyg_Flag(); + Cyg_Scheduler::unlock(); + return E_OK; +} +#endif // CYGPKG_UITRON_FLAGS_CREATE_DELETE + +CYG_UIT_FUNC_INLINE +ER +set_flg ( ID flgid, UINT setptn ) +{ + Cyg_Flag *p; + CYG_UITRON_CHECK_AND_GETP_FLAGS( flgid, p ); + p->setbits( setptn ); + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +clr_flg ( ID flgid, UINT clrptn ) +{ + Cyg_Flag *p; + CYG_UITRON_CHECK_AND_GETP_FLAGS( flgid, p ); + p->maskbits( clrptn ); + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +wai_flg ( UINT *p_flgptn, ID flgid, UINT waiptn, UINT wfmode ) +{ + Cyg_Flag *p; + CYG_UITRON_CHECK_AND_GETP_FLAGS( flgid, p ); + CYG_UIT_PARAMCHECK_PTR( p_flgptn ); + CYG_UIT_PARAMCHECK( 0 == (wfmode & ~Cyg_Flag::MASK), E_PAR ); + CYG_UIT_PARAMCHECK( 0 != waiptn, E_PAR ); + CYG_UITRON_CHECK_DISPATCH_ENABLED(); + // check we can use the wfmode value unchanged + CYG_ASSERT( Cyg_Flag::AND == TWF_ANDW, "Flag AND value bad" ); + CYG_ASSERT( Cyg_Flag::OR == TWF_ORW, "Flag OR value bad" ); + CYG_ASSERT( Cyg_Flag::CLR == TWF_CLR, "Flag CLR value bad" ); + + UINT result = p->wait( waiptn, wfmode ); + if ( ! result ) + CYG_UITRON_FAIL_RETURN(); + *p_flgptn = result; + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +pol_flg ( UINT *p_flgptn, ID flgid, UINT waiptn, UINT wfmode ) +{ + Cyg_Flag *p; + CYG_UITRON_CHECK_AND_GETP_FLAGS( flgid, p ); + CYG_UIT_PARAMCHECK_PTR( p_flgptn ); + CYG_UIT_PARAMCHECK( 0 == (wfmode & ~Cyg_Flag::MASK), E_PAR ); + CYG_UIT_PARAMCHECK( 0 != waiptn, E_PAR ); + // check we can use the wfmode value unchanged + CYG_ASSERT( Cyg_Flag::AND == TWF_ANDW, "Flag AND value bad" ); + CYG_ASSERT( Cyg_Flag::OR == TWF_ORW, "Flag OR value bad" ); + CYG_ASSERT( Cyg_Flag::CLR == TWF_CLR, "Flag CLR value bad" ); + + UINT result = p->poll( waiptn, wfmode ); + if ( ! result ) + return E_TMOUT; + *p_flgptn = result; + return E_OK; +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +CYG_UIT_FUNC_INLINE +ER +twai_flg ( UINT *p_flgptn, ID flgid, UINT waiptn, UINT wfmode, + TMO tmout ) +{ + Cyg_Flag *p; + CYG_UITRON_CHECK_AND_GETP_FLAGS( flgid, p ); + CYG_UIT_PARAMCHECK_PTR( p_flgptn ); + CYG_UIT_PARAMCHECK( 0 == (wfmode & ~Cyg_Flag::MASK), E_PAR ); + CYG_UIT_PARAMCHECK( 0 != waiptn, E_PAR ); + CYG_UITRON_CHECK_DISPATCH_ENABLED_TMO( tmout ); + // check we can use the wfmode value unchanged + CYG_ASSERT( Cyg_Flag::AND == TWF_ANDW, "Flag AND value bad" ); + CYG_ASSERT( Cyg_Flag::OR == TWF_ORW, "Flag OR value bad" ); + CYG_ASSERT( Cyg_Flag::CLR == TWF_CLR, "Flag CLR value bad" ); + + // do this now for the case when no sleeping actually occurs + Cyg_Thread *self = Cyg_Thread::self(); + self->set_wake_reason( Cyg_Thread::TIMEOUT ); + UINT result; + if ( TMO_FEVR == tmout ) + result = p->wait( waiptn, wfmode ); + else if ( TMO_POL == tmout ) + result = p->poll( waiptn, wfmode ); + else + result = p->wait( waiptn, wfmode, + Cyg_Clock::real_time_clock->current_value() + + (cyg_tick_count)tmout ); + if ( ! result ) + CYG_UITRON_FAIL_RETURN_SELF( self ); + *p_flgptn = result; + return E_OK; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +CYG_UIT_FUNC_INLINE +ER +ref_flg ( T_RFLG *pk_rflg, ID flgid ) +{ + Cyg_Flag *p; + CYG_UITRON_CHECK_AND_GETP_FLAGS( flgid, p ); + CYG_UIT_PARAMCHECK_PTR( pk_rflg ); + pk_rflg->exinf = NADR; + pk_rflg->wtsk = p->waiting(); + pk_rflg->flgptn = p->peek(); + return E_OK; +} + +#endif // 0 < CYG_UITRON_NUM( FLAGS ) +#endif // CYGPKG_UITRON_FLAGS + +#ifdef CYGPKG_UITRON_MBOXES +#if 0 < CYG_UITRON_NUM( MBOXES ) + +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE +CYG_UITRON_NEWFUNCTION( Cyg_Mbox ) + +CYG_UIT_FUNC_INLINE +ER +cre_mbx ( ID mbxid, T_CMBX* pk_cmbx ) +{ + ER ret = E_OK; + CYG_UIT_PARAMCHECK_PTR( pk_cmbx ); + CYG_UITRON_CHECK_NO_OBJ_LOCK_SCHED( MBOXES, mbxid ); + if ( ((ATR)(TA_TFIFO + TA_MFIFO)) != pk_cmbx->mbxatr ) + ret = E_RSATR; + else + CYG_UITRON_PTRS( MBOXES )[ mbxid - 1 ] = + new( &(CYG_UITRON_OBJS( MBOXES )[ mbxid - 1 ]) ) + Cyg_Mbox(); + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +del_mbx ( ID mbxid ) +{ + Cyg_Mbox *p; + CYG_UITRON_CHECK_AND_GETP_MBOXES( mbxid, p ); + Cyg_Scheduler::lock(); + // deal with the race condition here + if ( p != CYG_UITRON_PTRS( MBOXES )[ mbxid - 1 ] ) { + Cyg_Scheduler::unlock(); + return E_OBJ; + } + CYG_UITRON_PTRS( MBOXES )[ mbxid - 1 ] = NULL; + p->~Cyg_Mbox(); + Cyg_Scheduler::unlock(); + return E_OK; +} +#endif // CYGPKG_UITRON_MBOXES_CREATE_DELETE + +// This bit of unpleasantness is to allow uITRON programs to send a NULL +// message - if permitted by the parameter checking. +// +// NULL is used internally to mean no message; but -1 is fine. So we send +// a NULL as a NADR and if we see a NULL coming back, change it to a NADR. +// +// One hopes that often this will be optimized out, since the one or both +// of these being true has been detected and errored out just above. + +#ifdef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR +// represent a NULL as NADR internally +#define CYG_UIT_TMSG_FIXUP_IN( _p_ ) CYG_MACRO_START \ + if ( NULL == (_p_) ) \ + (_p_) = (T_MSG *)NADR; \ +CYG_MACRO_END + +// we get a NADR back sometimes, meaning NULL +#define CYG_UIT_TMSG_FIXUP_OUT( _p_ ) CYG_MACRO_START \ + if ( NADR == (_p_) ) \ + (_p_) = (T_MSG *)NULL; \ +CYG_MACRO_END + +#else +// NULL is checked for and makes an error +#define CYG_UIT_TMSG_FIXUP_IN( _p_ ) CYG_EMPTY_STATEMENT +#define CYG_UIT_TMSG_FIXUP_OUT( _p_ ) CYG_EMPTY_STATEMENT +#endif + +// and sometimes either in status enquiries +#define CYG_UIT_TMSG_FIXUP_ALL( _p_ ) CYG_MACRO_START \ + if ( NULL == (_p_) ) \ + (_p_) = (T_MSG *)NADR; \ + else if ( NADR == (_p_) ) \ + (_p_) = (T_MSG *)NULL; \ +CYG_MACRO_END + +CYG_UIT_FUNC_INLINE +ER +snd_msg ( ID mbxid, T_MSG *pk_msg ) +{ + Cyg_Mbox *p; + CYG_UITRON_CHECK_AND_GETP_MBOXES( mbxid, p ); + CYG_UIT_PARAMCHECK_PTR( pk_msg ); + CYG_UIT_TMSG_FIXUP_IN( pk_msg ); + cyg_bool result = p->tryput( (void *)pk_msg ); + if ( ! result ) + return E_QOVR; + return E_OK; +} + + +CYG_UIT_FUNC_INLINE +ER +rcv_msg ( T_MSG **ppk_msg, ID mbxid ) +{ + Cyg_Mbox *p; + CYG_UITRON_CHECK_AND_GETP_MBOXES( mbxid, p ); + CYG_UIT_PARAMCHECK_PTR( ppk_msg ); + CYG_UITRON_CHECK_DISPATCH_ENABLED(); + T_MSG *result = (T_MSG *)p->get(); + if ( ! result ) + CYG_UITRON_FAIL_RETURN(); + CYG_UIT_TMSG_FIXUP_OUT( result ); + *ppk_msg = result; + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +prcv_msg ( T_MSG **ppk_msg, ID mbxid ) +{ + Cyg_Mbox *p; + CYG_UITRON_CHECK_AND_GETP_MBOXES( mbxid, p ); + CYG_UIT_PARAMCHECK_PTR( ppk_msg ); + T_MSG *result = (T_MSG *)p->tryget(); + if ( ! result ) + return E_TMOUT; + CYG_UIT_TMSG_FIXUP_OUT( result ); + *ppk_msg = result; + return E_OK; +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +CYG_UIT_FUNC_INLINE +ER +trcv_msg ( T_MSG **ppk_msg, ID mbxid, TMO tmout ) +{ + Cyg_Mbox *p; + CYG_UITRON_CHECK_AND_GETP_MBOXES( mbxid, p ); + CYG_UIT_PARAMCHECK_PTR( ppk_msg ); + CYG_UITRON_CHECK_DISPATCH_ENABLED_TMO( tmout ); + // do this now for the case when no sleeping actually occurs + Cyg_Thread *self = Cyg_Thread::self(); + self->set_wake_reason( Cyg_Thread::TIMEOUT ); + T_MSG *result; + if ( TMO_FEVR == tmout ) + result = (T_MSG *)p->get(); + else if ( TMO_POL == tmout ) + result = (T_MSG *)p->tryget(); + else + result = (T_MSG *)p->get( + Cyg_Clock::real_time_clock->current_value() + + (cyg_tick_count)tmout ); + if ( ! result ) + CYG_UITRON_FAIL_RETURN_SELF( self ); + CYG_UIT_TMSG_FIXUP_OUT( result ); + *ppk_msg = result; + return E_OK; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +CYG_UIT_FUNC_INLINE +ER +ref_mbx ( T_RMBX *pk_rmbx, ID mbxid ) +{ + Cyg_Mbox *p; + CYG_UITRON_CHECK_AND_GETP_MBOXES( mbxid, p ); + CYG_UIT_PARAMCHECK_PTR( pk_rmbx ); + pk_rmbx->exinf = NADR; + pk_rmbx->wtsk = p->waiting_to_get(); + pk_rmbx->pk_msg = (T_MSG *)p->peek_item(); + CYG_UIT_TMSG_FIXUP_ALL( pk_rmbx->pk_msg ); + return E_OK; +} + +#undef CYG_UIT_TMSG_FIXUP_IN +#undef CYG_UIT_TMSG_FIXUP_OUT +#undef CYG_UIT_TMSG_FIXUP_ALL + +#endif // 0 < CYG_UITRON_NUM( MBOXES ) +#endif // CYGPKG_UITRON_MBOXES + +// - Extended Synchronization and Communication Functions + +#if 0 // NOT SUPPORTED +ER cre_mbf ( ID mbfid, T_CMBF *pk_cmbf ); +ER del_mbf ( ID mbfid ); +ER snd_mbf ( ID mbfid, VP msg, INT msgsz ); +ER psnd_mbf ( ID mbfid, VP msg, INT msgsz ); +ER tsnd_mbf ( ID mbfid, VP msg, INT msgsz, TMO tmout ); +ER rcv_mbf ( VP msg, INT *p_msgsz, ID mbfid ); +ER prcv_mbf ( VP msg, INT *p_msgsz, ID mbfid ); +ER trcv_mbf ( VP msg, INT *p_msgsz, ID mbfid, TMO tmout ); +ER ref_mbf ( T_RMBF *pk_rmbf, ID mbfid ); +ER cre_por ( ID porid, T_CPOR *pk_cpor ); +ER del_por ( ID porid ); +ER cal_por ( VP msg, INT *p_rmsgsz, ID porid, UINT calptn, INT + cmsgsz ); +ER pcal_por ( VP msg, INT *p_rmsgsz, ID porid, UINT calptn, INT + cmsgsz ); +ER tcal_por ( VP msg, INT *p_rmsgsz, ID porid, UINT calptn, INT + cmsgsz, TMO tmout ); +ER acp_por ( RNO *p_rdvno, VP msg, INT *p_cmsgsz, ID porid, UINT + acpptn ); +ER pacp_por ( RNO *p_rdvno, VP msg, INT *p_cmsgsz, ID porid, UINT + acpptn ); +ER tacp_por ( RNO *p_rdvno, VP msg, INT *p_cmsgsz, ID porid, UINT + acpptn, TMO tmout ); +ER fwd_por ( ID porid, UINT calptn, RNO rdvno, VP msg, INT cmsgsz + ); +ER rpl_rdv ( RNO rdvno, VP msg, INT rmsgsz ); +ER ref_por ( T_RPOR *pk_rpor, ID porid ); +#endif + +// - Interrupt Management Functions + +#if 0 // NOT SUPPORTED +ER def_int ( UINT dintno, T_DINT *pk_dint ); +void ret_wup ( ID tskid ); +#endif + +CYG_UIT_FUNC_INLINE +ER +loc_cpu ( void ) +{ + CYG_UITRON_CHECK_TASK_CONTEXT(); + Cyg_Interrupt::disable_interrupts(); + if ( 0 == Cyg_Scheduler::get_sched_lock() ) + Cyg_Scheduler::lock(); + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +unl_cpu ( void ) +{ + CYG_UITRON_CHECK_TASK_CONTEXT(); + Cyg_Interrupt::enable_interrupts(); + if ( 0 < Cyg_Scheduler::get_sched_lock() ) + Cyg_Scheduler::unlock(); + return E_OK; +} + +#if 0 // NOT SUPPORTED +ER dis_int ( UINT eintno ); +ER ena_int ( UINT eintno ); +ER chg_iXX ( UINT iXXXX ); +ER ref_iXX ( UINT *p_iXXXX ); +#endif + +// - Memorypool Management Functions +#ifdef CYGPKG_UITRON_MEMPOOLVAR +#if 0 < CYG_UITRON_NUM( MEMPOOLVAR ) + +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + +CYG_UITRON_NEWFUNCTION( Cyg_Mempool_Variable ) + +CYG_UIT_FUNC_INLINE +ER +cre_mpl ( ID mplid, T_CMPL *pk_cmpl ) +{ + ER ret = E_OK; + CYG_UIT_PARAMCHECK_PTR( pk_cmpl ); + CYG_UITRON_CHECK_NO_OBJ_LOCK_SCHED( MEMPOOLVAR, mplid ); + Cyg_Mempool_Variable *p = &(CYG_UITRON_OBJS( MEMPOOLVAR )[ mplid - 1 ]); + cyg_uint8 *base; + cyg_int32 size; + CYG_ADDRWORD scratch; + // preserve the original memory area to use + p->get_arena( base, size, scratch ); + + if ( size < pk_cmpl->mplsz ) + ret = E_NOMEM; + else if ( TA_TFIFO != pk_cmpl->mplatr ) + ret = E_RSATR; + else + CYG_UITRON_PTRS( MEMPOOLVAR )[ mplid - 1 ] = + new( p ) Cyg_Mempool_Variable( base, size ); + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +del_mpl ( ID mplid ) +{ + Cyg_Mempool_Variable *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLVAR( mplid, p ); + Cyg_Scheduler::lock(); + // deal with the race condition here + if ( p != CYG_UITRON_PTRS( MEMPOOLVAR )[ mplid - 1 ] ) { + Cyg_Scheduler::unlock(); + return E_OBJ; + } + CYG_UITRON_PTRS( MEMPOOLVAR )[ mplid - 1 ] = NULL; + p->~Cyg_Mempool_Variable(); + Cyg_Scheduler::unlock(); + return E_OK; +} +#endif // CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + +CYG_UIT_FUNC_INLINE +ER +get_blk ( VP *p_blk, ID mplid, INT blksz ) +{ + Cyg_Mempool_Variable *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLVAR( mplid, p ); + CYG_UIT_PARAMCHECK_PTR( p_blk ); + CYG_UIT_PARAMCHECK( blksz > 0, E_PAR ); + CYG_UITRON_CHECK_DISPATCH_ENABLED(); + VP result = (VP)p->alloc(blksz); + if ( ! result ) + CYG_UITRON_FAIL_RETURN(); + *p_blk = result; + return E_OK; +} + + +CYG_UIT_FUNC_INLINE +ER +pget_blk ( VP *p_blk, ID mplid, INT blksz ) +{ + Cyg_Mempool_Variable *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLVAR( mplid, p ); + CYG_UIT_PARAMCHECK_PTR( p_blk ); + CYG_UIT_PARAMCHECK( blksz > 0, E_PAR ); + VP result = (VP)p->try_alloc(blksz); + if ( ! result ) + return E_TMOUT; + *p_blk = result; + return E_OK; +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +CYG_UIT_FUNC_INLINE +ER +tget_blk ( VP *p_blk, ID mplid, INT blksz, TMO tmout ) +{ + Cyg_Mempool_Variable *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLVAR( mplid, p ); + CYG_UIT_PARAMCHECK_PTR( p_blk ); + CYG_UIT_PARAMCHECK( blksz > 0, E_PAR ); + CYG_UITRON_CHECK_DISPATCH_ENABLED_TMO( tmout ); + // do this now for the case when no sleeping actually occurs + Cyg_Thread *self = Cyg_Thread::self(); + self->set_wake_reason( Cyg_Thread::TIMEOUT ); + VP result; + if ( TMO_FEVR == tmout ) + result = p->alloc(blksz); + else if ( TMO_POL == tmout ) + result = p->try_alloc(blksz); + else + result = p->alloc( blksz, + Cyg_Clock::real_time_clock->current_value() + + (cyg_tick_count)tmout ); + if ( ! result ) + CYG_UITRON_FAIL_RETURN_SELF( self ); + *p_blk = result; + return E_OK; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +CYG_UIT_FUNC_INLINE +ER +rel_blk ( ID mplid, VP blk ) +{ + Cyg_Mempool_Variable *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLVAR( mplid, p ); + CYG_UIT_PARAMCHECK_PTR( blk ); + cyg_bool result = p->free( (cyg_uint8 *)blk, 0 ); + if ( ! result ) + return E_PAR; + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +ref_mpl ( T_RMPL *pk_rmpl, ID mplid ) +{ + Cyg_Mempool_Variable *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLVAR( mplid, p ); + CYG_UIT_PARAMCHECK_PTR( pk_rmpl ); + pk_rmpl->exinf = NADR; + pk_rmpl->wtsk = p->waiting(); + pk_rmpl->frsz = p->get_freemem(); + + cyg_uint8 *base; + cyg_int32 size; + CYG_ADDRWORD maxfree; + p->get_arena(base, size, maxfree); + pk_rmpl->maxsz = maxfree; + + return E_OK; +} + +#endif // 0 < CYG_UITRON_NUM( MEMPOOLVAR ) +#endif // CYGPKG_UITRON_MEMPOOLVAR + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED +#if 0 < CYG_UITRON_NUM( MEMPOOLFIXED ) + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + +CYG_UITRON_NEWFUNCTION( Cyg_Mempool_Fixed ) + +CYG_UIT_FUNC_INLINE +ER +cre_mpf ( ID mpfid, T_CMPF *pk_cmpf ) +{ + ER ret = E_OK; + CYG_UIT_PARAMCHECK_PTR( pk_cmpf ); + CYG_UITRON_CHECK_NO_OBJ_LOCK_SCHED( MEMPOOLFIXED, mpfid ); + Cyg_Mempool_Fixed *p = &(CYG_UITRON_OBJS( MEMPOOLFIXED )[ mpfid - 1 ]); + cyg_uint8 *base; + cyg_int32 size; + CYG_ADDRWORD scratch; + // preserve the original memory area to use + p->get_arena( base, size, scratch ); + + if ( size < (pk_cmpf->blfsz * (pk_cmpf->mpfcnt + 1)) ) + ret = E_NOMEM; + else if ( TA_TFIFO != pk_cmpf->mpfatr ) + ret = E_RSATR; + else + CYG_UITRON_PTRS( MEMPOOLFIXED )[ mpfid - 1 ] = + new( p ) + Cyg_Mempool_Fixed( base, size, + (CYG_ADDRWORD)pk_cmpf->blfsz ); + Cyg_Scheduler::unlock(); + return ret; +} + +CYG_UIT_FUNC_INLINE +ER +del_mpf ( ID mpfid ) +{ + Cyg_Mempool_Fixed *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLFIXED( mpfid, p ); + Cyg_Scheduler::lock(); + // deal with the race condition here + if ( p != CYG_UITRON_PTRS( MEMPOOLFIXED )[ mpfid - 1 ] ) { + Cyg_Scheduler::unlock(); + return E_OBJ; + } + CYG_UITRON_PTRS( MEMPOOLFIXED )[ mpfid - 1 ] = NULL; + p->~Cyg_Mempool_Fixed(); + Cyg_Scheduler::unlock(); + return E_OK; +} +#endif // CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + +CYG_UIT_FUNC_INLINE +ER +get_blf ( VP *p_blf, ID mpfid ) +{ + Cyg_Mempool_Fixed *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLFIXED( mpfid, p ); + CYG_UIT_PARAMCHECK_PTR( p_blf ); + CYG_UITRON_CHECK_DISPATCH_ENABLED(); + VP result = (VP)p->alloc(); + if ( ! result ) + CYG_UITRON_FAIL_RETURN(); + *p_blf = result; + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +pget_blf ( VP *p_blf, ID mpfid ) +{ + Cyg_Mempool_Fixed *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLFIXED( mpfid, p ); + CYG_UIT_PARAMCHECK_PTR( p_blf ); + VP result = (VP)p->try_alloc(); + if ( ! result ) + return E_TMOUT; + *p_blf = result; + return E_OK; +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +CYG_UIT_FUNC_INLINE +ER +tget_blf ( VP *p_blf, ID mpfid, TMO tmout ) +{ + Cyg_Mempool_Fixed *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLFIXED( mpfid, p ); + CYG_UIT_PARAMCHECK_PTR( p_blf ); + CYG_UITRON_CHECK_DISPATCH_ENABLED_TMO( tmout ); + // do this now for the case when no sleeping actually occurs + Cyg_Thread *self = Cyg_Thread::self(); + self->set_wake_reason( Cyg_Thread::TIMEOUT ); + VP result; + if ( TMO_FEVR == tmout ) + result = p->alloc(); + else if ( TMO_POL == tmout ) + result = p->try_alloc(); + else + result = p->alloc( + Cyg_Clock::real_time_clock->current_value() + + (cyg_tick_count)tmout ); + if ( ! result ) + CYG_UITRON_FAIL_RETURN_SELF( self ); + *p_blf = result; + return E_OK; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +CYG_UIT_FUNC_INLINE +ER +rel_blf ( ID mpfid, VP blf ) +{ + Cyg_Mempool_Fixed *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLFIXED( mpfid, p ); + CYG_UIT_PARAMCHECK_PTR( blf ); + cyg_bool result = p->free( (cyg_uint8 *)blf ); + if ( ! result ) + return E_PAR; + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +ref_mpf ( T_RMPF *pk_rmpf, ID mpfid ) +{ + Cyg_Mempool_Fixed *p; + CYG_UITRON_CHECK_AND_GETP_MEMPOOLFIXED( mpfid, p ); + CYG_UIT_PARAMCHECK_PTR( pk_rmpf ); + pk_rmpf->exinf = NADR; + pk_rmpf->wtsk = p->waiting(); + + cyg_int32 blocksize = p->get_blocksize(); + pk_rmpf->frbcnt = p->get_freemem() / blocksize; + // these two are "implementation dependent" ie. eCos only + pk_rmpf->numbcnt = p->get_totalmem() / blocksize; + pk_rmpf->bsize = blocksize; + + return E_OK; +} + +#endif // 0 < CYG_UITRON_NUM( MEMPOOLFIXED ) +#endif // CYGPKG_UITRON_MEMPOOLFIXED + +// - Time Management Functions + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK +CYG_UIT_FUNC_INLINE +ER +set_tim ( SYSTIME *pk_tim ) +{ + CYG_UIT_PARAMCHECK_PTR( pk_tim ); + Cyg_Clock::real_time_clock->set_value( *pk_tim ); + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +get_tim ( SYSTIME *pk_tim ) +{ + CYG_UIT_PARAMCHECK_PTR( pk_tim ); + *pk_tim = Cyg_Clock::real_time_clock->current_value(); + return E_OK; +} +#endif // CYGVAR_KERNEL_COUNTERS_CLOCK + + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +CYG_UIT_FUNC_INLINE +ER +dly_tsk ( DLYTIME dlytim ) +{ + CYG_UIT_PARAMCHECK( 0 <= dlytim, E_PAR ); + CYG_UITRON_CHECK_DISPATCH_ENABLED(); + if ( 0 >= dlytim ) + return E_OK; + Cyg_Thread *self = Cyg_Thread::self(); + CYG_UITRON_CHECK_TASK_CONTEXT_SELF( self ); + self->delay( dlytim ); + if ( Cyg_Thread::DONE != self->get_wake_reason() ) + CYG_UITRON_FAIL_RETURN_SELF( self ); + return E_OK; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK +#ifdef CYGPKG_UITRON_CYCLICS +#if 0 < CYG_UITRON_NUM( CYCLICS ) +CYG_UIT_FUNC_INLINE +ER +def_cyc ( HNO cycno, T_DCYC *pk_dcyc ) +{ + // pk_dcyc->cycatr is ignored + // The only relevant attribute is TA_HLNG/TA_ASM. + // This can be ignored as assembler routines are defined to be + // more conservative with registers than the procedure call standard. + + Cyg_Timer *p; + CYG_UITRON_CHECK_AND_GETHDLR( CYCLICS, cycno, p ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + CYG_UIT_PARAMCHECK( NULL != pk_dcyc, E_PAR ); +#endif + if( NADR == pk_dcyc ) { + p->~Cyg_Timer(); + return E_OK; + } + CYG_UIT_PARAMCHECK( 0 == (pk_dcyc->cycact & ~TCY_ON), E_PAR ); + CYG_UIT_PARAMCHECK( 0 < pk_dcyc->cyctim, E_PAR ); + p->initialize( + Cyg_Clock::real_time_clock, + (cyg_alarm_fn *)pk_dcyc->cychdr, + (CYG_ADDRWORD)pk_dcyc->exinf, + Cyg_Clock::real_time_clock->current_value() + pk_dcyc->cyctim, + pk_dcyc->cyctim, + pk_dcyc->cycact); + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +act_cyc ( HNO cycno, UINT cycact ) +{ + Cyg_Timer *p; + CYG_UITRON_CHECK_AND_GETHDLR( CYCLICS, cycno, p ); + CYG_UIT_PARAMCHECK( p->is_initialized(), E_NOEXS); + CYG_UIT_PARAMCHECK( 0 == (cycact & ~(TCY_ON | TCY_INI)), E_PAR ); + p->activate(cycact); + return E_OK; +} + + +CYG_UIT_FUNC_INLINE +ER +ref_cyc ( T_RCYC *pk_rcyc, HNO cycno ) +{ + Cyg_Timer *p; + cyg_tick_count t; + CYG_UITRON_CHECK_AND_GETHDLR( CYCLICS, cycno, p ); + CYG_UIT_PARAMCHECK( p->is_initialized(), E_NOEXS); + CYG_UIT_PARAMCHECK_PTR( pk_rcyc ); + + pk_rcyc->exinf = (VP)p->get_data(); + Cyg_Scheduler::lock(); + t = p->get_trigger() - Cyg_Clock::real_time_clock->current_value(); + Cyg_Scheduler::unlock(); + pk_rcyc->lfttim = t; + pk_rcyc->cycact = (UINT)p->is_enabled(); + return E_OK; +} +#endif // 0 < CYG_UITRON_NUM( CYCLICS ) +#endif // CYGPKG_UITRON_CYCLICS + +#ifdef CYGPKG_UITRON_ALARMS +#if 0 < CYG_UITRON_NUM( ALARMS ) +CYG_UIT_FUNC_INLINE +ER +def_alm ( HNO almno, T_DALM *pk_dalm ) +{ + Cyg_Timer *p; + cyg_tick_count t, now; + CYG_UITRON_CHECK_AND_GETHDLR( ALARMS, almno, p ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + CYG_UIT_PARAMCHECK( NULL != pk_dalm, E_PAR ); +#endif + if( NADR == pk_dalm ) { + p->~Cyg_Timer(); + return E_OK; + } + + CYG_UIT_PARAMCHECK( 0 == (pk_dalm->tmmode & ~TTM_REL), E_PAR ); + + // make the time arithmetic safe without locking + now = Cyg_Clock::real_time_clock->current_value(); + t = pk_dalm->almtim; + if( TTM_REL & pk_dalm->tmmode ) + t += now; + + CYG_UIT_PARAMCHECK( now < t, E_PAR ); + + p->initialize(Cyg_Clock::real_time_clock, + (cyg_alarm_fn *)pk_dalm->almhdr, + (CYG_ADDRWORD)pk_dalm->exinf, + t, 0, Cyg_Timer::ENABLE); + + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +ref_alm ( T_RALM *pk_ralm, HNO almno ) +{ + Cyg_Timer *p; + cyg_tick_count t; + + CYG_UITRON_CHECK_AND_GETHDLR( ALARMS, almno, p ); + CYG_UIT_PARAMCHECK_PTR( pk_ralm ); + CYG_UIT_PARAMCHECK( p->is_initialized(), E_NOEXS); + + Cyg_Scheduler::lock(); + t = p->get_trigger() - Cyg_Clock::real_time_clock->current_value(); + Cyg_Scheduler::unlock(); + pk_ralm->exinf = (VP)p->get_data(); + pk_ralm->lfttim = t; + return E_OK; +} +#endif // 0 < CYG_UITRON_NUM( ALARMS ) +#endif // CYGPKG_UITRON_ALARMS + +#endif // CYGVAR_KERNEL_COUNTERS_CLOCK + +// - System Management Functions + +CYG_UIT_FUNC_INLINE +ER +get_ver ( T_VER *pk_ver ) +{ + CYG_UIT_PARAMCHECK_PTR( pk_ver ); + + pk_ver->maker = CYGNUM_UITRON_VER_MAKER; + pk_ver->id = CYGNUM_UITRON_VER_ID; + pk_ver->spver = CYGNUM_UITRON_VER_SPVER; + pk_ver->prver = CYGNUM_UITRON_VER_PRVER; + pk_ver->prno[0] = CYGNUM_UITRON_VER_PRNO_0; + pk_ver->prno[1] = CYGNUM_UITRON_VER_PRNO_1; + pk_ver->prno[2] = CYGNUM_UITRON_VER_PRNO_2; + pk_ver->prno[3] = CYGNUM_UITRON_VER_PRNO_3; + pk_ver->cpu = CYGNUM_UITRON_VER_CPU; + pk_ver->var = CYGNUM_UITRON_VER_VAR; + + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +ref_sys ( T_RSYS *pk_rsys ) +{ + CYG_UIT_PARAMCHECK_PTR( pk_rsys ); + if ( ! Cyg_Interrupt::interrupts_enabled() ) + // CPU is locked + pk_rsys->sysstat = TSS_LOC; + else + pk_rsys->sysstat = + (Cyg_Scheduler::get_sched_lock() == 0) ? TSS_TSK : TSS_DDSP; + return E_OK; +} + +CYG_UIT_FUNC_INLINE +ER +ref_cfg ( T_RCFG *pk_rcfg ) +{ + CYG_UIT_PARAMCHECK_PTR( pk_rcfg ); + // no details here yet + return E_OK; +} + +#if 0 // NOT SUPPORTED +ER def_svc ( FN s_fncd, T_DSVC *pk_dsvc ); +ER def_exc ( UINT exckind, T_DEXC *pk_dexc ); +#endif + +// - Network Support Functions + +#if 0 // NOT SUPPORTED +ER nrea_dat ( INT *p_reasz, VP dstadr, NODE srcnode, VP srcadr, + INT datsz ); +ER nwri_dat ( INT *p_wrisz, NODE dstnode, VP dstadr, VP srcadr, + INT datsz ); +ER nget_nod ( NODE *p_node ); +ER nget_ver ( T_VER *pk_ver, NODE node ); +#endif + +// ======================================================================== + +#endif // CYGPKG_UITRON + +#endif // CYGPRI_UITRON_FUNCS_HERE_AND_NOW + +#endif // CYGONCE_COMPAT_UITRON_UIT_FUNC_INL +//EOF uit_func.inl diff --git a/packages/compat/uitron/current/include/uit_objs.hxx b/packages/compat/uitron/current/include/uit_objs.hxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/include/uit_objs.hxx @@ -0,0 +1,163 @@ +#ifndef CYGONCE_COMPAT_UITRON_UIT_OBJS_HXX +#define CYGONCE_COMPAT_UITRON_UIT_OBJS_HXX +//=========================================================================== +// +// uit_objs.hxx +// +// uITRON static objects +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON static system objects +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al + +#ifdef CYGPKG_UITRON + +#include // types; cyg_int32, CYG_ADDRWORD + +#include + +#include + +#include // Cyg_Thread +#include // Cyg_Mbox +#include // Cyg_Flag +#include // Cyg_Counting_Semaphore2 +#include // Cyg_Mempool_Fixed +#include // Cyg_Mempool_Variable +#include // Cyg_Timer + +// ------------------------------------------------------------------------ +// Some pasting macros to create names of the config macro and the +// static data resulting: + +#define CYG_UITRON_NUM( _which_ ) (CYGNUM_UITRON_ ## _which_) +#define CYG_UITRON_OBJS( _which_ ) cyg_uitron_ ## _which_ +#define CYG_UITRON_PTRS( _which_ ) cyg_uitron_ ## _which_ ## _ptrs +// ------------------------------------------------------------------------ +// CYG_UITRON_DECL +// +// Macro to declare static uitron static objects; uses the appropriate +// config define for the number of them to have. + +#define CYG_UITRON_DECL( _which_ ) \ + CYG_UITRON_OBJS( _which_ ) [ CYG_UITRON_NUM( _which_ ) ] + +// and the array of pointers to them for those with dynamic existence: +#define CYG_UITRON_DECL_PTRS( _which_ ) \ + CYG_UITRON_PTRS( _which_ ) [ CYG_UITRON_NUM( _which_ ) ] + + +// ------------------------------------------------------------------------ +// The external system objects themselves. + +#ifdef CYGPKG_UITRON_SEMAS +extern +Cyg_Counting_Semaphore2 CYG_UITRON_OBJS( SEMAS ) []; +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE +extern +Cyg_Counting_Semaphore2 *CYG_UITRON_PTRS( SEMAS ) []; +#endif +#endif +#ifdef CYGPKG_UITRON_MBOXES +extern +Cyg_Mbox CYG_UITRON_OBJS( MBOXES ) []; +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE +extern +Cyg_Mbox *CYG_UITRON_PTRS( MBOXES ) []; +#endif +#endif +#ifdef CYGPKG_UITRON_FLAGS +extern +Cyg_Flag CYG_UITRON_OBJS( FLAGS ) []; +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE +extern +Cyg_Flag *CYG_UITRON_PTRS( FLAGS ) []; +#endif +#endif +// there must always be tasks +extern +Cyg_Thread CYG_UITRON_OBJS( TASKS ) []; +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE +extern +Cyg_Thread *CYG_UITRON_PTRS( TASKS ) []; +#endif +// no endif +#ifdef CYGPKG_UITRON_MEMPOOLFIXED +extern +Cyg_Mempool_Fixed CYG_UITRON_OBJS( MEMPOOLFIXED ) []; +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE +extern +Cyg_Mempool_Fixed *CYG_UITRON_PTRS( MEMPOOLFIXED )[]; +#endif +#endif +#ifdef CYGPKG_UITRON_MEMPOOLVAR +extern +Cyg_Mempool_Variable CYG_UITRON_OBJS( MEMPOOLVAR ) []; +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE +extern +Cyg_Mempool_Variable *CYG_UITRON_PTRS( MEMPOOLVAR ) []; +#endif +#endif +#ifdef CYGPKG_UITRON_CYCLICS +extern +Cyg_Timer CYG_UITRON_OBJS( CYCLICS ) []; +#endif +#ifdef CYGPKG_UITRON_ALARMS +extern +Cyg_Timer CYG_UITRON_OBJS( ALARMS ) []; +#endif + +// ------------------------------------------------------------------------ +// Ancillary system objects - cleaner than extending the basic class + +#ifdef CYGIMP_THREAD_PRIORITY +// An array of priorities, for resetting back to the "created" prio when a +// task cycles though exit, dormancy, restart. +extern cyg_priority +cyg_uitron_task_initial_priorities[ CYG_UITRON_NUM( TASKS ) ]; +// and an accessor macro, for the addressing of this is naturally +// from 1..N also: +#define CYG_UITRON_TASK_INITIAL_PRIORITY( _tskid_ ) \ + (cyg_uitron_task_initial_priorities[ (_tskid_) - 1 ]) +#endif // CYGIMP_THREAD_PRIORITY + +// ------------------------------------------------------------------------ + +#endif // CYGPKG_UITRON + +#endif // CYGONCE_COMPAT_UITRON_UIT_OBJS_HXX +// EOF uit_objs.hxx diff --git a/packages/compat/uitron/current/include/uit_type.h b/packages/compat/uitron/current/include/uit_type.h new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/include/uit_type.h @@ -0,0 +1,676 @@ +#ifndef CYGONCE_COMPAT_UITRON_UIT_TYPE_H +#define CYGONCE_COMPAT_UITRON_UIT_TYPE_H +//=========================================================================== +// +// uit_type.h +// +// uITRON specific data types as required by the API +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON specific data types as required by the API +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al + +#ifdef CYGPKG_UITRON + +// ------------------------------------------------------------------------ +// uITRON types +// + +// from this section of the uITRON 3.02 manual: +// *********************************************************************** +// *** 6.4 Data Types *** +// *********************************************************************** +// +// *** General-Purpose Data Types *************************************** + +typedef cyg_int8 B; // signed 8-bit integer +typedef cyg_int16 H; // signed 16-bit integer +typedef cyg_int32 W; // signed 32-bit integer +typedef cyg_uint8 UB; // unsigned 8-bit integer +typedef cyg_uint16 UH; // unsigned 16-bit integer +typedef cyg_uint32 UW; // unsigned 32-bit integer + // +typedef cyg_uint32 VW; // unpredictable data type (32-bit size) +typedef cyg_uint16 VH; // unpredictable data type (16-bit size) +typedef cyg_uint8 VB; // unpredictable data type (8-bit size) + +typedef void * VP; // pointer to an unpredictable data type + +typedef CYG_ADDRWORD FP; // program start address + +// * The difference between VB, VH and VW and B, H and W is that only the +// number of bits is known for the former, not the data type of the +// contents. The latter clearly represent integers. +// +// *** Data Types Dependent on ITRON Specification *** +// +// In order to clarify the meanings of certain parameters, the following +// names are used for data types which appear frequently and/or have +// special meanings. + +typedef cyg_int32 INT; // Signed integer (bit width of processor) +typedef cyg_uint32 UINT; // Unsigned integer (bit width of processor) +typedef cyg_int32 BOOL; // Boolean value. TRUE (1) or FALSE (0). +typedef cyg_uint16 FN; // Function code. Signed integer. Maximum 2 bytes. +typedef INT ID; // Object ID number (???id) +typedef INT BOOL_ID;// Boolean value or ID number +typedef INT HNO; // Handler number +typedef INT RNO; // Rendezvous number +typedef INT NODE; // Node Number. Usually a signed integer. +typedef UINT ATR; // Object or handler attribute. An unsigned integer. +typedef INT ER; // Error code. A signed integer. +typedef INT PRI; // Task priority. A signed integer. +typedef UB T_MSG; // Message packet data structure used for mailboxes +typedef INT TMO; // Timeout value. A signed integer. + // TMO_POL = 0 indicates polling, + // while TMO_FEVR = -1 indicates wait forever. + +typedef cyg_uint64 CYGTM; +typedef CYGTM SYSTIME;// Data types used for specifying times. +typedef CYGTM CYCTIME;// Often split into upper and lower sections. +typedef CYGTM ALMTIME;// For details, see the chapter giving system +typedef CYGTM DLYTIME;// call descriptions;. + +// *********************************************************************** +// *** 6.7 Error Codes *** +// *********************************************************************** + +enum { +//------------------------------------------------------ +//Mnemonic Value Description +//------------------------------------------------------ +E_OK = 0, // Normal completion +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_SYS = (-5), // System error +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_NOMEM = (-10), // Insufficient memory +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_NOSPT = (-17), // Feature not supported +E_INOSPT = (-18), // Feature not supported by ITRON/FILE specification +E_RSFN = (-20), // Reserved function code number +E_RSATR = (-24), // Reserved attribute +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_PAR = (-33), // Parameter error +E_ID = (-35), // Invalid ID number +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_NOEXS = (-52), // Object does not exist +E_OBJ = (-63), // Invalid object state +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_MACV = (-65), // Memory access disabled or memory access violation +E_OACV = (-66), // Object access violation +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_CTX = (-69), // Context error +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_QOVR = (-73), // Queuing or nesting overflow +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_DLT = (-81), // Object being waited for was deleted +// - - - - - - - - // - - - - - - - - - - - - - - - - - - +E_TMOUT = (-85), // Polling failure or timeout exceeded +E_RLWAI = (-86), // WAIT state was forcibly released +// - - - - - - - - // - - - - - - - - - - - - - - - - - - - +#if 0 // CONNECTION FUNCTIONS ARE NOT SUPPORTED +EN_NOND = (-113), // Target node does not exist or cannot be accessed +EN_OBJNO = (-114), // Specifies an object number which could not be + // accessed on the target node +EN_PROTO = (-115), // Protocol not supported on target node +EN_RSFN = (-116), // System call or function not supported on target node +EN_COMM = (-117), // No response from target node +EN_RLWAI = (-118), // Connection function response wait state was forcibly + // released +EN_PAR = (-119), // A value outside the range supported by the target + // node and/or transmission packet format was specified + // as a parameter +EN_RPAR = (-120), // A value outside the range supported by the issuing + // node and/or transmission packet format was returned + // as a return parameter +EN_CTXID = (-121), // An object on another node was specified to a system + // call issued from a task in dispatch disabled state + // or from a task-independent portion +EN_EXEC = (-122), // System call could not be executed due to + // insufficient resources on the target node +EN_NOSPT = (-123), // Connection function not supported +#endif // 0 CONNECTION FUNCTIONS ARE NOT SUPPORTED +// - - - - - - - - // - - - - - - - - - - - - - - - - - - - +}; + + +// ******************************************************************* +// *** 6.6 Common Constants and Data Structure Packet Formats *** +// ******************************************************************* + +/* --- overall ----------------------- */ + +/* invalid address or pointer value */ +#define NADR ((void *)(-1)) + +enum { + TRUE = 1, /* true */ + FALSE = 0, /* false */ +}; + +/* TMO tmout: */ +enum { + TMO_POL = 0, /* polling */ + TMO_FEVR = (-1) /* wait forever */ +}; + +/* --- for task management functions ----------------------- */ + +// cre_tsk: + typedef struct t_ctsk { + VP exinf; /* extended information */ + ATR tskatr; /* task attributes */ + FP task; /* task start address */ + PRI itskpri; /* initial task priority */ + INT stksz; /* stack size */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_CTSK; + +// tskatr: +enum { + TA_ASM = 0x00, /* program written in assembly language */ + TA_HLNG = 0x01, /* program written in high-level language */ + TA_COP0 = 0x8000, /* uses coprocessor having ID = 0 */ + TA_COP1 = 0x4000, /* uses coprocessor having ID = 1 */ + TA_COP2 = 0x2000, /* uses coprocessor having ID = 2 */ + TA_COP3 = 0x1000, /* uses coprocessor having ID = 3 */ + TA_COP4 = 0x0800, /* uses coprocessor having ID = 4 */ + TA_COP5 = 0x0400, /* uses coprocessor having ID = 5 */ + TA_COP6 = 0x0200, /* uses coprocessor having ID = 6 */ + TA_COP7 = 0x0100, /* uses coprocessor having ID = 7 */ +}; + +// tskid: +enum { + TSK_SELF = 0, /* task specifies itself */ + /* FALSE = 0, */ /* indicates a task-independent portion (return + parameters only) */ +}; +// tskpri: +enum { + TPRI_INI = 0, /* specifies the initial priority on task startup + (chg_pri) */ + TPRI_RUN = 0, /* specifies the highest priority during execution + (rot_rdq) */ +}; + /* ref_tsk */ + typedef struct t_rtsk { + VP exinf; /* extended information */ + PRI tskpri; /* current priority */ + UINT tskstat; /* task state */ + /* the following are represent extended features of support + [level X] (implementation-dependent) */ +#if 0 // NOT SUPPORTED + UINT tskwait; /* cause of wait */ + ID wid; /* ID of object being waited for */ + INT wupcnt; /* wakeup request count */ + INT suscnt; /* SUSPEND request count */ + ATR tskatr; /* task attributes */ + FP task; /* task start address */ + PRI itskpri; /* initial task priority */ + INT stksz; /* stack size */ + // ... +#endif + } T_RTSK; + +// tskstat: +enum { + TTS_RUN = 0x01, /* RUN */ + TTS_RDY = 0x02, /* READY */ + TTS_WAI = 0x04, /* WAIT */ + TTS_SUS = 0x08, /* SUSPEND */ + TTS_WAS = 0x0C, /* WAIT-SUSPEND */ + TTS_DMT = 0x10, /* DORMANT */ +}; +// tskwait: +enum { + TTW_SLP = 0x0001, /* wait due to slp_tsk or tslp_tsk */ + TTW_DLY = 0x0002, /* wait due to dly_tsk */ + TTW_NOD = 0x0008, /* connection function response wait */ + TTW_FLG = 0x0010, /* wait due to wai_flg or twai_flg */ + TTW_SEM = 0x0020, /* wait due to wai_sem or twai_sem */ + TTW_MBX = 0x0040, /* wait due to rcv_msg or trcv_msg */ + TTW_SMBF = 0x0080, /* wait due to snd_mbf or tsnd_mbf */ + TTW_MBF = 0x0100, /* wait due to rcv_mbf or trcv_mbf */ + TTW_CAL = 0x0200, /* wait for rendezvous call */ + TTW_ACP = 0x0400, /* wait for rendezvous accept */ + TTW_RDV = 0x0800, /* wait for rendezvous completion */ + TTW_MPL = 0x1000, /* wait due to get_blk or tget_blk */ + TTW_MPF = 0x2000, /* wait due to get_blf or tget_blf */ +}; + /* Since the task states given by tskstat and tskwait are expressed + by bit correspondences, they are convenient when looking for OR + conditions (such as whether a task is in WAIT or READY state). + */ + +/* --- for semaphore functions ----------------------- */ + + /* cre_sem */ + typedef struct t_csem { + VP exinf; /* extended information */ + ATR sematr; /* semaphore attributes */ + /* Following is the extended function for [level X]. */ + INT isemcnt; /* initial semaphore count */ + /* INT maxsem; NOT SUPPORTED maximum semaphore count */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_CSEM; + + /* ref_sem */ + typedef struct t_rsem { + VP exinf; /* extended information */ + BOOL_ID wtsk; /* indicates whether or not there is a + waiting task */ + INT semcnt; /* current semaphore count */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_RSEM; + +/* --- for eventflag functions ----------------------- */ + + /* cre_flg */ + typedef struct t_cflg { + VP exinf; /* extended information */ + ATR flgatr; /* eventflag attribute */ + UINT iflgptn; /* initial eventflag */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_CFLG; + +// flgatr: +enum { + TA_WSGL = 0x00, /* multiple tasks are not allowed to wait (Wait + Single Task) */ + TA_WMUL = 0x08, /* multiple tasks are allowed to wait (Wait + Multiple Task) */ +}; +// wfmode: +enum { + TWF_ANDW = 0x00, /* AND wait */ + TWF_ORW = 0x02, /* OR wait */ + TWF_CLR = 0x01, /* clear specification */ +}; + /* ref_flg */ + typedef struct t_rflg { + VP exinf; /* extended information */ + BOOL_ID wtsk; /* indicates whether or not there is a + waiting task */ + UINT flgptn; /* eventflag bit pattern */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_RFLG; + +/* --- for mailbox functions ----------------------- */ + + /* cre_mbx */ + typedef struct t_cmbx { + VP exinf; /* extended information */ + ATR mbxatr; /* mailbox attributes */ + /* Following is implementation-dependent function */ + /* INT bufcnt; NOT SUPPORTED ring buffer size IS FIXED */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_CMBX; + +// mbxatr: +enum { + TA_TFIFO = 0x00, /* waiting tasks are handled by FIFO */ + TA_TPRI = 0x01, /* waiting tasks are handled by priority */ + TA_MFIFO = 0x00, /* messages are handled by FIFO */ + TA_MPRI = 0x02, /* messages are handled by priority */ +}; + + /* ref_mbx */ + typedef struct t_rmbx { + VP exinf; /* extended information */ + BOOL_ID wtsk; /* indicates whether or not there is a + waiting task */ + T_MSG* pk_msg; /* message to be sent next */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_RMBX; + +/* --- for messagebuffer functions ----------------------- */ + +#if 0 // NOT SUPPORTED + /* cre_mbf */ + typedef struct t_cmbf { + VP exinf; /* extended information */ + ATR mbfatr; /* messagebuffer attributes */ + INT bufsz; /* messagebuffer size */ + INT maxmsz; /* maximum size of messages */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_CMBF; + +// mbfatr: +// mbfid: +enum { + TMBF_OS = (-4), /* messagebuffer used for OS error log */ + TMBF_DB = (-3), /* messagebuffer used for debugging */ +}; + /* ref_mbf */ + typedef struct t_rmbf { + VP exinf; /* extended information */ + BOOL_ID wtsk; /* indicates whether or not there is a + task waiting to receive a message */ + BOOL_ID stsk; /* indicates whether or not there is a + task waiting to send a message */ + INT msgsz; /* size of message to be sent next */ + INT frbufsz; /* size of free buffer */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_RMBF; + +#endif +/* --- for port or rendezvous functions ----------------------- */ + +#if 0 // NOT SUPPORTED + + /* cre_por */ + typedef struct t_cpor { + VP exinf; /* extended information */ + ATR poratr; /* port attributes */ + INT maxcmsz; /* maximum call message size */ + INT maxrmsz; /* maximum reply message size */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_CPOR; + +// poratr: +enum { + TA_NULL = 0, /* specifies no particular attributes */ + /* TA_NULL should be used in place of zeroes to turn off all + attribute features. */ +}; + /* ref_por */ + typedef struct t_rpor { + VP exinf; /* extended information */ + BOOL_ID wtsk; /* indicates whether or not there is a task + waiting to call a rendezvous */ + BOOL_ID atsk; /* indicates whether or not there is a task + waiting to accept a rendezvous */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_RPOR; +#endif + +/* --- for interrupt management functions ----------------------- */ + +#if 0 // NOT SUPPORTED + /* def_int */ + typedef struct t_dint { + ATR intatr; /* interrupt handler attributes */ + FP inthdr; /* interrupt handler address */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_DINT; +#endif + +/* --- for memorypool management functions ----------------------- */ + + /* cre_mpl */ + typedef struct t_cmpl { + VP exinf; /* extended information */ + ATR mplatr; /* memorypool attributes */ + INT mplsz; /* memorypool size */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_CMPL; + +// mplatr: +// mplid: +enum { + TMPL_OS = (-4) /* memorypool used by OS */ +}; + /* ref_mpl */ + typedef struct t_rmpl { + VP exinf; /* extended information */ + BOOL_ID wtsk; /* indicates whether or not there are + waiting tasks */ + INT frsz; /* total size of free memory */ + INT maxsz; /* size of largest contiguous memory */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_RMPL; + + /* cre_mpf */ + typedef struct t_cmpf { + VP exinf; /* extended information */ + ATR mpfatr; /* memorypool attributes */ + INT mpfcnt; /* block count for entire memorypool */ + INT blfsz; /* fixed-size memory block size */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_CMPF; + +// mpfatr: + /* ref_mpf */ + typedef struct t_rmpf { + VP exinf; /* extended information */ + BOOL_ID wtsk; /* indicates whether or not there are + waiting tasks */ + INT frbcnt; /* free block count */ + /* additional information may be included depending on the + implementation */ + INT numbcnt; /* total number of blocks */ + INT bsize; /* block size */ + + } T_RMPF; + +/* --- for time management functions ----------------------- */ + +#if 0 // native definition is at head of this file + /* example for 32-bit CPUs */ + typedef struct t_systime { + H utime; /* upper 16 bits */ + UW ltime; /* lower 32 bits */ + } SYSTIME, CYCTIME, ALMTIME; + + /* example for 16-bit CPUs */ + typedef struct t_systime { + H utime; /* upper 16 bits */ + UH mtime; /* middle 16 bits */ + UH ltime; /* lower 16 bits */ + } SYSTIME, CYCTIME, ALMTIME; +#endif + /* Member configuration depends on the bit width of the processor and + on the implementation. A total of 48 bits is recommended. */ + + /* def_cyc */ + typedef struct t_dcyc { + VP exinf; /* extended information */ + ATR cycatr; /* cyclic handler attributes */ + FP cychdr; /* cyclic handler address */ + UINT cycact; /* cyclic handler activation */ + CYCTIME cyctim; /* cyclic startup period */ + } T_DCYC; + +// cycact: +enum { + TCY_OFF = 0x00, /* do not invoke cyclic handler */ + TCY_ON = 0x01, /* invoke cyclic handler */ + TCY_INT = 0x02, /* initialize cycle count */ + /* Following changed from TCY_INT to TCY_INI to match + description in the body of the standard. I assume TCY_INT + is a hypercorrection/typo; keep both */ + TCY_INI = 0x02, /* initialize cycle count */ +}; + /* ref_cyc */ + typedef struct t_rcyc { + VP exinf; /* extended information */ + CYCTIME lfttim; /* time left before next handler startup */ + UINT cycact; /* cyclic handler activation */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_RCYC; + + /* def_alm */ + typedef struct t_dalm { + VP exinf; /* extended information */ + ATR almatr; /* alarm handler attributes */ + FP almhdr; /* alarm handler address */ + UINT tmmode; /* start time specification mode */ + ALMTIME almtim; /* handler startup time */ + } T_DALM; + +// tmmode: +enum { + TTM_ABS = 0x00, /* specified as an absolute time */ + TTM_REL = 0x01, /* specified as a relative time */ +}; + /* ref_alm */ + typedef struct t_ralm { + VP exinf; /* extended information */ + ALMTIME lfttim; /* time left before next handler startup */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_RALM; + +/* --- for system management functions ----------------------- */ + + /* get_ver */ + typedef struct t_ver { + UH maker; /* vendor */ + UH id; /* format number */ + UH spver; /* specification version */ + UH prver; /* product version */ + UH prno[4]; /* product control information */ + UH cpu; /* CPU information */ + UH var; /* variation descriptor */ + } T_VER; + + /* ref_sys */ + typedef struct t_rsys { + INT sysstat; /* system state */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_RSYS; + +// sysstat: +enum { + TSS_TSK = 0, /* normal state in which dispatching is enabled during + task portion execution */ + TSS_DDSP = 1, /* state after dis_dsp has been executed during task + portion execution (dispatch disabled) */ + TSS_LOC = 3, /* state after loc_cpu has been executed during task + portion execution (interrupt and dispatch disabled) + */ + TSS_INDP = 4, /* state during execution of task-independent portions + (interrupt and timer handlers) */ +}; + /* ref_cfg */ + typedef struct t_rcfg { + /* details concerning members are implementation dependent */ + } T_RCFG; + +#if 0 // NOT SUPPORTED + /* def_svc */ + typedef struct t_dsvc { + ATR svcatr; /* extended SVC handler attributes */ + FP svchdr; /* extended SVC handler address */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_DSVC; + + /* def_exc */ + typedef struct t_dexc { + ATR excatr; /* exception handler attributes */ + FP exchdr; /* exception handler address */ + // ... + /* additional information may be included depending on the + implementation */ + // ... + } T_DEXC; +#endif + +/* --- for network management functions ----------------------- */ + +#if 0 // NOT SUPPORTED +// NODE srcnode, dstnode, node: +enum { + TND_SELF = 0, /* specifies the local node */ + TND_OTHR = (-1) /* specifies default remote node */ +}; +#endif +/* ------------------------------------------------------ */ + + + +#endif // CYGPKG_UITRON + +#endif // CYGONCE_COMPAT_UITRON_UIT_TYPE_H +// EOF uit_type.h diff --git a/packages/compat/uitron/current/src/PKGconf.mak b/packages/compat/uitron/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/src/PKGconf.mak @@ -0,0 +1,41 @@ +#============================================================================= +# +# makefile +# +# compat/uitron/src +# +#============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================ + +PACKAGE := uitron +include ../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := uit_func.cxx uit_objs.cxx +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/compat/uitron/current/src/uit_func.cxx b/packages/compat/uitron/current/src/uit_func.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/src/uit_func.cxx @@ -0,0 +1,159 @@ +//=========================================================================== +// +// uit_func.cxx +// +// uITRON compatibility functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON compatibility functions +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al + +#ifdef CYGPKG_UITRON + +// invoke the inline function definition to create static C linkage +// functions here: +#define CYGPRI_UITRON_FUNCS_HERE_AND_NOW +#include + +// ------------------------------------------------------------------------ +// STARTUP +// this routine is outside the uITRON specification; call it from +// cyg_start(), cyg_package_start(), cyg_prestart() or cyg_user_start() +// to start the uITRON tasks and scheduler. + +#if CYGNUM_UITRON_START_TASKS < 0 +#error CYGNUM_UITRON_START_TASKS should be >= 0 +#endif + +#if CYGNUM_UITRON_START_TASKS == 0 +#define START_TASKS CYGNUM_UITRON_TASKS +#else +#define START_TASKS CYGNUM_UITRON_START_TASKS +#endif + +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE +#if START_TASKS > CYGNUM_UITRON_TASKS_INITIALLY +#undef START_TASKS +#define START_TASKS CYGNUM_UITRON_TASKS_INITIALLY +#endif +#endif + +#if START_TASKS > CYGNUM_UITRON_TASKS +#undef START_TASKS +#define START_TASKS CYGNUM_UITRON_TASKS +#endif + +#if START_TASKS <= 0 +#error Number of uITRON tasks to start initially must be >= 0 +#endif + + +#define SET_UP_PTRS( _which_ ) CYG_MACRO_START \ + for ( i = 0; \ + (i < CYGNUM_UITRON_ ## _which_ ## _INITIALLY) && \ + (i < CYGNUM_UITRON_ ## _which_ ) ; \ + i++ ) { \ + CYG_UITRON_PTRS( _which_ )[ i ] = CYG_UITRON_OBJS( _which_ ) + i; \ + } \ + for ( /* i as is */; i < CYGNUM_UITRON_ ## _which_ ; i++ ) { \ + CYG_UITRON_PTRS( _which_ )[ i ] = NULL; \ + } \ +CYG_MACRO_END + +void cyg_uitron_start( void ) +{ + cyg_int32 i; + for ( i = 0; i < START_TASKS; i++ ) { +#ifdef CYGIMP_THREAD_PRIORITY + // save the initial priority in our private array + cyg_uitron_task_initial_priorities[ i ] = + cyg_uitron_TASKS[ i ].get_priority(); +#endif + // and awaken the task: + cyg_uitron_TASKS[ i ].resume(); + } + for ( /* i as is */; i < CYGNUM_UITRON_TASKS; i++ ) { +#ifdef CYGIMP_THREAD_PRIORITY + // save the initial priority in our private array + cyg_uitron_task_initial_priorities[ i ] = + cyg_uitron_TASKS[ i ].get_priority(); +#endif + // but ensure the task state is dormant. + cyg_uitron_TASKS[ i ].kill(); + } + +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE + SET_UP_PTRS( TASKS ); +#endif +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + SET_UP_PTRS( SEMAS ); +#endif +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + SET_UP_PTRS( MBOXES ); +#endif +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + SET_UP_PTRS( FLAGS ); +#endif +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + SET_UP_PTRS( MEMPOOLFIXED ); +#endif +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + SET_UP_PTRS( MEMPOOLVAR ); +#endif +} + +// These allow programs to link when cyg_uitron_start() is called +// (often because of CYGSEM_START_UITRON_COMPATIBILITY from infra, +// though we define these regardless just in case) +// even when there is no interest in uITRON and so the tasks are +// not externally defined; the reference to cyg_uitron_start() +// ensures the tasks array et al are still included... +extern "C" { + void task1( unsigned int arg ) CYGBLD_ATTRIB_WEAK; + void task2( unsigned int arg ) CYGBLD_ATTRIB_WEAK; + void task3( unsigned int arg ) CYGBLD_ATTRIB_WEAK; + void task4( unsigned int arg ) CYGBLD_ATTRIB_WEAK; +} + +void task1( unsigned int arg ) {} +void task2( unsigned int arg ) {} +void task3( unsigned int arg ) {} +void task4( unsigned int arg ) {} + +#endif // CYGPKG_UITRON + +// EOF uit_func.cxx diff --git a/packages/compat/uitron/current/src/uit_objs.cxx b/packages/compat/uitron/current/src/uit_objs.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/src/uit_objs.cxx @@ -0,0 +1,346 @@ +//=========================================================================== +// +// uit_objs.cxx +// +// uITRON static objects +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON static system objects +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al + +#ifdef CYGPKG_UITRON + +#include + // declarations of the objects + // we define below, and everything + // we need to specify them. + +// ------------------------------------------------------------------------ +// Mboxes have no initializer. +#ifdef CYGPKG_UITRON_MBOXES +#if 0 < CYGNUM_UITRON_MBOXES +Cyg_Mbox CYG_UITRON_DECL( MBOXES ); +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE +Cyg_Mbox *CYG_UITRON_DECL_PTRS( MBOXES ); +#endif +#endif +#endif // CYGPKG_UITRON_MBOXES + +// ------------------------------------------------------------------------ +// Flags have no initializer. +#ifdef CYGPKG_UITRON_FLAGS +#if 0 < CYGNUM_UITRON_FLAGS +Cyg_Flag CYG_UITRON_DECL( FLAGS ); +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE +Cyg_Flag *CYG_UITRON_DECL_PTRS( FLAGS ); +#endif +#endif +#endif // CYGPKG_UITRON_FLAGS + +// ------------------------------------------------------------------------ +// Semaphores have an optional initializer. +#ifdef CYGPKG_UITRON_SEMAS +#if (0 < CYGNUM_UITRON_SEMAS) || \ + defined( CYGDAT_UITRON_SEMA_INITIALIZERS ) + +#ifndef CYGNUM_UITRON_SEMAS +#error You must define CYGNUM_UITRON_SEMAS +#endif + +Cyg_Counting_Semaphore2 CYG_UITRON_DECL( SEMAS ) + +#ifdef CYGDAT_UITRON_SEMA_INITIALIZERS +// a Macro to ease the construction: +#define CYG_UIT_SEMA( _count_ ) Cyg_Counting_Semaphore2( (cyg_count32)(_count_) ) +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE +#define CYG_UIT_SEMA_NOEXS Cyg_Counting_Semaphore2( (cyg_count32) 0 ) +#endif + = { + CYGDAT_UITRON_SEMA_INITIALIZERS +} +#undef CYG_UIT_SEMA +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE +#undef CYG_UIT_SEMA_NOEXS +#endif +#endif // do we have initializers? +; // the end of the declaration, with or without initializer + +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE +Cyg_Counting_Semaphore2 *CYG_UITRON_DECL_PTRS( SEMAS ); +#endif +#endif +#endif // CYGPKG_UITRON_SEMAS + +// ------------------------------------------------------------------------ +// tasks MUST be initialized, you must have some. +#ifndef CYGDAT_UITRON_TASK_EXTERNS +#error You must define CYGDAT_UITRON_TASK_EXTERNS +#endif +#ifndef CYGDAT_UITRON_TASK_INITIALIZERS +#error You must define CYGDAT_UITRON_TASK_INITIALIZERS +#endif +#ifndef CYGNUM_UITRON_TASKS +#error You must define CYGNUM_UITRON_TASKS +#endif + +// declare the symbols used in the initializer +CYGDAT_UITRON_TASK_EXTERNS + +// a Macro to ease the construction: +// "name", priority, proc, stackbase, stacksize +#define CYG_UIT_TASK( _name_, _prio_, _func_, _sb_, _ss_ ) \ + Cyg_Thread( \ + (CYG_ADDRWORD)(_prio_), \ + (_func_), \ + (CYG_ADDRWORD)0, \ + _name_, \ + (CYG_ADDRESS)(_sb_), \ + (cyg_ucount32)(_ss_) ) + +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE +#define CYG_UIT_TASK_NOEXS( _name_, _sb_, _ss_ ) \ + Cyg_Thread( \ + (CYG_ADDRWORD)(CYG_SCHED_DEFAULT_INFO), \ + (cyg_thread_entry *)(0), \ + (CYG_ADDRWORD)0, \ + _name_, \ + (CYG_ADDRESS)(_sb_), \ + (cyg_ucount32)(_ss_) ) +#endif + +Cyg_Thread CYG_UITRON_DECL( TASKS ) = +{ + CYGDAT_UITRON_TASK_INITIALIZERS +}; + +#undef CYG_UIT_TASK +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE +#undef CYG_UIT_TASK_NOEXS +#endif + +#ifdef CYGIMP_THREAD_PRIORITY +// An ancillary array of priorities, for managing the "original" prio +cyg_priority +cyg_uitron_task_initial_priorities[ CYG_UITRON_NUM( TASKS ) ]; +#endif + +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE +Cyg_Thread *CYG_UITRON_DECL_PTRS( TASKS ); +#endif + +// ------------------------------------------------------------------------ +// fixed memory pools MUST be initialized, IF you have some. +#ifdef CYGPKG_UITRON_MEMPOOLFIXED +#if (0 < CYGNUM_UITRON_MEMPOOLFIXED) || \ + defined (CYGDAT_UITRON_MEMPOOLFIXED_INITIALIZERS) || \ + defined (CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS) + +#ifndef CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS +#error You must define CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS +#endif +#ifndef CYGDAT_UITRON_MEMPOOLFIXED_INITIALIZERS +#error You must define CYGDAT_UITRON_MEMPOOLFIXED_INITIALIZERS +#endif +#ifndef CYGNUM_UITRON_MEMPOOLFIXED +#error You must define CYGNUM_UITRON_MEMPOOLFIXED +#endif + +// declare the symbols used in the initializer +CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS + +// a Macro to ease the construction: addr, size, blocksize +#define CYG_UIT_MEMPOOLFIXED( _a_, _s_, _bs_ ) Cyg_Mempool_Fixed( \ + (cyg_uint8 *)(_a_), (cyg_int32)(_s_), (CYG_ADDRWORD)(_bs_) ) +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE +// note that this just picks a suitable size for the initialization, which +// should not be too inefficient +#define CYG_UIT_MEMPOOLFIXED_NOEXS( _a_, _s_ ) Cyg_Mempool_Fixed( \ + (cyg_uint8 *)(_a_), (cyg_int32)(_s_), (CYG_ADDRWORD) ((~7)&((_s_)/2)) ) +#endif + +Cyg_Mempool_Fixed CYG_UITRON_DECL( MEMPOOLFIXED ) = +{ + CYGDAT_UITRON_MEMPOOLFIXED_INITIALIZERS +}; +#undef CYG_UIT_MEMPOOLFIXED +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE +#undef CYG_UIT_MEMPOOLFIXED_NOEXS +#endif + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE +Cyg_Mempool_Fixed *CYG_UITRON_DECL_PTRS( MEMPOOLFIXED ); +#endif +#endif // do we have fixed memory pools at all? +#endif // CYGPKG_UITRON_MEMPOOLFIXED + +// ------------------------------------------------------------------------ +// variable memory pools MUST be initialized, IF you have some. +#ifdef CYGPKG_UITRON_MEMPOOLVAR +#if (0 < CYGNUM_UITRON_MEMPOOLVAR) || \ + defined (CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS) || \ + defined (CYGDAT_UITRON_MEMPOOLVAR_EXTERNS) + +#ifndef CYGDAT_UITRON_MEMPOOLVAR_EXTERNS +#error You must define CYGDAT_UITRON_MEMPOOLVAR_EXTERNS +#endif +#ifndef CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS +#error You must define CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS +#endif +#ifndef CYGNUM_UITRON_MEMPOOLVAR +#error You must define CYGNUM_UITRON_MEMPOOLVAR +#endif + +// declare the symbols used in the initializer +CYGDAT_UITRON_MEMPOOLVAR_EXTERNS + +// a Macro to ease the construction: addr, size +#define CYG_UIT_MEMPOOLVAR( _a_, _s_ ) Cyg_Mempool_Variable( \ + (cyg_uint8 *)(_a_),(cyg_int32)(_s_)) +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE +#define CYG_UIT_MEMPOOLVAR_NOEXS( _a_, _s_ ) Cyg_Mempool_Variable( \ + (cyg_uint8 *)(_a_),(cyg_int32)(_s_)) +#endif + +Cyg_Mempool_Variable CYG_UITRON_DECL( MEMPOOLVAR ) = +{ + CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS +}; +#undef CYG_UIT_MEMPOOLVAR +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE +#undef CYG_UIT_MEMPOOLVAR_NOEXS +#endif + +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE +Cyg_Mempool_Variable *CYG_UITRON_DECL_PTRS( MEMPOOLVAR ); +#endif +#endif // do we have variable memory pools at all? +#endif // CYGPKG_UITRON_MEMPOOLVAR + +// ------------------------------------------------------------------------ +// Cyclic alarm handlers might be initialized, if you have some. +// +#ifdef CYGPKG_UITRON_CYCLICS +#if (0 < CYGNUM_UITRON_CYCLICS) || \ + defined( CYGDAT_UITRON_CYCLIC_EXTERNS ) || \ + defined( CYGDAT_UITRON_CYCLIC_INITIALIZERS ) + +#ifndef CYGNUM_UITRON_CYCLICS +#error You must define CYGNUM_UITRON_CYCLICS +#endif + +#if defined( CYGDAT_UITRON_CYCLIC_INITIALIZERS ) || \ + defined( CYGDAT_UITRON_CYCLIC_EXTERNS ) + +#ifndef CYGDAT_UITRON_CYCLIC_INITIALIZERS +#error You must define CYGDAT_UITRON_CYCLIC_INITIALIZERS +#endif +#ifndef CYGDAT_UITRON_CYCLIC_EXTERNS +#error You must define CYGDAT_UITRON_CYCLIC_EXTERNS +#endif + +// declare the symbols used in the initializer +CYGDAT_UITRON_CYCLIC_EXTERNS + +#endif // have externs or initializers + +Cyg_Timer CYG_UITRON_DECL( CYCLICS ) + +#ifdef CYGDAT_UITRON_CYCLIC_INITIALIZERS + +#error *** CYCLIC INITIALIZERS ARE NOT SUPPORTED IN THIS RELEASE*** + +// a Macro to ease the construction: proc, arg, time +#define CYG_UIT_CYCLIC( ... ) Cyg_Timer() + = { + CYGDAT_UITRON_CYCLIC_INITIALIZERS +} +#undef CYG_UIT_CYCLIC +#endif // do we have initializers? +; // the end of the declaration, with or without initializer + +#endif // do we have cyclic alarms at all? +#endif // CYGPKG_UITRON_CYCLICS + +// ------------------------------------------------------------------------ +// Oneshot alarm handlers might be initialized, if you have some. +// +#ifdef CYGPKG_UITRON_ALARMS +#if (0 < CYGNUM_UITRON_ALARMS) || \ + defined( CYGDAT_UITRON_ALARM_EXTERNS ) || \ + defined( CYGDAT_UITRON_ALARM_INITIALIZERS ) + +#ifndef CYGNUM_UITRON_ALARMS +#error You must define CYGNUM_UITRON_ALARMS +#endif + +#if defined( CYGDAT_UITRON_ALARM_INITIALIZERS ) || \ + defined( CYGDAT_UITRON_ALARM_EXTERNS ) + +#ifndef CYGDAT_UITRON_ALARM_INITIALIZERS +#error You must define CYGDAT_UITRON_ALARM_INITIALIZERS +#endif +#ifndef CYGDAT_UITRON_ALARM_EXTERNS +#error You must define CYGDAT_UITRON_ALARM_EXTERNS +#endif + +// declare the symbols used in the initializer +CYGDAT_UITRON_ALARM_EXTERNS + +#endif // have externs or initializers + +Cyg_Timer CYG_UITRON_DECL( ALARMS ) + +#ifdef CYGDAT_UITRON_ALARM_INITIALIZERS + +#error *** ALARM INITIALIZERS ARE NOT SUPPORTED IN THIS RELEASE*** + +// a Macro to ease the construction: proc, arg, time +#define CYG_UIT_ALARM( ... ) Cyg_Timer() + = { + CYGDAT_UITRON_ALARM_INITIALIZERS +} +#undef CYG_UIT_ALARM +#endif // do we have initializers? +; // the end of the declaration, with or without initializer + +#endif // do we have oneshot alarms at all? +#endif // CYGPKG_UITRON_ALARMS + +// ------------------------------------------------------------------------ +#endif // CYGPKG_UITRON + +// EOF uit_objs.cxx diff --git a/packages/compat/uitron/current/tests/PKGconf.mak b/packages/compat/uitron/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/PKGconf.mak @@ -0,0 +1,44 @@ +#=============================================================================== +# +# makefile +# +# compat/uitron/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := uitron +include ../../../../pkgconf/pkgconf.mak + +TESTS := test1 test2 test3 test4 test5 \ + test6 test7 test8 test9 \ + testcxx testcx2 testcx3 testcx4 testcx5 \ + testcx6 testcx7 testcx8 testcx9 + + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + + + diff --git a/packages/compat/uitron/current/tests/test1.c b/packages/compat/uitron/current/tests/test1.c new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/test1.c @@ -0,0 +1,805 @@ +//=========================================================================== +// +// test1.c +// +// uITRON "C" test program one +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercom = 0; +volatile int intercount = 0; +INT scratch = 0; + +#ifndef CYGSEM_KERNEL_SCHED_TIMESLICE +#define TIMESLICEMSG "Assuming no kernel timeslicing" +#define TSGO() (1) +#define TSRELEASE() CYG_EMPTY_STATEMENT +#define TSSTOP() CYG_EMPTY_STATEMENT +#define TSLOCK() CYG_EMPTY_STATEMENT +#define TSUNLOCK() CYG_EMPTY_STATEMENT +#define ICWAIT( _i_ ) CYG_EMPTY_STATEMENT + +#else +// Now follow some nasty bodges to control the scheduling when basically it +// isn't controlled ie. timeslicing is on. It's bodgy because we're +// testing normal synchronization methods, so we shouldn't rely on them for +// comms between threads here. Instead there's a mixture of communicating +// via a flag (ts_interlock) which stops the "controlled" thread running +// away, and waiting for the controlled thread to run enough for us. +// +// Tasks 3 and 4 are waited for by the control task: task 3 locks the +// scheduler so is immediately descheduled when it unlocks it, task 4 does +// waiting-type operations, so we must give it chance to run by yielding a +// few times ourselves. Note the plain constant in ICWAIT() below. + +#define TIMESLICEMSG "Assuming kernel timeslicing ENABLED" +volatile int ts_interlock = 0; +#define TSGO() (ts_interlock) +#define TSRELEASE() ts_interlock = 1 +#define TSSTOP() ts_interlock = 0 + +#define TSLOCK() CYG_MACRO_START \ + ER ercd2 = dis_dsp(); \ + CYG_TEST_CHECK( E_OK == ercd2, "dis_dsp (TSLOCK) bad ercd2" ); \ +CYG_MACRO_END + +#define TSUNLOCK() CYG_MACRO_START \ + ER ercd3 = ena_dsp(); \ + CYG_TEST_CHECK( E_OK == ercd3, "ena_dsp (TSUNLOCK) bad ercd3" ); \ +CYG_MACRO_END + +#define ICWAIT( _i_ ) CYG_MACRO_START \ + int loops; \ + for ( loops = 3; (0 < loops) || ((_i_) > intercount); loops-- ) { \ + ER ercd4 = rot_rdq( 0 ); /* yield */ \ + CYG_TEST_CHECK( E_OK == ercd4, "rot_rdq (ICWAIT) bad ercd4" ); \ + } \ +CYG_MACRO_END +#endif // CYGSEM_KERNEL_SCHED_TIMESLICE + +/* +#define IC() \ +CYG_MACRO_START \ + static char *msgs[] = { "ZERO", "ONE", "TWO", "THREE", "FOUR", "LOTS" }; \ + CYG_TEST_INFO( msgs[ intercount > 5 ? 5 : intercount ] ); \ +CYG_MACRO_END +*/ + +// #define CYG_TEST_UITRON_TEST1_LOOPING 1 + +void task1( unsigned int arg ) +{ + ER ercd; + T_RTSK ref_tskd; + +#ifdef CYG_TEST_UITRON_TEST1_LOOPING + while ( 1 ) { +#endif // CYG_TEST_UITRON_TEST1_LOOPING + + CYG_TEST_INFO( "Task 1 running" ); + CYG_TEST_INFO( TIMESLICEMSG ); + + intercom = 0; + intercount = 0; + + CYG_TEST_INFO( "Testing get_tid and ref_tsk" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 1 == scratch, "tid not 1" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = get_tid( NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "get_tid bad ercd !E_PAR" ); +#endif + ercd = get_tid( NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "get_tid bad ercd !E_PAR" ); + ercd = ref_tsk( &ref_tskd, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_tsk bad ercd !E_ID" ); + ercd = ref_tsk( &ref_tskd, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_tsk bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_tsk( NULL, 1 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_tsk bad ercd !E_PAR" ); +#endif + ercd = ref_tsk( NADR, 1 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_tsk bad ercd !E_PAR" ); +#endif // we can test bad param error returns + ercd = ref_tsk( &ref_tskd, 1 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_RUN == ref_tskd.tskstat, "Bad task status 1" ); + ercd = ref_tsk( &ref_tskd, 0 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_RUN == ref_tskd.tskstat, "Bad task status 0" ); + ercd = ref_tsk( &ref_tskd, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_DMT == ref_tskd.tskstat, "Bad task status 2" ); + CYG_TEST_CHECK( 2 == ref_tskd.tskpri, "Bad task prio 2" ); + + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rsm_tsk DMT bad ercd !E_OBJ" ); + ercd = frsm_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "frsm_tsk DMT bad ercd !E_OBJ" ); + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai DMT bad ercd !E_OBJ" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "sus_tsk DMT bad ercd !E_OBJ" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "wup_tsk DMT bad ercd !E_OBJ" ); + ercd = can_wup( &scratch, 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "can_wup DMT bad ercd !E_OBJ" ); + + CYG_TEST_PASS( "get_tid, ref_tsk" ); + + CYG_TEST_INFO( "Testing prio change and start task" ); + ercd = sta_tsk( 2, 99 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + + // drop pri of task 2 + ercd = chg_pri( 2, 4 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ref_tsk( &ref_tskd, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_RDY == ref_tskd.tskstat, "Bad task status 2" ); + CYG_TEST_CHECK( 4 == ref_tskd.tskpri, "Bad task prio 2" ); + + // drop our pri below task 2 + ercd = chg_pri( 0, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + + ercd = ref_tsk( &ref_tskd, 1 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( 5 == ref_tskd.tskpri, "Bad task prio 1" ); + ercd = ref_tsk( &ref_tskd, 0 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( 5 == ref_tskd.tskpri, "Bad task prio 0" ); + ercd = ref_tsk( &ref_tskd, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + // it will have run to completion and regained its original prio + CYG_TEST_CHECK( 2 == ref_tskd.tskpri, "Bad task prio 2" ); + CYG_TEST_CHECK( TTS_DMT == ref_tskd.tskstat, "Bad task status 2" ); + + // retest these now that the task has executed once + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rsm_tsk DMT bad ercd !E_OBJ" ); + ercd = frsm_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "frsm_tsk DMT bad ercd !E_OBJ" ); + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai DMT bad ercd !E_OBJ" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "sus_tsk DMT bad ercd !E_OBJ" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "wup_tsk DMT bad ercd !E_OBJ" ); + ercd = can_wup( &scratch, 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "can_wup DMT bad ercd !E_OBJ" ); + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = chg_pri( -6, 9 ); + CYG_TEST_CHECK( E_ID == ercd, "chg_pri bad ercd !E_ID" ); + ercd = chg_pri( 99, 9 ); + CYG_TEST_CHECK( E_ID == ercd, "chg_pri bad ercd !E_ID" ); + ercd = sta_tsk( -6, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "sta_tsk bad ercd !E_ID" ); + ercd = sta_tsk( 99, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "sta_tsk bad ercd !E_ID" ); +#endif // we can test bad param error returns + + CYG_TEST_PASS( "sta_tsk, chg_pri" ); + + CYG_TEST_INFO( "Testing delay and dispatch disabling" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "dly_tsk bad ercd !E_CTX" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "dly_tsk bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + CYG_TEST_PASS( "dly_tsk, ena_dsp, dis_dsp" ); + + CYG_TEST_INFO( "Testing ready queue manipulation" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ercd = rot_rdq( 4 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ercd = rot_rdq( 5 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rot_rdq( -6 ); + CYG_TEST_CHECK( E_PAR == ercd, "rot_rdq bad ercd !E_PAR" ); + ercd = rot_rdq( 99 ); + CYG_TEST_CHECK( E_PAR == ercd, "rot_rdq bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + CYG_TEST_PASS( "rot_rdq" ); + + CYG_TEST_INFO( "Testing suspend/resume" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = sus_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "sus_tsk bad ercd !E_ID" ); + ercd = sus_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "sus_tsk bad ercd !E_ID" ); + ercd = rsm_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "rsm_tsk bad ercd !E_ID" ); + ercd = rsm_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "rsm_tsk bad ercd !E_ID" ); + ercd = frsm_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "frsm_tsk bad ercd !E_ID" ); + ercd = frsm_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "frsm_tsk bad ercd !E_ID" ); +#endif // we can test bad param error returns + // drop task 3 pri to same as us + CYG_TEST_CHECK( 0 == intercount, "intercount != 0" ); + + intercom = 3; // tell T3 to loop + TSRELEASE(); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 3, 66 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 3, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 1 ); + CYG_TEST_CHECK( 1 == intercount, "intercount != 1" ); + ercd = sus_tsk( 3 ); + TSRELEASE(); + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + intercom = 0; // bad data to T3 + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 1 == intercount, "intercount != 1" ); + intercom = 3; // tell T3 to loop + TSRELEASE(); + ercd = rsm_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 2 ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + + CYG_TEST_INFO( "Command task 3 inner loop stop" ); + intercom = 2 + 4; + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + + ercd = sus_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + intercom = 0; // bad data to T3 + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ercd = sus_tsk( 3 ); // suspend AGAIN + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + ercd = sus_tsk( 3 ); // AND AGAIN + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + ercd = rsm_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + ercd = rsm_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + intercom = 3; // tell T3 to loop + TSRELEASE(); + ercd = rsm_tsk( 3 ); // expect restart this time + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 3 ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + + CYG_TEST_INFO( "Command task 3 inner loop stop 2" ); + intercom = 2 + 4; + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + + ercd = sus_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + intercom = 0; // bad data to T3 + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + ercd = sus_tsk( 3 ); // suspend AGAIN + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + ercd = sus_tsk( 3 ); // AND AGAIN + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + intercom = 3; // tell T3 to loop + TSRELEASE(); + ercd = frsm_tsk( 3 ); // expect restart this time + CYG_TEST_CHECK( E_OK == ercd, "frsm_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 4 ); + CYG_TEST_CHECK( 4 == intercount, "intercount != 4" ); + + TSRELEASE(); + ercd = rsm_tsk( 3 ); // try it again + CYG_TEST_CHECK( E_OBJ == ercd, "rsm_tsk bad ercd !E_OBJ" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 5 ); + CYG_TEST_CHECK( 5 == intercount, "intercount != 5" ); + + TSRELEASE(); + ercd = frsm_tsk( 3 ); // try it again + CYG_TEST_CHECK( E_OBJ == ercd, "frsm_tsk bad ercd !E_OBJ" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 6 ); + CYG_TEST_CHECK( 6 == intercount, "intercount != 6" ); + + CYG_TEST_INFO( "Command task 3 all loops stop" ); + intercom = 4 + 8; + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 6 == intercount, "intercount != 6" ); + + intercom = intercount = 0; + + CYG_TEST_PASS( "sus_tsk, rsm_tsk, frsm_tsk" ); + + CYG_TEST_INFO( "Testing sleep/wakeup stuff" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = wup_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "wup_tsk bad ercd !E_ID" ); + ercd = wup_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "wup_tsk bad ercd !E_ID" ); + ercd = can_wup( &scratch, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "can_wup bad ercd !E_ID" ); + ercd = can_wup( &scratch, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "can_wup bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = can_wup( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "can_wup bad ercd !E_PAR" ); +#endif + ercd = can_wup( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "can_wup bad ercd !E_PAR" ); + + ercd = wup_tsk( 0 ); // not ourself + CYG_TEST_CHECK( E_ID == ercd, "wup_tsk bad ercd !E_ID" ); + ercd = wup_tsk( 1 ); // ourself + CYG_TEST_CHECK( E_OBJ == ercd, "wup_tsk bad ercd !E_OBJ" ); +#endif // we can test bad param error returns + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = tslp_tsk( -6 ); + CYG_TEST_CHECK( E_PAR == ercd, "tslp_tsk bad ercd !E_PAR" ); +#endif // we can test bad param error returns + ercd = tslp_tsk( TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); + ercd = tslp_tsk( 5 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = tslp_tsk( TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "tslp_tsk bad ercd !E_CTX" ); + ercd = tslp_tsk( TMO_POL ); + CYG_TEST_CHECK( E_CTX == ercd, "tslp_tsk bad ercd !E_CTX" ); + ercd = tslp_tsk( 5 ); + CYG_TEST_CHECK( E_CTX == ercd, "tslp_tsk bad ercd !E_CTX" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = tslp_tsk( -6 ); + CYG_TEST_CHECK( E_PAR == ercd, "tslp_tsk bad ercd !E_PAR" ); +#endif // we can test bad param error returns + ercd = tslp_tsk( TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); + ercd = tslp_tsk( 5 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); + + // drop task 4 pri to same as us + intercount = 0; + intercom = 1; // test plain slp_tsk + TSRELEASE(); + ercd = chg_pri( 4, 5 ); + CYG_TEST_CHECK( E_OBJ == ercd, "chg_pri bad ercd" ); + + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 4, 77 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 4, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + + ercd = wup_tsk( 4 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 1 ); + CYG_TEST_CHECK( 1 == intercount, "intercount != 1" ); + intercom = 2; // test tslp_tsk + TSRELEASE(); + ercd = wup_tsk( 4 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 2 ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + intercom = 3; // test tslp_tsk + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + intercom = 1; // test slp_tsk next... + ercd = dly_tsk( 20 ); // without a wup + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ICWAIT( 3 ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + + intercom = 1; // ...test slp_tsk + TSRELEASE(); + ercd = dly_tsk( 20 ); // without a wup (yet) + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + TSRELEASE(); + ercd = tslp_tsk( 20 ); // yield again + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); // and again + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rot_rdq( 0 ); // and yield + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 4 ); + CYG_TEST_CHECK( 4 == intercount, "intercount != 4" ); + + intercom = 1; // test slp_tsk + TSRELEASE(); + ercd = dly_tsk( 20 ); // without a wup (yet) + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 4 == intercount, "intercount != 4" ); + + // this wup will restart it when we yield: + TSLOCK(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + // these will count up: + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + scratch = -1; + ercd = can_wup( &scratch, 4 ); + CYG_TEST_CHECK( E_OK == ercd, "can_wup bad ercd" ); + CYG_TEST_CHECK( 2 == scratch, "Cancelled wups not 2" ); + CYG_TEST_CHECK( 4 == intercount, "intercount != 4" ); + TSUNLOCK(); + + intercom = 4; // do nothing + TSRELEASE(); + ercd = rot_rdq( 0 ); // and yield + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 5 ); + CYG_TEST_CHECK( 5 == intercount, "intercount != 5" ); + TSRELEASE(); + ercd = dly_tsk( 20 ); // let it do nothing + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + TSRELEASE(); + ercd = dly_tsk( 20 ); // lots of wups but no sleep + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 5 == intercount, "intercount != 5" ); + scratch = -1; + ercd = can_wup( &scratch, 4 ); + CYG_TEST_CHECK( E_OK == ercd, "can_wup bad ercd" ); + CYG_TEST_CHECK( 3 == scratch, "Cancelled wups not 3" ); + // now check that they are cancelled by doing a wait again + intercom = 1; // test slp_tsk + TSRELEASE(); + ercd = rot_rdq( 0 ); // still without a wup + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); // still without a wup + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + intercom = 4; // do nothing next + TSRELEASE(); + ICWAIT( 6 ); + CYG_TEST_CHECK( 6 == intercount, "intercount != 6" ); + ercd = rot_rdq( 0 ); // still without a wup + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 6 == intercount, "intercount != 6" ); + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rot_rdq( 0 ); // it will run now + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); // it will run now + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 7 ); + CYG_TEST_CHECK( 7 == intercount, "intercount != 7" ); + + TSRELEASE(); + intercom = 99; // exit, all done + ercd = rot_rdq( 0 ); // let it run + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 8 ); + CYG_TEST_CHECK( 8 == intercount, "intercount != 8" ); + + TSRELEASE(); + ercd = rot_rdq( 0 ); // let it run + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 8 == intercount, "intercount != 8" ); + + CYG_TEST_PASS( "wup_tsk, can_wup, slp_tsk, tslp_tsk" ); + +#ifdef CYG_TEST_UITRON_TEST1_LOOPING + chg_pri( 1, 1 ); + rot_rdq( 0 ); + ter_tsk( 2 ); + rot_rdq( 0 ); + ter_tsk( 3 ); + rot_rdq( 0 ); + ter_tsk( 4 ); + rot_rdq( 0 ); + } +#endif // CYG_TEST_UITRON_TEST1_LOOPING + + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + CYG_TEST_PASS( "Task 2 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == scratch, "tid not 2" ); + if ( 99 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 99" ); + ext_tsk(); + CYG_TEST_FAIL( "Task 2 failed to exit" ); +} + +void task3( unsigned int arg ) +{ + ER ercd; + TSLOCK(); + CYG_TEST_PASS("Task3 running"); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 3 == scratch, "tid not 3" ); + if ( 66 != arg ) + CYG_TEST_FAIL( "Task 3 arg not 66" ); + + while ( 2 & intercom ) { + while ( 1 & intercom ) { + intercount++; + TSSTOP(); + do { + TSUNLOCK(); + ercd = rot_rdq( 0 ); // yield() + TSLOCK(); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq 1 (task3) bad ercd" ); + } while ( !TSGO() ); + } + CYG_TEST_CHECK( 4 & intercom, "should not have got here yet 1" ); + TSSTOP(); + do { + TSUNLOCK(); + ercd = rot_rdq( 0 ); // yield() + TSLOCK(); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq 2 (task3) bad ercd" ); + } while ( !TSGO() ); + } + CYG_TEST_CHECK( 8 & intercom, "should not have got here yet 2" ); + + TSUNLOCK(); + ext_tsk(); + CYG_TEST_FAIL( "Task 3 failed to exit" ); +} + +void task4( unsigned int arg ) +{ + ER ercd; + CYG_TEST_PASS("Task4 running"); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 4 == scratch, "tid not 4" ); + if ( 77 != arg ) + CYG_TEST_FAIL( "Task 4 arg not 77" ); + while ( 1 ) { + switch ( intercom ) { + case 1: + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk (task4) bad ercd" ); + break; + case 2: + ercd = tslp_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk (task4) bad ercd" ); + break; + case 3: + ercd = tslp_tsk( 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, + "slp_tsk (task4) bad ercd !E_TMOUT" ); + break; + case 4: + // busily do nothing + while ( 4 == intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, + "rot_rdq (task4 idle) bad ercd" ); + } + break; + case 99: + goto out; + default: + CYG_TEST_FAIL( "Task 4 bad intercom" ); + goto out; + } + intercount++; + TSSTOP(); + do { + ercd = rot_rdq( 0 ); // yield() + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq (task4) bad ercd" ); + } while ( !TSGO() ); + } +out: + ext_tsk(); + CYG_TEST_FAIL( "Task 4 failed to exit" ); +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF test1.c diff --git a/packages/compat/uitron/current/tests/test2.c b/packages/compat/uitron/current/tests/test2.c new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/test2.c @@ -0,0 +1,956 @@ +//=========================================================================== +// +// test2.c +// +// uITRON "C" test program two +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough flag objects */ \ + defined( CYGPKG_UITRON_FLAGS ) && \ + (CYGNUM_UITRON_FLAGS >= 3) && \ + (CYGNUM_UITRON_FLAGS < 90) && \ + ( !defined(CYGPKG_UITRON_FLAGS_CREATE_DELETE) || \ + CYGNUM_UITRON_FLAGS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough message boxes */ \ + defined( CYGPKG_UITRON_MBOXES ) && \ + (CYGNUM_UITRON_MBOXES >= 3) && \ + (CYGNUM_UITRON_MBOXES < 90) && \ + ( !defined(CYGPKG_UITRON_MBOXES_CREATE_DELETE) || \ + CYGNUM_UITRON_MBOXES_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough fixed memory pools */ \ + defined( CYGPKG_UITRON_MEMPOOLFIXED ) && \ + (CYGNUM_UITRON_MEMPOOLFIXED >= 3) && \ + (CYGNUM_UITRON_MEMPOOLFIXED < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough variable mempools */ \ + defined( CYGPKG_UITRON_MEMPOOLVAR ) && \ + (CYGNUM_UITRON_MEMPOOLVAR >= 3) && \ + (CYGNUM_UITRON_MEMPOOLVAR < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLVAR_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +int intercom = 0; +int intercount = 0; +INT scratch = 0; + +void task1( unsigned int arg ) +{ + ER ercd; + + T_RSEM sem_info; + T_RFLG flg_info; + T_RMBX mbx_info; + T_RMPF mpf_info; + T_RMPL mpl_info; + UINT flagptn; + static char foo[] = "Test message"; + T_MSG *msgptr = foo; + T_MSG *rxptr = NULL; + VP blfptr = (VP)foo; + VP blkptr = (VP)foo; + + CYG_TEST_INFO( "Task 1 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 1 == scratch, "tid not 1" ); + + // start a lower prio task to interact with + intercom = 1; + ercd = sta_tsk( 2, 222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + // Semaphores; all the illegal argument combinations first + CYG_TEST_INFO( "Testing semaphore ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = sig_sem( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "sig_sem bad ercd !E_ID" ); + ercd = sig_sem( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "sig_sem bad ercd !E_ID" ); + ercd = wai_sem( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "wai_sem bad ercd !E_ID" ); + ercd = wai_sem( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "wai_sem bad ercd !E_ID" ); + ercd = preq_sem( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "preq_sem bad ercd !E_ID" ); + ercd = preq_sem( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "preq_sem bad ercd !E_ID" ); + ercd = twai_sem( -6, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "twai_sem bad ercd !E_ID" ); + ercd = twai_sem( 99, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "twai_sem bad ercd !E_ID" ); + ercd = twai_sem( 2, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_sem bad ercd !E_PAR" ); + ercd = ref_sem( &sem_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_sem bad ercd !E_ID" ); + ercd = ref_sem( &sem_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_sem bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_sem( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_sem bad ercd !E_PAR" ); +#endif + ercd = ref_sem( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_sem bad ercd !E_PAR" ); + CYG_TEST_PASS( "bad calls: sig_sem, [t]wai_sem, preq_sem, ref_sem" ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = preq_sem( 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "preq_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = wai_sem( 2 ); + CYG_TEST_CHECK( E_CTX == ercd, "wai_sem bad ercd !E_CTX" ); + ercd = twai_sem( 2, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "twai_sem bad ercd !E_CTX" ); + ercd = twai_sem( 2, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "twai_sem(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = twai_sem( 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem(POL) bad ercd !E_TMOUT" ); + ercd = preq_sem( 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "preq_sem bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = preq_sem( 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "preq_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: wai_sem, twai_sem with dis_dsp" ); + + // check ref_sem with various states + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 1 == sem_info.semcnt, "semcnt should be 1" ); + ercd = preq_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 2 == sem_info.semcnt, "semcnt should be 2" ); + ercd = wai_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 1 == sem_info.semcnt, "semcnt should be 1" ); + ercd = twai_sem( 2, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + intercom = 0; + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 != sem_info.wtsk, "sem.wtsk should be non0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be non0" ); +#if 1 + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); +#else // old, non-uITRON semantics + CYG_TEST_CHECK( 1 == sem_info.semcnt, "semcnt should be 1" ); +#endif + ercd = dly_tsk( 10 ); // let task 2 pick up the signal + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + CYG_TEST_PASS( "good calls: sig_sem, [t]wai,preq_sem with ref_sem" ); + + // Flags; all the illegal argument combinations first + CYG_TEST_INFO( "Testing flag ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = set_flg( -6, 1 ); + CYG_TEST_CHECK( E_ID == ercd, "set_flg bad ercd !E_ID" ); + ercd = set_flg( 99, 1 ); + CYG_TEST_CHECK( E_ID == ercd, "set_flg bad ercd !E_ID" ); + ercd = clr_flg( -6, 1 ); + CYG_TEST_CHECK( E_ID == ercd, "clr_flg bad ercd !E_ID" ); + ercd = clr_flg( 99, 1 ); + CYG_TEST_CHECK( E_ID == ercd, "sig_flg bad ercd !E_ID" ); + ercd = wai_flg( &flagptn, -6, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_ID == ercd, "wai_flg bad ercd !E_ID" ); + ercd = wai_flg( &flagptn, 99, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_ID == ercd, "wai_flg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = wai_flg( NULL, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "wai_flg bad ercd !E_PAR" ); +#endif + ercd = wai_flg( NADR, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "wai_flg bad ercd !E_PAR" ); + ercd = wai_flg( &flagptn, 2, 7, 34657 ); + CYG_TEST_CHECK( E_PAR == ercd, "wai_flg bad ercd !E_PAR" ); + ercd = wai_flg( &flagptn, 2, 0, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "wai_flg bad ercd !E_PAR" ); + ercd = pol_flg( &flagptn, -6, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_ID == ercd, "pol_flg bad ercd !E_ID" ); + ercd = pol_flg( &flagptn, 99, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_ID == ercd, "pol_flg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = pol_flg( NULL, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "pol_flg bad ercd !E_PAR" ); +#endif + ercd = pol_flg( NADR, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "pol_flg bad ercd !E_PAR" ); + ercd = pol_flg( &flagptn, 2, 7, 34657 ); + CYG_TEST_CHECK( E_PAR == ercd, "pol_flg bad ercd !E_PAR" ); + ercd = pol_flg( &flagptn, 2, 0, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "pol_flg bad ercd !E_PAR" ); + ercd = twai_flg( &flagptn, -6, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "twai_flg bad ercd !E_ID" ); + ercd = twai_flg( &flagptn, 99, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "twai_flg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = twai_flg( NULL, 2, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_flg bad ercd !E_PAR" ); +#endif + ercd = twai_flg( NADR, 2, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_flg bad ercd !E_PAR" ); + ercd = twai_flg( &flagptn, 2, 7, 34657, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_flg bad ercd !E_PAR" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_flg bad ercd !E_PAR" ); + ercd = twai_flg( &flagptn, 2, 0, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_flg bad ercd !E_PAR" ); + ercd = ref_flg( &flg_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_flg bad ercd !E_ID" ); + ercd = ref_flg( &flg_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_flg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_flg( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_flg bad ercd !E_PAR" ); +#endif + ercd = ref_flg( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_flg bad ercd !E_PAR" ); + CYG_TEST_PASS( "bad calls: set_flg, clr_flg, [t]wai,pol_flg, ref_flg" ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = pol_flg( &flagptn, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = wai_flg( &flagptn, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_CTX == ercd, "wai_flg bad ercd !E_CTX" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "twai_flg bad ercd !E_CTX" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "twai_flg(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg(POL) bad ercd !E_TMOUT" ); + ercd = pol_flg( &flagptn, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pol_flg( &flagptn, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: wai_flg, twai_flg with dis_dsp" ); + + // check ref_flg with various states + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 == flg_info.wtsk, "flg.wtsk should be non0" ); + CYG_TEST_CHECK( 0 == flg_info.flgptn, "flgptn should be 0" ); + intercom = 0; + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 != flg_info.wtsk, "flg.wtsk should be non0" ); + CYG_TEST_CHECK( 0 == flg_info.flgptn, "flgptn should be 0" ); + ercd = set_flg( 2, 0x5555 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_flg bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 != flg_info.wtsk, "flg.wtsk should be non0" ); + CYG_TEST_CHECK( 0x5555 == flg_info.flgptn, "flgptn should be 0x5555" ); + ercd = clr_flg( 2, 0xF0F0 ); + CYG_TEST_CHECK( E_OK == ercd, "clr_flg bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 != flg_info.wtsk, "flg.wtsk should be non0" ); + CYG_TEST_CHECK( 0x5050 == flg_info.flgptn, "flgptn should be 0x5050" ); + ercd = set_flg( 2, 0xFFFF ); + CYG_TEST_CHECK( E_OK == ercd, "sig_flg bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 == flg_info.wtsk, "flg.wtsk should be 0" ); + CYG_TEST_CHECK( 0xFFFF == flg_info.flgptn, "flgptn should be 0xFFFF" ); + CYG_TEST_PASS( "good calls: clr_flg, set_flg, wai_flg with ref_flg" ); + + // Mailboxes; all the illegal argument combinations first + CYG_TEST_INFO( "Testing mailbox ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = snd_msg( -6, msgptr ); + CYG_TEST_CHECK( E_ID == ercd, "snd_msg bad ercd !E_ID" ); + ercd = snd_msg( 99, msgptr ); + CYG_TEST_CHECK( E_ID == ercd, "snd_msg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = snd_msg( 2, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "snd_msg bad ercd !E_PAR" ); +#endif + ercd = snd_msg( 2, NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "snd_msg bad ercd !E_PAR" ); + ercd = rcv_msg( &rxptr, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "rcv_msg bad ercd !E_ID" ); + ercd = rcv_msg( &rxptr, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "rcv_msg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = rcv_msg( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "rcv_msg bad ercd !E_PAR" ); +#endif + ercd = rcv_msg( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "rcv_msg bad ercd !E_PAR" ); + ercd = prcv_msg( &rxptr, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "prcv_msg bad ercd !E_ID" ); + ercd = prcv_msg( &rxptr, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "prcv_msg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = prcv_msg( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "prcv_msg bad ercd !E_PAR" ); +#endif + ercd = prcv_msg( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "prcv_msg bad ercd !E_PAR" ); + ercd = trcv_msg( &rxptr, -6, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "trcv_msg bad ercd !E_ID" ); + ercd = trcv_msg( &rxptr, 99, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "trcv_msg bad ercd !E_ID" ); + ercd = trcv_msg( &rxptr, 2, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "trcv_msg bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = trcv_msg( NULL, 2, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "trcv_msg bad ercd !E_PAR" ); +#endif + ercd = trcv_msg( NADR, 2, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "trcv_msg bad ercd !E_PAR" ); + ercd = ref_mbx( &mbx_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mbx bad ercd !E_ID" ); + ercd = ref_mbx( &mbx_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mbx bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_mbx( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_mbx bad ercd !E_PAR" ); +#endif + ercd = ref_mbx( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_mbx bad ercd !E_PAR" ); + CYG_TEST_PASS( "bad calls: snd_msg, [pt]rcv_msg, ref_mbx" ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = prcv_msg( &rxptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "prcv_msg bad ercd !E_TMOUT" ); + ercd = trcv_msg( &rxptr, 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg bad ercd !E_TMOUT" ); + ercd = trcv_msg( &rxptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rcv_msg( &rxptr, 2 ); + CYG_TEST_CHECK( E_CTX == ercd, "rcv_msg bad ercd !E_CTX" ); + ercd = trcv_msg( &rxptr, 2, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "trcv_msg bad ercd !E_CTX" ); + ercd = trcv_msg( &rxptr, 2, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "trcv_msg(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = trcv_msg( &rxptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg(POL) bad ercd !E_TMOUT" ); + ercd = prcv_msg( &rxptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "prcv_msg bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = prcv_msg( &rxptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "prcv_msg bad ercd !E_TMOUT" ); + ercd = trcv_msg( &rxptr, 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg bad ercd !E_TMOUT" ); + ercd = trcv_msg( &rxptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: rcv_msg, trcv_msg with dis_dsp" ); + + // check ref_mbx with various states + ercd = ref_mbx( &mbx_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + CYG_TEST_CHECK( 0 == mbx_info.wtsk, "mbx.wtsk should be 0" ); + CYG_TEST_CHECK( NADR == mbx_info.pk_msg, "mbx peek should be NADR" ); + intercom = 0; + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_mbx( &mbx_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + CYG_TEST_CHECK( 0 != mbx_info.wtsk, "mbx.wtsk should be non0" ); + CYG_TEST_CHECK( NADR == mbx_info.pk_msg, "mbx peek should be NADR" ); + ercd = snd_msg( 2, msgptr ); + CYG_TEST_CHECK( E_OK == ercd, "snd_msg bad ercd" ); + ercd = ref_mbx( &mbx_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + CYG_TEST_CHECK( 0 == mbx_info.wtsk, "mbx.wtsk should be 0" ); +#if 1 + CYG_TEST_CHECK( NADR == mbx_info.pk_msg, "mbx peek should be NADR" ); +#else // old, non-uITRON semantics + CYG_TEST_CHECK( msgptr == mbx_info.pk_msg, "mbx peek should be msgptr" ); +#endif + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_mbx( &mbx_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + CYG_TEST_CHECK( 0 == mbx_info.wtsk, "mbx.wtsk should be 0" ); + CYG_TEST_CHECK( NADR == mbx_info.pk_msg, "mbx peek should be NADR" ); + // fill the message box, expect E_QOVR + for ( scratch = 0 ; scratch < 100 ; scratch++ ) { + if ( E_OK != ( ercd = snd_msg( 2, msgptr ) ) ) + break; + } + CYG_TEST_CHECK( (100 == scratch) || (E_QOVR == ercd), + "snd_msg bad ercd !E_QOVR/E_OK" ); + // empty the message box, expect the right number and E_TMOUT + for ( ; 1 ; scratch-- ) { + if ( E_OK != ( ercd = prcv_msg( &rxptr, 2 ) ) ) + break; + } + CYG_TEST_CHECK( 0 == scratch, "rcv_msg count bad scratch!=0" ); + CYG_TEST_CHECK( E_TMOUT == ercd, "rcv_msg bad ercd !E_TMOUT" ); + + CYG_TEST_PASS( "good calls: rcv_msg, snd_msg with ref_msg" ); + + // Fixed block memory pools: all the illegal argument combinations first + CYG_TEST_INFO( "Testing fixed block memory ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rel_blf( -6, blfptr ); + CYG_TEST_CHECK( E_ID == ercd, "rel_blf bad ercd !E_ID" ); + ercd = rel_blf( 99, blfptr ); + CYG_TEST_CHECK( E_ID == ercd, "rel_blf bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = rel_blf( 2, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "rel_blf bad ercd !E_PAR" ); +#endif + ercd = rel_blf( 2, NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "rel_blf bad ercd !E_PAR" ); +#endif // we can test bad param error returns + ercd = rel_blf( 2, blfptr ); // it did not come from a mpf + CYG_TEST_CHECK( E_PAR == ercd, "rel_blf bad ercd !E_PAR" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blf( &blfptr, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "get_blf bad ercd !E_ID" ); + ercd = get_blf( &blfptr, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "get_blf bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = get_blf( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "get_blf bad ercd !E_PAR" ); +#endif + ercd = get_blf( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "get_blf bad ercd !E_PAR" ); + ercd = pget_blf( &blfptr, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "pget_blf bad ercd !E_ID" ); + ercd = pget_blf( &blfptr, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "pget_blf bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = pget_blf( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "pget_blf bad ercd !E_PAR" ); +#endif + ercd = pget_blf( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "pget_blf bad ercd !E_PAR" ); + ercd = tget_blf( &blfptr, -6, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "tget_blf bad ercd !E_ID" ); + ercd = tget_blf( &blfptr, 99, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "tget_blf bad ercd !E_ID" ); + ercd = tget_blf( &blfptr, 2, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blf bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = tget_blf( NULL, 2, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blf bad ercd !E_PAR" ); +#endif + ercd = tget_blf( NADR, 2, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blf bad ercd !E_PAR" ); + ercd = ref_mpf( &mpf_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mpf bad ercd !E_ID" ); + ercd = ref_mpf( &mpf_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mpf bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_mpf( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_mpf bad ercd !E_PAR" ); +#endif + ercd = ref_mpf( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_mpf bad ercd !E_PAR" ); + CYG_TEST_PASS( "bad calls: rel_blf, [pt]get_blf, ref_mpf " ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = pget_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blf bad ercd" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blf bad ercd" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_CTX == ercd, "get_blf bad ercd !E_CTX" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blf bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pget_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blf bad ercd" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blf bad ercd" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + // consume the whole thing then do it again, expecting E_TMOUT + while ( E_OK == (ercd = pget_blf( &blfptr, 2 ) ) ) + continue; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + ercd = pget_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf bad ercd !E_TMOUT" ); + ercd = tget_blf( &blfptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_CTX == ercd, "get_blf bad ercd !E_CTX" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blf bad ercd !E_CTX" ); + ercd = tget_blf( &blfptr, 2, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blf(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = tget_blf( &blfptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf(POL) bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pget_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + ercd = tget_blf( &blfptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: rel_blf, [pt]get_blf with ena_dsp" ); + + // check ref_mpf with various states + ercd = ref_mpf( &mpf_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + CYG_TEST_CHECK( 0 == mpf_info.wtsk, "mpf.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == mpf_info.frbcnt, "mpf.frbcnt should be 0" ); + intercom = 0; + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_mpf( &mpf_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + CYG_TEST_CHECK( 0 != mpf_info.wtsk, "mpf.wtsk should be non0" ); + CYG_TEST_CHECK( 0 == mpf_info.frbcnt, "mpf.frbcnt should be 0" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + ercd = ref_mpf( &mpf_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + CYG_TEST_CHECK( 0 == mpf_info.wtsk, "mpf.wtsk should be 0" ); +#if 1 + CYG_TEST_CHECK( 0 == mpf_info.frbcnt, "mpf.frbcnt should be 0" ); +#else // old, non-uITRON semantics + CYG_TEST_CHECK( 0 != mpf_info.frbcnt, "mpf.frbcnt should be non0" ); +#endif + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_mpf( &mpf_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + CYG_TEST_CHECK( 0 == mpf_info.wtsk, "mpf.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == mpf_info.frbcnt, "mpf.frbcnt should be 0" ); + CYG_TEST_PASS( "good calls: rel_blf, get_blf with ref_mpf" ); + + // Variable block memory pools; illegal arguments + CYG_TEST_INFO( "Testing variable block memory ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rel_blk( -6, blkptr ); + CYG_TEST_CHECK( E_ID == ercd, "rel_blk bad ercd !E_ID" ); + ercd = rel_blk( 99, blkptr ); + CYG_TEST_CHECK( E_ID == ercd, "rel_blk bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = rel_blk( 2, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "rel_blk bad ercd !E_PAR" ); +#endif + ercd = rel_blk( 2, NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "rel_blk bad ercd !E_PAR" ); +#endif // we can test bad param error returns + ercd = rel_blk( 2, blkptr ); // it did not come from a mpl + CYG_TEST_CHECK( E_PAR == ercd, "rel_blk bad ercd !E_PAR" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blk( &blkptr, -6, 100 ); + CYG_TEST_CHECK( E_ID == ercd, "get_blk bad ercd !E_ID" ); + ercd = get_blk( &blkptr, 99, 100 ); + CYG_TEST_CHECK( E_ID == ercd, "get_blk bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = get_blk( NULL, 2, 100 ); + CYG_TEST_CHECK( E_PAR == ercd, "get_blk bad ercd !E_PAR" ); +#endif + ercd = get_blk( NADR, 2, 100 ); + CYG_TEST_CHECK( E_PAR == ercd, "get_blk bad ercd !E_PAR" ); + ercd = pget_blk( &blkptr, -6, 100 ); + CYG_TEST_CHECK( E_ID == ercd, "pget_blk bad ercd !E_ID" ); + ercd = pget_blk( &blkptr, 99, 100 ); + CYG_TEST_CHECK( E_ID == ercd, "pget_blk bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = pget_blk( NULL, 2, 100 ); + CYG_TEST_CHECK( E_PAR == ercd, "pget_blk bad ercd !E_PAR" ); +#endif + ercd = pget_blk( NADR, 2, 100 ); + CYG_TEST_CHECK( E_PAR == ercd, "pget_blk bad ercd !E_PAR" ); + ercd = tget_blk( &blkptr, -6, 100, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "tget_blk bad ercd !E_ID" ); + ercd = tget_blk( &blkptr, 99, 100, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "tget_blk bad ercd !E_ID" ); + ercd = tget_blk( &blkptr, 2, 100, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blk bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = tget_blk( NULL, 2, 100, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blk bad ercd !E_PAR" ); +#endif + ercd = tget_blk( NADR, 2, 100, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blk bad ercd !E_PAR" ); + ercd = ref_mpl( &mpl_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mpl bad ercd !E_ID" ); + ercd = ref_mpl( &mpl_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mpl bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_mpl( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_mpl bad ercd !E_PAR" ); +#endif + ercd = ref_mpl( NADR, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_mpl bad ercd !E_PAR" ); + CYG_TEST_PASS( "bad calls: rel_blk, [pt]get_blk, ref_mpl " ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = pget_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blk bad ercd" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blk bad ercd" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_CTX == ercd, "get_blk bad ercd !E_CTX" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blk bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pget_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blk bad ercd" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blk bad ercd" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + // consume the whole thing then do it again, expecting E_TMOUT + while ( E_OK == (ercd = pget_blk( &blkptr, 2, 100 ) ) ) + continue; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = pget_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &blkptr, 2, 100, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_CTX == ercd, "get_blk bad ercd !E_CTX" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blk bad ercd !E_CTX" ); + ercd = tget_blk( &blkptr, 2, 100, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blk(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = tget_blk( &blkptr, 2, 100, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk(POL) bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pget_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &blkptr, 2, 100, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: rel_blk, [pt]get_blk with ena_dsp" ); + + // check ref_mpl with various states + ercd = ref_mpl( &mpl_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + CYG_TEST_CHECK( 0 == mpl_info.wtsk, "mpl.wtsk should be 0" ); + CYG_TEST_CHECK( mpl_info.maxsz <= mpl_info.frsz, + "mpl.maxsz not < mpl.frsz" ); + intercom = 0; + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_mpl( &mpl_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + CYG_TEST_CHECK( 0 != mpl_info.wtsk, "mpl.wtsk should be non0" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + ercd = ref_mpl( &mpl_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + CYG_TEST_CHECK( 0 == mpl_info.wtsk, "mpl.wtsk should be 0" ); + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_mpl( &mpl_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + CYG_TEST_CHECK( 0 == mpl_info.wtsk, "mpl.wtsk should be 0" ); + CYG_TEST_PASS( "good calls: rel_blk, get_blk with ref_mpl" ); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + T_MSG *msgp = NULL; + UINT flgval = 0; + VP blfp = NULL; + VP blkp = NULL; + + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == scratch, "tid not 2" ); + if ( 222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 222" ); + + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = wai_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = wai_flg( &flgval, 2, 99, TWF_ANDW ); + CYG_TEST_CHECK( E_OK == ercd, "wai_flg bad ercd" ); + CYG_TEST_CHECK( 99 == (99 & flgval), "flg value no good" ); + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = rcv_msg( &msgp, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rcv_msg bad ercd" ); + CYG_TEST_CHECK( NULL != msgp, "no msg received" ); + CYG_TEST_CHECK( NADR != msgp, "no msg received" ); + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = get_blf( &blfp, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "get_blf bad ercd" ); + CYG_TEST_CHECK( NULL != blfp, "no blf allocated" ); + CYG_TEST_CHECK( NADR != blfp, "no blf allocated" ); + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = get_blk( &blkp, 2, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "get_blk bad ercd" ); + CYG_TEST_CHECK( NULL != blkp, "no blk allocated" ); + CYG_TEST_CHECK( NADR != blkp, "no blk allocated" ); + + ext_tsk(); + CYG_TEST_FAIL( "Task 2 failed to exit" ); +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF test2.c diff --git a/packages/compat/uitron/current/tests/test3.c b/packages/compat/uitron/current/tests/test3.c new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/test3.c @@ -0,0 +1,245 @@ +//=========================================================================== +// +// test3.c +// +// uITRON "C" test program three +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +int t2done = 0; +int t3done = 0; +int t4done = 0; + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +void task1( unsigned int arg ) +{ + ER ercd; + INT scratch; + + CYG_TEST_INFO( "Task 1 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 1 == scratch, "tid not 1" ); + + // start lower prio tasks to interact with + ercd = sta_tsk( 2, 222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = sta_tsk( 3, 333 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = sta_tsk( 4, 444 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + + // now start the test + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + CYG_TEST_INFO( "T1 awoken" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + CYG_TEST_INFO( "T1 signalled" ); + + // let the others complete, so we get the status back + ercd = dly_tsk( 50 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + CYG_TEST_CHECK( t2done, "t2 not done" ); + CYG_TEST_CHECK( t3done, "t3 not done" ); + CYG_TEST_CHECK( t4done, "t4 not done" ); + + CYG_TEST_PASS( "Immediate-dispatch producer/consumer test OK" ); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + INT scratch; + + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == scratch, "tid not 2" ); + if ( 222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 222" ); + + // now start the test + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + CYG_TEST_INFO( "T2 awoken" ); + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = wup_tsk( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + + CYG_TEST_INFO( "T2 completing" ); + t2done++; + + ercd = slp_tsk(); + CYG_TEST_FAIL( "Task 2 sleep came back" ); +} + +void task3( unsigned int arg ) +{ + ER ercd; + INT scratch; + + CYG_TEST_INFO( "Task 3 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 3 == scratch, "tid not 3" ); + if ( 333 != arg ) + CYG_TEST_FAIL( "Task 3 arg not 333" ); + + // now start the test + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + CYG_TEST_INFO( "T3 awoken" ); + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + + CYG_TEST_INFO( "T3 completing" ); + t3done++; + + ercd = slp_tsk(); + CYG_TEST_FAIL( "Task 3 sleep came back" ); +} + +void task4( unsigned int arg ) +{ + ER ercd; + INT scratch; + + CYG_TEST_INFO( "Task 4 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 4 == scratch, "tid not 4" ); + if ( 444 != arg ) + CYG_TEST_FAIL( "Task 4 arg not 444" ); + + // now start the test + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + + CYG_TEST_INFO( "T4 completing" ); + t4done++; + + ercd = slp_tsk(); + CYG_TEST_FAIL( "Task 4 sleep came back" ); +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF test3.c diff --git a/packages/compat/uitron/current/tests/test4.c b/packages/compat/uitron/current/tests/test4.c new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/test4.c @@ -0,0 +1,384 @@ +//=========================================================================== +// +// test4.c +// +// uITRON "C" test program four +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-12 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough cyclic handlers */ \ + defined( CYGPKG_UITRON_CYCLICS ) && \ + (CYGNUM_UITRON_CYCLICS >= 3) && \ + (CYGNUM_UITRON_CYCLICS < 90) && \ + \ + /* test configuration for enough alarm handlers */ \ + defined( CYGPKG_UITRON_ALARMS ) && \ + (CYGNUM_UITRON_ALARMS >= 3) && \ + (CYGNUM_UITRON_ALARMS < 90) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercount = 0; +INT scratch; + +void hand1(void) +{ + CYG_TEST_INFO("Handler 1 called"); + intercount++; +} + +void hand2(void) +{ + CYG_TEST_CHECK( 2 == intercount, "handler out of sync" ); + CYG_TEST_INFO("Handler 2 called"); + intercount++; +} + +void task1( unsigned int arg ) +{ + ER ercd; + + T_DCYC dcyc; + T_DALM dalm; + T_RCYC rcyc; + T_RALM ralm; + + static char foo[] = "Test message"; + VP info = (VP)foo; + + CYG_TEST_INFO( "Task 1 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 1 == scratch, "tid not 1" ); + + dcyc.exinf = (VP)info; + dcyc.cycatr = TA_HLNG; + dcyc.cychdr = (FP)&hand1; + dcyc.cycact = TCY_INI; // bad + dcyc.cyctim = 2; + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_cyc(3, &dcyc); + CYG_TEST_CHECK( E_PAR == ercd, "def_cyc bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + dcyc.cycact = TCY_OFF; // make good + dcyc.cyctim = 0; // bad + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_cyc(3, &dcyc); + CYG_TEST_CHECK( E_PAR == ercd, "def_cyc bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + dcyc.cyctim = 1; // make good + + ercd = def_cyc(3, &dcyc); + CYG_TEST_CHECK( E_OK == ercd, "def_cyc bad ercd" ); + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_cyc(-6, &dcyc); + CYG_TEST_CHECK( E_PAR == ercd, "def_cyc bad ercd !E_PAR" ); + ercd = def_cyc(99, &dcyc); + CYG_TEST_CHECK( E_PAR == ercd, "def_cyc bad ercd !E_PAR" ); + + ercd = act_cyc(-6, TCY_OFF); + CYG_TEST_CHECK( E_PAR == ercd, "act_cyc bad ercd !E_PAR" ); + ercd = act_cyc(99, TCY_OFF); + CYG_TEST_CHECK( E_PAR == ercd, "act_cyc bad ercd !E_PAR" ); + ercd = act_cyc( 3, ~0); + CYG_TEST_CHECK( E_PAR == ercd, "act_cyc bad ercd !E_PAR" ); + + ercd = ref_cyc(&rcyc, -6); + CYG_TEST_CHECK( E_PAR == ercd, "ref_cyc bad ercd !E_PAR" ); + ercd = ref_cyc(&rcyc, 99); + CYG_TEST_CHECK( E_PAR == ercd, "ref_cyc bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_cyc(NULL, 3); + CYG_TEST_CHECK( E_PAR == ercd, "ref_cyc bad ercd !E_PAR" ); +#endif + ercd = ref_cyc(NADR, 3); + CYG_TEST_CHECK( E_PAR == ercd, "ref_cyc bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + ercd = def_cyc(3, (T_DCYC *)NADR); + CYG_TEST_CHECK( E_OK == ercd, "def_cyc bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_cyc bad ercd !E_NOEXS" ); +#endif // we can test bad param error returns + + CYG_TEST_PASS( "bad calls: def_cyc, act_cyc, ref_cyc" ); + + dalm.exinf = (VP)info; + dalm.almatr = TA_HLNG; + dalm.almhdr = (FP)&hand2; + dalm.tmmode = ~0; // bad + dalm.almtim = 20; + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_alm(3, &dalm); + CYG_TEST_CHECK( E_PAR == ercd, "def_alm bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + dalm.tmmode = TTM_REL; // make good + dalm.almtim = 0; // bad + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_alm(3, &dalm); + CYG_TEST_CHECK( E_PAR == ercd, "def_alm bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + dalm.almtim = 1000; // make good + + ercd = def_alm(3, &dalm); + CYG_TEST_CHECK( E_OK == ercd, "def_alm bad ercd" ); + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = ref_alm(&ralm, -6); + CYG_TEST_CHECK( E_PAR == ercd, "ref_alm bad ercd !E_PAR" ); + ercd = ref_alm(&ralm, 99); + CYG_TEST_CHECK( E_PAR == ercd, "ref_alm bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_alm(NULL, 3); + CYG_TEST_CHECK( E_PAR == ercd, "ref_alm bad ercd !E_PAR" ); +#endif + ercd = ref_alm(NADR, 3); + CYG_TEST_CHECK( E_PAR == ercd, "ref_alm bad ercd !E_PAR" ); + +#endif // we can test bad param error returns + ercd = def_alm(3, (T_DALM *)NADR); + CYG_TEST_CHECK( E_OK == ercd, "def_cyc bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = ref_alm(&ralm, 3); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_cyc bad ercd !E_NOEXS" ); +#endif // we can test bad param error returns + + CYG_TEST_PASS( "bad calls: def_alm, act_alm, ref_alm" ); + + dcyc.exinf = (VP)info; + dcyc.cycatr = TA_HLNG; + dcyc.cychdr = (FP)&hand1; + dcyc.cycact = TCY_ON; + dcyc.cyctim = 50; + + ercd = def_cyc(3, &dcyc); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 45 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 50, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_ON == rcyc.cycact, "rcyc.cycact should be TCY_ON" ); + ercd = act_cyc(3, TCY_OFF); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 45 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 50, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_OFF == rcyc.cycact, "rcyc.cycact should be TCY_OFF" ); + ercd = act_cyc(3, TCY_ON); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc bad ercd" ); + + CYG_TEST_PASS("good calls: def_cyc, act_cyc, ref_cyc"); + + dalm.exinf = (VP)info; + dalm.almatr = TA_HLNG; + dalm.almhdr = (FP)&hand2; + dalm.tmmode = TTM_REL; + dalm.almtim = 120; + + ercd = def_alm(3, &dalm); + CYG_TEST_CHECK( E_OK == ercd, "def_alm bad ercd" ); + ercd = ref_alm(&ralm, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_alm bad ercd" ); + CYG_TEST_CHECK( info == ralm.exinf, "ralm.exinf should be info" ); + CYG_TEST_CHECK( 115 < ralm.lfttim, "ralm.lfttim too small" ); + CYG_TEST_CHECK( ralm.lfttim <= 120, "ralm.lfttim too big" ); + + // Expect handlers to be called at approximate times + // time intercount + // 50 hand1 0 + // 100 hand1 1 + // 120 hand2 2 + // 150 hand1 3 + + ercd = dly_tsk(160); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 4 == intercount, "handlers not both called" ); + + ercd = act_cyc(3, TCY_OFF); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(off) bad ercd" ); + + ercd = dly_tsk(60); // enough for at least one tick + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 4 == intercount, "cyclic not disabled" ); + + // approx time now 220, so we expect a cycle in about 30 ticks + ercd = act_cyc(3, TCY_ON); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(on) bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 25 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 35, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_ON == rcyc.cycact, "rcyc.cycact should be TCY_ON" ); + + // now resynchronize with right now: + ercd = act_cyc(3, TCY_ON|TCY_INI); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(on) bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 45 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 50, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_ON == rcyc.cycact, "rcyc.cycact should be TCY_ON" ); + + // wait a bit and check that time marches on, or even down + ercd = dly_tsk(10); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 35 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 45, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_ON == rcyc.cycact, "rcyc.cycact should be TCY_ON" ); + + // now turn it off and re-synch with right now: + ercd = act_cyc(3, TCY_OFF|TCY_INI); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(on) bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 45 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 50, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_OFF == rcyc.cycact, "rcyc.cycact should be TCY_OFF" ); + + ercd = act_cyc(3, TCY_OFF); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(on) bad ercd" ); + + CYG_TEST_PASS("good calls: def_cyc, act_cyc, ref_cyc, def_alm, ref_alm"); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF test4.c diff --git a/packages/compat/uitron/current/tests/test5.c b/packages/compat/uitron/current/tests/test5.c new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/test5.c @@ -0,0 +1,343 @@ +//=========================================================================== +// +// test5.c +// +// uITRON "C" test program five +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-12 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough flag objects */ \ + defined( CYGPKG_UITRON_FLAGS ) && \ + (CYGNUM_UITRON_FLAGS >= 3) && \ + (CYGNUM_UITRON_FLAGS < 90) && \ + ( !defined(CYGPKG_UITRON_FLAGS_CREATE_DELETE) || \ + CYGNUM_UITRON_FLAGS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough message boxes */ \ + defined( CYGPKG_UITRON_MBOXES ) && \ + (CYGNUM_UITRON_MBOXES >= 3) && \ + (CYGNUM_UITRON_MBOXES < 90) && \ + ( !defined(CYGPKG_UITRON_MBOXES_CREATE_DELETE) || \ + CYGNUM_UITRON_MBOXES_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough fixed memory pools */ \ + defined( CYGPKG_UITRON_MEMPOOLFIXED ) && \ + (CYGNUM_UITRON_MEMPOOLFIXED >= 3) && \ + (CYGNUM_UITRON_MEMPOOLFIXED < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough variable mempools */ \ + defined( CYGPKG_UITRON_MEMPOOLVAR ) && \ + (CYGNUM_UITRON_MEMPOOLVAR >= 3) && \ + (CYGNUM_UITRON_MEMPOOLVAR < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLVAR_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercount = 0; +UINT scratch; +T_MSG *t_msg; +VP vp; + +void task1( unsigned int arg ) +{ + ER ercd; + int i; + T_RSYS rsys; + + CYG_TEST_INFO( "Task 1 running" ); + + // check initial state + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_TSK == rsys.sysstat, "system state not TSS_TSK" ); + // disable intrs and check state + ercd = loc_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "loc_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_LOC == rsys.sysstat, "system state not TSS_LOC" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // try an illegal op + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "dly_tsk bad ercd !E_CTX" ); +#endif // CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // enable intrs and check state and a legal sleep + ercd = unl_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "unl_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_TSK == rsys.sysstat, "system state not TSS_TSK" ); + ercd = dly_tsk( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // disable intrs and try scheduler illegal ops + ercd = loc_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "loc_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_LOC == rsys.sysstat, "system state not TSS_LOC" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = dis_dsp(); + CYG_TEST_CHECK( E_CTX == ercd, "dis_dsp bad ercd !E_CTX" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_CTX == ercd, "ena_dsp bad ercd !E_CTX" ); +#endif // CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // enable again and check state + ercd = unl_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "unl_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_TSK == rsys.sysstat, "system state not TSS_TSK" ); + // disable the scheduler and check state + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_DDSP == rsys.sysstat, "system state not TSS_DDSP" ); + // disable intrs and check state + ercd = loc_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "loc_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_LOC == rsys.sysstat, "system state not TSS_LOC" ); + // then unlock and check state + ercd = unl_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "unl_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_TSK == rsys.sysstat, "system state not TSS_TSK" ); + + CYG_TEST_PASS( "Interrupt dis/enabling and interactions" ); + + // and now we can do the rest of the test + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai bad ercd !E_OBJ" ); + ercd = rel_wai( 1 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai(me) bad ercd !E_OBJ" ); + ercd = rel_wai( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "rel_wai bad ercd !E_ID" ); + ercd = rel_wai( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "rel_wai bad ercd !E_ID" ); +#endif // we can test bad param error returns + + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai bad ercd !E_OBJ" ); + ercd = rel_wai( 1 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai(me) bad ercd !E_OBJ" ); +#endif // we can test bad param error returns + + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "wai_sem bad ercd !E_RLWAI" ); + + ercd = twai_sem( 1, 20 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "twai_sem bad ercd !E_RLWAI" ); + + ercd = wai_flg( &scratch, 1, 9999, 0 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "wai_flg bad ercd !E_RLWAI" ); + + ercd = twai_flg( &scratch, 1, 9999, 0, 10 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "twai_flg bad ercd !E_RLWAI" ); + + ercd = rcv_msg( &t_msg, 1 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "rcv_msg bad ercd !E_RLWAI" ); + + ercd = trcv_msg( &t_msg, 1, 10 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "trcv_msg bad ercd !E_RLWAI" ); + + // these are loops so as to consume the whole of the mempool + // in order to wait at the end + for ( i = 0; i < 10; i++ ) + if ( E_OK != (ercd = get_blf( &vp, 3 ) ) ) + break; + CYG_TEST_CHECK( E_RLWAI == ercd, "get_blf bad ercd !E_RLWAI" ); + + for ( i = 0; i < 10; i++ ) + if ( E_OK != (ercd = tget_blf( &vp, 3, 10 ) ) ) + break; + CYG_TEST_CHECK( E_RLWAI == ercd, "tget_blf bad ercd !E_RLWAI" ); + + for ( i = 0; i < 10; i++ ) + if ( E_OK != (ercd = get_blk( &vp, 1, 1000 ) ) ) + break; + CYG_TEST_CHECK( E_RLWAI == ercd, "get_blk bad ercd !E_RLWAI" ); + + for ( i = 0; i < 10; i++ ) + if ( E_OK != (ercd = tget_blk( &vp, 1, 1000, 10 ) ) ) + break; + CYG_TEST_CHECK( E_RLWAI == ercd, "tget_blk bad ercd !E_RLWAI" ); + + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "dly_tsk bad ercd !E_RLWAI" ); + + ercd = tslp_tsk( 10 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "tslp_tsk bad ercd !E_RLWAI" ); + + ercd = slp_tsk(); + CYG_TEST_CHECK( E_RLWAI == ercd, "slp_tsk bad ercd !E_RLWAI" ); + + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + CYG_TEST_PASS("release wait: various waiting calls"); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == i, "tid not 2" ); + if ( 22222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 22222" ); + + for ( i = 0 ; i < 100; i++ ) { + ercd = rel_wai( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_wai bad ercd" ); + } + // we expect task2 to be killed here + CYG_TEST_FAIL( "Task 2 ran to completion!" ); +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF test5.c diff --git a/packages/compat/uitron/current/tests/test6.c b/packages/compat/uitron/current/tests/test6.c new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/test6.c @@ -0,0 +1,590 @@ +//=========================================================================== +// +// test6.c +// +// uITRON "C" test program six +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-10-01 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough flag objects */ \ + defined( CYGPKG_UITRON_FLAGS ) && \ + (CYGNUM_UITRON_FLAGS >= 3) && \ + (CYGNUM_UITRON_FLAGS < 90) && \ + ( !defined(CYGPKG_UITRON_FLAGS_CREATE_DELETE) || \ + CYGNUM_UITRON_FLAGS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough message boxes */ \ + defined( CYGPKG_UITRON_MBOXES ) && \ + (CYGNUM_UITRON_MBOXES >= 3) && \ + (CYGNUM_UITRON_MBOXES < 90) && \ + ( !defined(CYGPKG_UITRON_MBOXES_CREATE_DELETE) || \ + CYGNUM_UITRON_MBOXES_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercount = 0; +UINT scratch; +T_MSG *t_msg = (T_MSG *)&scratch; +T_MSG *msg; +VP vp; + +T_CSEM t_csem = { NULL, 0, 0 }; +T_CMBX t_cmbx = { NULL, 0 }; +T_CFLG t_cflg = { NULL, 0, 0 }; +T_RSEM t_rsem; +T_RMBX t_rmbx; +T_RFLG t_rflg; + + +void task1( unsigned int arg ) +{ + ER ercd; + int tests = 0; + + CYG_TEST_INFO( "Task 1 running" ); + + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_sem( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_sem bad ercd !E_ID" ); + ercd = del_sem( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_sem bad ercd !E_ID" ); + ercd = cre_sem( -6, &t_csem ); + CYG_TEST_CHECK( E_ID == ercd, "cre_sem bad ercd !E_ID" ); + ercd = cre_sem( 99, &t_csem ); + CYG_TEST_CHECK( E_ID == ercd, "cre_sem bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + ercd = cre_sem( 3, &t_csem ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_sem bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_sem( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + // check it is deleted + ercd = sig_sem( 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + ercd = preq_sem( 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "preq_sem bad ercd !E_NOEXS" ); + ercd = twai_sem( 3, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "twai_sem bad ercd !E_NOEXS" ); + ercd = wai_sem( 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "wai_sem bad ercd !E_NOEXS" ); + ercd = ref_sem( &t_rsem, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_sem bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_sem( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_sem bad ercd !E_PAR" ); +#endif + ercd = cre_sem( 3, NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_sem bad ercd !E_PAR" ); + t_csem.sematr = 0xfff; + ercd = cre_sem( 3, &t_csem ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_sem bad ercd !E_RSATR" ); + t_csem.sematr = 0; +#endif // we can test bad param error returns + ercd = cre_sem( 3, &t_csem ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); + // and check we can use it + ercd = sig_sem( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = wai_sem( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + ercd = preq_sem( 3 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "preq_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 3, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem bad ercd !E_TMOUT" ); + ercd = ref_sem( &t_rsem, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_sem bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = twai_sem( 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_sem bad ercd !E_DLT" ); + + // check they are deleted + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + // re-create and do it again + ercd = cre_sem( 1, &t_csem ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); + ercd = cre_sem( 2, &t_csem ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); + + // now wait while task 2 deletes the wait objects again + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_sem bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = twai_sem( 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_sem bad ercd !E_DLT" ); + + // check they are deleted + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete semaphores"); +#endif // CYGPKG_UITRON_SEMAS_CREATE_DELETE + + +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_flg( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_flg bad ercd !E_ID" ); + ercd = del_flg( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_flg bad ercd !E_ID" ); + ercd = cre_flg( -6, &t_cflg ); + CYG_TEST_CHECK( E_ID == ercd, "cre_flg bad ercd !E_ID" ); + ercd = cre_flg( 99, &t_cflg ); + CYG_TEST_CHECK( E_ID == ercd, "cre_flg bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + ercd = cre_flg( 3, &t_cflg ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_flg bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_flg( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + // check it is deleted + ercd = set_flg( 3, 0x6789 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "set_flg bad ercd !E_NOEXS" ); + ercd = clr_flg( 3, 0x9876 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "clr_flg bad ercd !E_NOEXS" ); + ercd = pol_flg( &scratch, 3, 0xdddd, TWF_ANDW ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pol_flg bad ercd !E_NOEXS" ); + ercd = twai_flg( &scratch, 3, 0x4444, TWF_ORW, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "twai_flg bad ercd !E_NOEXS" ); + ercd = wai_flg( &scratch, 3, 0xbbbb, TWF_ANDW | TWF_CLR ); + CYG_TEST_CHECK( E_NOEXS == ercd, "wai_flg bad ercd !E_NOEXS" ); + ercd = ref_flg( &t_rflg, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_flg bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_flg( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_flg bad ercd !E_PAR" ); +#endif + ercd = cre_flg( 3, NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_flg bad ercd !E_PAR" ); + t_cflg.flgatr = 0xfff; + ercd = cre_flg( 3, &t_cflg ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_flg bad ercd !E_RSATR" ); +#endif // we can test bad param error returns + // now create it well + t_cflg.flgatr = 0; + t_cflg.iflgptn = 0; + ercd = cre_flg( 3, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_flg bad ercd" ); + // and check we can use it + ercd = clr_flg( 3, 0x7256 ); + CYG_TEST_CHECK( E_OK == ercd, "clr_flg bad ercd" ); + ercd = set_flg( 3, 0xff ); + CYG_TEST_CHECK( E_OK == ercd, "set_flg bad ercd" ); + ercd = wai_flg( &scratch, 3, 0xaa, TWF_ANDW | TWF_CLR ); + CYG_TEST_CHECK( E_OK == ercd, "wai_flg bad ercd" ); + ercd = pol_flg( &scratch, 3, 0xaa, TWF_ANDW | TWF_CLR ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &scratch, 3, 0xaa, TWF_ANDW | TWF_CLR, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg bad ercd !E_TMOUT" ); + ercd = ref_flg( &t_rflg, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 == t_rflg.flgptn, "ref_flg bad ercd" ); + // now create it again with a preset pattern and check that we can + // detect that pattern: + ercd = del_flg( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + t_cflg.flgatr = 0; + t_cflg.iflgptn = 0x1234; + ercd = cre_flg( 3, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_flg bad ercd" ); + // and check we can use it + ercd = wai_flg( &scratch, 3, 0x1200, TWF_ANDW ); + CYG_TEST_CHECK( E_OK == ercd, "wai_flg bad ercd" ); + ercd = pol_flg( &scratch, 3, 0x0034, TWF_ANDW ); + CYG_TEST_CHECK( E_OK == ercd, "pol_flg bad ercd" ); + ercd = twai_flg( &scratch, 3, 0x1004, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "twai_flg bad ercd" ); + ercd = pol_flg( &scratch, 3, 0xffedcb, TWF_ORW ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = ref_flg( &t_rflg, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0x1234 == t_rflg.flgptn, "ref_flg bad ercd" ); + ercd = clr_flg( 3, 0 ); + ercd = ref_flg( &t_rflg, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 == t_rflg.flgptn, "ref_flg bad ercd" ); + + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wai_flg( &scratch, 1, 0xaa, TWF_ANDW ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_flg bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = twai_flg( &scratch, 2, 0x55, TWF_ANDW, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_flg bad ercd !E_DLT" ); + + // check they are deleted + ercd = set_flg( 1, 0x22 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "set_flg bad ercd !E_NOEXS" ); + ercd = clr_flg( 2, 0xdd ); + CYG_TEST_CHECK( E_NOEXS == ercd, "clr_flg bad ercd !E_NOEXS" ); + // re-create and do it again + t_cflg.iflgptn = 0x5555; + ercd = cre_flg( 1, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_flg bad ercd" ); + t_cflg.iflgptn = 0; + ercd = cre_flg( 2, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_flg bad ercd" ); + + // now wait while task 2 deletes the wait objects again + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wai_flg( &scratch, 1, 0xaaaa, TWF_ORW | TWF_CLR ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_flg bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = twai_flg( &scratch, 2, 0xffff, TWF_ORW, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_flg bad ercd !E_DLT" ); + + // check they are deleted + ercd = clr_flg( 1, 0xd00d ); + CYG_TEST_CHECK( E_NOEXS == ercd, "clr_flg bad ercd !E_NOEXS" ); + ercd = set_flg( 2, 0xfff00 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "set_flg bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete flags"); +#endif // CYGPKG_UITRON_FLAGS_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_mbx( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mbx bad ercd !E_ID" ); + ercd = del_mbx( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mbx bad ercd !E_ID" ); + ercd = cre_mbx( -6, &t_cmbx ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mbx bad ercd !E_ID" ); + ercd = cre_mbx( 99, &t_cmbx ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mbx bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + ercd = cre_mbx( 3, &t_cmbx ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_mbx bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_mbx( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + // check it is deleted + ercd = snd_msg( 3, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + ercd = rcv_msg( &msg, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rcv_msg bad ercd !E_NOEXS" ); + ercd = trcv_msg( &msg, 3, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "trcv_msg bad ercd !E_NOEXS" ); + ercd = prcv_msg( &msg, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "prcv_msg bad ercd !E_NOEXS" ); + ercd = ref_mbx( &t_rmbx, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_mbx bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_mbx( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_mbx bad ercd !E_PAR" ); +#endif + ercd = cre_mbx( 3, NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_mbx bad ercd !E_PAR" ); + t_cmbx.mbxatr = 0xfff; + ercd = cre_mbx( 3, &t_cmbx ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_mbx bad ercd !E_RSATR" ); + t_cmbx.mbxatr = 0; +#endif // we can test bad param error returns + ercd = cre_mbx( 3, &t_cmbx ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mbx bad ercd" ); + // and check we can use it + ercd = snd_msg( 3, t_msg ); + CYG_TEST_CHECK( E_OK == ercd, "snd_msg bad ercd" ); + ercd = rcv_msg( &msg, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "rcv_msg bad ercd" ); + ercd = trcv_msg( &msg, 3, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg bad ercd !E_TMOUT" ); + ercd = prcv_msg( &msg, 3 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "prcv_msg bad ercd !E_TMOUT" ); + ercd = ref_mbx( &t_rmbx, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rcv_msg( &msg, 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_mbx bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = trcv_msg( &msg, 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_mbx bad ercd !E_DLT" ); + + // check they are deleted + ercd = snd_msg( 1, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + ercd = snd_msg( 2, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + // re-create and do it again + ercd = cre_mbx( 1, &t_cmbx ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mbx bad ercd" ); + ercd = cre_mbx( 2, &t_cmbx ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mbx bad ercd" ); + + // now wait while task 2 deletes the wait objects again + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rcv_msg( &msg, 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_mbx bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = trcv_msg( &msg, 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_mbx bad ercd !E_DLT" ); + + // check they are deleted + ercd = snd_msg( 1, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + ercd = snd_msg( 2, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete mboxes"); +#endif // CYGPKG_UITRON_MBOXES_CREATE_DELETE + + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + ercd = dly_tsk( 5 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + // all done + if ( 0 == tests ) { + CYG_TEST_PASS( "N/A: no objects have create/delete enabled" ); + CYG_TEST_EXIT( "N/A" ); + } + else { + CYG_TEST_EXIT( "All done" ); + } + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == i, "tid not 2" ); + if ( 22222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 22222" ); + + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + ercd = del_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_SEMAS_CREATE_DELETE + +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + ercd = del_flg( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_flg( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_flg( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_flg( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_FLAGS_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + ercd = del_mbx( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mbx( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mbx( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mbx( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_MBOXES_CREATE_DELETE + + // we expect task2 to be killed here + CYG_TEST_FAIL( "Task 2 ran to completion!" ); +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF test6.c diff --git a/packages/compat/uitron/current/tests/test7.c b/packages/compat/uitron/current/tests/test7.c new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/test7.c @@ -0,0 +1,999 @@ +//=========================================================================== +// +// test7.c +// +// uITRON "C" test program seven +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-10-01 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough flag objects */ \ + defined( CYGPKG_UITRON_FLAGS ) && \ + (CYGNUM_UITRON_FLAGS >= 3) && \ + (CYGNUM_UITRON_FLAGS < 90) && \ + ( !defined(CYGPKG_UITRON_FLAGS_CREATE_DELETE) || \ + CYGNUM_UITRON_FLAGS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough message boxes */ \ + defined( CYGPKG_UITRON_MBOXES ) && \ + (CYGNUM_UITRON_MBOXES >= 3) && \ + (CYGNUM_UITRON_MBOXES < 90) && \ + ( !defined(CYGPKG_UITRON_MBOXES_CREATE_DELETE) || \ + CYGNUM_UITRON_MBOXES_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough fixed memory pools */ \ + defined( CYGPKG_UITRON_MEMPOOLFIXED ) && \ + (CYGNUM_UITRON_MEMPOOLFIXED >= 3) && \ + (CYGNUM_UITRON_MEMPOOLFIXED < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough variable mempools */ \ + defined( CYGPKG_UITRON_MEMPOOLVAR ) && \ + (CYGNUM_UITRON_MEMPOOLVAR >= 3) && \ + (CYGNUM_UITRON_MEMPOOLVAR < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLVAR_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +// ======================================================================== + +typedef enum { + START_WAITOP = 0, + SLEEP = 0, + DELAY, + SEMGET, + FLAGWAIT, + MSGGET, + MEMFIXEDGET, + MEMVARGET, + DONE_WAITOP +} WAITOP; + +typedef enum { + START_TYPE = 0, + PLAIN = 0, + TIMED = 1, + DONE_TYPE +} WAITTYPE; + +typedef enum { + START_KILLOP = 0, + + // These are the 5 ways out of a wait that we perm + // with other circumstances: + SIGNAL = 0, // do the appropriate producer op + TIMEOUT, // wait for the timeout to fire + RELEASE, // do a rel_wai() + DELETE, // delete the object; del_xxx() + KILL, // do a ter_tsk() on the waiter + + SUSPEND_SIGNAL_RESUME, + SUSPEND_TIMEOUT_RESUME, + SUSPEND_RELEASE_RESUME, + SUSPEND_DELETE_RESUME, + SUSPEND_KILL, // resume not applicable + + SUSPEND_SIGNAL_KILL, + SUSPEND_TIMEOUT_KILL, + SUSPEND_RELEASE_KILL, + SUSPEND_DELETE_KILL, + // SUSPEND_KILL_KILL not applicable + +#if 0 + // support these later if _really_ keen. + SUSPEND_SIGNAL_DELETE_RESUME, + SUSPEND_TIMEOUT_DELETE_RESUME, + SUSPEND_RELEASE_DELETE_RESUME, + // SUSPEND_DELETE_DELETE_RESUME not applicable + // SUSPEND_KILL_DELETE_RESUME not applicable + + SUSPEND_SIGNAL_DELETE_KILL, + SUSPEND_TIMEOUT_DELETE_KILL, + SUSPEND_RELEASE_DELETE_KILL, + // SUSPEND_DELETE_DELETE_KILL, + SUSPEND_KILL_DELETE // 2nd kill not applicable +#endif + + DONE_KILLOP +} KILLOP; + +// ======================================================================== + +char * waitstrings[] = +{ "Sleep ", "Delay ", "Sema ", "Flag ", "Mbox ", "MemFix", "MemVar" }; + +char * typestrings[] = +{ " (Plain) : ", " (Timed) : " }; + +char * killstrings[] = +{ "Signal", + "Wait-for-timeout", + "Release-wait", + "Delete-object", + "Kill-task", + + "Suspend/Signal/Resume", + "Suspend/Wait-for-timeout/Resume", + "Suspend/Release-wait/Resume", + "Suspend/Delete-object/Resume", + "Suspend/Kill-task", + + "Suspend/Signal/Kill-task", + "Suspend/Wait-for-timeout/Kill-task", + "Suspend/Release-wait/Kill-task", + "Suspend/Delete-object/Kill-task", + + +}; + +// ======================================================================== + +inline int task2arg( WAITOP wait, WAITTYPE waittype, KILLOP kill ) +{ + return waittype + (wait << 1) + (kill << 8); +} + +inline void decodearg( int arg, WAITOP *pwait, WAITTYPE *pwaittype, KILLOP *pkill ) +{ + *pwaittype = (arg & 1) ? TIMED : PLAIN; + *pwait = (arg >> 1) & 0x7f; + *pkill = (arg >> 8); +} + +static char *strdog( char *p, char *q ) +{ + while ( 0 != (*p++ = *q++) ); + return p - 1; +} + +static char * +makemsg( char *z, WAITOP wait, WAITTYPE waittype, KILLOP kill ) +{ + static char buf[ 1000 ]; + char *p = buf; + p = strdog( p, z ); + p = strdog( p, waitstrings[ wait ] ); + p = strdog( p, typestrings[ waittype ] ); + p = strdog( p, killstrings[ kill ] ); + *p = 0; + return buf; +} + +// ======================================================================== + +volatile int intercom = 0; + +// ======================================================================== + +T_RTSK rtsk; + +void +do_suspend( void ) +{ + ER ercd; + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_WAI == rtsk.tskstat, "bad tskstat !TTS_WAI" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_WAS == rtsk.tskstat, "bad tskstat !TTS_WAS" ); +} + +void +do_resume( void ) +{ + ER ercd; + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_SUS == rtsk.tskstat, "bad tskstat !TTS_SUS" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_RDY == rtsk.tskstat, "bad tskstat !TTS_RDY" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); +} + +// ======================================================================== + +#define T1_WAIT (7) +#define T2_WAIT (5) + +#define T1_MALLOC (110) +#define T2_MALLOC (100) + +VP vptmp; +VP vp = NULL; +VP vp1 = NULL; +VP t2vp = NULL; +VP t2vp_backup = NULL; + +UINT scratch; + +T_MSG *msg = (T_MSG *)&scratch; +T_MSG *msg1; + +void +do_prep( WAITOP wait ) +{ + ER ercd; + switch ( wait ) { + case SLEEP: + case DELAY: + case SEMGET: + case FLAGWAIT: + case MSGGET: + // do nothing for all of those + break; + case MEMFIXEDGET: + // allocate all the memory in the pool; remember a couple + // for freeing as the signalling operation: + t2vp = NULL; + vp = vptmp = NULL; + do { + vp1 = vptmp; + vptmp = vp; + ercd = pget_blf( &vp, 1 ); + } while ( E_OK == ercd ); + CYG_TEST_CHECK( E_TMOUT == ercd, "get_blf bad ercd" ); + CYG_TEST_CHECK( NULL != vp, "no allocated block to free" ); + CYG_TEST_CHECK( NULL != vp1, "no allocated block to free1" ); + break; + case MEMVARGET: + // allocate all the memory in the pool; remember a couple + // for freeing as the signalling operation: + t2vp = NULL; + vp = vptmp = NULL; + do { + vp1 = vptmp; + vptmp = vp; + ercd = pget_blk( &vp, 1, T1_MALLOC ); + } while ( E_OK == ercd ); + CYG_TEST_CHECK( E_TMOUT == ercd, "get_blk bad ercd" ); + CYG_TEST_CHECK( NULL != vp, "no allocated block to free" ); + CYG_TEST_CHECK( NULL != vp1, "no allocated block to free1" ); + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } +} + +void +do_tidyup( WAITOP wait ) +{ + ER ercd; + switch ( wait ) { + case SLEEP: + case DELAY: + case SEMGET: + case MSGGET: + // do nothing for all of those + break; + case FLAGWAIT: + // clear the flag variable + ercd = clr_flg( 1, 0 ); + CYG_TEST_CHECK( E_OK == ercd, "clr_flg bad ercd, tidy vp" ); + break; + case MEMFIXEDGET: + if ( NULL != vp ) { + ercd = rel_blf( 1, vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd, tidy vp" ); + } + if ( NULL != vp1 ) { + ercd = rel_blf( 1, vp1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd, tidy vp1" ); + } + if ( NULL != t2vp ) { + ercd = rel_blf( 1, t2vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd, tidy t2vp" ); + } + break; + case MEMVARGET: + if ( NULL != vp ) { + ercd = rel_blk( 1, vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd, tidy vp" ); + } + if ( NULL != vp1 ) { + ercd = rel_blk( 1, vp1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd, tidy vp1" ); + } + if ( NULL != t2vp ) { + ercd = rel_blk( 1, t2vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd, tidy t2vp" ); + } + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } +} + +void +do_recreate( WAITOP wait ) +{ +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + static T_CSEM t_csem = { NULL, 0, 0 }; +#endif +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + static T_CMBX t_cmbx = { NULL, 0 }; +#endif +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + static T_CFLG t_cflg = { NULL, 0, 0 }; +#endif +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + static T_CMPF t_cmpf = { NULL, 0, 20, 95 }; +#endif +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + static T_CMPL t_cmpl = { NULL, 0, 2000 }; +#endif + ER ercd = E_OK; + switch ( wait ) { + case SLEEP: + case DELAY: + // do nothing for all of those + break; + case SEMGET: +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + // create the semaphore + ercd = cre_sem( 1, &t_csem ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate SEMGET" ); +#endif + break; + case FLAGWAIT: +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + // create the flag + ercd = cre_flg( 1, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate FLAGWAIT" ); +#endif + break; + case MSGGET: +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + // create the mbox + ercd = cre_mbx( 1, &t_cmbx ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate MSGGET" ); +#endif + break; + case MEMFIXEDGET: +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + // create the mempool + ercd = cre_mpf( 1, &t_cmpf ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate MEMFIXEDGET" ); +#endif + break; + case MEMVARGET: +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + // create the mempool + ercd = cre_mpl( 1, &t_cmpl ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate MEMVARGET" ); +#endif + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } + // this is just to use ercd to prevent warnings + CYG_TEST_CHECK( E_OK == ercd, " bad ercd" ); +} + + + +void +do_signal( WAITOP wait ) +{ + ER ercd; + switch ( wait ) { + case SLEEP: + // send a wakeup + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + break; + case DELAY: + // simply wait for task 2's delay to complete + ercd = dly_tsk( T1_WAIT ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + break; + case SEMGET: + // signal the semaphore + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + break; + case FLAGWAIT: + // set the flag bits + ercd = set_flg( 1, 0xff ); + CYG_TEST_CHECK( E_OK == ercd, "set_flg bad ercd" ); + break; + case MSGGET: + // send a message + ercd = snd_msg( 1, msg ); + CYG_TEST_CHECK( E_OK == ercd, "snd_msg bad ercd" ); + break; + case MEMFIXEDGET: + // release a couple of blocks we allocated earlier. I hope. + CYG_TEST_CHECK( NULL != vp, "no allocated block to free" ); + CYG_TEST_CHECK( NULL != vp1, "no allocated block to free1" ); + ercd = rel_blf( 1, vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + vp = NULL; + ercd = rel_blf( 1, vp1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd1" ); + vp1 = NULL; + break; + case MEMVARGET: + // release a couple of blocks we allocated earlier. I hope. + CYG_TEST_CHECK( NULL != vp, "no allocated block to free" ); + CYG_TEST_CHECK( NULL != vp1, "no allocated block to free1" ); + ercd = rel_blk( 1, vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + vp = NULL; + ercd = rel_blk( 1, vp1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd1" ); + vp1 = NULL; + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } +} + +void +do_delete( WAITOP wait ) +{ + ER ercd = E_OK; + switch ( wait ) { + case SLEEP: + case DELAY: + CYG_TEST_FAIL( "bad call to do_delete( SLEEP or DELAY )" ); + break; + case SEMGET: +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + // delete the semaphore + ercd = del_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( SEMGET )" ); +#endif + break; + case FLAGWAIT: +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + // delete the flag + ercd = del_flg( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( FLAGWAIT )" ); +#endif + break; + case MSGGET: +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + // delete the mbox + ercd = del_mbx( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( MSGGET )" ); +#endif + break; + case MEMFIXEDGET: +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + // delete the mempool + ercd = del_mpf( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( MEMFIXEDGET )" ); +#endif + break; + case MEMVARGET: +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + // delete the mempool + ercd = del_mpl( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( MEMVARGET )" ); +#endif + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } + // this is just to use ercd to prevent warnings + CYG_TEST_CHECK( E_OK == ercd, " bad ercd" ); +} + + + +ER +do_wait( WAITOP wait, WAITTYPE type ) +{ + switch ( wait ) { + case SLEEP: + return ( PLAIN == type ) ? slp_tsk() : tslp_tsk( T2_WAIT ); + case DELAY: + return dly_tsk( T2_WAIT ); // forget the type + case SEMGET: + return ( PLAIN == type ) ? wai_sem( 1 ) : twai_sem( 1, T2_WAIT ); + case FLAGWAIT: + return ( PLAIN == type ) ? + wai_flg( &scratch, 1, 0x55, TWF_ANDW ) : + twai_flg( &scratch, 1, 0xaa, TWF_ANDW, T2_WAIT ); + case MSGGET: + return ( PLAIN == type ) ? + rcv_msg( &msg1, 1 ) : + trcv_msg( &msg1, 1, T2_WAIT ); + case MEMFIXEDGET: + return ( PLAIN == type ) ? + get_blf( &t2vp, 1 ) : + tget_blf( &t2vp, 1, T2_WAIT ); + case MEMVARGET: + return ( PLAIN == type ) ? + get_blk( &t2vp, 1, T2_MALLOC ) : + tget_blk( &t2vp, 1, T2_MALLOC, T2_WAIT ); + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } + CYG_TEST_FAIL( "Bad wait in do_wait" ); + return E_SYS; +} + +// ======================================================================== +void task1( unsigned int arg ) +{ + ER ercd; + WAITOP wait; + WAITTYPE type; + KILLOP kill; + + CYG_TEST_INFO( "Task 1 running" ); + + ercd = chg_pri( 1, 8 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + + for ( wait = START_WAITOP; wait < DONE_WAITOP ; wait++) { + for ( type = START_TYPE; type < DONE_TYPE ; type++ ) { + for ( kill = START_KILLOP; kill < DONE_KILLOP ; kill++ ) { + + // These clauses deal with a couple of special cases: + // [doing it this way helps keep the rest of the code + // nicely general and orthogonal] + // + // 1) DELAY: dly_tsk(): when this times out, the retcode is + // E_OK rather than E_TMOUT, and it always times out. The + // "signalling" method here is just to wait yourself. So we + // do not test DELAY with TIMED type. + // + // 2) PLAIN tests with TIMEOUT kill operations: a PLAIN test + // will not time out, it'll wait forever, so waiting for it + // so to do is pointless; further, we would check for the + // wrong error code. So we do not test PLAIN tests with + // TIMOUT kill operations. + // + // 3) SLEEP or DELAY tests with DELETE operations: there is + // no synchronization to delete in those cases. + // 3a) Individual object types are tested for delete support, + // and if there is none, the test is skipped. + + if ( DELAY == wait && TIMED == type ) + continue; + + if ( PLAIN == type && + ( ( TIMEOUT == kill) || + (SUSPEND_TIMEOUT_RESUME == kill) || + (SUSPEND_TIMEOUT_KILL == kill) ) ) + continue; + + if ( ( +#ifndef CYGPKG_UITRON_SEMAS_CREATE_DELETE + (SEMGET == wait) || +#endif +#ifndef CYGPKG_UITRON_FLAGS_CREATE_DELETE + (FLAGWAIT == wait) || +#endif +#ifndef CYGPKG_UITRON_MBOXES_CREATE_DELETE + (MSGGET == wait) || +#endif +#ifndef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + (MEMFIXEDGET == wait) || +#endif +#ifndef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + (MEMVARGET == wait) || +#endif + (SLEEP == wait) || + (DELAY == wait) + ) && + ((DELETE == kill) || + (SUSPEND_DELETE_RESUME == kill) || + (SUSPEND_DELETE_KILL == kill)) ) + continue; + + + CYG_TEST_INFO( makemsg( "T1: ", wait, type, kill ) ); + + intercom = 0; + + // prepare the synchronization objects + // (actually, just empty the mempools) + do_prep( wait ); + + // start task 2 at a higher priority than myself + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, task2arg( wait, type, kill ) ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + // task 2 should run now, until it waits. + + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_WAI == rtsk.tskstat, "bad tskstat" ); + CYG_TEST_CHECK( 5 == rtsk.tskpri, "bad tskpri" ); + + switch ( kill ) { + case SIGNAL: + // signal the task appropriately + do_signal( wait ); + // it should now have run to completion + break; + case TIMEOUT: + // wait for the timeout to occur + ercd = dly_tsk( T1_WAIT ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // it should now have run to completion + break; + case RELEASE: + // hit the task with a release-wait + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_wai bad ercd" ); + // it should now have run to completion + break; + case DELETE: + // delete the object appropriately + do_delete( wait ); + // it should now have run to completion + break; + case KILL: + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_SIGNAL_RESUME: + // suspend the task + do_suspend(); + // signal the task appropriately + do_signal( wait ); + // resume the task + do_resume(); + // it should now have run to completion + break; + case SUSPEND_TIMEOUT_RESUME: + // suspend the task + do_suspend(); + // wait for the timeout to occur + ercd = dly_tsk( T1_WAIT ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // resume the task + do_resume(); + // it should now have run to completion + break; + case SUSPEND_RELEASE_RESUME: + // suspend the task + do_suspend(); + // hit the task with a release-wait + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_wai bad ercd" ); + // resume the task + do_resume(); + // it should now have run to completion + break; + case SUSPEND_DELETE_RESUME: + // suspend the task + do_suspend(); + // delete the object appropriately + do_delete( wait ); + // resume the task + do_resume(); + // it should now have run to completion + break; + case SUSPEND_KILL: + // suspend the task + do_suspend(); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_SIGNAL_KILL: + // suspend the task + do_suspend(); + // signal the task appropriately + do_signal( wait ); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_TIMEOUT_KILL: + // suspend the task + do_suspend(); + // wait for the timeout to occur + ercd = dly_tsk( T1_WAIT ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_RELEASE_KILL: + // suspend the task + do_suspend(); + // hit the task with a release-wait + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_wai bad ercd" ); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_DELETE_KILL: + // suspend the task + do_suspend(); + // delete the object appropriately + do_delete( wait ); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } + + // task 2 should be dormant now, however it got there + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_DMT == rtsk.tskstat, "bad tskstat" ); + + if ( (SUSPEND_SIGNAL_KILL == kill) && + ((MEMFIXEDGET == wait) || (MEMVARGET == wait)) ) { + // it was a killed successful memory alloc, so we have + // lost the pointer to memory allocated; there is an + // implicit storeleak problem when the task trying + // to allocate is signalled then killed. + // Recreate the pointer from an old version: + CYG_TEST_CHECK( NULL == t2vp, "t2vp WAS allocated!" ); + t2vp = t2vp_backup; + } + + switch ( kill ) { + case KILL: + case SUSPEND_KILL: + case SUSPEND_SIGNAL_KILL: + case SUSPEND_TIMEOUT_KILL: + case SUSPEND_RELEASE_KILL: + case SUSPEND_DELETE_KILL: + // if task 2 was killed, expect only one increment + CYG_TEST_CHECK( 1 == intercom, "intercom bad value !1" ); + break; + default: + // otherwise expect two increments + CYG_TEST_CHECK( 2 == intercom, "intercom bad value !2" ); + break; + } + + // tidy up or recreate the synchronization objects + if ( (DELETE == kill) || + (SUSPEND_DELETE_RESUME == kill) || + (SUSPEND_DELETE_KILL == kill) ) + do_recreate( wait ); + else + do_tidyup( wait ); + } + } + } + CYG_TEST_PASS("synchronization interaction tests"); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + WAITOP wait; + WAITTYPE waittype; + KILLOP kill; + + decodearg( arg, &wait, &waittype, &kill ); + +// CYG_TEST_INFO( makemsg( " 2: ", wait, waittype, kill ) ); + + intercom++; + ercd = do_wait( wait, waittype ); + intercom++; + + switch ( kill ) { + case SIGNAL: + case SUSPEND_SIGNAL_RESUME: + // we expect to have been signalled correctly + CYG_TEST_CHECK( E_OK == ercd, "T2 wait bad ercd" ); + // here we know that the op completed OK + if ( (MEMFIXEDGET == wait) || (MEMVARGET == wait) ) { + // it was a successful memory alloc of whichever type, + // so we can save away a copy of t2vp for working round an + // implicit storeleak problem when the task trying to allocate + // is signalled then killed: + CYG_TEST_CHECK( NULL != t2vp, "No t2vp allocated!" ); + t2vp_backup = t2vp; + } + break; + case TIMEOUT: + case SUSPEND_TIMEOUT_RESUME: + // we expect to have timed out - if it's a timeout op. + CYG_TEST_CHECK( E_TMOUT == ercd, "T2 timeout bad ercd, !E_TMOUT" ); + break; + case RELEASE: + case SUSPEND_RELEASE_RESUME: + // we expect to have suffered a release wait. + CYG_TEST_CHECK( E_RLWAI == ercd, "T2 release bad ercd, !E_RLWAI" ); + break; + case DELETE: + case SUSPEND_DELETE_RESUME: + // we expect to be told the object is gone + CYG_TEST_CHECK( E_DLT == ercd, "T2 release bad ercd, !E_DLT" ); + break; + case KILL: + case SUSPEND_KILL: + case SUSPEND_SIGNAL_KILL: + case SUSPEND_TIMEOUT_KILL: + case SUSPEND_RELEASE_KILL: + case SUSPEND_DELETE_KILL: + // we expect to have been killed here, ie. this won't execute! + CYG_TEST_FAIL( "Task 2 ran to completion!" ); + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF test7.c diff --git a/packages/compat/uitron/current/tests/test8.c b/packages/compat/uitron/current/tests/test8.c new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/test8.c @@ -0,0 +1,384 @@ +//=========================================================================== +// +// test8.c +// +// uITRON "C" test program eight +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-10-12 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercount = 0; +INT scratch; + +void newtask( unsigned int arg ); +void task2( unsigned int arg ); +void task3( unsigned int arg ); +void task4( unsigned int arg ); + +T_CTSK t_ctsk = { NULL, 0, (FP)&newtask, 1, CYGNUM_UITRON_STACK_SIZE }; +T_RTSK t_rtsk; + +void task1( unsigned int arg ) +{ + ER ercd; + + CYG_TEST_INFO( "Task 1 running" ); + + // change us to prio 3 for flexibility + ercd = chg_pri( 0, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE + // first, check that we can delete a task: +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_tsk bad ercd !E_ID" ); + ercd = del_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_tsk bad ercd !E_ID" ); + ercd = cre_tsk( -6, &t_ctsk ); + CYG_TEST_CHECK( E_ID == ercd, "cre_tsk bad ercd !E_ID" ); + ercd = cre_tsk( 99, &t_ctsk ); + CYG_TEST_CHECK( E_ID == ercd, "cre_tsk bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + ercd = cre_tsk( 2, &t_ctsk ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_tsk bad ercd !E_OBJ" ); + // try a pre-existing object - ourselves! + ercd = cre_tsk( 1, &t_ctsk ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_tsk bad ercd !E_OBJ" ); + // try deleting an active task + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + // Task 2 is now ready-to-run, lower prio than us + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // Task 2 is now sleeping + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + // try deleting a running task - ourselves! + ercd = del_tsk( 1 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + // terminate task 2; should then be OK to delete it + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_tsk bad ercd" ); + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + // and check it is deleted + ercd = sta_tsk( 2, 99 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sta_tsk bad ercd !E_NOEXS" ); + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ter_tsk bad ercd !E_NOEXS" ); + ercd = chg_pri( 2, 6 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "chg_pri bad ercd !E_NOEXS" ); + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rel_wai bad ercd !E_NOEXS" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sus_tsk bad ercd !E_NOEXS" ); + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rsm_tsk bad ercd !E_NOEXS" ); + ercd = frsm_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "frsm_tsk bad ercd !E_NOEXS" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "wup_tsk bad ercd !E_NOEXS" ); + ercd = can_wup( &scratch, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "can_wup bad ercd !E_NOEXS" ); + ercd = ref_tsk( &t_rtsk, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_tsk bad ercd !E_NOEXS" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "del_tsk bad ercd !E_NOEXS" ); + // recreate task2, with the same function + t_ctsk.task = (FP)&task2; + t_ctsk.itskpri = 7; + ercd = cre_tsk( 2, &t_ctsk ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + ercd = ref_tsk( &t_rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( 7 == t_rtsk.tskpri, "Bad tskpri in new task2 !7" ); + CYG_TEST_CHECK( TTS_DMT == t_rtsk.tskstat, + "Bad tskstat in new task2 !TTS_DMT" ); + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + // now start the task and do the same lot again... + ercd = cre_tsk( 2, &t_ctsk ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_tsk bad ercd !E_OBJ" ); + // try deleting an active task + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + // Task 2 is now ready-to-run, lower prio than us + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "bad intercount !2" ); + // Task 2 is now sleeping + ercd = ref_tsk( &t_rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( 7 == t_rtsk.tskpri, "Bad tskpri in new task2 !7" ); + CYG_TEST_CHECK( TTS_WAI == t_rtsk.tskstat, + "Bad tskstat in new task2 !TTS_WAI" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + // up its priority + ercd = chg_pri( 2, 1 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + // awaken task 2; it will then exit-and-delete itself: + CYG_TEST_CHECK( 2 == intercount, "bad intercount !2" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); + // and check it is deleted + ercd = sta_tsk( 2, 99 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sta_tsk bad ercd !E_NOEXS" ); + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ter_tsk bad ercd !E_NOEXS" ); + ercd = chg_pri( 2, 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "chg_pri bad ercd !E_NOEXS" ); + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rel_wai bad ercd !E_NOEXS" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sus_tsk bad ercd !E_NOEXS" ); + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rsm_tsk bad ercd !E_NOEXS" ); + ercd = frsm_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "frsm_tsk bad ercd !E_NOEXS" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "wup_tsk bad ercd !E_NOEXS" ); + ercd = can_wup( &scratch, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "can_wup bad ercd !E_NOEXS" ); + ercd = ref_tsk( &t_rtsk, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_tsk bad ercd !E_NOEXS" ); + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "del_tsk bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_tsk( 2, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_tsk bad ercd !E_PAR" ); +#endif + ercd = cre_tsk( 2, NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_tsk bad ercd !E_PAR" ); + t_ctsk.stksz = 0x40000000; + ercd = cre_tsk( 2, &t_ctsk ); + CYG_TEST_CHECK( E_NOMEM == ercd, "cre_tsk bad ercd !E_NOMEM" ); + t_ctsk.stksz = CYGNUM_UITRON_STACK_SIZE; + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); +#endif // we can test bad param error returns + + ercd = del_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_tsk bad ercd" ); + t_ctsk.task = (FP)&task4; + t_ctsk.itskpri = 9; + ercd = cre_tsk( 3, &t_ctsk ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + // check we can delete it again immediately + ercd = del_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_tsk bad ercd" ); + ercd = ref_tsk( &t_rtsk, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_tsk bad ercd !E_NOEXS" ); + t_ctsk.task = (FP)&newtask; + t_ctsk.itskpri = 1; + ercd = cre_tsk( 3, &t_ctsk ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); + ercd = sta_tsk( 3, 999 ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + // it should have run now, and exited + CYG_TEST_CHECK( 5 == intercount, "bad intercount !5" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + // and check that it will just run again... + ercd = sta_tsk( 3, 999 ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + // it should have run now, and exited + CYG_TEST_CHECK( 7 == intercount, "bad intercount !7" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + // all done. + + CYG_TEST_PASS("create/delete tasks"); + + // all done + CYG_TEST_EXIT( "All done" ); +#else // ! CYGPKG_UITRON_TASKS_CREATE_DELETE + CYG_TEST_PASS( "N/A: tasks do not have create/delete enabled" ); + CYG_TEST_EXIT( "N/A" ); +#endif // ! CYGPKG_UITRON_TASKS_CREATE_DELETE + ext_tsk(); +} + + + +void newtask( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Newtask running" ); + CYG_TEST_CHECK( 999 == arg, "Bad arg to newtask() !999" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 3 == i, "tid not 3" ); + intercount++; + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + intercount++; + // and just return +} + +void task2( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == i, "tid not 2" ); + if ( 22222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 22222" ); + + intercount++; + + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + + intercount++; + + exd_tsk(); // if we are not killed first + + intercount++; // shouldn't happen +} + +void task3( unsigned int arg ) +{ + CYG_TEST_FAIL( "How come I'm being run?" ); +} + +void task4( unsigned int arg ) +{ + CYG_TEST_FAIL( "How come I'm being run?" ); +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF test8.c diff --git a/packages/compat/uitron/current/tests/test9.c b/packages/compat/uitron/current/tests/test9.c new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/test9.c @@ -0,0 +1,480 @@ +//=========================================================================== +// +// test9.c +// +// uITRON "C" test program nine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-10-16 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough fixed memory pools */ \ + defined( CYGPKG_UITRON_MEMPOOLFIXED ) && \ + (CYGNUM_UITRON_MEMPOOLFIXED >= 3) && \ + (CYGNUM_UITRON_MEMPOOLFIXED < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough variable mempools */ \ + defined( CYGPKG_UITRON_MEMPOOLVAR ) && \ + (CYGNUM_UITRON_MEMPOOLVAR >= 3) && \ + (CYGNUM_UITRON_MEMPOOLVAR < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLVAR_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +VP vp; + +T_CMPL t_cmpl = { NULL, 0, 1000 }; +T_RMPL t_rmpl; +T_CMPF t_cmpf = { NULL, 0, 10, 100 }; +T_RMPF t_rmpf; + + +void task1( unsigned int arg ) +{ + ER ercd; + int tests = 0; + + CYG_TEST_INFO( "Task 1 running" ); + + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_mpf( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mpf bad ercd !E_ID" ); + ercd = del_mpf( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mpf bad ercd !E_ID" ); + ercd = cre_mpf( -6, &t_cmpf ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mpf bad ercd !E_ID" ); + ercd = cre_mpf( 99, &t_cmpf ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mpf bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + // [first get a valid block from it for the freeing test later] + ercd = pget_blf( &vp, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blf bad ercd" ); + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_mpf bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_mpf( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + // check it is deleted + ercd = rel_blf( 3, vp ); // vp did come from this pool + CYG_TEST_CHECK( E_NOEXS == ercd, "rel_blf bad ercd !E_NOEXS" ); + ercd = pget_blf( &vp, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blf bad ercd !E_NOEXS" ); + ercd = tget_blf( &vp, 3, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "tget_blf bad ercd !E_NOEXS" ); + ercd = get_blf( &vp, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blf bad ercd !E_NOEXS" ); + ercd = ref_mpf( &t_rmpf, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_mpf bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_mpf( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_mpf bad ercd !E_PAR" ); +#endif + ercd = cre_mpf( 3, NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_mpf bad ercd !E_PAR" ); + t_cmpf.mpfatr = 0xfff; + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_mpf bad ercd !E_RSATR" ); +#endif // we can test bad param error returns + t_cmpf.mpfatr = 0; + t_cmpf.mpfcnt = 10000; + t_cmpf.blfsz = 100; + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_NOMEM == ercd, "cre_mpf bad ercd" ); + t_cmpf.mpfcnt = 100; + t_cmpf.blfsz = 100000; + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_NOMEM == ercd, "cre_mpf bad ercd" ); + // now create it well + t_cmpf.mpfatr = 0; + t_cmpf.mpfcnt = 10; + t_cmpf.blfsz = 100; + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpf bad ercd" ); + // and check we can use it + ercd = pget_blf( &vp, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blf bad ercd" ); + ercd = tget_blf( &vp, 3, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blf bad ercd" ); + ercd = get_blf( &vp, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "get_blf bad ercd" ); + ercd = rel_blf( 3, vp ); // vp did come from new pool + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + ercd = rel_blf( 3, vp ); // vp already freed + CYG_TEST_CHECK( E_PAR == ercd, "rel_blf bad ercd !E_PAR" ); + ercd = ref_mpf( &t_rmpf, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + + // In order to wait on the pools, we must first consume all they have: + while ( E_OK == (ercd = pget_blf( &vp, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + while ( E_OK == (ercd = tget_blf( &vp, 2, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf bad ercd !E_TMOUT" ); + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = get_blf( &vp, 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "get_blf bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = tget_blf( &vp, 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "tget_blf bad ercd !E_DLT" ); + // check they are deleted + ercd = get_blf( &vp, 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blf bad ercd !E_NOEXS" ); + ercd = pget_blf( &vp, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blf bad ercd !E_NOEXS" ); + + // re-create and do it again + t_cmpf.mpfcnt = 90; + t_cmpf.blfsz = 20; + ercd = cre_mpf( 1, &t_cmpf ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpf bad ercd" ); + t_cmpf.mpfcnt = 5; + t_cmpf.blfsz = 200; + ercd = cre_mpf( 2, &t_cmpf ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpf bad ercd" ); + + // In order to wait on the pools, we must first consume all they have: + while ( E_OK == (ercd = pget_blf( &vp, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + while ( E_OK == (ercd = tget_blf( &vp, 2, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf bad ercd !E_TMOUT" ); + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = get_blf( &vp, 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "get_blf bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = tget_blf( &vp, 2, 10 ); + CYG_TEST_CHECK( E_DLT == ercd, "tget_blf bad ercd !E_DLT" ); + // check they are deleted + ercd = tget_blf( &vp, 1, 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blf bad ercd !E_NOEXS" ); + ercd = get_blf( &vp, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blf bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete fixed mempools"); +#endif // CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_mpl( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mpl bad ercd !E_ID" ); + ercd = del_mpl( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mpl bad ercd !E_ID" ); + ercd = cre_mpl( -6, &t_cmpl ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mpl bad ercd !E_ID" ); + ercd = cre_mpl( 99, &t_cmpl ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mpl bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + // [first get a valid block from it for the freeing test later] + ercd = pget_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blk bad ercd" ); + ercd = cre_mpl( 3, &t_cmpl ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_mpl bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_mpl( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + // check it is deleted + ercd = rel_blk( 3, vp ); // vp did come from this pool + CYG_TEST_CHECK( E_NOEXS == ercd, "rel_blk bad ercd !E_NOEXS" ); + ercd = pget_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blk bad ercd !E_NOEXS" ); + ercd = tget_blk( &vp, 3, 100, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "tget_blk bad ercd !E_NOEXS" ); + ercd = get_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blk bad ercd !E_NOEXS" ); + ercd = ref_mpl( &t_rmpl, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_mpl bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_mpl( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_mpl bad ercd !E_PAR" ); +#endif + ercd = cre_mpl( 3, NADR ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_mpl bad ercd !E_PAR" ); + t_cmpl.mplatr = 0xfff; + ercd = cre_mpl( 3, &t_cmpl ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_mpl bad ercd !E_RSATR" ); +#endif // we can test bad param error returns + t_cmpl.mplatr = 0; + t_cmpl.mplsz = 100000000; + ercd = cre_mpl( 3, &t_cmpl ); + CYG_TEST_CHECK( E_NOMEM == ercd, "cre_mpl bad ercd" ); + // now create it well + t_cmpl.mplatr = 0; + t_cmpl.mplsz = 1000; + ercd = cre_mpl( 3, &t_cmpl ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpl bad ercd" ); + // and check we can use it + ercd = pget_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blk bad ercd" ); + ercd = pget_blk( &vp, 3, 100000000 ); // way too large + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &vp, 3, 100, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blk bad ercd" ); + ercd = get_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "get_blk bad ercd" ); + ercd = rel_blk( 3, vp ); // vp did come from new pool + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + ercd = rel_blk( 3, vp ); // vp already freed + CYG_TEST_CHECK( E_PAR == ercd, "rel_blk bad ercd !E_PAR" ); + ercd = ref_mpl( &t_rmpl, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + + // In order to wait on the pools, we must first consume all they have: + while ( E_OK == (ercd = pget_blk( &vp, 1, 100 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + while ( E_OK == (ercd = tget_blk( &vp, 2, 100, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk bad ercd !E_TMOUT" ); + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = get_blk( &vp, 1, 200 ); + CYG_TEST_CHECK( E_DLT == ercd, "get_blk bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = tget_blk( &vp, 2, 100, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "tget_blk bad ercd !E_DLT" ); + // check they are deleted + ercd = get_blk( &vp, 1, 200 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blk bad ercd !E_NOEXS" ); + ercd = pget_blk( &vp, 2, 20 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blk bad ercd !E_NOEXS" ); + + // re-create and do it again + ercd = cre_mpl( 1, &t_cmpl ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpl bad ercd" ); + ercd = cre_mpl( 2, &t_cmpl ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpl bad ercd" ); + + // In order to wait on the pools, we must first consume all they have: + while ( E_OK == (ercd = pget_blk( &vp, 1, 20 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + while ( E_OK == (ercd = tget_blk( &vp, 2, 400, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk bad ercd !E_TMOUT" ); + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = get_blk( &vp, 1, 200 ); + CYG_TEST_CHECK( E_DLT == ercd, "get_blk bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = tget_blk( &vp, 2, 500, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "tget_blk bad ercd !E_DLT" ); + // check they are deleted + ercd = tget_blk( &vp, 1, 200, 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blk bad ercd !E_NOEXS" ); + ercd = get_blk( &vp, 2, 20 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blk bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete variable mempools"); +#endif // CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + ercd = dly_tsk( 5 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + // all done + if ( 0 == tests ) { + CYG_TEST_PASS( "N/A: no objects have create/delete enabled" ); + CYG_TEST_EXIT( "N/A" ); + } + else { + CYG_TEST_EXIT( "All done" ); + } + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == i, "tid not 2" ); + if ( 22222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 22222" ); + + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + ercd = del_mpf( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpf( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpf( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpf( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + ercd = del_mpl( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpl( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpl( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpl( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + + // we expect task2 to be killed here + CYG_TEST_FAIL( "Task 2 ran to completion!" ); +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF test9.c diff --git a/packages/compat/uitron/current/tests/testcx2.cxx b/packages/compat/uitron/current/tests/testcx2.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/testcx2.cxx @@ -0,0 +1,923 @@ +//=========================================================================== +// +// testcx2.cxx +// +// uITRON "C++" test program two +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough flag objects */ \ + defined( CYGPKG_UITRON_FLAGS ) && \ + (CYGNUM_UITRON_FLAGS >= 3) && \ + (CYGNUM_UITRON_FLAGS < 90) && \ + ( !defined(CYGPKG_UITRON_FLAGS_CREATE_DELETE) || \ + CYGNUM_UITRON_FLAGS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough message boxes */ \ + defined( CYGPKG_UITRON_MBOXES ) && \ + (CYGNUM_UITRON_MBOXES >= 3) && \ + (CYGNUM_UITRON_MBOXES < 90) && \ + ( !defined(CYGPKG_UITRON_MBOXES_CREATE_DELETE) || \ + CYGNUM_UITRON_MBOXES_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough fixed memory pools */ \ + defined( CYGPKG_UITRON_MEMPOOLFIXED ) && \ + (CYGNUM_UITRON_MEMPOOLFIXED >= 3) && \ + (CYGNUM_UITRON_MEMPOOLFIXED < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough variable mempools */ \ + defined( CYGPKG_UITRON_MEMPOOLVAR ) && \ + (CYGNUM_UITRON_MEMPOOLVAR >= 3) && \ + (CYGNUM_UITRON_MEMPOOLVAR < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLVAR_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +int intercom = 0; +int intercount = 0; +INT scratch = 0; + +extern "C" { + void task1( unsigned int arg ); + void task2( unsigned int arg ); + void task3( unsigned int arg ); + void task4( unsigned int arg ); +} + +void task1( unsigned int arg ) +{ + ER ercd; + + T_RSEM sem_info; + T_RFLG flg_info; + T_RMBX mbx_info; + T_RMPF mpf_info; + T_RMPL mpl_info; + UINT flagptn; + static char foo[] = "Test message"; + T_MSG *msgptr = (T_MSG *)foo; + T_MSG *rxptr = NULL; + VP blfptr = (VP)foo; + VP blkptr = (VP)foo; + + CYG_TEST_INFO( "Task 1 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 1 == scratch, "tid not 1" ); + + // start a lower prio task to interact with + intercom = 1; + ercd = sta_tsk( 2, 222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + // Semaphores; all the illegal argument combinations first + CYG_TEST_INFO( "Testing semaphore ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = sig_sem( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "sig_sem bad ercd !E_ID" ); + ercd = sig_sem( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "sig_sem bad ercd !E_ID" ); + ercd = wai_sem( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "wai_sem bad ercd !E_ID" ); + ercd = wai_sem( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "wai_sem bad ercd !E_ID" ); + ercd = preq_sem( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "preq_sem bad ercd !E_ID" ); + ercd = preq_sem( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "preq_sem bad ercd !E_ID" ); + ercd = twai_sem( -6, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "twai_sem bad ercd !E_ID" ); + ercd = twai_sem( 99, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "twai_sem bad ercd !E_ID" ); + ercd = twai_sem( 2, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_sem bad ercd !E_PAR" ); + ercd = ref_sem( &sem_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_sem bad ercd !E_ID" ); + ercd = ref_sem( &sem_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_sem bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_sem( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_sem bad ercd !E_PAR" ); +#endif + CYG_TEST_PASS( "bad calls: sig_sem, [t]wai_sem, preq_sem, ref_sem" ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = preq_sem( 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "preq_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = wai_sem( 2 ); + CYG_TEST_CHECK( E_CTX == ercd, "wai_sem bad ercd !E_CTX" ); + ercd = twai_sem( 2, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "twai_sem bad ercd !E_CTX" ); + ercd = twai_sem( 2, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "twai_sem(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = twai_sem( 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem(POL) bad ercd !E_TMOUT" ); + ercd = preq_sem( 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "preq_sem bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = preq_sem( 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "preq_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: wai_sem, twai_sem with dis_dsp" ); + + // check ref_sem with various states + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 1 == sem_info.semcnt, "semcnt should be 1" ); + ercd = preq_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 2 == sem_info.semcnt, "semcnt should be 2" ); + ercd = wai_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 1 == sem_info.semcnt, "semcnt should be 1" ); + ercd = twai_sem( 2, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + intercom = 0; + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 != sem_info.wtsk, "sem.wtsk should be non0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be non0" ); +#if 1 + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); +#else // old, non-uITRON semantics + CYG_TEST_CHECK( 1 == sem_info.semcnt, "semcnt should be 1" ); +#endif + ercd = dly_tsk( 10 ); // let task 2 pick up the signal + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_sem( &sem_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + CYG_TEST_CHECK( 0 == sem_info.wtsk, "sem.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == sem_info.semcnt, "semcnt should be 0" ); + CYG_TEST_PASS( "good calls: sig_sem, [t]wai,preq_sem with ref_sem" ); + + // Flags; all the illegal argument combinations first + CYG_TEST_INFO( "Testing flag ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = set_flg( -6, 1 ); + CYG_TEST_CHECK( E_ID == ercd, "set_flg bad ercd !E_ID" ); + ercd = set_flg( 99, 1 ); + CYG_TEST_CHECK( E_ID == ercd, "set_flg bad ercd !E_ID" ); + ercd = clr_flg( -6, 1 ); + CYG_TEST_CHECK( E_ID == ercd, "clr_flg bad ercd !E_ID" ); + ercd = clr_flg( 99, 1 ); + CYG_TEST_CHECK( E_ID == ercd, "sig_flg bad ercd !E_ID" ); + ercd = wai_flg( &flagptn, -6, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_ID == ercd, "wai_flg bad ercd !E_ID" ); + ercd = wai_flg( &flagptn, 99, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_ID == ercd, "wai_flg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = wai_flg( NULL, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "wai_flg bad ercd !E_PAR" ); +#endif + ercd = wai_flg( &flagptn, 2, 7, 34657 ); + CYG_TEST_CHECK( E_PAR == ercd, "wai_flg bad ercd !E_PAR" ); + ercd = wai_flg( &flagptn, 2, 0, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "wai_flg bad ercd !E_PAR" ); + ercd = pol_flg( &flagptn, -6, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_ID == ercd, "pol_flg bad ercd !E_ID" ); + ercd = pol_flg( &flagptn, 99, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_ID == ercd, "pol_flg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = pol_flg( NULL, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "pol_flg bad ercd !E_PAR" ); +#endif + ercd = pol_flg( &flagptn, 2, 7, 34657 ); + CYG_TEST_CHECK( E_PAR == ercd, "pol_flg bad ercd !E_PAR" ); + ercd = pol_flg( &flagptn, 2, 0, TWF_ANDW ); + CYG_TEST_CHECK( E_PAR == ercd, "pol_flg bad ercd !E_PAR" ); + ercd = twai_flg( &flagptn, -6, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "twai_flg bad ercd !E_ID" ); + ercd = twai_flg( &flagptn, 99, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "twai_flg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = twai_flg( NULL, 2, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_flg bad ercd !E_PAR" ); +#endif + ercd = twai_flg( &flagptn, 2, 7, 34657, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_flg bad ercd !E_PAR" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_flg bad ercd !E_PAR" ); + ercd = twai_flg( &flagptn, 2, 0, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "twai_flg bad ercd !E_PAR" ); + ercd = ref_flg( &flg_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_flg bad ercd !E_ID" ); + ercd = ref_flg( &flg_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_flg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_flg( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_flg bad ercd !E_PAR" ); +#endif + CYG_TEST_PASS( "bad calls: set_flg, clr_flg, [t]wai,pol_flg, ref_flg" ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = pol_flg( &flagptn, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = wai_flg( &flagptn, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_CTX == ercd, "wai_flg bad ercd !E_CTX" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "twai_flg bad ercd !E_CTX" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "twai_flg(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg(POL) bad ercd !E_TMOUT" ); + ercd = pol_flg( &flagptn, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pol_flg( &flagptn, 2, 7, TWF_ANDW ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &flagptn, 2, 7, TWF_ANDW, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: wai_flg, twai_flg with dis_dsp" ); + + // check ref_flg with various states + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 == flg_info.wtsk, "flg.wtsk should be non0" ); + CYG_TEST_CHECK( 0 == flg_info.flgptn, "flgptn should be 0" ); + intercom = 0; + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 != flg_info.wtsk, "flg.wtsk should be non0" ); + CYG_TEST_CHECK( 0 == flg_info.flgptn, "flgptn should be 0" ); + ercd = set_flg( 2, 0x5555 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_flg bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 != flg_info.wtsk, "flg.wtsk should be non0" ); + CYG_TEST_CHECK( 0x5555 == flg_info.flgptn, "flgptn should be 0x5555" ); + ercd = clr_flg( 2, 0xF0F0 ); + CYG_TEST_CHECK( E_OK == ercd, "clr_flg bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 != flg_info.wtsk, "flg.wtsk should be non0" ); + CYG_TEST_CHECK( 0x5050 == flg_info.flgptn, "flgptn should be 0x5050" ); + ercd = set_flg( 2, 0xFFFF ); + CYG_TEST_CHECK( E_OK == ercd, "sig_flg bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_flg( &flg_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 == flg_info.wtsk, "flg.wtsk should be 0" ); + CYG_TEST_CHECK( 0xFFFF == flg_info.flgptn, "flgptn should be 0xFFFF" ); + CYG_TEST_PASS( "good calls: clr_flg, set_flg, wai_flg with ref_flg" ); + + // Mailboxes; all the illegal argument combinations first + CYG_TEST_INFO( "Testing mailbox ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = snd_msg( -6, msgptr ); + CYG_TEST_CHECK( E_ID == ercd, "snd_msg bad ercd !E_ID" ); + ercd = snd_msg( 99, msgptr ); + CYG_TEST_CHECK( E_ID == ercd, "snd_msg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = snd_msg( 2, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "snd_msg bad ercd !E_PAR" ); +#endif + ercd = rcv_msg( &rxptr, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "rcv_msg bad ercd !E_ID" ); + ercd = rcv_msg( &rxptr, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "rcv_msg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = rcv_msg( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "rcv_msg bad ercd !E_PAR" ); +#endif + ercd = prcv_msg( &rxptr, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "prcv_msg bad ercd !E_ID" ); + ercd = prcv_msg( &rxptr, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "prcv_msg bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = prcv_msg( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "prcv_msg bad ercd !E_PAR" ); +#endif + ercd = trcv_msg( &rxptr, -6, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "trcv_msg bad ercd !E_ID" ); + ercd = trcv_msg( &rxptr, 99, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "trcv_msg bad ercd !E_ID" ); + ercd = trcv_msg( &rxptr, 2, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "trcv_msg bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = trcv_msg( NULL, 2, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "trcv_msg bad ercd !E_PAR" ); +#endif + ercd = ref_mbx( &mbx_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mbx bad ercd !E_ID" ); + ercd = ref_mbx( &mbx_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mbx bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_mbx( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_mbx bad ercd !E_PAR" ); +#endif + CYG_TEST_PASS( "bad calls: snd_msg, [pt]rcv_msg, ref_mbx" ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = prcv_msg( &rxptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "prcv_msg bad ercd !E_TMOUT" ); + ercd = trcv_msg( &rxptr, 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg bad ercd !E_TMOUT" ); + ercd = trcv_msg( &rxptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rcv_msg( &rxptr, 2 ); + CYG_TEST_CHECK( E_CTX == ercd, "rcv_msg bad ercd !E_CTX" ); + ercd = trcv_msg( &rxptr, 2, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "trcv_msg bad ercd !E_CTX" ); + ercd = trcv_msg( &rxptr, 2, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "trcv_msg(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = trcv_msg( &rxptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg(POL) bad ercd !E_TMOUT" ); + ercd = prcv_msg( &rxptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "prcv_msg bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = prcv_msg( &rxptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "prcv_msg bad ercd !E_TMOUT" ); + ercd = trcv_msg( &rxptr, 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg bad ercd !E_TMOUT" ); + ercd = trcv_msg( &rxptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: rcv_msg, trcv_msg with dis_dsp" ); + + // check ref_mbx with various states + ercd = ref_mbx( &mbx_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + CYG_TEST_CHECK( 0 == mbx_info.wtsk, "mbx.wtsk should be 0" ); + CYG_TEST_CHECK( NADR == mbx_info.pk_msg, "mbx peek should be NADR" ); + intercom = 0; + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_mbx( &mbx_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + CYG_TEST_CHECK( 0 != mbx_info.wtsk, "mbx.wtsk should be non0" ); + CYG_TEST_CHECK( NADR == mbx_info.pk_msg, "mbx peek should be NADR" ); + ercd = snd_msg( 2, msgptr ); + CYG_TEST_CHECK( E_OK == ercd, "snd_msg bad ercd" ); + ercd = ref_mbx( &mbx_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + CYG_TEST_CHECK( 0 == mbx_info.wtsk, "mbx.wtsk should be 0" ); +#if 1 + CYG_TEST_CHECK( NADR == mbx_info.pk_msg, "mbx peek should be NADR" ); +#else // old, non-uITRON semantics + CYG_TEST_CHECK( msgptr == mbx_info.pk_msg, "mbx peek should be msgptr" ); +#endif + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_mbx( &mbx_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + CYG_TEST_CHECK( 0 == mbx_info.wtsk, "mbx.wtsk should be 0" ); + CYG_TEST_CHECK( NADR == mbx_info.pk_msg, "mbx peek should be NADR" ); + // fill the message box, expect E_QOVR + for ( scratch = 0 ; scratch < 100 ; scratch++ ) { + if ( E_OK != ( ercd = snd_msg( 2, msgptr ) ) ) + break; + } + CYG_TEST_CHECK( (100 == scratch) || (E_QOVR == ercd), + "snd_msg bad ercd !E_QOVR/E_OK" ); + // empty the message box, expect the right number and E_TMOUT + for ( ; 1 ; scratch-- ) { + if ( E_OK != ( ercd = prcv_msg( &rxptr, 2 ) ) ) + break; + } + CYG_TEST_CHECK( 0 == scratch, "rcv_msg count bad scratch!=0" ); + CYG_TEST_CHECK( E_TMOUT == ercd, "rcv_msg bad ercd !E_TMOUT" ); + + CYG_TEST_PASS( "good calls: rcv_msg, snd_msg with ref_msg" ); + + // Fixed block memory pools: all the illegal argument combinations first + CYG_TEST_INFO( "Testing fixed block memory ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rel_blf( -6, blfptr ); + CYG_TEST_CHECK( E_ID == ercd, "rel_blf bad ercd !E_ID" ); + ercd = rel_blf( 99, blfptr ); + CYG_TEST_CHECK( E_ID == ercd, "rel_blf bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = rel_blf( 2, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "rel_blf bad ercd !E_PAR" ); +#endif +#endif // we can test bad param error returns + ercd = rel_blf( 2, blfptr ); // it did not come from a mpf + CYG_TEST_CHECK( E_PAR == ercd, "rel_blf bad ercd !E_PAR" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blf( &blfptr, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "get_blf bad ercd !E_ID" ); + ercd = get_blf( &blfptr, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "get_blf bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = get_blf( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "get_blf bad ercd !E_PAR" ); +#endif + ercd = pget_blf( &blfptr, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "pget_blf bad ercd !E_ID" ); + ercd = pget_blf( &blfptr, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "pget_blf bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = pget_blf( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "pget_blf bad ercd !E_PAR" ); +#endif + ercd = tget_blf( &blfptr, -6, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "tget_blf bad ercd !E_ID" ); + ercd = tget_blf( &blfptr, 99, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "tget_blf bad ercd !E_ID" ); + ercd = tget_blf( &blfptr, 2, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blf bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = tget_blf( NULL, 2, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blf bad ercd !E_PAR" ); +#endif + ercd = ref_mpf( &mpf_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mpf bad ercd !E_ID" ); + ercd = ref_mpf( &mpf_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mpf bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_mpf( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_mpf bad ercd !E_PAR" ); +#endif + CYG_TEST_PASS( "bad calls: rel_blf, [pt]get_blf, ref_mpf " ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = pget_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blf bad ercd" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blf bad ercd" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_CTX == ercd, "get_blf bad ercd !E_CTX" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blf bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pget_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blf bad ercd" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blf bad ercd" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + // consume the whole thing then do it again, expecting E_TMOUT + while ( E_OK == (ercd = pget_blf( &blfptr, 2 ) ) ) + continue; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + ercd = pget_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf bad ercd !E_TMOUT" ); + ercd = tget_blf( &blfptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_CTX == ercd, "get_blf bad ercd !E_CTX" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blf bad ercd !E_CTX" ); + ercd = tget_blf( &blfptr, 2, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blf(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = tget_blf( &blfptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf(POL) bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pget_blf( &blfptr, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + ercd = tget_blf( &blfptr, 2, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + ercd = tget_blf( &blfptr, 2, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: rel_blf, [pt]get_blf with ena_dsp" ); + + // check ref_mpf with various states + ercd = ref_mpf( &mpf_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + CYG_TEST_CHECK( 0 == mpf_info.wtsk, "mpf.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == mpf_info.frbcnt, "mpf.frbcnt should be 0" ); + intercom = 0; + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_mpf( &mpf_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + CYG_TEST_CHECK( 0 != mpf_info.wtsk, "mpf.wtsk should be non0" ); + CYG_TEST_CHECK( 0 == mpf_info.frbcnt, "mpf.frbcnt should be 0" ); + ercd = rel_blf( 2, blfptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + ercd = ref_mpf( &mpf_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + CYG_TEST_CHECK( 0 == mpf_info.wtsk, "mpf.wtsk should be 0" ); +#if 1 + CYG_TEST_CHECK( 0 == mpf_info.frbcnt, "mpf.frbcnt should be 0" ); +#else // old, non-uITRON semantics + CYG_TEST_CHECK( 0 != mpf_info.frbcnt, "mpf.frbcnt should be non0" ); +#endif + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_mpf( &mpf_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + CYG_TEST_CHECK( 0 == mpf_info.wtsk, "mpf.wtsk should be 0" ); + CYG_TEST_CHECK( 0 == mpf_info.frbcnt, "mpf.frbcnt should be 0" ); + CYG_TEST_PASS( "good calls: rel_blf, get_blf with ref_mpf" ); + + // Variable block memory pools; illegal arguments + CYG_TEST_INFO( "Testing variable block memory ops" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rel_blk( -6, blkptr ); + CYG_TEST_CHECK( E_ID == ercd, "rel_blk bad ercd !E_ID" ); + ercd = rel_blk( 99, blkptr ); + CYG_TEST_CHECK( E_ID == ercd, "rel_blk bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = rel_blk( 2, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "rel_blk bad ercd !E_PAR" ); +#endif +#endif // we can test bad param error returns + ercd = rel_blk( 2, blkptr ); // it did not come from a mpl + CYG_TEST_CHECK( E_PAR == ercd, "rel_blk bad ercd !E_PAR" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blk( &blkptr, -6, 100 ); + CYG_TEST_CHECK( E_ID == ercd, "get_blk bad ercd !E_ID" ); + ercd = get_blk( &blkptr, 99, 100 ); + CYG_TEST_CHECK( E_ID == ercd, "get_blk bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = get_blk( NULL, 2, 100 ); + CYG_TEST_CHECK( E_PAR == ercd, "get_blk bad ercd !E_PAR" ); +#endif + ercd = pget_blk( &blkptr, -6, 100 ); + CYG_TEST_CHECK( E_ID == ercd, "pget_blk bad ercd !E_ID" ); + ercd = pget_blk( &blkptr, 99, 100 ); + CYG_TEST_CHECK( E_ID == ercd, "pget_blk bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = pget_blk( NULL, 2, 100 ); + CYG_TEST_CHECK( E_PAR == ercd, "pget_blk bad ercd !E_PAR" ); +#endif + ercd = tget_blk( &blkptr, -6, 100, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "tget_blk bad ercd !E_ID" ); + ercd = tget_blk( &blkptr, 99, 100, 10 ); + CYG_TEST_CHECK( E_ID == ercd, "tget_blk bad ercd !E_ID" ); + ercd = tget_blk( &blkptr, 2, 100, -999 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blk bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = tget_blk( NULL, 2, 100, 10 ); + CYG_TEST_CHECK( E_PAR == ercd, "tget_blk bad ercd !E_PAR" ); +#endif + ercd = ref_mpl( &mpl_info, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mpl bad ercd !E_ID" ); + ercd = ref_mpl( &mpl_info, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_mpl bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_mpl( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_mpl bad ercd !E_PAR" ); +#endif + CYG_TEST_PASS( "bad calls: rel_blk, [pt]get_blk, ref_mpl " ); +#endif // we can test bad param error returns + + // check the waitable functions versus dispatch disable + ercd = pget_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blk bad ercd" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blk bad ercd" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_CTX == ercd, "get_blk bad ercd !E_CTX" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blk bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pget_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blk bad ercd" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blk bad ercd" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + // consume the whole thing then do it again, expecting E_TMOUT + while ( E_OK == (ercd = pget_blk( &blkptr, 2, 100 ) ) ) + continue; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = pget_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &blkptr, 2, 100, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk(POL) bad ercd !E_TMOUT" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = get_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_CTX == ercd, "get_blk bad ercd !E_CTX" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blk bad ercd !E_CTX" ); + ercd = tget_blk( &blkptr, 2, 100, TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "tget_blk(FEVR) bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = tget_blk( &blkptr, 2, 100, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk(POL) bad ercd !E_TMOUT" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = pget_blk( &blkptr, 2, 100 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &blkptr, 2, 100, 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &blkptr, 2, 100, TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk(POL) bad ercd !E_TMOUT" ); + CYG_TEST_PASS( "bad calls: rel_blk, [pt]get_blk with ena_dsp" ); + + // check ref_mpl with various states + ercd = ref_mpl( &mpl_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + CYG_TEST_CHECK( 0 == mpl_info.wtsk, "mpl.wtsk should be 0" ); + CYG_TEST_CHECK( mpl_info.maxsz <= mpl_info.frsz, + "mpl.maxsz not < mpl.frsz" ); + intercom = 0; + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + intercom = 1; + ercd = ref_mpl( &mpl_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + CYG_TEST_CHECK( 0 != mpl_info.wtsk, "mpl.wtsk should be non0" ); + ercd = rel_blk( 2, blkptr ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + ercd = ref_mpl( &mpl_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + CYG_TEST_CHECK( 0 == mpl_info.wtsk, "mpl.wtsk should be 0" ); + ercd = dly_tsk( 10 ); // let task 2 start waiting + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_mpl( &mpl_info, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + CYG_TEST_CHECK( 0 == mpl_info.wtsk, "mpl.wtsk should be 0" ); + CYG_TEST_PASS( "good calls: rel_blk, get_blk with ref_mpl" ); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + T_MSG *msgp = NULL; + UINT flgval = 0; + VP blfp = NULL; + VP blkp = NULL; + + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == scratch, "tid not 2" ); + if ( 222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 222" ); + + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = wai_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = wai_flg( &flgval, 2, 99, TWF_ANDW ); + CYG_TEST_CHECK( E_OK == ercd, "wai_flg bad ercd" ); + CYG_TEST_CHECK( 99 == (99 & flgval), "flg value no good" ); + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = rcv_msg( &msgp, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rcv_msg bad ercd" ); + CYG_TEST_CHECK( NULL != msgp, "no msg received" ); + CYG_TEST_CHECK( NADR != msgp, "no msg received" ); + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = get_blf( &blfp, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "get_blf bad ercd" ); + CYG_TEST_CHECK( NULL != blfp, "no blf allocated" ); + CYG_TEST_CHECK( NADR != blfp, "no blf allocated" ); + while ( intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + } + ercd = get_blk( &blkp, 2, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "get_blk bad ercd" ); + CYG_TEST_CHECK( NULL != blkp, "no blk allocated" ); + CYG_TEST_CHECK( NADR != blkp, "no blk allocated" ); + + ext_tsk(); + CYG_TEST_FAIL( "Task 2 failed to exit" ); +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK " +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF testcx2.cxx diff --git a/packages/compat/uitron/current/tests/testcx3.cxx b/packages/compat/uitron/current/tests/testcx3.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/testcx3.cxx @@ -0,0 +1,252 @@ +//=========================================================================== +// +// testcx3.cxx +// +// uITRON "C++" test program three +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +int t2done = 0; +int t3done = 0; +int t4done = 0; + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +extern "C" { + void task1( unsigned int arg ); + void task2( unsigned int arg ); + void task3( unsigned int arg ); + void task4( unsigned int arg ); +} + +void task1( unsigned int arg ) +{ + ER ercd; + INT scratch; + + CYG_TEST_INFO( "Task 1 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 1 == scratch, "tid not 1" ); + + // start lower prio tasks to interact with + ercd = sta_tsk( 2, 222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = sta_tsk( 3, 333 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = sta_tsk( 4, 444 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + + // now start the test + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + CYG_TEST_INFO( "T1 awoken" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + CYG_TEST_INFO( "T1 signalled" ); + + // let the others complete, so we get the status back + ercd = dly_tsk( 50 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + CYG_TEST_CHECK( t2done, "t2 not done" ); + CYG_TEST_CHECK( t3done, "t3 not done" ); + CYG_TEST_CHECK( t4done, "t4 not done" ); + + CYG_TEST_PASS( "Immediate-dispatch producer/consumer test OK" ); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + INT scratch; + + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == scratch, "tid not 2" ); + if ( 222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 222" ); + + // now start the test + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + CYG_TEST_INFO( "T2 awoken" ); + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = wup_tsk( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + + CYG_TEST_INFO( "T2 completing" ); + t2done++; + + ercd = slp_tsk(); + CYG_TEST_FAIL( "Task 2 sleep came back" ); +} + +void task3( unsigned int arg ) +{ + ER ercd; + INT scratch; + + CYG_TEST_INFO( "Task 3 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 3 == scratch, "tid not 3" ); + if ( 333 != arg ) + CYG_TEST_FAIL( "Task 3 arg not 333" ); + + // now start the test + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + CYG_TEST_INFO( "T3 awoken" ); + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + + CYG_TEST_INFO( "T3 completing" ); + t3done++; + + ercd = slp_tsk(); + CYG_TEST_FAIL( "Task 3 sleep came back" ); +} + +void task4( unsigned int arg ) +{ + ER ercd; + INT scratch; + + CYG_TEST_INFO( "Task 4 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 4 == scratch, "tid not 4" ); + if ( 444 != arg ) + CYG_TEST_FAIL( "Task 4 arg not 444" ); + + // now start the test + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + + CYG_TEST_INFO( "T4 completing" ); + t4done++; + + ercd = slp_tsk(); + CYG_TEST_FAIL( "Task 4 sleep came back" ); +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF testcx3.cxx diff --git a/packages/compat/uitron/current/tests/testcx4.cxx b/packages/compat/uitron/current/tests/testcx4.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/testcx4.cxx @@ -0,0 +1,387 @@ +//=========================================================================== +// +// testcx4.cxx +// +// uITRON "C++" test program four +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-12 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough cyclic handlers */ \ + defined( CYGPKG_UITRON_CYCLICS ) && \ + (CYGNUM_UITRON_CYCLICS >= 3) && \ + (CYGNUM_UITRON_CYCLICS < 90) && \ + \ + /* test configuration for enough alarm handlers */ \ + defined( CYGPKG_UITRON_ALARMS ) && \ + (CYGNUM_UITRON_ALARMS >= 3) && \ + (CYGNUM_UITRON_ALARMS < 90) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercount = 0; +INT scratch; + +void hand1(void) +{ + CYG_TEST_INFO("Handler 1 called"); + intercount++; +} + +void hand2(void) +{ + CYG_TEST_CHECK( 2 == intercount, "handler out of sync" ); + CYG_TEST_INFO("Handler 2 called"); + intercount++; +} + +extern "C" { + void task1( unsigned int arg ); + void task2( unsigned int arg ); + void task3( unsigned int arg ); + void task4( unsigned int arg ); +} + +void task1( unsigned int arg ) +{ + ER ercd; + + T_DCYC dcyc; + T_DALM dalm; + T_RCYC rcyc; + T_RALM ralm; + + static char foo[] = "Test message"; + VP info = (VP)foo; + + CYG_TEST_INFO( "Task 1 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 1 == scratch, "tid not 1" ); + + dcyc.exinf = (VP)info; + dcyc.cycatr = TA_HLNG; + dcyc.cychdr = (FP)&hand1; + dcyc.cycact = TCY_INI; // bad + dcyc.cyctim = 2; + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_cyc(3, &dcyc); + CYG_TEST_CHECK( E_PAR == ercd, "def_cyc bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + dcyc.cycact = TCY_OFF; // make good + dcyc.cyctim = 0; // bad + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_cyc(3, &dcyc); + CYG_TEST_CHECK( E_PAR == ercd, "def_cyc bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + dcyc.cyctim = 1; // make good + + ercd = def_cyc(3, &dcyc); + CYG_TEST_CHECK( E_OK == ercd, "def_cyc bad ercd" ); + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_cyc(-6, &dcyc); + CYG_TEST_CHECK( E_PAR == ercd, "def_cyc bad ercd !E_PAR" ); + ercd = def_cyc(99, &dcyc); + CYG_TEST_CHECK( E_PAR == ercd, "def_cyc bad ercd !E_PAR" ); + + ercd = act_cyc(-6, TCY_OFF); + CYG_TEST_CHECK( E_PAR == ercd, "act_cyc bad ercd !E_PAR" ); + ercd = act_cyc(99, TCY_OFF); + CYG_TEST_CHECK( E_PAR == ercd, "act_cyc bad ercd !E_PAR" ); + ercd = act_cyc( 3, ~0); + CYG_TEST_CHECK( E_PAR == ercd, "act_cyc bad ercd !E_PAR" ); + + ercd = ref_cyc(&rcyc, -6); + CYG_TEST_CHECK( E_PAR == ercd, "ref_cyc bad ercd !E_PAR" ); + ercd = ref_cyc(&rcyc, 99); + CYG_TEST_CHECK( E_PAR == ercd, "ref_cyc bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_cyc(NULL, 3); + CYG_TEST_CHECK( E_PAR == ercd, "ref_cyc bad ercd !E_PAR" ); +#endif +#endif // we can test bad param error returns + + ercd = def_cyc(3, (T_DCYC *)NADR); + CYG_TEST_CHECK( E_OK == ercd, "def_cyc bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_cyc bad ercd !E_NOEXS" ); +#endif // we can test bad param error returns + + CYG_TEST_PASS( "bad calls: def_cyc, act_cyc, ref_cyc" ); + + dalm.exinf = (VP)info; + dalm.almatr = TA_HLNG; + dalm.almhdr = (FP)&hand2; + dalm.tmmode = ~0; // bad + dalm.almtim = 20; + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_alm(3, &dalm); + CYG_TEST_CHECK( E_PAR == ercd, "def_alm bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + dalm.tmmode = TTM_REL; // make good + dalm.almtim = 0; // bad + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = def_alm(3, &dalm); + CYG_TEST_CHECK( E_PAR == ercd, "def_alm bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + dalm.almtim = 1000; // make good + + ercd = def_alm(3, &dalm); + CYG_TEST_CHECK( E_OK == ercd, "def_alm bad ercd" ); + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = ref_alm(&ralm, -6); + CYG_TEST_CHECK( E_PAR == ercd, "ref_alm bad ercd !E_PAR" ); + ercd = ref_alm(&ralm, 99); + CYG_TEST_CHECK( E_PAR == ercd, "ref_alm bad ercd !E_PAR" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_alm(NULL, 3); + CYG_TEST_CHECK( E_PAR == ercd, "ref_alm bad ercd !E_PAR" ); +#endif + +#endif // we can test bad param error returns + ercd = def_alm(3, (T_DALM *)NADR); + CYG_TEST_CHECK( E_OK == ercd, "def_cyc bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = ref_alm(&ralm, 3); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_cyc bad ercd !E_NOEXS" ); +#endif // we can test bad param error returns + + CYG_TEST_PASS( "bad calls: def_alm, act_alm, ref_alm" ); + + dcyc.exinf = (VP)info; + dcyc.cycatr = TA_HLNG; + dcyc.cychdr = (FP)&hand1; + dcyc.cycact = TCY_ON; + dcyc.cyctim = 50; + + ercd = def_cyc(3, &dcyc); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 45 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 50, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_ON == rcyc.cycact, "rcyc.cycact should be TCY_ON" ); + ercd = act_cyc(3, TCY_OFF); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 45 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 50, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_OFF == rcyc.cycact, "rcyc.cycact should be TCY_OFF" ); + ercd = act_cyc(3, TCY_ON); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc bad ercd" ); + + CYG_TEST_PASS("good calls: def_cyc, act_cyc, ref_cyc"); + + dalm.exinf = (VP)info; + dalm.almatr = TA_HLNG; + dalm.almhdr = (FP)&hand2; + dalm.tmmode = TTM_REL; + dalm.almtim = 120; + + ercd = def_alm(3, &dalm); + CYG_TEST_CHECK( E_OK == ercd, "def_alm bad ercd" ); + ercd = ref_alm(&ralm, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_alm bad ercd" ); + CYG_TEST_CHECK( info == ralm.exinf, "ralm.exinf should be info" ); + CYG_TEST_CHECK( 115 < ralm.lfttim, "ralm.lfttim too small" ); + CYG_TEST_CHECK( ralm.lfttim <= 120, "ralm.lfttim too big" ); + + // Expect handlers to be called at approximate times + // time intercount + // 50 hand1 0 + // 100 hand1 1 + // 120 hand2 2 + // 150 hand1 3 + + ercd = dly_tsk(160); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 4 == intercount, "handlers not both called" ); + + ercd = act_cyc(3, TCY_OFF); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(off) bad ercd" ); + + ercd = dly_tsk(60); // enough for at least one tick + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 4 == intercount, "cyclic not disabled" ); + + // approx time now 220, so we expect a cycle in about 30 ticks + ercd = act_cyc(3, TCY_ON); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(on) bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 25 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 35, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_ON == rcyc.cycact, "rcyc.cycact should be TCY_ON" ); + + // now resynchronize with right now: + ercd = act_cyc(3, TCY_ON|TCY_INI); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(on) bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 45 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 50, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_ON == rcyc.cycact, "rcyc.cycact should be TCY_ON" ); + + // wait a bit and check that time marches on, or even down + ercd = dly_tsk(10); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 35 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 45, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_ON == rcyc.cycact, "rcyc.cycact should be TCY_ON" ); + + // now turn it off and re-synch with right now: + ercd = act_cyc(3, TCY_OFF|TCY_INI); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(on) bad ercd" ); + ercd = ref_cyc(&rcyc, 3); + CYG_TEST_CHECK( E_OK == ercd, "ref_cyc bad ercd" ); + CYG_TEST_CHECK( info == rcyc.exinf, "rcyc.exinf should be info" ); + CYG_TEST_CHECK( 45 < rcyc.lfttim, "rcyc.lfttim too small" ); + CYG_TEST_CHECK( rcyc.lfttim <= 50, "rcyc.lfttim too big" ); + CYG_TEST_CHECK( TCY_OFF == rcyc.cycact, "rcyc.cycact should be TCY_OFF" ); + + ercd = act_cyc(3, TCY_OFF); + CYG_TEST_CHECK( E_OK == ercd, "act_cyc(on) bad ercd" ); + + CYG_TEST_PASS("good calls: def_cyc, act_cyc, ref_cyc, def_alm, ref_alm"); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF testcx4.cxx diff --git a/packages/compat/uitron/current/tests/testcx5.cxx b/packages/compat/uitron/current/tests/testcx5.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/testcx5.cxx @@ -0,0 +1,353 @@ +//=========================================================================== +// +// testcx5.cxx +// +// uITRON "C++" test program five +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-12 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough flag objects */ \ + defined( CYGPKG_UITRON_FLAGS ) && \ + (CYGNUM_UITRON_FLAGS >= 3) && \ + (CYGNUM_UITRON_FLAGS < 90) && \ + ( !defined(CYGPKG_UITRON_FLAGS_CREATE_DELETE) || \ + CYGNUM_UITRON_FLAGS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough message boxes */ \ + defined( CYGPKG_UITRON_MBOXES ) && \ + (CYGNUM_UITRON_MBOXES >= 3) && \ + (CYGNUM_UITRON_MBOXES < 90) && \ + ( !defined(CYGPKG_UITRON_MBOXES_CREATE_DELETE) || \ + CYGNUM_UITRON_MBOXES_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough fixed memory pools */ \ + defined( CYGPKG_UITRON_MEMPOOLFIXED ) && \ + (CYGNUM_UITRON_MEMPOOLFIXED >= 3) && \ + (CYGNUM_UITRON_MEMPOOLFIXED < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough variable mempools */ \ + defined( CYGPKG_UITRON_MEMPOOLVAR ) && \ + (CYGNUM_UITRON_MEMPOOLVAR >= 3) && \ + (CYGNUM_UITRON_MEMPOOLVAR < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLVAR_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercount = 0; + +UINT scratch; +T_MSG *t_msg; +VP vp; + + +extern "C" { + void task1( unsigned int arg ); + void task2( unsigned int arg ); + void task3( unsigned int arg ); + void task4( unsigned int arg ); +} + + +void task1( unsigned int arg ) +{ + ER ercd; + int i; + T_RSYS rsys; + + CYG_TEST_INFO( "Task 1 running" ); + + // check initial state + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_TSK == rsys.sysstat, "system state not TSS_TSK" ); + // disable intrs and check state + ercd = loc_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "loc_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_LOC == rsys.sysstat, "system state not TSS_LOC" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // try an illegal op + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "dly_tsk bad ercd !E_CTX" ); +#endif // CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // enable intrs and check state and a legal sleep + ercd = unl_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "unl_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_TSK == rsys.sysstat, "system state not TSS_TSK" ); + ercd = dly_tsk( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // disable intrs and try scheduler illegal ops + ercd = loc_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "loc_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_LOC == rsys.sysstat, "system state not TSS_LOC" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = dis_dsp(); + CYG_TEST_CHECK( E_CTX == ercd, "dis_dsp bad ercd !E_CTX" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_CTX == ercd, "ena_dsp bad ercd !E_CTX" ); +#endif // CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // enable again and check state + ercd = unl_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "unl_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_TSK == rsys.sysstat, "system state not TSS_TSK" ); + // disable the scheduler and check state + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_DDSP == rsys.sysstat, "system state not TSS_DDSP" ); + // disable intrs and check state + ercd = loc_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "loc_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_LOC == rsys.sysstat, "system state not TSS_LOC" ); + // then unlock and check state + ercd = unl_cpu(); + CYG_TEST_CHECK( E_OK == ercd, "unl_cpu bad ercd" ); + ercd = ref_sys( &rsys ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sys bad ercd" ); + CYG_TEST_CHECK( TSS_TSK == rsys.sysstat, "system state not TSS_TSK" ); + + CYG_TEST_PASS( "Interrupt dis/enabling and interactions" ); + + // and now we can do the rest of the test + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai bad ercd !E_OBJ" ); + ercd = rel_wai( 1 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai(me) bad ercd !E_OBJ" ); + ercd = rel_wai( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "rel_wai bad ercd !E_ID" ); + ercd = rel_wai( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "rel_wai bad ercd !E_ID" ); +#endif // we can test bad param error returns + + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai bad ercd !E_OBJ" ); + ercd = rel_wai( 1 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai(me) bad ercd !E_OBJ" ); +#endif // we can test bad param error returns + + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "wai_sem bad ercd !E_RLWAI" ); + + ercd = twai_sem( 1, 20 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "twai_sem bad ercd !E_RLWAI" ); + + ercd = wai_flg( &scratch, 1, 9999, 0 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "wai_flg bad ercd !E_RLWAI" ); + + ercd = twai_flg( &scratch, 1, 9999, 0, 10 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "twai_flg bad ercd !E_RLWAI" ); + + ercd = rcv_msg( &t_msg, 1 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "rcv_msg bad ercd !E_RLWAI" ); + + ercd = trcv_msg( &t_msg, 1, 10 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "trcv_msg bad ercd !E_RLWAI" ); + + // these are loops so as to consume the whole of the mempool + // in order to wait at the end + for ( i = 0; i < 10; i++ ) + if ( E_OK != (ercd = get_blf( &vp, 3 ) ) ) + break; + CYG_TEST_CHECK( E_RLWAI == ercd, "get_blf bad ercd !E_RLWAI" ); + + for ( i = 0; i < 10; i++ ) + if ( E_OK != (ercd = tget_blf( &vp, 3, 10 ) ) ) + break; + CYG_TEST_CHECK( E_RLWAI == ercd, "tget_blf bad ercd !E_RLWAI" ); + + for ( i = 0; i < 10; i++ ) + if ( E_OK != (ercd = get_blk( &vp, 1, 1000 ) ) ) + break; + CYG_TEST_CHECK( E_RLWAI == ercd, "get_blk bad ercd !E_RLWAI" ); + + for ( i = 0; i < 10; i++ ) + if ( E_OK != (ercd = tget_blk( &vp, 1, 1000, 10 ) ) ) + break; + CYG_TEST_CHECK( E_RLWAI == ercd, "tget_blk bad ercd !E_RLWAI" ); + + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "dly_tsk bad ercd !E_RLWAI" ); + + ercd = tslp_tsk( 10 ); + CYG_TEST_CHECK( E_RLWAI == ercd, "tslp_tsk bad ercd !E_RLWAI" ); + + ercd = slp_tsk(); + CYG_TEST_CHECK( E_RLWAI == ercd, "slp_tsk bad ercd !E_RLWAI" ); + + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + CYG_TEST_PASS("release wait: various waiting calls"); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == i, "tid not 2" ); + if ( 22222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 22222" ); + + for ( i = 0 ; i < 100; i++ ) { + ercd = rel_wai( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_wai bad ercd" ); + } + // we expect task2 to be killed here + CYG_TEST_FAIL( "Task 2 ran to completion!" ); +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF testcx5.cxx diff --git a/packages/compat/uitron/current/tests/testcx6.cxx b/packages/compat/uitron/current/tests/testcx6.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/testcx6.cxx @@ -0,0 +1,591 @@ +//=========================================================================== +// +// testcx6.cxx +// +// uITRON "C++" test program six +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-10-14 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough flag objects */ \ + defined( CYGPKG_UITRON_FLAGS ) && \ + (CYGNUM_UITRON_FLAGS >= 3) && \ + (CYGNUM_UITRON_FLAGS < 90) && \ + ( !defined(CYGPKG_UITRON_FLAGS_CREATE_DELETE) || \ + CYGNUM_UITRON_FLAGS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough message boxes */ \ + defined( CYGPKG_UITRON_MBOXES ) && \ + (CYGNUM_UITRON_MBOXES >= 3) && \ + (CYGNUM_UITRON_MBOXES < 90) && \ + ( !defined(CYGPKG_UITRON_MBOXES_CREATE_DELETE) || \ + CYGNUM_UITRON_MBOXES_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercount = 0; +UINT scratch; +T_MSG *t_msg = (T_MSG *)&scratch; +T_MSG *msg; +VP vp; + +T_CSEM t_csem = { NULL, 0, 0 }; +T_CMBX t_cmbx = { NULL, 0 }; +T_CFLG t_cflg = { NULL, 0, 0 }; +T_RSEM t_rsem; +T_RMBX t_rmbx; +T_RFLG t_rflg; + + +extern "C" { + void task1( unsigned int arg ); + void task2( unsigned int arg ); + void task3( unsigned int arg ); + void task4( unsigned int arg ); +} + +void task1( unsigned int arg ) +{ + ER ercd; + int tests = 0; + + CYG_TEST_INFO( "Task 1 running" ); + + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_sem( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_sem bad ercd !E_ID" ); + ercd = del_sem( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_sem bad ercd !E_ID" ); + ercd = cre_sem( -6, &t_csem ); + CYG_TEST_CHECK( E_ID == ercd, "cre_sem bad ercd !E_ID" ); + ercd = cre_sem( 99, &t_csem ); + CYG_TEST_CHECK( E_ID == ercd, "cre_sem bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + ercd = cre_sem( 3, &t_csem ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_sem bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_sem( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + // check it is deleted + ercd = sig_sem( 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + ercd = preq_sem( 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "preq_sem bad ercd !E_NOEXS" ); + ercd = twai_sem( 3, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "twai_sem bad ercd !E_NOEXS" ); + ercd = wai_sem( 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "wai_sem bad ercd !E_NOEXS" ); + ercd = ref_sem( &t_rsem, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_sem bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_sem( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_sem bad ercd !E_PAR" ); +#endif + t_csem.sematr = 0xfff; + ercd = cre_sem( 3, &t_csem ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_sem bad ercd !E_RSATR" ); + t_csem.sematr = 0; +#endif // we can test bad param error returns + ercd = cre_sem( 3, &t_csem ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); + // and check we can use it + ercd = sig_sem( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + ercd = wai_sem( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + ercd = preq_sem( 3 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "preq_sem bad ercd !E_TMOUT" ); + ercd = twai_sem( 3, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_sem bad ercd !E_TMOUT" ); + ercd = ref_sem( &t_rsem, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_sem bad ercd" ); + + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_sem bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = twai_sem( 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_sem bad ercd !E_DLT" ); + + // check they are deleted + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + // re-create and do it again + ercd = cre_sem( 1, &t_csem ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); + ercd = cre_sem( 2, &t_csem ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); + + // now wait while task 2 deletes the wait objects again + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_sem bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = twai_sem( 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_sem bad ercd !E_DLT" ); + + // check they are deleted + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + ercd = sig_sem( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sig_sem bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete semaphores"); +#endif // CYGPKG_UITRON_SEMAS_CREATE_DELETE + + +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_flg( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_flg bad ercd !E_ID" ); + ercd = del_flg( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_flg bad ercd !E_ID" ); + ercd = cre_flg( -6, &t_cflg ); + CYG_TEST_CHECK( E_ID == ercd, "cre_flg bad ercd !E_ID" ); + ercd = cre_flg( 99, &t_cflg ); + CYG_TEST_CHECK( E_ID == ercd, "cre_flg bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + ercd = cre_flg( 3, &t_cflg ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_flg bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_flg( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + // check it is deleted + ercd = set_flg( 3, 0x6789 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "set_flg bad ercd !E_NOEXS" ); + ercd = clr_flg( 3, 0x9876 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "clr_flg bad ercd !E_NOEXS" ); + ercd = pol_flg( &scratch, 3, 0xdddd, TWF_ANDW ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pol_flg bad ercd !E_NOEXS" ); + ercd = twai_flg( &scratch, 3, 0x4444, TWF_ORW, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "twai_flg bad ercd !E_NOEXS" ); + ercd = wai_flg( &scratch, 3, 0xbbbb, TWF_ANDW | TWF_CLR ); + CYG_TEST_CHECK( E_NOEXS == ercd, "wai_flg bad ercd !E_NOEXS" ); + ercd = ref_flg( &t_rflg, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_flg bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_flg( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_flg bad ercd !E_PAR" ); +#endif + t_cflg.flgatr = 0xfff; + ercd = cre_flg( 3, &t_cflg ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_flg bad ercd !E_RSATR" ); +#endif // we can test bad param error returns + // now create it well + t_cflg.flgatr = 0; + t_cflg.iflgptn = 0; + ercd = cre_flg( 3, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_flg bad ercd" ); + // and check we can use it + ercd = clr_flg( 3, 0x7256 ); + CYG_TEST_CHECK( E_OK == ercd, "clr_flg bad ercd" ); + ercd = set_flg( 3, 0xff ); + CYG_TEST_CHECK( E_OK == ercd, "set_flg bad ercd" ); + ercd = wai_flg( &scratch, 3, 0xaa, TWF_ANDW | TWF_CLR ); + CYG_TEST_CHECK( E_OK == ercd, "wai_flg bad ercd" ); + ercd = pol_flg( &scratch, 3, 0xaa, TWF_ANDW | TWF_CLR ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = twai_flg( &scratch, 3, 0xaa, TWF_ANDW | TWF_CLR, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "twai_flg bad ercd !E_TMOUT" ); + ercd = ref_flg( &t_rflg, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 == t_rflg.flgptn, "ref_flg bad ercd" ); + // now create it again with a preset pattern and check that we can + // detect that pattern: + ercd = del_flg( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + t_cflg.flgatr = 0; + t_cflg.iflgptn = 0x1234; + ercd = cre_flg( 3, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_flg bad ercd" ); + // and check we can use it + ercd = wai_flg( &scratch, 3, 0x1200, TWF_ANDW ); + CYG_TEST_CHECK( E_OK == ercd, "wai_flg bad ercd" ); + ercd = pol_flg( &scratch, 3, 0x0034, TWF_ANDW ); + CYG_TEST_CHECK( E_OK == ercd, "pol_flg bad ercd" ); + ercd = twai_flg( &scratch, 3, 0x1004, TWF_ANDW, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "twai_flg bad ercd" ); + ercd = pol_flg( &scratch, 3, 0xffedcb, TWF_ORW ); + CYG_TEST_CHECK( E_TMOUT == ercd, "pol_flg bad ercd !E_TMOUT" ); + ercd = ref_flg( &t_rflg, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0x1234 == t_rflg.flgptn, "ref_flg bad ercd" ); + ercd = clr_flg( 3, 0 ); + ercd = ref_flg( &t_rflg, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_flg bad ercd" ); + CYG_TEST_CHECK( 0 == t_rflg.flgptn, "ref_flg bad ercd" ); + + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wai_flg( &scratch, 1, 0xaa, TWF_ANDW ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_flg bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = twai_flg( &scratch, 2, 0x55, TWF_ANDW, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_flg bad ercd !E_DLT" ); + + // check they are deleted + ercd = set_flg( 1, 0x22 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "set_flg bad ercd !E_NOEXS" ); + ercd = clr_flg( 2, 0xdd ); + CYG_TEST_CHECK( E_NOEXS == ercd, "clr_flg bad ercd !E_NOEXS" ); + // re-create and do it again + t_cflg.iflgptn = 0x5555; + ercd = cre_flg( 1, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_flg bad ercd" ); + t_cflg.iflgptn = 0; + ercd = cre_flg( 2, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_flg bad ercd" ); + + // now wait while task 2 deletes the wait objects again + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wai_flg( &scratch, 1, 0xaaaa, TWF_ORW | TWF_CLR ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_flg bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = twai_flg( &scratch, 2, 0xffff, TWF_ORW, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_flg bad ercd !E_DLT" ); + + // check they are deleted + ercd = clr_flg( 1, 0xd00d ); + CYG_TEST_CHECK( E_NOEXS == ercd, "clr_flg bad ercd !E_NOEXS" ); + ercd = set_flg( 2, 0xfff00 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "set_flg bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete flags"); +#endif // CYGPKG_UITRON_FLAGS_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_mbx( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mbx bad ercd !E_ID" ); + ercd = del_mbx( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mbx bad ercd !E_ID" ); + ercd = cre_mbx( -6, &t_cmbx ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mbx bad ercd !E_ID" ); + ercd = cre_mbx( 99, &t_cmbx ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mbx bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + ercd = cre_mbx( 3, &t_cmbx ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_mbx bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_mbx( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + // check it is deleted + ercd = snd_msg( 3, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + ercd = rcv_msg( &msg, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rcv_msg bad ercd !E_NOEXS" ); + ercd = trcv_msg( &msg, 3, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "trcv_msg bad ercd !E_NOEXS" ); + ercd = prcv_msg( &msg, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "prcv_msg bad ercd !E_NOEXS" ); + ercd = ref_mbx( &t_rmbx, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_mbx bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_mbx( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_mbx bad ercd !E_PAR" ); +#endif + t_cmbx.mbxatr = 0xfff; + ercd = cre_mbx( 3, &t_cmbx ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_mbx bad ercd !E_RSATR" ); + t_cmbx.mbxatr = 0; +#endif // we can test bad param error returns + ercd = cre_mbx( 3, &t_cmbx ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mbx bad ercd" ); + // and check we can use it + ercd = snd_msg( 3, t_msg ); + CYG_TEST_CHECK( E_OK == ercd, "snd_msg bad ercd" ); + ercd = rcv_msg( &msg, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "rcv_msg bad ercd" ); + ercd = trcv_msg( &msg, 3, 2 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "trcv_msg bad ercd !E_TMOUT" ); + ercd = prcv_msg( &msg, 3 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "prcv_msg bad ercd !E_TMOUT" ); + ercd = ref_mbx( &t_rmbx, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mbx bad ercd" ); + + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rcv_msg( &msg, 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_mbx bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = trcv_msg( &msg, 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_mbx bad ercd !E_DLT" ); + + // check they are deleted + ercd = snd_msg( 1, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + ercd = snd_msg( 2, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + // re-create and do it again + ercd = cre_mbx( 1, &t_cmbx ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mbx bad ercd" ); + ercd = cre_mbx( 2, &t_cmbx ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mbx bad ercd" ); + + // now wait while task 2 deletes the wait objects again + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rcv_msg( &msg, 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "wai_mbx bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = trcv_msg( &msg, 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "twai_mbx bad ercd !E_DLT" ); + + // check they are deleted + ercd = snd_msg( 1, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + ercd = snd_msg( 2, t_msg ); + CYG_TEST_CHECK( E_NOEXS == ercd, "snd_msg bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete mboxes"); +#endif // CYGPKG_UITRON_MBOXES_CREATE_DELETE + + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + ercd = dly_tsk( 5 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + // all done + if ( 0 == tests ) { + CYG_TEST_PASS( "N/A: no objects have create/delete enabled" ); + CYG_TEST_EXIT( "N/A" ); + } + else { + CYG_TEST_EXIT( "All done" ); + } + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == i, "tid not 2" ); + if ( 22222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 22222" ); + + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + ercd = del_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_sem( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_SEMAS_CREATE_DELETE + +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + ercd = del_flg( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_flg( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_flg( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_flg( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_FLAGS_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + ercd = del_mbx( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mbx( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mbx( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mbx( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_MBOXES_CREATE_DELETE + + // we expect task2 to be killed here + CYG_TEST_FAIL( "Task 2 ran to completion!" ); +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF testcx6.cxx diff --git a/packages/compat/uitron/current/tests/testcx7.cxx b/packages/compat/uitron/current/tests/testcx7.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/testcx7.cxx @@ -0,0 +1,1010 @@ +//=========================================================================== +// +// testcx7.cxx +// +// uITRON "C++" test program seven +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-10-14 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough flag objects */ \ + defined( CYGPKG_UITRON_FLAGS ) && \ + (CYGNUM_UITRON_FLAGS >= 3) && \ + (CYGNUM_UITRON_FLAGS < 90) && \ + ( !defined(CYGPKG_UITRON_FLAGS_CREATE_DELETE) || \ + CYGNUM_UITRON_FLAGS_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough message boxes */ \ + defined( CYGPKG_UITRON_MBOXES ) && \ + (CYGNUM_UITRON_MBOXES >= 3) && \ + (CYGNUM_UITRON_MBOXES < 90) && \ + ( !defined(CYGPKG_UITRON_MBOXES_CREATE_DELETE) || \ + CYGNUM_UITRON_MBOXES_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough fixed memory pools */ \ + defined( CYGPKG_UITRON_MEMPOOLFIXED ) && \ + (CYGNUM_UITRON_MEMPOOLFIXED >= 3) && \ + (CYGNUM_UITRON_MEMPOOLFIXED < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough variable mempools */ \ + defined( CYGPKG_UITRON_MEMPOOLVAR ) && \ + (CYGNUM_UITRON_MEMPOOLVAR >= 3) && \ + (CYGNUM_UITRON_MEMPOOLVAR < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLVAR_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + + +extern "C" { + void task1( unsigned int arg ); + void task2( unsigned int arg ); + void task3( unsigned int arg ); + void task4( unsigned int arg ); +} + +// ======================================================================== + +enum { + START_WAITOP = 0, + SLEEP = 0, + DELAY, + SEMGET, + FLAGWAIT, + MSGGET, + MEMFIXEDGET, + MEMVARGET, + DONE_WAITOP +}; +typedef int WAITOP; + +enum { + START_TYPE = 0, + PLAIN = 0, + TIMED = 1, + DONE_TYPE +}; +typedef int WAITTYPE; + +enum { + START_KILLOP = 0, + + // These are the 5 ways out of a wait that we perm + // with other circumstances: + SIGNAL = 0, // do the appropriate producer op + TIMEOUT, // wait for the timeout to fire + RELEASE, // do a rel_wai() + DELETE, // delete the object; del_xxx() + KILL, // do a ter_tsk() on the waiter + + SUSPEND_SIGNAL_RESUME, + SUSPEND_TIMEOUT_RESUME, + SUSPEND_RELEASE_RESUME, + SUSPEND_DELETE_RESUME, + SUSPEND_KILL, // resume not applicable + + SUSPEND_SIGNAL_KILL, + SUSPEND_TIMEOUT_KILL, + SUSPEND_RELEASE_KILL, + SUSPEND_DELETE_KILL, + // SUSPEND_KILL_KILL not applicable + +#if 0 + // support these later if _really_ keen. + SUSPEND_SIGNAL_DELETE_RESUME, + SUSPEND_TIMEOUT_DELETE_RESUME, + SUSPEND_RELEASE_DELETE_RESUME, + // SUSPEND_DELETE_DELETE_RESUME not applicable + // SUSPEND_KILL_DELETE_RESUME not applicable + + SUSPEND_SIGNAL_DELETE_KILL, + SUSPEND_TIMEOUT_DELETE_KILL, + SUSPEND_RELEASE_DELETE_KILL, + // SUSPEND_DELETE_DELETE_KILL, + SUSPEND_KILL_DELETE // 2nd kill not applicable +#endif + + DONE_KILLOP +}; +typedef int KILLOP; + +// ======================================================================== + +char * waitstrings[] = +{ "Sleep ", "Delay ", "Sema ", "Flag ", "Mbox ", "MemFix", "MemVar" }; + +char * typestrings[] = +{ " (Plain) : ", " (Timed) : " }; + +char * killstrings[] = +{ "Signal", + "Wait-for-timeout", + "Release-wait", + "Delete-object", + "Kill-task", + + "Suspend/Signal/Resume", + "Suspend/Wait-for-timeout/Resume", + "Suspend/Release-wait/Resume", + "Suspend/Delete-object/Resume", + "Suspend/Kill-task", + + "Suspend/Signal/Kill-task", + "Suspend/Wait-for-timeout/Kill-task", + "Suspend/Release-wait/Kill-task", + "Suspend/Delete-object/Kill-task", + + +}; + +// ======================================================================== + +inline int task2arg( WAITOP wait, WAITTYPE waittype, KILLOP kill ) +{ + return waittype + (wait << 1) + (kill << 8); +} + +inline void decodearg( int arg, WAITOP *pwait, WAITTYPE *pwaittype, KILLOP *pkill ) +{ + *pwaittype = (arg & 1) ? TIMED : PLAIN; + *pwait = (arg >> 1) & 0x7f; + *pkill = (arg >> 8); +} + +static char *strdog( char *p, char *q ) +{ + while ( 0 != (*p++ = *q++) ); + return p - 1; +} + +static char * +makemsg( char *z, WAITOP wait, WAITTYPE waittype, KILLOP kill ) +{ + static char buf[ 1000 ]; + char *p = buf; + p = strdog( p, z ); + p = strdog( p, waitstrings[ wait ] ); + p = strdog( p, typestrings[ waittype ] ); + p = strdog( p, killstrings[ kill ] ); + *p = 0; + return buf; +} + +// ======================================================================== + +volatile int intercom = 0; + +// ======================================================================== + +T_RTSK rtsk; + +void +do_suspend( void ) +{ + ER ercd; + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_WAI == rtsk.tskstat, "bad tskstat !TTS_WAI" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_WAS == rtsk.tskstat, "bad tskstat !TTS_WAS" ); +} + +void +do_resume( void ) +{ + ER ercd; + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_SUS == rtsk.tskstat, "bad tskstat !TTS_SUS" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_RDY == rtsk.tskstat, "bad tskstat !TTS_RDY" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); +} + +// ======================================================================== + +#define T1_WAIT (7) +#define T2_WAIT (5) + +#define T1_MALLOC (110) +#define T2_MALLOC (100) + +VP vptmp; +VP vp = NULL; +VP vp1 = NULL; +VP t2vp = NULL; +VP t2vp_backup = NULL; + +UINT scratch; + +T_MSG *msg = (T_MSG *)&scratch; +T_MSG *msg1; + +void +do_prep( WAITOP wait ) +{ + ER ercd; + switch ( wait ) { + case SLEEP: + case DELAY: + case SEMGET: + case FLAGWAIT: + case MSGGET: + // do nothing for all of those + break; + case MEMFIXEDGET: + // allocate all the memory in the pool; remember a couple + // for freeing as the signalling operation: + t2vp = NULL; + vp = vptmp = NULL; + do { + vp1 = vptmp; + vptmp = vp; + ercd = pget_blf( &vp, 1 ); + } while ( E_OK == ercd ); + CYG_TEST_CHECK( E_TMOUT == ercd, "get_blf bad ercd" ); + CYG_TEST_CHECK( NULL != vp, "no allocated block to free" ); + CYG_TEST_CHECK( NULL != vp1, "no allocated block to free1" ); + break; + case MEMVARGET: + // allocate all the memory in the pool; remember a couple + // for freeing as the signalling operation: + t2vp = NULL; + vp = vptmp = NULL; + do { + vp1 = vptmp; + vptmp = vp; + ercd = pget_blk( &vp, 1, T1_MALLOC ); + } while ( E_OK == ercd ); + CYG_TEST_CHECK( E_TMOUT == ercd, "get_blk bad ercd" ); + CYG_TEST_CHECK( NULL != vp, "no allocated block to free" ); + CYG_TEST_CHECK( NULL != vp1, "no allocated block to free1" ); + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } +} + +void +do_tidyup( WAITOP wait ) +{ + ER ercd; + switch ( wait ) { + case SLEEP: + case DELAY: + case SEMGET: + case MSGGET: + // do nothing for all of those + break; + case FLAGWAIT: + // clear the flag variable + ercd = clr_flg( 1, 0 ); + CYG_TEST_CHECK( E_OK == ercd, "clr_flg bad ercd, tidy vp" ); + break; + case MEMFIXEDGET: + if ( NULL != vp ) { + ercd = rel_blf( 1, vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd, tidy vp" ); + } + if ( NULL != vp1 ) { + ercd = rel_blf( 1, vp1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd, tidy vp1" ); + } + if ( NULL != t2vp ) { + ercd = rel_blf( 1, t2vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd, tidy t2vp" ); + } + break; + case MEMVARGET: + if ( NULL != vp ) { + ercd = rel_blk( 1, vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd, tidy vp" ); + } + if ( NULL != vp1 ) { + ercd = rel_blk( 1, vp1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd, tidy vp1" ); + } + if ( NULL != t2vp ) { + ercd = rel_blk( 1, t2vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd, tidy t2vp" ); + } + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } +} + +void +do_recreate( WAITOP wait ) +{ +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + static T_CSEM t_csem = { NULL, 0, 0 }; +#endif +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + static T_CMBX t_cmbx = { NULL, 0 }; +#endif +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + static T_CFLG t_cflg = { NULL, 0, 0 }; +#endif +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + static T_CMPF t_cmpf = { NULL, 0, 20, 95 }; +#endif +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + static T_CMPL t_cmpl = { NULL, 0, 2000 }; +#endif + ER ercd = E_OK; + switch ( wait ) { + case SLEEP: + case DELAY: + // do nothing for all of those + break; + case SEMGET: +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + // create the semaphore + ercd = cre_sem( 1, &t_csem ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate SEMGET" ); +#endif + break; + case FLAGWAIT: +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + // create the flag + ercd = cre_flg( 1, &t_cflg ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate FLAGWAIT" ); +#endif + break; + case MSGGET: +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + // create the mbox + ercd = cre_mbx( 1, &t_cmbx ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate MSGGET" ); +#endif + break; + case MEMFIXEDGET: +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + // create the mempool + ercd = cre_mpf( 1, &t_cmpf ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate MEMFIXEDGET" ); +#endif + break; + case MEMVARGET: +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + // create the mempool + ercd = cre_mpl( 1, &t_cmpl ); + CYG_TEST_CHECK( E_OK == ercd, "cre_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_recreate MEMVARGET" ); +#endif + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } + // this is just to use ercd to prevent warnings + CYG_TEST_CHECK( E_OK == ercd, " bad ercd" ); +} + + + +void +do_signal( WAITOP wait ) +{ + ER ercd; + switch ( wait ) { + case SLEEP: + // send a wakeup + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + break; + case DELAY: + // simply wait for task 2's delay to complete + ercd = dly_tsk( T1_WAIT ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + break; + case SEMGET: + // signal the semaphore + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + break; + case FLAGWAIT: + // set the flag bits + ercd = set_flg( 1, 0xff ); + CYG_TEST_CHECK( E_OK == ercd, "set_flg bad ercd" ); + break; + case MSGGET: + // send a message + ercd = snd_msg( 1, msg ); + CYG_TEST_CHECK( E_OK == ercd, "snd_msg bad ercd" ); + break; + case MEMFIXEDGET: + // release a couple of blocks we allocated earlier. I hope. + CYG_TEST_CHECK( NULL != vp, "no allocated block to free" ); + CYG_TEST_CHECK( NULL != vp1, "no allocated block to free1" ); + ercd = rel_blf( 1, vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + vp = NULL; + ercd = rel_blf( 1, vp1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd1" ); + vp1 = NULL; + break; + case MEMVARGET: + // release a couple of blocks we allocated earlier. I hope. + CYG_TEST_CHECK( NULL != vp, "no allocated block to free" ); + CYG_TEST_CHECK( NULL != vp1, "no allocated block to free1" ); + ercd = rel_blk( 1, vp ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + vp = NULL; + ercd = rel_blk( 1, vp1 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd1" ); + vp1 = NULL; + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } +} + +void +do_delete( WAITOP wait ) +{ + ER ercd = E_OK; + switch ( wait ) { + case SLEEP: + case DELAY: + CYG_TEST_FAIL( "bad call to do_delete( SLEEP or DELAY )" ); + break; + case SEMGET: +#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE + // delete the semaphore + ercd = del_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_sem bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( SEMGET )" ); +#endif + break; + case FLAGWAIT: +#ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE + // delete the flag + ercd = del_flg( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_flg bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( FLAGWAIT )" ); +#endif + break; + case MSGGET: +#ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE + // delete the mbox + ercd = del_mbx( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mbx bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( MSGGET )" ); +#endif + break; + case MEMFIXEDGET: +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + // delete the mempool + ercd = del_mpf( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( MEMFIXEDGET )" ); +#endif + break; + case MEMVARGET: +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + // delete the mempool + ercd = del_mpl( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); +#else + CYG_TEST_FAIL( "bad call to do_delete( MEMVARGET )" ); +#endif + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } + // this is just to use ercd to prevent warnings + CYG_TEST_CHECK( E_OK == ercd, " bad ercd" ); +} + + + +ER +do_wait( WAITOP wait, WAITTYPE type ) +{ + switch ( wait ) { + case SLEEP: + return ( PLAIN == type ) ? slp_tsk() : tslp_tsk( T2_WAIT ); + case DELAY: + return dly_tsk( T2_WAIT ); // forget the type + case SEMGET: + return ( PLAIN == type ) ? wai_sem( 1 ) : twai_sem( 1, T2_WAIT ); + case FLAGWAIT: + return ( PLAIN == type ) ? + wai_flg( &scratch, 1, 0x55, TWF_ANDW ) : + twai_flg( &scratch, 1, 0xaa, TWF_ANDW, T2_WAIT ); + case MSGGET: + return ( PLAIN == type ) ? + rcv_msg( &msg1, 1 ) : + trcv_msg( &msg1, 1, T2_WAIT ); + case MEMFIXEDGET: + return ( PLAIN == type ) ? + get_blf( &t2vp, 1 ) : + tget_blf( &t2vp, 1, T2_WAIT ); + case MEMVARGET: + return ( PLAIN == type ) ? + get_blk( &t2vp, 1, T2_MALLOC ) : + tget_blk( &t2vp, 1, T2_MALLOC, T2_WAIT ); + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } + CYG_TEST_FAIL( "Bad wait in do_wait" ); + return E_SYS; +} + +// ======================================================================== +void task1( unsigned int arg ) +{ + ER ercd; + WAITOP wait; + WAITTYPE type; + KILLOP kill; + + CYG_TEST_INFO( "Task 1 running" ); + + ercd = chg_pri( 1, 8 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + + for ( wait = START_WAITOP; wait < DONE_WAITOP ; wait++) { + for ( type = START_TYPE; type < DONE_TYPE ; type++ ) { + for ( kill = START_KILLOP; kill < DONE_KILLOP ; kill++ ) { + + // These clauses deal with a couple of special cases: + // [doing it this way helps keep the rest of the code + // nicely general and orthogonal] + // + // 1) DELAY: dly_tsk(): when this times out, the retcode is + // E_OK rather than E_TMOUT, and it always times out. The + // "signalling" method here is just to wait yourself. So we + // do not test DELAY with TIMED type. + // + // 2) PLAIN tests with TIMEOUT kill operations: a PLAIN test + // will not time out, it'll wait forever, so waiting for it + // so to do is pointless; further, we would check for the + // wrong error code. So we do not test PLAIN tests with + // TIMOUT kill operations. + // + // 3) SLEEP or DELAY tests with DELETE operations: there is + // no synchronization to delete in those cases. + // 3a) Individual object types are tested for delete support, + // and if there is none, the test is skipped. + + if ( DELAY == wait && TIMED == type ) + continue; + + if ( PLAIN == type && + ( ( TIMEOUT == kill) || + (SUSPEND_TIMEOUT_RESUME == kill) || + (SUSPEND_TIMEOUT_KILL == kill) ) ) + continue; + + if ( ( +#ifndef CYGPKG_UITRON_SEMAS_CREATE_DELETE + (SEMGET == wait) || +#endif +#ifndef CYGPKG_UITRON_FLAGS_CREATE_DELETE + (FLAGWAIT == wait) || +#endif +#ifndef CYGPKG_UITRON_MBOXES_CREATE_DELETE + (MSGGET == wait) || +#endif +#ifndef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + (MEMFIXEDGET == wait) || +#endif +#ifndef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + (MEMVARGET == wait) || +#endif + (SLEEP == wait) || + (DELAY == wait) + ) && + ((DELETE == kill) || + (SUSPEND_DELETE_RESUME == kill) || + (SUSPEND_DELETE_KILL == kill)) ) + continue; + + + CYG_TEST_INFO( makemsg( "T1: ", wait, type, kill ) ); + + intercom = 0; + + // prepare the synchronization objects + // (actually, just empty the mempools) + do_prep( wait ); + + // start task 2 at a higher priority than myself + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, task2arg( wait, type, kill ) ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + // task 2 should run now, until it waits. + + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_WAI == rtsk.tskstat, "bad tskstat" ); + CYG_TEST_CHECK( 5 == rtsk.tskpri, "bad tskpri" ); + + switch ( kill ) { + case SIGNAL: + // signal the task appropriately + do_signal( wait ); + // it should now have run to completion + break; + case TIMEOUT: + // wait for the timeout to occur + ercd = dly_tsk( T1_WAIT ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // it should now have run to completion + break; + case RELEASE: + // hit the task with a release-wait + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_wai bad ercd" ); + // it should now have run to completion + break; + case DELETE: + // delete the object appropriately + do_delete( wait ); + // it should now have run to completion + break; + case KILL: + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_SIGNAL_RESUME: + // suspend the task + do_suspend(); + // signal the task appropriately + do_signal( wait ); + // resume the task + do_resume(); + // it should now have run to completion + break; + case SUSPEND_TIMEOUT_RESUME: + // suspend the task + do_suspend(); + // wait for the timeout to occur + ercd = dly_tsk( T1_WAIT ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // resume the task + do_resume(); + // it should now have run to completion + break; + case SUSPEND_RELEASE_RESUME: + // suspend the task + do_suspend(); + // hit the task with a release-wait + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_wai bad ercd" ); + // resume the task + do_resume(); + // it should now have run to completion + break; + case SUSPEND_DELETE_RESUME: + // suspend the task + do_suspend(); + // delete the object appropriately + do_delete( wait ); + // resume the task + do_resume(); + // it should now have run to completion + break; + case SUSPEND_KILL: + // suspend the task + do_suspend(); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_SIGNAL_KILL: + // suspend the task + do_suspend(); + // signal the task appropriately + do_signal( wait ); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_TIMEOUT_KILL: + // suspend the task + do_suspend(); + // wait for the timeout to occur + ercd = dly_tsk( T1_WAIT ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_RELEASE_KILL: + // suspend the task + do_suspend(); + // hit the task with a release-wait + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "rel_wai bad ercd" ); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + case SUSPEND_DELETE_KILL: + // suspend the task + do_suspend(); + // delete the object appropriately + do_delete( wait ); + // kill the task + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + // it should now have terminated without running + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } + + // task 2 should be dormant now, however it got there + ercd = ref_tsk( &rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_DMT == rtsk.tskstat, "bad tskstat" ); + + if ( (SUSPEND_SIGNAL_KILL == kill) && + ((MEMFIXEDGET == wait) || (MEMVARGET == wait)) ) { + // it was a killed successful memory alloc, so we have + // lost the pointer to memory allocated; there is an + // implicit storeleak problem when the task trying + // to allocate is signalled then killed. + // Recreate the pointer from an old version: + CYG_TEST_CHECK( NULL == t2vp, "t2vp WAS allocated!" ); + t2vp = t2vp_backup; + } + + switch ( kill ) { + case KILL: + case SUSPEND_KILL: + case SUSPEND_SIGNAL_KILL: + case SUSPEND_TIMEOUT_KILL: + case SUSPEND_RELEASE_KILL: + case SUSPEND_DELETE_KILL: + // if task 2 was killed, expect only one increment + CYG_TEST_CHECK( 1 == intercom, "intercom bad value !1" ); + break; + default: + // otherwise expect two increments + CYG_TEST_CHECK( 2 == intercom, "intercom bad value !2" ); + break; + } + + // tidy up or recreate the synchronization objects + if ( (DELETE == kill) || + (SUSPEND_DELETE_RESUME == kill) || + (SUSPEND_DELETE_KILL == kill) ) + do_recreate( wait ); + else + do_tidyup( wait ); + } + } + } + CYG_TEST_PASS("synchronization interaction tests"); + + // all done + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + WAITOP wait; + WAITTYPE waittype; + KILLOP kill; + + decodearg( arg, &wait, &waittype, &kill ); + +// CYG_TEST_INFO( makemsg( " 2: ", wait, waittype, kill ) ); + + intercom++; + ercd = do_wait( wait, waittype ); + intercom++; + + switch ( kill ) { + case SIGNAL: + case SUSPEND_SIGNAL_RESUME: + // we expect to have been signalled correctly + CYG_TEST_CHECK( E_OK == ercd, "T2 wait bad ercd" ); + // here we know that the op completed OK + if ( (MEMFIXEDGET == wait) || (MEMVARGET == wait) ) { + // it was a successful memory alloc of whichever type, + // so we can save away a copy of t2vp for working round an + // implicit storeleak problem when the task trying to allocate + // is signalled then killed: + CYG_TEST_CHECK( NULL != t2vp, "No t2vp allocated!" ); + t2vp_backup = t2vp; + } + break; + case TIMEOUT: + case SUSPEND_TIMEOUT_RESUME: + // we expect to have timed out - if it's a timeout op. + CYG_TEST_CHECK( E_TMOUT == ercd, "T2 timeout bad ercd, !E_TMOUT" ); + break; + case RELEASE: + case SUSPEND_RELEASE_RESUME: + // we expect to have suffered a release wait. + CYG_TEST_CHECK( E_RLWAI == ercd, "T2 release bad ercd, !E_RLWAI" ); + break; + case DELETE: + case SUSPEND_DELETE_RESUME: + // we expect to be told the object is gone + CYG_TEST_CHECK( E_DLT == ercd, "T2 release bad ercd, !E_DLT" ); + break; + case KILL: + case SUSPEND_KILL: + case SUSPEND_SIGNAL_KILL: + case SUSPEND_TIMEOUT_KILL: + case SUSPEND_RELEASE_KILL: + case SUSPEND_DELETE_KILL: + // we expect to have been killed here, ie. this won't execute! + CYG_TEST_FAIL( "Task 2 ran to completion!" ); + break; + default: + CYG_TEST_FAIL( "bad switch" ); + break; + } +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF testcx7.cxx diff --git a/packages/compat/uitron/current/tests/testcx8.cxx b/packages/compat/uitron/current/tests/testcx8.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/testcx8.cxx @@ -0,0 +1,386 @@ +//=========================================================================== +// +// testcx8.cxx +// +// uITRON "C++" test program eight +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-10-14 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough semaphores */ \ + defined( CYGPKG_UITRON_SEMAS ) && \ + (CYGNUM_UITRON_SEMAS >= 3) && \ + (CYGNUM_UITRON_SEMAS < 90) && \ + ( !defined(CYGPKG_UITRON_SEMAS_CREATE_DELETE) || \ + CYGNUM_UITRON_SEMAS_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercount = 0; +INT scratch; + +void newtask( unsigned int arg ); + +T_CTSK t_ctsk = { NULL, 0, (FP)&newtask, 1, CYGNUM_UITRON_STACK_SIZE }; +T_RTSK t_rtsk; + +extern "C" { + void task1( unsigned int arg ); + void task2( unsigned int arg ); + void task3( unsigned int arg ); + void task4( unsigned int arg ); +} + +void task1( unsigned int arg ) +{ + ER ercd; + + CYG_TEST_INFO( "Task 1 running" ); + + // change us to prio 3 for flexibility + ercd = chg_pri( 0, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + +#ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE + // first, check that we can delete a task: +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_tsk bad ercd !E_ID" ); + ercd = del_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_tsk bad ercd !E_ID" ); + ercd = cre_tsk( -6, &t_ctsk ); + CYG_TEST_CHECK( E_ID == ercd, "cre_tsk bad ercd !E_ID" ); + ercd = cre_tsk( 99, &t_ctsk ); + CYG_TEST_CHECK( E_ID == ercd, "cre_tsk bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + ercd = cre_tsk( 2, &t_ctsk ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_tsk bad ercd !E_OBJ" ); + // try a pre-existing object - ourselves! + ercd = cre_tsk( 1, &t_ctsk ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_tsk bad ercd !E_OBJ" ); + // try deleting an active task + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + // Task 2 is now ready-to-run, lower prio than us + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + // Task 2 is now sleeping + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + // try deleting a running task - ourselves! + ercd = del_tsk( 1 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + // terminate task 2; should then be OK to delete it + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_tsk bad ercd" ); + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + // and check it is deleted + ercd = sta_tsk( 2, 99 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sta_tsk bad ercd !E_NOEXS" ); + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ter_tsk bad ercd !E_NOEXS" ); + ercd = chg_pri( 2, 6 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "chg_pri bad ercd !E_NOEXS" ); + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rel_wai bad ercd !E_NOEXS" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sus_tsk bad ercd !E_NOEXS" ); + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rsm_tsk bad ercd !E_NOEXS" ); + ercd = frsm_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "frsm_tsk bad ercd !E_NOEXS" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "wup_tsk bad ercd !E_NOEXS" ); + ercd = can_wup( &scratch, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "can_wup bad ercd !E_NOEXS" ); + ercd = ref_tsk( &t_rtsk, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_tsk bad ercd !E_NOEXS" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "del_tsk bad ercd !E_NOEXS" ); + // recreate task2, with the same function + t_ctsk.task = (FP)&task2; + t_ctsk.itskpri = 7; + ercd = cre_tsk( 2, &t_ctsk ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + ercd = ref_tsk( &t_rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( 7 == t_rtsk.tskpri, "Bad tskpri in new task2 !7" ); + CYG_TEST_CHECK( TTS_DMT == t_rtsk.tskstat, + "Bad tskstat in new task2 !TTS_DMT" ); + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + // now start the task and do the same lot again... + ercd = cre_tsk( 2, &t_ctsk ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_tsk bad ercd !E_OBJ" ); + // try deleting an active task + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + // Task 2 is now ready-to-run, lower prio than us + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + CYG_TEST_CHECK( 1 == intercount, "bad intercount !1" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "bad intercount !2" ); + // Task 2 is now sleeping + ercd = ref_tsk( &t_rtsk, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( 7 == t_rtsk.tskpri, "Bad tskpri in new task2 !7" ); + CYG_TEST_CHECK( TTS_WAI == t_rtsk.tskstat, + "Bad tskstat in new task2 !TTS_WAI" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "del_tsk bad ercd !E_OBJ" ); + // up its priority + ercd = chg_pri( 2, 1 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + // awaken task 2; it will then exit-and-delete itself: + CYG_TEST_CHECK( 2 == intercount, "bad intercount !2" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); + // and check it is deleted + ercd = sta_tsk( 2, 99 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sta_tsk bad ercd !E_NOEXS" ); + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ter_tsk bad ercd !E_NOEXS" ); + ercd = chg_pri( 2, 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "chg_pri bad ercd !E_NOEXS" ); + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rel_wai bad ercd !E_NOEXS" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "sus_tsk bad ercd !E_NOEXS" ); + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "rsm_tsk bad ercd !E_NOEXS" ); + ercd = frsm_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "frsm_tsk bad ercd !E_NOEXS" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "wup_tsk bad ercd !E_NOEXS" ); + ercd = can_wup( &scratch, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "can_wup bad ercd !E_NOEXS" ); + ercd = ref_tsk( &t_rtsk, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_tsk bad ercd !E_NOEXS" ); + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); + ercd = del_tsk( 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "del_tsk bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_tsk( 2, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_tsk bad ercd !E_PAR" ); +#endif + t_ctsk.stksz = 0x40000000; + ercd = cre_tsk( 2, &t_ctsk ); + CYG_TEST_CHECK( E_NOMEM == ercd, "cre_tsk bad ercd !E_NOMEM" ); + t_ctsk.stksz = CYGNUM_UITRON_STACK_SIZE; + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); +#endif // we can test bad param error returns + + ercd = del_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_tsk bad ercd" ); + t_ctsk.task = (FP)&task4; + t_ctsk.itskpri = 9; + ercd = cre_tsk( 3, &t_ctsk ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + // check we can delete it again immediately + ercd = del_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_tsk bad ercd" ); + ercd = ref_tsk( &t_rtsk, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_tsk bad ercd !E_NOEXS" ); + t_ctsk.task = (FP)&newtask; + t_ctsk.itskpri = 1; + ercd = cre_tsk( 3, &t_ctsk ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "bad intercount !3" ); + ercd = sta_tsk( 3, 999 ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + // it should have run now, and exited + CYG_TEST_CHECK( 5 == intercount, "bad intercount !5" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + // and check that it will just run again... + ercd = sta_tsk( 3, 999 ); + CYG_TEST_CHECK( E_OK == ercd, "cre_tsk bad ercd" ); + // it should have run now, and exited + CYG_TEST_CHECK( 7 == intercount, "bad intercount !7" ); + ercd = wai_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "wai_sem bad ercd" ); + // all done. + + CYG_TEST_PASS("create/delete tasks"); + + // all done + CYG_TEST_EXIT( "All done" ); +#else // ! CYGPKG_UITRON_TASKS_CREATE_DELETE + CYG_TEST_PASS( "N/A: tasks do not have create/delete enabled" ); + CYG_TEST_EXIT( "N/A" ); +#endif // ! CYGPKG_UITRON_TASKS_CREATE_DELETE + ext_tsk(); +} + + + +void newtask( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Newtask running" ); + CYG_TEST_CHECK( 999 == arg, "Bad arg to newtask() !999" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 3 == i, "tid not 3" ); + intercount++; + ercd = sig_sem( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "sig_sem bad ercd" ); + intercount++; + // and just return +} + +void task2( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == i, "tid not 2" ); + if ( 22222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 22222" ); + + intercount++; + + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + + intercount++; + + exd_tsk(); // if we are not killed first + + intercount++; // shouldn't happen +} + +void task3( unsigned int arg ) +{ + CYG_TEST_FAIL( "How come I'm being run?" ); +} + +void task4( unsigned int arg ) +{ + CYG_TEST_FAIL( "How come I'm being run?" ); +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF testcx8.cxx diff --git a/packages/compat/uitron/current/tests/testcx9.cxx b/packages/compat/uitron/current/tests/testcx9.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/testcx9.cxx @@ -0,0 +1,483 @@ +//=========================================================================== +// +// testcx9.cxx +// +// uITRON "C++" test program nine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-10-16 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* test configuration for enough fixed memory pools */ \ + defined( CYGPKG_UITRON_MEMPOOLFIXED ) && \ + (CYGNUM_UITRON_MEMPOOLFIXED >= 3) && \ + (CYGNUM_UITRON_MEMPOOLFIXED < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLFIXED_INITIALLY >= 3 ) && \ + \ + /* test configuration for enough variable mempools */ \ + defined( CYGPKG_UITRON_MEMPOOLVAR ) && \ + (CYGNUM_UITRON_MEMPOOLVAR >= 3) && \ + (CYGNUM_UITRON_MEMPOOLVAR < 90) && \ + ( !defined(CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE) || \ + CYGNUM_UITRON_MEMPOOLVAR_INITIALLY >= 3 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +VP vp; + +T_CMPL t_cmpl = { NULL, 0, 1000 }; +T_RMPL t_rmpl; +T_CMPF t_cmpf = { NULL, 0, 10, 100 }; +T_RMPF t_rmpf; + + +extern "C" { + void task1( unsigned int arg ); + void task2( unsigned int arg ); + void task3( unsigned int arg ); + void task4( unsigned int arg ); +} + +void task1( unsigned int arg ) +{ + ER ercd; + int tests = 0; + + CYG_TEST_INFO( "Task 1 running" ); + + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 2, 22222 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 2, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_mpf( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mpf bad ercd !E_ID" ); + ercd = del_mpf( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mpf bad ercd !E_ID" ); + ercd = cre_mpf( -6, &t_cmpf ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mpf bad ercd !E_ID" ); + ercd = cre_mpf( 99, &t_cmpf ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mpf bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + // [first get a valid block from it for the freeing test later] + ercd = pget_blf( &vp, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blf bad ercd" ); + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_mpf bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_mpf( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + // check it is deleted + ercd = rel_blf( 3, vp ); // vp did come from this pool + CYG_TEST_CHECK( E_NOEXS == ercd, "rel_blf bad ercd !E_NOEXS" ); + ercd = pget_blf( &vp, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blf bad ercd !E_NOEXS" ); + ercd = tget_blf( &vp, 3, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "tget_blf bad ercd !E_NOEXS" ); + ercd = get_blf( &vp, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blf bad ercd !E_NOEXS" ); + ercd = ref_mpf( &t_rmpf, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_mpf bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_mpf( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_mpf bad ercd !E_PAR" ); +#endif + t_cmpf.mpfatr = 0xfff; + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_mpf bad ercd !E_RSATR" ); +#endif // we can test bad param error returns + t_cmpf.mpfatr = 0; + t_cmpf.mpfcnt = 10000; + t_cmpf.blfsz = 100; + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_NOMEM == ercd, "cre_mpf bad ercd" ); + t_cmpf.mpfcnt = 100; + t_cmpf.blfsz = 100000; + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_NOMEM == ercd, "cre_mpf bad ercd" ); + // now create it well + t_cmpf.mpfatr = 0; + t_cmpf.mpfcnt = 10; + t_cmpf.blfsz = 100; + ercd = cre_mpf( 3, &t_cmpf ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpf bad ercd" ); + // and check we can use it + ercd = pget_blf( &vp, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blf bad ercd" ); + ercd = tget_blf( &vp, 3, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blf bad ercd" ); + ercd = get_blf( &vp, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "get_blf bad ercd" ); + ercd = rel_blf( 3, vp ); // vp did come from new pool + CYG_TEST_CHECK( E_OK == ercd, "rel_blf bad ercd" ); + ercd = rel_blf( 3, vp ); // vp already freed + CYG_TEST_CHECK( E_PAR == ercd, "rel_blf bad ercd !E_PAR" ); + ercd = ref_mpf( &t_rmpf, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpf bad ercd" ); + + // In order to wait on the pools, we must first consume all they have: + while ( E_OK == (ercd = pget_blf( &vp, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + while ( E_OK == (ercd = tget_blf( &vp, 2, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf bad ercd !E_TMOUT" ); + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = get_blf( &vp, 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "get_blf bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = tget_blf( &vp, 2, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "tget_blf bad ercd !E_DLT" ); + // check they are deleted + ercd = get_blf( &vp, 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blf bad ercd !E_NOEXS" ); + ercd = pget_blf( &vp, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blf bad ercd !E_NOEXS" ); + + // re-create and do it again + t_cmpf.mpfcnt = 90; + t_cmpf.blfsz = 20; + ercd = cre_mpf( 1, &t_cmpf ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpf bad ercd" ); + t_cmpf.mpfcnt = 5; + t_cmpf.blfsz = 200; + ercd = cre_mpf( 2, &t_cmpf ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpf bad ercd" ); + + // In order to wait on the pools, we must first consume all they have: + while ( E_OK == (ercd = pget_blf( &vp, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blf bad ercd !E_TMOUT" ); + while ( E_OK == (ercd = tget_blf( &vp, 2, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blf bad ercd !E_TMOUT" ); + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = get_blf( &vp, 1 ); + CYG_TEST_CHECK( E_DLT == ercd, "get_blf bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = tget_blf( &vp, 2, 10 ); + CYG_TEST_CHECK( E_DLT == ercd, "tget_blf bad ercd !E_DLT" ); + // check they are deleted + ercd = tget_blf( &vp, 1, 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blf bad ercd !E_NOEXS" ); + ercd = get_blf( &vp, 2 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blf bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete fixed mempools"); +#endif // CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + tests++; +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = del_mpl( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mpl bad ercd !E_ID" ); + ercd = del_mpl( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "del_mpl bad ercd !E_ID" ); + ercd = cre_mpl( -6, &t_cmpl ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mpl bad ercd !E_ID" ); + ercd = cre_mpl( 99, &t_cmpl ); + CYG_TEST_CHECK( E_ID == ercd, "cre_mpl bad ercd !E_ID" ); +#endif // we can test bad param error returns + // try a pre-existing object + // [first get a valid block from it for the freeing test later] + ercd = pget_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blk bad ercd" ); + ercd = cre_mpl( 3, &t_cmpl ); + CYG_TEST_CHECK( E_OBJ == ercd, "cre_mpl bad ercd !E_OBJ" ); + // delete it so we can play + ercd = del_mpl( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + // check it is deleted + ercd = rel_blk( 3, vp ); // vp did come from this pool + CYG_TEST_CHECK( E_NOEXS == ercd, "rel_blk bad ercd !E_NOEXS" ); + ercd = pget_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blk bad ercd !E_NOEXS" ); + ercd = tget_blk( &vp, 3, 100, 10 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "tget_blk bad ercd !E_NOEXS" ); + ercd = get_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blk bad ercd !E_NOEXS" ); + ercd = ref_mpl( &t_rmpl, 3 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "ref_mpl bad ercd !E_NOEXS" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + // now try creating it (badly) +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = cre_mpl( 3, NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "cre_mpl bad ercd !E_PAR" ); +#endif + t_cmpl.mplatr = 0xfff; + ercd = cre_mpl( 3, &t_cmpl ); + CYG_TEST_CHECK( E_RSATR == ercd, "cre_mpl bad ercd !E_RSATR" ); +#endif // we can test bad param error returns + t_cmpl.mplatr = 0; + t_cmpl.mplsz = 100000000; + ercd = cre_mpl( 3, &t_cmpl ); + CYG_TEST_CHECK( E_NOMEM == ercd, "cre_mpl bad ercd" ); + // now create it well + t_cmpl.mplatr = 0; + t_cmpl.mplsz = 1000; + ercd = cre_mpl( 3, &t_cmpl ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpl bad ercd" ); + // and check we can use it + ercd = pget_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "pget_blk bad ercd" ); + ercd = pget_blk( &vp, 3, 100000000 ); // way too large + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + ercd = tget_blk( &vp, 3, 100, 10 ); + CYG_TEST_CHECK( E_OK == ercd, "tget_blk bad ercd" ); + ercd = get_blk( &vp, 3, 100 ); + CYG_TEST_CHECK( E_OK == ercd, "get_blk bad ercd" ); + ercd = rel_blk( 3, vp ); // vp did come from new pool + CYG_TEST_CHECK( E_OK == ercd, "rel_blk bad ercd" ); + ercd = rel_blk( 3, vp ); // vp already freed + CYG_TEST_CHECK( E_PAR == ercd, "rel_blk bad ercd !E_PAR" ); + ercd = ref_mpl( &t_rmpl, 3 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_mpl bad ercd" ); + + // In order to wait on the pools, we must first consume all they have: + while ( E_OK == (ercd = pget_blk( &vp, 1, 100 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + while ( E_OK == (ercd = tget_blk( &vp, 2, 100, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk bad ercd !E_TMOUT" ); + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = get_blk( &vp, 1, 200 ); + CYG_TEST_CHECK( E_DLT == ercd, "get_blk bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = tget_blk( &vp, 2, 100, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "tget_blk bad ercd !E_DLT" ); + // check they are deleted + ercd = get_blk( &vp, 1, 200 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blk bad ercd !E_NOEXS" ); + ercd = pget_blk( &vp, 2, 20 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blk bad ercd !E_NOEXS" ); + + // re-create and do it again + ercd = cre_mpl( 1, &t_cmpl ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpl bad ercd" ); + ercd = cre_mpl( 2, &t_cmpl ); + CYG_TEST_CHECK( E_OK == ercd, "cre_mpl bad ercd" ); + + // In order to wait on the pools, we must first consume all they have: + while ( E_OK == (ercd = pget_blk( &vp, 1, 20 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "pget_blk bad ercd !E_TMOUT" ); + while ( E_OK == (ercd = tget_blk( &vp, 2, 400, 1 )) ) /* nothing */; + CYG_TEST_CHECK( E_TMOUT == ercd, "tget_blk bad ercd !E_TMOUT" ); + // now wait while task 2 deletes the wait objects + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = get_blk( &vp, 1, 200 ); + CYG_TEST_CHECK( E_DLT == ercd, "get_blk bad ercd !E_DLT" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = tget_blk( &vp, 2, 500, 20 ); + CYG_TEST_CHECK( E_DLT == ercd, "tget_blk bad ercd !E_DLT" ); + // check they are deleted + ercd = tget_blk( &vp, 1, 200, 1 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "get_blk bad ercd !E_NOEXS" ); + ercd = get_blk( &vp, 2, 20 ); + CYG_TEST_CHECK( E_NOEXS == ercd, "pget_blk bad ercd !E_NOEXS" ); + + CYG_TEST_PASS("create/delete variable mempools"); +#endif // CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + + ercd = ter_tsk( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ter_tsk bad ercd" ); + ercd = dly_tsk( 5 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + // all done + if ( 0 == tests ) { + CYG_TEST_PASS( "N/A: no objects have create/delete enabled" ); + CYG_TEST_EXIT( "N/A" ); + } + else { + CYG_TEST_EXIT( "All done" ); + } + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + int i; + CYG_TEST_INFO( "Task 2 running" ); + ercd = get_tid( &i ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == i, "tid not 2" ); + if ( 22222 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 22222" ); + + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + +#ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + ercd = del_mpf( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpf( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpf( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpf( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpf bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE + +#ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + ercd = del_mpl( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpl( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpl( 1 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); + ercd = del_mpl( 2 ); + CYG_TEST_CHECK( E_OK == ercd, "del_mpl bad ercd" ); + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk bad ercd" ); +#endif // CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE + + // we expect task2 to be killed here + CYG_TEST_FAIL( "Task 2 ran to completion!" ); +} + +void task3( unsigned int arg ) +{ +} + +void task4( unsigned int arg ) +{ +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF testcx9.cxx diff --git a/packages/compat/uitron/current/tests/testcxx.cxx b/packages/compat/uitron/current/tests/testcxx.cxx new file mode 100644 --- /dev/null +++ b/packages/compat/uitron/current/tests/testcxx.cxx @@ -0,0 +1,807 @@ +//=========================================================================== +// +// testcxx.cxx +// +// uITRON "C++" test program +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-13 +// Purpose: uITRON API testing +// Description: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +#include // uITRON setup CYGNUM_UITRON_SEMAS + // CYGPKG_UITRON et al +#include // testing infrastructure + +#ifdef CYGPKG_UITRON // we DO want the uITRON package + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE // we DO want prioritized threads + +#ifdef CYGFUN_KERNEL_THREADS_TIMER // we DO want timout-able calls + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK // we DO want the realtime clock + +// we're OK if it's C++ or neither of those two is defined: +#if defined( __cplusplus ) || \ + (!defined( CYGIMP_UITRON_INLINE_FUNCS ) && \ + !defined( CYGIMP_UITRON_CPP_OUTLINE_FUNCS) ) + +// =================== TEST CONFIGURATION =================== +#if \ + /* test configuration for enough tasks */ \ + (CYGNUM_UITRON_TASKS >= 4) && \ + (CYGNUM_UITRON_TASKS < 90) && \ + (CYGNUM_UITRON_START_TASKS == 1) && \ + ( !defined(CYGPKG_UITRON_TASKS_CREATE_DELETE) || \ + CYGNUM_UITRON_TASKS_INITIALLY >= 4 ) && \ + \ + /* the end of the large #if statement */ \ + 1 + +// ============================ END ============================ + + + +#include // uITRON + +externC void +cyg_package_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_INFO( "Calling cyg_uitron_start()" ); + cyg_uitron_start(); +} + +volatile int intercom = 0; +volatile int intercount = 0; +INT scratch = 0; + +extern "C" { + void task1( unsigned int arg ); + void task2( unsigned int arg ); + void task3( unsigned int arg ); + void task4( unsigned int arg ); +} + + +#ifndef CYGSEM_KERNEL_SCHED_TIMESLICE +#define TIMESLICEMSG "Assuming no kernel timeslicing" +#define TSGO() (1) +#define TSRELEASE() CYG_EMPTY_STATEMENT +#define TSSTOP() CYG_EMPTY_STATEMENT +#define TSLOCK() CYG_EMPTY_STATEMENT +#define TSUNLOCK() CYG_EMPTY_STATEMENT +#define ICWAIT( _i_ ) CYG_EMPTY_STATEMENT + +#else +// Now follow some nasty bodges to control the scheduling when basically it +// isn't controlled ie. timeslicing is on. It's bodgy because we're +// testing normal synchronization methods, so we shouldn't rely on them for +// comms between threads here. Instead there's a mixture of communicating +// via a flag (ts_interlock) which stops the "controlled" thread running +// away, and waiting for the controlled thread to run enough for us. +// +// Tasks 3 and 4 are waited for by the control task: task 3 locks the +// scheduler so is immediately descheduled when it unlocks it, task 4 does +// waiting-type operations, so we must give it chance to run by yielding a +// few times ourselves. Note the plain constant in ICWAIT() below. + +#define TIMESLICEMSG "Assuming kernel timeslicing ENABLED" +volatile int ts_interlock = 0; +#define TSGO() (ts_interlock) +#define TSRELEASE() ts_interlock = 1 +#define TSSTOP() ts_interlock = 0 + +#define TSLOCK() CYG_MACRO_START \ + ER ercd2 = dis_dsp(); \ + CYG_TEST_CHECK( E_OK == ercd2, "dis_dsp (TSLOCK) bad ercd2" ); \ +CYG_MACRO_END + +#define TSUNLOCK() CYG_MACRO_START \ + ER ercd3 = ena_dsp(); \ + CYG_TEST_CHECK( E_OK == ercd3, "ena_dsp (TSUNLOCK) bad ercd3" ); \ +CYG_MACRO_END + +#define ICWAIT( _i_ ) CYG_MACRO_START \ + int loops; \ + for ( loops = 3; (0 < loops) || ((_i_) > intercount); loops-- ) { \ + ER ercd4 = rot_rdq( 0 ); /* yield */ \ + CYG_TEST_CHECK( E_OK == ercd4, "rot_rdq (ICWAIT) bad ercd4" ); \ + } \ +CYG_MACRO_END +#endif // CYGSEM_KERNEL_SCHED_TIMESLICE + +/* +#define IC() \ +CYG_MACRO_START \ + static char *msgs[] = { "ZERO", "ONE", "TWO", "THREE", "FOUR", "LOTS" }; \ + CYG_TEST_INFO( msgs[ intercount > 5 ? 5 : intercount ] ); \ +CYG_MACRO_END +*/ + +// #define CYG_TEST_UITRON_TEST1_LOOPING 1 + +void task1( unsigned int arg ) +{ + ER ercd; + T_RTSK ref_tskd; + +#ifdef CYG_TEST_UITRON_TEST1_LOOPING + while ( 1 ) { +#endif // CYG_TEST_UITRON_TEST1_LOOPING + + CYG_TEST_INFO( "Task 1 running" ); + CYG_TEST_INFO( TIMESLICEMSG ); + + intercom = 0; + intercount = 0; + + CYG_TEST_INFO( "Testing get_tid and ref_tsk" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 1 == scratch, "tid not 1" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = get_tid( NULL ); + CYG_TEST_CHECK( E_PAR == ercd, "get_tid bad ercd !E_PAR" ); +#endif + ercd = ref_tsk( &ref_tskd, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_tsk bad ercd !E_ID" ); + ercd = ref_tsk( &ref_tskd, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "ref_tsk bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = ref_tsk( NULL, 1 ); + CYG_TEST_CHECK( E_PAR == ercd, "ref_tsk bad ercd !E_PAR" ); +#endif +#endif // we can test bad param error returns + ercd = ref_tsk( &ref_tskd, 1 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_RUN == ref_tskd.tskstat, "Bad task status 1" ); + ercd = ref_tsk( &ref_tskd, 0 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_RUN == ref_tskd.tskstat, "Bad task status 0" ); + ercd = ref_tsk( &ref_tskd, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_DMT == ref_tskd.tskstat, "Bad task status 2" ); + CYG_TEST_CHECK( 2 == ref_tskd.tskpri, "Bad task prio 2" ); + + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rsm_tsk DMT bad ercd !E_OBJ" ); + ercd = frsm_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "frsm_tsk DMT bad ercd !E_OBJ" ); + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai DMT bad ercd !E_OBJ" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "sus_tsk DMT bad ercd !E_OBJ" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "wup_tsk DMT bad ercd !E_OBJ" ); + ercd = can_wup( &scratch, 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "can_wup DMT bad ercd !E_OBJ" ); + + CYG_TEST_PASS( "get_tid, ref_tsk" ); + + CYG_TEST_INFO( "Testing prio change and start task" ); + ercd = sta_tsk( 2, 99 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + + // drop pri of task 2 + ercd = chg_pri( 2, 4 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ref_tsk( &ref_tskd, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( TTS_RDY == ref_tskd.tskstat, "Bad task status 2" ); + CYG_TEST_CHECK( 4 == ref_tskd.tskpri, "Bad task prio 2" ); + + // drop our pri below task 2 + ercd = chg_pri( 0, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + + ercd = ref_tsk( &ref_tskd, 1 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( 5 == ref_tskd.tskpri, "Bad task prio 1" ); + ercd = ref_tsk( &ref_tskd, 0 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + CYG_TEST_CHECK( 5 == ref_tskd.tskpri, "Bad task prio 0" ); + ercd = ref_tsk( &ref_tskd, 2 ); + CYG_TEST_CHECK( E_OK == ercd, "ref_tsk bad ercd" ); + // it will have run to completion and regained its original prio + CYG_TEST_CHECK( 2 == ref_tskd.tskpri, "Bad task prio 2" ); + CYG_TEST_CHECK( TTS_DMT == ref_tskd.tskstat, "Bad task status 2" ); + + // retest these now that the task has executed once + ercd = rsm_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rsm_tsk DMT bad ercd !E_OBJ" ); + ercd = frsm_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "frsm_tsk DMT bad ercd !E_OBJ" ); + ercd = rel_wai( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "rel_wai DMT bad ercd !E_OBJ" ); + ercd = sus_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "sus_tsk DMT bad ercd !E_OBJ" ); + ercd = wup_tsk( 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "wup_tsk DMT bad ercd !E_OBJ" ); + ercd = can_wup( &scratch, 2 ); + CYG_TEST_CHECK( E_OBJ == ercd, "can_wup DMT bad ercd !E_OBJ" ); + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = chg_pri( -6, 9 ); + CYG_TEST_CHECK( E_ID == ercd, "chg_pri bad ercd !E_ID" ); + ercd = chg_pri( 99, 9 ); + CYG_TEST_CHECK( E_ID == ercd, "chg_pri bad ercd !E_ID" ); + ercd = sta_tsk( -6, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "sta_tsk bad ercd !E_ID" ); + ercd = sta_tsk( 99, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "sta_tsk bad ercd !E_ID" ); +#endif // we can test bad param error returns + + CYG_TEST_PASS( "sta_tsk, chg_pri" ); + + CYG_TEST_INFO( "Testing delay and dispatch disabling" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "dly_tsk bad ercd !E_CTX" ); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_CTX == ercd, "dly_tsk bad ercd !E_CTX" ); +#endif // we can test bad param error returns + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = dly_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + CYG_TEST_PASS( "dly_tsk, ena_dsp, dis_dsp" ); + + CYG_TEST_INFO( "Testing ready queue manipulation" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ercd = rot_rdq( 4 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ercd = rot_rdq( 5 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = rot_rdq( -6 ); + CYG_TEST_CHECK( E_PAR == ercd, "rot_rdq bad ercd !E_PAR" ); + ercd = rot_rdq( 99 ); + CYG_TEST_CHECK( E_PAR == ercd, "rot_rdq bad ercd !E_PAR" ); +#endif // we can test bad param error returns + + CYG_TEST_PASS( "rot_rdq" ); + + CYG_TEST_INFO( "Testing suspend/resume" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = sus_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "sus_tsk bad ercd !E_ID" ); + ercd = sus_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "sus_tsk bad ercd !E_ID" ); + ercd = rsm_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "rsm_tsk bad ercd !E_ID" ); + ercd = rsm_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "rsm_tsk bad ercd !E_ID" ); + ercd = frsm_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "frsm_tsk bad ercd !E_ID" ); + ercd = frsm_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "frsm_tsk bad ercd !E_ID" ); +#endif // we can test bad param error returns + // drop task 3 pri to same as us + CYG_TEST_CHECK( 0 == intercount, "intercount != 0" ); + + intercom = 3; // tell T3 to loop + TSRELEASE(); + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 3, 66 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 3, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 1 ); + CYG_TEST_CHECK( 1 == intercount, "intercount != 1" ); + ercd = sus_tsk( 3 ); + TSRELEASE(); + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + intercom = 0; // bad data to T3 + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 1 == intercount, "intercount != 1" ); + intercom = 3; // tell T3 to loop + TSRELEASE(); + ercd = rsm_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 2 ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + + CYG_TEST_INFO( "Command task 3 inner loop stop" ); + intercom = 2 + 4; + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + + ercd = sus_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + intercom = 0; // bad data to T3 + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ercd = sus_tsk( 3 ); // suspend AGAIN + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + ercd = sus_tsk( 3 ); // AND AGAIN + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + ercd = rsm_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + ercd = rsm_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + intercom = 3; // tell T3 to loop + TSRELEASE(); + ercd = rsm_tsk( 3 ); // expect restart this time + CYG_TEST_CHECK( E_OK == ercd, "rsm_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 3 ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + + CYG_TEST_INFO( "Command task 3 inner loop stop 2" ); + intercom = 2 + 4; + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + + ercd = sus_tsk( 3 ); + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + intercom = 0; // bad data to T3 + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + ercd = sus_tsk( 3 ); // suspend AGAIN + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + ercd = sus_tsk( 3 ); // AND AGAIN + CYG_TEST_CHECK( E_OK == ercd, "sus_tsk bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + intercom = 3; // tell T3 to loop + TSRELEASE(); + ercd = frsm_tsk( 3 ); // expect restart this time + CYG_TEST_CHECK( E_OK == ercd, "frsm_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 4 ); + CYG_TEST_CHECK( 4 == intercount, "intercount != 4" ); + + TSRELEASE(); + ercd = rsm_tsk( 3 ); // try it again + CYG_TEST_CHECK( E_OBJ == ercd, "rsm_tsk bad ercd !E_OBJ" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 5 ); + CYG_TEST_CHECK( 5 == intercount, "intercount != 5" ); + + TSRELEASE(); + ercd = frsm_tsk( 3 ); // try it again + CYG_TEST_CHECK( E_OBJ == ercd, "frsm_tsk bad ercd !E_OBJ" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 6 ); + CYG_TEST_CHECK( 6 == intercount, "intercount != 6" ); + + CYG_TEST_INFO( "Command task 3 all loops stop" ); + intercom = 4 + 8; + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 6 == intercount, "intercount != 6" ); + + intercom = intercount = 0; + + CYG_TEST_PASS( "sus_tsk, rsm_tsk, frsm_tsk" ); + + CYG_TEST_INFO( "Testing sleep/wakeup stuff" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = wup_tsk( -6 ); + CYG_TEST_CHECK( E_ID == ercd, "wup_tsk bad ercd !E_ID" ); + ercd = wup_tsk( 99 ); + CYG_TEST_CHECK( E_ID == ercd, "wup_tsk bad ercd !E_ID" ); + ercd = can_wup( &scratch, -6 ); + CYG_TEST_CHECK( E_ID == ercd, "can_wup bad ercd !E_ID" ); + ercd = can_wup( &scratch, 99 ); + CYG_TEST_CHECK( E_ID == ercd, "can_wup bad ercd !E_ID" ); +#ifndef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR + ercd = can_wup( NULL, 2 ); + CYG_TEST_CHECK( E_PAR == ercd, "can_wup bad ercd !E_PAR" ); +#endif + + ercd = wup_tsk( 0 ); // not ourself + CYG_TEST_CHECK( E_ID == ercd, "wup_tsk bad ercd !E_ID" ); + ercd = wup_tsk( 1 ); // ourself + CYG_TEST_CHECK( E_OBJ == ercd, "wup_tsk bad ercd !E_OBJ" ); +#endif // we can test bad param error returns + +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = tslp_tsk( -6 ); + CYG_TEST_CHECK( E_PAR == ercd, "tslp_tsk bad ercd !E_PAR" ); +#endif // we can test bad param error returns + ercd = tslp_tsk( TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); + ercd = tslp_tsk( 5 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); +#ifdef CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = tslp_tsk( TMO_FEVR ); + CYG_TEST_CHECK( E_CTX == ercd, "tslp_tsk bad ercd !E_CTX" ); + ercd = tslp_tsk( TMO_POL ); + CYG_TEST_CHECK( E_CTX == ercd, "tslp_tsk bad ercd !E_CTX" ); + ercd = tslp_tsk( 5 ); + CYG_TEST_CHECK( E_CTX == ercd, "tslp_tsk bad ercd !E_CTX" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + ercd = tslp_tsk( -6 ); + CYG_TEST_CHECK( E_PAR == ercd, "tslp_tsk bad ercd !E_PAR" ); +#endif // we can test bad param error returns + ercd = tslp_tsk( TMO_POL ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); + ercd = tslp_tsk( 5 ); + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); + + // drop task 4 pri to same as us + intercount = 0; + intercom = 1; // test plain slp_tsk + TSRELEASE(); + ercd = chg_pri( 4, 5 ); + CYG_TEST_CHECK( E_OBJ == ercd, "chg_pri bad ercd" ); + + ercd = dis_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "dis_dsp bad ercd" ); + ercd = sta_tsk( 4, 77 ); + CYG_TEST_CHECK( E_OK == ercd, "sta_tsk bad ercd" ); + ercd = chg_pri( 4, 5 ); + CYG_TEST_CHECK( E_OK == ercd, "chg_pri bad ercd" ); + ercd = ena_dsp(); + CYG_TEST_CHECK( E_OK == ercd, "ena_dsp bad ercd" ); + + ercd = wup_tsk( 4 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 1 ); + CYG_TEST_CHECK( 1 == intercount, "intercount != 1" ); + intercom = 2; // test tslp_tsk + TSRELEASE(); + ercd = wup_tsk( 4 ); + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 2 ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + intercom = 3; // test tslp_tsk + TSRELEASE(); + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 2 == intercount, "intercount != 2" ); + intercom = 1; // test slp_tsk next... + ercd = dly_tsk( 20 ); // without a wup + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + ICWAIT( 3 ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + + intercom = 1; // ...test slp_tsk + TSRELEASE(); + ercd = dly_tsk( 20 ); // without a wup (yet) + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + TSRELEASE(); + ercd = tslp_tsk( 20 ); // yield again + CYG_TEST_CHECK( E_TMOUT == ercd, "tslp_tsk bad ercd !E_TMOUT" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); // and again + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 3 == intercount, "intercount != 3" ); + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rot_rdq( 0 ); // and yield + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 4 ); + CYG_TEST_CHECK( 4 == intercount, "intercount != 4" ); + + intercom = 1; // test slp_tsk + TSRELEASE(); + ercd = dly_tsk( 20 ); // without a wup (yet) + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 4 == intercount, "intercount != 4" ); + + // this wup will restart it when we yield: + TSLOCK(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + // these will count up: + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + scratch = -1; + ercd = can_wup( &scratch, 4 ); + CYG_TEST_CHECK( E_OK == ercd, "can_wup bad ercd" ); + CYG_TEST_CHECK( 2 == scratch, "Cancelled wups not 2" ); + CYG_TEST_CHECK( 4 == intercount, "intercount != 4" ); + TSUNLOCK(); + + intercom = 4; // do nothing + TSRELEASE(); + ercd = rot_rdq( 0 ); // and yield + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 5 ); + CYG_TEST_CHECK( 5 == intercount, "intercount != 5" ); + TSRELEASE(); + ercd = dly_tsk( 20 ); // let it do nothing + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + TSRELEASE(); + ercd = dly_tsk( 20 ); // lots of wups but no sleep + CYG_TEST_CHECK( E_OK == ercd, "dly_tsk bad ercd" ); + CYG_TEST_CHECK( 5 == intercount, "intercount != 5" ); + scratch = -1; + ercd = can_wup( &scratch, 4 ); + CYG_TEST_CHECK( E_OK == ercd, "can_wup bad ercd" ); + CYG_TEST_CHECK( 3 == scratch, "Cancelled wups not 3" ); + // now check that they are cancelled by doing a wait again + intercom = 1; // test slp_tsk + TSRELEASE(); + ercd = rot_rdq( 0 ); // still without a wup + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); // still without a wup + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + intercom = 4; // do nothing next + TSRELEASE(); + ICWAIT( 6 ); + CYG_TEST_CHECK( 6 == intercount, "intercount != 6" ); + ercd = rot_rdq( 0 ); // still without a wup + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 6 == intercount, "intercount != 6" ); + TSRELEASE(); + ercd = wup_tsk( 4 ); // now issue a wup + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + ercd = rot_rdq( 0 ); // it will run now + CYG_TEST_CHECK( E_OK == ercd, "wup_tsk bad ercd" ); + TSRELEASE(); + ercd = rot_rdq( 0 ); // it will run now + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 7 ); + CYG_TEST_CHECK( 7 == intercount, "intercount != 7" ); + + TSRELEASE(); + intercom = 99; // exit, all done + ercd = rot_rdq( 0 ); // let it run + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + ICWAIT( 8 ); + CYG_TEST_CHECK( 8 == intercount, "intercount != 8" ); + + TSRELEASE(); + ercd = rot_rdq( 0 ); // let it run + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq bad ercd" ); + CYG_TEST_CHECK( 8 == intercount, "intercount != 8" ); + + CYG_TEST_PASS( "wup_tsk, can_wup, slp_tsk, tslp_tsk" ); + +#ifdef CYG_TEST_UITRON_TEST1_LOOPING + chg_pri( 1, 1 ); + rot_rdq( 0 ); + ter_tsk( 2 ); + rot_rdq( 0 ); + ter_tsk( 3 ); + rot_rdq( 0 ); + ter_tsk( 4 ); + rot_rdq( 0 ); + } +#endif // CYG_TEST_UITRON_TEST1_LOOPING + + CYG_TEST_EXIT( "All done" ); + ext_tsk(); +} + + + +void task2( unsigned int arg ) +{ + ER ercd; + CYG_TEST_PASS( "Task 2 running" ); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 2 == scratch, "tid not 2" ); + if ( 99 != arg ) + CYG_TEST_FAIL( "Task 2 arg not 99" ); + ext_tsk(); + CYG_TEST_FAIL( "Task 2 failed to exit" ); +} + +void task3( unsigned int arg ) +{ + ER ercd; + TSLOCK(); + CYG_TEST_PASS("Task3 running"); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 3 == scratch, "tid not 3" ); + if ( 66 != arg ) + CYG_TEST_FAIL( "Task 3 arg not 66" ); + + while ( 2 & intercom ) { + while ( 1 & intercom ) { + intercount++; + TSSTOP(); + do { + TSUNLOCK(); + ercd = rot_rdq( 0 ); // yield() + TSLOCK(); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq 1 (task3) bad ercd" ); + } while ( !TSGO() ); + } + CYG_TEST_CHECK( 4 & intercom, "should not have got here yet 1" ); + TSSTOP(); + do { + TSUNLOCK(); + ercd = rot_rdq( 0 ); // yield() + TSLOCK(); + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq 2 (task3) bad ercd" ); + } while ( !TSGO() ); + } + CYG_TEST_CHECK( 8 & intercom, "should not have got here yet 2" ); + + TSUNLOCK(); + ext_tsk(); + CYG_TEST_FAIL( "Task 3 failed to exit" ); +} + +void task4( unsigned int arg ) +{ + ER ercd; + CYG_TEST_PASS("Task4 running"); + ercd = get_tid( &scratch ); + CYG_TEST_CHECK( E_OK == ercd, "get_tid bad ercd" ); + CYG_TEST_CHECK( 4 == scratch, "tid not 4" ); + if ( 77 != arg ) + CYG_TEST_FAIL( "Task 4 arg not 77" ); + while ( 1 ) { + switch ( intercom ) { + case 1: + ercd = slp_tsk(); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk (task4) bad ercd" ); + break; + case 2: + ercd = tslp_tsk( 10 ); + CYG_TEST_CHECK( E_OK == ercd, "slp_tsk (task4) bad ercd" ); + break; + case 3: + ercd = tslp_tsk( 10 ); + CYG_TEST_CHECK( E_TMOUT == ercd, + "slp_tsk (task4) bad ercd !E_TMOUT" ); + break; + case 4: + // busily do nothing + while ( 4 == intercom ) { + ercd = rot_rdq( 0 ); + CYG_TEST_CHECK( E_OK == ercd, + "rot_rdq (task4 idle) bad ercd" ); + } + break; + case 99: + goto out; + default: + CYG_TEST_FAIL( "Task 4 bad intercom" ); + goto out; + } + intercount++; + TSSTOP(); + do { + ercd = rot_rdq( 0 ); // yield() + CYG_TEST_CHECK( E_OK == ercd, "rot_rdq (task4) bad ercd" ); + } while ( !TSGO() ); + } +out: + ext_tsk(); + CYG_TEST_FAIL( "Task 4 failed to exit" ); +} + +#else // not enough (or too many) uITRON objects configured in +#define N_A_MSG "not enough uITRON objects to run test" +#endif // not enough (or too many) uITRON objects configured in +#else // not C++ and some C++ specific options enabled +#define N_A_MSG "C++ specific options selected but this is C" +#endif // not C++ and some C++ specific options enabled +#else // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#define N_A_MSG "no CYGVAR_KERNEL_COUNTERS_CLOCK" +#endif // ! CYGVAR_KERNEL_COUNTERS_CLOCK - can't test without it +#else // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#define N_A_MSG "no CYGFUN_KERNEL_THREADS_TIMER" +#endif // ! CYGFUN_KERNEL_THREADS_TIMER - can't test without it +#else // ! CYGIMP_THREAD_PRIORITY - can't test without it +#define N_A_MSG "no CYGSEM_KERNEL_SCHED_MLQUEUE" +#endif // ! CYGSEM_KERNEL_SCHED_MLQUEUE - can't test without it +#else // ! CYGPKG_UITRON +#define N_A_MSG "uITRON Compatibility layer disabled" +#endif // CYGPKG_UITRON + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS( "N/A: " N_A_MSG ); + CYG_TEST_EXIT( "N/A" ); +} +#endif // N_A_MSG defined ie. we are N/A. + +// EOF testcxx.cxx diff --git a/packages/devs/common/current/ChangeLog b/packages/devs/common/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/ChangeLog @@ -0,0 +1,172 @@ +Mon Oct 19 18:54:22 1998 Jonathan Larmour + + * include/pkgconf/devs.h: + Don't cause an error if the kernel is disabled. Instead simply + leave out most of the defines beneath + + * include/iorb.h: + Remove unnecessary include of , and + replace with include of + +1998-10-19 Mark Galassi + + * include/pkgconf/devs.h: updated the doc URL + +Sun Sep 27 09:50:57 1998 Jesper Skov + PR 17506 + + * src/table.cxx: Corrected ASSERT statements on set_baud_rate. + Cleaned up a few other functions which checked the return value of + the call and only did ASSERT if the return value was wrong. + +Thu Sep 17 11:32:02 1998 Jesper Skov + + * include/pkgconf/devs.h: Require CYGPKG_KERNEL in CDL. Protect + kernel.h inclusion by CYGPKG_KERNEL. + Declare CYG_DEVICE_SERIAL_RS232_MN10300_2_DECLARE if GDB_DEVICE is + not configured. + Don't include GDB_DEVICE if _RS232_MN10300_2 is not defined. + + * include/pkgconf/devices.h: Protect .hxx inclusion with #ifdef + __cplusplus. + GDB device only applicable to MN10300. + +Tue Sep 15 02:18:30 BST 1998 Chris Provenzano + + * include/pkgconf/devs.h: #define ...DECLARE instead of + #undef DO_NOT_DECLARE. Defining a positive is easier + to understand than not defining a negative. + + Only #define CYG_DEVICE_SERIAL_RS232_MN10300_2_DECLARE if we are + building the simulator. Otherwise declare the GDB pseudo device. + +1998-09-12 Bart Veer + + * include/pkgconf/devs.h: + Added missing descriptions (PR 17184) + +Fri Sep 11 11:01:33 1998 Jesper Skov + PR 17228, PR 17176 + + * src/table.cxx: Disable serial async read/write methods when + KMODE_INTERRUPT undefined. + + (Cyg_Device_Serial_RS232_mn10300_1_set_read_mode): + (Cyg_Device_Serial_RS232_mn10300_2_set_read_mode): + Inverted ASSERT expression. + + (Cyg_Device_Serial_RS232_mn10300_2_set_read_data): + (Cyg_Device_Serial_RS232_mn10300_1_set_read_data): + Corrected ASSERT expression. + + (Cyg_Device_Serial_RS232_tx39_set_line_mode): + (Cyg_Device_Serial_RS232_mn10300_2_set_line_mode): + (Cyg_Device_Serial_RS232_mn10300_1_set_line_mode): + Inverted ASSERT expression. + +1998-09-11 Bart Veer + + * include/pkgconf/devs.h: + Sorting out dependencies for error package. + +1998-09-03 Bart Veer + + * include/pkgconf/devs.h: + * include/pkgconf/devices.h: + Provide minimal support for configuration options. + +Thu Sep 3 15:53:01 1998 Jonathan Larmour + + * include/pkgconf/gdb_1.h, include/pkgconf/serial_mn10300_1.h, + include/pkgconf/serial_mn10300_2.h, + include/pkgconf/serial_tx39.h: + Move these pkgconf files into the packages that actually own them. + +Wed Sep 2 22:04:01 1998 Jonathan Larmour + + * include/pkgconf/serial_2.h, include/pkgconf/serial_mn10300_2.h: + Rename serial_2.h to serial_mn10300_2.h + + * include/pkgconf/devices.h, include/pkgconf/devs.h, + include/pkgconf/devs.h, serial_mn10300_2.h: + Change all mentions of serial_2.h to serial_mn10300_2.h and + all mentions of serial_mn10300.hxx to serial_mn10300_2.hxx + +Tue Sep 1 19:28:16 1998 Hugo Tyson + + * src/diag.cxx: + Use CYGDBG_INFRA_DIAG_USE_DEVICE (from infra.h) instead of + CYG_DIAG_USE_DEVICE (badly named, from kernel.h). + + * include/pkgconf/devs.h: + Correct a comment about CYGDBG_INFRA_DIAG_USE_DEVICE (from + infra.h) instead of CYG_DIAG_USE_DEVICE (badly named, from + kernel.h). + +Thu Aug 27 19:24:10 1998 Jonathan Larmour + + * include/pkgconf/serial_tx39.h: + Change CYG_DEVICE_SERIAL_RS232_TX39_DEFAULT_BAUD_RATE to 38400 from + 19200, in line with HAL. Fix for PR 16955 + +Wed Jul 29 17:45:10 BST 1998 Chris Provenzano + + * include/serial.hxx: Comment cleanup from the code review. + +Wed Jul 29 13:35:53 BST 1998 Chris Provenzano + + * include/pkgconf/serial_2.h: Generic cleanup. Correct + comments to match comments in other device configure files. + Remove mention of KMODE_ASSERT as it doesn't do anything. + +Tue Jul 28 19:12:49 BST 1998 Chris Provenzano + + * include/pkgconf/devs.h: Set the device name of the + device to test. + +Tue Jul 28 13:56:45 BST 1998 Chris Provenzano + + * src/table.cxx: Use macro device names instead of hardcoded + names. This fixes the TX39 build. + +Mon Jul 27 23:31:07 BST 1998 Chris Provenzano + + * include/pkgconf/devs.h, include/pkgconf/gdb_1.h + Code revies cleanup. + + * include/pkgconf/gdb_1.h, include/pkgconf/serial_mn10300_1.h + Remove CYG_DEVICE_..._KMODE_ASSERT configuration option. + Selective linking will DTRT for this option. + + * src/table.cxx + Use macro device names instead of hardcoded names. + +Mon Jul 27 17:33:59 BST 1998 Chris Provenzano + + * Changelog: Initial ChangeLog entry. + + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== + diff --git a/packages/devs/common/current/include/device.hxx b/packages/devs/common/current/include/device.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/include/device.hxx @@ -0,0 +1,69 @@ +#ifndef CYGONCE_DEVS_COMMON_DEVICE_HXX +#define CYGONCE_DEVS_COMMON_DEVICE_HXX + +//========================================================================== +// +// device.hxx +// +// Header file for the generic device data structure +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-20 +// Purpose: Define Cyg_Device data structure +// Description: This file contains the C++ class declaration of Cyg_Device. +// Cyg_Device is the base class for all devices. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include // tracing macros + +#include + +// ------------------------------------------------------------------------- +// Cyg_Device + +class Cyg_Device +{ + protected: + + // Accessor functions + void + set_iorb_pdevice( Cyg_IORB * iorb ) { iorb->set_pdevice( this ); } + + public: +}; + +#endif // CYGONCE_DEVS_COMMON_DEVICE_HXX +// End of device.hxx + diff --git a/packages/devs/common/current/include/iorb.h b/packages/devs/common/current/include/iorb.h new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/include/iorb.h @@ -0,0 +1,106 @@ +#ifndef CYGONCE_DEVS_COMMON_IORB_H +#define CYGONCE_DEVS_COMMON_IORB_H + +//========================================================================== +// +// iorb.h +// +// Header file for IORB data structure +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-20 +// Purpose: Define IORB data structure +// Description: This file contains the C/C++ struct declaration of Cyg_IORB. +// Cyg_IORB is the basic class for all device operations for +// both the C and C++ API. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include // tracing macros + +// ------------------------------------------------------------------------- +// Cyg_IORB + +/* + * This struct will be accessed by some ISR routines. Any field that is + * modified by an ISR routine must be declared volatile. Currently this + * includes next, ret_length, and resultstatus. + * + * Note: For next this means the pointer next is volatile not the contents. + */ +typedef struct Cyg_IORB_t +{ +#ifdef __cplusplus + friend class Cyg_Device; + + private: + Cyg_Device * pdevice; + + // Accessor functions + void set_pdevice(Cyg_Device * device) { pdevice = device; } + + public: + + // Accessor functions + Cyg_Device * + get_pdevice(void) { return(pdevice); } + +#else + // Make sure the C and C++ versions are the same size; + CYG_ADDRESS pdevice; +#endif + + struct Cyg_IORB_t * volatile next; + + void * buffer; // ptr to buffer + cyg_uint32 buffer_length; // length of buffer + volatile cyg_uint32 xferred_length; // length of buffer xferd + + cyg_uint8 opcode; // operation code + options + volatile cyg_uint8 status; // state, result + error code + + CYG_ADDRWORD callback_data; // data field for callback routine + void (*callback)( struct Cyg_IORB_t * piorb); +} Cyg_IORB; + +// opflags codes +#define CYG_IORB_NOBLOCK 0x01 // opcode for special serial reads + +// Resultstatus codes +#define CYG_IORB_OK 0x00 +#define CYG_IORB_CANCELED 0x02 + +#endif // CYGONCE_DEVS_COMMON_IORB_H +// End of iorb.h + diff --git a/packages/devs/common/current/include/pkgconf/devices.h b/packages/devs/common/current/include/pkgconf/devices.h new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/include/pkgconf/devices.h @@ -0,0 +1,89 @@ +#ifndef CYGONCE_PKGCONF_DEVICES_H +#define CYGONCE_PKGCONF_DEVICES_H +// ==================================================================== +// +// pkgconf/devices.h +// +// Device configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors:proven +// Date: 1998-04-24 +// Purpose: Contain #include for all the possible devices for the +// current configuration. All applications should include +// this file if they want to use the raw C++ device +// Eventually this file should be generated automatically. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +/* --------------------------------------------------------------------- + * Get the device configurations. + */ + +#include + +/* --------------------------------------------------------------------- + * Now #include the specific driver include file. + */ + +#ifdef __cplusplus + +#ifdef CYG_HAL_MN10300 +# ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_1 +# include +# endif +# ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_2 +# include +# endif +#endif + +#ifdef CYG_HAL_TX39 +# ifdef CYGPKG_DEVICES_SERIAL_RS232_TX39 +# include +# endif +#endif + +#ifdef CYGPKG_DEVICES_GDB +# include +#endif + +#ifdef CYGPKG_DEVICES_WALLCLOCK +# include +#endif + +#ifdef CYGPKG_DEVICES_WATCHDOG +# include +#endif + +#endif /* __cplusplus */ + +#endif /* CYGONCE_PKGCONF_DEVICES_H */ +/* EOF devices.h */ diff --git a/packages/devs/common/current/include/pkgconf/devs.h b/packages/devs/common/current/include/pkgconf/devs.h new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/include/pkgconf/devs.h @@ -0,0 +1,173 @@ +#ifndef CYGONCE_PKGCONF_DEVS_H +#define CYGONCE_PKGCONF_DEVS_H +// ==================================================================== +// +// pkgconf/devs.h +// +// Device configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-24 +// Purpose: To allow the user to edit device configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +/* ---------------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_DEVICES { + display "Device drivers" + type bool + requires CYGPKG_ERROR + description " + The eCos system is supplied with a number of different + device drivers." + doc ref/ecos-ref/ecos-device-drivers.html + } + + }}CFG_DATA */ + +/* --------------------------------------------------------------------- + * This file needs to know which HAL and device packages are in the + * current configuration. + */ + +#include + +/* + * This #include is spurious but avoids some problems in the current + * sources. + */ +#ifdef CYGPKG_KERNEL +#include + +/* --------------------------------------------------------------------- + * Define all the potential devices that the kernel can have. Then define + * the configuration file that contains the specific configuration for + * that device. Eventually all these configuration files will be generated + * by a hardware configuration tool. + */ + +#if defined(CYG_HAL_MN10300) && defined(CYGPKG_DEVICES_SERIAL_RS232_MN10300) + +# include + +# ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_1 +# define CYG_DEVICE_SERIAL_RS232_MN10300_1 "pkgconf/serial_mn10300_1.h" +# define CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME CYG_DEVICE_NAME_1 +# define CYG_DEVICE_SERIAL_RS232_MN10300_1_DECLARE +# endif + +# ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_2 +# define CYG_DEVICE_SERIAL_RS232_MN10300_2 "pkgconf/serial_mn10300_2.h" +# define CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME CYG_DEVICE_NAME_2 +// If we are the simulator then we want native output, +// otherwise we want GDB output by default. These +// all depend on the HAL --proven 19980906 +# if defined(CYG_HAL_MN10300_SIM) || !defined(CYGPKG_DEVICES_GDB) +# define CYG_DEVICE_SERIAL_RS232_MN10300_2_DECLARE +# endif +# endif + +/* + * GDB is a pseudo device that wraps a real device. If this package + * is required default it to the second serial port. + */ +#if defined(CYGPKG_DEVICES_GDB) \ + && defined(CYGPKG_DEVICES_SERIAL_RS232_MN10300_2) +#define CYG_DEVICE_GDB_1 "pkgconf/gdb_1.h" +//#define CYG_DEVICE_GDB_1_NAME CYG_DEVICE_NAME_2 +#ifndef CYG_HAL_MN10300_SIM +#define CYG_DEVICE_GDB_1_NAME CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME +#endif + +// These last two fields I really don't like. +// The should probably go in "pkgconf/gdb_1.h" but I'd rather they +// went away completely --proven 19980630 +// Note CYG_DEVICE_GDB_1_CLASS is different than CYG_CLASS_DEVICE_GDB_1 +#define CYG_DEVICE_GDB_1_CLASS CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 +#define CYG_DEVICE_GDB_1_INCLUDE "cyg/devs/serial/rs232/mn10300/serial_mn10300_2.hxx" +#endif + +#endif /* CYG_HAL_MN10300 */ + +#ifdef CYG_HAL_TX39 + +/* No serial drivers for simulator yet. */ +#if defined(CYG_HAL_TX39_JMR3904) && defined(CYGPKG_DEVICES_SERIAL_RS232_TX39) +#define CYG_DEVICE_SERIAL_RS232_TX39 "pkgconf/serial_tx39.h" +#define CYG_DEVICE_SERIAL_RS232_TX39_NAME CYG_DEVICE_NAME_1 +#define CYG_DEVICE_SERIAL_RS232_TX39_DECLARE +#endif +#endif + +/* --------------------------------------------------------------------- + * Define the device that is to be used for outputing diag data. One is + * required only if CYGDBG_INFRA_DIAG_USE_DEVICE is defined. Define the + * name in terms of an above device name. + */ +#ifdef CYG_HAL_MN10300 +// #ifdef on rom monitor +// #define CYG_DEVICE_DIAG_CLASS CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 +// #define CYG_DEVICE_DIAG_NAME CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME +#define CYG_DEVICE_DIAG_CLASS CYG_CLASS_DEVICE_GDB_1 +#define CYG_DEVICE_DIAG_NAME CYG_DEVICE_GDB_1_NAME + +#endif + +#ifdef CYG_HAL_TX39 +#define CYG_DEVICE_DIAG_CLASS CYG_CLASS_DEVICE_SERIAL_RS232_TX39 +#define CYG_DEVICE_DIAG_NAME CYG_DEVICE_SERIAL_RS232_TX39_NAME +#endif + +/* --------------------------------------------------------------------- + * Define the name of the device you wish to test. The test + * infrastructure can only handle one. + */ +#define CYGVAR_DEVICE_TEST_NAME CYG_DEVICE_NAME_2 + +/* --------------------------------------------------------------------- + * Define the names of the devices. These must be defined after the + * device to device name mappings. + */ +#define CYG_DEVICE_NAME_1 cyg_serial1 +#define CYG_DEVICE_NAME_2 cyg_serial2 + +#endif // ifdef CYGPKG_KERNEL + +/* --------------------------------------------------------------------- + * Define for a device table. Necessary for the C library to access devices. + */ +#define CYG_DEVICE_TABLE + +#endif /* CYGONCE_PKGCONF_DEVS_H */ +/* EOF devs.h */ diff --git a/packages/devs/common/current/include/queuet.hxx b/packages/devs/common/current/include/queuet.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/include/queuet.hxx @@ -0,0 +1,154 @@ +#ifndef CYGONCE_DEVS_COMMON_QUEUET_HXX +#define CYGONCE_DEVS_COMMON_QUEUET_HXX + +//========================================================================== +// +// queuet.hxx +// +// Generic queue template +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-21 +// Purpose: Create a template atomic queue +// Description: This file contains the implementations of +// Cyg_Queuet +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // base kernel types +#include // assertion macros +#include // tracing macros + + +/* + * Queue that allows two threads to interact with a queue + * without locking. One thread does queueing of useable buffers + * and dequeing of done buffers and one thread is the consumer. + * + * Only n-1 elements may be queued at any time for a queue of n bytes. + */ + +template +class Cyg_Queuet +{ +private: + cyg_ucount32 next_free; + cyg_ucount32 last_free; + cyg_ucount32 next_inuse; + cyg_ucount32 last_inuse; + static const cyg_ucount32 queue_size = QUEUE_SIZE; + T * queue[ QUEUE_SIZE ]; + +public: /* Routines for dealing with the queue */ + inline T * + get_next_inuse(T * done) + { + T * ret; + + CYG_ASSERT (next_inuse < queue_size, "next_inuse out of bounds"); + CYG_ASSERT (last_inuse < queue_size, "last_inuse out of bounds"); + + if (done) { + (++last_inuse) %= queue_size; + } + if ((ret = queue[next_inuse]) != NULL) { + (++next_inuse) %= queue_size; + } + return ret; + } + + inline void + enqueue(T * next) + { + CYG_ASSERT (next_free < queue_size, "next_free out of bounds"); + CYG_ASSERT (queue[next_free] == NULL, "next_free is not NULL"); + CYG_ASSERT (min_free(), "not enough space to enqueue"); + + queue[next_free++] = next; + next_free %= queue_size; + } + + inline T * + Cyg_Queuet::dequeue() + { + T * ret; + + CYG_ASSERT (last_free < queue_size, "last_free out of bounds"); + CYG_ASSERT (last_free != last_inuse, "no elements to dequeue"); + CYG_ASSERT (queue[last_free] != NULL, "queued element is NULL"); + + ret = queue[last_free]; + queue[last_free++] = NULL; + last_free %= queue_size; + return ret; + } + + /* Assume producer is checking */ + inline cyg_ucount32 + Cyg_Queuet::min_done() + { + cyg_count32 tmp; + cyg_ucount32 ret; + + if (queue[last_free] != NULL) { + tmp = last_inuse - last_free; + ret = (tmp < 0 ? tmp + queue_size : tmp); + } else { + CYG_ASSERT (last_free == next_free, + "last_free element is bogus"); + ret = 0; + } + return ret; + } + + /* Assume producer is checking */ + cyg_ucount32 + Cyg_Queuet::min_free() + { + cyg_count32 tmp; + cyg_ucount32 ret; + + CYG_ASSERT (next_free < queue_size, "next_free out of bounds"); + CYG_ASSERT (last_free < queue_size, "last_free out of bounds"); + + tmp = last_free - next_free; + ret = (tmp <= 0 ? tmp + queue_size : tmp); + /* Only n - 1 elements may be queued */ + return (ret - 1); + } +}; + +// ------------------------------------------------------------------------- +#endif // CYGONCE_DEVS_COMMON_QUEUET_HXX +// End of queuet.hxx + + diff --git a/packages/devs/common/current/include/serial.hxx b/packages/devs/common/current/include/serial.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/include/serial.hxx @@ -0,0 +1,64 @@ +#ifndef CYGONCE_DEVS_COMMON_SERIAL_HXX +#define CYGONCE_DEVS_COMMON_SERIAL_HXX + +//========================================================================== +// +// serial.hxx +// +// Header file for the generic serial device +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-20 +// Purpose: Define Cyg_Device_Serial data structure +// Description: This file contains the C++ class declar of Cyg_Device_Serial. +// Cyg_Device_Serial is the base class for all serial devices. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // base kernel types +#include // assertion macros +#include // tracing macros + +#include + +// ------------------------------------------------------------------------- +// Cyg_Device_Serial + +class Cyg_Device_Serial + : public Cyg_Device +{ + // nothing extra +}; + +#endif // CYGONCE_DEVS_COMMON_SERIAL_HXX +// End of serial.hxx + diff --git a/packages/devs/common/current/include/table.h b/packages/devs/common/current/include/table.h new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/include/table.h @@ -0,0 +1,179 @@ +#ifndef CYGONCE_DEVS_COMMON_TABLE_H +#define CYGONCE_DEVS_COMMON_TABLE_H + +//========================================================================== +// +// table.h +// +// Header file for the device table +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-20 +// Purpose: Define Device Table +// Description: This file contains the device table structure +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +/* + * devs.h should be replaced by an appropriate ECC Hardy package. + * and this file should mostly be auto generated -- proven 19980625 + */ +#include // What devices do we need. + +#include // Common type definitions and support +#include // Cyg_IORB definition +#include // Standard error codes + +// Handles to some of the device entries. +// These shouldn't go here and should be generated by ECC-Hardy +// --proven 19980625 +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1 +extern CYG_ADDRWORD stdeval1_serial1; +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2 +extern CYG_ADDRWORD stdeval1_serial2; +#endif +#else +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2 +extern CYG_ADDRWORD stdeval1_serial2; +#endif +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39 +extern CYG_ADDRWORD jmr3904_serial; +#endif + +// Mode for opening + +typedef enum { + CYG_DEVICE_OPEN_MODE_TEXT, + CYG_DEVICE_OPEN_MODE_RAW +} Cyg_DeviceOpenMode; + +// ------------------------------------------------------------------------- +// Cyg_Device_Table_t + +/* + * Device table. + */ +struct Cyg_Device_Table_t +{ + char * name; + CYG_ADDRWORD cookie; +// cyg_off_t seek_position; // Not implemented yet + + /* + * Note: The cookie is necessary for the function to differentiate + * between various instantiations of the same device type. + * + * Also note that open() will be called before the kernel scheduler + * (and hence the interrupt system) starts, so it must be safe for this + */ + Cyg_ErrNo (*open) (CYG_ADDRWORD cookie, Cyg_DeviceOpenMode); + Cyg_ErrNo (*read_cancel) (CYG_ADDRWORD cookie, Cyg_IORB *); + Cyg_ErrNo (*write_cancel) (CYG_ADDRWORD cookie, Cyg_IORB *); + Cyg_ErrNo (*read_blocking) (CYG_ADDRWORD cookie, Cyg_IORB *); + Cyg_ErrNo (*write_blocking) (CYG_ADDRWORD cookie, Cyg_IORB *); + Cyg_ErrNo (*read_asynchronous) (CYG_ADDRWORD cookie, Cyg_IORB *); + Cyg_ErrNo (*write_asynchronous) (CYG_ADDRWORD cookie, Cyg_IORB *); + Cyg_ErrNo (*close) (CYG_ADDRWORD cookie); + + CYG_ADDRWORD ioctl; +}; + +externC struct Cyg_Device_Table_t Cyg_Device_Table[]; + +struct Cyg_Device_Serial_RS232_Table_t +{ + Cyg_ErrNo (*set_kmode) (CYG_ADDRWORD cookie, cyg_uint32); + Cyg_ErrNo (*get_baud_rate) (CYG_ADDRWORD cookie, cyg_int32 * ); + Cyg_ErrNo (*set_baud_rate) (CYG_ADDRWORD cookie, cyg_int32, cyg_int32 *); + Cyg_ErrNo (*get_line_mode) (CYG_ADDRWORD cookie, cyg_int32 * ); + Cyg_ErrNo (*set_line_mode) (CYG_ADDRWORD cookie, cyg_int32, cyg_int32 *); + + Cyg_ErrNo (*get_read_mode) (CYG_ADDRWORD cookie, cyg_int32 * ); + Cyg_ErrNo (*set_read_mode) (CYG_ADDRWORD cookie, cyg_int32, cyg_int32 *); + Cyg_ErrNo (*set_read_data) (CYG_ADDRWORD cookie, cyg_int32, char *, cyg_uint32); +}; + +/* + * C API is just a set of macros + */ +#define cyg_read_cancel(x, y) \ + ((struct Cyg_Device_Table_t *)x)->read_cancel(((struct Cyg_Device_Table_t *)x)->cookie, y) + +#define cyg_write_cancel(x, y) \ + ((struct Cyg_Device_Table_t *)x)->write_cancel(((struct Cyg_Device_Table_t *)x)->cookie, y) + +#define cyg_read_blocking(x, y) \ + ((struct Cyg_Device_Table_t *)x)->read_blocking(((struct Cyg_Device_Table_t *)x)->cookie, y) + +#define cyg_write_blocking(x, y) \ + ((struct Cyg_Device_Table_t *)x)->write_blocking(((struct Cyg_Device_Table_t *)x)->cookie, y) + +#define cyg_read_asynchronous(x, y) \ + ((struct Cyg_Device_Table_t *)x)->read_asynchronous(((struct Cyg_Device_Table_t *)x)->cookie, y) + +#define cyg_write_asynchronous(x, y) \ + ((struct Cyg_Device_Table_t *)x)->write_asynchronous(((struct Cyg_Device_Table_t *)x)->cookie, y) + +/* + * C API for Serial RS232 devices + */ +#define cyg_serial_rs232_set_kmode(x, y) \ + ((struct Cyg_Device_Serial_RS232_Table_t *)((struct Cyg_Device_Table_t *)x)->ioctl)->set_kmode(((struct Cyg_Device_Table_t *)x)->cookie, y) + +#define cyg_serial_rs232_get_baud_rate(x, y) \ + ((struct Cyg_Device_Serial_RS232_Table_t *)((struct Cyg_Device_Table_t *)x)->ioctl)->get_baud_rate(((struct Cyg_Device_Table_t *)x)->cookie, y) + +#define cyg_serial_rs232_set_baud_rate(x, y, z) \ + ((struct Cyg_Device_Serial_RS232_Table_t *)((struct Cyg_Device_Table_t *)x)->ioctl)->set_baud_rate(((struct Cyg_Device_Table_t *)x)->cookie, y, z) + +#define cyg_serial_rs232_get_line_mode(x, y) \ + ((struct Cyg_Device_Serial_RS232_Table_t *)((struct Cyg_Device_Table_t *)x)->ioctl)->get_line_mode(((struct Cyg_Device_Table_t *)x)->cookie, y) + +#define cyg_serial_rs232_set_line_mode(x, y, z) \ + ((struct Cyg_Device_Serial_RS232_Table_t *)((struct Cyg_Device_Table_t *)x)->ioctl)->set_line_mode(((struct Cyg_Device_Table_t *)x)->cookie, y, z) + +#define cyg_serial_rs232_get_read_mode(x, y) \ + ((struct Cyg_Device_Serial_RS232_Table_t *)((struct Cyg_Device_Table_t *)x)->ioctl)->get_read_mode(((struct Cyg_Device_Table_t *)x)->cookie, y) + +#define cyg_serial_rs232_set_read_mode(x, y, z) \ + ((struct Cyg_Device_Serial_RS232_Table_t *)((struct Cyg_Device_Table_t *)x)->ioctl)->set_read_mode(((struct Cyg_Device_Table_t *)x)->cookie, y, z) + +#define cyg_serial_rs232_set_read_data(x, y, z, a) \ + ((struct Cyg_Device_Serial_RS232_Table_t *)((struct Cyg_Device_Table_t *)x)->ioctl)->set_read_data(((struct Cyg_Device_Table_t *)x)->cookie, y, z, a) + + + +#endif // CYGONCE_DEVS_COMMON_TABLE_H +// End of table.h + diff --git a/packages/devs/common/current/include/testaux.hxx b/packages/devs/common/current/include/testaux.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/include/testaux.hxx @@ -0,0 +1,78 @@ +#ifndef CYGONCE_DEVS_COMMON_TESTAUX_HXX +#define CYGONCE_DEVS_COMMON_TESTAUX_HXX + +//========================================================================== +// +// testaux.hxx +// +// Auxiliary test header file +// This file is temporary in the devs directory. +// --proven 19980514 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-09 +// Description: +// Defines some convenience functions to get us going. In +// particular this file reserves space for NTHREADS threads, +// which can be created by calls to aux_new_thread() +// It also defines a CHECK function. +// +//####DESCRIPTIONEND#### + +#ifdef NTHREADS + +#define STACKSIZE 4096 + +static Cyg_Thread *thread[NTHREADS]; + +static char thread_obj[NTHREADS][sizeof(Cyg_Thread)]; +static char stack[NTHREADS][STACKSIZE]; + +static inline void *operator new(size_t size, void *ptr) { return ptr; }; + +static int nthreads = 0; + +static Cyg_Thread *new_thread(cyg_thread_entry *entry, CYG_ADDRWORD data) { + + CYG_ASSERT(nthreads < NTHREADS, + "Attempt to create more than NTHREADS threads"); + + thread[nthreads] = new( (void *)&thread_obj[nthreads] ) + Cyg_Thread(entry, data, STACKSIZE, (CYG_ADDRESS)stack[nthreads] ); + + thread[nthreads]->resume(); + + return thread[nthreads++]; +} +#endif // defined(NTHREADS) + +#define CHECK(b) CYG_TEST_CHECK(b,#b) + +#endif // CYGONCE_DEVS_COMMON_TESTAUX_HXX +// End of testaux.hxx diff --git a/packages/devs/common/current/src/PKGconf.mak b/packages/devs/common/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/src/PKGconf.mak @@ -0,0 +1,41 @@ +#=============================================================================== +# +# makefile +# +# devs/common/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices +include ../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := diag.cxx table.cxx +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/devs/common/current/src/diag.cxx b/packages/devs/common/current/src/diag.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/src/diag.cxx @@ -0,0 +1,85 @@ +/*============================================================================= +// +// devs/diag.c +// +// Redirect diag output to the appropriate device +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-05-11 +// Purpose: Kernel diagnostic output +// Description: Implementations of kernel diagnostic routines. +// +//####DESCRIPTIONEND#### +// +//==========================================================================*/ + +#include // Include all the possible devices + +/*---------------------------------------------------------------------------*/ + +#ifdef CYGDBG_INFRA_DIAG_USE_DEVICE +#if defined(CYG_DEVICE_DIAG_CLASS) && defined(CYG_DEVICE_DIAG_NAME) + +extern CYG_DEVICE_DIAG_CLASS CYG_DEVICE_DIAG_NAME; + +/*---------------------------------------------------------------------------*/ +/* Write single char to output */ + +cyg_ucount8 sync_mode = 0; + +externC void diag_device_write_char(char c) +{ + Cyg_IORB iorb; + + iorb.buffer = &c; + iorb.buffer_length = 1; + if (sync_mode) { + CYG_DEVICE_DIAG_NAME.io_write_assert(&iorb); + } else { + CYG_DEVICE_DIAG_NAME.io_write_blocking(&iorb); + } +} + +externC void diag_device_start_sync() +{ + sync_mode = 1; +} + +externC void diag_device_end_sync() +{ + sync_mode = 0; +} + +#else +#error "Must define CYG_DEVICE_DIAG_CLASS and CYG_DEVICE_DIAG_NAME" +#endif // ! (defined(CYG_DEVICE_DIAG_CLASS) && defined(CYG_DEVICE_DIAG_NAME)) +#endif // CYGDBG_INFRA_DIAG_USE_DEVICE + +/*---------------------------------------------------------------------------*/ +/* End of devs/diag.c */ diff --git a/packages/devs/common/current/src/table.cxx b/packages/devs/common/current/src/table.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/common/current/src/table.cxx @@ -0,0 +1,633 @@ +//========================================================================== +// +// devs/table.cxx +// +// Virtual Device Table without Virtual Functions +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-05-20 +// Purpose: Virtual Device Table +// Description: Allow packages to use devices without having to know the +// device class. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // Include all the possible devices +#include // Common type definitions and support +#include +#include // HAL diagnostic output + +#ifdef CYG_DEVICE_TABLE + +// --------------------------------------------------------------------------- +// CYG_DEVICE_SERIAL_RS232_MN10300_1 + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1 + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_read_cancel(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.io_read_cancel(iorb); + CYG_ASSERT(ret == 0, "Read cancel failed to the mn10300 serial port 1."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_read_blocking(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.io_read_blocking(iorb); + CYG_ASSERT(ret == 0, "Read failed to the mn10300 serial port 1."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_write_blocking(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.io_write_blocking(iorb); + CYG_ASSERT(ret == 0, "Write failed to the mn10300 serial port 1."); + return ENOERR; +} + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_INTERRUPT +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_read_asynchronous(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.io_read_asynchronous(iorb); + CYG_ASSERT(ret == 0, + "Read asynchronous failed to the mn10300 serial port 1."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_write_asynchronous(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.io_write_asynchronous(iorb); + CYG_ASSERT(ret == 0, + "Write asynchronous failed to the mn10300 serial port 1."); + return ENOERR; +} +#endif + +// Device specific routines; +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_set_kmode(CYG_ADDRWORD cookie, cyg_uint32 mode) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.set_kmode(mode); + CYG_ASSERT(ret == 0, "Set kmode failed to the mn10300 serial port 1."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_get_baud_rate(CYG_ADDRWORD cookie, + cyg_int32 * old_baud_rate) +{ + *old_baud_rate = CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.get_baud_rate(); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_set_baud_rate(CYG_ADDRWORD cookie, + cyg_int32 baud_rate, cyg_int32 * old_baud_rate) +{ + *old_baud_rate = + CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.set_baud_rate(baud_rate); + CYG_ASSERT(*old_baud_rate >= 0, + "Set baud rate failed to the mn10300 serial port 1."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_get_line_mode(CYG_ADDRWORD cookie, + cyg_int32 * line_mode) +{ + *line_mode = CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.get_line_mode(); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_set_line_mode(CYG_ADDRWORD cookie, + cyg_int32 line_mode, cyg_int32 * old_line_mode) +{ + *old_line_mode = + CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.set_line_mode(line_mode); + CYG_ASSERT(*old_line_mode >= 0, + "Set line mode failed to the mn10300 serial port 1."); + return ENOERR; +} + +// externC Cyg_ErrNo +// Cyg_Device_Serial_RS232_mn10300_1_get_read_mode(CYG_ADDRWORD cookie, +// cyg_int32 * read_mode) +// { +// *line_mode = serial.get_read_mode(); +// return ENOERR; +// } + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_set_read_mode(CYG_ADDRWORD cookie, + cyg_int32 read_mode, cyg_int32 * old_read_mode) +{ + *old_read_mode = + CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.set_read_mode(read_mode); + CYG_ASSERT(*old_read_mode >= 0, + "Set read mode failed to the mn10300 serial port 1."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_1_set_read_data(CYG_ADDRWORD cookie, + cyg_int32 mode, const char * str, cyg_uint32 length) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME.set_read_data(mode, str, length); + CYG_ASSERT(0 == ret, "Set read data failed to the mn10300 serial port 1."); + return ENOERR; +} + +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_1 + +// --------------------------------------------------------------------------- +// CYG_DEVICE_SERIAL_RS232_MN10300_2 + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2 + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_read_cancel(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.io_read_cancel(iorb); + CYG_ASSERT(ret == 0, "Read cancel failed to the mn10300 serial port 2."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_read_blocking(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.io_read_blocking(iorb); + CYG_ASSERT(ret == 0, "Read failed to the mn10300 serial port 2."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_write_blocking(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.io_write_blocking(iorb); + CYG_ASSERT(ret == 0, "Write failed to the mn10300 serial port 2."); + return ENOERR; +} + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_INTERRUPT +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_read_asynchronous(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.io_read_asynchronous(iorb); + CYG_ASSERT(ret == 0, + "Read asynchronous failed to the mn10300 serial port 2."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_write_asynchronous(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.io_write_asynchronous(iorb); + CYG_ASSERT(ret == 0, + "Write asynchronous failed to the mn10300 serial port 2."); + return ENOERR; +} +#endif + +// Device specific routines; +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_set_kmode(CYG_ADDRWORD cookie, cyg_uint32 mode) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.set_kmode(mode); + CYG_ASSERT(ret == 0, "Set kmode failed to the mn10300 serial port 2."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_get_baud_rate(CYG_ADDRWORD cookie, + cyg_int32 * old_baud_rate) +{ + *old_baud_rate = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.get_baud_rate(); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_set_baud_rate(CYG_ADDRWORD cookie, + cyg_int32 baud_rate, cyg_int32 * old_baud_rate) +{ + *old_baud_rate = + CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.set_baud_rate(baud_rate); + CYG_ASSERT(*old_baud_rate >= 0, + "Set baud rate failed to the mn10300 serial port 2."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_get_line_mode(CYG_ADDRWORD cookie, + cyg_int32 * line_mode) +{ + *line_mode = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.get_line_mode(); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_set_line_mode(CYG_ADDRWORD cookie, + cyg_int32 line_mode, cyg_int32 * old_line_mode) +{ + *old_line_mode = + CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.set_line_mode(line_mode); + CYG_ASSERT(*old_line_mode >= 0, + "Set line mode failed to the mn10300 serial port 2."); + return ENOERR; +} + +// externC Cyg_ErrNo +// Cyg_Device_Serial_RS232_mn10300_2_get_read_mode(CYG_ADDRWORD cookie, +// cyg_int32 * read_mode) +// { +// *line_mode = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.get_read_mode(); +// return ENOERR; +// } + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_set_read_mode(CYG_ADDRWORD cookie, + cyg_int32 read_mode, cyg_int32 * old_read_mode) +{ + *old_read_mode = + CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.set_read_mode(read_mode); + CYG_ASSERT(*old_read_mode >= 0, + "Set read mode failed to the mn10300 serial port 2."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_mn10300_2_set_read_data(CYG_ADDRWORD cookie, + cyg_int32 mode, const char * str, cyg_uint32 length) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME.set_read_data(mode, str, length); + CYG_ASSERT(0 == ret, "Set read data failed to the mn10300 serial port 2."); + return ENOERR; +} + +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_2 + +// --------------------------------------------------------------------------- +// CYG_DEVICE_SERIAL_RS232_TX39 + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39 + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_tx39_read_blocking(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_TX39_NAME.io_read_blocking(iorb); + CYG_ASSERT(ret == 0, "Read failed to the TX39 serial port 0."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_tx39_write_blocking(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_TX39_NAME.io_write_blocking(iorb); + CYG_ASSERT(ret == 0, "Write failed to the TX39 serial port 0."); + return ENOERR; +} + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_KMODE_INTERRUPT +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_tx39_read_asynchronous(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_TX39_NAME.io_read_asynchronous(iorb); + CYG_ASSERT(ret == 0, + "Read asynchronous failed to the TX39 serial port 0."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_tx39_write_asynchronous(CYG_ADDRWORD cookie, Cyg_IORB * iorb) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_TX39_NAME.io_write_asynchronous(iorb); + CYG_ASSERT(ret == 0, + "Write asynchronous failed to the TX39 serial port 0."); + return ENOERR; +} +#endif + +// Device specific routines; +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_tx39_set_kmode(CYG_ADDRWORD cookie, cyg_uint32 mode) +{ + cyg_int32 ret; + + ret = CYG_DEVICE_SERIAL_RS232_TX39_NAME.set_kmode(mode); + CYG_ASSERT(ret == 0, "Set kmode failed to the TX39 serial port 0."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_tx39_get_baud_rate(CYG_ADDRWORD cookie, + cyg_int32 * old_baud_rate) +{ + *old_baud_rate = CYG_DEVICE_SERIAL_RS232_TX39_NAME.get_baud_rate(); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_tx39_set_baud_rate(CYG_ADDRWORD cookie, + cyg_int32 baud_rate, cyg_int32 * old_baud_rate) +{ + *old_baud_rate = + CYG_DEVICE_SERIAL_RS232_TX39_NAME.set_baud_rate(baud_rate); + CYG_ASSERT(*old_baud_rate >= 0, + "Set baud rate failed to the TX39 serial port 0."); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_tx39_get_line_mode(CYG_ADDRWORD cookie, + cyg_int32 * line_mode) +{ + *line_mode = CYG_DEVICE_SERIAL_RS232_TX39_NAME.get_line_mode(); + return ENOERR; +} + +externC Cyg_ErrNo +Cyg_Device_Serial_RS232_tx39_set_line_mode(CYG_ADDRWORD cookie, + cyg_int32 line_mode, cyg_int32 * old_line_mode) +{ + *old_line_mode = + CYG_DEVICE_SERIAL_RS232_TX39_NAME.set_line_mode(line_mode); + CYG_ASSERT(*old_line_mode >= 0, + "Set line mode failed to the TX39 serial port 0."); + return ENOERR; +} + +#endif /* CYG_DEVICE_SERIAL_RS232_TX39 */ + +// --------------------------------------------------------------------------- +// HAL_DIAG + +#ifdef HAL_DIAG_INIT +externC Cyg_ErrNo +Cyg_Device_Pseudo_Hal_Diag_open( CYG_ADDRWORD cookie, Cyg_DeviceOpenMode ) +{ + HAL_DIAG_INIT(); + return ENOERR; +} +#endif + +#ifdef HAL_DIAG_READ_CHAR +externC Cyg_ErrNo +Cyg_Device_Pseudo_Hal_Diag_read_blocking( CYG_ADDRWORD cookie, Cyg_IORB *iorb ) +{ + cyg_ucount32 i; + cyg_bool exit_loop = false; + + for (i=0; (i < iorb->buffer_length) && !exit_loop; i++) + { + HAL_DIAG_READ_CHAR(* ((char*)iorb->buffer + i) ); + + // exit loop on certain characters, newline, EOF, etc. + switch (*((char*)iorb->buffer + i)) + { + case 4: + case 10: + case 13: + case 26: + exit_loop = true; + break; + default: + break; + } // switch + } // for + + iorb->xferred_length = i; + return ENOERR; +} +#endif + +#ifdef HAL_DIAG_WRITE_CHAR +externC Cyg_ErrNo +Cyg_Device_Pseudo_Hal_Diag_write_blocking( CYG_ADDRWORD cookie, Cyg_IORB *iorb ) +{ + cyg_ucount32 i; + + for (i=0; i < iorb->buffer_length; i++) + { + HAL_DIAG_WRITE_CHAR(*((char *)iorb->buffer + i)); + } // for + + iorb->xferred_length = iorb->buffer_length; + return ENOERR; +} +#endif + +// --------------------------------------------------------------------------- +// Device specific ioctl table +// +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1 +struct Cyg_Device_Serial_RS232_Table_t Cyg_Device_Serial_RS232_mn10300_1_Table = +{ + &Cyg_Device_Serial_RS232_mn10300_1_set_kmode, + &Cyg_Device_Serial_RS232_mn10300_1_get_baud_rate, + &Cyg_Device_Serial_RS232_mn10300_1_set_baud_rate, + &Cyg_Device_Serial_RS232_mn10300_1_get_line_mode, + &Cyg_Device_Serial_RS232_mn10300_1_set_line_mode, + NULL, + &Cyg_Device_Serial_RS232_mn10300_1_set_read_mode, + &Cyg_Device_Serial_RS232_mn10300_1_set_read_data +}; +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2 +struct Cyg_Device_Serial_RS232_Table_t Cyg_Device_Serial_RS232_mn10300_2_Table = +{ + &Cyg_Device_Serial_RS232_mn10300_2_set_kmode, + &Cyg_Device_Serial_RS232_mn10300_2_get_baud_rate, + &Cyg_Device_Serial_RS232_mn10300_2_set_baud_rate, + &Cyg_Device_Serial_RS232_mn10300_2_get_line_mode, + &Cyg_Device_Serial_RS232_mn10300_2_set_line_mode, + NULL, + &Cyg_Device_Serial_RS232_mn10300_2_set_read_mode, + &Cyg_Device_Serial_RS232_mn10300_2_set_read_data +}; +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39 +struct Cyg_Device_Serial_RS232_Table_t Cyg_Device_Serial_RS232_tx39_Table = +{ + &Cyg_Device_Serial_RS232_tx39_set_kmode, + &Cyg_Device_Serial_RS232_tx39_get_baud_rate, + &Cyg_Device_Serial_RS232_tx39_set_baud_rate, + &Cyg_Device_Serial_RS232_tx39_get_line_mode, + &Cyg_Device_Serial_RS232_tx39_set_line_mode, + NULL, NULL, NULL +}; +#endif +// --------------------------------------------------------------------------- +// Device table +// +struct Cyg_Device_Table_t Cyg_Device_Table[] = { + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1 +{ "serial1", (CYG_ADDRWORD) 0, + NULL, // no open + &Cyg_Device_Serial_RS232_mn10300_1_read_cancel, + NULL, + &Cyg_Device_Serial_RS232_mn10300_1_read_blocking, + &Cyg_Device_Serial_RS232_mn10300_1_write_blocking, +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_INTERRUPT + &Cyg_Device_Serial_RS232_mn10300_1_read_asynchronous, + &Cyg_Device_Serial_RS232_mn10300_1_write_asynchronous, +#else + NULL, NULL, +#endif + NULL, // no close + (CYG_ADDRWORD)&Cyg_Device_Serial_RS232_mn10300_1_Table +}, +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2 +{ "serial2", (CYG_ADDRWORD) 0, + NULL, // no open + &Cyg_Device_Serial_RS232_mn10300_2_read_cancel, + NULL, + &Cyg_Device_Serial_RS232_mn10300_2_read_blocking, + &Cyg_Device_Serial_RS232_mn10300_2_write_blocking, +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_INTERRUPT + &Cyg_Device_Serial_RS232_mn10300_2_read_asynchronous, + &Cyg_Device_Serial_RS232_mn10300_2_write_asynchronous, +#else + NULL, NULL, +#endif + NULL, // no close + (CYG_ADDRWORD)&Cyg_Device_Serial_RS232_mn10300_2_Table +}, +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39 +{ "serial0", (CYG_ADDRWORD) 0, + NULL, // no open + NULL, + NULL, + &Cyg_Device_Serial_RS232_tx39_read_blocking, + &Cyg_Device_Serial_RS232_tx39_write_blocking, +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_KMODE_INTERRUPT + &Cyg_Device_Serial_RS232_tx39_read_asynchronous, + &Cyg_Device_Serial_RS232_tx39_write_asynchronous, +#else + NULL,NULL, +#endif + NULL, // no close + (CYG_ADDRWORD)&Cyg_Device_Serial_RS232_tx39_Table +}, +#endif + +{ "haldiag", (CYG_ADDRWORD) 0, +#ifdef HAL_DIAG_INIT + &Cyg_Device_Pseudo_Hal_Diag_open, +#else + NULL, +#endif + + NULL, + NULL, + +#ifdef HAL_DIAG_READ_CHAR + &Cyg_Device_Pseudo_Hal_Diag_read_blocking, +#else + NULL, +#endif + +#ifdef HAL_DIAG_WRITE_CHAR + &Cyg_Device_Pseudo_Hal_Diag_write_blocking, +#else + NULL, +#endif + NULL }, // no close + +{ NULL, (CYG_ADDRWORD) 0, NULL, NULL, NULL, NULL } +}; + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1 +CYG_ADDRWORD stdeval1_serial1 = (CYG_ADDRWORD)&Cyg_Device_Table[0]; +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2 +CYG_ADDRWORD stdeval1_serial2 = (CYG_ADDRWORD)&Cyg_Device_Table[1]; +#endif +#else +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2 +CYG_ADDRWORD stdeval1_serial2 = (CYG_ADDRWORD)&Cyg_Device_Table[0]; +#endif +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39 +CYG_ADDRWORD jmr3904_serial = (CYG_ADDRWORD)&Cyg_Device_Table[0]; +#endif + +#endif + +/*---------------------------------------------------------------------------*/ +/* End of devs/table.cxx */ diff --git a/packages/devs/gdb/current/include/gdb_1.hxx b/packages/devs/gdb/current/include/gdb_1.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/gdb/current/include/gdb_1.hxx @@ -0,0 +1,105 @@ +#ifndef CYGONCE_DEVS_GDB_1_HXX +#define CYGONCE_DEVS_GDB_1_HXX + +//========================================================================== +// +// gdb_1.hxx +// +// Header file for the pseudo gdb device +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-22 +// Purpose: Define Cyg_Device_GDB_1 data structure +// Description: This file contains the C++ class declaration of +// Cyg_Device_GDB_1. There can be only one as it +// inherits from a specific device. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // Device configureation file + +#ifdef CYG_DEVICE_GDB_1 +// Include Configureation options specific to the device +#include CYG_DEVICE_GDB_1 +#include CYG_DEVICE_GDB_1_INCLUDE + +#include +#include + +// ------------------------------------------------------------------------- +// Cyg_Device_GDB_1 + +#define CYG_CLASS_DEVICE_GDB_1 Cyg_Device_GDB_1 + +class CYG_CLASS_DEVICE_GDB_1 + : public CYG_DEVICE_GDB_1_CLASS +{ + +#ifdef CYG_DEVICE_INTERNAL + +private: + /* Queue of write requests */ + Cyg_IORB * gdb_write_buffer_first; + Cyg_IORB * gdb_write_buffer_last; + + static void iorb_setup(CYG_CLASS_DEVICE_GDB_1 *iorb); + static void iorb_callback(Cyg_IORB *iorb); + + char gdb_write_buf[(CYGNUM_DEVICE_GDB_BUFFER_SIZE * 2 + 5)]; + volatile cyg_uint32 gdb_write_length; + Cyg_IORB gdb_write_iorb; + +#endif + +public: + + /* Constructor */ + CYG_CLASS_DEVICE_GDB_1(); + + cyg_int32 io_write_assert(Cyg_IORB * iorb); + cyg_int32 io_write_blocking(Cyg_IORB * iorb); + cyg_int32 io_write_asynchronous(Cyg_IORB * iorb); + +}; + +// Declare exported variables +#ifdef CYG_DEVICE_GDB_1_NAME +#ifndef CYG_DEVICE_GDB_1_DO_NOT_DECLARE +extern CYG_CLASS_DEVICE_GDB_1 CYG_DEVICE_GDB_1_NAME; +#endif +#endif + +#endif // CYG_DEVICE_GDB_1 + +#endif // CYGONCE_DEVS_GDB_1_HXX +// End of gdb_1.hxx + diff --git a/packages/devs/gdb/current/include/pkgconf/gdb_1.h b/packages/devs/gdb/current/include/pkgconf/gdb_1.h new file mode 100644 --- /dev/null +++ b/packages/devs/gdb/current/include/pkgconf/gdb_1.h @@ -0,0 +1,96 @@ +#ifndef CYGONCE_PKGCONF_GDB_1_H +#define CYGONCE_PKGCONF_GDB_1_H +// ==================================================================== +// +// pkgconf/gdb_1.h +// +// Device configuration file for gdb 1 +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors:proven +// Date: 1998-04-24 +// Purpose: To allow the user to edit device specific configuration +// for the gdb 1 pseudo device. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +/* ---------------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_DEVICES_GDB { + display "GDB pseudo device" + parent CYGPKG_DEVICES + requires CYGPKG_DEVICES_SERIAL_RS232_MN10300_2 + description " + If the gdb source level debugger is going to be used to + debug the application then on some target systems this will + involve the exclusive use of some hardware, for example a + serial line. Hence this device cannot be used for other + purposes, for example C library standard I/O. If the gdb + pseudo device is enabled then this provides a means of + performing output operations encapsulated within the gdb + protocol, thus allowing a single serial line or similar + device to be used for both debugging and for output. Note + that currently GDB does not support input operations. This + package is only supported on the MN10300." + } + + }}CFG_DATA */ + +/* ==================================================================== + * First we define all the options that are exportable to the user. + * These options will show/hide various methods for the class. + * These options are always device specific. + */ + +#ifdef CYG_DEVICE_INTERNAL +/* ==================================================================== + * Now define internal only options. These options dictate the struture + * of a class but have no effect on the methods declared for a class. + */ + +/* --------------------------------------------------------------------- + * Define the number of bytes to convert and output in to the base driver. + * This number will result in a buffer which is SIZE * 2 + 5 bytes. + */ +# define CYGNUM_DEVICE_GDB_BUFFER_SIZE 100 + +/* ==================================================================== + * Duplicate the device specific options to device generic options. + * DO NOT modify these options. Modify the corresponding options above. + * This is so the internal source files can be compiled from the same + * common sources. These defines can never be exported to the user. + */ + +#endif // CYG_DEVICE_INTERNAL + +#endif /* CYGONCE_PKGCONF_GDB_1_H */ +/* EOF gdb_1.h */ diff --git a/packages/devs/gdb/current/src/PKGconf.mak b/packages/devs/gdb/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/gdb/current/src/PKGconf.mak @@ -0,0 +1,41 @@ +#=============================================================================== +# +# makefile +# +# devs/serial/rs232/mn10300/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_gdb +include ../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := gdb_1.cxx +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/devs/gdb/current/src/gdb_1.cxx b/packages/devs/gdb/current/src/gdb_1.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/gdb/current/src/gdb_1.cxx @@ -0,0 +1,245 @@ +//================================================================= +// +// gdb_1.cxx +// +// Pseudo Driver for GDB +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-05-30 +// Description: Class methods for class Cyg_Device_GDB_1 +//####DESCRIPTIONEND#### + +#include // To see if we need to bother +#ifdef CYG_DEVICE_GDB_1 // Do we need to build this file + +#define CYG_DEVICE_INTERNAL +#include +#include // Cyg_Binary_Semaphore +#include // NULL + +#ifdef CYG_DEVICE_GDB_1_NAME // Only construct object if there is a name +CYG_CLASS_DEVICE_GDB_1 CYG_DEVICE_GDB_1_NAME; +#endif + +// ------------------------------------------------------------------------ +// Constructor for GDB device +// +CYG_CLASS_DEVICE_GDB_1::CYG_CLASS_DEVICE_GDB_1() + : CYG_DEVICE_GDB_1_CLASS() +{ + CYG_REPORT_FUNCTION(); + + // Initialize any data + + // write_buffers = NULL; + +} + +// ------------------------------------------------------------------------ +// Routines to deal with the new iorb +// + +static const char hexchars[] = "0123456789abcdef"; + +static cyg_uint32 +iorb_compute(char * in_data, cyg_uint32 length, Cyg_IORB * out) +{ + cyg_uint8 csum = 0; + cyg_ucount8 i; + char * data; + + data = (char *)out->buffer; + + if (length > CYGNUM_DEVICE_GDB_BUFFER_SIZE) { + length = CYGNUM_DEVICE_GDB_BUFFER_SIZE; + } + + data[0] = '$'; + data[1] = 'O'; + csum += data[1]; + for (i = 0; i < length; i++) { + data[(i*2)+2] = hexchars[(in_data[i] >> 4) & 0x0f]; + data[(i*2)+3] = hexchars[in_data[i] & 0x0f]; + csum += data[(i*2)+2]; + csum += data[(i*2)+3]; + } + data[(i*2)+2] = '#'; + data[(i*2)+3] = hexchars[csum >> 4]; + data[(i*2)+4] = hexchars[csum & 0x0f]; + + out->buffer_length = (i * 2) + 5; + return (length); +} + +void +CYG_CLASS_DEVICE_GDB_1::iorb_setup(CYG_CLASS_DEVICE_GDB_1 * data) +{ + Cyg_IORB * iorb; + + iorb = data->gdb_write_buffer_first; + + /* set up gdb_write_iorb */ + data->gdb_write_iorb.buffer = data->gdb_write_buf; + data->gdb_write_iorb.callback = iorb_callback; + data->gdb_write_iorb.callback_data = (CYG_ADDRWORD)data; + iorb->xferred_length = iorb_compute((char *)iorb->buffer, iorb->buffer_length, &data->gdb_write_iorb); + + /* Save the length of the original data that still needs to be sent */ + data->gdb_write_length = iorb->buffer_length - iorb->xferred_length; + + /* Start the write process */ + data->io_write(&data->gdb_write_iorb); +} + +void +CYG_CLASS_DEVICE_GDB_1::iorb_callback(Cyg_IORB *iorb) +{ + CYG_CLASS_DEVICE_GDB_1 * foo = (CYG_CLASS_DEVICE_GDB_1 *)iorb->callback_data; + cyg_uint32 length; + + if (foo->gdb_write_length) { + /* Compute the offset into the original data */ + length = iorb_compute ((char *)foo->gdb_write_buffer_first->buffer + + foo->gdb_write_buffer_first->xferred_length, foo->gdb_write_length, + &foo->gdb_write_iorb); + + foo->gdb_write_buffer_first->xferred_length += length; + foo->gdb_write_length -= length; + + foo->io_write(&foo->gdb_write_iorb); + + } else { + Cyg_IORB * done; + + /* Get the next iorb */ + done = foo->gdb_write_buffer_first; + foo->gdb_write_buffer_first = foo->gdb_write_buffer_first->next; + if (foo->gdb_write_buffer_first == NULL) { + foo->gdb_write_buffer_last = NULL; + } else { + foo->iorb_setup(foo); + } + if (done->callback) { + done->callback(done); + } + } +} + +// ------------------------------------------------------------------------ +// Asynchronous write +// + +cyg_int32 +CYG_CLASS_DEVICE_GDB_1::io_write_asynchronous(Cyg_IORB * iorb) +{ + iorb->next = NULL; + Cyg_Scheduler::lock(); + if (gdb_write_buffer_first == NULL) { + gdb_write_buffer_first = iorb; + gdb_write_buffer_last = iorb; + Cyg_Scheduler::unlock(); + iorb_setup(this); + } else { + gdb_write_buffer_last->next = iorb; + gdb_write_buffer_last = iorb; + Cyg_Scheduler::unlock(); + } + return 0; +} + +// ------------------------------------------------------------------------ +// Synchronous write +// + +static void +callback(Cyg_IORB *iorb) +{ + Cyg_Binary_Semaphore * data = (Cyg_Binary_Semaphore *)iorb->callback_data; + data->post(); +} + +cyg_int32 +CYG_CLASS_DEVICE_GDB_1::io_write_blocking(Cyg_IORB * iorb) +{ + Cyg_Binary_Semaphore write(0); + + // We need a callback routine to wake us up + iorb->callback_data = (CYG_ADDRESS)&write; + iorb->callback = callback; + iorb->next = NULL; + + Cyg_Scheduler::lock(); + if (gdb_write_buffer_first == NULL) { + gdb_write_buffer_last = iorb; + gdb_write_buffer_first = iorb; + } else { + gdb_write_buffer_last->next = iorb; + gdb_write_buffer_last = iorb; + Cyg_Scheduler::unlock(); + write.wait(); + return 0; + } + + Cyg_Scheduler::unlock(); + iorb_setup(this); + write.wait(); + return 0; +} + +// ------------------------------------------------------------------------ +// Assert versions. These versions bypass most of the driver code. +// These are to be used by the BSP or asserts. Only use them once +// start_sync() is called and when done normal operations is +// restarted with the end_sync() mode. +// +// Note DO NOT DO LOCKING IN THIS ROUTINE!!! +// + +cyg_int32 +CYG_CLASS_DEVICE_GDB_1::io_write_assert(Cyg_IORB * iorb) +{ + Cyg_IORB assert_iorb; + char assert_buffer[256]; + cyg_uint32 length, length_left; + + assert_iorb.callback = NULL; + assert_iorb.callback_data = 0; + assert_iorb.buffer = assert_buffer; + for (length_left = iorb->buffer_length; length_left; length_left -= length) { + length = iorb_compute((char *)iorb->buffer + iorb->xferred_length, + length_left, &assert_iorb); + iorb->xferred_length += length; + (CYG_DEVICE_GDB_1_CLASS *)this->io_write_assert(&assert_iorb); + } + + return 0; +} + +#endif // #ifdef CYG_DEVICE_GDB_1 +// EOF gdb_1.cxx diff --git a/packages/devs/serial/rs232/common/current/ChangeLog b/packages/devs/serial/rs232/common/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/common/current/ChangeLog @@ -0,0 +1,180 @@ +1998-10-24 Hugo Tyson + + * tests/serial_test.c (entry0): + Add runtime check that the zeroth entry in the Cyg_Device_Table + is actually a "serial" device (by name). Otherwise, don't call + the routines; the API existence check in that it compiled remains + sound. + +Fri Oct 23 20:02:17 1998 Jonathan Larmour + + * tests/serial_test.c: + Add a default CYG_TEST_PASS_EXIT when there is no kernel C API, + as we depend on its presence to do the testing + +Fri Oct 23 11:52:45 BST 1998 Chris Provenzano + + * tests/set_baud_rate.c tests/get_baud_rate.c tests/serial1.c + * tests/serial2.c tests/serial3.c tests/serial4.c tests/serial5.c + * tests/serial6.c: Removed these tests as they are superceeded + by tests/serial_test.c. + + * tests/PKGconf.mak: Added serial_test.c and removed all the old + serial[x].c set_baud_rate.c and get_baud_rate.c tests. + + * tests/serial_test.c: New test to just test the API and not much + of the functionality. These tests meet or exceed the previous + existence/spelling tests of the API and therefore replace all the + serial[x].c set_baud_rate.c and get_baud_rate.c tests. + +Mon Oct 19 19:02:21 1998 Jonathan Larmour + + * include/pkgconf/serial_rs232_common.h: + Require the kernel package for this package + +Sun Sep 27 15:18:35 1998 Jesper Skov + + * tests/set_baud_rate.c: Do not change the baud rate to + 0. Undefined behavior in the current drivers. + +Sun Sep 27 13:50:38 1998 Jesper Skov + + * tests/README: Added copyright blurb. + +Fri Sep 25 21:26:08 1998 Jesper Skov + + * tests/set_baud_rate.c (entry0): Do send output if baud rate is + set to 0. This is the correct behavior. It's a problem with the + mn10300 driver. + +Fri Sep 25 20:59:54 1998 Jesper Skov + + * tests/README: Added. + +Fri Sep 25 19:47:36 1998 Jesper Skov + PR 17483 + + * tests/set_baud_rate.c: Don't send any output when baud rate is + set to 0. + +Fri Sep 25 11:25:29 1998 Jesper Skov + + * tests/serial6.c: Do null-test if required calls not available. + + * tests/serial3.c: + * tests/serial5.c: + Added some diag info to help identify these as input tests. + Removed old PR 17270 workaround since the PR 17227 fix made these + tests valid regardless of KMODE config. + + * tests/serial2.c: + * tests/serial4.c: + Added PR 17270 workaround. + + * tests/PKGconf.mak: Reintroduced input tests. + +Thu Sep 17 19:10:03 1998 Frank Ch. Eigler + + * tests/serial2.c (entry0): Reorder foo flag use to avoid race + condition. + +1998-09-14 Bart Veer + + * include/pkgconf/serial_rs232_common.h: + Change the package type to boolean, to allow all serial + devices to be disabled. + +1998-09-12 Bart Veer + + * include/pkgconf/serial_rs232_common.h: + Added missing descriptions (PR 17184) + +Fri Sep 11 12:11:19 1998 Jesper Skov + + * tests/serial2.c: + * tests/serial3.c: + * tests/serial4.c: + * tests/serial5.c: + Undid last change because of a config problem (PR 17270). + +Thu Sep 10 10:28:10 1998 Jesper Skov + + * tests/serial2.c: + * tests/serial3.c: + * tests/serial4.c: + * tests/serial5.c: + Only run actual test when CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + defined. + +Thu Sep 10 10:05:40 1998 Jesper Skov + + * tests/serial6.c: Changed test numbers from 5 to 6. + +1998-09-04 Bart Veer + + * include/pkgconf/serial_rs232_common.h: + Sorting out naming conventions. + +1998-09-03 Bart Veer + + * include/pkgconf/serial_rs232_common.h: + New file to support minimal configuration data. + +Thu Sep 3 10:03:00 1998 Tim Goodwin + + * tests/get_baud_rate.c: + * serial1.c: + * serial2.c: + * serial3.c: + * tests/serial4.c: + * tests/serial5.c: + * tests/serial6.c: + * tests/set_baud_rate.c: + + Change to cyg_thread_create() interface. + +Fri Aug 28 09:43:55 1998 Jonathan Larmour + + * tests/get_baud_rate.c, tests/serial1.c, tests/serial2.c, + tests/serial3.c, tests/serial4.c, tests/serial5.c, tests/serial6.c, + tests/set_baud_rate.c: + Change use of main() as the entry point to cyg_start() under the + new entry point scheme. Remove return codes as cyg_start() returns + void, not int. + +Wed Jul 29 17:46:34 BST 1998 Chris Provenzano + + * include/rs232.h, include/rs232.ht, include/rs232.hxx: + Comment cleanup from the code review. + + * include/rs232.h: Support baudrates up to 460800. + +Mon Jul 27 17:33:59 BST 1998 Chris Provenzano + + * Changelog: Initial ChangeLog entry. + + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== + diff --git a/packages/devs/serial/rs232/common/current/include/baud.h b/packages/devs/serial/rs232/common/current/include/baud.h new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/common/current/include/baud.h @@ -0,0 +1,149 @@ +#ifndef CYGONCE_DEVS_SERIAL_RS232_BAUD_H +#define CYGONCE_DEVS_SERIAL_RS232_BAUD_H + +//========================================================================== +// +// baud.h +// +// Header file for the baud rate +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-05-22 +// Purpose: Define B0 and other macros +// Description: This file contains a lot of macro stuff for the +// baud rate, both internal only. +// Usage: #include something that includes this. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#ifdef CYG_DEVICE_INTERNAL + +// Now set the default baudrate +#ifndef CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE +#error "Must specify a default baud rate" +#else + +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 0) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 50) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B50 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B50 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 75) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B75 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B75 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 110) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B110 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B110 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 134) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B134 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B134 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 150) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B150 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B150 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 200) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B200 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B200 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 200) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B200 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B200 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 300) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B300 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B300 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 600) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B600 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B600 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 1200) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B1200 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B1200 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 1800) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B1800 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B1800 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 2400) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B2400 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B2400 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 4800) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B4800 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B4800 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 9600) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B9600 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B9600 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 19200) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B19200 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B19200 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 38400) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 57600) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B57600 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B57600 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 115200) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B115200 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B115200 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 230400) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B230400 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B230400 +#endif +#if (CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE == 460800) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE CYG_DEVICE_SERIAL_RS232_T1_VALUE_B460800 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE CYG_DEVICE_SERIAL_RS232_T2_VALUE_B460800 +#endif + +#ifndef CYG_DEVICE_SERIAL_RS232_T1_VALUE +#error "Invalid default baud rate." +#endif + +#endif // CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE + +#endif // CYG_DEVICE_INTERNAL + +#endif // CYGONCE_DEVS_SERIAL_RS232_BAUD_H +// End of baud.h + diff --git a/packages/devs/serial/rs232/common/current/include/pkgconf/serial_rs232_common.h b/packages/devs/serial/rs232/common/current/include/pkgconf/serial_rs232_common.h new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/common/current/include/pkgconf/serial_rs232_common.h @@ -0,0 +1,63 @@ +#ifndef CYGONCE_PKGCONF_SERIAL_RS232_COMMON_H +#define CYGONCE_PKGCONF_SERIAL_RS232_COMMON_H +// ==================================================================== +// +// pkgconf/serial_rs232_common.h +// +// Configuration file for shared serial line code. +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-03 +// Purpose: To allow the user to edit configuration +// options common to all serial lines. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +/* ---------------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_DEVICES_SERIAL_RS232_COMMON { + display "Serial RS232 devices" + type bool + # parent CYGPKG_DEVICES_SERIAL + parent CYGPKG_DEVICES + requires CYGPKG_KERNEL + description " + Drivers for various RS232 devices." + doc ref/ecos-ref/part-iii.html + } + + }}CFG_DATA +*/ + +#endif /* CYGONCE_PKGCONF_SERIAL_RS232_COMMON_H */ +/* EOF serial_rs232_common.h */ diff --git a/packages/devs/serial/rs232/common/current/include/rs232.h b/packages/devs/serial/rs232/common/current/include/rs232.h new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/common/current/include/rs232.h @@ -0,0 +1,94 @@ +#ifndef CYGONCE_DEVS_SERIAL_RS232_COMMON_RS232_H +#define CYGONCE_DEVS_SERIAL_RS232_COMMON_RS232_H + +//========================================================================== +// +// rs232.h +// +// Header file for the generic serial device +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-20 +// Purpose: Define Cyg_Device_Serial data structure +// Description: This file contains the baud rates and line modes for the +// RS232 serial devices. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +// Various baud rates +// Macro names are the same as the POSIX ones. +#define B0 0 +#define B50 1 +#define B75 2 +#define B110 3 +#define B134 4 +#define B150 5 +#define B200 6 +#define B300 7 +#define B600 8 +#define B1200 9 +#define B1800 10 +#define B2400 11 +#define B4800 12 +#define B9600 13 +#define B19200 14 +#define B38400 15 +// Non POSIX FAST baud rates. +#define B57600 16 +#define B115200 17 +#define B230400 18 +#define B460800 19 + +// Various line modes +// Macro names are the same as the POSIX ones. +#define CSIZE 0x03 // Mask for number of bits per byte +#define CS5 0x00 +#define CS6 0x01 +#define CS7 0x02 +#define CS8 0x04 +#define CSTOPB 0x04 // If set then two stop bits otherwise one +#define PARENB 0x10 // If set then parity is enabled +#define PARODD 0x20 // If set then odd parity otherwise even + +// Read mode bits +#define CYG_DEVICE_SERIAL_RS232_READ_MODE_IGN 0x01 // Ignore +#define CYG_DEVICE_SERIAL_RS232_READ_MODE_TRN 0x02 // Translate +#define CYG_DEVICE_SERIAL_RS232_READ_MODE_EOB 0x04 // End of Buffer + +// Possible future read mode options +//#define CYG_DEVICE_SERIAL_RS232_READ_MODE_ESCAPE 0x10 +//#define CYG_DEVICE_SERIAL_RS232_READ_MODE_XOFF 0x20 +//#define CYG_DEVICE_SERIAL_RS232_READ_MODE_XON 0x40 + +#endif // CYGONCE_DEVS_SERIAL_RS232_COMMON_RS232_H +// End of rs232.h + diff --git a/packages/devs/serial/rs232/common/current/include/rs232.ht b/packages/devs/serial/rs232/common/current/include/rs232.ht new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/common/current/include/rs232.ht @@ -0,0 +1,135 @@ +#ifndef CYGONCE_DEVS_SERIAL_RS232_COMMON_RS232_HT +#define CYGONCE_DEVS_SERIAL_RS232_COMMON_RS232_HT + +//========================================================================== +// +// rs232.ht +// +// Template file for rs232 serial device +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-22 +// Purpose: Internals to a configured device serial rs232 class. +// Description: This file contains the INTERNALS of a C++ class. +// This file is included inside the declaration of the C++ class. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +/* + * Some of these fields will be accessed by some ISR routines. Any field + * that is modified by an ISR routine must be declared volatile. + */ +#ifdef CYG_DEVICE_INTERNAL + + protected: + // Read + Cyg_IORB * volatile read_buffer; + + // Only needed for interrupt mode + #ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + Cyg_Queuet + read_buffers; + #ifdef CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + Cyg_IORB * volatile read_buffers_ll_first; + Cyg_IORB * volatile read_buffers_ll_last; + #endif + + #ifndef CYG_DEVICE_SERIAL_RS232_ONE_VECTOR + Cyg_Interrupt read_interrupt; + #endif + + #ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL +// volatile cyg_ucount32 read_throttle; +// cyg_uint8 read_throttle_size; // this can be made configurable +// cyg_uint8 read_throttle_free; +// cyg_uint8 read_throttle_queued; +// char read_throttle_buffer[256]; + #endif + #endif + + #ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + cyg_uint8 read_mode; + cyg_uint8 read_mode_eob_count; + const char * read_mode_eob_chars; +// cyg_uint8 read_mode_translate_char; +// cyg_uint8 read_mode_escape_next_char; + + #endif + + // These are actually routines in disguize + static cyg_ISR read_isr; + static cyg_DSR read_dsr; + + // Write + Cyg_IORB * volatile write_buffer; + + // Only needed for interrupt mode + #ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + Cyg_Queuet + write_buffers; + #ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + Cyg_IORB * volatile write_buffers_ll_first; + Cyg_IORB * volatile write_buffers_ll_last; + #endif + + #ifndef CYG_DEVICE_SERIAL_RS232_ONE_VECTOR + Cyg_Interrupt write_interrupt; + #endif + #endif + + // These are actually routines in disguize + static cyg_ISR write_isr; + static cyg_DSR write_dsr; + + #ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + cyg_uint8 write_mode; + volatile cyg_int8 write_char; + #endif + + // Generic + #ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + #ifdef CYG_DEVICE_SERIAL_RS232_ONE_VECTOR + Cyg_Interrupt both_interrupt; + static cyg_ISR both_isr; + static cyg_DSR both_dsr; + #endif + cyg_uint8 kmode; + #endif + + #ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + Cyg_Mutex mutex; + #endif + +#endif // CYG_DEVICE_INTERNAL +#endif // CYGONCE_DEVS_SERIAL_RS232_COMMON_RS232_HT +// End of rs232.ht + diff --git a/packages/devs/serial/rs232/common/current/include/rs232.hxx b/packages/devs/serial/rs232/common/current/include/rs232.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/common/current/include/rs232.hxx @@ -0,0 +1,68 @@ +#ifndef CYGONCE_DEVS_SERIAL_RS232_COMMON_RS232_HXX +#define CYGONCE_DEVS_SERIAL_RS232_COMMON_RS232_HXX + +//========================================================================== +// +// rs232.hxx +// +// Header file for the generic serial device +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-20 +// Purpose: Define Cyg_Device_Serial data structure +// Description: This file contains the C++ class declaration of +// Cyg_Device_Serial_RS232, which is the base class for all +// RS232 serial devices. +// Usage: #include "cyg/devs/serial/rs232/common/rs232.hxx" +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include // tracing macros + +#include +#include + +#include + +// ------------------------------------------------------------------------- +// Cyg_Device_Serial_RS232 + +class Cyg_Device_Serial_RS232 + : public Cyg_Device_Serial +{ + // nothing extra +}; + +#endif // CYGONCE_DEVS_SERIAL_RS232_COMMON_RS232_HXX +// End of rs232.hxx + diff --git a/packages/devs/serial/rs232/common/current/tests/PKGconf.mak b/packages/devs/serial/rs232/common/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/common/current/tests/PKGconf.mak @@ -0,0 +1,39 @@ +#=============================================================================== +# +# makefile +# +# devs/serial/rs232/common/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_serial_rs232_common +include ../../../../../../pkgconf/pkgconf.mak + +TESTS := serial_test + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + + diff --git a/packages/devs/serial/rs232/common/current/tests/serial_test.c b/packages/devs/serial/rs232/common/current/tests/serial_test.c new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/common/current/tests/serial_test.c @@ -0,0 +1,164 @@ +//================================================================= +// +// serial_test.c +// +// Test that the device API for the serial device exists. +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// October 31, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-10-08 +// Description: Tests basic serial functionality. +//####DESCRIPTIONEND#### + +#include +#include // Generic test macros +#ifdef CYGPKG_KERNEL +# include +#endif + +#ifndef CYGFUN_KERNEL_API_C + +externC void +cyg_start(void) +{ + CYG_TEST_INIT(); + + CYG_TEST_PASS_EXIT("N/A: Testing is not applicable " + "to this configuration"); +} + +#else + +#include // All the kernel specific stuff +#include // All the device specific stuff + +#define NTHREADS 1 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + +char message1[] = "This is test message 1.\n"; +char message2[] = "This is test message 2.\n"; + +/* Only call routines that do not require user input */ +void entry0(CYG_ADDRWORD data) +{ + Cyg_IORB iorb1, iorb2; + cyg_int32 baud_rate, i; + + /* Only call routines if there is a serial device in the system */ + if ( NULL == Cyg_Device_Table[0].name || + /* strcmp is not necessarily around */ + 's' != Cyg_Device_Table[0].name[0] || + 'e' != Cyg_Device_Table[0].name[1] || + 'r' != Cyg_Device_Table[0].name[2] || + 'i' != Cyg_Device_Table[0].name[3] || + 'a' != Cyg_Device_Table[0].name[4] || + 'l' != Cyg_Device_Table[0].name[5] ) { + CYG_TEST_PASS_EXIT( "N/A: no serial device in Cyg_Device_Table" ); + return; + } + + iorb1.callback = NULL; + iorb1.buffer = message1; + iorb1.buffer_length = sizeof(message1) - 1; + cyg_write_asynchronous(Cyg_Device_Table, &iorb1); + + iorb2.buffer = message2; + iorb2.buffer_length = sizeof(message2) - 1; + cyg_write_blocking(Cyg_Device_Table, &iorb2); + + for (i = 0; i < 1000000; i++); // Delay to flush the tx buffer + + if ((cyg_serial_rs232_get_baud_rate(Cyg_Device_Table, &baud_rate )) >= 0) { + CYG_TEST_PASS_FAIL( + (cyg_serial_rs232_set_baud_rate(Cyg_Device_Table, baud_rate,&i) >= 0), + "Setting baud rate to previous baud rate."); + } else { + CYG_TEST_FAIL("Could not get baud rate."); + } + + CYG_TEST_PASS_EXIT("serial_test"); +} + +/* Make calls to the rest of the API */ +void entry_bogus(CYG_ADDRWORD data) +{ + Cyg_IORB iorb; + char buf[1024]; + cyg_uint32 old; + iorb.buffer = buf; + iorb.buffer_length = sizeof(buf); + + // Set mode to interrupt + cyg_serial_rs232_set_kmode(Cyg_Device_Table, (cyg_uint32)1); + // cyg_serial_rs232_get_kmode(Cyg_Device_Table); // Doesn't exist yet + + // These could go in the entry0 routine + cyg_serial_rs232_get_line_mode(Cyg_Device_Table, &old); + cyg_serial_rs232_set_line_mode(Cyg_Device_Table, 1, &old); + + cyg_serial_rs232_get_baud_rate(Cyg_Device_Table, &old); + cyg_serial_rs232_set_baud_rate(Cyg_Device_Table, 1, &old); + + cyg_serial_rs232_get_read_mode(Cyg_Device_Table, &old); + cyg_serial_rs232_set_read_mode(Cyg_Device_Table, 1, &old); + + cyg_serial_rs232_set_read_data(Cyg_Device_Table, 1, NULL, 0); + cyg_read_asynchronous(Cyg_Device_Table, &iorb); + cyg_read_blocking(Cyg_Device_Table, &iorb); + cyg_read_cancel(Cyg_Device_Table, &iorb); + + // cyg_serial_rs232_set_write_mode(Cyg_Device_Table, 1);// Doesn't exist yet + // cyg_serial_rs232_get_write_mode(Cyg_Device_Table);// Doesn't exist yet + cyg_write_asynchronous(Cyg_Device_Table, &iorb); + cyg_write_blocking(Cyg_Device_Table, &iorb); + // cyg_write_cancel(Cyg_Device_Table, &iorb); // Doesn't exist yet +} + +externC void +cyg_start(void) +{ + CYG_TEST_INIT(); + + cyg_thread_create(4, entry0, (cyg_addrword_t)0, "serial_test", + (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_EXIT("Not reached"); + + entry_bogus(0); // To prevent selective linking from GC all the bogus calls. +} + +#endif // ifdef CYGFUN_KERNEL_API_C + +// EOF serial_test.cxx diff --git a/packages/devs/serial/rs232/mn10300/current/ChangeLog b/packages/devs/serial/rs232/mn10300/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/ChangeLog @@ -0,0 +1,306 @@ +1998-10-24 Hugo Tyson + + * include/pkgconf/serial_mn10300.h: + Only define anything if we have the correct hardware platform and + NOT a simulator target for that platform, as well as the device + package itself being defined. + +1998-10-23 Hugo Tyson + + * tests/mn10300_1_serial_test.cxx: + Move include of testing header above the check for "can we test". + + * tests/mn10300_2_serial_test.cxx: + Move include of testing header above the check for "can we test". + Assign dummy to unused baud_rate to prevent warning; this keeps + this test as similar as possible to the others. + +Thu Oct 22 13:15:06 BST 1998 Chris Provenzano + + * include/serial_mn10300_1.hxx, include/serial_mn10300_2.hxx + * src/serial_mn10300_1.cxx, src/serial_mn10300_2.cxx + Fix PR17883. 0 byte writes hang driver. + + * mn10300_1_serial_test.cxx, mn10300_2_serial_test.cxx + Fix up some coding standard problems. + +Wed Oct 21 17:50:04 BST 1998 Chris Provenzano + + * mn10300_2_serial_out_blocking.cxx: Removed. It is no longer + pertinent. All functionality is in mn10300_2_serial_write_blocking.cxx + which is an internal test not to be sent out this release. + + * PKGconf.mak: Added two new API tests to build. + + * mn10300_1_serial_test.cxx, mn10300_2_serial_test.cxx: Two new tests + that test just the API and not much of the functionality. These tests + meet or exceed the previous existence/spelling tests of the API and + therefore replace all the serial[x].cxx tests which were removed. + +Tue Oct 20 15:54:43 1998 Jonathan Larmour + + * src/PKGconf.mak: + Remove unnecessary override of PKGCONF_CXXFLAGS + +Tue Oct 20 11:15:30 BST 1998 Chris Provenzano + + * tests/PKGconf.mak: The defaul build should only build tests that + can be run with the automated test infrastructure. I.E. None. + + * tests/README, tests/serial3.cxx, tests/serial4.cxx tests/serial5.cxx + * tests/serial7.cxx, tests/set_baud_rate.cxx: Removed trash tests. + Much better tests along with testing infrastructure are on the way. + +1998-10-19 Jesper Skov + + * include/pkgconf/serial_mn10300.h: Undid 1998-10-16 change. + +1998-10-16 Jesper Skov + + * include/pkgconf/serial_mn10300.h: Changed + CYGPKG_HAL_MN10300_STDEVAL1 to CYG_HAL_MN10300_STDEVAL1. + +Thu Oct 15 17:00:00 1998 John Dallaway + + * include/pkgconf/serial_mn10300.h: Disable dependence on HAL in CDL. + +Sun Sep 27 13:50:23 1998 Jesper Skov + + * tests/README: Added copyright blurb. + +Sun Sep 27 10:30:53 1998 Jesper Skov + + PR 17505 + + * src/serial_mn10300_1.cxx (get_baud_rate): Remove seemingly + spurious mutex.unlock. + +Fri Sep 25 20:59:46 1998 Jesper Skov + + * tests/README: Added. + +Fri Sep 25 19:58:38 1998 Jesper Skov + + * include/serial_mn10300_2.hxx: Use same serial divisors for 9600, + 19200 and 38400 baud as CygMon. + +Fri Sep 25 11:17:31 1998 Jesper Skov + + * tests/mn10300_2_get_baud_rate.cxx (entry0): Use a signed + variable to hold return value (baud_rate). + + * tests/serial6.cxx (entry1): Reduced delay. + Added some diag info. + Changed test numbers to match file. + + * tests/PKGconf.mak: Reintroduced input tests. + + * tests/serial3.c: + * tests/serial5.c: + Added some diag info to help identify these as input tests. + + * tests/serial3.c: + * tests/serial4.c: + * tests/serial5.c: + * tests/serial6.c: + Changed NULL-test condition to match default serial port + configuration. + +Wed Sep 23 14:34:22 1998 Jesper Skov + PR 17424 + + * src/serial_mn10300_1.cxx: + * src/serial_mn10300_2.cxx: + (io_write, io_read) Also do callbacks in poll-mode, if the pointer + is non-NULL. + +Tue Sep 22 14:26:35 1998 Jesper Skov + + * include/serial_mn10300_2.hxx: Extended driver class name with + _2. + +Thu Sep 17 13:01:21 1998 Jesper Skov + + * include/pkgconf/serial_mn10300_1.h: + * include/pkgconf/serial_mn10300_2.h: + Protect CYG_DEVICE_SERIAL_RS232_MN10300_x_KMODE_INTERRUPT with + CYGIMP_KERNEL_INTERRUPTS_DSRS. + Protect CYG_DEVICE_SERIAL_RS232_MUTEX with CYGPKG_KERNEL. + + * include/pkgconf/serial_mn10300.h: Put some requires in CDL. + +Thu Sep 17 09:46:03 1998 Jesper Skov + + * tests/PKGconf.mak: Removed TESTS_IN and TESTS_OTHER since they + fail. + +Tue Sep 15 02:23:06 BST 1998 Chris Provenzano + + * include/serial_mn10300_1.hxx, include/serial_mn10300_1.hxx, + * src/serial_mn10300_1.cxx, src/serial_mn10300_2.cxx: + Use positive macros instead of negative changing all + ...DO_NOT_DECLARE macros to ...DECLARE + +1998-09-12 Bart Veer + + * include/pkgconf/serial_mn10300.h: + Added missing descriptions (PR 17184) + +Fri Sep 11 10:25:20 1998 Jesper Skov + + * src/serial_mn10300_1.cxx (set_kmode): + * src/serial_mn10300_2.cxx (set_kmode): + Fixed Assertion. + + * include/serial_mn10300_2.hxx: + * include/serial_mn10300_1.hxx: + Use interrupt vectors defined by hal_intr.h. + +Thu Sep 10 11:20:08 1998 Jesper Skov + PR#17176 + + * include/serial_mn10300_1.hxx: Removed conditionals around + set_kmode. + * src/serial_mn10300_1.cxx (io_read_cancel): Made to compile + without KMODE_INTERRUPT. + (set_kmode): Added dummy function for use when only one kmode is + configured. + + * include/serial_mn10300_2.hxx: Removed conditionals around + set_kmode. + * src/serial_mn10300_2.cxx (io_read_cancel): Made to compile + without KMODE_INTERRUPT. + (set_kmode): Added dummy function for use when only one kmode is + configured. + +1998-09-04 Bart Veer + + * include/pkgconf/serial_mn10300.h: + Fixed the parent definition for the package. + +1998-09-03 Bart Veer + + * src/serial_mn10300_2.cxx: + * src/serial_mn10300_1.cxx: + * include/pkgconf/serial_mn10300.h: + Provide minimal support for configuration data. + +Thu Sep 3 15:58:13 1998 Jonathan Larmour + + * include/pkgconf/serial_mn10300.h, + include/pkgconf/serial_mn10300_2.h: + Move these files here from devs/common/current/include/pkgconf/ + renaming serial_mn10300_1.h to serial_mn10300.h + +Thu Sep 3 10:09:52 1998 Tim Goodwin + + * tests/serial7.cxx: + Comments claim this is test 2 and test 5! + +Wed Sep 2 22:11:03 1998 Jonathan Larmour + + * include/serial_mn10300.hxx, include/serial_mn10300_2.hxx: + Rename serial_mn10300.hxx to serial_mn10300_2.hxx + + * include/serial_mn10300_2.hxx, src/serial_mn10300_2.cxx: + Change all mentions of serial_mn10300.hxx to serial_mn10300_2.hxx + including things in comments + +Fri Aug 28 09:48:38 1998 Jonathan Larmour + + * tests/mn10300_2_get_baud_rate.cxx, + tests/mn10300_2_serial_out_asynchronous.cxx, + tests/mn10300_2_serial_out_blocking.cxx, tests/serial3.cxx, + tests/serial4.cxx, tests/serial5.cxx, tests/serial6.cxx, + tests/serial7.cxx, tests/set_baud_rate.cxx: + Change use of main() as the entry point to cyg_start() under the + new entry point scheme. Remove return codes as cyg_start() returns + void, not int. + +Wed Jul 29 17:48:58 BST 1998 Chris Provenzano + + * include/serial_mn10300.hxx, src/serial_mn10300_2.cxx: + Support baudrates up to 460800 + + * tests/PKGconf.mak, + * tests/get_baud_rate.cxx, tests/mn10300_2_get_baud_rate.cxx: + Rename get_baud_rate.cxx to mn10300_2_get_baud_rate.cxx + +Wed Jul 29 16:12:29 BST 1998 Chris Provenzano + + * serial/rs232/mn10300/current/tests/PKGconf.mak: + Add more tests. + + * tests/mn10300_2_serial_out_blocking.cxx: Use correct + device macro for identifying declared device. + + * tests/mn10300_2_serial_out_asynchronous.cxx: Replaces + old serial2.cxx test. Does a lot more testing too. + + * tests/serial1.cxx, tests/serial2.cxx: Remove old tests. + +Wed Jul 29 13:38:27 BST 1998 Chris Provenzano + + * serial/rs232/mn10300/current/tests/PKGconf.mak: + Add more tests. + + * src/serial_mn10300_2.cxx: If interrupt mode is configured + then make that the default mode. This is required to let + devices work with the ROM monitor as the read isr needs to + catch ^C when the kernel is running. + + * src/serial_mn10300_2.cxx: Fix interrupt mode to DTRT + when a 0 buffer_length IORB is passed to io_write(). + + * tests/mn10300_2_serial_out_blocking.cxx: Replaces old + serial1.cxx test. Does a lot more testing too. + +Tue Jul 28 21:19:17 BST 1998 Chris Provenzano + + * tests/PKGconf.mak: Sort tests by device testing guidelines + + * tests/serial1.cxx: Update test to use CYGVAR_DEVICE_TEST_NAME + Added small stress test and also test for setting of + xferred_length in returned IORB buffer. + + * tests/set_baud_rate.cxx: Some fixes to let it compile. + +Mon Jul 27 23:39:57 BST 1998 Chris Provenzano + + * include/serial_mn10300.hxx: + Remove CYG_DEVICE_..._KMODE_ASSERT configuration option. + Selective linking will DTRT for this option. + + * tests/get_baud_rate.cxx, tests/serial2.cxx, tests/serial4.cxx, + * tests/serial6.cxx, tests/serial7.cxx: + Use macro device names instead of hardcoded names. + +Mon Jul 27 17:33:59 BST 1998 Chris Provenzano + + * Changelog: Initial ChangeLog entry. + + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== + diff --git a/packages/devs/serial/rs232/mn10300/current/include/pkgconf/serial_mn10300.h b/packages/devs/serial/rs232/mn10300/current/include/pkgconf/serial_mn10300.h new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/include/pkgconf/serial_mn10300.h @@ -0,0 +1,89 @@ +#ifndef CYGONCE_PKGCONF_SERIAL_MN10300_H +#define CYGONCE_PKGCONF_SERIAL_MN10300_H +// ==================================================================== +// +// pkgconf/serial_mn10300.h +// +// Device configuration file for mn10300 serial devices +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-04-24 +// Purpose: To allow the user to edit device configuration +// options for the mn10300 serial devices +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +#include + +/* Only define options if the driver is to be present. */ +#if defined( CYGPKG_HAL_MN10300 ) && \ + !defined( CYGPKG_HAL_MN10300_SIM ) && \ + defined( CYGPKG_DEVICES_SERIAL_RS232_MN10300 ) + +/* ---------------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_DEVICES_SERIAL_RS232_MN10300 { + display "MN10300 serial devices" + parent CYGPKG_DEVICES_SERIAL_RS232_COMMON +# requires CYGPKG_HAL_MN10300_STDEVAL1 + requires CYGPKG_KERNEL + description " + Drivers for the on-chip RS232 devices." + } + + cdl_component CYGPKG_DEVICES_SERIAL_RS232_MN10300_1 { + display "On-chip serial device 1" + parent CYGPKG_DEVICES_SERIAL_RS232_MN10300 + requires CYGPKG_KERNEL + description " + Driver for the first on-chip RS232 device." + } + + cdl_component CYGPKG_DEVICES_SERIAL_RS232_MN10300_2 { + display "On-chip serial device 2" + parent CYGPKG_DEVICES_SERIAL_RS232_MN10300 + requires CYGPKG_KERNEL + description " + Driver for the second on-chip RS232 device." + } + + }}CFG_DATA +*/ + +#define CYGPKG_DEVICES_SERIAL_RS232_MN10300_1 +#define CYGPKG_DEVICES_SERIAL_RS232_MN10300_2 + +#endif /* ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300 et al */ + +#endif /* CYGONCE_PKGCONF_SERIAL_MN10300_H */ +/* EOF serial_mn10300.h */ diff --git a/packages/devs/serial/rs232/mn10300/current/include/pkgconf/serial_mn10300_1.h b/packages/devs/serial/rs232/mn10300/current/include/pkgconf/serial_mn10300_1.h new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/include/pkgconf/serial_mn10300_1.h @@ -0,0 +1,167 @@ +#ifndef CYGONCE_PKGCONF_SERIAL_MN10300_1_H +#define CYGONCE_PKGCONF_SERIAL_MN10300_1_H +// ==================================================================== +// +// pkgconf/serial_mn10300_1.h +// +// Device configuration file for mn10300 serial 1 +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors:proven +// Date: 1998-04-24 +// Purpose: To allow the user to edit device specific configuration +// for the mn10300 1 serial device. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +#include + +#ifdef CYGPKG_KERNEL +#include +#endif + +/* Only define options if the driver is to be present. */ +#ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_1 + +/* ==================================================================== + * First we define all the options that are exportable to the user. + * These options will show/hide various methods for the class. + * These options are always device specific. + */ + +/* --------------------------------------------------------------------- + * Define what kernel mode the driver can support. One must be defined. + * Both can be defined. + */ +#define CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_POLLED +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS +#define CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_INTERRUPT +#endif + +/* --------------------------------------------------------------------- + * Define if we do diag output. This could possible be another kmode. + * --proven 19980512 + */ +#define CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_ASSERT + +/* --------------------------------------------------------------------- + * Define the default baudrate and line mode. + */ +#define CYG_DEVICE_SERIAL_RS232_MN10300_1_DEFAULT_BAUD_RATE 19200 + +/* --------------------------------------------------------------------- + * Define if non binary terminal protocol modes are needed. + */ +#define CYG_DEVICE_SERIAL_RS232_MN10300_1_READ_MODES +#define CYG_DEVICE_SERIAL_RS232_MN10300_1_WRITE_MODES + + +#ifdef CYG_DEVICE_INTERNAL +/* ==================================================================== + * Now define internal only options. These options dictate the struture + * of a class but have no effect on the methods declared for a class. + */ + +/* --------------------------------------------------------------------- + * The need for queues is only necessary in interrupt mode. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_INTERRUPT + +/* --------------------------------------------------------------------- + * Define the number of iorb read buffers the serial read_isr device can + * handle at one time. Also define if the device needs to queue more iorbs + * than what the read_isr can handle. + */ +# define CYG_DEVICE_SERIAL_RS232_READ_BUFFERS 4 +# define CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + +/* --------------------------------------------------------------------- + * Define the number of iorb write buffers the serial write_isr device can + * handle at one time. Also define if the device needs to queue more iorbs + * than what the write_isr can handle. + */ +# define CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS 4 +# define CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_INTERRUPT + +/* ==================================================================== + * Duplicate the device specific options to device generic options. + * DO NOT modify these options. Modify the corresponding options above. + * This is so the internal source files can be compiled from the same + * common sources. These defines can never be exported to the user. + */ + +/* --------------------------------------------------------------------- + * Define what kernel mode the driver can support. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_INTERRUPT +#define CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT 1 +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_POLLED +#define CYG_DEVICE_SERIAL_RS232_KMODE_POLLED 0 +#endif + +/* --------------------------------------------------------------------- + * Define what line modes the driver can support. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_LINE_MODES +#define CYG_DEVICE_SERIAL_RS232_LINE_MODES +#endif + +/* --------------------------------------------------------------------- + * Define any terminal protocols need to be supported. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_READ_MODES +#define CYG_DEVICE_SERIAL_RS232_READ_MODES +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_WRITE_MODES +#define CYG_DEVICE_SERIAL_RS232_WRITE_MODES +#endif + + +#ifdef CYGPKG_KERNEL +/* --------------------------------------------------------------------- + * Define if a mutex is needed to lock out multiple threads accessing + * the serial driver. If not defined then it is assumes only one + * thread will access the driver at a given time. + */ +#define CYG_DEVICE_SERIAL_RS232_MUTEX +#endif /* CYGPKG_KERNEL */ + +#endif // CYG_DEVICE_INTERNAL + +#endif /* ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_1 */ + +#endif /* CYGONCE_PKGCONF_SERIAL_MN10300_1_H */ +/* EOF serial_mn10300_1.h */ diff --git a/packages/devs/serial/rs232/mn10300/current/include/pkgconf/serial_mn10300_2.h b/packages/devs/serial/rs232/mn10300/current/include/pkgconf/serial_mn10300_2.h new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/include/pkgconf/serial_mn10300_2.h @@ -0,0 +1,160 @@ +#ifndef CYGONCE_PKGCONF_SERIAL_MN10300_2_H +#define CYGONCE_PKGCONF_SERIAL_MN10300_2_H +// ==================================================================== +// +// pkgconf/serial_mn10300_2.h +// +// Device configuration file for mn10300 serial 2 +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors:proven +// Date: 1998-04-24 +// Purpose: To allow the user to edit device specific configuration +// for the mn10300 2 serial device. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +#include + +#ifdef CYGPKG_KERNEL +#include +#endif + +/* Only define options if the driver is to be present. */ +#ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_2 + +/* ==================================================================== + * First we define all the options that are exportable to the user. + * These options will show/hide various methods for the class. + * These options are always device specific. + */ + +/* --------------------------------------------------------------------- + * Define what kernel mode the driver can support. One must be defined. + * Both can be defined. + */ +#define CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_POLLED +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS +#define CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_INTERRUPT +#endif + +/* --------------------------------------------------------------------- + * Define the default baudrate and line mode. + */ +#define CYG_DEVICE_SERIAL_RS232_MN10300_2_DEFAULT_BAUD_RATE 38400 + +/* --------------------------------------------------------------------- + * Define if non binary terminal protocol modes are needed. + */ +#define CYG_DEVICE_SERIAL_RS232_MN10300_2_READ_MODES +#define CYG_DEVICE_SERIAL_RS232_MN10300_2_WRITE_MODES + + +#ifdef CYG_DEVICE_INTERNAL +/* ==================================================================== + * Now define internal only options. These options dictate the struture + * of a class but have no effect on the methods declared for a class. + */ + +/* --------------------------------------------------------------------- + * The need for queues is only necessary in interrupt mode. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_INTERRUPT + +/* --------------------------------------------------------------------- + * Define the number of iorb read buffers the serial read_isr device can + * handle at one time. Also define if the device needs to queue more iorbs + * than what the read_isr can handle. + */ +# define CYG_DEVICE_SERIAL_RS232_READ_BUFFERS 4 +# define CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + +/* --------------------------------------------------------------------- + * Define the number of iorb write buffers the serial write_isr device can + * handle at one time. Also define if the device needs to queue more iorbs + * than what the write_isr can handle. + */ +# define CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS 4 +# define CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_INTERRUPT + +/* ==================================================================== + * Duplicate the device specific options to device generic options. + * DO NOT modify these options. Modify the corresponding options above. + * This is so the internal source files can be compiled from the same + * common sources. These defines can never be exported to the user. + */ + +/* --------------------------------------------------------------------- + * Define what kernel mode the driver can support. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_INTERRUPT +#define CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT 1 +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_POLLED +#define CYG_DEVICE_SERIAL_RS232_KMODE_POLLED 0 +#endif + +/* --------------------------------------------------------------------- + * Define what line modes the driver can support. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_LINE_MODES +#define CYG_DEVICE_SERIAL_RS232_LINE_MODES +#endif + +/* --------------------------------------------------------------------- + * Define any terminal protocols need to be supported. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_READ_MODES +#define CYG_DEVICE_SERIAL_RS232_READ_MODES +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_WRITE_MODES +#define CYG_DEVICE_SERIAL_RS232_WRITE_MODES +#endif + +#ifdef CYGPKG_KERNEL +/* --------------------------------------------------------------------- + * Define if a mutex is needed to lock out multiple threads accessing + * the serial driver. If not defined then it is assumes only one + * thread will access the driver at a given time. + */ +#define CYG_DEVICE_SERIAL_RS232_MUTEX +#endif /* CYGPKG_KERNEL */ + +#endif // CYG_DEVICE_INTERNAL + +#endif /* ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_2 */ + +#endif /* CYGONCE_PKGCONF_SERIAL_MN10300_2_H */ +/* EOF serial_mn10300_2.h */ diff --git a/packages/devs/serial/rs232/mn10300/current/include/serial_mn10300_1.hxx b/packages/devs/serial/rs232/mn10300/current/include/serial_mn10300_1.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/include/serial_mn10300_1.hxx @@ -0,0 +1,201 @@ +#ifndef CYGONCE_DEVS_SERIAL_RS232_MN10300_SERIAL_MN10300_1_HXX +#define CYGONCE_DEVS_SERIAL_RS232_MN10300_SERIAL_MN10300_1_HXX + +//========================================================================== +// +// serial_mn10300_1.hxx +// +// Header file for the mn10300 serial port #1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-22 +// Purpose: Define Cyg_Device_Serial_mn10300_1 data structure +// Description: This file contains the C++ class declaration of +// Cyg_Device_Serial_mn10300_1. There can be only one. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // Device configureation file + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1 +// Include Configureation options specific to the device +#include CYG_DEVICE_SERIAL_RS232_MN10300_1 + +#include +#include // assertion macros +#include // tracing macros + +#include // Cyg_ISR, Cyg_DSR +#include // intr.hxx +#include // intr.hxx +#include // vectors +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX +#include +#endif +#include + +// ------------------------------------------------------------------------- +// The mn10300 serial 1 device is CURRENTLY unique. + +#ifdef CYG_DEVICE_INTERNAL +// Define the serial registers. +#define CYG_DEVICE_SERIAL_RS232_CR ((volatile cyg_uint16 *)0x34000810) +#define CYG_DEVICE_SERIAL_RS232_ICR ((volatile cyg_uint8 *) 0x34000814) +#define CYG_DEVICE_SERIAL_RS232_TXR ((volatile cyg_uint8 *) 0x34000818) +#define CYG_DEVICE_SERIAL_RS232_RXR ((volatile cyg_uint8 *) 0x34000819) + +#define CYG_DEVICE_SERIAL_RS232_SR_ADDR 0x3400081c +#define CYG_DEVICE_SERIAL_RS232_SR_SIZE cyg_uint16 +#define CYG_DEVICE_SERIAL_RS232_SR \ + ((volatile CYG_DEVICE_SERIAL_RS232_SR_SIZE *) CYG_DEVICE_SERIAL_RS232_SR_ADDR) + +// Timer 2 provides the baud rate divisor for serial 2 exclusivly +#define TIMER1_MD ((volatile cyg_uint8 *)0x34001001) +#define TIMER1_BR ((volatile cyg_uint8 *)0x34001011) +#define TIMER2_CR ((volatile cyg_uint8 *)0x34001021) + +#define PORT3_MD ((volatile cyg_uint8 *)0x36008025) + + +#define CYG_DEVICE_SERIAL_RS232_TVEC CYG_VECTOR_SERIAL_1_TX +#define CYG_DEVICE_SERIAL_RS232_RVEC CYG_VECTOR_SERIAL_1_RX + +// Here are the values for the timers to set the various baud rates +// Timer 1 is the 8 bit timer 1 register +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 0 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B600 0 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B1200 0 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B2400 0 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B4800 0 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B9600 195 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B19200 98 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400 48 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B57600 32 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B115200 16 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B230400 8 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B460800 4 + +// Timer 2 doesn't exist and is always 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B600 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B1200 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B2400 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B4800 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B9600 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B19200 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B57600 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B115200 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B230400 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B460800 0 + +// Now set the default baudrate +#ifndef CYG_DEVICE_SERIAL_RS232_MN10300_1_DEFAULT_BAUD_RATE +#error "Must specify a default baud rate" +#else +#if ((CYG_DEVICE_SERIAL_RS232_MN10300_1_DEFAULT_BAUD_RATE > 0) && \ + (CYG_DEVICE_SERIAL_RS232_MN10300_1_DEFAULT_BAUD_RATE < 9600)) +#error "Baud rates less than 9600 are not supported for the mn10300 serial port 1 at this time" +#endif +#define CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE \ + CYG_DEVICE_SERIAL_RS232_MN10300_1_DEFAULT_BAUD_RATE +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_1_DEFAULT_BAUD_RATE + +#include + +#endif // CYG_DEVICE_INTERNAL + +// ------------------------------------------------------------------------- +// Cyg_Device_Serial_RS232_mn10300_1 + +#define CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 Cyg_Device_Serial_RS232_mn10300_1 + +class CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 + : public Cyg_Device_Serial_RS232 +{ +#ifdef CYG_DEVICE_INTERNAL +#include +#endif + +private: + /* Internal routines */ + cyg_int32 io_read(Cyg_IORB * iorb); + cyg_int32 io_write(Cyg_IORB * iorb); + void io_write_flush(void); + +public: + + /* Constructor */ + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1(); + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_ASSERT + cyg_int32 io_read_assert(Cyg_IORB * iorb); + cyg_int32 io_write_assert(Cyg_IORB * iorb); +#endif + + cyg_int32 io_read_cancel(Cyg_IORB * iorb); + cyg_int32 io_write_cancel(Cyg_IORB * iorb); + cyg_int32 io_read_blocking(Cyg_IORB * iorb); + cyg_int32 io_write_blocking(Cyg_IORB * iorb); + cyg_int32 io_read_asynchronous(Cyg_IORB * iorb); + cyg_int32 io_write_asynchronous(Cyg_IORB * iorb); + + cyg_int32 set_kmode(cyg_uint32); + cyg_int32 get_kmode(void); + + cyg_int32 set_baud_rate(cyg_uint32); + cyg_int32 get_baud_rate(void); + + cyg_int32 set_line_mode(cyg_uint32); + cyg_int32 get_line_mode(void); + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_READ_MODES + cyg_int32 set_read_mode(cyg_uint32); + cyg_int32 set_read_data(cyg_uint32 /* mode */, const char * /* data */, cyg_uint32 /* count */); +#endif +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_WRITE_MODES + cyg_int32 set_write_mode(cyg_uint32); +#endif +}; + +// Declare exported variables +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_DECLARE +extern CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME; +#endif +#endif + +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_1 + +#endif // CYGONCE_DEVS_SERIAL_RS232_MN10300_SERIAL_MN10300_1_HXX +// End of serial_mn10300_1.hxx + diff --git a/packages/devs/serial/rs232/mn10300/current/include/serial_mn10300_2.hxx b/packages/devs/serial/rs232/mn10300/current/include/serial_mn10300_2.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/include/serial_mn10300_2.hxx @@ -0,0 +1,203 @@ +#ifndef CYGONCE_DEVS_SERIAL_RS232_MN10300_SERIAL_MN10300_2_HXX +#define CYGONCE_DEVS_SERIAL_RS232_MN10300_SERIAL_MN10300_2_HXX + +//========================================================================== +// +// serial_mn10300_2.hxx +// +// Header file for the mn10300 serial port #2 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-22 +// Purpose: Define Cyg_Device_Serial_mn10300_2 data structure +// Description: This file contains the C++ class declaration of +// Cyg_Device_Serial_mn10300_2. There can be only one. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // Device configureation file + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2 +// Include Configureation options specific to the device +#include CYG_DEVICE_SERIAL_RS232_MN10300_2 + +#include +#include // assertion macros +#include // tracing macros + +#include // Cyg_ISR, Cyg_DSR +#include // intr.hxx +#include // intr.hxx +#include // vectors +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX +#include +#endif +#include + +// ------------------------------------------------------------------------- +// The mn10300 serial 2 device is unique. + +#ifdef CYG_DEVICE_INTERNAL +// Define the serial registers. +#define CYG_DEVICE_SERIAL_RS232_CR ((volatile cyg_uint16 *)0x34000820) +#define CYG_DEVICE_SERIAL_RS232_ICR ((volatile cyg_uint8 *) 0x34000824) +#define CYG_DEVICE_SERIAL_RS232_TXR ((volatile cyg_uint8 *) 0x34000828) +#define CYG_DEVICE_SERIAL_RS232_RXR ((volatile cyg_uint8 *) 0x34000829) + +#define CYG_DEVICE_SERIAL_RS232_SR_ADDR 0x3400082c +#define CYG_DEVICE_SERIAL_RS232_SR_SIZE cyg_uint8 +#define CYG_DEVICE_SERIAL_RS232_SR \ + ((volatile CYG_DEVICE_SERIAL_RS232_SR_SIZE *) CYG_DEVICE_SERIAL_RS232_SR_ADDR) + +#define CYG_DEVICE_SERIAL_RS232_TR ((volatile cyg_uint8 *) 0x3400082d) + +// Timer 2 provides the baud rate divisor for serial 2 exclusivly +#define TIMER2_MD ((volatile cyg_uint8 *)0x34001002) +#define TIMER2_BR ((volatile cyg_uint8 *)0x34001012) +#define TIMER2_CR ((volatile cyg_uint8 *)0x34001022) + +#define PORT3_MD ((volatile cyg_uint8 *)0x36008025) + + +#define CYG_DEVICE_SERIAL_RS232_TVEC CYG_VECTOR_SERIAL_2_TX +#define CYG_DEVICE_SERIAL_RS232_RVEC CYG_VECTOR_SERIAL_2_RX + +// Here are the values for the timers to set the various baud rates +// Timer 1 is the serial 2 timer register (division ratio 2) +// The values for 9600, 19200 and 38400 match thos used by CygMon. +// (Matsushita suggested values in comment.) +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 0 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B600 126 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B1200 125 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B2400 124 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B4800 124 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B9600 70 // 119 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B19200 70 // 111 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400 22 // 97 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B57600 88 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B115200 64 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B230400 64 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B460800 32 + +// Timer 2 is the 8 bit timer 2 register (division ratio 1) +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B600 196 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B1200 98 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B2400 49 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B4800 24 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B9600 21 // 12 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B19200 10 // 6 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400 16 // 3 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B57600 2 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B115200 1 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B230400 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B460800 0 + +// Now set the default baudrate +#ifndef CYG_DEVICE_SERIAL_RS232_MN10300_2_DEFAULT_BAUD_RATE +#error "Must specify a default baud rate" +#else +#if ((CYG_DEVICE_SERIAL_RS232_MN10300_2_DEFAULT_BAUD_RATE > 0) && \ + (CYG_DEVICE_SERIAL_RS232_MN10300_2_DEFAULT_BAUD_RATE < 600)) +#error "Baud rates less than 600 are not supported for the mn10300 at this time" +#endif +#define CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE \ + CYG_DEVICE_SERIAL_RS232_MN10300_2_DEFAULT_BAUD_RATE +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_2_DEFAULT_BAUD_RATE + +#include + +#endif // CYG_DEVICE_INTERNAL + +// ------------------------------------------------------------------------- +// Cyg_Device_Serial_RS232_mn10300_2 + +#define CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 Cyg_Device_Serial_RS232_mn10300_2 + +class CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 + : public Cyg_Device_Serial_RS232 +{ +#ifdef CYG_DEVICE_INTERNAL +#include +#endif + +protected: + /* Internal routines */ + cyg_int32 io_read(Cyg_IORB * iorb); + cyg_int32 io_write(Cyg_IORB * iorb); + void io_write_flush(void); + +public: + + /* Constructor */ + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2(); + + cyg_int32 io_read_cancel(Cyg_IORB * iorb); + cyg_int32 io_write_cancel(Cyg_IORB * iorb); + + cyg_int32 io_read_assert(Cyg_IORB * iorb); + cyg_int32 io_write_assert(Cyg_IORB * iorb); + cyg_int32 io_read_blocking(Cyg_IORB * iorb); + cyg_int32 io_write_blocking(Cyg_IORB * iorb); + cyg_int32 io_read_asynchronous(Cyg_IORB * iorb); + cyg_int32 io_write_asynchronous(Cyg_IORB * iorb); + + cyg_int32 set_kmode(cyg_uint32); + cyg_int32 get_kmode(void); + + cyg_int32 set_baud_rate(cyg_uint32); + cyg_int32 get_baud_rate(void); + + cyg_int32 set_line_mode(cyg_uint32); + cyg_int32 get_line_mode(void); + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_READ_MODES + cyg_int32 set_read_mode(cyg_uint32); + cyg_int32 set_read_data(cyg_uint32 /* mode */, const char * /* data */, cyg_uint32 /* count */); +#endif +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_WRITE_MODES + cyg_int32 set_write_mode(cyg_uint32); +#endif +}; + +// Declare exported variables +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_DECLARE +extern CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME; +#endif +#endif + +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_2 + +#endif // CYGONCE_DEVS_SERIAL_RS232_MN10300_SERIAL_MN10300_2_HXX +// End of serial_mn10300_2.hxx + diff --git a/packages/devs/serial/rs232/mn10300/current/src/PKGconf.mak b/packages/devs/serial/rs232/mn10300/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/src/PKGconf.mak @@ -0,0 +1,41 @@ +#=============================================================================== +# +# makefile +# +# devs/serial/rs232/mn10300/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_serial_rs232_mn10300 +include ../../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := serial_mn10300_2.cxx serial_mn10300_1.cxx +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/devs/serial/rs232/mn10300/current/src/serial_mn10300_1.cxx b/packages/devs/serial/rs232/mn10300/current/src/serial_mn10300_1.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/src/serial_mn10300_1.cxx @@ -0,0 +1,1148 @@ +//================================================================= +// +// serial_mn10300_1.cxx +// +// Driver for the mn10300 serial port #1 +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-22 +// Description: Class methods for the class Cyg_Device_Serial_mn10300_1 +//####DESCRIPTIONEND#### + +#include // To see if we need to bother +#ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_1 // Do we need to build this file + +#define CYG_DEVICE_INTERNAL +#include +#include // Cyg_Binary_Semaphore + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_DECLARE +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME; +#endif +#endif + +static char eob_chars[] = { 4, 10, 13, 26 }; + +// ------------------------------------------------------------------------ +// Constructor for serial device +// +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1() +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + : read_interrupt(CYG_DEVICE_SERIAL_RS232_RVEC, 4, (CYG_ADDRWORD)this, read_isr, read_dsr), + write_interrupt(CYG_DEVICE_SERIAL_RS232_TVEC, 4, (CYG_ADDRWORD)this, write_isr, write_dsr) +#endif +{ + CYG_REPORT_FUNCTION(); + + // Initialize any data + read_buffer = NULL; + + // read_buffers = NULL; +#ifdef CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + read_buffers_ll_last = NULL; + read_buffers_ll_first = NULL; +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + // Default to ASCII mode if READ_MODES is configured. + read_mode = 0xff; + read_mode_eob_chars = eob_chars; + read_mode_eob_count = sizeof(eob_chars); +// read_mode_translate_char = 0; +// read_mode_escape_next_char = 0; +#endif + + write_buffer = NULL; + // write_buffers = NULL; +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + write_buffers_ll_last = NULL; + write_buffers_ll_first = NULL; +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + // Default to CR to CRLF translation + write_mode = 1; + write_char = 0; +#endif + + // Set the timers before enabling them or the serial device + *TIMER1_BR = CYG_DEVICE_SERIAL_RS232_T1_VALUE; + + // Timer1 sourced from IOCLK + *TIMER1_MD = 0x80; + + // Mode on PORT3, used for serial line controls. + *PORT3_MD = 0x01; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.attach(); + write_interrupt.attach(); + // Clear interrupts for now. + *CYG_DEVICE_SERIAL_RS232_ICR = 0x00; + /* Do not unmask the interrupt unless interrupt is the default mode */ +#endif + + // Set the control register, finallizing the settup. + // Source from timer 1, 8bit chars, enable tx and rx + *CYG_DEVICE_SERIAL_RS232_CR = 0xc084; +} + +// ------------------------------------------------------------------------ +// set_kmode() +// Set the kernel mode to (polled, interrrupt, ...) +// Only applicable if we have multiple modes. + +#if defined (CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) && \ + defined (CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: + set_kmode(cyg_uint32 new_mode) +{ + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + + /* Switching from polled mode to interrupt mode is easy */ + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) { + if (new_mode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + + kmode = CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT; + + /* Turn on interrupts by unmasking the appropriate vector */ + read_interrupt.unmask_interrupt(read_interrupt.get_vector()); + write_interrupt.unmask_interrupt(write_interrupt.get_vector()); + } + } + /* Switching to polled mode should flush the buffers */ + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + + return 0; +} + +#else + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: + set_kmode(cyg_uint32 new_mode) +{ +#if defined(CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) + CYG_ASSERT (CYG_DEVICE_SERIAL_RS232_KMODE_POLLED == new_mode, + "Can only select polled mode" ); +#endif +#if defined(CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) + CYG_ASSERT (CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT == new_mode, + "Can only select interrupt mode" ); +#endif + + return 0; +} + +#endif + +// ------------------------------------------------------------------------ +// Baud rate + +static struct baud_rate { + cyg_uint8 tm_br; +} baud_rate_table[] = { + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B0 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B50 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B75 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B110 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B134.5 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B150 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B300 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B600 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B1200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B1800 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B2400 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 }, // B4800 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B9600 }, // B9600 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B19200 }, // B19200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400 }, // B38400 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B57600 }, // B57600 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B115200 }, // B115200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B230400 }, // B230400 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B460800 } // B460800 +}; + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: +get_baud_rate() +{ + cyg_ucount8 i; + cyg_uint8 tm_br; + + tm_br = *TIMER1_BR; + + for (i = 0; i < (sizeof(baud_rate_table) / sizeof(struct baud_rate)); i++) { + if (tm_br == baud_rate_table[i].tm_br) { + return(i); + } + } + + return(-1); +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: +set_baud_rate(cyg_uint32 baud_rate) +{ + cyg_int32 old_baud_rate; + cyg_uint16 sc_icr; + + if (baud_rate > (sizeof(baud_rate_table) / sizeof(struct baud_rate))) { + return -1; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + + /* + * Flush the write queue. + * Not necessary for the read queue + */ + this->io_write_flush(); + + /* Get the old baud rate */ + if ((old_baud_rate = this->get_baud_rate()) < 0) + old_baud_rate = 0; + + /* Turn off read and write */ + sc_icr = *CYG_DEVICE_SERIAL_RS232_CR; + *CYG_DEVICE_SERIAL_RS232_CR = sc_icr & 0x3fff; + + /* Turn off timer 1 */ + *TIMER1_MD = 0x00; + + *TIMER1_BR = baud_rate_table[baud_rate].tm_br; + + /* Reenable timer and serial port for valid baud rates greater than 0 */ + if (baud_rate_table[baud_rate].tm_br) { + *TIMER1_MD = 0x80; + *CYG_DEVICE_SERIAL_RS232_CR = sc_icr | 0xc000; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + + return(old_baud_rate); + +} + +// ------------------------------------------------------------------------ +// Line mode +// +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: +get_line_mode() +{ + cyg_uint16 sc_icr; + cyg_int32 ret; + + sc_icr = *CYG_DEVICE_SERIAL_RS232_CR; + + /* bits per byte */ + if (sc_icr & 0x0080) { + ret = CS8; + } else { + ret = CS7; + } + /* Stop bits */ + if (sc_icr & 0x0008) { + ret |= CSTOPB; + } + /* Parity */ + switch (sc_icr & 0x0070) { + case 0x0000: /* No parity */ + break; + case 0x0070: /* Odd parity */ + ret |= PARODD; + /* Fall through */ + case 0x0060: /* Even parity */ + ret |= PARENB; + break; + default: + ret = -1; + break; + } + + return ret; +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: +set_line_mode(cyg_uint32 line_mode) +{ + cyg_int32 old_line_mode; + cyg_uint16 sc_icr; + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + /* + * Flush the write queue. + * Not necessary for the read queue + */ + this->io_write_flush(); + + sc_icr = *CYG_DEVICE_SERIAL_RS232_CR; + + old_line_mode = this->get_line_mode(); + + switch(line_mode & CSIZE) { + case CS7: + sc_icr &= ~0x0080; + break; + case CS8: + sc_icr |= 0x0080; + break; + default: + return -1; + break; + } + if (line_mode & CSTOPB) { + sc_icr |= 0x0008; + } else { + sc_icr &= ~0x0008; + } + if (line_mode & PARENB) { + if (!(line_mode & PARODD)) { + sc_icr &= ~0x0010; + sc_icr |= 0x0060; + } else { + sc_icr |= 0x0070; + } + } else { + sc_icr &= ~0x0070; + } + + /* Set the new flags all in one write. */ + *CYG_DEVICE_SERIAL_RS232_CR = sc_icr; + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + + return old_line_mode; + +} + +// ------------------------------------------------------------------------ +// set_read_mode() +// Set the read mode (CRNL translation, EOL detection, escape characters) +// Currently there are only two modes (BINARY and ASCII) + +#ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: +set_read_mode(cyg_uint32 new_mode) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + if (new_mode) { + read_mode = 0xff; + } else { + read_mode = 0; + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: +set_read_data(cyg_uint32 mode, const char * data, cyg_uint32 count) +{ + cyg_int32 ret = 0; + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + +// SHould turn off interrupts + switch(mode) { + case CYG_DEVICE_SERIAL_RS232_READ_MODE_EOB: + if (data == NULL) { + read_mode_eob_count = sizeof(eob_chars); + read_mode_eob_chars = eob_chars; + } else { + read_mode_eob_count = count; + read_mode_eob_chars = data; + } + break; + default: + ret = -1; + break; + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +#endif + +static inline void +throttle(char ch) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL + cyg_uint8 tmp; + + tmp = (data->read_throttle_free + 1) % data->read_throttle_size; + /* Check that there is space to put the character */ + if (tmp != data->read_throttle_queued) { + data->read_throttle_buffer[tmp] = ch; + data->read_throttle_free = tmp; + } + data->read_throttle = 1; +#endif +} + +// ------------------------------------------------------------------------ +// read_isr() +// +cyg_uint32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: + read_isr(cyg_vector vector, CYG_ADDRWORD isr_data) +{ + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 *)isr_data; + volatile cyg_uint8 * tty_rx, ch; + cyg_uint32 off, ret; + cyg_uint8 eob = 0; + + // Default return value + ret = Cyg_Interrupt::HANDLED; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + // Clear interrupts regaurdless of kmode + data->read_interrupt.acknowledge_interrupt(vector); +#endif + + tty_rx = CYG_DEVICE_SERIAL_RS232_RXR; + ch = *tty_rx; + +#ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + while (data->read_mode) { + cyg_ucount8 i; + + // On escape characters, skip mode checks; break + // Deal with flow control characters; return + + /* Deal with ignored characters first */ + if (data->read_mode & CYG_DEVICE_SERIAL_RS232_READ_MODE_IGN) { + if (ch == 10) + return ret; + } + /* Translate characters before checking on EOB conditions. */ + if (data->read_mode & CYG_DEVICE_SERIAL_RS232_READ_MODE_TRN) { + if (ch == 13) + ch = 10; + } + /* Return a not full IORB on an EOB condition. */ + if (data->read_mode & CYG_DEVICE_SERIAL_RS232_READ_MODE_EOB) { + for (i = 0; i < data->read_mode_eob_count; i++) { + if (ch == data->read_mode_eob_chars[i]) { + eob = 1; + break; + } + } + } + break; + } +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL + if (read_throttle == 0) { +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (data->read_buffer == NULL) { + while ((data->read_buffer = data->read_buffers.get_next_inuse(data->read_buffer))) { + if (data->read_buffer->xferred_length < data->read_buffer->buffer_length) { + ret = Cyg_Interrupt::CALL_DSR; + break; + } + } + if (data->read_buffer == NULL) { + ret = Cyg_Interrupt::CALL_DSR; + throttle(ch); + return ret; + } + } +#endif + + off = data->read_buffer->xferred_length++; + *((char *)data->read_buffer->buffer + off) = ch; + + // This is still ugly --proven 19980526 + if ((data->read_buffer->xferred_length == data->read_buffer->buffer_length) || eob) { +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + data->read_buffer = data->read_buffers.get_next_inuse(data->read_buffer); +#else + data->read_buffer = NULL; +#endif + ret = Cyg_Interrupt::CALL_DSR; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + while ((data->read_buffer != NULL) && + (data->read_buffer->xferred_length == data->read_buffer->buffer_length)) { + data->read_buffer = data->read_buffers.get_next_inuse(data->read_buffer); + ret = Cyg_Interrupt::CALL_DSR; // Probably not necessary + } +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL + } else { + throttle(ch); + } +#endif + + return ret; + +} + +void +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: + read_dsr(cyg_vector vector, cyg_ucount32 dsr_count, CYG_ADDRWORD dsr_data) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 *)dsr_data; + cyg_ucount32 count, i; + Cyg_IORB * iorb; + + /* + * Note: Interrupts are not disabled but if the isr causes another + * buffer to become done since the start of this call then + * dsr_read() will be called again to handle that buffer. + */ + + for (i = 0, count = data->read_buffers.min_done(); i < count; i++) { + iorb = data->read_buffers.dequeue(); + if (iorb->callback) + iorb->callback(iorb); + } + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + // Enqueue as many iorbs as we dequeued + for (i = 0; i < count; i++) { + if ((iorb = data->read_buffers_ll_first)) { + data->read_buffers_ll_first = iorb->next; + data->read_buffers.enqueue (iorb); + iorb->next = NULL; + } else { + break; + } + } +#endif +#endif +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::io_read(Cyg_IORB * iorb) +{ + volatile cyg_uint16 * tty_status = CYG_DEVICE_SERIAL_RS232_SR; + const cyg_vector vector = CYG_DEVICE_SERIAL_RS232_RVEC; + + iorb->next = NULL; + iorb->xferred_length = 0; + iorb->status = CYG_IORB_OK; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT +#ifdef CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + /* + * If more iorbs are be queued than the queuet can handle then + * a separate link list needs to hold the extra. Since the DSR + * does the dequeueing from the link list we have to enqueue + * with the scheduler disabled. + * + * Note: To prevent lots of scheduler locks and unlocks we check + * the queue while the scheduler is unlocked, and only if it is + * full do we lock the scheduler and verify that the queue is + * still full. It is possible that between the check and the lock + * that the DSR could run and make some space in the queue. + * + * Note: We cannot have any iorbs on the ll if the queue is not full. + * + * Note: We cannot have a full queue and also be in polled mode. + * This is why we return after placing the iorb on the ll if the + * queue is full, as there is nothing else to do. + */ + if (read_buffers.min_free() == 0) { + + Cyg_Scheduler::lock(); + + // Check again with the scheduler locked + if (read_buffers.min_free() == 0) { + if (read_buffers_ll_first) { + read_buffers_ll_last->next = iorb; + } else { + read_buffers_ll_first = iorb; + } + read_buffers_ll_last = iorb; + Cyg_Scheduler::unlock(); + return 0; + } + Cyg_Scheduler::unlock(); + } + +#endif + + read_buffers.enqueue(iorb); + + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + /* We may have to enable CTR here to tell the other side to start + * sending characters --proven 19980513 */ + return 0; + } +#else + read_buffer = iorb; +#endif + +#ifndef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + /* + * Special nonblocking mode for polled only drivers. + * This is so BSPs and other non kernel things can poll for each char. + * individually. Use only if read modes don't otherwise solve the problem. + */ + if (CYG_IORB_NOBLOCK == iorb->opcode) { + if ((*tty_status & 0x0010) != 0) { + read_isr(vector, (CYG_ADDRWORD)this); + } + return 0; + } +#endif + + do { + do { + while ((*tty_status & 0x0010) == 0) continue; + } while (read_isr(vector, (CYG_ADDRWORD)this) == Cyg_Interrupt::HANDLED); + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_dsr(vector, 0, (CYG_ADDRWORD)this); +#else + + // Make a callback, even in poll-mode. + + // This should really be done in read_dsr, but this requires + // the iorb to be passed along as an argument (or in + // read_buffer) which a) isn't pretty, b) would require other + // callers of read_dsr to know that fact. The read_dsr would + // extract the iorb and do the below. This fix seemed cleaner + // given that it is a short term solution anyway. -jskov + + if (iorb->callback) + iorb->callback(iorb); + +#endif + } while (read_buffer); + return 0; +} + +// ------------------------------------------------------------------------ +// set_write_mode() +// Set the write mode (CRNL translation) +// Currently there are only two modes (BINARY and ASCII) + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: +set_write_mode(cyg_uint32 new_mode) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + write_mode = new_mode; +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +#endif + +// ------------------------------------------------------------------------ +// write_isr() +// We set the mn10300 to interrupt as soon as the transmission buffer is +// empty. this is before the transmission is completed though. For proper +// flush semantics the driver should switch to getting an interrupt for +// transmission completed then check if it has completed and if not +// return HANDLED. The next interrupt should then switch back. +// --proven 19980523 +// + +cyg_uint32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: + write_isr(cyg_vector vector, CYG_ADDRWORD isr_data) +{ + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 *)isr_data; + volatile cyg_uint8 * tty_tx, ch; + cyg_uint32 off, ret; + + // Default return value + ret = Cyg_Interrupt::HANDLED; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + // Clear interrupts regaurdless of kmode + data->write_interrupt.acknowledge_interrupt(vector); + + while ((data->write_buffer == NULL) || + (data->write_buffer->xferred_length == data->write_buffer->buffer_length)) { + data->write_buffer = data->write_buffers.get_next_inuse(data->write_buffer); + ret = Cyg_Interrupt::CALL_DSR; + if (!data->write_buffer) { + return ret; + } + } +#else + if (data->write_buffer->xferred_length == data->write_buffer->buffer_length) { + ret = Cyg_Interrupt::CALL_DSR; + data->write_buffer = NULL; + return ret; + } +#endif + + off = data->write_buffer->xferred_length++; + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + if (data->write_mode) { + // This is for cr to cr/lf conversion + if ((ch = data->write_char)) { + data->write_char = '\0'; + } else { + if ((*((char *)data->write_buffer->buffer + off)) != '\n') { + ch = *((char *)data->write_buffer->buffer + off); + } else { + // Decrement so next pass will DTRT + data->write_buffer->xferred_length--; + data->write_char = '\n'; + ch = '\r'; + } + } + } else +#endif + ch = *((char *)data->write_buffer->buffer + off); + + tty_tx = CYG_DEVICE_SERIAL_RS232_TXR; + *tty_tx = ch; + // Do not modify any data structure after the data is written because + // it is possible an interrupt will call this routine before this + // invocation of this routine executes any code beyond this point. + return ret; +} + +void +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1:: + write_dsr(cyg_vector vector, cyg_ucount32 dsr_count, CYG_ADDRWORD dsr_data) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1 *)dsr_data; + cyg_ucount32 count, i; + Cyg_IORB * iorb; + /* + * Note: Interrupts are not disabled but if the isr causes another + * buffer to become done since the start of this call then + * dsr_write() will be called again to handle that buffer. + */ + + for (i = 0, count = data->write_buffers.min_done(); i < count; i++) { + iorb = data->write_buffers.dequeue(); + if (iorb->callback) + iorb->callback(iorb); + } + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + // Enqueue as many iorbs as we dequeued + for (i = 0; i < count; i++) { + if ((iorb = data->write_buffers_ll_first)) { + data->write_buffers_ll_first = iorb->next; + data->write_buffers.enqueue (iorb); + iorb->next = NULL; + } else { + break; + } + } +#endif +#endif +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::io_write(Cyg_IORB * iorb) +{ + volatile CYG_DEVICE_SERIAL_RS232_SR_SIZE * tty_status = CYG_DEVICE_SERIAL_RS232_SR; + const cyg_vector vector = CYG_DEVICE_SERIAL_RS232_TVEC; + + iorb->next = NULL; + iorb->xferred_length = 0; + iorb->status = CYG_IORB_OK; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + /* + * If more iorbs are be queued than the queuet can handle then + * a separate link list needs to hold the extra. Since the DSR + * does the dequeueing from the link list we have to enqueue + * with the scheduler disabled. + * + * Note: To prevent lots of scheduler locks and unlocks we check + * the queue while the scheduler is unlocked, and only if it is + * full do we lock the scheduler and verify that the queue is + * still full. It is possible that between the check and the lock + * that the DSR could run and make some space in the queue. + * + * Note: We cannot have any iorbs on the ll if the queue is not full. + * + * Note: We cannot have a full queue and also be in polled mode. + * This is why we return after placing the iorb on the ll if the + * queue is full, as there is nothing else to do. + */ + if (write_buffers.min_free() == 0) { + + Cyg_Scheduler::lock(); + + // Check again with the scheduler locked + if (write_buffers.min_free() == 0) { + if (write_buffers_ll_first) { + write_buffers_ll_last->next = iorb; + } else { + write_buffers_ll_first = iorb; + } + write_buffers_ll_last = iorb; + Cyg_Scheduler::unlock(); + return 0; + } + Cyg_Scheduler::unlock(); + } + +#endif + + write_buffers.enqueue (iorb); + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + if (write_buffer == NULL) { +// Must check that iorb isn't already done --proven 19980516 + if (iorb->buffer_length == 0) { + write_isr (vector, (CYG_ADDRWORD)this); + write_dsr (vector, 0, (CYG_ADDRWORD)this); + } else { + /* Prime serial write interrupts with first byte */ + while ((*tty_status & 0x0020) != 0) continue; + write_isr (vector, (CYG_ADDRWORD)this); + } + } + return 0; + } +#else + write_buffer = iorb; +#endif + + do { + do { + while ((*tty_status & 0x0020) != 0) continue; + } while (write_isr(vector, (CYG_ADDRWORD)this) == Cyg_Interrupt::HANDLED); + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + write_dsr (vector, 0, (CYG_ADDRWORD)this); +#else + + // Make a callback, even in poll-mode. + + // This should really be done in write_dsr, but this requires + // the iorb to be passed along as an argument (or in + // read_buffer) which a) isn't pretty, b) would require other + // callers of write_dsr to know that fact. The write_dsr would + // extract the iorb and do the below. This fix seemed cleaner + // given that it is a short term solution anyway. -jskov + + if (iorb->callback) + iorb->callback(iorb); + +#endif + + } while (write_buffer); + return 0; +} + +// ------------------------------------------------------------------------ +// Asynchronous versions are only configured with the +// interrupt version is configured +// +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::io_read_asynchronous(Cyg_IORB * iorb) +{ + // Do we want to configure an error condition for this? --proven 19980506 + CYG_ASSERT (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT, + "Cannot do an io_read_asynchronous while in polled mode" ); + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + this->io_read (iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; + +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::io_write_asynchronous(Cyg_IORB * iorb) +{ + // Do we want to configure an error condition for this? --proven 19980506 + CYG_ASSERT (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT, + "Cannot do an io_write_asynchronous while in polled mode" ); + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + this->io_write (iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} +#endif + +// ------------------------------------------------------------------------ +// Blocking versions just call the internal version with a callback. +// + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT +static void +callback(Cyg_IORB *iorb) +{ + Cyg_Binary_Semaphore * data = (Cyg_Binary_Semaphore *)iorb->callback_data; + data->post(); +} +#endif + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::io_read_blocking(Cyg_IORB * iorb) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + Cyg_Binary_Semaphore read(0); + + // We need a callback routine to wake us up + iorb->callback_data = (CYG_ADDRESS)&read; + iorb->callback = callback; + this->io_read(iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + read.wait(); + return 0; + } else +#endif + { + iorb->callback = NULL; + this->io_read(iorb); + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::io_write_blocking(Cyg_IORB * iorb) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + Cyg_Binary_Semaphore write(0); + + // We need a callback routine to wake us up + iorb->callback_data = (CYG_ADDRESS)&write; + iorb->callback = callback; + this->io_write(iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + write.wait(); + return 0; + } else +#endif + { + iorb->callback = NULL; + this->io_write(iorb); + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +// Internal routine needed to flush writes in a blocking manner. +void +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::io_write_flush(void) +{ + Cyg_IORB iorb; + + iorb.buffer_length = 0; +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + Cyg_Binary_Semaphore write(0); + + // We need a callback routine to wake us up + iorb.callback_data = (CYG_ADDRESS)&write; + iorb.callback = callback; + this->io_write(&iorb); + write.wait(); + } else +#endif + { + iorb.callback = NULL; + this->io_write(&iorb); + } +} + +// ------------------------------------------------------------------------ +// Cancel routines to stop an existing IO operation +// + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::io_read_cancel(Cyg_IORB * iorb) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + Cyg_Scheduler::lock(); +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.disable_interrupts(); +#endif + + // For now only allow the current iorb to be cancelable + // --proven 19980714 + + if (read_buffer == NULL) { +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if ((read_buffer = read_buffers.get_next_inuse(read_buffer)) == NULL) +#endif + { +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.enable_interrupts(); +#endif + Cyg_Scheduler::unlock(); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; + } + } + if (((iorb == NULL) && read_buffer) || + (iorb && (read_buffer == iorb))) { + read_buffer->status = CYG_IORB_CANCELED; +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_buffer = read_buffers.get_next_inuse(read_buffer); +#endif + // Need to clear out any flush iorbs -- proven 19980714 + } else { +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.enable_interrupts(); +#endif + Cyg_Scheduler::unlock(); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.enable_interrupts(); +#endif + read_dsr(CYG_DEVICE_SERIAL_RS232_RVEC, 0, (CYG_ADDRWORD)this); + Cyg_Scheduler::unlock(); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +// ------------------------------------------------------------------------ +// Assert versions. These versions bypass most of the driver code. +// These are to be used by the BSP or asserts. Only use them once +// start_sync() is called and when done normal operations is +// restarted with the end_sync() mode. +// +// Note DO NOT DO LOCKING IN THIS ROUTINE!!! +// + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_ASSERT +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_1::io_write_assert(Cyg_IORB * iorb) +{ + volatile cyg_uint16 * tty_status = CYG_DEVICE_SERIAL_RS232_SR; + volatile cyg_uint8 * tty_tx = CYG_DEVICE_SERIAL_RS232_TXR; + cyg_uint8 ch; + + iorb->xferred_length = 0; + while (iorb->xferred_length < iorb->buffer_length) { + if ((ch = (*((char*)iorb->buffer + iorb->xferred_length++))) == '\n') { + while ((*tty_status & 0x0020) != 0) continue; + *tty_tx = '\r'; + } + while ((*tty_status & 0x0020) != 0) continue; + *tty_tx = ch; + } + return 0; +} + +#endif // #ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_KMODE_ASSERT + +#endif // #ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_1 +// EOF serial_mn10300_1.cxx diff --git a/packages/devs/serial/rs232/mn10300/current/src/serial_mn10300_2.cxx b/packages/devs/serial/rs232/mn10300/current/src/serial_mn10300_2.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/src/serial_mn10300_2.cxx @@ -0,0 +1,1166 @@ +//================================================================= +// +// serial_mn10300_2.cxx +// +// Driver for the mn10300 serial port #2 +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-22 +// Description: Class methods for the class Cyg_Device_Serial_mn10300 +//####DESCRIPTIONEND#### + +#include // To see if we need to bother +#ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_2 // Do we need to build this file + +#define CYG_DEVICE_INTERNAL +#include +#include // Cyg_Binary_Semaphore + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_DECLARE +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME; +#endif +#endif + +static char eob_chars[] = { 4, 10, 13, 26 }; + +// ------------------------------------------------------------------------ +// Constructor for serial device +// +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2() +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + : read_interrupt(CYG_DEVICE_SERIAL_RS232_RVEC, 4, (CYG_ADDRWORD)this, read_isr, read_dsr), + write_interrupt(CYG_DEVICE_SERIAL_RS232_TVEC, 4, (CYG_ADDRWORD)this, write_isr, write_dsr) +#endif +{ + CYG_REPORT_FUNCTION(); + + // Initialize any data + read_buffer = NULL; + + // read_buffers = NULL; +#ifdef CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + read_buffers_ll_last = NULL; + read_buffers_ll_first = NULL; +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + // Default to ASCII mode if READ_MODES is configured. + read_mode = 0xff; + read_mode_eob_chars = eob_chars; + read_mode_eob_count = sizeof(eob_chars); +// read_mode_translate_char = 0; +// read_mode_escape_next_char = 0; +#endif + + write_buffer = NULL; + // write_buffers = NULL; +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + write_buffers_ll_last = NULL; + write_buffers_ll_first = NULL; +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + // Default to CR to CRLF translation + write_mode = 1; + write_char = 0; +#endif + + // Set the timers before enabling them or the serial device + *CYG_DEVICE_SERIAL_RS232_TR = CYG_DEVICE_SERIAL_RS232_T1_VALUE; + *TIMER2_BR = CYG_DEVICE_SERIAL_RS232_T2_VALUE; + + // Timer2 sourced from IOCLK + *TIMER2_MD = 0x80; + + // Mode on PORT3, used for serial line controls. + *PORT3_MD = 0x01; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.attach(); + write_interrupt.attach(); + // Clear interrupts for now. + *CYG_DEVICE_SERIAL_RS232_ICR = 0x00; + + /* Turn on interrupts by unmasking the vector */ + kmode = CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT; + read_interrupt.unmask_interrupt(read_interrupt.get_vector()); + write_interrupt.unmask_interrupt(write_interrupt.get_vector()); +#endif + + // Set the control register, finallizing the settup. + // Source from timer 2, 8bit chars, enable tx and rx + *CYG_DEVICE_SERIAL_RS232_CR = 0xc081; +} + +// ------------------------------------------------------------------------ +// set_kmode() +// Set the kernel mode to (polled, interrrupt, ...) +// Only applicable if we have multiple modes. + +#if defined (CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) && \ + defined (CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: + set_kmode(cyg_uint32 new_mode) +{ + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + + /* Switching from polled mode to interrupt mode is easy */ + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) { + if (new_mode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + + /* Turn on interrupts by unmasking the vector */ + kmode = CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT; + read_interrupt.unmask_interrupt(read_interrupt.get_vector()); + write_interrupt.unmask_interrupt(write_interrupt.get_vector()); + } + } + /* Switching to polled mode should flush the buffers */ + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + if (new_mode == CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) { + + this->io_write_flush(); + + /* Turn off interrupts by masking the vector */ + kmode = CYG_DEVICE_SERIAL_RS232_KMODE_POLLED; + read_interrupt.mask_interrupt(read_interrupt.get_vector()); + write_interrupt.mask_interrupt(write_interrupt.get_vector()); + } + } + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + + return 0; +} + +#else + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: + set_kmode(cyg_uint32 new_mode) +{ +#if defined(CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) + CYG_ASSERT (CYG_DEVICE_SERIAL_RS232_KMODE_POLLED == new_mode, + "Can only select polled mode" ); +#endif +#if defined(CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) + CYG_ASSERT (CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT == new_mode, + "Can only select interrupt mode" ); +#endif + + return 0; +} + +#endif + +// ------------------------------------------------------------------------ +// Baud rate + +static struct baud_rate { + cyg_uint8 sc_txb; + cyg_uint8 tm_br; +} baud_rate_table[] = { + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B0 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B50 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B75 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B110 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B134.5 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B150 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B300 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B600, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B600 }, // B600 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B1200, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B1200 }, // B1200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B1800 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B2400, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B2400 }, // B2400 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B4800, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B4800 }, // B4800 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B9600, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B9600 }, // B9600 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B19200, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B19200 }, // B19200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400 }, // B38400 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B57600, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B57600 }, // B57600 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B115200,CYG_DEVICE_SERIAL_RS232_T2_VALUE_B115200}, // B115200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B230400,CYG_DEVICE_SERIAL_RS232_T2_VALUE_B230400}, // B230400 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B460800,CYG_DEVICE_SERIAL_RS232_T2_VALUE_B460800} // B460800 + +}; + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: +get_baud_rate() +{ + cyg_ucount8 i; + cyg_uint8 tr, tm_br; + + tm_br = *TIMER2_BR; + tr = *CYG_DEVICE_SERIAL_RS232_TR; + + for (i = 0; i < (sizeof(baud_rate_table) / sizeof(struct baud_rate)); i++) { + if ((tr == baud_rate_table[i].sc_txb) && + (tm_br == baud_rate_table[i].tm_br)) { + return(i); + } + } + + return(-1); +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: +set_baud_rate(cyg_uint32 baud_rate) +{ + cyg_int32 old_baud_rate; + cyg_uint16 sc_icr; + + if (baud_rate > (sizeof(baud_rate_table) / sizeof(struct baud_rate))) { + return -1; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + + /* + * Flush the write queue. + * Not necessary for the read queue + */ + this->io_write_flush(); + + /* Get the old baud rate */ + if ((old_baud_rate = this->get_baud_rate()) < 0) + old_baud_rate = 0; + + /* Turn off read and write */ + sc_icr = *CYG_DEVICE_SERIAL_RS232_CR; + *CYG_DEVICE_SERIAL_RS232_CR = sc_icr & 0x3fff; + + /* Turn off timer 2 */ + *TIMER2_MD = 0x00; + + *CYG_DEVICE_SERIAL_RS232_TR = baud_rate_table[baud_rate].sc_txb; + *TIMER2_BR = baud_rate_table[baud_rate].tm_br; + + /* Reenable timer and serial port for valid baud rates greater than 0 */ + if (baud_rate_table[baud_rate].sc_txb && baud_rate_table[baud_rate].tm_br) { + *TIMER2_MD = 0x80; + *CYG_DEVICE_SERIAL_RS232_CR = sc_icr | 0xc000; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + + return(old_baud_rate); + +} + +// ------------------------------------------------------------------------ +// Line mode + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: +get_line_mode() +{ + cyg_uint16 sc_icr; + cyg_int32 ret; + + sc_icr = *CYG_DEVICE_SERIAL_RS232_CR; + + /* bits per byte */ + if (sc_icr & 0x0080) { + ret = CS8; + } else { + ret = CS7; + } + /* Stop bits */ + if (sc_icr & 0x0008) { + ret |= CSTOPB; + } + /* Parity */ + switch (sc_icr & 0x0070) { + case 0x0000: /* No parity */ + break; + case 0x0070: /* Odd parity */ + ret |= PARODD; + /* Fall through */ + case 0x0060: /* Even parity */ + ret |= PARENB; + break; + default: + ret = -1; + break; + } + + return ret; +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: +set_line_mode(cyg_uint32 line_mode) +{ + cyg_int32 old_line_mode; + cyg_uint16 sc_icr; + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + /* + * Flush the write queue. + * Not necessary for the read queue + */ + this->io_write_flush(); + + sc_icr = *CYG_DEVICE_SERIAL_RS232_CR; + + old_line_mode = this->get_line_mode(); + + switch(line_mode & CSIZE) { + case CS7: + sc_icr &= ~0x0080; + break; + case CS8: + sc_icr |= 0x0080; + break; + default: + return -1; + break; + } + if (line_mode & CSTOPB) { + sc_icr |= 0x0008; + } else { + sc_icr &= ~0x0008; + } + if (line_mode & PARENB) { + if (!(line_mode & PARODD)) { + sc_icr &= ~0x0010; + sc_icr |= 0x0060; + } else { + sc_icr |= 0x0070; + } + } else { + sc_icr &= ~0x0070; + } + + /* Set the new flags all in one write. */ + *CYG_DEVICE_SERIAL_RS232_CR = sc_icr; + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + + return old_line_mode; + +} + +// ------------------------------------------------------------------------ +// set_read_mode() +// Set the read mode (CRNL translation, EOL detection, escape characters) +// Currently there are only two modes (BINARY and ASCII) + +#ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: +set_read_mode(cyg_uint32 new_mode) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + if (new_mode) { + read_mode = 0xff; + } else { + read_mode = 0; + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: +set_read_data(cyg_uint32 mode, const char * data, cyg_uint32 count) +{ + cyg_int32 ret = 0; + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + +// SHould turn off interrupts + switch(mode) { + case CYG_DEVICE_SERIAL_RS232_READ_MODE_EOB: + if (data == NULL) { + read_mode_eob_count = sizeof(eob_chars); + read_mode_eob_chars = eob_chars; + } else { + read_mode_eob_count = count; + read_mode_eob_chars = data; + } + break; + default: + ret = -1; + break; + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +#endif + +static inline void +throttle(char ch) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL + cyg_uint8 tmp; + + tmp = (data->read_throttle_free + 1) % data->read_throttle_size; + /* Check that there is space to put the character */ + if (tmp != data->read_throttle_queued) { + data->read_throttle_buffer[tmp] = ch; + data->read_throttle_free = tmp; + } + data->read_throttle = 1; +#endif +} + +// ------------------------------------------------------------------------ +// read_isr() +// +cyg_uint32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: + read_isr(cyg_vector vector, CYG_ADDRWORD isr_data) +{ + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 *)isr_data; + volatile cyg_uint8 * tty_rx, ch; + cyg_uint32 off, ret; + cyg_uint8 eob = 0; + + // Default return value + ret = Cyg_Interrupt::HANDLED; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + // Clear interrupts regardless of kmode + data->read_interrupt.acknowledge_interrupt(vector); +#endif + + tty_rx = CYG_DEVICE_SERIAL_RS232_RXR; + ch = *tty_rx; + +#ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + while (data->read_mode) { + cyg_ucount8 i; + + // On escape characters, skip mode checks; break + // Deal with flow control characters; return + + /* Deal with ignored characters first */ + if (data->read_mode & CYG_DEVICE_SERIAL_RS232_READ_MODE_IGN) { + if (ch == 10) + return ret; + } + /* Translate characters before checking on EOB conditions. */ + if (data->read_mode & CYG_DEVICE_SERIAL_RS232_READ_MODE_TRN) { + if (ch == 13) + ch = 10; + } + /* Return a not full IORB on an EOB condition. */ + if (data->read_mode & CYG_DEVICE_SERIAL_RS232_READ_MODE_EOB) { + for (i = 0; i < data->read_mode_eob_count; i++) { + if (ch == data->read_mode_eob_chars[i]) { + eob = 1; + break; + } + } + } + break; + } +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL + if (read_throttle == 0) { +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (data->read_buffer == NULL) { + while ((data->read_buffer = data->read_buffers.get_next_inuse(data->read_buffer))) { + if (data->read_buffer->xferred_length < data->read_buffer->buffer_length) { + ret = Cyg_Interrupt::CALL_DSR; + break; + } + } + if (data->read_buffer == NULL) { + ret = Cyg_Interrupt::CALL_DSR; + throttle(ch); + return ret; + } + } +#endif + + off = data->read_buffer->xferred_length++; + *((char *)data->read_buffer->buffer + off) = ch; + + // This is still ugly --proven 19980526 + if ((data->read_buffer->xferred_length == data->read_buffer->buffer_length) || eob) { +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + data->read_buffer = data->read_buffers.get_next_inuse(data->read_buffer); +#else + data->read_buffer = NULL; +#endif + ret = Cyg_Interrupt::CALL_DSR; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + while ((data->read_buffer != NULL) && + (data->read_buffer->xferred_length == data->read_buffer->buffer_length)) { + data->read_buffer = data->read_buffers.get_next_inuse(data->read_buffer); + ret = Cyg_Interrupt::CALL_DSR; // Probably not necessary + } +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL + } else { + throttle(ch); + } +#endif + + return ret; + +} + +void +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: + read_dsr(cyg_vector vector, cyg_ucount32 dsr_count, CYG_ADDRWORD dsr_data) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 *)dsr_data; + cyg_ucount32 count, i; + Cyg_IORB * iorb; + + /* + * Note: Interrupts are not disabled but if the isr causes another + * buffer to become done since the start of this call then + * dsr_read() will be called again to handle that buffer. + */ + + for (i = 0, count = data->read_buffers.min_done(); i < count; i++) { + iorb = data->read_buffers.dequeue(); + if (iorb->callback) + iorb->callback(iorb); + } + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + // Enqueue as many iorbs as we dequeued + for (i = 0; i < count; i++) { + if ((iorb = data->read_buffers_ll_first)) { + data->read_buffers_ll_first = iorb->next; + data->read_buffers.enqueue (iorb); + iorb->next = NULL; + } else { + break; + } + } +#endif +#endif +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::io_read(Cyg_IORB * iorb) +{ + volatile cyg_uint8 * tty_status = CYG_DEVICE_SERIAL_RS232_SR; + const cyg_vector vector = CYG_DEVICE_SERIAL_RS232_RVEC; + + iorb->next = NULL; + iorb->xferred_length = 0; + iorb->status = CYG_IORB_OK; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT +#ifdef CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + /* + * If more iorbs are be queued than the queuet can handle then + * a separate link list needs to hold the extra. Since the DSR + * does the dequeueing from the link list we have to enqueue + * with the scheduler disabled. + * + * Note: To prevent lots of scheduler locks and unlocks we check + * the queue while the scheduler is unlocked, and only if it is + * full do we lock the scheduler and verify that the queue is + * still full. It is possible that between the check and the lock + * that the DSR could run and make some space in the queue. + * + * Note: We cannot have any iorbs on the ll if the queue is not full. + * + * Note: We cannot have a full queue and also be in polled mode. + * This is why we return after placing the iorb on the ll if the + * queue is full, as there is nothing else to do. + */ + if (read_buffers.min_free() == 0) { + + Cyg_Scheduler::lock(); + + // Check again with the scheduler locked + if (read_buffers.min_free() == 0) { + if (read_buffers_ll_first) { + read_buffers_ll_last->next = iorb; + } else { + read_buffers_ll_first = iorb; + } + read_buffers_ll_last = iorb; + Cyg_Scheduler::unlock(); + return 0; + } + Cyg_Scheduler::unlock(); + } + +#endif + + read_buffers.enqueue(iorb); + + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + /* We may have to enable CTR here to tell the other side to start + * sending characters --proven 19980513 */ + return 0; + } +#else + read_buffer = iorb; +#endif + +#ifndef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + /* + * Special nonblocking mode for polled only drivers. + * This is so BSPs and other non kernel things can poll for each char. + * individually. Use only if read modes don't otherwise solve the problem. + */ + if (CYG_IORB_NOBLOCK == iorb->opcode) { + if ((*tty_status & 0x10) != 0) { + read_isr(vector, (CYG_ADDRWORD)this); + } + return 0; + } +#endif + + do { + do { + while ((*tty_status & 0x10) == 0) continue; + } while (read_isr(vector, (CYG_ADDRWORD)this) == Cyg_Interrupt::HANDLED); +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_dsr(vector, 0, (CYG_ADDRWORD)this); +#else + + // Make a callback, even in poll-mode. + + // This should really be done in read_dsr, but this requires + // the iorb to be passed along as an argument (or in + // read_buffer) which a) isn't pretty, b) would require other + // callers of read_dsr to know that fact. The read_dsr would + // extract the iorb and do the below. This fix seemed cleaner + // given that it is a short term solution anyway. -jskov + + if (iorb->callback) + iorb->callback(iorb); + +#endif + } while (read_buffer); + return 0; +} + +// ------------------------------------------------------------------------ +// set_write_mode() +// Set the write mode (CRNL translation) +// Currently there are only two modes (BINARY and ASCII) + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: +set_write_mode(cyg_uint32 new_mode) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + write_mode = new_mode; +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +#endif + +// ------------------------------------------------------------------------ +// write_isr() +// We set the mn10300 to interrupt as soon as the transmission buffer is +// empty. this is before the transmission is completed though. For proper +// flush semantics the driver should switch to getting an interrupt for +// transmission completed then check if it has completed and if not +// return HANDLED. The next interrupt should then switch back. +// --proven 19980523 +// + +cyg_uint32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: + write_isr(cyg_vector vector, CYG_ADDRWORD isr_data) +{ + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 *)isr_data; + volatile cyg_uint8 * tty_tx, ch; + cyg_uint32 off, ret; + + // Default return value + ret = Cyg_Interrupt::HANDLED; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + // Clear interrupts regardless of kmode + data->write_interrupt.acknowledge_interrupt(vector); + + while ((data->write_buffer == NULL) || + (data->write_buffer->xferred_length == data->write_buffer->buffer_length)) { + data->write_buffer = data->write_buffers.get_next_inuse(data->write_buffer); + ret = Cyg_Interrupt::CALL_DSR; + if (!data->write_buffer) { + return ret; + } + } +#else + if (data->write_buffer->xferred_length == data->write_buffer->buffer_length) { + ret = Cyg_Interrupt::CALL_DSR; + data->write_buffer = NULL; + return ret; + } +#endif + + off = data->write_buffer->xferred_length++; + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + if (data->write_mode) { + // This is for cr to cr/lf conversion + if ((ch = data->write_char)) { + data->write_char = '\0'; + } else { + if ((*((char *)data->write_buffer->buffer + off)) != '\n') { + ch = *((char *)data->write_buffer->buffer + off); + } else { + // Decrement so next pass will DTRT + data->write_buffer->xferred_length--; + data->write_char = '\n'; + ch = '\r'; + } + } + } else +#endif + ch = *((char *)data->write_buffer->buffer + off); + + tty_tx = CYG_DEVICE_SERIAL_RS232_TXR; + *tty_tx = ch; + // Do not modify any data structure after the data is written because + // it is possible an interrupt will call this routine before this + // invocation of this routine executes any code beyond this point. + return ret; +} + +void +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2:: + write_dsr(cyg_vector vector, cyg_ucount32 dsr_count, CYG_ADDRWORD dsr_data) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2 *)dsr_data; + cyg_ucount32 count, i; + Cyg_IORB * iorb; + + /* + * Note: Interrupts are not disabled but if the isr causes another + * buffer to become done since the start of this call then + * dsr_write() will be called again to handle that buffer. + */ + + for (i = 0, count = data->write_buffers.min_done(); i < count; i++) { + iorb = data->write_buffers.dequeue(); + if (iorb->callback) + iorb->callback(iorb); + } + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + // Enqueue as many iorbs as we dequeued + for (i = 0; i < count; i++) { + if ((iorb = data->write_buffers_ll_first)) { + data->write_buffers_ll_first = iorb->next; + data->write_buffers.enqueue (iorb); + iorb->next = NULL; + } else { + break; + } + } +#endif +#endif +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::io_write(Cyg_IORB * iorb) +{ + volatile CYG_DEVICE_SERIAL_RS232_SR_SIZE * tty_status = CYG_DEVICE_SERIAL_RS232_SR; + const cyg_vector vector = CYG_DEVICE_SERIAL_RS232_TVEC; + + iorb->next = NULL; + iorb->xferred_length = 0; + iorb->status = CYG_IORB_OK; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + /* + * If more iorbs are be queued than the queuet can handle then + * a separate link list needs to hold the extra. Since the DSR + * does the dequeueing from the link list we have to enqueue + * with the scheduler disabled. + * + * Note: To prevent lots of scheduler locks and unlocks we check + * the queue while the scheduler is unlocked, and only if it is + * full do we lock the scheduler and verify that the queue is + * still full. It is possible that between the check and the lock + * that the DSR could run and make some space in the queue. + * + * Note: We cannot have any iorbs on the ll if the queue is not full. + * + * Note: We cannot have a full queue and also be in polled mode. + * This is why we return after placing the iorb on the ll if the + * queue is full, as there is nothing else to do. + */ + if (write_buffers.min_free() == 0) { + + Cyg_Scheduler::lock(); + + // Check again with the scheduler locked + if (write_buffers.min_free() == 0) { + if (write_buffers_ll_first) { + write_buffers_ll_last->next = iorb; + } else { + write_buffers_ll_first = iorb; + } + write_buffers_ll_last = iorb; + Cyg_Scheduler::unlock(); + return 0; + } + Cyg_Scheduler::unlock(); + } + +#endif + + write_buffers.enqueue (iorb); + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + if (write_buffer == NULL) { +// Must check that iorb isn't already done --proven 19980516 + if (iorb->buffer_length == 0) { + write_isr (vector, (CYG_ADDRWORD)this); + write_dsr (vector, 0, (CYG_ADDRWORD)this); + } else { + /* Prime serial write interrupts with first byte */ + while ((*tty_status & 0x20) != 0) continue; + write_isr (vector, (CYG_ADDRWORD)this); + } + } + return 0; + } +#else + write_buffer = iorb; +#endif + + do { + do { + while ((*tty_status & 0x20) != 0) continue; + } while (write_isr(vector, (CYG_ADDRWORD)this) == Cyg_Interrupt::HANDLED); +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + write_dsr (vector, 0, (CYG_ADDRWORD)this); +#else + + // Make a callback, even in poll-mode. + + // This should really be done in write_dsr, but this requires + // the iorb to be passed along as an argument (or in + // read_buffer) which a) isn't pretty, b) would require other + // callers of write_dsr to know that fact. The write_dsr would + // extract the iorb and do the below. This fix seemed cleaner + // given that it is a short term solution anyway. -jskov + + if (iorb->callback) + iorb->callback(iorb); + +#endif + } while (write_buffer); + return 0; +} + +// ------------------------------------------------------------------------ +// Asynchronous versions are only configured with the +// interrupt version is configured +// +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::io_read_asynchronous(Cyg_IORB * iorb) +{ + // Do we want to configure an error condition for this? --proven 19980506 + CYG_ASSERT (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT, + "Cannot do an io_read_asynchronous while in polled mode" ); + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + this->io_read (iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; + +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::io_write_asynchronous(Cyg_IORB * iorb) +{ + // Do we want to configure an error condition for this? --proven 19980506 + CYG_ASSERT (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT, + "Cannot do an io_write_asynchronous while in polled mode" ); + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + this->io_write (iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} +#endif + +// ------------------------------------------------------------------------ +// Blocking versions just call the internal version with a callback. +// + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT +static void +callback(Cyg_IORB *iorb) +{ + Cyg_Binary_Semaphore * data = (Cyg_Binary_Semaphore *)iorb->callback_data; + data->post(); +} +#endif + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::io_read_blocking(Cyg_IORB * iorb) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + Cyg_Binary_Semaphore read(0); + + // We need a callback routine to wake us up + iorb->callback_data = (CYG_ADDRESS)&read; + iorb->callback = callback; + this->io_read(iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + read.wait(); + return 0; + } else +#endif + { + iorb->callback = NULL; + this->io_read(iorb); + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::io_write_blocking(Cyg_IORB * iorb) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + Cyg_Binary_Semaphore write(0); + + // We need a callback routine to wake us up + iorb->callback_data = (CYG_ADDRESS)&write; + iorb->callback = callback; + this->io_write(iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + write.wait(); + return 0; + } else +#endif + { + iorb->callback = NULL; + this->io_write(iorb); + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +// Internal routine needed to flush writes in a blocking manner. +void +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::io_write_flush(void) +{ + Cyg_IORB iorb; + + iorb.buffer_length = 0; +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + Cyg_Binary_Semaphore write(0); + + // We need a callback routine to wake us up + iorb.callback_data = (CYG_ADDRESS)&write; + iorb.callback = callback; + this->io_write(&iorb); + write.wait(); + } else +#endif + { + iorb.callback = NULL; + this->io_write(&iorb); + } +} + +// ------------------------------------------------------------------------ +// Cancel routines to stop an existing IO operation +// + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::io_read_cancel(Cyg_IORB * iorb) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + Cyg_Scheduler::lock(); +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.disable_interrupts(); +#endif + + // For now only allow the current iorb to be cancelable + // --proven 19980714 + + if (read_buffer == NULL) { +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if ((read_buffer = read_buffers.get_next_inuse(read_buffer)) == NULL) +#endif + { +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.enable_interrupts(); +#endif + Cyg_Scheduler::unlock(); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; + } + } + if (((iorb == NULL) && read_buffer) || + (iorb && (read_buffer == iorb))) { + read_buffer->status = CYG_IORB_CANCELED; +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_buffer = read_buffers.get_next_inuse(read_buffer); +#endif + // Need to clear out any flush iorbs -- proven 19980714 + } else { +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.enable_interrupts(); +#endif + Cyg_Scheduler::unlock(); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_interrupt.enable_interrupts(); +#endif + read_dsr(CYG_DEVICE_SERIAL_RS232_RVEC, 0, (CYG_ADDRWORD)this); + Cyg_Scheduler::unlock(); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +// ------------------------------------------------------------------------ +// Assert versions. These versions bypass most of the driver code. +// These are to be used by the BSP or asserts. Only use them once +// start_sync() is called and when done normal operations is +// restarted with the end_sync() mode. +// +// Note DO NOT DO LOCKING IN THIS ROUTINE!!! +// + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_ASSERT +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_MN10300_2::io_write_assert(Cyg_IORB * iorb) +{ + volatile cyg_uint8 * tty_status = CYG_DEVICE_SERIAL_RS232_SR; + volatile cyg_uint8 * tty_tx = CYG_DEVICE_SERIAL_RS232_TXR; + cyg_uint8 ch; + + iorb->xferred_length = 0; + while (iorb->xferred_length < iorb->buffer_length) { + if ((ch = (*((char *)iorb->buffer + iorb->xferred_length++))) == '\n') { + while ((*tty_status & 0x20) != 0) continue; + *tty_tx = '\r'; + } + while ((*tty_status & 0x20) != 0) continue; + *tty_tx = ch; + } + return 0; +} + +#endif // #ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_KMODE_ASSERT + +#endif // #ifdef CYGPKG_DEVICES_SERIAL_RS232_MN10300_2 +// EOF serial_mn10300_2.cxx diff --git a/packages/devs/serial/rs232/mn10300/current/tests/PKGconf.mak b/packages/devs/serial/rs232/mn10300/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/tests/PKGconf.mak @@ -0,0 +1,38 @@ +#=============================================================================== +# +# makefile +# +# devs/serial/rs232/mn10300/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_serial_rs232_mn10300 +include ../../../../../../pkgconf/pkgconf.mak + + +TESTS := $(TESTS_NOT_TO_AUTOMATE) mn10300_1_serial_test mn10300_2_serial_test + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + diff --git a/packages/devs/serial/rs232/mn10300/current/tests/mn10300_1_serial_test.cxx b/packages/devs/serial/rs232/mn10300/current/tests/mn10300_1_serial_test.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/tests/mn10300_1_serial_test.cxx @@ -0,0 +1,143 @@ +//================================================================= +// +// mn10300_1_serial_test.cxx +// +// Test that the device API for the mn10300_1 device exists. +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// October 31, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-10-08 +// Description: Tests basic serial functionality. +//####DESCRIPTIONEND#### + +// #include +#include // For now include all the devices + +#include // Generic test macros + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME +#define CYG_DEVICE_SERIAL_RS232_NAME CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME + +#define NTHREADS 1 +#include // All the kernel specific stuff +#include + +// #define CYG_DEVICE_INTERNAL +// #include +// #include + +char message1[] = "This is test message 1.\n"; +char message2[] = "This is test message 2.\n"; + +/* Only call routines that do not require user input */ +void entry0(CYG_ADDRWORD data) +{ + Cyg_IORB iorb1, iorb2; + cyg_int32 baud_rate, i; + + iorb1.callback = NULL; + iorb1.buffer = message1; + iorb1.buffer_length = sizeof(message1) - 1; + CYG_DEVICE_SERIAL_RS232_NAME.io_write_asynchronous(&iorb1); + + iorb2.buffer = message2; + iorb2.buffer_length = sizeof(message2) - 1; + CYG_DEVICE_SERIAL_RS232_NAME.io_write_blocking(&iorb2); + + for (i = 0; i < 1000000; i++); // Delay to flush the tx buffer + + if ((baud_rate = CYG_DEVICE_SERIAL_RS232_NAME.get_baud_rate()) >= 0) { + CYG_TEST_PASS_FAIL( + (CYG_DEVICE_SERIAL_RS232_NAME.set_baud_rate(baud_rate) >= 0), + "Setting baud rate to previous baud rate."); + } else { + CYG_TEST_FAIL("Could not get baud rate."); + } + + CYG_TEST_PASS_EXIT("serial_test"); +} + +/* Make calls to the rest of the API */ +void entry_bogus(CYG_ADDRWORD data) +{ + Cyg_IORB iorb; + char buf[1024]; + iorb.buffer = buf; + iorb.buffer_length = sizeof(buf); + + // Set mode to interrupt + CYG_DEVICE_SERIAL_RS232_NAME.set_kmode((cyg_uint32)1); + // CYG_DEVICE_SERIAL_RS232_NAME.get_kmode(); // Doesn't exist yet + + // These could go in the entry0 routine + CYG_DEVICE_SERIAL_RS232_NAME.get_line_mode(); + CYG_DEVICE_SERIAL_RS232_NAME.set_line_mode(1); + + CYG_DEVICE_SERIAL_RS232_NAME.get_baud_rate(); + CYG_DEVICE_SERIAL_RS232_NAME.set_baud_rate(1); + + CYG_DEVICE_SERIAL_RS232_NAME.set_read_mode(1); + // CYG_DEVICE_SERIAL_RS232_NAME.get_read_mode(); // Doesn't exist yet + CYG_DEVICE_SERIAL_RS232_NAME.set_read_data(1, NULL, 0); + CYG_DEVICE_SERIAL_RS232_NAME.io_read_asynchronous(&iorb); + CYG_DEVICE_SERIAL_RS232_NAME.io_read_blocking(&iorb); + CYG_DEVICE_SERIAL_RS232_NAME.io_read_cancel(&iorb); + + CYG_DEVICE_SERIAL_RS232_NAME.set_write_mode(1); + // CYG_DEVICE_SERIAL_RS232_NAME.get_write_mode(); // Doesn't exist yet + CYG_DEVICE_SERIAL_RS232_NAME.io_write_asynchronous(&iorb); + CYG_DEVICE_SERIAL_RS232_NAME.io_write_blocking(&iorb); + // CYG_DEVICE_SERIAL_RS232_NAME.io_write_cancel(&iorb);// Doesn't exist yet +} + +externC void +cyg_start(void) +{ + CYG_TEST_INIT(); + + new_thread(entry0, 0); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_EXIT("Not reached"); + + entry_bogus(0); // To prevent selective linking from GC all the bogus calls. +} + +#else // CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME + +externC void +cyg_start(void) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_EXIT("N/A: required serial device not present"); +} + +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_1_NAME + +// EOF mn10300_1_serial_tests.cxx diff --git a/packages/devs/serial/rs232/mn10300/current/tests/mn10300_2_serial_test.cxx b/packages/devs/serial/rs232/mn10300/current/tests/mn10300_2_serial_test.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/mn10300/current/tests/mn10300_2_serial_test.cxx @@ -0,0 +1,146 @@ +//================================================================= +// +// mn10300_2_serial_test.cxx +// +// Test that the device API for the mn10300_2 device exists. +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// October 31, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-10-08 +// Description: Tests basic serial functionality. +//####DESCRIPTIONEND#### + +// #include +#include // For now include all the devices + +#include // Generic test macros + +#ifdef CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME +#define CYG_DEVICE_SERIAL_RS232_NAME CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME + +#define NTHREADS 1 +#include // All the kernel specific stuff +#include + +// #define CYG_DEVICE_INTERNAL +// #include +// #include + +char message1[] = "This is test message 1.\n"; +char message2[] = "This is test message 2.\n"; + +/* Only call routines that do not require user input */ +void entry0(CYG_ADDRWORD data) +{ + Cyg_IORB iorb1, iorb2; + cyg_int32 baud_rate, i; + + iorb1.callback = NULL; + iorb1.buffer = message1; + iorb1.buffer_length = sizeof(message1) - 1; +// Because the testing infrastructure currently uses the hal +// We cannot do ANY calls to the device driver. +// CYG_DEVICE_SERIAL_RS232_NAME.io_write_asynchronous(&iorb1); + + iorb2.buffer = message2; + iorb2.buffer_length = sizeof(message2) - 1; +// CYG_DEVICE_SERIAL_RS232_NAME.io_write_blocking(&iorb2); + + for (i = 0; i < 1000000; i++); // Delay to flush the tx buffer + + baud_rate = i; +// if ((baud_rate = CYG_DEVICE_SERIAL_RS232_NAME.get_baud_rate()) >= 0) { +// CYG_TEST_PASS_FAIL( +// (CYG_DEVICE_SERIAL_RS232_NAME.set_baud_rate(baud_rate) >= 0), +// "Setting baud rate to previous baud rate."); +// } else { +// CYG_TEST_FAIL("Could not get baud rate."); +// } + + CYG_TEST_PASS_EXIT("serial_test"); +} + +/* Make calls to the rest of the API */ +void entry_bogus(CYG_ADDRWORD data) +{ + Cyg_IORB iorb; + char buf[1024]; + iorb.buffer = buf; + iorb.buffer_length = sizeof(buf); + + // Set mode to interrupt + CYG_DEVICE_SERIAL_RS232_NAME.set_kmode((cyg_uint32)1); + // CYG_DEVICE_SERIAL_RS232_NAME.get_kmode(); // Doesn't exist yet + + // These could go in the entry0 routine + CYG_DEVICE_SERIAL_RS232_NAME.get_line_mode(); + CYG_DEVICE_SERIAL_RS232_NAME.set_line_mode(1); + + CYG_DEVICE_SERIAL_RS232_NAME.get_baud_rate(); + CYG_DEVICE_SERIAL_RS232_NAME.set_baud_rate(1); + + CYG_DEVICE_SERIAL_RS232_NAME.set_read_mode(1); + // CYG_DEVICE_SERIAL_RS232_NAME.get_read_mode(); // Doesn't exist yet + CYG_DEVICE_SERIAL_RS232_NAME.set_read_data(1, NULL, 0); + CYG_DEVICE_SERIAL_RS232_NAME.io_read_asynchronous(&iorb); + CYG_DEVICE_SERIAL_RS232_NAME.io_read_blocking(&iorb); + CYG_DEVICE_SERIAL_RS232_NAME.io_read_cancel(&iorb); + + CYG_DEVICE_SERIAL_RS232_NAME.set_write_mode(1); + // CYG_DEVICE_SERIAL_RS232_NAME.get_write_mode(); // Doesn't exist yet + CYG_DEVICE_SERIAL_RS232_NAME.io_write_asynchronous(&iorb); + CYG_DEVICE_SERIAL_RS232_NAME.io_write_blocking(&iorb); + // CYG_DEVICE_SERIAL_RS232_NAME.io_write_cancel(&iorb);// Doesn't exist yet +} + +externC void +cyg_start(void) +{ + CYG_TEST_INIT(); + + new_thread(entry0, 0); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_EXIT("Not reached"); + + entry_bogus(0); // To prevent selective linking from GC all the bogus calls. +} + +#else // CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME + +externC void +cyg_start(void) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_EXIT("N/A: required serial device not present"); +} + +#endif // CYG_DEVICE_SERIAL_RS232_MN10300_2_NAME + +// EOF mn10300_2_serial_tests.cxx diff --git a/packages/devs/serial/rs232/tx39/current/ChangeLog b/packages/devs/serial/rs232/tx39/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/tx39/current/ChangeLog @@ -0,0 +1,196 @@ +1998-10-24 Hugo Tyson + + * include/pkgconf/serial_tx39.h: + Only define anything if we have the correct hardware platform and + NOT a simulator target for that platform, as well as the device + package itself being defined. + +1998-10-23 Hugo Tyson + + * tests/tx39_serial_test.cxx: + Move include of testing header above the check for "can we test". + +Thu Oct 22 12:55:04 BST 1998 Chris Provenzano + + * PKGconf.mak: added new API test and delete all the old tests + + * tests/README, tests/get_baud_rate.cxx, tests/serial1.cxx + * tests/serial2.cxx, tests/serial3.cxx, tests/serial4.cxx + * tests/serial5.cxx, tests/set_baud_rate.cxx + Removed old tests. + + * tx39_serial_test.cxx: New test that test just the API and not much + of the functionality. These tests meet or exceed the previous + existence/spelling tests of the API and therefore replace all the + serial[x].cxx tests which were removed. + +Tue Oct 20 15:56:00 1998 Jonathan Larmour + + * src/PKGconf.mak: + Remove unnecessary override of PKGCONF_CXXFLAGS + +1998-10-19 Jesper Skov + + * include/pkgconf/serial_tx39.h: Undid 1998-10-16 change. + +1998-10-16 Jesper Skov + + * include/pkgconf/serial_tx39.h: Changed CYGPKG_HAL_TX39_JMR3904 + to CYG_HAL_TX39_JMR3904. + +Thu Oct 15 17:00:00 1998 John Dallaway + + * include/pkgconf/serial_tx39.h: Disable dependence on HAL + in CDL. + +Tue Sep 29 09:16:53 1998 Jesper Skov + + * tests/get_baud_rate.cxx (entry0): Removed loop that made the + test timeout on sim. + +Sun Sep 27 15:17:34 1998 Jesper Skov + + * tests/set_baud_rate.cxx: Do not change the baud rate to + 0. Undefined behavior in the current drivers. + +Sun Sep 27 13:50:01 1998 Jesper Skov + + * tests/README: Added copyright blurb. + +Fri Sep 25 20:59:10 1998 Jesper Skov + + * tests/README: Added. + +Fri Sep 25 20:30:12 1998 Jesper Skov + + * tests/set_baud_rate.cxx (entry0): Set baud_rate to 38400, not + 19200. + +Fri Sep 25 11:59:31 1998 Jesper Skov + + * tests/serial3.cxx: + * tests/serial5.cxx: + Added some diag info to help identify as input tests. + + * tests/PKGconf.mak: Reintroduced input tests. + +Wed Sep 23 16:53:57 1998 Jesper Skov + PR 17315 + + * tests/set_baud_rate.cxx: + * tests/serial5.cxx: + * tests/serial4.cxx: + * tests/serial3.cxx: + * tests/serial2.cxx: + * tests/serial1.cxx: + * tests/get_baud_rate.cxx: + Changed device name. + + * tests/PKGconf.mak: + Include tests that do not require human intervention. + +Wed Sep 23 14:36:53 1998 Jesper Skov + PR 17424 + + * src/serial_tx39.cxx (io_write, io_read): Also do callbacks in + poll-mode, if the pointer is non-NULL. + +Thu Sep 17 19:21:35 1998 Frank Ch. Eigler + + * tests/serial2.cxx (entry0): + Reorder foo flag use to avoid race condition. + +Thu Sep 17 12:53:33 1998 Jesper Skov + + * include/pkgconf/serial_tx39.h: Put requires in CDL. + Protect CYG_DEVICE_SERIAL_RS232_MUTEX + with CYGPKG_KERNEL. + Protect CYG_DEVICE_SERIAL_RS232_TX39_KMODE_INTERRUPT with + CYGIMP_KERNEL_INTERRUPTS_DSRS. + +Thu Sep 17 09:45:00 1998 Jesper Skov + + * tests/get_baud_rate.cxx tests/serial1.cxx tests/serial2.cxx + tests/serial3.cxx tests/serial4.cxx tests/serial5.cxx + tests/set_baud_rate.cxx + Remove all tests. They are not mentioned in the makefile. + +Tue Sep 15 02:23:06 BST 1998 Chris Provenzano + + * include/serial_tx39.hxx, src/serial_tx39.cxx: + Use positive macros instead of negative changing all + ...DO_NOT_DECLARE macros to ...DECLARE + +1998-09-12 Bart Veer + + * include/pkgconf/serial_tx39.h: + Added missing descriptions (PR 17184) + +Fri Sep 11 11:13:18 1998 Jesper Skov + PR 17228 + + * src/serial_tx39.cxx (io_read): Made to compile when + KMODE_INTERRUPT undefined. + (io_write): Same. + (write_isr): Same. + (both_isr): Only compile when KMODE_INTERRUPT defined. + (set_kmode): Added dummy function for use when only one kmode is + configured + * include/serial_tx39.hxx: Removed conditionals around + set_kmode. + +1998-09-04 Bart Veer + + * include/pkgconf/serial_tx39.h: + Sorting out naming conventions within the devs/serial hierarchy. + +Thu Sep 3 16:00:45 1998 Jonathan Larmour + + * include/pkgconf/serial_tx39.h: + Moved here from devs/common/current/include/pkgconf/ + +Fri Aug 28 09:50:36 1998 Jonathan Larmour + + * tests/get_baud_rate.cxx, tests/serial1.cxx, tests/serial2.cxx, + tests/serial3.cxx, tests/serial4.cxx, tests/serial5.cxx, + tests/set_baud_rate.cxx: + Change use of main() as the entry point to cyg_start() under the + new entry point scheme. Remove return codes as cyg_start() returns + void, not int. + +Tue Jul 28 13:58:25 BST 1998 Chris Provenzano + + * include/serial_tx39.hxx: Declare TX39 device using the + configured name. + + * tests/PKGconf.mak: Don't compile tests right now. + All tests need to be reworked. + +Mon Jul 27 17:33:59 BST 1998 Chris Provenzano + + * Changelog: Initial ChangeLog entry. + + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/devs/serial/rs232/tx39/current/include/pkgconf/serial_tx39.h b/packages/devs/serial/rs232/tx39/current/include/pkgconf/serial_tx39.h new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/tx39/current/include/pkgconf/serial_tx39.h @@ -0,0 +1,181 @@ +#ifndef CYGONCE_PKGCONF_SERIAL_TX39_H +#define CYGONCE_PKGCONF_SERIAL_TX39_H +// ==================================================================== +// +// pkgconf/serial_tx39.h +// +// Device configuration file for tx39 serial ports +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-05-25 +// Purpose: To allow the user to edit device specific +// configuration options for the tx39 2 serial device. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +#include + +#ifdef CYGPKG_KERNEL +#include +#endif + +/* Only define options if the driver is to be present. */ +#if defined( CYGPKG_HAL_TX39 ) && \ + !defined( CYGPKG_HAL_TX39_SIM ) && \ + defined( CYGPKG_DEVICES_SERIAL_RS232_TX39 ) + +/* ---------------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_DEVICES_SERIAL_RS232_TX39 { + display "TX39 serial device code" + parent CYGPKG_DEVICES_SERIAL_RS232_COMMON +# requires CYGPKG_HAL_TX39_JMR3904 + requires CYGPKG_KERNEL + description " + Driver for the on-chip RS232 device." + } + + }}CFG_DATA +*/ + +/* --------------------------------------------------------------------- + * First we define all the options that are exportable to the user. These + * options will show/hide various methods for the class. + */ + +/* --------------------------------------------------------------------- + * Define what kernel mode the driver can support. One must be defined. + * Both can be defined. + */ +#define CYG_DEVICE_SERIAL_RS232_TX39_KMODE_POLLED +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS +#define CYG_DEVICE_SERIAL_RS232_TX39_KMODE_INTERRUPT +#endif + +/* --------------------------------------------------------------------- + * Define if we do diag output. This could possible be another kmode. + * --proven 19980512 + */ +#define CYG_DEVICE_SERIAL_RS232_TX39_KMODE_ASSERT + +/* --------------------------------------------------------------------- + * Define the default baudrate and line mode. + */ +#define CYG_DEVICE_SERIAL_RS232_TX39_DEFAULT_BAUD_RATE 38400 + +/* --------------------------------------------------------------------- + * Define if non binary terminal protocol modes are needed. + */ +#define CYG_DEVICE_SERIAL_RS232_TX39_READ_MODES +#define CYG_DEVICE_SERIAL_RS232_TX39_WRITE_MODES + + +#ifdef CYG_DEVICE_INTERNAL +/* ==================================================================== + * Now define internal only options. These options dictate the struture + * of a class but have no effect on the methods declared for a class. + */ + +/* --------------------------------------------------------------------- + * The need for queues is only necessary in interrupt mode. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_KMODE_INTERRUPT + +/* --------------------------------------------------------------------- + * Define the number of iorb read buffers the serial read_isr device can + * handle at one time. Also define if the device needs to queue more iorbs + * than what the read_isr can handle. + */ +# define CYG_DEVICE_SERIAL_RS232_READ_BUFFERS 4 +# define CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + +/* --------------------------------------------------------------------- + * Define the number of iorb write buffers the serial write_isr device can + * handle at one time. Also define if the device needs to queue more iorbs + * than what the write_isr can handle. + */ +# define CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS 4 +# define CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + +#endif // CYG_DEVICE_SERIAL_RS232_TX39_KMODE_INTERRUPT + +/* ==================================================================== + * Duplicate the above options. DO NOT modify them. Modify the ones above. + * This is so the internal source files can be compiled from the same + * common sources. These defines can never be exported to the user. + */ + +/* --------------------------------------------------------------------- + * Define what kernel mode the driver can support. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_KMODE_INTERRUPT +#define CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT 1 +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_KMODE_POLLED +#define CYG_DEVICE_SERIAL_RS232_KMODE_POLLED 0 +#endif + +/* --------------------------------------------------------------------- + * Define what line modes the driver can support. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_LINE_MODES +#define CYG_DEVICE_SERIAL_RS232_LINE_MODES +#endif + +/* --------------------------------------------------------------------- + * Define any terminal protocols need to be supported. + */ +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_READ_MODES +#define CYG_DEVICE_SERIAL_RS232_READ_MODES +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_WRITE_MODES +#define CYG_DEVICE_SERIAL_RS232_WRITE_MODES +#endif + +#ifdef CYGPKG_KERNEL +/* --------------------------------------------------------------------- + * Define if a mutex is needed to lock out multiple threads accessing + * the serial driver. If not defined then it is assumes only one + * thread will access the driver at a given time. + */ +#define CYG_DEVICE_SERIAL_RS232_MUTEX +#endif /* CYGPKG_KERNEL */ + +#endif // CYG_DEVICE_INTERNAL + +#endif /* ifdef CYGPKG_DEVICES_SERIAL_RS232_TX39 et al */ + +#endif /* CYGONCE_PKGCONF_SERIAL_TX39_H */ +/* EOF serial_tx39.h */ diff --git a/packages/devs/serial/rs232/tx39/current/include/serial_tx39.hxx b/packages/devs/serial/rs232/tx39/current/include/serial_tx39.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/tx39/current/include/serial_tx39.hxx @@ -0,0 +1,180 @@ +#ifndef CYGONCE_DEVS_SERIAL_RS232_TX39_SERIAL_TX39_HXX +#define CYGONCE_DEVS_SERIAL_RS232_TX39_SERIAL_TX39_HXX + +//========================================================================== +// +// serial_tx39.hxx +// +// Header file for the tx39 serial device +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-04-22 +// Purpose: Define Cyg_Device_Serial_tx39 data structure +// Description: This file contains the C++ class declaration of +// Cyg_Device_Serial_tx39. There can be only one. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // Device configureation file + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39 +// Include Configureation options specific to the device +#include CYG_DEVICE_SERIAL_RS232_TX39 + +#include +#include // assertion macros +#include // tracing macros + +#include // Cyg_ISR, Cyg_DSR +#include // intr.hxx +#include // intr.hxx + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX +#include +#endif +#include + +// ------------------------------------------------------------------------- +// The tx39 serial device registers. + +#ifdef CYG_DEVICE_INTERNAL +// Define the serial registers. +#define CYG_DEVICE_SERIAL_RS232_TX39_SLCR ((volatile cyg_uint16 *)0xfffff300) +#define CYG_DEVICE_SERIAL_RS232_TX39_SDICR ((volatile cyg_uint16 *)0xfffff308) +#define CYG_DEVICE_SERIAL_RS232_TX39_SDISR ((volatile cyg_uint16 *)0xfffff30c) +#define CYG_DEVICE_SERIAL_RS232_TX39_SFCR ((volatile cyg_uint16 *)0xfffff310) +#define CYG_DEVICE_SERIAL_RS232_TX39_SBRG ((volatile cyg_uint16 *)0xfffff314) +#define CYG_DEVICE_SERIAL_RS232_TX39_TFIFO ((volatile cyg_uint8 *)0xfffff320) +#define CYG_DEVICE_SERIAL_RS232_TX39_SFIFO ((volatile cyg_uint8 *)0xfffff330) + +#define CYG_DEVICE_SERIAL_RS232_TX39_VEC CYG_VECTOR_SIO_0 + +// Here are the values for the timers to set the various baud rates +// Timer 1 is the serial 2 timer register +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0 0 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B600 0x02 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B1200 0x02 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B2400 0x02 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B4800 0x02 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B9600 0x01 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B19200 0x01 +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400 0x01 + +// Timer 2 is the 8 bit timer 2 register +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 0 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B600 81 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B1200 41 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B2400 20 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B4800 41 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B9600 20 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B19200 10 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400 05 + +// Now set the default baudrate +#ifndef CYG_DEVICE_SERIAL_RS232_TX39_DEFAULT_BAUD_RATE +#error "Must specify a default baud rate" +#else +#if ((CYG_DEVICE_SERIAL_RS232_TX39_DEFAULT_BAUD_RATE > 0) && \ + (CYG_DEVICE_SERIAL_RS232_TX39_DEFAULT_BAUD_RATE < 600)) +#error "Baud rates less than 600 are not supported for the tx39 at this time" +#endif +#define CYG_DEVICE_SERIAL_RS232_DEFAULT_BAUD_RATE \ + CYG_DEVICE_SERIAL_RS232_TX39_DEFAULT_BAUD_RATE +#endif // CYG_DEVICE_SERIAL_RS232_TX39_DEFAULT_BAUD_RATE + +#include + +#endif // CYG_DEVICE_INTERNAL + +// ------------------------------------------------------------------------- +// Cyg_Device_Serial_RS232_tx39 + +#define CYG_CLASS_DEVICE_SERIAL_RS232_TX39 Cyg_Device_Serial_RS232_tx39 + +class CYG_CLASS_DEVICE_SERIAL_RS232_TX39 + : public Cyg_Device_Serial_RS232 +{ +#ifdef CYG_DEVICE_INTERNAL +#define CYG_DEVICE_SERIAL_RS232_ONE_VECTOR +#include +#endif + +private: + /* Internal routines */ + cyg_int32 io_read(Cyg_IORB * iorb); + cyg_int32 io_write(Cyg_IORB * iorb); + void io_write_flush(void); + +public: + + /* Constructor */ + CYG_CLASS_DEVICE_SERIAL_RS232_TX39(); + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_KMODE_ASSERT + cyg_int32 io_read_assert(Cyg_IORB * iorb); + cyg_int32 io_write_assert(Cyg_IORB * iorb); +#endif + + cyg_int32 io_read_blocking(Cyg_IORB * iorb); + cyg_int32 io_write_blocking(Cyg_IORB * iorb); + cyg_int32 io_read_asynchronous(Cyg_IORB * iorb); + cyg_int32 io_write_asynchronous(Cyg_IORB * iorb); + + cyg_int32 set_kmode(cyg_uint32); + cyg_int32 get_kmode(void); + + cyg_int32 set_baud_rate(cyg_uint32); + cyg_int32 get_baud_rate(void); + + cyg_int32 set_line_mode(cyg_uint32); + cyg_int32 get_line_mode(void); + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_READ_MODES + cyg_int32 set_read_mode(cyg_uint32); +#endif +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_WRITE_MODES + cyg_int32 set_write_mode(cyg_uint32); +#endif +}; + +// Declare exported variables +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_NAME +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_DECLARE +extern CYG_CLASS_DEVICE_SERIAL_RS232_TX39 CYG_DEVICE_SERIAL_RS232_TX39_NAME; +#endif +#endif + +#endif // CYG_DEVICE_SERIAL_RS232_TX39 + +#endif // CYGONCE_DEVS_SERIAL_RS232_TX39_SERIAL_TX39_HXX +// End of serial_tx39.hxx + diff --git a/packages/devs/serial/rs232/tx39/current/src/PKGconf.mak b/packages/devs/serial/rs232/tx39/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/tx39/current/src/PKGconf.mak @@ -0,0 +1,41 @@ +#=============================================================================== +# +# makefile +# +# devs/serial/rs232/tx39/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_serial_rs232_tx39 +include ../../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := serial_tx39.cxx +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/devs/serial/rs232/tx39/current/src/serial_tx39.cxx b/packages/devs/serial/rs232/tx39/current/src/serial_tx39.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/tx39/current/src/serial_tx39.cxx @@ -0,0 +1,1092 @@ +//================================================================= +// +// serial_tx39.cxx +// +// Drivers for the tx39 +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-05-25 +// Description: Class methods for the class Cyg_Device_Serial_tx39 +// The tx39 on chip serial port only requries one interrupt handler +// as it only has one vector for the port. The handler must check +// and multiples the read and write interrupts and then clear it. +// One unusual thing about the TX39 is that the transfer interrupt +// is not clearable if there is space to put characters in the +// tfifo. This means that when nothing is to be written the +// transfer interrupt must be disabled. +//####DESCRIPTIONEND#### + +#include // To see if we need to bother +#if defined(CYG_HAL_TX39_JMR3904) && defined(CYGPKG_DEVICES_SERIAL_RS232_TX39) + +#define CYG_DEVICE_INTERNAL +#include +#include // Cyg_Binary_Semaphore + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_NAME +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_DECLARE +CYG_CLASS_DEVICE_SERIAL_RS232_TX39 CYG_DEVICE_SERIAL_RS232_TX39_NAME; +#endif +#endif + +// ------------------------------------------------------------------------ +// Constructor for serial device +// +CYG_CLASS_DEVICE_SERIAL_RS232_TX39::CYG_CLASS_DEVICE_SERIAL_RS232_TX39() +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + : both_interrupt(CYG_DEVICE_SERIAL_RS232_TX39_VEC, 4, (CYG_ADDRWORD)this, both_isr, both_dsr) +#endif +{ + CYG_REPORT_FUNCTION(); + + read_buffer = NULL; + + // read_buffers = NULL; +#ifdef CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + read_buffers_ll_last = NULL; + read_buffers_ll_first = NULL; +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + // Default to ASCII mode if READ_MODES is configured. + read_mode = 0xff; +// read_mode_translate_char = 0; +// read_mode_escape_next_char = 0; +#endif + + write_buffer = NULL; + // write_buffers = NULL; +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + write_buffers_ll_last = NULL; + write_buffers_ll_first = NULL; +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + // Default to CR to CRLF translation + write_mode = 1; + write_char = 0; +#endif + + // Set the timers before enabling them or the serial device + *CYG_DEVICE_SERIAL_RS232_TX39_SBRG = (CYG_DEVICE_SERIAL_RS232_T1_VALUE << 8) | CYG_DEVICE_SERIAL_RS232_T2_VALUE; +// (0x0100 | 10); + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + both_interrupt.attach(); + // Clear interrupts for now. + *CYG_DEVICE_SERIAL_RS232_TX39_SDICR = 0x0000; + /* Do not unmask the interrupt unless interrupt is the default mode */ +#endif + + // Set the control registers, finallizing the settup. + // Set up FIFOs rx and tx DMA transfer levels to 4 + *CYG_DEVICE_SERIAL_RS232_TX39_SFCR = 0x0000; + + // Source from baud rate generator, 8-1-no parity. + *CYG_DEVICE_SERIAL_RS232_TX39_SLCR = 0x0020; +} + +// ------------------------------------------------------------------------ +// set_kmode() +// Set the kernel mode to (polled, interrrupt, ...) +// Only applicable if we have multiple modes. + +#if defined (CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) && \ + defined (CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: + set_kmode(cyg_uint32 new_mode) +{ + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + + /* Switching from polled mode to interrupt mode is easy */ + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) { + if (new_mode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + + /* Only enable read interrupts for now */ + *CYG_DEVICE_SERIAL_RS232_TX39_SDICR = 0x0001; + *CYG_DEVICE_SERIAL_RS232_TX39_SDISR = 0x0000; + + /* Turn on interrupts by unmasking the vector */ + both_interrupt.unmask_interrupt(both_interrupt.get_vector()); + } + } + /* Switching to polled mode should flush the buffers */ + else { + if (new_mode == CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) { + both_interrupt.mask_interrupt(both_interrupt.get_vector()); + *CYG_DEVICE_SERIAL_RS232_TX39_SDICR = 0x0000; + *CYG_DEVICE_SERIAL_RS232_TX39_SDISR = 0x0000; + } + } + + kmode = new_mode; + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + + return 0; +} + +#else + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: + set_kmode(cyg_uint32 new_mode) +{ +#if defined(CYG_DEVICE_SERIAL_RS232_KMODE_POLLED) + CYG_ASSERT (CYG_DEVICE_SERIAL_RS232_KMODE_POLLED == new_mode, + "Can only select polled mode" ); +#endif +#if defined(CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) + CYG_ASSERT (CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT == new_mode, + "Can only select interrupt mode" ); +#endif + + return 0; +} + +#endif + +// ------------------------------------------------------------------------ +// Baud rate + +static struct baud_rate { + cyg_uint8 bclk; + cyg_uint8 brd; +} baud_rate_table[] = { + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B0 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B50 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B75 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B110 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B134.5 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B150 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B300 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B600, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B600 }, // B600 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B1200, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B1200 }, // B1200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B0, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B0 }, // B1800 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B2400, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B2400 }, // B2400 + + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B4800, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B4800 }, // B4800 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B9600, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B9600 }, // B9600 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B19200, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B19200 }, // B19200 + { CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400, CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400 } // B38400 +}; + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: +get_baud_rate() +{ + cyg_ucount8 i; + cyg_uint8 bclk, brd; + + brd = *CYG_DEVICE_SERIAL_RS232_TX39_SBRG & 0xff; + bclk = (*CYG_DEVICE_SERIAL_RS232_TX39_SBRG >> 8) & 0xff; + + for (i = 0; i < (sizeof(baud_rate_table) / sizeof(struct baud_rate)); i++) { + if ((bclk == baud_rate_table[i].bclk) && + (brd == baud_rate_table[i].brd)) { + return(i); + } + } + + return(-1); +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: +set_baud_rate(cyg_uint32 baud_rate) +{ + cyg_int32 old_baud_rate; + + if (baud_rate > (sizeof(baud_rate_table) / sizeof(struct baud_rate))) { + return -1; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + + /* + * Flush the write queue. + * Not necessary for the read queue + */ + this->io_write_flush(); + + /* Get the old baud rate */ + if ((old_baud_rate = this->get_baud_rate()) < 0) + old_baud_rate = 0; + + /* Turn off read and write */ + // Cannot be done for the TX39 chip SIO + + /* Reenable timer and serial port for valid baud rates greater than 0 */ + if (baud_rate_table[baud_rate].bclk && baud_rate_table[baud_rate].brd) { + *CYG_DEVICE_SERIAL_RS232_TX39_SBRG = + (baud_rate_table[baud_rate].bclk << 8) | baud_rate_table[baud_rate].brd; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + + return(old_baud_rate); + +} + +// ------------------------------------------------------------------------ +// Line mode + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: +get_line_mode() +{ + cyg_uint16 slcr; + cyg_int32 ret; + + slcr = *CYG_DEVICE_SERIAL_RS232_TX39_SLCR; + + /* bits per byte */ + if (slcr & 0x0001) { + ret = CS7; + } else { + ret = CS8; + } + /* Stop bits */ + if (slcr & 0x0004) { + ret |= CSTOPB; + } + /* Parity */ + if (slcr & 0x0008) { + ret |= PARENB; + if (!(slcr & 0x0010)) { + ret |= PARODD; + } + } + + return ret; +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: +set_line_mode(cyg_uint32 line_mode) +{ + cyg_int32 old_line_mode; + cyg_uint16 slcr; + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + /* + * Flush the write queue. + * Not necessary for the read queue + */ + this->io_write_flush(); + + slcr = *CYG_DEVICE_SERIAL_RS232_TX39_SLCR; + + old_line_mode = this->get_line_mode(); + + switch(line_mode & CSIZE) { + case CS8: + slcr &= ~0x0001; + break; + case CS7: + slcr |= 0x0001; + break; + default: + return -1; + break; + } + if (line_mode & CSTOPB) { + slcr |= 0x0004; + } else { + slcr &= ~0x0004; + } + if (line_mode & PARENB) { + if (line_mode & PARODD) { + slcr &= ~0x0010; + } else { + slcr |= 0x0010; + } + } else { + slcr &= ~0x0008; + } + + /* Set the new flags all in one write. */ + *CYG_DEVICE_SERIAL_RS232_TX39_SLCR = slcr; + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + + return old_line_mode; + +} + +// ------------------------------------------------------------------------ +// set_read_mode() +// Set the read mode (CRNL translation, EOL detection, escape characters) +// Currently there are only two modes (BINARY and ASCII) + +#ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: +set_read_mode(cyg_uint32 new_mode) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + if (new_mode) { + read_mode = 0xff; + } else { + read_mode = 0; + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +#endif + +static inline void +throttle(char ch) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL + cyg_uint8 tmp; + + tmp = (data->read_throttle_free + 1) % data->read_throttle_size; + /* Check that there is space to put the character */ + if (tmp != data->read_throttle_queued) { + data->read_throttle_buffer[tmp] = ch; + data->read_throttle_free = tmp; + } + data->read_throttle = 1; +#endif +} + +// ------------------------------------------------------------------------ +// read_isr() +// +cyg_uint32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: + read_isr(cyg_vector vector, CYG_ADDRWORD isr_data) +{ + CYG_CLASS_DEVICE_SERIAL_RS232_TX39 * data = (CYG_CLASS_DEVICE_SERIAL_RS232_TX39 *)isr_data; + volatile cyg_uint16 * sdisr = CYG_DEVICE_SERIAL_RS232_TX39_SDISR; + volatile cyg_uint8 * sfifo = CYG_DEVICE_SERIAL_RS232_TX39_SFIFO; + cyg_uint32 off, ret; + cyg_uint8 eob = 0; + cyg_uint8 ch; + + // Default return value + ret = Cyg_Interrupt::HANDLED; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + // Clear interrupts regaurdless of kmode + // data->read_interrupt.acknowledge_interrupt(vector); +#endif + + ch = *sfifo; + *sdisr = 0x0000; + +#ifdef CYG_DEVICE_SERIAL_RS232_READ_MODES + while (data->read_mode) { + // On escape characters, skip mode checks; break + // Deal with flow control characters; return + + /* Deal with ignored characters first */ + if (data->read_mode & CYG_DEVICE_SERIAL_RS232_READ_MODE_IGN) { + if (ch == 10) + return ret; + } + /* Translate characters before checking on EOB conditions. */ + if (data->read_mode & CYG_DEVICE_SERIAL_RS232_READ_MODE_TRN) { + if (ch == 13) + ch = 10; + } + /* Return a not full IORB on an EOB condition. */ + if (data->read_mode & CYG_DEVICE_SERIAL_RS232_READ_MODE_EOB) { + if ((ch == 4) || (ch == 10) || (ch == 13) || (ch == 26)) { + eob = 1; + } + } + break; + } +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL + if (read_throttle == 0) { +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (data->read_buffer == NULL) { + while ((data->read_buffer = data->read_buffers.get_next_inuse(data->read_buffer))) { + if (data->read_buffer->xferred_length < data->read_buffer->buffer_length) { + ret = Cyg_Interrupt::CALL_DSR; + break; + } + } + if (data->read_buffer == NULL) { + ret = Cyg_Interrupt::CALL_DSR; + throttle(ch); + return ret; + } + } +#endif + + off = data->read_buffer->xferred_length++; + *((char *)data->read_buffer->buffer + off) = ch; + + // This is still ugly --proven 19980526 + if ((data->read_buffer->xferred_length == data->read_buffer->buffer_length) || eob) { +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + data->read_buffer = data->read_buffers.get_next_inuse(data->read_buffer); +#else + data->read_buffer = NULL; +#endif + ret = Cyg_Interrupt::CALL_DSR; + } + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + while ((data->read_buffer != NULL) && + (data->read_buffer->xferred_length == data->read_buffer->buffer_length)) { + data->read_buffer = data->read_buffers.get_next_inuse(data->read_buffer); + ret = Cyg_Interrupt::CALL_DSR; // Probably not necessary + } +#endif + +#ifdef CYG_DEVICE_SERIAL_RS232_FLOW_CONTROL + } else { + throttle(ch); + } +#endif + + return ret; + +} + +void +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: + read_dsr(cyg_vector vector, cyg_ucount32 dsr_count, CYG_ADDRWORD dsr_data) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + CYG_CLASS_DEVICE_SERIAL_RS232_TX39 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_TX39 *)dsr_data; + cyg_ucount32 count, i; + Cyg_IORB * iorb; + + /* + * Note: Interrupts are not disabled but if the isr causes another + * buffer to become done since the start of this call then + * dsr_read() will be called again to handle that buffer. + */ + + for (i = 0, count = data->read_buffers.min_done(); i < count; i++) { + iorb = data->read_buffers.dequeue(); + if (iorb->callback) + iorb->callback(iorb); + } + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + // Enqueue as many iorbs as we dequeued + for (i = 0; i < count; i++) { + if ((iorb = data->read_buffers_ll_first)) { + data->read_buffers_ll_first = iorb->next; + data->read_buffers.enqueue (iorb); + iorb->next = NULL; + } else { + break; + } + } +#endif +#endif +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39::io_read(Cyg_IORB * iorb) +{ + volatile cyg_uint16 * sdisr = CYG_DEVICE_SERIAL_RS232_TX39_SDISR; + const cyg_vector vector = CYG_DEVICE_SERIAL_RS232_TX39_VEC; + + iorb->xferred_length = 0; + iorb->next = NULL; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT +#ifdef CYG_DEVICE_SERIAL_RS232_READ_BUFFERS_LL + /* + * If more iorbs are be queued than the queuet can handle then + * a separate link list needs to hold the extra. Since the DSR + * does the dequeueing from the link list we have to enqueue + * with the scheduler disabled. + * + * Note: To prevent lots of scheduler locks and unlocks we check + * the queue while the scheduler is unlocked, and only if it is + * full do we lock the scheduler and verify that the queue is + * still full. It is possible that between the check and the lock + * that the DSR could run and make some space in the queue. + * + * Note: We cannot have any iorbs on the ll if the queue is not full. + * + * Note: We cannot have a full queue and also be in polled mode. + * This is why we return after placing the iorb on the ll if the + * queue is full, as there is nothing else to do. + */ + if (read_buffers.min_free() == 0) { + + Cyg_Scheduler::lock(); + + // Check again with the scheduler locked + if (read_buffers.min_free() == 0) { + if (read_buffers_ll_first) { + read_buffers_ll_last->next = iorb; + } else { + read_buffers_ll_first = iorb; + } + read_buffers_ll_last = iorb; + Cyg_Scheduler::unlock(); + return 0; + } + Cyg_Scheduler::unlock(); + } + +#endif + + read_buffers.enqueue(iorb); + + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + /* We may have to enable CTR here to tell the other side to start + * sending characters --proven 19980513 */ + return 0; + } +#else + read_buffer = iorb; +#endif + +#ifndef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + /* + * Special nonblocking mode for polled only drivers. + * This is so BSPs and other non kernel things can poll for each char. + * individually. Use only if read modes don't otherwise solve the problem. + */ + if (CYG_IORB_NOBLOCK == iorb->opcode) { + if ((*sdisr & 0x0001) != 0x0001) { + read_isr(vector, (CYG_ADDRWORD)this); + } + return 0; + } +#endif + + do { + do { + while ((*sdisr & 0x0001) != 0x0001) continue; + } while (read_isr(vector, (CYG_ADDRWORD)this) == Cyg_Interrupt::HANDLED); +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + read_dsr(vector, 0, (CYG_ADDRWORD)this); +#else + + // Make a callback, even in poll-mode. + + // This should really be done in read_dsr, but this requires + // the iorb to be passed along as an argument (or in + // read_buffer) which a) isn't pretty, b) would require other + // callers of read_dsr to know that fact. The read_dsr would + // extract the iorb and do the below. This fix seemed cleaner + // given that it is a short term solution anyway. -jskov + + if (iorb->callback) + iorb->callback(iorb); + +#endif + } while (read_buffer); + return 0; +} + +// ------------------------------------------------------------------------ +// set_write_mode() +// Set the write mode (CRNL translation) +// Currently there are only two modes (BINARY and ASCII) + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: +set_write_mode(cyg_uint32 new_mode) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + write_mode = new_mode; +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +#endif + +// ------------------------------------------------------------------------ +// write_isr() +// + +cyg_uint32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: + write_isr(cyg_vector vector, CYG_ADDRWORD isr_data) +{ + CYG_CLASS_DEVICE_SERIAL_RS232_TX39 * data = (CYG_CLASS_DEVICE_SERIAL_RS232_TX39 *)isr_data; + volatile cyg_uint16 * sdisr = CYG_DEVICE_SERIAL_RS232_TX39_SDISR; + volatile cyg_uint8 * tfifo = CYG_DEVICE_SERIAL_RS232_TX39_TFIFO; + cyg_uint32 off, ret; + cyg_uint8 ch; + + // Default return value + ret = Cyg_Interrupt::HANDLED; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + // Clear interrupts regaurdless of kmode + // data->write_interrupt.acknowledge_interrupt(vector); + + while ((data->write_buffer == NULL) || + (data->write_buffer->xferred_length == data->write_buffer->buffer_length)) { + data->write_buffer = data->write_buffers.get_next_inuse(data->write_buffer); + ret = Cyg_Interrupt::CALL_DSR; + if (data->write_buffer == NULL) { + volatile cyg_uint16 sdicr_v; + volatile cyg_uint16* sdicr = CYG_DEVICE_SERIAL_RS232_TX39_SDICR; + + /* Turn off write interrupts */ + sdicr_v = *sdicr & ~0x0002; + *sdicr = sdicr_v; + *sdisr = 0x0000; + return ret; + } + } +#else + if (data->write_buffer->xferred_length == data->write_buffer->buffer_length) { + ret = Cyg_Interrupt::CALL_DSR; + data->write_buffer = NULL; + return ret; + } +#endif + + off = data->write_buffer->xferred_length++; + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_MODES + if (data->write_mode) { + // This is for cr to cr/lf conversion + if ((ch = data->write_char)) { + data->write_char = '\0'; + } else { + if ((*((char *)data->write_buffer->buffer + off)) != '\n') { + ch = *((char *)data->write_buffer->buffer + off); + } else { + // Decrement so next pass will DTRT + data->write_buffer->xferred_length--; + data->write_char = '\n'; + ch = '\r'; + } + } + } else +#endif + ch = *((char *)data->write_buffer->buffer + off); + + *sdisr = 0x0000; + *tfifo = ch; + + // Do not modify any data structure after the data is written because + // it is possible an interrupt will call this routine before this + // invocation of this routine executes any code beyond this point. + return ret; +} + +void +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: + write_dsr(cyg_vector vector, cyg_ucount32 dsr_count, CYG_ADDRWORD dsr_data) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + CYG_CLASS_DEVICE_SERIAL_RS232_TX39 * data = + (CYG_CLASS_DEVICE_SERIAL_RS232_TX39 *)dsr_data; + cyg_ucount32 count, i; + Cyg_IORB * iorb; + + /* + * Note: Interrupts are not disabled but if the isr causes another + * buffer to become done since the start of this call then + * dsr_write() will be called again to handle that buffer. + */ + + for (i = 0, count = data->write_buffers.min_done(); i < count; i++) { + iorb = data->write_buffers.dequeue(); + if (iorb->callback) + iorb->callback(iorb); + } + +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + // Enqueue as many iorbs as we dequeued + for (i = 0; i < count; i++) { + if ((iorb = data->write_buffers_ll_first)) { + data->write_buffers_ll_first = iorb->next; + data->write_buffers.enqueue (iorb); + iorb->next = NULL; + } else { + break; + } + } +#endif +#endif + +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39::io_write(Cyg_IORB * iorb) +{ + volatile cyg_uint16 * sdisr = CYG_DEVICE_SERIAL_RS232_TX39_SDISR; + const cyg_vector vector = CYG_DEVICE_SERIAL_RS232_TX39_VEC; + + iorb->xferred_length = 0; + iorb->next = NULL; + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT +#ifdef CYG_DEVICE_SERIAL_RS232_WRITE_BUFFERS_LL + /* + * If more iorbs are be queued than the queuet can handle then + * a separate link list needs to hold the extra. Since the DSR + * does the dequeueing from the link list we have to enqueue + * with the scheduler disabled. + * + * Note: To prevent lots of scheduler locks and unlocks we check + * the queue while the scheduler is unlocked, and only if it is + * full do we lock the scheduler and verify that the queue is + * still full. It is possible that between the check and the lock + * that the DSR could run and make some space in the queue. + * + * Note: We cannot have any iorbs on the ll if the queue is not full. + * + * Note: We cannot have a full queue and also be in polled mode. + * This is why we return after placing the iorb on the ll if the + * queue is full, as there is nothing else to do. + */ + if (write_buffers.min_free() == 0) { + + Cyg_Scheduler::lock(); + + // Check again with the scheduler locked + if (write_buffers.min_free() == 0) { + if (write_buffers_ll_first) { + write_buffers_ll_last->next = iorb; + } else { + write_buffers_ll_first = iorb; + } + write_buffers_ll_last = iorb; + Cyg_Scheduler::unlock(); + return 0; + } + Cyg_Scheduler::unlock(); + } + +#endif + + write_buffers.enqueue (iorb); + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + if (write_buffer == NULL) { + volatile cyg_uint16 sdicr_v; + volatile cyg_uint16* sdicr = CYG_DEVICE_SERIAL_RS232_TX39_SDICR; + + +// Must check that iorb isn't already done --proven 19980516 +// if (iorb->length && (iorb->ret_length == 0)) + /* Prime serial write interrupts with first byte */ +// while ((*sdisr & 0x0002) != 0x0002) continue; +// write_isr (vector, (CYG_ADDRWORD)this); + sdicr_v = *sdicr | 0x0002; + *sdicr = sdicr_v; + + } + return 0; + } +#else + write_buffer = iorb; +#endif + + do { + do { + while ((*sdisr & 0x0002) != 0x0002) continue; + } while (write_isr(vector, (CYG_ADDRWORD)this) == Cyg_Interrupt::HANDLED); +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + write_dsr (vector, 0, (CYG_ADDRWORD)this); +#else + + // Make a callback, even in poll-mode. + + // This should really be done in write_dsr, but this requires + // the iorb to be passed along as an argument (or in + // read_buffer) which a) isn't pretty, b) would require other + // callers of write_dsr to know that fact. The write_dsr would + // extract the iorb and do the below. This fix seemed cleaner + // given that it is a short term solution anyway. -jskov + + if (iorb->callback) + iorb->callback(iorb); + +#endif + } while (write_buffer); + return 0; +} + +// ------------------------------------------------------------------------ +// Multiplexor ISR and DSR routines. + +#if defined(CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) \ + && defined (CYG_DEVICE_SERIAL_RS232_ONE_VECTOR) +cyg_uint32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: + both_isr(cyg_vector vector, CYG_ADDRWORD isr_data) +{ + volatile cyg_uint16 sdisr_v, * sdisr = CYG_DEVICE_SERIAL_RS232_TX39_SDISR; + cyg_uint32 read_ret, write_ret, ret; + + // Read status + sdisr_v = *sdisr; + + // Default return value + ret = Cyg_Interrupt::HANDLED; + read_ret = Cyg_Interrupt::HANDLED; + write_ret = Cyg_Interrupt::HANDLED; + + // Clear interrupts regaurdless of kmode + // data->both_interrupt.acknowledge_interrupt(vector); + + if (sdisr_v & 0x0001) { + read_ret = CYG_CLASS_DEVICE_SERIAL_RS232_TX39::read_isr(vector, isr_data); + } + if (sdisr_v & 0x0002) { + write_ret = CYG_CLASS_DEVICE_SERIAL_RS232_TX39::write_isr(vector, isr_data); + } + + if ((read_ret == Cyg_Interrupt::CALL_DSR) || + (write_ret == Cyg_Interrupt::CALL_DSR)) + ret = Cyg_Interrupt::CALL_DSR; + *sdisr = 0x0000; + return ret; +} + +void +CYG_CLASS_DEVICE_SERIAL_RS232_TX39:: + both_dsr(cyg_vector vector, cyg_ucount32 dsr_count, CYG_ADDRWORD dsr_data) +{ + CYG_CLASS_DEVICE_SERIAL_RS232_TX39::read_dsr(vector, 0, dsr_data); + CYG_CLASS_DEVICE_SERIAL_RS232_TX39::write_dsr(vector, 0, dsr_data); +} +#endif + +// ------------------------------------------------------------------------ +// Asynchronous versions are only configured with the +// interrupt version is configured +// +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39::io_read_asynchronous(Cyg_IORB * iorb) +{ + // Do we want to configure an error condition for this? --proven 19980506 + CYG_ASSERT (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT, + "Cannot do an io_read_asynchronous while in polled mode" ); + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + this->io_read (iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; + +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39::io_write_asynchronous(Cyg_IORB * iorb) +{ + // Do we want to configure an error condition for this? --proven 19980506 + CYG_ASSERT (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT, + "Cannot do an io_write_asynchronous while in polled mode" ); + +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif + this->io_write (iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} +#endif + +// ------------------------------------------------------------------------ +// Blocking versions just call the internal version with a callback. +// + +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT +static void +callback(Cyg_IORB *iorb) +{ + Cyg_Binary_Semaphore * data = (Cyg_Binary_Semaphore *)iorb->callback_data; + data->post(); +} +#endif + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39::io_read_blocking(Cyg_IORB * iorb) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + Cyg_Binary_Semaphore read(0); + + // We need a callback routine to wake us up + iorb->callback_data = (CYG_ADDRESS)&read; + iorb->callback = callback; + this->io_read(iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + read.wait(); + return 0; + } else +#endif + { + iorb->callback = NULL; + this->io_read(iorb); + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39::io_write_blocking(Cyg_IORB * iorb) +{ +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.lock(); +#endif +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + Cyg_Binary_Semaphore write(0); + + // We need a callback routine to wake us up + iorb->callback_data = (CYG_ADDRESS)&write; + iorb->callback = callback; + this->io_write(iorb); +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + write.wait(); + return 0; + } else +#endif + { + iorb->callback = NULL; + this->io_write(iorb); + } +#ifdef CYG_DEVICE_SERIAL_RS232_MUTEX + mutex.unlock(); +#endif + return 0; +} + +// Internal routine needed to flush writes in a blocking manner. +void +CYG_CLASS_DEVICE_SERIAL_RS232_TX39::io_write_flush(void) +{ + Cyg_IORB iorb; + + iorb.buffer_length = 0; +#ifdef CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT + if (kmode == CYG_DEVICE_SERIAL_RS232_KMODE_INTERRUPT) { + Cyg_Binary_Semaphore write(0); + + // We need a callback routine to wake us up + iorb.callback_data = (CYG_ADDRESS)&write; + iorb.callback = callback; + this->io_write(&iorb); + write.wait(); + } else +#endif + { + iorb.callback = NULL; + this->io_write(&iorb); + } +} + +// ------------------------------------------------------------------------ +// Assert versions. These versions bypass most of the driver code. +// These are to be used by the BSP or asserts. Only use them once +// start_sync() is called and when done normal operations is +// restarted with the end_sync() mode. +// +// Note DO NOT DO LOCKING IN THIS ROUTINE!!! +// + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_KMODE_ASSERT +cyg_int32 +CYG_CLASS_DEVICE_SERIAL_RS232_TX39::io_write_assert(Cyg_IORB * iorb) +{ + volatile cyg_uint16 sdisr_v, * sdisr = CYG_DEVICE_SERIAL_RS232_TX39_SDISR; + volatile cyg_uint8 ch, * tfifo = CYG_DEVICE_SERIAL_RS232_TX39_TFIFO; + + iorb->xferred_length = 0; + while (iorb->xferred_length < iorb->buffer_length) { + if ((ch = (*((char*)iorb->buffer + iorb->xferred_length++))) == '\n') { + while (((sdisr_v = *sdisr) & 0x0002) != 0x0002) continue; + *sdisr = (sdisr_v & ~0x0002); + *tfifo = '\r'; + } + while (((sdisr_v = *sdisr) & 0x0002) != 0x0002) continue; + *sdisr = (sdisr_v & ~0x0002); + *tfifo = ch; + } + return 0; +} + +#endif // #ifdef CYG_DEVICE_SERIAL_RS232_TX39_KMODE_ASSERT + +#endif // #ifdef CYGPKG_DEVICES_SERIAL_RS232_TX39 +// EOF serial_tx39.cxx diff --git a/packages/devs/serial/rs232/tx39/current/tests/PKGconf.mak b/packages/devs/serial/rs232/tx39/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/tx39/current/tests/PKGconf.mak @@ -0,0 +1,39 @@ +#=============================================================================== +# +# makefile +# +# devs/serial/rs232/tx39/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_serial_rs232_tx39 +include ../../../../../../pkgconf/pkgconf.mak + +TESTS := tx39_serial_test + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + + diff --git a/packages/devs/serial/rs232/tx39/current/tests/tx39_serial_test.cxx b/packages/devs/serial/rs232/tx39/current/tests/tx39_serial_test.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/serial/rs232/tx39/current/tests/tx39_serial_test.cxx @@ -0,0 +1,143 @@ +//================================================================= +// +// tx39_serial_test.cxx +// +// Test that the device API for the tx39 device exists. +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// October 31, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): proven +// Contributors: proven +// Date: 1998-10-08 +// Description: Tests basic serial functionality. +//####DESCRIPTIONEND#### + +// #include +#include // For now include all the devices + +#include // Generic test macros + +#ifdef CYG_DEVICE_SERIAL_RS232_TX39_NAME +#define CYG_DEVICE_SERIAL_RS232_NAME CYG_DEVICE_SERIAL_RS232_TX39_NAME + +#define NTHREADS 1 +#include // All the kernel specific stuff +#include + +// #define CYG_DEVICE_INTERNAL +// #include +// #include + +char message1[] = "This is test message 1.\n"; +char message2[] = "This is test message 2.\n"; + +/* Only call routines that do not require user input */ +void entry0(CYG_ADDRWORD data) +{ + Cyg_IORB iorb1, iorb2; + cyg_int32 baud_rate, i; + + iorb1.callback = NULL; + iorb1.buffer = message1; + iorb1.buffer_length = sizeof(message1) - 1; + CYG_DEVICE_SERIAL_RS232_NAME.io_write_asynchronous(&iorb1); + + iorb2.buffer = message2; + iorb2.buffer_length = sizeof(message2) - 1; + CYG_DEVICE_SERIAL_RS232_NAME.io_write_blocking(&iorb2); + + for (i = 0; i < 1000000; i++); // Delay to flush the tx buffer + + if ((baud_rate = CYG_DEVICE_SERIAL_RS232_NAME.get_baud_rate()) >= 0) { + CYG_TEST_PASS_FAIL( + (CYG_DEVICE_SERIAL_RS232_NAME.set_baud_rate(baud_rate) >= 0), + "Setting baud rate to previous baud rate."); + } else { + CYG_TEST_FAIL("Could not get baud rate."); + } + + CYG_TEST_PASS_EXIT("serial_test"); +} + +/* Make calls to the rest of the API */ +void entry_bogus(CYG_ADDRWORD data) +{ + Cyg_IORB iorb; + char buf[1024]; + iorb.buffer = buf; + iorb.buffer_length = sizeof(buf); + + // Set mode to interrupt + CYG_DEVICE_SERIAL_RS232_NAME.set_kmode((cyg_uint32)1); + // CYG_DEVICE_SERIAL_RS232_NAME.get_kmode(); // Doesn't exist yet + + // These could go in the entry0 routine + CYG_DEVICE_SERIAL_RS232_NAME.get_line_mode(); + CYG_DEVICE_SERIAL_RS232_NAME.set_line_mode(1); + + CYG_DEVICE_SERIAL_RS232_NAME.get_baud_rate(); + CYG_DEVICE_SERIAL_RS232_NAME.set_baud_rate(1); + + CYG_DEVICE_SERIAL_RS232_NAME.set_read_mode(1); + // CYG_DEVICE_SERIAL_RS232_NAME.get_read_mode(); // Doesn't exist yet + // CYG_DEVICE_SERIAL_RS232_NAME.set_read_data(1, NULL, 0); + CYG_DEVICE_SERIAL_RS232_NAME.io_read_asynchronous(&iorb); + CYG_DEVICE_SERIAL_RS232_NAME.io_read_blocking(&iorb); + // CYG_DEVICE_SERIAL_RS232_NAME.io_read_cancel(&iorb);// Doesn't exist yet + + CYG_DEVICE_SERIAL_RS232_NAME.set_write_mode(1); + // CYG_DEVICE_SERIAL_RS232_NAME.get_write_mode(); // Doesn't exist yet + CYG_DEVICE_SERIAL_RS232_NAME.io_write_asynchronous(&iorb); + CYG_DEVICE_SERIAL_RS232_NAME.io_write_blocking(&iorb); + // CYG_DEVICE_SERIAL_RS232_NAME.io_write_cancel(&iorb);// Doesn't exist yet +} + +externC void +cyg_start(void) +{ + CYG_TEST_INIT(); + + new_thread(entry0, 0); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_EXIT("Not reached"); + + entry_bogus(0); // To prevent selective linking from GC all the bogus calls. +} + +#else // CYG_DEVICE_SERIAL_RS232_TX39_NAME + +externC void +cyg_start(void) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_EXIT("N/A: required serial device not present"); +} + +#endif // CYG_DEVICE_SERIAL_RS232_TX39_NAME + +// EOF tx39_serial_tests.cxx diff --git a/packages/devs/wallclock/current/ChangeLog b/packages/devs/wallclock/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/devs/wallclock/current/ChangeLog @@ -0,0 +1,77 @@ +1998-10-23 Jesper Skov + + * tests/wallclock.cxx: Reduce test time on TX39 SIM. + +Tue Oct 20 15:54:09 1998 Jonathan Larmour + + * src/PKGconf.mak: + Remove unnecessary override of PKGCONF_CXXFLAGS + +1998-09-26 Bart Veer + + * include/pkgconf/wallclock.h: + PR17501: When using the emulation there is a requirement on the + kernel clock. This has been added to the configuration data. + If real hardware were used then this dependency would disappear, + but currently there is no easy way to express this, and there are + no hardware implementations. + +1998-09-12 Bart Veer + + * include/pkgconf/wallclock.h: + Added missing descriptions (PR 17184) + +1998-09-02 Bart Veer + + * include/pkgconf/wallclock.h: + Added minimal configuration data. + +Fri Aug 28 09:40:19 1998 Jonathan Larmour + + * tests/wallclock.cxx: + Rename int main(argc, argv) to void cyg_start( void ) under the + new entry point system. Therefore also remove return code. + +Tue Aug 18 16:49:20 1998 Jonathan Larmour + + * tests/wallclock.cxx: + Move inclusion of thread.inl before sched.hxx to prevent inline + warnings + +1998-07-31 Nick Garnett + + * include/pkgconf/wallclock.h: + Added this file to contain wallclock confiuration parameters. + + * src/emulate.cxx: + Now uses pkgconf/wallclock.h for configuration. + +Wed Jul 22 21:04:15 1998 Jonathan Larmour + + * src/emulate.cxx: + Remove unnecessary include of and remove an + unused variable (result) from get_current_time() + +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### + + diff --git a/packages/devs/wallclock/current/include/pkgconf/wallclock.h b/packages/devs/wallclock/current/include/pkgconf/wallclock.h new file mode 100644 --- /dev/null +++ b/packages/devs/wallclock/current/include/pkgconf/wallclock.h @@ -0,0 +1,73 @@ +#ifndef CYGONCE_PKGCONF_WALLCLOCK_H +#define CYGONCE_PKGCONF_WALLCLOCK_H +// ==================================================================== +// +// pkgconf/wallclock.h +// +// Wallclock configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-07-29 +// Purpose: To allow the user to edit wallclock config options. +// Description: +//####DESCRIPTIONEND#### +// +// ==================================================================== + +#include // kernel configuration file + +/* ---------------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_DEVICES_WALLCLOCK { + display "Wallclock device" + parent CYGPKG_DEVICES + requires CYGVAR_KERNEL_COUNTERS_CLOCK + description " + The wallclock device provides real time stamps, as opposed + to the eCos kernel timers which typically just count the + number of clock ticks since the hardware was powered up. + Depending on the target platform this device may involve + interacting with a suitable clock chip, or it may be + emulated by using the kernel timers. + " + } + + }}CFG_DATA */ + +/* --------------------------------------------------------------------- + * Decide whether we are using the emulated wallclock or a hardware + * supplied device. + */ + +#define CYGIMP_WALLCLOCK_EMULATE + +/* -------------------------------------------------------------------- */ +#endif /* CYGONCE_PKGCONF_WALLCLOCK_H */ +/* EOF wallclock.h */ diff --git a/packages/devs/wallclock/current/include/wallclock.hxx b/packages/devs/wallclock/current/include/wallclock.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/wallclock/current/include/wallclock.hxx @@ -0,0 +1,79 @@ +#ifndef CYGONCE_DEVS_WALLCLOCK_HXX +#define CYGONCE_DEVS_WALLCLOCK_HXX + +//========================================================================== +// +// wallclock.hxx +// +// Wallclock interface declaration +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-07-14 +// Purpose: Wall Clock declarations +// Description: This file defines the interface to the wall clock device +// that provides real time stamps. This is either an interface +// to a hardware RTC like the Dallas DS12887, or it is emulated +// using the kernel clock. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros + +// ------------------------------------------------------------------------- +// Wallclock class + +class Cyg_WallClock +{ + +public: + + Cyg_WallClock(); + + // Returns the current timestamp. This may involve reading the + // hardware, so it may take anything up to a second to complete. + cyg_uint32 get_current_time(); + + // Sets the value of the timestamp relative to now. This may involve + // writing to the hardware, so it may take anything up to a second to + // complete. + void set_current_time( cyg_uint32 time_stamp ); + + // A static pointer to the single system defined wall clock device. + static Cyg_WallClock *wallclock; + +}; + +// ------------------------------------------------------------------------- + +#endif // ifndef CYGONCE_DEVS_WALLCLOCK_HXX +// EOF wallclock.hxx diff --git a/packages/devs/wallclock/current/src/PKGconf.mak b/packages/devs/wallclock/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/wallclock/current/src/PKGconf.mak @@ -0,0 +1,41 @@ +#=============================================================================== +# +# makefile +# +# devs/wallclock/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_wallclock +include ../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := emulate.cxx +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/devs/wallclock/current/src/emulate.cxx b/packages/devs/wallclock/current/src/emulate.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/wallclock/current/src/emulate.cxx @@ -0,0 +1,113 @@ +//========================================================================== +// +// devs/wallclock/emulate.cxx +// +// Wallclock emulation implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-07-14 +// Purpose: Wallclock emulation +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // Wallclock device config + +#include // Common type definitions and support +#include // HAL diagnostic output + +#include + +#include +#include + +#include + +#ifdef CYGIMP_WALLCLOCK_EMULATE + +/*---------------------------------------------------------------------------*/ +// Local static variables + +static Cyg_WallClock wallclock_instance CYG_INIT_PRIORITY( CLOCK ); + +static cyg_tick_count epoch_ticks; + +static cyg_uint32 epoch_time_stamp; + +Cyg_WallClock *Cyg_WallClock::wallclock; + +/*---------------------------------------------------------------------------*/ +// Constructor + +Cyg_WallClock::Cyg_WallClock() +{ + // install instance pointer + wallclock = &wallclock_instance; +} + +/*---------------------------------------------------------------------------*/ +// Returns the current timestamp. This may involve reading the +// hardware, so it may take anything up to a second to complete. + +cyg_uint32 Cyg_WallClock::get_current_time() +{ + Cyg_Clock::cyg_resolution res = Cyg_Clock::real_time_clock->get_resolution(); + + Cyg_Scheduler::lock(); + + cyg_tick_count diff = Cyg_Clock::real_time_clock->current_value() + - epoch_ticks; + + diff = ( diff * res.dividend ) / ( res.divisor * 1000000000LL ) ; + + Cyg_Scheduler::unlock(); + + return epoch_time_stamp + diff; +} + +/*---------------------------------------------------------------------------*/ +// Sets the value of the timestamp relative to now. This may involve +// writing to the hardware, so it may take anything up to a second to +// complete. +void Cyg_WallClock::set_current_time( cyg_uint32 time_stamp ) +{ + Cyg_Scheduler::lock(); + + epoch_time_stamp = time_stamp; + epoch_ticks = Cyg_Clock::real_time_clock->current_value(); + + Cyg_Scheduler::unlock(); +} + +/*---------------------------------------------------------------------------*/ + +#endif +/*---------------------------------------------------------------------------*/ +/* End of devs/wallclock/emulate.cxx */ diff --git a/packages/devs/wallclock/current/tests/PKGconf.mak b/packages/devs/wallclock/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/wallclock/current/tests/PKGconf.mak @@ -0,0 +1,39 @@ +#=============================================================================== +# +# makefile +# +# devs/wallclock/current/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_wallclock +include ../../../../pkgconf/pkgconf.mak + +TESTS := wallclock + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + + diff --git a/packages/devs/wallclock/current/tests/wallclock.cxx b/packages/devs/wallclock/current/tests/wallclock.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/wallclock/current/tests/wallclock.cxx @@ -0,0 +1,135 @@ +//========================================================================== +// +// wallclock.cxx +// +// WallClock test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-07-20 +// Description: Tests the Kernel Wall Clock +// This test exercises the WallClock class and checks that it +// keeps time correctly. +//####DESCRIPTIONEND#### +// ------------------------------------------------------------------------- + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include + +// ------------------------------------------------------------------------- +// Data for the test + +#define STACKSIZE (2*1024) // size of thread stack + +char thread_stack[STACKSIZE]; + +inline void *operator new(size_t size, void *ptr) { return ptr; }; + +// array of threads. +char thread[sizeof(Cyg_Thread)]; + +Cyg_Thread *th; + +#define EPOCH 900000000U + +#if defined(CYG_HAL_MIPS_SIM) +// Reduce time in simulated TX39 so that it runs within the timeout. +#define LOOPS 3 +#else +#define LOOPS 30 +#endif + +cyg_tick_count one_sec; + +// ------------------------------------------------------------------------- +// Thread body + + +void wallclock_thread( CYG_ADDRWORD id ) +{ + cyg_uint32 wtime; + + Cyg_WallClock::wallclock->set_current_time( EPOCH ); + + for( int i = 0; i < LOOPS; i++ ) + { + wtime = Cyg_WallClock::wallclock->get_current_time(); + + if(wtime != EPOCH+i) + { + CYG_TEST_FAIL_FINISH( "Clock out of sync" ); + } + + th->delay( one_sec ); + } + + CYG_TEST_PASS_FINISH("Wallclock OK"); + +} + +// ------------------------------------------------------------------------- + + +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + + Cyg_Clock::cyg_resolution res = Cyg_Clock::real_time_clock->get_resolution(); + + one_sec = ( res.divisor * 1000000000LL ) / res.dividend ; + + th = new((void *)&thread) Cyg_Thread(wallclock_thread, + 0, + STACKSIZE, + (CYG_ADDRESS)thread_stack + ); + + th->resume(); + + // Get the world going + Cyg_Scheduler::scheduler.start(); + +} + +// ------------------------------------------------------------------------- +// EOF wallclock.cxx diff --git a/packages/devs/watchdog/current/ChangeLog b/packages/devs/watchdog/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/current/ChangeLog @@ -0,0 +1,104 @@ +1998-10-23 Jesper Skov + + * tests/watchdog.cxx (cyg_start): Reduce test time on TX39 SIM. + + * include/pkgconf/watchdog.h: Use emulatation code for MN10300 + SIM. + +Tue Oct 20 15:52:46 1998 Jonathan Larmour + + * src/mn10300.cxx: + Include so that we get CYGIMP_WATCHDOG_EMULATE + defined appropriately + + * src/PKGconf.mak: + Remove unnecessary override of PKGCONF_CXXFLAGS + +1998-09-26 Bart Veer + + * include/pkgconf/watchdog.h: + PR17501: When using the emulation there is a requirement on the + kernel clock. This has been added to the configuration data. The + mn10300 hardware implementation does not have this requirement, + but there is no easy way to express this at present. + +1998-09-12 Bart Veer + + * include/pkgconf/watchdog.h: + Added missing descriptions (PR 17184) + +1998-09-02 Bart Veer + + * include/pkgconf/watchdog.h: + Added minimal configuration data. + +1998-09-01 Nick Garnett + + * src/mn10300.cxx: + Added include for , for scheduler lock and + unlock functions. + + * src/PKGconf.mak: + Added mn10300.cxx to COMPILE for mn10300. + + * include/pkgconf/watchdog.h: + Default to using real hardware on MN10300. + +Fri Aug 28 09:42:26 1998 Jonathan Larmour + + * tests/watchdog.cxx: + Rename int main(argc, argv) to void cyg_start( void ) under the + new entry point system. Therefore also remove return code. + +Tue Aug 18 16:51:24 1998 Jonathan Larmour + + * tests/watchdog.cxx: + Move inclusion of thread.inl to before sched.hxx to prevent inline + warnings + +1998-08-14 Nick Garnett + + * src/emulate.cxx: + Added include for cyg/kernel/sched.inl. + +1998-07-31 Nick Garnett + + * src/PKGconf.mak: + Added mn10300.cxx to COMPILE list. + + * src/mn10300.cxx: + Completed implementation using MN10300 watchdog timer. + + * include/watchdog.hxx: + Renamed 'register' functions to 'install'. Added install() and + uninstall() to Cyg_Watchdog_Action class. + + * include/pkgconf/watchdog.h: + Added this file to contain watchdog config options. + +1998-07-29 Nick Garnett + + * include/watchdog.hxx, src/emulate.cxx: + Created initial versions of watchdog device. + +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### diff --git a/packages/devs/watchdog/current/include/pkgconf/watchdog.h b/packages/devs/watchdog/current/include/pkgconf/watchdog.h new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/current/include/pkgconf/watchdog.h @@ -0,0 +1,82 @@ +#ifndef CYGONCE_PKGCONF_WATCHDOG_H +#define CYGONCE_PKGCONF_WATCHDOG_H +// ==================================================================== +// +// pkgconf/watchdog.h +// +// Watchdog configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-07-29 +// Purpose: To allow the user to edit watchdog config options. +// Description: +//####DESCRIPTIONEND#### +// +// ==================================================================== + +#include // kernel configuration file + +/* ---------------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_DEVICES_WATCHDOG { + display "Watchdog device" + parent CYGPKG_DEVICES + requires CYGVAR_KERNEL_COUNTERS_CLOCK + description " + The watchdog device allows applications to make use of a + timer facility. First the application should register an + action routine with the watchdog device, and start the + watchdog running. After this the application must call a + watchdog reset function at regular intervals, or else the + device will cause the installed action routine to be + invoked. The assumption is that the watchdog timer should + never trigger unless there has been a serious fault in + either the hardware or the software, and the application's + action routine should perform an appropriate reset + operation." + } + + }}CFG_DATA */ + +/* --------------------------------------------------------------------- + * Decide whether we are using the emulated watchdog or a hardware + * supplied device. + */ + + +#define CYGIMP_WATCHDOG_EMULATE + +#if defined(CYG_HAL_MN10300_MN103002) && !defined(CYGPKG_HAL_MN10300_SIM) +#undef CYGIMP_WATCHDOG_EMULATE +#endif + +/* -------------------------------------------------------------------- */ +#endif /* CYGONCE_PKGCONF_WATCHDOG_H */ +/* EOF watchdog.h */ diff --git a/packages/devs/watchdog/current/include/watchdog.hxx b/packages/devs/watchdog/current/include/watchdog.hxx new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/current/include/watchdog.hxx @@ -0,0 +1,145 @@ +#ifndef CYGONCE_DEVS_WATCHDOG_HXX +#define CYGONCE_DEVS_WATCHDOG_HXX + +//========================================================================== +// +// watchdog.hxx +// +// Watchdog interface declaration +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-07-14 +// Purpose: Watchdog declarations +// Description: This file defines the interface to the watchdog device +// that provides timer based recovery from software and +// hardware faults. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros + + +class Cyg_Watchdog_Action; + +// ------------------------------------------------------------------------- +// Watchdog class + +class Cyg_Watchdog +{ + + Cyg_Watchdog_Action *action_list; + +public: + + Cyg_Watchdog(); + + // Start the watchdog running. + void start(); + + // Reset watchdog timer. This needs to be called regularly to prevent + // the watchdog firing. + void reset(); + + // Trigger the watchdog as if the timer had expired. + void trigger(); + + // Register an action routine that will be called when the timer + // triggers. + void install_action( Cyg_Watchdog_Action *wdaction ); + + // Deregister a previously registered action routine. + void uninstall_action( Cyg_Watchdog_Action *wdaction ); + + // A static instance of the single system defined watchdog device. + static Cyg_Watchdog watchdog; + +}; + +// ------------------------------------------------------------------------- +// Watchdog action class + +class Cyg_Watchdog_Action +{ + friend class Cyg_Watchdog; + + Cyg_Watchdog_Action *next; // link in chain + + void (*action)( CYG_ADDRWORD data ); // action function + + CYG_ADDRWORD data; // data argument + +public: + + Cyg_Watchdog_Action( + void (*action)( CYG_ADDRWORD data ), + CYG_ADDRWORD data + ); + + ~Cyg_Watchdog_Action(); + + void install(); + + void uninstall(); +}; + +// ------------------------------------------------------------------------- +// Cyg_Watchdog_Action inlines + +inline Cyg_Watchdog_Action::Cyg_Watchdog_Action( + void (*action_arg)( CYG_ADDRWORD data ), + CYG_ADDRWORD data_arg + ) +{ + next = NULL; + action = action_arg; + data = data_arg; +} + +inline Cyg_Watchdog_Action::~Cyg_Watchdog_Action() +{ + Cyg_Watchdog::watchdog.uninstall_action( this ); +} + +inline void Cyg_Watchdog_Action::install() +{ + Cyg_Watchdog::watchdog.install_action( this ); +} + +inline void Cyg_Watchdog_Action::uninstall() +{ + Cyg_Watchdog::watchdog.uninstall_action( this ); +} + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_DEVS_WATCHDOG_HXX +// EOF watchdog.hxx diff --git a/packages/devs/watchdog/current/src/PKGconf.mak b/packages/devs/watchdog/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/current/src/PKGconf.mak @@ -0,0 +1,42 @@ +#=============================================================================== +# +# makefile +# +# devs/watchdog/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_watchdog +include ../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := emulate.cxx +COMPILE := $(COMPILE) mn10300.cxx +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/devs/watchdog/current/src/emulate.cxx b/packages/devs/watchdog/current/src/emulate.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/current/src/emulate.cxx @@ -0,0 +1,211 @@ +//========================================================================== +// +// watchdog/emulate.cxx +// +// Watchdog implementation emulation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-07-29 +// Purpose: Watchdog class implementation +// Description: Contains an implementation of the Watchdog class for use +// when there is no hardware watchdog timer. Instead it is +// emulated using an Alarm object. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // watchdog configuration file + +#ifdef CYGIMP_WATCHDOG_EMULATE + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // clock and alarm +#include // scheduler + +#include // my header + +#include // scheduler inlines + +// ------------------------------------------------------------------------- +// Forward definitions + +static cyg_alarm_fn watchdog_alarm; + +// ------------------------------------------------------------------------- +// Statics + +// A static pointer to the single system defined watchdog device. +Cyg_Watchdog Cyg_Watchdog::watchdog; + +static Cyg_Alarm alarm( Cyg_Clock::real_time_clock, watchdog_alarm, 0 ); + +// One second's worth of ticks. +static cyg_tick_count one_sec; + +// ------------------------------------------------------------------------- +// Constructor + +Cyg_Watchdog::Cyg_Watchdog() +{ + CYG_REPORT_FUNCTION(); + + action_list = 0; + + Cyg_Clock::cyg_resolution res = Cyg_Clock::real_time_clock->get_resolution(); + + one_sec = ( res.divisor * 1000000000LL ) / res.dividend ; + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Start the watchdog running. + +void Cyg_Watchdog::start() +{ + CYG_REPORT_FUNCTION(); + + Cyg_Clock::cyg_resolution res = Cyg_Clock::real_time_clock->get_resolution(); + + // Set alarm to a one second single-shot trigger + alarm.initialize( Cyg_Clock::real_time_clock->current_value() + one_sec, 0 ); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Reset watchdog timer. This needs to be called regularly to prevent +// the watchdog firing. + +void Cyg_Watchdog::reset() +{ + CYG_REPORT_FUNCTION(); + + Cyg_Clock::cyg_resolution res = Cyg_Clock::real_time_clock->get_resolution(); + + Cyg_Scheduler::lock(); + + // Set alarm to a one second single-shot trigger + alarm.initialize( Cyg_Clock::real_time_clock->current_value() + one_sec, 0 ); + + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Trigger the watchdog as if the timer had expired. + +void Cyg_Watchdog::trigger() +{ + CYG_REPORT_FUNCTION(); + + Cyg_Scheduler::lock(); + + // Disable alarm just in case + alarm.disable(); + + Cyg_Watchdog_Action *act = action_list; + + while( 0 != act ) + { + act->action( act->data ); + + act = act->next; + } + + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Register an action routine that will be called when the timer +// triggers. + +void Cyg_Watchdog::install_action( Cyg_Watchdog_Action *action ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Scheduler::lock(); + + action->next = action_list; + action_list = action; + + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Deregister a previously registered action routine. + +void Cyg_Watchdog::uninstall_action( Cyg_Watchdog_Action *action ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Scheduler::lock(); + + Cyg_Watchdog_Action **act_ptr = &action_list; + + while( 0 != *act_ptr ) + { + Cyg_Watchdog_Action *a = *act_ptr; + + if( a == action ) + { + *act_ptr = a->next; + break; + } + act_ptr = &a->next; + } + + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Alarm function + +void watchdog_alarm( Cyg_Alarm *a, CYG_ADDRWORD data) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Watchdog::watchdog.trigger(); +} + +#endif // CYGIMP_WATCHDOG_EMULATE +// ------------------------------------------------------------------------- +// EOF watchdog/emulate.cxx diff --git a/packages/devs/watchdog/current/src/mn10300.cxx b/packages/devs/watchdog/current/src/mn10300.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/current/src/mn10300.cxx @@ -0,0 +1,238 @@ +//========================================================================== +// +// watchdog/mn10300.cxx +// +// Watchdog implementation for MN10300 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-07-29 +// Purpose: Watchdog class implementation +// Description: Contains an implementation of the Watchdog class for use +// with the MN10300 hardware watchdog timer. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // system configuration file +#include // configuration for this package + +#if defined(CYG_HAL_MN10300_MN103002) && !defined(CYGIMP_WATCHDOG_EMULATE) + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // IO register access + +#include // scheduler +#include // interrupts + +#include // scheduler inlines + +#include // my header + +// ------------------------------------------------------------------------- +// MN10300 watchdog timer registers + +#define WATCHDOG_BASE 0x34004000 +#define WATCHDOG_COUNTER (WATCHDOG_BASE) +#define WATCHDOG_CONTROL (WATCHDOG_BASE+2) +#define WATCHDOG_RESET (WATCHDOG_BASE+4) + +#define WATCHDOG_WDCK0 0x07 +#define WATCHDOG_WDCK0_DEFAULT 0x04 // 1016.801ms cycle +#define WATCHDOG_WDRST 0x40 +#define WATCHDOG_WDCNE 0x80 + +// ------------------------------------------------------------------------- +// Forward definitions + +static cyg_ISR watchdog_isr; +static cyg_DSR watchdog_dsr; + +// ------------------------------------------------------------------------- +// Statics + +// A static pointer to the single system defined watchdog device. +Cyg_Watchdog Cyg_Watchdog::watchdog; + +// Interrupt object +static Cyg_Interrupt interrupt( + CYG_VECTOR_WATCHDOG, + 0, + 0, + watchdog_isr, + watchdog_dsr + ); + +// ------------------------------------------------------------------------- +// Constructor + +Cyg_Watchdog::Cyg_Watchdog() +{ + CYG_REPORT_FUNCTION(); + + action_list = 0; + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Start the watchdog running. + +void Cyg_Watchdog::start() +{ + CYG_REPORT_FUNCTION(); + + interrupt.attach(); + + HAL_WRITE_UINT8( WATCHDOG_COUNTER, 0 ); + + // Set overflow cycle + // Enable and reset counter + HAL_WRITE_UINT8( WATCHDOG_CONTROL, + WATCHDOG_WDCK0_DEFAULT|WATCHDOG_WDCNE|WATCHDOG_WDRST); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Reset watchdog timer. This needs to be called regularly to prevent +// the watchdog firing. + +void Cyg_Watchdog::reset() +{ + CYG_REPORT_FUNCTION(); + + cyg_uint8 ctrl; + + HAL_READ_UINT8( WATCHDOG_CONTROL, ctrl ); + + ctrl |= WATCHDOG_WDRST; + + HAL_WRITE_UINT8( WATCHDOG_CONTROL, ctrl ); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Trigger the watchdog as if the timer had expired. + +void Cyg_Watchdog::trigger() +{ + CYG_REPORT_FUNCTION(); + + Cyg_Scheduler::lock(); + + // Disable interrupt just in case + interrupt.detach(); + + Cyg_Watchdog_Action *act = action_list; + + while( 0 != act ) + { + act->action( act->data ); + + act = act->next; + } + + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Register an action routine that will be called when the timer +// triggers. + +void Cyg_Watchdog::install_action( Cyg_Watchdog_Action *action ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Scheduler::lock(); + + action->next = action_list; + action_list = action; + + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Deregister a previously registered action routine. + +void Cyg_Watchdog::uninstall_action( Cyg_Watchdog_Action *action ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Scheduler::lock(); + + Cyg_Watchdog_Action **act_ptr = &action_list; + + while( 0 != *act_ptr ) + { + Cyg_Watchdog_Action *a = *act_ptr; + + if( a == action ) + { + *act_ptr = a->next; + break; + } + act_ptr = &a->next; + } + + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// ISR and DSR + +cyg_uint32 watchdog_isr( cyg_vector vector, CYG_ADDRWORD data) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Watchdog::watchdog.trigger(); + + CYG_REPORT_RETURN(); + + return 0; +} + +void watchdog_dsr(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data) +{ +} + +#endif // defined(CYG_HAL_MN10300_MN103002) && !defined(CYGIMP_WATCHDOG_EMULATE) +// ------------------------------------------------------------------------- +// EOF watchdog/mn10300.cxx diff --git a/packages/devs/watchdog/current/tests/PKGconf.mak b/packages/devs/watchdog/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/current/tests/PKGconf.mak @@ -0,0 +1,39 @@ +#=============================================================================== +# +# makefile +# +# devs/watchdog/current/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := devices_watchdog +include ../../../../pkgconf/pkgconf.mak + +TESTS := watchdog + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + + diff --git a/packages/devs/watchdog/current/tests/watchdog.cxx b/packages/devs/watchdog/current/tests/watchdog.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/current/tests/watchdog.cxx @@ -0,0 +1,156 @@ +//========================================================================== +// +// watchdog.cxx +// +// Watchdog test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-07-20 +// Description: Tests the Kernel Wall Clock +// This test exercises the Watchdog class and checks that it +// works as advertised. +//####DESCRIPTIONEND#### +// ------------------------------------------------------------------------- + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include + +// ------------------------------------------------------------------------- +// Data for the test + +#define STACKSIZE (2*1024) // size of thread stack + +char thread_stack[STACKSIZE]; + +inline void *operator new(size_t size, void *ptr) { return ptr; }; + +// array of threads. +char thread[sizeof(Cyg_Thread)]; + +Cyg_Thread *th; + +volatile cyg_count8 watchdog_state; + +cyg_tick_count one_sec; + + +// ------------------------------------------------------------------------- +// Action functions: + +void watchdog_action1( CYG_ADDRWORD data ) +{ + CYG_TEST_FAIL_FINISH("Watchdog triggered unexpectedly"); +} + +void watchdog_action2( CYG_ADDRWORD data ) +{ + CYG_TEST_PASS_FINISH("Watchdog OK"); +} + +// ------------------------------------------------------------------------- +// Thread body + + +void watchdog_thread( CYG_ADDRWORD id ) +{ + Cyg_Watchdog::watchdog.start(); + + // First test that the watchdog does not trigger when being reset. + { + Cyg_Watchdog_Action wdaction( watchdog_action1, 0 ); + + wdaction.install(); + + for( int i = 0; i < 10; i++ ) + { + th->delay( one_sec-2 ); + Cyg_Watchdog::watchdog.reset(); + } + } + + // Now check that it triggers when not reset + { + Cyg_Watchdog_Action wdaction( watchdog_action2, 0 ); + + wdaction.install(); + + Cyg_Watchdog::watchdog.reset(); + + th->delay( one_sec*10 ); + } + + CYG_TEST_FAIL_FINISH("Watchdog failed to trigger"); +} + +// ------------------------------------------------------------------------- + + +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + + Cyg_Clock::cyg_resolution res = Cyg_Clock::real_time_clock->get_resolution(); + +#if defined(CYG_HAL_MIPS_SIM) + // Reduce time in simulated TX39 so that it runs within the timeout. + one_sec = ( res.divisor * 200000000LL ) / res.dividend ; +#else + one_sec = ( res.divisor * 1000000000LL ) / res.dividend ; +#endif + + th = new((void *)&thread) Cyg_Thread(watchdog_thread, + 0, + STACKSIZE, + (CYG_ADDRESS)thread_stack + ); + + th->resume(); + + // Get the world going + Cyg_Scheduler::scheduler.start(); + +} + +// ------------------------------------------------------------------------- +// EOF watchdog.cxx diff --git a/packages/error/current/ChangeLog b/packages/error/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/error/current/ChangeLog @@ -0,0 +1,40 @@ +1998-09-11 Bart Veer + + * include/pkgconf/error.h: + Sorting out dependencies for error package. + +Mon Aug 24 17:51:08 1998 Jonathan Larmour + + * include/pkgconf/error.h: + Add CDL for this package, for the configuration system. + +Wed Aug 12 11:04:27 BST 1998 Chris Provenzano + + * Changelog: Initial ChangeLog entry. + * include/codes.h: #include for define + of externC. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== + diff --git a/packages/error/current/include/codes.h b/packages/error/current/include/codes.h new file mode 100644 --- /dev/null +++ b/packages/error/current/include/codes.h @@ -0,0 +1,131 @@ +#ifndef CYGONCE_ERROR_CODES_H +#define CYGONCE_ERROR_CODES_H +//=========================================================================== +// +// codes.h +// +// Common error code definitions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-06-11 +// Purpose: To provide a common set of error codes +// Description: This provides a common set of error codes that all packages can +// agree on. It doesn't preclude them defining their own error +// return system, but this is a preferable system to use to help +// error support be as general as possible. +// +// We try and conform to the ANSI/POSIX error code format, namely +// starting with the character 'E' +// +// Usage: #include +// +// Example: +// +// err=myfun(); +// if (err != ENOERR) +// { +// str=strerror(err); +// printf("myfun returned error: %s\n", str); +// } +// else .... +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header +#include // externC + +// Include the error package? +#ifdef CYGPKG_ERROR + + +// TYPE DEFINITIONS + +// A type for error codes which may be useful to explain the purpose of +// a variable or return code. It shows that it contains an error code +// of the type defined below + +typedef int Cyg_ErrNo; + + +// FUNCTION PROTOTYPES + +// ANSI standard strerror() function as described by ANSI chap. 7.11.6.2. +// This is normally provided by + +externC char * +strerror( Cyg_ErrNo ); + +// prototype for the actual implementation. Equivalent to the above, but +// used internally by this product in preference + +externC char * +_strerror( Cyg_ErrNo ); + + +// CONSTANT DEFINITIONS + +// If adding to this list, you must also update strerror() with its text +// If there is a common error of the same purpose on Unix, try and use its +// name and number. If not, use one above 200 to prevent future conflicts +// +// Do not use negative numbers, so that functions can return positive on +// success and -ESOMETHING on error, and it all works consistently. + +#define ENOERR 0 // No error +#define EPERM 1 // Not permitted +#define ENOENT 2 // No such entity +#define ESRCH 3 // No such process +#define EINTR 4 // Operation interrupted +#define EIO 5 // I/O error +#define EBADF 9 // Bad file handle +#define EAGAIN 11 // Try again later +#define EWOULDBLOCK EAGAIN +#define ENOMEM 12 // Out of memory +#define EBUSY 16 // Resource busy +#define ENODEV 19 // No such device +#define EINVAL 22 // Invalid argument +#define EMFILE 24 // Too many open files +#define EDOM 33 // Argument to math function outside valid + // domain +#define ERANGE 34 // Math result cannot be represented +#define ENOSYS 38 // Function not implemented + +#define EEOF 200 // End of file reached +#define ENOSUPP 201 // Operation not supported +#define EDEVNOSUPP 202 // Device does not support this operation + +#endif // ifdef CYGPKG_ERROR + +#endif // CYGONCE_ERROR_CODES_H multiple inclusion protection + +// EOF codes.h diff --git a/packages/error/current/include/pkgconf/error.h b/packages/error/current/include/pkgconf/error.h new file mode 100644 --- /dev/null +++ b/packages/error/current/include/pkgconf/error.h @@ -0,0 +1,77 @@ +#ifndef CYGONCE_PKGCONF_ERROR_H +#define CYGONCE_PKGCONF_ERROR_H +//=========================================================================== +// +// error.h +// +// Configuration header for the Common error code package +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-06-11 +// Purpose: To configure the Common error package +// Description: Does any necessary configuration of the Common error package +// Usage: #include +// #ifdef CYGPKG_ERROR +// ... +// +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// INCLUDES + +// Include system configuration file to work out whether the Common error +// package is to be included at all (from CYGPKG_ERROR) +#include + +/* + {{CFG_DATA + + cdl_package CYGPKG_ERROR { + display "Common error code support" + description "This package contains the common list of error and + status codes. It is held centrally to allow + packages to interchange error codes and status + codes in a common way, rather than each package + having its own conventions for error/status + reporting. The error codes are modelled on the + POSIX style naming e.g. EINVAL etc. This package + also provides the standard strerror() function to + convert error codes to textual representation." + type bool + } + + }}CFG_DATA +*/ + + +#endif // CYGONCE_PKGCONF_ERROR_H multiple inclusion protection + +// EOF error.h diff --git a/packages/error/current/src/PKGconf.mak b/packages/error/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/error/current/src/PKGconf.mak @@ -0,0 +1,40 @@ +#============================================================================= +# +# makefile +# +# error/src +# +#============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================= + +PACKAGE := error +include ../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := strerror.cxx +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src diff --git a/packages/error/current/src/strerror.cxx b/packages/error/current/src/strerror.cxx new file mode 100644 --- /dev/null +++ b/packages/error/current/src/strerror.cxx @@ -0,0 +1,202 @@ +//=========================================================================== +// +// strerror.cxx +// +// ANSI error code string routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-06-11 +// Purpose: To provide the strerror() implementation +// Description: This implements strerror() as described in ANSI chap 7.11.6.2 +// Usage: See +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_ERROR + +// INCLUDES + +#include // Common project-wide type definitions +#include // Tracing support +#include // Error code definitions and header for this + // file + +// EXPORTED SYMBOLS + +externC char * +strerror( int errnum ) __attribute__ ((weak, alias("_strerror") )); + +// FUNCTIONS + +externC char * +_strerror( int errnum ) +{ + register char *s; + + CYG_REPORT_FUNCNAMETYPE( "_strerror", "String form of error is \"%s\"" ); + + switch (errnum) + { + +#ifdef ENOERR + case ENOERR: + s = "No error"; + break; +#endif + +#ifdef EPERM + case EPERM: + s = "Not permitted"; + break; +#endif + +#ifdef ENOENT + case ENOENT: + s = "No such entity"; + break; +#endif + +#ifdef ESRCH + case ESRCH: + s = "No such process"; + break; +#endif + +#ifdef EINTR + case EINTR: + s = "Operation interrupted"; + break; +#endif + +#ifdef EIO + case EIO: + s = "I/O error"; + break; +#endif + +#ifdef EBADF + case EBADF: + s = "Bad file handle"; + break; +#endif + +#ifdef EAGAIN + case EAGAIN: + s = "Try again later"; + break; +#endif + +#ifdef ENOMEM + case ENOMEM: + s = "Out of memory"; + break; +#endif + +#ifdef EBUSY + case EBUSY: + s = "Resource busy"; + break; +#endif + +#ifdef ENODEV + case ENODEV: + s = "No such device"; + break; +#endif + +#ifdef EINVAL + case EINVAL: + s = "Invalid argument"; + break; +#endif + +#ifdef EMFILE + case EMFILE: + s = "Too many open files"; + break; +#endif + +#ifdef EDOM + case EDOM: + s = "Argument to math function outside valid domain"; + break; +#endif + +#ifdef ERANGE + case ERANGE: + s = "Math result cannot be represented"; + break; +#endif + +#ifdef ENOSYS + case ENOSYS: + s = "Function not implemented"; + break; +#endif + +#ifdef EEOF + case EEOF: + s = "End of file reached"; + break; +#endif + +#ifdef ENOSUPP + case ENOSUPP: + s = "Operation not supported"; + break; +#endif + +#ifdef EDEVNOSUPP + case EDEVNOSUPP: + s = "Device does not support this operation"; + break; +#endif + + default: + s = "Unknown error"; + break; + + } // switch + + CYG_REPORT_RETVAL(s); + + return s; +} // _strerror() + +#endif // ifdef CYGPKG_ERROR + +// EOF strerror.cxx diff --git a/packages/hal/common/current/ChangeLog b/packages/hal/common/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/ChangeLog @@ -0,0 +1,178 @@ +1998-10-25 Jesper Skov + + * src/thread-packets.c: Fixed closing #endif comment. + + * src/generic-stub.c: Fixed closing #endif comment. + +1998-10-23 Jesper Skov + + * src/hal_common.c: Removed. We can't use weak default functions + when they may conflict with strong functions in the library. + +1998-10-23 Jesper Skov + + * include/generic-stub.h: Added __interruptible_control. + +1998-10-23 Jesper Skov + PR 17460, PR 17913 + + * include/pkgconf/hal.h: Let HAL exception support require Kernel + exception support. + +1998-10-21 Jesper Skov + PR 17842 + + * include/pkgconf/hal.h: Let HAL GDB thread support require Kernel + GDB thread support. + +1998-10-20 Jesper Skov + PR 17460 + + * src/hal_common.c: Added. Includes a weak handle_exception + definition. + +1998-10-20 Jesper Skov + PR 17885, 17880, 17841 + + * include/pkgconf/hal.h: Don't allow GDB stubs to be configured + for SIMs or MN10300. + +1998-10-19 Jesper Skov + + * src/thread-packets.c: Sync'd with libstub source. + +1998-10-16 Bart Veer + + * include/pkgconf/hal.h (CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE): + Added new configuration option for interrupt stack size. + +Thu Oct 15 21:25:55 1998 Jonathan Larmour + + * include/pkgconf/hal.h: + Make CYGFUN_HAL_COMMON_KERNEL_SUPPORT require the kernel, as it + is enabling this is eCos-kernel specific, and relies on + configuration options defined only in the kernel + Required for PR 17229 + +1998-10-15 Jesper Skov + + * include/pkgconf/hal.h (CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT): + Added config option. + +1998-10-14 Nick Garnett + + * include/pkgconf/hal.h: + Move some configury from kernel.h to here. Particularly the + support for GDB stubs. + + * tests/cache.c: + * tests/context.c: + * tests/intr.c: + * tests/PKGconf.mak: + New directory of HAL-only test programs. Currently contains some + very basic test programs. + + * include/generic-stub.h: + * include/dbg-threads-api.h: + * src/generic-stub.c: + * src/thread-packets.c: + * src/thread-pkts.h: + * src/stubrom/PKGconf.mak: + * src/stubrom/stubrom.c: + Moved these files here from kernel. + +1998-10-08 Gary Thomas + + * include/pkgconf/hal.h: + Add support for new architecture. + +1998-09-23 Nick Garnett + + * include/pkgconf/hal.h: + Switched TX39 over to using CYGMON from GDB stubs. + +Tue Sep 15 19:13:04 1998 David Moore + + * include/pkgconf/hal.h: Cleaned up comments. + +Mon Sep 14 11:08:26 1998 Jesper Skov + PR 17230 + + * include/pkgconf/hal.h: Added IMP_HAL_COMMON_INTERRUPTS_CHAIN + option. + +1998-09-14 Bart Veer + + * include/pkgconf/hal.h: + Fixed typo in description. + +1998-09-12 Bart Veer + + * include/pkgconf/hal.h: + Sort out exception handling options (PR 16953) + Added missing descriptions (PR 17184) + +Tue Sep 8 17:16:39 1998 Hugo Tyson + + * include/pkgconf/hal.h: + Elide some spurious redefines of CYG_HAL_MN10300_STDEVAL1 and + CYG_HAL_MN10300_SIM within ifdefs conditioned on same. + +1998-09-03 Bart Veer + + * include/pkgconf/hal.h: + CYGPKG_HAL_COMMON is now a component, not a package. + +1998-09-02 Bart Veer + + * include/pkgconf/hal.h: + Moved target and platform specific configuration data to + the appropriate packages. + + Symbols identifying the target hardware should be just defined, + not given a value, as per the coding standards. + +Mon Aug 31 09:16:08 1998 Jesper Skov + + * include/pkgconf/hal.h: Added INIT_PRIORITY default setting for + powerpc. + +1998-08-28 Bart Veer + + * include/pkgconf/hal.h: + Added configuration data. + +1998-08-20 Nick Garnett + + * include/pkgconf/hal.h: + Moved definition of CYG_KERNEL_USE_INIT_PRIORITY here from + kernel.h. + +1998-08-18 Nick Garnett + + * include/pkgconf/hal.h: + Created this file to contain HAL config options. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/common/current/include/dbg-threads-api.h b/packages/hal/common/current/include/dbg-threads-api.h new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/include/dbg-threads-api.h @@ -0,0 +1,108 @@ +#if !defined(DBG_THREADS_API_INCLUDED) +#define DBG_THREADS_API_INCLUDED 1 +/* These are the calls used to extract operating system specific information + used in supporting thread aware debugging. + The Operating Environment being debugged needs to supply these functions. + */ + +/* + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#define has_thread_void 0 +#define has_thread_current 1 +#define has_thread_registers 2 +#define has_thread_reg_change 4 +#define has_thread_list 8 +#define has_thread_info 16 + +typedef unsigned char threadref[8] ; + +struct dbg_capabilities +{ + unsigned long mask1 ; +} ; + + +/* fill in the list of thread aware capabilities */ +extern int dbg_thread_capabilities(struct dbg_capabilities * cbp) ; + + +/* Fillin the identifier of the current thread */ +/* return 1 if defined, 0 if not defined */ +extern int dbg_currthread(threadref * varparm) ; + +/* Return the unique ID number of the current thread. */ +extern int dbg_currthread_id(void); + +/* get the first or next member of the list of known threads */ +extern int dbg_threadlist(int startflag, + threadref * lastthreadid, + threadref * next_thread + ) ; + +/* return 1 if next_threadid has been filled in with a value */ +/* return 0 if there are none or no more */ + +/* The O.S can fill in the following information about a thread when queried. + The structure of thise strings is determined by the O.S. + It is display oriented, so figure out what the users need to see. + Nulls are OK but GDB will fill some not so meaningful data. + These pointers may be in the calles private structures, the info will + get copied immediatly after the call to retreive it. + */ +struct cygmon_thread_debug_info +{ + threadref thread_id ; + int context_exists ; /* To the point where examining its state, + registers and stack makes sense to GDB */ + char * thread_display ; /* As shown in thread status window, name, state */ + char * unique_thread_name ; /* human readable identifier, window label */ + char * more_display ; /* more detailed info about thread. + priority, queuedepth, state, stack usage, statistics */ +} ; + + + + +extern int dbg_threadinfo( + threadref * threadid, + struct cygmon_thread_debug_info * info) ; + +/* Return 1 if threadid is defined and info copied, 0 otherwise */ + +/* The O.S should fillin the array of registers using values from the +saves context. The array MUST be in GDB register save order even if +the saved context is different or smaller. Do not alter the values of +registers which are NOT in the O.S. thread context. Their default values +have already been assigned. +*/ + +extern int dbg_getthreadreg( + threadref * osthreadid, + int regcount, /* count of registers in the array */ + void * regval) ; /* fillin this array */ + + +/* The O.S. should scan through this list of registers which are in +GDB order and the O.S. should replace the values of all registers +which are defined in the saved context of thread or process identified +by osthreadid. Return 0 if the threadis does not map to a known +process or other error. Return 1 if the setting is successful. */ + +extern int dbg_setthreadreg( + threadref * osthreadid, + int regcount , /* number of registers */ + void * regval) ; + +#endif /* DBG_THREADS_API_INCLUDED */ diff --git a/packages/hal/common/current/include/generic-stub.h b/packages/hal/common/current/include/generic-stub.h new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/include/generic-stub.h @@ -0,0 +1,156 @@ +/* Definitions for the generic GDB remote stub + * + * Copyright (c) 1997, 1998 Cygnus Solutions + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ +#ifndef GENERIC_STUB_H +#define GENERIC_STUB_H + +/* Two typedefs must be provided before including this file. + target_register_t should correspond to the largest register value on + this target processor. + regnames_t corresponds to a type representing a register number. */ + +#ifndef ASM + +struct gdb_packet; + +/* Set the current serial port being used for stub I/O to PORT. */ +extern void __set_serial_port (int port); + +/* Set the baud rate for the current serial port. */ +extern void __set_baud_rate (int baud); + +/* Write C to the current serial port. */ +extern void putDebugChar (int c); + +/* Read one character from the current serial port. */ +extern int getDebugChar (void); + +/* Push CH back onto the debug stream. */ +extern void ungetDebugChar (int ch); + +/* Return the currently-saved value corresponding to register REG. */ +extern target_register_t get_register (regnames_t reg); + +/* Store VALUE in the register corresponding to WHICH. */ +extern void put_register (regnames_t which, target_register_t value); + +/* Set the next instruction to be executed when the user program resumes + execution to PC. */ +extern void set_pc (target_register_t pc); + +/* Set the return value of the currently-pending syscall to VALUE. */ +extern void set_syscall_value (target_register_t value); + +/* Return the Nth argument to the currently-pending syscall (starting from + 0). */ +extern target_register_t get_syscall_arg (int n); + +/* Initialize the stub. This will also install any trap handlers needed by + the stub. */ +extern void initialize_stub (void); + +/* Initialize the hardware. */ +extern void initHardware (void); + +/* Skip the current instruction. */ +extern void __skipinst (void); + +/* If the breakpoint we hit is in the breakpoint() instruction, return a + non-zero value. */ +extern int __is_breakpoint_function (void); + +/* Execute a breakpoint instruction. Restarting will cause the instruction + to be skipped. */ +extern void breakpoint (void); + +/* Return the syscall # corresponding to this system call. */ +extern int __get_syscall_num (void); + +/* Transfer exception event processing to the stub. */ +extern void __switch_to_stub (void); + +/* Send an exit packet containing the specified status. */ +extern void __send_exit_status (int status); + +/* Copy COUNT bytes of memory from SRC to DST. A non-zero value will be + returned if a memory fault occurs during the copy. */ +extern int __read_mem_safe (unsigned char *buf, target_register_t addr, int count); +extern int __write_mem_safe (unsigned char *buf, target_register_t addr, int count); + +/* Reset the board. */ +extern void __reset (void); + +/* Flush the instruction cache. */ +extern void flush_i_cache (void); + +/* Flush the data cache. */ +extern void __flush_d_cache (void); + +typedef enum { + CACHE_NOOP, CACHE_ENABLE, CACHE_DISABLE, CACHE_FLUSH +} cache_control_t; + +/* Perform the specified operation on the instruction cache. + Returns 1 if the cache is enabled, 0 otherwise. */ +extern int __instruction_cache (cache_control_t request); +/* Perform the specified operation on the data cache. + Returns 1 if the cache is enabled, 0 otherwise. */ +extern int __data_cache (cache_control_t request); + +/* Write the 'T' packet in BUFFER. SIGVAL is the signal the program + received. */ + +extern void __build_t_packet (int sigval, char *buffer); + +/* Return 1 when a complete packet has been received, 0 if the packet + is not yet complete, or -1 if an erroneous packet was NAKed. */ +int __add_char_to_packet (int character, struct gdb_packet *packet); + +typedef int (*__PFI)(int); +typedef void (*__PFV)(void); + +/* When an exception occurs, __process_exception_vec will be invoked with + the signal number corresponding to the trap/exception. The function + should return zero if it wishes execution to resume from the saved + register values; a non-zero value indicates that the exception handler + should be reinvoked. */ +extern volatile __PFI __process_exception_vec; +extern volatile __PFV __process_exit_vec; +extern volatile __PFI __process_syscall_vec; +extern volatile __PFI __process_signal_vec; +extern volatile __PFI __interruptible_control; + +/* Send an 'O' packet to GDB containing STR. */ +extern int __output_gdb_string (const char *str, int string_len); + +/* Request MAXLEN bytes of input from GDB to be stored in DEST. If BLOCK + is set, GDB should block until MAXLEN bytes are available to be + read; otherwise, it will return immediately with whatever data is + available. + The return value is the number of bytes written into DEST. */ +extern int __get_gdb_input (char *dest, int maxlen, int block); + +/* Choose which tty port should be used for GDB debugging. Note that this + function is completely target-dependent; it may do nothing at all. */ +extern void __setTty (int which); + +/* Return which port is currently being used for debugging. */ +extern int __getTty (void); + +extern char __tohex (int c); + +unsigned char * __mem2hex (unsigned char *mem, unsigned char *dest, int count, int may_fault); +#endif + +#endif diff --git a/packages/hal/common/current/include/pkgconf/hal.h b/packages/hal/common/current/include/pkgconf/hal.h new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/include/pkgconf/hal.h @@ -0,0 +1,445 @@ +#ifndef CYGONCE_PKGCONF_HAL_H +#define CYGONCE_PKGCONF_HAL_H +// ==================================================================== +// +// pkgconf/hal.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-29 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +/* --------------------------------------------------------------------- + * Some of the HAL configuration options depend on global options, + * so it is necessary to include the global options first. + */ + +#include + +/* --------------------------------------------------------------------- + Define an overall package for the HAL. All other HAL packages + live below this. + + {{CFG_DATA + + cdl_package CYGPKG_HAL { + display "eCos HAL" + type dummy + description " + The eCos HAL package provide a porting layer for + higher-level parts of the system such as the kernel and the + C library. Each installation should have HAL packages for + one or more architectures, and for each architecture there + may be one or more supported platforms. It is necessary to + select one target architecture and one platform for that + architecture. There are also a number of configuration + options that are common to all HAL packages." + doc ref/ecos-ref/the-ecos-hardware-abstraction-layer-hal.html + } + + }}CFG_DATA */ + +/* --------------------------------------------------------------------- + * The platform-independent HAL configuration options go here, + * inside a component CYGPKG_HAL_COMMON. In practice some of the + * options are not completely platform-independent, but they are + * likely to be available on the vast majority of platforms and + * it is more convenient to provide them by default and let the + * appropriate platforms disable them (probably via a suitable + * interface). + * + * The common component is subdivided into components for + * interrupt handling, thread context, and rom monitor/gdb support. + + {{CFG_DATA + + cdl_component CYGPKG_HAL_COMMON { + display "Platform-independent HAL options" + parent CYGPKG_HAL + type dummy + description " + A number of configuration options are common to most or all + HAL packages, for example options controlling how much state + should be saved during a context switch. The implementations + of these options will vary from architecture to architecture." + } + + cdl_option CYGFUN_HAL_COMMON_KERNEL_SUPPORT { + display "Provide eCos kernel support" + parent CYGPKG_HAL_COMMON + requires CYGPKG_KERNEL + description " + The HAL can be configured to either support the full eCos + kernel, or to support only very simple applications which do + not require a full kernel. If kernel support is not required + then some of the startup, exception, and interrupt handling + code can be eliminated." + } + + }}CFG_DATA */ +#define CYGFUN_HAL_COMMON_KERNEL_SUPPORT + +/* {{CFG_DATA + + cdl_component CYGPKG_HAL_COMMON_INTERRUPTS { + display "HAL interrupt handling" + parent CYGPKG_HAL_COMMON + type dummy + description " + A number of configuration options related to interrupt + handling are common to most or all HAL packages, even though + the implementations will vary from architecture to + architecture." + } + + cdl_option CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK { + display "Use separate stack for interrupts" + parent CYGPKG_HAL_COMMON_INTERRUPTS + description " + When an interrupt occurs this interrupt can be handled either + on the current stack or on a separate stack maintained by the + HAL. Using a separate stack requires a small number of extra + instructions in the interrupt handling code, but it has the + advantage that it is no longer necessary to allow extra space + in every thread stack for the interrupt handlers. The amount + of extra space required depends on the interrupt handlers + that are being used." + } + + # NOTE: various parts of the system such as device drivers should + # impose lower bounds on this. The actual lower bound depends on a + # platform-specific value for startup overheads, and the minimum + # sizes specified by the various device drivers. If interrupts are + # not handled on a separate stack then only the startup overheads + # are significant. If nested interrupts are disabled then the + # lower bound is the maximum of the individual sizes, otherwise + # it is the sum of these sizes. It is not currently possible to + # express a relationship like this. + cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE { + display "Interrupt stack size" + parent CYGPKG_HAL_COMMON_INTERRUPTS + type count + legal_values 1024 to 1048576 + description " + This configuration option specifies the stack size in bytes + for the interrupt stack. Typically this should be a multiple + of 16, but the exact requirements will vary from architecture + to architecture. The interrupt stack serves two separate + purposes. It is used as the stack during system + initialization. In addition, if the interrupt system is + configured to use a separate stack then all interrupts will + be processed on this stack. The exact memory requirements + will vary from application to application, and will depend + heavily on whether or not other interrupt-related options, + for example nested interrupts, are enabled." + } + + cdl_option CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING { + display "Allow nested interrupts" + parent CYGPKG_HAL_COMMON_INTERRUPTS + description " + When an interrupt occurs the HAL interrupt handling code can + either leave interrupts disabled for the duration of the + interrupt handling code, or by doing some extra work it can + reenable interrupts before invoking the interrupt handler and + thus allow nested interrupts to happen. If all the interrupt + handlers being used are small and do not involve any loops + then it is usually better to disallow nested interrupts. + However if any of the interrupt handlers are more complicated + than nested interrupts will usually be required." + } + + cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT { + display "Save minimum context on interrupt" + parent CYGPKG_HAL_COMMON_INTERRUPTS + description " + The HAL interrupt handling code can exploit the calling conventions + defined for a given architecture to reduce the amount of state + that has to be saved. Generally this improves performance and + reduces code size. However it can make source-level debugging + more difficult. + " + } + + cdl_option CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN { + display "Chain all interrupts together" + parent CYGPKG_HAL_COMMON_INTERRUPTS + description " + Interrupts can be attached to vectors either singly, or be + chained together. The latter is necessary if there is no way + of discovering which device has interrupted without + inspecting the device itself. It can also reduce the amount + of RAM needed for interrupt decoding tables and code." + } + + }}CFG_DATA + +*/ + +#define CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK +#define CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE 4096 +#undef CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING +#define CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT +#undef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN + + +/* {{CFG_DATA + + cdl_component CYGPKG_HAL_COMMON_CONTEXT { + display "HAL context switch support" + parent CYGPKG_HAL_COMMON + type dummy + description " + A number of configuration options related to thread contexts + are common to most or all HAL packages, even though the + implementations will vary from architecture to architecture." + } + + cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM { + display "Use minimum thread context" + parent CYGPKG_HAL_COMMON_CONTEXT + description " + The thread context switch code can exploit the calling conventions + defined for a given architecture to reduce the amount of state + that has to be saved during a context switch. Generally this + improves performance and reduces code size. However it can make + source-level debugging more difficult." + } + + }}CFG_DATA */ +#define CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM + +/* {{CFG_DATA + + # NOTE: The requirement for kernel exception support is bogus in that + # the user can supply a deliver_exception function herself. In that + # case, however, it is easy to force the kernel option off while leaving + # this one on. Having the requirement prevents accidental invalid + # configurations of the kernel. + cdl_option CYGPKG_HAL_EXCEPTIONS { + display "HAL exception support" + parent CYGPKG_HAL_COMMON + requires CYGPKG_KERNEL_EXCEPTIONS + description " + When a processor exception occurs, for example an attempt to + execute an illegal instruction or to perform a divide by + zero, this exception may be handled in a number of different + ways. If the target system has gdb support then typically + the exception will be handled by gdb code. Otherwise if the + HAL exception support is enabled then the HAL will invoke a + routine deliver_exception(). Typically this routine will be + provided by the eCos kernel, but it is possible for + application code to provide its own implementation. If the + HAL exception support is not enabled and a processor + exception occurs then the behaviour of the system is + undefined. + " + } + + }}CFG_DATA */ +#define CYGPKG_HAL_EXCEPTIONS + + +/* --------------------------------------------------------------------- + * Options related to source-level debugging and diagnostics. + + {{CFG_DATA + + cdl_component CYGPKG_HAL_DEBUG { + display "Source-level debugging support" + type dummy + parent CYGPKG_HAL + description " + If the source level debugger gdb is to be used for debugging + application code then it may be necessary to configure in support + for this in the HAL." + } + + cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS { + display "Include GDB stubs in HAL" + parent CYGPKG_HAL_DEBUG + requires !CYGPKG_HAL_POWERPC_SIM + requires !CYGPKG_HAL_MN10300_SIM + requires !CYGPKG_HAL_TX39_SIM + requires !CYGPKG_HAL_MN10300_STDEVAL1 + description " + This option causes a set of GDB stubs to be included into the + system. On some target systems the GDB support will be + provided by other means, for example by a ROM monitor. On + other targets, especially when building a ROM-booting system, + the necessary support has to go into the target library + itself." + } + + cdl_option CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT { + display "Include GDB multi-threading debug support" + parent CYGPKG_HAL_DEBUG + requires CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + description " + This option enables some extra HAL code which is needed + to support multi-threaded source level debugging." + } + + cdl_option CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT { + display "Include GDB external break support" + parent CYGPKG_HAL_DEBUG + requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + description " + This option causes the GDB stub to add a serial interrupt handler + which will listen for GDB break packets. This lets you stop the + target asynchronously when using GDB, usually by hitting Control+C + or pressing the STOP button." + } + + + }}CFG_DATA */ + +#undef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS +#undef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT + +#define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT + +/* + * NOTE: + * + * Right now there is no easy way to express the ROM monitor options + * in CDL. The problem is that the default values depend on the + * target platform and on the desired start-up. It is possible to + * produce something that will work correctly in a clean world, but + * not something more general. + * + * One possibility is to duplicate the relevant options in the various + * platform HAL packages, renaming them to avoid collisions. This appears + * to be feasible with the current sources because the rom monitor options + * are only referenced in the HAL packages. It is not clear whether or not + * this will continue to be the case. */ + +/* + * Some development boards come with a ROM monitor that provides + * download and debug facilities. Such ROMs may also supply interrupt + * redirection and IO facilities. The following option causes the HAL + * to integrate with the ROM monitor present on the configured + * platform. If this option is not defined, the monitor will not be + * used. Where there is more than one ROM monitor for a specific + * platform, a subsidiary define should identify the appropriate monitor + * type. + */ + +//#define CYG_HAL_USE_ROM_MONITOR + +#if defined(CYG_HAL_TX39_JMR3904) && defined(CYG_HAL_STARTUP_RAM) +#define CYG_HAL_USE_ROM_MONITOR +#define CYG_HAL_USE_ROM_MONITOR_CYGMON +#endif +#if defined(CYG_HAL_MN10300_STDEVAL1) && defined(CYG_HAL_STARTUP_RAM) +#define CYG_HAL_USE_ROM_MONITOR +#define CYG_HAL_USE_ROM_MONITOR_CYGMON +#endif + +#ifdef CYG_HAL_USE_ROM_MONITOR + +//#define CYG_HAL_USE_ROM_MONITOR_SLOAD +//#define CYG_HAL_USE_ROM_MONITOR_GDB_STUBS +//#define CYG_HAL_USE_ROM_MONITOR_CYGMON + +#endif + +/* --------------------------------------------------------------------- + * + * The section below deals with some inferences about package/feature + * presence that are not yet supported by the full external configuration + * tool; they are NOT user configuration, and you should NOT edit them. + */ + +/* + * Initialization options. + * + * WARNING: this option should not be enabled by end users. It + * makes use of an experimental facility in g++ which has not been + * generally distributed. + * + * The USE_INIT_PRIORITY option enables the use of the g++ init_priority + * attribute which allows the order of execution of constructors of + * static objects to be controlled. This option is not yet required by + * the current kernel, but it will be required by future versions. + */ + +#undef CYG_KERNEL_USE_INIT_PRIORITY + +#ifdef CYG_HAL_TX39 +#define CYG_KERNEL_USE_INIT_PRIORITY +#endif +#ifdef CYG_HAL_MN10300 +#define CYG_KERNEL_USE_INIT_PRIORITY +#endif +#ifdef CYG_HAL_POWERPC +#define CYG_KERNEL_USE_INIT_PRIORITY +#endif + +/* + * CYG_HAL_ and CYG_HAL__ are generated by + * pkgconf, using the information from the targets file. + * + * NOTE: Currently the code also needs these #defines. + */ +#ifdef CYG_HAL_MN10300_STDEVAL1 +# define CYG_HAL_MN10300_MN103002 +#endif +#ifdef CYG_HAL_MN10300_SIM +# define CYG_HAL_MN10300_MN103002 +#endif + +#ifdef CYG_HAL_POWERPC_COGENT +# define CYG_HAL_POWERPC_MP860 +#endif +#ifdef CYG_HAL_POWERPC_SIM +# define CYG_HAL_POWERPC_MP860 +#endif + +#ifdef CYG_HAL_TX39_JMR3904 +# define CYG_HAL_MIPS +# define CYG_HAL_MIPS_TX39 +# define CYG_HAL_MIPS_TX3904 +# define CYG_HAL_MIPS_JMR3904 +#endif +#ifdef CYG_HAL_TX39_SIM +# define CYG_HAL_MIPS +# define CYG_HAL_MIPS_TX39 +# define CYG_HAL_MIPS_SIM +#endif + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_H */ +/* EOF hal.h */ diff --git a/packages/hal/common/current/src/PKGconf.mak b/packages/hal/common/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/src/PKGconf.mak @@ -0,0 +1,42 @@ +#=============================================================================== +# +# makefile +# +# hal/common/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal +include ../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := generic-stub.c thread-packets.c + +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/hal/common/current/src/generic-stub.c b/packages/hal/common/current/src/generic-stub.c new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/src/generic-stub.c @@ -0,0 +1,1075 @@ +/**************************************************************************** + + THIS SOFTWARE IS NOT COPYRIGHTED + + HP offers the following for use in the public domain. HP makes no + warranty with regard to the software or it's performance and the + user accepts the software "AS IS" with all faults. + + HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD + TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +****************************************************************************/ + +/**************************************************************************** + * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $ + * + * Module name: remcom.c $ + * Revision: 1.34 $ + * Date: 91/03/09 12:29:49 $ + * Contributor: Lake Stevens Instrument Division$ + * + * Description: low level support for gdb debugger. $ + * + * Considerations: only works on target hardware $ + * + * Written by: Glenn Engel $ + * ModuleState: Experimental $ + * + * NOTES: See Below $ + * + * Modified for SPARC by Stu Grossman, Cygnus Support. + * Modified for generic CygMON stub support by Bob Manson, Cygnus Solutions. + * + * To enable debugger support, two things need to happen. One, a + * call to set_debug_traps() is necessary in order to allow any breakpoints + * or error conditions to be properly intercepted and reported to gdb. + * Two, a breakpoint needs to be generated to begin communication. This + * is most easily accomplished by a call to breakpoint(). Breakpoint() + * simulates a breakpoint by executing a trap #1. + * + ************* + * + * The following gdb commands are supported: + * + * command function Return value + * + * g return the value of the CPU registers hex data or ENN + * G set the value of the CPU registers OK or ENN + * + * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN + * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN + * + * c Resume at current address SNN ( signal NN) + * cAA..AA Continue at address AA..AA SNN + * + * s Step one instruction SNN + * sAA..AA Step one instruction from AA..AA SNN + * + * k kill + * + * ? What was the last sigval ? SNN (signal NN) + * + * bBB..BB Set baud rate to BB..BB OK or BNN, then sets + * baud rate + * + * All commands and responses are sent with a packet which includes a + * checksum. A packet consists of + * + * $#. + * + * where + * :: + * :: < two hex digits computed as modulo 256 sum of > + * + * When a packet is received, it is first acknowledged with either '+' or '-'. + * '+' indicates a successful transfer. '-' indicates a failed transfer. + * + * Example: + * + * Host: Reply: + * $m0,10#2a +$00010203040506070809101112131415#42 + * + ****************************************************************************/ + +#include + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + +#include + +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 /* interrupt */ +#define SIGQUIT 3 /* quit */ +#define SIGILL 4 /* illegal instruction (not reset when caught) */ +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGIOT 6 /* IOT instruction */ +#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ +#define SIGEMT 7 /* EMT instruction */ +#define SIGFPE 8 /* floating point exception */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGSEGV 11 /* segmentation violation */ +#define SIGSYS 12 /* bad argument to system call */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 /* software termination signal from kill */ + +#include // HAL header + +#ifdef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT +#define DEBUG_THREADS 1 // FIXME: put in header file? +#else +#define DEBUG_THREADS 0 // FIXME: put in header file? +#endif + +#define uint32 cyg_uint32 +#include "thread-pkts.h" + +/************************************************************************/ +/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ +/* at least NUMREGBYTES*2 are needed for register packets */ +#define BUFMAX 2048 + +static int process_exception (int sigval); +static void do_nothing (void); /* and do it gracefully */ +static int syscall_do_nothing (int); +static void kill_program (int sigval); +static void process_query (char *pkt); +static void process_set (char *pkt); + +volatile __PFI __process_exception_vec = process_exception; +volatile __PFV __process_exit_vec = do_nothing; +volatile __PFI __process_syscall_vec = syscall_do_nothing; +volatile __PFI __process_signal_vec = NULL; +volatile __PFI __interruptible_control = NULL; + +static const char hexchars[] = "0123456789abcdef"; + +extern target_register_t registers[]; /* The current saved registers */ +extern target_register_t * _registers ; +extern HAL_SavedRegisters *_hal_registers; + +int __process_target_query(char * pkt, char * out, int maxOut) +{ return 0 ; } +int __process_target_set(char * pkt, char * out, int maxout) +{ return 0 ; } +int __process_target_packet(char * pkt, char * out, int maxout) +{ return 0 ; } + + +/* Return the value corresponding to register REG of the active thread. */ +static target_register_t thread_get_register (regnames_t reg) +{ + return _registers[reg]; +} + + +/* Store VALUE in the register corresponding to WHICH of the active thread. */ +static void thread_put_register (regnames_t which, target_register_t value) +{ + _registers[which] = value; +} + + +char +__tohex (int c) +{ + return hexchars [c & 15]; +} + +target_register_t *__our_registers; + +#ifndef NUMREGS_GDB +#define NUMREGS_GDB NUMREGS +#endif + +static char *strcpy( char *s, const char *t) +{ + char *r = s; + + while( *t ) *s++ = *t++; + + return r; +} + +static int strlen( const char *s ) +{ + int r = 0; + while( *s++ ) r++; + return r; +} + +// Use this function to disable serial interrupts whenever reply +// characters are expected from GDB. The reason we want to control +// whether the target can be interrupted or not is simply that GDB on +// the host will be sending acknowledge characters/commands while the +// stub is running - if serial interrupts were still active, the +// characters would never reach the (polling) getDebugChar. +static void +interruptible (int state) +{ + static int current_state = 0; + + if (__interruptible_control) { + if (state) { + current_state--; + if (0 >= current_state) { + current_state = 0; + __interruptible_control (1); + } + } else { + current_state++; + if (1 == current_state) + __interruptible_control (0); + } + } +} + + +/* One pushback character. */ +int ungot_char = -1; + +static int +readDebugChar (void) +{ + if (ungot_char > 0) + { + int result = ungot_char; + ungot_char = -1; + return result; + } + else + return getDebugChar (); +} + +struct gdb_packet +{ + /* The checksum calculated so far. */ + int checksum; + /* The checksum we've received from the remote side. */ + int xmitcsum; + /* Contents of the accumulated packet. */ + char *contents; + /* Number of characters received. */ + int length; + /* + * state is the current state: + * 0 = looking for start of packet + * 1 = got start of packet, looking for # terminator + * 2 = looking for first byte of checksum + * 3 = looking for second byte of checksum (indicating end of packet) + */ + char state; +}; + +/* Convert ch from a hex digit to an int. */ + +int +stubhex(unsigned char ch) +{ + if (ch >= 'a' && ch <= 'f') + return ch-'a'+10; + if (ch >= '0' && ch <= '9') + return ch-'0'; + if (ch >= 'A' && ch <= 'F') + return ch-'A'+10; + return -1; +} + +static void +getpacket(char *buffer) +{ + struct gdb_packet packet; + + packet.state = 0; + packet.contents = buffer; + while (__add_char_to_packet (readDebugChar () & 0x7f, &packet) != 1) + { + /* Empty */ + } +} + +int +__add_char_to_packet (int ch, struct gdb_packet *packet) +{ + if (packet->state == 0) + { + if (ch == '$') + { + packet->state = 1; + packet->length = 0; + packet->checksum = 0; + packet->xmitcsum = -1; + } + return 0; + } + + if (packet->state == 1) + { + if (ch == '#') + { + packet->contents[packet->length] = 0; + packet->state = 2; + } + else + { + if (packet->length == BUFMAX) { + packet->state = 0; + return -1; + } + packet->checksum += ch; + packet->contents[packet->length++] = ch; + } + return 0; + } + + if (packet->state == 2) + { + packet->xmitcsum = stubhex (ch) << 4; + packet->state = 3; + return 0; + } + + if (packet->state == 3) + { + packet->xmitcsum |= stubhex(ch); + if ((packet->checksum & 255) != packet->xmitcsum) + { + putDebugChar ('-'); /* failed checksum */ + packet->state = 0; + return -1; + } + else + { + putDebugChar('+'); /* successful transfer */ + /* if a sequence char is present, reply the sequence ID */ + if (packet->contents[2] == ':') + { + int count = packet->length; + int i; + putDebugChar (packet->contents[0]); + putDebugChar (packet->contents[1]); + /* remove sequence chars from buffer */ + for (i=3; i <= count; i++) + packet->contents[i-3] = packet->contents[i]; + } + return 1; + } + } + /* We should never get here. */ + packet->state = 0; + return -1; +} + +/* send the packet in buffer. */ + +static void +putpacket(unsigned char *buffer) +{ + unsigned char checksum; + int count; + unsigned char ch; + + interruptible (0); + + /* $#. */ + do + { + putDebugChar ('$'); + checksum = 0; + count = 0; + + while ((ch = buffer[count])) + { + putDebugChar (ch); + checksum += ch; + count += 1; + } + + putDebugChar ('#'); + putDebugChar (hexchars[(checksum >> 4) & 0xf]); + putDebugChar (hexchars[checksum & 0xf]); + + } + while ((readDebugChar () & 0x7f) != '+'); + + interruptible (1); +} + +static char remcomInBuffer[BUFMAX]; +static char remcomOutBuffer[BUFMAX]; + +/* Indicate to caller of mem2hex or hex2mem that there has been an + error. */ +volatile int __mem_fault = 0; + +static int +__copy_mem_safe (unsigned char *dst, unsigned char *src, int count) +{ + int res; + + __set_mem_fault_trap (1); + while (count--) + *(dst++) = *(src++); + res = __mem_fault; + __set_mem_fault_trap (0); + return res ? 1 : 0; +} + +int +__read_mem_safe (unsigned char *dst, target_register_t src, int count) +{ + return __copy_mem_safe (dst, (unsigned char*) src, count); +} + +int +__write_mem_safe (unsigned char *src, target_register_t dst, int count) +{ + return __copy_mem_safe ((unsigned char*) dst, src, count); +} + +/* Convert the memory pointed to by mem into hex, placing result in buf. + * Return a pointer to the last char put in buf (null), in case of mem fault, + * return 0. + * If MAY_FAULT is non-zero, then we will handle memory faults by returning + * a 0, else treat a fault like any other fault in the stub. + */ + +unsigned char * +__mem2hex(mem, buf, count, may_fault) + unsigned char *mem; + unsigned char *buf; + int count; + int may_fault; +{ + unsigned char ch; + + __set_mem_fault_trap(may_fault); + + while (count-- > 0) + { + ch = *mem++; + if (__mem_fault) + return 0; + *buf++ = hexchars[(ch >> 4) & 0xf]; + *buf++ = hexchars[ch & 0xf]; + } + + *buf = 0; + + __set_mem_fault_trap(0); + + return buf; +} + +/* convert the hex array pointed to by buf into binary to be placed in mem + * return a pointer to the character AFTER the last byte written */ + +static char * +hex2mem(unsigned char *buf, unsigned char *mem, int count, int may_fault) +{ + int i; + unsigned char ch; + + __set_mem_fault_trap (may_fault); + + for (i=0; i> ((numBits - 1) * 8)); + if (v || (numBits == 1)) + { + v = v & 255; + *(ptr++) = __tohex ((v / 16) & 15); + *(ptr++) = __tohex (v & 15); + numChars += 2; + } + numBits--; + } + + return (numChars); +} + +void +__handle_exception (void) +{ + void breakinst(void); + int sigval; + + interruptible (0); + + // Expand the HAL_SavedRegisters structure into the GDB register + // array format. + HAL_GET_GDB_REGISTERS (®isters[0], _hal_registers); + _registers = ®isters[0]; + + /* reply to host that an exception has occurred */ + sigval = __computeSignal (__get_trap_number ()); + + if (__is_breakpoint_function ()) + __skipinst (); + +#if 0 //def SIGSYSCALL + if(sigval == SIGSYSCALL) + { + int val; + /* Do the skipinst FIRST. */ + __skipinst (); + val = __process_syscall_vec (__get_syscall_num ()); + if (val == 0) + return; + else if (val < 0) + sigval = -val; + } + +#endif + + while (__process_exception_vec (sigval)); + + + // Compact register array again. + HAL_SET_GDB_REGISTERS (_hal_registers, ®isters[0]); + + interruptible (1); +} + +static int +process_packet (char *packet) +{ +//diag_printf("pkt %s\n",packet); + remcomOutBuffer[0] = 0; + + switch (packet[0]) + { + case '?': + { + int sigval = __computeSignal (__get_trap_number ()); + remcomOutBuffer[0] = 'S'; + remcomOutBuffer[1] = hexchars[(sigval >> 4) & 0xf]; + remcomOutBuffer[2] = hexchars[sigval & 0xf]; + remcomOutBuffer[3] = 0; + break; + } + + case 'd': + /* toggle debug flag */ + break; + + case 'q': + /* general query packet */ + process_query (&packet[1]); + break; + + case 'Q': + /* general set packet */ + process_set (&packet[1]); + break; + + case 'g': /* return the value of the CPU registers */ + { + char *ptr = remcomOutBuffer; + int x; + + for (x = 0; x < NUMREGS_GDB; x++) + { + /* We need to compensate for the value offset within the + register. */ + target_register_t addr = thread_get_register (x); + char *vptr = ((char *)&addr) + sizeof(addr) - REGSIZE(x); + + ptr = __mem2hex(vptr, ptr, REGSIZE(x), 0); + } + break; + } + + case 'P': + case 'G': /* set the value of the CPU registers - return OK */ + { + int x; + int sr = 0, er = NUMREGS_GDB; + char *ptr = &packet[1]; + + if (packet[0] == 'P') + { + target_register_t regno; + + if (__hexToInt (&ptr, ®no) + && (*ptr++ == '=')) + { + sr = regno; + er = regno + 1; + } + else + { + strcpy (remcomOutBuffer, "P01"); + break; + } + } + + for (x = sr; x < er; x++) + { + target_register_t value = 0; + + char *vptr = ((char *)&value) + sizeof(value) - REGSIZE(x); + hex2mem(ptr, vptr, REGSIZE (x), 0); + thread_put_register (x, value); + ptr += REGSIZE(x) * 2; + } + + strcpy (remcomOutBuffer, "OK"); + break; + } + + case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */ + /* Try to read %x,%x. */ + { + target_register_t addr, length; + char *ptr = &packet[1]; + + if (__hexToInt(&ptr, &addr) + && *ptr++ == ',' + && __hexToInt(&ptr, &length)) + { + if (__mem2hex ((char *)addr, remcomOutBuffer, length, 1)) + break; + + strcpy (remcomOutBuffer, "E03"); + } + else + strcpy(remcomOutBuffer,"E01"); + break; + } + + case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ + /* Try to read '%x,%x:'. */ + { + target_register_t addr, length; + char *ptr = &packet[1]; + + if (__hexToInt(&ptr, &addr) + && *ptr++ == ',' + && __hexToInt(&ptr, &length) + && *ptr++ == ':') + { + if (hex2mem(ptr, (char *)addr, length, 1)) + strcpy(remcomOutBuffer, "OK"); + else + strcpy(remcomOutBuffer, "E03"); + } + else + strcpy(remcomOutBuffer, "E02"); + break; + } + + case 'S': + case 's': /* sAA..AA Step from address AA..AA(optional) */ + case 'C': + case 'c': /* cAA..AA Continue at address AA..AA(optional) */ + /* try to read optional parameter, pc unchanged if no parm */ + + { + char *ptr = &packet[1]; + target_register_t addr; + target_register_t foo = 99999; + target_register_t sigval; + +//diag_printf("stepping\n"); + sigval = foo; + if (packet[0] == 'C' || packet[0] == 'S') + { + __hexToInt (&ptr, &sigval); + if (*ptr == ';') + ptr++; + } + + if (__hexToInt(&ptr, &addr)) + set_pc (addr); + + /* Need to flush the instruction cache here, as we may have deposited a + breakpoint, and the icache probably has no way of knowing that a data ref to + some location may have changed something that is in the instruction cache. + */ + + flush_i_cache (); + + if (sigval != foo) + { + if (__process_signal_vec != NULL) + { + if (! __process_signal_vec (sigval)) + return -1; + } + sigval = SIGKILL; /* Always nuke the program */ + kill_program (sigval); + return 0; + } + + /* Set machine state to force a single step. */ + if (packet[0] == 's' || packet[0] == 'S') + single_step (); + + return -1; + } + + /* kill the program */ + case 'k' : + __process_exit_vec (); + return 1; +#if 0 + case 't': /* Test feature */ + __asm__ (" std %f30,[%sp]"); + break; +#endif + case 'r': /* Reset */ + __reset (); + break; + case 'H': + STUB_PKT_CHANGETHREAD (packet+1, remcomOutBuffer, 300) ; + break ; + case 'T' : + STUB_PKT_THREAD_ALIVE (packet+1, remcomOutBuffer, 300) ; + break ; + + case 'b': /* bBB... Set baud rate to BB... */ + { + target_register_t baudrate; + + char *ptr = &packet[1]; + if (!__hexToInt(&ptr, &baudrate)) + { + strcpy(remcomOutBuffer,"B01"); + break; + } + + putpacket ("OK"); /* Ack before changing speed */ + __set_baud_rate (baudrate); + break; + } + } + + /* reply to the request */ + putpacket (remcomOutBuffer); + return 0; +} + +static void +send_t_packet (int sigval) +{ + __build_t_packet (sigval, remcomOutBuffer); + putpacket(remcomOutBuffer); +} + +/* + * This function does all command procesing for interfacing to gdb. + */ + +static int +process_exception (int sigval) +{ + int status; + + /* Nasty. */ + if (ungot_char < 0) + send_t_packet (sigval); + + /* Undo effect of previous single step. */ + clear_single_step (); + + do { + getpacket (remcomInBuffer); + status = process_packet (remcomInBuffer); + } while (status == 0); + + + /* Install breakpoints that may have been set to perform single stepping. */ + install_breakpoints (); + + if (status < 0) + return 0; + else + return 1; +} + +void +__send_exit_status (int status) +{ + remcomOutBuffer[0] = 'W'; + remcomOutBuffer[1] = hexchars[(status >> 4) & 0xf]; + remcomOutBuffer[2] = hexchars[status & 0xf]; + remcomOutBuffer[3] = 0; + putpacket (remcomOutBuffer); +} + +int +__get_gdb_input (char *dest, int maxlen, int block) +{ + char buf[4]; + int len, i; + + buf[0] = 'I'; + buf[1] = '0'; + buf[2] = block ? '0' : '1'; + buf[3] = 0; + putpacket (buf); + getpacket (remcomInBuffer); + if (remcomInBuffer[0] != 'I') + return -1; + len = stubhex (remcomInBuffer[1]) * 16 + stubhex (remcomInBuffer[2]); + for (i = 0; i < len; i++) + { + dest[i] = stubhex (remcomInBuffer[3 + i * 2]) * 16; + dest[i] |= stubhex (remcomInBuffer[3 + i * 2 + 1]); + } + dest[i] = '\0'; + return len; +} + +void +__output_hex_value (target_register_t i) +{ + char buf[32], *ptr=buf+31; + unsigned int x; + + *ptr = 0; + for (x = 0; x < (sizeof(i) * 2); x++) + { + *(--ptr) = hexchars[i & 15]; + i = i >> 4; + } + while (*ptr) + { + putDebugChar (*(ptr++)); + } +} + +int +__output_gdb_string(const char *str, int string_len) +{ + static char buf[1024]; + int x; + int len; + + if (string_len == 0) + string_len = strlen (str); + + len = string_len * 2 + 1; + + buf[0] = 'O'; + for (x = 0; x < string_len; x++) + { + char c = str[x]; + buf[x*2+1] = hexchars[(c >> 4) & 0xf]; + buf[x*2+2] = hexchars[c % 16]; + } + buf[x*2+1] = 0; + putpacket (buf); + return string_len; +} + +static void +do_nothing (void) +{ + /* mmmm */ +} + +static int +syscall_do_nothing (int junk) +{ + return 0; +} + +/* Start the stub running. */ +void +__switch_to_stub () +{ + __process_exception_vec = process_exception; +} + +void +ungetDebugChar (int c) +{ + ungot_char = c; +} + +static void +kill_program (int sigval) +{ + remcomOutBuffer[0] = 'X'; + remcomOutBuffer[1] = hexchars[(sigval >> 4) & 15]; + remcomOutBuffer[2] = hexchars[sigval & 15]; + remcomOutBuffer[3] = 0; + putpacket (remcomOutBuffer); +} + +/* Table used by the crc32 function to calcuate the checksum. */ +static uint32 crc32_table[256]; +static int tableInit = 0; + +/* + Calculate a CRC-32 using LEN bytes of PTR. CRC is the initial CRC + value. + PTR is assumed to be a pointer in the user program. */ + +static uint32 +crc32 (unsigned char *ptr, int len, uint32 crc) +{ + if (! tableInit) + { + /* Initialize the CRC table and the decoding table. */ + uint32 i, j; + uint32 c; + + tableInit = 1; + for (i = 0; i < 256; i++) + { + for (c = i << 24, j = 8; j > 0; --j) + c = c & 0x80000000 ? (c << 1) ^ 0x04c11db7 : (c << 1); + crc32_table[i] = c; + } + } + + __mem_fault = 0; + while (len--) + { + unsigned char ch; + + __read_mem_safe (&ch, (target_register_t) ptr, 1); + if (__mem_fault) + { + break; + } + crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ ch) & 255]; + ptr++; + } + return crc; +} + +/* Handle the 'q' request */ + +static void +process_query (char *pkt) +{ + remcomOutBuffer[0] = '\0'; + if ('C' == pkt[0] && + 'R' == pkt[1] && + 'C' == pkt[2] && + ':' == pkt[3]) + { + target_register_t startmem; + target_register_t length; + uint32 our_crc; + + pkt += 4; + if (__hexToInt (&pkt, &startmem) + && *(pkt++) == ',' + && __hexToInt (&pkt, &length)) + { + our_crc = crc32 ((unsigned char *) startmem, length, 0xffffffff); + if (__mem_fault) + { + strcpy (remcomOutBuffer, "E01"); + } + else + { + int numb = __intToHex (remcomOutBuffer + 1, our_crc, 32); + remcomOutBuffer[0] = 'C'; + remcomOutBuffer[numb + 1] = 0; + } + } + return; + } + else + { + char ch ; + char * subpkt ; + ch = *pkt ; + subpkt = pkt + 1 ; + switch (ch) + { + case 'L' : /* threadlistquery */ + STUB_PKT_GETTHREADLIST (subpkt, remcomOutBuffer, 300); + break ; + case 'P' : /* Thread or process information request */ + STUB_PKT_GETTHREADINFO (subpkt, remcomOutBuffer, 300); + break ; + default: + __process_target_query (pkt, remcomOutBuffer, 300); + break ; + } + } +} + +/* Handle the 'Q' request */ + +static void +process_set (char *pkt) +{ + char ch ; + ch = *pkt ; + + switch (ch) + { + case 'p' : /* Set current process or thread */ + /* reserve the packet id even if support is not present */ + /* Dont strip the 'p' off the header, there are several variations of + this packet */ + STUB_PKT_CHANGETHREAD (pkt, remcomOutBuffer, 300) ; + break ; + default: + __process_target_set (pkt, remcomOutBuffer, 300); + break ; + } +} + +#endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS diff --git a/packages/hal/common/current/src/stubrom/PKGconf.mak b/packages/hal/common/current/src/stubrom/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/src/stubrom/PKGconf.mak @@ -0,0 +1,41 @@ +#=============================================================================== +# +# makefile +# +# kernel/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal +include ../../../../../pkgconf/pkgconf.mak + +TESTS := stubrom + +WHEREAMI := src/stubrom + +default: $(TESTS) + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.prv + diff --git a/packages/hal/common/current/src/stubrom/stubrom.c b/packages/hal/common/current/src/stubrom/stubrom.c new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/src/stubrom/stubrom.c @@ -0,0 +1,54 @@ +/*========================================================================== +// +// stubrom.c +// +// GDB Stub ROM main +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-06-02 +// Purpose: GDB Stub ROM main +// Description: Main program for GDB stub ROM. It simply set the debug +// traps and then breakpoints so we can talk to GDB. +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + +#include + +void cyg_start (void) +{ + set_debug_traps(); + + for(;;) breakpoint(); + + +} + +// End of stubrom.c diff --git a/packages/hal/common/current/src/thread-packets.c b/packages/hal/common/current/src/thread-packets.c new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/src/thread-packets.c @@ -0,0 +1,1303 @@ + +/* + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +#if defined(CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT) \ + && defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) + +/* FIXME: Scan this module for correct sizes of fields in packets */ +#define DEBUG_THREADS 1 +#include "cyg/hal/dbg-threads-api.h" + +/* This file should ALWAYS define debug thread support */ +/* Dont include the object in the link if you dont need the support */ +/* This is NOT the internal unit debug flag, it is a feature control */ +#if defined(DEBUG_THREADS) +#undef DEBUG_THREADS +#define DEBUG_THREADS 1 +#endif + +#define UNIT_TEST 0 +#define GDB_MOCKUP 0 + + +#define STUB_BUF_MAX 300 /* for range checking of packet lengths */ + +#include "thread-pkts.h" + +// Use HAL rather than board.h in eCos +#define PKT_DEBUG 0 +#include +//#include "board.h" + +#if !defined(PKT_DEBUG) +#define PKT_DEBUG 0 +#endif +extern void output_string(char * message) ; + +#if PKT_DEBUG +void output_threadid(char * title,threadref * ref) ; +#warning "PKT_DEBUG macros engaged" +#define PKT_TRACE(title,packet) \ +{ output_string(title) ; output_string(packet) ; output_string("\n") ;} +#else +#define PKT_TRACE(title,packet) {} +#endif + + +/* This is going to be irregular because the various implementations + have adopted different names for registers. + It would be nice to fix them to have a common convention + _stub_registers + stub_registers + alt_stub_registers + */ + +extern target_register_t * _registers ; + /* A pointer to the current set of registers */ +extern target_register_t registers[NUMREGS]; /* The current saved registers */ +extern target_register_t alt_registers[NUMREGS] ; + /* Thread or saved process state */ + + +void __stub_copy_registers( + target_register_t * dest, + target_register_t *src + ) +{ + target_register_t * limit ; + limit = dest + NUMREGS ; + + while (dest < limit) *dest++ = *src++ ; +} + +extern int stubhex(char ch) ; + +/* ----- STUB_PACK_NAK ----------------------------------- */ +/* Pack an error response into the response packet */ + +char * stub_pack_nak(char * outbuf) +{ + *outbuf++ = 'E' ; + *outbuf++ = '0' ; + *outbuf++ = '2' ; + return outbuf ; +} /* stub_pack_nak */ + +/* ----- STUB_PACK_ACK -------------------------- */ +/* Pack an OK achnowledgement */ +char * stub_pack_ack(char * outbuf) +{ + *outbuf++ = 'O' ; + *outbuf++ = 'K' ; + return outbuf ; +} /* stub_pack_ack */ + +/* ------- STUB_UNPACK_INT ------------------------------- */ +/* Unpack a few bytes and return its integer value */ +/* This is where I wish functions could return several values + I would also advance the buffer pointer */ + +int stub_unpack_int(char * buff,int fieldlength) +{ + int retval = 0 ; + int nibble ; + while (fieldlength) + { nibble = stubhex(*buff++) ; + retval |= nibble ; + fieldlength-- ; + if (fieldlength) retval = retval << 4 ; + } + return retval ; +} /* stub_unpack_int */ + +static char * unpack_byte(char * buf, int * value) +{ + *value = stub_unpack_int(buf,2) ; + return buf + 2 ; +} + +static char * unpack_int(char * buf, int * value) +{ + *value = stub_unpack_int(buf,8) ; + return buf + 8 ; +} + +/* We are NOT depending upun extensive libraries */ +static int ishex(char ch,int *val) +{ + if ((ch >= 'a') && (ch <= 'f')) + { *val =ch - 'a' + 10 ; return 1 ; } + if ((ch >= 'A') && (ch <= 'F')) + { *val = ch - 'A' + 10 ; return 1 ;} + if ((ch >= '0') && (ch <= '9')) + { *val = ch - '0' ; return 1 ; } + return 0 ; +} /* ishex */ + +static char * unpack_nibble(char * buf,int * val) +{ + ishex(*buf++,val) ; + return buf ; +} + + +static const char hexchars[] = "0123456789abcdef"; + +static char * pack_hex_byte(char * pkt, unsigned char byte) +{ + *pkt++ = hexchars[(byte >> 4) & 0xf] ; + *pkt++ = hexchars[(byte & 0xf)] ; + return pkt ; +} /* pack_hex_byte */ + +#if 0 // Currenly unused by eCos stub. +/* ---- STUB_PACK_VARLEN_HEX ------------------------------------- */ +/* Format a variable length stream of hex bytes */ + +static char * pack_varlen_hex( + char * pkt, + unsigned int value) +{ + int i ; + static unsigned char n[8] ; + if (value == 0) + { + *pkt++ = '0' ; + return pkt ; + } + else + { + i = 8 ; + while (i-- >= 0 ) /* unpack nibbles into a char array */ + { + n[i] = value & 0x0f ; + value = value >> 4 ; + } + i = 0 ; /* we had descrmented it to -1 */ + while (n[i] == 0 ) i++ ; /* drop leading zeroes */ + while (i++ < 8) *pkt++ = hexchars[n[i]] ; /* pack the number */ + } + return pkt ; +} /* pack_varlen_hex */ +#endif + +/* ------ STUB_UNPACK_VARLEN_HEX -------------------------------- */ +/* Parse a stream of hex bytes which may be of variable length */ +/* return the pointer to the next char */ +/* modify a varparm containing the result */ +/* A failure would look like a non-increment of the buffer pointer */ + +/* This unpacks hex strings that may have been packed using sprintf(%x) */ +/* We assume some non-hex delimits them */ + +char * unpack_varlen_hex( + char * buff, /* packet to parse */ + int * result) +{ + int nibble ; + int retval ; + retval = 0 ; + + while (ishex(*buff,&nibble)) + { + buff++ ; + retval = retval << 4 ; + retval |= nibble & 0x0f ; + } + *result = retval ; + return buff ; +} /* stub_unpack_varlen_int */ + + +/* ------ UNPACK_THREADID ------------------------------- */ +/* A threadid is a 64 bit quantity */ + +#define BUFTHREADIDSIZ 16 /* encode 64 bits in 16 chars of hex */ + +static char * unpack_threadid(char * inbuf, threadref * id) +{ + char * altref ; + char * limit = inbuf + BUFTHREADIDSIZ ; + int x,y ; + altref = (char *) id ; + + while (inbuf < limit) + { + x = stubhex(*inbuf++) ; + y = stubhex(*inbuf++) ; + *altref++ = (x << 4) | y ; + } + return inbuf ; +} /* unpack_threadid */ + + + +/* Pack an integer use leading zeroes */ +static char * pack_int(char * buf,int value) +{ + buf = pack_hex_byte(buf,(value>> 24)& 0xff) ; + buf = pack_hex_byte(buf,(value >>16)& 0xff) ; + buf = pack_hex_byte(buf,(value >>8) & 0x0ff) ; + buf = pack_hex_byte(buf,(value & 0xff)) ; + return buf ; +} /* pack_int */ + + +/* -------- PACK_STRING ---------------------------------------------- */ +/* This stupid string better not contain any funny characters */ +/* Also, the GDB protocol will not cope with NULLs in the + string or at the end of it. + While is is posable to encapsulate the protocol in ays that + preclude filtering for # I am assuming this is a constraint. +*/ + +static char * pack_raw_string(char * pkt,char * string) +{ + char ch ; + while (0 != (ch = *string++)) *pkt++ = ch ; + return pkt ; +} + +static char * pack_string( + char * pkt, + char * string) +{ + char ch ; + int len = 0; + char *s = string; + while( *s++ ) len++; + if (len > 200 ) len = 200 ; /* Bigger than most GDB packets, junk??? */ + pkt = pack_hex_byte(pkt,len) ; + while (len-- > 0) + { + ch = *string++ ; + if ((ch == '\0') || (ch == '#')) ch = '*' ; /* Protect encapsulation */ + *pkt++ = ch ; + } + return pkt ; +} /* pack_string */ + + +/* ----- STUB_PACK_THREADID --------------------------------------------- */ +/* Convert a binary 64 bit threadid and pack it into a xmit buffer */ +/* Return the advanced buffer pointer */ + +static char * pack_threadid(char * pkt, threadref * id) +{ + char * limit ; + unsigned char * altid ; + altid = (unsigned char *) id ; + limit = pkt + BUFTHREADIDSIZ ; + while (pkt < limit) pkt = pack_hex_byte(pkt,*altid++) ; + return pkt ; +} /* stub_pack_threadid */ + +/* UNFORTUNATLY, not all ow the extended debugging system has yet been + converted to 64 but thread referenecces and process identifiers. + These routines do the conversion. + An array of bytes is the correct treatment of an opaque identifier. + ints have endian issues. + */ + +static void int_to_threadref(threadref * id, int value) +{ + unsigned char * scan ; + scan = (unsigned char *) id ; + { + int i = 4 ; + while (i--) *scan++ = 0 ; + } + *scan++ = (value >> 24) & 0xff ; + *scan++ = (value >> 16) & 0xff ; + *scan++ = (value >> 8) & 0xff ; + *scan++ = (value & 0xff) ; +} + +static int threadref_to_int(threadref * ref) +{ + int value = 0 ; + unsigned char * scan ; + int i ; + + scan = (char *) ref ; + scan += 4 ; + i = 4 ; + while (i-- > 0) value = (value << 8) | ((*scan++) & 0xff) ; + return value ; +} /* threadref_to_int */ + +void copy_threadref(threadref * dest, threadref * src) +{ + int i ; + unsigned char * csrc, * cdest ; + csrc = (unsigned char *) src ; + cdest = (unsigned char *) dest ; + i = 8 ; + while (i--) *cdest++ = *csrc++ ; +} + + +int threadmatch( + threadref * dest , + threadref * src + ) +{ + unsigned char * srcp, * destp ; + int i , result ; + srcp = (char *) src ; + destp = (char *) dest ; + i = 8 ; + result = 1 ; + while (i-- > 0 ) result &= (*srcp++ == *destp++) ? 1 : 0 ; + return result ; +} /* threadmatch */ + + + +static char * Tpkt_threadtag = "thread:" ; + +/* ----- STUB_PACK_TPKT_THREADID ------------------------------------ */ +/* retreive, tag and insert a thread identifier into a T packet. */ +/* Insert nothing if the thread identifier is not available */ + +char * stub_pack_Tpkt_threadid(char * pkt) +{ + static threadref thread ; + int fmt = 0 ; /* old format */ + PKT_TRACE("Tpkt-id","---") ; + if (dbg_currthread(&thread)) + { + pkt = pack_raw_string(pkt,Tpkt_threadtag) ; + if (fmt) + pkt = pack_threadid(pkt,&thread) ; + else + /* Until GDB lengthens its thread ids, we have to MASH + the threadid into somthing shorter. PLEASE FIX GDB */ + pkt = pack_int(pkt,threadref_to_int(&thread)) ; + *pkt++ = ';' ; /* terminate variable length int */ + *pkt = '\0' ; /* Null terminate to allow string to be printed, no++ */ + } + PKT_TRACE("packedTpkt","--") ; + return pkt ; +} /* stub_pack_Tpkt_threadid */ + + +void stub_pkt_currthread( + char * inbuf, + char * outbuf, + int bufmax) +{ + threadref thread ; + char * base_out ; + base_out = outbuf ; + + if (dbg_currthread(&thread)) + { + *outbuf++ = 'q' ; + *outbuf++ = 'P' ; /* FIXME: Is this a reasanable code */ + outbuf = pack_threadid(outbuf,&thread) ; /* Long form */ + } + else outbuf = stub_pack_nak(outbuf) ; + *outbuf = '\0' ; /* terminate response packet */ + PKT_TRACE("stub_pkt_currthread(resp) ",base_out) ; +} /* stub_pkt_currthread */ + +/* ----- STUB_PKT_THREAD_ALIVE --------------------------------- */ +/* Answer the thread alive query */ + +void stub_pkt_thread_alive(char * inbuf, + char * outbuf, + int bufmax) +{ + char * prebuf = inbuf ; + int result ; + threadref thread ; + struct cygmon_thread_debug_info info ; + + if (prebuf != (inbuf = unpack_varlen_hex(inbuf,&result))) + { + int_to_threadref(&thread,result) ; + /* pack old format into internal format */ + if ((dbg_threadinfo(&thread,&info)) + && info.context_exists) + { outbuf = stub_pack_ack(outbuf) ; + *outbuf = '\0' ; + return ; + } + } + outbuf = stub_pack_nak(outbuf) ; + *outbuf = '\0' ; /* terminate the response message */ +} /* stub_pkt_thread_alive */ + + + +/* ----- STUB_PKT_CHANGETHREAD ------------------------------- */ +/* Switch the display of registers to that of a saved context */ + +/* Changing the context makes NO sense, although the packets define the + capability. Therefore, the option to change the context back does + call the function to change registers. Also, there is no + forced context switch. + 'p' - New format, long long threadid, no special cases + 'c' - Old format, id for continue,32 bit threadid max, possably less + -1 contimue means continue all threads + 'g' - Old Format, id for general use (other than continue) + + replies: + OK for success + ENN for error + */ + +void stub_pkt_changethread( + char * inbuf, + char * outbuf, + int bufmax) +{ + threadref id ; + int idefined = -1 ; + char ch ; + PKT_TRACE("setthread-pkt ",inbuf) ; + + /* Parse the incoming packet for a thread identifier */ + switch (ch = *inbuf++ ) /* handle various packet formats */ + { + case 'p' : /* New format: mode:8,threadid:64 */ + inbuf = unpack_nibble(inbuf,&idefined) ; + inbuf = unpack_threadid(inbuf,&id) ; /* even if startflag */ + break ; + case 'c' : /* old format , specify thread for continue */ + outbuf = stub_pack_nak(outbuf) ; /* Not supported */ + break ; + case 'g' : /* old format, specify thread for general operations */ + /* OLD format: parse a variable length hex string */ + /* OLD format consider special thread ids */ + { + int oldthreadid ; + inbuf = unpack_varlen_hex(inbuf,&oldthreadid) ; + int_to_threadref(&id,oldthreadid) ; + switch (oldthreadid) + { + case 0 : /* pick a thread, any thread */ + idefined = 2 ; /* select original interrupted context */ + break ; + case -1 : /* all threads */ + idefined = 2 ; + break ; + default : + idefined = 1 ; /* select the specified thread */ + break ; + } + } + break ; + default: + outbuf = stub_pack_nak(outbuf) ; + break ; + } /* handle various packet formats */ + + + switch (idefined) + { + case -1 : + /* Packet not supported, already NAKed, no further action */ + break ; + case 0 : + /* Switch back to interrupted context */ + _registers = ®isters[0] ; + break ; + case 1 : + /* copy the saved registers into the backup registers */ + __stub_copy_registers(alt_registers,registers) ; + /* The OS will now update the values it has in a saved process context*/ + if (dbg_getthreadreg(&id,NUMREGS,&alt_registers[0])) + { + /* switch the registers pointer */ + _registers = &alt_registers[0] ; + outbuf = stub_pack_ack(outbuf) ; + } + else + outbuf = stub_pack_nak(outbuf) ; + break ; + case 2 : break ; /* switch to interrupted context */ + default: + outbuf = stub_pack_nak(outbuf) ; + break ; + } + *outbuf = '\0' ; /* Terminate response pkt */ +} /* stub_pkt-changethread */ + + +/* ---- STUB_PKT_GETTHREADLIST ------------------------------- */ +/* Get a portion of the threadlist or process list */ +/* This may be part of a multipacket transaction */ +/* It would be hard to tell in the response packet the difference + between the end of list and an error in threadid encoding. + */ + +void stub_pkt_getthreadlist(char * inbuf, + char * outbuf, + int bufmax) +{ + char * count_ptr ; + char * done_ptr ; + char * limit ; + int start_flag , batchsize , result , count ; + static threadref lastthread, nextthread ; + +#if PKT_DEBUG + char * r_base = outbuf ; +#endif + PKT_TRACE("pkt_getthreadlist: ",inbuf) ; + + count = 0 ; + inbuf = unpack_nibble(inbuf,&start_flag) ; + inbuf = unpack_byte(inbuf,&batchsize) ; + inbuf = unpack_threadid(inbuf,&lastthread) ; /* even if startflag */ + + /* Start building response packet */ + limit = outbuf + (bufmax - BUFTHREADIDSIZ - 10) ; /* id output packing limit */ + *outbuf++ = 'Q' ; + *outbuf++ = 'M' ; + + /* Default values for count and done fields, save ptr to repatch */ + count_ptr = outbuf ; /* save to repatch count */ + outbuf = pack_hex_byte(outbuf,0) ; + done_ptr = outbuf ; /* Backpatched later */ + *outbuf++ = '0' ; /* Done = 0 by default */ + outbuf = pack_threadid(outbuf,&lastthread) ; + + /* Loop through the threadid packing */ + while ((outbuf < limit) && (count < batchsize)) + { + result = dbg_threadlist(start_flag,&lastthread,&nextthread) ; + start_flag = 0 ; /* redundent but effective */ + if (!result) + { *done_ptr = '1' ; /* pack the done flag */ + break ; + } +#if 0 /* DEBUG */ + if (threadmatch(&lastthread,&nextthread)) + { + output_string("FAIL: Threadlist, not incrementing\n") ; + *done_ptr = '1' ; + break ; + } +#endif + count++ ; + outbuf = pack_threadid(outbuf,&nextthread) ; + copy_threadref(&lastthread,&nextthread) ; + } + pack_hex_byte(count_ptr,count) ;/* backpatch, Pack the count field */ + *outbuf = '\0' ; + PKT_TRACE("pkt_getthreadlist(resp) ",r_base) ; +} /* pkt_getthreadlist */ + + + + +/* ----- STUB_PKT_GETTHREADINFO ---------------------------------------- */ +/* Get the detailed information about a specific thread or process */ + +/* +Encoding: + 'Q':8,'P':8,mask:16 + + Mask Fields + threadid:1, # always request threadid + context_exists:2, + display:4, + unique_name:8, + more_display:16 + */ + +void stub_pkt_getthreadinfo( + char * inbuf, + char * outbuf, + int bufmax) +{ + int mask ; + int result ; + threadref thread ; + struct cygmon_thread_debug_info info ; + + info.context_exists = 0 ; + info.thread_display = 0 ; + info.unique_thread_name = 0 ; + info.more_display = 0 ; + + /* Assume the packet identification chars have already been + discarded by the packet demultiples routines */ + PKT_TRACE("PKT getthreadinfo",inbuf) ; + + inbuf = unpack_int(inbuf,&mask) ; + inbuf = unpack_threadid(inbuf,&thread) ; + + result = dbg_threadinfo(&thread,&info) ; /* Make system call */ + + if (result) + { + *outbuf++ = 'q' ; + *outbuf++ = 'p' ; + outbuf = pack_int(outbuf,mask) ; + outbuf = pack_threadid(outbuf,&info.thread_id) ; /* echo threadid */ + if (mask & 2) /* context-exists */ + { + outbuf = pack_int(outbuf,2) ; /* tag */ + outbuf = pack_hex_byte(outbuf,2) ; /* length */ + outbuf = pack_hex_byte(outbuf,info.context_exists) ; + } + if ((mask & 4) && info.thread_display)/* display */ + { + outbuf = pack_int(outbuf,4) ; /* tag */ + outbuf = pack_string(outbuf,info.thread_display) ; + } + if ((mask & 8) && info.unique_thread_name) /* unique_name */ + { + outbuf = pack_int(outbuf,8) ; + outbuf = pack_string(outbuf,info.unique_thread_name) ; + } + if ((mask & 16) && info.more_display) /* more display */ + { + outbuf = pack_int(outbuf,16) ; /* tag 16 */ + outbuf = pack_string(outbuf,info.more_display) ; + } + } + else + { + PKT_TRACE("FAIL: dbg_threadinfo\n", "") ; + outbuf = stub_pack_nak(outbuf) ; + } + *outbuf = '\0' ; +} /* stub_pkt_getthreadinfo */ + + + + +#if GDB_MOCKUP +/* ------ MATCHED GDB SIDE PACKET ENCODING AND PARSING ----------------- */ + +char * pack_nibble(char * buf, int nibble) +{ + *buf++ = hexchars[(nibble & 0x0f)] ; + return buf ; +} /* pack_nibble */ + +#if 0 +static char * unpack_short(char * buf,int * value) +{ + *value = stub_unpack_int(buf,4) ; + return buf + 4 ; +} + +static char * pack_short( + char * buf, + unsigned int value) +{ + buf = pack_hex_byte(buf,(value >> 8) & 0xff) ; + buf = pack_hex_byte(buf,(value & 0xff)) ; + return buf ; +} /* pack_short */ +#endif + + +/* Generally, I dont bury xmit and receive calls inside packet formatters + and parsers + */ + + + + +/* ----- PACK_SETTHREAD_REQUEST ------------------------------------- */ +/* Encoding: ??? decode gdb/remote.c + 'Q':8,'p':8,idefined:8,threadid:32 ; + */ + +char * pack_setthread_request( + char * buf, + char fmt, /* c,g or, p */ + int idformat , + threadref * threadid ) +{ + *buf++ = fmt ; + + if (fmt == 'p') + { /* pack the long form */ + buf = pack_nibble(buf,idformat) ; + buf = pack_threadid(buf,threadid) ; + } + else + { /* pack the shorter form - Serious truncation */ + /* There are reserved identifieds 0 , -1 */ + int quickref = threadref_to_int(threadid) ; + buf = pack_varlen_hex(buf,quickref) ; + } + *buf++ = '\0' ; /* end_of_packet */ + return buf ; +} /* pack_setthread_request */ + + + +/* -------- PACK_THREADLIST-REQUEST --------------------------------- */ +/* Format: i'Q':8,i"L":8,initflag:8,batchsize:16,lastthreadid:32 */ + + +char * pack_threadlist_request( + char * pkt, + int startflag, + int threadcount, + threadref * nextthread + ) +{ + *pkt++ = 'q' ; + *pkt++ = 'L' ; + pkt = pack_nibble(pkt,startflag) ; /* initflag 1 bytes */ + pkt = pack_hex_byte(pkt,threadcount) ; /* threadcount 2 bytes */ + pkt = pack_threadid(pkt,nextthread) ; /* 64 bit thread identifier */ + *pkt = '\0' ; + return pkt ; +} /* remote_threadlist_request */ + + + + +/* ---------- PARSE_THREADLIST_RESPONSE ------------------------------------ */ +/* Encoding: 'q':8,'M':8,count:16,done:8,argthreadid:64,(threadid:64)* */ + +int parse_threadlist_response( + char * pkt, + threadref * original_echo, + threadref * resultlist, + int * doneflag) +{ + char * limit ; + int count, resultcount , done ; + resultcount = 0 ; + + /* assume the 'q' and 'M chars have been stripped */ + PKT_TRACE("parse-threadlist-response ",pkt) ; + limit = pkt + (STUB_BUF_MAX - BUFTHREADIDSIZ) ; /* done parse past here */ + pkt = unpack_byte(pkt,&count) ; ; /* count field */ + pkt = unpack_nibble(pkt,&done) ; + /* The first threadid is the argument threadid */ + pkt = unpack_threadid(pkt,original_echo) ; /* should match query packet */ + while ((count-- > 0) && (pkt < limit)) + { + pkt = unpack_threadid(pkt,resultlist++) ; + resultcount++ ; + } + if (doneflag) *doneflag = done ; + return resultcount ; /* successvalue */ +} /* parse_threadlist_response */ + +struct gdb_ext_thread_info +{ + threadref threadid ; + int active ; + char display[256] ; + char shortname[32] ; + char more_display[256] ; +} ; + + +/* ----- PACK_THREAD_INFO_REQUEST -------------------------------- */ + +/* + threadid:1, # always request threadid + context_exists:2, + display:4, + unique_name:8, + more_display:16 + */ + +/* Encoding: 'Q':8,'P':8,mask:32,threadid:64 */ + +char * pack_threadinfo_request(char * pkt, + int mode, + threadref * id + ) +{ + *pkt++ = 'Q' ; + *pkt++ = 'P' ; + pkt = pack_int(pkt,mode) ; /* mode */ + pkt = pack_threadid(pkt,id) ; /* threadid */ + *pkt = '\0' ; /* terminate */ + return pkt ; +} /* pack_thread_info_request */ + + + +static char * unpack_string( + char * src, + char * dest, + int length) +{ + while (length--) *dest++ = *src++ ; + *dest = '\0' ; + return src ; +} /* unpack_string */ + + +void output_threadid(char * title,threadref * ref) +{ + char hexid[20] ; + pack_threadid(&hexid[0],ref) ; /* Convert threead id into hex */ + hexid[16] = 0 ; + output_string(title) ; output_string(&hexid[0]) ; output_string("\n"); +} + +/* ------ REMOTE_UPK_THREAD_INFO_RESPONSE ------------------------------- */ +/* Unpack the response of a detailed thread info packet */ +/* Encoding: i'Q':8,i'R':8,argmask:16,threadid:64,(tag:8,length:16,data:x)* */ + +#define TAG_THREADID 1 +#define TAG_EXISTS 2 +#define TAG_DISPLAY 4 +#define TAG_THREADNAME 8 +#define TAG_MOREDISPLAY 16 + + +int remote_upk_thread_info_response( + char * pkt, + threadref * expectedref , + struct gdb_ext_thread_info * info) +{ + int mask, length ; + unsigned int tag ; + threadref ref ; + char * limit = pkt + 500 ; /* plausable parsing limit */ + int retval = 1 ; + + PKT_TRACE("upk-threadinfo ",pkt) ; + + /* info->threadid = 0 ; FIXME: implement zero_threadref */ + info->active = 0 ; + info->display[0] = '\0' ; + info->shortname[0] = '\0' ; + info->more_display[0] = '\0' ; + + /* Assume the characters indicating the packet type have been stripped */ + pkt = unpack_int(pkt,&mask) ; /* arg mask */ + pkt = unpack_threadid(pkt , &ref) ; + + if (! threadmatch(&ref,expectedref)) + { /* This is an answer to a different request */ + output_string("FAIL Thread mismatch\n") ; + output_threadid("ref ",&ref) ; + output_threadid("expected ",expectedref) ; + return 0 ; + } + copy_threadref(&info->threadid,&ref) ; + + /* Loop on tagged fields , try to bail if somthing goes wrong */ + if (mask==0) output_string("OOPS NO MASK \n") ; + + while ((pkt < limit) && mask && *pkt) /* packets are terminated with nulls */ + { + pkt = unpack_int(pkt,&tag) ; /* tag */ + pkt = unpack_byte(pkt,&length) ; /* length */ + if (! (tag & mask)) /* tags out of synch with mask */ + { + output_string("FAIL: threadinfo tag mismatch\n") ; + retval = 0 ; + break ; + } + if (tag == TAG_THREADID) + { + output_string("unpack THREADID\n") ; + if (length != 16) + { + output_string("FAIL: length of threadid is not 16\n") ; + retval = 0 ; + break ; + } + pkt = unpack_threadid(pkt,&ref) ; + mask = mask & ~ TAG_THREADID ; + continue ; + } + if (tag == TAG_EXISTS) + { + info->active = stub_unpack_int(pkt,length) ; + pkt += length ; + mask = mask & ~(TAG_EXISTS) ; + if (length > 8) + { + output_string("FAIL: 'exists' length too long\n"); + retval = 0 ; + break ; + } + continue ; + } + if (tag == TAG_THREADNAME) + { + pkt = unpack_string(pkt,&info->shortname[0],length) ; + mask = mask & ~TAG_THREADNAME ; + continue ; + } + if (tag == TAG_DISPLAY) + { + pkt = unpack_string(pkt,&info->display[0],length) ; + mask = mask & ~TAG_DISPLAY ; + continue ; + } + if (tag == TAG_MOREDISPLAY) + { + pkt = unpack_string(pkt,&info->more_display[0],length) ; + mask = mask & ~TAG_MOREDISPLAY ; + continue ; + } + output_string("FAIL: unknown info tag\n") ; + break ; /* Not a tag we know about */ + } + return retval ; +} /* parse-thread_info_response */ + + +/* ---- REMOTE_PACK-CURRTHREAD_REQUEST ---------------------------- */ +/* This is a request to emit the T packet */ + +/* FORMAT: 'q':8,'C' */ + +char * remote_pack_currthread_request(char * pkt ) +{ + *pkt++ = 'q' ; + *pkt++ = 'C' ; + *pkt = '\0' ; + return pkt ; +} /* remote_pack-currthread_request */ + + +/* ------- REMOTE_UPK_CURTHREAD_RESPONSE ----------------------- */ +/* Unpack the interesting part of a T packet */ + + +int remote_upk_currthread_response( + char * pkt, + threadref * ref ) /* Parse a T packet */ +{ + int retval = 0 ; + PKT_TRACE("upk-currthreadresp ",pkt) ; + +#if 0 + { + static char threadtag[8] = "thread" ; + int retval = 0 ; + int i , found ; + char ch ; + int quickid ; + + /* Unpack as a t packet */ + while (((ch = *pkt++) != ':') /* scan for : thread */ + && (ch != '\0')) /* stop at end of packet */ + + { + found = 0 ; + i = 0 ; + while ((ch = *pkt++) == threadtag[i++]) ; + if (i == 8) /* string match "thread" */ + { + pkt = unpack_varlen_hex(pkt,&quickid) ; + retval = 1; + break ; + } + retval = 0 ; + } + } +#else + pkt = unpack_threadid(pkt,ref) ; + retval = 1 ; +#endif + return retval ; +} /* remote_upk_currthread_response */ + + +/* -------- REMOTE_UPK-SIMPLE_ACK --------------------------------- */ +/* Decode a response which is eother "OK" or "Enn" + fillin error code, fillin pkfag-1== undef, 0==nak, 1 == ack ; + return advanced packet pointer */ + + +char * remote_upk_simple_ack( + char * buf, + int * pkflag, + int * errcode) +{ + int lclerr = 0 ; + char ch = *buf++ ; + int retval = -1 ; /* Undefined ACK , a protocol error */ + if (ch == 'E') /* NAK */ + { + buf = unpack_byte(buf,&lclerr) ; + retval = 0 ; /* transaction failed, explicitly */ + } + else + if ((ch == 'O') && (*buf++ == 'K')) /* ACK */ + retval = 1 ; /* transaction succeeded */ + *pkflag = retval ; + *errcode = lclerr ; + return buf ; +} /* remote-upk_simple_ack */ + + +/* -------- PACK_THREADALIVE_REQUEST ------------------------------- */ + +char * pack_threadalive_request( + char * buf, + threadref * threadid) +{ + *buf++ = 'T' ; + buf = pack_threadid(buf,threadid) ; + *buf = '\0' ; + return buf ; +} /* pack_threadalive_request */ + +#endif /* GDB_MOCKUP */ + +/* ---------------------------------------------------------------------- */ +/* UNIT_TESTS SUBSECTION */ +/* ---------------------------------------------------------------------- */ + + +#if UNIT_TEST +extern void output_string(char * message) ; +static char test_req[400] ; +static char t_response[400] ; + + + +/* ----- DISPLAY_THREAD_INFO ---------------------------------------------- */ +/* Use local cygmon string output utiities */ + +void display_thread_info(struct gdb_ext_thread_info * info) +{ + + output_threadid("Threadid: ",&info->threadid) ; + /* short name */ + output_string("Name: ") ; output_string(info->shortname) ; output_string("\n"); + /* format display state */ + output_string("State: ") ; output_string(info->display) ; output_string("\n") ; + /* additional data */ + output_string("other: ");output_string(info->more_display); + output_string("\n\n"); +} /* display_thread_info */ + + +/* --- CURRTHREAD-TEST -------------------------------------------- */ +static int currthread_test(threadref * thread) +{ + int result ; + output_string("TEST: currthread\n") ; + remote_pack_currthread_request(test_req) ; + stub_pkt_currthread(test_req+2,t_response,STUB_BUF_MAX) ; + result = remote_upk_currthread_response(t_response+2,thread) ; + if (result) + { + output_string("PASS getcurthread\n") ; + /* FIXME: print the thread */ + } + else + output_string("FAIL getcurrthread\n") ; + return result ; +} /* currthread_test */ + +/* ------ SETTHREAD_TEST ------------------------------------------- */ + /* use a known thread from previous test */ + +static int setthread_test(threadref * thread) +{ + int result, errcode ; + output_string("TEST: setthread\n") ; + + pack_setthread_request(test_req,'p',1,thread) ; + stub_pkt_changethread(test_req,t_response,STUB_BUF_MAX) ; + remote_upk_simple_ack(t_response,&result,&errcode) ; + switch (result) + { + case 0 : + output_string("FAIL setthread\n") ; + break ; + case 1 : + output_string("PASS setthread\n") ; + break ; + default : + output_string("FAIL setthread -unrecognized response\n") ; + break ; + } + return result ; +} /* setthread_test */ + + +/* ------ THREADACTIVE_TEST ---------------------- */ + /* use known thread */ + /* pack threadactive packet */ + /* process threadactive packet */ + /* parse threadactive response */ + /* check results */ + + +int threadactive_test(threadref * thread) +{ + int result ; + int errcode ; + output_string("TEST: threadactive\n") ; + pack_threadalive_request(test_req,thread) ; + stub_pkt_thread_alive(test_req+1,t_response,STUB_BUF_MAX); + remote_upk_simple_ack(t_response,&result,&errcode) ; + switch (result) + { + case 0 : + output_string("FAIL threadalive\n") ; + break ; + case 1 : + output_string("PASS threadalive\n") ; + break ; + default : + output_string("FAIL threadalive -unrecognized response\n") ; + break ; + } + return result ; +} /* threadactive_test */ + +/* ------ REMOTE_GET_THREADINFO -------------------------------------- */ +int remote_get_threadinfo( + threadref * threadid, + int fieldset , /* TAG mask */ + struct gdb_ext_thread_info * info + ) +{ + int result ; + pack_threadinfo_request(test_req,fieldset,threadid) ; + stub_pkt_getthreadinfo(test_req+2,t_response,STUB_BUF_MAX) ; + result = remote_upk_thread_info_response(t_response+2,threadid,info) ; + return result ; +} /* remote_get-thrreadinfo */ + + +static struct gdb_ext_thread_info test_info ; + +static int get_and_display_threadinfo(threadref * thread) +{ + int mode ; + int result ; + /* output_string("TEST: get and display threadinfo\n") ; */ + + mode = TAG_THREADID | TAG_EXISTS | TAG_THREADNAME + | TAG_MOREDISPLAY | TAG_DISPLAY ; + result = remote_get_threadinfo(thread,mode,&test_info) ; + if (result) display_thread_info(&test_info) ; +#if 0 /* silent subtest */ + if (result) + output_string("PASS: get_and_display threadinfo\n") ; + else + output_string("FAIL: get_and_display threadinfo\n") ; +#endif + return result ; +} /* get-and-display-threadinfo */ + + + +/* ----- THREADLIST_TEST ------------------------------------------ */ +#define TESTLISTSIZE 16 +#define TLRSIZ 2 +static threadref test_threadlist[TESTLISTSIZE] ; + +static int threadlist_test(void) +{ + int done, i , result_count ; + int startflag = 1 ; + int result = 1 ; + int loopcount = 0 ; + static threadref nextthread ; + static threadref echo_nextthread ; + + output_string("TEST: threadlist\n") ; + + done = 0 ; + while (! done) + { + if (loopcount++ > 10) + { + result = 0 ; + output_string("FAIL: Threadlist test -infinite loop-\n") ; + break ; + } + pack_threadlist_request(test_req,startflag,TLRSIZ,&nextthread) ; + startflag = 0 ; /* clear for later iterations */ + stub_pkt_getthreadlist(test_req+2,t_response,STUB_BUF_MAX); + result_count = parse_threadlist_response(t_response+2, + &echo_nextthread, + &test_threadlist[0],&done) ; + if (! threadmatch(&echo_nextthread,&nextthread)) + { + output_string("FAIL: threadlist did not echo arg thread\n"); + result = 0 ; + break ; + } + if (result_count <= 0) + { + if (done != 0) + { output_string("FAIL threadlist_test, failed to get list"); + result = 0 ; + } + break ; + } + if (result_count > TLRSIZ) + { + output_string("FAIL: threadlist response longer than requested\n") ; + result = 0 ; + break ; + } + /* Setup to resume next batch of thread references , set nestthread */ + copy_threadref(&nextthread,&test_threadlist[result_count-1]) ; + /* output_threadid("last-of-batch",&nextthread) ; */ + i = 0 ; + while (result_count--) + { + if (0) /* two display alternatives */ + output_threadid("truncatedisplay",&test_threadlist[i++]) ; + else + get_and_display_threadinfo(&test_threadlist[i++]) ; + } + + } + if (!result) + output_string("FAIL: threadlist test\n") ; + else output_string("PASS: Threadlist test\n") ; + return result ; +} /* threadlist_test */ + + +static threadref testthread ; + + +int test_thread_support(void) +{ + int result = 1 ; + output_string("TESTING Thread support infrastructure\n") ; + stub_pack_Tpkt_threadid(test_req) ; + PKT_TRACE("packing the threadid -> ",test_req) ; + result &= currthread_test(&testthread) ; + result &= get_and_display_threadinfo(&testthread) ; + result &= threadlist_test() ; + result &= setthread_test(&testthread) ; + if (result) + output_string("PASS: UNITTEST Thread support\n") ; + else + output_string("FAIL: UNITTEST Thread support\n") ; + return result ; +} /* test-thread_support */ +#endif /* UNIT_TEST */ + +#endif // ifdef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT... diff --git a/packages/hal/common/current/src/thread-pkts.h b/packages/hal/common/current/src/thread-pkts.h new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/src/thread-pkts.h @@ -0,0 +1,61 @@ +/* thread-packets.h - + Optional packet processing for thread aware debugging. + Externs as called by central packet switch routine + */ + +/* + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +/* The DEBUG_THREADS flag is usually set in board.h */ + + +#if DEBUG_THREADS /* activate this in board.h */ + +extern void stub_pkt_changethread(char * inbuf, + char * outbuf, + int bufmax) ; + + +extern void stub_pkt_getthreadlist(char * inbuf, + char * outbuf, + int bufmax) ; + + +extern void stub_pkt_getthreadinfo( + char * inbuf, + char * outbuf, + int bufmax) ; + +extern void stub_pkt_thread_alive( + char * inbuf, + char * outbuf, + int bufmax) ; + +extern void stub_pkt_currthread( + char * inbuf, + char * outbuf, + int bufmax) ; + +#define STUB_PKT_GETTHREADLIST(a,b,c) { stub_pkt_getthreadlist(a,b,c);} +#define STUB_PKT_GETTHREADINFO(a,b,c) { stub_pkt_getthreadinfo(a,b,c);} +#define STUB_PKT_CHANGETHREAD(a,b,c) { stub_pkt_changethread(a,b,c);} +#define STUB_PKT_THREAD_ALIVE(a,b,c) { stub_pkt_thread_alive(a,b,c);} +#define STUB_PKT_CURRTHREAD(a,b,c) { stub_pkt_currthread(a,b,c);} +#else +#define STUB_PKT_GETTHREADLIST(a,b,c) {} +#define STUB_PKT_GETTHREADINFO(a,b,c) {} +#define STUB_PKT_CHANGETHREAD(a,b,c) {} +#define STUB_PKT_THREAD_ALIVE(a,b,c) {} +#define STUB_PKT_CURRTHREAD(a,b,c) {} +#endif diff --git a/packages/hal/common/current/tests/PKGconf.mak b/packages/hal/common/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/tests/PKGconf.mak @@ -0,0 +1,39 @@ +#=============================================================================== +# +# makefile +# +# hal/common/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal +include ../../../../pkgconf/pkgconf.mak + +TESTS := cache intr context + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + + diff --git a/packages/hal/common/current/tests/cache.c b/packages/hal/common/current/tests/cache.c new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/tests/cache.c @@ -0,0 +1,148 @@ +/*================================================================= +// +// cache.c +// +// HAL Cache timing test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm, nickg +// Date: 1998-06-18 +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#include + +// ------------------------------------------------------------------------- + +#define MAXSIZE 1<<18 + +volatile char m[MAXSIZE]; + +// ------------------------------------------------------------------------- + +static void time0(register cyg_uint32 stride) +{ + register cyg_uint32 j,k; +// cyg_tick_count_t count0, count1; +// cyg_ucount32 t; + register char c; + +// count0 = current_time(); + + for(k=0; k<4000;k++) { + for(j=0; j<(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE); j++) { + c=m[stride*j]; + } + } + +// count1 = current_time(); +// t = count1 - count0; +// diag_printf("stride=%d, time=%d\n", stride, t); +} + +// ------------------------------------------------------------------------- + +void time1(void) +{ + cyg_uint32 i; + + for(i=1; i<65; i+=i) { + time0(i); + } +} + +// ------------------------------------------------------------------------- +// This test could be improved by counting number of passes possible +// in a given number of ticks. + +static void entry0( void ) +{ + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + CYG_TEST_INFO("Dcache off Icache off"); + time1(); + + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_ENABLE(); + CYG_TEST_INFO("Dcache on Icache off"); + time1(); + + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_ENABLE(); + HAL_DCACHE_DISABLE(); + CYG_TEST_INFO("Dcache off Icache on"); + time1(); + + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_ENABLE(); + HAL_DCACHE_ENABLE(); + CYG_TEST_INFO("Dcache on Icache on"); + time1(); + + + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + CYG_TEST_INFO("Dcache off Icache off"); + time1(); + + + CYG_TEST_PASS_FINISH("End of test"); +} + +// ------------------------------------------------------------------------- + +void cache_main( void ) +{ + CYG_TEST_INIT(); + + entry0(); + +} + +// ------------------------------------------------------------------------- + +externC void +cyg_start( void ) +{ + cache_main(); +} + +// ------------------------------------------------------------------------- +/* EOF cache.c */ diff --git a/packages/hal/common/current/tests/context.c b/packages/hal/common/current/tests/context.c new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/tests/context.c @@ -0,0 +1,110 @@ +/*================================================================= +// +// context.c +// +// HAL Thread context handling test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-10-07 +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#include + +#include +#include + +#define CYG_TRACE_USER_BOOL 1 + +// ------------------------------------------------------------------------- + +#define THREADS 4 +#define STACKSIZE (2*1024) + +char stack[THREADS][STACKSIZE]; + +CYG_ADDRWORD sp[THREADS]; + +cyg_count32 switches = 0; + +// ------------------------------------------------------------------------- + +void entry0( CYG_ADDRWORD arg ) +{ + CYG_TRACE1B("Thread %d started\n", arg ); + + while( switches < 1000 ) + { + HAL_THREAD_SWITCH_CONTEXT( &sp[arg], &sp[(arg+1) % THREADS] ); + + CYG_TRACE1B("Thread %d resumed\n", arg ); + + switches++; + } + + CYG_TEST_PASS_FINISH("HAL Context test"); + +} + +// ------------------------------------------------------------------------- + +void context_main(void) +{ + int i; + + CYG_TEST_INIT(); + + // Init all thread contexts: + + for( i = 0 ; i < THREADS; i++ ) + { + sp[i] = (CYG_ADDRWORD)stack[i]+STACKSIZE; + + HAL_THREAD_INIT_CONTEXT( sp[i], i, entry0, i*0x01010000 ); + } + + // Load the first thread. + + HAL_THREAD_LOAD_CONTEXT( &sp[0] ); +} + +// ------------------------------------------------------------------------- + +externC void +cyg_start( void ) +{ + context_main(); +} + +// ------------------------------------------------------------------------- +/* EOF context.c */ diff --git a/packages/hal/common/current/tests/intr.c b/packages/hal/common/current/tests/intr.c new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/tests/intr.c @@ -0,0 +1,148 @@ +/*================================================================= +// +// intr.c +// +// HAL Interrupt API test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-10-08 +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#include + +// ------------------------------------------------------------------------- + +#if defined(CYG_HAL_MN10300_STDEVAL1) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 150000 + +#endif +#if defined(CYG_HAL_MN10300_SIM) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 9999 + +#endif + +#if defined(CYG_HAL_MIPS_JMR3904) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 15625 + +#endif + +#if defined(CYG_HAL_MIPS_SIM) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 1000} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 999 + +#endif + +#if defined(CYG_HAL_POWERPC_MP860) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 20625 + +#endif + +#ifndef CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 9999 + +#endif + +// ------------------------------------------------------------------------- + +#define ISR_DATA 0xAAAA1234 + +// ------------------------------------------------------------------------- + +volatile cyg_count32 ticks = 0; + +// ------------------------------------------------------------------------- + +cyg_uint32 isr( cyg_uint32 vector, CYG_ADDRWORD data ) +{ + CYG_TEST_CHECK( ISR_DATA == data , "Bad data passed to ISR"); + CYG_TEST_CHECK( CYG_VECTOR_RTC == vector , "Bad vector passed to ISR"); + + HAL_CLOCK_RESET( vector, CYGNUM_KERNEL_COUNTERS_RTC_PERIOD ); + + HAL_INTERRUPT_ACKNOWLEDGE( vector ); + + ticks++; + + return 0; +} + +// ------------------------------------------------------------------------- + +void intr_main( void ) +{ + CYG_INTERRUPT_STATE oldints; + + CYG_TEST_INIT(); + + HAL_INTERRUPT_ATTACH( CYG_VECTOR_RTC, isr, ISR_DATA, 0 ); + + HAL_CLOCK_INITIALIZE( CYGNUM_KERNEL_COUNTERS_RTC_PERIOD ); + + HAL_INTERRUPT_UNMASK( CYG_VECTOR_RTC ); + + HAL_ENABLE_INTERRUPTS(); + + while( ticks < 10 ) + { + + } + + HAL_DISABLE_INTERRUPTS(oldints); + + CYG_TEST_PASS_FINISH("HAL interrupt test"); +} + + +// ------------------------------------------------------------------------- + +externC void +cyg_start( void ) +{ + intr_main(); +} + + +// ------------------------------------------------------------------------- +/* EOF intr.c */ diff --git a/packages/hal/mips/arch/current/ChangeLog b/packages/hal/mips/arch/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/ChangeLog @@ -0,0 +1,248 @@ +1998-10-27 Jesper Skov + PR 18033 + + * include/hal_intr.h: Replaced CYGIMP_HAL_INTERRUPTS_CHAIN + with the correct CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN. + +1998-10-27 Jesper Skov + PR 18021 + * src/hal_misc.c (hal_ctrlc_isr): Removed break; to prevent + compiler error. + +1998-10-25 Jesper Skov + + * src/mips-stub.c (__build_t_packet): Replaced + CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT with + CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT. + Fixed #endif comment. + + * src/hal_misc.c (hal_ctrlc_isr): Replaced + CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS with + CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS. + + * include/hal_intr.h: Replaced CYGIMP_KERNEL_INTERRUPTS_CHAIN with + CYGIMP_HAL_INTERRUPTS_CHAIN. + +1998-10-23 Jesper Skov + + * include/hal_intr.h: Include pkgconf/hal.h. + +1998-10-16 Bart Veer + + * src/vectors.S (__interrupt_stack): + Made the interrupt stack size configurable. + +1998-10-16 Nick Garnett + + * src/hal_misc.c: + Enabled caches by default. + +1998-10-14 Nick Garnett + + * src/context.S (hal_thread_switch_context): + Store copy of R31(RA) in PC slot in register state to keep GDB + happy. + * include/hal_arch.h (HAL_THREAD_INIT_CONTEXT): + Intialize PC slot in register state. + + * src/hal_misc.c: + Altered ifdefs to allow building without kernel present. + + * include/mips-stub.h: + Include generic-stub.h from HAL rather than from kernel. + + * src/mips-stub.c: + Added signal definitions to avoid including signal.h. + + * include/hal_intr.h: + Added implementations of HAL_INTERRUPT_ACKNOWLEDGE() and + HAL_INTERRUPT_SET_LEVEL(). + +1998-10-13 Jesper Skov + + * src/hal_misc.c: Use GDB array rather than HAL_SavedRegisters + structure. Rely on generic stub to pack/unpack the array. + + * include/hal_arch.h (HAL_GET_GDB_REGISTERS, + HAL_SET_GDB_REGISTERS): get/set full register set. + +1998-10-13 Jesper Skov + + * include/mips-stub.h: Moved first use of regnames below + definition. + +Sun Sep 27 12:17:42 1998 Jesper Skov + + * include/hal_cache.h (HAL_DCACHE_LOCK): Terminate asm string. + +1998-09-26 Nick Garnett + + * include/hal_cache.h: + Cleaned up some compilation errors. + +Tue Sep 15 19:13:43 1998 David Moore + + * src/vectors.S: Cleaned up comments. + +1998-09-15 Nick Garnett + + * include/hal_arch.h (HAL_GET_GDB_REGISTERS): + Initialized R30 to a copy of SP to avoid GDB making bogus memory + references. + + * src/hal_misc.c: + Added support for Ctrl-C processing when running under Cygmon. + Fixed a compiler warning. + +1998-09-14 Bart Veer + + * src/PKGconf.mak: + Made vectors.o dependent on the various files that can contain + makefile variables or rules. This is needed after changes to + pkgconf.tcl for PRs 17195 and 17286. + +Mon Sep 14 11:10:20 1998 Jesper Skov + PR 17230 + + * src/vectors.S: Replaced CYGIMP_KERNEL_INTERRUPTS_CHAIN with new + CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN. + +1998-09-14 Nick Garnett + PR 17230 + + * include/hal_intr.h: + Added HAL_TRANSLATE_VECTOR() to translate a supplied vector number + into one that can be used in the HAL. Added calls to it in + HAL_INTERRUPT_ATTACH() and HAL_INTERRUPT_DETACH(). + +1998-09-12 Bart Veer + + * include/pkgconf/hal_tx39.h: + Added missing descriptions (PR 17184) + + * src/vectors.S: + was being included without properly checking + that the kernel package was enabled. + + * src/hal_misc.c (exception_handler): + Sort out exception handling options (PR 16953) + +1998-09-11 Nick Garnett + PR 17230 + + * src/vectors.S (__default_interrupt_vsr): + Modified interrupt decode code to preserve raising interrupt + number to pass to ISR, even when using chained interrupts. + +1998-09-03 Bart Veer + + * src/mips-stub.c: + Fixed type in config option name. + +1998-09-02 Bart Veer + + * include/pkgconf/hal_tx39.h: + New header file for architecture-specific configuration options + + * tests/PKGconf.mak: + * src/PKGconf.mak: + Sort out package naming conventions. + +Tue Sep 1 19:26:45 1998 Hugo Tyson + + * src/hal_misc.c: + Use CYGDBG_INFRA_DIAG_USE_DEVICE (from infra.h) instead of + CYG_DIAG_USE_DEVICE (badly named, from kernel.h). + +1998-09-01 Nick Garnett + + * include/hal_intr.h: + Added CYG_EXCEPTION_COUNT. + +1998-08-28 Bart Veer + + * src/vectors.S, src/context.S, src/hal_misc.c, src/mips-stub.c: + Updated for new kernel configuration option symbol names + +Fri Aug 28 10:01:24 1998 Jonathan Larmour + + * src/hal_misc.c: + Rename __main() to cyg_hal_invoke_constructors() to prevent the + implied link with things called, or related to main(). Remove static + initialised variable as we can now guarantee it is only called + once. + + * src/vectors.S: + Instead of calling main(), call cyg_start() which lives in the infra + package. + Explicitly invoke constructors as it isn't done magically for us + any more, now that main() is no longer used. + + +1998-08-25 Nick Garnett + + * src/vectors.S: + Now pass pointer to saved registers as third argument to + interrupt_end(). + + * include/hal_arch.h: + Added macros to support GDB. + +Tue Aug 25 02:33:59 1998 Jonathan Larmour + + * include/mips_stub.h, src/hal_misc.c: + Add void to prototypes and typedefs that want it to silence warnings + +1998-08-21 Nick Garnett + + * include/hal_cache.h: + Now includes cyg_type.h rather than ktypes.h. + +1998-08-18 Nick Garnett + + * src/context.S: + * include/hal_arch.h: + * include/hal_io.h: + * include/hal_intr.h: + Now uses cyg_type.h rather than ktypes.h. + + * src/hal_misc.c: + * src/vectors.S: + Now uses hal.h rather than kernel.h. + +1998-07-23 Nick Garnett + + * include/hal_intr.h: Fixed some issues raised bt code review. + + * src/context.S: + * include/hal_arch.h: Fixed some typos raised by code review. + + * include/hal_intr.h (HAL_INTERRUPT_MASK): + * src/vectors.S (hal_interrupt_level): Added hal_interrupt_level + to allow for interaction between HAL_INTERRUPT_UNMASK() and + HAL_INTERRUPT_SET_LEVEL(). + + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/mips/arch/current/include/basetype.h b/packages/hal/mips/arch/current/include/basetype.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/basetype.h @@ -0,0 +1,63 @@ +#ifndef CYGONCE_HAL_BASETYPE_H +#define CYGONCE_HAL_BASETYPE_H + +//============================================================================= +// +// basetype.h +// +// Standard types for this architecture. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-05 +// Purpose: Define architecture base types. +// Usage: Included by , do not use directly +// +//####DESCRIPTIONEND#### +// + +//----------------------------------------------------------------------------- +// Characterize the architecture + +#define CYG_BYTEORDER CYG_MSBFIRST // Big endian + +//----------------------------------------------------------------------------- +// MIPS does not usually use labels with undersores. Some labels generated +// by the linker do, so add an underscore where required. + +#define CYG_LABEL_NAME(_name_) _##_name_ + +//----------------------------------------------------------------------------- +// Define the standard variable sizes + +// The MIPS architecture uses the default definitions of the base types, +// so we do not need to define any here. + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_BASETYPE_H +// End of basetype.h diff --git a/packages/hal/mips/arch/current/include/hal_arch.h b/packages/hal/mips/arch/current/include/hal_arch.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/hal_arch.h @@ -0,0 +1,229 @@ +#ifndef CYGONCE_HAL_HAL_ARCH_H +#define CYGONCE_HAL_HAL_ARCH_H + +//============================================================================= +// +// hal_arch.h +// +// Architecture specific abstractions +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-05 +// Purpose: Define architecture abstractions +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +//----------------------------------------------------------------------------- +// Processor saved states: +// The layout of this structure is also defined in "mips.inc", for assembly +// code. Do not change this without changing that (or vice versa). + +typedef struct +{ + // These are common to all saved states + cyg_uint32 d[32]; /* Data regs */ + cyg_uint32 hi; /* hi word of mpy/div reg */ + cyg_uint32 lo; /* lo word of mpy/div reg */ + + // These are only saved for exceptions and interrupts + cyg_uint32 vector; /* Vector number */ + cyg_uint32 pc; /* Program Counter */ + cyg_uint32 sr; /* Status Reg */ + cyg_uint32 cache; /* Cache control register */ + + + // These are only saved for exceptions, and are not restored + // when continued. + cyg_uint32 cause; /* Exception cause register */ + cyg_uint32 badvr; /* Bad virtual address reg */ + cyg_uint32 prid; /* Processor Version */ + cyg_uint32 config; /* Config register */ +} HAL_SavedRegisters; + +//----------------------------------------------------------------------------- +// Exception handling function. +// This function is defined by the kernel according to this prototype. It is +// invoked from the HAL to deal with any CPU exceptions that the HAL does +// not want to deal with itself. It usually invokes the kernel's exception +// delivery mechanism. + +externC void deliver_exception( CYG_WORD code, CYG_ADDRWORD data ); + +//----------------------------------------------------------------------------- +// Bit manipulation macros + +externC cyg_uint32 hal_lsbit_index(cyg_uint32 mask); +externC cyg_uint32 hal_msbit_index(cyg_uint32 mask); + +#define HAL_LSBIT_INDEX(index, mask) index = hal_lsbit_index(mask); + +#define HAL_MSBIT_INDEX(index, mask) index = hal_msbit_index(mask); + +//----------------------------------------------------------------------------- +// Context Initialization +// Initialize the context of a thread. +// Arguments: +// _sparg_ name of variable containing current sp, will be written with new sp +// _thread_ thread object address, passed as argument to entry point +// _entry_ entry point address. +// _id_ bit pattern used in initializing registers, for debugging. + +#define HAL_THREAD_INIT_CONTEXT( _sparg_, _thread_, _entry_, _id_ ) \ +{ \ + register CYG_WORD _sp_ = ((CYG_WORD)_sparg_)-56; \ + register HAL_SavedRegisters *_regs_; \ + int _i_; \ + _regs_ = (HAL_SavedRegisters *)((_sp_) - sizeof(HAL_SavedRegisters)); \ + for( _i_ = 0; _i_ < 32; _i_++ ) (_regs_)->d[_i_] = (_id_)|_i_; \ + (_regs_)->d[29] = (CYG_WORD)(_sp_); /* SP = top of stack */ \ + (_regs_)->d[04] = (CYG_WORD)(_thread_); /* R4 = arg1 = thread ptr */ \ + (_regs_)->lo = 0; /* LO = 0 */ \ + (_regs_)->hi = 0; /* HI = 0 */ \ + (_regs_)->d[30] = (CYG_WORD)(_sp_); /* FP = top of stack */ \ + (_regs_)->d[31] = (CYG_WORD)(_entry_); /* LR(d[31]) = entry point */ \ + (_regs_)->pc = (CYG_WORD)(_entry_); /* PC = entry point */ \ + _sparg_ = (CYG_ADDRESS)_regs_; \ +} + +//----------------------------------------------------------------------------- +// Context switch macros. +// The arguments are pointers to locations where the stack pointer +// of the current thread is to be stored, and from where the sp of the +// next thread is to be fetched. + +externC void hal_thread_switch_context( CYG_ADDRESS to, CYG_ADDRESS from ); +externC void hal_thread_load_context( CYG_ADDRESS to ) + __attribute__ ((noreturn)); + +#define HAL_THREAD_SWITCH_CONTEXT(_fspptr_,_tspptr_) \ + hal_thread_switch_context((CYG_ADDRESS)_tspptr_,(CYG_ADDRESS)_fspptr_); + +#define HAL_THREAD_LOAD_CONTEXT(_tspptr_) \ + hal_thread_load_context( (CYG_ADDRESS)_tspptr_ ); + +//----------------------------------------------------------------------------- +// Execution reorder barrier. +// When optimizing the compiler can reorder code. In multithreaded systems +// where the order of actions is vital, this can sometimes cause problems. +// This macro may be inserted into places where reordering should not happen. +// The "memory" keyword is potentially unnecessary, but it is harmless to +// keep it. + +#define HAL_REORDER_BARRIER() asm volatile ( "" : : : "memory" ) + +//----------------------------------------------------------------------------- +// Breakpoint support +// HAL_BREAKPOINT() is a code sequence that will cause a breakpoint to happen if +// executed. +// HAL_BREAKINST is the value of the breakpoint instruction and HAL_BREAKINST_SIZE +// is its size in bytes. + +#define HAL_BREAKPOINT(_label_) \ +asm volatile (" .globl " #_label_ ";" \ + #_label_":" \ + " break 5" \ + ); + +#define HAL_BREAKINST 0x0005000d + +#define HAL_BREAKINST_SIZE 4 + +//----------------------------------------------------------------------------- +// Thread register state manipulation for GDB support. + +// Translate a stack pointer as saved by the thread context macros above into +// a pointer to a HAL_SavedRegisters structure. +#define HAL_THREAD_GET_SAVED_REGISTERS( _sp_, _regs_ ) \ + (_regs_) = (HAL_SavedRegisters *)(_sp_) + +// Copy a set of registers from a HAL_SavedRegisters structure into a +// GDB ordered array. +#define HAL_GET_GDB_REGISTERS( _aregval_ , _regs_ ) \ +{ \ + CYG_ADDRWORD *_regval_ = (CYG_ADDRWORD *)(_aregval_); \ + int _i_; \ + \ + for( _i_ = 0; _i_ < 32; _i_++ ) \ + _regval_[_i_] = (_regs_)->d[_i_]; \ + \ + _regval_[32] = (_regs_)->sr; \ + _regval_[33] = (_regs_)->lo; \ + _regval_[34] = (_regs_)->hi; \ + _regval_[35] = (_regs_)->badvr; \ + _regval_[36] = (_regs_)->cause; \ + _regval_[37] = (_regs_)->pc; \ +} + +// Copy a GDB ordered array into a HAL_SavedRegisters structure. +#define HAL_SET_GDB_REGISTERS( _regs_ , _aregval_ ) \ +{ \ + CYG_ADDRWORD *_regval_ = (CYG_ADDRWORD *)(_aregval_); \ + int _i_; \ + \ + for( _i_ = 0; _i_ < 32; _i_++ ) \ + (_regs_)->d[_i_] = _regval_[_i_]; \ + \ + (_regs_)->sr = _regval_[32]; \ + (_regs_)->lo = _regval_[33]; \ + (_regs_)->hi = _regval_[34]; \ + (_regs_)->badvr = _regval_[35]; \ + (_regs_)->cause = _regval_[36]; \ + (_regs_)->pc = _regval_[37]; \ +} + +//----------------------------------------------------------------------------- +// HAL setjmp + +#define HAL_JMP_BUF_SIZE 11 + +typedef cyg_uint32 hal_jmp_buf[HAL_JMP_BUF_SIZE]; + +externC int hal_setjmp(hal_jmp_buf env); +externC void hal_longjmp(hal_jmp_buf env, int val); + +//----------------------------------------------------------------------------- +// Idle thread code. +// This macro is called in the idle thread loop, and gives the HAL the +// chance to insert code. Typical idle thread behaviour might be to halt the +// processor. + +externC void hal_idle_thread_action(cyg_uint32 loop_count); + +#define HAL_IDLE_THREAD_ACTION(_count_) hal_idle_thread_action(_count_) + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_HAL_ARCH_H +// End of hal_arch.h + + diff --git a/packages/hal/mips/arch/current/include/hal_cache.h b/packages/hal/mips/arch/current/include/hal_cache.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/hal_cache.h @@ -0,0 +1,402 @@ +#ifndef CYGONCE_HAL_CACHE_H +#define CYGONCE_HAL_CACHE_H + +//============================================================================= +// +// hal_cache.h +// +// HAL cache control API +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: Cache control API +// Description: The macros defined here provide the HAL APIs for handling +// cache control operations. +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +//============================================================================= +// MIPS simulator + +#ifdef CYG_HAL_MIPS_SIM + +//----------------------------------------------------------------------------- +// Cache dimensions + +// Data cache +#define HAL_DCACHE_SIZE 4096 // Size of data cache in bytes +#define HAL_DCACHE_LINE_SIZE 16 // Size of a data cache line +#define HAL_DCACHE_WAYS 2 // Associativity of the cache + +// Instruction cache +#define HAL_ICACHE_SIZE 4096 // Size of cache in bytes +#define HAL_ICACHE_LINE_SIZE 16 // Size of a cache line +#define HAL_ICACHE_WAYS 2 // Associativity of the cache + +#define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS)) +#define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS)) + +//----------------------------------------------------------------------------- +// Global control of data cache + +// Enable the data cache +#define HAL_DCACHE_ENABLE() + +// Disable the data cache +#define HAL_DCACHE_DISABLE() + +// Invalidate the entire cache +#define HAL_DCACHE_INVALIDATE_ALL() + +// Synchronize the contents of the cache with memory. +#define HAL_DCACHE_SYNC() + +// Set the data cache refill burst size +//#define HAL_DCACHE_BURST_SIZE(_size_) + +// Set the data cache write mode +//#define HAL_DCACHE_WRITE_MODE( _mode_ ) + +//#define HAL_DCACHE_WRITETHRU_MODE 0 +//#define HAL_DCACHE_WRITEBACK_MODE 1 + +// Load the contents of the given address range into the data cache +// and then lock the cache so that it stays there. +//#define HAL_DCACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_DCACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Data cache line control + +// Allocate cache lines for the given address range without reading its +// contents from memory. +//#define HAL_DCACHE_ALLOCATE( _base_ , _size_ ) + +// Write dirty cache lines to memory and invalidate the cache entries +// for the given address range. +//#define HAL_DCACHE_FLUSH( _base_ , _size_ ) + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_DCACHE_INVALIDATE( _base_ , _size_ ) + +// Write dirty cache lines to memory for the given address range. +//#define HAL_DCACHE_STORE( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of reading +// from it later. +//#define HAL_DCACHE_READ_HINT( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of writing +// to it later. +//#define HAL_DCACHE_WRITE_HINT( _base_ , _size_ ) + +// Allocate and zero the cache lines associated with the given range. +//#define HAL_DCACHE_ZERO( _base_ , _size_ ) + +//----------------------------------------------------------------------------- +// Global control of Instruction cache + +// Enable the instruction cache +#define HAL_ICACHE_ENABLE() + +// Disable the instruction cache +#define HAL_ICACHE_DISABLE() + +// Invalidate the entire cache +#define HAL_ICACHE_INVALIDATE_ALL() + +// Synchronize the contents of the cache with memory. +#define HAL_ICACHE_SYNC() + +// Set the instruction cache refill burst size +//#define HAL_ICACHE_BURST_SIZE(_size_) + +// Load the contents of the given address range into the instruction cache +// and then lock the cache so that it stays there. +//#define HAL_ICACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_ICACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Instruction cache line control + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_ICACHE_INVALIDATE( _base_ , _size_ ) + +#endif + + +//============================================================================= +// Toshiba TX3904 + +#ifdef CYG_HAL_MIPS_TX3904 + +//----------------------------------------------------------------------------- +// Cache dimensions + +// Data cache +#define HAL_DCACHE_SIZE 1024 // Size of data cache in bytes +#define HAL_DCACHE_LINE_SIZE 4 // Size of a data cache line +#define HAL_DCACHE_WAYS 2 // Associativity of the cache + +// Instruction cache +#define HAL_ICACHE_SIZE 4096 // Size of cache in bytes +#define HAL_ICACHE_LINE_SIZE 16 // Size of a cache line +#define HAL_ICACHE_WAYS 1 // Associativity of the cache + +#define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS)) +#define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS)) + +//----------------------------------------------------------------------------- +// Global control of data cache + +// Enable the data cache +#define HAL_DCACHE_ENABLE() \ +{ \ + asm volatile ("mfc0 $2,$3;" \ + "ori $2,$2,0x0010;" \ + "mtc0 $2,$3;" \ + : \ + : \ + : "$2" \ + ); \ + \ +} + +// Disable the data cache +#define HAL_DCACHE_DISABLE() \ +{ \ + asm volatile ("mfc0 $2,$3;" \ + "la $3,0xFFFFFFEF;" \ + "and $2,$2,$3;" \ + "mtc0 $2,$3;" \ + : \ + : \ + : "$2", "$3" \ + ); \ + \ +} + +// Invalidate the entire cache +// We do this by reading a word from each line to invalidate the current +// cache contents. +#define HAL_DCACHE_INVALIDATE_ALL() \ +{ \ + extern char __ram_data_start; \ + CYG_WORD *addr = (CYG_WORD *)&__ram_data_start; \ + CYG_WORD sum = 0; \ + int i; \ + for( i = 0; i < HAL_DCACHE_SIZE; i += HAL_DCACHE_LINE_SIZE ) \ + { \ + sum += addr[i]; \ + } \ +} + +// Synchronize the contents of the cache with memory. +#define HAL_DCACHE_SYNC() HAL_DCACHE_INVALIDATE_ALL() + +// Set the data cache refill burst size +//#define HAL_DCACHE_BURST_SIZE(_size_) + +// Set the data cache write mode +//#define HAL_DCACHE_WRITE_MODE( _mode_ ) + +//#define HAL_DCACHE_WRITETHRU_MODE 0 +//#define HAL_DCACHE_WRITEBACK_MODE 1 + +// Load the contents of the given address range into the data cache +// and then lock the cache so that it stays there. +#define HAL_DCACHE_LOCK(_base_, _size_) \ +{ \ + asm volatile ("mfc0 $2,$7;" \ + "ori $2,$2,0x0100;" \ + "mtc0 $2,$7;" \ + : \ + : \ + : "$2" \ + ); \ +} + +// Undo a previous lock operation +#define HAL_DCACHE_UNLOCK(_base_, _size_) \ +{ \ + asm volatile ("mfc0 $2,$7;" \ + "la $3,0xFFFFFEFF;" \ + "and $2,$2,$3;" \ + "mtc0 $2,$7;" \ + : \ + : \ + : "$2", "$3" \ + ); \ +} + +//----------------------------------------------------------------------------- +// Data cache line control + +// Allocate cache lines for the given address range without reading its +// contents from memory. +//#define HAL_DCACHE_ALLOCATE( _base_ , _size_ ) + +// Write dirty cache lines to memory and invalidate the cache entries +// for the given address range. +//#define HAL_DCACHE_FLUSH( _base_ , _size_ ) + +// Invalidate cache lines in the given range without writing to memory. +#define HAL_DCACHE_INVALIDATE( _base_ , _asize_ ) \ +{ \ + register CYG_ADDRESS _addr_ = (CYG_ADDRESS)(_base_); \ + register CYG_WORD _size_ = (_asize_); \ + HAL_DCACHE_DISABLE(); \ + for( ; _addr_ <= _addr_+_size_; _addr_ += HAL_DCACHE_LINE_SIZE ) \ + { \ + asm volatile ("cache 17,0(%0)" : : "r"(addr) ); \ + } \ + HAL_DCACHE_ENABLE(); \ +} + +// Write dirty cache lines to memory for the given address range. +//#define HAL_DCACHE_STORE( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of reading +// from it later. +//#define HAL_DCACHE_READ_HINT( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of writing +// to it later. +//#define HAL_DCACHE_WRITE_HINT( _base_ , _size_ ) + +// Allocate and zero the cache lines associated with the given range. +//#define HAL_DCACHE_ZERO( _base_ , _size_ ) + +//----------------------------------------------------------------------------- +// Global control of Instruction cache + +// Enable the instruction cache +#define HAL_ICACHE_ENABLE() \ +{ \ + asm volatile ("mfc0 $2,$3;" \ + "ori $2,$2,0x0020;" \ + "mtc0 $2,$3;" \ + : \ + : \ + : "$2" \ + ); \ + \ +} + +// Disable the instruction cache +#define HAL_ICACHE_DISABLE() \ +{ \ + asm volatile ("mfc0 $2,$3;" \ + "la $3,0xFFFFFFDF;" \ + "and $2,$2,$3;" \ + "mtc0 $2,$3;" \ + : \ + : \ + : "$2", "$3" \ + ); \ + \ +} + +// Invalidate the entire cache +#define HAL_ICACHE_INVALIDATE_ALL() \ +{ \ + register CYG_ADDRESS addr; \ + HAL_ICACHE_DISABLE(); \ + for( addr = 0; addr < HAL_ICACHE_SIZE; addr += HAL_ICACHE_LINE_SIZE ) \ + { \ + asm volatile ("cache 0,0(%0)" : : "r"(addr) ); \ + } \ + HAL_ICACHE_ENABLE(); \ +} + +// Synchronize the contents of the cache with memory. +#define HAL_ICACHE_SYNC() HAL_ICACHE_INVALIDATE_ALL() + +// Set the instruction cache refill burst size +//#define HAL_ICACHE_BURST_SIZE(_size_) + +// Load the contents of the given address range into the instruction cache +// and then lock the cache so that it stays there. +#define HAL_ICACHE_LOCK(_base_, _size_) \ +{ \ + asm volatile ("mfc0 $2,$7;" \ + "ori $2,$2,0x0200;" \ + "mtc0 $2,$7;" \ + : \ + : \ + : "$2" \ + ); \ +} + +// Undo a previous lock operation +#define HAL_ICACHE_UNLOCK(_base_, _size_) \ +{ \ + asm volatile ("mfc0 $2,$7;" \ + "la $3,0xFFFFFDFF;" \ + "and $2,$2,$3;" \ + "mtc0 $2,$7;" \ + : \ + : \ + : "$2", "$3" \ + ); \ +} + +//----------------------------------------------------------------------------- +// Instruction cache line control + +// Invalidate cache lines in the given range without writing to memory. +#define HAL_ICACHE_INVALIDATE( _base_ , _asize_ ) \ +{ \ + register CYG_ADDRESS _addr_ = (CYG_ADDRESS)(_base_); \ + register CYG_WORD _size_ = (_asize_); \ + HAL_ICACHE_DISABLE(); \ + for( ; _addr_ <= _addr_+_size_; _addr_ += HAL_ICACHE_LINE_SIZE ) \ + { \ + asm volatile ("cache 0,0(%0)" : : "r"(addr) ); \ + } \ + HAL_ICACHE_ENABLE(); \ +} + +#endif + +//----------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_CACHE_H +// End of hal_cache.h diff --git a/packages/hal/mips/arch/current/include/hal_intr.h b/packages/hal/mips/arch/current/include/hal_intr.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/hal_intr.h @@ -0,0 +1,362 @@ +#ifndef CYGONCE_HAL_HAL_INTR_H +#define CYGONCE_HAL_HAL_INTR_H + +//============================================================================= +// +// hal_intr.h +// +// HAL Interrupt and clock support +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: Define Interrupt support +// Description: The macros defined here provide the HAL APIs for handling +// interrupts and the clock. +// +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include +#include + +//----------------------------------------------------------------------------- +// MIPS exception vectors. + +// Exception vectors. +// These are the exception codes presented in the +// Cause register and correspond to VSRs. + +#define CYG_VECTOR_INTERRUPT 0 +#define CYG_VECTOR_TLB_MOD 1 +#define CYG_VECTOR_TLB_LOAD_REFILL 2 +#define CYG_VECTOR_TLB_STORE_REFILL 3 +#define CYG_VECTOR_LOAD_ADDRESS 4 +#define CYG_VECTOR_STORE_ADDRESS 5 +#define CYG_VECTOR_IBE 6 +#define CYG_VECTOR_DBE 7 +#define CYG_VECTOR_SYSTEM_CALL 8 +#define CYG_VECTOR_BREAKPOINT 9 +#define CYG_VECTOR_RESERVED_INSTRUCTION 10 +#define CYG_VECTOR_COPROCESSOR 11 +#define CYG_VECTOR_OVERFLOW 12 +#define CYG_VECTOR_RESERVED_13 13 + +#define CYG_VSR_MIN 0 +#define CYG_VSR_MAX 13 +#define CYG_VSR_COUNT 14 + +#define CYG_EXCEPTION_MIN 1 +#define CYG_EXCEPTION_MAX 13 +#define CYG_EXCEPTION_COUNT 14 + +// Interrupt vectors. + +#if defined(CYG_HAL_MIPS_TX3904) || defined(CYG_HAL_MIPS_SIM) + +// These are decoded via the IP bits of the cause +// register when an external interrupt is delivered. + +#define CYG_VECTOR_INT_1 0 +#define CYG_VECTOR_INT_2 1 +#define CYG_VECTOR_INT_3 2 +#define CYG_VECTOR_INT_4 3 +#define CYG_VECTOR_INT_5 4 +#define CYG_VECTOR_INT_6 5 +#define CYG_VECTOR_INT_7 6 +#define CYG_VECTOR_DMAC1_CH3 7 +#define CYG_VECTOR_DMAC1_CH2 8 +#define CYG_VECTOR_DMAC0_CH1 9 +#define CYG_VECTOR_DMAC0_CH0 10 +#define CYG_VECTOR_SIO_0 11 +#define CYG_VECTOR_SIO_1 12 +#define CYG_VECTOR_TMR_0 13 +#define CYG_VECTOR_TMR_1 14 +#define CYG_VECTOR_TMR_2 15 +#define CYG_VECTOR_INT_0 16 + +#define CYG_ISR_MIN 0 +#define CYG_ISR_MAX 16 +#define CYG_ISR_COUNT 17 + +// The vector used by the Real time clock +#define CYG_VECTOR_RTC CYG_VECTOR_TMR_0 + +#endif + +//----------------------------------------------------------------------------- +// Static data used by HAL + +// ISR tables +externC volatile CYG_ADDRESS hal_interrupt_handlers[CYG_ISR_COUNT]; +externC volatile CYG_ADDRWORD hal_interrupt_data[CYG_ISR_COUNT]; +externC volatile CYG_ADDRESS hal_interrupt_objects[CYG_ISR_COUNT]; + +// VSR table +externC volatile CYG_ADDRESS hal_vsr_table[CYG_VSR_MAX+1]; + +//----------------------------------------------------------------------------- +// Default ISR + +externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data); + +//----------------------------------------------------------------------------- +// Interrupt state storage + +typedef cyg_uint32 CYG_INTERRUPT_STATE; + +//----------------------------------------------------------------------------- +// Interrupt control macros +// Beware of the nops in this code. These fill load/store delay slots to prevent +// following code being run in the wrong state. + +#define HAL_DISABLE_INTERRUPTS(_old_) \ +{ \ + asm volatile ( \ + "mfc0 $8,$12; nop;" \ + "move %0,$8;" \ + "and $8,$8,0XFFFFFFFE;" \ + "mtc0 $8,$12;" \ + "nop; nop; nop;" \ + "and %0,%0,0X1;" \ + : "=r"(_old_) \ + : \ + : "$8" \ + ); \ +} + +#define HAL_ENABLE_INTERRUPTS() \ +{ \ + asm volatile ( \ + "mfc0 $8,$12; nop;" \ + "or $8,$8,1;" \ + "mtc0 $8,$12;" \ + "nop; nop; nop;" \ + : \ + : \ + : "$8" \ + ); \ +} + +#define HAL_RESTORE_INTERRUPTS(_old_) \ +{ \ + asm volatile ( \ + "mfc0 $8,$12; nop;" \ + "and %0,%0,0x1;" \ + "or $8,$8,%0;" \ + "mtc0 $8,$12;" \ + "nop; nop; nop;" \ + : \ + : "r"(_old_) \ + : "$8" \ + ); \ +} + +#define HAL_QUERY_INTERRUPTS( _state_ ) \ +{ \ + asm volatile ( \ + "mfc0 %0,$12; nop;" \ + "and %0,%0,0x1;" \ + : "=r"(_state_) \ + : \ + : "$8" \ + ); \ +} + +//----------------------------------------------------------------------------- +// Vector translation. +// For chained interrupts we only have a single vector though which all +// are passed. For unchained interrupts we have a vector per interrupt. + +#if defined(CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN) + +#define HAL_TRANSLATE_VECTOR(_vector_,_index_) (_index_) = 0 + +#else + +#define HAL_TRANSLATE_VECTOR(_vector_,_index_) (_index_) = (_vector_) + +#endif + +//----------------------------------------------------------------------------- +// Interrupt and VSR attachment macros + +#define HAL_INTERRUPT_ATTACH( _vector_, _isr_, _data_, _object_ ) \ +{ \ + cyg_uint32 _index_; \ + HAL_TRANSLATE_VECTOR( _vector_, _index_ ); \ + \ + if( hal_interrupt_handlers[_index_] == (CYG_ADDRESS)hal_default_isr ) \ + { \ + hal_interrupt_handlers[_index_] = (CYG_ADDRESS)_isr_; \ + hal_interrupt_data[_index_] = (CYG_ADDRWORD)_data_; \ + hal_interrupt_objects[_index_] = (CYG_ADDRESS)_object_; \ + } \ +} + +#define HAL_INTERRUPT_DETACH( _vector_, _isr_ ) \ +{ \ + cyg_uint32 _index_; \ + HAL_TRANSLATE_VECTOR( _vector_, _index_ ); \ + \ + if( hal_interrupt_handlers[_index_] == (CYG_ADDRESS)_isr_ ) \ + { \ + hal_interrupt_handlers[_index_] = (CYG_ADDRESS)hal_default_isr; \ + hal_interrupt_data[_index_] = 0; \ + hal_interrupt_objects[_index_] = 0; \ + } \ +} + +#define HAL_VSR_GET( _vector_, _pvsr_ ) \ + *(_pvsr_) = (void (*)())hal_vsr_table[_vector_]; + + +#define HAL_VSR_SET( _vector_, _vsr_, _poldvsr_ ) \ + if( _poldvsr_ != NULL ) *_poldvsr_ = (void (*)())hal_vsr_table[_vector_]; \ + hal_vsr_table[_vector_] = (CYG_ADDRESS)_vsr_; + +//----------------------------------------------------------------------------- +// Interrupt controller access + +#if defined(CYG_HAL_MIPS_TX3904) || defined(CYG_HAL_MIPS_SIM) + +#define TX3904_ILR0 0xFFFFC010 +#define TX3904_CConR 0xFFFFE000 + +// Array which stores the configured priority levels for the configured +// interrupts. +externC volatile CYG_BYTE hal_interrupt_level[CYG_ISR_COUNT]; + + +#define HAL_INTERRUPT_MASK( _vector_ ) \ +{ \ + HAL_IO_REGISTER _reg_ = TX3904_ILR0; \ + CYG_WORD32 _ilr_; \ + _reg_ += (_vector_)&0xC; \ + HAL_READ_UINT32( _reg_, _ilr_ ); \ + _ilr_ &= ~(7 << (((_vector_)&0x3)<<3)); \ + HAL_WRITE_UINT32( _reg_, _ilr_ ); \ +} + +#define HAL_INTERRUPT_UNMASK( _vector_ ) \ +{ \ + HAL_IO_REGISTER _reg_ = TX3904_ILR0; \ + CYG_WORD32 _ilr_; \ + _reg_ += (_vector_)&0xC; \ + HAL_READ_UINT32( _reg_, _ilr_ ); \ + _ilr_ |= hal_interrupt_level[_vector_] << (((_vector_)&0x3)<<3); \ + HAL_WRITE_UINT32( _reg_, _ilr_ ); \ +} + +#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ ) \ +{ \ + if( _vector_ <= CYG_VECTOR_INT_7 || _vector_ == CYG_VECTOR_INT_0 ) \ + { \ + cyg_uint32 _val_ = _vector_ + 1; \ + if( _val_ == CYG_VECTOR_INT_0 + 1 ) _val_ = 0; \ + HAL_WRITE_UINT8( TX3904_CConR+1, _val_); \ + } \ +} + +#define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ ) \ +{ \ + if( _vector_ <= CYG_VECTOR_INT_7 || _vector_ == CYG_VECTOR_INT_0 ) \ + { \ + cyg_uint32 _val_ = 0; \ + if( _up_ ) _val_ |= 1; \ + if( !(_level_) ) _val_ |= 2; \ + HAL_WRITE_UINT16( TX3904_CConR+2, _val_ ); \ + } \ +} + +#define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ ) \ +{ \ + HAL_IO_REGISTER _reg_ = TX3904_ILR0; \ + CYG_WORD32 _ilr_; \ + _reg_ += (_vector_)&0xC; \ + HAL_READ_UINT32( _reg_, _ilr_ ); \ + _ilr_ |= (_level_) << (((_vector_)&0x3)<<3); \ + HAL_WRITE_UINT32( _reg_, _ilr_ ); \ + hal_interrupt_level[_vector_] = _level_; \ +} + +#else + +#error Unspecified platform for MIPS + +#endif + +//----------------------------------------------------------------------------- +// Clock control + +#if defined(CYG_HAL_MIPS_TX3904) || defined(CYG_HAL_MIPS_SIM) + +#define TX3904_TIMER_BASE 0xFFFFF000 +#define TX3904_TIMER_CR (TX3904_TIMER_BASE + 0x00) +#define TX3904_TIMER_SR (TX3904_TIMER_BASE + 0x04) +#define TX3904_TIMER_CPR (TX3904_TIMER_BASE + 0x08) +#define TX3904_TIMER_IMR (TX3904_TIMER_BASE + 0x10) +#define TX3904_TIMER_DR (TX3904_TIMER_BASE + 0x20) +#define TX3904_TIMER_RR (TX3904_TIMER_BASE + 0xF0) + +#define HAL_CLOCK_INITIALIZE( _period_ ) \ +{ \ + HAL_WRITE_UINT32( TX3904_TIMER_DR, 0x000000003 ); \ + HAL_WRITE_UINT32( TX3904_TIMER_CPR, _period_ ); \ + HAL_WRITE_UINT32( TX3904_TIMER_SR, 0x00000000 ); \ + HAL_WRITE_UINT32( TX3904_TIMER_IMR, 0x00008001 ); \ + HAL_WRITE_UINT32( TX3904_TIMER_CR, 0x000000C0 ); \ +} + +#define HAL_CLOCK_RESET( _vector_, _period_ ) \ +{ \ + HAL_WRITE_UINT32( TX3904_TIMER_SR, 0x00000000 ); \ +} + +#define HAL_CLOCK_READ( _pvalue_ ) \ +{ \ + HAL_READ_UINT32( TX3904_TIMER_RR, *(_pvalue_) ); \ +} + +#else + +#error Unspecified platform for MIPS + +#endif + +//----------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_HAL_INTR_H +// End of hal_intr.h diff --git a/packages/hal/mips/arch/current/include/hal_io.h b/packages/hal/mips/arch/current/include/hal_io.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/hal_io.h @@ -0,0 +1,134 @@ +#ifndef CYGONCE_HAL_HAL_IO_H +#define CYGONCE_HAL_HAL_IO_H + +//============================================================================= +// +// hal_io.h +// +// HAL device IO register support. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: Define IO register support +// Description: The macros defined here provide the HAL APIs for handling +// device IO control registers. +// +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +//----------------------------------------------------------------------------- +// IO Register address. +// This type is for recording the address of an IO register. + +typedef volatile CYG_ADDRWORD HAL_IO_REGISTER; + +//----------------------------------------------------------------------------- +// BYTE Register access. +// Individual and vectorized access to 8 bit registers. + +#define HAL_READ_UINT8( _register_, _value_ ) \ + ((_value_) = *((volatile CYG_BYTE *)(_register_))) + +#define HAL_WRITE_UINT8( _register_, _value_ ) \ + (*((volatile CYG_BYTE *)(_register_)) = (_value_)) + +#define HAL_READ_UINT8_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + (_buf_)[_i_] = ((volatile CYG_BYTE *)(_register_))[_j_]; \ +} + +#define HAL_WRITE_UINT8_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + ((volatile CYG_BYTE *)(_register_))[_j_] = (_buf_)[_i_]; \ +} + + +//----------------------------------------------------------------------------- +// 16 bit access. +// Individual and vectorized access to 16 bit registers. + +#define HAL_READ_UINT16( _register_, _value_ ) \ + ((_value_) = *((volatile CYG_WORD16 *)(_register_))) + +#define HAL_WRITE_UINT16( _register_, _value_ ) \ + (*((volatile CYG_WORD16 *)(_register_)) = (_value_)) + +#define HAL_READ_UINT16_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + (_buf_)[_i_] = ((volatile CYG_WORD16 *)(_register_))[_j_]; \ +} + +#define HAL_WRITE_UINT16_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + ((volatile CYG_WORD16 *)(_register_))[_j_] = (_buf_)[_i_]; \ +} + +//----------------------------------------------------------------------------- +// 32 bit access. +// Individual and vectorized access to 32 bit registers. + +#define HAL_READ_UINT32( _register_, _value_ ) \ + ((_value_) = *((volatile CYG_WORD32 *)(_register_))) + +#define HAL_WRITE_UINT32( _register_, _value_ ) \ + (*((volatile CYG_WORD32 *)(_register_)) = (_value_)) + +#define HAL_READ_UINT32_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + (_buf_)[_i_] = ((volatile CYG_WORD32 *)(_register_))[_j_]; \ +} + +#define HAL_WRITE_UINT32_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + ((volatile CYG_WORD32 *)(_register_))[_j_] = (_buf_)[_i_]; \ +} + +//----------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_HAL_IO_H +// End of hal_io.h diff --git a/packages/hal/mips/arch/current/include/mips-regs.h b/packages/hal/mips/arch/current/include/mips-regs.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/mips-regs.h @@ -0,0 +1,205 @@ +/* mips-regs.h - register defines for MIPS processors + * + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + + +/* This value must agree with NUMREGS in mips-stub.h. */ + +#define NUM_REGS 90 + +#ifdef __mips64 + #define REG_SIZE 8 +#else + #define REG_SIZE 4 +#endif + +/* General register names for assembly code. */ + +#define zero $0 +#define at $1 /* assembler temporary */ +#define v0 $2 /* value holders */ +#define v1 $3 +#define a0 $4 /* arguments */ +#define a1 $5 +#define a2 $6 +#define a3 $7 +#define t0 $8 /* temporaries */ +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#define s0 $16 /* saved registers */ +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 /* temporaries */ +#define t9 $25 +#define k0 $26 /* kernel registers */ +#define k1 $27 +#define gp $28 /* global pointer */ +#define sp $29 /* stack pointer */ +#define s8 $30 /* saved register */ +#define fp $30 /* frame pointer (obsolete usage) */ +#define ra $31 /* return address */ + +/* MIPS registers, numbered in the order in which gdb expects to see them. */ +#define ZERO 0 +#define AT 1 +#define V0 2 +#define V1 3 +#define A0 4 +#define A1 5 +#define A2 6 +#define A3 7 + +#define T0 8 +#define T1 9 +#define T2 10 +#define T3 11 +#define T4 12 +#define T5 13 +#define T6 14 +#define T7 15 + +#define S0 16 +#define S1 17 +#define S2 18 +#define S3 19 +#define S4 20 +#define S5 21 +#define S6 22 +#define S7 23 + +#define T8 24 +#define T9 25 +#define K0 26 +#define K1 27 +#define GP 28 +#define SP 29 +#define S8 30 +#define RA 31 + +#define SR 32 +#define LO 33 +#define HI 34 +#define BAD_VA 35 +#define CAUSE 36 +#define PC 37 + +/* System Control Coprocessor (CP0) exception processing registers */ +#define C0_CONTEXT $4 /* Context */ +#define C0_BADVADDR $8 /* Bad Virtual Address */ +#define C0_COUNT $9 /* Count */ +#define C0_COMPARE $11 /* Compare */ +#define C0_STATUS $12 /* Processor Status */ +#define C0_CAUSE $13 /* Exception Cause */ +#define C0_EPC $14 /* Exception PC */ +#define C0_XCONTEXT $20 /* XContext */ +#define C0_ECC $26 /* ECC */ +#define C0_CACHEERR $27 /* CacheErr */ +#define C0_ERROREPC $30 /* ErrorEPC */ + +/* Status register fields */ +#define SR_CUMASK 0xf0000000 /* Coprocessor usable bits */ +#define SR_CU3 0x80000000 /* Coprocessor 3 usable */ +#define SR_CU2 0x40000000 /* coprocessor 2 usable */ +#define SR_CU1 0x20000000 /* Coprocessor 1 usable */ +#define SR_CU0 0x10000000 /* Coprocessor 0 usable */ + +#define SR_FR 0x04000000 /* Enable 32 floating-point registers */ +#define SR_RE 0x02000000 /* Reverse Endian in user mode */ + +#define SR_BEV 0x00400000 /* Bootstrap Exception Vector */ +#define SR_TS 0x00200000 /* TLB shutdown (reserved on R4600) */ +#define SR_SR 0x00100000 /* Soft Reset */ + +#define SR_CH 0x00040000 /* Cache Hit */ +#define SR_CE 0x00020000 /* ECC register modifies check bits */ +#define SR_DE 0x00010000 /* Disable cache errors */ + +#define SR_IMASK 0x0000ff00 /* Interrupt Mask */ +#define SR_IMASK8 0x00000000 /* Interrupt Mask level=8 */ +#define SR_IMASK7 0x00008000 /* Interrupt Mask level=7 */ +#define SR_IMASK6 0x0000c000 /* Interrupt Mask level=6 */ +#define SR_IMASK5 0x0000e000 /* Interrupt Mask level=5 */ +#define SR_IMASK4 0x0000f000 /* Interrupt Mask level=4 */ +#define SR_IMASK3 0x0000f800 /* Interrupt Mask level=3 */ +#define SR_IMASK2 0x0000fc00 /* Interrupt Mask level=2 */ +#define SR_IMASK1 0x0000fe00 /* Interrupt Mask level=1 */ +#define SR_IMASK0 0x0000ff00 /* Interrupt Mask level=0 */ + +#define SR_IBIT8 0x00008000 /* (Intr5) */ +#define SR_IBIT7 0x00004000 /* (Intr4) */ +#define SR_IBIT6 0x00002000 /* (Intr3) */ +#define SR_IBIT5 0x00001000 /* (Intr2) */ +#define SR_IBIT4 0x00000800 /* (Intr1) */ +#define SR_IBIT3 0x00000400 /* (Intr0) */ +#define SR_IBIT2 0x00000200 /* (Software Interrupt 1) */ +#define SR_IBIT1 0x00000100 /* (Software Interrupt 0) */ + +#define SR_KX 0x00000080 /* xtlb in kernel mode */ +#define SR_SX 0x00000040 /* mips3 & xtlb in supervisor mode */ +#define SR_UX 0x00000020 /* mips3 & xtlb in user mode */ + +#define SR_KSU_MASK 0x00000018 /* ksu mode mask */ +#define SR_KSU_USER 0x00000010 /* user mode */ +#define SR_KSU_SUPV 0x00000008 /* supervisor mode */ +#define SR_KSU_KERN 0x00000000 /* kernel mode */ + +#define SR_ERL 0x00000004 /* error level */ +#define SR_EXL 0x00000002 /* exception level */ +#define SR_IE 0x00000001 /* interrupt enable */ + +/* Cause register fields */ +#define CAUSE_BD 0x80000000 /* Branch Delay */ +#define CAUSE_CEMASK 0x30000000 /* Coprocessor Error */ +#define CAUSE_CESHIFT 28 /* Right justify CE */ +#define CAUSE_IPMASK 0x0000ff00 /* Interrupt Pending */ +#define CAUSE_IPSHIFT 8 /* Right justify IP */ +#define CAUSE_IP8 0x00008000 /* (Intr5) */ +#define CAUSE_IP7 0x00004000 /* (Intr4) */ +#define CAUSE_IP6 0x00002000 /* (Intr3) */ +#define CAUSE_IP5 0x00001000 /* (Intr2) */ +#define CAUSE_IP4 0x00000800 /* (Intr1) */ +#define CAUSE_IP3 0x00000400 /* (Intr0) */ +#define CAUSE_SW2 0x00000200 /* (Software Interrupt 1) */ +#define CAUSE_SW1 0x00000100 /* (Software Interrupt 0) */ +#define CAUSE_EXCMASK 0x0000007c /* Exception Code */ +#define CAUSE_EXCSHIFT 2 /* Right justify EXC */ + +/* Exception Codes */ +#define EXC_INT 0 /* External interrupt */ +#define EXC_MOD 1 /* TLB modification exception */ +#define EXC_TLBL 2 /* TLB miss (Load or Ifetch) */ +#define EXC_TLBS 3 /* TLB miss (Store) */ +#define EXC_ADEL 4 /* Address error (Load or Ifetch) */ +#define EXC_ADES 5 /* Address error (Store) */ +#define EXC_IBE 6 /* Bus error (Ifetch) */ +#define EXC_DBE 7 /* Bus error (data load or store) */ +#define EXC_SYS 8 /* System call */ +#define EXC_BP 9 /* Break point */ +#define EXC_RI 10 /* Reserved instruction */ +#define EXC_CPU 11 /* Coprocessor unusable */ +#define EXC_OVF 12 /* Arithmetic overflow */ +#define EXC_TRAP 13 /* Trap exception */ +#define EXC_FPE 15 /* Floating Point Exception */ + + diff --git a/packages/hal/mips/arch/current/include/mips-stub.h b/packages/hal/mips/arch/current/include/mips-stub.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/mips-stub.h @@ -0,0 +1,116 @@ +/* mips-stub.h - MIPS-specific definitions for generic stub + * + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#define NUMREGS 90 + +#ifdef __mips64 + #define REGSIZE(X) 8 + typedef unsigned long long target_register_t; +#else + #define REGSIZE(X) 4 + typedef unsigned long target_register_t; +#endif + +enum regnames { + ZERO, AT, V0, V1, A0, A1, A2, A3, + T0, T1, T2, T3, T4, T5, T6, T7, + S0, S1, S2, S3, S4, S5, S6, S7, + T8, T9, K0, K1, GP, SP, S8, RA, + SR, LO, HI, BAD, CAUSE, PC, + CONFIG = 84, CACHE, DEBUG, DEPC, EPC +}; + +typedef enum regnames regnames_t; + +#include + +/* If ENABLED is non-zero, supply a memory fault handler that traps + subsequent memory errors and sets _mem_err to 1. Otherwise, memory + faults are processed as exceptions. */ +extern void __set_mem_fault_trap (int enable); + +/* Write C to the current serial port. */ +extern void putDebugChar (int c); + +/* Read one character from the current serial port. */ +extern int getDebugChar (void); + +/* Given a trap value TRAP, return the corresponding signal. */ +extern int __computeSignal (unsigned int trap_number); + +/* Install the standard set of trap handlers for the stub. */ +extern void __install_traps (void); + +/* Return the SPARC trap number corresponding to the last-taken trap. */ +extern int __get_trap_number (void); + +/* Return the currently-saved value corresponding to register REG. */ +extern target_register_t get_register (regnames_t reg); + +/* Store VALUE in the register corresponding to WHICH. */ +extern void put_register (regnames_t which, target_register_t value); + +/* Set the currently-saved pc register value to PC. This also updates NPC + as needed. */ +extern void set_pc (target_register_t pc); + +/* Flush the instruction cache. */ +extern void flush_i_cache (void); + +/* Reset the board. */ +extern void __reset (void); + +/* Set the baud rate for the current serial port. */ +extern void __set_baud_rate (int baud); + +/* Initialize the hardware. */ +extern void initHardware (void); + +/* Set things up so that the next user resume will execute one instruction. + This may be done by setting breakpoints or setting a single step flag + in the saved user registers, for example. */ +void single_step (void); + +/* Clear the single-step state. */ +void clear_single_step (void); + +struct gdb_packet; + +/* Return 1 when a complete packet has been received, 0 if the packet + is not yet complete, or -1 if an erroneous packet was NAKed. */ +int __add_char_to_packet (int character, struct gdb_packet *packet); + +/* If the breakpoint we hit is in the breakpoint() instruction, return a + non-zero value. */ +extern int __is_breakpoint_function (void); + +/* Skip the current instruction. */ +extern void __skipinst (void); + +/* Write the 'T' packet in BUFFER. SIGVAL is the signal the program + received. */ + +extern void __build_t_packet (int sigval, char *buffer); + +extern void install_breakpoints (void); + +/* Address in text section of a breakpoint instruction. */ + +extern void _breakinst (void); + +/* The opcode for a breakpoint instruction. */ + +extern unsigned long __break_opcode (void); + diff --git a/packages/hal/mips/arch/current/include/mips.inc b/packages/hal/mips/arch/current/include/mips.inc new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/mips.inc @@ -0,0 +1,113 @@ +##============================================================================= +## +## mips.inc +## +## MIPS assembler header file +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1997-10-16 +## Purpose: MIPS definitions. +## Description: This file contains various definitions and macros that are +## useful for writing assembly code for the MIPS CPU family. +## Usage: +## #include +## ... +## +## +######DESCRIPTIONEND#### +## +##============================================================================= + +##----------------------------------------------------------------------------- +## Standard MIPS register names: + +#define zero $0 +#define z0 $0 +#define v0 $2 +#define v1 $3 +#define a0 $4 +#define a1 $5 +#define a2 $6 +#define a3 $7 +#define t0 $8 +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#define s0 $16 +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 +#define t9 $25 +#define k0 $26 /* kernel private register 0 */ +#define k1 $27 /* kernel private register 1 */ +#define gp $28 /* global data pointer */ +#define sp $29 /* stack-pointer */ +#define fp $30 /* frame-pointer */ +#define ra $31 /* return address */ +#define pc $pc /* pc, used on mips16 */ + +#define config $3 // Configuration register +#define cache $7 // Cache control +#define badvr $8 // Bad virtual address +#define sr $12 // Status register +#define cause $13 // Exception cause +#define epc $14 // Exception pc value +#define prid $15 // processor ID + +##----------------------------------------------------------------------------- +## MIPS saved state + +#define mipsreg_regs 0 +#define mipsreg_hi (4*32) +#define mipsreg_lo (mipsreg_hi+4) +#define mipsreg_vector (mipsreg_lo+4) +#define mipsreg_pc (mipsreg_vector+4) +#define mipsreg_sr (mipsreg_pc+4) +#define mipsreg_cache (mipsreg_sr+4) +#define mipsreg_cause (mipsreg_cache+4) +#define mipsreg_badvr (mipsreg_cause+4) +#define mipsreg_prid (mipsreg_badvr+4) +#define mipsreg_config (mipsreg_prid+4) +#define mipsreg_size (mipsreg_config+4) + +#define mips_exception_decrement (mipsreg_size*2) + +#define mips_stack_frame_size 24 // 3 (64 bit) args worth + +#------------------------------------------------------------------------------ +# end of mips.inc diff --git a/packages/hal/mips/arch/current/include/mips_opcode.h b/packages/hal/mips/arch/current/include/mips_opcode.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/mips_opcode.h @@ -0,0 +1,295 @@ +/*- + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Ralph Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)mips_opcode.h 7.1 (Berkeley) 3/19/92 + * via: mips_opcode.h,v 1.1 1994/03/10 16:15:10 (algorithmics) + */ + +/* + * Define the instruction formats and opcode values for the + * MIPS instruction set. + */ + +#ifndef _MIPS_OPCODE_H +#define _MIPS_OPCODE_H + +/* + * Define the instruction formats. + */ +typedef union { + unsigned word; + +#ifdef MIPSEL + struct { + unsigned imm: 16; + unsigned rt: 5; + unsigned rs: 5; + unsigned op: 6; + } IType; + + struct { + unsigned target: 26; + unsigned op: 6; + } JType; + + struct { + unsigned func: 6; + unsigned shamt: 5; + unsigned rd: 5; + unsigned rt: 5; + unsigned rs: 5; + unsigned op: 6; + } RType; + + struct { + unsigned func: 6; + unsigned fd: 5; + unsigned fs: 5; + unsigned ft: 5; + unsigned fmt: 4; + unsigned : 1; /* always '1' */ + unsigned op: 6; /* always '0x11' */ + } FRType; +#else + struct { + unsigned op: 6; + unsigned rs: 5; + unsigned rt: 5; + unsigned imm: 16; + } IType; + + struct { + unsigned op: 6; + unsigned target: 26; + } JType; + + struct { + unsigned op: 6; + unsigned rs: 5; + unsigned rt: 5; + unsigned rd: 5; + unsigned shamt: 5; + unsigned func: 6; + } RType; + + struct { + unsigned op: 6; /* always '0x11' */ + unsigned : 1; /* always '1' */ + unsigned fmt: 4; + unsigned func: 6; + unsigned ft: 5; + unsigned fs: 5; + unsigned fd: 5; + } FRType; +#endif +} InstFmt; + +/* + * Values for the 'op' field. + */ +#define OP_SPECIAL 000 +#define OP_REGIMM 001 +#define OP_J 002 +#define OP_JAL 003 +#define OP_BEQ 004 +#define OP_BNE 005 +#define OP_BLEZ 006 +#define OP_BGTZ 007 + +#define OP_ADDI 010 +#define OP_ADDIU 011 +#define OP_SLTI 012 +#define OP_SLTIU 013 +#define OP_ANDI 014 +#define OP_ORI 015 +#define OP_XORI 016 +#define OP_LUI 017 + +#define OP_COP0 020 +#define OP_COP1 021 +#define OP_COP2 022 +#define OP_BEQL 024 +#define OP_BNEL 025 +#define OP_BLEZL 026 +#define OP_BGTZL 027 + +#define OP_DADDI 030 +#define OP_DADDIU 031 +#define OP_LDL 032 +#define OP_LDR 033 + +#define OP_LB 040 +#define OP_LH 041 +#define OP_LWL 042 +#define OP_LW 043 +#define OP_LBU 044 +#define OP_LHU 045 +#define OP_LWR 046 +#define OP_LWU 047 + +#define OP_SB 050 +#define OP_SH 051 +#define OP_SWL 052 +#define OP_SW 053 +#define OP_SDL 054 +#define OP_SDR 055 +#define OP_SWR 056 +#define OP_CACHE 057 + +#define OP_LL 060 +#define OP_LWC1 061 +#define OP_LWC2 062 +#define OP_LLD 064 +#define OP_LDC1 065 +#define OP_LDC2 066 +#define OP_LD 067 + +#define OP_SC 070 +#define OP_SWC1 071 +#define OP_SWC2 072 +#define OP_SCD 074 +#define OP_SDC1 075 +#define OP_SDC2 076 +#define OP_SD 077 + +/* + * Values for the 'func' field when 'op' == OP_SPECIAL. + */ +#define OP_SLL 000 +#define OP_SRL 002 +#define OP_SRA 003 +#define OP_SLLV 004 +#define OP_SRLV 006 +#define OP_SRAV 007 + +#define OP_JR 010 +#define OP_JALR 011 +#define OP_SYSCALL 014 +#define OP_BREAK 015 +#define OP_SYNC 017 + +#define OP_MFHI 020 +#define OP_MTHI 021 +#define OP_MFLO 022 +#define OP_MTLO 023 +#define OP_DSLLV 024 +#define OP_DSRLV 026 +#define OP_DSRAV 027 + +#define OP_MULT 030 +#define OP_MULTU 031 +#define OP_DIV 032 +#define OP_DIVU 033 +#define OP_DMULT 034 +#define OP_DMULTU 035 +#define OP_DDIV 036 +#define OP_DDIVU 037 + +#define OP_ADD 040 +#define OP_ADDU 041 +#define OP_SUB 042 +#define OP_SUBU 043 +#define OP_AND 044 +#define OP_OR 045 +#define OP_XOR 046 +#define OP_NOR 047 + +#define OP_SLT 052 +#define OP_SLTU 053 +#define OP_DADD 054 +#define OP_DADDU 055 +#define OP_DSUB 056 +#define OP_DSUBU 057 + +#define OP_TGE 060 +#define OP_TGEU 061 +#define OP_TLT 062 +#define OP_TLTU 063 +#define OP_TEQ 064 +#define OP_TNE 066 + +#define OP_DSLL 070 +#define OP_DSRL 072 +#define OP_DSRA 073 +#define OP_DSLL32 074 +#define OP_DSRL32 076 +#define OP_DSRA32 077 + +/* + * Values for the 'func' field when 'op' == OP_REGIMM. + */ +#define OP_BLTZ 000 +#define OP_BGEZ 001 +#define OP_BLTZL 002 +#define OP_BGEZL 003 + +#define OP_TGEI 010 +#define OP_TGEIU 011 +#define OP_TLTI 012 +#define OP_TLTIU 013 +#define OP_TEQI 014 +#define OP_TNEI 016 + +#define OP_BLTZAL 020 +#define OP_BGEZAL 021 +#define OP_BLTZALL 022 +#define OP_BGEZALL 023 + +/* + * Values for the 'rs' field when 'op' == OP_COPz. + */ +#define OP_MF 000 +#define OP_DMF 001 +#define OP_CF 002 +#define OP_MT 004 +#define OP_DMT 005 +#define OP_CT 006 +#define OP_BC 010 + +/* + * Values for the 'rt' field when 'op' == OP_COPz and 'rt' == OP_BC. + */ +#define COPz_BCF 0x00 +#define COPz_BCT 0x01 +#define COPz_BCFL 0x02 +#define COPz_BCTL 0x03 + +/* + * Instructions with specal significance to debuggers. + */ +#define BREAK_INSTR 0x0005000d /* instruction code for break */ +#define NOP_INSTR 0x00000000 /* instruction code for no-op */ + +#endif /* _MIPS_OPCODE_H */ diff --git a/packages/hal/mips/arch/current/include/pkgconf/hal_tx39.h b/packages/hal/mips/arch/current/include/pkgconf/hal_tx39.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/include/pkgconf/hal_tx39.h @@ -0,0 +1,63 @@ +#ifndef CYGONCE_PKGCONF_HAL_TX39_H +#define CYGONCE_PKGCONF_HAL_TX39_H +// ==================================================================== +// +// pkgconf/hal_tx39.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_TX39 { + display "TX39 architecture" + type radio + parent CYGPKG_HAL + target tx39 + description " + The TX39 architecture HAL package provides generic support + for this processor architecture. It is also necessary to + select a specific target platform HAL package." + } + + }}CFG_DATA */ + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_TX39_H */ +/* EOF hal_tx39.h */ diff --git a/packages/hal/mips/arch/current/src/PKGconf.mak b/packages/hal/mips/arch/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/src/PKGconf.mak @@ -0,0 +1,54 @@ +#============================================================================== +# +# makefile +# +# hal/mips/arch/src +# +#============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================== + +PACKAGE := hal_tx39 +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := hal_misc.c context.S mips-stub.c +OTHER_OBJS := +OTHER_TARGETS := vectors.stamp +OTHER_DEPS := $(PACKAGE)_vectors.d +OTHER_CLEAN := vectors.clean + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + +vectors.stamp: $(PACKAGE)_vectors.o + $(CP) $< $(PREFIX)/lib/vectors.o + @$(TOUCH) $@ + +vectors.clean: + $(RM) $(PREFIX)/lib/vectors.o $(PACKAGE)_vectors.o + $(RM) vectors.stamp + +$(PACKAGE)_vectors.o: $(BUILD_TREE)/pkgconf/pkgconf.mak \ + $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) + + diff --git a/packages/hal/mips/arch/current/src/context.S b/packages/hal/mips/arch/current/src/context.S new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/src/context.S @@ -0,0 +1,227 @@ +##=============================================================================## +## context.S +## +## MIPS context switch code +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1998-04-27 +## Purpose: MIPS context switch code +## Description: This file contains implementations of the thread context +## switch routines. It also contains the longjmp() and setjmp() +## routines. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +#include + + .set noat + +#------------------------------------------------------------------------------ +# hal_thread_switch_context +# Switch thread contexts +# A0 = address of sp of next thread to execute +# A1 = address of sp save location of current thread + + .global hal_thread_switch_context +hal_thread_switch_context: + + addi sp,sp,-mipsreg_size # space for registers + + # store GPRs +#ifndef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM + sw $0,(mipsreg_regs+0*4)(sp) + sw $1,(mipsreg_regs+1*4)(sp) + sw $2,(mipsreg_regs+2*4)(sp) + sw $3,(mipsreg_regs+3*4)(sp) + sw $4,(mipsreg_regs+4*4)(sp) + sw $5,(mipsreg_regs+5*4)(sp) + sw $6,(mipsreg_regs+6*4)(sp) + sw $7,(mipsreg_regs+7*4)(sp) + sw $8,(mipsreg_regs+8*4)(sp) + sw $9,(mipsreg_regs+9*4)(sp) + sw $10,(mipsreg_regs+10*4)(sp) + sw $11,(mipsreg_regs+11*4)(sp) + sw $12,(mipsreg_regs+12*4)(sp) + sw $13,(mipsreg_regs+13*4)(sp) + sw $14,(mipsreg_regs+14*4)(sp) + sw $15,(mipsreg_regs+15*4)(sp) + sw $24,(mipsreg_regs+24*4)(sp) + sw $25,(mipsreg_regs+25*4)(sp) + sw $28,(mipsreg_regs+28*4)(sp) # == GP +#endif + sw $16,(mipsreg_regs+16*4)(sp) + sw $17,(mipsreg_regs+17*4)(sp) + sw $18,(mipsreg_regs+18*4)(sp) + sw $19,(mipsreg_regs+19*4)(sp) + sw $20,(mipsreg_regs+20*4)(sp) + sw $21,(mipsreg_regs+21*4)(sp) + sw $22,(mipsreg_regs+22*4)(sp) + sw $23,(mipsreg_regs+23*4)(sp) +# sw $26,(mipsreg_regs+26*4)(sp) # == K0 +# sw $27,(mipsreg_regs+27*4)(sp) # == K1 +# sw $29,(mipsreg_regs+29*4)(sp) # == SP + sw $30,(mipsreg_regs+30*4)(sp) # == FP + sw $31,(mipsreg_regs+31*4)(sp) # == RA + sw $31,(mipsreg_pc)(sp) # == PC (to help with debugging) + +#ifndef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM + + mflo t0 # save LO and HI regs + mfhi t1 + sw t0,mipsreg_lo(sp) + sw t1,mipsreg_hi(sp) + +#endif + + addi t0,sp,mipsreg_size # save SP in reg dump + sw t0,(mipsreg_regs+29*4)(sp) + + sw sp,0(a1) # save sp in save loc + + # Now load the destination thread by dropping through + # to hal_thread_load_context + +#------------------------------------------------------------------------------ +# hal_thread_load_context +# Load thread context +# A0 = address of sp of next thread to execute +# Note that this function is also the second half of hal_thread_switch_context +# and is simply dropped into from it. + + .global hal_thread_load_context +hal_thread_load_context: + + lw sp,0(a0) # load new SP directly + +#ifndef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM + + lw t0,mipsreg_hi(sp) # load HI and LO regs + lw t1,mipsreg_lo(sp) + mthi t0 + mtlo t1 + +#endif + + # load GPRs +# lw $0,(mipsreg_regs+0*4)(sp) + lw $4,(mipsreg_regs+4*4)(sp) # A0, must load for thread startup +#ifndef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM + lw $1,(mipsreg_regs+1*4)(sp) + lw $2,(mipsreg_regs+2*4)(sp) + lw $3,(mipsreg_regs+3*4)(sp) + lw $5,(mipsreg_regs+5*4)(sp) + lw $6,(mipsreg_regs+6*4)(sp) + lw $7,(mipsreg_regs+7*4)(sp) + lw $8,(mipsreg_regs+8*4)(sp) + lw $9,(mipsreg_regs+9*4)(sp) + lw $10,(mipsreg_regs+10*4)(sp) + lw $11,(mipsreg_regs+11*4)(sp) + lw $12,(mipsreg_regs+12*4)(sp) + lw $13,(mipsreg_regs+13*4)(sp) + lw $14,(mipsreg_regs+14*4)(sp) + lw $15,(mipsreg_regs+15*4)(sp) + lw $24,(mipsreg_regs+24*4)(sp) + lw $25,(mipsreg_regs+25*4)(sp) +#endif + lw $16,(mipsreg_regs+16*4)(sp) + lw $17,(mipsreg_regs+17*4)(sp) + lw $18,(mipsreg_regs+18*4)(sp) + lw $19,(mipsreg_regs+19*4)(sp) + lw $20,(mipsreg_regs+20*4)(sp) + lw $21,(mipsreg_regs+21*4)(sp) + lw $22,(mipsreg_regs+22*4)(sp) + lw $23,(mipsreg_regs+23*4)(sp) +# lw $26,(mipsreg_regs+26*4)(sp) # == K0 +# lw $27,(mipsreg_regs+27*4)(sp) # == K1 +# lw $28,(mipsreg_regs+28*4)(sp) # == GP +# lw $29,(mipsreg_regs+29*4)(sp) # == SP + lw $30,(mipsreg_regs+30*4)(sp) # == FP + lw $31,(mipsreg_regs+31*4)(sp) # == RA + + # Note that the following lw must go here and not + # in the jr delay slot, since it has a delay slot + # of its own. + lw sp,(mipsreg_regs+29*4)(sp) # load SP + jr ra # return via ra + nop # delay slot - must be nop + +#------------------------------------------------------------------------------ +# HAL longjmp, setjmp implementations +# hal_setjmp saves only to callee save registers 13-31, r1[sp],r2 +# and lr into buffer supplied in r3[arg0] + + .globl hal_setjmp + .ent hal_setjmp +hal_setjmp: + sw $31,44(a0) # ra (link) + sw $30,40(a0) + sw $28,36(a0) # gp, optimize out? + sw $23,32(a0) + sw $22,28(a0) + sw $21,24(a0) + sw $20,20(a0) + sw $19,16(a0) + sw $18,12(a0) + sw $17,8(a0) + sw $16,4(a0) + sw sp,0(a0) # $29 + li v0,0 + jr ra + nop # delay slot + .end hal_setjmp + + .globl hal_longjmp + .ent hal_longjmp +hal_longjmp: + lw $31,44(a0) # ra (link) + lw $30,40(a0) + lw $28,36(a0) # gp, optimize out? + lw $23,32(a0) + lw $22,28(a0) + lw $21,24(a0) + lw $20,20(a0) + lw $19,16(a0) + lw $18,12(a0) + lw $17,8(a0) + lw $16,4(a0) + lw sp,0(a0) # $29 + move v0,a1 + jr ra + nop # delay slot + .end hal_longjmp + + +#------------------------------------------------------------------------------ +# end of context.S + + \ No newline at end of file diff --git a/packages/hal/mips/arch/current/src/hal_misc.c b/packages/hal/mips/arch/current/src/hal_misc.c new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/src/hal_misc.c @@ -0,0 +1,425 @@ +//============================================================================= +// +// hal_misc.c +// +// HAL miscellaneous functions +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-05 +// Purpose: HAL miscellaneous functions +// Description: This file contains miscellaneous functions provided by the +// HAL. +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include // Base types +#include // tracing macros +#include // assertion macros + +#include // architectural definitions + +#include // Interrupt handling + +#include // Cache handling + +/*---------------------------------------------------------------------------*/ +/* First level C exception handler. */ + +externC void __handle_exception (void); + +externC HAL_SavedRegisters *_hal_registers; + +externC void exception_handler(HAL_SavedRegisters *regs) +{ +#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) + + // Set the pointer to the registers of the current exception + // context. At entry the GDB stub will expand the + // HAL_SavedRegisters structure into a (bigger) register array. + _hal_registers = regs; + __handle_exception(); + +#elif defined(CYGFUN_HAL_COMMON_KERNEL_SUPPORT) && defined(CYGPKG_HAL_EXCEPTIONS) + + // We should decode the vector and pass a more appropriate + // value as the second argument. For now we simply pass a + // pointer to the saved registers. We should also divert + // breakpoint and other debug vectors into the debug stubs. + + deliver_exception( regs->vector>>2, (CYG_ADDRWORD)regs ); + +#else + + CYG_FAIL("Exception!!!"); + +#endif + return; +} + +/*---------------------------------------------------------------------------*/ +/* default ISR */ + +externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) +{ + CYG_TRACE1(true, "Interrupt: %d", vector); + CYG_FAIL("Spurious Interrupt!!!"); + return 0; +} + +/*---------------------------------------------------------------------------*/ +/* data copy and bss zero functions */ + +typedef void (CYG_ROM_ADDRESS)(void); + +#ifdef CYG_HAL_STARTUP_ROM +void hal_copy_data(void) +{ + extern char __ram_data_start; + extern char __ram_data_end; + extern CYG_ROM_ADDRESS __rom_data_start; + char *p = &__ram_data_start; + char *q = (char *)&__rom_data_start; + + while( p != (char *)&__ram_data_end ) + *p++ = *q++; +} +#endif + +void hal_zero_bss(void) +{ + extern CYG_ROM_ADDRESS __bss_start; + extern CYG_ROM_ADDRESS _end; + char *p = (char *)&__bss_start; + + while( p != (char *)&_end ) + *p++ = 0; +} + +/*---------------------------------------------------------------------------*/ + +void fake_ctor(void) {}; + +void +cyg_hal_invoke_constructors (void) +{ +#ifdef CYG_KERNEL_USE_INIT_PRIORITY + + typedef void (*pfunc) (void); + extern pfunc __CTOR_LIST__[]; + long i = (long)(__CTOR_LIST__[0]); + pfunc p; + + for ( ; i > 0; i-- ) + { + p = __CTOR_LIST__[i]; + p (); + } + +#else + + typedef void (CYG_CODE_ADDRESS)(); + extern CYG_CODE_ADDRESS __sched_text_start; + extern CYG_CODE_ADDRESS __sched_text_end; + extern CYG_CODE_ADDRESS __clock_text_start; + extern CYG_CODE_ADDRESS __clock_text_end; + extern CYG_CODE_ADDRESS __thread_text_start; + extern CYG_CODE_ADDRESS __thread_text_end; + + typedef void (*pfunc) (); + extern pfunc __CTOR_LIST__[]; + pfunc *p; + + for (p = __CTOR_LIST__+1; *p != 0; p++) + { + CYG_ADDRESS *pp = (CYG_ADDRESS *)*p; + + if( pp > (CYG_ADDRESS *)&__sched_text_start && + pp < (CYG_ADDRESS *)&__sched_text_end ) + { + (*p) (); + *p = fake_ctor; + } + } + + for (p = __CTOR_LIST__+1; *p != 0; p++) + { + CYG_ADDRESS *pp = (CYG_ADDRESS *)*p; + + if( pp > (CYG_ADDRESS *)&__clock_text_start && + pp < (CYG_ADDRESS *)&__clock_text_end ) + { + (*p) (); + *p = fake_ctor; + } + } + + for (p = __CTOR_LIST__+1; *p != 0; p++) + { + CYG_ADDRESS *pp = (CYG_ADDRESS *)*p; + + if( pp > (CYG_ADDRESS *)&__thread_text_start && + pp < (CYG_ADDRESS *)&__thread_text_end ) + { + (*p) (); + *p = fake_ctor; + } + } + + for (p = __CTOR_LIST__+1; *p != 0; p++) + { + (*p) (); + *p = fake_ctor; + } + +#endif + +#ifdef CYG_HAL_MIPS_TX3904 + + // On the real hardware we also enable the cache. + // doing this here is a temporary measure until we + // have a proper platform specific place to do it. + + HAL_ICACHE_INVALIDATE_ALL(); + HAL_ICACHE_ENABLE(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_DCACHE_ENABLE(); + +#endif + +#if defined(CYG_HAL_USE_ROM_MONITOR) && \ + !defined(CYGDBG_INFRA_DIAG_USE_DEVICE) && \ + defined(CYG_HAL_TX39_JMR3904) + + { + static void hal_init_ctrlc_intr(void); + hal_init_ctrlc_intr(); + } + +#endif +#if defined(CYGFUN_HAL_COMMON_KERNEL_SUPPORT) && \ + defined(CYG_HAL_USE_ROM_MONITOR) && \ + defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + { + extern void patch_dbg_syscalls(void * vector); +#define DBG_SYSCALL_VEC_NUM 15 + patch_dbg_syscalls( (void *)(&hal_vsr_table[DBG_SYSCALL_VEC_NUM]) ); + } +#endif +} + +/*---------------------------------------------------------------------------*/ +/* Determine the index of the ls bit of the supplied mask. */ + +cyg_uint32 hal_lsbit_index(cyg_uint32 mask) +{ + cyg_uint32 n = mask; + + static const signed char tab[64] = + { -1, 0, 1, 12, 2, 6, 0, 13, 3, 0, 7, 0, 0, 0, 0, 14, 10, + 4, 0, 0, 8, 0, 0, 25, 0, 0, 0, 0, 0, 21, 27 , 15, 31, 11, + 5, 0, 0, 0, 0, 0, 9, 0, 0, 24, 0, 0 , 20, 26, 30, 0, 0, 0, + 0, 23, 0, 19, 29, 0, 22, 18, 28, 17, 16, 0 + }; + + n &= ~(n-1UL); + n = (n<<16)-n; + n = (n<<6)+n; + n = (n<<4)+n; + + return tab[n>>26]; +} + +/*---------------------------------------------------------------------------*/ +/* Determine the index of the ms bit of the supplied mask. */ + +cyg_uint32 hal_msbit_index(cyg_uint32 mask) +{ + cyg_uint32 x = mask; + cyg_uint32 w; + + /* Phase 1: make word with all ones from that one to the right */ + x |= x >> 16; + x |= x >> 8; + x |= x >> 4; + x |= x >> 2; + x |= x >> 1; + + /* Phase 2: calculate number of "1" bits in the word */ + w = (x & 0x55555555) + ((x >> 1) & 0x55555555); + w = (w & 0x33333333) + ((w >> 2) & 0x33333333); + w = w + (w >> 4); + w = (w & 0x000F000F) + ((w >> 8) & 0x000F000F); + return (cyg_uint32)((w + (w >> 16)) & 0xFF); + +} + +/*---------------------------------------------------------------------------*/ +/* Idle thread action */ + +void hal_idle_thread_action( cyg_uint32 count ) +{ +#if 0 //def CYG_HAL_MIPS_SIM + if( (count % 1000) == 0 ) + { + // This code causes a fake interrupt. + asm volatile ( + "xor $24,$24,$24;" + "mtc0 $24,$13;" + "lui $25,%%hi(1f);" + "ori $25,$25,%%lo(1f);" + "j other_vector;" + "nop;" + "1:" + : + : + : "t8", "t9" + ); + } +#endif +#if 0 //def CYG_HAL_MIPS_JMR3904 + + { +// cyg_uint32 tval, isr, imr, ilr; + cyg_uint32 sr, cr; +// HAL_CLOCK_READ( &tval ); +// HAL_READ_UINT32( 0xFFFFC000, isr ); +// HAL_READ_UINT32( 0xFFFFC004, imr ); +// HAL_READ_UINT32( 0xFFFFC01C, ilr ); +// CYG_TRACE2(1, "Timer value, ISR ",tval, isr); +// CYG_TRACE2(1, "IMR ILR0 ", imr, ilr); + + asm volatile ( + "mfc0 %0,$12;" + "mfc0 %1,$13;" + : "=r"(sr), "=r"(cr) + ); + + CYG_TRACE2(1, "Status Cause ", sr, cr); + +// if( count == 4 ) +// { +// HAL_ENABLE_INTERRUPTS(); +// } + +// if( count >= 10 ) +// for(;;); + } +#endif +} + +/*---------------------------------------------------------------------------*/ +/* This code installs an interrupt handler to capture Ctrl-C. */ +/* It's here for lack of anywhere more suitable to put it. */ + +#if defined(CYG_HAL_USE_ROM_MONITOR) && \ + !defined(CYGDBG_INFRA_DIAG_USE_DEVICE) && \ + defined(CYG_HAL_TX39_JMR3904) + +#define DIAG_BASE 0xfffff300 +#define DIAG_SLCR (DIAG_BASE+0x00) +#define DIAG_SLSR (DIAG_BASE+0x04) +#define DIAG_SLDICR (DIAG_BASE+0x08) +#define DIAG_SLDISR (DIAG_BASE+0x0C) +#define DIAG_SFCR (DIAG_BASE+0x10) +#define DIAG_SBRG (DIAG_BASE+0x14) +#define DIAG_TFIFO (DIAG_BASE+0x20) +#define DIAG_RFIFO (DIAG_BASE+0x30) + +#define BRG_T0 0x0000 +#define BRG_T2 0x0100 +#define BRG_T4 0x0200 +#define BRG_T5 0x0300 + +static cyg_uint32 hal_ctrlc_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) +{ + char c; + CYG_WORD16 disr; + + HAL_READ_UINT16( DIAG_SLDISR , disr ); + + if( disr & 0x0001 ) + { + + disr = disr & ~0x0001; + + HAL_READ_UINT8( DIAG_RFIFO, c ); + + HAL_WRITE_UINT16( DIAG_SLDISR , disr ); + +#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) + if( c == 3 ) + { + // Ctrl-C: breakpoint. + extern void breakpoint(void); + breakpoint(); + } +#elif defined(CYG_HAL_USE_ROM_MONITOR) && defined(CYG_HAL_USE_ROM_MONITOR_GDB_STUBS) + if( c == 3 ) + { + // Ctrl-C: breakpoint. +// HAL_BREAKPOINT(_breakinst); + typedef void bpt_fn(void); + bpt_fn *bfn = ((bpt_fn **)0x80000100)[61]; + + bfn(); + } +#elif defined(CYG_HAL_USE_ROM_MONITOR) && defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + if( c == 3 ) + { + // Ctrl-C: breakpoint. + HAL_BREAKPOINT(_breakinst1); + } +#endif + } + + return 0; +} + + +static void hal_init_ctrlc_intr(void) +{ + CYG_WORD16 dicr; + + HAL_INTERRUPT_ATTACH( CYG_VECTOR_SIO_0, hal_ctrlc_isr, NULL, NULL ); + + HAL_INTERRUPT_UNMASK( CYG_VECTOR_SIO_0 ); + + HAL_READ_UINT16( DIAG_SLDICR , dicr ); + dicr = 0x0001; + HAL_WRITE_UINT16( DIAG_SLDICR , dicr ); +} + +#endif + +/*---------------------------------------------------------------------------*/ +/* End of hal_misc.c */ diff --git a/packages/hal/mips/arch/current/src/mips-stub.c b/packages/hal/mips/arch/current/src/mips-stub.c new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/src/mips-stub.c @@ -0,0 +1,378 @@ +/* mips-stub.c - helper functions for stub, generic to all MIPS processors + * + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +#include "cyg/hal/hal_stub.h" + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + +#include "cyg/hal/hal_arch.h" +#include +#include + +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 /* interrupt */ +#define SIGQUIT 3 /* quit */ +#define SIGILL 4 /* illegal instruction (not reset when caught) */ +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGIOT 6 /* IOT instruction */ +#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ +#define SIGEMT 7 /* EMT instruction */ +#define SIGFPE 8 /* floating point exception */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGSEGV 11 /* segmentation violation */ +#define SIGSYS 12 /* bad argument to system call */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 /* software termination signal from kill */ + + +/* Saved registers. */ + +HAL_SavedRegisters *_hal_registers; + +target_register_t * _registers; /* A pointer to the current set of registers */ +target_register_t registers[NUMREGS]; +target_register_t alt_registers[NUMREGS] ; /* Thread or saved process state */ + + +/* Given a trap value TRAP, return the corresponding signal. */ + +int __computeSignal (unsigned int trap_number) +{ + switch (trap_number) + { + case EXC_INT: + /* External interrupt */ + return SIGINT; + + case EXC_RI: + /* Reserved instruction */ + case EXC_CPU: + /* Coprocessor unusable */ + return SIGILL; + + case EXC_BP: + /* Break point */ + return SIGTRAP; + + case EXC_OVF: + /* Arithmetic overflow */ + case EXC_TRAP: + /* Trap exception */ + case EXC_FPE: + /* Floating Point Exception */ + return SIGFPE; + + case EXC_IBE: + /* Bus error (Ifetch) */ + case EXC_DBE: + /* Bus error (data load or store) */ + return SIGBUS; + + case EXC_MOD: + /* TLB modification exception */ + case EXC_TLBL: + /* TLB miss (Load or Ifetch) */ + case EXC_TLBS: + /* TLB miss (Store) */ + case EXC_ADEL: + /* Address error (Load or Ifetch) */ + case EXC_ADES: + /* Address error (Store) */ + return SIGSEGV; + + case EXC_SYS: + /* System call */ + return SIGSYS; + + default: + return SIGTERM; + } +} + + +/* Return the trap number corresponding to the last-taken trap. */ + +int __get_trap_number (void) +{ + return (get_register (CAUSE) & CAUSE_EXCMASK) >> CAUSE_EXCSHIFT; +} + +// Return the currently-saved value corresponding to register REG of +// the exception context. +target_register_t get_register (regnames_t reg) +{ + return registers[reg]; +} + +// Store VALUE in the register corresponding to WHICH in the exception +// context. +void put_register (regnames_t which, target_register_t value) +{ + registers[which] = value; +} + + +/* Set the currently-saved pc register value to PC. This also updates NPC + as needed. */ + +void set_pc (target_register_t pc) +{ + put_register (PC, pc); +} + + +/*---------------------------------------------------------------------- + * Single-step support + */ + +/* Saved instruction data for single step support. */ + +typedef unsigned long t_inst; + +static struct +{ + t_inst *targetAddr; + t_inst savedInstr; +} instrBuffer; + + +/* Set things up so that the next user resume will execute one instruction. + This may be done by setting breakpoints or setting a single step flag + in the saved user registers, for example. */ + +void single_step (void) +{ + InstFmt inst; + t_inst *pc = (t_inst *) get_register (PC); + + instrBuffer.targetAddr = pc + 1; /* set default */ + + inst.word = *pc; /* read the next instruction */ + +//diag_printf("pc %08x %08x\n",pc,inst.word); + + switch (inst.RType.op) { /* override default if branch */ + case OP_SPECIAL: + switch (inst.RType.func) { + case OP_JR: + case OP_JALR: + instrBuffer.targetAddr = (t_inst *) get_register (inst.RType.rs); + break; + }; + break; + + case OP_REGIMM: + switch (inst.IType.rt) { + case OP_BLTZ: + case OP_BLTZL: + case OP_BLTZAL: + case OP_BLTZALL: + if (get_register (inst.IType.rs) < 0 ) + instrBuffer.targetAddr = + (t_inst *)(((signed short)inst.IType.imm<<2) + + (get_register (PC) + 4)); + else + instrBuffer.targetAddr = (t_inst *)(get_register (PC) + 8); + break; + case OP_BGEZ: + case OP_BGEZL: + case OP_BGEZAL: + case OP_BGEZALL: + if (get_register (inst.IType.rs) >= 0 ) + instrBuffer.targetAddr = + (t_inst *)(((signed short)inst.IType.imm<<2) + + (get_register (PC) + 4)); + else + instrBuffer.targetAddr = (t_inst *)(get_register (PC) + 8); + break; + }; + break; + + case OP_J: + case OP_JAL: + instrBuffer.targetAddr = + (t_inst *)((inst.JType.target<<2) + + ((get_register (PC) + 4)&0xf0000000)); + break; + + case OP_BEQ: + case OP_BEQL: + if (get_register (inst.IType.rs) == get_register (inst.IType.rt)) + instrBuffer.targetAddr = + (t_inst *)(((signed short)inst.IType.imm<<2) + + (get_register (PC) + 4)); + else + instrBuffer.targetAddr = (t_inst *)(get_register (PC) + 8); + break; + case OP_BNE: + case OP_BNEL: + if (get_register (inst.IType.rs) != get_register (inst.IType.rt)) + instrBuffer.targetAddr = + (t_inst *)(((signed short)inst.IType.imm<<2) + + (get_register (PC) + 4)); + else + instrBuffer.targetAddr = (t_inst *)(get_register (PC) + 8); + break; + case OP_BLEZ: + case OP_BLEZL: + if (get_register (inst.IType.rs) <= 0) + instrBuffer.targetAddr = + (t_inst *)(((signed short)inst.IType.imm<<2) + (get_register (PC) + 4)); + else + instrBuffer.targetAddr = (t_inst *)(get_register (PC) + 8); + break; + case OP_BGTZ: + case OP_BGTZL: + if (get_register (inst.IType.rs) > 0) + instrBuffer.targetAddr = + (t_inst *)(((signed short)inst.IType.imm<<2) + (get_register (PC) + 4)); + else + instrBuffer.targetAddr = (t_inst *)(get_register (PC) + 8); + break; + +#if 0 /* no floating point support at the moment */ + case OP_COP1: + if (inst.RType.rs == OP_BC) + switch (inst.RType.rt) { + case COPz_BCF: + case COPz_BCFL: + if (get_register (FCSR) & CSR_C) + instrBuffer.targetAddr = (t_inst *)(get_register (PC) + 8); + else + instrBuffer.targetAddr = + (t_inst *)(((signed short)inst.IType.imm<<2) + + (get_register (PC) + 4)); + break; + case COPz_BCT: + case COPz_BCTL: + if (get_register (FCSR) & CSR_C) + instrBuffer.targetAddr = + (t_inst *)(((signed short)inst.IType.imm<<2) + + (get_register (PC) + 4)); + else + instrBuffer.targetAddr = (t_inst *)(get_register (PC) + 8); + break; + }; + break; +#endif + + } +} + + +/* Clear the single-step state. */ + +void clear_single_step (void) +{ +//diag_printf("clear_ss ta %08x\n",instrBuffer.targetAddr); + if (instrBuffer.targetAddr != NULL) + { + *instrBuffer.targetAddr = instrBuffer.savedInstr; + instrBuffer.targetAddr = NULL; + } + instrBuffer.savedInstr = NOP_INSTR; +} + + +void install_breakpoints () +{ +//diag_printf("install_bpt ta %08x\n",instrBuffer.targetAddr); + if (instrBuffer.targetAddr != NULL) + { + instrBuffer.savedInstr = *instrBuffer.targetAddr; + *instrBuffer.targetAddr = __break_opcode (); +//diag_printf("ta %08x si %08x *ta %08x\n", +// instrBuffer.targetAddr,instrBuffer.savedInstr,*instrBuffer.targetAddr); + } +} + + +/* If the breakpoint we hit is in the breakpoint() instruction, return a + non-zero value. */ + +int +__is_breakpoint_function () +{ + return get_register (PC) == (target_register_t)&_breakinst; +} + + +/* Skip the current instruction. Since this is only called by the + stub when the PC points to a breakpoint or trap instruction, + we can safely just skip 4. */ + +void __skipinst (void) +{ + put_register (PC, get_register (PC) + 4); +} + + +/* Write the 'T' packet in BUFFER. SIGVAL is the signal the program + received. */ + +void __build_t_packet (int sigval, char *buf) +{ + target_register_t addr; + char *ptr = buf; + target_register_t *sp; + + sp = (target_register_t *) get_register (SP); + + *ptr++ = 'T'; + *ptr++ = __tohex (sigval >> 4); + *ptr++ = __tohex (sigval); + + +#ifdef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT + // Include thread ID if thread manipulation is required. + { + int id; + extern int dbg_currthread_id(void); // FIXME: get from header instead + + *ptr++ = 't'; + *ptr++ = 'h'; + *ptr++ = 'r'; + *ptr++ = 'e'; + *ptr++ = 'a'; + *ptr++ = 'd'; + *ptr++ = ':'; + + id = dbg_currthread_id (); + ptr = __mem2hex((char *)&id, ptr, sizeof(id), 0); + *ptr++ = ';'; + } +#endif + + *ptr++ = __tohex (PC >> 4); + *ptr++ = __tohex (PC); + *ptr++ = ':'; + addr = get_register (PC); + ptr = __mem2hex((char *)&addr, ptr, sizeof(addr), 0); + *ptr++ = ';'; + + *ptr++ = __tohex (SP >> 4); + *ptr++ = __tohex (SP); + *ptr++ = ':'; + ptr = __mem2hex((char *)&sp, ptr, sizeof(sp), 0); + *ptr++ = ';'; + + *ptr++ = 0; +} + +#endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS diff --git a/packages/hal/mips/arch/current/src/vectors.S b/packages/hal/mips/arch/current/src/vectors.S new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/src/vectors.S @@ -0,0 +1,776 @@ +##============================================================================= +## +## vectors.S +## +## MIPS exception vectors +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1998-02-04 +## Purpose: MIPS exception vectors +## Description: This file defines the code placed into the exception +## vectors. It also contains the first level default VSRs +## that save and restore state for both exceptions and +## interrupts. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +# .file "vectors.S" + +#include +#include + +#ifdef CYGPKG_KERNEL +# include +#endif + +#include + + .extern cyg_instrument + +##----------------------------------------------------------------------------- + +#define MAX_SAVE_REG 31 + +#if defined(CYG_HAL_STARTUP_RAM) +# if defined(CYG_HAL_MIPS_SIM) || !defined(CYG_HAL_USE_ROM_MONITOR) +# define INITIAL_SR 0x1000ff00 /* CP0 usable, Ints enabled */ +//#define INITIAL_SR 0x10000000 /* CP0 usable, Ints disabled */ +# else +# define INITIAL_SR 0x1040ff00 /* as above + ROM vectors used */ +# endif +#elif defined(CYG_HAL_STARTUP_ROM) +# define INITIAL_SR 0x1040ff00 /* as above + ROM vectors used */ +#endif + +##----------------------------------------------------------------------------- +## Hardware supplied vectors + + .set noreorder + .set noat + + .section ".reset_vector","ax" + + # Reset vector at 0xBFC00000 + + .globl reset_vector +reset_vector: + la v0,_start # jump to start + jr v0 + nop # (delay slot) + + .section ".debug_vector","ax" + + # Debug vector at 0xBFC00200 + + .globl debug_vector +debug_vector: + la k0,32 + la k1,hal_vsr_table # Get VSR table + lw k1,32*4(k1) # load debug vector + jr k1 # go there + nop # (delay slot) + + .section ".other_vector","ax" + + # Common vector at 0x80000080 or 0xBFC00180 + + .globl other_vector +other_vector: + mfc0 k0,cause # K0 = exception cause + nop + andi k0,k0,0x7F # isolate exception code + la k1,hal_vsr_table # address of VSR table + add k1,k1,k0 # offset of VSR entry + lw k1,0(k1) # k1 = pointer to VSR + jr k1 # go there + nop # (delay slot) + + .section ".utlb_vector","ax" + + .globl utlb_vector +utlb_vector: + la k0,33 + la k1,hal_vsr_table # Get VSR table + lw k1,33*4(k1) # load utlb vector + jr k1 # go there + nop # (delay slot) + + +##----------------------------------------------------------------------------- +## Startup code + + .text + + .globl _start + .ent _start +_start: + # init CPU registers + mtc0 zero,cause # zero cause reg + la v0,INITIAL_SR + mtc0 v0,sr + mfc0 v0,config + nop + .set at + and v0,v0,0xffffffcf +# la v0,0 + .set noat + mtc0 v0,config + + + # Initialize hardware + +#ifdef CYG_HAL_MIPS_JMR3904 + + # These mappings need to be set up before we + # can use the stack and make calls to other + # functions + + # SCS0,1 base addr of ISA & PCI + la a0,0xffffe010 + la a1,0x20201410 + sw a1,0(a0) + + la a0,0xffffe014 + la a1,0x0000fcfc + sw a1,0(a0) + + # ROM configuration + la a0,0xffff9000 + la a1,0x1fc00400 + sw a1,0(a0) + + # SRAM config + la a0,0xffff9100 + la a1,0x00000000 + sw a1,0(a0) + + la a0,0xfffff500 + la a1,0xff + sb a1,0(a0) + la a1,0 + sb a1,4(a0) +#endif + + # Load Global Pointer register. + la gp,_gp + + # load initial stack pointer + la a0,__interrupt_stack + move sp,a0 + +#if defined(CYG_HAL_STARTUP_ROM) || \ + (defined(CYG_HAL_STARTUP_RAM) && !defined(CYG_HAL_USE_ROM_MONITOR)) + + # If we are starting up from ROM, or we are starting in + # RAM and NOT using a ROM monitor, initialize the VSR table. + + la a0,__default_interrupt_vsr + la a1,__default_exception_vsr + la a3,hal_vsr_table + sw a0,0(a3) + sw a1,1*4(a3) + sw a1,2*4(a3) + sw a1,3*4(a3) + sw a1,4*4(a3) + sw a1,5*4(a3) + sw a1,6*4(a3) + sw a1,7*4(a3) + sw a1,8*4(a3) + sw a1,9*4(a3) + sw a1,10*4(a3) + sw a1,11*4(a3) + sw a1,12*4(a3) + sw a1,13*4(a3) + sw a1,14*4(a3) + sw a1,15*4(a3) + + sw a1,32*4(a3) + sw a1,33*4(a3) + +#ifdef CYG_HAL_ROM_MONITOR + + # Install vectors to debug read and write functions + + .extern hal_diag_write_char + .extern hal_diag_read_char + .extern breakpoint + + la a0,hal_diag_write_char + sw a0,63*4(a3) + la a1,hal_diag_read_char + sw a1,62*4(a3) + la a0,breakpoint + sw a0,61*4(a3) + +#endif + +#endif +#if defined(CYG_HAL_STARTUP_RAM) && defined(CYG_HAL_USE_ROM_MONITOR) + + # initialize the VSR table + # We only take control of the interrupt vector, + # the rest are left to the ROM for now... + + la a0,__default_interrupt_vsr + la a3,hal_vsr_table + sw a0,0(a3) + +#endif + +#ifdef CYG_HAL_STARTUP_ROM + # Copy data from ROM to RAM + + .extern hal_copy_data + jal hal_copy_data + nop +#endif + + # Zero BSS + + .extern hal_zero_bss + jal hal_zero_bss + nop + + # Call constructors + + .extern cyg_hal_invoke_constructors + jal cyg_hal_invoke_constructors + nop + + # Call cyg_start + + .extern cyg_start + jal cyg_start + nop + +9: + j 9b # Loop if we return + nop # (delay slot) + + .end _start + +##----------------------------------------------------------------------------- +## Default exception VSR. +## Saves machine state and calls external handling code. + + .globl __default_exception_vsr + .ent __default_exception_vsr +__default_exception_vsr: + + # We enter here with all of the CPU state still + # in its registers except: + # K0 = vector index + # K1 = address of this function + +#ifdef CYG_HAL_ROM_MONITOR + # Switch to interrupt stack to handle exception + move k1,sp + la sp,__interrupt_stack +#endif + + addi sp,sp,-mips_exception_decrement + # space for registers + safety margin + + sw k0,mipsreg_vector(sp) # store vector + + .set noat + # store GPRs + sw $0,(mipsreg_regs+0*4)(sp) + sw $1,(mipsreg_regs+1*4)(sp) + sw $2,(mipsreg_regs+2*4)(sp) + sw $3,(mipsreg_regs+3*4)(sp) + sw $4,(mipsreg_regs+4*4)(sp) + sw $5,(mipsreg_regs+5*4)(sp) + sw $6,(mipsreg_regs+6*4)(sp) + sw $7,(mipsreg_regs+7*4)(sp) + sw $8,(mipsreg_regs+8*4)(sp) + sw $9,(mipsreg_regs+9*4)(sp) + sw $10,(mipsreg_regs+10*4)(sp) + sw $11,(mipsreg_regs+11*4)(sp) + sw $12,(mipsreg_regs+12*4)(sp) + sw $13,(mipsreg_regs+13*4)(sp) + sw $14,(mipsreg_regs+14*4)(sp) + sw $15,(mipsreg_regs+15*4)(sp) + sw $16,(mipsreg_regs+16*4)(sp) + sw $17,(mipsreg_regs+17*4)(sp) + sw $18,(mipsreg_regs+18*4)(sp) + sw $19,(mipsreg_regs+19*4)(sp) + sw $20,(mipsreg_regs+20*4)(sp) + sw $21,(mipsreg_regs+21*4)(sp) + sw $22,(mipsreg_regs+22*4)(sp) + sw $23,(mipsreg_regs+23*4)(sp) + sw $24,(mipsreg_regs+24*4)(sp) + sw $25,(mipsreg_regs+25*4)(sp) +# sw $26,(mipsreg_regs+26*4)(sp) # == K0 +# sw $27,(mipsreg_regs+27*4)(sp) # == K1 + sw $28,(mipsreg_regs+28*4)(sp) # == GP +# sw $29,(mipsreg_regs+29*4)(sp) # == SP + sw $30,(mipsreg_regs+30*4)(sp) # == FP + sw $31,(mipsreg_regs+31*4)(sp) # == RA + + mfhi a0 + mflo a1 + sw a0,mipsreg_hi(sp) + sw a1,mipsreg_lo(sp) + +#ifdef CYG_HAL_ROM_MONITOR + # K1 contains original SP + sw k1,(mipsreg_regs+29*4)(sp) # store in reg dump +#else + # synthesize original SP value + move a2,sp # a2 = sp + addi a2,a2,mips_exception_decrement # a2 = original sp + sw a2,(mipsreg_regs+29*4)(sp) # store in reg dump +#endif + + # save remaining machine state registers + mfc0 t0,cause + mfc0 t1,sr +# mfc0 t2,cache + mfc0 t3,badvr + mfc0 t4,config + mfc0 t5,prid + mfc0 t6,epc + +#ifndef CYG_HAL_MIPS_SIM + mfc0 t2,cache +#endif + + sw t0,mipsreg_cause(sp) + sw t1,mipsreg_sr(sp) + sw t2,mipsreg_cache(sp) + sw t3,mipsreg_badvr(sp) + sw t4,mipsreg_config(sp) + sw t5,mipsreg_prid(sp) + sw t6,mipsreg_pc(sp) + + + # The machine state is now all saved on the stack. + + # Load Global Pointer register. + la gp,_gp + + move s0,sp # save pointer to saved state + + addi sp,sp,-mips_stack_frame_size # make a null frame + + # Need to set up back pointers etc. ??? + + la ra,restore_state # load return address + + .extern exception_handler + j exception_handler # call C code + move a0,s0 # arg0 = register dump (delay slot) + + # When the exception handler returns, it will + # go back to restore_state, below. + + .end __default_exception_vsr + +##------------------------------------------------------------------------------ +## Default interrupt VSR. +## Saves machine state and calls appropriate ISR. When done, calls +## interrupt_end() to finish up and possibly reschedule. + + .globl __default_interrupt_vsr + .ent __default_interrupt_vsr +__default_interrupt_vsr: + + + # We enter here with all of the CPU state still + # in its registers except: + # K0 = vector index + # K1 = address of this function + + addi sp,sp,-mips_exception_decrement + # space for registers + safety margin + + sw k0,mipsreg_vector(sp) # store vector + + # store GPRs + sw $0,(mipsreg_regs+0*4)(sp) + sw $1,(mipsreg_regs+1*4)(sp) + sw $2,(mipsreg_regs+2*4)(sp) + sw $3,(mipsreg_regs+3*4)(sp) + sw $4,(mipsreg_regs+4*4)(sp) + sw $5,(mipsreg_regs+5*4)(sp) + sw $6,(mipsreg_regs+6*4)(sp) + sw $7,(mipsreg_regs+7*4)(sp) + sw $8,(mipsreg_regs+8*4)(sp) + sw $9,(mipsreg_regs+9*4)(sp) + sw $10,(mipsreg_regs+10*4)(sp) + sw $11,(mipsreg_regs+11*4)(sp) + sw $12,(mipsreg_regs+12*4)(sp) + sw $13,(mipsreg_regs+13*4)(sp) + sw $14,(mipsreg_regs+14*4)(sp) + sw $15,(mipsreg_regs+15*4)(sp) + sw $16,(mipsreg_regs+16*4)(sp) + sw $17,(mipsreg_regs+17*4)(sp) + sw $18,(mipsreg_regs+18*4)(sp) + sw $19,(mipsreg_regs+19*4)(sp) + sw $20,(mipsreg_regs+20*4)(sp) + sw $21,(mipsreg_regs+21*4)(sp) + sw $22,(mipsreg_regs+22*4)(sp) + sw $23,(mipsreg_regs+23*4)(sp) + sw $24,(mipsreg_regs+24*4)(sp) + sw $25,(mipsreg_regs+25*4)(sp) +# sw $26,(mipsreg_regs+26*4)(sp) # == K0 +# sw $27,(mipsreg_regs+27*4)(sp) # == K1 + sw $28,(mipsreg_regs+28*4)(sp) # == GP +# sw $29,(mipsreg_regs+29*4)(sp) # == SP + sw $30,(mipsreg_regs+30*4)(sp) # == FP + sw $31,(mipsreg_regs+31*4)(sp) # == RA + + mfhi a0 + mflo a1 + sw a0,mipsreg_hi(sp) + sw a1,mipsreg_lo(sp) + + # synthesize original SP value + move a2,sp # a2 = sp + addi a2,a2,mips_exception_decrement # a2 = original sp + sw a2,(mipsreg_regs+29*4)(sp) # store in reg dump + + mfc0 t1,sr + mfc0 t3,epc + +#ifndef CYG_HAL_MIPS_SIM + mfc0 t2,cache +#endif + sw t1,mipsreg_sr(sp) + sw t2,mipsreg_cache(sp) + sw t3,mipsreg_pc(sp) + + # The machine state is now all saved on the stack. + + # Load Global Pointer register. + la gp,_gp + +#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT + .extern _18Cyg_Scheduler_Base$sched_lock + la v0,_18Cyg_Scheduler_Base$sched_lock + lw a0,0(v0) + addi a0,a0,1 + sw a0,0(v0) +#endif + + move s0,sp # save pointer to saved state + +#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK + + la a0,__interrupt_stack # a0 = stack top + la a1,__interrupt_stack_base # a1 = stack base + sub a3,sp,a1 # a3 = sp - base + bltz a3,1f # if < 0 - not on istack + nop # delay slot + sub t0,a0,sp # t0 = top - sp + bgtz t0,8f # if > 0 - already on istack + nop # delay slot +1: + move sp,a0 # switch to istack +8: + addi sp,sp,-4 # space for old SP + sw s0,0(sp) # save old SP on stack + +#endif + + subu sp,sp,mips_stack_frame_size # make a null frame + + # Need to set up back pointers etc. ??? + + # Decode external interrupt via interrupt controller + + mfc0 a1,cause # get cause register + nop + srl a1,a1,10 # shift IP bits to ls bits + andi a1,a1,0x7F # isolate IP bits + la t0,interrupt_translation_table # address of translation table + add t0,t0,a1 # offset of index byte + lb s2,0(t0) # load it + +#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN + move s1,zero # Just vector zero is supported +#else + move s1,s2 # Vector == interrupt number +#endif + + # Here s1 is the number of the vector to be called and s2 is + # the number of the interrupt being serviced. + +#if defined(CYGPKG_KERNEL_INSTRUMENT) && defined(CYGDBG_KERNEL_INSTRUMENT_INTR) + + # Call cyg_instrument to record that this interrupt is being raised. + + li a0,0x0301 # a0 = type = INTR,RAISE + move a1,s1 # a1 = vector number + jal cyg_instrument # call instrument function + xor a2,a2,a2 # arg2 = 0 (delay slot) +#endif + + sll s1,s1,2 # s1 = byte offset of vector + + la t2,hal_interrupt_handlers # handler table + add t2,t2,s1 # address of ISR ptr + lw t2,0(t2) # ISR pointer + + la a1,hal_interrupt_data # data table + add a1,a1,s1 # address of data ptr + lw a1,0(a1) # Data pointer + + move a0,s2 # pass interrupt number + + jalr t2 # call ISR via t2 + nop # (delay slot) + +#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK + + # If we are returning from the last nested interrupt, move back + # to the thread stack. interrupt_end() must be called on the + # thread stack since it potentially causes a context switch. + # Since we have arranged for the top of stack location to + # contain the sp we need to go back to here, just pop it off + # and put it in SP. + + + lw sp,mips_stack_frame_size(sp) # sp = *sp + subu sp,sp,mips_stack_frame_size # make a null frame +#endif + +#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT + + # We only need to call _interrupt_end() when there is a kernel + # present to do any tidying up. + + # On return v0 bit 1 will indicate whether a DSR is + # to be posted. Pass this together with a pointer to + # the interrupt object we have just used to the + # interrupt tidy up routine. + + # Note that s0, s1 and s2 are defined to be preserved across + # calls by the calling convention, so they still contain + # the register dump, the vector offset and the interrupt number + # respectively. + + move a0,v0 # put ISR result in arg0 + + la a1,hal_interrupt_objects # interrupt object table + add a1,a1,s1 # address of object ptr + lw a1,0(a1) # a1 = object ptr + + move a2,s0 # arg3 = saved register dump + + # interrupt_end() must be called with interrupts enabled. + + rfe # restore previous status bits + # this may enable interrupts + + .extern interrupt_end + jal interrupt_end # call into C to finish off + nop # (delay slot) + +#endif + +restore_state: + + # All done, restore CPU state and continue + + addi sp,sp,mips_stack_frame_size # retrieve CPU state ptr + + # Load status register and cache control register. + # This will put the interrupt, mode and cache control + # bits back to their post-exception values, so we will + # need to do another RFE before we finish. + + lw t1,mipsreg_sr(sp) + lw t2,mipsreg_cache(sp) + + mtc0 t1,sr +#ifndef CYG_HAL_MIPS_SIM + mtc0 t2,cache +#endif + + lw a0,mipsreg_hi(sp) + lw a1,mipsreg_lo(sp) + mthi a0 + mtlo a1 + + # load GPRs +# lw $0,(mipsreg_regs+0*4)(sp) + lw $1,(mipsreg_regs+1*4)(sp) + lw $2,(mipsreg_regs+2*4)(sp) + lw $3,(mipsreg_regs+3*4)(sp) + lw $4,(mipsreg_regs+4*4)(sp) + lw $5,(mipsreg_regs+5*4)(sp) + lw $6,(mipsreg_regs+6*4)(sp) + lw $7,(mipsreg_regs+7*4)(sp) + lw $8,(mipsreg_regs+8*4)(sp) + lw $9,(mipsreg_regs+9*4)(sp) + lw $10,(mipsreg_regs+10*4)(sp) + lw $11,(mipsreg_regs+11*4)(sp) + lw $12,(mipsreg_regs+12*4)(sp) + lw $13,(mipsreg_regs+13*4)(sp) + lw $14,(mipsreg_regs+14*4)(sp) + lw $15,(mipsreg_regs+15*4)(sp) + lw $16,(mipsreg_regs+16*4)(sp) + lw $17,(mipsreg_regs+17*4)(sp) + lw $18,(mipsreg_regs+18*4)(sp) + lw $19,(mipsreg_regs+19*4)(sp) + lw $20,(mipsreg_regs+20*4)(sp) + lw $21,(mipsreg_regs+21*4)(sp) + lw $22,(mipsreg_regs+22*4)(sp) + lw $23,(mipsreg_regs+23*4)(sp) + lw $24,(mipsreg_regs+24*4)(sp) + lw $25,(mipsreg_regs+25*4)(sp) +# lw $26,(mipsreg_regs+26*4)(sp) # == K0 +# lw $27,(mipsreg_regs+27*4)(sp) # == K1 + lw $28,(mipsreg_regs+28*4)(sp) # == GP +# lw $29,(mipsreg_regs+29*4)(sp) # == SP + lw $30,(mipsreg_regs+30*4)(sp) # == FP + lw $31,(mipsreg_regs+31*4)(sp) # == RA + + lw k0,mipsreg_pc(sp) # K0 = return PC + lw sp,(mipsreg_regs+29*4)(sp) # load SP + sync + jr k0 # jump back to interrupted code + rfe # restore state (delay slot) + + .end __default_interrupt_vsr + +# This table translates from the 6 bit value supplied in the IP bits +# of the cause register into a 0..16 offset into the ISR tables. +interrupt_translation_table: + .byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 + .byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 + .byte 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16 + .byte 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16 + +##----------------------------------------------------------------------------- +## Interrupt Stack. +## Used during intialization and for executing ISRs. + + .bss + + .balign 16 +__interrupt_stack_base: + .rept CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE + .byte 0 + .endr + .balign 16 +__interrupt_stack: + + .long 0,0,0,0,0,0,0,0 + +#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT + + .globl idle_thread_stack +idle_thread_stack: + .rept CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE + .byte 0 + .endr + +#endif + +##----------------------------------------------------------------------------- +## VSR table. +## The main interrupt code indirects through here to find the VSR +## to execute for each architecture defined interrupt. +## This is only used for simulated targets, on real targets a fixed location VSR +## table is now allocated at 0x80000100. + +#if defined(CYG_HAL_MIPS_SIM) || \ + ( defined(CYG_HAL_MIPS_TX3904) && \ + defined(CYG_HAL_STARTUP_RAM) && \ + !defined(CYG_HAL_USE_ROM_MONITOR) \ + ) + .section ".vsr_table","a" + + .globl hal_vsr_table + +hal_vsr_table: + .long __default_interrupt_vsr + .rept 63 + .long __default_exception_vsr + .endr + +#endif + +#------------------------------------------------------------------------------ +# Interrupt vector tables. +# These tables contain the isr, data and object pointers used to deliver +# interrupts to user code. +# hal_interrupt_level contains the interrupt level set by +# HAL_INTERRUPT_CONFIGURE(). + + + .extern hal_default_isr + + .data + + .globl hal_interrupt_handlers +hal_interrupt_handlers: + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + .long hal_default_isr + + .globl hal_interrupt_data +hal_interrupt_data: + .rept 17 + .long 0 + .endr + + .globl hal_interrupt_objects +hal_interrupt_objects: + .rept 17 + .long 0 + .endr + + .globl hal_interrupt_level +hal_interrupt_level: + .rept 17 + .byte 7 + .endr + +##----------------------------------------------------------------------------- +## end of vectors.S diff --git a/packages/hal/mips/arch/current/tests/PKGconf.mak b/packages/hal/mips/arch/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mips/arch/current/tests/PKGconf.mak @@ -0,0 +1,40 @@ +#=============================================================================== +# +# makefile +# +# hal/mips/arch/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + + +PACKAGE := hal_tx39 +include ../../../../../pkgconf/pkgconf.mak + +TESTS := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + + diff --git a/packages/hal/mips/jmr3904/current/ChangeLog b/packages/hal/mips/jmr3904/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/ChangeLog @@ -0,0 +1,137 @@ +1998-10-25 Jesper Skov + + * src/hal_stub.c: Fixed #endif comment. + +Fri Oct 23 03:33:47 1998 Jonathan Larmour + + * src/jmr3904.ld: + Move _gp pointer to after data section and constructors/destructors + +1998-10-21 Nick Garnett + + * src/hal_stub.c: + Removed include of , it appears to be unnecessary. + +1998-10-19 Jesper Skov + + * include/pkgconf/hal_tx39_jmr3904.h: Undid 1998-10-16 change. + +1998-10-16 Jesper Skov + + * include/pkgconf/hal_tx39_jmr3904.h: Changed + CYGPKG_HAL_TX39_JMR3904 to CYG_HAL_TX39_JMR3904. + +1998-10-14 Nick Garnett + + * include/hal_stub.h: + Now get generic-stub.h from hal rather than kernel. + + * src/hal_diag.c: + * src/hal_stub.c: + Altered ifdefs to support building without kernel. + +1998-10-13 Nick Garnett + + * src/jmr3904.ld: + Moved RAM load address to 0x80008000. + +Mon Oct 12 18:04:16 1998 Jonathan Larmour + + * include/hal_diag.h: + Add void arg to hal_diag_init() prototype + Fix for PR 17309 + +1998-09-24 Tim Goodwin + + * include/pkgconf/hal_tx39_jmr3904.h: + Correct file name in comment. + +1998-09-15 Nick Garnett + + * src/jmr3904.ld: + Moved RAM LOAD_BASE up to 0x80005000 to avoid memory used by + Cygmon. + + * src/hal_diag.c (hal_diag_write_char): + Added support for Ctrl-C handling while running under Cygmon. + Extra support from Cygmon may be needed in future. + +1998-09-11 Bart Veer + + * include/pkgconf/hal_tx39_jmr3904.h: + Updated configuration data with some descriptions. + +1998-09-04 Bart Veer + + * include/pkgconf/hal_tx39_jmr3904.h: + Temporary change to the type of the startup option, needed by the + configuration tool. + +1998-09-02 Bart Veer + + * include/pkgconf/hal_tx39_jmr3904.h: + New header file for platform-specific configuration options + + * tests/PKGconf.mak: + * src/PKGconf.mak: + Sort out package naming conventions. + +1998-08-28 Bart Veer + + * src/hal_diag.c, src/hal_stub.c: + Updated for new kernel configuration option symbol names + +Fri Aug 28 09:22:30 1998 Jesper Skov + + * src/hal_stub.c: Moved strcpy/strlen to the generic stub. + +1998-08-18 Nick Garnett + + * include/hal_diag.h: + * include/hal_stub.h: + * src/hal_diag.c: + * src/jmr3904.S: + Now includes rather than . + + * src/jmr3904.ld: + Removed memory layout tool support. + Now includes rather than . + +Tue Aug 18 11:44:40 1998 Jonathan Larmour + + * src/jmr3904.ld: Reorder group line + +Mon Aug 17 22:23:27 1998 Jonathan Larmour + + * src/jmr3904.ld: + Add GROUP(libgcc.a libtarget.a) to prevent need for explicit linking + +1998-07-23 Nick Garnett + + * src/jmr3904.ld: Added header comment and tidied up the layout a + little. + + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/mips/jmr3904/current/include/hal_diag.h b/packages/hal/mips/jmr3904/current/include/hal_diag.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/include/hal_diag.h @@ -0,0 +1,69 @@ +#ifndef CYGONCE_HAL_HAL_DIAG_H +#define CYGONCE_HAL_HAL_DIAG_H + +/*============================================================================= +// +// hal_diag.h +// +// HAL Support for Kernel Diagnostic Routines +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL Support for Kernel Diagnostic Routines +// Description: Diagnostic routines for use during kernel development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include + +/*---------------------------------------------------------------------------*/ +/* functions implemented in hal_diag.c */ + +externC void hal_diag_init(void); + +externC void hal_diag_write_char(char c); + +externC void hal_diag_read_char(char *c); + +/*---------------------------------------------------------------------------*/ + +#define HAL_DIAG_INIT() hal_diag_init() + +#define HAL_DIAG_WRITE_CHAR(_c_) hal_diag_write_char(_c_) + +#define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_) + +/*---------------------------------------------------------------------------*/ +/* end of hal_diag.h */ +#endif /* CYGONCE_HAL_HAL_DIAG_H */ diff --git a/packages/hal/mips/jmr3904/current/include/hal_stub.h b/packages/hal/mips/jmr3904/current/include/hal_stub.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/include/hal_stub.h @@ -0,0 +1,54 @@ +#ifndef CYGONCE_HAL_HAL_STUB_H +#define CYGONCE_HAL_HAL_STUB_H + +//============================================================================= +// +// hal_stub.h +// +// General header for HAL GDB stub support. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-06-08 +// Purpose: HAL stub support. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include +#include + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_HAL_STUB_H +// End of hal_stub.h + + diff --git a/packages/hal/mips/jmr3904/current/include/pkgconf/hal_tx39_jmr3904.h b/packages/hal/mips/jmr3904/current/include/pkgconf/hal_tx39_jmr3904.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/include/pkgconf/hal_tx39_jmr3904.h @@ -0,0 +1,85 @@ +#ifndef CYGONCE_PKGCONF_HAL_TX39_JMR3904_H +#define CYGONCE_PKGCONF_HAL_TX39_JMR3904_H +// ==================================================================== +// +// pkgconf/hal_tx39_jmr3904.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_TX39_JMR3904 { + display "JMR3904 evaluation board" + type radio + parent CYGPKG_HAL_TX39 + platform jmr3904 + description " + The JMR3904 HAL package should be used when targetting the + actual hardware. The same package can also be used when + running on the full simulator, since this provides an + accurate simulation of the hardware including I/O devices. + To use the simulator in this mode the command + `target sim --board=jmr3904' should be used from inside gdb." + } + + cdl_option CYGHWR_HAL_TX39_JMR3904_STARTUP { + display "Startup type" + parent CYGPKG_HAL_TX39_JMR3904 + #type count + type enum + legal_values ram rom + startup + description " + When targetting the JMR3904 board it is possible to build + the system for either RAM bootstrap or ROM bootstrap. The + former generally requires that the board is equipped with + ROMs containing the Cygmon ROM monitor or equivalent + software that allows gdb to download the eCos application + on to the board. The latter typically requires that the + eCos application be blown into EPROMs or equivalent + technology." + } + + }}CFG_DATA */ +#define CYGHWR_HAL_TX39_JMR3904_STARTUP ram + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_TX39_JMR3904_H */ +/* EOF hal_tx39_jmr3904.h */ diff --git a/packages/hal/mips/jmr3904/current/src/PKGconf.mak b/packages/hal/mips/jmr3904/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/src/PKGconf.mak @@ -0,0 +1,55 @@ +#============================================================================== +# +# makefile +# +# hal/mips/jmr3904/src +# +#============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================== + +PACKAGE := hal_tx39_jmr3904 +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := hal_diag.c jmr3904.S hal_stub.c +OTHER_OBJS := +OTHER_TARGETS := ldscript.stamp +OTHER_CLEAN := ldscript.clean +OTHER_DEPS := ldscript.d + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + +.PHONY: ldscript.clean + +ldscript.stamp: jmr3904.ld + $(CC) -E -P -Wp,-MD,ldscript.tmp -xc $(INCLUDE_PATH) $(CFLAGS) -o $(PREFIX)/lib/target.ld $< + @echo -e "\n$@ : $< \\" > ldscript.d + @tail -n +2 ldscript.tmp >> ldscript.d + @rm ldscript.tmp + $(TOUCH) $@ + +ldscript.clean: + $(RM) -f $(PREFIX)/lib/target.ld + $(RM) -f ldscript.stamp + diff --git a/packages/hal/mips/jmr3904/current/src/hal_diag.c b/packages/hal/mips/jmr3904/current/src/hal_diag.c new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/src/hal_diag.c @@ -0,0 +1,511 @@ +/*============================================================================= +// +// hal_diag.c +// +// HAL diagnostic output code +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL diagnostic output +// Description: Implementations of HAL diagnostic output support. +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include // base types +#include // tracing macros +#include // assertion macros + +#include +#include + +#include + +#include + +/*---------------------------------------------------------------------------*/ + +//#define CYG_KERNEL_DIAG_LCD +#define CYG_KERNEL_DIAG_SERIAL0 + +#if defined(CYG_HAL_USE_ROM_MONITOR) + +#define CYG_KERNEL_DIAG_GDB + +#endif + +/*---------------------------------------------------------------------------*/ + +static cyg_uint8 leds = 0; + +void hal_diag_led(int x) +{ +// return; + leds ^= x; + + HAL_WRITE_UINT8( 0xfffff504, leds); + +#if 0 + { + int i; + + for( i = 0; i < 0x00020000; i++ ); + } +#endif +} + +/*---------------------------------------------------------------------------*/ + +#ifdef CYG_KERNEL_DIAG_SERIAL0 + +#define DIAG_BASE 0xfffff300 +#define DIAG_SLCR (DIAG_BASE+0x00) +#define DIAG_SLSR (DIAG_BASE+0x04) +#define DIAG_SLDICR (DIAG_BASE+0x08) +#define DIAG_SLDISR (DIAG_BASE+0x0C) +#define DIAG_SFCR (DIAG_BASE+0x10) +#define DIAG_SBRG (DIAG_BASE+0x14) +#define DIAG_TFIFO (DIAG_BASE+0x20) +#define DIAG_RFIFO (DIAG_BASE+0x30) + +#define BRG_T0 0x0000 +#define BRG_T2 0x0100 +#define BRG_T4 0x0200 +#define BRG_T5 0x0300 + + +void hal_diag_init() +{ +#if defined(CYG_HAL_USE_ROM_MONITOR) +// If we are using the ROM monitor, it has already +// initialized the serial line. +#else +//hal_diag_led(0x10); + HAL_WRITE_UINT16( DIAG_SLCR , 0x0020 ); + + HAL_WRITE_UINT16( DIAG_SLDICR , 0x0000 ); + + HAL_WRITE_UINT16( DIAG_SFCR , 0x0000 ); + +// HAL_WRITE_UINT16( DIAG_SBRG , BRG_T2 | 20 ); + HAL_WRITE_UINT16( DIAG_SBRG , BRG_T2 | 10 ); +// HAL_WRITE_UINT16( DIAG_SBRG , BRG_T2 | 5 ); +//hal_diag_led(0x10); +#endif +} + +void hal_diag_write_char_serial0( char c) +{ + CYG_WORD16 disr; + +//hal_diag_led(0x20); + + for(;;) + { + HAL_READ_UINT16( DIAG_SLDISR , disr ); + + if( disr & 0x0002 ) break; + } + + disr = disr & ~0x0002; + + HAL_WRITE_UINT8( DIAG_TFIFO, c ); + + HAL_WRITE_UINT16( DIAG_SLDISR , disr ); + +//hal_diag_led(0x20); +} + +void hal_diag_drain_serial0(void) +{ + CYG_WORD16 disr; + + for(;;) + { + HAL_READ_UINT16( DIAG_SLDISR , disr ); + + if( disr & 0x0002 ) break; + } + + disr = disr & ~0x0002; + + HAL_WRITE_UINT16( DIAG_SLDISR , disr ); +} + +void hal_diag_read_char_serial0(char *c) +{ + CYG_WORD16 disr; + +//hal_diag_led(0x40); + for(;;) + { + + HAL_READ_UINT16( DIAG_SLDISR , disr ); + + if( disr & 0x0001 ) break; + } + + disr = disr & ~0x0001; + + HAL_READ_UINT8( DIAG_RFIFO, *c ); + + HAL_WRITE_UINT16( DIAG_SLDISR , disr ); + +//hal_diag_led(0x40); +} + + +void hal_diag_write_char(char c) +{ +#ifdef CYG_KERNEL_DIAG_GDB +#if 0 //defined(CYG_HAL_USE_ROM_MONITOR) + + typedef void rom_write_fn(char c); + rom_write_fn *fn = ((rom_write_fn **)0x80000100)[63]; + + fn(c); + +#else + static char line[100]; + static int pos = 0; +// register volatile cyg_uint16 *volatile tty_status = SERIAL1_SR; + + // No need to send CRs + if( c == '\r' ) return; + + line[pos++] = c; + + if( c == '\n' || pos == sizeof(line) ) + { + CYG_INTERRUPT_STATE old; +// CYG_ADDRWORD old; + + // Disable interrupts. This prevents GDB trying to interrupt us + // while we are in the middle of sending a packet. The serial + // receive interrupt will be seen when we re-enable interrupts + // later. + + HAL_DISABLE_INTERRUPTS(old); + + while(1) + { + static char hex[] = "0123456789ABCDEF"; + cyg_uint8 csum = 0; + int i; + char c1; + + hal_diag_write_char_serial0('$'); + hal_diag_write_char_serial0('O'); + csum += 'O'; + for( i = 0; i < pos; i++ ) + { + char ch = line[i]; + char h = hex[(ch>>4)&0xF]; + char l = hex[ch&0xF]; + hal_diag_write_char_serial0(h); + hal_diag_write_char_serial0(l); + csum += h; + csum += l; + } + hal_diag_write_char_serial0('#'); + hal_diag_write_char_serial0(hex[(csum>>4)&0xF]); + hal_diag_write_char_serial0(hex[csum&0xF]); + +#if 1 + hal_diag_read_char_serial0( &c1 ); + + // We must ack the interrupt caused by that read to avoid + // confusing the GDB stub ROM. +// HAL_INTERRUPT_ACKNOWLEDGE( CYG_VECTOR_EXTERNAL_2 ); + + if( c1 == '+' ) break; + +#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) + if( c1 == 3 ) + { + // Ctrl-C: breakpoint. + extern void breakpoint(); + breakpoint(); + break; + } +#elif defined(CYG_HAL_USE_ROM_MONITOR) && defined(CYG_HAL_USE_ROM_MONITOR_GDB_STUBS) + if( c1 == 3 ) + { + // Ctrl-C: breakpoint. +// HAL_BREAKPOINT(_breakinst); + typedef void bpt_fn(); + bpt_fn *bfn = ((bpt_fn **)0x80000100)[61]; + + bfn(); + + break; + } +#elif defined(CYG_HAL_USE_ROM_MONITOR) && defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + if( c1 == 3 ) + { + // Ctrl-C: breakpoint. + HAL_BREAKPOINT(_breakinst); + + break; + } +#endif + +#else + break; +#endif + } + + pos = 0; + + // Wait for all data from serial line to drain + // and clear ready-to-send indication. + hal_diag_drain_serial0(); + + // And re-enable interrupts + HAL_RESTORE_INTERRUPTS(old); + + } +#endif +#else + hal_diag_write_char_serial0(c); +#endif +} + +void hal_diag_read_char(char *c) +{ + for(;;) + { +#if defined(CYG_KERNEL_DIAG_GDB) && defined(CYG_HAL_USE_ROM_MONITOR) + + typedef void rom_read_fn(char *c); + rom_read_fn *fn = ((rom_read_fn **)0x80000100)[62]; + + fn(c); + +#else + hal_diag_read_char_serial0(c); + +#endif + +#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) + if( *c == 3 ) + { + // Ctrl-C: breakpoint. + extern void breakpoint(void); + breakpoint(); + continue; + } +#elif defined(CYG_HAL_USE_ROM_MONITOR) + if( *c == 3 ) + { + // Ctrl-C: breakpoint. + +// HAL_BREAKPOINT(_breakinst); + typedef void bpt_fn(void); + bpt_fn *bfn = ((bpt_fn **)0x80000100)[61]; + + bfn(); + continue; + } +#endif + + break; + } +} + +#endif + +/*---------------------------------------------------------------------------*/ + +#ifdef CYG_KERNEL_DIAG_LCD + +/* ----------------------------------------------------------- */ +#define ISA_BASE 0xA0000000 +#define LCD_DATA *(volatile unsigned char*)(0x13400000+ISA_BASE) +#define LCD_CMD *(volatile unsigned char*)(0x13000000+ISA_BASE) + +#define DISPCLR 0x01 /* Display Clear */ +#define ECURINC 0x06 /* Cursor Increment */ +#define DISPCONT 0x08 /* Display Control */ +#define BLINK 0x01 /* Blink */ +#define CURON 0x02 /* Cursor ON */ +#define DISPON 0x04 /* Display ON */ +#define INITCMD 0x38 /* Initial Command */ +#define DDRAM 0x80 /* DDRAM address */ +#define LCDBUSY 0x80 /* Busy */ + +/* ----------------------------------------------------------- */ + +/* */ +/* JMZ-LCD202 LCD Display Unit */ +/* - Sample Program (for JMR-TX3904) - */ +/* */ + +static void readyLCD(){ + while(LCD_CMD & LCDBUSY); +} + +static void outLCD(unsigned char d){ + readyLCD(); + LCD_DATA = d; +} + +static void outLCD_CMD(unsigned char d){ + readyLCD(); + LCD_CMD = d; +} + +static void INIT_LCD(){ + outLCD_CMD(INITCMD); + outLCD_CMD(DISPCONT); + outLCD_CMD(DISPCLR); + outLCD_CMD(ECURINC); + outLCD_CMD(DISPCONT|BLINK|CURON|DISPON); +} + +#if 0 +static void MAIN(){ + int i; + static char c[]="JMZ-LCD202 LCD UNIT"; + static char d[]="Display Test Sample"; + + INIT_LCD(); + outLCD_CMD(DDRAM); + for (i=0;i<20;i++) outLCD(c[i]); + outLCD_CMD(DDRAM+0x40); + for (i=0;i<20;i++) outLCD(d[i]); +} +#endif + +#define LCD_LINE0 0x00 +#define LCD_LINE1 0x40 + +#define LCD_LINE_LENGTH 20 + +static char lcd_line0[LCD_LINE_LENGTH+1]; +static char lcd_line1[LCD_LINE_LENGTH+1]; +static char *lcd_line[2] = { lcd_line0, lcd_line1 }; +static int lcd_curline = 0; +static int lcd_linepos = 0; + +static void lcd_dis(int add, char *string); + +void hal_diag_init() +{ + int i; +//hal_diag_led(0x10); + + INIT_LCD(); + + lcd_curline = 0; + lcd_linepos = 0; + + for( i = 0; i < LCD_LINE_LENGTH; i++ ) + lcd_line[0][i] = lcd_line[1][i] = ' '; + + lcd_line[0][LCD_LINE_LENGTH] = lcd_line[1][LCD_LINE_LENGTH] = 0; + + lcd_dis( LCD_LINE0, lcd_line[0] ); + lcd_dis( LCD_LINE1, lcd_line[1] ); + +#if 0 + { + int i; + static char c[]="JMZ-LCD202 LCD UNIT"; + static char d[]="Display Test Sample"; + + outLCD_CMD(DDRAM); + for (i=0;i<20;i++) outLCD(c[i]); + outLCD_CMD(DDRAM+0x40); + for (i=0;i<20;i++) outLCD(d[i]); + } +#endif + +//hal_diag_led(0x10); +} + +/* this routine writes the string to the LCD */ +/* display after setting the address to add */ +static void lcd_dis(int add, char *string) +{ + int i; + + outLCD_CMD(DDRAM+add); + + for (i=0 ; i= LCD_LINE_LENGTH ) return; + + // ignore CR + if( c == '\r' ) return; + + if( c == '\n' ) + { + lcd_dis( LCD_LINE0, &lcd_line[lcd_curline^1][0] ); + lcd_dis( LCD_LINE1, &lcd_line[lcd_curline][0] ); + + // Do a line feed + lcd_curline ^= 1; + lcd_linepos = 0; + + for( i = 0; i < LCD_LINE_LENGTH; i++ ) + lcd_line[lcd_curline][i] = ' '; + + return; + } + + lcd_line[lcd_curline][lcd_linepos++] = c; + +//hal_diag_led(0x20); +} + +void hal_diag_read_char(char *c) +{ +//hal_diag_led(0x40); + +//hal_diag_led(0x40); +} + + +#endif + + +/*---------------------------------------------------------------------------*/ +/* End of hal_diag.c */ diff --git a/packages/hal/mips/jmr3904/current/src/hal_stub.c b/packages/hal/mips/jmr3904/current/src/hal_stub.c new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/src/hal_stub.c @@ -0,0 +1,258 @@ +/* hal-stub.c - helper functions for stub, specific to ECC HAL + * + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +//#include +//#include "board.h" + +#include + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + +#include +#include +#include +#include + +/*---------------------------------------------------------------------------*/ + +#define DIAG_BASE 0xfffff300 +#define DIAG_SLCR (DIAG_BASE+0x00) +#define DIAG_SLSR (DIAG_BASE+0x04) +#define DIAG_SLDICR (DIAG_BASE+0x08) +#define DIAG_SLDISR (DIAG_BASE+0x0C) +#define DIAG_SFCR (DIAG_BASE+0x10) +#define DIAG_SBRG (DIAG_BASE+0x14) +#define DIAG_TFIFO (DIAG_BASE+0x20) +#define DIAG_RFIFO (DIAG_BASE+0x30) + +#define BRG_T0 0x0000 +#define BRG_T2 0x0100 +#define BRG_T4 0x0200 +#define BRG_T5 0x0300 + +/*---------------------------------------------------------------------------*/ + +/* External data */ + +extern int output_debug; /* dvemon.c */ +extern int (*read_vector) (int, char *, int); /* read.c */ +extern int (*write_vector) (int, char *, int); /* write.c */ + +/* External functions */ + +//int outbyte (unsigned char byte); /* dvemon.c */ +//unsigned char inbyte (); /* dvemon.c */ +//void general_exception (void); /* tx39-exc.S */ + + +/* Local data */ + + +/* If ENABLED is non-zero, supply a memory fault handler that traps + subsequent memory errors and sets _mem_err to 1. Otherwise, memory + faults are processed as exceptions. */ + +void __set_mem_fault_trap (int enable) {} + +static int serial_initialized = 0; + +static void serial_init() +{ +//hal_diag_led(0x10); + HAL_WRITE_UINT16( DIAG_SLCR , 0x0020 ); + + HAL_WRITE_UINT16( DIAG_SLDICR , 0x0000 ); + + HAL_WRITE_UINT16( DIAG_SFCR , 0x0000 ); + +// HAL_WRITE_UINT16( DIAG_SBRG , BRG_T2 | 20 ); +// HAL_WRITE_UINT16( DIAG_SBRG , BRG_T2 | 10 ); + HAL_WRITE_UINT16( DIAG_SBRG , BRG_T2 | 5 ); + + serial_initialized = 1; + +//hal_diag_led(0x10); +} + +/* Write C to the current serial port. */ + +void putDebugChar (int c) +{ +#ifdef CYG_HAL_MIPS_SIM + +#else + CYG_WORD16 disr; + +//hal_diag_led(0x20); + + if( !serial_initialized ) serial_init(); + + for(;;) + { + HAL_READ_UINT16( DIAG_SLDISR , disr ); + + if( disr & 0x0002 ) break; + } + + disr = disr & ~0x0002; + + HAL_WRITE_UINT8( DIAG_TFIFO, c ); + + HAL_WRITE_UINT16( DIAG_SLDISR , disr ); + +//hal_diag_led(0x20); +// HAL_DIAG_WRITE_CHAR( c ); +#endif +} + +/* Read one character from the current serial port. */ + +int getDebugChar (void) +{ +#ifdef CYG_HAL_MIPS_SIM + static char input[] = "+$s#73"; + static int i = 0; + return input[i++]; +#else + char c; + + CYG_WORD16 disr; + + if( !serial_initialized ) serial_init(); + +//hal_diag_led(0x40); + for(;;) + { + + HAL_READ_UINT16( DIAG_SLDISR , disr ); + + if( disr & 0x0001 ) break; + } + + disr = disr & ~0x0001; + + HAL_READ_UINT8( DIAG_RFIFO, c ); + + HAL_WRITE_UINT16( DIAG_SLDISR , disr ); + +//hal_diag_led(0x40); + +// HAL_DIAG_READ_CHAR(c); +// diag_printf("<%02x:%c>",c); + + return c; + +#endif +} + + +/* Install the standard set of trap handlers for the stub. */ + +void __install_traps (void) +{ + // Nothing to do, the HAL will call handle_exception when one occurs. +} + +/* Flush the instruction cache. */ +void flush_i_cache (void) { HAL_ICACHE_INVALIDATE_ALL(); } + + +/* Reset the board. */ +void __reset (void) {} + + +/* Set the baud rate for the current serial port. */ +void __set_baud_rate (int baud) {} + + +/* Initialize the hardware. */ +void initHardware (void) {} + +#if 0 +/* Alternate read function for use when stub is running. It + reads the data for standard input from the remote GDB. */ + +int dve_read (int fd, char *buf, int nbytes) +{ + __get_gdb_input (buf, nbytes, 1); +} + +/* Alternate write function for use when stub is running. It + writes the data for standard output to the remote GDB. */ + +int dve_write (int fd, char *buf, int nbytes) +{ + __output_gdb_string (buf, nbytes); +} + +#endif + +/* Install traps and otherwise initialize stub. */ + +void set_debug_traps (void) +{ +// output_debug = 0; /* disable control-O prefixing on output */ + initialize_stub (); /* will call __install_traps and initHardware */ +// read_vector = dve_read; /* alternate read() function for stub */ +// write_vector = dve_write; /* alternate write() function for stub */ +} + + +/* This function will generate a breakpoint exception. It is used at the + beginning of a program to sync up with a debugger and can be used + otherwise as a quick means to stop program execution and "break" into + the debugger. */ + +void +breakpoint() +{ +#ifdef CYG_HAL_MIPS_SIM + + // This code causes a fake breakpoint. + asm volatile ( + "lui $24,0x0000;" + "ori $24,0x0024;" + "mtc0 $24,$13;" + "lui $25,%%hi(1f);" + "ori $25,$25,%%lo(1f);" + "j other_vector;" + "nop;" + ".global _breakinst;" + "_breakinst:" + "1: nop;" + : + : + : "t8", "t9" + ); + +#else + + HAL_BREAKPOINT(_breakinst); + +#endif + +} + + +/* This function returns the opcode for a 'break 5' instruction. */ + +unsigned long __break_opcode () +{ + return HAL_BREAKINST; +} + +#endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS diff --git a/packages/hal/mips/jmr3904/current/src/jmr3904.S b/packages/hal/mips/jmr3904/current/src/jmr3904.S new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/src/jmr3904.S @@ -0,0 +1,55 @@ +##============================================================================= +## +## sim.S +## +## Simulator hardware setup +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1998-02-05 +## Purpose: Simulator hardware setup +## Description: This file contains any code needed to initialize the +## hardware on the MIPS simulator. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +##include + +#------------------------------------------------------------------------------ + + .globl hal_hardware_init +hal_hardware_init: + + jr $31 + +#------------------------------------------------------------------------------ +# end of sim.S \ No newline at end of file diff --git a/packages/hal/mips/jmr3904/current/src/jmr3904.ld b/packages/hal/mips/jmr3904/current/src/jmr3904.ld new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/src/jmr3904.ld @@ -0,0 +1,230 @@ +/*========================================================================== +// +// jmr3904.ld +// +// Linker script for JMR3904 board +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: JMR3904 Linker script +// Description: This script is passed to the linker to define the memory +// of the JMR-TX3904 board. +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + +STARTUP(vectors.o) +ENTRY(reset_vector) + +GROUP(libtarget.a libgcc.a) + +#include + +#if defined(CYG_HAL_STARTUP_RAM) +# if defined(CYG_HAL_USE_ROM_MONITOR) +# define LOAD_BASE 0x80008000 +# define DATA_BASE +# else +# define LOAD_BASE 0x80000000 +# define DATA_BASE +# endif +# define AT(x) +#elif defined(CYG_HAL_STARTUP_ROM) +# define LOAD_BASE 0xBFC00000 +# define DATA_BASE 0x80000200 +#endif + +SECTIONS +{ + /*------------------------------------------------------------*/ + + /* Start of ROM */ + . = LOAD_BASE; + + .rom_vectors : + { +#if defined(CYG_HAL_STARTUP_RAM) +#if !defined(CYG_HAL_USE_ROM_MONITOR) + KEEP(*(.utlb_vector)) + . = ALIGN(0x80); + KEEP(*(.other_vector)) + . = ALIGN(0x100); + KEEP(*(.vsr_table)) /* VSR table at 0x80000100 */ + /* debug and reset vector not used in RAM version */ + KEEP(*(.debug_vector)) + KEEP(*(.reset_vector)) +#endif +#elif defined(CYG_HAL_STARTUP_ROM) + KEEP(*(.reset_vector)) + . = ALIGN(0x100); + KEEP(*(.utlb_vector)) + . = ALIGN(0x80); + KEEP(*(.other_vector)) + . = ALIGN(0x100); + KEEP(*(.debug_vector)) +#endif + } + + /*------------------------------------------------------------*/ + + .text : + { + _stext = .; +#ifndef CYG_KERNEL_USE_INIT_PRIORITY + __sched_text_start = .; + *sched.o(.text*) + __sched_text_end = .; + __clock_text_start = .; + *clock.o(.text*) + __clock_text_end = .; + __thread_text_start = .; + *thread.o(.text*) + __thread_text_end = .; +#endif + *(.text*) + *(.gnu.warning) + *(.gnu.linkonce*) + *(.init) + + } + _etext = .; + PROVIDE (etext = .); + .fini : { *(.fini) } + .rodata : { *(.rodata*) } + .rodata1 : { *(.rodata1) } + .fixup : { *(.fixup) } + .gcc_except_table : { *(.gcc_except_table) } + + /*------------------------------------------------------------*/ + +/* __rom_data_start = __rom_ram_vectors_start + SIZEOF( .ram_vectors ); */ + __rom_data_start = ALIGN(8); + .data DATA_BASE : + AT( __rom_data_start ) + { + __ram_data_start = .; + *(.data*) + *(.data1) + _GOT1_START_ = .; + *(.got1) + _GOT1_END_ = .; + /* Put .ctors and .dtors next to the .got2 section, so that the pointers + get relocated with -mrelocatable. */ + _GOT2_START_ = .; + *(.got2) + _GOT2_END_ = .; + . = ALIGN(8); +#ifdef CYG_KERNEL_USE_INIT_PRIORITY + SORT(CONSTRUCTORS) + *(.ctors*) + *(.dtors*) +#else + CONSTRUCTORS + *(.ctors*) + *(.dtors*) +#endif + . = ALIGN(8); + _GOT_START_ = .; + _gp = .; + __global = _gp; + _GLOBAL_OFFSET_TABLE_ = .; + _SDA_BASE_ = .; + *(.got.plt) + *(.got) + _GOT_END_ = .; + *(.dynamic) + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + *(.sdata*) + *(.sbss*) + *(.eh_frame) + } + __ram_data_end = .; + PROVIDE( __ram_data_end = .); + _edata = .; + PROVIDE (edata = .); + + /*------------------------------------------------------------*/ + + . = ALIGN(4); + __bss_start = .; + .bss : + { + *(.scommon) + *(.dynbss) + *(.bss) + *(COMMON) + } + . = ALIGN(4); + _end = . ; + PROVIDE (end = .); + + /*------------------------------------------------------------*/ + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to + the beginning of the section so we begin them at 0. */ + + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + +} + +#if !(defined(CYG_HAL_STARTUP_RAM) && !defined(CYG_HAL_USE_ROM_MONITOR)) + +hal_vsr_table = 0x80000100; + +#endif + +// End of jmr3904.ld diff --git a/packages/hal/mips/jmr3904/current/tests/PKGconf.mak b/packages/hal/mips/jmr3904/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mips/jmr3904/current/tests/PKGconf.mak @@ -0,0 +1,37 @@ +#=============================================================================== +# +# makefile +# +# hal/mips/jmr3904/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal_tx39_jmr3904 +include ../../../../../pkgconf/pkgconf.mak + +TESTS := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + diff --git a/packages/hal/mips/sim/current/ChangeLog b/packages/hal/mips/sim/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/mips/sim/current/ChangeLog @@ -0,0 +1,88 @@ +1998-10-23 Jesper Skov + + * include/pkgconf/hal_tx39_sim.h: Allow wallclock and watchdog + devices to be configured. + +1998-10-23 Jesper Skov + + * include/hal_stub.h: Include generic-stub.h from hal. + +Fri Oct 23 03:35:20 1998 Jonathan Larmour + + * src/sim.ld: + Move _gp pointer to after data section and constructors/destructors + +1998-10-22 Jesper Skov + + * include/pkgconf/hal_tx39_sim.h: Preclude GDB device. + +1998-10-19 Jesper Skov + + * include/pkgconf/hal_tx39_sim.h: Undid 1998-10-16 change. + +1998-10-16 Jesper Skov + + * include/pkgconf/hal_tx39_sim.h: Changed CYGPKG_HAL_TX39_SIM to + CYG_HAL_TX39_SIM. + +1998-09-11 Bart Veer + + * include/pkgconf/hal_tx39_sim.h: + Updated configuration data with a description and some + requires. + +1998-09-02 Bart Veer + + * include/pkgconf/hal_tx39_sim.h: + New header file for platform-specific configuration options + + * tests/PKGconf.mak: + * src/PKGconf.mak: + Sort out package naming conventions. + +1998-08-18 Nick Garnett + + * include/hal_diag.h: + * include/hal_stub.h: + * src/sim.S: + * src/sim.ld: + Now uses hal.h rather than kernel.h. + +Tue Aug 18 11:43:47 1998 Jonathan Larmour + + * src/sim.ld: reorder GROUP line + +Mon Aug 17 22:24:54 1998 Jonathan Larmour + + * src/sim.ld: + Add GROUP(libgcc.a libtarget.a) to prevent need for explicit linking + +1998-07-23 Nick Garnett + + * src/hal_diag.c: Added header comments to keep pkgrelease happy. + + * src/sim.ld: Added header comment and tidied up a bit. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/mips/sim/current/include/hal_diag.h b/packages/hal/mips/sim/current/include/hal_diag.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/sim/current/include/hal_diag.h @@ -0,0 +1,114 @@ +#ifndef CYGONCE_HAL_HAL_DIAG_H +#define CYGONCE_HAL_HAL_DIAG_H + +/*============================================================================= +// +// hal_diag.h +// +// HAL Support for Kernel Diagnostic Routines +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL Support for Kernel Diagnostic Routines +// Description: Diagnostic routines for use during kernel development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include + +/*---------------------------------------------------------------------------*/ + +#define CYG_DIAG_USE_PAL + +/*---------------------------------------------------------------------------*/ + +#ifdef CYG_DIAG_USE_PAL + +/*---------------------------------------------------------------------------*/ +/* Register addresses */ + +#define PAL_RESET 0x00 +#define PAL_CPU_NR 0x04 +#define PAL_INT 0x08 +#define PAL_NR_CPU 0x0a + +#define PAL_READ_FIFO 0x10 +#define PAL_READ_STATUS 0x14 +#define PAL_WRITE_FIFO 0x18 +#define PAL_WRITE_STATUS 0x1a + +#define OEA_DEV 0xFFFF0000 + +/*---------------------------------------------------------------------------*/ + +#define HAL_DIAG_INIT() + +#define HAL_DIAG_WRITE_CHAR(_c_) \ +{ \ + volatile unsigned char *tty_buffer = \ + (unsigned char*)(OEA_DEV + PAL_WRITE_FIFO); \ + volatile unsigned char *tty_status = \ + (unsigned char*)(OEA_DEV + PAL_WRITE_STATUS); \ + if( _c_ != '\r' ) \ + { \ + while( *tty_status == 0 ) continue; \ + *tty_buffer = _c_; \ + } \ +} + +#define HAL_DIAG_READ_CHAR(_c_) \ +{ \ + volatile unsigned char *tty_buffer = \ + (unsigned char*)(OEA_DEV + PAL_READ_FIFO); \ + volatile unsigned char *tty_status = \ + (unsigned char*)(OEA_DEV + PAL_READ_STATUS); \ + while( *tty_status == 0 ) continue; \ + _c_ = *tty_buffer; \ +} + +#else +/*---------------------------------------------------------------------------*/ +/* There is no diagnostic output on MIPS simulator */ + +#define HAL_DIAG_INIT() + +#define HAL_DIAG_WRITE_CHAR(_c_) + +#define HAL_DIAG_READ_CHAR(_c_) (_c_) = 0 + +#endif + +/*---------------------------------------------------------------------------*/ +/* end of hal_diag.h */ +#endif /* CYGONCE_HAL_HAL_DIAG_H */ diff --git a/packages/hal/mips/sim/current/include/hal_stub.h b/packages/hal/mips/sim/current/include/hal_stub.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/sim/current/include/hal_stub.h @@ -0,0 +1,54 @@ +#ifndef CYGONCE_HAL_HAL_STUB_H +#define CYGONCE_HAL_HAL_STUB_H + +//============================================================================= +// +// hal_atub.h +// +// General header for HAL GDB stub support. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-06-08 +// Purpose: HAL stub support. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include +#include + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_HAL_STUB_H +// End of hal_stub.h + + diff --git a/packages/hal/mips/sim/current/include/pkgconf/hal_tx39_sim.h b/packages/hal/mips/sim/current/include/pkgconf/hal_tx39_sim.h new file mode 100644 --- /dev/null +++ b/packages/hal/mips/sim/current/include/pkgconf/hal_tx39_sim.h @@ -0,0 +1,70 @@ +#ifndef CYGONCE_PKGCONF_HAL_TX39_SIM_H +#define CYGONCE_PKGCONF_HAL_TX39_SIM_H +// ==================================================================== +// +// pkgconf/hal_tx39_sim.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_TX39_SIM { + display "Minimal simulator" + type radio + parent CYGPKG_HAL_TX39 + platform sim + requires !CYGPKG_DEVICES_GDB + requires !CYGPKG_DEVICES_SERIAL_RS232_COMMON + requires !CYGPKG_DEVICES_SERIAL_RS232_TX39 + description " + The minimal simulator HAL package is provided for when only + a simple simulation of the processor architecture is + desired, as opposed to detailed simulation of any specific + board. To use this minimal simulator the command + `target sim --board=jmr3904pal' should be used from inside + gdb. It is not possible to use any of the eCos device + drivers when the simulator is running in this mode" + } + + }}CFG_DATA */ + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_TX39_SIM_H */ +/* EOF hal_tx39_sim.h */ diff --git a/packages/hal/mips/sim/current/src/PKGconf.mak b/packages/hal/mips/sim/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mips/sim/current/src/PKGconf.mak @@ -0,0 +1,56 @@ +#============================================================================== +# +# makefile +# +# hal/mips/sim/src +# +#============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================== + +PACKAGE := hal_tx39_sim +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := hal_diag.c sim.S +OTHER_OBJS := +OTHER_TARGETS := ldscript.stamp +OTHER_CLEAN := ldscript.clean +OTHER_DEPS := ldscript.d + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + +.PHONY: ldscript.clean + +ldscript.stamp: sim.ld + $(CC) -E -P -Wp,-MD,ldscript.tmp -xc $(INCLUDE_PATH) $(CFLAGS) -o $(PREFIX)/lib/target.ld $< + @echo -e "\n$@ : $< \\" > ldscript.d + @tail -n +2 ldscript.tmp >> ldscript.d + @rm ldscript.tmp + $(TOUCH) $@ + +ldscript.clean: + $(RM) -f $(PREFIX)/lib/target.ld + $(RM) -f ldscript.stamp + + diff --git a/packages/hal/mips/sim/current/src/hal_diag.c b/packages/hal/mips/sim/current/src/hal_diag.c new file mode 100644 --- /dev/null +++ b/packages/hal/mips/sim/current/src/hal_diag.c @@ -0,0 +1,45 @@ +/*============================================================================= +// +// hal_diag.c +// +// HAL diagnostic output code +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL diagnostic output +// Description: Implementations of HAL diagnostic output support. +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +/* NOTHING HERE !!! */ + +/*---------------------------------------------------------------------------*/ +/* End of hal_diag.c */ diff --git a/packages/hal/mips/sim/current/src/sim.S b/packages/hal/mips/sim/current/src/sim.S new file mode 100644 --- /dev/null +++ b/packages/hal/mips/sim/current/src/sim.S @@ -0,0 +1,55 @@ +##============================================================================= +## +## sim.S +## +## Simulator hardware setup +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1998-02-05 +## Purpose: Simulator hardware setup +## Description: This file contains any code needed to initialize the +## hardware on the MIPS simulator. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +##include + +#------------------------------------------------------------------------------ + + .globl hal_hardware_init +hal_hardware_init: + + jr $31 + +#------------------------------------------------------------------------------ +# end of sim.S \ No newline at end of file diff --git a/packages/hal/mips/sim/current/src/sim.ld b/packages/hal/mips/sim/current/src/sim.ld new file mode 100644 --- /dev/null +++ b/packages/hal/mips/sim/current/src/sim.ld @@ -0,0 +1,221 @@ +/*========================================================================== +// +// sim.ld +// +// Linker script for MIPS simulator +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: MIPS simulator Linker script +// Description: This script is passed to the linker to define the memory +// of the MIPS simulator. +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + +STARTUP(vectors.o) +ENTRY(reset_vector) + +GROUP(libtarget.a libgcc.a) + +#include + +#if defined(CYG_HAL_STARTUP_RAM) +#define LOAD_BASE 0x80000000 +#define DATA_BASE +#define AT(x) +#elif defined(CYG_HAL_STARTUP_ROM) +#define LOAD_BASE 0xBFC00000 +#define DATA_BASE 0x80000200 +#endif + +/* + * Allocate the stack to be at the top of memory, since the stack + * grows down + */ + +/*__interrupt_stack = DATA_BASE + 0x00100000; */ + +SECTIONS +{ + /*------------------------------------------------------------*/ + + /* Start of ROM */ + . = LOAD_BASE; + + .rom_vectors : + { +#if defined(CYG_HAL_STARTUP_RAM) + KEEP(*(.utlb_vector)) + . = ALIGN(0x80); + KEEP(*(.other_vector)) + /* debug and reset vector not used in RAM version */ + KEEP(*(.debug_vector)) + KEEP(*(.reset_vector)) +#elif defined(CYG_HAL_STARTUP_ROM) + KEEP(*(.reset_vector)) + . = ALIGN(0x100); + KEEP(*(.utlb_vector)) + . = ALIGN(0x80); + KEEP(*(.debug_vector)) + . = ALIGN(0x100); + KEEP(*(.other_vector)) +#endif + } + + /*------------------------------------------------------------*/ + + .text : + { + _stext = .; +#ifndef CYG_KERNEL_USE_INIT_PRIORITY + __sched_text_start = .; + *sched.o(.text*) + __sched_text_end = .; + __clock_text_start = .; + *clock.o(.text*) + __clock_text_end = .; + __thread_text_start = .; + *thread.o(.text*) + __thread_text_end = .; +#endif + *(.text*) + *(.gnu.warning) + *(.gnu.linkonce*) + *(.init) + + } + _etext = .; + PROVIDE (etext = .); + .fini : { *(.fini) } + .rodata : { *(.rodata*) } + .rodata1 : { *(.rodata1) } + .fixup : { *(.fixup) } + .gcc_except_table : { *(.gcc_except_table) } + + /*------------------------------------------------------------*/ + +/* __rom_data_start = __rom_ram_vectors_start + SIZEOF( .ram_vectors ); */ + __rom_data_start = ALIGN(8); + .data DATA_BASE : + { + __ram_data_start = .; + *(.data*) + *(.data1) + _GOT1_START_ = .; + *(.got1) + _GOT1_END_ = .; + /* Put .ctors and .dtors next to the .got2 section, so that the pointers + get relocated with -mrelocatable. */ + _GOT2_START_ = .; + *(.got2) +#ifdef CYG_KERNEL_USE_INIT_PRIORITY + SORT(CONSTRUCTORS) + *(.ctors*) + *(.dtors*) +#else + CONSTRUCTORS + *(.ctors*) + *(.dtors*) +#endif + _GOT2_END_ = .; + . = ALIGN(8); + _gp = .; + __global = _gp; + _GLOBAL_OFFSET_TABLE_ = .; + _GOT_START_ = .; + _SDA_BASE_ = .; + *(.got.plt) + *(.got) + _GOT_END_ = .; + *(.dynamic) + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + *(.sdata*) + *(.sbss*) + } + __ram_data_end = .; + PROVIDE( __ram_data_end = .); + _edata = .; + PROVIDE (edata = .); + + /*------------------------------------------------------------*/ + + . = ALIGN(4); + __bss_start = .; + .bss : + { + *(.scommon) + *(.dynbss) + *(.bss) + *(COMMON) + } + . = ALIGN(4); + _end = . ; + PROVIDE (end = .); + + /*------------------------------------------------------------*/ + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to + the beginning of the section so we begin them at 0. */ + + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + +} + +//hal_vsr_table = 0x80000100; + +// End of sim.ld diff --git a/packages/hal/mips/sim/current/tests/PKGconf.mak b/packages/hal/mips/sim/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mips/sim/current/tests/PKGconf.mak @@ -0,0 +1,37 @@ +#=============================================================================== +# +# makefile +# +# hal/mips/sim/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal_tx39_sim +include ../../../../../pkgconf/pkgconf.mak + +TESTS := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + diff --git a/packages/hal/mn10300/arch/current/ChangeLog b/packages/hal/mn10300/arch/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/ChangeLog @@ -0,0 +1,225 @@ +1998-10-21 Nick Garnett + + * include/hal_intr.h (HAL_CLOCK_READ): + Fixed this macro to return correct value. + +1998-10-16 Bart Veer + + * src/vectors.S (__interrupt_stack): + Made the interrupt stack size configurable. + +1998-10-16 Nick Garnett + + * src/hal_misc.c: + Enabled caches by default. + +1998-10-13 Nick Garnett + + * src/hal_misc.c: + Altered ifdefs to allow builds without kernel. + +Thu Sep 24 18:14:19 1998 Jesper Skov + + * include/hal_intr.h: Read the interrupt control registers back + after writing to them to ensure that the value is not sitting in + the store buffer. + Also put _ around variable names in HAL_INTERRUPT_CONFIGURE for + consistency. + +1998-09-24 Nick Garnett + + * include/hal_intr.h: + Inverted mask for level in HAL_INTERRUPT_SET_LEVEL(). + + * src/vectors.S: + Added correct implementations of decode_interrupt macro for + chained interrupt processing. + Modified call to cyg_instrument() to pass table offset as well as + vector number. + Include to allow call to cyg_instrument() to be + enabled. + +1998-09-14 Bart Veer + + * src/PKGconf.mak: + Made vectors.o dependent on the various files that can contain + makefile variables or rules. This is needed after changes to + pkgconf.tcl for PRs 17195 and 17286. + +Mon Sep 14 11:08:40 1998 Jesper Skov + PR 17230 + + * include/hal_intr.h: + * src/vectors.S: + Replaced CYGIMP_KERNEL_INTERRUPTS_CHAIN with new + CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN. + +1998-09-12 Bart Veer + + * include/pkgconf/hal_mn10300.h: + Added missing descriptions (PR 17184) + + * src/hal_misc.c (exception_handler): + Sort out exception handling options (PR 16953) + +Thu Sep 10 20:24:02 1998 Hugo Tyson + + * src/vectors.S (__default_interrupt_vsr): + Fix a bug. Wrong offset when restoring the PSW tends to screw + things up rather. + +Thu Sep 10 15:12:21 1998 Jesper Skov + PR 17153 + + * src/vectors.S (__default_interrupt_vsr): Pass correct vector + value to isr. + +1998-09-09 Nick Garnett + + * include/hal_arch.h: + Removed distinction between interrupt and thread switch contexts + in HAL_SavedRegisters. Modified appropriate macros to reflect this. + + * src/hal_misc.c (cyg_hal_invoke_constructors): + Added call to patch_dbg_syscalls() for Cygmon hosted builds. + + * src/context.S (_hal_thread_switch_context): + Adjust thread context so that it has the same structure as the + state saved by interrupt and exception handlers. This makes + supporting thread-aware debugging easier. + + * src/vectors.S: + Moved nmi and trap vectors to correct slots in vsr table. + Now place arg3 of interrupt_end() in correct stack slot. + +1998-09-04 Bart Veer + + * src/vectors.S (__default_interrupt_vsr): + Fixed type in configuration option name. + +Thu Sep 3 15:15:57 1998 Tim Goodwin + + * hal/mn10300/arch/current/src/PKGconf.mak + * hal/mn10300/arch/current/src/makefile + * hal/mn10300/arch/current/tests/PKGconf.mak + + s/panx/mn10300/g + +1998-09-03 Nick Garnett + + * src/vectors.S: + Fixed offset bug in __trap. + Changed conditionals on runtime initialisation of VSR table to not + do it in simulated targets. + +1998-09-02 Bart Veer + + * include/pkgconf/hal_mn10300.h: + New header file for architecture-specific configuration options + + * tests/PKGconf.mak: + * src/PKGconf.mak: + Sort out package naming conventions. + +1998-09-02 Nick Garnett + + * src/vectors.S: + Moved NMI and TRAP VSRs down 1 word to match cygmon's use of the + vector table. This may need to change back in the future. + +1998-09-01 Nick Garnett + + * include/hal_intr.h: + Added CYG_VSR_COUNT, CYG_EXCEPTION_COUNT and CYG_ISR_COUNT. + Modified HAL_TRANSLATE_VECTOR() for mn103002 to provide slots + for the NMI vectors at start of hal_interrupt_* tables. + + * src/hal_misc.c (exception_handler): + Added support for decoding NMI vectors and for calling watchdog + ISR if present. + + * src/vectors.S: + Modified behaviour of __default_nmi_vsr to support watchdog timer + properly. + Fixed indirection bug in __nmi and __trap. + Modified offsets in hal_interrupt_* tables to provide slots for + NMI vectors at start in mn103002. + +1998-08-28 Bart Veer + + * src/vectors.S, src/context.S, src/hal_misc.c, include/hal_intr.h: + Updated for new kernel configuration option symbol names + +Fri Aug 28 10:09:03 1998 Jonathan Larmour + + * src/hal_misc.c: + rename __main() to cyg_hal_invoke_constructors() and remove + initialised test + + * src/vectors.S (_start): + Change call of __main() to cyg_hal_invoke_constructors(), and call + of main() to cyg_start() + +1998-08-25 Nick Garnett + + * src/vectors.S: + Now pass pointer to saved registers as third argument to + interrupt_end(). + + * include/hal_arch.h: + Added macros to support GDB. + +1998-08-21 Nick Garnett + + * include/hal_cache.h: + Now includes cyg_type.h rather than ktypes.h. + + * src/hal_misc.c: + Added calls to turn the caches on. But disabled them + since they interact poorly with Cygmon (Cygmon does not + flush the caches when setting/clearing breakpoints). + +Wed Aug 19 18:19:32 1998 Jonathan Larmour + + * src/hal_misc.c (__main): + Add void to function prototypes to silence warnings + +1998-08-18 Nick Garnett + + * include/hal_arch.h: + * include/hal_intr.h: + Now includes cyg_type.h rather than ktypes.h. + + * src/context.S: + * src/vectors.S: + * src/hal_misc.c: + Now uses hal.h rather than kernel.h. + +1998-08-17 Nick Garnett + + * src/vectors.S: + Reorgnized ifdefs to better support kernel porting. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/mn10300/arch/current/include/basetype.h b/packages/hal/mn10300/arch/current/include/basetype.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/include/basetype.h @@ -0,0 +1,58 @@ +#ifndef CYGONCE_HAL_BASETYPE_H +#define CYGONCE_HAL_BASETYPE_H + +//============================================================================= +// +// basetype.h +// +// Standard types for this architecture. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-08 +// Purpose: Define architecture base types. +// Usage: Included by "cyg_type.h", do not use directly +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +//----------------------------------------------------------------------------- +// Characterize the architecture + +#define CYG_BYTEORDER CYG_LSBFIRST // Big endian + +//----------------------------------------------------------------------------- +// Define the standard variable sizes + +// The MN10300 architecture uses the default definitions of the base types, +// so we do not need to define any here. + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_BASETYPE_H +// End of basetype.h diff --git a/packages/hal/mn10300/arch/current/include/hal_arch.h b/packages/hal/mn10300/arch/current/include/hal_arch.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/include/hal_arch.h @@ -0,0 +1,248 @@ +#ifndef CYGONCE_HAL_HAL_ARCH_H +#define CYGONCE_HAL_HAL_ARCH_H + +//============================================================================= +// +// hal_arch.h +// +// Architecture specific abstractions +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-08 +// Purpose: Define architecture abstractions +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +//----------------------------------------------------------------------------- +// Processor saved states: + +typedef struct HAL_SavedRegisters +{ + // These are common to all saved states and are in the order + // stored and loaded by the movm instruction. + cyg_uint32 vector; /* Vector number/dummy */ + cyg_uint32 lar; /* Loop address register */ + cyg_uint32 lir; /* Loop instruction register */ + cyg_uint32 mdr; /* Multiply/Divide register */ + cyg_uint32 a1; + cyg_uint32 a0; + cyg_uint32 d1; + cyg_uint32 d0; + cyg_uint32 a3; + cyg_uint32 a2; + cyg_uint32 d3; + cyg_uint32 d2; + + /* On interrupts the PC and PSW are pushed automatically by the */ + /* CPU and SP is pushed for debugging reasons. On a thread switch */ + /* the saved context is made to look the same. */ + + cyg_uint32 sp; /* Saved copy of SP in some states */ + cyg_uint32 psw; /* Status word */ + cyg_uint32 pc; /* Program Counter */ + +} HAL_SavedRegisters; + +//----------------------------------------------------------------------------- +// Exception handling function. +// This function is defined by the kernel according to this prototype. It is +// invoked from the HAL to deal with any CPU exceptions that the HAL does +// not want to deal with itself. It usually invokes the kernel's exception +// delivery mechanism. + +externC void deliver_exception( CYG_WORD code, CYG_ADDRWORD data ); + +//----------------------------------------------------------------------------- +// Bit manipulation routines + +externC cyg_uint32 hal_lsbit_index(cyg_uint32 mask); +externC cyg_uint32 hal_msbit_index(cyg_uint32 mask); + +#define HAL_LSBIT_INDEX(index, mask) index = hal_lsbit_index(mask); + +#define HAL_MSBIT_INDEX(index, mask) index = hal_msbit_index(mask); + +//----------------------------------------------------------------------------- +// Context Initialization +// Initialize the context of a thread. +// Arguments: +// _sp_ name of variable containing current sp, will be written with new sp +// _thread_ thread object address, passed as argument to entry point +// _entry_ entry point address. +// _id_ bit pattern used in initializing registers, for debugging. + + +#define HAL_THREAD_INIT_CONTEXT( _sp_, _thread_, _entry_, _id_ ) \ +{ \ + register HAL_SavedRegisters *_regs_; \ + _regs_ = (HAL_SavedRegisters *)((_sp_) - sizeof(HAL_SavedRegisters)*2); \ + _regs_->d0 = (CYG_WORD)(_thread_); \ + _regs_->d1 = (_id_)|0xddd1; \ + _regs_->d2 = (_id_)|0xddd2; \ + _regs_->d3 = (_id_)|0xddd3; \ + _regs_->a0 = (_id_)|0xaaa0; \ + _regs_->a1 = (_id_)|0xaaa1; \ + _regs_->a2 = (_id_)|0xaaa2; \ + _regs_->a3 = (_id_)|0xaaa3; \ + _regs_->mdr = 0; \ + _regs_->lir = 0; \ + _regs_->lar = 0; \ +/* _regs_->psw = 0x0F00; */ \ + _regs_->pc = (CYG_WORD)(_entry_); \ + _sp_ = (CYG_ADDRESS)_regs_; \ +} + +//----------------------------------------------------------------------------- +// Context switch macros. +// The arguments are pointers to locations where the stack pointer +// of the current thread is to be stored, and from where the sp of the +// next thread is to be fetched. + +externC void hal_thread_switch_context( CYG_ADDRESS to, CYG_ADDRESS from ); +externC void hal_thread_load_context( CYG_ADDRESS to ) + __attribute__ ((noreturn)); + +#define HAL_THREAD_SWITCH_CONTEXT(_fspptr_,_tspptr_) \ + hal_thread_switch_context((CYG_ADDRESS)_tspptr_,(CYG_ADDRESS)_fspptr_); + +#define HAL_THREAD_LOAD_CONTEXT(_tspptr_) \ + hal_thread_load_context( (CYG_ADDRESS)_tspptr_ ); + +//----------------------------------------------------------------------------- +// Execution reorder barrier. +// When optimizing the compiler can reorder code. In multithreaded systems +// where the order of actions is vital, this can sometimes cause problems. +// This macro may be inserted into places where reordering should not happen. + +#define HAL_REORDER_BARRIER() asm ( "" ) + +//----------------------------------------------------------------------------- +// Breakpoint support +// HAL_BREAKPOINT() is a code sequence that will cause a breakpoint to happen if +// executed. +// HAL_BREAKINST is the value of the breakpoint instruction and HAL_BREAKINST_SIZE +// is its size in bytes. + +#define HAL_BREAKPOINT(_label_) \ +asm volatile (" .globl " #_label_ ";" \ + #_label_":" \ + ".byte 0xFF" \ + ); + +#define HAL_BREAKINST 0xFF + +#define HAL_BREAKINST_SIZE 1 + +//----------------------------------------------------------------------------- +// Thread register state manipulation for GDB support. + +// Translate a stack pointer as saved by the thread context macros above into +// a pointer to a HAL_SavedRegisters structure. +#define HAL_THREAD_GET_SAVED_REGISTERS( _sp_, _regs_ ) \ + (_regs_) = (HAL_SavedRegisters *)(_sp_) + +// Copy a set of registers from a HAL_SavedRegisters structure into a +// GDB ordered array. +#define HAL_GET_GDB_REGISTERS( _aregval_ , _regs_ ) \ +{ \ + CYG_ADDRWORD *_regval_ = (CYG_ADDRWORD *)(_aregval_); \ + \ + _regval_[0] = (_regs_)->d0; \ + _regval_[1] = (_regs_)->d1; \ + _regval_[2] = (_regs_)->d2; \ + _regval_[3] = (_regs_)->d3; \ + _regval_[4] = (_regs_)->a0; \ + _regval_[5] = (_regs_)->a1; \ + _regval_[6] = (_regs_)->a2; \ + _regval_[7] = (_regs_)->a3; \ + \ + _regval_[8] = (CYG_ADDRWORD)(_regs_) + \ + sizeof(HAL_SavedRegisters); \ + _regval_[9] = (_regs_)->pc; \ + _regval_[10] = (_regs_)->mdr; \ + _regval_[11] = (_regs_)->psw; \ + \ + _regval_[12] = (_regs_)->lar; \ + _regval_[13] = (_regs_)->lir; \ +} + +// Copy a GDB ordered array into a HAL_SavedRegisters structure. +#define HAL_SET_GDB_REGISTERS( _regs_ , _aregval_ ) \ +{ \ + CYG_ADDRWORD *_regval_ = (CYG_ADDRWORD *)(_aregval_); \ + \ + (_regs_)->d0 = _regval_[0]; \ + (_regs_)->d1 = _regval_[1]; \ + (_regs_)->d2 = _regval_[2]; \ + (_regs_)->d3 = _regval_[3]; \ + (_regs_)->a0 = _regval_[4]; \ + (_regs_)->a1 = _regval_[5]; \ + (_regs_)->a2 = _regval_[6]; \ + (_regs_)->a3 = _regval_[7]; \ + \ + (_regs_)->pc = _regval_[9]; \ + (_regs_)->mdr = _regval_[10]; \ + \ + (_regs_)->lar = _regval_[12]; \ + (_regs_)->lir = _regval_[13]; \ + \ + /* We do not allow the SP or PSW to be set. Changing the SP will \ + * mess up the saved state. No PSW is saved on thread context \ + * switches, so there is nowhere to save it to. \ + */ \ +} + +//----------------------------------------------------------------------------- +// HAL setjmp + +#define HAL_JMP_BUF_SIZE 6 + +typedef cyg_uint32 hal_jmp_buf[HAL_JMP_BUF_SIZE]; + +externC int hal_setjmp(hal_jmp_buf env); +externC void hal_longjmp(hal_jmp_buf env, int val); + +//----------------------------------------------------------------------------- +// Idle thread code. +// This macro is called in the idle thread loop, and gives the HAL the +// chance to insert code. Typical idle thread behaviour might be to halt the +// processor. + +//externC void hal_idle_thread_action(cyg_uint32 loop_count); + +#define HAL_IDLE_THREAD_ACTION(_count_) + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_HAL_ARCH_H +// End of hal_arch.h diff --git a/packages/hal/mn10300/arch/current/include/hal_cache.h b/packages/hal/mn10300/arch/current/include/hal_cache.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/include/hal_cache.h @@ -0,0 +1,368 @@ +#ifndef CYGONCE_HAL_CACHE_H +#define CYGONCE_HAL_CACHE_H + +//============================================================================= +// +// hal_cache.h +// +// HAL cache control API +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: Cache control API +// Description: The macros defined here provide the HAL APIs for handling +// cache control operations. +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +//============================================================================= +// MN10300 Simulator + +#if defined(CYG_HAL_MN10300_SIM) + +//----------------------------------------------------------------------------- +// Cache dimensions + +// Data cache +#define HAL_DCACHE_SIZE 4096 // Size of data cache in bytes +#define HAL_DCACHE_LINE_SIZE 16 // Size of a data cache line +#define HAL_DCACHE_WAYS 2 // Associativity of the cache + +// Instruction cache +#define HAL_ICACHE_SIZE 4096 // Size of cache in bytes +#define HAL_ICACHE_LINE_SIZE 16 // Size of a cache line +#define HAL_ICACHE_WAYS 2 // Associativity of the cache + +#define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS)) +#define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS)) + +//----------------------------------------------------------------------------- +// Global control of data cache + +// Enable the data cache +#define HAL_DCACHE_ENABLE() + +// Disable the data cache +#define HAL_DCACHE_DISABLE() + +// Invalidate the entire cache +#define HAL_DCACHE_INVALIDATE_ALL() + +// Synchronize the contents of the cache with memory. +#define HAL_DCACHE_SYNC() + +// Set the data cache refill burst size +//#define HAL_DCACHE_BURST_SIZE(_size_) + +// Set the data cache write mode +//#define HAL_DCACHE_WRITE_MODE( _mode_ ) + +// Load the contents of the given address range into the data cache +// and then lock the cache so that it stays there. +//#define HAL_DCACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_DCACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Data cache line control + +// Allocate cache lines for the given address range without reading its +// contents from memory. +//#define HAL_DCACHE_ALLOCATE( _base_ , _size_ ) + +// Write dirty cache lines to memory and invalidate the cache entries +// for the given address range. +//#define HAL_DCACHE_FLUSH( _base_ , _size_ ) + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_DCACHE_INVALIDATE( _base_ , _size_ ) + +// Write dirty cache lines to memory for the given address range. +//#define HAL_DCACHE_STORE( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of reading +// from it later. +//#define HAL_DCACHE_READ_HINT( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of writing +// to it later. +//#define HAL_DCACHE_WRITE_HINT( _base_ , _size_ ) + +// Allocate and zero the cache lines associated with the given range. +//#define HAL_DCACHE_ZERO( _base_ , _size_ ) + +//----------------------------------------------------------------------------- +// Global control of Instruction cache + +// Enable the instruction cache +#define HAL_ICACHE_ENABLE() + +// Disable the instruction cache +#define HAL_ICACHE_DISABLE() + +// Invalidate the entire cache +#define HAL_ICACHE_INVALIDATE_ALL() + +// Synchronize the contents of the cache with memory. +#define HAL_ICACHE_SYNC() + +// Set the instruction cache refill burst size +//#define HAL_ICACHE_BURST_SIZE(_size_) + +// Load the contents of the given address range into the instruction cache +// and then lock the cache so that it stays there. +//#define HAL_ICACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_ICACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Instruction cache line control + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_ICACHE_INVALIDATE( _base_ , _size_ ) + +#endif + + +//============================================================================= +// MN103002 implementation + +#if !defined(CYG_HAL_MN10300_SIM) && defined(CYG_HAL_MN10300_MN103002) + +//----------------------------------------------------------------------------- +// Cache dimensions + + +// Data cache +#define HAL_DCACHE_SIZE 4096 // Size of data cache in bytes +#define HAL_DCACHE_LINE_SIZE 16 // Size of a data cache line +#define HAL_DCACHE_WAYS 2 // Associativity of the cache + +// Instruction cache +#define HAL_ICACHE_SIZE 4096 // Size of cache in bytes +#define HAL_ICACHE_LINE_SIZE 16 // Size of a cache line +#define HAL_ICACHE_WAYS 2 // Associativity of the cache + +#define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS)) +#define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS)) + +//----------------------------------------------------------------------------- +// Control registers + +#define HAL_CHCTR ((CYG_ADDRWORD *)0x20000070) + +#define HAL_CHCTR_ICEN 0x0001 +#define HAL_CHCTR_DCEN 0x0002 +#define HAL_CHCTR_ICBUSY 0x0004 +#define HAL_CHCTR_DCBUSY 0x0008 +#define HAL_CHCTR_ICINV 0x0010 +#define HAL_CHCTR_DCINV 0x0020 +#define HAL_CHCTR_DCWTMD 0x0040 +#define HAL_CHCTR_ICWMD 0x0300 +#define HAL_CHCTR_DCWMD 0x3000 + +#define HAL_DCACHE_PURGE_WAY0 ((CYG_ADDRWORD *)0x28400000) +#define HAL_DCACHE_PURGE_WAY1 ((CYG_ADDRWORD *)0x28401000) + +//----------------------------------------------------------------------------- +// Global control of data cache + +// Enable the data cache +#define HAL_DCACHE_ENABLE() \ +{ \ + CYG_ADDRWORD chctr = *HAL_CHCTR; \ + chctr |= HAL_CHCTR_DCEN; \ + *HAL_CHCTR = chctr; \ +} + +// Disable the data cache +#define HAL_DCACHE_DISABLE() \ +{ \ + CYG_ADDRWORD chctr = *HAL_CHCTR; \ + chctr &= ~HAL_CHCTR_DCEN; \ + *HAL_CHCTR = chctr; \ +} + +// Invalidate the entire cache +#define HAL_DCACHE_INVALIDATE_ALL() \ +{ \ + CYG_ADDRWORD chctr, chctr1; \ + chctr1 = *HAL_CHCTR; \ + HAL_DCACHE_DISABLE(); \ + while( *HAL_CHCTR & HAL_CHCTR_DCBUSY ); \ + chctr = *HAL_CHCTR; \ + chctr |= HAL_CHCTR_DCINV; \ + *HAL_CHCTR = chctr; \ + while( *HAL_CHCTR & HAL_CHCTR_DCBUSY ); \ + *HAL_CHCTR = chctr1; \ +} + +// Synchronize the contents of the cache with memory. +#define HAL_DCACHE_SYNC() + +// Set the data cache refill burst size +//#define HAL_DCACHE_BURST_SIZE(_size_) + +// Set the data cache write mode +#define HAL_DCACHE_WRITE_MODE( _mode_ ) \ +{ \ + CYG_ADDRWORD chctr; \ + chctr = *HAL_CHCTR; \ + HAL_DCACHE_DISABLE(); \ + while( *HAL_CHCTR & HAL_CHCTR_DCBUSY ); \ + chctr |= HAL_CHCTR_DCWTMD*(_mode_); \ + *HAL_CHCTR = chctr; \ +} + +#define HAL_DCACHE_WRITEBACK_MODE 0 +#define HAL_DCACHE_WRITETHRU_MODE 1 + +// Load the contents of the given address range into the data cache +// and then lock the cache so that it stays there. +//#define HAL_DCACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_DCACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Data cache line control + +// Allocate cache lines for the given address range without reading its +// contents from memory. +//#define HAL_DCACHE_ALLOCATE( _base_ , _size_ ) + +// Write dirty cache lines to memory and invalidate the cache entries +// for the given address range. +//#define HAL_DCACHE_FLUSH( _base_ , _size_ ) + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_DCACHE_INVALIDATE( _base_ , _size_ ) + +// Write dirty cache lines to memory for the given address range. +#define HAL_DCACHE_STORE( _base_ , _size_ ) \ +{ \ + volatile CYG_ADDRWORD *way0 = HAL_DCACHE_PURGE_WAY0; \ + volatile CYG_ADDRWORD *way1 = HAL_DCACHE_PURGE_WAY1; \ + int i; \ + CYG_ADDRWORD chctr; \ + chctr = *HAL_CHCTR; \ + HAL_DCACHE_DISABLE(); \ + while( *HAL_CHCTR & HAL_CHCTR_DCBUSY ); \ + \ + way0 += ((CYG_ADDRWORD)_base_) & 0x000007f0; \ + way1 += ((CYG_ADDRWORD)_base_) & 0x000007f0; \ + for( i = 0; i < _size_ ; i += HAL_DCACHE_LINE_SIZE ) \ + { \ + *way0 = 0; \ + *way1 = 0; \ + way0 += HAL_DCACHE_LINE_SIZE; \ + way1 += HAL_DCACHE_LINE_SIZE; \ + } \ + *HAL_CHCTR = chctr; \ +} + +// Preread the given range into the cache with the intention of reading +// from it later. +//#define HAL_DCACHE_READ_HINT( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of writing +// to it later. +//#define HAL_DCACHE_WRITE_HINT( _base_ , _size_ ) + +// Allocate and zero the cache lines associated with the given range. +//#define HAL_DCACHE_ZERO( _base_ , _size_ ) + +//----------------------------------------------------------------------------- +// Global control of Instruction cache + +// Enable the instruction cache +#define HAL_ICACHE_ENABLE() \ +{ \ + CYG_ADDRWORD chctr = *HAL_CHCTR; \ + chctr |= HAL_CHCTR_ICEN; \ + *HAL_CHCTR = chctr; \ +} + +// Disable the instruction cache +#define HAL_ICACHE_DISABLE() \ +{ \ + CYG_ADDRWORD chctr = *HAL_CHCTR; \ + chctr &= ~HAL_CHCTR_ICEN; \ + *HAL_CHCTR = chctr; \ +} + +// Invalidate the entire cache +#define HAL_ICACHE_INVALIDATE_ALL() \ +{ \ + CYG_ADDRWORD chctr, chctr1; \ + chctr1 = *HAL_CHCTR; \ + HAL_ICACHE_DISABLE(); \ + while( *HAL_CHCTR & HAL_CHCTR_ICBUSY ); \ + chctr = *HAL_CHCTR; \ + chctr |= HAL_CHCTR_ICINV; \ + *HAL_CHCTR = chctr; \ + while( *HAL_CHCTR & HAL_CHCTR_ICBUSY ); \ + *HAL_CHCTR = chctr1; \ +} + +// Synchronize the contents of the cache with memory. +#define HAL_ICACHE_SYNC() + +// Set the instruction cache refill burst size +//#define HAL_ICACHE_BURST_SIZE(_size_) + +// Load the contents of the given address range into the instruction cache +// and then lock the cache so that it stays there. +//#define HAL_ICACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_ICACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Instruction cache line control + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_ICACHE_INVALIDATE( _base_ , _size_ ) + +#endif + + +//----------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_CACHE_H +// End of hal_cache.h diff --git a/packages/hal/mn10300/arch/current/include/hal_intr.h b/packages/hal/mn10300/arch/current/include/hal_intr.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/include/hal_intr.h @@ -0,0 +1,813 @@ +#ifndef CYGONCE_HAL_HAL_INTR_H +#define CYGONCE_HAL_HAL_INTR_H + +//============================================================================= +// +// hal_intr.h +// +// HAL Interrupt and clock support +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: Define Interrupt support +// Description: The macros defined here provide the HAL APIs for handling +// interrupts and the clock. +// +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include + +//----------------------------------------------------------------------------- + +// The MN10300 has a somewhat complex interrupt structure. Besides the +// reset and NMI vectors there are seven maskable interrupt vectors +// which must point to code in the 64k starting at 0x40000000. There +// are also 25 Interrupt control groups, each of which can have 4 +// interrupt lines attached, for a theoretical total of 100 interrupts +// (!). Some of these are dedicated to specific devices, other to +// external pins, and others are not connected to anything, resulting +// in only 45 that can actually be delivered. Each control group may +// be assigned one of seven interrupt levels, and is delivered to the +// corresponding vector. Software can then use a register to determine +// the delivering group and detect from there which interrupt has been +// delivered. +// +// The approach we will adopt at present is for the code attached to +// each vector to save state and jump via a table to a VSR. The +// default VSR will fully decode the delivered interrupt into a table +// of isr/data/object entries. VSR replacement will operate on the +// first level indirection table rather than the hardware +// vectors. This is the fastest mechanism, however it needs 100*3*4 + +// 7*4 = 1228 bytes for the tables. +// + +//----------------------------------------------------------------------------- +// Interrupt vectors. + +// The level-specific hardware vectors +#define CYG_VECTOR_0 0 +#define CYG_VECTOR_1 1 +#define CYG_VECTOR_2 2 +#define CYG_VECTOR_3 3 +#define CYG_VECTOR_4 4 +#define CYG_VECTOR_5 5 +#define CYG_VECTOR_6 6 +#define CYG_VECTOR_NMI 7 +#define CYG_VECTOR_TRAP 8 + +#define CYG_VSR_MIN 0 +#define CYG_VSR_MAX 8 +#define CYG_VSR_COUNT 9 + +#define CYG_EXCEPTION_MIN 0 +#define CYG_EXCEPTION_MAX 3 +#define CYG_EXCEPTION_COUNT 4 + + +#if defined(CYG_HAL_MN10300_MN103000) + +// The decoded interrupts + +#define CYG_VECTOR_NMIRQ 0 +#define CYG_VECTOR_WATCHDOG 1 +#define CYG_VECTOR_SYSTEM_ERROR 2 +#define CYG_VECTOR_RESERVED_3 3 + +#define CYG_VECTOR_RESERVED_4 4 +#define CYG_VECTOR_RESERVED_5 5 +#define CYG_VECTOR_RESERVED_6 6 +#define CYG_VECTOR_RESERVED_7 7 + +#define CYG_VECTOR_TIMER_0 8 +#define CYG_VECTOR_TIMER_1 9 +#define CYG_VECTOR_TIMER_2 10 +#define CYG_VECTOR_TIMER_3 11 + +#define CYG_VECTOR_TIMER_4 12 +#define CYG_VECTOR_TIMER_5 13 +#define CYG_VECTOR_TIMER_6 14 +#define CYG_VECTOR_TIMER_7 15 + +#define CYG_VECTOR_TIMER_8 16 +#define CYG_VECTOR_TIMER_8_COMPARE_A 17 +#define CYG_VECTOR_TIMER_8_COMPARE_B 18 +#define CYG_VECTOR_RESERVED_19 19 + +#define CYG_VECTOR_TIMER_9 20 +#define CYG_VECTOR_TIMER_9_COMPARE_A 21 +#define CYG_VECTOR_TIMER_9_COMPARE_B 22 +#define CYG_VECTOR_RESERVED_23 23 + +#define CYG_VECTOR_TIMER_10 24 +#define CYG_VECTOR_TIMER_10_COMPARE_A 25 +#define CYG_VECTOR_TIMER_10_COMPARE_B 26 +#define CYG_VECTOR_TIMER_10_COMPARE_C 27 + +#define CYG_VECTOR_TIMER_11 28 +#define CYG_VECTOR_TIMER_11_COMPARE_A 29 +#define CYG_VECTOR_TIMER_11_COMPARE_B 30 +#define CYG_VECTOR_TIMER_11_COMPARE_C 31 + +#define CYG_VECTOR_TIMER_12 32 +#define CYG_VECTOR_TIMER_12_COMPARE_A 33 +#define CYG_VECTOR_TIMER_12_COMPARE_B 34 +#define CYG_VECTOR_TIMER_12_COMPARE_C 35 + +#define CYG_VECTOR_TIMER_11_COMPARE_D 36 +#define CYG_VECTOR_TIMER_12_COMPARE_D 37 +#define CYG_VECTOR_RESERVED_38 38 +#define CYG_VECTOR_RESERVED_39 39 + +#define CYG_VECTOR_DMA0 40 +#define CYG_VECTOR_RESERVED_41 41 +#define CYG_VECTOR_RESERVED_42 42 +#define CYG_VECTOR_RESERVED_43 43 + +#define CYG_VECTOR_DMA1 44 +#define CYG_VECTOR_RESERVED_45 45 +#define CYG_VECTOR_RESERVED_46 46 +#define CYG_VECTOR_RESERVED_47 47 + +#define CYG_VECTOR_DMA2 48 +#define CYG_VECTOR_RESERVED_49 49 +#define CYG_VECTOR_RESERVED_50 50 +#define CYG_VECTOR_RESERVED_51 51 + +#define CYG_VECTOR_DMA3 52 +#define CYG_VECTOR_RESERVED_53 53 +#define CYG_VECTOR_RESERVED_54 54 +#define CYG_VECTOR_RESERVED_55 55 + +#define CYG_VECTOR_SERIAL_0_RX 56 +#define CYG_VECTOR_SERIAL_0_TX 57 +#define CYG_VECTOR_RESERVED_58 58 +#define CYG_VECTOR_RESERVED_59 59 + +#define CYG_VECTOR_SERIAL_1_RX 60 +#define CYG_VECTOR_SERIAL_1_TX 61 +#define CYG_VECTOR_RESERVED_62 62 +#define CYG_VECTOR_RESERVED_63 63 + +#define CYG_VECTOR_EXTERNAL_0 64 +#define CYG_VECTOR_RESERVED_65 65 +#define CYG_VECTOR_RESERVED_66 66 +#define CYG_VECTOR_RESERVED_67 67 + +#define CYG_VECTOR_EXTERNAL_1 68 +#define CYG_VECTOR_RESERVED_69 69 +#define CYG_VECTOR_RESERVED_70 70 +#define CYG_VECTOR_RESERVED_71 71 + +#define CYG_VECTOR_EXTERNAL_2 72 +#define CYG_VECTOR_RESERVED_73 73 +#define CYG_VECTOR_RESERVED_74 74 +#define CYG_VECTOR_RESERVED_75 75 + +#define CYG_VECTOR_EXTERNAL_3 76 +#define CYG_VECTOR_RESERVED_77 77 +#define CYG_VECTOR_RESERVED_78 78 +#define CYG_VECTOR_RESERVED_79 79 + +#define CYG_VECTOR_EXTERNAL_4 80 +#define CYG_VECTOR_RESERVED_81 81 +#define CYG_VECTOR_RESERVED_82 82 +#define CYG_VECTOR_RESERVED_83 83 + +#define CYG_VECTOR_EXTERNAL_5 84 +#define CYG_VECTOR_RESERVED_85 85 +#define CYG_VECTOR_RESERVED_86 86 +#define CYG_VECTOR_RESERVED_87 87 + +#define CYG_VECTOR_EXTERNAL_6 88 +#define CYG_VECTOR_RESERVED_89 89 +#define CYG_VECTOR_RESERVED_90 90 +#define CYG_VECTOR_RESERVED_91 91 + +#define CYG_VECTOR_EXTERNAL_7 92 +#define CYG_VECTOR_RESERVED_93 93 +#define CYG_VECTOR_RESERVED_94 94 +#define CYG_VECTOR_RESERVED_95 95 + +#define CYG_VECTOR_AD_CONVERSION 96 +#define CYG_VECTOR_RESERVED_97 97 +#define CYG_VECTOR_RESERVED_98 98 +#define CYG_VECTOR_RESERVED_99 99 + +#define CYG_ISR_MIN 0 +#define CYG_ISR_MAX 99 + +#define CYG_ISR_COUNT 100 + +#elif defined(CYG_HAL_MN10300_MN103002) + +// The decoded interrupts + +#define CYG_VECTOR_NMIRQ 0 +#define CYG_VECTOR_WATCHDOG 1 +#define CYG_VECTOR_SYSTEM_ERROR 2 +#define CYG_VECTOR_RESERVED_3 3 + +#define CYG_VECTOR_RESERVED_4 4 +#define CYG_VECTOR_RESERVED_5 5 +#define CYG_VECTOR_RESERVED_6 6 +#define CYG_VECTOR_RESERVED_7 7 + +#define CYG_VECTOR_TIMER_0 8 +#define CYG_VECTOR_RESERVED_9 9 +#define CYG_VECTOR_RESERVED_10 10 +#define CYG_VECTOR_RESERVED_11 11 + +#define CYG_VECTOR_TIMER_1 12 +#define CYG_VECTOR_RESERVED_13 13 +#define CYG_VECTOR_RESERVED_14 14 +#define CYG_VECTOR_RESERVED_15 15 + +#define CYG_VECTOR_TIMER_2 16 +#define CYG_VECTOR_RESERVED_17 17 +#define CYG_VECTOR_RESERVED_18 18 +#define CYG_VECTOR_RESERVED_19 19 + +#define CYG_VECTOR_TIMER_3 20 +#define CYG_VECTOR_RESERVED_21 21 +#define CYG_VECTOR_RESERVED_22 22 +#define CYG_VECTOR_RESERVED_23 23 + +#define CYG_VECTOR_TIMER_4 24 +#define CYG_VECTOR_RESERVED_25 25 +#define CYG_VECTOR_RESERVED_26 26 +#define CYG_VECTOR_RESERVED_27 27 + +#define CYG_VECTOR_TIMER_5 28 +#define CYG_VECTOR_RESERVED_29 29 +#define CYG_VECTOR_RESERVED_30 30 +#define CYG_VECTOR_RESERVED_31 31 + +#define CYG_VECTOR_TIMER_6 32 +#define CYG_VECTOR_RESERVED_33 33 +#define CYG_VECTOR_RESERVED_34 34 +#define CYG_VECTOR_RESERVED_35 35 + +#define CYG_VECTOR_TIMER_6_COMPARE_A 36 +#define CYG_VECTOR_RESERVED_37 37 +#define CYG_VECTOR_RESERVED_38 38 +#define CYG_VECTOR_RESERVED_39 39 + +#define CYG_VECTOR_TIMER_6_COMPARE_B 40 +#define CYG_VECTOR_RESERVED_41 41 +#define CYG_VECTOR_RESERVED_42 42 +#define CYG_VECTOR_RESERVED_43 43 + +#define CYG_VECTOR_RESERVED_44 44 +#define CYG_VECTOR_RESERVED_45 45 +#define CYG_VECTOR_RESERVED_46 46 +#define CYG_VECTOR_RESERVED_47 47 + +#define CYG_VECTOR_DMA0 48 +#define CYG_VECTOR_RESERVED_49 49 +#define CYG_VECTOR_RESERVED_50 50 +#define CYG_VECTOR_RESERVED_51 51 + +#define CYG_VECTOR_DMA1 52 +#define CYG_VECTOR_RESERVED_53 53 +#define CYG_VECTOR_RESERVED_54 54 +#define CYG_VECTOR_RESERVED_55 55 + +#define CYG_VECTOR_DMA2 56 +#define CYG_VECTOR_RESERVED_57 57 +#define CYG_VECTOR_RESERVED_58 58 +#define CYG_VECTOR_RESERVED_59 59 + +#define CYG_VECTOR_DMA3 60 +#define CYG_VECTOR_RESERVED_61 61 +#define CYG_VECTOR_RESERVED_62 62 +#define CYG_VECTOR_RESERVED_63 63 + +#define CYG_VECTOR_SERIAL_0_RX 64 +#define CYG_VECTOR_RESERVED_65 65 +#define CYG_VECTOR_RESERVED_66 66 +#define CYG_VECTOR_RESERVED_67 67 + +#define CYG_VECTOR_SERIAL_0_TX 68 +#define CYG_VECTOR_RESERVED_69 69 +#define CYG_VECTOR_RESERVED_70 70 +#define CYG_VECTOR_RESERVED_71 71 + +#define CYG_VECTOR_SERIAL_1_RX 72 +#define CYG_VECTOR_RESERVED_73 73 +#define CYG_VECTOR_RESERVED_74 74 +#define CYG_VECTOR_RESERVED_75 75 + +#define CYG_VECTOR_SERIAL_1_TX 76 +#define CYG_VECTOR_RESERVED_77 77 +#define CYG_VECTOR_RESERVED_78 78 +#define CYG_VECTOR_RESERVED_79 79 + +#define CYG_VECTOR_SERIAL_2_RX 80 +#define CYG_VECTOR_RESERVED_81 81 +#define CYG_VECTOR_RESERVED_82 82 +#define CYG_VECTOR_RESERVED_83 83 + +#define CYG_VECTOR_SERIAL_2_TX 84 +#define CYG_VECTOR_RESERVED_85 85 +#define CYG_VECTOR_RESERVED_86 86 +#define CYG_VECTOR_RESERVED_87 87 + +#define CYG_VECTOR_RESERVED_88 88 +#define CYG_VECTOR_RESERVED_89 89 +#define CYG_VECTOR_RESERVED_90 90 +#define CYG_VECTOR_RESERVED_91 91 + +#define CYG_VECTOR_EXTERNAL_0 92 +#define CYG_VECTOR_RESERVED_93 93 +#define CYG_VECTOR_RESERVED_94 94 +#define CYG_VECTOR_RESERVED_95 95 + +#define CYG_VECTOR_EXTERNAL_1 96 +#define CYG_VECTOR_RESERVED_97 97 +#define CYG_VECTOR_RESERVED_98 98 +#define CYG_VECTOR_RESERVED_99 99 + +#define CYG_VECTOR_EXTERNAL_2 100 +#define CYG_VECTOR_RESERVED_101 101 +#define CYG_VECTOR_RESERVED_102 102 +#define CYG_VECTOR_RESERVED_103 103 + +#define CYG_VECTOR_EXTERNAL_3 104 +#define CYG_VECTOR_RESERVED_105 105 +#define CYG_VECTOR_RESERVED_106 106 +#define CYG_VECTOR_RESERVED_107 107 + +#define CYG_VECTOR_EXTERNAL_4 108 +#define CYG_VECTOR_RESERVED_109 109 +#define CYG_VECTOR_RESERVED_110 110 +#define CYG_VECTOR_RESERVED_111 111 + +#define CYG_VECTOR_EXTERNAL_5 112 +#define CYG_VECTOR_RESERVED_113 113 +#define CYG_VECTOR_RESERVED_114 114 +#define CYG_VECTOR_RESERVED_115 115 + +#define CYG_VECTOR_EXTERNAL_6 116 +#define CYG_VECTOR_RESERVED_117 117 +#define CYG_VECTOR_RESERVED_118 118 +#define CYG_VECTOR_RESERVED_119 119 + +#define CYG_VECTOR_EXTERNAL_7 120 +#define CYG_VECTOR_RESERVED_121 121 +#define CYG_VECTOR_RESERVED_122 122 +#define CYG_VECTOR_RESERVED_123 123 + +#define CYG_ISR_MIN 0 +#define CYG_ISR_MAX 123 + +#define CYG_ISR_COUNT (3+((CYG_ISR_MAX+1)/4)) + +#endif + +// The vector used by the Real time clock + +#ifdef CYG_HAL_MN10300_SIM +# define CYG_VECTOR_RTC CYG_VECTOR_TIMER_5 +//# define CYG_VECTOR_RTC CYG_VECTOR_EXTERNAL_1 +#else +# ifdef CYG_HAL_MN10300_MN103000 +# define CYG_VECTOR_RTC CYG_VECTOR_TIMER_8 +# endif +# ifdef CYG_HAL_MN10300_MN103002 +# define CYG_VECTOR_RTC CYG_VECTOR_TIMER_5 +# endif +#endif + +//----------------------------------------------------------------------------- +// Timer control registers. + +// On simulator we use simulated external interrupt + +#if defined(CYG_HAL_MN10300_MN103002) + +// On the mn103002 we use timers 4 and 5 + +#define TIMER4_CR 0x340010a0 +#define TIMER4_BR 0x34001090 +#define TIMER4_MD 0x34001080 + +#define TIMER5_CR 0x340010a2 +#define TIMER5_BR 0x34001092 +#define TIMER5_MD 0x34001082 + +#define TIMER_CR TIMER5_CR +#define TIMER_BR TIMER5_BR +#define TIMER_MD TIMER5_MD + +#define TIMER0_MD 0x34001000 +#define TIMER0_BR 0x34001010 +#define TIMER0_CR 0x34001020 + +#elif defined(CYG_HAL_MN10300_MN103000) + +// on the mn103000 we use timers 4 and 5 +#define TIMER4_CR 0x340010a0 +#define TIMER4_BR 0x34001090 +#define TIMER4_MD 0x34001080 + +#define TIMER5_CR 0x340010a2 +#define TIMER5_BR 0x34001092 +#define TIMER5_MD 0x34001082 + +#define TIMER_CR TIMER5_CR +#define TIMER_BR TIMER5_BR +#define TIMER_MD TIMER5_MD + +#define TIMER0_MD 0x34001000 +#define TIMER0_BR 0x34001010 +#define TIMER0_CR 0x34001020 + +#endif + +//----------------------------------------------------------------------------- +// Static data used by HAL + +// ISR tables +externC volatile CYG_ADDRESS hal_interrupt_handlers[CYG_ISR_COUNT]; +externC volatile CYG_ADDRWORD hal_interrupt_data[CYG_ISR_COUNT]; +externC volatile CYG_ADDRESS hal_interrupt_objects[CYG_ISR_COUNT]; + +// VSR table +externC volatile CYG_ADDRESS hal_vsr_table[CYG_VSR_COUNT]; + +// MN10300 interrupt control registers, mapped by linker script. +externC volatile cyg_uint16 mn10300_interrupt_control[0x300/2]; + +//----------------------------------------------------------------------------- +// Interrupt state storage + +typedef cyg_uint32 CYG_INTERRUPT_STATE; + +//----------------------------------------------------------------------------- +// Interrupt control macros + +#define HAL_DISABLE_INTERRUPTS(_old_) \ + asm volatile ( \ + "mov psw,%0;" \ + "mov 0xF7FF,d0;" \ + "and %0,d0;" \ + "mov d0,psw;" \ + "and 0x0800,%0;" \ + : "=d"(_old_) \ + : \ + : "d0" \ + ); + +#define HAL_ENABLE_INTERRUPTS() \ + asm volatile ( \ + "mov psw,d0;" \ + "or 0x0800,d0;" \ + "mov d0,psw;" \ + : \ + : \ + : "d0" \ + ); + +#define HAL_RESTORE_INTERRUPTS(_old_) \ + asm volatile ( \ + "mov psw,d1;" \ + "or %0,d1;" \ + "mov d1,psw;" \ + : \ + : "d"(_old_) \ + : "d1" \ + ); + +#define HAL_QUERY_INTERRUPTS(_old_) \ + asm volatile ( \ + "mov psw,%0;" \ + "and 0x0800,%0;" \ + : "=d"(_old_) \ + ); + +//----------------------------------------------------------------------------- +// Translate a vector number into an ISR table index. +// If we have chained interrupts we have just a single ISR per priority +// level. On the MN103000 there are several interrupts per controller, +// so we have to decode to one of 100 vectors. On the MN103002 there is +// only one interrupt per controller, so we can have just one ISR per +// controller, except for the NMI vectors which occupy the first 3 slots. + +#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN + +#define HAL_TRANSLATE_VECTOR(_vector_,_index_) \ +{ \ + /* ICRs are 16 bit regs at 32 bit spacing */ \ + cyg_ucount16 _ix_ = ((_vector_)>>2)<<1; \ + \ + /* read the appropriate interrupt control register */ \ + cyg_uint16 _icr_ = mn10300_interrupt_control[_ix_]; \ + \ + /* extract interrupt priority level */ \ + _index_ = (_icr_ >> 12) & 0x7; \ +} + +#else + +#if defined(CYG_HAL_MN10300_MN103000) + +#define HAL_TRANSLATE_VECTOR(_vector_,_index_) _index_ = (_vector_) + +#elif defined(CYG_HAL_MN10300_MN103002) + +//#define HAL_TRANSLATE_VECTOR(_vector_,_index_) _index_ = ((_vector_)>>2) + +#define HAL_TRANSLATE_VECTOR(_vector_,_index_) \ + _index_ = (((_vector_)<=CYG_VECTOR_SYSTEM_ERROR) ? \ + (_vector_) : \ + (((_vector_)>>2)+CYG_VECTOR_RESERVED_3)) + +#endif + +#endif + + +//----------------------------------------------------------------------------- +// Interrupt and VSR attachment macros + +#define HAL_INTERRUPT_ATTACH( _vector_, _isr_, _data_, _object_ ) \ +{ \ + cyg_uint32 _index_; \ + HAL_TRANSLATE_VECTOR(_vector_,_index_); \ + \ + if( hal_interrupt_handlers[_index_] == (CYG_ADDRESS)NULL ) \ + { \ + hal_interrupt_handlers[_index_] = (CYG_ADDRESS)_isr_; \ + hal_interrupt_data[_index_] = (CYG_ADDRWORD)_data_; \ + hal_interrupt_objects[_index_] = (CYG_ADDRESS)_object_; \ + } \ +} + +#define HAL_INTERRUPT_DETACH( _vector_, _isr_ ) \ +{ \ + cyg_uint32 _index_; \ + HAL_TRANSLATE_VECTOR(_vector_,_index_); \ + \ + if( hal_interrupt_handlers[_index_] == (CYG_ADDRESS)_isr_ ) \ + { \ + hal_interrupt_handlers[_index_] = (CYG_ADDRESS)NULL; \ + hal_interrupt_data[_index_] = 0; \ + hal_interrupt_objects[_index_] = 0; \ + } \ +} + +#define HAL_VSR_GET( _vector_, _pvsr_ ) \ + *((CYG_ADDRESS *)_pvsr_) = hal_vsr_table[_vector_]; + + +#define HAL_VSR_SET( _vector_, _vsr_, _poldvsr_ ) \ + if( _poldvsr_ != NULL ) \ + *(CYG_ADDRESS *)_poldvsr_ = hal_vsr_table[_vector_]; \ + hal_vsr_table[_vector_] = (CYG_ADDRESS)_vsr_; + + +//----------------------------------------------------------------------------- +// Interrupt controller access +// Read interrupt control registers back after writing to them. This +// ensures that the written value is not sitting in the store buffers +// when interrupts are re-enabled. +#define HAL_INTERRUPT_MASK( _vector_ ) \ +{ \ + /* ICRs are 16 bit regs at 32 bit spacing */ \ + cyg_ucount16 _index_ = ((_vector_)>>2)<<1; \ + \ + /* read the appropriate interrupt control register */ \ + cyg_uint16 _icr_ = mn10300_interrupt_control[_index_]; \ + \ + /* clear interrupt enable bit for this vector */ \ + _icr_ &= ~(0x0100<<((_vector_)&3)); \ + \ + /* restore the interrupt control register */ \ + mn10300_interrupt_control[_index_] = _icr_; \ + _icr_ = mn10300_interrupt_control[_index_]; \ +} + +#define HAL_INTERRUPT_UNMASK( _vector_ ) \ +{ \ + /* ICRs are 16 bit regs at 32 bit spacing */ \ + cyg_ucount16 _index_ = (_vector_>>2)<<1; \ + \ + /* read the appropriate interrupt control register */ \ + cyg_uint16 _icr_ = mn10300_interrupt_control[_index_]; \ + \ + /* set interrupt enable bit for this vector */ \ + _icr_ |= (0x0100<<(_vector_&3)); \ + \ + /* restore the interrupt control register */ \ + mn10300_interrupt_control[_index_] = _icr_; \ + _icr_ = mn10300_interrupt_control[_index_]; \ +} + +#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ ) \ +{ \ + /* ICRs are 16 bit regs at 32 bit spacing */ \ + cyg_ucount16 _index_ = ((_vector_)>>2)<<1; \ + \ + /* read the appropriate interrupt control register */ \ + cyg_uint16 _icr_ = mn10300_interrupt_control[_index_]; \ + \ + /* clear interrupt request bit for this vector */ \ + _icr_ &= ~(0x0010<<((_vector_)&3)); \ + \ + /* set interrupt detect bit for this vector */ \ + _icr_ |= (0x0001<<((_vector_)&3)); \ + \ + /* restore the interrupt control register */ \ + mn10300_interrupt_control[_index_] = _icr_; \ + _icr_ = mn10300_interrupt_control[_index_]; \ +} + +#define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ ) \ +{ \ + cyg_vector _v_ = _vector_; \ + /* adjust vector to bit offset in EXTMD */ \ + _v_ -= CYG_VECTOR_EXTERNAL_0; \ + _v_ >>= 1; \ + \ + cyg_uint16 _val_ = 0; \ + \ + /* set bits according to requirements */ \ + if( _up_ ) _val_ |= 1; \ + if( !(_level_) ) _val_ |= 2; \ + \ + /* get EXTMD */ \ + cyg_uint16 _reg_ = mn10300_interrupt_control[0x180>>1]; \ + \ + /* clear old value and set new */ \ + _reg_ &= ~(3<<_v_); \ + _reg_ |= _val_<<_v_; \ + \ + /* restore EXTMD */ \ + mn10300_interrupt_control[0x180>>1] = _reg_; \ +} + +#define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ ) \ +{ \ + /* ICRs are 16 bit regs at 32 bit spacing */ \ + cyg_ucount16 _index_ = (_vector_>>2)<<1; \ + \ + /* read the appropriate interrupt control register */ \ + cyg_uint16 _icr_ = mn10300_interrupt_control[_index_]; \ + \ + /* set interrupt level for this group of vectors */ \ + _icr_ &= 0x0FFF; \ + _icr_ |= (_level_)<<12; \ + \ + /* restore the interrupt control register */ \ + mn10300_interrupt_control[_index_] = _icr_; \ + _icr_ = mn10300_interrupt_control[_index_]; \ +} + +//----------------------------------------------------------------------------- +// Clock control + + +#if 0 // defined(CYG_HAL_MN10300_SIM) + +#define OEA_DEV 0x31000000 + +#define HAL_SWAP(x) ((((x)&0xff)<<24)|(((x)&0xff00)<<8)| \ + (((x)&0xff0000)>>8)|(((x)&0xff000000)>>24)) + +#define PAL_COUNTDOWN_TIMER 0x20 // one shot on IR0 +#define PAL_COUNTDOWN_VALUE 0x24 +#define PAL_PERIODIC_TIMER 0x28 // repeating on IR1 +#define PAL_PERIODIC_VALUE 0x2c + + +// IRQ1 set to receive clock intrs +#define HAL_CLOCK_INITIALIZE( _period_ ) \ +{ \ + volatile cyg_uint32 *timer = (cyg_uint32 *) \ + (OEA_DEV + PAL_PERIODIC_TIMER); \ + cyg_uint32 p = _period_; \ + \ + *timer = HAL_SWAP(p); \ +} + +#elif defined(CYG_HAL_MN10300_MN103000) + +#define HAL_CLOCK_INITIALIZE( _period_ ) \ +{ \ + volatile cyg_uint16 *timer_ctr = (cyg_uint16 *)TIMER_BR; \ + volatile cyg_uint16 *timer_mode = (cyg_uint16 *)TIMER_MD; \ + volatile cyg_uint8 *timer_a_mode = (cyg_uint8 *)0x34001084; \ + \ + *timer_a_mode = 0x04; \ + \ + *timer_ctr = 0xf000; \ + \ + *timer_mode = 0x0013; \ + *timer_mode = 0x4013; \ + *timer_mode = 0x0013; \ + *timer_mode = 0x8013; \ +} + +#elif defined(CYG_HAL_MN10300_MN103002) + +#define HAL_CLOCK_INITIALIZE( _period_ ) \ +{ \ + volatile cyg_uint16 *timer4_br = (cyg_uint16 *)TIMER4_BR; \ + volatile cyg_uint8 *timer4_md = (cyg_uint8 *)TIMER4_MD; \ + volatile cyg_uint16 *timer5_br = (cyg_uint16 *)TIMER5_BR; \ + volatile cyg_uint8 *timer5_md = (cyg_uint8 *)TIMER5_MD; \ + \ + /* Set timers 4 and 5 into cascade mode */ \ + \ + *timer5_br = (_period_)>>16; \ + \ + *timer5_md = 0x40; \ + *timer5_md = 0x83; \ + \ + *timer4_br = (_period_)&0x0000FFFF; \ + \ + *timer4_md = 0x40; \ + *timer4_md = 0x80; \ +} + +#else + +#error Undefined MN10300 model + +#endif + +#define HAL_CLOCK_RESET( _vector_, _period_ ) + +#if 0 //def CYG_HAL_MN10300_SIM + +// This timer counts down, so subtract from set value. +#define HAL_CLOCK_READ( _pvalue_ ) \ +{ \ + volatile cyg_uint32 *timer = (cyg_uint32 *) \ + (OEA_DEV + PAL_PERIODIC_TIMER); \ + volatile cyg_uint32 *value = (cyg_uint32 *) \ + (OEA_DEV + PAL_PERIODIC_VALUE); \ + cyg_uint32 t,v; \ + t = *timer; \ + v = *value; \ + *(_pvalue_) = HAL_SWAP(t) - HAL_SWAP(v); \ +} + +#else // CYG_HAL_MN10300_SIM not +#define HAL_CLOCK_READ( _pvalue_ ) \ +{ \ + volatile cyg_uint16 *timer4_cr = (cyg_uint16 *)TIMER4_CR; \ + volatile cyg_uint16 *timer5_cr = (cyg_uint16 *)TIMER5_CR; \ + \ + cyg_uint16 t5; \ + cyg_uint16 t4; \ + \ + /* Loop reading the two timers until we can read t5 twice */ \ + /* with the same value. This avoids getting silly times if */ \ + /* the timers carry between reading the two regs. */ \ + do { \ + t5 = *timer5_cr; \ + t4 = *timer4_cr; \ + } while( t5 != *timer5_cr ); \ + \ + *(_pvalue_) = CYGNUM_KERNEL_COUNTERS_RTC_PERIOD - ((t5<<16) + t4); \ +} +#endif // CYG_HAL_MN10300_SIM +//----------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_HAL_INTR_H +// End of hal_intr.h diff --git a/packages/hal/mn10300/arch/current/include/hal_io.h b/packages/hal/mn10300/arch/current/include/hal_io.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/include/hal_io.h @@ -0,0 +1,134 @@ +#ifndef CYGONCE_HAL_HAL_IO_H +#define CYGONCE_HAL_HAL_IO_H + +//============================================================================= +// +// hal_io.h +// +// HAL device IO register support. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: Define IO register support +// Description: The macros defined here provide the HAL APIs for handling +// device IO control registers. +// +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +//----------------------------------------------------------------------------- +// IO Register address. +// This type is for recording the address of an IO register. + +typedef volatile CYG_ADDRWORD HAL_IO_REGISTER; + +//----------------------------------------------------------------------------- +// BYTE Register access. +// Individual and vectorized access to 8 bit registers. + +#define HAL_READ_UINT8( _register_, _value_ ) \ + ((_value_) = *((volatile CYG_BYTE *)(_register_))) + +#define HAL_WRITE_UINT8( _register_, _value_ ) \ + (*((volatile CYG_BYTE *)(_register_)) = (_value_)) + +#define HAL_READ_UINT8_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + (_buf_)[_i_] = ((volatile CYG_BYTE *)(_register_))[_j_]; \ +} + +#define HAL_WRITE_UINT8_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + ((volatile CYG_BYTE *)(_register_))[_j_] = (_buf_)[_i_]; \ +} + + +//----------------------------------------------------------------------------- +// 16 bit access. +// Individual and vectorized access to 16 bit registers. + +#define HAL_READ_UINT16( _register_, _value_ ) \ + ((_value_) = *((volatile CYG_WORD16 *)(_register_))) + +#define HAL_WRITE_UINT16( _register_, _value_ ) \ + (*((volatile CYG_WORD16 *)(_register_)) = (_value_)) + +#define HAL_READ_UINT16_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + (_buf_)[_i_] = ((volatile CYG_WORD16 *)(_register_))[_j_]; \ +} + +#define HAL_WRITE_UINT16_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + ((volatile CYG_WORD16 *)(_register_))[_j_] = (_buf_)[_i_]; \ +} + +//----------------------------------------------------------------------------- +// 32 bit access. +// Individual and vectorized access to 32 bit registers. + +#define HAL_READ_UINT32( _register_, _value_ ) \ + ((_value_) = *((volatile CYG_WORD32 *)(_register_))) + +#define HAL_WRITE_UINT32( _register_, _value_ ) \ + (*((volatile CYG_WORD32 *)(_register_)) = (_value_)) + +#define HAL_READ_UINT32_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + (_buf_)[_i_] = ((volatile CYG_WORD32 *)(_register_))[_j_]; \ +} + +#define HAL_WRITE_UINT32_VECTOR( _register_, _buf_, _count_, _step_ ) \ +{ \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) \ + ((volatile CYG_WORD32 *)(_register_))[_j_] = (_buf_)[_i_]; \ +} + +//----------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_HAL_IO_H +// End of hal_io.h diff --git a/packages/hal/mn10300/arch/current/include/pkgconf/hal_mn10300.h b/packages/hal/mn10300/arch/current/include/pkgconf/hal_mn10300.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/include/pkgconf/hal_mn10300.h @@ -0,0 +1,64 @@ +#ifndef CYGONCE_PKGCONF_HAL_MN10300_H +#define CYGONCE_PKGCONF_HAL_MN10300_H +// ==================================================================== +// +// pkgconf/hal_mn10300.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_MN10300 { + display "MN10300 architecture" + type radio + parent CYGPKG_HAL + target mn10300 + description " + The MN10300 architecture HAL package provides generic + support for this processor architecture. It is also + necessary to select a specific target platform HAL + package." + } + + }}CFG_DATA */ + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_MN10300_H */ +/* EOF hal_mn10300.h */ diff --git a/packages/hal/mn10300/arch/current/src/PKGconf.mak b/packages/hal/mn10300/arch/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/src/PKGconf.mak @@ -0,0 +1,53 @@ +#============================================================================== +# +# makefile +# +# hal/mn10300/arch/src +# +#============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================== + +PACKAGE := hal_mn10300 +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := hal_misc.c context.S +OTHER_OBJS := +OTHER_TARGETS := vectors.stamp +OTHER_DEPS := $(PACKAGE)_vectors.d +OTHER_CLEAN := vectors.clean + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + +vectors.stamp: $(PACKAGE)_vectors.o + $(CP) $< $(PREFIX)/lib/vectors.o + @$(TOUCH) $@ + +vectors.clean: + $(RM) $(PREFIX)/lib/vectors.o $(PACKAGE)_vectors.o + $(RM) vectors.stamp + +$(PACKAGE)_vectors.o: $(BUILD_TREE)/pkgconf/pkgconf.mak \ + $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) + diff --git a/packages/hal/mn10300/arch/current/src/context.S b/packages/hal/mn10300/arch/current/src/context.S new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/src/context.S @@ -0,0 +1,137 @@ +##============================================================================= +## +## context.S +## +## MN10300 context switch code +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1998-04-27 +## Purpose: MN10300 context switch code +## Description: This file contains implementations of the thread context +## switch routines. It also contains the longjmp() and setjmp() +## routines. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +#------------------------------------------------------------------------------ +# Configure to use either a minimal or maximal thread state + +#ifdef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM + +#define SAVE_REGS [d2,d3,a2,a3,other] + +#else + +#define SAVE_REGS [d2,d3,a2,a3,other] + +#endif + +#------------------------------------------------------------------------------ +# hal_thread_switch_context +# Switch thread contexts +# D0 = address of sp of next thread to execute +# D1 = address of sp save location of current thread + + .global _hal_thread_switch_context +_hal_thread_switch_context: + add -8,sp # space for SP and PSW + movm SAVE_REGS,(sp) # dump all registers onto stack + mov psw,d2 # put PSW into saved state + mov d2,(52,sp) + mov d1,a2 # move save loc addr to A2 + mov sp,(0,a2) # store SP in save location + + # Now load the destination thread by dropping through + # to hal_thread_load_context + +#------------------------------------------------------------------------------ +# hal_thread_load_context +# Load thread context +# D0 = address of sp of next thread to execute +# Note that this function is also the second half of hal_thread_switch_context +# and is simply dropped into from it. + + .global _hal_thread_load_context +_hal_thread_load_context: + + mov d0,a2 # move next sp loc to a2 + mov (0,a2),sp # load SP with new value + movm (sp),SAVE_REGS # load all registers + add 8,sp # skip SP & PSW, we never restore them. + ret [],0 + +##----------------------------------------------------------------------------- +## HAL longjmp(), setjmp() implementations +## These implementations omit the usual movm [d2,d3,a2,a3],(sp) +## Which is the first instruction of all C compiled functions. + + # This just preserves the callee save registers + # namely a2,a3,d2,d3 + # setjmp cannot use movm to do this as we need to keep + # the sp underneath all live data at all times. + .globl _hal_setjmp +_hal_setjmp: # d0=env + mov d0,a0 # env + mov d2,(4,a0) + mov d3,(8,a0) + mov a2,(12,a0) + mov a3,(16,a0) + mov mdr,d1 # link saved by call (also in (0,sp)) + mov d1,(20,a0) + mov sp,a1 + mov a1,(0,a0) # a1==(caller''s sp) + clr d0 # return 0 + ret [],0 + + # longjmp returns to caller of setjmp + # after restoring callee save registers + .globl _hal_longjmp +_hal_longjmp: + mov d0,a0 + mov (4,a0),d2 + mov (8,a0),d3 + mov (12,a0),a2 + mov (16,a0),a3 + mov (20,a0),d0 +## mov d0,mdr + mov (0,a0),a1 # stashed (caller''s sp) + mov a1,sp + mov d0,(0,sp) # put link on stack + mov d1,d0 # return arg1 + ret [],0 # this ignores (0,sp) and does pc=mdr + + +#------------------------------------------------------------------------------ +# end of context.S + + \ No newline at end of file diff --git a/packages/hal/mn10300/arch/current/src/hal_misc.c b/packages/hal/mn10300/arch/current/src/hal_misc.c new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/src/hal_misc.c @@ -0,0 +1,211 @@ +/*============================================================================= +// +// hal_misc.c +// +// HAL miscellaneous functions +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-11-12 +// Purpose: HAL miscellaneous functions +// Description: This file contains miscellaneous functions provided by the +// HAL. +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include + +#include + +#include + +#include + +/*---------------------------------------------------------------------------*/ + +void +cyg_hal_invoke_constructors (void) +{ + typedef void (*pfunc) (void); + extern pfunc _CTOR_LIST__[]; + extern pfunc _CTOR_END__[]; + pfunc *p; + +#ifdef CYG_KERNEL_USE_INIT_PRIORITY + for (p = &_CTOR_END__[-1]; p >= _CTOR_LIST__; p--) + (*p) (); +#else + for (p = _CTOR_LIST__; p != _CTOR_END__; p++) + (*p) (); +#endif + +#ifdef CYG_HAL_MN10300_STDEVAL1 + + // On the real hardware we also enable the cache. + // doing this here is a temporary measure until we + // have a proper platform specific place to do it. + + // Note that the hardware seems to come up with the + // caches containing random data. Hence they must be + // invalidated before being enabled. + + HAL_ICACHE_INVALIDATE_ALL(); + HAL_ICACHE_ENABLE(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_DCACHE_ENABLE(); + +#endif + +#if defined(CYGFUN_HAL_COMMON_KERNEL_SUPPORT) && \ + defined(CYG_HAL_USE_ROM_MONITOR) && \ + defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + { + extern CYG_ADDRESS hal_virtual_vector_table[32]; + extern void patch_dbg_syscalls(void * vector); +#define DBG_SYSCALL_VEC_NUM 15 + patch_dbg_syscalls( (void *)(&hal_virtual_vector_table[DBG_SYSCALL_VEC_NUM]) ); + } +#endif + +} + +/*---------------------------------------------------------------------------*/ +/* Determine the index of the ls bit of the supplied mask. */ + +cyg_uint32 hal_lsbit_index(cyg_uint32 mask) +{ + cyg_uint32 n = mask; + + static const signed char tab[64] = + { -1, 0, 1, 12, 2, 6, 0, 13, 3, 0, 7, 0, 0, 0, 0, 14, 10, + 4, 0, 0, 8, 0, 0, 25, 0, 0, 0, 0, 0, 21, 27 , 15, 31, 11, + 5, 0, 0, 0, 0, 0, 9, 0, 0, 24, 0, 0 , 20, 26, 30, 0, 0, 0, + 0, 23, 0, 19, 29, 0, 22, 18, 28, 17, 16, 0 + }; + + n &= ~(n-1UL); + n = (n<<16)-n; + n = (n<<6)+n; + n = (n<<4)+n; + + return tab[n>>26]; +} + +/*---------------------------------------------------------------------------*/ +/* Determine the index of the ms bit of the supplied mask. */ + +cyg_uint32 hal_msbit_index(cyg_uint32 mask) +{ + cyg_uint32 x = mask; + cyg_uint32 w; + + /* Phase 1: make word with all ones from that one to the right */ + x |= x >> 16; + x |= x >> 8; + x |= x >> 4; + x |= x >> 2; + x |= x >> 1; + + /* Phase 2: calculate number of "1" bits in the word */ + w = (x & 0x55555555) + ((x >> 1) & 0x55555555); + w = (w & 0x33333333) + ((w >> 2) & 0x33333333); + w = w + (w >> 4); + w = (w & 0x000F000F) + ((w >> 8) & 0x000F000F); + return (cyg_uint32)((w + (w >> 16)) & 0xFF); + +} + +/*---------------------------------------------------------------------------*/ +/* First level C exception handler. */ + +void exception_handler(HAL_SavedRegisters *regs) +{ + // We should decode the vector and pass a more appropriate + // value as the second argument. For now we simply pass a + // pointer to the saved registers. We should also divert + // breakpoint and other debug vectors into the debug stubs. + +#if defined(CYGFUN_HAL_COMMON_KERNEL_SUPPORT) + + CYG_WORD vector = regs->vector; + + if( vector == 0 ) + { + // An NMI vector, decode it from the NMIGR + + cyg_uint32 nmigr = mn10300_interrupt_control[0]; + + // Write back to clear interrupt bits + mn10300_interrupt_control[0] = nmigr; + + if( nmigr & 0x0002 ) + { + // Special case the watchdog timer exception, look for an + // ISR for it and call it if present. Otherwise pass on to + // the exception system. + + cyg_uint32 (*isr)(CYG_ADDRWORD,CYG_ADDRWORD); + cyg_uint32 index; + + HAL_TRANSLATE_VECTOR( CYG_VECTOR_WATCHDOG, index ); + + isr = (cyg_uint32 (*)(CYG_ADDRWORD,CYG_ADDRWORD)) + (hal_interrupt_handlers[index]); + + if( isr != 0 ) + { + isr(CYG_VECTOR_WATCHDOG, + hal_interrupt_data[CYG_VECTOR_WATCHDOG] + ); + return; + } + vector = CYG_VECTOR_WATCHDOG; + } + // Check for system error + else if( nmigr & 0x0004 ) vector = CYG_VECTOR_SYSTEM_ERROR; + + // otherwise it is an NMI and vector is correct. + } + +#if defined(CYGPKG_HAL_EXCEPTIONS) + + deliver_exception( vector, (CYG_ADDRWORD)regs ); + +#endif + +#endif + + return; +} + +/*---------------------------------------------------------------------------*/ +/* End of hal_misc.c */ diff --git a/packages/hal/mn10300/arch/current/src/vectors.S b/packages/hal/mn10300/arch/current/src/vectors.S new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/src/vectors.S @@ -0,0 +1,698 @@ +##============================================================================= +## +## vectors.S +## +## MN10300 exception vectors +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1997-10-16 +## Purpose: MN10300 exception vectors +## Description: This file defines the code placed into the exception +## vectors. It also contains the first level default VSRs +## that save and restore state for both exceptions and +## interrupts. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +#ifdef CYGPKG_KERNEL + +#include + +#endif + + .extern _cyg_instrument + + +##----------------------------------------------------------------------------- +## Register addresses and initialization values + + .equ IOBCTR ,0x32000010 + .equ MEMCTR0 ,0x32000020 + .equ MEMCTR1 ,0x32000022 + .equ MEMCTR2 ,0x32000024 + .equ MEMCTR3 ,0x32000026 + .equ MEMCTR4 ,0x32000028 + .equ MEMCTR5 ,0x3200002a + .equ MEMCTR6 ,0x3200002c + .equ MEMCTR7 ,0x3200002e + .equ DRAMCTR ,0x32000040 + .equ REFCNT ,0x32000042 + +#ifdef CYG_HAL_MN10300_STDEVAL1 + .equ INIT_MEMCTR0,0x1200 # 2wait + .equ INIT_MEMCTR1,0x0120 # 1wait-32bit- + .equ INIT_MEMCTR2,0x0065 + .equ INIT_DRAMCTR,0x0287 + .equ INIT_REFCNT,0x00eb +#endif + + .equ P2OUT ,0x36008004 + .equ P2MD ,0x36008024 + .equ P2SS ,0x36008044 + .equ P2DIR ,0x36008064 + + .equ INIT_P2MD,0xf0 + .equ INIT_P2DIR,0xff + +##----------------------------------------------------------------------------- + + .macro led val + movm [d2],(sp) + mov \val,d2 + asl 4,d2 + movbu d2,(P2OUT) + movm (sp),[d2] + .endm + + +##----------------------------------------------------------------------------- + + .file "vectors.S" + +##----------------------------------------------------------------------------- + + .section ".vectors","ax" + + .globl reset_vector + +reset_vector: + # Reset vector + jmp _start + + .p2align 3 + + # NMI vector + jmp __nmi + + .p2align 3 + + # Trap vector + jmp __trap + +##----------------------------------------------------------------------------- +## NMI vector + + .globl __nmi +__nmi: + add -4,sp # space for SP + movm [d2,d3,a2,a3,other],(sp) # push all registers + mov (_hal_vsr_table+28),a0 + jmp (a0) + +##----------------------------------------------------------------------------- +## Trap vector + + .globl __trap +__trap: + add -8,sp # space for SP and PSW + movm [d2,d3,a2,a3,other],(sp) # push all registers + mov (_hal_vsr_table+32),a0 + jmp (a0) + +##----------------------------------------------------------------------------- +## Macro to define a hardware VSR + + .macro hardware_vector name + .globl __hardware_vector_\name +__hardware_vector_\name: + add -4,sp # space for SP + movm [d2,d3,a2,a3,other],(sp) # push all registers + mov \name,d0 # d0 = vector id + mov d0,(0,sp) # save in dummy stack loc + mov _hal_vsr_table,a0 # a0 = vsr table + add \name<<2,a0 # a0 = &required vsr + mov (a0),a0 # a0 = required vsr + jmp (a0) # go there + .endm + +##----------------------------------------------------------------------------- +## Hardware Vectors. These are pointed to by the registers in +## mn10300_interrupt_vectors and must be in the range 0x4000XXXX. + + hardware_vector 0 + hardware_vector 1 + hardware_vector 2 + hardware_vector 3 + hardware_vector 4 + hardware_vector 5 + hardware_vector 6 + +##----------------------------------------------------------------------------- +## Startup code + + .text + + .globl _start +_start: + +#if defined(CYG_HAL_MN10300_STDEVAL1) + mov INIT_MEMCTR0,d2 + movhu d2,(MEMCTR0) + + mov INIT_MEMCTR1,d2 + movhu d2,(MEMCTR1) + + mov INIT_MEMCTR2,d2 + movhu d2,(MEMCTR2) + + mov INIT_REFCNT,d2 + movhu d2,(REFCNT) + + mov INIT_DRAMCTR,d2 + movhu d2,(DRAMCTR) + + # Set up LED + + mov INIT_P2MD,d2 + movbu d2,(P2MD) + + mov INIT_P2DIR,d2 + movbu d2,(P2DIR) + + +#endif + + # Set up the PSW + + mov 0x0700,d0 + mov d0,psw + + # set up stack + + mov __interrupt_stack,a0 + sub 8,a0 + mov a0,sp + +#ifdef CYG_HAL_STARTUP_ROM + + # Copy data from ROM to RAM + + mov __rom_data_start,a0 + mov __ram_data_end,a1 + mov __ram_data_start,a2 + + cmp a2,a1 + beq 8f +1: + movbu (a0),d0 + movbu d0,(a2) + inc a0 + inc a2 + cmp a2,a1 + bne 1b +8: + +#endif + + # Clear BSS + mov __bss_start,a0 + mov _end,a1 + + cmp a0,a1 + beq 8f + clr d0 +1: + movbu d0,(a0) + inc a0 + cmp a0,a1 + bne 1b +8: + # Install interrupt vectors + +#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_MN10300_SIM) + mov _mn10300_interrupt_vectors,a0 + mov __hardware_vector_0,d0 + movhu d0,(0,a0) + mov __hardware_vector_1,d0 + movhu d0,(4,a0) + mov __hardware_vector_2,d0 + movhu d0,(8,a0) + mov __hardware_vector_3,d0 + movhu d0,(12,a0) + mov __hardware_vector_4,d0 + movhu d0,(16,a0) + mov __hardware_vector_5,d0 + movhu d0,(20,a0) + mov __hardware_vector_6,d0 + movhu d0,(24,a0) +#endif +#if defined(CYG_HAL_STARTUP_RAM) && !defined(CYG_HAL_MN10300_SIM) + + # init vsr table in SRAM where the ROM + # vectors the interrupts. + + mov _hal_vsr_table,a0 + mov __default_interrupt_vsr,d0 + mov d0,(0,a0) + mov d0,(4,a0) + mov d0,(8,a0) +#ifndef CYG_HAL_USE_ROM_MONITOR_CYGMON + # When using Cygmon, leave level 3 for GDB + # Ctrl-C interrupts. + mov d0,(12,a0) +#endif + mov d0,(16,a0) + mov d0,(20,a0) + mov d0,(24,a0) + mov __default_nmi_vsr,d0 + mov d0,(28,a0) + mov __default_trap_vsr,d0 + mov d0,(32,a0) +#endif + + # Call constructors + + .extern _cyg_hal_invoke_constructors + call _cyg_hal_invoke_constructors,[],0 + + # Call cyg_start + clr d0 + mov d0,(4,sp) + + .extern _cyg_start + call _cyg_start,[],0 + +9: + bra 9b # Loop if we return + +##----------------------------------------------------------------------------- +## Debug code to count interrupts on the led. + +#ifdef CYG_HAL_MN10300_STDEVAL1 + + .macro show_interrupts + mov (led_count),d1 + inc d1 +# cmp 20000,d1 +# ble 2f + mov 0,d1 + movbu (led_value),d0 + movbu d0,(P2OUT) + add 16,d0 + cmp 0x90,d0 + bne 1f + mov 0,d0 +1: + movbu d0,(led_value) +2: + mov d1,(led_count) + .endm + +#else + + .macro show_interrupts + .endm + +#endif + +##----------------------------------------------------------------------------- +## The following macros are defined depending on whether the HAL is configured +## to support the kernel or not. + +#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT + + .extern __18Cyg_Scheduler_Base.sched_lock + + # Increment the scheduler lock + + .macro increment_sched_lock reg=d0 + mov (__18Cyg_Scheduler_Base.sched_lock),\reg + inc \reg + mov \reg,(__18Cyg_Scheduler_Base.sched_lock) + .endm + +#else + + .macro increment_sched_lock reg=d0 + .endm + +#endif + +##----------------------------------------------------------------------------- +## The following macros are defined depending on whether the Interrupt +## system is using isr tables or chaining. + +#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN + +#define CYG_ISR_TABLE_SIZE 7 + +#if defined(CYG_HAL_MN10300_MN103000) + + # decode the interrupt + .macro decode_interrupt dreg,areg,dreg1 + mov _mn10300_interrupt_control,\areg + movhu (0x100,\areg),\dreg # dreg = IAGR + movhu (\dreg,\areg),\dreg1 # dreg1 = IGR[dreg] + and 0xf,\dreg1 # dreg1 = ID0..3 + mov hal_lsbit_table,\areg # areg = ls bit table + movbu (\dreg1,\areg),\dreg1 # dreg1 = ls bit index + add \dreg,\dreg1 # dreg1 = word index of isr + mov (0,a2),\dreg # dreg = vector priority + mov \dreg1,(0,a2) # store real vector in saved state + asl 2,\dreg # dreg = byte index of isr + .endm + +#elif defined(CYG_HAL_MN10300_MN103002) + + # decode the interrupt + .macro decode_interrupt dreg,areg,dreg1 + mov _mn10300_interrupt_control,\areg + movhu (0x100,\areg),\dreg1 # dreg1 = IAGR + mov (0,a2),\dreg # dreg = vector priority + mov \dreg1,(0,a2) # store real vector in saved state + asl 2,\dreg # dreg = byte index of isr + .endm + +#endif + +#else + +#if defined(CYG_HAL_MN10300_MN103000) + +#define CYG_ISR_TABLE_SIZE 100 + + # decode the interrupt + .macro decode_interrupt dreg,areg,dreg1 + mov _mn10300_interrupt_control,\areg + movhu (0x100,\areg),\dreg # dreg = IAGR + movhu (\dreg,\areg),\dreg1 # dreg1 = IGR[dreg] + and 0xf,\dreg1 # dreg1 = ID0..3 + mov hal_lsbit_table,\areg # areg = ls bit table + movbu (\dreg1,\areg),\dreg1 # dreg1 = ls bit index + add \dreg1,\dreg # dreg = word index of isr + mov \dreg,(0,a2) # store real vector in saved state + asl 2,\dreg # dreg = byte index of isr + .endm + + +#elif defined(CYG_HAL_MN10300_MN103002) + +#define CYG_ISR_TABLE_SIZE 34 + + # decode the interrupt + .macro decode_interrupt dreg,areg,dreg1 + mov _mn10300_interrupt_control,\areg + movhu (0x100,\areg),\dreg # dreg = IAGR + mov \dreg,(0,a2) # store real vector in saved state + add 12,\dreg # skip NMI vectors + .endm + +#endif + +#endif + +##----------------------------------------------------------------------------- +## Default interrupt VSR + + .text + .globl __default_interrupt_vsr +__default_interrupt_vsr: + + # We come here with all the registers pushed + # onto the stack. + + increment_sched_lock + +#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK + # Increment interrupt nesting counter + mov __interrupt_stack,a0 # A0 = interrupt stack top + mov sp,a2 # A2 = SP + cmp __interrupt_stack_base,a2 # compare with base of stack + blt 1f # if lt switch to int stack + cmp a0,a2 # compare sp with stack top + ble 8f # if le already on istack +1: + mov a0,sp # switch to new SP +8: + movm [a2],(sp) # save old SP + +#else + mov sp,a2 # A2 = saved thread state +#endif + + # Here A2 -> saved thread state on the threads own + # stack. We will be executing either on the same stack + # or on the interrupt stack, depending on config options. + + decode_interrupt d3,a3,d0 + + # Here D3 contains the table byte offset of the vector to + # call. On the MN103000 this needs to be shifted right by + # two to derive the vector. On the MN103002 this correponds + # exactly to the vector used to attach it. + +#if defined(CYGPKG_KERNEL_INSTRUMENT) && defined(CYGDBG_KERNEL_INSTRUMENT_INTR) + + # Call cyg_instrument to record that this interrupt is being raised. + + add -16,sp # make space for return link + args + mov 0x0301,d0 # d0 = type = INTR,RAISE + mov (0,a2),d1 # d1 = arg1 = vector + mov d3,(12,sp) # (12,sp) = arg2 = table offset + calls _cyg_instrument # call instrumentation + add 16,sp # pop space + +#endif + +#ifdef CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING + + # To allow nested interrupts, we set the IE bit. We do + # not touch the IPL bits, so only higher priority interrupts + # will be nested on top of us. Also, new interrupts will not + # be delivered until the ISR calls + # Cyg_Interrupt::acknowledge_interrupt(). At some future point + # we may want to do the ack stuff here to allow immediate nesting. + + or 0x0800,psw + +#endif + mov _hal_interrupt_handlers,a0 # a0 = isr table + mov (d3,a0),a0 # a0 = isr + + mov _hal_interrupt_data,a1 # a1 = data table + mov (d3,a1),d1 # d1 = isr data + + mov (0,a2),d0 # d0 = vector. (d3 is... + # ...adjusted for table reads) +#if defined(CYG_HAL_MN10300_MN103000) + lsr 2,d0 # d0 = vector number +#endif + add -16,sp # make space for return link + + calls (a0) # call isr + + # on return d0 bit 1 will indicate whether a DSR is + # to be posted. Pass this together with a pointer to + # the interrupt object we have just used to the + # interrupt tidy up routine. + + # D3 is defined to be saved across procedure calls, and + # should still contain the vector byte index. Similarly, + # A2 should still point to the saved machine state. + +#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK + + # If we are returning from the last nested interrupt, move back + # to the thread stack. interrupt_end() must be called on the + # thread stack since it potentially causes a context switch. + + add 16,sp # pop call frame from int stack + movm (sp),[a3] # pop old sp + mov a3,sp # put in SP + + add -16,sp # make call frame for call + +#endif + +#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT + + # We only need to call _interrupt_end() when there is a kernel + # present to do any tidying up. + + # Using the vector offset in D3, get the interrupt object pointer + # into D1. + mov _hal_interrupt_objects,a0 # a0 = object table + mov (d3,a0),d1 # d1 = object + + # Even when this is not the last nested interrupt, we must call + # _interrupt_end() to post the DSR and decrement the scheduler + # lock. + + # interrupt_end must be called with interrupts enabled. + # At this point we restore the PSW of the code we interrupted + # to get the IPL bits back. By definition this PSW must have + # interrupts enabled. + mov (52,a2),d2 + + mov d2,psw + + mov a2,(12,sp) # arg3 = saved state. + + calls _interrupt_end # call interrupt end fn +#endif + + add 16,sp # pop return link + + show_interrupts + + movm (sp),[d2,d3,a2,a3,other] # pop regs + add 4,sp + rti # and return + +hal_lsbit_table: + .byte 0, 0, 1, 0 + .byte 2, 0, 1, 0 + .byte 3, 0, 1, 0 + .byte 2, 0, 1, 0 + + +##----------------------------------------------------------------------------- +## Default NMI VSR + + .globl _exception_handler + + .text + .globl __default_nmi_vsr +__default_nmi_vsr: + + # We come here with all the registers saved + # on the stack. + + mov sp,a1 # a1 = saved state + mov a1,d0 # d0 = arg1 = saved state + + add -16,sp # return link + args + mov 0,d1 # 0 == NMI trap + mov d1,(16,sp) # save in spare save slot + + calls _exception_handler # call C code + add 16,sp # pop args + movm (sp),[d2,d3,a2,a3,other] # pop all registers + add 4,sp + rti + +##----------------------------------------------------------------------------- +## Default TRAP VSR + + .text + .globl __default_trap_vsr +__default_trap_vsr: + + # We come here with all the registers saved + # on the stack. + + add -8,sp # return link + arg + mov 3,d1 # 3 == TRAP trap + mov d1,(0,sp) # save in spare save slot + calls _exception_handler # call C code + add 8,sp # pop args + movm (sp),[d2,d3,a2,a3,other] # pop all registers + add 4,sp + rets + +##----------------------------------------------------------------------------- +## VSR table. The VSRs pointed to by this table are called from the stubs +## connected to the hardware. + +#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_MN10300_SIM) + + .data + + .globl _hal_vsr_table +_hal_vsr_table: + .long __default_interrupt_vsr + .long __default_interrupt_vsr + .long __default_interrupt_vsr + .long __default_interrupt_vsr + .long __default_interrupt_vsr + .long __default_interrupt_vsr + .long __default_interrupt_vsr + .long __default_nmi_vsr + .long __default_trap_vsr + +#endif + +##----------------------------------------------------------------------------- +## Interrupt tables + + .section ".bss" + + .globl _hal_interrupt_handlers +_hal_interrupt_handlers: + .rept CYG_ISR_TABLE_SIZE + .long 0 + .endr + + .globl _hal_interrupt_data +_hal_interrupt_data: + .rept CYG_ISR_TABLE_SIZE + .long 0 + .endr + + .globl _hal_interrupt_objects +_hal_interrupt_objects: + .rept CYG_ISR_TABLE_SIZE + .long 0 + .endr + + +##----------------------------------------------------------------------------- +## Temporary interrupt stack + + .section ".bss" + + .balign 16 +__interrupt_stack_base: + .rept CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE + .byte 0 + .endr + .balign 16 +__interrupt_stack: + + .long 0,0,0,0,0,0,0,0 + +##----------------------------------------------------------------------------- + +#ifdef CYG_HAL_MN10300_STDEVAL1 + .data +## Keep alignment to work around compiler/linker bug +led_count: .long 0 +led_value: .byte 0x40 +led_foo1: .byte 0x00 +led_foo2: .byte 0x00 +led_foo3: .byte 0x00 +#endif + +##----------------------------------------------------------------------------- +## end of vectors.S + diff --git a/packages/hal/mn10300/arch/current/tests/PKGconf.mak b/packages/hal/mn10300/arch/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/arch/current/tests/PKGconf.mak @@ -0,0 +1,38 @@ +#=============================================================================== +# +# makefile +# +# hal/mn10300/arch/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal_mn10300 +include ../../../../../pkgconf/pkgconf.mak + +TESTS := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + diff --git a/packages/hal/mn10300/sim/current/ChangeLog b/packages/hal/mn10300/sim/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/ChangeLog @@ -0,0 +1,88 @@ +1998-10-23 Jesper Skov + + * include/pkgconf/hal_mn10300_sim.h: Allow wallclock and watchdog + devices to be configured. + +1998-10-19 Jesper Skov + + * include/pkgconf/hal_mn10300_sim.h: Undid 1998-10-16 change. + +1998-10-16 Jesper Skov + + * include/pkgconf/hal_mn10300_sim.h: Changed + CYGPKG_HAL_MN10300_SIM to CYG_HAL_MN10300_SIM. + +1998-09-22 Bart Veer + + * include/pkgconf/hal_mn10300_sim.h: + Preclude the gdb pseudo device as well as all the other devices. + This allows the configuration tool to do a better job when + switching from hardware to simulator. + +1998-09-11 Bart Veer + + * include/pkgconf/hal_mn10300_sim.h: + Updated configuration information with a description and + some requires. + +Thu Sep 3 15:15:57 1998 Tim Goodwin + + * hal/mn10300/sim/current/src/PKGconf.mak + * hal/mn10300/sim/current/src/makefile + * hal/mn10300/sim/current/tests/PKGconf.mak + + s/panx/mn10300/g + +1998-09-02 Bart Veer + + * include/pkgconf/hal_mn10300_sim.h: + New header file for platform-specific configuration options + + * tests/PKGconf.mak: + * src/PKGconf.mak: + Sort out package naming conventions. + +Wed Aug 19 18:45:44 1998 Jonathan Larmour + + * src/hal_diag.c (hal_diag_init): + Put void into function prototype argument list to silence warning + +1998-08-18 Nick Garnett + + * include/hal_diag.h: + * src/hal_diag.c: + * src/sim.ld: + Now uses hal.h rather than kernel.h. + +Tue Aug 18 11:45:25 1998 Jonathan Larmour + + * src/sim.ld: Reorder GROUP line + +Mon Aug 17 22:21:34 1998 Jonathan Larmour + + * src/sim.ld: + Add GROUP(libgcc.a libtarget.a) to prevent need for explicit linking + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/mn10300/sim/current/include/hal_diag.h b/packages/hal/mn10300/sim/current/include/hal_diag.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/include/hal_diag.h @@ -0,0 +1,94 @@ +#ifndef CYGONCE_HAL_HAL_DIAG_H +#define CYGONCE_HAL_HAL_DIAG_H + +/*============================================================================= +// +// hal_diag.h +// +// HAL Support for Kernel Diagnostic Routines +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL Support for Kernel Diagnostic Routines +// Description: Diagnostic routines for use during kernel development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include + +/*---------------------------------------------------------------------------*/ +/* Register addresses */ + +#define PAL_RESET 0x00 +#define PAL_CPU_NR 0x04 +#define PAL_INT 0x08 +#define PAL_NR_CPU 0x0a + +#define PAL_READ_FIFO 0x10 +#define PAL_READ_STATUS 0x14 +#define PAL_WRITE_FIFO 0x18 +#define PAL_WRITE_STATUS 0x1a + +#define OEA_DEV 0x31000000 + +/*---------------------------------------------------------------------------*/ + +#define HAL_DIAG_INIT() + +#define HAL_DIAG_WRITE_CHAR(_c_) \ +{ \ + volatile unsigned char *tty_buffer = \ + (unsigned char*)(OEA_DEV + PAL_WRITE_FIFO); \ + volatile unsigned char *tty_status = \ + (unsigned char*)(OEA_DEV + PAL_WRITE_STATUS); \ + if( _c_ != '\r' ) \ + { \ + while( *tty_status == 0 ) continue; \ + *tty_buffer = _c_; \ + } \ +} + +#define HAL_DIAG_READ_CHAR(_c_) \ +{ \ + volatile unsigned char *tty_buffer = \ + (unsigned char*)(OEA_DEV + PAL_READ_FIFO); \ + volatile unsigned char *tty_status = \ + (unsigned char*)(OEA_DEV + PAL_READ_STATUS); \ + while( *tty_status == 0 ) continue; \ + _c_ = *tty_buffer; \ +} + +/*---------------------------------------------------------------------------*/ +/* end of hal_diag.h */ +#endif /* CYGONCE_HAL_HAL_DIAG_H */ diff --git a/packages/hal/mn10300/sim/current/include/pkgconf/hal_mn10300_sim.h b/packages/hal/mn10300/sim/current/include/pkgconf/hal_mn10300_sim.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/include/pkgconf/hal_mn10300_sim.h @@ -0,0 +1,68 @@ +#ifndef CYGONCE_PKGCONF_HAL_MN10300_SIM_H +#define CYGONCE_PKGCONF_HAL_MN10300_SIM_H +// ==================================================================== +// +// pkgconf/hal_mn10300_sim.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_MN10300_SIM { + display "Minimal simulator" + type radio + parent CYGPKG_HAL_MN10300 + platform sim + requires !CYGPKG_DEVICES_GDB + requires !CYGPKG_DEVICES_SERIAL_RS232_COMMON + requires !CYGPKG_DEVICES_SERIAL_RS232_MN10300 + description " + The minimal simulator HAL package is provided for use when + only a simple simulation of the processor architecture is + desired, as opposed to detailed simulation of any specific + board. In particular it is not possible to simulate any of + the I/O devices, so device drivers cannot be used." + } + + }}CFG_DATA */ + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_MN10300_SIM_H */ +/* EOF hal_mn10300_sim.h */ diff --git a/packages/hal/mn10300/sim/current/src/PKGconf.mak b/packages/hal/mn10300/sim/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/src/PKGconf.mak @@ -0,0 +1,56 @@ +#=============================================================================== +# +# makefile +# +# hal/mn10300/sim/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal_mn10300_sim +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := hal_diag.c sim.S +OTHER_OBJS := +OTHER_TARGETS := ldscript.stamp +OTHER_CLEAN := ldscript.clean +OTHER_DEPS := ldscript.d + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + +.PHONY: ldscript.clean + +ldscript.stamp: sim.ld + $(CC) -E -P -Wp,-MD,ldscript.tmp -xc $(INCLUDE_PATH) $(CFLAGS) -o $(PREFIX)/lib/target.ld $< + @echo -e "\n$@ : $< \\" > ldscript.d + @tail -n +2 ldscript.tmp >> ldscript.d + @rm ldscript.tmp + $(TOUCH) $@ + +ldscript.clean: + $(RM) -f $(PREFIX)/lib/target.ld + $(RM) -f ldscript.stamp + + diff --git a/packages/hal/mn10300/sim/current/src/hal_diag.c b/packages/hal/mn10300/sim/current/src/hal_diag.c new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/src/hal_diag.c @@ -0,0 +1,58 @@ +/*============================================================================= +// +// hal_diag.c +// +// HAL diagnostic output code +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-13 +// Purpose: HAL diagnostic output +// Description: Implementations of HAL diagnostic output support. +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include + +// diag channel implemented in header file on the MN10300 simulator + +void hal_diag_init(void) +{ +} + +void hal_diag_write_char(char c) +{ +} + +/*===========================================================================*/ +/* EOF hal_diag.c */ + diff --git a/packages/hal/mn10300/sim/current/src/sim.S b/packages/hal/mn10300/sim/current/src/sim.S new file mode 100644 diff --git a/packages/hal/mn10300/sim/current/src/sim.ld b/packages/hal/mn10300/sim/current/src/sim.ld new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/src/sim.ld @@ -0,0 +1,106 @@ +STARTUP(vectors.o) +ENTRY(reset_vector) + +GROUP(libtarget.a libgcc.a) + +#include + +#define LOAD_BASE 0x40000000 +#define DATA_BASE + +SECTIONS +{ + + /* Start of ROM */ + . = LOAD_BASE; + + .rom_vectors : + { + KEEP(*(.vectors)) + } + + .text : + { + _stext = .; + *(.text*) + *(.gnu.warning) + *(.gnu.linkonce*) + *(.init) + + } + _etext = .; + PROVIDE (etext = .); + .fini : { *(.fini) } + .rodata : { *(.rodata*) } + .rodata1 : { *(.rodata1) } + .fixup : { *(.fixup) } + .gcc_except_table : { *(.gcc_except_table) } + + __rom_data_start = ALIGN(4); + .data DATA_BASE : + AT( __rom_data_start ) + { + __ram_data_start = .; + *(.data*) + *(.data1) + _GOT1_START_ = .; + *(.got1) + _GOT1_END_ = .; + /* Put .ctors and .dtors next to the .got2 section, so that the pointers + get relocated with -mrelocatable. */ + _GOT2_START_ = .; + *(.got2) + _GOT2_END_ = .; + . = ALIGN(4); +#ifdef CYG_KERNEL_USE_INIT_PRIORITY + __CTOR_LIST__ = .; + KEEP(*(SORT(.ctors*))) + __CTOR_END__ = .; + __DTOR_LIST__ = .; + KEEP(*(SORT(.dtors*))) + __DTOR_END__ = .; +#else + __CTOR_LIST__ = .; + KEEP(*sched.o(.ctors*)) + KEEP(*clock.o(.ctors*)) + KEEP(*thread.o(.ctors*)) + KEEP(*(.ctors*)) + __CTOR_END__ = .; + __DTOR_LIST__ = .; + KEEP(*(.dtors)) + __DTOR_END__ = .; +#endif + _GOT_START_ = .; + _GLOBAL_OFFSET_TABLE_ = . + 32768; + _SDA_BASE_ = .; + *(.got.plt) + *(.got) + _GOT_END_ = .; + *(.dynamic) + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + *(.sdata*) + *(.sbss*) + } + __ram_data_end = .; + PROVIDE( __ram_data_end = .); + _edata = .; + PROVIDE (edata = .); + . = ALIGN(4); + __bss_start = .; + .bss : + { + *(.scommon) + *(.dynbss) + *(.bss) + *(COMMON) + } + . = ALIGN(4); + _end = . ; + PROVIDE (end = .); + +} + +_mn10300_interrupt_control = 0x34000100; +_mn10300_interrupt_vectors = 0x20000000; diff --git a/packages/hal/mn10300/sim/current/tests/PKGconf.mak b/packages/hal/mn10300/sim/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/sim/current/tests/PKGconf.mak @@ -0,0 +1,38 @@ +#=============================================================================== +# +# makefile +# +# hal/mn10300/sim/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal_mn10300_sim +include ../../../../../pkgconf/pkgconf.mak + +TESTS := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + diff --git a/packages/hal/mn10300/stdeval1/current/ChangeLog b/packages/hal/mn10300/stdeval1/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/stdeval1/current/ChangeLog @@ -0,0 +1,116 @@ +1998-10-19 Jesper Skov + + * include/pkgconf/hal_mn10300_stdeval1.h: Undid 1998-10-16 change. + +1998-10-16 Jesper Skov + + * include/pkgconf/hal_mn10300_stdeval1.h: Changed + CYGPKG_HAL_MN10300_STDEVAL1 to CYG_HAL_MN10300_STDEVAL1. + +1998-10-14 Nick Garnett + + * src/hal_diag.c: + Removed some compiler warnings. + +1998-10-13 Nick Garnett + + * src/stdeval1.ld: + Moved RAM load address to 0x80008000. + +Mon Oct 12 18:03:12 1998 Jonathan Larmour + + * include/hal_diag.h: + Add void arg to prototype for hal_diag_init() + Fix for PR 17309 + +Wed Sep 23 08:11:32 1998 Jonathan Larmour + + * include/hal_diag.h: + Add HAL_DIAG_READ_CHAR() macro for consistency with other targets + since we do have the hal_diag_read_char() function. + Fix for PR 17300 + +1998-09-11 Bart Veer + + * include/pkgconf/hal_mn10300_stdeval1.h: + Updated configuration data with some descriptions. + +1998-09-09 Nick Garnett + + * src/stdeval1.ld: + Added definition of hal_virtual_vector_table. + + * src/hal_diag.c: + Added configury to allow PROMIce AI ROMART to be used + independently of diag destination. Added ai_write_hex() to provide + rudimentary support for numerical output when doing this. + +1998-09-04 Bart Veer + + * include/pkgconf/hal_mn10300_stdeval1.h: + Temporary change to the type of the startup option, needed by the + configuration tool. + +Thu Sep 3 15:15:57 1998 Tim Goodwin + + * hal/mn10300/stdeval1/current/src/PKGconf.mak + * hal/mn10300/stdeval1/current/src/makefile + * hal/mn10300/stdeval1/current/tests/PKGconf.mak + + s/panx/mn10300/g + +1998-09-02 Bart Veer + + * include/pkgconf/hal_mn10300_stdeval1.h: + New header file for platform-specific configuration options + + * tests/PKGconf.mak: + * src/PKGconf.mak: + Sort out package naming conventions. + +1998-09-02 Nick Garnett + + * src/hal_diag.c: + Fixed some compiler warnings. + Ifdeffed out intialisation of serial2 when using cygmon, thus + retaining Cygmon's line setup. + +1998-08-18 Nick Garnett + + * include/hal_diag.h: + * src/hal_diag.c: + * src/stdeval1.ld: + Now uses hal.h rather than kernel.h. + +Tue Aug 18 11:46:14 1998 Jonathan Larmour + + * src/stdeval1.ld: Reorder GROUP line + +Mon Aug 17 22:20:05 1998 Jonathan Larmour + + * src/stdeval1.ld: + Add GROUP(libgcc.a libtarget.a) to prevent need for explicit linking + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/mn10300/stdeval1/current/include/hal_diag.h b/packages/hal/mn10300/stdeval1/current/include/hal_diag.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/stdeval1/current/include/hal_diag.h @@ -0,0 +1,69 @@ +#ifndef CYGONCE_HAL_HAL_DIAG_H +#define CYGONCE_HAL_HAL_DIAG_H + +/*============================================================================= +// +// hal_diag.h +// +// HAL Support for Kernel Diagnostic Routines +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL Support for Kernel Diagnostic Routines +// Description: Diagnostic routines for use during kernel development. +// Usage: #include "cyg/hal/hal_diag.h" +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include + +/*---------------------------------------------------------------------------*/ +/* functions implemented in hal_diag.c */ + +externC void hal_diag_init(void); + +externC void hal_diag_write_char(char c); + +externC void hal_diag_read_char(char *c); + +/*---------------------------------------------------------------------------*/ + +#define HAL_DIAG_INIT() hal_diag_init() + +#define HAL_DIAG_WRITE_CHAR(_c_) hal_diag_write_char(_c_) + +#define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_) + +/*---------------------------------------------------------------------------*/ +/* end of hal_diag.h */ +#endif /* CYGONCE_HAL_HAL_DIAG_H */ diff --git a/packages/hal/mn10300/stdeval1/current/include/pkgconf/hal_mn10300_stdeval1.h b/packages/hal/mn10300/stdeval1/current/include/pkgconf/hal_mn10300_stdeval1.h new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/stdeval1/current/include/pkgconf/hal_mn10300_stdeval1.h @@ -0,0 +1,84 @@ +#ifndef CYGONCE_PKGCONF_HAL_MN10300_STDEVAL1_H +#define CYGONCE_PKGCONF_HAL_MN10300_STDEVAL1_H +// ==================================================================== +// +// pkgconf/hal_mn10300_stdeval1.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_MN10300_STDEVAL1 { + display "stdeval1 evaluation board" + type radio + parent CYGPKG_HAL_MN10300 + platform stdeval1 + description " + The stdeval1 HAL package should be used when targetting the + actual hardware. The same package can also be used when + running on the full MN10300 simulator, since this provides + an accurate simulation of the full hardware including I/O + devices." + } + + cdl_option CYGHWR_HAL_MN10300_STDEVAL1_STARTUP { + display "Startup type" + parent CYGPKG_HAL_MN10300_STDEVAL1 + #type count + type enum + legal_values ram rom + startup + description " + When targetting the stdeval1 board it is possible to build + the system for either RAM bootstrap or ROM bootstrap. The + former generally requires that the board is equipped with + ROMs containing the Cygmon ROM monitor or equivalent + software that allows gdb to download the eCos application + on to the board. The latter typically requires that the + eCos application be blown into EPROMs or equivalent + technology." + } + + }}CFG_DATA */ +#define CYGHWR_HAL_MN10300_STDEVAL1_STARTUP ram + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_MN10300_STDEVAL1_H */ +/* EOF hal_mn10300_stdeval1.h */ diff --git a/packages/hal/mn10300/stdeval1/current/src/PKGconf.mak b/packages/hal/mn10300/stdeval1/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/stdeval1/current/src/PKGconf.mak @@ -0,0 +1,56 @@ +#=============================================================================== +# +# makefile +# +# hal/mn10300/stdeval1/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + + +PACKAGE := hal_mn10300_stdeval1 +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := hal_diag.c stdeval1.S +OTHER_OBJS := +OTHER_TARGETS := ldscript.stamp +OTHER_CLEAN := ldscript.clean +OTHER_DEPS := ldscript.d + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + +.PHONY: ldscript.clean + +ldscript.stamp: stdeval1.ld + $(CC) -E -P -Wp,-MD,ldscript.tmp -xc $(INCLUDE_PATH) $(CFLAGS) -o $(PREFIX)/lib/target.ld $< + @echo -e "\n$@ : $< \\" > ldscript.d + @tail -n +2 ldscript.tmp >> ldscript.d + @rm ldscript.tmp + $(TOUCH) $@ + +ldscript.clean: + $(RM) -f $(PREFIX)/lib/target.ld + $(RM) -f ldscript.stamp + diff --git a/packages/hal/mn10300/stdeval1/current/src/hal_diag.c b/packages/hal/mn10300/stdeval1/current/src/hal_diag.c new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/stdeval1/current/src/hal_diag.c @@ -0,0 +1,509 @@ +/*============================================================================= +// +// hal_diag.c +// +// HAL diagnostic output code +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL diagnostic output +// Description: Implementations of HAL diagnostic output support. +// +//####DESCRIPTIONEND#### +// +//===========================================================================*/ + +#include + +#include // base types +#include // tracing macros +#include // assertion macros + +#include +#include + +/*---------------------------------------------------------------------------*/ +/* Select default diag channel to use */ + +//#define CYG_KERNEL_DIAG_ROMART +//#define CYG_KERNEL_DIAG_SERIAL1 +//#define CYG_KERNEL_DIAG_SERIAL2 +//#define CYG_KERNEL_DIAG_GDB + +#if !defined(CYG_KERNEL_DIAG_SERIAL1) && \ + !defined(CYG_KERNEL_DIAG_SERIAL2) && \ + !defined(CYG_KERNEL_DIAG_ROMART) + +# if defined(CYG_HAL_MN10300_STDEVAL1) + +# if defined(CYG_HAL_STARTUP_RAM) + +# if defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + + // If loaded into RAM via CYGMON we diag via + // serial 2 using GDB protocol + +# define CYG_KERNEL_DIAG_SERIAL2 +# define CYG_KERNEL_DIAG_GDB + +# elif defined(CYG_HAL_USE_ROM_MONITOR_SLOAD) + + // If loaded into RAM via SLOAD we diag via + // serial 1 + +# define CYG_KERNEL_DIAG_SERIAL1 + +# elif defined(CYG_HAL_USE_ROM_MONITOR_GDB_STUBS) + + // If loaded into RAM via GDB STUB ROM we diag via + // serial 1 using GDB protocol + +# define CYG_KERNEL_DIAG_SERIAL1 +# define CYG_KERNEL_DIAG_GDB + +# endif // defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + +# elif defined(CYG_HAL_STARTUP_ROM) + + // If we are ROM resident, we diag via serial 1 + +# define CYG_KERNEL_DIAG_SERIAL1 + +# endif // defined(CYG_HAL_STARTUP_RAM) + +# endif // defined(CYG_HAL_MN10300_STDEVAL1) + +#endif // if ... + +/*---------------------------------------------------------------------------*/ +// PromICE AI interface + +#if defined(CYG_HAL_MN10300_STDEVAL1_ROMART) || defined(CYG_KERNEL_DIAG_ROMART) + +#ifdef CYG_HAL_MN10300_STDEVAL1 +#define PROMICE_AILOC 0x40008000 +#endif + +#define PROMICE_BUS_SIZE 16 +#define PROMICE_BURST_SIZE 1 + +#if PROMICE_BUS_SIZE == 16 + +typedef volatile struct +{ + volatile cyg_uint16 zero; +// cyg_uint16 pad1[PROMICE_BURST_SIZE]; + volatile cyg_uint16 one; +// cyg_uint16 pad2[PROMICE_BURST_SIZE]; + volatile cyg_uint16 data; +// cyg_uint16 pad3[PROMICE_BURST_SIZE]; + volatile cyg_uint16 status; + +} AISTRUCT; + +#endif + +AISTRUCT *AI = (AISTRUCT *)PROMICE_AILOC; + +#define PROMICE_STATUS_TDA 0x01 +#define PROMICE_STATUS_HDA 0x02 +#define PROMICE_STATUS_OVR 0x04 + + +void ai_diag_init() +{ + volatile cyg_uint8 junk; + + while( AI->status == 0xCC ) + continue; + + junk = AI->data; +} + +static void ai_write_char(cyg_uint8 data) +{ + volatile cyg_uint8 junk; + int i; + + // Wait for tda == 0 + while( (AI->status & PROMICE_STATUS_TDA) == PROMICE_STATUS_TDA ) + continue; + + // Send start bit + junk = AI->one; + + for( i = 0; i < 8; i++ ) + { + // send ls bit of data + if( (data & 1) == 1 ) + junk = AI->one; + else + junk = AI->zero; + + // shift down for next bit + data >>= 1; + } + + // Send stop bit + junk = AI->one; + + // all done +} + +void ai_diag_write_char(char c) +{ + ai_write_char((cyg_uint8)c); +} + +void ai_diag_drain() {} + +void ai_diag_read_char(char *c) { *c = '\n'; } + +void ai_writes(char *s) +{ + while( *s ) ai_write_char( *s++ ); +} + +void ai_write_hex( cyg_uint32 x) +{ + int i; + ai_writes("0x"); + for( i = 28; i >=0 ; i-=4 ) + { + char *d = "0123456789ABCDEF"; + ai_write_char( d[(x>>i)&0xf] ); + } + ai_write_char(' '); +} + +#if defined(CYG_KERNEL_DIAG_ROMART) + +#define hal_diag_init_serial ai_diag_init +#define hal_diag_write_char_serial ai_diag_write_char +#define hal_diag_drain_serial ai_diag_drain +#define hal_diag_read_char_serial ai_diag_read_char + +#endif + +#endif + +/*---------------------------------------------------------------------------*/ +// MN10300 Serial line + +#if defined(CYG_HAL_MN10300_STDEVAL1_SERIAL1) || defined(CYG_KERNEL_DIAG_SERIAL1) + +// We use serial1 on MN103002 +#define SERIAL1_CR ((volatile cyg_uint16 *)0x34000810) +#define SERIAL1_ICR ((volatile cyg_uint8 *) 0x34000814) +#define SERIAL1_TXR ((volatile cyg_uint8 *) 0x34000818) +#define SERIAL1_RXR ((volatile cyg_uint8 *) 0x34000819) +#define SERIAL1_SR ((volatile cyg_uint16 *)0x3400081c) + +// Timer 1 provided baud rate divisor +#define TIMER1_MD ((volatile cyg_uint8 *)0x34001001) +#define TIMER1_BR ((volatile cyg_uint8 *)0x34001011) +#define TIMER1_CR ((volatile cyg_uint8 *)0x34001021) + +#define PORT3_MD ((volatile cyg_uint8 *)0x36008025) + +// Mystery register +#define TMPSCNT ((volatile cyg_uint8 *)0x34001071) + +#define SIO1_LSTAT_TRDY 0x20 +#define SIO1_LSTAT_RRDY 0x10 + +void hal_diag_init_serial1(void) +{ + // 48 translates to 38400 baud. + *TIMER1_BR = 48; + + // Timer1 sourced from IOCLK + *TIMER1_MD = 0x80; + + // Mode on PORT3, used for serial line controls. + *PORT3_MD = 0x01; + + // No interrupts for now. + *SERIAL1_ICR = 0x00; + + // Source from timer 1, 8bit chars, enable tx and rx + *SERIAL1_CR = 0xc084; +} + +void hal_diag_write_char_serial1(char c) +{ + register volatile cyg_uint16 *volatile tty_status = SERIAL1_SR; + register volatile cyg_uint8 *volatile tty_tx = SERIAL1_TXR; + + while( (*tty_status & SIO1_LSTAT_TRDY) != 0 ) continue; + + *tty_tx = c; +} + +void hal_diag_drain_serial1(void) +{ + register volatile cyg_uint16 *volatile tty_status = SERIAL1_SR; + + while( (*tty_status & SIO1_LSTAT_TRDY) != 0 ) continue; +} + +void hal_diag_read_char_serial1(char *c) +{ + register volatile cyg_uint16 *volatile tty_status = SERIAL1_SR; + register volatile cyg_uint8 *volatile tty_rx = SERIAL1_RXR; + + while( (*tty_status & SIO1_LSTAT_RRDY) == 0 ) continue; + + *c = *tty_rx; + +} + +#if defined(CYG_KERNEL_DIAG_SERIAL1) + +#define hal_diag_init_serial hal_diag_init_serial1 +#define hal_diag_write_char_serial hal_diag_write_char_serial1 +#define hal_diag_drain_serial hal_diag_drain_serial1 +#define hal_diag_read_char_serial hal_diag_read_char_serial1 + +#endif + +#endif + +#if defined(CYG_HAL_MN10300_STDEVAL1) + +void led(int x) +{ + *((cyg_uint8 *)0x36008004) = x<<4; +} + +#endif + + +/*---------------------------------------------------------------------------*/ + +#if defined(CYG_HAL_MN10300_STDEVAL1_SERIAL2) || defined(CYG_KERNEL_DIAG_SERIAL2) + +// We use serial2 on MN103002 +#define SERIAL2_CR ((volatile cyg_uint16 *)0x34000820) +#define SERIAL2_ICR ((volatile cyg_uint8 *) 0x34000824) +#define SERIAL2_TXR ((volatile cyg_uint8 *) 0x34000828) +#define SERIAL2_RXR ((volatile cyg_uint8 *) 0x34000829) +#define SERIAL2_SR ((volatile cyg_uint8 *)0x3400082c) +#define SERIAL2_TR ((volatile cyg_uint8 *)0x3400082d) + +// Timer 2 provided baud rate divisor +#define TIMER2_MD ((volatile cyg_uint8 *)0x34001002) +#define TIMER2_BR ((volatile cyg_uint8 *)0x34001012) +#define TIMER2_CR ((volatile cyg_uint8 *)0x34001022) + +#define PORT3_MD ((volatile cyg_uint8 *)0x36008025) + +// Mystery register +#define TMPSCNT ((volatile cyg_uint8 *)0x34001071) + +#define SIO2_LSTAT_TRDY 0x20 +#define SIO2_LSTAT_RRDY 0x10 + +void hal_diag_init_serial2(void) +{ +#if !defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + + // 16 and 22 translate to 38400 baud. + *TIMER2_BR = 16; + *SERIAL2_TR = 22; + + // Timer2 sourced from IOCLK + *TIMER2_MD = 0x80; + + // Mode on PORT3, used for serial line controls. + *PORT3_MD = 0x01; + + // No interrupts for now. + *SERIAL2_ICR = 0x00; + + // Source from timer 2, 8bit chars, enable tx and rx + *SERIAL2_CR = 0xc081; + +#endif +} + +void hal_diag_write_char_serial2(char c) +{ + register volatile cyg_uint8 *volatile tty_status = SERIAL2_SR; + register volatile cyg_uint8 *volatile tty_tx = SERIAL2_TXR; + + while( (*tty_status & SIO2_LSTAT_TRDY) != 0 ) continue; + + *tty_tx = c; +} + +void hal_diag_drain_serial2(void) +{ + register volatile cyg_uint8 *volatile tty_status = SERIAL2_SR; + + while( (*tty_status & SIO2_LSTAT_TRDY) != 0 ) continue; +} + +void hal_diag_read_char_serial2(char *c) +{ + register volatile cyg_uint8 *volatile tty_status = SERIAL2_SR; + register volatile cyg_uint8 *volatile tty_rx = SERIAL2_RXR; + + while( (*tty_status & SIO2_LSTAT_RRDY) == 0 ) continue; + + *c = *tty_rx; +} + +#if defined(CYG_KERNEL_DIAG_SERIAL2) + +#define hal_diag_init_serial hal_diag_init_serial2 +#define hal_diag_write_char_serial hal_diag_write_char_serial2 +#define hal_diag_drain_serial hal_diag_drain_serial2 +#define hal_diag_read_char_serial hal_diag_read_char_serial2 + +#endif + +#endif + +/*---------------------------------------------------------------------------*/ + +void hal_diag_init(void) +{ + hal_diag_init_serial(); +} + +void hal_diag_write_char(char c) +{ +#ifdef CYG_KERNEL_DIAG_GDB + + static char line[100]; + static int pos = 0; + + // No need to send CRs + if( c == '\r' ) return; + + line[pos++] = c; + + if( c == '\n' || pos == sizeof(line) ) + { + CYG_INTERRUPT_STATE old; + + // Disable interrupts. This prevents GDB trying to interrupt us + // while we are in the middle of sending a packet. The serial + // receive interrupt will be seen when we re-enable interrupts + // later. + + HAL_DISABLE_INTERRUPTS(old); + + while(1) + { + static char hex[] = "0123456789ABCDEF"; + cyg_uint8 csum = 0; + int i; + + hal_diag_write_char_serial('$'); + hal_diag_write_char_serial('O'); + csum += 'O'; + for( i = 0; i < pos; i++ ) + { + char ch = line[i]; + char h = hex[(ch>>4)&0xF]; + char l = hex[ch&0xF]; + hal_diag_write_char_serial(h); + hal_diag_write_char_serial(l); + csum += h; + csum += l; + } + hal_diag_write_char_serial('#'); + hal_diag_write_char_serial(hex[(csum>>4)&0xF]); + hal_diag_write_char_serial(hex[csum&0xF]); + +#if 0 + { + char c1; + + hal_diag_read_char_serial( &c1 ); + + // We must ack the interrupt caused by that read to avoid + // confusing the GDB stub ROM. + HAL_INTERRUPT_ACKNOWLEDGE( CYG_VECTOR_EXTERNAL_2 ); + + if( c1 == '+' ) break; + + ai_writes("hal_diag_read_char_serial("); + ai_write_char(c1); + ai_writes(")\r\n"); + ai_writes("retry\r\n"); + +#if defined(CYG_HAL_USE_ROM_MONITOR) && defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + if( c1 == 3 ) + { + // Ctrl-C: breakpoint. +// HAL_BREAKPOINT(_breakinst); + typedef void bpt_fn(); + bpt_fn *bfn = ((bpt_fn **)0x80000100)[61]; + + bfn(); + + break; + } +#endif + + } +#else + break; +#endif + } + + pos = 0; + + // Wait for tx buffer to drain + hal_diag_drain_serial(); + + // And re-enable interrupts + HAL_RESTORE_INTERRUPTS(old); + + } + +#else + hal_diag_write_char_serial(c); +#endif +} + + + + +void hal_diag_read_char(char *c) +{ + hal_diag_read_char_serial(c); +} + + +/*---------------------------------------------------------------------------*/ +/* End of hal_diag.c */ diff --git a/packages/hal/mn10300/stdeval1/current/src/stdeval1.S b/packages/hal/mn10300/stdeval1/current/src/stdeval1.S new file mode 100644 diff --git a/packages/hal/mn10300/stdeval1/current/src/stdeval1.ld b/packages/hal/mn10300/stdeval1/current/src/stdeval1.ld new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/stdeval1/current/src/stdeval1.ld @@ -0,0 +1,121 @@ +STARTUP(vectors.o) +ENTRY(reset_vector) + +GROUP(libtarget.a libgcc.a) + +#include + +#ifdef CYG_HAL_STARTUP_ROM +#define LOAD_BASE 0x40000000 +#define DATA_BASE 0x48000000 +#define VSR_BASE +#endif +#ifdef CYG_HAL_STARTUP_RAM +# define LOAD_BASE 0x48008000 +# define DATA_BASE +# define VSR_BASE 0x48000000 +#endif + + +SECTIONS +{ + + /* Start of ROM */ + . = LOAD_BASE; + + .rom_vectors : + { + KEEP(*(.vectors)) + } + + .text : + { + _stext = .; + *(.text*) + *(.gnu.warning) + *(.gnu.linkonce*) + *(.init) + + } + _etext = .; + PROVIDE (etext = .); + .fini : { *(.fini) } + .rodata : { *(.rodata*) } + .rodata1 : { *(.rodata1) } + .fixup : { *(.fixup) } + .gcc_except_table : { *(.gcc_except_table) } + +/* __rom_data_start = __rom_ram_vectors_start + SIZEOF( .ram_vectors ); */ + __rom_data_start = ALIGN(4); + .data DATA_BASE : + AT( __rom_data_start ) + { + __ram_data_start = .; + *(.data*) + *(.data1) + _GOT1_START_ = .; + *(.got1) + _GOT1_END_ = .; + /* Put .ctors and .dtors next to the .got2 section, so that the pointers + get relocated with -mrelocatable. */ + _GOT2_START_ = .; + *(.got2) + _GOT2_END_ = .; + . = ALIGN(4); +#ifdef CYG_KERNEL_USE_INIT_PRIORITY + __CTOR_LIST__ = .; + KEEP(*(SORT(.ctors*))) + __CTOR_END__ = .; + __DTOR_LIST__ = .; + KEEP(*(SORT(.dtors*))) + __DTOR_END__ = .; +#else + __CTOR_LIST__ = .; + *sched.o(.ctors*) + *clock.o(.ctors*) + *thread.o(.ctors*) + *(.ctors*) + __CTOR_END__ = .; + __DTOR_LIST__ = .; + *(.dtors) + __DTOR_END__ = .; +#endif + _GOT_START_ = .; + _GLOBAL_OFFSET_TABLE_ = . + 32768; + _SDA_BASE_ = .; + *(.got.plt) + *(.got) + _GOT_END_ = .; + *(.dynamic) + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + *(.sdata*) + *(.sbss*) + } + __ram_data_end = .; + PROVIDE( __ram_data_end = .); + _edata = .; + PROVIDE (edata = .); + . = ALIGN(4); + __bss_start = .; + .bss : + { + *(.scommon) + *(.dynbss) + *(.bss) + *(COMMON) + } + . = ALIGN(4); + _end = . ; + PROVIDE (end = .); + +} + +_mn10300_interrupt_control = 0x34000100; +_mn10300_interrupt_vectors = 0x20000000; + +#ifdef CYG_HAL_STARTUP_RAM +_hal_vsr_table = VSR_BASE; +_hal_virtual_vector_table = VSR_BASE+0x80; +#endif diff --git a/packages/hal/mn10300/stdeval1/current/tests/PKGconf.mak b/packages/hal/mn10300/stdeval1/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/mn10300/stdeval1/current/tests/PKGconf.mak @@ -0,0 +1,38 @@ +#=============================================================================== +# +# makefile +# +# hal/mn10300/stdeval1/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal_mn10300_stdeval1 +include ../../../../../pkgconf/pkgconf.mak + +TESTS := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + diff --git a/packages/hal/powerpc/arch/current/ChangeLog b/packages/hal/powerpc/arch/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/ChangeLog @@ -0,0 +1,423 @@ +1998-10-27 Jesper Skov + + * src/vectors.S: Also save registers 13-15 in minimum context for + convenience. + +1998-10-25 Jesper Skov + + * src/vectors.S: Removed pkgconf/kernel.h include fix-me. + +1998-10-23 Jesper Skov + + * include/ppc_stub.h: Include generic-stub.h from hal. + +Fri Oct 23 04:47:11 1998 Jonathan Larmour + + * include/hal_cache.h: + Include HAL configuration file to be sure we get all the right + defines. This is a potential problem, that I had thought may be + the cause of PR 17839, but that turned out to be a config tool + problem + +1998-10-16 Bart Veer + + * src/vectors.S (__interrupt_stack): + Made the interrupt stack size configurable. + +1998-10-15 Jesper Skov + + * src/ppc_stub.c (__computeSignal): Use SIGSYS for 'sc' + exceptions. + +1998-10-15 Jesper Skov + PR 17808 + + * include/hal_arch.h (HAL_JMP_BUF_SIZE): Increased to 23. + + * src/context.S (hal_setjmp, hal_longjmp): Also save CR[2-4]. + +1998-10-15 Jesper Skov + + * src/vectors.S: CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS changed to + CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS. + +1998-10-15 Jesper Skov + + * src/ppc_stub.c: Replaced include with SIGxxx + definitions. + +1998-10-15 Jesper Skov + + * src/ppc_stub.c: Graceful error if attempted compiled for + simulator. + Also do proper include of dbg-threads-api.h. + + * src/vectors.S: Changed CYG_HAL_GDB_BREAK to + CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT. + +1998-10-15 Jesper Skov + + * src/ppc_stub.c (single_step, clear_single_step): Disable + interrupts when doing a single-step. + +1998-10-14 Nick Garnett + + * include/hal_io.h: + * src/ppc_stub.c: + * src/hal_misc.c: + Minor modifications to permit building without kernel. + +1998-10-14 Jesper Skov + + * include/hal_intr.h (HAL_QUERY_INTERRUPTS): Fixed to do the right + thing. + +1998-10-13 Jesper Skov + + * src/ppc_stub.c: + * src/hal_misc.c: + Added thread support. Primarily a change in the way registers are + accessed. + + * include/hal_arch.h (HAL_GET_GDB_REGISTERS, + HAL_SET_GDB_REGISTERS): Added a few more registers. + +1998-10-12 Jesper Skov + + * Reverted below to avoid problems with test farm. Waiting for + approval of other diffs. + +1998-10-12 Jesper Skov + + * src/ppc_stub.c: + * src/hal_misc.c: + Added thread support. Primarily a change in the way registers are + accessed. + + * include/hal_arch.h (HAL_GET_GDB_REGISTERS, + HAL_SET_GDB_REGISTERS): Added a few more registers. + +1998-10-12 Jesper Skov + + * include/ppc_stub.h: Added CYGONCE protection. + Fixed warning. + +1998-10-09 Jesper Skov + + * include/hal_intr.h: Added HAL_TRANSLATE_VECTOR. + +1998-10-08 Jesper Skov + + * src/vectors.S: Protect kernel.h inclusion by CYGPKG_KERNEL. + +1998-10-08 Jesper Skov + + * include/hal_arch.h + * include/ppc_regs.h + * src/hal_misc.c + Changed /**/ comments to //. + +1998-10-08 Jesper Skov + + * src/makefile: Removed. + +1998-10-08 Jesper Skov + + * include/basetype.h: + * include/hal_arch.h: + * include/hal_cache.h: + * include/hal_intr.h: + * include/hal_io.h: + * include/ppc_regs.h: + * include/pkgconf/hal_powerpc.h: + * src/context.S: + * src/hal_misc.c: + * src/vectors.S: + Expanded TABs. + +1998-10-08 Jesper Skov + + * src/vectors.S: Added GDB interrupt support. + Call GDB stub init at startup. + +1998-10-08 Jesper Skov + + * include/ppc_regs.h: Added defines for Internal Memory Map. Added + CYGONCE protection. + +1998-10-07 Jesper Skov + + * include/hal_io.h: Enforce in-order IO. + +1998-10-01 Jesper Skov + + * src/vectors.S (_start): Comment change. + + * include/hal_intr.h: Added empty HAL_INTERRUPT_SET_LEVEL macro. + +Thu Sep 17 17:40:01 1998 Jesper Skov + + * src/vectors.S: Simulator does not support DER register. + +1998-09-14 Bart Veer + + * src/PKGconf.mak: + Made vectors.o dependent on the various files that can contain + makefile variables or rules. This is needed after changes to + pkgconf.tcl for PRs 17195 and 17286. + +1998-09-12 Bart Veer + + * include/pkgconf/hal_powerpc.h: + Added missing descriptions (PR 17184) + + * src/hal_misc.c (exception_handler): + Sort out exception handling options (PR 16953) + +Fri Sep 4 12:03:54 1998 Jesper Skov + + * src/context.S: Always save/restore CR as the compiler may only + do a partial restore. + +Thu Sep 3 10:12:46 1998 Jesper Skov + + * include/hal_cache.h: Replaced CACHE macros with dummies. The + errata for the revision A.2 MPC860 is pretty grim wrt cache side + effects. + + * include/hal_cache.h: + * include/hal_io.h: + * include/hal_arch.h: + * include/hal_intr.h: + Wrapped multi-line macros with CYG_MACRO_START/END. + +1998-09-02 Bart Veer + + * include/pkgconf/hal_powerpc.h: + New header file for architecture-specific configuration options + + * tests/PKGconf.mak: + * src/PKGconf.mak: + Sort out package naming conventions. + +1998-09-01 Nick Garnett + + * include/hal_intr.h: + Added CYG_VSR_COUNT, CYG_EXCEPTION_COUNT and CYG_ISR_COUNT. + +Tue Sep 1 14:43:48 1998 Jesper Skov + + * include/hal_cache.h (HAL_DCACHE_SYNC): Write data in the cache + back to memory. + (HAL_ICACHE_SYNC): Do nothing. + +Tue Sep 1 10:26:10 1998 Jesper Skov + + * src/hal_misc.c: Define empty __eabi to override compiler + generated version of the same. + +Mon Aug 31 16:32:34 1998 Jesper Skov + + * src/hal_misc.c (cyg_hal_invoke_constructors): Renamed from + __eabi. + +Mon Aug 31 16:31:18 1998 Jesper Skov + + * src/vectors.S (_start): Call C++ constructors. + +Mon Aug 31 15:32:22 1998 Jesper Skov + + * src/vectors.S (__default_interrupt_vsr): Added config options: + CYGFUN_HAL_COMMON_KERNEL_SUPPORT and + CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK. + (restore_state): Moved from bottom of __default_exception_vsr to + bottom of __default_interrupt_vsr. + +Mon Aug 31 13:33:04 1998 Jesper Skov + + * src/ppc_stub.c (__computeSignal): Added handling of MC860 + specific exceptions. + Made VECTOR_PROGRAM decode actual exception type. + + * include/hal_intr.h: Defined MC860 specific vectors. + +Mon Aug 31 10:12:44 1998 Jesper Skov + + * src/hal_misc.c: + * src/vectors.S: + Added ha_default_isr. + + * include/hal_cache.h: + * include/ppc_regs.h: + Defined HAL_DCACHE_x macros. + + * include/hal_arch.h: + * src/hal_misc: + Added hal_idle_thread_action. + +1998-08-28 Bart Veer + + * src/vectors.S, src/context.S, src/hal_misc.c, src/ppc_stub.c, + include/hal_intr.h : + Updated for new kernel configuration option symbol names + +Fri Aug 28 17:55:46 1998 Jesper Skov + + * src/vectors.S: Added some more comments. + (_start): Disable 860 "Development Support" as it breaks PowerPC + standard single-stepping exceptions. + + * src/ppc_stub.c: Handle single-step exceptions properly. Also + enable exception-after-branch. + +Fri Aug 28 17:41:34 1998 Jesper Skov + + * include/ppc_regs.h: Added some more definitions. + + * include/hal_cache.h: Defined HAL_ICACHE_x macros. + + * include/hal_arch.h (HAL_BREAKINST): Use same opcode as GDB. + +Fri Aug 28 10:11:06 1998 Jonathan Larmour + + * src/vectors.S (_start): + Change call of main() to cyg_start(), and change comments + accordingly. Definitely never call exit(). + +Thu Aug 27 15:30:27 1998 Jesper Skov + + * include/ppc_stub.h (REGSIZE): Floats are 64 bit. + +Thu Aug 27 13:58:16 1998 Jesper Skov + + * src/hal_misc.c: Removed GDB C-C stuff again. + +Wed Aug 26 16:05:53 1998 Jesper Skov + + * src/hal_misc.c (hal_ctrlc_isr, hal_init_ctrlc_intr): + Added GDB C-C support (temporary location). + +Wed Aug 26 15:12:31 1998 Jesper Skov + + * src/hal_misc.c (__eabi): Changed to match the constructor table + generated by the linker script. + +Wed Aug 26 09:38:07 1998 Jesper Skov + + * include/hal_arch.h (HAL_GET_GDB_REGISTERS): Fixed typo. + (HAL_SET_GDB_REGISTERS): Same. + +1998-08-25 Nick Garnett + + * src/vectors.S: + Now pass pointer to saved registers as third argument to + interrupt_end(). + + * include/hal_arch.h: + Added macros to support GDB. + +Tue Aug 25 16:57:27 1998 Jesper Skov + + * src/ppc_stub.c: Comment changes. + +Tue Aug 25 11:11:49 1998 Jesper Skov + + * include/hal_intr.h (HAL_INTERRUPT_ATTACH): Added cast to avoid + compiler warning. + +Tue Aug 25 11:08:00 1998 Jesper Skov + + * include/hal_arch.h (HAL_REORDER_BARRIER): Added side effect to + "memory". + +Mon Aug 24 13:15:07 1998 Jesper Skov + + * include/ppc_stub.h: Corrected NUMREGS. + +Mon Aug 24 11:14:08 1998 Jesper Skov + + * src/vectors.S (__default_exception_vsr): Don't access register + hid0. + +Mon Aug 24 10:37:04 1998 Jesper Skov + + * src/vectors.S (_start): Removed non-functional OCD control. + +1998-08-21 Nick Garnett + + * include/hal_cache.h: + Now includes cyg_type.h rather than ktypes.h. + +Thu Aug 20 17:43:50 1998 Jesper Skov + + * src/vectors.S: Disable OCD control to allow debugging of gdb + stub. + + * src/vectors.S: Temporary stack definition. + +Thu Aug 20 17:37:10 1998 Jesper Skov + + * src/hal_misc.c: Added GDB stub support. + + * include/ppc.inc: Added some 860 register definitions. + + * include/hal_arch.h: Added breakpoint stuff. + +Thu Aug 20 16:07:03 1998 Jesper Skov + + * src/PKGconf.mak: Include GDB support files. + +Thu Aug 20 16:00:21 1998 Jesper Skov + + * include/ppc_stub.h: + * include/ppc_regs.h: + * src/ppc_stub.c: + Added for GDB support. + +Tue Aug 18 18:44:00 1998 Jesper Skov + + * include/hal_intr.h: + * include/hal_arch.h: + Use cyg_type.h rather than ktypes.h. + +Tue Aug 18 18:38:43 1998 Jesper Skov + + * include/basetype.h: Fixed typo. + +1998-08-18 Nick Garnett + + * src/context.S: + * src/hal_misc.c: + * include/hal_intr.h: + * src/vectors.S: + Now uses hal.h rather than kernel.h. + +Mon Aug 17 16:23:46 1998 Jesper Skov + + * include/hal_intr.h (HAL_DISABLE_INTERRUPTS): Fix MACRO line + continuation. + (HAL_RESTORE_INTERRUPTS): Same. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/powerpc/arch/current/include/basetype.h b/packages/hal/powerpc/arch/current/include/basetype.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/include/basetype.h @@ -0,0 +1,64 @@ +#ifndef CYGONCE_HAL_BASETYPE_H +#define CYGONCE_HAL_BASETYPE_H + +//============================================================================= +// +// basetype.h +// +// Standard types for this architecture. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-08 +// Purpose: Define architecture base types. +// Usage: Included by "cyg_type.h", do not use directly + +// +//####DESCRIPTIONEND#### +// + +//----------------------------------------------------------------------------- +// Characterize the architecture + +#define CYG_BYTEORDER CYG_MSBFIRST // Big endian + +//----------------------------------------------------------------------------- +// Powerpc does not usually use labels with underscores. Some labels generated +// by the linker do, so add an underscore where required. + +#define CYG_LABEL_NAME(_name_) _##_name_ + +//----------------------------------------------------------------------------- +// Define the standard variable sizes + +// The PowerPC architecture uses the default definitions of the base types, +// so we do not need to define any here. + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_BASETYPE_H +// End of basetype.h diff --git a/packages/hal/powerpc/arch/current/include/hal_arch.h b/packages/hal/powerpc/arch/current/include/hal_arch.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/include/hal_arch.h @@ -0,0 +1,237 @@ +#ifndef CYGONCE_HAL_ARCH_H +#define CYGONCE_HAL_ARCH_H + +//============================================================================= +// +// hal_arch.h +// +// Architecture specific abstractions +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-08 +// Purpose: Define architecture abstractions +// Usage: #include + +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +//----------------------------------------------------------------------------- +// Processor saved states: +// The layout of this structure is also defined in "ppc.inc", for assembly +// code. Do not change this without changing that (or vice versa). + +typedef struct +{ + // These are common to all saved states + cyg_uint32 d[32]; // Data regs + cyg_uint32 cr; // Condition Reg + cyg_uint32 xer; // XER + cyg_uint32 lr; // Link Reg + cyg_uint32 ctr; // Count Reg + + // These are only saved for exceptions and interrupts + cyg_uint32 vector; // Vector number + cyg_uint32 msr; // Machine State Reg + cyg_uint32 pc; // Program Counter + + // These are only saved for exceptions, and are not restored + // when continued. + cyg_uint32 hid0; // Hw Implementation Dependent + cyg_uint32 dar; // Data Address Reg + cyg_uint32 dsisr; // DSISR + cyg_uint32 pvr; // Processor Version + + // maybe add BATs, and SRs too + // maybe also add FP registers +} HAL_SavedRegisters; + +//----------------------------------------------------------------------------- +// Exception handling function. +// This function is defined by the kernel according to this prototype. It is +// invoked from the HAL to deal with any CPU exceptions that the HAL does +// not want to deal with itself. It usually invokes the kernel's exception +// delivery mechanism. + +externC void deliver_exception( CYG_WORD code, CYG_ADDRWORD data ); + +//----------------------------------------------------------------------------- +// Bit manipulation macros + +#define HAL_LSBIT_INDEX(index, mask) \ + asm ( "neg 11,%1;" \ + "and 11,11,%1;" \ + "cntlzw %0,11;" \ + "subfic %0,%0,31;" \ + : "=r" (index) \ + : "r" (mask) \ + : "r11" \ + ); + +#define HAL_MSBIT_INDEX(index, mask) \ + asm ( "cntlzw %1,%0" : "=r" (mask) : "r" (index) ); + +//----------------------------------------------------------------------------- +// Context Initialization +// Initialize the context of a thread. +// Arguments: +// _sp_ name of variable containing current sp, will be written with new sp +// _thread_ thread object address, passed as argument to entry point +// _entry_ entry point address. +// _id_ bit pattern used in initializing registers, for debugging. + +#define HAL_THREAD_INIT_CONTEXT( _sparg_, _thread_, _entry_, _id_ ) \ + CYG_MACRO_START \ + register CYG_WORD _sp_ = ((CYG_WORD)_sparg_)-56; \ + register HAL_SavedRegisters *_regs_; \ + int _i_; \ + _regs_ = (HAL_SavedRegisters *)((_sp_) - sizeof(HAL_SavedRegisters)); \ + for( _i_ = 0; _i_ < 32; _i_++ ) (_regs_)->d[_i_] = (_id_)|_i_; \ + (_regs_)->d[01] = (CYG_WORD)(_sp_); /* SP = top of stack */ \ + (_regs_)->d[03] = (CYG_WORD)(_thread_); /* R3 = arg1 = thread ptr */ \ + (_regs_)->cr = 0; /* CR = 0 */ \ + (_regs_)->xer = 0; /* XER = 0 */ \ + (_regs_)->lr = (CYG_WORD)(_entry_); /* LR = entry point */ \ + (_regs_)->ctr = 0; /* CTR = 0 */ \ + _sparg_ = (CYG_ADDRESS)_regs_; \ + CYG_MACRO_END + +//----------------------------------------------------------------------------- +// Context switch macros. +// The arguments are pointers to locations where the stack pointer +// of the current thread is to be stored, and from where the sp of the +// next thread is to be fetched. + +externC void hal_thread_switch_context( CYG_ADDRESS to, CYG_ADDRESS from ); +externC void hal_thread_load_context( CYG_ADDRESS to ) + __attribute__ ((noreturn)); + +#define HAL_THREAD_SWITCH_CONTEXT(_fspptr_,_tspptr_) \ + hal_thread_switch_context((CYG_ADDRESS)_tspptr_,(CYG_ADDRESS)_fspptr_); + +#define HAL_THREAD_LOAD_CONTEXT(_tspptr_) \ + hal_thread_load_context( (CYG_ADDRESS)_tspptr_ ); + +//----------------------------------------------------------------------------- +// Execution reorder barrier. +// When optimizing the compiler can reorder code. In multithreaded systems +// where the order of actions is vital, this can sometimes cause problems. +// This macro may be inserted into places where reordering should not happen. + +#define HAL_REORDER_BARRIER() asm volatile ( "" : : : "memory" ) + +//----------------------------------------------------------------------------- +// Breakpoint support +// HAL_BREAKPOINT() is a code sequence that will cause a breakpoint to happen +// if executed. +// HAL_BREAKINST is the value of the breakpoint instruction and +// HAL_BREAKINST_SIZE is its size in bytes. + +#define HAL_BREAKPOINT(_label_) \ +asm volatile (" .globl " #_label_ ";" \ + #_label_":" \ + " trap" \ + ); + +#define HAL_BREAKINST 0x7d821008 + +#define HAL_BREAKINST_SIZE 4 + +//----------------------------------------------------------------------------- +// Thread register state manipulation for GDB support. + +// Translate a stack pointer as saved by the thread context macros above into +// a pointer to a HAL_SavedRegisters structure. +#define HAL_THREAD_GET_SAVED_REGISTERS( _sp_, _regs_ ) \ + (_regs_) = (HAL_SavedRegisters *)(_sp_) + +// Copy a set of registers from a HAL_SavedRegisters structure into a +// GDB ordered array. +#define HAL_GET_GDB_REGISTERS( _aregval_, _regs_ ) \ + CYG_MACRO_START \ + CYG_ADDRWORD *_regval_ = (CYG_ADDRWORD *)(_aregval_); \ + int _i_; \ + \ + for( _i_ = 0; _i_ < 32; _i_++ ) \ + _regval_[_i_] = (_regs_)->d[_i_]; \ + \ + _regval_[64] = (_regs_)->pc; \ + _regval_[65] = (_regs_)->msr; \ + _regval_[66] = (_regs_)->cr; \ + _regval_[67] = (_regs_)->lr; \ + _regval_[68] = (_regs_)->ctr; \ + _regval_[69] = (_regs_)->xer; \ + CYG_MACRO_END + +// Copy a GDB ordered array into a HAL_SavedRegisters structure. +#define HAL_SET_GDB_REGISTERS( _regs_ , _aregval_ ) \ + CYG_MACRO_START \ + CYG_ADDRWORD *_regval_ = (CYG_ADDRWORD *)(_aregval_); \ + int _i_; \ + \ + for( _i_ = 0; _i_ < 32; _i_++ ) \ + (_regs_)->d[_i_] = _regval_[_i_]; \ + \ + (_regs_)->pc = _regval_[64]; \ + (_regs_)->msr = _regval_[65]; \ + (_regs_)->cr = _regval_[66]; \ + (_regs_)->lr = _regval_[67]; \ + (_regs_)->ctr = _regval_[68]; \ + (_regs_)->xer = _regval_[69]; \ + CYG_MACRO_END + +//----------------------------------------------------------------------------- +// HAL setjmp + +#define HAL_JMP_BUF_SIZE 23 + +typedef cyg_uint32 hal_jmp_buf[HAL_JMP_BUF_SIZE]; + +externC int hal_setjmp(hal_jmp_buf env); +externC void hal_longjmp(hal_jmp_buf env, int val); + + +//----------------------------------------------------------------------------- +// Idle thread code. +// This macro is called in the idle thread loop, and gives the HAL the +// chance to insert code. Typical idle thread behaviour might be to halt the +// processor. + +externC void hal_idle_thread_action(cyg_uint32 loop_count); + +#define HAL_IDLE_THREAD_ACTION(_count_) hal_idle_thread_action(_count_) + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_ARCH_H +// End of hal_arch.h + + diff --git a/packages/hal/powerpc/arch/current/include/hal_cache.h b/packages/hal/powerpc/arch/current/include/hal_cache.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/include/hal_cache.h @@ -0,0 +1,353 @@ +#ifndef CYGONCE_HAL_CACHE_H +#define CYGONCE_HAL_CACHE_H + +//============================================================================= +// +// hal_cache.h +// +// HAL cache control API +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: Cache control API +// Description: The macros defined here provide the HAL APIs for handling +// cache control operations. +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include +#include +#include + +//============================================================================= +// PowerPC simulator + +#ifdef CYG_HAL_POWERPC_SIM + +//----------------------------------------------------------------------------- +// Cache dimensions + +// Data cache +#define HAL_DCACHE_SIZE 4096 // Size of data cache in bytes +#define HAL_DCACHE_LINE_SIZE 16 // Size of a data cache line +#define HAL_DCACHE_WAYS 2 // Associativity of the cache + +// Instruction cache +#define HAL_ICACHE_SIZE 4096 // Size of cache in bytes +#define HAL_ICACHE_LINE_SIZE 16 // Size of a cache line +#define HAL_ICACHE_WAYS 2 // Associativity of the cache + +#define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS)) +#define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS)) + +//----------------------------------------------------------------------------- +// Global control of data cache + +// Enable the data cache +#define HAL_DCACHE_ENABLE() + +// Disable the data cache +#define HAL_DCACHE_DISABLE() + +// Invalidate the entire cache +#define HAL_DCACHE_INVALIDATE_ALL() + +// Synchronize the contents of the cache with memory. +#define HAL_DCACHE_SYNC() + +// Set the data cache refill burst size +//#define HAL_DCACHE_BURST_SIZE(_size_) + +// Set the data cache write mode +//#define HAL_DCACHE_WRITE_MODE( _mode_ ) + +//#define HAL_DCACHE_WRITETHRU_MODE 0 +//#define HAL_DCACHE_WRITEBACK_MODE 1 + +// Load the contents of the given address range into the data cache +// and then lock the cache so that it stays there. +//#define HAL_DCACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_DCACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Data cache line control + +// Allocate cache lines for the given address range without reading its +// contents from memory. +//#define HAL_DCACHE_ALLOCATE( _base_ , _size_ ) + +// Write dirty cache lines to memory and invalidate the cache entries +// for the given address range. +//#define HAL_DCACHE_FLUSH( _base_ , _size_ ) + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_DCACHE_INVALIDATE( _base_ , _size_ ) + +// Write dirty cache lines to memory for the given address range. +//#define HAL_DCACHE_STORE( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of reading +// from it later. +//#define HAL_DCACHE_READ_HINT( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of writing +// to it later. +//#define HAL_DCACHE_WRITE_HINT( _base_ , _size_ ) + +// Allocate and zero the cache lines associated with the given range. +//#define HAL_DCACHE_ZERO( _base_ , _size_ ) + +//----------------------------------------------------------------------------- +// Global control of Instruction cache + +// Enable the instruction cache +#define HAL_ICACHE_ENABLE() + +// Disable the instruction cache +#define HAL_ICACHE_DISABLE() + +// Invalidate the entire cache +#define HAL_ICACHE_INVALIDATE_ALL() + +// Synchronize the contents of the cache with memory. +#define HAL_ICACHE_SYNC() + +// Set the instruction cache refill burst size +//#define HAL_ICACHE_BURST_SIZE(_size_) + +// Load the contents of the given address range into the instruction cache +// and then lock the cache so that it stays there. +//#define HAL_ICACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_ICACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Instruction cache line control + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_ICACHE_INVALIDATE( _base_ , _size_ ) + +#endif + + +//============================================================================= +// Motorola MP860 + +#ifdef CYG_HAL_POWERPC_MP860 + +//----------------------------------------------------------------------------- +// Cache dimensions + +// Data cache +#define HAL_DCACHE_SIZE 4096 // Size of data cache in bytes +#define HAL_DCACHE_LINE_SIZE 16 // Size of a data cache line +#define HAL_DCACHE_WAYS 2 // Associativity of the cache + +// Instruction cache +#define HAL_ICACHE_SIZE 4096 // Size of cache in bytes +#define HAL_ICACHE_LINE_SIZE 16 // Size of a cache line +#define HAL_ICACHE_WAYS 2 // Associativity of the cache + +#define HAL_DCACHE_SETS (HAL_DCACHE_SIZE/(HAL_DCACHE_LINE_SIZE*HAL_DCACHE_WAYS)) +#define HAL_ICACHE_SETS (HAL_ICACHE_SIZE/(HAL_ICACHE_LINE_SIZE*HAL_ICACHE_WAYS)) + +//----------------------------------------------------------------------------- +// Global control of data cache + +// FIXME: +// The revision A.2 MPC860 might do all sorts of horrible things to +// the cache contents in a few specific (and unlikely) +// situations. However, as I don't feel like being bitten by these, +// leave caches disabled at all times. +#if 1 +// Enable the data cache +#define HAL_DCACHE_ENABLE() + +// Disable the data cache +#define HAL_DCACHE_DISABLE() + +// Invalidate the entire cache +#define HAL_DCACHE_INVALIDATE_ALL() + +// Synchronize the contents of the cache with memory. +#define HAL_DCACHE_SYNC() +#else +// Enable the data cache +#define HAL_DCACHE_ENABLE() \ + asm volatile ("sync;" \ + "mtspr 568, %0;" /* DC_CST */ \ + : : "r" (DC_CMD_CE)) + +// Disable the data cache +#define HAL_DCACHE_DISABLE() \ + asm volatile ("sync;" \ + "mtspr 568, %0;" /* DC_CST */ \ + : : "r" (DC_CMD_CD)) + +// Invalidate the entire cache +#define HAL_DCACHE_INVALIDATE_ALL() \ + asm volatile ("sync;" \ + "mtspr 568, %0;" /* DC_CST */ \ + : : "r" (DC_CMD_IA)) + +// Synchronize the contents of the cache with memory. +#define HAL_DCACHE_SYNC() \ + CYG_MACRO_START \ + int i; \ + int cmd = DC_CMD_FL; \ + for (i = 0; i < HAL_DCACHE_SETS; i++){ \ + asm volatile ("sync;" \ + "mtspr 569, %0;" /* DC_ADR */ \ + "mtspr 568, %2;" /* DC_CST */ \ + "mtspr 569, %1;" /* DC_ADR */ \ + "mtspr 568, %2;" /* DC_CST */ \ + : /* no output */ \ + : "r" (i << 4), "r" (0x1000 | (i << 4)), \ + "r" (cmd)); \ + } \ + CYG_MACRO_END +#endif + +// Set the data cache refill burst size +//#define HAL_DCACHE_BURST_SIZE(_size_) + +// Set the data cache write mode +//#define HAL_DCACHE_WRITE_MODE( _mode_ ) + +//#define HAL_DCACHE_WRITETHRU_MODE 0 +//#define HAL_DCACHE_WRITEBACK_MODE 1 + +// Load the contents of the given address range into the data cache +// and then lock the cache so that it stays there. +//#define HAL_DCACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_DCACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Data cache line control + +// Allocate cache lines for the given address range without reading its +// contents from memory. +//#define HAL_DCACHE_ALLOCATE( _base_ , _size_ ) + +// Write dirty cache lines to memory and invalidate the cache entries +// for the given address range. +//#define HAL_DCACHE_FLUSH( _base_ , _size_ ) + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_DCACHE_INVALIDATE( _base_ , _size_ ) + +// Write dirty cache lines to memory for the given address range. +//#define HAL_DCACHE_STORE( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of reading +// from it later. +//#define HAL_DCACHE_READ_HINT( _base_ , _size_ ) + +// Preread the given range into the cache with the intention of writing +// to it later. +//#define HAL_DCACHE_WRITE_HINT( _base_ , _size_ ) + +// Allocate and zero the cache lines associated with the given range. +//#define HAL_DCACHE_ZERO( _base_ , _size_ ) + +//----------------------------------------------------------------------------- +// Global control of Instruction cache + +// FIXME: +// The revision A.2 MPC860 might do all sorts of horrible things to +// the cache contents in a few specific (and unlikely) +// situations. However, as I don't feel like being bitten by these, +// leave caches disabled at all times. +#if 1 +// Enable the instruction cache +#define HAL_ICACHE_ENABLE() + +// Disable the instruction cache +#define HAL_ICACHE_DISABLE() + +// Invalidate the entire cache +#define HAL_ICACHE_INVALIDATE_ALL() + +// Synchronize the contents of the cache with memory. +#define HAL_ICACHE_SYNC() +#else +// Enable the instruction cache +#define HAL_ICACHE_ENABLE() \ + asm volatile ("mtspr 560, %0;" /* IC_CST */ \ + "isync" \ + : : "r" (IC_CMD_CE)) + +// Disable the instruction cache +#define HAL_ICACHE_DISABLE() \ + asm volatile ("mtspr 560, %0;" /* IC_CST */ \ + "isync" \ + : : "r" (IC_CMD_CD)) + +// Invalidate the entire cache +#define HAL_ICACHE_INVALIDATE_ALL() \ + asm volatile ("mtspr 560, %0;" /* IC_CST */ \ + "isync" \ + : : "r" (IC_CMD_IA)) + +// Synchronize the contents of the cache with memory. +#define HAL_ICACHE_SYNC() +#endif + +// Set the instruction cache refill burst size +//#define HAL_ICACHE_BURST_SIZE(_size_) + +// Load the contents of the given address range into the instruction cache +// and then lock the cache so that it stays there. +//#define HAL_ICACHE_LOCK(_base_, _size_) + +// Undo a previous lock operation +//#define HAL_ICACHE_UNLOCK(_base_, _size_) + +//----------------------------------------------------------------------------- +// Instruction cache line control + +// Invalidate cache lines in the given range without writing to memory. +//#define HAL_ICACHE_INVALIDATE( _base_ , _size_ ) + +#endif + +//----------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_CACHE_H +// End of hal_cache.h diff --git a/packages/hal/powerpc/arch/current/include/hal_intr.h b/packages/hal/powerpc/arch/current/include/hal_intr.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/include/hal_intr.h @@ -0,0 +1,291 @@ +#ifndef CYGONCE_HAL_INTR_H +#define CYGONCE_HAL_INTR_H + +//============================================================================= +// +// hal_intr.h +// +// HAL Interrupt and clock support +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: Define Interrupt support +// Description: The macros defined here provide the HAL APIs for handling +// interrupts and the clock. +// +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include + +//----------------------------------------------------------------------------- +// PowerPC exception vectors. + +#define CYG_VECTOR_RESERVED_0 0 +#define CYG_VECTOR_RESET 1 +#define CYG_VECTOR_MACHINE_CHECK 2 +#define CYG_VECTOR_DSI 3 +#define CYG_VECTOR_ISI 4 +#define CYG_VECTOR_INTERRUPT 5 +#define CYG_VECTOR_ALIGNMENT 6 +#define CYG_VECTOR_PROGRAM 7 +#define CYG_VECTOR_FP_UNAVAILABLE 8 +#define CYG_VECTOR_DECREMENTER 9 +#define CYG_VECTOR_RESERVED_A 10 +#define CYG_VECTOR_RESERVED_B 11 +#define CYG_VECTOR_SYSTEM_CALL 12 +#define CYG_VECTOR_TRACE 13 +#define CYG_VECTOR_FP_ASSIST 14 + +#ifdef CYG_HAL_POWERPC_MP860 +#define CYG_VECTOR_RESERVED_F 15 +#define CYG_VECTOR_SW_EMUL 16 +#define CYG_VECTOR_ITLB_MISS 17 +#define CYG_VECTOR_DTLB_MISS 18 +#define CYG_VECTOR_ITLB_ERROR 19 +#define CYG_VECTOR_DTLB_ERROR 20 +#define CYG_VECTOR_RESERVED_15 21 +#define CYG_VECTOR_RESERVED_16 22 +#define CYG_VECTOR_RESERVED_17 23 +#define CYG_VECTOR_RESERVED_18 24 +#define CYG_VECTOR_RESERVED_19 25 +#define CYG_VECTOR_RESERVED_1A 26 +#define CYG_VECTOR_RESERVED_1B 27 +#define CYG_VECTOR_DATA_BP 28 +#define CYG_VECTOR_INSTRUCTION_BP 29 +#define CYG_VECTOR_PERIPHERAL_BP 30 +#define CYG_VECTOR_NMI 31 +#endif + + + +#define CYG_VSR_MIN 0 +#define CYG_VSR_MAX 14 +#define CYG_VSR_COUNT 15 + +#define CYG_ISR_MIN 0 +#define CYG_ISR_MAX 14 +#define CYG_ISR_COUNT 15 + +#ifdef CYG_HAL_POWERPC_MP860 +#define CYG_EXCEPTION_MIN 0 +#define CYG_EXCEPTION_MAX 31 +#define CYG_EXCEPTION_COUNT 32 +#else +#define CYG_EXCEPTION_MIN 0 +#define CYG_EXCEPTION_MAX 14 +#define CYG_EXCEPTION_COUNT 15 +#endif + + +// The vector used by the Real time clock +#define CYG_VECTOR_RTC CYG_VECTOR_DECREMENTER + +//----------------------------------------------------------------------------- +// Static data used by HAL + +// ISR tables +externC volatile CYG_ADDRESS hal_interrupt_handlers[CYG_ISR_COUNT]; +externC volatile CYG_ADDRWORD hal_interrupt_data[CYG_ISR_COUNT]; +externC volatile CYG_ADDRESS hal_interrupt_objects[CYG_ISR_COUNT]; + +// VSR table +externC volatile CYG_ADDRESS hal_vsr_table[CYG_VSR_COUNT]; + +//----------------------------------------------------------------------------- +// Default ISR + +externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data); + +//----------------------------------------------------------------------------- +// Interrupt state storage + +typedef cyg_uint32 CYG_INTERRUPT_STATE; + +//----------------------------------------------------------------------------- +// Interrupt control macros + +#define HAL_DISABLE_INTERRUPTS(_old_) \ + asm volatile ( \ + "mfmsr %0;" \ + "lis 4,0;" \ + "ori 4,4,0x8000 ;" \ + "not 5,4;" \ + "and 5,%0,5;" \ + "mtmsr 5;" \ + "and %0,%0,4" \ + : "=r"(_old_) \ + : \ + : "r4", "r5" \ + ); + +#define HAL_ENABLE_INTERRUPTS() \ + asm volatile ( \ + "mfmsr 3;" \ + "lis 4,0;" \ + "ori 4,4,0x8000 ;" \ + "or 3,3,4;" \ + "mtmsr 3;" \ + : \ + : \ + : "r3", "r4" \ + ); + +#define HAL_RESTORE_INTERRUPTS(_old_) \ + asm volatile ( \ + "mfmsr 3;" \ + "lis 4,0;" \ + "ori 4,4,0x8000 ;" \ + "and 4,%0,4;" \ + "or 4,3,4;" \ + "mtmsr 4;" \ + : \ + : "r"(_old_) \ + : "r3", "r4" \ + ); + +// FIXME: using andi with side-effect on cc would be better but causes +// compiler problem. +#define HAL_QUERY_INTERRUPTS(_old_) \ + asm volatile ( \ + "mfmsr %0;" \ + "lis 4,0;" \ + "ori 4,4,0x8000;" \ + "and %0,%0,4;" \ + : "=r"(_old_) \ + : \ + : "r4" \ + ); + +//----------------------------------------------------------------------------- +// Vector translation. +// Only one vector is available for external interrupts. No translation +// required. + +#define HAL_TRANSLATE_VECTOR(_vector_,_index_) (_index_) = (_vector_) + + +//----------------------------------------------------------------------------- +// Interrupt and VSR attachment macros + +#define HAL_INTERRUPT_ATTACH( _vector_, _isr_, _data_, _object_ ) \ + CYG_MACRO_START \ + cyg_uint32 _index_ = ((_vector_)>>3)&1; \ + \ + if( hal_interrupt_handlers[_index_] == (CYG_ADDRESS)hal_default_isr ) \ + { \ + hal_interrupt_handlers[_index_] = (CYG_ADDRESS)_isr_; \ + hal_interrupt_data[_index_] = (CYG_ADDRWORD) _data_; \ + hal_interrupt_objects[_index_] = (CYG_ADDRESS)_object_; \ + } \ + CYG_MACRO_END + +#define HAL_INTERRUPT_DETACH( _vector_, _isr_ ) \ + CYG_MACRO_START \ + cyg_uint32 _index_ = ((_vector_)>>3)&1; \ + \ + if( hal_interrupt_handlers[_index_] == (CYG_ADDRESS)_isr_ ) \ + { \ + hal_interrupt_handlers[_index_] = (CYG_ADDRESS)hal_default_isr; \ + hal_interrupt_data[_index_] = 0; \ + hal_interrupt_objects[_index_] = 0; \ + } \ + CYG_MACRO_END + +#define HAL_VSR_GET( _vector_, _pvsr_ ) \ + *(CYG_ADDRESS *)(_pvsr_) = hal_vsr_table[_vector_]; + + +#define HAL_VSR_SET( _vector_, _vsr_, _poldvsr_ ) \ + CYG_MACRO_START \ + if( _poldvsr_ != NULL ) \ + *(CYG_ADDRESS *)_poldvsr_ = hal_vsr_table[_vector_]; \ + hal_vsr_table[_vector_] = (CYG_ADDRESS)_vsr_; \ + CYG_MACRO_END + +//----------------------------------------------------------------------------- +// Interrupt controller access + +// These are not defined since individual interrupts cannot be masked +// without the help of an external interrupt controller. + +#define HAL_INTERRUPT_MASK( _vector_ ) + +#define HAL_INTERRUPT_UNMASK( _vector_ ) + +#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ ) + +#define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ ) + +#define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ ) + +//----------------------------------------------------------------------------- +// Clock control + +#define HAL_CLOCK_INITIALIZE( _period_ ) \ + CYG_MACRO_START \ + cyg_uint32 period = _period_; \ + asm volatile ( \ + "mtdec %0;" \ + : \ + : "r"(period) \ + ); \ + CYG_MACRO_END + +#define HAL_CLOCK_RESET( _vector_, _period_ ) \ + CYG_MACRO_START \ + cyg_uint32 period = _period_; \ + asm volatile ( \ + "mtdec %0;" \ + : \ + : "r"(period) \ + ); \ + CYG_MACRO_END + +#define HAL_CLOCK_READ( _pvalue_ ) \ + CYG_MACRO_START \ + register cyg_uint32 result; \ + asm volatile( \ + "mfdec %0;" \ + : "=r"(result) \ + ); \ + *(_pvalue_) = CYGNUM_KERNEL_COUNTERS_RTC_PERIOD-result; \ + CYG_MACRO_END + +//----------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_INTR_H +// End of hal_intr.h diff --git a/packages/hal/powerpc/arch/current/include/hal_io.h b/packages/hal/powerpc/arch/current/include/hal_io.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/include/hal_io.h @@ -0,0 +1,169 @@ +#ifndef CYGONCE_HAL_IO_H +#define CYGONCE_HAL_IO_H + +//============================================================================= +// +// hal_io.h +// +// HAL device IO register support. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-02-17 +// Purpose: Define IO register support +// Description: The macros defined here provide the HAL APIs for handling +// device IO control registers. +// +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +//----------------------------------------------------------------------------- +// Enforce in-order IO for all HAL reads/writes using this macro. +#define HAL_IO_BARRIER() \ + asm volatile ( "eieio" ::: "memory") + +//----------------------------------------------------------------------------- +// IO Register address. +// This type is for recording the address of an IO register. + +typedef volatile CYG_ADDRWORD HAL_IO_REGISTER; + +//----------------------------------------------------------------------------- +// BYTE Register access. +// Individual and vectorized access to 8 bit registers. + +#define HAL_READ_UINT8( _register_, _value_ ) \ + CYG_MACRO_START \ + ((_value_) = *((volatile CYG_BYTE *)(_register_))); \ + HAL_IO_BARRIER (); \ + CYG_MACRO_END + +#define HAL_WRITE_UINT8( _register_, _value_ ) \ + CYG_MACRO_START \ + (*((volatile CYG_BYTE *)(_register_)) = (_value_)); \ + HAL_IO_BARRIER (); \ + CYG_MACRO_END + +#define HAL_READ_UINT8_VECTOR( _register_, _buf_, _count_, _step_ ) \ + CYG_MACRO_START \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) { \ + (_buf_)[_i_] = ((volatile CYG_BYTE *)(_register_))[_j_]; \ + HAL_IO_BARRIER (); \ + } \ + CYG_MACRO_END + +#define HAL_WRITE_UINT8_VECTOR( _register_, _buf_, _count_, _step_ ) \ + CYG_MACRO_START \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) { \ + ((volatile CYG_BYTE *)(_register_))[_j_] = (_buf_)[_i_]; \ + HAL_IO_BARRIER (); \ + } \ + CYG_MACRO_END + + +//----------------------------------------------------------------------------- +// 16 bit access. +// Individual and vectorized access to 16 bit registers. + +#define HAL_READ_UINT16( _register_, _value_ ) \ + CYG_MACRO_START \ + ((_value_) = *((volatile CYG_WORD16 *)(_register_))); \ + HAL_IO_BARRIER (); \ + CYG_MACRO_END + +#define HAL_WRITE_UINT16( _register_, _value_ ) \ + CYG_MACRO_START \ + (*((volatile CYG_WORD16 *)(_register_)) = (_value_)); \ + HAL_IO_BARRIER (); \ + CYG_MACRO_END + +#define HAL_READ_UINT16_VECTOR( _register_, _buf_, _count_, _step_ ) \ + CYG_MACRO_START \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) { \ + (_buf_)[_i_] = ((volatile CYG_WORD16 *)(_register_))[_j_]; \ + HAL_IO_BARRIER (); \ + } \ + CYG_MACRO_END + +#define HAL_WRITE_UINT16_VECTOR( _register_, _buf_, _count_, _step_ ) \ + CYG_MACRO_START \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) { \ + ((volatile CYG_WORD16 *)(_register_))[_j_] = (_buf_)[_i_]; \ + HAL_IO_BARRIER (); \ + } \ + CYG_MACRO_END + +//----------------------------------------------------------------------------- +// 32 bit access. +// Individual and vectorized access to 32 bit registers. + +#define HAL_READ_UINT32( _register_, _value_ ) \ + CYG_MACRO_START \ + ((_value_) = *((volatile CYG_WORD32 *)(_register_))); \ + HAL_IO_BARRIER (); \ + CYG_MACRO_END + +#define HAL_WRITE_UINT32( _register_, _value_ ) \ + CYG_MACRO_START \ + (*((volatile CYG_WORD32 *)(_register_)) = (_value_)); \ + HAL_IO_BARRIER (); \ + CYG_MACRO_END + +#define HAL_READ_UINT32_VECTOR( _register_, _buf_, _count_, _step_ ) \ + CYG_MACRO_START \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) { \ + (_buf_)[_i_] = ((volatile CYG_WORD32 *)(_register_))[_j_]; \ + HAL_IO_BARRIER (); \ + } \ + CYG_MACRO_END + +#define HAL_WRITE_UINT32_VECTOR( _register_, _buf_, _count_, _step_ ) \ + CYG_MACRO_START \ + cyg_count32 _i_,_j_; \ + for( _i_ = 0, _j_ = 0; _i_ < (_count_); _i_++, _j_ += (_step_)) { \ + ((volatile CYG_WORD32 *)(_register_))[_j_] = (_buf_)[_i_]; \ + HAL_IO_BARRIER (); \ + } \ + CYG_MACRO_END + +//----------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_IO_H +// End of hal_io.h diff --git a/packages/hal/powerpc/arch/current/include/pkgconf/hal_powerpc.h b/packages/hal/powerpc/arch/current/include/pkgconf/hal_powerpc.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/include/pkgconf/hal_powerpc.h @@ -0,0 +1,64 @@ +#ifndef CYGONCE_PKGCONF_HAL_POWERPC_H +#define CYGONCE_PKGCONF_HAL_POWERPC_H +// ==================================================================== +// +// pkgconf/hal_powerpc.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_POWERPC { + display "PowerPC architecture" + type radio + parent CYGPKG_HAL + target powerpc + description " + The PowerPC architecture HAL package provides generic + support for this processor architecture. It is also + necessary to select a specific target platform HAL + package." + } + + }}CFG_DATA */ + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_POWERPC_H */ +/* EOF hal_powerpc.h */ diff --git a/packages/hal/powerpc/arch/current/include/ppc.inc b/packages/hal/powerpc/arch/current/include/ppc.inc new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/include/ppc.inc @@ -0,0 +1,153 @@ +##============================================================================= +## +## ppc.inc +## +## PowerPC assembler header file +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1997-10-16 +## Purpose: PowerPC definitions. +## Description: This file contains various definitions and macros that are +## useful for writing assembly code for the PowerPC +## Usage: +## #include +## ... +## +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#------------------------------------------------------------------------------ +# Easier to read names for the registers + + .equ r0, 0 + .equ r1, 1 + .equ r2, 2 + .equ r3, 3 + .equ r4, 4 + .equ r5, 5 + .equ r6, 6 + .equ r7, 7 + .equ r8, 8 + .equ r9, 9 + .equ r10, 10 + .equ r11, 11 + .equ r12, 12 + .equ r13, 13 + .equ r14, 14 + .equ r15, 15 + .equ r16, 16 + .equ r17, 17 + .equ r18, 18 + .equ r19, 19 + .equ r20, 20 + .equ r21, 21 + .equ r22, 22 + .equ r23, 23 + .equ r24, 24 + .equ r25, 25 + .equ r26, 26 + .equ r27, 27 + .equ r28, 28 + .equ r29, 29 + .equ r30, 30 + .equ r31, 31 + + .equ sp, r1 + +#------------------------------------------------------------------------------ +# The names of some special purpose registers + + .equ dsisr, 18 + .equ dar , 19 + .equ dec , 22 + .equ sprg0, 272 + .equ sprg1, 273 + .equ sprg2, 274 + .equ sprg3, 275 + .equ pvr , 287 + .equ hid0 , 1008 + +#ifdef CYG_HAL_POWERPC_MP860 + .equ ic_cst,560 + .equ dc_cst,568 + .equ der , 149 +#endif + +#------------------------------------------------------------------------------ +# Some useful coding macros + + # Load immediate word, has to be done with 2 instructions + .macro lwi reg,val + lis \reg,\val@H + ori \reg,\reg,\val@L + .endm + + # Move from HID0 hw control register + .macro mfhid0 reg + mfspr \reg,hid0 + .endm + +#------------------------------------------------------------------------------ +# Exception, interrupt and thread context save area layout + + # These first 36 words are common to all + # saved states + .equ ppcreg_regs, 0 # 32 integer registers + .equ ppcreg_cr, 32*4 + .equ ppcreg_xer, 33*4 + .equ ppcreg_lr, 34*4 + .equ ppcreg_ctr, 35*4 + .equ ppcreg_context_size, 36*4 + + # The following are only saved on exceptions and interrupts + .equ ppcreg_vector, 36*4 # exception vector + .equ ppcreg_msr, 37*4 # MSR at time of exception + .equ ppcreg_pc, 38*4 # PC at time of exception + + # The following are only saved on exceptions, and are for information + # only. They are not restored with the rest of the state. + .equ ppcreg_hid0, 39*4 # HID0 HW control register + .equ ppcreg_dar, 40*4 # data address register + .equ ppcreg_dsisr, 41*4 # DSI status register + .equ ppcreg_pvr, 42*4 # processor version + .equ ppcreg_exception_size, 43*4 + + # FIXME possibly need BAT and segment registers here too + # FIXME also decide what to do with FP state. + + .equ ppc_stack_frame_size, 56 # size of a stack frame + + .equ ppc_exception_safety, 0x100 # safety net for exceptions + .equ ppc_exception_decrement, ppcreg_exception_size+ppc_exception_safety + + +#------------------------------------------------------------------------------ +# end of ppc.inc diff --git a/packages/hal/powerpc/arch/current/include/ppc_regs.h b/packages/hal/powerpc/arch/current/include/ppc_regs.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/include/ppc_regs.h @@ -0,0 +1,169 @@ +#ifndef CYGONCE_HAL_PPC_REGS_H +#define CYGONCE_HAL_PPC_REGS_H + +// ppc_regs.h - register defines for PowerPC processors +// +// Copyright (c) 1998 Cygnus Support +// +// The authors hereby grant permission to use, copy, modify, distribute, +// and license this software and its documentation for any purpose, provided +// that existing copyright notices are retained in all copies and that this +// notice is included verbatim in any distributions. No written agreement, +// license, or royalty fee is required for any of the authorized uses. +// Modifications to this software may be copyrighted by their authors +// and need not follow the licensing terms described here, provided that +// the new terms are clearly indicated on the first page of each file where +// they apply. + +// PPC registers, numbered in the order in which gdb expects to see them. + +#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 + +#define F0 32 +#define F1 33 +#define F2 34 +#define F3 35 +#define F4 36 +#define F5 37 +#define F6 38 +#define F7 39 +#define F8 40 +#define F9 41 +#define F10 42 +#define F11 43 +#define F12 44 +#define F13 45 +#define F14 46 +#define F15 47 +#define F16 48 +#define F17 49 +#define F18 50 +#define F19 51 +#define F20 52 +#define F21 53 +#define F22 54 +#define F23 55 +#define F24 56 +#define F25 57 +#define F26 58 +#define F27 59 +#define F28 60 +#define F29 61 +#define F30 62 +#define F31 63 + +#define PC 64 +#define PS 65 +#define CND 66 +#define LR 67 +#define CNT 68 +#define XER 69 +#define MQ 70 + +// For convenience +#define SP R1 + +#ifdef CYG_HAL_POWERPC_MP860 +// General purpose registers. No floating point registers on MP860. +#define FIRST_GP_REG R0 +#define LAST_GP_REG R31 + +// CPU state registers. +#define FIRST_CS_REG PC +#define LAST_CS_REG MQ +#endif + + +// MSR bits +#define MSR_LE 0x00000001 // little-endian mode enable +#define MSR_RI 0x00000002 // recoverable exception +#define MSR_DR 0x00000010 // data address translation +#define MSR_IR 0x00000020 // instruction address translation +#define MSR_IP 0x00000040 // exception prefix +#define MSR_FE1 0x00000100 // floating-point exception mode 1 +#define MSR_BE 0x00000200 // branch trace enable +#define MSR_SE 0x00000400 // single-step trace enable +#define MSR_FE0 0x00000800 // floating-point exception mode 0 +#define MSR_ME 0x00001000 // machine check enable +#define MSR_FP 0x00002000 // floating-point available +#define MSR_PR 0x00004000 // privilege level +#define MSR_EE 0x00008000 // external interrupt enable +#define MSR_ILE 0x00010000 // exception little-endian mode +#define MSR_POW 0x00040000 // power management enable + + + +#ifdef CYG_HAL_POWERPC_MP860 +// Instruction cache control. +#define IC_CST 560 +#define IC_ADR 561 +#define IC_DAT 562 + +#define IC_CMD_CE 0x02000000 // cache enable +#define IC_CMD_CD 0x04000000 // cache disable +#define IC_CMD_LL 0x06000000 // load & lock +#define IC_CMD_UL 0x08000000 // unlock line +#define IC_CMD_UA 0x0a000000 // unlock all +#define IC_CMD_IA 0x0c000000 // invalidate all + +// Data cache control. +#define DC_CST 568 +#define DC_ADR 569 +#define DC_DAT 570 + +#define DC_CMD_CE 0x02000000 // cache enable +#define DC_CMD_CD 0x04000000 // cache disable +#define DC_CMD_LL 0x06000000 // lock line +#define DC_CMD_UL 0x08000000 // unlock line +#define DC_CMD_UA 0x0a000000 // unlock all +#define DC_CMD_IA 0x0c000000 // invalidate all +#define DC_CMD_FL 0x0e000000 // flush line +#define DC_CMD_SW 0x01000000 // set writethrough +#define DC_CMD_CW 0x03000000 // clear writethrough +#define DC_CMD_SS 0x05000000 // set little endian swap +#define DC_CMD_CS 0x07000000 // clear little endian swap + + +// Internal Memory Map +#define IMM_BASE 0xff000000 // The 860 internal memory map base + +#define IMM_SIPEND (IMM_BASE + 0x010) // Interrupt Pend Register +#define IMM_SIMASK (IMM_BASE + 0x014) // Interrupt Mask +#define IMM_SIEL (IMM_BASE + 0x018) // Interrupt Edge Level Mask +#define IMM_SIVEC (IMM_BASE + 0x01c) // Interrupt Vector + +#define IMM_TBSCR (IMM_BASE + 0x200) // Timebase Status and Control +#endif + +#endif // ifdef CYGONCE_HAL_PPC_REGS_H diff --git a/packages/hal/powerpc/arch/current/include/ppc_stub.h b/packages/hal/powerpc/arch/current/include/ppc_stub.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/include/ppc_stub.h @@ -0,0 +1,119 @@ +#ifndef CYGONCE_HAL_PPC_STUB_H +#define CYGONCE_HAL_PPC_STUB_H + +/* ppc_stub.h - PowerPC-specific definitions for generic stub + * + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#define NUMREGS 71 + +#define REGSIZE( _x_ ) (((_x_) >= F0 && (_x_) <= F31) ? 8 : 4) + +typedef unsigned long target_register_t; + +enum regnames { + R0, R1, R2, R3, R4, R5, R6, R7, + R8, R9, R10, R11, R12, R13, R14, R15, + R16, R17, R18, R19, R20, R21, R22, R23, + R24, R25, R26, R27, R28, R29, R30, R31, + F0, F1, F2, F3, F4, F5, F6, F7, + F8, F9, F10, F11, F12, F13, F14, F15, + F16, F17, F18, F19, F20, F21, F22, F23, + F24, F25, F26, F27, F28, F29, F30, F31, + PC, PS, CND, LR, CNT, XER, MQ +}; + +typedef enum regnames regnames_t; + +#include + +/* If ENABLED is non-zero, supply a memory fault handler that traps + subsequent memory errors and sets _mem_err to 1. Otherwise, memory + faults are processed as exceptions. */ +extern void __set_mem_fault_trap (int enable); + +/* Write C to the current serial port. */ +extern void putDebugChar (int c); + +/* Read one character from the current serial port. */ +extern int getDebugChar (void); + +/* Given a trap value TRAP, return the corresponding signal. */ +extern int __computeSignal (unsigned int trap_number); + +/* Install the standard set of trap handlers for the stub. */ +extern void __install_traps (void); + +/* Return the SPARC trap number corresponding to the last-taken trap. */ +extern int __get_trap_number (void); + +/* Return the currently-saved value corresponding to register REG. */ +extern target_register_t get_register (regnames_t reg); + +/* Store VALUE in the register corresponding to WHICH. */ +extern void put_register (regnames_t which, target_register_t value); + +/* Set the currently-saved pc register value to PC. This also updates NPC + as needed. */ +extern void set_pc (target_register_t pc); + +/* Flush the instruction cache. */ +extern void flush_i_cache (void); + +/* Reset the board. */ +extern void __reset (void); + +/* Set the baud rate for the current serial port. */ +extern void __set_baud_rate (int baud); + +/* Initialize the hardware. */ +extern void initHardware (void); + +/* Set things up so that the next user resume will execute one instruction. + This may be done by setting breakpoints or setting a single step flag + in the saved user registers, for example. */ +void single_step (void); + +/* Clear the single-step state. */ +void clear_single_step (void); + +struct gdb_packet; + +/* Return 1 when a complete packet has been received, 0 if the packet + is not yet complete, or -1 if an erroneous packet was NAKed. */ +int __add_char_to_packet (int character, struct gdb_packet *packet); + +/* If the breakpoint we hit is in the breakpoint() instruction, return a + non-zero value. */ +extern int __is_breakpoint_function (void); + +/* Skip the current instruction. */ +extern void __skipinst (void); + +/* Write the 'T' packet in BUFFER. SIGVAL is the signal the program + received. */ + +extern void __build_t_packet (int sigval, char *buffer); + +extern void install_breakpoints (void); + +/* Address in text section of a breakpoint instruction. */ + +extern void _breakinst (void); + +/* The opcode for a breakpoint instruction. */ + +extern unsigned long __break_opcode (void); + +#endif // ifndef CYGONCE_HAL_PPC_STUB_H diff --git a/packages/hal/powerpc/arch/current/src/PKGconf.mak b/packages/hal/powerpc/arch/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/src/PKGconf.mak @@ -0,0 +1,54 @@ +#============================================================================== +# +# makefile +# +# hal/powerpc/arch/src +# +#============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================== + +PACKAGE := hal_powerpc +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := hal_misc.c context.S ppc_stub.c +OTHER_OBJS := +OTHER_TARGETS := vectors.stamp +OTHER_DEPS := $(PACKAGE)_vectors.d +OTHER_CLEAN := vectors.clean + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + +vectors.stamp: $(PACKAGE)_vectors.o + $(CP) $< $(PREFIX)/lib/vectors.o + @$(TOUCH) $@ + +vectors.clean: + $(RM) $(PREFIX)/lib/vectors.o $(PACKAGE)_vectors.o + $(RM) vectors.stamp + +$(PACKAGE)_vectors.o: $(BUILD_TREE)/pkgconf/pkgconf.mak \ + $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) + + diff --git a/packages/hal/powerpc/arch/current/src/context.S b/packages/hal/powerpc/arch/current/src/context.S new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/src/context.S @@ -0,0 +1,233 @@ +##============================================================================= +## +## context.S +## +## PowerPC context switch code +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1998-04-27 +## Purpose: PowerPC context switch code +## Description: This file contains implementations of the thread context +## switch routines. It also contains the longjmp() and setjmp() +## routines. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +#include "cyg/hal/ppc.inc" + +#------------------------------------------------------------------------------ +# function declaration macro + +#define FUNC_START(name) \ + .type name,@function; \ + .globl name; \ +name: + +#------------------------------------------------------------------------------ +# Configure to use either a minimal or maximal thread state + +#ifdef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM + +#define MIN_SAVE_REG 13 +#define MAX_SAVE_REG 31 + + .macro save_special + .endm + + .macro load_special + .endm +#else + +#define MIN_SAVE_REG 6 +#define MAX_SAVE_REG 31 + + .macro save_special + mfxer r6 + mfctr r7 + stw r6,ppcreg_xer(sp) + stw r7,ppcreg_ctr(sp) + .endm + + .macro load_special + lwz r6,ppcreg_xer(sp) + lwz r7,ppcreg_ctr(sp) + mtxer r6 + mtctr r7 + .endm + +#endif + +#------------------------------------------------------------------------------ +# hal_thread_switch_context +# Switch thread contexts +# R3 = address of sp of next thread to execute +# R4 = address of sp save location of current thread + + +FUNC_START(hal_thread_switch_context) + mr r5,sp # R5 = saved stack pointer + subi sp,sp,ppcreg_context_size # space for state + + # Save registers MIN..MAX + .set _reg,MIN_SAVE_REG + .rept MAX_SAVE_REG+1-MIN_SAVE_REG + stw _reg,(ppcreg_regs+_reg*4)(sp) + .set _reg,_reg+1 + .endr + + stw r0,0(sp) # R0 + stw r5,4(sp) # R5 = real SP, save in R1 slot + stw r2,8(sp) # R2 = TOC + + # CR cannot be treated as a special register since GCC will only + # do partial restore of CR at function exit, depending on which + # of CR2, CR3, and CR4 have been used in the given function. + mfcr r5 # save CR. + stw r5,ppcreg_cr(sp) + + save_special # save special regs + + mflr r5 # save LR == return link for this fn + stw r5,ppcreg_lr(sp) + + stw sp,0(r4) # save SP into save location + + # Now load the destination thread by dropping through + # to hal_thread_load_context + +#------------------------------------------------------------------------------ +# hal_thread_load_context +# Load thread context +# R3 = address of sp of next thread to execute +# Note that this function is also the second half of hal_thread_switch_context +# and is simply dropped into from it. + +FUNC_START(hal_thread_load_context) + + lwz sp,0(r3) # load state directly into SP + + load_special # load special registers + + lwz r5,ppcreg_cr(sp) # restore CR + mtcr r5 + + lwz r5,ppcreg_lr(sp) # get LR as set as return link + mtlr r5 + + # Load registers MIN..MAX + .set _reg,MIN_SAVE_REG + .rept MAX_SAVE_REG+1-MIN_SAVE_REG + lwz _reg,(ppcreg_regs+_reg*4)(sp) + .set _reg,_reg+1 + .endr + + lwz r0,0(sp) # R0 + lwz r2,8(sp) # R2 = TOC + lwz r3,12(sp) # load r3 +# lwz r4,16(sp) # load r4 +# lwz r5,20(sp) # load r5 + + lwz sp,4(sp) # finally restore true SP + + blr # jump to LR + +#------------------------------------------------------------------------------ +# HAL longjmp, setjmp implementations +# hal_setjmp saves only to callee save registers 13-31, r1[sp],r2, cr[2-4] +# and lr into buffer supplied in r3[arg0] + +FUNC_START(hal_setjmp) + mfcr r5 + stw r5,88(r3) + mflr r5 + stw r5,84(r3) + stw r31,80(r3) + stw r30,76(r3) + stw r29,72(r3) + stw r28,68(r3) + stw r27,64(r3) + stw r26,60(r3) + stw r25,56(r3) + stw r24,52(r3) + stw r23,48(r3) + stw r22,44(r3) + stw r21,40(r3) + stw r20,36(r3) + stw r19,32(r3) + stw r18,28(r3) + stw r17,24(r3) + stw r16,20(r3) + stw r15,16(r3) + stw r14,12(r3) + stw r13,8(r3) + stw r2,4(r3) # TOC, optimize out? + stw sp,0(r3) + li r3,0 # return 0 + blr + +# hal_longjmp loads state from r3[arg0] and returns +# and lr into buffer supplied in r3[arg0] + +FUNC_START(hal_longjmp) + lwz r5,88(r3) + mtcr r5 + lwz r5,84(r3) + mtlr r5 + lwz r31,80(r3) + lwz r30,76(r3) + lwz r29,72(r3) + lwz r28,68(r3) + lwz r27,64(r3) + lwz r26,60(r3) + lwz r25,56(r3) + lwz r24,52(r3) + lwz r23,48(r3) + lwz r22,44(r3) + lwz r21,40(r3) + lwz r20,36(r3) + lwz r19,32(r3) + lwz r18,28(r3) + lwz r17,24(r3) + lwz r16,20(r3) + lwz r15,16(r3) + lwz r14,12(r3) + lwz r13,8(r3) + lwz r2,4(r3) + lwz sp,0(r3) + mr r3,r4 # return r4[arg1] + blr + + + +#------------------------------------------------------------------------------ +# end of context.S diff --git a/packages/hal/powerpc/arch/current/src/hal_misc.c b/packages/hal/powerpc/arch/current/src/hal_misc.c new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/src/hal_misc.c @@ -0,0 +1,130 @@ +//============================================================================= +// +// hal_misc.c +// +// HAL miscellaneous functions +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-11-12 +// Purpose: HAL miscellaneous functions +// Description: This file contains miscellaneous functions provided by the +// HAL. +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include +#include // tracing macros +#include // assertion macros + +#include // HAL header + +//--------------------------------------------------------------------------- + +void cyg_hal_invoke_constructors (void) +{ + static int initialized = 0; + + if (! initialized) + { + typedef void (*pfunc) (void); + extern pfunc __CTOR_LIST__[]; + extern pfunc __CTOR_END__[]; + pfunc *p; + + initialized = 1; + + for (p = &__CTOR_END__[0]-1; p >= __CTOR_LIST__; p--){ + (*p) (); + } + } +} + +// Override any __eabi the compiler might generate. We don't want +// constructors to be called twice. +void __eabi (void) {} + +//--------------------------------------------------------------------------- +// First level C exception handler. + +externC void __handle_exception (void); + +externC HAL_SavedRegisters *_hal_registers; + +void exception_handler(HAL_SavedRegisters *regs) +{ +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + + // Set the pointer to the registers of the current exception + // context. At entry the GDB stub will expand the + // HAL_SavedRegisters structure into a (bigger) register array. + _hal_registers = regs; + + __handle_exception(); + +#elif defined(CYGFUN_HAL_COMMON_KERNEL_SUPPORT) && defined(CYGPKG_HAL_EXCEPTIONS) + + // We should decode the vector and pass a more appropriate + // value as the second argument. For now we simply pass a + // pointer to the saved registers. We should also divert + // breakpoint and other debug vectors into the debug stubs. + + deliver_exception( regs->vector>>8, (CYG_ADDRWORD)regs ); + +#else + + CYG_FAIL("Exception!!!"); + +#endif + + return; +} + +//--------------------------------------------------------------------------- +// Default ISR + +externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) +{ + CYG_TRACE1(true, "Interrupt: %d", vector); + CYG_FAIL("Spurious Interrupt!!!"); + return 0; +} + +//--------------------------------------------------------------------------- +// Idle thread action + +void hal_idle_thread_action( cyg_uint32 count ) +{ +} + +//--------------------------------------------------------------------------- +// End of hal_misc.c diff --git a/packages/hal/powerpc/arch/current/src/ppc_stub.c b/packages/hal/powerpc/arch/current/src/ppc_stub.c new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/src/ppc_stub.c @@ -0,0 +1,303 @@ +/* ppc_stub.c - helper functions for stub, generic to all PowerPC processors + * + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +#include + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + +#ifdef CYG_HAL_POWERPC_SIM +#error "GDB Stub support not implemented for PPC SIM" +#endif + +#include +#include +#include +#include + +#ifdef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT +#include // dbg_currthread_id +#endif + +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 /* interrupt */ +#define SIGQUIT 3 /* quit */ +#define SIGILL 4 /* illegal instruction (not reset when caught) */ +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGIOT 6 /* IOT instruction */ +#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ +#define SIGEMT 7 /* EMT instruction */ +#define SIGFPE 8 /* floating point exception */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGSEGV 11 /* segmentation violation */ +#define SIGSYS 12 /* bad argument to system call */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 /* software termination signal from kill */ + +/* Saved registers. */ + +HAL_SavedRegisters *_hal_registers; + +target_register_t * _registers; /* A pointer to the current set of registers */ +target_register_t registers[NUMREGS]; +target_register_t alt_registers[NUMREGS] ; /* Thread or saved process state */ + + +/* Given a trap value TRAP, return the corresponding signal. */ + +int __computeSignal (unsigned int trap_number) +{ + switch (trap_number) + { + case CYG_VECTOR_MACHINE_CHECK: + /* Machine check */ + case CYG_VECTOR_DSI: + /* Data access */ + return SIGSEGV; + + case CYG_VECTOR_ISI: + /* Instruction access (Ifetch) */ + case CYG_VECTOR_ALIGNMENT: + /* Data access */ + return SIGBUS; + + case CYG_VECTOR_INTERRUPT: + /* External interrupt */ + return SIGINT; + + case CYG_VECTOR_TRACE: + /* Instruction trace */ + return SIGTRAP; + + case CYG_VECTOR_PROGRAM: + switch ((get_register (PS) >> 17) & 0xf){ + case 1: /* trap */ + return SIGTRAP; + case 2: /* privileged instruction */ + case 4: /* illegal instruction */ + return SIGILL; + case 8: /* floating point */ + return SIGFPE; + default: /* should never happen! */ + return SIGTERM; + } + + case CYG_VECTOR_RESERVED_A: + case CYG_VECTOR_RESERVED_B: + return SIGILL; + + case CYG_VECTOR_FP_UNAVAILABLE: + /* FPU disabled */ + case CYG_VECTOR_FP_ASSIST: + /* FPU assist */ + return SIGFPE; + + case CYG_VECTOR_DECREMENTER: + /* Decrementer alarm */ + return SIGALRM; + + case CYG_VECTOR_SYSTEM_CALL: + /* System call */ + return SIGSYS; + +#ifdef CYG_HAL_POWERPC_MP860 + case CYG_VECTOR_SW_EMUL: + /* A SW_EMUL is generated instead of PROGRAM for illegal + instructions. */ + return SIGILL; + + case CYG_VECTOR_DATA_BP: + case CYG_VECTOR_INSTRUCTION_BP: + case CYG_VECTOR_PERIPHERAL_BP: + case CYG_VECTOR_NMI: + /* Developer port debugging exceptions. */ + return SIGTRAP; + + case CYG_VECTOR_ITLB_MISS: + case CYG_VECTOR_DTLB_MISS: + /* Software reload of TLB required. */ + return SIGTRAP; + + case CYG_VECTOR_ITLB_ERROR: + /* Invalid instruction access. */ + return SIGBUS; + + case CYG_VECTOR_DTLB_ERROR: + /* Invalid data access. */ + return SIGSEGV; +#endif + + default: + return SIGTERM; + } +} + + +/* Return the trap number corresponding to the last-taken trap. */ + +int __get_trap_number (void) +{ + // The vector is not not part of the GDB register set so get it + // directly from the save context. + return _hal_registers->vector >> 8; +} + +// Return the currently-saved value corresponding to register REG of +// the exception context. +target_register_t get_register (regnames_t reg) +{ + return registers[reg]; +} + +// Store VALUE in the register corresponding to WHICH in the exception +// context. +void put_register (regnames_t which, target_register_t value) +{ + registers[which] = value; +} + + +/* Set the currently-saved pc register value to PC. This also updates NPC + as needed. */ + +void set_pc (target_register_t pc) +{ + put_register (PC, pc); +} + + +/*---------------------------------------------------------------------- + * Single-step support + */ + +/* Set things up so that the next user resume will execute one instruction. + This may be done by setting breakpoints or setting a single step flag + in the saved user registers, for example. */ + +static target_register_t irq_state; + +void single_step (void) +{ + target_register_t msr = get_register (PS); + + // Set single-step flag in the exception context. + msr |= (MSR_SE | MSR_BE); + // Disable interrupts. + irq_state = msr & MSR_EE; + msr &= ~MSR_EE; + + put_register (PS, msr); +} + +/* Clear the single-step state. */ + +void clear_single_step (void) +{ + target_register_t msr = get_register (PS); + + // Clear single-step flag in the exception context. + msr &= ~(MSR_SE | MSR_BE); + // Restore interrupt state. + // FIXME: Should check whether the executed instruction changed the + // interrupt state - or single-stepping a MSR changing instruction + // may result in a wrong EE. Not a very likely scenario though. + msr |= irq_state; + + put_register (PS, msr); +} + + +void install_breakpoints (void) +{ + /* NOP since single-step HW exceptions are used instead of + breakpoints. */ +} + + +/* If the breakpoint we hit is in the breakpoint() instruction, return a + non-zero value. */ + +int +__is_breakpoint_function () +{ + return get_register (PC) == (target_register_t)&_breakinst; +} + + +/* Skip the current instruction. Since this is only called by the + stub when the PC points to a breakpoint or trap instruction, + we can safely just skip 4. */ + +void __skipinst (void) +{ + put_register (PC, get_register (PC) + 4); +} + + +/* Write the 'T' packet in BUFFER. SIGVAL is the signal the program + received. */ + +void __build_t_packet (int sigval, char *buf) +{ + target_register_t addr; + char *ptr = buf; + target_register_t *sp; + + sp = (target_register_t *) get_register (SP); + + *ptr++ = 'T'; + *ptr++ = __tohex (sigval >> 4); + *ptr++ = __tohex (sigval); + +#ifdef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT + // Include thread ID if thread manipulation is required. + { + int id; + + *ptr++ = 't'; + *ptr++ = 'h'; + *ptr++ = 'r'; + *ptr++ = 'e'; + *ptr++ = 'a'; + *ptr++ = 'd'; + *ptr++ = ':'; + + id = dbg_currthread_id (); + ptr = __mem2hex((char *)&id, ptr, sizeof(id), 0); + *ptr++ = ';'; + } +#endif + + + *ptr++ = __tohex (PC >> 4); + *ptr++ = __tohex (PC); + *ptr++ = ':'; + addr = get_register (PC); + ptr = __mem2hex((char *)&addr, ptr, sizeof(addr), 0); + *ptr++ = ';'; + + *ptr++ = __tohex (SP >> 4); + *ptr++ = __tohex (SP); + *ptr++ = ':'; + ptr = __mem2hex((char *)&sp, ptr, sizeof(sp), 0); + *ptr++ = ';'; + + *ptr++ = 0; +} + +#endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS diff --git a/packages/hal/powerpc/arch/current/src/vectors.S b/packages/hal/powerpc/arch/current/src/vectors.S new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/src/vectors.S @@ -0,0 +1,798 @@ +##============================================================================= +## +## vectors.S +## +## PowerPC exception vectors +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1997-10-16 +## Purpose: PowerPC exception vectors +## Description: This file defines the code placed into the exception +## vectors. It also contains the first level default VSRs +## that save and restore state for both exceptions and +## interrupts. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +#ifdef CYGPKG_KERNEL +#include // CYGPKG_KERNEL_INSTRUMENT +#endif + +#include "cyg/hal/ppc.inc" + +#define FUNC_START(name) \ + .type name,@function; \ + .globl name; \ +name: + +#============================================================================== + + .file "vectors.S" + + .extern hal_interrupt_handlers + .extern hal_interrupt_data + .extern hal_interrupt_objects + + .extern cyg_instrument + + .extern hal_hardware_init + +#============================================================================== +# MSR initialization value +# zero all bits except: +# FP = floating point available +# ME = machine check enabled +# IP = vectors at 0xFFFxxxxx (ROM startup only) +# RI = recoverable interrupt + +#ifdef CYG_HAL_STARTUP_ROM +#define CYG_MSR 0x00003042 +#endif +#ifdef CYG_HAL_STARTUP_RAM +#define CYG_MSR 0x00003002 +#endif + +#============================================================================== +# If the following option is enabled, we only save registers up to R12. +# The PowerPC ABI defines registers 13..31 as callee saved and thus we do +# not need to save them when calling C functions. +# Note: Save some extra convenience registers (13-15) + +#ifdef CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT + +#define MAX_SAVE_REG 15 + +#else + +#define MAX_SAVE_REG 31 + +#endif + +#============================================================================== +# Start by defining the exceptions vectors that must be placed at +# locations 0xFFF00000 and 0x00000000. The following code will normally +# be located at 0xFFF00000 in the ROM. It may optionally be copied out +# to 0x00000000 if we want to use the RAM vectors. For this reason this code +# MUST BE POSITION INDEPENDENT. In RAM loaded configurations, this code may +# be placed at 0x00000000 during loading. + + .section ".vectors","ax" + +#------------------------------------------------------------------------------ +# Unused first vector. + +rom_vectors: + lwi r3,_start + mtlr r3 + blr + + .byte 0x11 + .byte 0x22 + .byte 0x33 + .byte 0x44 + +#------------------------------------------------------------------------------ +# Reset vector. + + .p2align 8 + .globl reset_vector + +reset_vector: + lwi r3,_start + mtlr r3 + blr + +#------------------------------------------------------------------------------ +# Macro for generating an exception vector service routine + + .macro exception_vector name + .p2align 8 + .globl __exception_\name +__exception_\name: + mtspr sprg1,r3 # stash some work registers away + mtspr sprg2,r4 + mtspr sprg3,r5 + mfcr r4 # stash CR + li r5,__exception_\name@L # load low half of vector address + srwi r5,r5,6 # shift right by 6 + lwi r3,hal_vsr_table # table base + lwzx r3,r3,r5 # address of vsr + mflr r5 # save link register + mtlr r3 # put vsr address into it + li r3,__exception_\name@L # reload low half of vector address + blr # go to common code + .endm + +#------------------------------------------------------------------------------ +# Define the exception vectors. + + # These are the architecture defined vectors that + # are always present. + + exception_vector machine_check + exception_vector data_storage + exception_vector instruction_storage + exception_vector external + exception_vector alignment + exception_vector program + exception_vector floatingpoint_unavailable + exception_vector decrementer + exception_vector reserved_00a00 + exception_vector reserved_00b00 + exception_vector system_call + exception_vector trace + exception_vector floatingpoint_assist + exception_vector reserved_00f00 + + # There are some additional vectors defined + # on various implementations. + +#ifdef CYG_HAL_POWERPC_MP860 + + # MP860 vectors + + exception_vector software_emu + exception_vector instruction_tlb_miss + exception_vector data_tlb_miss + exception_vector instruction_tlb_error + exception_vector data_tlb_error + exception_vector reserved_01500 + exception_vector reserved_01600 + exception_vector reserved_01700 + exception_vector reserved_01800 + exception_vector reserved_01900 + exception_vector reserved_01A00 + exception_vector reserved_01B00 + exception_vector data_breakpoint + exception_vector instruction_breakpoint + exception_vector peripheral_breakpoint + exception_vector NMI_port + +rom_vectors_end: +#endif + +#============================================================================== +# Real startup code. We jump here from the various reset vectors to set up the +# world. + + .text + .globl _start + +_start: + # Set up MSR + lwi r3,CYG_MSR + mtmsr r3 + +#if defined(CYG_HAL_POWERPC_MP860) && !defined(CYG_HAL_POWERPC_SIM) + # Disable special 860 "development support" which suppresses + # trace exceptions. The CPU seems to hang, not executing from + # offset 0x1e00(?) as expected. + li r3,0 + mtspr der, r3 +#endif + + # Set up global offset table + lwi r2,_GLOBAL_OFFSET_TABLE_ + + # set up time base register to zero + xor r3,r3,r3 + mtspr 284,r3 + xor r4,r4,r4 + mtspr 285,r4 + + # set up stack + lwi sp,__interrupt_stack + mtspr sprg0,sp # save in sprg0 for later use + + # Call platform specific hardware initialization + bl hal_hardware_init + + # optional: initialize BAT registers + +#ifdef CYG_HAL_STARTUP_ROM + + # Copy data from ROM to ram + lwi r3,__rom_data_start # r3 = rom start + lwi r4,__ram_data_start # r4 = ram start + lwi r5,__ram_data_end # r5 = ram end + + cmplw r4,r5 # skip if no data + beq 2f + +1: + lwz r0,0(r3) # get word from ROM + stw r0,0(r4) # store in RAM + addi r3,r3,4 # increment by 1 word + addi r4,r4,4 # increment by 1 word + cmplw r4,r5 # compare + blt 1b # loop if not yet done +2: + +#ifdef CYG_HAL_POWERPC_COPY_VECTORS + # Copy RAM exception vectors from ROM to RAM + lwi r3,rom_vectors # r3 = rom start + lwi r4,0 # r4 = ram start + lwi r5,rom_vectors_end # r5 = rom end + + cmplw r3,r5 # skip if no vectors + beq 2f + +1: + lwz r0,0(r3) # get word from ROM + stw r0,0(r4) # store in RAM + addi r3,r3,4 # increment by 1 word + addi r4,r4,4 # increment by 1 word + cmplw r3,r5 # compare + blt 1b # loop if not yet done +2: +#endif + +#endif + + # clear BSS + + lwi r3,__bss_start # r3 = start + lwi r4,_end # r4 = end + li r0,0 # r0 = 0 + cmplw r3,r4 # skip if no bss + beq 2f + +1: + stw r0,0(r3) # store zero + addi r3,r3,4 # increment by 1 word + cmplw r3,r4 # compare + blt 1b # loop if not yet done +2: + + # set up stack to call cyg_start + subi sp,sp,12 # make space on stack + li r0,0 + stw r0,0(sp) # clear back chain + stw r0,8(sp) # zero return pc + stwu sp,-ppc_stack_frame_size(sp) # create new stack frame + # for the call to __eabi + # and cyg_start + +#ifdef CYG_KERNEL_USE_INIT_PRIORITY + + .extern cyg_hal_invoke_constructors + bl cyg_hal_invoke_constructors # call c++ constructors + +#endif + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + .extern set_debug_traps + bl set_debug_traps +#endif + + .extern cyg_start + bl cyg_start # call cyg_start +9: + b 9b # if we return, loop + +#------------------------------------------------------------------------------ +# This code handles the common part of all exception handlers. +# It saves the machine state onto the stack and then calls +# a "C" routine to do the rest of the work. This work may result +# in thread switches, and changes to the saved state. When we return +# here the saved state is restored and execution is continued. + + .text + + .extern __default_exception_vsr +__default_exception_vsr: + + # We come here with all register containing their + # pre-exception values except: + # R3 = ls 16 bits of vector address + # R4 = saved CR + # R5 = saved LR + # LR = VSR address + # SPRG1 = old R3 + # SPRG2 = old R4 + # SPRG3 = old R5 + # SRR0 = old PC + # SRR1 = old MSR + + subi r1,r1,ppc_exception_decrement + # leave space for registers and + # a safety margin + + # First, save away some registers + stw r3,ppcreg_vector(r1) # stash vector + stw r4,ppcreg_cr(r1) # stash CR + stw r5,ppcreg_lr(r1) # stash LR + + mfspr r3,sprg1 # save original R3 + stw r3,ppcreg_regs+3*4(r1) + mfspr r4,sprg2 # save original R4 + stw r4,ppcreg_regs+4*4(r1) + mfspr r5,sprg3 # save original R5 + stw r5,ppcreg_regs+5*4(r1) + + stw r0,ppcreg_regs(r1) # save R0 + stw r2,ppcreg_regs+2*4(r1) # save R2 + + mr r3,r1 # recreate original R1 + addi r3,r3,ppc_exception_decrement + stw r3,ppcreg_regs+1*4(r1) # and save it in state + + # Save registers 6..31 + .set _reg,6 + .rept MAX_SAVE_REG+1-6 + stw _reg,(ppcreg_regs+_reg*4)(r1) + .set _reg,_reg+1 + .endr + + # get remaining CPU registers + mfxer r3 + mfctr r5 + mfdar r6 + mfdsisr r7 + mfpvr r8 + mfsrr0 r9 + mfsrr1 r10 + + # and store them + stw r3,ppcreg_xer(r1) + stw r5,ppcreg_ctr(r1) + stw r6,ppcreg_dar(r1) + stw r7,ppcreg_dsisr(r1) + stw r8,ppcreg_pvr(r1) + stw r9,ppcreg_pc(r1) + stw r10,ppcreg_msr(r1) + + # The entire CPU state is now stashed on the stack, + # call into C to do something with it. + + mr r3,sp # R3 = register dump + + subi sp,sp,ppc_stack_frame_size # make a null frame + + li r0,0 # R0 = 0 + stw r0,0(sp) # backchain = 0 + stw r0,8(sp) # return pc = 0 + + stwu sp,-ppc_stack_frame_size(sp) # create new stack frame + # where C code can save LR + + lwi r5,restore_state # get return link + mtlr r5 # to link register + + .extern exception_handler + b exception_handler # call C code, r3 = registers + + # When the call returns it will go to restore_state below. + + +#------------------------------------------------------------------------------ +# Common interrupt handling code. + + .extern __default_interrupt_vsr +__default_interrupt_vsr: + + # We come here with all register containing their + # pre-exception values except: + # R3 = ls 16 bits of vector address + # R4 = saved CR + # R5 = saved LR + # LR = VSR address + # SPRG1 = old R3 + # SPRG2 = old R4 + # SPRG3 = old R5 + # SRR0 = old PC + # SRR1 = old MSR + + + subi r1,r1,ppc_exception_decrement + # leave space for registers and + # a safety margin + + stw r3,ppcreg_vector(r1) # stash vector + stw r4,ppcreg_cr(r1) # stash CR + stw r5,ppcreg_lr(r1) # stash LR + + mfspr r3,sprg1 # save original R3 + stw r3,ppcreg_regs+3*4(r1) + mfspr r4,sprg2 # save original R4 + stw r4,ppcreg_regs+4*4(r1) + mfspr r5,sprg3 # save original R5 + stw r5,ppcreg_regs+5*4(r1) + + stw r0,ppcreg_regs(r1) # save R0 + stw r2,ppcreg_regs+2*4(r1) # save R2 + + mr r3,r1 # recreate original R1 + addi r3,r3,ppc_exception_decrement + stw r3,ppcreg_regs+1*4(r1) # and save it in state + + # Save registers 6..31 + .set _reg,6 + .rept MAX_SAVE_REG+1-6 + stw _reg,(ppcreg_regs+_reg*4)(r1) + .set _reg,_reg+1 + .endr + + # get remaining CPU registers + mfxer r3 + mfctr r5 + mfsrr0 r6 + mfsrr1 r7 + + # and store them + stw r3,ppcreg_xer(r1) + stw r5,ppcreg_ctr(r1) + stw r6,ppcreg_pc(r1) + stw r7,ppcreg_msr(r1) + + # The entire CPU state is now stashed on the stack, + # increment the scheduler lock and call the ISR + # for this vector. + +#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT + .extern _18Cyg_Scheduler_Base.sched_lock + lwi r3,_18Cyg_Scheduler_Base.sched_lock + lwz r4,0(r3) + addi r4,r4,1 + stw r4,0(r3) +#endif + + mr r13,sp # R13 = register dump + +#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK + lwi r3,__interrupt_stack # stack top + lwi r4,__interrupt_stack_base # stack base + sub. r5,sp,r4 # sp - base + blt 1f # if < 0 - not on istack + sub. r5,r3,sp # top - sp + bgt 2f # if > 0 - already on istack + +1: mr sp,r3 # switch to istack + +2: stwu r13,-4(sp) # save old SP on stack + +#endif + + subi sp,sp,ppc_stack_frame_size # make a null frame + + li r0,0 # R0 = 0 + stw r0,0(sp) # backchain = 0 + stw r0,8(sp) # return pc = 0 + + stwu sp,-ppc_stack_frame_size(sp) # create new stack frame + # where C code can save LR + +#if defined(CYGPKG_KERNEL_INSTRUMENT) && defined(CYGDBG_KERNEL_INSTRUMENT_INTR) + + lwi r3,0x0301 # r3 = type = INTR,RAISE + lwz r4,ppcreg_vector(r13) # arg1 = vector address + srwi r4,r4,8 # arg1 = vector number + xor r5,r5,r5 # arg2 = 0 + bl cyg_instrument # call instrument function + +#endif + +#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT + .extern cyg_hal_gdb_isr + lwz r3,ppcreg_vector(r13) # retrieve vector number + cmpwi r3,0x0500 # if external, call HAL + bne 1f # GDB ISR which will check + bl cyg_hal_gdb_isr # for serial receive irq. + cmpwi r3,0x0000 # Call ISR proper? + beq 2f # (r3 is 0 when skipping + # to avoid DSR call) +1: +#endif + + lwz r3,ppcreg_vector(r13) # retrieve vector number + srwi r15,r3,11 # isolate bit 11 of vector id + slwi r15,r15,2 # convert to word offset + + srwi r3,r3,8 # R3 = vector no argument + + lwi r6,hal_interrupt_handlers # get interrupt handler table + lwzx r6,r6,r15 # load routine pointer + + lwi r4,hal_interrupt_data # get interrupt data table + lwzx r4,r4,r15 # load data pointer + # R4 = data argument + + mtctr r6 # put isr address in ctr + + bctrl # branch to ctr reg and link + +#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT + # If interrupt was caused by GDB, the ISR call above + # is skipped by jumping here. +2: +#endif + +#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK + + # If we are returning from the last nested interrupt, move back + # to the thread stack. interrupt_end() must be called on the + # thread stack since it potentially causes a context switch. + # Since we have arranged for the top of stack location to + # contain the sp we need to go back to here, just pop it off + # and put it in SP. + + + lwz sp,ppc_stack_frame_size*2(sp) # sp = *sp + + subi sp,sp,ppc_stack_frame_size # make a null frame + + li r0,0 # R0 = 0 + stw r0,0(sp) # backchain = 0 + stw r0,8(sp) # return pc = 0 + + stwu sp,-ppc_stack_frame_size(sp) # create new stack frame + # where C code can save LR +#endif + +#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT + + # We only need to call _interrupt_end() when there is a kernel + # present to do any tidying up. + + # on return r3 bit 1 will indicate whether a DSR is + # to be posted. Pass this together with a pointer to + # the interrupt object we have just used to the + # interrupt tidy up routine. + + # Note that r13 and r15 are defined to be preserved across + # calls by the calling convention, so they still contain + # the register dump and the vector number respectively. + + lwi r4,hal_interrupt_objects # get interrupt object table + lwzx r4,r4,r15 # load object pointer + + lwz r6,ppcreg_msr(r13) # restore msr, including + mtmsr r6 # interrupt enable + + mr r5,r13 # arg3 = saved register dump + + .extern interrupt_end + bl interrupt_end # call into C to finish off +#endif + +restore_state: + # All done, restore CPU state and continue + + addi sp,sp,ppc_stack_frame_size*2 # retrieve CPU state pointer + + # get sprs we want to restore + lwz r3,ppcreg_cr(sp) + lwz r4,ppcreg_pc(sp) + lwz r5,ppcreg_msr(sp) + lwz r6,ppcreg_xer(sp) + lwz r7,ppcreg_lr(sp) + lwz r8,ppcreg_ctr(sp) + + + # stuff some of them into the CPU + mtxer r6 + mtlr r7 + mtctr r8 + + # restore R0 and R2 + lwz r0,ppcreg_regs(sp) + lwz r2,ppcreg_regs+2*4(sp) + + # restore registers 6..31 + .set _reg,6 + .rept MAX_SAVE_REG+1-6 + lwz _reg,(ppcreg_regs+_reg*4)(r1) + .set _reg,_reg+1 + .endr + + # Here all the registers are loaded except + # r1 = ppcregs + # r3 = ccr + # r4 = srr0 = pc + # r5 = srr1 = msr + + # We have to disable interrupts while srr0 and + # srr1 are loaded, since another interrupt will + # destroy them. + + mtcr r3 # set ccr + + lwi r3,0x00003002 # do rest with ints disabled + mtmsr r3 + + mtsrr0 r4 # load old pc + mtsrr1 r5 # load old msr + + lwz r3,ppcreg_regs+3*4(r1) # load r3 value + lwz r4,ppcreg_regs+4*4(r1) # load r4 value + lwz r5,ppcreg_regs+5*4(r1) # load r5 value + lwz r1,ppcreg_regs+1*4(r1) # restore r1 + + sync # settle things down + isync + rfi # and return + +#------------------------------------------------------------------------------ +# This table contains a VSR pointer for each defined exception. +# All of these except 5 and 9 point to the __default_exception_vsr +# above, 5 and 9 point to the __default_interrupt_vsr. Entries in +# this table may be changed using Cyg_Interrupt::set_vsr(). + + .data + + .globl hal_vsr_table +hal_vsr_table: + # Architecture defined vectors + .long __default_exception_vsr # reserved + .long __default_exception_vsr # system reset + .long __default_exception_vsr # machine check + .long __default_exception_vsr # data storage + .long __default_exception_vsr # instruction storage + + .long __default_interrupt_vsr # external interrupt + + .long __default_exception_vsr # alignment + .long __default_exception_vsr # program + .long __default_exception_vsr # floating point unavailable + + .long __default_interrupt_vsr # decrementer + + .long __default_exception_vsr # reserved 0x0a00 + .long __default_exception_vsr # reserved 0x0b00 + .long __default_exception_vsr # system call + .long __default_exception_vsr # trace + .long __default_exception_vsr # floating point assist + .long __default_exception_vsr # reserved 0x0f00 + +#ifdef CYG_HAL_POWERPC_MP860 + + # Implementation defined vectors + .long __default_exception_vsr # software emulation + .long __default_exception_vsr # instruction TLB miss + .long __default_exception_vsr # data TLB miss + .long __default_exception_vsr # instruction TLB error + .long __default_exception_vsr # data TLB error + .long __default_exception_vsr # reserved 0x1500 + .long __default_exception_vsr # reserved 0x1600 + .long __default_exception_vsr # reserved 0x1700 + .long __default_exception_vsr # reserved 0x1800 + .long __default_exception_vsr # reserved 0x1900 + .long __default_exception_vsr # reserved 0x1a00 + .long __default_exception_vsr # reserved 0x1b00 + .long __default_exception_vsr # data breakpoint + .long __default_exception_vsr # instruction breakpoint + .long __default_exception_vsr # peripheral breakpoint + .long __default_exception_vsr # non maskable development port +#endif + +#------------------------------------------------------------------------------ +# Interrupt vector tables. +# These tables contain the isr, data and object pointers used to deliver +# interrupts to user code. + + .data + + .extern hal_default_isr + + .globl hal_interrupt_handlers +hal_interrupt_handlers: + .rept 15 + .long hal_default_isr + .endr + + .globl hal_interrupt_data +hal_interrupt_data: + .rept 15 + .long 0 + .endr + + .globl hal_interrupt_objects +hal_interrupt_objects: + .rept 15 + .long 0 + .endr + +##----------------------------------------------------------------------------- +## Temporary interrupt stack + + .section ".bss" + + .balign 16 +__interrupt_stack_base: + .rept CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE + .byte 0 + .endr + .balign 16 +__interrupt_stack: + + .long 0,0,0,0,0,0,0,0 + +#------------------------------------------------------------------------------ + +#ifndef CYG_KERNEL_USE_INIT_PRIORITY + +# Head of __init function used for static constructors + .section ".init.head","ax" + .align 2 +FUNC_START(__init) + stwu 1,-8(1) + mflr 0 + stw 0,12(1) + +# Head of __fini function used for static destructors + .section ".fini.head","ax" + .align 2 +FUNC_START(__fini) + stwu 1,-8(1) + mflr 0 + stw 0,12(1) + + +# Tail of __init used for static constructors + .section ".init.tail","ax" + lwz 0,12(1) + mtlr 0 + addi 1,1,8 + blr + +# Tail of __fini used for static destructors + .section ".fini.tail","ax" + lwz 0,12(1) + mtlr 0 + addi 1,1,8 + blr + +#endif + +#------------------------------------------------------------------------------ +# end of vectors.S diff --git a/packages/hal/powerpc/arch/current/tests/PKGconf.mak b/packages/hal/powerpc/arch/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/arch/current/tests/PKGconf.mak @@ -0,0 +1,37 @@ +#============================================================================== +# +# makefile +# +# hal/powerpc/arch/tests +# +#============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================== + +PACKAGE := hal_powerpc +include ../../../../../pkgconf/pkgconf.mak + +TESTS := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + diff --git a/packages/hal/powerpc/cogent/current/ChangeLog b/packages/hal/powerpc/cogent/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/ChangeLog @@ -0,0 +1,252 @@ +1998-10-28 Jesper Skov + + * src/hal_stub.c: Add special initialization of serial for CMA102 + support. + +1998-10-25 Jesper Skov + + * src/hal_diag.c: Replaced CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS + with CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS. + + PR 17986 + * include/hal_stub.h: Removed superfluous pkgconf/kernel.h + include. + +1998-10-23 Jesper Skov + + * include/hal_stub.h: Include generic-stub.h from hal. + +1998-10-23 Jesper Skov + + * src/cogent.ld: Added copyright notice. + +1998-10-19 Jesper Skov + + * include/pkgconf/hal_powerpc_cogent.h: Undid 1998-10-16 change. + +1998-10-19 Jesper Skov + + * include/hal_diag.h: Add declaration for hal_diag_read_char. + +1998-10-16 Jesper Skov + + * include/pkgconf/hal_powerpc_cogent.h: Changed + CYGPKG_HAL_POWERPC_COGENT to CYG_HAL_POWERPC_COGENT. + +1998-10-15 Jesper Skov + + * src/hal_stub.c: Changed CYG_HAL_GDB_BREAK to + CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT. + Removed conditionals for simulator which will never be used. + +1998-10-14 Nick Garnett + + * src/hal_stub.c: + * src/hal_diag.c: + Some changes to allow building without kernel. + +1998-10-08 Jesper Skov + + * include/hal_diag.h + * src/cogent.ld + * src/hal_diag.c + Changed /**/ comments to //. + +1998-10-08 Jesper Skov + + * src/makefile: Removed. + +1998-10-08 Jesper Skov + + * src/hal_stub.c: Fix warning. + +1998-10-08 Jesper Skov + + * include/hal_diag.h + * include/hal_stub.h + * include/pkgconf/hal_powerpc_cogent.h + * src/cogent.S + * src/cogent.ld + * src/hal_diag.c + * src/hal_stub.c + Expanded TABs. + +1998-10-08 Jesper Skov + + * src/hal_stub.c: Removed HAL_IO_BARRIER calls. + Added GDB interrupt support. + +1998-10-08 Jesper Skov + + * src/hal_diag.c: Removed HAL_IO_BARRIER calls. + +1998-10-01 Jesper Skov + + * src/hal_diag.c: Changed baud rate to 38400. + +1998-10-01 Jesper Skov + + * src/hal_stub.c: Changed baud rate to 38400. + + * src/hal_diag.c (hal_diag_read_char): Added for LCD (dummy + function). + +1998-09-12 Bart Veer + + * include/pkgconf/hal_powerpc_cogent.h: + Added missing descriptions (PR 17184) + +1998-09-04 Bart Veer + + * include/pkgconf/hal_powerpc_cogent.h: + Temporary change to the type of the startup option, needed by the + configuration tool. + +1998-09-02 Bart Veer + + * include/pkgconf/hal_powerpc_cogent.h: + New header file for platform-specific options + + * tests/PKGconf.mak: + * src/PKGconf.mak: + Sort out package naming conventions. + +Wed Sep 2 17:30:21 1998 Jesper Skov + + * src/cogent.S (hal_hardware_init): Set Bus Monitor to generate + bus errors if read/write cycles are not properly terminated after + some time. + +Tue Sep 1 15:47:03 1998 Jesper Skov + + * src/hal_diag.c: Include correct header file for previous change. + +Tue Sep 1 15:41:54 1998 Jesper Skov + + * src/hal_diag.c (hal_diag_init, hal_diag_write_char): + When compiled with gdb stub support, let gdb handle diag output. + +Mon Aug 31 10:51:32 1998 Jesper Skov + + * src/hal_diag.c (hal_diag_read_char): Removed GDB C-c check. + + * include/hal_diag.h (HAL_DIAG_READ_CHAR): Added. + +1998-08-28 Bart Veer + + * src/hal_diag.c, src/hal_stub.c: + Updated for new kernel configuration option symbol names + +Fri Aug 28 11:12:34 1998 Jesper Skov + + * src/hal_stub.c (serial_init): Set serial speed to 115200 baud. + +Fri Aug 28 09:25:40 1998 Jesper Skov + + * src/hal_stub.c: Moved strcpy/strlen to generic-stub.c + +Thu Aug 27 10:11:22 1998 Jesper Skov + + * src/hal_stub.c (initHardware): Initialize serial. + Also initialize LCD when building ROM. + + * src/hal_diag.c: Added LCD init string for eCos ROM. + +Wed Aug 26 15:56:56 1998 Jesper Skov + + * src/hal_stub.c: + * src/hal_diag.c: + Changed to use HAL_READ/WRITE macros. + + * src/hal_diag.c (hal_diag_read_char): Added GDB C-C check. + +Wed Aug 26 09:01:02 1998 Jesper Skov + + * src/cogent.ld: Cleaned up a bit. Sort constructors. + Fixed alignment problem. + +Mon Aug 24 17:20:44 1998 Jesper Skov + + * src/hal_stub.c: + * src/hal_diag.c: + Now using the same macro definitions as 16550.hxx. + +Mon Aug 24 13:11:51 1998 Jesper Skov + + * src/cogent.ld: Move data to top of memory when building as + ROM_MONITOR. + +Mon Aug 24 10:33:22 1998 Jesper Skov + + * src/hal_diag.c: Now initializes the UART to 19200 baud. + +Mon Aug 24 10:30:44 1998 Jesper Skov + + * src/cogent.ld: Don't put .fini* at 0x00000000. + +Thu Aug 20 17:52:25 1998 Jesper Skov + + * include/hal_diag.h: Fixed prototype. + +Thu Aug 20 17:45:19 1998 Jesper Skov + + * src/cogent.ld: Moved stack definition to arch/../vectors.S. + +Thu Aug 20 17:32:02 1998 Jesper Skov + + * src/hal_diag.c (hal_diag_read_char): Added. + (hal_diag_init): Handle non-guarded IO registers properly. Also + cleaned up a bit. + (lcd_dis): Same. + (hal_diag_write_char): Handle truncation correctly. + +Thu Aug 20 16:07:44 1998 Jesper Skov + + * src/PKGconf.mak: Include GDB support files. + +Thu Aug 20 16:02:00 1998 Jesper Skov + + * include/hal_stub.h: + * src/hal_stub.c: + Added for GDB support. + +1998-08-18 Nick Garnett + + * src/cogent.S: + * src/hal_diag.c: + * include/hal_diag.h: + * src/cogent.ld: + Now uses hal.h rather than kernel.h. + +Tue Aug 18 11:46:53 1998 Jonathan Larmour + + * src/cogent.ld: Reorder GROUP line + +Mon Aug 17 22:13:41 1998 Jonathan Larmour + + * src/cogent.ld: + Add GROUP(libgcc.a libtarget.a) to prevent need for explicit linking + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/powerpc/cogent/current/include/hal_diag.h b/packages/hal/powerpc/cogent/current/include/hal_diag.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/include/hal_diag.h @@ -0,0 +1,69 @@ +#ifndef CYGONCE_HAL_HAL_DIAG_H +#define CYGONCE_HAL_HAL_DIAG_H + +//============================================================================= +// +// hal_diag.h +// +// HAL Support for Kernel Diagnostic Routines +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL Support for Kernel Diagnostic Routines +// Description: Diagnostic routines for use during kernel development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include + +//----------------------------------------------------------------------------- +// functions implemented in hal_diag.c + +externC void hal_diag_init(void); + +externC void hal_diag_write_char(char c); + +externC void hal_diag_read_char(char *c); + +//----------------------------------------------------------------------------- + +#define HAL_DIAG_INIT() hal_diag_init() + +#define HAL_DIAG_WRITE_CHAR(_c_) hal_diag_write_char(_c_) + +#define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_) + +//----------------------------------------------------------------------------- +// end of hal_diag.h +#endif // CYGONCE_HAL_HAL_DIAG_H diff --git a/packages/hal/powerpc/cogent/current/include/hal_stub.h b/packages/hal/powerpc/cogent/current/include/hal_stub.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/include/hal_stub.h @@ -0,0 +1,54 @@ +#ifndef CYGONCE_HAL_HAL_STUB_H +#define CYGONCE_HAL_HAL_STUB_H + +//============================================================================= +// +// hal_stub.h +// +// General header for HAL GDB stub support. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov from an original by nickg +// Contributors: jskov +// Date: 1998-06-08 +// Purpose: HAL stub support. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include +#include + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_HAL_STUB_H +// End of hal_stub.h + + diff --git a/packages/hal/powerpc/cogent/current/include/pkgconf/hal_powerpc_cogent.h b/packages/hal/powerpc/cogent/current/include/pkgconf/hal_powerpc_cogent.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/include/pkgconf/hal_powerpc_cogent.h @@ -0,0 +1,82 @@ +#ifndef CYGONCE_PKGCONF_HAL_POWERPC_COGENT_H +#define CYGONCE_PKGCONF_HAL_POWERPC_COGENT_H +// ==================================================================== +// +// pkgconf/hal_powerpc_cogent.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_POWERPC_COGENT { + display "Cogent PowerPC evaluation board" + type radio + parent CYGPKG_HAL_POWERPC + platform cogent + description " + The cogent HAL package provides the support needed to run + eCos on a Cogent board equipped with a PowerPC processor." + } + + cdl_option CYGHWR_HAL_POWERPC_COGENT_STARTUP { + display "Startup type" + parent CYGPKG_HAL_POWERPC_COGENT + #type count + type enum + legal_values ram rom + startup + description " + When targetting the cogent board it is possible to build + the system for either RAM bootstrap or ROM bootstrap. The + former generally requires that the board is equipped with + ROMs containing a suitable ROM monitor or equivalent + software that allows gdb to download the eCos application + on to the board. The latter typically requires that the + eCos application be blown into EPROMs or equivalent + technology." + } + + }}CFG_DATA */ + +#define CYGHWR_HAL_POWERPC_COGENT_STARTUP ram + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_POWERPC_COGENT_H */ +/* EOF hal_powerpc_cogent.h */ diff --git a/packages/hal/powerpc/cogent/current/src/PKGconf.mak b/packages/hal/powerpc/cogent/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/src/PKGconf.mak @@ -0,0 +1,55 @@ +#============================================================================== +# +# makefile +# +# hal/powerpc/cogent/src +# +#============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================== + +PACKAGE := hal_powerpc_cogent +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := hal_diag.c cogent.S hal_stub.c +OTHER_OBJS := +OTHER_TARGETS := ldscript.stamp +OTHER_CLEAN := ldscript.clean +OTHER_DEPS := ldscript.d + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + +.PHONY: ldscript.clean + +ldscript.stamp: cogent.ld + $(CC) -E -P -Wp,-MD,ldscript.tmp -xc $(INCLUDE_PATH) $(CFLAGS) -o $(PREFIX)/lib/target.ld $< + @echo -e "\n$@ : $< \\" > ldscript.d + @tail -n +2 ldscript.tmp >> ldscript.d + @rm ldscript.tmp + $(TOUCH) $@ + +ldscript.clean: + $(RM) -f $(PREFIX)/lib/target.ld + $(RM) -f ldscript.stamp + diff --git a/packages/hal/powerpc/cogent/current/src/cogent.S b/packages/hal/powerpc/cogent/current/src/cogent.S new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/src/cogent.S @@ -0,0 +1,167 @@ +##============================================================================= +## +## cogent.S +## +## Cogent board hardware setup +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1997-11-11 +## Purpose: Cogent board hardware setup +## Description: This file contains any code needed to initialize the +## hardware on a Cogent PowerPC board. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +#include + +#------------------------------------------------------------------------------ + + .globl hal_hardware_init +hal_hardware_init: + +#if defined(CYG_HAL_POWERPC_COGENT) && defined(CYG_HAL_POWERPC_MP860) + + # Set up MP860 mapping registers for cogent + + # MP860 time base control register + lwi r3,0xff000200 + li r4,0x0001 + sth r4,0(r3) + + + lwi r3,0xff000000 # base address of control registers + + # FIXME: I do not know if the timeout is correct. works with the + # below memory mappings/wait states and the PromICE. + lwi r4,0x0000ff80 # Disable watchdog, enable ... + stw r4,0x0004(r3) # ...Bus Monitor, timeout after 255*8 cycles + + # Set CS0 to + # base addr 0xfff00000 + # wait states 4 + # size 1M + # Covers ROM + lwi r4,0xfff00801 + stw r4,0x0100(r3) + lwi r4,0xfff00140 + stw r4,0x0104(r3) + + # Set CS1 to + # base addr 0x00000000 + # external ACK + # size 64M + # Covers DRAM and slot0 + lwi r4,0x00000001 + stw r4,0x0108(r3) + lwi r4,0xfc000008 + stw r4,0x010c(r3) + + # Set CS2 to + # base addr 0x04000000 + # external ACK + # size 64M + # slot1 and slot2 + lwi r4,0x04000001 + stw r4,0x0110(r3) + lwi r4,0xfc000008 + stw r4,0x0114(r3) + + # Set CS3 to + # base addr 0x0e000000 + # exernal ack + # size 32M + # covers IO registers + lwi r4,0x0e000001 + stw r4,0x0118(r3) + lwi r4,0xfe000108 + stw r4,0x011c(r3) + +#if 0 + # Set up the BAT registers to cover same address spaces + + # The 860 does not appear to have BAT registers. + + # ibat0 + # base addr 0xfff00000 + # length 1M + # WIMG = 0000 + # covers ROM + lwi r4,0xfff0001f + mtibatu 0,r4 + lwi r4,0xfff00002 + mtibatl 0,r4 + + # ibat1 + # base addr 0x00000000 + # length 256M + # WIMG = 0000 + # covers DRAM and slots + lwi r4,0x00001fff + mtibatu 1,r4 + lwi r4,0x00000002 + mtibatl 1,r4 + + # dbat0 + # base addr 0xfff00000 + # length 256M + # WIMG = 0101 + # covers ROM for data access + lwi r4,0xfff01fff + mtdbatu 0,r4 + lwi r4,0xfff0002a + mtdbatl 0,r4 + + # dbat1 + # base addr 0x00000000 + # length 256M + # WIMG = 0000 + # covers DRAM and slots + lwi r4,0x00001fff + mtdbatu 1,r4 + lwi r4,0x00000002 + mtdbatl 1,r4 + + # Enable translation in the MSR + mfmsr r3 + lwi r4,0x00000030 + or r3,r3,r4 + mtmsr r3 + +#endif + +#endif + + blr + +#------------------------------------------------------------------------------ +# end of cogent.S diff --git a/packages/hal/powerpc/cogent/current/src/cogent.ld b/packages/hal/powerpc/cogent/current/src/cogent.ld new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/src/cogent.ld @@ -0,0 +1,170 @@ +/*========================================================================== +// +// cogent.ld +// +// Linker script for Cogent/MPC860 board +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors:nickg +// Date: 1998-02-17 +// Purpose: Cogent Linker script +// Description: This script is passed to the linker to define the memory +// of the Cogent/MPC860 board. +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ +STARTUP(vectors.o) +ENTRY(reset_vector) + +GROUP(libtarget.a libgcc.a) + +#include + +#ifdef CYG_HAL_STARTUP_ROM +#define LOAD_BASE 0xFFF00000 +#define DATA_BASE 0x00780000 // Data at top of memory so GDB + // doesn't trash ROM state while + // downloading programs. +#endif +#ifdef CYG_HAL_STARTUP_RAM +#define LOAD_BASE 0x00000000 +#define DATA_BASE +#endif + +// Alignment of sections must be equal to or bigger than the alignment +// requested by gcc (use 'objdump -h' to see these). + +SECTIONS +{ + + /* Start of ROM */ + . = LOAD_BASE; + + .rom_vectors : + { + KEEP(*(.vectors)) + } + + /*------------------------------------------------------------*/ + + .text : + { + _stext = .; + *(.text*) + *(.gnu.warning) + *(.gnu.linkonce*) + *(.init) + } + + _etext = .; + PROVIDE (etext = .); + .fini : { *(.fini) } + .rodata1 : { *(.rodata1) } + .rodata : { *(.rodata*) } + .fixup : { *(.fixup) } + .gcc_except_table : { *(.gcc_except_table) } + +// __rom_data_start = __rom_ram_vectors_start + SIZEOF( .ram_vectors ); + __rom_data_start = ALIGN(8); + .data DATA_BASE : + AT( __rom_data_start ) + { + __ram_data_start = .; + *(.data*) + __GOT1_START__ = .; + *(.got1) + __GOT1_END__ = .; + /* Put .ctors and .dtors next to the .got2 section, so that the pointers + get relocated with -mrelocatable. */ +#ifdef CYG_KERNEL_USE_INIT_PRIORITY + . = ALIGN(8); + __CTOR_LIST__ = .; + KEEP(*(SORT(.ctors*))) + __CTOR_END__ = .; + __DTOR_LIST__ = .; + KEEP(*(SORT(.dtors*))) + __DTOR_END__ = .; +#else + __CTOR_LIST__ = .; + *sched.o(.ctors*) + *clock.o(.ctors*) + *thread.o(.ctors*) + *(.ctors*) + __CTOR_END__ = .; + __DTOR_LIST__ = .; + *(.dtors) + __DTOR_END__ = .; +#endif + __GOT2_START__ = .; + *(.got2) + __GOT2_END__ = .; + __GOT_START__ = .; + _GLOBAL_OFFSET_TABLE_ = . + 32768; + _SDA_BASE_ = .; + *(.got.plt) + *(.got) + __GOT_END__ = .; + *(.dynamic) + // We want the small data sections together, so single-instruction offsets + // can access them all, and initialized data all before uninitialized, so + // we can shorten the on-disk segment size. + __SDATA_START__ = .; + *(.sdata) + __SDATA2_START__ = .; + *(.sdata2) + } + __ram_data_end = .; + PROVIDE( __ram_data_end = .); + _edata = .; + PROVIDE (edata = .); + . = ALIGN(4); + __bss_start = .; + .sbss : + { + __SBSS_START__ = .; + *(.sbss) + __SBSS_END__ = .; + __SBSS2_START__ = .; + *(.sbss2) + __SBSS2_END__ = .; + *(.scommon) + } + . = ALIGN(8); + .bss : + { + *(.scommon) + *(.dynbss) + *(.bss) + *(COMMON) + } + . = ALIGN(4); + _end = . ; + PROVIDE (end = .); + +} diff --git a/packages/hal/powerpc/cogent/current/src/hal_diag.c b/packages/hal/powerpc/cogent/current/src/hal_diag.c new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/src/hal_diag.c @@ -0,0 +1,464 @@ +//============================================================================= +// +// hal_diag.c +// +// HAL diagnostic output code +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg, jskov +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL diagnostic output +// Description: Implementations of HAL diagnostic output support. +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include // base types +#include // tracing macros +#include // assertion macros + +#include // IO macros +#include + +#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) +#include // __output_gdb_string +#endif + +#include + + +//----------------------------------------------------------------------------- +// Select default diag channel to use + +//#define CYG_KERNEL_DIAG_ROMART +//#define CYG_KERNEL_DIAG_LCD +//#define CYG_KERNEL_DIAG_SERIAL + +#if !defined(CYG_KERNEL_DIAG_SERIAL) && \ + !defined(CYG_KERNEL_DIAG_LCD) && \ + !defined(CYG_KERNEL_DIAG_ROMART) + +#define CYG_KERNEL_DIAG_SERIAL + +#endif + +//----------------------------------------------------------------------------- +// Cogent board specific 16550 code. + +#if defined(CYG_KERNEL_DIAG_SERIAL) + +//----------------------------------------------------------------------------- +// From serial_16550.h +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400 0x00 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400 0x06 + +// FIXME: This is the base address of the B-channel on the PowerPC +// Cogent board. +#define CYG_DEVICE_SERIAL_RS232_16550_BASE 0xe900007 + + +// Define the serial registers. +#define CYG_DEVICE_SERIAL_RS232_16550_RBR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x00) + // receiver buffer register, read, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_THR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x00) + // transmitter holding register, write, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_DLL \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x00) + // divisor latch (LS), read/write, dlab = 1 +#define CYG_DEVICE_SERIAL_RS232_16550_IER \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x08) + // interrupt enable register, read/write, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_DLM \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x08) + // divisor latch (MS), read/write, dlab = 1 +#define CYG_DEVICE_SERIAL_RS232_16550_IIR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x10) + // interrupt identification register, read, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_FCR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x10) + // fifo control register, write, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_AFR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x10) + // alternate function register, read/write, dlab = 1 +#define CYG_DEVICE_SERIAL_RS232_16550_LCR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x18) + // line control register, read/write +#define CYG_DEVICE_SERIAL_RS232_16550_MCR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x20) + // modem control register, read/write +#define CYG_DEVICE_SERIAL_RS232_16550_LSR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x28) + // line status register, read +#define CYG_DEVICE_SERIAL_RS232_16550_MSR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x30) + // modem status register, read +#define CYG_DEVICE_SERIAL_RS232_16550_SCR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x38) + // scratch pad register + +// FIXME: Naming convention? +// The interrupt enable register bits. +#define SIO_IER_ERDAI 0x01 // enable received data available irq +#define SIO_IER_ETHREI 0x02 // enable THR empty interrupt +#define SIO_IER_ELSI 0x04 // enable receiver line status irq +#define SIO_IER_EMSI 0x08 // enable modem status interrupt + +// The interrupt identification register bits. +#define SIO_IIR_IP 0x01 // 0 if interrupt pending +#define SIO_IIR_ID_MASK 0x0e // mask for interrupt ID bits + +// The line status register bits. +#define SIO_LSR_DR 0x01 // data ready +#define SIO_LSR_OE 0x02 // overrun error +#define SIO_LSR_PE 0x04 // parity error +#define SIO_LSR_FE 0x08 // framing error +#define SIO_LSR_BI 0x10 // break interrupt +#define SIO_LSR_THRE 0x20 // transmitter holding register empty +#define SIO_LSR_TEMT 0x40 // transmitter register empty +#define SIO_LSR_ERR 0x80 // any error condition + +// The modem status register bits. +#define SIO_MSR_DCTS 0x01 // delta clear to send +#define SIO_MSR_DDSR 0x02 // delta data set ready +#define SIO_MSR_TERI 0x04 // trailing edge ring indicator +#define SIO_MSR_DDCD 0x08 // delta data carrier detect +#define SIO_MSR_CTS 0x10 // clear to send +#define SIO_MSR_DSR 0x20 // data set ready +#define SIO_MSR_RI 0x40 // ring indicator +#define SIO_MSR_DCD 0x80 // data carrier detect + +// The line control register bits. +#define SIO_LCR_WLS0 0x01 // word length select bit 0 +#define SIO_LCR_WLS1 0x02 // word length select bit 1 +#define SIO_LCR_STB 0x04 // number of stop bits +#define SIO_LCR_PEN 0x08 // parity enable +#define SIO_LCR_EPS 0x10 // even parity select +#define SIO_LCR_SP 0x20 // stick parity +#define SIO_LCR_SB 0x40 // set break +#define SIO_LCR_DLAB 0x80 // divisor latch access bit + +void hal_diag_init(void) +{ +#if !defined(CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS) + cyg_uint8 lcr; + + // 8-1-no parity. + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LCR, + SIO_LCR_WLS0 | SIO_LCR_WLS1); + + // Set speed to 38400. + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LCR, lcr); + lcr |= SIO_LCR_DLAB; + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LCR, lcr); + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_DLL, + CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400); + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_DLM, + CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400); + lcr &= ~SIO_LCR_DLAB; + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LCR, lcr); +#endif +} + +void hal_diag_write_char(char c) +{ +#if !defined(CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS) + cyg_uint8 lsr; + + do { + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LSR, lsr); + } while ((lsr & SIO_LSR_THRE) == 0); + + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_THR, c); +#else + __output_gdb_string (&c, 1); +#endif +} + +void hal_diag_read_char(char *c) +{ + cyg_uint8 lsr; + + do { + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LSR, lsr); + } while ((lsr & SIO_LSR_DR) == 0); + + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_RBR, *c); +} +#endif + +//----------------------------------------------------------------------------- +// Cogent board specific LCD code + +#if defined(CYG_KERNEL_DIAG_LCD) + +// FEMA 162B 16 character x 2 line LCD +// base addresses and register offsets * + +#define MBD_BASE 0 + +#define LCD_BASE (MBD_BASE + 0xEB00007) + +#define LCD_DATA (LCD_BASE + 0x00) // read/write lcd data +#define LCD_STAT (LCD_BASE + 0x08) // read lcd busy status +#define LCD_CMD (LCD_BASE + 0x08) // write lcd command + +// status register bit definitions +#define LCD_STAT_BUSY 0x80 // 1 = display busy +#define LCD_STAT_ADD 0x7F // bits 0-6 return current display address + +// command register definitions +#define LCD_CMD_RST 0x01 // clear entire display and reset display address +#define LCD_CMD_HOME 0x02 // reset display address and reset any shifting +#define LCD_CMD_ECL 0x04 // move cursor left one position on next data write +#define LCD_CMD_ESL 0x05 // shift display left one position on next data write +#define LCD_CMD_ECR 0x06 // move cursor right one position on next data write +#define LCD_CMD_ESR 0x07 // shift display right one position on next data write +#define LCD_CMD_DOFF 0x08 // display off, cursor off, blinking off +#define LCD_CMD_BL 0x09 // blink character at current cursor position +#define LCD_CMD_CUR 0x0A // enable cursor on +#define LCD_CMD_DON 0x0C // turn display on +#define LCD_CMD_CL 0x10 // move cursor left one position +#define LCD_CMD_SL 0x14 // shift display left one position +#define LCD_CMD_CR 0x18 // move cursor right one position +#define LCD_CMD_SR 0x1C // shift display right one position +#define LCD_CMD_MODE 0x38 // sets 8 bits, 2 lines, 5x7 characters +#define LCD_CMD_ACG 0x40 // bits 0-5 sets the character generator address +#define LCD_CMD_ADD 0x80 // bits 0-6 sets the display data address to line 1 + + +// LCD status values +#define LCD_OK 0x00 +#define LCD_ERR 0x01 + +#define LCD_LINE0 0x00 +#define LCD_LINE1 0x40 + +#define LCD_LINE_LENGTH 16 + +static char lcd_line0[LCD_LINE_LENGTH+1]; +static char lcd_line1[LCD_LINE_LENGTH+1]; +static char *lcd_line[2] = { lcd_line0, lcd_line1 }; +static int lcd_curline = 0; +static int lcd_linepos = 0; + + +static void lcd_dis(int add, char *string); + +void hal_diag_init() +{ + cyg_uint8 stat; + int i; + + // wait for not busy + do { HAL_READ_UINT8 (LCD_STAT, stat); } while (stat & LCD_STAT_BUSY); + + // configure the lcd for 8 bits/char, 2 lines + // and 5x7 dot matrix + HAL_WRITE_UINT8 (LCD_CMD, LCD_CMD_MODE); + + // wait for not busy + do { HAL_READ_UINT8 (LCD_STAT, stat); } while (stat & LCD_STAT_BUSY); + + // turn the LCD display on + HAL_WRITE_UINT8 (LCD_CMD, LCD_CMD_DON); + + lcd_curline = 0; + lcd_linepos = 0; + + for( i = 0; i < LCD_LINE_LENGTH; i++ ) + lcd_line[0][i] = lcd_line[1][i] = ' '; + + lcd_line[0][LCD_LINE_LENGTH] = lcd_line[1][LCD_LINE_LENGTH] = 0; + + lcd_dis( LCD_LINE0, lcd_line[0] ); + lcd_dis( LCD_LINE1, lcd_line[1] ); + + +#if defined(CYG_HAL_ROM_MONITOR) + // It's handy to have the LCD initialized at reset when using it + for debugging output. + { + extern void diag_write_string (const char*); + diag_write_string ("eCos ROM " __TIME__ "\n"); + diag_write_string (__DATE__ "\n"); + } +#endif +} + +// this routine writes the string to the LCD +// display after setting the address to add +static void lcd_dis(int add, char *string) +{ + cyg_uint8 stat; + int i; + + // write the string out to the display stopping when we reach 0 + for (i = 0; *string != '\0'; i++) + { + // wait for not busy + do { HAL_READ_UINT8 (LCD_STAT, stat); } while (stat & LCD_STAT_BUSY); + + // write the address + HAL_WRITE_UINT8 (LCD_CMD, (LCD_CMD_ADD + add)); + add++; + + // wait for not busy + do { HAL_READ_UINT8 (LCD_STAT, stat); } while (stat & LCD_STAT_BUSY); + + // write the data + HAL_WRITE_UINT8 (LCD_DATA, *string++); + } +} + +void hal_diag_write_char(char c) +{ + int i; + + // ignore CR + if( c == '\r' ) return; + + if( c == '\n' ) + { + lcd_dis( LCD_LINE0, &lcd_line[lcd_curline^1][0] ); + lcd_dis( LCD_LINE1, &lcd_line[lcd_curline][0] ); + + // Do a line feed + lcd_curline ^= 1; + lcd_linepos = 0; + + for( i = 0; i < LCD_LINE_LENGTH; i++ ) + lcd_line[lcd_curline][i] = ' '; + + return; + } + + // Truncate long lines + if( lcd_linepos >= LCD_LINE_LENGTH ) return; + + lcd_line[lcd_curline][lcd_linepos++] = c; +} + +char hal_diag_read_char(void) +{ + return 0; +} + +#endif + + +//---------------------------------------------------------------------------*/ +// PromICE AI interface + + +#if defined(CYG_KERNEL_DIAG_ROMART) + +#ifdef CYG_HAL_POWERPC_COGENT +#define PROMICE_AILOC 0xfff00020 +#endif + +// Add this to the LoadICE config file: ailoc 20 19200 +// FIXME: I couldn't get this to work. jskov + +#define PROMICE_BUS_SIZE 16 +#define PROMICE_BURST_SIZE 1 + +#if PROMICE_BUS_SIZE == 16 + +typedef volatile struct +{ + volatile cyg_uint16 zero; +// cyg_uint16 pad1[PROMICE_BURST_SIZE]; + volatile cyg_uint16 one; +// cyg_uint16 pad2[PROMICE_BURST_SIZE]; + volatile cyg_uint16 data; +// cyg_uint16 pad3[PROMICE_BURST_SIZE]; + volatile cyg_uint16 status; + +} AISTRUCT; + +#endif + +AISTRUCT *AI = (AISTRUCT *)PROMICE_AILOC; + +#define PROMICE_STATUS_TDA 0x01 +#define PROMICE_STATUS_HDA 0x02 +#define PROMICE_STATUS_OVR 0x04 + +void hal_diag_init() +{ + volatile cyg_uint8 junk; + + while( AI->status == 0xCC ) + continue; + + junk = AI->data; +} + +static void ai_write_char(cyg_uint8 data) +{ + volatile cyg_uint8 junk; + int i; + + // Wait for tda == 0 + while( (AI->status & PROMICE_STATUS_TDA) == PROMICE_STATUS_TDA ) + continue; + + // Send start bit + junk = AI->one; + + for( i = 0; i < 8; i++ ) + { + // send ls bit of data + if( (data & 1) == 1 ) + junk = AI->one; + else + junk = AI->zero; + + // shift down for next bit + data >>= 1; + } + + // Send stop bit + junk = AI->one; + + // all done +} + +void hal_diag_write_char(char c) +{ + ai_write_char((cyg_uint8)c); +} + +#endif + +//----------------------------------------------------------------------------- +// End of hal_diag.c diff --git a/packages/hal/powerpc/cogent/current/src/hal_stub.c b/packages/hal/powerpc/cogent/current/src/hal_stub.c new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/src/hal_stub.c @@ -0,0 +1,350 @@ +/* hal_stub.c - helper functions for stub, specific to ECC HAL + * + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +#include + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + +#include +#include +#include // IO macros +#include // HAL_ENABLE_INTERRUPTS +#include // Register values +#include +#include + +/*---------------------------------------------------------------------------*/ +/* From serial_16550.h */ +#define CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400 0x00 +#define CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400 0x06 + +// FIXME: This is the base address of the B-channel on the PowerPC +// Cogent board. +#define CYG_DEVICE_SERIAL_RS232_16550_BASE 0xe900007 + + +// Define the serial registers. +#define CYG_DEVICE_SERIAL_RS232_16550_RBR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x00) + // receiver buffer register, read, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_THR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x00) + // transmitter holding register, write, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_DLL \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x00) + // divisor latch (LS), read/write, dlab = 1 +#define CYG_DEVICE_SERIAL_RS232_16550_IER \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x08) + // interrupt enable register, read/write, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_DLM \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x08) + // divisor latch (MS), read/write, dlab = 1 +#define CYG_DEVICE_SERIAL_RS232_16550_IIR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x10) + // interrupt identification register, read, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_FCR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x10) + // fifo control register, write, dlab = 0 +#define CYG_DEVICE_SERIAL_RS232_16550_AFR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x10) + // alternate function register, read/write, dlab = 1 +#define CYG_DEVICE_SERIAL_RS232_16550_LCR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x18) + // line control register, read/write +#define CYG_DEVICE_SERIAL_RS232_16550_MCR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x20) + // modem control register, read/write +#define CYG_DEVICE_SERIAL_RS232_16550_LSR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x28) + // line status register, read +#define CYG_DEVICE_SERIAL_RS232_16550_MSR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x30) + // modem status register, read +#define CYG_DEVICE_SERIAL_RS232_16550_SCR \ + ((volatile cyg_uint8 *) CYG_DEVICE_SERIAL_RS232_16550_BASE + 0x38) + // scratch pad register + +// FIXME: Naming convention? +// The interrupt enable register bits. +#define SIO_IER_ERDAI 0x01 // enable received data available irq +#define SIO_IER_ETHREI 0x02 // enable THR empty interrupt +#define SIO_IER_ELSI 0x04 // enable receiver line status irq +#define SIO_IER_EMSI 0x08 // enable modem status interrupt + +// The interrupt identification register bits. +#define SIO_IIR_IP 0x01 // 0 if interrupt pending +#define SIO_IIR_ID_MASK 0x0e // mask for interrupt ID bits + +// The line status register bits. +#define SIO_LSR_DR 0x01 // data ready +#define SIO_LSR_OE 0x02 // overrun error +#define SIO_LSR_PE 0x04 // parity error +#define SIO_LSR_FE 0x08 // framing error +#define SIO_LSR_BI 0x10 // break interrupt +#define SIO_LSR_THRE 0x20 // transmitter holding register empty +#define SIO_LSR_TEMT 0x40 // transmitter register empty +#define SIO_LSR_ERR 0x80 // any error condition + +// The modem status register bits. +#define SIO_MSR_DCTS 0x01 // delta clear to send +#define SIO_MSR_DDSR 0x02 // delta data set ready +#define SIO_MSR_TERI 0x04 // trailing edge ring indicator +#define SIO_MSR_DDCD 0x08 // delta data carrier detect +#define SIO_MSR_CTS 0x10 // clear to send +#define SIO_MSR_DSR 0x20 // data set ready +#define SIO_MSR_RI 0x40 // ring indicator +#define SIO_MSR_DCD 0x80 // data carrier detect + +// The line control register bits. +#define SIO_LCR_WLS0 0x01 // word length select bit 0 +#define SIO_LCR_WLS1 0x02 // word length select bit 1 +#define SIO_LCR_STB 0x04 // number of stop bits +#define SIO_LCR_PEN 0x08 // parity enable +#define SIO_LCR_EPS 0x10 // even parity select +#define SIO_LCR_SP 0x20 // stick parity +#define SIO_LCR_SB 0x40 // set break +#define SIO_LCR_DLAB 0x80 // divisor latch access bit + +/*---------------------------------------------------------------------------*/ + +/* Local data */ + + +/* If ENABLED is non-zero, supply a memory fault handler that traps + subsequent memory errors and sets _mem_err to 1. Otherwise, memory + faults are processed as exceptions. */ + +void __set_mem_fault_trap (int enable) {} + +#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT +// This ISR is called from the interrupt handler on external +// interrupts. This should only happen when there is no serial +// driver, so the code shouldn't mess anything up. +int cyg_hal_gdb_isr (void) +{ + cyg_uint8 vec; + + + // Serial interrupts are feed to IRQ1 (vector 0x08) on the Cogent + // board. + HAL_READ_UINT8 (IMM_SIVEC, vec); + if (0x08 == vec) { + cyg_uint8 c; + + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_RBR, c); + if( 3 == c ) + { + // Ctrl-C: breakpoint. + extern void breakpoint(void); + breakpoint(); + + // Interrupt handled. Don't call ISR proper. + return 0; + } + } + + // Not caused by GDB. Call ISR proper. + return 1; +} + +static int interruptible (int state) +{ + unsigned long mask; + HAL_READ_UINT32(IMM_SIMASK, mask); + + // Serial interrupts are feed to IRQ1. + if (state) { + HAL_WRITE_UINT32(IMM_SIMASK, mask | 0x20000000); + } else { + HAL_WRITE_UINT32(IMM_SIMASK, mask & (~0x20000000)); + } + + return 0; +} +#endif + +static void serial_init(void) +{ + cyg_uint8 lcr; + + // 8-1-no parity. + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LCR, + SIO_LCR_WLS0 | SIO_LCR_WLS1); + + // Set speed to 38400. + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LCR, lcr); + lcr |= SIO_LCR_DLAB; + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LCR, lcr); + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_DLL, + CYG_DEVICE_SERIAL_RS232_T2_VALUE_B38400); + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_DLM, + CYG_DEVICE_SERIAL_RS232_T1_VALUE_B38400); + lcr &= ~SIO_LCR_DLAB; + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LCR, lcr); + + { + // Special initialization for ST16C552 on CMA102 + cyg_uint8 mcr; + + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_MCR, mcr); + mcr |= 8; + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_MCR, mcr); + + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_MCR+0x40, mcr); + mcr |= 8; + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_MCR+0x40, mcr); + } + +#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT + // Enable IRQ1. + HAL_WRITE_UINT32(IMM_SIMASK, 0x20000000); + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_FCR, 0); + // Enable serial receive interrupts. + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_IER, SIO_IER_ERDAI); + HAL_ENABLE_INTERRUPTS(); +#endif +} + +/* Write C to the current serial port. */ + +void putDebugChar (int c) +{ + cyg_uint8 lsr; + + do { + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LSR, lsr); + } while ((lsr & SIO_LSR_THRE) == 0); + + HAL_WRITE_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_THR, c); +} + +/* Read one character from the current serial port. */ + +int getDebugChar (void) +{ + char c; + cyg_uint8 lsr; + + do { + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LSR, lsr); + } while ((lsr & SIO_LSR_DR) == 0); + + HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_RBR, c); + + return c; +} + + +/* Install the standard set of trap handlers for the stub. */ + +void __install_traps (void) +{ + // Nothing to do, the HAL will call handle_exception when one occurs. +} + +/* Flush the instruction cache. */ +void flush_i_cache (void) { HAL_ICACHE_INVALIDATE_ALL(); } + + +/* Reset the board. */ +void __reset (void) {} + + +/* Set the baud rate for the current serial port. */ +void __set_baud_rate (int baud) {} + + +/* Initialize the hardware. */ +void initHardware (void) +{ + static int initialized = 0; + + if (!initialized) { + initialized = 1; + + serial_init (); + +#if defined(CYG_HAL_ROM_MONITOR) + /* Initialize the LCD */ + diag_init (); +#endif + + } +} + +#if 0 +/* Alternate read function for use when stub is running. It + reads the data for standard input from the remote GDB. */ + +int dve_read (int fd, char *buf, int nbytes) +{ + __get_gdb_input (buf, nbytes, 1); +} + +/* Alternate write function for use when stub is running. It + writes the data for standard output to the remote GDB. */ + +int dve_write (int fd, char *buf, int nbytes) +{ + __output_gdb_string (buf, nbytes); +} + +#endif + + +int ppc_process_signal (int signal) +{ + /* We don't care about the signal (atm). */ + return 0; +} + +/* Install traps and otherwise initialize stub. */ + +void set_debug_traps (void) +{ + /* Set signal handling vector so we can treat 'C' as 'c'. */ + __process_signal_vec = &ppc_process_signal; + +#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT + // Control of GDB interrupts. + __interruptible_control = &interruptible; +#endif + + initHardware (); +} + + +/* This function will generate a breakpoint exception. It is used at the + beginning of a program to sync up with a debugger and can be used + otherwise as a quick means to stop program execution and "break" into + the debugger. */ + +void +breakpoint() +{ + HAL_BREAKPOINT(_breakinst); +} + + +/* This function returns the opcode for a 'trap' instruction. */ + +unsigned long __break_opcode () +{ + return HAL_BREAKINST; +} + +#endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS diff --git a/packages/hal/powerpc/cogent/current/tests/PKGconf.mak b/packages/hal/powerpc/cogent/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/tests/PKGconf.mak @@ -0,0 +1,37 @@ +#=============================================================================== +# +# makefile +# +# hal/powerpc/cogent/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := hal_powerpc_cogent +include ../../../../../pkgconf/pkgconf.mak + +TESTS := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + diff --git a/packages/hal/powerpc/sim/current/ChangeLog b/packages/hal/powerpc/sim/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/sim/current/ChangeLog @@ -0,0 +1,121 @@ +1998-10-25 Jesper Skov + + + * include/hal_stub.h: Removed superfluous pkgconf/kernel.h + include. + +1998-10-23 Jesper Skov + + * include/pkgconf/hal_powerpc_sim.h: Allow wallclock and watchdog + devices to be configured. + +1998-10-23 Jesper Skov + + * include/hal_stub.h: Include generic-stub.h from hal. + +1998-10-23 Jesper Skov + + * src/PKGconf.mak (COMPILE): Removed empty hal_diag.c. + +1998-10-22 Jesper Skov + PR 17898 + + * include/pkgconf/hal_powerpc_sim.h: Preclude devices. + +1998-10-20 Jesper Skov + + * runtime/tree: Added. + +1998-10-19 Jesper Skov + + * include/pkgconf/hal_powerpc_sim.h: Undid 1998-10-16 change. + +1998-10-16 Jesper Skov + + * include/pkgconf/hal_powerpc_sim.h: Changed + CYGPKG_HAL_POWERPC_SIM to CYG_HAL_POWERPC_SIM. + +1998-10-13 Jesper Skov + + * include/hal_stub.h: Added. + +1998-10-13 Jesper Skov + + * src/sim.ld: Glob expressions to match function/data-sections + needed for selective linking. + +1998-10-08 Jesper Skov + + * include/hal_diag.h + * src/sim.ld + Changed /**/ comments to //. + +1998-10-08 Jesper Skov + + * src/makefile: Removed. + +1998-10-08 Jesper Skov + + * include/hal_diag.h + * include/pkgconf/hal_powerpc_sim.h + * src/sim.S + * src/sim.ld + Expanded TABs. + +Thu Sep 17 17:40:31 1998 Jesper Skov + + * src/sim.ld: Fixed to work with simulator. Needs to be cleaned up + though. + +1998-09-12 Bart Veer + + * include/pkgconf/hal_powerpc_sim.h: + Added missing descriptions (PR 17184) + +1998-09-02 Bart Veer + + * include/pkgconf/hal_powerpc_sim.h: + New header file for platform-specific configuration options + + * tests/PKGconf.mak: + * src/PKGconf.mak: + Sort out package naming conventions. + +1998-08-18 Nick Garnett + + * src/sim.S: + * include/hal_diag.h: + Now uses hal.h rather than kernel.h. + +Tue Aug 18 11:47:24 1998 Jonathan Larmour + + * src/sim.ld: Reorder GROUP line + +Mon Aug 17 22:18:15 1998 Jonathan Larmour + + * src/sim.ld: + Add GROUP(libgcc.a libtarget.a) to prevent need for explicit linking + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/hal/powerpc/sim/current/include/hal_diag.h b/packages/hal/powerpc/sim/current/include/hal_diag.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/sim/current/include/hal_diag.h @@ -0,0 +1,94 @@ +#ifndef CYGONCE_HAL_HAL_DIAG_H +#define CYGONCE_HAL_HAL_DIAG_H + +//============================================================================= +// +// hal_diag.h +// +// HAL Support for Kernel Diagnostic Routines +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: HAL Support for Kernel Diagnostic Routines +// Description: Diagnostic routines for use during kernel development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include + +//----------------------------------------------------------------------------- +// Register addresses + +#define PAL_RESET 0x00 +#define PAL_CPU_NR 0x04 +#define PAL_INT 0x08 +#define PAL_NR_CPU 0x0a + +#define PAL_READ_FIFO 0x10 +#define PAL_READ_STATUS 0x14 +#define PAL_WRITE_FIFO 0x18 +#define PAL_WRITE_STATUS 0x1a + +#define OEA_DEV 0xf0001000 + +//----------------------------------------------------------------------------- + +#define HAL_DIAG_INIT() + +#define HAL_DIAG_WRITE_CHAR(_c_) \ +{ \ + volatile unsigned char *tty_buffer = \ + (unsigned char*)(OEA_DEV + PAL_WRITE_FIFO); \ + volatile unsigned char *tty_status = \ + (unsigned char*)(OEA_DEV + PAL_WRITE_STATUS); \ + if( _c_ != '\r' ) \ + { \ + while( *tty_status == 0 ) continue; \ + *tty_buffer = _c_; \ + } \ +} + +#define HAL_DIAG_READ_CHAR(_c_) \ +{ \ + volatile unsigned char *tty_buffer = \ + (unsigned char*)(OEA_DEV + PAL_READ_FIFO); \ + volatile unsigned char *tty_status = \ + (unsigned char*)(OEA_DEV + PAL_READ_STATUS); \ + while( *tty_status == 0 ) continue; \ + _c_ = *tty_buffer; \ +} + +//----------------------------------------------------------------------------- +// end of hal_diag.h +#endif // CYGONCE_HAL_HAL_DIAG_H diff --git a/packages/hal/powerpc/sim/current/include/hal_stub.h b/packages/hal/powerpc/sim/current/include/hal_stub.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/sim/current/include/hal_stub.h @@ -0,0 +1,54 @@ +#ifndef CYGONCE_HAL_HAL_STUB_H +#define CYGONCE_HAL_HAL_STUB_H + +//============================================================================= +// +// hal_stub.h +// +// General header for HAL GDB stub support. +// +//============================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jskov from an original by nickg +// Contributors: jskov +// Date: 1998-06-08 +// Purpose: HAL stub support. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include +#include + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_HAL_STUB_H +// End of hal_stub.h + + diff --git a/packages/hal/powerpc/sim/current/include/pkgconf/hal_powerpc_sim.h b/packages/hal/powerpc/sim/current/include/pkgconf/hal_powerpc_sim.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/sim/current/include/pkgconf/hal_powerpc_sim.h @@ -0,0 +1,68 @@ +#ifndef CYGONCE_PKGCONF_HAL_POWERPC_SIM_H +#define CYGONCE_PKGCONF_HAL_POWERPC_SIM_H +// ==================================================================== +// +// pkgconf/hal_powerpc_sim.h +// +// HAL configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 1998-09-02 +// Purpose: To allow the user to edit HAL configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_package CYGPKG_HAL_POWERPC_SIM { + display "Minimal simulator" + type radio + parent CYGPKG_HAL_POWERPC + platform sim + requires !CYGPKG_DEVICES_GDB + requires !CYGPKG_DEVICES_SERIAL_RS232_COMMON + description " + The minimal simulator HAL package is provided for use when + only a simple simulation of the processor architecture is + desired, as opposed to detailed simulation of any specific + board. In particular it is not possible to simulate any of + the I/O devices, so device drivers cannot be used." + } + + }}CFG_DATA +*/ + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_HAL_POWERPC_SIM_H */ +/* EOF hal_powerpc_sim.h */ diff --git a/packages/hal/powerpc/sim/current/runtime/tree b/packages/hal/powerpc/sim/current/runtime/tree new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/sim/current/runtime/tree @@ -0,0 +1,5 @@ +/#address-cells 1 +/openprom/init/register/pc 0x100 +/iobus@0xf0000000/reg 0xf0000000 0x01000000 +/iobus/pal@0xf0001000/reg 0xf0001000 32 + diff --git a/packages/hal/powerpc/sim/current/src/PKGconf.mak b/packages/hal/powerpc/sim/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/sim/current/src/PKGconf.mak @@ -0,0 +1,56 @@ +#============================================================================== +# +# makefile +# +# hal/powerpc/sim/src +# +#============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================== + +PACKAGE := hal_powerpc_sim +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := sim.S +OTHER_OBJS := +OTHER_TARGETS := ldscript.stamp +OTHER_CLEAN := ldscript.clean +OTHER_DEPS := ldscript.d + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + +.PHONY: ldscript.clean + +ldscript.stamp: sim.ld + $(CC) -E -P -Wp,-MD,ldscript.tmp -xc $(INCLUDE_PATH) $(CFLAGS) -o $(PREFIX)/lib/target.ld $< + @echo -e "\n$@ : $< \\" > ldscript.d + @tail -n +2 ldscript.tmp >> ldscript.d + @rm ldscript.tmp + $(TOUCH) $@ + +ldscript.clean: + $(RM) -f $(PREFIX)/lib/target.ld + $(RM) -f ldscript.stamp + + diff --git a/packages/hal/powerpc/sim/current/src/sim.S b/packages/hal/powerpc/sim/current/src/sim.S new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/sim/current/src/sim.S @@ -0,0 +1,104 @@ +#============================================================================== +## +## sim.S +## +## Simulator hardware setup +## +##============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +##============================================================================= +#######DESCRIPTIONBEGIN#### +## +## Author(s): nickg +## Contributors: nickg +## Date: 1997-11-11 +## Purpose: Simulator hardware setup +## Description: This file contains any code needed to initialize the +## hardware on the PowerPC simulator. +## +######DESCRIPTIONEND#### +## +##============================================================================= + +#include + +#include "cyg/hal/ppc.inc" + +#------------------------------------------------------------------------------ + + .globl hal_hardware_init +hal_hardware_init: + +#if 0 + # Set up the BAT registers to cover same address spaces + + # ibat0 + # base addr 0xfff00000 + # length 1M + # WIMG = 0000 + # covers ROM + lwi r4,0xfff0001f + mtibatu 0,r4 + lwi r4,0xfff00002 + mtibatl 0,r4 + + # ibat1 + # base addr 0x00000000 + # length 256M + # WIMG = 0000 + # covers DRAM and slots + lwi r4,0x00001fff + mtibatu 1,r4 + lwi r4,0x00000002 + mtibatl 1,r4 + + # dbat0 + # base addr 0xfff00000 + # length 256M + # WIMG = 0101 + # covers ROM for data access + lwi r4,0xfff01fff + mtdbatu 0,r4 + lwi r4,0xfff0002a + mtdbatl 0,r4 + + # dbat1 + # base addr 0x00000000 + # length 256M + # WIMG = 0000 + # covers DRAM and slots + lwi r4,0x00001fff + mtdbatu 1,r4 + lwi r4,0x00000002 + mtdbatl 1,r4 + + # Enable translation in the MSR + mfmsr r3 + lwi r4,0x00000030 + or r3,r3,r4 + mtmsr r3 +#endif + blr + +#------------------------------------------------------------------------------ +# end of sim.S \ No newline at end of file diff --git a/packages/hal/powerpc/sim/current/src/sim.ld b/packages/hal/powerpc/sim/current/src/sim.ld new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/sim/current/src/sim.ld @@ -0,0 +1,237 @@ +//========================================================================== +// +// sim.ld +// +// Linker script for PowerPC simulator +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.cygnus.com. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos code, released September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors:nickg +// Date: 1998-02-17 +// Purpose: PowerPC simulator Linker script +// Description: This script is passed to the linker to define the memory +// of the PowerPC simulator. +// +//####DESCRIPTIONEND#### +// +//========================================================================== +STARTUP(vectors.o) +OUTPUT_FORMAT("elf32-powerpc") +OUTPUT_ARCH(powerpc) +ENTRY(reset_vector) +// Do we need any of these for elf? +// __DYNAMIC = 0; + +GROUP(libtarget.a libgcc.a) + +#include + +MEMORY +{ + + // In a RAM system, fake the division between ROM and + // RAM for testing. + ram_vectors : ORIGIN = 0x00000000, LENGTH = 0x2000 + rom_vectors : ORIGIN = 0x00002000, LENGTH = 0x2000 + ram : ORIGIN = 0x00004000, LENGTH = 496k + rom : ORIGIN = 0x00080000, LENGTH = 512k +} + +// Allocate the stack to be at the top of memory, since the stack +// grows down + +PROVIDE (__interrupt_stack = 0x00100000); + +// Initalize some symbols to be zero so we can reference them in the +// crt0 without core dumping. These functions are all optional, but +// we do this so we can have our crt0 always use them if they exist. +// This is so BSPs work better when using the crt0 installed gcc. +// We have to initalize them twice, so we cover a.out (which prepends +// an underscore) and coff object file formats. + +//PROVIDE (hardware_init_hook = 0); +//PROVIDE (software_init_hook = 0); + +SECTIONS +{ + // Read-only sections, merged into text segment: + .interp : { *(.interp) } >rom + .hash : { *(.hash) } >rom + .dynsym : { *(.dynsym) } >rom + .dynstr : { *(.dynstr) } >rom + .rel.text : { *(.rel.text) } >rom + .rela.text : { *(.rela.text) } >rom + .rel.data : { *(.rel.data) } >rom + .rela.data : { *(.rela.data) } >rom + .rel.rodata : { *(.rel.rodata) } >rom + .rela.rodata : { *(.rela.rodata) } >rom + .rel.got : { *(.rel.got) } >rom + .rela.got : { *(.rela.got) } >rom + .rel.got1 : { *(.rel.got1) } >rom + .rela.got1 : { *(.rela.got1) } >rom + .rel.got2 : { *(.rel.got2) } >rom + .rela.got2 : { *(.rela.got2) } >rom + .rel.ctors : { *(.rel.ctors) } >rom + .rela.ctors : { *(.rela.ctors) } >rom + .rel.dtors : { *(.rel.dtors) } >rom + .rela.dtors : { *(.rela.dtors) } >rom + .rel.init : { *(.rel.init) } >rom + .rela.init : { *(.rela.init) } >rom + .rel.fini : { *(.rel.fini) } >rom + .rela.fini : { *(.rela.fini) } >rom + .rel.bss : { *(.rel.bss) } >rom + .rela.bss : { *(.rela.bss) } >rom + .rel.plt : { *(.rel.plt) } >rom + .rela.plt : { *(.rela.plt) } >rom + .init : { + *(.init.head) + *(.init) + *(.init.tail) + } >rom =0 + .plt : { *(.plt) } >rom + .text : + { + _stext = .; + *(.text*) + *(.gnu.warning) + *(.gnu.linkonce*) + } >rom =0 + _etext = .; + PROVIDE (etext = .); + .fini : { + *(.fini.head) + *(.fini) + *(.fini.tail) + } >rom =0 + + .rodata1 : { *(.rodata1) } >rom + .rodata : { *(.rodata*) } >rom + __FIXUP_START__ = .; + .fixup : { *(.fixup) } >rom + __FIXUP_END__ = .; + __EXCEPT_START__ =.; + .gcc_except_table : { *(.gcc_except_table) } >rom + __EXCEPT_END__ =.; + // Read-write section, merged into data segment: + __rom_data_start = ALIGN(4); + .data : + AT( __rom_data_start ) + { + __ram_data_start = .; + PROVIDE( __ram_data_start = .); + + *(.data*) + __GOT1_START__ = .; + *(.got1) + __GOT1_END__ = .; + // Put .ctors and .dtors next to the .got2 section, so that the pointers + // get relocated with -mrelocatable. +#ifdef CYG_KERNEL_USE_INIT_PRIORITY + . = ALIGN(8); + __CTOR_LIST__ = .; + KEEP(*(SORT(.ctors*))) + __CTOR_END__ = .; + __DTOR_LIST__ = .; + KEEP(*(SORT(.dtors*))) + __DTOR_END__ = .; +#else + __CTOR_LIST__ = .; + *sched.o(.ctors*) + *clock.o(.ctors*) + *thread.o(.ctors*) + *(.ctors*) + __CTOR_END__ = .; + __DTOR_LIST__ = .; + *(.dtors*) + __DTOR_END__ = .; +#endif + __GOT2_START__ = .; + *(.got2) + __GOT2_END__ = .; + __GOT_START__ = .; + _GLOBAL_OFFSET_TABLE_ = . + 32768; + _SDA_BASE_ = .; + *(.got.plt) + *(.got) + __GOT_END__ = .; + *(.dynamic) + // We want the small data sections together, so single-instruction offsets + // can access them all, and initialized data all before uninitialized, so + // we can shorten the on-disk segment size. + __SDATA_START__ = .; + *(.sdata) + __SDATA2_START__ = .; + *(.sdata2) + } >ram + __ram_data_end = .; + PROVIDE( __ram_data_end = .); + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : + { + __SBSS_START__ = .; + *(.sbss*) + __SBSS_END__ = .; + __SBSS2_START__ = .; + *(.sbss2) + __SBSS2_END__ = .; + *(.scommon) + } >ram + + .bss : + { + *(.dynbss) + *(.bss) + *(COMMON) + } >ram + _end = . ; + PROVIDE (end = .); + + + __rom_ram_vectors_start = ALIGN(4); +#if 1 + .vectors : + { + *(.vectors) + } > ram_vectors +#else + .ram_vectors : + AT ( __rom_ram_vectors_start ) + { + __ram_vectors_start = .; + *(.ram_vectors) + __ram_vectors_end = .; + } >ram_vectors + + .rom_vectors : + { + *(.rom_vectors) + } >rom_vectors +#endif + +} + diff --git a/packages/hal/powerpc/sim/current/tests/PKGconf.mak b/packages/hal/powerpc/sim/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/sim/current/tests/PKGconf.mak @@ -0,0 +1,38 @@ +#============================================================================== +# +# makefile +# +# hal/powerpc/sim/tests +# +#============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================== + +PACKAGE := hal_powerpc_sim +include ../../../../../pkgconf/pkgconf.mak + +TESTS := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + diff --git a/packages/infra/current/ChangeLog b/packages/infra/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/infra/current/ChangeLog @@ -0,0 +1,283 @@ +Mon Oct 26 19:40:48 1998 Jonathan Larmour + + * src/memset.c, src/memcpy.c: + Conditionalise out all tracing for now + Fix for PR 17996 + +Fri Oct 23 05:42:36 1998 Jonathan Larmour + + * include/cyg_ass.h (CYGASSERT_docall): + Make a dummy reference to _msg_ argument when + CYGDBG_INFRA_DEBUG_ASSERT_MESSAGE is disabled, otherwise we may get + "unused variable" warnings + Fix for PR 17889 + +1998-10-22 Hugo Tyson + + * src/buffer.cxx (increment_buffer_pos): + Use the correctly named print_trace_buffer() rather than some + typo/globaleditto. + (cyg_trace_dump): only refer to thread->get_saved_context() if + CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT is defined. + +1998-10-22 Hugo Tyson + + * src/buffer.cxx (write_thread_id): + Make get_tid() be there when used. + + * include/pkgconf/infra.h: + Only enable all the buffered tracing stuff if USE_TRACING is + selected; otherwise link errors ensue if only USE_ASSERTS is + enabled. + +1998-10-22 Jesper Skov + PR 17914 + + * src/simple.cxx (CYG_NO_THREADID): Set if there is no Kernel + support. + +1998-10-20 Nick Garnett + + * src/null.cxx: + Removed fix for PR 17471 since the required macros have been moved + to cyg_type.h. + + * include/diag.h (diag_printf): + * src/diag.c (diag_printf): + Made use of variadic arguments optional in this function. + + * include/pkgconf/infra.h: + Added configury to support buffered tracing. + + * src/fancy.cxx (trim_func): + Fixed fencepost bug. + + * src/PKGconf.mak: + * src/buffer.cxx: + Added buffer.cxx to implement buffered trace log. + +Thu Oct 15 21:27:23 1998 Jonathan Larmour + + * src/delete.cxx, src/memcpy.c, src/memset.c: + Moved here from ecc/kernel/current/src/common, as they should + be present even if the kernel is disabled + + * include/pkgconf/infra.h: + Add new config options CYGIMP_INFRA_PREFER_SMALL_TO_FAST_MEMCPY + and CYGIMP_INFRA_PREFER_SMALL_TO_FAST_MEMSET to support the + functionality available in memcpy.c and memset.c + + * src/PKGconf.mak: + build above new files + + Above changes are required for PR 17229 + +1998-10-14 Nick Garnett + + * include/cyg_type.h: + Moved CYG_LABEL_NAME() macro here from ktypes.h. + +Wed Oct 14 17:10:12 1998 Jonathan Larmour + + * src/diag.c: + Change warning message from previous change to match compiler + output exactly + +Tue Oct 13 17:23:37 1998 Jonathan Larmour + + * src/diag.c: + Output another warning so that people know that diag.c produces + a warning + Reformat to 76 columns + Change args of diag_printf to be ANSI-style, not K&R to + silence warning + +1998-09-25 Bart Veer + + * src/null.cxx: + PR 17471: null.cxx relies on the macro CYG_LABEL_NAME(), which on + the mn10300 is defined only if is included. + As a temporary fix this header file is now always included. In the + medium term there will have to be proper fixes to ktypes.h and to + cyg_type.h + +Wed Sep 16 03:42:16 1998 Jonathan Larmour + + * src/startup.cxx, src/dummyxxmain.cxx: + Move __main() to a separate dummyxxmain.cxx source file to resolve + linking bogosities on some targets + Fix for PR 17279 - kudos to Tim Goodwin really + + * src/PKGconf.mak: + Build src/dummyxxmain.cxx + +Tue Sep 15 19:14:33 1998 David Moore + + * include/pkgconf/infra.h: Cleaned up comments. + +Tue Sep 15 14:34:34 1998 David Moore + + * src/startup.cxx: + * include/cyg_type.h: + CYGBLD_ATTRIB_WEAK moved from src/startup.cxx to + include/cyg_type.h + +Tue Sep 15 12:26:36 1998 Jonathan Larmour + + * src/null.cxx, src/simple.cxx, src/fancy.cxx: + Change cyg_check_data_ptr() to not compare with _end symbol from + linker scripts as this is a bogus thing to do when starting in + ROM. Some better magic can be done later with the memory layout + tool. + + * src/simple.cxx (cyg_assert_fail), + src/fancy.cxx (cyg_assert_fail): + If an assert is thrown, loop forever no matter what the platform + rather than resetting the jmr board. + +Fri Sep 11 12:52:59 1998 Hugo Tyson + + * src/tcdiag.cxx: + * src/diag.c: + Remove dependencies on the kernel: + o types are available from here, infra. + o Diag and its mates are here and the HAL. + +Thu Sep 10 21:59:09 1998 Hugo Tyson + + * src/fancy.cxx: + * src/simple.cxx: + * src/null.cxx: + Remove dependencies on the kernel: + o interrupt stuff is available from the HAL. + o types are available from here, infra. + o Diag and its mates are here and the HAL. + o Only consider printing thread information if there is a kernel. + +Thu Sep 10 21:29:55 1998 Hugo Tyson + + * include/pkgconf/infra.h: + Fix CDL descriptions (mainly) resulting from review of + configury here. + +Thu Sep 10 17:38:00 1998 Hugo Tyson + + * src/null.cxx: + Add an empty cyg_assert_fail() if not CYGDBG_USE_ASSERTS, so that + clib's assert() can use it, in common with but regardless of the + internal assert setup. Of course if internal asserts are used, + the same routine is used. + +Thu Sep 3 19:05:29 1998 Hugo Tyson + + * src/startup.cxx (__main): + ...and its mates. Correct the bad usage of the tracing macros - a + type was implied when the type was void, so an assert fires. + + * include/diag.h (diag_printf): + Remove 'useful' prototype; this function deliberately has a K&R + prototype to avoid having to use varargs, or pad arglists or + anything grody like that. Comment to that effect added too. + + * src/fancy.cxx: + Condition out routines which are only used by tracing system; + prevent warnings. Also changed the default widths setup to + something more suitable to our long function names; viewing on + about a 200 column screen recommended - or use 'simple' instead. + +Tue Sep 1 19:09:39 1998 Hugo Tyson + + * include/pkgconf/infra.h: + Fancy tracing by default, as I've been requested. + Move definition (or not) of CYGDBG_INFRA_DIAG_USE_DEVICE from the + kernel, correcting the symbol construction as we go. + + * include/cyg_type.h: + Correct multiple-inclusion protection, remove + Version nonsense, correct Usage: field, put in + definition of CYGBLD_NORET. + + * include/cyg_ass.h: + Correct Usage: field, remove definition of CYGDBG_NORET, correct + definition of cyg_assert_fail to use CYGBLD_NORET as intended. + + * include/cyg_trac.h: + Tidy up comments. + + * src/PKGconf.mak (COMPILE): + Added all the new units below. + + * src/fancy.cxx: + * src/simple.cxx: + * src/null.cxx: + Moved here from the kernel; comments changed accordingly. + + * src/tcdiag.cxx: + * include/diag.h: + * src/diag.c: + Moved here from the kernel; comments changed accordingly. + Also use config symbol CYGDBG_INFRA_DIAG_USE_DEVICE rather than + (badly named) CYG_DIAG_USE_DEVICE. + +Fri Aug 28 15:22:16 1998 Hugo Tyson + + * include/pkgconf/infra.h: + Add lots of lovely cdl comments and new, correct, names for the + config options themselves. + * include/cyg_trac.h: + * include/cyg_ass.h: + Use the newly named options. + + [KERNEL] see also changes to src/trace/{fancy,null,simple}.cxx + which should soon move into this package instead. + +Fri Aug 28 09:57:21 1998 Jonathan Larmour + + * include/pkgconf/infra.h: + Add CYGSEM_START_ISO_C_COMPATIBILITY and + CYGSEM_START_UITRON_COMPATIBILITY options, along with some comment. + + * src/PKGconf.mak, src/startup.cxx: + Add these two files for the new file startup.cxx that provides the + generic startup mechanism, using new cyg_start() functions. This + is to remove the dependency on main(), which is defined in ISO and + POSIX as having certain properties we wouldn't be able to give it + otherwise. + +Tue Aug 25 11:47:58 1998 Jonathan Larmour + + * src/startup.cxx: + Add this to provide new startup method + +1998-08-20 Nick Garnett + + * include/cyg_type.h: + Moved constructor priority ordering stuff here from + kernel/ktypes.h. + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== + + + diff --git a/packages/infra/current/include/cyg_ass.h b/packages/infra/current/include/cyg_ass.h new file mode 100644 --- /dev/null +++ b/packages/infra/current/include/cyg_ass.h @@ -0,0 +1,251 @@ +#ifndef CYGONCE_INFRA_CYG_ASS_H +#define CYGONCE_INFRA_CYG_ASS_H + +//========================================================================== +// +// assert.h +// +// Macros and prototypes for the assert system +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg from an original by hmt +// Contributors: nickg +// Date: 1997-09-08 +// Purpose: Use asserts to avoid writing duff code. +// Description: Runtime tests that compile to nothing in +// release versions of the code, to allow +// as-you-go testing of alternate builds. +// Usage: #include +// ... +// CYG_ASSERT( pcount > 0, "Number of probes should be > 0!" ); +// +// which can result, for example, in a message of the form: +// ASSERT FAILED: probemgr.cxx:1340, scan_probes() : +// number of probes should be > 0! +// if the boolean "pcount > 0" is false. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // for CYGBLD_NORET + +// ------------------------------------------------------------------------- +// If we do not have a function name macro, define it ourselves + +#ifndef CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO + // __PRETTY_FUNCTION__ does not work +# ifndef __PRETTY_FUNCTION__ // And it is not already defined +# define __PRETTY_FUNCTION__ NULL +# endif +#endif + +// ... before the dependency on having asserts at all. +// ------------------------------------------------------------------------- + +#ifdef CYGDBG_USE_ASSERTS + +// ------------------------------------------------------------------------- +// this is executed to deal with failure - breakpoint it first! + +externC void +cyg_assert_fail( char *psz_func, char *psz_file, + cyg_uint32 linenum, char *psz_msg ) + CYGBLD_NORET; + +// ------------------------------------------------------------------------- + + +// ------------------------------------------------------------------------- +// We define macros and appropriate prototypes for the assert/fail +// system. These are: +// CYG_FAIL - unconditional panic +// CYG_ASSERT - panic if boolean expression is false +// + +# ifdef CYGDBG_INFRA_DEBUG_ASSERT_MESSAGE +# define CYGASSERT_docall( _msg_ ) \ + cyg_assert_fail( __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_ ); +# else +# define CYGASSERT_docall( _msg_ ) \ + CYG_MACRO_START \ + char *_tmp1_ = _msg_; \ + _tmp1_ = _tmp1_; \ + cyg_assert_fail( __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL ); \ + CYG_MACRO_END +# endif + +// unconditional failure; use like panic(), coredump() &c. +# define CYG_FAIL( _msg_ ) \ + CYG_MACRO_START \ + CYGASSERT_docall( _msg_ ); \ + CYG_MACRO_END + +// conditioned assert; if the condition is false, fail. +# define CYG_ASSERT( _bool_, _msg_ ) \ + CYG_MACRO_START \ + if ( ! ( _bool_ ) ) \ + CYGASSERT_docall( _msg_ ); \ + CYG_MACRO_END + +#else // ! CYGDBG_USE_ASSERTS + +// ------------------------------------------------------------------------- +// No asserts: we define empty statements for assert & fail. + +# define CYG_ASSERT( _bool_, _msg_ ) CYG_EMPTY_STATEMENT +# define CYG_FAIL( _msg_ ) CYG_EMPTY_STATEMENT + +#endif // ! CYGDBG_USE_ASSERTS + +// ------------------------------------------------------------------------- +// Pointer integrity checks. +// These check not only for NULL pointer, but can also check for pointers +// that are outside to defined memory areas of the platform or executable. +// We differentiate between data and function pointers, so that we can cope +// with different formats, and so we can check them against different memory +// regions. + +externC cyg_bool cyg_check_data_ptr(void *ptr); +externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)); + +#ifdef CYGDBG_USE_ASSERTS + +# define CYG_CHECK_DATA_PTR( _ptr_, _msg_ ) \ + CYG_MACRO_START \ + if( !cyg_check_data_ptr((void *)(_ptr_))) \ + CYGASSERT_docall( _msg_ ); \ + CYG_MACRO_END + +# define CYG_CHECK_FUNC_PTR( _ptr_, _msg_ ) \ + CYG_MACRO_START \ + if( !cyg_check_func_ptr((void (*)(void))(_ptr_))) \ + CYGASSERT_docall( _msg_ ); \ + CYG_MACRO_END + +#else // CYGDBG_USE_ASSERTS + +# define CYG_CHECK_DATA_PTR( _ptr_, _msg_ ) CYG_EMPTY_STATEMENT +# define CYG_CHECK_FUNC_PTR( _ptr_, _msg_ ) CYG_EMPTY_STATEMENT + + +#endif // CYGDBG_USE_ASSERTS + +// ------------------------------------------------------------------------- +// Unconditional definitions: + +// Check an object for validity by calling its own checker. +// Usage: +// ClassThing *p = &classobject; +// CYG_ASSERTCLASS( p, "Object at p is broken!" ); + +// this enum gives some options as to how keenly to test; avoids cluttering +// the member function declaration if the implementor wants to do more +// zealous tests themselves. + +enum cyg_assert_class_zeal { + cyg_system_test = -1, + cyg_none = 0, + cyg_trivial, + cyg_quick, + cyg_thorough, + cyg_extreme +}; + +// ------------------------------------------------------------------------- +// Define macros for checking classes: +// +// CYG_ASSERTCLASS - do proforma check on a class pointer +// CYG_ASSERTCLASSO - do proforma check on a class object +// +// The idiom required is that a class have a member function called +// "bool check_this( cyg_assert_class_zeal )" that returns true iff the +// object is OK. This need not be conditionally compiled against +// CYGDBG_USE_ASSERTS but it can be if only this macro is used to +// invoke it. Alternatively it can be invoked by hand with other +// choices from the above enum. + +// Assert the checker function of an object by pointer, or in hand. + +#ifdef __cplusplus + +# define CYG_ASSERT_CLASS_ZEAL (cyg_quick) // can be redefined locally + +# define CYG_ASSERTCLASS( _pobj_, _msg_ ) \ + CYG_ASSERT( ((NULL != (_pobj_)) \ + && (_pobj_)->check_this( CYG_ASSERT_CLASS_ZEAL )), _msg_ ); + +# define CYG_ASSERTCLASSO( _obj_, _msg_ ) \ + CYG_ASSERT( (_obj_).check_this( CYG_ASSERT_CLASS_ZEAL ), _msg_ ); + +#define CYGDBG_DEFINE_CHECK_THIS \ + bool check_this( cyg_assert_class_zeal zeal ); + +#endif + +// ------------------------------------------------------------------------- +// Some alternative names for basic assertions that we can disable +// individually. +// +// CYG_PRECONDITION - argument checking etc +// CYG_POSTCONDITION - results etc +// CYG_LOOP_INVARIANT - for putting in loops + +#ifdef CYGDBG_INFRA_DEBUG_PRECONDITIONS +# define CYG_PRECONDITION( _bool_ , _msg_ ) CYG_ASSERT( _bool_, _msg_ ) +#else +# define CYG_PRECONDITION( _bool_ , _msg_ ) CYG_EMPTY_STATEMENT +#endif + +#ifdef CYGDBG_INFRA_DEBUG_POSTCONDITIONS +# define CYG_POSTCONDITION( _bool_ , _msg_ ) CYG_ASSERT( _bool_, _msg_ ) +#else +# define CYG_POSTCONDITION( _bool_ , _msg_ ) CYG_EMPTY_STATEMENT +#endif + +#ifdef CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS +# define CYG_LOOP_INVARIANT( _bool_ , _msg_ ) CYG_ASSERT( _bool_, _msg_ ) +#else +# define CYG_LOOP_INVARIANT( _bool_ , _msg_ ) CYG_EMPTY_STATEMENT +#endif + +// ------------------------------------------------------------------------- +// Compile time failure; like #error but in a macro so we can use it in +// other definitions. +// +// Usage: +// #define new CYG_COMPILETIMEFAIL( "Do NOT use new!") + +#define CYG_COMPILETIMEFAIL( _msg_ ) !!!-- _msg_ --!!! + + +// ------------------------------------------------------------------------- + +#endif // CYGONCE_INFRA_CYG_ASS_H multiple inclusion protection +// EOF cyg_ass.h diff --git a/packages/infra/current/include/cyg_trac.h b/packages/infra/current/include/cyg_trac.h new file mode 100644 --- /dev/null +++ b/packages/infra/current/include/cyg_trac.h @@ -0,0 +1,1608 @@ +#ifndef CYGONCE_INFRA_CYG_TRAC_H +#define CYGONCE_INFRA_CYG_TRAC_H + +//========================================================================== +// +// cyg_trac.h +// +// Macros and prototypes for the tracing system +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg from an original by hmt +// Contributors: nickg +// Date: 1998-04-23 +// Purpose: Use traces to log procedure entry, and "print" stuff +// Description: Runtime logging messages that compile to nothing in +// release versions of the code, to allow +// as-you-go tracing of alternate builds. +// Usage: #include +// ... +// CYG_TRACE2( PIPE_TRACE, "pipe %x, data %d", ppipe, oword ); +// +// which can result, for example, in a message of the form: +// "TRACE: pipemgr.cxx:1340, write_pipe(): pipe 0x8004c, data 17" +// +//####DESCRIPTIONEND#### +// + +/**************************************************************************** + +Explicit tracing +================ + +CYG_TRACE0( bool, msg ); +CYG_TRACE1( bool, msg, arg1 ); +CYG_TRACE2( bool, msg, arg1, arg2 ); +.... +CYG_TRACE8( bool, msg, .... [with 8 args] ); + +In general, the bool controls whether or not the tracing occurs for a +particular invocation of the macro. The msg is a printf-style string, +though exactly which formats are supported depends on the underlying +implementation. Typically, at least %d, %x, %08x, %c and %s will be +supported. Of course a most compact implementation might print + + TRACE:z1dbuff.c[92]get_nextdata(): data pointer %x offset %d: 42BD8 1C + +or some such, leaving you to work it out for yourself. + +It is expected that the boolean would rarely actually be a complex +expression; it is more likely that it would either be "1", tracing being +controlled for the whole compilation unit or subsystem by means of the +CYGDBG_USE_TRACING symbol, or a local symbol for tracing over the whole +file, defined to 0 or to 1. For runtime control of tracing in a debugging +session, it is typical to use symbols defined to expressions such as: + + static int xxx_trace = 0; + #define TL1 (0 < xxx_trace) + #define TL2 (1 < xxx_trace) + +so you set xxx_trace to 1 to enable those messages conditioned by TL1 +(trace level 1) and so on. + + CYG_TRACE1( TL1, "Major argument is %d", zz ); + CYG_TRACE4( TL2, "...minor details %d %d %d %d", m1, m2, m3 ,m4 ); + +To assist with the case where the same symbol or expression is used +throughout a compilation unit, the programmer can define the symbol +CYG_TRACE_USER_BOOL as they choose and then use convenience macros with the +suffix 'B' in the obvious manner: + + #define CYG_TRACE_USER_BOOL (xxx_trace > 0) + CYG_TRACE2B( "Counters are %d, %d", countlo, counthi ); + +For the case where you just want to print a load of numbers in hex, or +decimal, convenience suffices X, D and Y are provided. X uses %08x, D %d +and Y an unadorned %x for each argument. + + CYG_TRACE3D( TL2, m1, m2, d ); + +If you want to do something similar but with a little more comment, the +names (strictly spellings) of the variables you are printing can be used by +appending a V to the X, D or Y. + + CYG_TRACE3DV( TL2, m1, m2, d ); + +might output: + + TRACE:z1dbuff.c[92]get_nextdata(): m1=23 m2=-4 d=55 + +These conveniences can be combined, and they apply equally to tracing with +up to 8 variables; the B for Bool goes last: + + CYG_TRACE4DVB( i, i*i, i*i*i, i*i*i*i ); + +might output: + + TRACE:table.c[12]main(): i=3 i*i=9 i*i*i=27 i*i*i*i=81 + + +Function Tracing +================ + +There are also facities for easily reporting function entry and exit, +printing the function arguments, and detecting returns without logging (or +without a value!). + +The basic facility is + + CYG_REPORT_FUNCTION(); + +In C, place this between the local variable declarations and the first +statement or errors will ensue. C++ is more flexible; place the macro as +the first line of all functions you wish to trace. The following +variations are also provided: + + CYG_REPORT_FUNCTYPE( exitmsg ) provide a printf string for the type + of the returned value + CYG_REPORT_FUNCNAME( name ) supply a function name explicitly, for + if __FUNCTION__ is not supported + CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both of the above extensions + +These are unconditional; the assumption is that if function reporting is +used at all it will be used for all functions within a compilation unit. +However, it is useful to be able to control function reporting at finer +grain without editing the source files concerned, at compile time or at +runtime. To support this, conditioned versions (with suffix 'C') are +provided for the above four macros, which only procduce trace output if the +macro CYG_REPORT_USER_BOOL evaluates true. + + CYG_REPORT_FUNCTIONC() + CYG_REPORT_FUNCNAMEC( name ) + CYG_REPORT_FUNCTYPEC( exitmsg ) + CYG_REPORT_FUNCNAMETYPEC( name, exitmsg ) + +You can define CYG_REPORT_USER_BOOL to anything you like before invoking +these macros; using a simple -DCYG_REPORT_USER_BOOL=0 or ...=1 on the +compiler command line would do the trick, but there is more flexibility to +be gained by something like: + + #define CYG_REPORT_USER_BOOL (reporting_bool_FOO) + #ifdef TRACE_FOO + int reporting_bool_FOO = 1; + #else + int reporting_bool_FOO = 0; + #endif + +where FOO relates to the module name. Thus an external symbol sets the +default, but it can be overridden in a debugging session by setting the +variable reporting_bool_FOO. + +Note that the condition applied to the initial CYG_REPORT_FUNC...() macro +controls all function-related reporting (not tracing) from that function; +the underlying mechanisms still operate even if no output is created. Thus +no conditioned variants of CYG_REPORT_FUNCARG[s] nor of CYG_REPORT_RETURN +are needed. + +Examples: + int myfunction() + { + CYG_REPORT_FUNCTYPE( "recode is %d" ); + +A function return is traced using + + CYG_REPORT_RETURN() a void return + CYG_REPORT_RETVAL( value ) returning a value + +With the CYG_REPORT_FUNCTYPE example, the latter might produce a message +like: + + TRACE:myprog.c[40]fact(): enter + TRACE:myprog.c[53]fact(): retcode is 24 + +It is also useful to trace the values of the arguments to a function: + CYG_REPORT_FUNCARGVOID confirms that the function is void + CYG_REPORT_FUNCARG1( format, arg ) printf-style + to + CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style + +The CYG_REPORT_FUNCARG[1-8] macros are also offered with the convenience +extensions: D, X, or Y, and V like the explicit tracing macros. For +example: + + int fact( int number ) + { + CYG_REPORT_FUNCTYPE( "recode is %d" ); + CYG_REPORT_FUNCARG1DV( number ); + int result = number; + while ( --number > 1 ) result *= number + CYG_REPORT_RETVAL( result ); + return result; + } + +might produce: + + TRACE:myprog.c[40]fact(): enter + TRACE:myprog.c[40]fact(): number=4 + TRACE:myprog.c[53]fact(): retcode is 24 + +If no exit message is provided, a default of %08x is used. + + +General Configury +================= + +If CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is *not* defined, it is assumed +that __PRETTY_FUNCTION__ or equivalents do not exist, so no function name +tracing is possible; only file and line number. + +If CYGDBG_INFRA_DEBUG_TRACE_MESSAGE is *not* defined, the message and +arguments to all tracing macros are not used; only "execution was here" +type information, by file, function and line number, is available. This +can greatly reduce the size of an image with tracing disabled, which may be +crucial in debugging on actual shipped hardware with limited memory. + +C/C++: in C++ the function reporting is implemented using a class object +with a destructor; this allows reporting of a return which has not been +explicitly reported, and detection of accidental multiple return reports. +This helps you write the function reporting correctly. In C it is not +possible to be so sophisticated, so the implementation is not so helpful in +detecting errors in the use of the tracing system. + +Note that for all of the above variations, the internal API to the +functions which are called in consequence of tracing remains the same, so +these variations can be mixed in the same executable, by configuring the +tracing macros differently in different compilation units or subsystems. + + +Summary +======= + +Explicit tracing +---------------- + +CYG_TRACE0( bool, msg ) if bool, print msg +CYG_TRACE1( bool, msg, arg ) if bool, printf-style + to +CYG_TRACE8( bool, msg, arg1...arg8 ) if bool, printf-style + +CYG_TRACE0B( msg, args... ) to CYG_TRACE8B() use CYG_TRACE_USER_BOOL + +CYG_TRACE1X( bool, args... ) to CYG_TRACE8X() print args using %08x +CYG_TRACE1Y( bool, args... ) to CYG_TRACE8Y() print args using %x +CYG_TRACE1D( bool, args... ) to CYG_TRACE8D() print args using %d + +CYG_TRACE1XV( bool, args... ) to CYG_TRACE8XV() print args using "arg=%08x" +CYG_TRACE1YV( bool, args... ) to CYG_TRACE8YV() print args using "arg=%x" +CYG_TRACE1DV( bool, args... ) to CYG_TRACE8DV() print args using "arg=%d" + +CYG_TRACE1XB( args... ) to CYG_TRACE8XB() print using %08x, no bool +CYG_TRACE1YB( args... ) to CYG_TRACE8YB() print using %x, no bool +CYG_TRACE1DB( args... ) to CYG_TRACE8DB() print using %d, no bool + +CYG_TRACE1XVB( args... ) to CYG_TRACE8XVB() use "arg=%08x", no bool +CYG_TRACE1YVB( args... ) to CYG_TRACE8YVB() use "arg=%x", no bool +CYG_TRACE1DVB( args... ) to CYG_TRACE8DVB() use "arg=%d", no bool + +Function tracing +---------------- + +CYG_REPORT_FUNCTION() default function entry +CYG_REPORT_FUNCNAME( name ) name the function +CYG_REPORT_FUNCTYPE( exitmsg ) printf for retval +CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both + +CYG_REPORT_FUNCTIONC() as above, but conditional +CYG_REPORT_FUNCNAMEC( name ) on CYG_REPORT_USER_BOOL +CYG_REPORT_FUNCTYPEC( exitmsg ) however it is defined +CYG_REPORT_FUNCNAMETYPEC( name, exitmsg ) ... + +CYG_REPORT_RETURN() void function exit +CYG_REPORT_RETVAL( value ) returning value + +CYG_REPORT_FUNCARGVOID() void function entry +CYG_REPORT_FUNCARG1( format, arg ) printf-style + to +CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style + +CYG_REPORT_FUNCARG1X( arg ) + to +CYG_REPORT_FUNCARG8X( arg1...arg8 ) use %08x +CYG_REPORT_FUNCARG1Y... use %x +CYG_REPORT_FUNCARG1D... use %d + +CYG_REPORT_FUNCARG1XV... use "arg=%08x" +CYG_REPORT_FUNCARG1YV... use "arg=%x" +CYG_REPORT_FUNCARG1DV... use "arg=%d" + + +--------------------------------------------------------------------------- + +Internal Documentation +====================== + +The required functions which are used by the tracing macros are + + externC void + cyg_tracenomsg( char *psz_func, char *psz_file, cyg_uint32 linenum ); + + externC void + cyg_tracemsg( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ); + + externC void + cyg_tracemsg2( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ); + // extended in the obvious way for 4,6,8 arguments + +These functions should expect psz_func and psz_file to possibly be NULL in +case those facilities are not available in the compilation environment, and +do something safe in such cases. A NULL message should really be dealt +with safely also, just logging "execution here" info like cyg_tracenomsg(). + +Discussion of possible underlying implementations +------------------------------------------------- + +It is intended that the functions that get called can simply print the info +they are given in as fancy a format as you like, or they could do the +printf-type formatting and log the resulting text in a buffer. They get +told the type of event (function-entry, function-arguments, function-exit +or plain tracing info) and so can perform fancy indenting, for example, to +make call stack inspection more obvious to humans. It is also intended +that a more compact logging arrangement be possible, for example one which +records, in 32-bit words (CYG_ADDRWORDs), the addresses of the file, +function and msg strings, the line number and the arguments. This has the +implication that the msg string should not be constructed dynamically but +be static ie. a plain quoted C string. The number of arguments also must +be recorded, and if it is chosen to save string arguments in the buffer +rather than just their addresses (which could be invalid by the time the +logged information is processed) some flagging of which arguments are +strings must be provided. The system could also be extended to deal with +floats of whichever size fir in a CYG_ADDRWORD; these would probably +require special treatment also. With these considerations in mind, the +maximum number of parameters in a single trace message has been set to 8, +so that a byte bitset could be used to indicate which arguments are +strings, another for those which are floats, and the count of arguments +also fits in a byte as number or a bitset. + + +****************************************************************************/ + +#include + +#include + +// ------------------------------------------------------------------------- +// CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is dealt with in cyg_ass.h. +// ------------------------------------------------------------------------- + +#ifdef CYGDBG_USE_TRACING + +// ------------------------------------------------------------------------- +// We define macros and appropriate prototypes for the trace/fail +// system. These are: +// CYG_TRACE0..8 - trace if boolean +// CYG_TRACEPROC - default no comment proc entry +// CYG_TRACEPROCOUT - default no comment proc exit + +// these are executed to deal with tracing - breakpoint? + +externC void +cyg_tracenomsg( char *psz_func, char *psz_file, cyg_uint32 linenum ); + +// provide every other one of these as a space/caller bloat compromise. + +# ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +enum cyg_trace_what{ + cyg_trace_trace = 0, + cyg_trace_enter, + cyg_trace_args, + cyg_trace_return, +// cyg_trace_, +// cyg_trace_, +}; + +externC void +cyg_tracemsg( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ); + +externC void +cyg_tracemsg2( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ); +externC void +cyg_tracemsg4( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3 ); +externC void +cyg_tracemsg6( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5 ); +externC void +cyg_tracemsg8( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5, + CYG_ADDRWORD arg6, CYG_ADDRWORD arg7 ); + +#endif // CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +// ------------------------------------------------------------------------- + +# ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +# define CYG_TRACE_docall0( _msg_ ) \ + cyg_tracemsg( cyg_trace_trace, \ + __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_ ); + +# define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \ + cyg_tracemsg2( cyg_trace_trace, \ + __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ + (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_ ); + +# define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \ + cyg_tracemsg4( cyg_trace_trace, \ + __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ + (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \ + (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_ ); + +# define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \ + _arg4_, _arg5_ ) \ + cyg_tracemsg6( cyg_trace_trace, \ + __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ + (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \ + (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \ + (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_ ); + +# define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \ + _arg4_, _arg5_, _arg6_, _arg7_ ) \ + cyg_tracemsg8( cyg_trace_trace, \ + __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ + (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \ + (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \ + (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_, \ + (CYG_ADDRWORD)_arg6_, (CYG_ADDRWORD)_arg7_ ); + +# else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +# define CYG_TRACE_docall0( _msg_ ) \ + cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); + +# define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \ + cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); + +# define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \ + cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); + +# define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \ + _arg4_, _arg5_ ) \ + cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); + +# define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_, _arg2_, _arg3_, \ + _arg4_, _arg5_, _arg6_, _arg7_ ) \ + cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); + +#endif + +// ------------------------------------------------------------------------- +// Conditioned trace; if the condition is false, fail. + +#define CYG_TRACE0( _bool_, _msg_ ) \ + CYG_MACRO_START \ + if ( ( _bool_ ) ) \ + CYG_TRACE_docall0( _msg_ ); \ + CYG_MACRO_END + +#define CYG_TRACE1( _bool_, _msg_, a ) \ + CYG_MACRO_START \ + if ( ( _bool_ ) ) \ + CYG_TRACE_docall2( _msg_, a, 0 ); \ + CYG_MACRO_END + +#define CYG_TRACE2( _bool_, _msg_, a, b ) \ + CYG_MACRO_START \ + if ( ( _bool_ ) ) \ + CYG_TRACE_docall2( _msg_, a, b ); \ + CYG_MACRO_END + +#define CYG_TRACE3( _bool_, _msg_, a, b, c ) \ + CYG_MACRO_START \ + if ( ( _bool_ ) ) \ + CYG_TRACE_docall4( _msg_, a, b, c, 0 ); \ + CYG_MACRO_END + +#define CYG_TRACE4( _bool_, _msg_, a, b, c, d ) \ + CYG_MACRO_START \ + if ( ( _bool_ ) ) \ + CYG_TRACE_docall4( _msg_, a, b, c, d ); \ + CYG_MACRO_END + +#define CYG_TRACE5( _bool_, _msg_, a, b, c, d, e ) \ + CYG_MACRO_START \ + if ( ( _bool_ ) ) \ + CYG_TRACE_docall6( _msg_, a, b, c, d, e, 0 ); \ + CYG_MACRO_END + +#define CYG_TRACE6( _bool_, _msg_, a, b, c, d, e, f ) \ + CYG_MACRO_START \ + if ( ( _bool_ ) ) \ + CYG_TRACE_docall6( _msg_, a, b, c, d, e, f ); \ + CYG_MACRO_END + +#define CYG_TRACE7( _bool_, _msg_, a, b, c, d, e, f, g ) \ + CYG_MACRO_START \ + if ( ( _bool_ ) ) \ + CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, 0 ); \ + CYG_MACRO_END + +#define CYG_TRACE8( _bool_, _msg_, a, b, c, d, e, f, g, h ) \ + CYG_MACRO_START \ + if ( ( _bool_ ) ) \ + CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, h ); \ + CYG_MACRO_END + +// ------------------------------------------------------------------------- +// Report function entry and exit. +// In C++ the macro CYG_REPORT_FUNCTION should appear as the first line of +// any function. It will generate a message whenever the function is entered +// and when it is exited. +// In C the macro should appear as the first statement after any local variable +// definitions. No exit message will be generated unless CYG_REPORT_RETURN is +// placed just before each return. +// Where a piece of code is to be compiled with both C and C++, the above +// rules for C should be followed. + +#ifdef CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS + +#ifdef __cplusplus + +class Cyg_TraceFunction_Report_ +{ +public: + int cond; + char *func; + char *file; + cyg_uint32 lnum; +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + char *exitmsg; + CYG_ADDRWORD exitvalue; + enum { UNSET = 0, SET, VOID } exitset; +#endif + + Cyg_TraceFunction_Report_( + int condition, char *psz_func, char *psz_file, + cyg_uint32 linenum) + { + cond = condition; + func = psz_func; + file = psz_file; + lnum = linenum; + +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + exitmsg = NULL; + exitset = UNSET; + if ( cond ) + cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter"); +#else + if ( cond ) + cyg_tracenomsg( func, file, lnum ); +#endif + }; + + Cyg_TraceFunction_Report_( + int condition, char *psz_func, char *psz_file, + cyg_uint32 linenum, char *psz_exitmsg ) + { + cond = condition; + func = psz_func; + file = psz_file; + lnum = linenum; +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + exitmsg = psz_exitmsg; + exitset = UNSET; + if ( cond ) + cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter"); +#else + CYG_UNUSED_PARAM( char *, psz_exitmsg ); + if ( cond ) + cyg_tracenomsg( func, file, lnum ); +#endif + }; + + inline void set_exitvoid( cyg_uint32 linenum ) + { + lnum = linenum; +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + CYG_ASSERT( NULL == exitmsg, "exitvoid used in typed function" ); + CYG_ASSERT( UNSET == exitset, "exitvoid used when arg already set" ); + exitset = VOID; +#endif + } + + inline void set_exitvalue( cyg_uint32 linenum, CYG_ADDRWORD retcode ) + { + lnum = linenum; +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + CYG_ASSERT( UNSET == exitset, "exitvalue used when arg already set" ); + exitvalue = retcode; + exitset = SET; +#else + CYG_UNUSED_PARAM( CYG_ADDRWORD, retcode ); +#endif + } + + ~Cyg_TraceFunction_Report_() + { + if ( cond ) { +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + if ( VOID == exitset ) + cyg_tracemsg( cyg_trace_return, func, file, lnum, + "return void"); + else if ( UNSET == exitset ) + cyg_tracemsg( cyg_trace_return, func, file, lnum, + "RETURNING UNSET!"); + else if ( NULL == exitmsg ) + cyg_tracemsg2( cyg_trace_return, func, file, lnum, + "return %08x", exitvalue, 0 ); + else + cyg_tracemsg2( cyg_trace_return, func, file, lnum, + exitmsg, exitvalue, 0 ); +#else + cyg_tracenomsg( func, file, lnum ); +#endif + } + } +}; + +// These have no CYG_MACRO_START,END around because it is required +// that the scope of the object be the whole function body. Get it? + +// These are the unconditional versions: +#define CYG_REPORT_FUNCTION() \ + Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ + 1, __PRETTY_FUNCTION__, \ + __FILE__, __LINE__ ) + +#define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \ + Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ + 1, __PRETTY_FUNCTION__, \ + __FILE__, __LINE__, _exitmsg_ ) + +#define CYG_REPORT_FUNCNAME( _name_ ) \ + Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ + 1, _name_, \ + __FILE__, __LINE__ ) + +#define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \ + Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ + 1, _name_, \ + __FILE__, __LINE__, _exitmsg_ ) + +// These are conditioned on macro CYG_REPORT_USER_BOOL +// (which you better have defined) +#define CYG_REPORT_FUNCTIONC() \ + Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ + CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \ + __FILE__, __LINE__ ) + +#define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \ + Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ + CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \ + __FILE__, __LINE__, _exitmsg_ ) + +#define CYG_REPORT_FUNCNAMEC( _name_ ) \ + Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ + CYG_REPORT_USER_BOOL, _name_, \ + __FILE__, __LINE__ ) + +#define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \ + Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ + CYG_REPORT_USER_BOOL, _name_, \ + __FILE__, __LINE__, _exitmsg_ ) + + +#define CYG_REPORT_RETURN() CYG_MACRO_START \ + cyg_tracefunction_report_.set_exitvoid( __LINE__ ); \ +CYG_MACRO_END + +#define CYG_REPORT_RETVAL( _value_) CYG_MACRO_START \ + cyg_tracefunction_report_.set_exitvalue( \ + __LINE__, (CYG_ADDRWORD)(_value_) ); \ +CYG_MACRO_END + + +#else // not __cplusplus + + +struct Cyg_TraceFunction_Report_ +{ + int cond; + char *func; + char *file; /* not strictly needed in plain 'C' */ + cyg_uint32 lnum; /* nor this */ +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + char *exitmsg; + CYG_ADDRWORD exitvalue; + int exitset; +#endif + +}; + +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +#define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg( cyg_trace_enter, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + "enter" ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \ + { _c_, _fn_, _fl_, _l_, _xm_, _xv_, _xs_ } + +#else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +#define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracenomsg( cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \ + { _c_, _fn_, _fl_, _l_ } + +#endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +// These have no CYG_MACRO_START,END around because it is required +// that the scope of the object be the whole function body. Get it? + +// These are the unconditional versions: +#define CYG_REPORT_FUNCTION() \ + struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ + CYG_REPORT_FUNCTION_CONSTRUCT( \ + 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \ + CYG_REPORT_FUNCTION_ENTER_INTERNAL() + +#define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \ + struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ + CYG_REPORT_FUNCTION_CONSTRUCT( \ + 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ + CYG_REPORT_FUNCTION_ENTER_INTERNAL() + +#define CYG_REPORT_FUNCNAME( _name_ ) \ + struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ + CYG_REPORT_FUNCTION_CONSTRUCT( \ + 1, _name_, __FILE__, __LINE__, NULL, 0, 0 ); \ + CYG_REPORT_FUNCTION_ENTER_INTERNAL() + +#define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \ + struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ + CYG_REPORT_FUNCTION_CONSTRUCT( \ + 1, _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ + CYG_REPORT_FUNCTION_ENTER_INTERNAL() + +// These are conditioned on macro CYG_REPORT_USER_BOOL +// (which you better have defined) +#define CYG_REPORT_FUNCTIONC() \ + struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ + CYG_REPORT_FUNCTION_CONSTRUCT( \ + CYG_REPORT_USER_BOOL, \ + __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \ + CYG_REPORT_FUNCTION_ENTER_INTERNAL() + +#define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \ + struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ + CYG_REPORT_FUNCTION_CONSTRUCT( \ + CYG_REPORT_USER_BOOL, \ + __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ + CYG_REPORT_FUNCTION_ENTER_INTERNAL() + +#define CYG_REPORT_FUNCNAMEC( _name_ ) \ + struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ + CYG_REPORT_FUNCTION_CONSTRUCT( \ + CYG_REPORT_USER_BOOL, \ + _name_, __FILE__, __LINE__, NULL, 0, 0 ); \ + CYG_REPORT_FUNCTION_ENTER_INTERNAL() + +#define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \ + struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ + CYG_REPORT_FUNCTION_CONSTRUCT( \ + CYG_REPORT_USER_BOOL, \ + _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ + CYG_REPORT_FUNCTION_ENTER_INTERNAL() + +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +#define CYG_REPORT_RETURN() CYG_MACRO_START \ + CYG_ASSERT( NULL == cyg_tracefunction_report_.exitmsg, \ + "exitvoid used in typed function" ); \ + CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \ + "exitvoid used when arg already set" ); \ + cyg_tracefunction_report_.lnum = __LINE__; \ + cyg_tracefunction_report_.exitset = 2; \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg( cyg_trace_return, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + "return void" ); \ +CYG_MACRO_END + +#define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \ + CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \ + "exitvalue used when arg already set" ); \ + cyg_tracefunction_report_.lnum = __LINE__; \ + cyg_tracefunction_report_.exitvalue = (CYG_ADDRWORD)(_value_); \ + cyg_tracefunction_report_.exitset = 1; \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg2( cyg_trace_return, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + cyg_tracefunction_report_.exitmsg ? \ + cyg_tracefunction_report_.exitmsg : \ + "return %08x", \ + cyg_tracefunction_report_.exitvalue, 0 ); \ +CYG_MACRO_END + +#else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +#define CYG_REPORT_RETURN() CYG_MACRO_START \ + cyg_tracefunction_report_.lnum = __LINE__; \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracenomsg( cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum ); \ +CYG_MACRO_END + +#define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \ + CYG_REPORT_RETURN(); \ +CYG_MACRO_END + +#endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +#endif // not __cplusplus + +#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +#define CYG_REPORT_FUNCARGVOID() CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg( cyg_trace_args, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + "(void)" \ + ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCARG1( _format_, a ) CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg2( cyg_trace_args, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + (_format_), \ + (CYG_ADDRWORD)a , 0 \ + ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg2( cyg_trace_args, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + (_format_), \ + (CYG_ADDRWORD)a, (CYG_ADDRWORD)b \ + ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg4( cyg_trace_args, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + (_format_), \ + (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ + (CYG_ADDRWORD)c , 0 \ + ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg4( cyg_trace_args, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + (_format_), \ + (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ + (CYG_ADDRWORD)c, (CYG_ADDRWORD)d \ + ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg6( cyg_trace_args, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + (_format_), \ + (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ + (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ + (CYG_ADDRWORD)e , 0 \ + ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg6( cyg_trace_args, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + (_format_), \ + (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ + (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ + (CYG_ADDRWORD)e, (CYG_ADDRWORD)f \ + ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_MACRO_START \ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg8( cyg_trace_args, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + (_format_), \ + (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ + (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ + (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \ + (CYG_ADDRWORD)g , 0 \ + ); \ +CYG_MACRO_END + +#define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_MACRO_START\ + if ( cyg_tracefunction_report_.cond ) \ + cyg_tracemsg8( cyg_trace_args, \ + cyg_tracefunction_report_.func, \ + cyg_tracefunction_report_.file, \ + cyg_tracefunction_report_.lnum, \ + (_format_), \ + (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ + (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ + (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \ + (CYG_ADDRWORD)g, (CYG_ADDRWORD)h, \ + ); \ +CYG_MACRO_END + + +#else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +#define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT + +#endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +#else // no CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS + +#define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT + +#define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT + +#define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT + +#define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT +#define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT + +#endif // CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS + +#else // ! CYGDBG_USE_TRACING + +// ------------------------------------------------------------------------- +// No traces: we define empty statements for trace macros. + +#define CYG_TRACE0( _bool_, _msg_ ) CYG_EMPTY_STATEMENT +#define CYG_TRACE1( _bool_, _msg_, a ) CYG_EMPTY_STATEMENT +#define CYG_TRACE2( _bool_, _msg_, a,b ) CYG_EMPTY_STATEMENT +#define CYG_TRACE3( _bool_, _msg_, a,b,c ) CYG_EMPTY_STATEMENT +#define CYG_TRACE4( _bool_, _msg_, a,b,c,d ) CYG_EMPTY_STATEMENT +#define CYG_TRACE5( _bool_, _msg_, a,b,c,d,e ) CYG_EMPTY_STATEMENT +#define CYG_TRACE6( _bool_, _msg_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT +#define CYG_TRACE7( _bool_, _msg_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT +#define CYG_TRACE8( _bool_, _msg_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT + +#define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT + +#define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT + +#define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT +#define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT + +#define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT +#define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT + +#endif // ! CYGDBG_USE_TRACING + +// ------------------------------------------------------------------------- +// +// CYG_TRACEn{[XDY]{V}}{B} +// +// Convenience macros: these fall into a few dimensions, with suffix letters: +// First option: +// X: user need not supply a format string, %08x is used +// D: ditto but signed decimal, %d +// Y: ditto but just plain %x +// Second option, only meaningful with one of XDY: +// V: " = %..." is used, by stringifying the argument +// Third option: +// B: user need not supply a bool; the symbol CYG_TRACE_USER_BOOL is +// used (which we do not define, user must do this) + +#define CYG_TRACE0B( _msg_ ) \ + CYG_TRACE0( CYG_TRACE_USER_BOOL, _msg_ ) +#define CYG_TRACE1B( _msg_, a ) \ + CYG_TRACE1( CYG_TRACE_USER_BOOL, _msg_, a ) +#define CYG_TRACE2B( _msg_, a,b ) \ + CYG_TRACE2( CYG_TRACE_USER_BOOL, _msg_, a,b ) +#define CYG_TRACE3B( _msg_, a,b,c ) \ + CYG_TRACE3( CYG_TRACE_USER_BOOL, _msg_, a,b,c ) +#define CYG_TRACE4B( _msg_, a,b,c,d ) \ + CYG_TRACE4( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d ) +#define CYG_TRACE5B( _msg_, a,b,c,d,e ) \ + CYG_TRACE5( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e ) +#define CYG_TRACE6B( _msg_, a,b,c,d,e,f ) \ + CYG_TRACE6( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f ) +#define CYG_TRACE7B( _msg_, a,b,c,d,e,f,g ) \ + CYG_TRACE7( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g ) +#define CYG_TRACE8B( _msg_, a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g,h ) + +// long hex versions + +#define CYG_TRACE1X( _bool_, a ) \ + CYG_TRACE1( _bool_, "%08x", a ) +#define CYG_TRACE2X( _bool_, a,b ) \ + CYG_TRACE2( _bool_, "%08x %08x", a,b ) +#define CYG_TRACE3X( _bool_, a,b,c ) \ + CYG_TRACE3( _bool_, "%08x %08x %08x", a,b,c ) +#define CYG_TRACE4X( _bool_, a,b,c,d ) \ + CYG_TRACE4( _bool_, "%08x %08x %08x %08x", a,b,c,d ) +#define CYG_TRACE5X( _bool_, a,b,c,d,e ) \ + CYG_TRACE5( _bool_, "%08x %08x %08x %08x %08x", a,b,c,d,e ) +#define CYG_TRACE6X( _bool_, a,b,c,d,e,f ) \ + CYG_TRACE6( _bool_, "%08x %08x %08x %08x %08x %08x", \ + a,b,c,d,e,f ) +#define CYG_TRACE7X( _bool_, a,b,c,d,e,f,g ) \ + CYG_TRACE7( _bool_, "%08x %08x %08x %08x %08x %08x %08x", \ + a,b,c,d,e,f,g ) +#define CYG_TRACE8X( _bool_, a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( _bool_, "%08x %08x %08x %08x %08x %08x %08x %08x", \ + a,b,c,d,e,f,g,h ) + +#define CYG_TRACE1XV( _bool_, a ) \ + CYG_TRACE1( _bool_, # a "=%08x ", a ) +#define CYG_TRACE2XV( _bool_, a,b ) \ + CYG_TRACE2( _bool_, \ + # a "=%08x " # b "=%08x " , a,b ) +#define CYG_TRACE3XV( _bool_, a,b,c ) \ + CYG_TRACE3( _bool_, \ + # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c ) +#define CYG_TRACE4XV( _bool_, a,b,c,d ) \ + CYG_TRACE4( _bool_, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + , a,b,c,d ) +#define CYG_TRACE5XV( _bool_, a,b,c,d,e ) \ + CYG_TRACE5( _bool_, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " \ + , a,b,c,d,e ) +#define CYG_TRACE6XV( _bool_, a,b,c,d,e,f ) \ + CYG_TRACE6( _bool_, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " # f "=%08x " \ + , a,b,c,d,e,f ) +#define CYG_TRACE7XV( _bool_, a,b,c,d,e,f,g ) \ + CYG_TRACE7( _bool_, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " # f "=%08x " # g "=%08x " \ + , a,b,c,d,e,f,g ) +#define CYG_TRACE8XV( _bool_, a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( _bool_, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \ + , a,b,c,d,e,f,g,h ) + +#define CYG_TRACE1XB( a ) \ + CYG_TRACE1( CYG_TRACE_USER_BOOL, "%08x", a ) +#define CYG_TRACE2XB( a,b ) \ + CYG_TRACE2( CYG_TRACE_USER_BOOL, "%08x %08x", a,b ) +#define CYG_TRACE3XB( a,b,c ) \ + CYG_TRACE3( CYG_TRACE_USER_BOOL, "%08x %08x %08x", a,b,c ) +#define CYG_TRACE4XB( a,b,c,d ) \ + CYG_TRACE4( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x", a,b,c,d ) +#define CYG_TRACE5XB( a,b,c,d,e ) \ + CYG_TRACE5( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x", a,b,c,d,e ) +#define CYG_TRACE6XB( a,b,c,d,e,f ) \ + CYG_TRACE6( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x", \ + a,b,c,d,e,f ) +#define CYG_TRACE7XB( a,b,c,d,e,f,g ) \ + CYG_TRACE7( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x", \ + a,b,c,d,e,f,g ) +#define CYG_TRACE8XB( a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x %08x", \ + a,b,c,d,e,f,g,h ) + +#define CYG_TRACE1XVB( a ) \ + CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%08x ", a ) +#define CYG_TRACE2XVB( a,b ) \ + CYG_TRACE2( CYG_TRACE_USER_BOOL, \ + # a "=%08x " # b "=%08x " , a,b ) +#define CYG_TRACE3XVB( a,b,c ) \ + CYG_TRACE3( CYG_TRACE_USER_BOOL, \ + # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c ) +#define CYG_TRACE4XVB( a,b,c,d ) \ + CYG_TRACE4( CYG_TRACE_USER_BOOL, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + , a,b,c,d ) +#define CYG_TRACE5XVB( a,b,c,d,e ) \ + CYG_TRACE5( CYG_TRACE_USER_BOOL, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " \ + , a,b,c,d,e ) +#define CYG_TRACE6XVB( a,b,c,d,e,f ) \ + CYG_TRACE6( CYG_TRACE_USER_BOOL, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " # f "=%08x " \ + , a,b,c,d,e,f ) +#define CYG_TRACE7XVB( a,b,c,d,e,f,g ) \ + CYG_TRACE7( CYG_TRACE_USER_BOOL, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " # f "=%08x " # g "=%08x " \ + , a,b,c,d,e,f,g ) +#define CYG_TRACE8XVB( a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( CYG_TRACE_USER_BOOL, \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \ + , a,b,c,d,e,f,g,h ) + +// decimal versions + +#define CYG_TRACE1D( _bool_, a ) \ + CYG_TRACE1( _bool_, "%d", a ) +#define CYG_TRACE2D( _bool_, a,b ) \ + CYG_TRACE2( _bool_, "%d %d", a,b ) +#define CYG_TRACE3D( _bool_, a,b,c ) \ + CYG_TRACE3( _bool_, "%d %d %d", a,b,c ) +#define CYG_TRACE4D( _bool_, a,b,c,d ) \ + CYG_TRACE4( _bool_, "%d %d %d %d", a,b,c,d ) +#define CYG_TRACE5D( _bool_, a,b,c,d,e ) \ + CYG_TRACE5( _bool_, "%d %d %d %d %d", a,b,c,d,e ) +#define CYG_TRACE6D( _bool_, a,b,c,d,e,f ) \ + CYG_TRACE6( _bool_, "%d %d %d %d %d %d", \ + a,b,c,d,e,f ) +#define CYG_TRACE7D( _bool_, a,b,c,d,e,f,g ) \ + CYG_TRACE7( _bool_, "%d %d %d %d %d %d %d", \ + a,b,c,d,e,f,g ) +#define CYG_TRACE8D( _bool_, a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( _bool_, "%d %d %d %d %d %d %d %d", \ + a,b,c,d,e,f,g,h ) + +#define CYG_TRACE1DV( _bool_, a ) \ + CYG_TRACE1( _bool_, # a "=%d ", a ) +#define CYG_TRACE2DV( _bool_, a,b ) \ + CYG_TRACE2( _bool_, \ + # a "=%d " # b "=%d " , a,b ) +#define CYG_TRACE3DV( _bool_, a,b,c ) \ + CYG_TRACE3( _bool_, \ + # a "=%d " # b "=%d " # c "=%d " , a,b,c ) +#define CYG_TRACE4DV( _bool_, a,b,c,d ) \ + CYG_TRACE4( _bool_, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + , a,b,c,d ) +#define CYG_TRACE5DV( _bool_, a,b,c,d,e ) \ + CYG_TRACE5( _bool_, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " \ + , a,b,c,d,e ) +#define CYG_TRACE6DV( _bool_, a,b,c,d,e,f ) \ + CYG_TRACE6( _bool_, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " # f "=%d " \ + , a,b,c,d,e,f ) +#define CYG_TRACE7DV( _bool_, a,b,c,d,e,f,g ) \ + CYG_TRACE7( _bool_, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " # f "=%d " # g "=%d " \ + , a,b,c,d,e,f,g ) +#define CYG_TRACE8DV( _bool_, a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( _bool_, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " # f "=%d " # g "=%d " # h "=%d " \ + , a,b,c,d,e,f,g,h ) + +#define CYG_TRACE1DB( a ) \ + CYG_TRACE1( CYG_TRACE_USER_BOOL, "%d", a ) +#define CYG_TRACE2DB( a,b ) \ + CYG_TRACE2( CYG_TRACE_USER_BOOL, "%d %d", a,b ) +#define CYG_TRACE3DB( a,b,c ) \ + CYG_TRACE3( CYG_TRACE_USER_BOOL, "%d %d %d", a,b,c ) +#define CYG_TRACE4DB( a,b,c,d ) \ + CYG_TRACE4( CYG_TRACE_USER_BOOL, "%d %d %d %d", a,b,c,d ) +#define CYG_TRACE5DB( a,b,c,d,e ) \ + CYG_TRACE5( CYG_TRACE_USER_BOOL, "%d %d %d %d %d", a,b,c,d,e ) +#define CYG_TRACE6DB( a,b,c,d,e,f ) \ + CYG_TRACE6( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d", \ + a,b,c,d,e,f ) +#define CYG_TRACE7DB( a,b,c,d,e,f,g ) \ + CYG_TRACE7( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d", \ + a,b,c,d,e,f,g ) +#define CYG_TRACE8DB( a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d %d", \ + a,b,c,d,e,f,g,h ) + +#define CYG_TRACE1DVB( a ) \ + CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%d ", a ) +#define CYG_TRACE2DVB( a,b ) \ + CYG_TRACE2( CYG_TRACE_USER_BOOL, \ + # a "=%d " # b "=%d " , a,b ) +#define CYG_TRACE3DVB( a,b,c ) \ + CYG_TRACE3( CYG_TRACE_USER_BOOL, \ + # a "=%d " # b "=%d " # c "=%d " , a,b,c ) +#define CYG_TRACE4DVB( a,b,c,d ) \ + CYG_TRACE4( CYG_TRACE_USER_BOOL, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + , a,b,c,d ) +#define CYG_TRACE5DVB( a,b,c,d,e ) \ + CYG_TRACE5( CYG_TRACE_USER_BOOL, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " \ + , a,b,c,d,e ) +#define CYG_TRACE6DVB( a,b,c,d,e,f ) \ + CYG_TRACE6( CYG_TRACE_USER_BOOL, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " # f "=%d " \ + , a,b,c,d,e,f ) +#define CYG_TRACE7DVB( a,b,c,d,e,f,g ) \ + CYG_TRACE7( CYG_TRACE_USER_BOOL, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " # f "=%d " # g "=%d " \ + , a,b,c,d,e,f,g ) +#define CYG_TRACE8DVB( a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( CYG_TRACE_USER_BOOL, \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " # f "=%d " # g "=%d " # h "=%d " \ + , a,b,c,d,e,f,g,h ) + +// short hex versions + +#define CYG_TRACE1Y( _bool_, a ) \ + CYG_TRACE1( _bool_, "%x", a ) +#define CYG_TRACE2Y( _bool_, a,b ) \ + CYG_TRACE2( _bool_, "%x %x", a,b ) +#define CYG_TRACE3Y( _bool_, a,b,c ) \ + CYG_TRACE3( _bool_, "%x %x %x", a,b,c ) +#define CYG_TRACE4Y( _bool_, a,b,c,d ) \ + CYG_TRACE4( _bool_, "%x %x %x %x", a,b,c,d ) +#define CYG_TRACE5Y( _bool_, a,b,c,d,e ) \ + CYG_TRACE5( _bool_, "%x %x %x %x %x", a,b,c,d,e ) +#define CYG_TRACE6Y( _bool_, a,b,c,d,e,f ) \ + CYG_TRACE6( _bool_, "%x %x %x %x %x %x", \ + a,b,c,d,e,f ) +#define CYG_TRACE7Y( _bool_, a,b,c,d,e,f,g ) \ + CYG_TRACE7( _bool_, "%x %x %x %x %x %x %x", \ + a,b,c,d,e,f,g ) +#define CYG_TRACE8Y( _bool_, a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( _bool_, "%x %x %x %x %x %x %x %x", \ + a,b,c,d,e,f,g,h ) + +#define CYG_TRACE1YV( _bool_, a ) \ + CYG_TRACE1( _bool_, # a "=%x ", a ) +#define CYG_TRACE2YV( _bool_, a,b ) \ + CYG_TRACE2( _bool_, \ + # a "=%x " # b "=%x " , a,b ) +#define CYG_TRACE3YV( _bool_, a,b,c ) \ + CYG_TRACE3( _bool_, \ + # a "=%x " # b "=%x " # c "=%x " , a,b,c ) +#define CYG_TRACE4YV( _bool_, a,b,c,d ) \ + CYG_TRACE4( _bool_, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + , a,b,c,d ) +#define CYG_TRACE5YV( _bool_, a,b,c,d,e ) \ + CYG_TRACE5( _bool_, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " \ + , a,b,c,d,e ) +#define CYG_TRACE6YV( _bool_, a,b,c,d,e,f ) \ + CYG_TRACE6( _bool_, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " # f "=%x " \ + , a,b,c,d,e,f ) +#define CYG_TRACE7YV( _bool_, a,b,c,d,e,f,g ) \ + CYG_TRACE7( _bool_, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " # f "=%x " # g "=%x " \ + , a,b,c,d,e,f,g ) +#define CYG_TRACE8YV( _bool_, a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( _bool_, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " # f "=%x " # g "=%x " # h "=%x " \ + , a,b,c,d,e,f,g,h ) + +#define CYG_TRACE1YB( a ) \ + CYG_TRACE1( CYG_TRACE_USER_BOOL, "%x", a ) +#define CYG_TRACE2YB( a,b ) \ + CYG_TRACE2( CYG_TRACE_USER_BOOL, "%x %x", a,b ) +#define CYG_TRACE3YB( a,b,c ) \ + CYG_TRACE3( CYG_TRACE_USER_BOOL, "%x %x %x", a,b,c ) +#define CYG_TRACE4YB( a,b,c,d ) \ + CYG_TRACE4( CYG_TRACE_USER_BOOL, "%x %x %x %x", a,b,c,d ) +#define CYG_TRACE5YB( a,b,c,d,e ) \ + CYG_TRACE5( CYG_TRACE_USER_BOOL, "%x %x %x %x %x", a,b,c,d,e ) +#define CYG_TRACE6YB( a,b,c,d,e,f ) \ + CYG_TRACE6( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x", \ + a,b,c,d,e,f ) +#define CYG_TRACE7YB( a,b,c,d,e,f,g ) \ + CYG_TRACE7( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x", \ + a,b,c,d,e,f,g ) +#define CYG_TRACE8YB( a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x %x", \ + a,b,c,d,e,f,g,h ) + +#define CYG_TRACE1YVB( a ) \ + CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%x ", a ) +#define CYG_TRACE2YVB( a,b ) \ + CYG_TRACE2( CYG_TRACE_USER_BOOL, \ + # a "=%x " # b "=%x " , a,b ) +#define CYG_TRACE3YVB( a,b,c ) \ + CYG_TRACE3( CYG_TRACE_USER_BOOL, \ + # a "=%x " # b "=%x " # c "=%x " , a,b,c ) +#define CYG_TRACE4YVB( a,b,c,d ) \ + CYG_TRACE4( CYG_TRACE_USER_BOOL, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + , a,b,c,d ) +#define CYG_TRACE5YVB( a,b,c,d,e ) \ + CYG_TRACE5( CYG_TRACE_USER_BOOL, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " \ + , a,b,c,d,e ) +#define CYG_TRACE6YVB( a,b,c,d,e,f ) \ + CYG_TRACE6( CYG_TRACE_USER_BOOL, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " # f "=%x " \ + , a,b,c,d,e,f ) +#define CYG_TRACE7YVB( a,b,c,d,e,f,g ) \ + CYG_TRACE7( CYG_TRACE_USER_BOOL, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " # f "=%x " # g "=%x " \ + , a,b,c,d,e,f,g ) +#define CYG_TRACE8YVB( a,b,c,d,e,f,g,h ) \ + CYG_TRACE8( CYG_TRACE_USER_BOOL, \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " # f "=%x " # g "=%x " # h "=%x " \ + , a,b,c,d,e,f,g,h ) + +// ------------------------------------------------------------------------- +// +// CYG_REPORT_FUNCARGn{[XDY]{V}} +// +// Convenience macros two: these fall into a few dimensions, with suffix letters: +// First option: +// X: user need not supply a format string, %08x is used +// D: ditto but signed decimal, %d +// Y: ditto but just plain %x +// Second option, only meaningful with one of XDY: +// V: " = %..." is used, by stringifying the argument + +// long hex versions + +#define CYG_REPORT_FUNCARG1X( a ) \ + CYG_REPORT_FUNCARG1( "%08x", a ) +#define CYG_REPORT_FUNCARG2X( a,b ) \ + CYG_REPORT_FUNCARG2( "%08x %08x", a,b ) +#define CYG_REPORT_FUNCARG3X( a,b,c ) \ + CYG_REPORT_FUNCARG3( "%08x %08x %08x", a,b,c ) +#define CYG_REPORT_FUNCARG4X( a,b,c,d ) \ + CYG_REPORT_FUNCARG4( "%08x %08x %08x %08x", a,b,c,d ) +#define CYG_REPORT_FUNCARG5X( a,b,c,d,e ) \ + CYG_REPORT_FUNCARG5( "%08x %08x %08x %08x %08x", a,b,c,d,e ) +#define CYG_REPORT_FUNCARG6X( a,b,c,d,e,f ) \ + CYG_REPORT_FUNCARG6( "%08x %08x %08x %08x %08x %08x", \ + a,b,c,d,e,f ) +#define CYG_REPORT_FUNCARG7X( a,b,c,d,e,f,g ) \ + CYG_REPORT_FUNCARG7( "%08x %08x %08x %08x %08x %08x %08x", \ + a,b,c,d,e,f,g ) +#define CYG_REPORT_FUNCARG8X( a,b,c,d,e,f,g,h ) \ + CYG_REPORT_FUNCARG8( "%08x %08x %08x %08x %08x %08x %08x %08x", \ + a,b,c,d,e,f,g,h ) + +#define CYG_REPORT_FUNCARG1XV( a ) \ + CYG_REPORT_FUNCARG1( # a "=%08x ", a ) +#define CYG_REPORT_FUNCARG2XV( a,b ) \ + CYG_REPORT_FUNCARG2( \ + # a "=%08x " # b "=%08x " , a,b ) +#define CYG_REPORT_FUNCARG3XV( a,b,c ) \ + CYG_REPORT_FUNCARG3( \ + # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c ) +#define CYG_REPORT_FUNCARG4XV( a,b,c,d ) \ + CYG_REPORT_FUNCARG4( \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + , a,b,c,d ) +#define CYG_REPORT_FUNCARG5XV( a,b,c,d,e ) \ + CYG_REPORT_FUNCARG5( \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " \ + , a,b,c,d,e ) +#define CYG_REPORT_FUNCARG6XV( a,b,c,d,e,f ) \ + CYG_REPORT_FUNCARG6( \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " # f "=%08x " \ + , a,b,c,d,e,f ) +#define CYG_REPORT_FUNCARG7XV( a,b,c,d,e,f,g ) \ + CYG_REPORT_FUNCARG7( \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " # f "=%08x " # g "=%08x " \ + , a,b,c,d,e,f,g ) +#define CYG_REPORT_FUNCARG8XV( a,b,c,d,e,f,g,h ) \ + CYG_REPORT_FUNCARG8( \ + # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ + # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \ + , a,b,c,d,e,f,g,h ) + +// decimal versions + + +#define CYG_REPORT_FUNCARG1D( a ) \ + CYG_REPORT_FUNCARG1( "%d", a ) +#define CYG_REPORT_FUNCARG2D( a,b ) \ + CYG_REPORT_FUNCARG2( "%d %d", a,b ) +#define CYG_REPORT_FUNCARG3D( a,b,c ) \ + CYG_REPORT_FUNCARG3( "%d %d %d", a,b,c ) +#define CYG_REPORT_FUNCARG4D( a,b,c,d ) \ + CYG_REPORT_FUNCARG4( "%d %d %d %d", a,b,c,d ) +#define CYG_REPORT_FUNCARG5D( a,b,c,d,e ) \ + CYG_REPORT_FUNCARG5( "%d %d %d %d %d", a,b,c,d,e ) +#define CYG_REPORT_FUNCARG6D( a,b,c,d,e,f ) \ + CYG_REPORT_FUNCARG6( "%d %d %d %d %d %d", \ + a,b,c,d,e,f ) +#define CYG_REPORT_FUNCARG7D( a,b,c,d,e,f,g ) \ + CYG_REPORT_FUNCARG7( "%d %d %d %d %d %d %d", \ + a,b,c,d,e,f,g ) +#define CYG_REPORT_FUNCARG8D( a,b,c,d,e,f,g,h ) \ + CYG_REPORT_FUNCARG8( "%d %d %d %d %d %d %d %d", \ + a,b,c,d,e,f,g,h ) + +#define CYG_REPORT_FUNCARG1DV( a ) \ + CYG_REPORT_FUNCARG1( # a "=%d ", a ) +#define CYG_REPORT_FUNCARG2DV( a,b ) \ + CYG_REPORT_FUNCARG2( \ + # a "=%d " # b "=%d " , a,b ) +#define CYG_REPORT_FUNCARG3DV( a,b,c ) \ + CYG_REPORT_FUNCARG3( \ + # a "=%d " # b "=%d " # c "=%d " , a,b,c ) +#define CYG_REPORT_FUNCARG4DV( a,b,c,d ) \ + CYG_REPORT_FUNCARG4( \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + , a,b,c,d ) +#define CYG_REPORT_FUNCARG5DV( a,b,c,d,e ) \ + CYG_REPORT_FUNCARG5( \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " \ + , a,b,c,d,e ) +#define CYG_REPORT_FUNCARG6DV( a,b,c,d,e,f ) \ + CYG_REPORT_FUNCARG6( \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " # f "=%d " \ + , a,b,c,d,e,f ) +#define CYG_REPORT_FUNCARG7DV( a,b,c,d,e,f,g ) \ + CYG_REPORT_FUNCARG7( \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " # f "=%d " # g "=%d " \ + , a,b,c,d,e,f,g ) +#define CYG_REPORT_FUNCARG8DV( a,b,c,d,e,f,g,h ) \ + CYG_REPORT_FUNCARG8( \ + # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ + # e "=%d " # f "=%d " # g "=%d " # h "=%d " \ + , a,b,c,d,e,f,g,h ) + +// short hex versions + +#define CYG_REPORT_FUNCARG1Y( a ) \ + CYG_REPORT_FUNCARG1( "%x", a ) +#define CYG_REPORT_FUNCARG2Y( a,b ) \ + CYG_REPORT_FUNCARG2( "%x %x", a,b ) +#define CYG_REPORT_FUNCARG3Y( a,b,c ) \ + CYG_REPORT_FUNCARG3( "%x %x %x", a,b,c ) +#define CYG_REPORT_FUNCARG4Y( a,b,c,d ) \ + CYG_REPORT_FUNCARG4( "%x %x %x %x", a,b,c,d ) +#define CYG_REPORT_FUNCARG5Y( a,b,c,d,e ) \ + CYG_REPORT_FUNCARG5( "%x %x %x %x %x", a,b,c,d,e ) +#define CYG_REPORT_FUNCARG6Y( a,b,c,d,e,f ) \ + CYG_REPORT_FUNCARG6( "%x %x %x %x %x %x", \ + a,b,c,d,e,f ) +#define CYG_REPORT_FUNCARG7Y( a,b,c,d,e,f,g ) \ + CYG_REPORT_FUNCARG7( "%x %x %x %x %x %x %x", \ + a,b,c,d,e,f,g ) +#define CYG_REPORT_FUNCARG8Y( a,b,c,d,e,f,g,h ) \ + CYG_REPORT_FUNCARG8( "%x %x %x %x %x %x %x %x", \ + a,b,c,d,e,f,g,h ) + +#define CYG_REPORT_FUNCARG1YV( a ) \ + CYG_REPORT_FUNCARG1( # a "=%x ", a ) +#define CYG_REPORT_FUNCARG2YV( a,b ) \ + CYG_REPORT_FUNCARG2( \ + # a "=%x " # b "=%x " , a,b ) +#define CYG_REPORT_FUNCARG3YV( a,b,c ) \ + CYG_REPORT_FUNCARG3( \ + # a "=%x " # b "=%x " # c "=%x " , a,b,c ) +#define CYG_REPORT_FUNCARG4YV( a,b,c,d ) \ + CYG_REPORT_FUNCARG4( \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + , a,b,c,d ) +#define CYG_REPORT_FUNCARG5YV( a,b,c,d,e ) \ + CYG_REPORT_FUNCARG5( \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " \ + , a,b,c,d,e ) +#define CYG_REPORT_FUNCARG6YV( a,b,c,d,e,f ) \ + CYG_REPORT_FUNCARG6( \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " # f "=%x " \ + , a,b,c,d,e,f ) +#define CYG_REPORT_FUNCARG7YV( a,b,c,d,e,f,g ) \ + CYG_REPORT_FUNCARG7( \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " # f "=%x " # g "=%x " \ + , a,b,c,d,e,f,g ) +#define CYG_REPORT_FUNCARG8YV( a,b,c,d,e,f,g,h ) \ + CYG_REPORT_FUNCARG8( \ + # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ + # e "=%x " # f "=%x " # g "=%x " # h "=%x " \ + , a,b,c,d,e,f,g,h ) + + +#endif // CYGONCE_INFRA_CYG_TRAC_H multiple inclusion protection +// EOF cyg_trac.h diff --git a/packages/infra/current/include/cyg_type.h b/packages/infra/current/include/cyg_type.h new file mode 100644 --- /dev/null +++ b/packages/infra/current/include/cyg_type.h @@ -0,0 +1,267 @@ +#ifndef CYGONCE_INFRA_CYG_TYPE_H +#define CYGONCE_INFRA_CYG_TYPE_H + +//========================================================================== +// +// cyg_type.h +// +// Standard types, and some useful coding macros. +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg from an original by hmt +// Contributors: nickg +// Date: 1997-09-08 +// Purpose: share unambiguously sized types. +// Description: we typedef [cyg_][u]int8,16,32 &c for general use. +// Usage: #include "cyg/infra/cyg_type.h" +// ... +// cyg_int32 my_32bit_integer; +// +//####DESCRIPTIONEND#### +// + +#include // Configuration header for the infra package +#include // Definition of NULL from the compiler + +// ------------------------------------------------------------------------- +// Some useful macros. These are defined here by default. + +// externC is used in mixed C/C++ headers to force C linkage on an external +// definition. It avoids having to put all sorts of ifdefs in. + +#ifdef __cplusplus +# define externC extern "C" +#else +# define externC extern +#endif + + +// ------------------------------------------------------------------------- +// The header defines the base types used here. It is +// supplied either by the target architecture HAL, or by the host +// porting kit. They are all defined as macros, and only those that +// make choices other than the defaults given below need be defined. + +#define CYG_LSBFIRST 1234 +#define CYG_MSBFIRST 4321 + +#include + +#if (CYG_BYTEORDER != CYG_LSBFIRST) && (CYG_BYTEORDER != CYG_MSBFIRST) +# error You must define CYG_BYTEORDER to equal CYG_LSBFIRST or CYG_MSBFIRST +#endif + + +#ifndef cyg_halint8 +# define cyg_halint8 char +#endif +#ifndef cyg_halint16 +# define cyg_halint16 short +#endif +#ifndef cyg_halint32 +# define cyg_halint32 int +#endif +#ifndef cyg_halint64 +# define cyg_halint64 long long +#endif + +#ifndef cyg_halcount8 +# define cyg_halcount8 int +#endif +#ifndef cyg_halcount16 +# define cyg_halcount16 int +#endif +#ifndef cyg_halcount32 +# define cyg_halcount32 int +#endif +#ifndef cyg_halcount64 +# define cyg_halcount64 long long +#endif + +#ifndef cyg_halbool +# ifdef __cplusplus +# define cyg_halbool bool +# else +# define cyg_halbool int +# endif +#endif + +#ifndef cyg_halatomic +# define cyg_halatomic cyg_halint8 +#endif + +// ------------------------------------------------------------------------- +// The obvious few that compilers may define for you. +// But in case they don't: + +#ifndef NULL +# define NULL 0 +#endif + +#ifndef __cplusplus + +typedef cyg_halbool bool; + +# ifndef false +# define false 0 +# endif + +# ifndef true +# define true (!false) +# endif + +#endif + +// ------------------------------------------------------------------------- +// Allow creation of procedure-like macros that are a single statement, +// and must be followed by a semi-colon + +#define CYG_MACRO_START do { +#define CYG_MACRO_END } while (0) + +#define CYG_EMPTY_STATEMENT CYG_MACRO_START CYG_MACRO_END + +#define CYG_UNUSED_PARAM( _type_, _name_ ) CYG_MACRO_START \ + _type_ tmp1 = _name_; \ + _name_ = tmp1; \ +CYG_MACRO_END + +// ------------------------------------------------------------------------- +// Define basic types for using integers in memory and structures; +// depends on compiler defaults and CPU type. + +typedef unsigned cyg_halint8 cyg_uint8 ; +typedef signed cyg_halint8 cyg_int8 ; + +typedef unsigned cyg_halint16 cyg_uint16 ; +typedef signed cyg_halint16 cyg_int16 ; + +typedef unsigned cyg_halint32 cyg_uint32 ; +typedef signed cyg_halint32 cyg_int32 ; + +typedef unsigned cyg_halint64 cyg_uint64 ; +typedef signed cyg_halint64 cyg_int64 ; + +typedef cyg_halbool cyg_bool ; + +// ------------------------------------------------------------------------- +// Define types for using integers in registers for looping and the like; +// depends on CPU type, choose what it is most comfortable with, with at +// least the range required. + +typedef unsigned cyg_halcount8 cyg_ucount8 ; +typedef signed cyg_halcount8 cyg_count8 ; + +typedef unsigned cyg_halcount16 cyg_ucount16 ; +typedef signed cyg_halcount16 cyg_count16 ; + +typedef unsigned cyg_halcount32 cyg_ucount32 ; +typedef signed cyg_halcount32 cyg_count32 ; + +typedef unsigned cyg_halcount64 cyg_ucount64 ; +typedef signed cyg_halcount64 cyg_count64 ; + +// ------------------------------------------------------------------------- +// Define a type to be used for atomic accesses. This type is guaranteed +// to be read or written in a single uninterruptible operation. This type +// is at least a single byte. + +typedef volatile unsigned cyg_halatomic cyg_atomic; +typedef volatile unsigned cyg_halatomic CYG_ATOMIC; + +// ------------------------------------------------------------------------- +// Define types for access plain, on-the-metal memory or devices. + +typedef cyg_uint32 CYG_WORD; +typedef cyg_uint8 CYG_BYTE; +typedef cyg_uint16 CYG_WORD16; +typedef cyg_uint32 CYG_WORD32; +typedef cyg_uint64 CYG_WORD64; +typedef cyg_uint32 CYG_ADDRESS; +typedef CYG_ADDRESS CYG_ADDRWORD; + +// ------------------------------------------------------------------------- +// Constructor ordering macros. These are added as annotations to all +// static objects to order the constuctors appropriately. + +#if defined(__cplusplus) && defined(CYG_KERNEL_USE_INIT_PRIORITY) + +#define CYG_INIT_PRIORITY( _pri_ ) \ + __attribute__((init_priority (CYG_INIT_##_pri_))) + +#else + +#define CYG_INIT_PRIORITY( _pri_ ) + +#endif + +#define CYG_INIT_BEFORE( _pri_ ) (CYG_INIT_##_pri_-100) +#define CYG_INIT_AFTER( _pri_ ) (CYG_INIT_##_pri_+100) + +#define CYG_INIT_HAL 10000 +#define CYG_INIT_SCHEDULER 11000 +#define CYG_INIT_INTERRUPTS 12000 +#define CYG_INIT_CLOCK 13000 +#define CYG_INIT_IDLE_THREAD 14000 +#define CYG_INIT_THREADS 15000 +#define CYG_INIT_KERNEL 40000 +#define CYG_INIT_LIBC 50000 +#define CYG_INIT_APPLICATION 65000 +#define CYG_INIT_DEFAULT 65535 + +// ------------------------------------------------------------------------- +// Define a compiler-specific rune for saying a function doesn't return + +#ifdef __GNUC__ +# define CYGBLD_NORET __attribute__((noreturn)) +#else +# define CYGBLD_NORET +#endif + +#ifdef __GNUC__ +# define CYGBLD_ATTRIB_WEAK __attribute__ ((weak)) +#else + // This intentionally gives an error only if we actually try to + // use it. #error would give an error if we simple can't. +# define CYGBLD_ATTRIB_WEAK !!!-- Attribute weak not defined --!!! +#endif + +// ------------------------------------------------------------------------- +// Label name macro. Some toolsets generate labels with initial +// underscores and others don't. This macro should be used on labels +// that are defined in assembly code or linker scripts so that we can +// do the right thing. + +#ifndef CYG_LABEL_NAME + +#define CYG_LABEL_NAME(_name_) _name_ + +#endif + +// ------------------------------------------------------------------------- +#endif // CYGONCE_INFRA_CYG_TYPE_H multiple inclusion protection +// EOF cyg_type.h diff --git a/packages/infra/current/include/diag.h b/packages/infra/current/include/diag.h new file mode 100644 --- /dev/null +++ b/packages/infra/current/include/diag.h @@ -0,0 +1,97 @@ +#ifndef CYGONCE_INFRA_DIAG_H +#define CYGONCE_INFRA_DIAG_H + +/*============================================================================= +// +// diag.h +// +// Diagnostic Routines for Infra Development +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: Diagnostic Routines for Infra Development +// Description: Diagnostic routines for use during infra development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//==========================================================================*/ + +#include + +#ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG +#include +#endif + +/*---------------------------------------------------------------------------*/ +/* Diagnostic routines */ + +externC void diag_init(void); /* Initialize, call before any others*/ + +externC void diag_write_char(char c); /* Write single char to output */ + +externC void diag_write_string(char *psz); /* Write zero terminated string */ + +externC void diag_write_dec( cyg_int32 n); /* Write decimal value */ + +externC void diag_write_hex( cyg_uint32 n); /* Write hexadecimal value */ + + +#ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG + +externC void diag_printf( char *fmt, ... ); /* Formatted print */ + +#else + +// This function deliberately has a K&R prototype to avoid having to use +// varargs, or pad arglists or anything grody like that. + +#warning CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG not enabled +#warning Expect a "function declaration isn't a prototype" warning + +externC void diag_printf(/* char *fmt, CYG_ADDRWORD, CYG_ADDRWORD, + CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD, + CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD */); + +#endif + +/*---------------------------------------------------------------------------*/ +/* Internal Diagnostic MACROS */ + +#ifdef CYGDBG_INFRA_DIAG_USE_DEVICE +#define DIAG_DEVICE_START_SYNC() diag_device_start_sync() +#define DIAG_DEVICE_END_SYNC() diag_device_end_sync() +#else +#define DIAG_DEVICE_START_SYNC() +#define DIAG_DEVICE_END_SYNC() +#endif + +/*---------------------------------------------------------------------------*/ +#endif /* CYGONCE_INFRA_DIAG_H */ +/* EOF diag.h */ diff --git a/packages/infra/current/include/pkgconf/infra.h b/packages/infra/current/include/pkgconf/infra.h new file mode 100644 --- /dev/null +++ b/packages/infra/current/include/pkgconf/infra.h @@ -0,0 +1,599 @@ +#ifndef CYGONCE_PKGCONF_INFRA_H +#define CYGONCE_PKGCONF_INFRA_H +//========================================================================= +// +// pkgconf/infra.h +// +// Infrastructure configuration file. +// +//========================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv,hmt +// Contributors: bartv,hmt +// Date: 1998-04-17 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +//========================================================================= + +/* The header pkgconf/system.h contains configuration options controlled by + * the pkgconf tool. These options cannot be edited by hand, they can only + * be changed by running pkgconf again. + */ +#include + +/* ==================================================================== + * Debug facilities. The eCos source code contains a significant amount + * of internal debugging support, in the form of assertions and + * tracing. Tracing takes the form of text messages that get output + * via the diagnostics channel to the host whenever an event occurs, + * or whenever a function is called or returns (the implementation + * may change in future releases of the system). It is possible to + * enable assertions and tracing independently. There are also + * options controlling the exact behaviour of the assertion and + * tracing facilities, thus giving users finer control over the + * code and data size requirements. + * + * Thought: Can we get a real 'mu' out of this in uITRON throughout? + * It's \265 in C strings, in iso_8859_1 + * It is mentioned in the startup enabling stuff. + * + */ + +/* {{CFG_DATA + cdl_package CYGPKG_INFRA { + display "Infrastructure" + type dummy + description "Common types and useful macros. + Tracing and assertion facilities. + Package startup options." + } + }}CFG_DATA */ + + +/* ======================================================================== + * The common types part of the system is not yet configurable. + */ +/* {{not-CFG_DATA + cdl_component CYGPKG_INFRA_TYPES { + display "Common Types" + type dummy + parent CYGPKG_INFRA + description "These types are used throughout the eCos source code. + Currently there are no configuration options associated + with the Common Types component; they are automatically + set up according to the selected HAL." + } + }}not-CFG_DATA */ + + +/* ================================================================= + * This option decides whether the diag_printf() function uses + * variadic argument support, or uses a K&R style declaration to + * support it. It is possible that variadic arguments do not work, + * or support for them is not available in a particular tool chain; + * hence the option for using an alternative implementation. + */ + +/* {{CFG_DATA + cdl_option CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG { + display "Use varargs in diag_printf()" + type boolean + parent CYGPKG_INFRA + description "The diagnostic routine diag_printf() can be defined + using either variadic arguments or a K&R style definition. + The former will work in most circumstances, but if variable + argument handling is broken or missing then the K&R variant + may be used. This will also generate warnings about the + declaration of diag_printf() not being a prototype. + These may safely be ignored." + } + }}CFG_DATA */ + +#define CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG + +/* ======================================================================== + * There is a global option that affects whether the user is building + * a release system or a debug system. It enables all the stuff below. + * + * This used to be CYG_RELEASE_DEBUG. + */ +/* {{CFG_DATA + cdl_component CYGPKG_INFRA_DEBUG { + display "Asserts & Tracing" + type boolean + parent CYGPKG_INFRA + description "The eCos source code contains a significant amount of + internal debugging support, in the form of assertions and + tracing. + Assertions check at runtime that various conditions are as + expected; if not, execution is halted. + Tracing takes the form of text messages that are output + whenever certain events occur, or whenever functions are + called or return. + The most important property of these checks and messages is + that they are not required for the program to run. + It is prudent to develop software with assertions enabled, + but disable them when making a product release, thus + removing the overhead of that checking. + It is possible to enable assertions and tracing + independently. + There are also options controlling the exact behaviour of + the assertion and tracing facilities, thus giving users + finer control over the code and data size requirements." + } + }}CFG_DATA */ +#undef CYGPKG_INFRA_DEBUG + + +/* + * If global debugging is enabled then by default all assertions + * are enabled. Tracing is not enabled by default because it + * involves excessive overheads, for example on some targets + * it requires sending a string down a serial line for every + * function call. Both assertions and tracing are controlled + * by the following lines. + */ +/* {{CFG_DATA + cdl_component CYGDBG_USE_ASSERTS { + display "Use asserts" + type boolean + parent CYGPKG_INFRA_DEBUG + description "If this option is defined, asserts in the code + are tested. + Assert functions (CYG_ASSERT()) are defined in + 'include/cyg/infra/cyg_ass.h' within the 'install' tree. + If it is not defined, these result in no additional + object code and no checking of the asserted conditions." + } + cdl_component CYGDBG_USE_TRACING { + display "Use tracing" + type boolean + parent CYGPKG_INFRA_DEBUG + description "If this option is defined, tracing operations + result in output or logging, depending on other options. + This may have adverse effects on performance, if the time + taken to output message overwhelms the available CPU + power or output bandwidth. + Trace functions (CYG_TRACE())are defined in + 'include/cyg/infra/cyg_trac.h' within the 'install' tree. + If it is not defined, these result in no additional + object code and no trace information." + } + }}CFG_DATA */ +#ifdef CYGPKG_INFRA_DEBUG +# define CYGDBG_USE_ASSERTS +# undef CYGDBG_USE_TRACING +#endif + +/* + * The eCos system uses a number of more specialised assertions in + * addition to a conventional ASSERT() macro. By default these are all + * enabled when general assertions are enabled, but it is possible to + * suppress some of them and thus reduce the size of the generated code. + * + * Preconditions check that a condition holds true at the beginning of + * a piece of code, typically at the start of a function. For example a + * kernel function might have a precondition that it is only invoked + * when the scheduler is locked. + * + * Postconditions check that a condition holds at the end of a piece of + * code, typically at the point where a function returns. For example + * at the end of scheduler initialisation there could be a + * postcondition that there is at least one runnable thread, the idle + * thread. + * + * Loop invariants check that a condition holds on every iteration of + * a loop. For example the deferred service support code in the kernel + * could have a loop invariant that interrupts are enabled whenever + * there are still DSR's pending. + */ +/* {{CFG_DATA + cdl_option CYGDBG_INFRA_DEBUG_PRECONDITIONS { + display "Preconditions" + type boolean + parent CYGDBG_USE_ASSERTS + description "This option allows individual control of preconditions. + A precondition is one type of assert, which it is + useful to control separately from more general asserts. + The function is CYG_PRECONDITION(condition,msg)." + } + cdl_option CYGDBG_INFRA_DEBUG_POSTCONDITIONS { + display "Postconditions" + type boolean + parent CYGDBG_USE_ASSERTS + description "This option allows individual control of postconditions. + A postcondition is one type of assert, which it is + useful to control separately from more general asserts. + The function is CYG_POSTCONDITION(condition,msg)." + } + cdl_option CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS { + display "Loop invariants" + type boolean + parent CYGDBG_USE_ASSERTS + description "This option allows individual control of loop invariants. + A loop invariant is one type of assert, which it is + useful to control separately from more general asserts, + particularly since a loop invariant is typically evaluated + a great many times when used correctly. + The function is CYG_LOOP_INVARIANT(condition,msg)." + } + }}CFG_DATA */ +#ifdef CYGDBG_USE_ASSERTS +# define CYGDBG_INFRA_DEBUG_PRECONDITIONS +# define CYGDBG_INFRA_DEBUG_POSTCONDITIONS +# define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS +#endif + +/* + * The eCos system uses two types of tracing mechanisms. The most common + * type traces events, for example an event could be logged whenever + * an interrupt occurs or whenever a context switch takes place. The + * second type of tracing mechanism records every function entry and + * exit. It is possible to disable this second type of tracing while + * leaving the main tracing facility enabled. + */ +/* {{CFG_DATA + cdl_option CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS { + display "Trace function reports" + type boolean + parent CYGDBG_USE_TRACING + description "This option allows individual control of + function entry/exit tracing, independent of + more general tracing output. + This may be useful to remove clutter from a + trace log." + } + }}CFG_DATA */ +#ifdef CYGDBG_USE_TRACING +# define CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS +#endif + +/* + * There are currently three tracing and assert destinations. The NULL + * destination simply throws all tracing messages away. The SIMPLE + * destination uses the kernel diagnostic output routines to print test + * messages on the diagnostic device. The FANCY destination does a more + * elaborate job of it. Define exactly one of these. + */ +/* {{CFG_DATA + cdl_option CYGDBG_INFRA_DEBUG_TRACE_ASSERT_NULL { + display "Null output" + type radio + parent CYGPKG_INFRA_DEBUG + description "A null output module which is useful when + debugging interactively; the output routines + can be breakpointed rather than have them actually + 'print' something." + } + cdl_option CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE { + display "Simple output" + type radio + parent CYGPKG_INFRA_DEBUG + description "An output module which produces simple output + from tracing and assertion events." + } + cdl_option CYGDBG_INFRA_DEBUG_TRACE_ASSERT_FANCY { + display "Fancy output" + type radio + parent CYGPKG_INFRA_DEBUG + description "An output module which produces fancy output + from tracing and assertion events." + } + cdl_component CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER { + display "Buffered tracing" + type radio + parent CYGPKG_INFRA_DEBUG + description "An output module which buffers output + from tracing and assertion events. The stored + messages are output when an assert fires, or + cyg_trace_output() is called. + Of course, there will only be stored messages + if tracing per se (CYGDBG_USE_TRACING) + is enabled above." + } + cdl_option CYGDBG_INFRA_DEBUG_TRACE_BUFFER_SIZE { + display "Trace buffer size" + type count + legal_values 5 to 65535 + parent CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER + description "The size of the trace buffer. This counts the number + of trace records stored. When the buffer fills it + either wraps, stops recording, or generates output." + } + cdl_option CYGDBG_INFRA_DEBUG_TRACE_BUFFER_WRAP { + display "Wrap trace buffer when full" + type radio + parent CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER + description "When the trace buffer has filled with records it + starts again at the beginning. Hence only the last + CYGDBG_INFRA_DEBUG_TRACE_BUFFER_SIZE messages will + be recorded." + } + cdl_option CYGDBG_INFRA_DEBUG_TRACE_BUFFER_HALT { + display "Halt trace buffer when full" + type radio + parent CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER + description "When the trace buffer has filled with records it + stops recording. Hence only the first + CYGDBG_INFRA_DEBUG_TRACE_BUFFER_SIZE messages will + be recorded." + } + cdl_option CYGDBG_INFRA_DEBUG_TRACE_BUFFER_PRINT { + display "Print trace buffer when full" + type radio + parent CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER + description "When the trace buffer has filled with records it + prints the contents of the buffer. The buffer is then + emptied and the system continues." + } + cdl_option CYGDBG_INFRA_DEBUG_TRACE_BUFFER_PRINT_ON_ASSERT { + display "Print trace buffer on assert fail" + type bool + parent CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER + description "When an assertion fails the trace buffer will be printed to + the default diagnostic device." + } + }}CFG_DATA */ +# if defined( CYGDBG_USE_TRACING ) || defined( CYGDBG_USE_ASSERTS ) +# undef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_NULL +# undef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE +# undef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_FANCY +# define CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER +# endif + +# if defined(CYGDBG_USE_TRACING) +# if defined(CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER) +# define CYGDBG_INFRA_DEBUG_TRACE_BUFFER_SIZE 32 +# define CYGDBG_INFRA_DEBUG_TRACE_BUFFER_WRAP +# undef CYGDBG_INFRA_DEBUG_TRACE_BUFFER_HALT +# undef CYGDBG_INFRA_DEBUG_TRACE_BUFFER_PRINT +# define CYGDBG_INFRA_DEBUG_TRACE_BUFFER_PRINT_ON_ASSERT +# endif +# endif + + +/* + * All assertions within eCos contain a text message which should give + * some information about the condition being tested. These text messages + * will end up being embedded in the final application image and hence + * there is a significant penalty in terms of code size. It is possible + * to suppress the use of these messages by disabling + * CYGDBG_INFRA_DEBUG_ASSERT_MESSAGE. + * This results in smaller code size, but there is less information if + * an assertion actually gets triggered. + * + * Similarly eCos trace macros also make use of a text message, and + * this message can be suppressed by disabling + * CYGDBG_INFRA_DEBUG_TRACE_MESSAGE. + */ + +/* {{CFG_DATA + cdl_option CYGDBG_INFRA_DEBUG_ASSERT_MESSAGE { + display "Use assert text" + type boolean + parent CYGDBG_USE_ASSERTS + description "All assertions within eCos contain a text message + which should give some information about the condition + being tested. + These text messages will end up being embedded in the + application image and hence there is a significant penalty + in terms of image size. + It is possible to suppress the use of these messages by + disabling this option. + This results in smaller code size, but there is less + human-readable information if an assertion actually gets + triggered." + } + cdl_option CYGDBG_INFRA_DEBUG_TRACE_MESSAGE { + display "Use trace text" + type boolean + parent CYGDBG_USE_TRACING + description "All trace calls within eCos contain a text message + which should give some information about the circumstances. + These text messages will end up being embedded in the + application image and hence there is a significant penalty + in terms of image size. + It is possible to suppress the use of these messages by + disabling this option. + This results in smaller code size, but there is less + human-readable information available in the trace output, + possibly only filenames and line numbers." + } + }}CFG_DATA */ +#define CYGDBG_INFRA_DEBUG_ASSERT_MESSAGE +#define CYGDBG_INFRA_DEBUG_TRACE_MESSAGE + +/* ======================================================================== + * By default all assertion and trace macros will make use of the name + * of the current function, via gcc's __PRETTY_FUNCTION__ extension. + * This provides useful extra information, but again there is some + * code size overhead. It is possible to suppress the use of function + * names, and have the assertions and trace facilities only use the + * filename and linenumber information provided by __FILE__ and __LINE__. + */ +/* {{CFG_DATA + cdl_option CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO { + display "Use function names" + type boolean + parent CYGPKG_INFRA_DEBUG + description "All trace and assert calls within eCos contain a + reference to the builtin macro '__PRETTY_FUNCTION__', + which evaluates to a string containing + the name of the current function. + This is useful when reading a trace log. + It is possible to suppress the use of the function name + by disabling this option. + This results in smaller code size, but there is less + human-readable information available in the trace output, + possibly only filenames and line numbers." + } + }}CFG_DATA */ +#define CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO + +/* ================================================================= + * The following options allow particular compatibility modes to be + * enabled, when they require specialised support from the startup + * process. These can affect the environment in which the program + * runs. + * + * CYGSEM_START_ISO_C_COMPATIBILITY enables compatibility with ISO C, + * in particular in eCos it creates a thread that invokes the function + * main() which the user must supply. It does this by invoking the function + * cyg_iso_c_start(). For more information, refer to the C library + * documentation. + * + * CYGSEM_START_UITRON_COMPATIBILITY enables compatibility with uItron. + * You must configure uItron with the correct tasks, and then enabling this + * option starts the uItron subsystem. It does this by invoking the function + * cyg_uitron_start(). + * + * Both these can also be done by the user overriding cyg_user_start(), + * cyg_package_start(), or cyg_prestart(). Refer to the documentation on + * how and when to do this. + */ + +/* {{CFG_DATA + cdl_component CYGPKG_INFRA_STARTUP { + display "Startup options" + type dummy + parent CYGPKG_INFRA + description "Some packages require a startup routine to be called. + This can be carried out by application code, by supplying + a routine called cyg_package_start() which calls the + appropriate package startup routine(s). + Alternatively, this routine can be constructed automatically + and configured to call the startup routines of your choice." + doc ref/ecos-ref/c-library-startup.html + } + cdl_option CYGSEM_START_ISO_C_COMPATIBILITY { + display "Start ISO C library" + type boolean + parent CYGPKG_INFRA_STARTUP + requires CYGPKG_LIBC + description "Generate a call to initialize the ISO C library + (libc) within the system version of cyg_package_start(). + This enables compatibility with ISO C, in particular in + eCos it creates a thread that invokes the function main() + which the user must supply. + It does this by invoking the function cyg_iso_c_start(). + If this is disabled, and you want to use the C library, you + call cyg_iso_c_start() from your own cyg_package_start() + or cyg_userstart()." + } + cdl_option CYGSEM_START_UITRON_COMPATIBILITY { + display "Start uITRON subsystem" + type boolean + parent CYGPKG_INFRA_STARTUP + requires CYGPKG_UITRON + description "Generate a call to initialize the + uITRON compatibility subsystem + within the system version of cyg_package_start(). + This enables compatibility with uITRON. + You must configure uITRON with the correct tasks before + starting the uItron subsystem. + If this is disabled, and you want to use uITRON, + you must call cyg_uitron_start() from your own + cyg_package_start() or cyg_userstart()." + } + }}CFG_DATA */ +#ifdef CYGPKG_LIBC +#define CYGSEM_START_ISO_C_COMPATIBILITY +#endif + +#ifdef CYGPKG_UITRON +#undef CYGSEM_START_UITRON_COMPATIBILITY +#endif + +/* ======================================================================== + * memcpy()/memset() configuration + * + * The infra package contains implementations of memcpy() and memset() + * because gcc generates code that uses these when initialising + * structures, if it has been configured with its own builtin versions + * disabled (-fno-builtin). + * + */ + +/* + {{CFG_DATA + + cdl_option CYGIMP_INFRA_PREFER_SMALL_TO_FAST_MEMCPY { + display "Smaller slower memcpy()" + description "Enabling this option causes the implementation of + the standard memcpy() routine to reduce code + size at the expense of execution speed. This + option is automatically enabled with the use of + the -Os option to the compiler. Also note that + the compiler will try to use its own builtin + version of memcpy() if possible, ignoring the + implementation in this package, unless given + the -fno-builtin compiler option." + type boolean + parent CYGPKG_INFRA + } + + cdl_option CYGIMP_INFRA_PREFER_SMALL_TO_FAST_MEMSET { + display "Smaller slower memset()" + description "Enabling this option causes the implementation of + the standard memset() routine to reduce code + size at the expense of execution speed. This + option is automatically enabled with the use of + the -Os option to the compiler. Also note that + the compiler will try to use its own builtin + version of memset() if possible, ignoring the + implementation in this package, unless given + the -fno-builtin compiler option." + type boolean + parent CYGPKG_INFRA + } + + }}CFG_DATA +*/ + +#undef CYGIMP_INFRA_PREFER_SMALL_TO_FAST_MEMCPY +#undef CYGIMP_INFRA_PREFER_SMALL_TO_FAST_MEMSET + +/* ======================================================================== + * Debugging-related miscellania. + * + * NOTE: this is not yet fully supported, by CDL nor by having a proper + * symbol name. + * + * Define how diag data is directed off of the board. If using an actual + * device then a device must be configured to support diag. + */ + +#undef CYGDBG_INFRA_DIAG_USE_DEVICE + +/* ======================================================================== + * That's all. + */ + +#endif /* CYGONCE_PKGCONF_INFRA_H */ +/* EOF infra.h */ diff --git a/packages/infra/current/include/testcase.h b/packages/infra/current/include/testcase.h new file mode 100644 --- /dev/null +++ b/packages/infra/current/include/testcase.h @@ -0,0 +1,145 @@ +#ifndef CYGONCE_INFRA_TESTCASE_H +#define CYGONCE_INFRA_TESTCASE_H +//========================================================================== +// +// testcase.h +// +// Target side interface for tests +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy +// Contributors: ctarpy +// Date: 1998/16/3 +// +// +//####DESCRIPTIONEND#### + +#include // Common type definitions and support + + +// The values of status have the following meaning: +// 0 fail +// 1 pass +// 2 exit +// 3 info +externC void +cyg_test_output(int status, char* msg, int line_number, char* file); + +// This should be called at the start of each test file +externC void +cyg_test_init(void); + +// This causes the test to exit +externC void +cyg_test_exit(void) __attribute__ ((__noreturn__)); + + +// ----------- Info ----------- +// +// Any macro with EXIT in it should only be used in a panic situation. It +// is synonymous with assert. If the test behaves as expected, it +// should call one of the FINISH macros. +// +// - Compound testcases +// If a testcase is capable of being part of a compound, then the following +// rules apply: +// - The testcase must only ever call one of the EXIT macros if it decides +// the state of the system is such that further testing is meaningless; +// such a call would prevent subsequent tests in the compound from being +// run. +// - In order to terminate the test, the testcase should call one of the +// FINISH macros. This must be done from within main(). + + + + +// The following is the testcase API to be used by testcases. + +#define CYG_TEST_INIT() cyg_test_init() + +#define CYG_TEST_INFO( _msg_ ) \ + cyg_test_output(3, _msg_, __LINE__, __FILE__) + +#define CYG_TEST_PASS( _msg_ ) \ + cyg_test_output(1, _msg_, __LINE__, __FILE__) + +#define CYG_TEST_FAIL( _msg_ ) \ + cyg_test_output(0, _msg_, __LINE__, __FILE__) + +#define CYG_TEST_EXIT( _msg_ ) \ + (cyg_test_output(2, _msg_, __LINE__, __FILE__), \ + cyg_test_exit()) + +#ifdef CYG_COMPOUND_TEST +# define CYG_TEST_FINISH( _msg_ ) \ + (cyg_test_output(2, _msg_, __LINE__, __FILE__), \ + return 0; +#else +# define CYG_TEST_FINISH( _msg_ ) \ + (cyg_test_output(2, _msg_, __LINE__, __FILE__), \ + cyg_test_exit()) +#endif + +#define CYG_TEST_STILL_ALIVE( _ctr_ , _msg_ ) CYG_TEST_INFO( _msg_ ) + + + + +// ----- The following are convenience functions + +#define CYG_TEST_PASS_FINISH( _msg_ ) \ + (cyg_test_output(1, _msg_, __LINE__, __FILE__), \ + CYG_TEST_FINISH("done")) + +#define CYG_TEST_FAIL_FINISH( _msg_ ) \ + (cyg_test_output(0, _msg_, __LINE__, __FILE__), \ + CYG_TEST_FINISH("done")) + + +#define CYG_TEST_CHECK( _chk_ , _msg_) \ + (void)(( _chk_ ) || ( cyg_test_output(0, _msg_, __LINE__, __FILE__), \ + cyg_test_exit(), 1) ) + +#define CYG_TEST_PASS_FAIL( _cdn_, _msg_ ) \ +if ( _cdn_ ) CYG_TEST_PASS( _msg_ ); else CYG_TEST_FAIL( _msg_ ) + + +// CYG_TEST_PASS_EXIT and CYG_TEST_FAIL_EXIT are now obscelete, +// but are here for now +// to avoid breaking testcases which still use them. They will +// soon go away. +#define CYG_TEST_PASS_EXIT( _msg_ ) \ + (cyg_test_output(1, _msg_, __LINE__, __FILE__), \ + CYG_TEST_EXIT("done")) + +#define CYG_TEST_FAIL_EXIT( _msg_ ) \ + (cyg_test_output(0, _msg_, __LINE__, __FILE__), \ + CYG_TEST_EXIT("done")) + + +#endif // CYGONCE_INFRA_TESTCASE_H +// EOF testcase.h diff --git a/packages/infra/current/src/PKGconf.mak b/packages/infra/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/PKGconf.mak @@ -0,0 +1,46 @@ +#============================================================================ +# +# makefile +# +# infra/src +# +#============================================================================ +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================ + +PACKAGE := infra +include ../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := startup.cxx dummyxxmain.cxx \ + null.cxx simple.cxx fancy.cxx buffer.cxx \ + diag.c tcdiag.cxx \ + memcpy.c memset.c \ + delete.cxx + + +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src diff --git a/packages/infra/current/src/buffer.cxx b/packages/infra/current/src/buffer.cxx new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/buffer.cxx @@ -0,0 +1,768 @@ +//========================================================================== +// +// buffer.cxx +// +// Memory buffered trace and assert functions +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-10-16 +// Purpose: Buffered Trace and assert functions +// Description: The functions in this file are a buffered implementation +// of the standard trace and assert functions. These store +// trace messages in a memory buffer and emit them when an +// assert is hit, or when requested to. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include + +#ifdef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER + +#include // base types +#include // tracing macros +#include // assertion macros + +#include // HAL configury +#include // HAL polled output +#include // architectural stuff for... +#include // interrupt control + +#ifdef CYGPKG_KERNEL +#include // kernel configury +#include // thread id to print +#include // ancillaries for above +#include // ancillaries for above +#endif + +// ------------------------------------------------------------------------- +// Local Configuration: hack me! + +// these are generally: +// if 0, feature is disabled +// if 1, feature is enabled, printing is default width +// if >1, field is padded up to that width if necessary +// (not truncated ever) + +#define CYG_FILENAME 20 +#define CYG_THREADID 1 +#define CYG_LINENUM 4 +#define CYG_FUNCNAME 100 +#define CYG_DIAG_PRINTF 1 +#define CYG_FUNC_INDENT 2 + +#ifndef CYGPKG_KERNEL +# undef CYG_THREADID +# define CYG_THREADID 0 +#endif + +#if CYG_FUNCNAME == 1 +#define CYG_FBUF_SIZE 100 +#else +#define CYG_FBUF_SIZE (CYG_FUNCNAME+20) +#endif + +// ------------------------------------------------------------------------- +// Trace buffer + +#ifdef CYGDBG_USE_TRACING + +struct Cyg_TraceRecord +{ + cyg_uint32 what; + cyg_uint32 tid; + char *function; + char *file; + char *message; + cyg_uint32 line; + cyg_uint32 narg; + CYG_ADDRWORD arg[8]; +}; + +Cyg_TraceRecord cyg_infra_trace_buffer[CYGDBG_INFRA_DEBUG_TRACE_BUFFER_SIZE]; + +static cyg_uint32 cyg_infra_trace_buffer_pos = 0; + +static cyg_bool cyg_infra_trace_buffer_enable = true; + +static cyg_bool cyg_infra_trace_buffer_wrap = false; + +// ------------------------------------------------------------------------- +// Functions to trim file names and function names down to printable lengths +// (these are shared between trace and assert functions) + +#if 0 +static char * tracepremsgs[] = { + " INFO:", + "ENTER :", + "ARGS :", + "RETURN:", + "bad code" +}; +#endif + +static char * tracepremsgs[] = { + "'", + "{{", + "((", + "}}", + "bad code" +}; + +static char * tracepostmsgs[] = { + "'", + "", + "))", + "", + "bad code" +}; + +static void +write_whattrace( cyg_uint32 what ) +{ +#if CYG_FUNC_INDENT + static cyg_int32 cyg_indent = 0; + if ( 3 == what ) + cyg_indent -= CYG_FUNC_INDENT; + cyg_int32 i = cyg_indent; + for ( ; i > 0; i-- ) + diag_write_string( " " ); +#endif // CYG_FUNC_INDENT + diag_write_string( tracepremsgs[ what > 4 ? 4 : what ] ); +#if CYG_FUNC_INDENT + if ( 1 == what ) + cyg_indent += CYG_FUNC_INDENT; +#endif // CYG_FUNC_INDENT +} + +static void +write_whattracepost( cyg_uint32 what ) +{ + diag_write_string( tracepostmsgs[ what > 4 ? 4 : what ] ); +} + + +#endif // CYGDBG_USE_TRACING + +// ------------------------------------------------------------------------- + +static char *trim_file(char *file) +{ +#if CYG_FILENAME + if ( NULL == file ) + file = ""; + +#if 1 == CYG_FILENAME + char *f = file; + while( *f ) f++; + while( *f != '/' && f != file ) f--; + return f==file?f:(f+1); +#else + static char fbuf2[100]; + char *f = file, *g = fbuf2; + while( *f ) f++; + while( *f != '/' && f != file ) f--; + if ( f > file ) f++; + while( *f ) *g++ = *f++; + while( CYG_FILENAME > (g - fbuf2) ) *g++ = ' '; + *g = 0; + return fbuf2; +#endif +#else + return ""; +#endif +} + +static char *trim_func(char *func) +{ +#if CYG_FUNCNAME + static char fbuf[CYG_FBUF_SIZE]; + cyg_count32 i; + + if ( NULL == func ) + func = ""; + + for( i = 0; func[i] && func[i] != '(' && i < CYG_FBUF_SIZE-4 ; i++ ) + fbuf[i] = func[i]; + + fbuf[i++] = '('; + fbuf[i++] = ')'; + fbuf[i ] = 0; + while( i > 0 && fbuf[i] != ' ' ) i--; + if( i > 0 ) i++; +#if 1 == CYG_FUNCNAME + return &fbuf[i]; +#else + char *p = &fbuf[i]; + while ( *p ) p++; + while ( CYG_FUNCNAME > (p - (&fbuf[i])) ) *p++ = ' '; + *p = 0; + return &fbuf[i]; +#endif +#else + return ""; +#endif +} + +static void write_lnum( cyg_uint32 lnum) +{ +#if CYG_LINENUM + diag_write_char('['); +#if 1 < CYG_LINENUM + cyg_uint32 i, j; + for ( i = 2, j = 100; i < CYG_LINENUM ; i++, j *= 10 ) + if ( lnum < j ) + diag_write_char(' '); +#endif + diag_write_dec(lnum); + diag_write_char(']'); + diag_write_char(' '); +#endif +} + +// ------------------------------------------------------------------------- + +#if CYG_THREADID +static cyg_uint32 get_tid(void) +{ + + Cyg_Thread *t = Cyg_Thread::self(); + cyg_uint16 tid = 0xFFFF; + + if( t != NULL ) tid = t->get_unique_id(); + + return tid; +} +#else +# define get_tid() (0xFFFF) +#endif + +static void write_thread_id() +{ +#if CYG_THREADID + cyg_uint16 tid = get_tid(); + + diag_write_char('<'); + diag_write_hex(tid); + diag_write_char('>'); +#endif +} + +// ------------------------------------------------------------------------- +// Trace functions: + +#ifdef CYGDBG_USE_TRACING + +static void print_trace_buffer(void) +{ + cyg_count32 start = cyg_infra_trace_buffer_pos; + cyg_count32 end = start; + cyg_count32 i; + + // If the buffer has wrapped we want to display the records from + // the current pos and around back to the same place. If the buffer + // has not wrapped, we want to display from the start to pos. + + if( !cyg_infra_trace_buffer_wrap ) + start = 0; + + i = start; + do + { + Cyg_TraceRecord *rec = &cyg_infra_trace_buffer[i]; + cyg_uint32 old_ints; + + char *psz_msg = rec->message; + + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string( "TRACE: " ); +#if CYG_THREADID + diag_write_char('<'); + diag_write_hex(rec->tid); + diag_write_char('>'); +#endif + diag_write_string(trim_file(rec->file)); + write_lnum(rec->line); + diag_write_string(trim_func(rec->function)); + diag_write_char(' '); + write_whattrace( rec->what ); +#if CYG_DIAG_PRINTF + diag_printf( psz_msg, + rec->arg[0], rec->arg[1], + rec->arg[2], rec->arg[3], + rec->arg[4], rec->arg[5], + rec->arg[6], rec->arg[7] ); +#else + diag_write_string(psz_msg); + diag_write_char(' '); + + for( cyg_count8 j = 0; j < rec->narg ; j++ ) + { + diag_write_hex(rec->arg[j]); + diag_write_char(' '); + } +#endif + write_whattracepost( rec->what ); + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); + + i++; + if( i == CYGDBG_INFRA_DEBUG_TRACE_BUFFER_SIZE ) + i = 0; + + } while( i != end ); + +} + +static void increment_buffer_pos() +{ + cyg_infra_trace_buffer_pos++; + + if( cyg_infra_trace_buffer_pos == CYGDBG_INFRA_DEBUG_TRACE_BUFFER_SIZE ) + { +#if defined(CYGDBG_INFRA_DEBUG_TRACE_BUFFER_WRAP) + cyg_infra_trace_buffer_pos = 0; + cyg_infra_trace_buffer_wrap = true; +#elif defined(CYGDBG_INFRA_DEBUG_TRACE_BUFFER_HALT) + cyg_infra_trace_buffer_enable = false; +#elif defined(CYGDBG_INFRA_DEBUG_TRACE_BUFFER_PRINT) + print_trace_buffer(); + cyg_infra_trace_buffer_pos = 0; + cyg_infra_trace_buffer_wrap = false; +#else +#error No trace buffer full mode set +#endif + } + +} + +// ------------------------------------------------------------------------- + +externC void +cyg_tracenomsg( char *psz_func, char *psz_file, cyg_uint32 linenum ) +{ + cyg_uint32 old_ints; + + if( !cyg_infra_trace_buffer_enable ) return; + + HAL_DISABLE_INTERRUPTS(old_ints); + + Cyg_TraceRecord *rec = &cyg_infra_trace_buffer[cyg_infra_trace_buffer_pos]; + + rec->what = 0; + rec->tid = get_tid(); + rec->function = psz_func; + rec->file = psz_file; + rec->line = linenum; + rec->message = 0; + rec->narg = 0; + + increment_buffer_pos(); + + HAL_RESTORE_INTERRUPTS(old_ints); + +}; + +// provide every other one of these as a space/caller bloat compromise. + +externC void +cyg_tracemsg( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ) +{ + cyg_uint32 old_ints; + + if( !cyg_infra_trace_buffer_enable ) return; + + HAL_DISABLE_INTERRUPTS(old_ints); + + Cyg_TraceRecord *rec = &cyg_infra_trace_buffer[cyg_infra_trace_buffer_pos]; + + rec->what = what; + rec->tid = get_tid(); + rec->function = psz_func; + rec->file = psz_file; + rec->line = linenum; + rec->message = psz_msg; + rec->narg = 0; + + increment_buffer_pos(); + + HAL_RESTORE_INTERRUPTS(old_ints); + +}; + +externC void +cyg_tracemsg2( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ) +{ + cyg_uint32 old_ints; + + if( !cyg_infra_trace_buffer_enable ) return; + + HAL_DISABLE_INTERRUPTS(old_ints); + + Cyg_TraceRecord *rec = &cyg_infra_trace_buffer[cyg_infra_trace_buffer_pos]; + + rec->what = what; + rec->tid = get_tid(); + rec->function = psz_func; + rec->file = psz_file; + rec->line = linenum; + rec->message = psz_msg; + rec->narg = 2; + + rec->arg[0] = arg0; + rec->arg[1] = arg1; + + increment_buffer_pos(); + + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +externC void +cyg_tracemsg4( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3 ) +{ + cyg_uint32 old_ints; + + if( !cyg_infra_trace_buffer_enable ) return; + + HAL_DISABLE_INTERRUPTS(old_ints); + + Cyg_TraceRecord *rec = &cyg_infra_trace_buffer[cyg_infra_trace_buffer_pos]; + + rec->what = what; + rec->tid = get_tid(); + rec->function = psz_func; + rec->file = psz_file; + rec->line = linenum; + rec->message = psz_msg; + rec->narg = 4; + + rec->arg[0] = arg0; + rec->arg[1] = arg1; + rec->arg[2] = arg2; + rec->arg[3] = arg3; + + increment_buffer_pos(); + + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +externC void +cyg_tracemsg6( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5 ) +{ + cyg_uint32 old_ints; + + if( !cyg_infra_trace_buffer_enable ) return; + + HAL_DISABLE_INTERRUPTS(old_ints); + + Cyg_TraceRecord *rec = &cyg_infra_trace_buffer[cyg_infra_trace_buffer_pos]; + + rec->what = what; + rec->tid = get_tid(); + rec->function = psz_func; + rec->file = psz_file; + rec->line = linenum; + rec->message = psz_msg; + rec->narg = 6; + + rec->arg[0] = arg0; + rec->arg[1] = arg1; + rec->arg[2] = arg2; + rec->arg[3] = arg3; + rec->arg[4] = arg4; + rec->arg[5] = arg5; + + increment_buffer_pos(); + + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +externC void +cyg_tracemsg8( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5, + CYG_ADDRWORD arg6, CYG_ADDRWORD arg7 ) +{ + cyg_uint32 old_ints; + + if( !cyg_infra_trace_buffer_enable ) return; + + HAL_DISABLE_INTERRUPTS(old_ints); + + Cyg_TraceRecord *rec = &cyg_infra_trace_buffer[cyg_infra_trace_buffer_pos]; + + rec->what = what; + rec->tid = get_tid(); + rec->function = psz_func; + rec->file = psz_file; + rec->line = linenum; + rec->message = psz_msg; + rec->narg = 6; + + rec->arg[0] = arg0; + rec->arg[1] = arg1; + rec->arg[2] = arg2; + rec->arg[3] = arg3; + rec->arg[4] = arg4; + rec->arg[5] = arg5; + rec->arg[6] = arg6; + rec->arg[7] = arg7; + + increment_buffer_pos(); + + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +// ------------------------------------------------------------------------- + +externC void +cyg_trace_print(void) +{ + cyg_bool old_enable = cyg_infra_trace_buffer_enable; + cyg_infra_trace_buffer_enable = false; + print_trace_buffer(); + cyg_infra_trace_buffer_pos = 0; + cyg_infra_trace_buffer_wrap = false; + cyg_infra_trace_buffer_enable = old_enable; +} + + +// ------------------------------------------------------------------------- + +externC void +cyg_trace_dump(void) +{ +#if defined(CYGPKG_KERNEL) && defined(CYG_DIAG_PRINTF) + + { + diag_printf("\nScheduler:\n\n"); + + Cyg_Scheduler *sched = &Cyg_Scheduler::scheduler; + + diag_printf("Lock: %d\n",sched->get_sched_lock() ); + +# ifdef CYGVAR_KERNEL_THREADS_NAME + + diag_printf("Current Thread: %s\n",sched->get_current_thread()->get_name()); + +# else + + diag_printf("Current Thread: %d\n",sched->get_current_thread()->get_unique_id()); + +# endif + + } + +# ifdef CYGVAR_KERNEL_THREADS_LIST + + { + Cyg_Thread *t = Cyg_Thread::get_list_head(); + + diag_printf("\nThreads:\n\n"); + + while( NULL != t ) + { + cyg_uint32 state = t->get_state(); + char tstate[7]; + char *tstate1 = "SCUKX"; + static char *(reasons[8]) = + { + "NONE", // No recorded reason + "WAIT", // Wait with no timeout + "DELAY", // Simple time delay + "TIMEOUT", // Wait with timeout/timeout expired + "BREAK", // forced break out of sleep + "DESTRUCT", // wait object destroyed[note] + "EXIT", // forced termination + "DONE" // Wait/delay complete + }; + + if( 0 != state ) + { + // Knock out chars that do not correspond to set bits. + for( int i = 0; i < 6 ; i++ ) + if( 0 == (state & (1<get_name(), + t->get_priority(), + tstate, + t->get_unique_id() + ); +# else + + diag_printf( "Thread %3d pri = %3d state = %6s\n", + t->get_unique_id(), + t->get_priority(), + tstate + ); + +# endif + diag_printf( "%20s stack base = %08x ptr = %08x size = %08x\n", + "", + t->get_stack_base(), +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + t->get_saved_context(), +#else + 0, +#endif + t->get_stack_size() + ); + + diag_printf( "%20s sleep reason %8s wake reason %8s\n", + "", + reasons[t->get_sleep_reason()], + reasons[t->get_wake_reason()] + ); + + diag_printf( "%20s queue = %08x wait info = %08x\n", + "", + t->get_current_queue(), + t->get_wait_info() + ); + + diag_printf("\n"); + t = t->get_list_next(); + } + + } +# endif // CYGVAR_KERNEL_THREADS_LIST + +#endif // CYG_DIAG_PRINTF +} + +#endif // CYGDBG_USE_TRACING + +// ------------------------------------------------------------------------- +// Assert functions: + +#ifdef CYGDBG_USE_ASSERTS + +externC void +cyg_assert_fail( char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + diag_write_string("ASSERT FAIL: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); + diag_write_string(psz_msg); + diag_write_char('\n'); + +#ifdef CYGDBG_INFRA_DEBUG_TRACE_BUFFER_PRINT_ON_ASSERT + + cyg_trace_print(); + cyg_trace_dump(); + +#endif + + for(;;); + +// DIAG_DEVICE_END_SYNC(); +// HAL_RESTORE_INTERRUPTS(old_ints); +}; + +extern "C" +{ +extern unsigned long CYG_LABEL_NAME(stext); +extern unsigned long CYG_LABEL_NAME(etext); + +unsigned long stext_addr = (unsigned long)&CYG_LABEL_NAME(stext); +unsigned long etext_addr = (unsigned long)&CYG_LABEL_NAME(etext); +}; + +externC cyg_bool cyg_check_data_ptr(void *ptr) +{ + unsigned long p = (unsigned long)ptr; + + if( p == 0 ) return false; + + if( p > stext_addr && p < etext_addr ) return false; + + return true; +} + +externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)) +{ + unsigned long p = (unsigned long)ptr; + + if( p == 0 ) return false; + + if( p < stext_addr && p > etext_addr ) return false; + + return true; +} + +#endif // CYGDBG_USE_ASSERTS + +#endif // CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER + +// ------------------------------------------------------------------------- +// EOF buffer.cxx diff --git a/packages/infra/current/src/delete.cxx b/packages/infra/current/src/delete.cxx new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/delete.cxx @@ -0,0 +1,110 @@ +//========================================================================== +// +// common/delete.cxx +// +// Default delete implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1999-08-13 +// Purpose: Gives a default delete operation if the C library isn't present +// Description: This file supplies a definition of the default delete +// operation (aka __builtin_delete and __builtin_vec_delete) +// for use when the normal delete can't be used - normally when +// the C library is not present +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include + +// The configuration here is as follows: +// +// To deal with virtual destructors, where the correct delete() function +// must be called for the derived class in question, the underlying delete +// is called when needed, from destructors. This is regardless of whether +// the destructor is called by delete itself. So there is a reference to +// delete() from all destructors. The default builtin delete() attempts to +// call free() if there is one defined. So, if you have destructors, and +// you have free(), as in malloc() and free() in the C library, any +// destructor counts as a reference to free(). So the libc heap system is +// linked in regardless of whether it gets explicitly called. +// +// To defeat this undesirable behaviour, we define empty versions of delete +// and delete[]. But doing this prevents proper use of the libc heap in +// C++ programs via C++'s new and delete operators. +// +// Therefore, configuration is provided (in the libc package, near malloc +// et al) for explicitly disabling the provision of these empty functions, +// so that new and delete can be used, if that's what's required. +// +// It is also possible to override all this complexity anyway, but that is +// not yet represented in an external config option. + + + +// If this is already externally defined, go ahead and override the +// builtin delete functions. +#ifndef CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS + +# define CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS +# ifdef CYGPKG_LIBC +// then there is a libc: if there is a malloc, maybe do not supply empty +// delete functions. Get the libc config info to find out. + +# include + +// So, do NOT provide these functions if there is a malloc and we are not +// to provide these functions: +# ifdef CYGPKG_LIBC_MALLOC +# ifdef CYGIMP_LIBC_MALLOC_CXX_DELETE_CALLS_FREE +# undef CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS +# endif // CYGIMP_LIBC_MALLOC_CXX_DELETE_CALLS_FREE +# endif // CYGPKG_LIBC_MALLOC +# endif // CYGPKG_LIBC +#endif // CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS not already defined + +#ifdef CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS +// then define these empty functions: + +void operator delete(void *x) throw() +{ + CYG_EMPTY_STATEMENT; +} + +void operator delete[](void *x) throw() +{ + CYG_EMPTY_STATEMENT; +} + +#endif // CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS + +// EOF delete.cxx diff --git a/packages/infra/current/src/diag.c b/packages/infra/current/src/diag.c new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/diag.c @@ -0,0 +1,431 @@ +/*======================================================================== +// +// diag.c +// +// Infrastructure diagnostic output code +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: Infrastructure diagnostic output +// Description: Implementations of infrastructure diagnostic routines. +// +//####DESCRIPTIONEND#### +// +//======================================================================*/ + +#include +#include +#include + +#include // base types + +#include // HAL polled output +#include // architectural stuff for... +#include // interrupt control +#include // diagnostic output routines + +#ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG + +#include + +#endif + + + +/*----------------------------------------------------------------------*/ + +void diag_write_num( + cyg_uint32 n, /* number to write */ + cyg_ucount8 base, /* radix to write to */ + cyg_ucount8 sign, /* sign, '-' if -ve, '+' if +ve */ + cyg_bool pfzero, /* prefix with zero ? */ + cyg_ucount8 width /* min width of number */ + ); + +#ifdef CYGDBG_INFRA_DIAG_USE_DEVICE + +// this is not properly supported; in particular, there is no properly +// defined API (extern definition) for the diag_device routines used below. + +/*----------------------------------------------------------------------*/ +/* Initialize, call before any others */ + +externC void diag_init() +{ +} + +/*----------------------------------------------------------------------*/ +/* Write single char to output */ + +externC void diag_write_char(char c) +{ + diag_device_write_char(c); +} + +#else + +/*----------------------------------------------------------------------*/ +/* Initialize, call before any others */ + +externC void diag_init(void) +{ + HAL_DIAG_INIT(); +} + +/*----------------------------------------------------------------------*/ +/* Write single char to output */ + +#define PREFIX() +//#define PREFIX() HAL_DIAG_WRITE_CHAR(0x0F) + +externC void diag_write_char(char c) +{ + /* Translate LF into CRLF */ + + if( c == '\n' ) + { + PREFIX(); + HAL_DIAG_WRITE_CHAR('\r'); + } + + PREFIX(); + HAL_DIAG_WRITE_CHAR(c); +} +#endif + +/*----------------------------------------------------------------------*/ +/* Write zero terminated string */ + +externC void diag_write_string(char *psz) +{ + while( *psz ) diag_write_char( *psz++ ); +} + +/*----------------------------------------------------------------------*/ +/* Write decimal value */ + +externC void diag_write_dec( cyg_int32 n) +{ + cyg_ucount8 sign; + + if( n < 0 ) n = -n, sign = '-'; + else sign = '+'; + + diag_write_num( n, 10, sign, false, 0); +} + +/*----------------------------------------------------------------------*/ +/* Write hexadecimal value */ + +externC void diag_write_hex( cyg_uint32 n) +{ + diag_write_num( n, 16, '+', false, 0); +} + +/*----------------------------------------------------------------------*/ +/* Generic number writing function */ +/* The parameters determine what radix is used, the signed-ness of the */ +/* number, its minimum width and whether it is zero or space filled on */ +/* the left. */ + +void diag_write_num( + cyg_uint32 n, /* number to write */ + cyg_ucount8 base, /* radix to write to */ + cyg_ucount8 sign, /* sign, '-' if -ve, '+' if +ve */ + cyg_bool pfzero, /* prefix with zero ? */ + cyg_ucount8 width /* min width of number */ + ) +{ + char buf[16]; + cyg_count8 bpos; + char bufinit = pfzero?'0':' '; + char *digits = "0123456789ABCDEF"; + + /* init buffer to padding char: space or zero */ + for( bpos = 0; bpos < (cyg_count8)sizeof(buf); bpos++ ) buf[bpos] = bufinit; + + /* Set pos to start */ + bpos = 0; + + /* construct digits into buffer in reverse order */ + if( n == 0 ) buf[bpos++] = '0'; + else while( n != 0 ) + { + cyg_ucount8 d = n % base; + buf[bpos++] = digits[d]; + n /= base; + } + + /* set pos to width if less. */ + if( (cyg_count8)width > bpos ) bpos = width; + + /* set sign if negative. */ + if( sign == '-' ) + { + if( buf[bpos-1] == bufinit ) bpos--; + buf[bpos] = sign; + } + else bpos--; + + /* Now write it out in correct order. */ + while( bpos >= 0 ) + diag_write_char(buf[bpos--]); +} + +/*----------------------------------------------------------------------*/ +/* perform some simple sanity checks on a string to ensure that it */ +/* consists of printable characters and is of reasonable length. */ + +static cyg_bool diag_check_string( char *str ) +{ + cyg_bool result = true; + char *s; + + if( str == NULL ) return false; + + for( s = str ; result && *s ; s++ ) + { + char c = *s; + + /* Check for a reasonable length string. */ + + if( s-str > 256 ) result = false; + + /* We only really support CR and NL at present. If we want to + * use tabs or other special chars, this test will have to be + * expanded. + */ + + if( c == '\n' || c == '\r' ) + continue; + + /* Check for printable chars. This assumes ASCII */ + + if( c < ' ' || c > '~' ) + result = false; + + } + + return result; +} + +/*----------------------------------------------------------------------*/ + +externC void diag_vprintf( char *fmt, CYG_ADDRWORD *args) +{ + if( !diag_check_string(fmt) ) + { + int i; + diag_write_string("\n"); + return; + } + + while( *fmt != '\0' ) + { + char c = *fmt; + + if( c != '%' ) diag_write_char( c ); + else + { + cyg_bool pfzero = false; + cyg_count8 width = 0; + char sign = '+'; + + c = *++fmt; + + if( c == '0' ) pfzero = true; + + while( '0' <= c && c <= '9' ) + { + width = width*10 + c - '0'; + c = *++fmt; + } + + switch( c ) + { + case 'd': + case 'D': + { + long val = (long)(*args++); + if( val < 0 ) val = -val, sign = '-'; + diag_write_num(val, 10, sign, pfzero, width); + break; + } + + case 'x': + case 'X': + { + unsigned long val = (long)(*args++); + diag_write_num(val, 16, sign, pfzero, width); + break; + } + + case 'c': + case 'C': + { + char ch = (char)(*args++); + diag_write_char(ch); + break; + } + + case 's': + case 'S': + { + char *s = (char *)(*args++); + cyg_count32 len = 0; + cyg_count32 pre = 0, post = 0; + + if( s == NULL ) s = ""; + else if( !diag_check_string(s) ) + { + diag_write_string(" 25 ) width -= 25; + pfzero = false; + /* Drop through to print the closing ">" */ + /* and pad to the required length. */ + } + + while( s[len] != 0 ) len++; + + if( width && len > width ) len = width; + + if( pfzero ) pre = width-len; + else post = width-len; + + while( pre-- > 0 ) diag_write_char(' '); + + while( *s != '\0' && len-- != 0) + diag_write_char(*s++); + + while( post-- > 0 ) diag_write_char(' '); + + break; + } + + case 'b': + case 'B': + { + unsigned long val = (unsigned long)(*args++); + cyg_uint32 i; + if( width == 0 ) width = 32; + + for( i = width-1; i >= 0; i-- ) + diag_write_char( (val&(1< // Configuration header + +// INCLUDES + +#include // Common type definitions and support +#include // Default tracing support + + +// FUNCTIONS + +externC void +__main( void ) +{ + CYG_REPORT_FUNCTION(); + CYG_REPORT_FUNCARGVOID(); + + CYG_TRACE0( true, "This is the system default __main()" ); + + CYG_EMPTY_STATEMENT; // don't let it complain about doing nothing + + CYG_REPORT_RETURN(); +} // __main() + +// EOF dummyxxmain.cxx diff --git a/packages/infra/current/src/fancy.cxx b/packages/infra/current/src/fancy.cxx new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/fancy.cxx @@ -0,0 +1,537 @@ +//========================================================================== +// +// fancy.cxx +// +// Fancy formatting trace and assert functions +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-12-04 +// Purpose: Fancy Trace and assert functions +// Description: The functions in this file are fancy implementations of the +// standard trace and assert functions. These do printf +// style formatting, printing the string and arguments. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include + +#ifdef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_FANCY + +#include // base types +#include // tracing macros +#include // assertion macros + +#include // HAL configury +#include // HAL polled output +#include // architectural stuff for... +#include // interrupt control + +#ifdef CYGPKG_KERNEL +#include // kernel configury +#include // thread id to print +#include // ancillaries for above +#include // ancillaries for above +#endif + +// ------------------------------------------------------------------------- +// Local Configuration: hack me! + +// these are generally: +// if 0, feature is disabled +// if 1, feature is enabled, printing is default width +// if >1, field is padded up to that width if necessary +// (not truncated ever) + +#define CYG_FILENAME 20 +#define CYG_THREADID 0 // DO NOT SET IF NO KERNEL +#define CYG_LINENUM 4 +#define CYG_FUNCNAME 100 +#define CYG_DIAG_PRINTF 1 +#define CYG_FUNC_INDENT 2 + +#ifndef CYGPKG_KERNEL +# undef CYG_THREADID +# define CYG_THREADID 0 +#endif + +#if CYG_FUNCNAME == 1 +#define CYG_FBUF_SIZE 100 +#else +#define CYG_FBUF_SIZE (CYG_FUNCNAME+20) +#endif + +// ------------------------------------------------------------------------- +// Functions to trim file names and function names down to printable lengths +// (these are shared between trace and assert functions) + +#ifdef CYGDBG_USE_TRACING + +#if 0 +static char * tracepremsgs[] = { + " INFO:", + "ENTER :", + "ARGS :", + "RETURN:", + "bad code" +}; +#endif + +static char * tracepremsgs[] = { + "'", + "{{", + "((", + "}}", + "bad code" +}; + +static char * tracepostmsgs[] = { + "'", + "", + "))", + "", + "bad code" +}; + +static void +write_whattrace( cyg_uint32 what ) +{ +#if CYG_FUNC_INDENT + static cyg_uint32 cyg_indent = 0; + if ( 3 == what ) + cyg_indent -= CYG_FUNC_INDENT; + cyg_uint32 i = cyg_indent; + for ( ; i > 0; i-- ) + diag_write_string( " " ); +#endif // CYG_FUNC_INDENT + diag_write_string( tracepremsgs[ what > 4 ? 4 : what ] ); +#if CYG_FUNC_INDENT + if ( 1 == what ) + cyg_indent += CYG_FUNC_INDENT; +#endif // CYG_FUNC_INDENT +} + +static void +write_whattracepost( cyg_uint32 what ) +{ + diag_write_string( tracepostmsgs[ what > 4 ? 4 : what ] ); +} +#endif // CYGDBG_USE_TRACING + +static char *trim_file(char *file) +{ +#if CYG_FILENAME + if ( NULL == file ) + file = ""; + +#if 1 == CYG_FILENAME + char *f = file; + while( *f ) f++; + while( *f != '/' && f != file ) f--; + return f==file?f:(f+1); +#else + static char fbuf2[100]; + char *f = file, *g = fbuf2; + while( *f ) f++; + while( *f != '/' && f != file ) f--; + if ( f > file ) f++; + while( *f ) *g++ = *f++; + while( CYG_FILENAME > (g - fbuf2) ) *g++ = ' '; + *g = 0; + return fbuf2; +#endif +#else + return ""; +#endif +} + +static char *trim_func(char *func) +{ +#if CYG_FUNCNAME + static char fbuf[CYG_FBUF_SIZE]; + int i; + + if ( NULL == func ) + func = ""; + + for( i = 0; func[i] && func[i] != '(' && i < CYG_FBUF_SIZE-4 ; i++ ) + fbuf[i] = func[i]; + + fbuf[i++] = '('; + fbuf[i++] = ')'; + fbuf[i ] = 0; + while( i > 0 && fbuf[i] != ' ' ) i--; + if( i > 0 ) i++; +#if 1 == CYG_FUNCNAME + return &fbuf[i]; +#else + char *p = &fbuf[i]; + while ( *p ) p++; + while ( CYG_FUNCNAME > (p - (&fbuf[i])) ) *p++ = ' '; + *p = 0; + return &fbuf[i]; +#endif +#else + return ""; +#endif +} + +void write_lnum( cyg_uint32 lnum) +{ +#if CYG_LINENUM + diag_write_char('['); +#if 1 < CYG_LINENUM + cyg_uint32 i, j; + for ( i = 2, j = 100; i < CYG_LINENUM ; i++, j *= 10 ) + if ( lnum < j ) + diag_write_char(' '); +#endif + diag_write_dec(lnum); + diag_write_char(']'); + diag_write_char(' '); +#endif +} + +void write_thread_id() +{ +#if CYG_THREADID + Cyg_Thread *t = Cyg_Thread::self(); + cyg_uint16 tid = 0xFFFF; + + if( t != NULL ) tid = t->get_unique_id(); + + diag_write_char('<'); + diag_write_hex(tid); + diag_write_char('>'); +#endif +} + +// ------------------------------------------------------------------------- +// Trace functions: + +#ifdef CYGDBG_USE_TRACING + +externC void +cyg_tracenomsg( char *psz_func, char *psz_file, cyg_uint32 linenum ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + diag_write_string("TRACE: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); + +}; + +// provide every other one of these as a space/caller bloat compromise. + +externC void +cyg_tracemsg( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string( "TRACE: " ); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); + write_whattrace( what ); + diag_write_string(psz_msg); + write_whattracepost( what ); + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); + +}; + +externC void +cyg_tracemsg2( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string( "TRACE: " ); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); + write_whattrace( what ); +#if CYG_DIAG_PRINTF + diag_printf( psz_msg, arg0, arg1 ); +#else + diag_write_string(psz_msg); + diag_write_char(' '); + diag_write_hex(arg0); + diag_write_char(' '); + diag_write_hex(arg1); +#endif + write_whattracepost( what ); + diag_write_char('\n'); + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +externC void +cyg_tracemsg4( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3 ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string( "TRACE: " ); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); + write_whattrace( what ); +#if CYG_DIAG_PRINTF + diag_printf( psz_msg, arg0, arg1, arg2, arg3 ); +#else + diag_write_string(psz_msg); + diag_write_char(' '); + diag_write_hex(arg0); + diag_write_char(' '); + diag_write_hex(arg1); + diag_write_char(' '); + diag_write_hex(arg2); + diag_write_char(' '); + diag_write_hex(arg3); +#endif + write_whattracepost( what ); + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +externC void +cyg_tracemsg6( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5 ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string( "TRACE: " ); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); + write_whattrace( what ); +#if CYG_DIAG_PRINTF + diag_printf( psz_msg, arg0, arg1, arg2, arg3, arg4, arg5 ); +#else + diag_write_string(psz_msg); + diag_write_char(' '); + diag_write_hex(arg0); + diag_write_char(' '); + diag_write_hex(arg1); + diag_write_char(' '); + diag_write_hex(arg2); + diag_write_char(' '); + diag_write_hex(arg3); + diag_write_char(' '); + diag_write_hex(arg4); + diag_write_char(' '); + diag_write_hex(arg5); +#endif + write_whattracepost( what ); + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +externC void +cyg_tracemsg8( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5, + CYG_ADDRWORD arg6, CYG_ADDRWORD arg7 ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string( "TRACE: " ); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); + write_whattrace( what ); +#if CYG_DIAG_PRINTF + diag_printf( psz_msg, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 ); +#else + diag_write_string(psz_msg); + diag_write_char(' '); + diag_write_hex(arg0); + diag_write_char(' '); + diag_write_hex(arg1); + diag_write_char(' '); + diag_write_hex(arg2); + diag_write_char(' '); + diag_write_hex(arg3); + diag_write_char(' '); + diag_write_hex(arg4); + diag_write_char(' '); + diag_write_hex(arg5); + diag_write_char(' '); + diag_write_hex(arg6); + diag_write_char(' '); + diag_write_hex(arg7); +#endif + write_whattracepost( what ); + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +#endif // CYGDBG_USE_TRACING + +// ------------------------------------------------------------------------- +// Assert functions: + +#ifdef CYGDBG_USE_ASSERTS + +externC void +cyg_assert_fail( char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + diag_write_string("ASSERT FAIL: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); + diag_write_string(psz_msg); + diag_write_char('\n'); + + for(;;); + +// DIAG_DEVICE_END_SYNC(); +// HAL_RESTORE_INTERRUPTS(old_ints); +}; + +extern "C" +{ +extern unsigned long CYG_LABEL_NAME(stext); +extern unsigned long CYG_LABEL_NAME(etext); + +unsigned long stext_addr = (unsigned long)&CYG_LABEL_NAME(stext); +unsigned long etext_addr = (unsigned long)&CYG_LABEL_NAME(etext); +}; + +externC cyg_bool cyg_check_data_ptr(void *ptr) +{ + unsigned long p = (unsigned long)ptr; + + if( p == 0 ) return false; + + if( p > stext_addr && p < etext_addr ) return false; + + return true; +} + +externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)) +{ + unsigned long p = (unsigned long)ptr; + + if( p == 0 ) return false; + + if( p < stext_addr && p > etext_addr ) return false; + + return true; +} + +#endif // CYGDBG_USE_ASSERTS + +#endif // CYGDBG_INFRA_DEBUG_TRACE_ASSERT_FANCY + +// ------------------------------------------------------------------------- +// EOF fancy.cxx diff --git a/packages/infra/current/src/memcpy.c b/packages/infra/current/src/memcpy.c new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/memcpy.c @@ -0,0 +1,182 @@ +/*=========================================================================== +// +// memcpy.c +// +// ANSI standard memcpy() routine +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-06-04 +// Purpose: This file implements the ANSI memcpy() function +// Description: This file implements the memcpy() function defined in ANSI para +// 7.11.2.1. This is implemented in the kernel rather than the +// C library due to it being required by gcc whether or not the +// C library has been configured in. +// +//####DESCRIPTIONEND#### +// +//==========================================================================*/ + + +/* INCLUDES */ + +#include /* Configuration of infra package */ + +#include /* Common type definitions */ +#include /* Tracing support */ +#include /* Assertion support */ +#include /* Compiler defns such as size_t, NULL etc. */ + +/* MACROS */ + +/* Nonzero if either X or Y is not aligned on a word boundary. */ +#define CYG_STR_UNALIGNED(X, Y) \ + (((CYG_WORD)(X) & (sizeof (CYG_WORD) - 1)) | \ + ((CYG_WORD)(Y) & (sizeof (CYG_WORD) - 1))) + +/* How many bytes are copied each iteration of the 4X unrolled loop in the + * optimised string implementation + */ +#define CYG_STR_OPT_BIGBLOCKSIZE (sizeof(CYG_WORD) << 2) + + +/* How many bytes are copied each iteration of the word copy loop in the + * optimised string implementation + */ +#define CYG_STR_OPT_LITTLEBLOCKSIZE (sizeof (CYG_WORD)) + +/* EXPORTED SYMBOLS */ + +externC void * +memcpy( void *s1, const void *s2, size_t n ) __attribute__((weak, + alias("_memcpy"))); + +/* FUNCTIONS */ + +void * +_memcpy( void *s1, const void *s2, size_t n ) +{ +#if defined(CYGIMP_INFRA_PREFER_SMALL_TO_FAST_MEMCPY) || defined(__OPTIMIZE_SIZE__) + char *dst = (char *) s1; + const char *src = (const char *) s2; + +#ifdef CYG_TRACING_FIXED + CYG_REPORT_FUNCNAMETYPE( "_memcpy", "returning %08x" ); + CYG_REPORT_FUNCARG3( "dst=%08x, src=%08x, n=%d", dst, src, n ); + + if (n != 0) + { + CYG_CHECK_DATA_PTR( dst, "dst is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( src, "src is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( dst+n-1, "dst+n-1 is not a valid address!" ); + CYG_CHECK_DATA_PTR( src+n-1, "src+n-1 is not a valid address!" ); + } +#endif + + while (n--) + { + *dst++ = *src++; + } /* while */ + +#ifdef CYG_TRACING_FIXED + CYG_REPORT_RETVAL( s1 ); +#endif + return s1; +#else + char *dst; + const char *src; + CYG_WORD *aligned_dst; + const CYG_WORD *aligned_src; + +#ifdef CYG_TRACING_FIXED + CYG_REPORT_FUNCNAMETYPE( "_memcpy", "returning %08x" ); +#endif + + dst = (char *)s1; + src = (const char *)s2; + +#ifdef CYG_TRACING_FIXED + CYG_REPORT_FUNCARG3( "dst=%08x, src=%08x, n=%d", dst, src, n ); + + if (n != 0) + { + CYG_CHECK_DATA_PTR( dst, "dst is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( src, "src is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( dst+n-1, "dst+n-1 is not a valid address!" ); + CYG_CHECK_DATA_PTR( src+n-1, "src+n-1 is not a valid address!" ); + } +#endif + + /* If the size is small, or either SRC or DST is unaligned, + * then punt into the byte copy loop. This should be rare. + */ + if (n < sizeof(CYG_WORD) || CYG_STR_UNALIGNED (src, dst)) + { + while (n--) + *dst++ = *src++; +#ifdef CYG_TRACING_FIXED + CYG_REPORT_RETVAL( s1 ); +#endif + return s1; + } /* if */ + + aligned_dst = (CYG_WORD *)dst; + aligned_src = (const CYG_WORD *)src; + + /* Copy 4X long words at a time if possible. */ + while (n >= CYG_STR_OPT_BIGBLOCKSIZE) + { + *aligned_dst++ = *aligned_src++; + *aligned_dst++ = *aligned_src++; + *aligned_dst++ = *aligned_src++; + *aligned_dst++ = *aligned_src++; + n -= CYG_STR_OPT_BIGBLOCKSIZE; + } /* while */ + + /* Copy one long word at a time if possible. */ + while (n >= CYG_STR_OPT_LITTLEBLOCKSIZE) + { + *aligned_dst++ = *aligned_src++; + n -= CYG_STR_OPT_LITTLEBLOCKSIZE; + } /* while */ + + /* Pick up any residual with a byte copier. */ + dst = (char*)aligned_dst; + src = (const char*)aligned_src; + while (n--) + *dst++ = *src++; + +#ifdef CYG_TRACING_FIXED + CYG_REPORT_RETVAL( s1 ); +#endif + return s1; +#endif /* not defined(CYGIMP_PREFER_SMALL_TO_FAST_MEMCPY) || + * defined(__OPTIMIZE_SIZE__) */ +} /* _memcpy() */ + +/* EOF memcpy.c */ diff --git a/packages/infra/current/src/memset.c b/packages/infra/current/src/memset.c new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/memset.c @@ -0,0 +1,179 @@ +/*=========================================================================== +// +// memset.c +// +// ANSI standard memset() routine +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-06-04 +// Purpose: This file implements the ANSI memset() function +// Description: This file implements the memset() function defined in ANSI para +// 7.11.6.1. This is implemented in the kernel rather than the +// C library due to it being required by gcc whether or not the +// C library has been configured in. +// +//####DESCRIPTIONEND#### +// +//==========================================================================*/ + + +/* INCLUDES */ + +#include /* Configuration of infra package */ + +#include /* Common type definitions */ +#include /* Tracing support */ +#include /* Assertion support */ +#include /* Compiler defns such as size_t, NULL etc. */ + +/* MACROS */ + +/* Nonzero if X is not aligned on a word boundary. */ +#define CYG_STR_UNALIGNED(X) ((CYG_WORD)(X) & (sizeof (CYG_WORD) - 1)) + +/* How many bytes are copied each iteration of the word copy loop in the + * optimised string implementation + */ +#define CYG_STR_OPT_LITTLEBLOCKSIZE (sizeof (CYG_WORD)) + +/* EXPORTED SYMBOLS */ + +externC void * +memset( void *s, int c, size_t n ) __attribute__ ((weak, alias("_memset"))); + +/* FUNCTIONS */ + +void * +_memset( void *s, int c, size_t n ) +{ +#if defined(CYGIMP_INFRA_PREFER_SMALL_TO_FAST_MEMSET) || defined(__OPTIMIZE_SIZE__) + char *char_ptr = (char *)s; + +#ifdef CYG_TRACING_FIXED + CYG_REPORT_FUNCNAMETYPE( "_memset", "returning %08x" ); + CYG_REPORT_FUNCARG3( "s=%08x, c=%d, n=%d", s, c, n ); + + if (n != 0) + { + CYG_CHECK_DATA_PTR( s, "s is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s+n-1, "s+n-1 is not a valid address!" ); + } +#endif + + while (n-- != 0) + { + *char_ptr++ = (char) c; + } + +#ifdef CYG_TRACING_FIXED + CYG_REPORT_RETVAL( s ); +#endif + return s; +#else + char *char_ptr = (char *)s; + cyg_ucount8 count; + CYG_WORD buffer; + CYG_WORD *aligned_addr; + char *unaligned_addr; + +#ifdef CYG_TRACING_FIXED + CYG_REPORT_FUNCNAMETYPE( "_memset", "returning %08x" ); + CYG_REPORT_FUNCARG3( "s=%08x, c=%d, n=%d", s, c, n ); + + if (n != 0) + { + CYG_CHECK_DATA_PTR( s, "s is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( (char *)s+n-1, "s+n-1 is not a valid address!" ); + } +#endif + + if (n < sizeof(CYG_WORD) || CYG_STR_UNALIGNED (s)) + { + while (n-- != 0) + { + *char_ptr++ = (char) c; + } +#ifdef CYG_TRACING_FIXED + CYG_REPORT_RETVAL( s ); +#endif + return s; + } + + /* If we get this far, we know that n is large and s is word-aligned. */ + + aligned_addr = (CYG_WORD *)s; + + /* Store C into each char sized location in BUFFER so that + * we can set large blocks quickly. + */ + c &= 0xff; + if (CYG_STR_OPT_LITTLEBLOCKSIZE == 4) + { + buffer = (c << 8) | c; + buffer |= (buffer << 16); + } + else + { + buffer = 0; + for (count = 0; count < CYG_STR_OPT_LITTLEBLOCKSIZE; count++) + buffer = (buffer << 8) | c; + } + + while (n >= CYG_STR_OPT_LITTLEBLOCKSIZE*4) + { + *aligned_addr++ = buffer; + *aligned_addr++ = buffer; + *aligned_addr++ = buffer; + *aligned_addr++ = buffer; + n -= 4*CYG_STR_OPT_LITTLEBLOCKSIZE; + } + + while (n >= CYG_STR_OPT_LITTLEBLOCKSIZE) + { + *aligned_addr++ = buffer; + n -= CYG_STR_OPT_LITTLEBLOCKSIZE; + } + + /* Pick up the remainder with a bytewise loop. */ + unaligned_addr = (char*)aligned_addr; + while (n) + { + *unaligned_addr++ = (char)c; + n--; + } + +#ifdef CYG_TRACING_FIXED + CYG_REPORT_RETVAL( s ); +#endif + return s; +#endif /* not defined(CYGIMP_PREFER_SMALL_TO_FAST_MEMSET) || + * defined(__OPTIMIZE_SIZE__) */ +} /* _memset() */ + +/* EOF memset.c */ diff --git a/packages/infra/current/src/null.cxx b/packages/infra/current/src/null.cxx new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/null.cxx @@ -0,0 +1,168 @@ +//========================================================================== +// +// null.cxx +// +// Null trace and assert functions +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-15 +// Purpose: Trace and assert functions +// Description: The functions in this file are null implementations of the +// standard trace and assert functions. These can be used to +// eliminate all trace and assert messages without recompiling. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#ifndef CYGDBG_USE_ASSERTS +// then you get an empty function regardless, so that other code can link: +// (for example libc assert() calls this whether or not eCos code has +// asserts enabled - of course if it does, assert() maps to the chosen +// implementation; if not, it's the same inner function to breakpoint.) + +#include // base types +#include // tracing macros +#include // assertion macros + +externC void +cyg_assert_fail( char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ) +{ + for(;;); +}; +#endif // not CYGDBG_USE_ASSERTS + +#ifdef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_NULL + +#include // base types +#include // tracing macros +#include // assertion macros + +// ------------------------------------------------------------------------- +// Trace functions: + +#ifdef CYGDBG_USE_TRACING + +externC void +cyg_tracenomsg( char *psz_func, char *psz_file, cyg_uint32 linenum ) +{} + +// provide every other one of these as a space/caller bloat compromise. + +externC void +cyg_tracemsg( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ) +{} + +externC void +cyg_tracemsg2( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ) +{} +externC void +cyg_tracemsg4( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3 ) +{} +externC void +cyg_tracemsg6( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5 ) +{} +externC void +cyg_tracemsg8( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5, + CYG_ADDRWORD arg6, CYG_ADDRWORD arg7 ) +{} + +#endif // CYGDBG_USE_TRACING + +// ------------------------------------------------------------------------- +// Assert functions: + +#ifdef CYGDBG_USE_ASSERTS + +externC void +cyg_assert_fail( char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ) +{ + for(;;); +}; + +extern "C" +{ +extern unsigned long CYG_LABEL_NAME(stext); +extern unsigned long CYG_LABEL_NAME(etext); + +unsigned long stext_addr = (unsigned long)&CYG_LABEL_NAME(stext); +unsigned long etext_addr = (unsigned long)&CYG_LABEL_NAME(etext); +}; + +externC cyg_bool cyg_check_data_ptr(void *ptr) +{ + unsigned long p = (unsigned long)ptr; + + if( p == 0 ) return false; + + if( p > stext_addr && p < etext_addr ) return false; + + return true; +} + +externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)) +{ + unsigned long p = (unsigned long)ptr; + + if( p == 0 ) return false; + + if( p < stext_addr && p > etext_addr ) return false; + + return true; +} + +#endif // CYGDBG_USE_ASSERTS + +#endif // CYGDBG_INFRA_DEBUG_TRACE_ASSERT_NULL + +// ------------------------------------------------------------------------- +// EOF null.cxx diff --git a/packages/infra/current/src/simple.cxx b/packages/infra/current/src/simple.cxx new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/simple.cxx @@ -0,0 +1,441 @@ +//========================================================================== +// +// simple.cxx +// +// Simple, non formatting trace and assert functions +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-12-04 +// Purpose: Simple Trace and assert functions +// Description: The functions in this file are simple implementations +// of the standard trace and assert functions. These do not +// do any printf style formatting, simply printing the string +// and arguments directly. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include + +#ifdef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE + +#include // base types +#include // tracing macros +#include // assertion macros + +#include // HAL configury +#include // HAL polled output +#include // architectural stuff for... +#include // interrupt control + +#ifdef CYGPKG_KERNEL +#include // kernel configury +#include // thread id to print +#include // ancillaries for above +#include // ancillaries for above +#endif + +// ------------------------------------------------------------------------- +// Local Configuration: hack me! + +#define CYG_NO_FILENAME 1 +#define CYG_NO_THREADID 0 +#define CYG_NO_LINENUM 0 +#define CYG_NO_FUNCNAME 0 +#define CYG_DIAG_PRINTF 1 + +#ifndef CYGPKG_KERNEL +# undef CYG_NO_THREADID +# define CYG_NO_THREADID 1 +#endif +// ------------------------------------------------------------------------- +// Functions to trim file names and function names down to printable lengths +// (these are shared between trace and assert functions) + +static char *trim_file(char *file) +{ +#if !CYG_NO_FILENAME + if ( NULL == file ) + file = ""; + + char *f = file; + + while( *f ) f++; + + while( *f != '/' && f != file ) f--; + + return f==file?f:(f+1); +#else + return ""; +#endif +} + +static char *trim_func(char *func) +{ +#if !CYG_NO_FUNCNAME + + static char fbuf[100]; + int i; + + if ( NULL == func ) + func = ""; + + for( i = 0; func[i] && func[i] != '(' ; i++ ) + fbuf[i] = func[i]; + + fbuf[i++] = '('; + fbuf[i++] = ')'; + fbuf[i++] = 0; + + while( i > 0 && fbuf[i] != ' ' ) i--; + if( i > 0 ) i++; + + return &fbuf[i]; +#else + return ""; +#endif +} + +void write_lnum( cyg_uint32 lnum) +{ +#if !CYG_NO_LINENUM + diag_write_char('['); + diag_write_dec(lnum); + diag_write_char(']'); +#endif +} + +void write_thread_id() +{ +#if !CYG_NO_THREADID + Cyg_Thread *t = Cyg_Thread::self(); + cyg_uint16 tid = 0xFFFF; + + if( t != NULL ) tid = t->get_unique_id(); + + diag_write_char('<'); + diag_write_hex(tid); + diag_write_char('>'); +#endif +} + + +// ------------------------------------------------------------------------- +// Trace functions: + +#ifdef CYGDBG_USE_TRACING + +externC void +cyg_tracenomsg( char *psz_func, char *psz_file, cyg_uint32 linenum ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + diag_write_string("TRACE: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); + +}; + +// provide every other one of these as a space/caller bloat compromise. + +externC void +cyg_tracemsg( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string("TRACE: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); + diag_write_string(psz_msg); + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); + +}; + +externC void +cyg_tracemsg2( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string("TRACE: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); +#if CYG_DIAG_PRINTF + diag_printf( psz_msg, arg0, arg1 ); +#else + diag_write_string(psz_msg); + diag_write_char(' '); + diag_write_hex(arg0); + diag_write_char(' '); + diag_write_hex(arg1); +#endif + diag_write_char('\n'); + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +externC void +cyg_tracemsg4( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3 ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string("TRACE: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); +#if CYG_DIAG_PRINTF + diag_printf( psz_msg, arg0, arg1, arg2, arg3 ); +#else + diag_write_string(psz_msg); + diag_write_char(' '); + diag_write_hex(arg0); + diag_write_char(' '); + diag_write_hex(arg1); + diag_write_char(' '); + diag_write_hex(arg2); + diag_write_char(' '); + diag_write_hex(arg3); +#endif + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +externC void +cyg_tracemsg6( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5 ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string("TRACE: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); +#if CYG_DIAG_PRINTF + diag_printf( psz_msg, arg0, arg1, arg2, arg3, arg4, arg5 ); +#else + diag_write_string(psz_msg); + diag_write_char(' '); + diag_write_hex(arg0); + diag_write_char(' '); + diag_write_hex(arg1); + diag_write_char(' '); + diag_write_hex(arg2); + diag_write_char(' '); + diag_write_hex(arg3); + diag_write_char(' '); + diag_write_hex(arg4); + diag_write_char(' '); + diag_write_hex(arg5); +#endif + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +externC void +cyg_tracemsg8( cyg_uint32 what, + char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg, + CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, + CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, + CYG_ADDRWORD arg4, CYG_ADDRWORD arg5, + CYG_ADDRWORD arg6, CYG_ADDRWORD arg7 ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + if ( NULL == psz_msg ) + psz_msg = ""; + + diag_write_string("TRACE: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); +#if CYG_DIAG_PRINTF + diag_printf( psz_msg, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 ); +#else + diag_write_string(psz_msg); + diag_write_char(' '); + diag_write_hex(arg0); + diag_write_char(' '); + diag_write_hex(arg1); + diag_write_char(' '); + diag_write_hex(arg2); + diag_write_char(' '); + diag_write_hex(arg3); + diag_write_char(' '); + diag_write_hex(arg4); + diag_write_char(' '); + diag_write_hex(arg5); + diag_write_char(' '); + diag_write_hex(arg6); + diag_write_char(' '); + diag_write_hex(arg7); +#endif + diag_write_char('\n'); + + DIAG_DEVICE_END_SYNC(); + HAL_RESTORE_INTERRUPTS(old_ints); +}; + +#endif // CYGDBG_USE_TRACING + +// ------------------------------------------------------------------------- +// Assert functions: + +#ifdef CYGDBG_USE_ASSERTS + +externC void +cyg_assert_fail( char *psz_func, char *psz_file, cyg_uint32 linenum, + char *psz_msg ) +{ + cyg_uint32 old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + DIAG_DEVICE_START_SYNC(); + + diag_write_string("ASSERT FAIL: "); + write_thread_id(); + diag_write_string(trim_file(psz_file)); + write_lnum(linenum); + diag_write_string(trim_func(psz_func)); + diag_write_char(' '); + diag_write_string(psz_msg); + diag_write_char('\n'); + + for(;;); + +// DIAG_DEVICE_END_SYNC(); +// HAL_RESTORE_INTERRUPTS(old_ints); +}; + +extern "C" +{ +extern unsigned long CYG_LABEL_NAME(stext); +extern unsigned long CYG_LABEL_NAME(etext); + +unsigned long stext_addr = (unsigned long)&CYG_LABEL_NAME(stext); +unsigned long etext_addr = (unsigned long)&CYG_LABEL_NAME(etext); +}; + +externC cyg_bool cyg_check_data_ptr(void *ptr) +{ + unsigned long p = (unsigned long)ptr; + + if( p == 0 ) return false; + + if( p > stext_addr && p < etext_addr ) return false; + + return true; +} + +externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)) +{ + unsigned long p = (unsigned long)ptr; + + if( p == 0 ) return false; + + if( p < stext_addr && p > etext_addr ) return false; + + return true; +} + +#endif // CYGDBG_USE_ASSERTS + +#endif // CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE + +// ------------------------------------------------------------------------- +// EOF simple.cxx diff --git a/packages/infra/current/src/startup.cxx b/packages/infra/current/src/startup.cxx new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/startup.cxx @@ -0,0 +1,161 @@ +//======================================================================== +// +// startup.cxx +// +// General startup code for the target machine +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-08-25 +// Purpose: This provides generic startup code for the eCos system. +// Description: We start the system with the entry point cyg_start() +// which is called from the eCos HALs. This in turn invokes +// cyg_prestart(), cyg_package_start() and cyg_user_start(). +// All these can be overriden by the user. +// Usage: Override the defaults to use your own startup code, +// or leave it be and use the configuration options to set +// the appropriate compatibility environment e.g. uItron, +// ISO C, etc. +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include // Common type definitions and support +#include // Default tracing support + +#ifdef CYGSEM_START_ISO_C_COMPATIBILITY +# include +#endif + +#ifdef CYGSEM_START_UITRON_COMPATIBILITY +# include +#endif + +#ifdef CYGPKG_KERNEL +# include +# include +#endif + +// FUNCTION PROTOTYPES + +externC void +cyg_start( void ) CYGBLD_ATTRIB_WEAK; + +externC void +cyg_prestart( void ) CYGBLD_ATTRIB_WEAK; + +externC void +cyg_package_start( void ) CYGBLD_ATTRIB_WEAK; + +externC void +cyg_user_start( void ) CYGBLD_ATTRIB_WEAK; + + +// FUNCTIONS + +void +cyg_start( void ) +{ + CYG_REPORT_FUNCTION(); + CYG_REPORT_FUNCARGVOID(); + + cyg_prestart(); + + cyg_package_start(); + + cyg_user_start(); + +#ifdef CYGPKG_KERNEL + Cyg_Scheduler::start(); +#endif + + CYG_REPORT_RETURN(); +} // cyg_start() + + +void +cyg_prestart( void ) +{ + CYG_REPORT_FUNCTION(); + CYG_REPORT_FUNCARGVOID(); + + CYG_TRACE0( true, "This is the system default cyg_prestart()" ); + + CYG_EMPTY_STATEMENT; // don't let it complain about doing nothing + + CYG_REPORT_RETURN(); +} // cyg_prestart() + + +void +cyg_package_start( void ) +{ + CYG_REPORT_FUNCTION(); + CYG_REPORT_FUNCARGVOID(); + + CYG_TRACE0( true, "This is the system default cyg_package_start()" ); + +#ifdef CYGSEM_START_UITRON_COMPATIBILITY + cyg_uitron_start(); +#endif + +#ifdef CYGSEM_START_ISO_C_COMPATIBILITY + // This works even if the kernel is there, but if not, then it + // calls the user main() and doesn't return until it does! + cyg_iso_c_start(); +#endif + + CYG_EMPTY_STATEMENT; // don't let it complain about doing nothing + + CYG_REPORT_RETURN(); +} // cyg_package_start() + + + +void +cyg_user_start( void ) +{ + CYG_REPORT_FUNCTION(); + CYG_REPORT_FUNCARGVOID(); + + CYG_TRACE0( true, "This is the system default cyg_user_start()" ); + + CYG_EMPTY_STATEMENT; // don't let it complain about doing nothing + + CYG_REPORT_RETURN(); +} // cyg_user_start() + + +// EOF startup.cxx diff --git a/packages/infra/current/src/tcdiag.cxx b/packages/infra/current/src/tcdiag.cxx new file mode 100644 --- /dev/null +++ b/packages/infra/current/src/tcdiag.cxx @@ -0,0 +1,90 @@ +//========================================================================== +// +// tcdiag.cxx +// +// Infrastructure diag test harness. +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-17 +// Description: Test harness implementation that uses the infrastructure +// diag channel. This is intended for manual testing. +// +//####DESCRIPTIONEND#### + +#include +#include + +#include // base types +#include // HAL polled output +#include // what we implement + +void cyg_test_init() +{ + diag_init(); +} + +void cyg_test_output(int status, char *msg, int line, char *file) +{ + char *st = "UNKNOWN STATUS:"; + + switch (status) { + case 0: + st = "FAIL:"; + break; + case 1: + st = "PASS:"; + break; + case 2: + st = "EXIT:"; + break; + case 3: + st = "INFO:"; + break; + } + + diag_write_string(st); + diag_write_char('<'); + diag_write_string(msg); + diag_write_char('>'); + if( 0 == status ) { + diag_write_string(" Line: "); + diag_write_dec(line); + diag_write_string(", File: "); + diag_write_string(file); + } + diag_write_char('\n'); +} + +// This is an appropriate function to set a breakpoint on +void cyg_test_exit() +{ + for(;;) + ; +} +// EOF tcdiag.cxx diff --git a/packages/kernel/current/ChangeLog b/packages/kernel/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/kernel/current/ChangeLog @@ -0,0 +1,1194 @@ +1998-10-28 David Moore + + * include/pkgconf/kernel.h + (CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION): Changed default value for + MIPS simulator to be 0.01 secs instead of 0.001 seconds. + +1998-10-28 Jesper Skov + + * tests/kcache1.c (HAL_DCACHE_PURGE_ALL): Fixed compiler problem + on PowerPC. + +1998-10-27 Nick Garnett + + * tests/kcache1.c: + Added calls to HAL_DCACHE_PURGE_ALL() before each test. Added + local version of HAL_DCACHE_PURGE_ALL() if this is not supplied by + the HAL. + +1998-10-27 Hugo Tyson + + * src/common/thread.cxx (wake): + Remove the thread unconditionally from any queue it was on; for we + have just become not-asleep, so it must be OK. (Bug was: it + didn't happen in transit WAIT-SUSPEND -> SUSPEND, so synch object + still believed the task was waiting on it). PR#17998 + +1998-10-26 Jesper Skov + PR 17527, PR 17837 + + * tests/kcache1.c: + * tests/kclock0.c: + * tests/kclock1.c: + * tests/clock1.cxx: + * tests/clock0.cxx: + Do N/A PASS when kernel real-time clock is configured out. + +1998-10-26 Jesper Skov + PR 17866 + + * include/pkgconf/kernel.h + (CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE): Doubled to prevent stack + overruns on PowerPC. + +1998-10-26 Jesper Skov + PR 17987 + + * src/debug/dbg_gdb.cxx (dbg_threadinfo): Removed "more: " + output. + +1998-10-23 John Dallaway + + * tests/tm_basic.cxx: Added basic timing test. + +1998-10-23 Nick Garnett + + * include/instrmnt.h: + Improved documentation of cyg_instrument_enable() and + cyg_instrument_disable(). + + * src/instrmnt/meminst.cxx: + Added code to enable and disable whole groups of events. + +1998-10-23 Jesper Skov + + * include/generic-stub.h: Deleted. It was moved to hal common some + time ago. + +Fri Oct 23 04:45:12 1998 Jonathan Larmour + + * tests/kcache1.c: + Remove forced warning of a warning which no longer applies + +1998-10-22 Nick Garnett + + * src/common/clock.cxx: + Stop searching the alarm list when the current alarm is in the + future in Cyg_Counter::tick(). Changed sense of comparison in + Cyg_Counter::add_alarm() to sort alarms in ascending order. + +Thu Oct 22 18:21:50 1998 Jonathan Larmour + + * include/pkgconf/kernel.h: + Fix commenting within CDL "comments" + +Thu Oct 22 17:25:45 1998 Jonathan Larmour + + * include/pkgconf/kernel.h: + Remove CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER configuration + option. For PR 17838 + +1998-10-21 Nick Garnett + + * include/pkgconf/kernel.h (CYGNUM_KERNEL_COUNTERS_RTC_PERIOD): + Changed value for JMR3904 board to 15360 which is correct for a + 24.576MHz board rather than 25MHz as before. + + * src/common/thread.cxx: + Exchanged stack_base and stack_size in idle thread constructor. + +1998-10-20 Hugo Tyson + + * tests/kflag1.c (kflag1_main): + Only mess with f2 if it exists, ie. CYGFUN_KERNEL_THREADS_TIMER. + +1998-10-19 Mark Galassi + + * include/pkgconf/kernel.h: updated the doc URL + +1998-10-19 Hugo Tyson + + * include/kapi.h: + * include/kapidata.h (struct cyg_flag_t): + * src/common/kapi.cxx: + Add flags (Cyg_Flag, kernel.../flag.hxx) to the C API. + + * tests/PKGconf.mak (TESTS): + Add new tests for flags via the C API. + + * tests/kflag0.c: + * tests/kflag1.c: + New tests (well, versions of the plain C++ versions flag0.cxx and + flag1.cxx) for flags via the kernel C API. + +1998-10-19 Bart Veer + + * include/pkgconf/kernel.h: + Fixed description of clock resolution. + +1998-10-17 Bart Veer + + * include/pkgconf/kernel.h: + Added a way of configuring the clock interrupt frequency. + +Thu Oct 15 21:31:58 1998 Jonathan Larmour + + * include/pkgconf/kernel.h: + Allow kernel to be disabled now + + * src/common/delete.cxx, src/common/memcpy.c, src/common/memset.c: + Move these files to the infra package + + * src/PKGconf.mak: + Don't build the above files any more + + Above changes are required for PR 17229 + +1998-10-15 Hugo Tyson + + * include/mempoolt.inl (Cyg_Mempoolt): + * include/mempolt2.inl (Cyg_Mempolt2): + Flesh out the destructors to awaken any waiting threads + with reason Cyg_Thread::DESTRUCT to support uITRON + create and delete of memory pool objects. + Note that only template mempolt2 is actually used. + +Wed Oct 14 21:45:54 1998 Jonathan Larmour + + * tests/thread_gdb.c: + Remove unnecessary inclusion of + + * tests/kcache1.c: + Add a warning to expect the "function declaration isn't a + prototype" warning from infra/diag.h + +1998-10-14 Hugo Tyson + + * src/common/thread.cxx (kill,reinitialize): + Do not refer to member timer unless CYGFUN_KERNEL_THREADS_TIMER is + defined. + +1998-10-14 Nick Garnett + + * src/debug/dbg-thread-demux.c: + Now get dbg-threads-api.h from HAL. + + * src/debug/dbg_gdb.cxx: + Tidied up info sent back by dbg_threadinfo(). + + * src/common/thread.cxx: + Changed constructor of idle thread to include initial priority and + a thread name. + + * include/pkgconf/kernel.h: + Moved GDB stub configuration code out to hal.h. + + * include/ktypes.h: + Moved definition of CYG_LABEL_NAME() out to cyg_type.h. + + * src/debug/PKGconf.mak: + * src/debug/dbg-threads-api.h: + * src/debug/generic-stub.c: + * src/debug/stubrom.c: + * src/debug/thread-packets.c: + * src/debug/thread-pkts.h: + These files have all be relocated to hal/common. + +1998-10-14 Hugo Tyson + + * include/thread.hxx (class Cyg_Thread): + Add public members get_stack_base(), get_stack_size() and + get_stack_limit(); + Add private members add_to_list() and remove_from_list() to + centralize handling of the CYGVAR_KERNEL_THREADS_LIST as it is + known. + + * include/thread.inl (class Cyg_Thread): + Add public members get_stack_base(), get_stack_size() and + get_stack_limit(); + + * src/common/thread.cxx: + Add private members add_to_list() and remove_from_list() to + centralize handling of the CYGVAR_KERNEL_THREADS_LIST as it is + known. + Tidy up the two constructors to use them. + Add CYG_REPORT_RETURN()/_RETVAL(...) logging throughout. + Tidy up reinitialize() to use the 6-argument constructor, + thus preserving the thread name. + Fix some bugs in the CYGVAR_KERNEL_THREADS_LIST stuff where + re-adding a thread caused loops in the list, and the like. + Fix bug in set_priority() when the thread is asleep but NOT on any + queue, such as a plain counted_sleep(). + +1998-10-14 Jesper Skov + + * src/debug/thread-packets.c: + * src/debug/dbg_gdb.cxx: + Don't include hal_stub.h unless it's really, really, really + needed. + +1998-10-14 Jesper Skov + + * src/debug/dbg_gdb.cxx: Don't include hal_stub.h unless it's really + needed. + +1998-10-13 Jesper Skov + + * src/debug/generic-stub.c: Added thread support. Renaming a few + functions/variables to match the most recent libstub + generic-stub.c. + Use thread_get_register & thread_put_register when handling GDB + register packets. + + * src/debug/dbg_gdb.cxx (dbg_getthreadreg, dbg_getthreadreg): + DTRT for current thread when CygMon is not configured. + + * src/debug/dbg_gdb.cxx (dbg_threadlist, dbg_getthreadreg, + dbg_getthreadreg): return true/false rather than 0, 1, -1. + + * src/debug/dbg_gdb.cxx: + * src/debug/dbg-threads-api.h: + Added dbg_currthread_id. + +1998-10-08 Jesper Skov + + * src/debug/generic-stub.c: + * src/debug/generic-stub.h: + Added control of interrupts. + Removed unused functions set_debug_trap and initialize_stub. + +Tue Oct 13 17:36:29 1998 Jonathan Larmour + + * src/test/tsttracc.c (cyg_start): + Replace CYG_REPORT_FUNCARGSVOID with the correct + CYG_REPORT_FUNCARGVOID + +1998-10-09 Hugo Tyson + + * src/common/thread.cxx: + clear_timer() is a static which always affects the executing + thread and none other. Removed the "foo->" from various + "foo->clear_timer()" calls to make this less confusing. + Ditto set_timer(). + Changed a "clear_timer()" call to "timer.disable()" and added one + so that they affect _this_ thread, the thread which is being + kill()ed or reinitialize()d rather than the killer or the + resuscitator. Otherwise the alarm list can still get a loop in + it when a thread's killed when waiting with a timeout and + restarted soon enough. + +1998-10-08 Hugo Tyson + + In general, these changes are to support create/delete of uITRON + objects; this requires that an object can be destroyed whilst + there are threads waiting on it, and that they shall be awoken + with a specific return code. + + * include/thread.hxx: + Cyg_Thread::DESTRUCT added to wake reasons, to deal with an object + being destroyed whilst a thread is waiting on it; it's handled in + a manner very similar to release() and BREAK wake_reason. + + * src/common/thread.cxx: + thread_entry(): threads now exit() if the entry_point returns. + Cyg_Thread() constructors now initialize wake_reason to NONE. + reinitialize() clears any pending timeout before calling + constructors. + counted_sleep( [timeout] ) now both deal with the wake reason in + general, and with DESTRUCT in particular. + exit() now clears any pending timeout. + kill() now force_resumes the thread first. + kill() now does not explicitly remove the thread from any queue + it's on; wake() does that for you anyway. + delay() clears the timer just in case and handles DESTRUCT + properly. + DESTRUCT added to various switches for completeness. + + The fixes to counted_sleep()[x2] and kill() are a bugfix for + PR#17688. + + * include/flag.hxx: + * src/sync/flag.cxx: + Add an argument, defaulting to 0, to the constructor which sets + the initial flag value. + Add handing of DESTRUCT wake reason. + Add a destructor which wakes all threads with DESTRUCT + wake_reason. + + * include/mboxt2.inl: + Add handing of DESTRUCT wake reason. + Add a destructor which wakes all threads with DESTRUCT + wake_reason. + + * src/sync/cnt_sem2.cxx: + Add handing of DESTRUCT wake reason. + Add a destructor which wakes all threads with DESTRUCT + wake_reason. + Correct typo in logic for queueing a waiting thread in + Cyg_Counting_Semaphore2::wait( cyg_tick_count abs_timeout ). + This is a bugfix for PR#17687. + + * include/mboxt.inl: + * include/mempoolt.inl: + * include/mempolt2.inl: + * src/sync/bin_sem.cxx: + * src/sync/cnt_sem.cxx: + * src/sync/mutex.cxx: + All these gain handling of the DESTRUCT wake_reason, that's all. + +1998-10-08 Gary Thomas + + * include/pkgconf/kernel.h: + Add support for new architecture + +1998-10-07 Nick Garnett + + * tests/kcache1.c (entry0): + Replaced CYG_TEST_FINISH() with CYG_TEST_PASS_FINISH(). + + * src/debug/dbg-thread-demux.c: + Added dbg_thread_syscall_rmt_1() to save/set and restore the $gp + register values when being called from Cygmon. + +Sun Sep 27 20:12:15 1998 David Moore + + * include/mlqueue.hxx: + * include/bitmap.hxx: + Disallow more than 32 priority levels + + * include/pkgconf/kernel.h: + Changed range of allowed levels from 64 to 32 + +1998-09-27 Nick Garnett + + * tests/memfix2.cxx: + Changed message to say "Fixed memory pool 2 OK" rather than + "Variable memory pool 2 OK". + +1998-09-26 Bart Veer + + * include/intr.hxx (DSRs_pending): + PR 17500: if DSR support is disabled completely then this inline + function should not be defined at all. + +1998-09-26 Nick Garnett + + * tests/kcache1.c: + Added this test program for cache API. Includes some performance + testing. + +1998-09-25 Nick Garnett + + * src/debug/dbg_gdb.cxx: + Removed some debugging code. + + * tests/thread_gdb.c: + Added this test program to allow for GDB thread support testing. + +1998-09-25 Bart Veer + + * include/pkgconf/kernel.h: + The GDB thread support requires the kernel to keep track of all + threads on a linked list. This is a separate option. An additional + requires statement enforces the dependency. + +1998-09-25 Nick Garnett + + * src/debug/dbg-thread-demux.c: + Added include of , removed debug code. + +1998-09-24 Bart Veer + + * src/debug/dbg-thread-demux.c (dbg_thread_syscall_rmt): + PR 17327. If kernel gdb thread support is disabled, do not compile + in the relevant cases in the rmt switch statement. This is a + partial solution to the general problem of how the HAL, kernel, + cygmon, and gdb interact. + +1998-09-24 Nick Garnett + + * src/common/clock.cxx (Cyg_RealTimeClock): + Changed clock priority from zero to one, since it is now used to + set the hardware interrupt priority. + + * src/intr/intr.cxx: + Cyg_Interrupt::chain_isr() now only calls interrupt objects that + have the matching vector number. + Call HAL_INTERRUPT_SET_LEVEL() when attaching interrupts using the + priority passed in the constructor. + Added call to HAL_TRANSLATE_VECTOR() for attaching chained + interrupts. + + * include/instrmnt.h (CYG_INSTRUMENT_EVENT_INTR_CHAIN_ISR): + Added this event. + +Thu Sep 24 11:07:12 1998 David Moore + + * tests/except1.cxx: + * tests/kexcept1.cxx: + Made exception tests detect when CYGPKG_KERNEL_EXCEPTIONS + is disabled. + + +1998-09-22 Bart Veer + + * include/pkgconf/kernel.h: + Changed the kernel package from type bool to type dummy, since + it is not yet possible to disable this package. + +1998-09-20 Mark Galassi + + * include/pkgconf/kernel.h: updated CDL doc strings. + fixed some typos in my doc strings. + +1998-09-18 Nick Garnett + + * src/common/thread.cxx: + * include/thread.inl: + Modified threads list from a LIFO stack to a ring so that we can + add new ones to the end and present the threads to GDB in an order + that more closely matches how it assigns thread ids. + +Wed Sep 16 19:11:22 1998 Hugo Tyson + + * include/thread.inl (get_unique_id): + Move this declaration to before its first use, so that the user + knows it is inline at the point of use. Avoids a warning. + +Wed Sep 16 08:49:48 1998 Jesper Skov + PR 17269 + + * src/common/except.cxx (Cyg_Exception_Control): Replaced + CYGNUM_EXCEPTION_MAX (bug!) with CYG_EXCEPTION_COUNT. + + * include/kapidata.h (struct cyg_exception_conrol): Replaced + CYG_EXCEPTION_MAX (bug!) with CYG_EXCEPTION_COUNT. + + * src/intr/intr.cxx: + * include/intr.hxx (class Cyg_Interrupt): Replaced CYG_ISR_MAX+1 + with CYG_ISR_COUNT. + + * include/except.hxx: Replaced CYGNUM_EXCEPTION_COUNT with + CYG_EXCEPTION_COUNT. + + * tests/kintr0.c: + * tests/intr0.cxx: Replaced CYG_ISR_MAX (bug!) with + CYG_ISR_COUNT. + +Tue Sep 15 19:19:37 1998 Jonathan Larmour + + * include/mboxt2.hxx: + Add inclusion of thread.inl to silence warning + + * tests/kexcept1.c: + Insert void as parameter list of __default_exception_vsr() to + silence warning + +Tue Sep 15 19:16:52 1998 David Moore + + * src/sched/sched.cxx: Cleaned up comments. + +1998-09-15 Nick Garnett + + * src/debug/dbg-thread-demux.c: + Stubbed out led() function. + + * src/debug/dbg_gdb.cxx: + Decide whether to byteswap thread id depending on reported byte + order of target. + Many small changes to debug code. + + * include/thread.inl (init_context): + Changed CYG_DEBUG to CYGPKG_INFRA_DEBUG. + +Tue Sep 15 09:35:14 1998 Jesper Skov + PR 17236 + + * src/common/clock.cxx (add_alarm): A retriggering alarm called + with a trigger time in the past or now will be assigned a new + trigger time. Don't find the counter list until the final trigger + time is known. + Also added a few #else error statements to catch a situation where + no CYGIMP_KERNEL_COUNTERS_x_LIST implementation config is + selected. + + * tests/clock0.cxx: Added extra ASSERT to ensure alarms enabled + with a trigger time of now or in the past actually fire. + * tests/kclock0.c: Same. + +1998-09-15 Bart Veer + + * include/pkgconf/kernel.h: + Cleaning up coonfiguration data (mostly improving the + descriptions). + +Mon Sep 14 11:08:59 1998 Jesper Skov + PR 17230 + + * include/pkgconf/kernel.h: CYGIMP_KERNEL_INTERRUPTS_CHAIN + requires CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN. + +1998-09-14 Mark Galassi + + * include/pkgconf/kernel.h: started adding CDL doc fields. + +1998-09-12 Bart Veer + + * include/pkgconf/kernel.h: + Sort out exception handling options (PR 16953) + Added missing descriptions (PR 17184) + +Fri Sep 11 19:18:28 1998 Hugo Tyson + + * include/clock.hxx (class Cyg_Alarm): + * src/common/clock.cxx (Cyg_Alarm::add_alarm): + PR#17182 + Move the code to synchronize a repeating alarm which had been + firing in the dim and distant past with times in the future, which + had been inline in Cyg_Alarm::enable(), into a function of its + own, Cyg_Alarm::synchronize(). Call it from Cyg_Alarm::enable() + and also from add_alarm() when the immediate time to fire is now + or in the past; otherwise an initial time of, say, NOW-10 with an + interval of 5 would just get lost. Also corrected/commented the + logic there to allow an alarm's handler to cancel itself. + +Wed Sep 9 17:43:26 1998 Hugo Tyson + + * src/common/delete.cxx: + Control the provision of empty delete functions rather better, via + an explicit option from the libc package. Read the rather lengthy + comment in delete.cxx for the explanation. + Also note that the correct place for this functionality is in the + infrastructure, and the same should be done for the C++ new + functions also. + +1998-09-09 Nick Garnett + + * src/common/thread.cxx: + combined separate next_unique_id variables in both constructors. + This would have caused duplicate thread ids to be generated. + + * include/thread.inl: + Added code to initialize Cyg_HardwareThread::saved_context. + + * src/debug/dbg-thread-demux.c: + * src/debug/dbg_gdb.cxx: + Many changes to get thread API working with Cygmon. Debug code + currently left in place until complete testing is possible. + +Tue Sep 8 17:17:32 1998 Hugo Tyson + + * include/pkgconf/kernel.h (CYGNUM_KERNEL_COUNTERS_RTC_PERIOD): + Set up a sensible default RTC for CYG_HAL_MN10300_SIM different + from that for the MN103002 or CYG_HAL_MN10300_STDEVAL1, so that + sim tests run in less than geological time. This is the same as + the default value of before. + +Fri Sep 4 18:25:02 1998 Hugo Tyson + + * src/sched/mlqueue.cxx (timeslice): + * src/sched/sched.cxx (unlock_inner): + Condition out the tracing macros here by default, for tracing + these consumes the whole quantum. + +1998-09-04 Bart Veer + + * include/pkgconf/kernel.h: + Commented out the ROM monitor-specific option settings for now. + + * tests/kclock1.c: + * include/pkgconf/kernel.h: + * include/kapidata.h (struct cyg_counter): + Fixed typos in configuration option names. + +1998-09-03 David Moore + + * include/pkgconf/kernel.h + (CYGNUM_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE): + Fixed typo in configuration option name. + + * src/intr/intr.cxx: + Fixed typo in configuration option name. + Fixed cast to incorrect type. + +1998-09-03 Nick Garnett + + * src/PKGconf.mak (COMPILE): + Added debug/dbg-thread-demux.c to COMPILE list. + + * src/debug/dbg_gdb.cxx (dbg_threadinfo): + Added first cut at providing thread state string. + + * src/debug/dbg-thread-syscall.h: + * src/debug/dbg-thread-demux.c: + Added these two files to implement the interface between Cygmon + and eCos. + +1998-09-03 Bart Veer + + * include/pkgconf/kernel.h (CYGSEM_KERNEL_MEMORY_COALESCE): + * include/mvarimpl.inl (Cyg_Mempool_Variable_Implementation): + Fixed typo in configuration option name. + + * include/pkgconf/kernel.h: + Fixed type in configuration option name. + +Wed Sep 2 19:01:02 1998 Hugo Tyson + + * include/mboxt.hxx: + * include/mboxt.inl: + * include/mboxt2.hxx: + * include/mboxt2.inl: + * include/mempolt2.hxx: + * include/mempolt2.inl: + * include/mempoolt.hxx: + * include/mempoolt.inl: + * include/sema2.hxx: + * src/sync/cnt_sem2.cxx: + * include/flag.hxx: + * src/sync/flag.cxx: + * include/kapi.h: + * src/common/kapi.cxx: + * tests/kmbox1.c: + * tests/kmemfix1.c: + * tests/kmemvar1.c: + * tests/mbox1.cxx: + * tests/memfix1.cxx: + * tests/memvar1.cxx: + Memory pool (both types) and message boxes (both types) and flags + and cnt_sem2-type semaphores now all have absolute timeouts + instead of relative ones in the timely wait functions. + uITRON has changed to add the current time itself. + Kapi changes are mainly name changes to make it clear that + timeouts are now absolute. + The tests (incl. kapi) add in the time themselves now. + +1998-09-01 Tim Goodwin + + * include/kapi.h: + * src/common/kapi.cxx: + * tests/kclock1.c: + * tests/kexcept1.c: + * tests/kmbox1.c: + * tests/kmemfix1.c: + * tests/kmemvar1.c: + * tests/kmutex1.c: + * tests/ksched1.c: + * tests/ksem1.c: + * tests/kthread0.c: + * tests/kthread1.c: + * src/test/kcache1.c: + * src/test/kphilo.c: + * tests/kphilo.c: + * tests/lottery.c: + Changes to cyg_thread_create() interface. + +Tue Sep 1 18:49:06 1998 Hugo Tyson + + * include/pkgconf/kernel.h: + Moved and renamed CYG_DIAG_USE_DEVICE to infra and to + CYGDBG_INFRA_DIAG_USE_DEVICE; kernel.h now includes infra.h as + well as hal.h to ensure all its clients get the info too. + + * include/intr.hxx (class Cyg_Interrupt): + Add static member interrupts_enabled() to poll the current status; + just to avoid calling the HAL directly, really. + + * include/diag.h: + Now just includes cyg/infra/diag.h, so that kernel-specific + features can be added later - original diag.h has moved to infra, + and is that includee. + + * src/PKGconf.mak: + Trace folder and its contents elided, now in infra. + + * src/trace/diag.c: + * src/trace/fancy.cxx: + * src/trace/null.cxx: + * src/trace/simple.cxx: + * src/trace/tcdiag.cxx: + Deleted; all moved to infra, actually. + +1998-09-01 Nick Garnett + + * src/debug/dbg-threads-api.h: + * src/debug/dbg_gdb.cxx: + Converted threadref from long long to char[8] as defined by Cygmon + guys. + + * src/common/thread.cxx: + Added scheduler lock around manipulations of thread list. + + * include/except.hxx: + Now use CYG_EXCEPTION_COUNT to size handler arrays. + +Mon Aug 31 17:53:12 1998 Jonathan Larmour + + * include/memfixed.hxx, include/mempolt2.hxx, include/mempolt2.inl, + include/mempoolt.hxx, include/mempoolt.inl, include/memvar.hxx, + include/mvarimpl.hxx, include/mvarimpl.inl, src/mem/memfixed.cxx, + src/mem/memvar.cxx: + + Add new get_allocation_size() method to return the size of a + previously allocated block - trivial for fixed block allocator, and + requiring a bit of poking around for the variable block allocator. + + This is required for the C library realloc() implementation. Strictly + this only uses the variable block allocator, but the API can only be + enhanced by also updating the template. As a result, this also meant + doing it for the fixed block allocator. + +Mon Aug 31 09:51:37 1998 Jesper Skov + + * src/debug/stubrom.c (cyg_start): Renamed from main(). + +Mon Aug 31 09:00:01 1998 Jesper Skov + + * src/common/thread.cxx: Fixed typo. + +1998-08-28 Bart Veer + + * include/pkgconf/kernel.h, include/bitmap.hxx, include/clock.hxx, + include/except.hxx, include/flag.hxx, include/instrmnt.h, + include/intr.hxx, include/kapi.h, include/kapidata.h, + include/mbox.hxx, include/mboxt.hxx, include/mboxt.inl, + include/mboxt2.hxx, include/mboxt2.inl, include/memfixed.hxx, + include/mempolt2.hxx, include/mempolt2.inl, + include/mempoolt.hxx, include/mempoolt.inl, include/memvar.hxx, + include/mlqueue.hxx, include/mutex.hxx, include/mvarimpl.inl, + include/sched.hxx, include/sema.hxx, include/sema2.hxx, + include/thread.hxx, include/thread.inl, + include/pkgconf/kernel.h: + src/common/clock.cxx, src/common/except.cxx, + src/common/kapi.cxx, src/common/thread.cxx, + src/debug/dbg_gdb.cxx, src/debug/generic-stub.c, + src/instrmnt/meminst.cxx, src/instrmnt/nullinst.cxx, + src/intr/intr.cxx, src/mem/memfixed.cxx, src/mem/memvar.cxx, + src/sched/bitmap.cxx, src/sched/lottery.cxx, + src/sched/mlqueue.cxx, src/sched/sched.cxx, + src/sync/cnt_sem.cxx, src/sync/cnt_sem2.cxx, src/sync/flag.cxx, + src/sync/mbox.cxx, src/sync/mutex.cxx, src/test/diag.cxx, + src/test/kcache1.c, src/test/main.cxx, src/test/timer.cxx, + src/test/tstmbox.cxx: + tests/clock0.cxx, tests/clock1.cxx, tests/except1.cxx, + tests/flag1.cxx, tests/intr0.cxx, tests/kclock0.c, + tests/kclock1.c, tests/kexcept1.c, tests/kintr0.c, + tests/kmbox1.c, tests/kmemfix1.c, tests/kmemvar1.c, + tests/kmutex0.c, tests/kmutex1.c, tests/ksched1.c, + tests/ksem0.c, tests/ksem1.c, tests/kthread0.c, + tests/kthread1.c, tests/lottery.c, tests/mbox1.cxx, + tests/memfix1.cxx, tests/memvar1.cxx, tests/sync3.cxx, + tests/thread2.cxx : + Provide configuration data and rename configuration options + +Fri Aug 28 15:27:31 1998 Hugo Tyson + + * src/trace/fancy.cxx: + * src/trace/simple.cxx: + * src/trace/null.cxx: + Condition on newly named symbols from the infra package, whence + these units will be moved soon. + +Fri Aug 28 09:33:17 1998 Jonathan Larmour + + * src/test/demo.cxx, src/test/kcache1.c, src/test/kphilo.c, + src/test/main.cxx, src/test/philo.cxx, src/test/sload.c, + src/test/timer.cxx, src/test/tstflag.cxx, src/test/tstmbox.cxx, + src/test/tstmpf.cxx, src/test/tstmpool.cxx, src/test/tsttracc.c, + src/test/tsttrace.cxx, tests/bin_sem0.cxx, tests/bin_sem1.cxx, + tests/bin_sem2.cxx, tests/clock0.cxx, tests/clock1.cxx, + tests/cnt_sem0.cxx, tests/cnt_sem1.cxx, tests/except1.cxx, + tests/flag0.cxx, tests/flag1.cxx, tests/intr0.cxx, tests/kclock0.c, + tests/kclock1.c, tests/kexcept1.c, tests/kill.cxx, tests/kintr0.c, + tests/kmbox1.c, tests/kmemfix1.c, tests/kmemvar1.c, tests/kmutex0.c, + tests/kmutex1.c, tests/kphilo.c, tests/ksched1.c, tests/ksem0.c, + tests/ksem1.c, tests/kthread0.c, tests/kthread1.c, tests/lottery.c, + tests/mbox1.cxx, tests/memfix1.cxx, tests/memfix2.cxx, + tests/memvar1.cxx, tests/memvar2.cxx, tests/mutex0.cxx, + tests/mutex1.cxx, tests/philo.cxx, tests/release.cxx, + tests/sched1.cxx, tests/sync2.cxx, tests/sync3.cxx, + tests/thread0.cxx, tests/thread1.cxx, tests/thread2.cxx: + Change entry points from main() to cyg_start(), and remove return + codes - while main returned an int, cyg_start() returns void. It has + no meaning anyway - what could you do with the code? + + * src/test/tsttracc.c, src/test/tsttrace.cxx: + Also change trace calls (CYG_REPORT_...) to reflect that it is a + function called cyg_start with no args returning void, rather than + what it was for main(argc, argv) + +Fri Aug 28 09:24:41 1998 Jesper Skov + + * src/debug/generic-stub.c: Moved strcpy/strlen from hal-stub to + generic-stub. Cleaned up a bit to avoid compiler warnings. + +Thu Aug 27 19:22:51 1998 Hugo Tyson + + * tests/kphilo.c (Philosopher): + * tests/philo.cxx (Philosopher): + * src/test/philo.cxx (Philosopher): + * src/test/kphilo.c (Philosopher): + * src/common/kapi.cxx: + Change CYG_RELEASE_DEBUG to CYGPKG_INFRA_DEBUG. + These changes are self-contained, so they can go in right now. + +Thu Aug 27 15:20:31 1998 Hugo Tyson + + * include/mvarimpl.inl (free): + Remove a couple of warning due to pointer comparison without casts + in coallesce(sic.) code. + +1998-08-26 Nick Garnett + + * include/kapidata.h: + Added saved_context to cyg_hardwarethread structure to track + GDB support in rest of kernel. + +1998-08-25 Nick Garnett + + * include/pkgconf/kernel.h: + Added CYGIMP_KERNEL_THREAD_GDB_SUPPORT to configure for GDB + interactions with the kernel. + + * src/debug/dbg-threads-api.h: + * src/debug/dbg_gdb.cxx: + Added these files to repository to support GDB interactions + with the kernel. Note that dbg-threads-api.h is a copy of a + file in devo/libstub. Any changes there must be merged in here + too. + + * src/PKGconf.mak: + Added debug/dbg_gdb.cxx to COMPILE list. + + * include/thread.inl: + * include/thread.hxx: + Added support for GDB, specifically for thread-aware debugging. + + * include/intr.hxx: + * src/intr/intr.cxx: + Added an extra argument to interrupt_end(): a pointer to + the saved register state. This is optionally used to provide + a more interesting saved register state for GDB. + +Tue Aug 25 02:36:26 1998 Jonathan Larmour + + * include/generic-stub.h: + Add void to empty prototype argument lists to silence compiler + warnings + +Fri Aug 21 18:46:34 1998 Hugo Tyson + + * src/common/clock.cxx (enable): + Make the maths work right if we only just set up the clock + thingy. Unsigned has a lot to answer for; when the next scheduled + tick was all correct, the delta was -1, which correctly rounds to + zero in the division. But it isn't -1 it's 18446744073709551615 + which gave a shift of 15 in the the uITRON test programs. + +Fri Aug 21 11:40:50 1998 Hugo Tyson + + * include/mboxt2.inl (put): + * include/mempolt2.inl (alloc): + Tidy Nick's changes (1998-07-27) for set_timer() semantics a bit, + make it a bit more efficient and smaller code. + +Thu Aug 20 17:37:35 BST 1998 Chris Provenzano + + * include/mvarimpl.inl, include/pkgconf/kernel.h: + Added memory coallecsing to the variable size memory allocator. + This option is enabled my default. + + * tests/stdlib/malloc2.c: Only print 50 messages, not 500. + +1998-08-20 Nick Garnett + + * include/pkgconf/kernel.h: + Moved definition of CYG_KERNEL_USE_INIT_PRIORITY from here + to hal.h. + + * include/thread.hxx: + Changed argument to cyg_thread_entry() to CYG_ADDRWORD from + CYG_ADDRESS. + + * include/ktypes.h: + Moved constructor priority ordering stuff out to infra/cyg_type.h. + + * include/kapi.h: + * src/common/kapi.cxx: + Added name and priority parameters to cyg_thread_create() and + swapped stack size and base parameters. These changes are + currently protected by DAY_OF_CHAOS ifdefs and are therefore + inactive. + +Wed Aug 19 19:06:16 1998 Jonathan Larmour + + * tests/bin_sem1.cxx, tests/bin_sem2.cxx, tests/cnt_sem1.cxx, + tests/flag1.cxx, tests/mbox1.cxx, tests/memfix2.cxx, + tests/memvar2.cxx, tests/sync2.cxx, tests/sync3.cxx, + tests/thread2.cxx, tests/release.cxx, tests/kill.cxx: + Reorder inclusion of thread.inl to silence warnings + +Wed Aug 19 18:48:03 1998 Jonathan Larmour + + * include/kernel.hxx: + Reorder inclusion of thread.inl to silence warnings + +Wed Aug 19 18:21:31 1998 Jonathan Larmour + + * src/common/kapi.cxx, src/sync/flag.cxx: + Reorder inclusion of thread.inl to silence warnings + + * src/sync/bin_sem.cxx, src/sync/cnt_sem.cxx, src/sync/cnt_sem2.cxx, + src/sync/mbox.cxx: + Add inclusion of thread.inl to silence warnings + + * src/common/memset.c: + Make pointer arithmetic be on char *, not void * to silence warnings + + * include/diag.h, src/trace/diag.c: + Make diag_init take void parameter, and give diag_printf explicit + parameters in prototypes to silence warnings + +1998-08-19 Nick Garnett + + * include/pkgconf/kernel.h: + * src/common/thread.cxx: + Added ifdef for CYGIMP_IDLE_THREAD_YIELD to support single + priority configurations. + +Tue Aug 18 16:56:38 1998 Jonathan Larmour + + * include/thread.hxx, include/thread.inl: + To silence compiler warnings, move register_exception inline definition + from the .hxx to the .inl. Also move attach_stack to before the + constructor where it is invoked from. + +1998-08-18 Nick Garnett + + * include/pkgconf/kernel.h: + Moved all HAL specific config options out to a HAL config file. + + * include/kapi.h: + * src/common/kapi.cxx: + Added cyg_scheduler_lock() and cyg_scheduler_unlock() to provide + user access to the scheduler lock. + +Mon Aug 17 21:39:20 1998 Jonathan Larmour + + * include/kapi.h: + Insert "void" to empty parameter lists to silence warnings + +Fri Aug 14 18:10:20 1998 Hugo Tyson + + * src/common/thread.cxx (exit): + Set the state explicitly to EXITED rather than or'ing + it in; should be safe cos it's what kill does in the normal case. + Needed to avoid suspend sort of states persisting after death. + One character changes are always aesthetically pleasing. + +Fri Aug 14 17:28:01 1998 Hugo Tyson + + * include/pkgconf/kernel.h: + Add config options as below: + + * src/common/thread.cxx: + Add asserts of CYGNUM_KERNEL_MAX_COUNTED_WAKE_COUNT_ASSERT + and CYGNUM_KERNEL_MAX_SUSPEND_COUNT_ASSERT if they are defined. + Also lazily tidied format of func hdrs as per code review et al. + +1998-08-14 Nick Garnett + + * include/kapidata.h: + Added support for thread names and thread housekeeping list. + + * src/common/delete.cxx: + Added include for cyg_type.h. + + * include/pkgconf/kernel.h: + Added CYGIMP_THREAD_NAME and CYGIMP_THREAD_LIST options. + + * include/thread.inl: + * include/thread.hxx: + Added support for thread names and thread housekeeping list. + + * src/common/thread.cxx: + Added support for thread names and thread housekeeping list. + Fixed ordering bug in Cyg_Thread::delay(). + +Thu Aug 13 15:33:48 1998 Jonathan Larmour + + * include/ktypes.h: + Remove inlined new and delete as they aren't strictly permitted and + they prevent a valid new and delete being defined anywhere else! + + * src/common/delete.cxx, src/PKGconf.mak: + Add delete.cxx to provide default delete operation for when a C + library isn't present + +1998-07-28 Nick Garnett + + * include/thread.hxx, include/sched.hxx, include/mlqueue.hxx, + include/lottery.hxx, include/bitmap.hxx, src/common/thread.cxx, + src/sched/sched.cxx, src/sched/mlqueue.cxx, src/sched/lottery.cxx, + src/sched/bitmap.cxx: + Added an alternative constructor to Cyg_Thread which takes + arguments in new order, and includes a scheduling parameters + argument. Propagated effects of this through Cyg_SchedThread + and Cyg_SchedThread_Implementation. This mostly takes the form + of passing the scheduling parameters through to the constructors. + +1998-07-27 Nick Garnett + + * src/sync/flag.cxx, src/sync/cnt_sem2.cxx, include/mempoolt.inl, + include/mempolt2.inl, include/mboxt2.inl, include/mboxt.inl: + Modified code in API calls that take a timeout to allow for a + timeout in the past. + NOTE: The timeouts have for now been left as relative delays, they + should be converted to absolute timeouts. + + * src/common/thread.cxx: + Modified code in counted_sleep to allow for a timeout in the past. + Added handling of EXIT wake_reason in delay(). + +1998-07-24 Nick Garnett + + * include/thread.inl: + Reordered code in Cyg_Thread::set_timer() to init the timer after + wake_reason has been assigned. + + * include/clock.inl: + Removed Cyg_Alarm::enable(). + + * src/sync/mutex.cxx (Cyg_Condition_Variable::wait): + Modified order of code in timed version of wait to allow for a + timout in the past. + + * src/sync/cnt_sem.cxx (Cyg_Counting_Semaphore::wait): + Modified order of code in timed version of wait to allow for a + timout in the past. Also modified timeout to be absolute rather + than relative. + + * src/common/thread.cxx (Cyg_Thread::wake): + Added test for whether a thread is actually asleep before waking + it. Allows us to apply wake() to awake threads without damage. + + * src/common/clock.cxx: + Added code to Cyg_Counter::add_alarm() to deal with alarms + that trigger now or in the past. + Moved Cyg_Alarm::enable() here. Added code to do the right thing + when reenabling previously disabled interval alarms. + +1998-07-23 Nick Garnett + + * src/debug/stubrom.c: Added header comments. + +Thu Mar 26 18:25:36 1998 Jonathan Larmour + + * src/test/philo.cxx: + Rename CYG_DEBUG ifdef to CYG_RELEASE_DEBUG + +Wed Mar 25 23:23:39 GMT 1998 Chris Provenzano + + * configure.in: Fix so non_arch.h is updated even if + config.cache does exists. + + * include/kapi.h, include/kapidata.h, include/kernel.hxx + * include/mboxt.inl, include/sched.hxx: + #include instead of include + + * include/eccconf/kernel.h: Added. This was old devo/config.h + + * src/Makefile.am : Set CYG_CONFIGURATION to "" + + * src/test/Makefile.am : Build .gdbinit from gdbinit.in + and tree from tree.in + +Wed Mar 25 18:24:48 1998 Jonathan Larmour + + * src/Makefile.am, src/common/memcpy.c, src/common/memset.c: + Move memcpy and memset functions from C library into kernel to + satisfy the requirements of gcc - namely it must be available at + at all time. Changed memcpy and memset to sit more cleanly in the + kernel, and lose all dependencies on the C library + * src/Makefile.in: regenerated + +Fri Mar 13 18:36:42 GMT 1998 Chris Provenzano + + * configure.in : Add rule to get correct objcopy for target + * src/test/Makefile.am : Add rule to build philo.srec + +Fri Mar 13 11:47:23 GMT 1998 Chris Provenzano + + * configure.in, non_arch.h.in, non_arch.sh + Add support for the mn103000 + +Thu Mar 12 11:38:28 GMT 1998 David Moore + + * src/Makefile.am: + Removed flag to leave comments in generated linker script. + +Thu Mar 12 10:55:20 GMT 1998 David Moore + + * configure.in: + Fixed setting of platform variable + +Wed Mar 11 16:54:28 GMT 1998 Chris Provenzano + + * src/test/Makefile.am, tests/Makefile.am: + Make sure CXXFLAGS from configure are also used + +Wed Mar 11 16:16:57 GMT 1998 Chris Provenzano + + * configure.in, non_arch.h.in. non_arch.sh: + Added build support for mips + * tests/Makefile.am, src/test/Makefile.am + Link with -nostdlib -lgcc + +Wed Mar 11 14:43:36 GMT 1998 Chris Provenzano + + * Makefile.am, configure.in, tests/Makefile.am + support building tests in the tests directory + +Wed Mar 11 13:18:17 GMT 1998 Chris Provenzano + + * acinclude.m4, stamp-h.in, non_arch.h.in, src/Makefile.am: + Added to support new kernel configure/make process + + * Makefile.am: Modified to support new kernel configure/make + process. + + * src/acinclude.m4, src/aclocal.m4, src/configure, src/configure.in + Deleted to support new kernel configure/make process + + * Makefile.in, configure, aclocal.m4, src/Makefile.in, + src/configure: regenerated + + * non_arch.sh: New shellscript to change platform/startup/debug + options after a configure is done. + + * src/devo/config.h: include non_arch.h, for platform/startup/debug + options. This is generated at configure and modified by non_arch.sh + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/kernel/current/include/bitmap.hxx b/packages/kernel/current/include/bitmap.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/bitmap.hxx @@ -0,0 +1,185 @@ +#ifndef CYGONCE_KERNEL_BITMAP_HXX +#define CYGONCE_KERNEL_BITMAP_HXX + +//========================================================================== +// +// bitmap.hxx +// +// Bitmap scheduler class declaration(s) +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-10 +// Purpose: Define bitmap scheduler implementation +// Description: The classes defined here are used as base classes +// by the common classes that define schedulers and thread +// things. +// Usage: Included according to configuration by +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +// ------------------------------------------------------------------------- +// The macro CYGNUM_KERNEL_SCHED_BITMAP_SIZE contains the number of bits +// that the scheduler bitmap should contain. It is derived from the number +// of threads that the system is allowed to use during configuration. + +#ifndef CYGNUM_KERNEL_SCHED_BITMAP_SIZE +#define CYGNUM_KERNEL_SCHED_BITMAP_SIZE 32 +#endif + +#if CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 8 +typedef cyg_ucount8 cyg_sched_bitmap; +#elif CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 16 +typedef cyg_ucount16 cyg_sched_bitmap; +#elif CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 32 +typedef cyg_ucount32 cyg_sched_bitmap; +#else +#error Bitmaps greater than 32 bits not currently allowed +#endif + +// ------------------------------------------------------------------------- +// Customize the scheduler + +#define CYGIMP_THREAD_PRIORITY 1 +#define CYG_SCHED_UNIQUE_PRIORITIES 1 + +#define CYG_THREAD_MIN_PRIORITY (CYGNUM_KERNEL_SCHED_BITMAP_SIZE-1) +#define CYG_THREAD_MAX_PRIORITY 0 + +// set default scheduling info value for thread constructors. +#define CYG_SCHED_DEFAULT_INFO CYG_THREAD_MAX_PRIORITY + +// ------------------------------------------------------------------------- +// This class contains the implementation details of the scheduler, and +// provides a standard API for accessing it. + +class Cyg_Scheduler_Implementation + : public Cyg_Scheduler_Base +{ + friend class Cyg_ThreadQueue_Implementation; + friend class Cyg_SchedThread_Implementation; + + cyg_sched_bitmap run_queue; + + Cyg_Thread *thread_table[CYGNUM_KERNEL_SCHED_BITMAP_SIZE]; + + +protected: + + Cyg_Scheduler_Implementation(); // Constructor + + // The following functions provide the scheduler implementation + // interface to the Cyg_Scheduler class. These are protected + // so that only the scheduler can call them. + + // choose a new thread + Cyg_Thread *schedule(); + + // make thread schedulable + void add_thread(Cyg_Thread *thread); + + // make thread un-schedulable + void rem_thread(Cyg_Thread *thread); + + // register thread with scheduler + void register_thread(Cyg_Thread *thread); + + // deregister thread + void deregister_thread(Cyg_Thread *thread); + + // Test the given priority for uniqueness + cyg_bool unique( cyg_priority priority); + +}; + +// ------------------------------------------------------------------------- +// Scheduler thread implementation. +// This class provides the implementation of the scheduler specific parts +// of each thread. + +class Cyg_SchedThread_Implementation +{ + friend class Cyg_Scheduler_Implementation; + friend class Cyg_ThreadQueue_Implementation; + +protected: + + cyg_priority priority; // current thread priority + + Cyg_SchedThread_Implementation(CYG_ADDRWORD sched_info); + + void yield(); // Yield CPU to next thread + +}; + +// ------------------------------------------------------------------------- +// Thread queue implementation. +// This class provides the (scheduler specific) implementation of the +// thread queue class. + +class Cyg_ThreadQueue_Implementation +{ + cyg_sched_bitmap wait_queue; + +protected: + + // API used by Cyg_ThreadQueue + + Cyg_ThreadQueue_Implementation(); // Constructor + + // Add thread to queue + void enqueue(Cyg_Thread *thread); + + // return first thread on queue + Cyg_Thread *highpri(); + + // remove first thread on queue + Cyg_Thread *dequeue(); + + // remove specified thread from queue + void remove(Cyg_Thread *thread); + + // test if queue is empty + cyg_bool empty(); + +}; + +inline cyg_bool Cyg_ThreadQueue_Implementation::empty() +{ + return wait_queue == 0; +} + +// ------------------------------------------------------------------------- + +#endif // ifndef CYGONCE_KERNEL_BITMAP_HXX +// EOF bitmap.hxx diff --git a/packages/kernel/current/include/clock.hxx b/packages/kernel/current/include/clock.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/clock.hxx @@ -0,0 +1,220 @@ +#ifndef CYGONCE_KERNEL_CLOCK_HXX +#define CYGONCE_KERNEL_CLOCK_HXX + +//========================================================================== +// +// clock.hxx +// +// Clock and Alarm class declaration(s) +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Define Clock and Alarm class interfaces +// Description: The classes defined here collectively implement the +// internal API used to create, configure and manage Counters, +// Clocks and Alarms. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros + +// ------------------------------------------------------------------------- + +class Cyg_Alarm; + +typedef void cyg_alarm_fn(Cyg_Alarm *alarm, CYG_ADDRWORD data); + +// ------------------------------------------------------------------------- +// Counter object. + +class Cyg_Counter +{ + + friend class Cyg_Alarm; + +#if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) + + Cyg_Alarm *alarm_list; // Linear list of Alarms + +#elif defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) + + Cyg_Alarm *alarm_list[CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE]; + +#endif + + cyg_tick_count counter; // counter value + + cyg_uint32 increment; // increment per tick + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Counter( + cyg_uint32 increment = 1 + ); + + ~Cyg_Counter(); + + // Return current value of counter + cyg_tick_count current_value(); + + // Return low and high halves of the + // counter value. + cyg_uint32 current_value_lo(); + cyg_uint32 current_value_hi(); + + // Set the counter's current value + void set_value( cyg_tick_count new_value); + + // Advance counter by some number of ticks + void tick( cyg_uint32 ticks = 1); + + // Add an alarm to this counter + void add_alarm( Cyg_Alarm *alarm ); + + // Remove an alarm from this counter + void rem_alarm( Cyg_Alarm *alarm ); + +}; + +// ------------------------------------------------------------------------- +// Clock class. This is derived from a Counter and defines extra +// features to support clock-like behaviour. + +class Cyg_Clock + : public Cyg_Counter +{ + +public: + + CYGDBG_DEFINE_CHECK_THIS + + // This structure allows a more accurate representation + // of the resolution than a single integer would allow. + // The resolution is defined as dividend/divisor nanoseconds + // per tick. + struct cyg_resolution { + cyg_uint32 dividend; + cyg_uint32 divisor; + }; + +private: + + cyg_resolution resolution; // Current clock resolution + +public: + + Cyg_Clock( // Create clock with given resolution + cyg_resolution resolution + ); + + ~Cyg_Clock(); // Destructor + + cyg_resolution get_resolution(); // Return current resolution + + void set_resolution( // Set new resolution + cyg_resolution resolution + ); + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK + + // There is a system supplied real time clock... + + static Cyg_Clock *real_time_clock; + +#endif + +}; + +// ------------------------------------------------------------------------- +// Alarm class. An alarm may be attached to a counter (or a clock) to be +// called when the trigger value is reached. + +class Cyg_Alarm +{ + friend class Cyg_Counter; + +#if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) || defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) + + Cyg_Alarm *next; // next alarm in list + +#endif + +protected: + Cyg_Counter *counter; // Attached to this counter/clock + + cyg_alarm_fn *alarm; // Call-back function + + CYG_ADDRWORD data; // Call-back data + + cyg_tick_count trigger; // Absolute trigger time + + cyg_tick_count interval; // Retrigger interval + + cyg_bool enabled; // True if enabled + + Cyg_Alarm(); + + void synchronize( void ); // deal with times in the past, + // make next alarm in synch. + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Alarm // Constructor + ( + Cyg_Counter *counter, // Attached to this counter + cyg_alarm_fn *alarm, // Call-back function + CYG_ADDRWORD data // Call-back data + ); + + ~Cyg_Alarm(); // Destructor + + void initialize( // Initialize Alarm + cyg_tick_count trigger, // Absolute trigger time + cyg_tick_count interval = 0 // Relative retrigger interval + ); + + void enable(); // Ensure alarm enabled + + void disable(); // Ensure alarm disabled + + +}; + +// ------------------------------------------------------------------------- + +#endif // ifndef CYGONCE_KERNEL_CLOCK_HXX +// EOF clock.hxx diff --git a/packages/kernel/current/include/clock.inl b/packages/kernel/current/include/clock.inl new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/clock.inl @@ -0,0 +1,107 @@ +#ifndef CYGONCE_KERNEL_CLOCK_INL +#define CYGONCE_KERNEL_CLOCK_INL + +//========================================================================== +// +// clock.inl +// +// Clock and Alarm class inlines +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-30 +// Purpose: Define Clock and Alarm class inlines +// Description: Define inline functions for counter, clock and alarm +// classes. +// Usage: #include +// #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- +// Counter class inlines + +// Return current value of counter +inline cyg_tick_count Cyg_Counter::current_value() +{ + return counter; +} + +inline cyg_uint32 Cyg_Counter::current_value_lo() +{ + return counter&0xFFFFFFFF; +} + +inline cyg_uint32 Cyg_Counter::current_value_hi() +{ + return (counter>>32)&0xFFFFFFFF; +} + +// Set the counter's current value +inline void Cyg_Counter::set_value( cyg_tick_count new_value) +{ + counter = new_value; +} + +// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- +// Clock class inlines + +// Return current resolution +inline Cyg_Clock::cyg_resolution Cyg_Clock::get_resolution() +{ + return resolution; +} + +// Set new resolution +inline void Cyg_Clock::set_resolution( + Cyg_Clock::cyg_resolution new_resolution + ) +{ + resolution = new_resolution; +} + +// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- +// Alarm inlines + +// Ensure alarm disabled +inline void Cyg_Alarm::disable() +{ + if( enabled ) counter->rem_alarm(this); +} + + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_CLOCK_INL +// EOF clock.inl diff --git a/packages/kernel/current/include/diag.h b/packages/kernel/current/include/diag.h new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/diag.h @@ -0,0 +1,55 @@ +#ifndef CYGONCE_KERNEL_DIAG_H +#define CYGONCE_KERNEL_DIAG_H + +/*============================================================================= +// +// diag.h +// +// Diagnostic Routines for Kernel Development +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: Diagnostic Routines for Kernel Development +// Description: Diagnostic routines for use during kernel development. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//==========================================================================*/ + +// These have now migrated to here: + +#include + +// this file is retained for the kernel to add to the functionality +// in the knowledge that there _is_ a kernel. + +/*---------------------------------------------------------------------------*/ +#endif /* CYGONCE_KERNEL_DIAG_H */ +/* EOF diag.h */ diff --git a/packages/kernel/current/include/errors.h b/packages/kernel/current/include/errors.h new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/errors.h @@ -0,0 +1,72 @@ +#ifndef CYGONCE_KERNEL_ERRORS_H +#define CYGONCE_KERNEL_ERRORS_H + +//========================================================================== +// +// errors.h +// +// Error values from kernel +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-10-07 +// Purpose: Define error codes +// Description: Error codes returned by various bits of the kernel. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +// General successful result: + +#define CYGERR_OK 0 + +// ------------------------------------------------------------------------- +// Define base of codes: + +#define CYGERR_KERNEL_BASE 0xEE000000 + +// ------------------------------------------------------------------------- +// Thread related errors + +#define CYGERR_KERNEL_THREAD_BASE (CYGERR_KERNEL_BASE+0x00010000) + +#define CYGERR_KERNEL_THREAD_PRIORITY_INVALID (CYGERR_KERNEL_THREAD_BASE+1) +#define CYGERR_KERNEL_THREAD_PRIORITY_DUPLICATE (CYGERR_KERNEL_THREAD_BASE+2) + +// ------------------------------------------------------------------------- +// Interrupt related errors + +#define CYGERR_KERNEL_INTR_BASE (CYGERR_KERNEL_BASE+0x00020000) + +#define CYGERR_KERNEL_INTR_VECTOR_INVALID (CYGERR_KERNEL_INTR_BASE+1) + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_ERRORS_H +// EOF errors.h diff --git a/packages/kernel/current/include/except.hxx b/packages/kernel/current/include/except.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/except.hxx @@ -0,0 +1,117 @@ +#ifndef CYGONCE_KERNEL_EXCEPT_HXX +#define CYGONCE_KERNEL_EXCEPT_HXX + +//========================================================================== +// +// except.hxx +// +// Exception handling declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-04-09 +// Purpose: Define exception interfaces +// Description: The classes defined here collectively implement the +// internal API used to register, manage and deliver +// exceptions. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include // exception defines + +// ------------------------------------------------------------------------- +// Exception handler function prototype + +typedef void cyg_exception_handler( + CYG_ADDRWORD data, // user supplied data + cyg_code exception_number, // exception being raised + CYG_ADDRWORD exception_info // any exception specific info + ); + +// ------------------------------------------------------------------------- +// Exception delivery interface. This function is exported to the HAL which +// invokes it for all exceptions that it is not able to handle itself. + +externC void deliver_exception( CYG_WORD code, CYG_ADDRWORD data ); + +// ------------------------------------------------------------------------- +// Exception control class. Depending on the configuration there is either +// one of these per thread, or one for the entire system. + +#ifdef CYGPKG_KERNEL_EXCEPTIONS + +class Cyg_Exception_Control +{ + +#ifdef CYGSEM_KERNEL_EXCEPTIONS_DECODE + cyg_exception_handler *exception_handler[CYG_EXCEPTION_COUNT]; + + CYG_ADDRWORD exception_data[CYG_EXCEPTION_COUNT]; +#else + cyg_exception_handler *exception_handler; // Handler function + + CYG_ADDRWORD exception_data; // Handler data +#endif + +public: + + Cyg_Exception_Control(); + + // Register an exception handler for either the specific exception + // or for all exceptions. + void register_exception( + cyg_code exception_number, // exception number + cyg_exception_handler handler, // handler function + CYG_ADDRWORD data, // data argument + cyg_exception_handler **old_handler, // handler function + CYG_ADDRWORD *old_data // data argument + ); + + // Remove an exception handler. + void deregister_exception( + cyg_code exception_number // exception number + ); + + // Deliver the given exception now by invoking the appropriate + // exception handler. + void deliver_exception( + cyg_code exception_number, // exception being raised + CYG_ADDRWORD exception_info // exception specific info + ); +}; + +#endif + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_EXCEPT_HXX +// EOF except.hxx diff --git a/packages/kernel/current/include/flag.hxx b/packages/kernel/current/include/flag.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/flag.hxx @@ -0,0 +1,155 @@ +#ifndef CYGONCE_KERNEL_FLAG_HXX +#define CYGONCE_KERNEL_FLAG_HXX + +//========================================================================== +// +// flag.hxx +// +// Flag object class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Define Flag class interfaces +// Description: The classes defined here provide the APIs for flags. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include // Cyg_Thread + +// ------------------------------------------------------------------------- + +// Flag object. This class implements a queue of threads waiting for a +// boolean expression of the flag value (an integer) to become true; all +// relevant threads are awoken, not just the first. A variant on this is +// the single-bit flag, which is implemented by means of default arguments. + +#ifdef CYGIMP_FLAGS_16BIT +typedef cyg_uint16 Cyg_FlagValue; +#define CYG_FLAGS_SIZE 16 +#endif +#ifdef CYGIMP_FLAGS_32BIT +typedef cyg_uint32 Cyg_FlagValue; +#define CYG_FLAGS_SIZE 32 +#endif +#ifdef CYGIMP_FLAGS_64BIT +typedef cyg_uint64 Cyg_FlagValue; +#define CYG_FLAGS_SIZE 64 +#endif + +#ifndef CYG_FLAGS_SIZE +typedef cyg_uint32 Cyg_FlagValue; +#define CYG_FLAGS_SIZE 32 +#endif + + + +class Cyg_Flag +{ +private: + Cyg_FlagValue value; + + class FlagWaitInfo + { + public: + Cyg_FlagValue allmask; // these are separate words to + Cyg_FlagValue anymask; // save time in wakeup. + Cyg_FlagValue value_out; // return the value that satisfied + cyg_bool do_clear; + + FlagWaitInfo() { value_out = 0; } + }; + + Cyg_ThreadQueue queue; // Queue of waiting threads + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Flag( Cyg_FlagValue init = 0 ); // Constructor + ~Cyg_Flag(); // Destructor + + void + setbits( Cyg_FlagValue arg = ~0 ); // -OR- the arg in + // not inlined; this function awakens affected threads. + + void + maskbits( Cyg_FlagValue arg = 0 ); // -AND- it in + // this is not inlined because it needs to lock the scheduler; + // it only really does value &= arg; nobody can be awoken in consequence. + + typedef cyg_uint8 WaitMode; + // These values are chosen to map directly to uITRON for emulation + // purposes: + static const WaitMode AND = 0; // all specified bits must be set + static const WaitMode OR = 2; // any specified bit must be set + static const WaitMode CLR = 1; // clear value when satisfied + static const WaitMode MASK= 3; // might be useful + + // Wait for a match on our pattern, according to the flags given. + // Return the matching value, or zero if interrupted. + Cyg_FlagValue + wait( Cyg_FlagValue pattern, WaitMode mode ); + + // Wait for a match on our pattern, with an absolute timeout. + // Return the matching value, or zero if timed out/interrupted. + // (zero cannot match any pattern). +#ifdef CYGFUN_KERNEL_THREADS_TIMER + Cyg_FlagValue + wait( Cyg_FlagValue pattern, WaitMode mode, + cyg_tick_count abs_timeout ); +#endif + // Test for a match on our pattern, according to the flags given. + // Return the matching value if success, else zero. + Cyg_FlagValue + poll( Cyg_FlagValue pattern, WaitMode mode ); + + inline Cyg_FlagValue + peek() // Get current value + { + return value; // NOT atomic wrt threads + } + + inline cyg_bool + waiting() // Any threads waiting? + { + return !queue.empty(); + } +}; + + + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_FLAG_HXX +// EOF flag.hxx diff --git a/packages/kernel/current/include/instrmnt.h b/packages/kernel/current/include/instrmnt.h new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/instrmnt.h @@ -0,0 +1,381 @@ +#ifndef CYGONCE_KERNEL_INSTRMNT_HXX +#define CYGONCE_KERNEL_INSTRMNT_HXX + +//========================================================================== +// +// instrmnt.hxx +// +// Kernel Instrumentation mechanism +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-10-24 +// Purpose: Define kernel instrumentation +// Description: A set of definitions and macros used to implement an +// instrumentation interface for the kernel. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros + +// ------------------------------------------------------------------------- +// Underlying instrumentation function + +externC void cyg_instrument( cyg_uint32 type, CYG_ADDRWORD arg1, CYG_ADDRWORD arg2 ); + +// ------------------------------------------------------------------------- +// The following functions are used to enable and disable specific +// instrumentation classes and events. The class must be one of the +// class defines below. The event may be one of the event defines below +// or zero, in which case all of the events in the class are enabled or +// disabled. + +#ifdef CYGDBG_KERNEL_INSTRUMENT_FLAGS + +externC void cyg_instrument_enable( cyg_uint32 cl, cyg_uint32 event ); + +externC void cyg_instrument_disable( cyg_uint32 cl, cyg_uint32 event ); + +#endif + +// ------------------------------------------------------------------------- +// Instrumentation macros + +#ifdef CYGPKG_KERNEL_INSTRUMENT + +#define CYG_INSTRUMENT(_type_,_arg1_,_arg2_) cyg_instrument(_type_, CYG_ADDRWORD(_arg1_), CYG_ADDRWORD(_arg2_)) + +#else // ifdef CYGPKG_KERNEL_INSTRUMENT + +#define CYG_INSTRUMENT(_type_,_arg1_,_arg2_) + +#endif // ifdef CYGPKG_KERNEL_INSTRUMENT + +// ------------------------------------------------------------------------- +// Type codes. +// Each code is 16 bit with an event class in the top 8 bits +// and an event code in the lower 8 bits. + +// Event classes +#define CYG_INSTRUMENT_CLASS_SCHED 0x0100 +#define CYG_INSTRUMENT_CLASS_THREAD 0x0200 +#define CYG_INSTRUMENT_CLASS_INTR 0x0300 +#define CYG_INSTRUMENT_CLASS_MUTEX 0x0400 +#define CYG_INSTRUMENT_CLASS_CONDVAR 0x0500 +#define CYG_INSTRUMENT_CLASS_BINSEM 0x0600 +#define CYG_INSTRUMENT_CLASS_CNTSEM 0x0700 +#define CYG_INSTRUMENT_CLASS_CLOCK 0x0800 +#define CYG_INSTRUMENT_CLASS_ALARM 0x0900 +#define CYG_INSTRUMENT_CLASS_MBOXT 0x0a00 + +#define CYG_INSTRUMENT_CLASS_USER 0x0f00 + +#define CYG_INSTRUMENT_CLASS_MAX CYG_INSTRUMENT_CLASS_USER + +// Scheduler events +#define CYG_INSTRUMENT_EVENT_SCHED_LOCK 1 +#define CYG_INSTRUMENT_EVENT_SCHED_UNLOCK 2 +#define CYG_INSTRUMENT_EVENT_SCHED_RESCHEDULE 3 +#define CYG_INSTRUMENT_EVENT_SCHED_TIMESLICE 4 + +// Thread events +#define CYG_INSTRUMENT_EVENT_THREAD_SWITCH 1 +#define CYG_INSTRUMENT_EVENT_THREAD_SLEEP 2 +#define CYG_INSTRUMENT_EVENT_THREAD_WAKE 3 +#define CYG_INSTRUMENT_EVENT_THREAD_SUSPEND 4 +#define CYG_INSTRUMENT_EVENT_THREAD_RESUME 5 +#define CYG_INSTRUMENT_EVENT_THREAD_PRIORITY 6 +#define CYG_INSTRUMENT_EVENT_THREAD_DELAY 7 +#define CYG_INSTRUMENT_EVENT_THREAD_ALARM 8 + +// Interrupt events +#define CYG_INSTRUMENT_EVENT_INTR_RAISE 1 +#define CYG_INSTRUMENT_EVENT_INTR_END 2 +#define CYG_INSTRUMENT_EVENT_INTR_RESTORE 3 +#define CYG_INSTRUMENT_EVENT_INTR_POST_DSR 4 +#define CYG_INSTRUMENT_EVENT_INTR_CALL_DSR 5 +#define CYG_INSTRUMENT_EVENT_INTR_ATTACH 6 +#define CYG_INSTRUMENT_EVENT_INTR_DETACH 7 +#define CYG_INSTRUMENT_EVENT_INTR_SET_VSR 8 +#define CYG_INSTRUMENT_EVENT_INTR_DISABLE 9 +#define CYG_INSTRUMENT_EVENT_INTR_ENABLE 10 +#define CYG_INSTRUMENT_EVENT_INTR_MASK 11 +#define CYG_INSTRUMENT_EVENT_INTR_UNMASK 12 +#define CYG_INSTRUMENT_EVENT_INTR_CONFIGURE 13 +#define CYG_INSTRUMENT_EVENT_INTR_ACK 14 +#define CYG_INSTRUMENT_EVENT_INTR_CHAIN_ISR 15 + +// Mutex events +#define CYG_INSTRUMENT_EVENT_MUTEX_LOCK 1 +#define CYG_INSTRUMENT_EVENT_MUTEX_WAIT 2 +#define CYG_INSTRUMENT_EVENT_MUTEX_LOCKED 3 +#define CYG_INSTRUMENT_EVENT_MUTEX_TRY 4 +#define CYG_INSTRUMENT_EVENT_MUTEX_UNLOCK 5 +#define CYG_INSTRUMENT_EVENT_MUTEX_WAKE 6 + +// Condition variable events +#define CYG_INSTRUMENT_EVENT_CONDVAR_WAIT 1 +#define CYG_INSTRUMENT_EVENT_CONDVAR_WOKE 2 +#define CYG_INSTRUMENT_EVENT_CONDVAR_SIGNAL 3 +#define CYG_INSTRUMENT_EVENT_CONDVAR_WAKE 4 +#define CYG_INSTRUMENT_EVENT_CONDVAR_BROADCAST 5 +#define CYG_INSTRUMENT_EVENT_CONDVAR_TIMED_WAIT 6 + +// Binary semaphore events +#define CYG_INSTRUMENT_EVENT_BINSEM_CLAIM 1 +#define CYG_INSTRUMENT_EVENT_BINSEM_WAIT 2 +#define CYG_INSTRUMENT_EVENT_BINSEM_WOKE 3 +#define CYG_INSTRUMENT_EVENT_BINSEM_TRY 4 +#define CYG_INSTRUMENT_EVENT_BINSEM_POST 5 +#define CYG_INSTRUMENT_EVENT_BINSEM_WAKE 6 + +// Counting semaphore events +#define CYG_INSTRUMENT_EVENT_CNTSEM_CLAIM 1 +#define CYG_INSTRUMENT_EVENT_CNTSEM_WAIT 2 +#define CYG_INSTRUMENT_EVENT_CNTSEM_WOKE 3 +#define CYG_INSTRUMENT_EVENT_CNTSEM_TRY 4 +#define CYG_INSTRUMENT_EVENT_CNTSEM_POST 5 +#define CYG_INSTRUMENT_EVENT_CNTSEM_WAKE 6 +#define CYG_INSTRUMENT_EVENT_CNTSEM_TIMEOUT 7 + +// Clock events +#define CYG_INSTRUMENT_EVENT_CLOCK_TICK_START 1 +#define CYG_INSTRUMENT_EVENT_CLOCK_TICK_END 2 +#define CYG_INSTRUMENT_EVENT_CLOCK_ISR 3 + +// Alarm events +#define CYG_INSTRUMENT_EVENT_ALARM_ADD 1 +#define CYG_INSTRUMENT_EVENT_ALARM_REM 2 +#define CYG_INSTRUMENT_EVENT_ALARM_CALL 3 +#define CYG_INSTRUMENT_EVENT_ALARM_INIT 4 +#define CYG_INSTRUMENT_EVENT_ALARM_TRIGGER 5 +#define CYG_INSTRUMENT_EVENT_ALARM_INTERVAL 6 + +// Mboxt events +#define CYG_INSTRUMENT_EVENT_MBOXT_WAIT 1 +#define CYG_INSTRUMENT_EVENT_MBOXT_GET 2 +#define CYG_INSTRUMENT_EVENT_MBOXT_GOT 3 +#define CYG_INSTRUMENT_EVENT_MBOXT_TIMEOUT 4 +#define CYG_INSTRUMENT_EVENT_MBOXT_WAKE 5 +#define CYG_INSTRUMENT_EVENT_MBOXT_TRY 6 +#define CYG_INSTRUMENT_EVENT_MBOXT_PUT 7 + + + +// User events + +#define CYG_INSTRUMENT_EVENT_USER_1 1 +#define CYG_INSTRUMENT_EVENT_USER_2 2 +#define CYG_INSTRUMENT_EVENT_USER_3 3 +#define CYG_INSTRUMENT_EVENT_USER_4 4 +#define CYG_INSTRUMENT_EVENT_USER_5 5 +#define CYG_INSTRUMENT_EVENT_USER_6 6 +#define CYG_INSTRUMENT_EVENT_USER_7 7 +#define CYG_INSTRUMENT_EVENT_USER_8 8 +#define CYG_INSTRUMENT_EVENT_USER_9 9 +#define CYG_INSTRUMENT_EVENT_USER_10 10 +#define CYG_INSTRUMENT_EVENT_USER_11 11 +#define CYG_INSTRUMENT_EVENT_USER_12 12 +#define CYG_INSTRUMENT_EVENT_USER_13 13 +#define CYG_INSTRUMENT_EVENT_USER_14 14 +#define CYG_INSTRUMENT_EVENT_USER_15 15 +#define CYG_INSTRUMENT_EVENT_USER_16 16 +#define CYG_INSTRUMENT_EVENT_USER_17 17 +#define CYG_INSTRUMENT_EVENT_USER_18 18 +#define CYG_INSTRUMENT_EVENT_USER_19 19 + +// ------------------------------------------------------------------------- +// Handy-dandy macro to make event codes. +// Note that this relies on the definitions above +// having a well defined form. + +#define CYGINST_EVENT(_class_,_event_) \ +((CYG_INSTRUMENT_CLASS_##_class_)|(CYG_INSTRUMENT_EVENT_##_class_##_##_event_)) + +// ------------------------------------------------------------------------- +// Scheduler instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_SCHED + +#define CYG_INSTRUMENT_SCHED(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(SCHED,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_SCHED(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// Thread instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_THREAD + +#define CYG_INSTRUMENT_THREAD(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(THREAD,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_THREAD(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// Interrupt instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_INTR + +#define CYG_INSTRUMENT_INTR(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(INTR,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_INTR(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// Mutex instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_MUTEX + +#define CYG_INSTRUMENT_MUTEX(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(MUTEX,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_MUTEX(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// Condition variable instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_CONDVAR + +#define CYG_INSTRUMENT_CONDVAR(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(CONDVAR,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_CONDVAR(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// Binary semaphore instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_BINSEM + +#define CYG_INSTRUMENT_BINSEM(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(BINSEM,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_BINSEM(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// Counting semaphore instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_CNTSEM + +#define CYG_INSTRUMENT_CNTSEM(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(CNTSEM,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_CNTSEM(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// Clock instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_CLOCK + +#define CYG_INSTRUMENT_CLOCK(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(CLOCK,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_CLOCK(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// Alarm instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_ALARM + +#define CYG_INSTRUMENT_ALARM(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(ALARM,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_ALARM(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// Mboxt instrumentation macros + +#ifdef CYGDBG_KERNEL_INSTRUMENT_MBOXT + +#define CYG_INSTRUMENT_MBOXT(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(MBOXT,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_MBOXT(_event_,_arg1_,_arg2_) + +#endif + +// ------------------------------------------------------------------------- +// User instrumentation + +#ifdef CYGDBG_KERNEL_INSTRUMENT_USER + +#define CYG_INSTRUMENT_USER(_event_,_arg1_,_arg2_) \ + CYG_INSTRUMENT(CYGINST_EVENT(USER,_event_),_arg1_,_arg2_) + +#else + +#define CYG_INSTRUMENT_USER(_event_,_arg1_,_arg2_) + +#endif + + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_INSTRMNT_HXX +// EOF instrmnt.hxx diff --git a/packages/kernel/current/include/intr.hxx b/packages/kernel/current/include/intr.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/intr.hxx @@ -0,0 +1,276 @@ +#ifndef CYGONCE_KERNEL_INTR_HXX +#define CYGONCE_KERNEL_INTR_HXX + +//========================================================================== +// +// intr.hxx +// +// Interrupt class declaration(s) +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Define Interrupt class interfaces +// Description: The classes defined here provide the APIs for handling +// interrupts. +// Usage: #include "intr.hxx" +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +// ------------------------------------------------------------------------- +// Function prototype typedefs + + +// VSR = Vector Service Routine. This is the code attached directly to an +// interrupt vector. It is very architecture/platform specific and usually +// must be written in assembler. + +typedef void cyg_VSR(); + +// ISR = Interrupt Service Routine. This is called from the default +// VSR in response to an interrupt. It may access shared data but may +// not call kernel routines. The return value may be +// Cyg_Interrupt::HANDLED and/or Cyg_Interrupt::CALL_DSR. + +typedef cyg_uint32 cyg_ISR(cyg_vector vector, CYG_ADDRWORD data); + +// DSR = Deferred Service Routine. This is called if the ISR returns +// the Cyg_Interrupt::CALL_DSR bit. It is called at a "safe" point in +// the kernel where it may make calls on kernel routines. The count +// argument indicates how many times the ISR has asked for the DSR to +// be posted since the last time the DSR ran. + +typedef void cyg_DSR(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data); + +// ------------------------------------------------------------------------- +// Include HAL definitions + +class Cyg_Interrupt; + +#include + +#include + +externC void interrupt_end( + cyg_uint32 isr_ret, + Cyg_Interrupt *intr, + HAL_SavedRegisters *ctx + ); + +// ------------------------------------------------------------------------- +// Interrupt class. This both represents each interrupt and provides a static +// interface for controlling the interrupt hardware. + +class Cyg_Interrupt +{ + + friend class Cyg_Scheduler; + friend void interrupt_end( cyg_uint32, + Cyg_Interrupt *, + HAL_SavedRegisters *); + + cyg_vector vector; // Interrupt vector + + cyg_priority priority; // Queuing priority + + cyg_ISR *isr; // Pointer to ISR + + cyg_DSR *dsr; // Pointer to DSR + + CYG_ADDRWORD data; // Data pointer + + + + // DSR handling interface called by the scheduler + + // Check for pending DSRs + static cyg_bool DSRs_pending(); + + // Call any pending DSRs + static void call_pending_DSRs(); + + void post_dsr(); // Post the DSR for this interrupt + + // Data structures for handling DSR calls. We implement two DSR + // handling mechanisms, a list based one and a table based + // one. The list based mechanism is safe with respect to temporary + // overloads and will not run out of resource. However it requires + // extra data per interrupt object, and interrupts must be turned + // off briefly when delivering the DSR. The table based mechanism + // does not need unnecessary interrupt switching, but may be prone + // to overflow on overload. However, since a correctly programmed + // real time application should not experience such a condition, + // the table based mechanism is more efficient for real use. The + // list based mechainsm is enabled by default since it is safer to + // use during development. + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE + + static Cyg_Interrupt *dsr_table[CYGNUM_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE]; + + static cyg_ucount32 dsr_table_head; + + static cyg_ucount32 dsr_table_tail; + +#endif +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST + + cyg_ucount32 dsr_count; // Number of DSR posts made + + Cyg_Interrupt *next_dsr; // next DSR in list + + static Cyg_Interrupt *dsr_list; // static list of pending DSRs + +#endif + +#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN + + // The default mechanism for handling interrupts is to attach just + // one Interrupt object to each vector. In some cases, and on some + // hardware, this is not possible, and each vector must carry a chain + // of interrupts. + + Cyg_Interrupt *next; // Next Interrupt in list + + // Chaining ISR inserted in HAL vector + static cyg_uint32 chain_isr(cyg_vector vector, CYG_ADDRWORD data); + + // Table of interrupt chains + static Cyg_Interrupt *chain_list[CYG_ISR_COUNT]; + +#endif + +public: + + Cyg_Interrupt // Initialize interrupt + ( + cyg_vector vector, // Vector to attach to + cyg_priority priority, // Queue priority + CYG_ADDRWORD data, // Data pointer + cyg_ISR *isr, // Interrupt Service Routine + cyg_DSR *dsr // Deferred Service Routine + ); + + ~Cyg_Interrupt(); + + // ISR return values + enum { + HANDLED = 1, // Interrupt was handled + CALL_DSR = 2 // Schedule DSR + }; + + // Interrupt management + + void attach(); // Attach to vector + + + void detach(); // Detach from vector + + + // Static Interrupt management functions + + // Get the current service routine + static void get_vsr(cyg_vector vector, cyg_VSR **vsr); + + // Install a vector service routine + static void set_vsr( + cyg_vector vector, // hardware vector to replace + cyg_VSR *vsr, // my new service routine + cyg_VSR **old = NULL // pointer to old vsr, if required + ); + + + // Static interrupt masking functions + + // Disable interrupts at the CPU + static void disable_interrupts(); + + // Re-enable CPU interrupts + static void enable_interrupts(); + + // Are interrupts enabled at the CPU? + static inline cyg_bool interrupts_enabled() + { + CYG_WORD result; // needs to be register sized + HAL_QUERY_INTERRUPTS( result ); + return (0 != result); + } + + // Get the vector for the following calls + inline cyg_vector get_vector() + { + return vector; + } + + // Static PIC control functions + + // Mask a specific interrupt in a PIC + static void mask_interrupt(cyg_vector vector); + + // Clear PIC mask + static void unmask_interrupt(cyg_vector vector); + + // Acknowledge interrupt at PIC + static void acknowledge_interrupt(cyg_vector vector); + + // Change interrupt detection at PIC + static void configure_interrupt( + cyg_vector vector, // vector to control + cyg_bool level, // level or edge triggered + cyg_bool up // hi/lo level, rising/falling edge + ); + +}; + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS +// ------------------------------------------------------------------------- +// Check for pending DSRs + +inline cyg_bool Cyg_Interrupt::DSRs_pending() +{ +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE + + return dsr_table_head != dsr_table_tail; + +#endif +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST + + return dsr_list != NULL; + +#endif +}; +#endif // CYGIMP_KERNEL_INTERRUPTS_DSRS + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_INTR_HXX +// EOF intr.hxx diff --git a/packages/kernel/current/include/kapi.h b/packages/kernel/current/include/kapi.h new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/kapi.h @@ -0,0 +1,606 @@ +#ifndef CYGONCE_KERNEL_KAPI_H +#define CYGONCE_KERNEL_KAPI_H + +/*========================================================================== +// +// kapi.h +// +// Native API for Kernel +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg, dsm +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: Native API for Kernel +// Description: This file describes the native API for using the kernel. +// It is essentially a set of C wrappers for the C++ class +// member functions. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + +#include + +#ifdef CYGFUN_KERNEL_API_C +#include + +/*---------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------*/ +/* The following are derived types, they may have different */ +/* definitions from these depending on configuration. */ + +typedef CYG_ADDRWORD cyg_addrword_t; /* May hold pointer or word */ +typedef cyg_addrword_t cyg_handle_t; /* Object handle */ +typedef cyg_uint32 cyg_priority_t; /* type for priorities */ +typedef cyg_uint32 cyg_code_t; /* type for various codes */ +typedef cyg_uint32 cyg_vector_t; /* Interrupt vector id */ + +typedef unsigned long long cyg_tick_count_t; + +typedef int cyg_bool_t; + +/* Exception handler function definition */ +typedef void cyg_exception_handler_t( + cyg_addrword_t data, + cyg_code_t exception_number, + cyg_addrword_t info +); + +/*---------------------------------------------------------------------------*/ +struct cyg_thread; +typedef struct cyg_thread cyg_thread; + +struct cyg_interrupt; +typedef struct cyg_interrupt cyg_interrupt; + +struct cyg_counter; +typedef struct cyg_counter cyg_counter; + +struct cyg_clock; +typedef struct cyg_clock cyg_clock; + +struct cyg_alarm; +typedef struct cyg_alarm cyg_alarm; + +struct cyg_mbox; +typedef struct cyg_mbox cyg_mbox; + +struct cyg_mempool_var; +typedef struct cyg_mempool_var cyg_mempool_var; + +struct cyg_mempool_fix; +typedef struct cyg_mempool_fix cyg_mempool_fix; + +struct cyg_sem_t; +typedef struct cyg_sem_t cyg_sem_t; + +struct cyg_flag_t; +typedef struct cyg_flag_t cyg_flag_t; + +struct cyg_mutex_t; +typedef struct cyg_mutex_t cyg_mutex_t; + +struct cyg_cond_t; +typedef struct cyg_cond_t cyg_cond_t; + +/*---------------------------------------------------------------------------*/ +/* Scheduler operations */ + +/* Starts scheduler with created threads. Never returns. */ +void cyg_scheduler_start(void) __attribute__ ((noreturn)); + +/* Lock and unlock the scheduler. When the scheduler is */ +/* locked thread preemption is disabled. */ +void cyg_scheduler_lock(void); + +void cyg_scheduler_unlock(void); + +/*---------------------------------------------------------------------------*/ +/* Thread operations */ + +typedef void cyg_thread_entry_t(cyg_addrword_t); + +void cyg_thread_create( + cyg_addrword_t sched_info, /* scheduling info (eg pri) */ + cyg_thread_entry_t *entry, /* entry point function */ + cyg_addrword_t entry_data, /* entry data */ + char *name, /* optional thread name */ + void *stack_base, /* stack base, NULL = alloc */ + cyg_ucount32 stack_size, /* stack size, 0 = default */ + cyg_handle_t *handle, /* returned thread handle */ + cyg_thread *thread /* put thread here */ +); + +void cyg_thread_exit(void); + + +void cyg_thread_suspend(cyg_handle_t thread); + +void cyg_thread_resume(cyg_handle_t thread); + +void cyg_thread_kill(cyg_handle_t thread); + + +void cyg_thread_yield(void); + +cyg_handle_t cyg_thread_self(void); + + +/* Priority manipulation */ + +void cyg_thread_set_priority(cyg_handle_t thread, cyg_priority_t priority ); + +cyg_priority_t cyg_thread_get_priority(cyg_handle_t thread); + +/* Deadline scheduling control (optional) */ + +void cyg_thread_deadline_wait( + cyg_tick_count_t start_time, /* abs earliest start time */ + cyg_tick_count_t run_time, /* worst case execution time */ + cyg_tick_count_t deadline /* absolute deadline */ +); + +void cyg_thread_delay(cyg_tick_count_t delay); + +/*---------------------------------------------------------------------------*/ +/* Exception handling. */ + +/* Replace current exception handler, this may apply to either the */ +/* current thread, or to a global exception handler. The exception */ +/* number may be ignored, or used to specify a particular handler. */ + +void cyg_exception_set_handler( + cyg_code_t exception_number, + cyg_exception_handler_t *new_handler, + cyg_addrword_t new_data, + cyg_exception_handler_t **old_handler, + cyg_addrword_t *old_data +); + +/* Clear exception hander to default value */ +void cyg_exception_clear_handler( + cyg_code_t exception_number +); + +/* Invoke exception handler */ +void cyg_exception_call_handler( + cyg_handle_t thread, + cyg_code_t exception_number, + cyg_addrword_t exception_info +); + + +/*---------------------------------------------------------------------------*/ +/* Interrupt handling */ +typedef void cyg_VSR_t(void); +typedef cyg_uint32 cyg_ISR_t(cyg_vector_t vector, cyg_addrword_t data); +typedef void cyg_DSR_t( + cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data); + + +enum cyg_ISR_results +{ + CYG_ISR_HANDLED = 1, /* Interrupt was handled */ + CYG_ISR_CALL_DSR = 2 /* Schedule DSR */ +}; + +void cyg_interrupt_create( + cyg_vector_t vector, /* Vector to attach to */ + cyg_priority_t priority, /* Queue priority */ + cyg_addrword_t data, /* Data pointer */ + cyg_ISR_t *isr, /* Interrupt Service Routine */ + cyg_DSR_t *dsr, /* Deferred Service Routine */ + cyg_handle_t *handle, /* returned handle */ + cyg_interrupt *intr /* put interrupt here */ +); + +void cyg_interrupt_delete( cyg_handle_t interrupt ); + +void cyg_interrupt_attach( cyg_handle_t interrupt ); + +void cyg_interrupt_detach( cyg_handle_t interrupt ); + +/* VSR manipulation */ + +void cyg_interrupt_get_vsr( + cyg_vector_t vector, /* vector to get */ + cyg_VSR_t **vsr /* vsr got */ +); + +void cyg_interrupt_set_vsr( + cyg_vector_t vector, /* vector to set */ + cyg_VSR_t *vsr /* vsr to set */ +); + +/* CPU level interrupt mask */ +void cyg_interrupt_disable(void); + +void cyg_interrupt_enable(void); + +/* Interrupt controller access */ +void cyg_interrupt_mask(cyg_vector_t vector); + +void cyg_interrupt_unmask(cyg_vector_t vector); + +void cyg_interrupt_acknowledge(cyg_vector_t vector); + +void cyg_interrupt_configure( + cyg_vector_t vector, /* vector to configure */ + cyg_bool_t level, /* level or edge triggered */ + cyg_bool_t up /* rising/faling edge, high/low level*/ +); + +/*---------------------------------------------------------------------------*/ +/* Counters, Clocks and Alarms */ + +void cyg_counter_create( + cyg_handle_t *handle, /* returned counter handle */ + cyg_counter *counter /* put counter here */ +); + +void cyg_counter_delete(cyg_handle_t counter); + +/* Return current value of counter */ +cyg_tick_count_t cyg_counter_current_value(cyg_handle_t counter); + +/* Set new current value */ +void cyg_counter_set_value( + cyg_handle_t counter, + cyg_tick_count_t new_value +); + +/* Advance counter by one tick */ +void cyg_counter_tick(cyg_handle_t counter); + + +typedef struct +{ + cyg_uint32 dividend; + cyg_uint32 divisor; +} cyg_resolution_t; + +/* Create a clock object */ +void cyg_clock_create( + cyg_resolution_t resolution, /* Initial resolution */ + cyg_handle_t *handle, /* Returned clock handle */ + cyg_clock *clock /* put clock here */ +); + +void cyg_clock_delete(cyg_handle_t clock); + +/* convert a clock handle to a counter handle so we can use the */ +/* counter API on it. */ +void cyg_clock_to_counter( + cyg_handle_t clock, + cyg_handle_t *counter +); + +void cyg_clock_set_resolution( + cyg_handle_t clock, + cyg_resolution_t resolution /* New resolution */ +); + +cyg_resolution_t cyg_clock_get_resolution(cyg_handle_t clock); + +/* handle of real time clock */ +cyg_handle_t cyg_real_time_clock(void); + +/* returns value of real time clock's counter. + This is the same as: + (cyg_clock_to_counter(cyg_real_time_clock(), &h), + cyg_counter_current_value(h)) */ +cyg_tick_count_t cyg_current_time(void); + +/* Alarm handler function */ +typedef void cyg_alarm_t(cyg_handle_t alarm, cyg_addrword_t data); + +void cyg_alarm_create( + cyg_handle_t counter, /* Attached to this counter */ + cyg_alarm_t *alarmfn, /* Call-back function */ + cyg_addrword_t data, /* Call-back data */ + cyg_handle_t *handle, /* Returned alarm object */ + cyg_alarm *alarm /* put alarm here */ +); + +/* Disable alarm, detach from counter and invalidate handles */ +void cyg_alarm_delete( cyg_handle_t alarm); + +void cyg_alarm_initialize( + cyg_handle_t alarm, + cyg_tick_count_t trigger, /* Absolute trigger time */ + cyg_tick_count_t interval /* Relative retrigger interval */ +); + +void cyg_alarm_enable( cyg_handle_t alarm ); + +void cyg_alarm_disable( cyg_handle_t alarm ); + +/*---------------------------------------------------------------------------*/ +/* Mail boxes */ +void cyg_mbox_create( + cyg_handle_t *handle, + cyg_mbox *mbox +); + +void cyg_mbox_delete(cyg_handle_t mbox); + +void *cyg_mbox_get(cyg_handle_t mbox); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +void *cyg_mbox_timed_get( + cyg_handle_t mbox, + cyg_tick_count_t abstime + ); +#endif + +void *cyg_mbox_tryget(cyg_handle_t mbox); + +void *cyg_mbox_peek_item(cyg_handle_t mbox); + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT +cyg_bool_t cyg_mbox_put(cyg_handle_t mbox, void *item); +#ifdef CYGFUN_KERNEL_THREADS_TIMER +cyg_bool_t cyg_mbox_timed_put( + cyg_handle_t mbox, + void *item, + cyg_tick_count_t abstime + ); +#endif +#endif + +cyg_bool_t cyg_mbox_tryput(cyg_handle_t mbox, void *item); + +cyg_count32 cyg_mbox_peek(cyg_handle_t mbox); + +cyg_bool_t cyg_mbox_waiting_to_get(cyg_handle_t mbox); + +cyg_bool_t cyg_mbox_waiting_to_put(cyg_handle_t mbox); + + +/*-----------------------------------------------------------------------*/ +/* Memory pools */ + +/* There are two sorts of memory pools. A variable size memory pool + is for allocating blocks of any size. A fixed size memory pool, has + the block size specified when the pool is created, and only provides + blocks of that size. */ + +/* Create a variable size memory pool */ +void cyg_mempool_var_create( + void *base, /* base of memory to use for pool */ + cyg_int32 size, /* size of memory in bytes */ + cyg_handle_t *handle, /* returned handle of memory pool */ + cyg_mempool_var *var /* space to put pool structure in */ + ); + +/* Delete variable size memory pool */ +void cyg_mempool_var_delete(cyg_handle_t varpool); + +/* Allocates a block of length size. This waits if the memory is not + currently available. */ +void *cyg_mempool_var_alloc(cyg_handle_t varpool, cyg_int32 size); + +/* Allocates a block of length size. This waits until abstime, + if the memory is not already available. NULL is returned if + no memory is available. */ +void *cyg_mempool_var_timed_alloc( + cyg_handle_t varpool, + cyg_int32 size, + cyg_tick_count_t abstime); + +/* Allocates a block of length size. NULL is returned if no memory is + available. */ +void *cyg_mempool_var_try_alloc( + cyg_handle_t varpool, + cyg_int32 size); + +/* Frees memory back into variable size pool. */ +void cyg_mempool_var_free(cyg_handle_t varpool, void *p); + +/* Returns true if there are any threads waiting for memory in the + given memory pool. */ +cyg_bool_t cyg_mempool_var_waiting(cyg_handle_t varpool); + +typedef struct { + cyg_int32 totalmem; + cyg_int32 freemem; + void *base; + cyg_int32 size; + cyg_int32 blocksize; + cyg_int32 maxfree; // The largest free block +} cyg_mempool_info; + +/* Puts information about a variable memory pool into the structure + provided. */ +void cyg_mempool_var_get_info(cyg_handle_t varpool, cyg_mempool_info *info); + +/* Create a fixed size memory pool */ +void cyg_mempool_fix_create( + void *base, // base of memory to use for pool + cyg_int32 size, // size of memory in byte + cyg_int32 blocksize, // size of allocation in bytes + cyg_handle_t *handle, // handle of memory pool + cyg_mempool_fix *fix // space to put pool structure in + ); + +/* Delete fixed size memory pool */ +void cyg_mempool_fix_delete(cyg_handle_t fixpool); + +/* Allocates a block. This waits if the memory is not + currently available. */ +void *cyg_mempool_fix_alloc(cyg_handle_t fixpool); + +/* Allocates a block. This waits until abstime, if the memory + is not already available. NULL is returned if no memory is + available. */ +void *cyg_mempool_fix_timed_alloc( + cyg_handle_t fixpool, + cyg_tick_count_t abstime); + +/* Allocates a block. NULL is returned if no memory is available. */ +void *cyg_mempool_fix_try_alloc(cyg_handle_t fixpool); + +/* Frees memory back into fixed size pool. */ +void cyg_mempool_fix_free(cyg_handle_t fixpool, void *p); + +/* Returns true if there are any threads waiting for memory in the + given memory pool. */ +cyg_bool_t cyg_mempool_fix_waiting(cyg_handle_t fixpool); + +/* Puts information about a variable memory pool into the structure + provided. */ +void cyg_mempool_fix_get_info(cyg_handle_t fixpool, cyg_mempool_info *info); + +/*---------------------------------------------------------------------------*/ +/* Semaphores */ + +void cyg_semaphore_init( + cyg_sem_t *sem, /* Semaphore to init */ + cyg_ucount32 val /* Initial semaphore value */ +); + +void cyg_semaphore_destroy( cyg_sem_t *sem ); + +void cyg_semaphore_wait( cyg_sem_t *sem ); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +cyg_bool_t cyg_semaphore_timed_wait( + cyg_sem_t *sem, + cyg_tick_count_t abstime + ); +#endif + +cyg_bool_t cyg_semaphore_trywait( cyg_sem_t *sem ); + +void cyg_semaphore_post( cyg_sem_t *sem ); + +void cyg_semaphore_peek( cyg_sem_t *sem, cyg_ucount32 *val ); + +/*---------------------------------------------------------------------------*/ +/* Flags */ + +typedef cyg_uint32 cyg_flag_value_t; +typedef cyg_uint8 cyg_flag_mode_t; +#define CYG_FLAG_WAITMODE_AND ((cyg_flag_mode_t)0) /* all bits must be set */ +#define CYG_FLAG_WAITMODE_OR ((cyg_flag_mode_t)2) /* any bit must be set */ +#define CYG_FLAG_WAITMODE_CLR ((cyg_flag_mode_t)1) /* clear when satisfied */ + +void cyg_flag_init( + cyg_flag_t *flag /* Flag to init */ +); + +void cyg_flag_destroy( cyg_flag_t *flag ); + +/* bitwise-or in the bits in value; awaken any waiting tasks whose + condition is now satisfied */ +void cyg_flag_setbits( cyg_flag_t *flag, cyg_flag_value_t value); + +/* bitwise-and with the the bits in value; this clears the bits which + are not set in value. No waiting task can be awoken. */ +void cyg_flag_maskbits( cyg_flag_t *flag, cyg_flag_value_t value); + +/* wait for the flag value to match the pattern, according to the mode. + If mode includes CLR, set the flag value to zero when + our pattern is matched. The return value is that which matched + the request, or zero for an error/timeout return. + Value must not itself be zero. */ +cyg_flag_value_t cyg_flag_wait( cyg_flag_t *flag, + cyg_flag_value_t pattern, + cyg_flag_mode_t mode ); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +cyg_flag_value_t cyg_flag_timed_wait( cyg_flag_t *flag, + cyg_flag_value_t pattern, + cyg_flag_mode_t mode, + cyg_tick_count_t abstime ); + +#endif + +cyg_flag_value_t cyg_flag_poll( cyg_flag_t *flag, + cyg_flag_value_t pattern, + cyg_flag_mode_t mode ); + +cyg_flag_value_t cyg_flag_peek( cyg_flag_t *flag ); + +cyg_bool_t cyg_flag_waiting( cyg_flag_t *flag ); + +/*---------------------------------------------------------------------------*/ +/* Mutex */ + +void cyg_mutex_init( + cyg_mutex_t *mutex /* Mutex to init */ +); + +void cyg_mutex_destroy( cyg_mutex_t *mutex ); + +void cyg_mutex_lock( cyg_mutex_t *mutex ); + +cyg_bool_t cyg_mutex_trylock( cyg_mutex_t *mutex ); + +void cyg_mutex_unlock( cyg_mutex_t *mutex ); + +/*---------------------------------------------------------------------------*/ +/* Condition Variables */ + +void cyg_cond_init( + cyg_cond_t *cond, /* condition variable to init */ + cyg_mutex_t *mutex /* associated mutex */ +); + +void cyg_cond_destroy( cyg_cond_t *cond ); + +void cyg_cond_wait( cyg_cond_t *cond ); + +void cyg_cond_signal( cyg_cond_t *cond ); + +void cyg_cond_broadcast( cyg_cond_t *cond ); + +#ifdef CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT +cyg_bool_t cyg_cond_timed_wait( + cyg_cond_t *cond, + cyg_tick_count_t abstime + ); +#endif + + +#ifdef __cplusplus +} +#endif + +#include + +/*---------------------------------------------------------------------------*/ +/* EOF kapi.h */ +#endif /* CYGFUN_KERNEL_API_C */ +#endif /* CYGONCE_KERNEL_KAPI_H */ diff --git a/packages/kernel/current/include/kapidata.h b/packages/kernel/current/include/kapidata.h new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/kapidata.h @@ -0,0 +1,386 @@ +#ifndef CYGONCE_KERNEL_KAPIDATA_H +#define CYGONCE_KERNEL_KAPIDATA_H + +/*============================================================================= +// +// kapidata.h +// +// Native API data structures +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-03-13 +// Purpose: Native API data structures +// Description: This file defines the structures used in the native API. The +// sizes of these structures are dependent on the system +// configuration and must be kept in step with their real +// counterparts in the C++ headers. +// Usage: included by kapi.h +// +//####DESCRIPTIONEND#### +// +//==========================================================================*/ + +#include + +#include +#include // exception defines + +/*---------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/*---------------------------------------------------------------------------*/ + +#ifndef CYGNUM_KERNEL_SCHED_BITMAP_SIZE +#if defined(CYGSEM_KERNEL_SCHED_MLQUEUE) +#define CYGNUM_KERNEL_SCHED_BITMAP_SIZE 32 +#elif defined(CYGSEM_KERNEL_SCHED_BITMAP) +#define CYGNUM_KERNEL_SCHED_BITMAP_SIZE 32 +#endif +#endif + +#if CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 8 +typedef cyg_ucount8 cyg_sched_bitmap; +#elif CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 16 +typedef cyg_ucount16 cyg_sched_bitmap; +#elif CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 32 +typedef cyg_ucount32 cyg_sched_bitmap; +#elif CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 64 +typedef cyg_ucount64 cyg_sched_bitmap; +#else +#error Bitmaps greater than 64 bits not currently allowed +#endif + +typedef struct +{ +#if defined(CYGSEM_KERNEL_SCHED_BITMAP) + + cyg_sched_bitmap map; + +#elif defined(CYGSEM_KERNEL_SCHED_MLQUEUE) + + cyg_thread *queue; + +#elif defined(CYGSEM_KERNEL_SCHED_LOTTERY) + + cyg_thread *queue; + +#else + +#error Undefined scheduler type + +#endif +} cyg_threadqueue; + +/*---------------------------------------------------------------------------*/ + +struct cyg_interrupt +{ + cyg_vector_t vector; + cyg_priority_t priority; + cyg_ISR_t *isr; + cyg_DSR_t *dsr; + CYG_ADDRWORD data; + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST + cyg_ucount32 dsr_count; + cyg_interrupt *next_dsr; +#endif +#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN + cyg_interrupt *next; +#endif +}; + + +/*---------------------------------------------------------------------------*/ + +struct cyg_counter +{ +#if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) + cyg_alarm *alarm_list; +#elif defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) + cyg_alarm *alarm_list[CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE]; +#endif + cyg_tick_count_t counter; + cyg_uint32 increment; +}; + +/*---------------------------------------------------------------------------*/ + +struct cyg_clock +{ + cyg_counter counter; + cyg_resolution_t resolution; +}; + +/*---------------------------------------------------------------------------*/ + +struct cyg_alarm +{ +#if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) || defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) + cyg_alarm *next; +#endif + cyg_counter *counter; + cyg_alarm_t *alarm; + CYG_ADDRWORD data; + cyg_tick_count_t trigger; + cyg_tick_count_t interval; + cyg_bool enabled; +}; + +/*---------------------------------------------------------------------------*/ +/* Exception controller */ + +#ifdef CYGPKG_KERNEL_EXCEPTIONS +typedef struct +{ +#ifdef CYGSEM_KERNEL_EXCEPTIONS_DECODE + cyg_exception_handler_t *exception_handler[CYG_EXCEPTION_COUNT]; + + CYG_ADDRWORD exception_data[CYG_EXCEPTION_COUNT]; +#else + cyg_exception_handler_t *exception_handler; // Handler function + + CYG_ADDRWORD exception_data; // Handler data +#endif + +} cyg_exception_control; + +#endif + +/*---------------------------------------------------------------------------*/ +/* Thread structure */ + +typedef struct +{ + CYG_ADDRESS stack_base; /* pointer to base of stack area */ + cyg_uint32 stack_size; /* size of stack area in bytes */ +#ifdef CYGFUN_KERNEL_THREADS_STACK_LIMIT + CYG_ADDRESS stack_limit; /* movable stack limit */ +#endif + CYG_ADDRESS stack_ptr; /* pointer to saved state on stack */ + CYG_ADDRWORD entry_point; /* main entry point (code pointer!) */ + CYG_ADDRWORD entry_data; /* entry point argument */ +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + void *saved_context; // If non-zero, this points at a more + // interesting context than stack_ptr. +#endif + +} cyg_hardwarethread; + +typedef struct +{ +#if defined(CYGSEM_KERNEL_SCHED_BITMAP) + + cyg_priority_t priority; /* current thread priority */ + +#elif defined(CYGSEM_KERNEL_SCHED_MLQUEUE) + + cyg_thread *next; + cyg_thread *prev; + + cyg_priority_t priority; /* current thread priority */ + +#elif defined(CYGSEM_KERNEL_SCHED_LOTTERY) + + cyg_thread *next; + cyg_thread *prev; + + cyg_priority_t priority; /* current thread priority */ + + cyg_priority_t compensation_tickets; /* sleep compensation */ + +#else + +#error Undefined scheduler type + +#endif + + cyg_threadqueue *queue; + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + cyg_count32 mutex_count; +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE + cyg_priority_t original_priority; + cyg_bool priority_inherited; +#endif +#endif + +} cyg_schedthread; + +typedef struct +{ + cyg_alarm alarm; + cyg_thread *thread; +} cyg_threadtimer; + + +typedef int cyg_reason_t; /* cyg_reason is originally an enum */ + +struct cyg_thread +{ + cyg_hardwarethread hwthread; + cyg_schedthread schedthread; + + cyg_uint32 state; + cyg_ucount32 suspend_count; + cyg_ucount32 wakeup_count; + CYG_ADDRWORD wait_info; + cyg_uint16 unique_id; + + +#if defined(CYGPKG_KERNEL_EXCEPTIONS) && !defined(CYGSEM_KERNEL_EXCEPTIONS_GLOBAL) + + cyg_exception_control exception_control; + +#endif + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_threadtimer timer; +#endif + + cyg_reason_t sleep_reason; + cyg_reason_t wake_reason; + +#ifdef CYGVAR_KERNEL_THREADS_DATA + + CYG_ADDRWORD thread_data[CYGNUM_KERNEL_THREADS_DATA_MAX]; + +#endif + +#ifdef CYGVAR_KERNEL_THREADS_NAME + + char *name; + +#endif + +#ifdef CYGVAR_KERNEL_THREADS_LIST + + cyg_thread *list_next; + +#endif + +}; + +/*---------------------------------------------------------------------------*/ + +struct cyg_mbox +{ + cyg_count32 base; /* index of first used slot */ + cyg_count32 count; /* count of used slots */ + cyg_threadqueue get_threadq; /* Queue of waiting threads */ +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + cyg_threadqueue put_threadq; /* Queue of waiting threads */ +#endif + void * itemqueue[ CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE ]; +}; + +/*---------------------------------------------------------------------------*/ + +struct cyg_sem_t +{ + cyg_count32 count; /* The semaphore count */ + cyg_threadqueue queue; /* Queue of waiting threads */ +}; + +/*---------------------------------------------------------------------------*/ + +struct cyg_flag_t +{ + cyg_flag_value_t value; /* The flag value */ + cyg_threadqueue queue; /* Queue of waiting threads */ +}; + +/*---------------------------------------------------------------------------*/ + +struct cyg_mutex_t +{ + cyg_bool locked; /* true if locked */ + cyg_thread *owner; /* Current locking thread */ + cyg_threadqueue queue; /* Queue of waiting threads */ + +}; + +/*---------------------------------------------------------------------------*/ + +struct cyg_cond_t +{ + cyg_mutex_t *mutex; /* Associated mutex */ + cyg_threadqueue queue; /* Queue of waiting threads */ +}; + +/*---------------------------------------------------------------------------*/ + +/* This corresponds to the extra fields provided by the mempoolt template + not the actual size of the template in any given instance. */ +typedef struct cyg_mempoolt { + cyg_threadqueue queue; +} cyg_mempoolt; + + +struct cyg_mempool_var_memdq { + struct cyg_mempool_var_memdq *prev, *next; + cyg_int32 size; +}; + +struct cyg_mempool_var { + struct cyg_mempool_var_memdq head; + cyg_uint8 *obase; + cyg_int32 osize; + cyg_int32 oalign; + cyg_uint8 *bottom; + cyg_uint8 *top; + cyg_int32 alignment; + cyg_int32 freemem; + cyg_mempoolt mempoolt; +}; + +struct cyg_mempool_fix { + cyg_uint32 *bitmap; + cyg_int32 maptop; + cyg_uint8 *mempool; + cyg_int32 numblocks; + cyg_int32 freeblocks; + cyg_int32 blocksize; + cyg_int32 firstfree; + cyg_uint8 *top; + cyg_mempoolt mempoolt; +}; + +/*------------------------------------------------------------------------*/ + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------*/ +/* EOF kapidata.h */ +#endif /* CYGONCE_KERNEL_KAPIDATA_H */ diff --git a/packages/kernel/current/include/kernel.hxx b/packages/kernel/current/include/kernel.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/kernel.hxx @@ -0,0 +1,75 @@ +#ifndef CYGONCE_KERNEL_KERNEL_HXX +#define CYGONCE_KERNEL_KERNEL_HXX + +//========================================================================== +// +// kernel.hxx +// +// Kernel mega-include file +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Include all kernel files +// Description: This file contains includes for all the kernel +// headers. This simplifys things in the sources. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + + +#include + +#include + +#include // assertion macros +#include // tracing macros + +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +// ------------------------------------------------------------------------- +#endif // #ifndef CYGONCE_KERNEL_KERNEL_HXX +// EOF kernel.hxx diff --git a/packages/kernel/current/include/ktypes.h b/packages/kernel/current/include/ktypes.h new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/ktypes.h @@ -0,0 +1,118 @@ +#ifndef CYGONCE_KERNEL_KTYPES_H +#define CYGONCE_KERNEL_KTYPES_H + +//========================================================================== +// +// ktypes.h +// +// Standard types used in the kernel and its interfaces +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg from an original by hmt +// Contributors: nickg +// Date: 1997-09-08 +// Purpose: Define kernel specific types +// Description: Kernel specific types +// Usage: #include +// ... +// cyg_priority priority; // etc +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +// ------------------------------------------------------------------------- +// Check that a configuration file is present. + +#ifndef CYGONCE_PKGCONF_KERNEL_H +#error "No Configuration file included" +#endif + +// ------------------------------------------------------------------------- + +#include +#include // for size_t + +// ------------------------------------------------------------------------- +// Integer types: + +typedef cyg_int32 cyg_code; // General return/error/status code + +typedef cyg_count32 cyg_priority; // priority value + +typedef cyg_uint32 cyg_vector; // vector number/descriptor + +typedef cyg_uint64 cyg_tick_count; // clock tick count value + +// ------------------------------------------------------------------------- +// Predefinitions of various kernel classes + +#ifdef __cplusplus + +class Cyg_Scheduler; +class Cyg_Scheduler_Implementation; + +class Cyg_HardwareThread; +class Cyg_SchedThread; +class Cyg_SchedThread_Implementation; +class Cyg_Thread; + +class Cyg_ThreadQueue; +class Cyg_ThreadQueue_Implementation; + +#endif + + +// ------------------------------------------------------------------------- +// Class and structure conversion macros. +// CYG_CLASSFROMFIELD translates a pointer to a field of a struct or +// class into a pointer to the class. +// CYG_OFFSETOFBASE yields the offset of a base class of a derived +// class. +// CYG_CLASSFROMBASE translates a pointer to a base class into a pointer +// to a selected derived class. The base class object _must_ be part of +// the specified derived class. This is essentially a poor mans version +// of the RTTI dynamic_cast operator. +// Caveat: These macros do not work for virtual base classes. + +#define CYG_CLASSFROMFIELD(_type_,_member_,_ptr_)\ + ((_type_ *)((char *)(_ptr_)-((char *)&(((_type_ *)0)->_member_)))) + +#ifdef __cplusplus + +#define CYG_OFFSETOFBASE(_type_,_base_)\ + ((char *)((_base_ *)((_type_ *)4)) - (char *)4) + +# define CYG_CLASSFROMBASE(_class_,_base_,_ptr_)\ + ((_class_ *)((char *)(_ptr_) - CYG_OFFSETOFBASE(_class_,_base_))) + +#endif + +// ------------------------------------------------------------------------- +#endif // CYGONCE_KERNEL_KTYPES_H +// EOF ktypes.h + diff --git a/packages/kernel/current/include/llistt.hxx b/packages/kernel/current/include/llistt.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/llistt.hxx @@ -0,0 +1,160 @@ +#ifndef CYGONCE_KERNEL_LLISTT_HXX +#define CYGONCE_KERNEL_LLISTT_HXX + +//========================================================================== +// +// llistt.hxx +// +// Llistt linked list template class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Define Llistt template class +// Description: The classes defined here provide the APIs for llistts. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include + +// ------------------------------------------------------------------------- +// A simple linked list template; each item also contains a pointer of type +// T, and you can search for a particular T* in a list. +// +// It is intended that this list be amenable to the trick of using the +// address of the pointer that is the list head, cast to an item pointer, +// as the "zeroth" element of the list; prev of the first item is the +// address of the head pointer, and inserting before the first item works +// correctly. For this reason, a "getprev" is not provided; iteration may +// only be forwards, until a NULL is found. +// +// It is expected that derived classes will be used to hold other +// information than just the T* but that is beyond our discussion here; +// only the T* can be searched for using code provided here. +// +// This module is NOT thread-safe; it is expected that all clients will be +// seeing that that themselves. + +template +class Cyg_Llistt +{ +private: + Cyg_Llistt *next, *prev; + T *tptr; + +private: + // make initialisation _without_ a T* impossible. + Cyg_Llistt &operator=(Cyg_Llistt &); + Cyg_Llistt(Cyg_Llistt &); + Cyg_Llistt(); + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Llistt( T *tvalue ) // Constructor + { + tptr = tvalue; + next = prev = NULL; + } + + ~Cyg_Llistt() // Destructor + { + CYG_ASSERT( NULL == next, "bad item next - still in list" ); + CYG_ASSERT( NULL == prev, "bad item prev - still in list" ); + } + + // iterator, basically. + Cyg_Llistt * getnext() { return next; } + + // get the value + T * getitem() { return tptr; } + + // look up a particular T value in the llist + static Cyg_Llistt * + find( Cyg_Llistt *list, T *tvalue ) + { + for ( ; list ; list = list->next ) { + if ( list->tptr == tvalue ) + break; + } + return list; + } + + // unlink an item from the list + void + unlink() + { + CYG_ASSERT( prev, "not in a list" ); + prev->next = next; + if ( next ) { + next->prev = prev; + } + next = prev = NULL; + } + + // insert a new item in the list after "this" + void + insertafter( Cyg_Llistt *item ) + { + CYG_ASSERT( item, "null item" ); + CYG_ASSERT( NULL == item->next, "bad item next - already linked" ); + CYG_ASSERT( NULL == item->prev, "bad item prev - already linked" ); + item->next = next; + item->prev = this; + if ( next ) + next->prev = item; + next = item; + } + + // insert a new item in the list before "this" + void + insertbefore( Cyg_Llistt *item ) + { + CYG_ASSERT( prev, "this not in a list" ); + CYG_ASSERT( item, "null item" ); + CYG_ASSERT( NULL == item->next, "bad item next - already linked" ); + CYG_ASSERT( NULL == item->prev, "bad item prev - already linked" ); + item->prev = prev; + item->next = this; + prev->next = item; + prev = item; + } +}; + + + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_LLISTT_HXX +// EOF llistt.hxx diff --git a/packages/kernel/current/include/lottery.hxx b/packages/kernel/current/include/lottery.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/lottery.hxx @@ -0,0 +1,212 @@ +#ifndef CYGONCE_KERNEL_LOTTERY_HXX +#define CYGONCE_KERNEL_LOTTERY_HXX + +//========================================================================== +// +// lottery.hxx +// +// Lottery scheduler class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-10 +// Purpose: Define lottery scheduler implementation +// Description: The classes defined here are used as base classes +// by the common classes that define schedulers and thread +// things. A lottery scheduler provides each thread with a +// share of the processor based on the number of tickets that +// it owns. +// Usage: Included according to configuration by +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +// ------------------------------------------------------------------------- +// Customize the scheduler + +#define CYGIMP_THREAD_PRIORITY 1 // Threads have changable priorities + +#define CYG_THREAD_MIN_PRIORITY 1 +#define CYG_THREAD_MAX_PRIORITY 0x7FFFFFFF + +// set default scheduling info value for thread constructors. +#define CYG_SCHED_DEFAULT_INFO CYG_THREAD_MAX_PRIORITY + +#error Lottery Scheduler not yet complete, do not use!!! + +// ------------------------------------------------------------------------- +// Thread queue implementation. +// This class provides the (scheduler specific) implementation of the +// thread queue class. + +class Cyg_ThreadQueue_Implementation +{ + friend class Cyg_Scheduler_Implementation; + friend class Cyg_SchedThread_Implementation; + + Cyg_Thread *queue; + +protected: + + // API used by Cyg_ThreadQueue + + // Add thread to queue + void enqueue(Cyg_Thread *thread); + + // return first thread on queue + Cyg_Thread *highpri(); + + // remove first thread on queue + Cyg_Thread *dequeue(); + + // remove specified thread from queue + void remove(Cyg_Thread *thread); + + // test if queue is empty + cyg_bool empty(); + + void rotate(); // Rotate the queue +}; + +inline cyg_bool Cyg_ThreadQueue_Implementation::empty() +{ + return queue == NULL; +} + +// ------------------------------------------------------------------------- +// This class contains the implementation details of the scheduler, and +// provides a standard API for accessing it. + +class Cyg_Scheduler_Implementation + : public Cyg_Scheduler_Base +{ + friend class Cyg_ThreadQueue_Implementation; + friend class Cyg_SchedThread_Implementation; + + // All runnable threads are kept on a single run queue + // in MRU order. + Cyg_ThreadQueue_Implementation run_queue; + + cyg_uint32 rand_seed; + + cyg_int32 total_tickets; + +protected: + + Cyg_Scheduler_Implementation(); // Constructor + + // The following functions provide the scheduler implementation + // interface to the Cyg_Scheduler class. These are protected + // so that only the scheduler can call them. + + // choose a new thread + Cyg_Thread *schedule(); + + // make thread schedulable + void add_thread(Cyg_Thread *thread); + + // make thread un-schedulable + void rem_thread(Cyg_Thread *thread); + + // register thread with scheduler + void register_thread(Cyg_Thread *thread); + + // deregister thread + void deregister_thread(Cyg_Thread *thread); + + // Test the given priority for uniqueness + cyg_bool unique( cyg_priority priority); + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + + // If timeslicing is enbled, define a scheduler + // entry point to do timeslicing. This will be + // called from the RTC DSR. + +protected: + + static cyg_count32 timeslice_count; + +public: + void timeslice(); + + static void reset_timeslice_count(); + +#endif + + +}; + +// ------------------------------------------------------------------------- +// Cyg_Scheduler_Implementation inlines + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + +inline void Cyg_Scheduler_Implementation::reset_timeslice_count() +{ + timeslice_count = CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS; +} + +#endif + +// ------------------------------------------------------------------------- +// Scheduler thread implementation. +// This class provides the implementation of the scheduler specific parts +// of each thread. + +class Cyg_SchedThread_Implementation +{ + friend class Cyg_Scheduler_Implementation; + friend class Cyg_ThreadQueue_Implementation; + + Cyg_Thread *next; // next thread in queue + Cyg_Thread *prev; // previous thread in queue + + void insert( Cyg_Thread *thread ); // Insert thread in front of this + + void remove(); // remove this from queue + +protected: + + cyg_priority priority; // current thread priority == tickets held + + cyg_priority compensation_tickets; // sleep compensation + + Cyg_SchedThread_Implementation(CYG_ADDRWORD sched_info); + + void yield(); // Yield CPU to next thread + +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_LOTTERY_HXX +// EOF lottery.hxx diff --git a/packages/kernel/current/include/mbox.hxx b/packages/kernel/current/include/mbox.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mbox.hxx @@ -0,0 +1,125 @@ +#ifndef CYGONCE_KERNEL_MBOX_HXX +#define CYGONCE_KERNEL_MBOX_HXX + +//========================================================================== +// +// mbox.hxx +// +// Plain (void *) Mbox (Message Box/Mailbox) class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Define Mbox class interfaces +// Description: The classes defined here provide the APIs for mboxes. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include + +#ifdef CYGIMP_MBOX_USE_MBOXT_PLAIN +#include +#else +#include +#endif + +// ------------------------------------------------------------------------- +// Message/Mail Box. This class implements a queue of void * items using +// the Cyg_Mbox template class. + +#ifndef CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE +// default is 10 elements +#define CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE (10) +#endif + +// Cyg_Mbox has a fixed size array of (void *)s; one size fits all. +// Because of this, we can simplify the API by returning a NULL for +// "failed" conditions. Ergo a NULL message is illegal. BFD. + +class Cyg_Mbox +{ +private: +#ifdef CYGIMP_MBOX_USE_MBOXT_PLAIN + Cyg_Mboxt m; +#else + Cyg_Mboxt2 m; +#endif + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Mbox(); // Constructor + ~Cyg_Mbox(); // Destructor + + void * get(); // get an item; wait if none +#ifdef CYGFUN_KERNEL_THREADS_TIMER + void * get( cyg_tick_count timeout ); +#endif + void * tryget(); // just one attempt + + void * peek_item(); // Get next item to be returned + // without removing it + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT // then we support it too + cyg_bool put( void *item ); // put an item; wait if full +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_bool put( void *item, cyg_tick_count timeout ); +#endif +#endif + cyg_bool tryput( void *item ); // fails if Q full + + inline + cyg_count32 peek() // Get current count value + { + return m.peek(); + } + + inline + cyg_bool waiting_to_get() // Any threads waiting to get? + { + return m.waiting_to_get(); + } + inline + cyg_bool waiting_to_put() // Any threads waiting to put? + { + return m.waiting_to_put(); + } +}; + + + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MBOX_HXX +// End of mbox.hxx diff --git a/packages/kernel/current/include/mboxt.hxx b/packages/kernel/current/include/mboxt.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mboxt.hxx @@ -0,0 +1,127 @@ +#ifndef CYGONCE_KERNEL_MBOXT_HXX +#define CYGONCE_KERNEL_MBOXT_HXX + +//========================================================================== +// +// mboxt.hxx +// +// Mboxt (Message Box/Mailbox) class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Define Mboxt class interfaces +// Description: The classes defined here provide the APIs for mboxtes. +// Usage: #include +// #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include + +// ------------------------------------------------------------------------- +// Message/Mail Box. This template implements a queue of T's. +// Implemented as a template for maximal flexibility; one would hope +// that only one, with T==(void *) and the same number of them, +// is ever used without very good reason. + +// Cyg_Mboxt has a fixed size array of T's; one size fits all. + +template +class Cyg_Mboxt +{ +private: + cyg_count32 base; // index of first used slot + cyg_count32 count; // count of used slots + Cyg_ThreadQueue get_threadq; // Queue of waiting threads +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + Cyg_ThreadQueue put_threadq; // Queue of waiting threads +#endif + static const + cyg_count32 size = QUEUE_SIZE; + T itemqueue[ QUEUE_SIZE ]; + // queue of items + // private utility functions + // wake up a thread from some queue + inline void wakeup_waiter( Cyg_ThreadQueue &q ); + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Mboxt(); // Constructor + ~Cyg_Mboxt(); // Destructor + + cyg_bool get( T &ritem ); // get an item; wait if none +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_bool get( T &ritem, cyg_tick_count abs_timeout ); +#endif + cyg_bool tryget( T &ritem ); // just one attempt + + cyg_bool peek_item( T &ritem ); // get next item without + // removing it + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + cyg_bool put( const T item ); // put an item; wait if full +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_bool put( const T item, cyg_tick_count abs_timeout ); +#endif +#endif + cyg_bool tryput( const T item ); // fails if Q full + + inline + cyg_count32 peek() // Get current count value + { + return count; + } + + inline + cyg_bool waiting_to_get() // Any threads waiting? + { + return ! get_threadq.empty(); + } + + inline + cyg_bool waiting_to_put() // Any threads waiting? + { +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + return ! put_threadq.empty(); +#else + return false; +#endif + } +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MBOXT_HXX +// EOF mboxt.hxx diff --git a/packages/kernel/current/include/mboxt.inl b/packages/kernel/current/include/mboxt.inl new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mboxt.inl @@ -0,0 +1,634 @@ +#ifndef CYGONCE_KERNEL_MBOXT_INL +#define CYGONCE_KERNEL_MBOXT_INL +//========================================================================== +// +// mboxt.inl +// +// Mboxt mbox template class implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Mboxt template implementation +// Description: This file contains the implementations of the mboxt +// template classes. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // our header + +#include // thread inlines +#include // scheduler inlines +#include // clock inlines + +// ------------------------------------------------------------------------- +// inline function for awakening waiting threads + +template +inline void +Cyg_Mboxt::wakeup_waiter( Cyg_ThreadQueue &q ) +{ + if( !q.empty() ) { + // The queue is non-empty, so grab the next thread and wake it up. + Cyg_Thread *thread = q.dequeue(); + + CYG_ASSERTCLASS( thread, "Bad thread pointer"); + + thread->set_wake_reason( Cyg_Thread::DONE ); + thread->wake(); + CYG_INSTRUMENT_MBOXT(WAKE, this, thread); + } +} + +// ------------------------------------------------------------------------- +// Constructor + +template +Cyg_Mboxt::Cyg_Mboxt() +{ + CYG_REPORT_FUNCTION(); + base = 0; + count = 0; +} + +// ------------------------------------------------------------------------- +// Destructor + +template +Cyg_Mboxt::~Cyg_Mboxt() +{ + CYG_REPORT_FUNCTION(); + CYG_ASSERT( 0 == count, "Deleting mboxt with messages"); + CYG_ASSERT( get_threadq.empty(), "Deleting mboxt with threads waiting to get"); +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + CYG_ASSERT( put_threadq.empty(), "Deleting mboxt with threads waiting to put"); +#endif +} + +// ------------------------------------------------------------------------- +// debugging/assert function + +#ifdef CYGDBG_USE_ASSERTS + +template +cyg_bool +Cyg_Mboxt::check_this(cyg_assert_class_zeal zeal) +{ + CYG_REPORT_FUNCTION(); + + if ( Cyg_Thread::DESTRUCT == Cyg_Thread::self()->get_wake_reason() ) + // then the whole thing is invalid, and we know it. + // so return OK, since this check should NOT make an error. + return true; + + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + +#if 0 // thread queues do not have checking funcs. + if ( ! get_threadq.check_this( zeal ) ) return false; +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + if ( ! put_threadq.check_this( zeal ) ) return false; +#endif +#endif + + switch( zeal ) + { + case cyg_system_test: + case cyg_extreme: + case cyg_thorough: + case cyg_quick: + case cyg_trivial: + // plenty of scope for fencepost problems here + if ( size < count ) return false; + if ( size <= base ) return false; + if ( 0 > count ) return false; + if ( 0 > base ) return false; + + // there was initially a test of the form + // (0 < count && count < size) && ! threadqueue.empty() + // here - ie. there should only be people waiting if the Q is full + // or empty. This is bogus, anyone else might run between a waiter + // being awoken, so there can be a 2nd waiter in the Q and a free + // slot (say) simultaneously. + + // Further, we need 2 queues; imagine a 10-slot itemqueue with 25 + // attempts to put to it, so 15 sleep. 10 other threads get, + // awakening 10 of the 15 put-sleepers. Another one gets, and + // can't because there is no data there _yet_; it sleeps, and the + // 10 awakened threads cycle through the run queue, each putting, + // the first awakens the get-sleeper, which in turn awakens a + // further put-sleeper. + + // This requirement for 2 queue only holds if Ngetters > 2 * Nslots + // or Nputters > 2 * Nslots; if these are both false, one queue + // will suffice. This could be an optimisation for the future - + // wow, 4 bytes. + + case cyg_none: + default: + break; + }; + + return true; +} + +#endif + + +// ------------------------------------------------------------------------- +// From here downwards, these are the major functions of the template; if +// being genuinely used as a template they should probably not be inlined. +// If being used to construct a specific class, with explicit functions, +// then they should be. This is controlled by: + +#ifdef CYGIMP_MBOXT_INLINE +#define CYG_MBOXT_INLINE inline +#else +#define CYG_MBOXT_INLINE +#endif + +// ------------------------------------------------------------------------- +// Get an item, or wait for one to arrive + +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt::get( T &ritem ) +{ + CYG_REPORT_FUNCTION(); + cyg_bool result = true; + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + CYG_INSTRUMENT_MBOXT(GET, this, count); + + // Loop while the mboxt is empty, sleeping each time around + // the loop. This copes with the possibility of a higher priority + // thread grabbing the message between the wakeup in unlock() and + // this thread actually starting. + + while( result && (0 == count) ) { + self->set_sleep_reason( Cyg_Thread::WAIT ); + self->sleep(); + get_threadq.enqueue( self ); + + CYG_INSTRUMENT_MBOXT(WAIT, this, count); + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + if ( result ) { + CYG_INSTRUMENT_MBOXT(GOT, this, count); + + ritem = itemqueue[ (count--, base++) ]; + CYG_ASSERT( 0 <= count, "Count went -ve" ); + CYG_ASSERT( size >= base, "Base overflow" ); + + if ( size <= base ) + base = 0; + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + wakeup_waiter( put_threadq ); +#endif + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( result ); + return result; +} + + +// ------------------------------------------------------------------------- +// Try to get an item with an absolute timeout and return success. + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt::get( T &ritem, cyg_tick_count abs_timeout ) +{ + CYG_REPORT_FUNCTION(); + cyg_bool result = true; + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + CYG_INSTRUMENT_MBOXT(GET, this, count); + + // Set the timer _once_ outside the loop. + self->set_timer( abs_timeout, Cyg_Thread::TIMEOUT ); + + // If the timeout is in the past, the wake reason will have been + // set to something other than NONE already. Set the result false + // to force an immediate return. + + if( self->get_wake_reason() != Cyg_Thread::NONE ) + result = false; + + // Loop while the mboxt is empty, sleeping each time around the loop. + // This copes with the possibility of a higher priority thread grabbing + // the message between the wakeup in put()&c and this thread actually + // starting. + while ( result && (0 == count) ) { + // must reset the sleep reason every time + self->set_sleep_reason( Cyg_Thread::TIMEOUT ); + self->sleep(); + get_threadq.enqueue( self ); + + CYG_INSTRUMENT_MBOXT(WAIT, this, count); + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + result = false; + CYG_INSTRUMENT_MBOXT(TIMEOUT, this, count); + break; + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + // clear the timer; if it actually fired, no worries. + self->clear_timer(); + + if ( result ) { + + CYG_INSTRUMENT_MBOXT(GOT, this, count); + + ritem = itemqueue[ (count--, base++) ]; + CYG_ASSERT( 0 <= count, "Count went -ve" ); + CYG_ASSERT( size >= base, "Base overflow" ); + + if ( size <= base ) + base = 0; + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + wakeup_waiter( put_threadq ); +#endif + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( result ); + return result; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +// ------------------------------------------------------------------------- +// Try to get an item and return success. + +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt::tryget( T &ritem ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(TRY, this, count); + + cyg_bool result = ( 0 < count ); + // If the mboxt is not empty, grab an item and return it. + if ( result ) { + ritem = itemqueue[ (count--, base++) ]; + CYG_ASSERT( 0 <= count, "Count went -ve" ); + CYG_ASSERT( size >= base, "Base overflow" ); + if ( size <= base ) + base = 0; + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + wakeup_waiter( put_threadq ); +#endif + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return result; +} + +// ------------------------------------------------------------------------- +// get next item without removing it +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt::peek_item( T &ritem ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(TRY, this, count); + + cyg_bool result = ( 0 < count ); + // If the mboxt is not empty, grab an item and return it. + if ( result ) + ritem = itemqueue[ base ]; + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return result; +} + +// ------------------------------------------------------------------------- +// Put an item in the queue; wait if full. + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt::put( const T item ) +{ + CYG_REPORT_FUNCTION(); + cyg_bool result = true; + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(PUT, this, count); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + while ( result && (size == count) ) { + self->set_sleep_reason( Cyg_Thread::WAIT ); + self->sleep(); + put_threadq.enqueue( self ); + + CYG_INSTRUMENT_MBOXT(WAIT, this, count); + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + Cyg_Scheduler::unlock(); // unlock, maybe switch threads + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + if ( result ) { + cyg_count32 in = base + (count++); + if ( size <= in ) + in -= size; + + CYG_ASSERT( size > in, "in overflow" ); + CYG_ASSERT( 0 <= in, "in overflow" ); + CYG_ASSERT( size >= count, "count overflow" ); + + itemqueue[ in ] = item; + + wakeup_waiter( get_threadq ); + } + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( result ); + return result; +} + +// ------------------------------------------------------------------------- +// Put an item in the queue; wait if full, with an absolute timeout; +// return success. + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt::put( const T item, cyg_tick_count abs_timeout ) +{ + CYG_REPORT_FUNCTION(); + cyg_bool result = true; + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(PUT, this, count); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Set the timer _once_ outside the loop. + self->set_timer( abs_timeout, Cyg_Thread::TIMEOUT ); + + // If the timeout is in the past, the wake reason will have been + // set to something other than NONE already. Set the result false + // to force an immediate return. + + if( self->get_wake_reason() != Cyg_Thread::NONE ) + result = false; + + // Loop while the mboxt is full, sleeping each time around the loop. + // This copes with the possibility of a higher priority thread filling + // the empty slot between the wakeup in get()&c and this thread + // actually starting. + while ( result && (size == count) ) { + // must reset the sleep reason every time + self->set_sleep_reason( Cyg_Thread::TIMEOUT ); + self->sleep(); + put_threadq.enqueue( self ); + + CYG_INSTRUMENT_MBOXT(WAIT, this, count); + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + result = false; + CYG_INSTRUMENT_MBOXT(TIMEOUT, this, count); + break; + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + // clear the timer; if it actually fired, no worries. + self->clear_timer(); + + if ( result ) { + cyg_count32 in = base + (count++); + if ( size <= in ) + in -= size; + + CYG_ASSERT( size > in, "in overflow" ); + CYG_ASSERT( 0 <= in, "in overflow" ); + CYG_ASSERT( size >= count, "count overflow" ); + + itemqueue[ in ] = item; + + wakeup_waiter( get_threadq ); + } + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( result ); + return result; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER +#endif // CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + +// ------------------------------------------------------------------------- +// Try to put an item in the queue and return success; queue may be full. + +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt::tryput( const T item ) +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(PUT, this, count); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + if ( size == count ) { + Cyg_Scheduler::unlock(); // unlock, maybe switch threads + return false; // the mboxt is full + } + + cyg_count32 in = base + (count++); + if ( size <= in ) + in -= size; + + CYG_ASSERT( size > in, "in overflow" ); + CYG_ASSERT( 0 <= in, "in overflow" ); + CYG_ASSERT( size >= count, "count overflow" ); + + itemqueue[ in ] = item; + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + wakeup_waiter( get_threadq ); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return true; +} + + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MBOXT_INL +// EOF mboxt.inl diff --git a/packages/kernel/current/include/mboxt2.hxx b/packages/kernel/current/include/mboxt2.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mboxt2.hxx @@ -0,0 +1,131 @@ +#ifndef CYGONCE_KERNEL_MBOXT2_HXX +#define CYGONCE_KERNEL_MBOXT2_HXX + +//========================================================================== +// +// mboxt2.hxx +// +// Mboxt2 (Message Box/Mailbox) class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Define Mboxt2 class interfaces +// Description: The classes defined here provide the APIs for mboxt2es. +// Usage: #include +// #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include +#include + +// ------------------------------------------------------------------------- +// Message/Mail Box. This template implements a queue of T's. +// Implemented as a template for maximal flexibility; one would hope +// that only one, with T==(void *) and the same number of them, +// is ever used without very good reason. + +// Cyg_Mboxt2 has a fixed size array of T's; one size fits all. + +template +class Cyg_Mboxt2 +{ +private: + cyg_count32 base; // index of first used slot + cyg_count32 count; // count of used slots + Cyg_ThreadQueue get_threadq; // Queue of waiting threads +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + Cyg_ThreadQueue put_threadq; // Queue of waiting threads +#endif + static const + cyg_count32 size = QUEUE_SIZE; + T itemqueue[ QUEUE_SIZE ]; + // queue of items + // private utility functions + // wake up a thread from some queue + inline void wakeup_winner( const T &msg ); +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + inline void wakeup_putter( void ); +#endif + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Mboxt2(); // Constructor + ~Cyg_Mboxt2(); // Destructor + + cyg_bool get( T &ritem ); // get an item; wait if none +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_bool get( T &ritem, cyg_tick_count abs_timeout ); +#endif + cyg_bool tryget( T &ritem ); // just one attempt + + cyg_bool peek_item( T &ritem ); // get next item without + // removing it + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + cyg_bool put( const T item ); // put an item; wait if full +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_bool put( const T item, cyg_tick_count abs_timeout ); +#endif +#endif + cyg_bool tryput( const T item ); // fails if Q full + + inline + cyg_count32 peek() // Get current count value + { + return count; + } + + inline + cyg_bool waiting_to_get() // Any threads waiting? + { + return ! get_threadq.empty(); + } + + inline + cyg_bool waiting_to_put() // Any threads waiting? + { +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + return ! put_threadq.empty(); +#else + return false; +#endif + } +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MBOXT2_HXX +// EOF mboxt2.hxx diff --git a/packages/kernel/current/include/mboxt2.inl b/packages/kernel/current/include/mboxt2.inl new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mboxt2.inl @@ -0,0 +1,681 @@ +#ifndef CYGONCE_KERNEL_MBOXT2_INL +#define CYGONCE_KERNEL_MBOXT2_INL +//========================================================================== +// +// mboxt2.inl +// +// Mboxt2 mbox template class implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Mboxt2 template implementation +// Description: This file contains the implementations of the mboxt2 +// template classes. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // our header + +#include // thread inlines +#include // scheduler inlines +#include // clock inlines + +// ------------------------------------------------------------------------- +// inline function for awakening waiting threads + +template +inline void +Cyg_Mboxt2::wakeup_winner( const T &msg ) +{ + CYG_ASSERT( !get_threadq.empty(), "Where did the winner go?" ); + + // The queue is non-empty, so grab the next thread and wake it up. + Cyg_Thread *thread = get_threadq.dequeue(); + + CYG_ASSERTCLASS( thread, "Bad thread pointer"); + + T *msg_ret = (T *)(thread->get_wait_info()); + *msg_ret = msg; + + thread->set_wake_reason( Cyg_Thread::DONE ); + thread->wake(); + + CYG_INSTRUMENT_MBOXT(WAKE, this, thread); +} + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT +template +inline void +Cyg_Mboxt2::wakeup_putter( void ) +{ + if( !put_threadq.empty() ) { + // The queue is non-empty, so grab the next thread and wake it up. + Cyg_Thread *thread = put_threadq.dequeue(); + + CYG_ASSERTCLASS( thread, "Bad thread pointer"); + + T *new_msg = (T *)(thread->get_wait_info()); + + cyg_count32 in = base + (count++); + if ( size <= in ) + in -= size; + + CYG_ASSERT( size > in, "in overflow" ); + CYG_ASSERT( 0 <= in, "in overflow" ); + CYG_ASSERT( size >= count, "count overflow" ); + + itemqueue[ in ] = *new_msg; + + thread->set_wake_reason( Cyg_Thread::DONE ); + thread->wake(); + + CYG_INSTRUMENT_MBOXT(WAKE, this, thread); + } +} +#endif + +// ------------------------------------------------------------------------- +// Constructor + +template +Cyg_Mboxt2::Cyg_Mboxt2() +{ + CYG_REPORT_FUNCTION(); + base = 0; + count = 0; + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Destructor + +template +Cyg_Mboxt2::~Cyg_Mboxt2() +{ + CYG_REPORT_FUNCTION(); +#if 0 + CYG_ASSERT( 0 == count, "Deleting mboxt2 with messages"); + CYG_ASSERT( get_threadq.empty(), "Deleting mboxt2 with threads waiting to get"); +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + CYG_ASSERT( put_threadq.empty(), "Deleting mboxt2 with threads waiting to put"); +#endif +#endif + // Prevent preemption + Cyg_Scheduler::lock(); + + while ( ! get_threadq.empty() ) { + Cyg_Thread *thread = get_threadq.dequeue(); + thread->set_wake_reason( Cyg_Thread::DESTRUCT ); + thread->wake(); + } +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + while ( ! put_threadq.empty() ) { + Cyg_Thread *thread = put_threadq.dequeue(); + thread->set_wake_reason( Cyg_Thread::DESTRUCT ); + thread->wake(); + } +#endif + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// debugging/assert function + +#ifdef CYGDBG_USE_ASSERTS + +template +cyg_bool +Cyg_Mboxt2::check_this(cyg_assert_class_zeal zeal) +{ + if ( Cyg_Thread::DESTRUCT == Cyg_Thread::self()->get_wake_reason() ) + // then the whole thing is invalid, and we know it. + // so return OK, since this check should NOT make an error. + return true; + + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + +#if 0 // thread queues do not have checking funcs. + if ( ! get_threadq.check_this( zeal ) ) return false; +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + if ( ! put_threadq.check_this( zeal ) ) return false; +#endif +#endif + + switch( zeal ) + { + case cyg_system_test: + case cyg_extreme: + case cyg_thorough: + case cyg_quick: + case cyg_trivial: + // plenty of scope for fencepost problems here + if ( size < count ) return false; + if ( size <= base ) return false; + if ( 0 > count ) return false; + if ( 0 > base ) return false; + + // Comments about needing 2 queues elided; they're not true in this + // immediate-dispatch model. I think we could get away with only + // one queue now, biut is it worth it? 4 bytes of redundant info + // buys a lot of correctness. + + case cyg_none: + default: + break; + }; + + return true; +} + +#endif + + +// ------------------------------------------------------------------------- +// From here downwards, these are the major functions of the template; if +// being genuinely used as a template they should probably not be inlined. +// If being used to construct a specific class, with explicit functions, +// then they should be. This is controlled by: + +#ifdef CYGIMP_MBOXT_INLINE +#define CYG_MBOXT_INLINE inline +#else +#define CYG_MBOXT_INLINE +#endif + +// ------------------------------------------------------------------------- +// Get an item, or wait for one to arrive + +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt2::get( T &ritem ) +{ + CYG_REPORT_FUNCTION(); + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + CYG_INSTRUMENT_MBOXT(GET, this, count); + + if ( 0 < count ) { + CYG_INSTRUMENT_MBOXT(GOT, this, count); + + ritem = itemqueue[ (count--, base++) ]; + CYG_ASSERT( 0 <= count, "Count went -ve" ); + CYG_ASSERT( size >= base, "Base overflow" ); + + if ( size <= base ) + base = 0; + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + wakeup_putter(); +#endif + + // Unlock the scheduler and definitely switch threads + Cyg_Scheduler::unlock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( true ); + return true; + } + + self->set_wait_info( (CYG_ADDRWORD)&ritem ); + self->set_sleep_reason( Cyg_Thread::WAIT ); + self->sleep(); + get_threadq.enqueue( self ); + + CYG_INSTRUMENT_MBOXT(WAIT, this, count); + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + + cyg_bool result = true; + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( result ); + return result; +} + + +// ------------------------------------------------------------------------- +// Try to get an item with an absolute timeout and return success. + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt2::get( T &ritem, cyg_tick_count abs_timeout ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + CYG_INSTRUMENT_MBOXT(GET, this, count); + + if ( 0 < count ) { + CYG_INSTRUMENT_MBOXT(GOT, this, count); + + ritem = itemqueue[ (count--, base++) ]; + CYG_ASSERT( 0 <= count, "Count went -ve" ); + CYG_ASSERT( size >= base, "Base overflow" ); + + if ( size <= base ) + base = 0; + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + wakeup_putter(); +#endif + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( true ); + return true; + } + + // Set the timer + self->set_timer( abs_timeout, Cyg_Thread::TIMEOUT ); + + // If the timeout is in the past, the wake reason will have been set to + // something other than NONE already. If so, skip the wait and go + // straight to unlock. + + if( Cyg_Thread::NONE == self->get_wake_reason() ) { + self->set_wait_info( (CYG_ADDRWORD)&ritem ); + self->sleep(); + get_threadq.enqueue( self ); + + CYG_INSTRUMENT_MBOXT(WAIT, this, count); + } + + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + + // clear the timer; if it actually fired, no worries. + self->clear_timer(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_bool result = true; + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + result = false; + CYG_INSTRUMENT_MBOXT(TIMEOUT, this, count); + break; + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + + CYG_REPORT_RETVAL( result ); + return result; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +// ------------------------------------------------------------------------- +// Try to get an item and return success. + +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt2::tryget( T &ritem ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(TRY, this, count); + + cyg_bool result = ( 0 < count ); + // If the mboxt2 is not empty, grab an item and return it. + if ( result ) { + ritem = itemqueue[ (count--, base++) ]; + CYG_ASSERT( 0 <= count, "Count went -ve" ); + CYG_ASSERT( size >= base, "Base overflow" ); + if ( size <= base ) + base = 0; + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + wakeup_putter(); +#endif + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( result ); + return result; +} + +// ------------------------------------------------------------------------- +// get next item without removing it +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt2::peek_item( T &ritem ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(TRY, this, count); + + cyg_bool result = ( 0 < count ); + // If the mboxt2 is not empty, grab an item and return it. + if ( result ) + ritem = itemqueue[ base ]; + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( result ); + return result; +} + +// ------------------------------------------------------------------------- +// Put an item in the queue; wait if full. + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt2::put( const T item ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(PUT, this, count); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + if ( size == count ) { + CYG_ASSERT( get_threadq.empty(), "Threads waiting AND queue full?" ); + + self->set_wait_info( (CYG_ADDRWORD)&item ); + self->set_sleep_reason( Cyg_Thread::WAIT ); + self->sleep(); + put_threadq.enqueue( self ); + + CYG_INSTRUMENT_MBOXT(WAIT, this, count); + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // when this returns, our item is in the queue. + Cyg_Scheduler::unlock(); // unlock, switch threads + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_bool result = true; + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + CYG_REPORT_RETVAL( result ); + return result; + } + + if ( !get_threadq.empty() ) { + wakeup_winner( item ); + Cyg_Scheduler::unlock(); // unlock, maybe switch threads + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( true ); + return true; + } + + cyg_count32 in = base + (count++); + if ( size <= in ) + in -= size; + + CYG_ASSERT( size > in, "in overflow" ); + CYG_ASSERT( 0 <= in, "in overflow" ); + CYG_ASSERT( size >= count, "count overflow" ); + + itemqueue[ in ] = item; + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( true ); + return true; +} + +// ------------------------------------------------------------------------- +// Put an item in the queue; wait if full, with an absolute timeout; +// return success. + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt2::put( const T item, cyg_tick_count abs_timeout ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(PUT, this, count); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + if ( size == count ) { + + CYG_ASSERT( get_threadq.empty(), "Threads waiting AND queue full?" ); + + // Set the timer + self->set_timer( abs_timeout, Cyg_Thread::TIMEOUT ); + + // If the timeout is in the past, the wake reason will have been set to + // something other than NONE already. If so, skip the wait and go + // straight to unlock. + + if( Cyg_Thread::NONE == self->get_wake_reason() ) { + self->set_wait_info( (CYG_ADDRWORD)&item ); + self->sleep(); + put_threadq.enqueue( self ); + + CYG_INSTRUMENT_MBOXT(WAIT, this, count); + } + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // when this returns, our item is in the queue. + Cyg_Scheduler::unlock(); // unlock, switch threads + + // clear the timer; if it actually fired, no worries. + self->clear_timer(); + + cyg_bool result = true; + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + result = false; + CYG_INSTRUMENT_MBOXT(TIMEOUT, this, count); + break; + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( result ); + return result; + } + + + if ( !get_threadq.empty() ) { + wakeup_winner( item ); + Cyg_Scheduler::unlock(); // unlock, maybe switch threads + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( true ); + return true; + } + + cyg_count32 in = base + (count++); + if ( size <= in ) + in -= size; + + CYG_ASSERT( size > in, "in overflow" ); + CYG_ASSERT( 0 <= in, "in overflow" ); + CYG_ASSERT( size >= count, "count overflow" ); + + itemqueue[ in ] = item; + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( true ); + return true; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER +#endif // CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + +// ------------------------------------------------------------------------- +// Try to put an item in the queue and return success; queue may be full. + +template +CYG_MBOXT_INLINE cyg_bool +Cyg_Mboxt2::tryput( const T item ) +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MBOXT(PUT, this, count); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + if ( size == count ) { + CYG_ASSERT( get_threadq.empty(), "Threads waiting AND queue full?" ); + Cyg_Scheduler::unlock(); // unlock, maybe switch threads + CYG_REPORT_RETVAL( false ); + return false; // the mboxt2 is full + } + + if ( !get_threadq.empty() ) { + CYG_ASSERT( 0 == count, "Threads waiting AND queue not empty" ); + wakeup_winner( item ); + Cyg_Scheduler::unlock(); // unlock, maybe switch threads + CYG_REPORT_RETVAL( true ); + return true; + } + + cyg_count32 in = base + (count++); + if ( size <= in ) + in -= size; + + CYG_ASSERT( size > in, "in overflow" ); + CYG_ASSERT( 0 <= in, "in overflow" ); + CYG_ASSERT( size >= count, "count overflow" ); + + itemqueue[ in ] = item; + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETVAL( true ); + return true; +} + + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MBOXT2_INL +// EOF mboxt2.inl diff --git a/packages/kernel/current/include/memfixed.hxx b/packages/kernel/current/include/memfixed.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/memfixed.hxx @@ -0,0 +1,119 @@ +#ifndef CYGONCE_KERNEL_MEMFIXED_HXX +#define CYGONCE_KERNEL_MEMFIXED_HXX + +//========================================================================== +// +// memfixed.hxx +// +// Memory pool with fixed block class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-23 +// Purpose: Define Memfixed class interface +// Description: Inline class for constructing a fixed block allocator +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // kernel types +#include // assertion macros + +#ifdef CYGIMP_MEM_USE_MEMPOOLT_PLAIN +#include // kernel safe mempool template +#else +#include // kernel safe mempool template +#endif + +#include // implementation of a fixed mem pool + +class Cyg_Mempool_Fixed { +private: +#ifdef CYGIMP_MEM_USE_MEMPOOLT_PLAIN + Cyg_Mempoolt mypool; +#else + Cyg_Mempolt2 mypool; +#endif + +public: + // this API makes concrete a class which implements a thread-safe + // kernel-savvy memory pool which manages fixed size blocks. + + CYGDBG_DEFINE_CHECK_THIS + + // Constructor: gives the base and size of the arena in which memory is + // to be carved out, note that management structures are taken from the + // same arena. Alloc_unit is the blocksize allocated. + Cyg_Mempool_Fixed( + cyg_uint8 *base, + cyg_int32 size, + CYG_ADDRWORD alloc_unit ); + + // Destructor + ~Cyg_Mempool_Fixed(); + + // get some memory; wait if none available + cyg_uint8 *alloc(); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + // get some memory with a timeout + cyg_uint8 *alloc(cyg_tick_count delay_timeout ); +#endif + + // get some memory, return NULL if none available + cyg_uint8 *try_alloc(); + + // free the memory back to the pool + cyg_bool free( cyg_uint8 *p); + + // is anyone waiting for memory? + cyg_bool waiting(); + + // read the fixed allocation size + cyg_int32 get_blocksize(); + + // these two are obvious and generic + cyg_int32 get_totalmem(); + cyg_int32 get_freemem(); + + // get information about the construction parameters for external + // freeing after the destruction of the holding object + void + get_arena( cyg_uint8 * &base, cyg_int32 &size, CYG_ADDRWORD &alloc ); + + // Return the size of the memory allocation (previously returned + // by alloc() or try_alloc() ) at ptr. Returns -1 if not found + cyg_int32 + get_allocation_size( cyg_uint8 * /* ptr */ ); +}; + +#endif // ifndef CYGONCE_KERNEL_MEMFIXED_HXX +// EOF memfixed.hxx diff --git a/packages/kernel/current/include/mempolt2.hxx b/packages/kernel/current/include/mempolt2.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mempolt2.hxx @@ -0,0 +1,122 @@ +#ifndef CYGONCE_KERNEL_MEMPOLT2_HXX +#define CYGONCE_KERNEL_MEMPOLT2_HXX + +//========================================================================== +// +// mempolt2.hxx +// +// Mempolt2 (Memory pool template) class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Define Mempolt2 class interface + +// Description: The class defined here provides the APIs for thread-safe, +// kernel-savvy memory managers; make a class with the +// underlying allocator as the template parameter. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include + +template +class Cyg_Mempolt2 +{ +private: + T pool; // underlying memory manager + Cyg_ThreadQueue queue; // queue of waiting threads + + class Mempolt2WaitInfo { + private: + Mempolt2WaitInfo() {} + public: + cyg_int32 size; + cyg_uint8 *addr; + Mempolt2WaitInfo( cyg_int32 allocsize ) + { size = allocsize; addr = 0; } + }; + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Mempolt2( + cyg_uint8 *base, + cyg_int32 size, + CYG_ADDRWORD arg_thru ); // Constructor + ~Cyg_Mempolt2(); // Destructor + + // get some memory; wait if none available; return NULL if failed + // due to interrupt + cyg_uint8 *alloc( cyg_int32 size ); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + // get some memory with a timeout; return NULL if failed + // due to interrupt or timeout + cyg_uint8 *alloc( cyg_int32 size, cyg_tick_count abs_timeout ); +#endif + + // get some memory, return NULL if none available + cyg_uint8 *try_alloc( cyg_int32 size ); + + // free the memory back to the pool + cyg_bool free( cyg_uint8 *p, cyg_int32 size ); + + // if applicable: return -1 if not fixed size + cyg_int32 get_blocksize(); + + // is anyone waiting for memory? + cyg_bool waiting() { return ! queue.empty(); } + + // these two are obvious and generic + cyg_int32 get_totalmem(); + cyg_int32 get_freemem(); + + // get information about the construction parameters for external + // freeing after the destruction of the holding object. + void get_arena( + cyg_uint8 * &base, + cyg_int32 &size, + CYG_ADDRWORD &arg_thru ); + + // Return the size of the memory allocation (previously returned + // by alloc() or try_alloc() ) at ptr. Returns -1 if not found + cyg_int32 + get_allocation_size( cyg_uint8 * /* ptr */ ); +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MEMPOLT2_HXX +// EOF mempolt2.hxx diff --git a/packages/kernel/current/include/mempolt2.inl b/packages/kernel/current/include/mempolt2.inl new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mempolt2.inl @@ -0,0 +1,416 @@ +#ifndef CYGONCE_KERNEL_MEMPOLT2_INL +#define CYGONCE_KERNEL_MEMPOLT2_INL + +//========================================================================== +// +// mempolt2.inl +// +// Mempolt2 (Memory pool template) class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Define Mempolt2 class interface + +// Description: The class defined here provides the APIs for thread-safe, +// kernel-savvy memory managers; make a class with the +// underlying allocator as the template parameter. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // implementation eg. Cyg_Thread::self(); +#include // implementation eg. Cyg_Scheduler::lock(); + +// ------------------------------------------------------------------------- +// Constructor; we _require_ these arguments and just pass them through to +// the implementation memory pool in use. +template +Cyg_Mempolt2::Cyg_Mempolt2( + cyg_uint8 *base, + cyg_int32 size, + CYG_ADDRWORD arg_thru) // Constructor + : pool( base, size, arg_thru ) +{ +} + + +template +Cyg_Mempolt2::~Cyg_Mempolt2() // destructor +{ + // Prevent preemption + Cyg_Scheduler::lock(); + + while ( ! queue.empty() ) { + Cyg_Thread *thread = queue.dequeue(); + thread->set_wake_reason( Cyg_Thread::DESTRUCT ); + thread->wake(); + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); +} + +// ------------------------------------------------------------------------- +// get some memory; wait if none available +template +inline cyg_uint8 * +Cyg_Mempolt2::alloc( cyg_int32 size ) +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_uint8 *ret; + ret = pool.alloc( size ); + if ( ret ) { + Cyg_Scheduler::unlock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( ret ); + return ret; + } + + Cyg_Thread *self = Cyg_Thread::self(); + + Mempolt2WaitInfo waitinfo( size ); + + self->set_wait_info( (CYG_ADDRWORD)&waitinfo ); + self->set_sleep_reason( Cyg_Thread::WAIT ); + self->sleep(); + queue.enqueue( self ); + + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + + cyg_bool result = true; // just used as a flag here + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + + if ( ! result ) + ret = NULL; + else + ret = waitinfo.addr; + + CYG_ASSERT( (!result) || (NULL != ret), "Good result but no alloc!" ); + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( ret ); + return ret; +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +// ------------------------------------------------------------------------- +// get some memory with a timeout +template +inline cyg_uint8 * +Cyg_Mempolt2::alloc( cyg_int32 size, cyg_tick_count abs_timeout ) +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_uint8 *ret; + ret = pool.alloc( size ); + if ( ret ) { + Cyg_Scheduler::unlock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( ret ); + return ret; + } + + Cyg_Thread *self = Cyg_Thread::self(); + + Mempolt2WaitInfo waitinfo( size ); + + self->set_timer( abs_timeout, Cyg_Thread::TIMEOUT ); + + // If the timeout is in the past, the wake reason will have been set to + // something other than NONE already. If so, skip the wait and go + // straight to unlock. + + if( Cyg_Thread::NONE == self->get_wake_reason() ) { + self->set_wait_info( (CYG_ADDRWORD)&waitinfo ); + self->sleep(); + queue.enqueue( self ); + } + + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + + // clear the timer; if it actually fired, no worries. + self->clear_timer(); + + cyg_bool result = true; // just used as a flag here + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + result = false; + break; + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + + if ( ! result ) + ret = NULL; + else + ret = waitinfo.addr; + + CYG_ASSERT( (!result) || (NULL != ret), "Good result but no alloc!" ); + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_REPORT_RETVAL( ret ); + return ret; +} +#endif + +// ------------------------------------------------------------------------- +// get some memory, return NULL if none available +template +inline cyg_uint8 * +Cyg_Mempolt2::try_alloc( cyg_int32 size ) +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_uint8 *ret = pool.alloc( size ); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + return ret; +} + + +// ------------------------------------------------------------------------- +// free the memory back to the pool +template +cyg_bool +Cyg_Mempolt2::free( cyg_uint8 *p, cyg_int32 size ) +{ + CYG_REPORT_FUNCTION(); + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_int32 ret = pool.free( p, size ); + + // anyone waiting? + if ( !(queue.empty()) ) { + Mempolt2WaitInfo *p; + Cyg_Thread *thread; + +#ifdef CYGIMP_MEM_T_ONEFREE_TO_ONEALLOC + thread = queue.dequeue(); + p = (Mempolt2WaitInfo *)(thread->get_wait_info()); + CYG_ASSERT( NULL == p->addr, "Thread already awoken?" ); + + cyg_uint8 *mem; + mem = pool.alloc( p->size ); + CYG_ASSERT( NULL != mem, "That should have succeeded" ); + thread->set_wake_reason( Cyg_Thread::DONE ); + thread->wake(); + // return the successful value to it + p->addr = mem; +#else + Cyg_ThreadQueue holding; + do { + thread = queue.dequeue(); + p = (Mempolt2WaitInfo *)(thread->get_wait_info()); + CYG_ASSERT( NULL == p->addr, "Thread already awoken?" ); + + cyg_uint8 *mem; + if ( NULL != (mem = pool.alloc( p->size )) ) { + // success! awaken the thread + thread->set_wake_reason( Cyg_Thread::DONE ); + thread->wake(); + // return the successful value to it + p->addr = mem; + } + else { + // preserve the entry on the holding queue + holding.enqueue( thread ); + } + } while ( !(queue.empty()) ); + + // Now re-queue the unaffected threads back into the pool queue + // (no pun intended) + while ( !(holding.empty()) ) { + queue.enqueue( holding.dequeue() ); + } +#endif // CYGIMP_MEM_T_ONEFREE_TO_ONEALLOC + } + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( ret ); + return ret; +} + +// ------------------------------------------------------------------------- +// if applicable: return -1 if not fixed size +template +inline cyg_int32 +Cyg_Mempolt2::get_blocksize() +{ + // there should not be any atomicity issues here + return pool.get_blocksize(); +} + +// ------------------------------------------------------------------------- +// these two are obvious and generic, but need atomicity protection (maybe) +template +inline cyg_int32 +Cyg_Mempolt2::get_totalmem() +{ + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_int32 ret = pool.get_totalmem(); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + return ret; +} + +template +inline cyg_int32 +Cyg_Mempolt2::get_freemem() +{ + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_int32 ret = pool.get_freemem(); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + return ret; +} + +// ------------------------------------------------------------------------- +// get information about the construction parameters for external +// freeing after the destruction of the holding object +template +inline void +Cyg_Mempolt2::get_arena( + cyg_uint8 * &base, cyg_int32 &size, CYG_ADDRWORD &arg_thru ) +{ + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + pool.get_arena( base, size, arg_thru ); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); +} + +// ------------------------------------------------------------------------- +// Return the size of the memory allocation (previously returned +// by alloc() or try_alloc() ) at ptr. Returns -1 if not found +template +cyg_int32 +Cyg_Mempolt2::get_allocation_size( cyg_uint8 *ptr ) +{ + cyg_int32 ret; + + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + ret = pool.get_allocation_size( ptr ); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return ret; +} + +// ------------------------------------------------------------------------- +// debugging/assert function + +#ifdef CYGDBG_USE_ASSERTS + +template +inline cyg_bool +Cyg_Mempolt2::check_this(cyg_assert_class_zeal zeal) +{ + CYG_REPORT_FUNCTION(); + + if ( Cyg_Thread::DESTRUCT == Cyg_Thread::self()->get_wake_reason() ) + // then the whole thing is invalid, and we know it. + // so return OK, since this check should NOT make an error. + return true; + + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + + return true; +} +#endif + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MEMPOLT2_INL +// EOF mempolt2.inl diff --git a/packages/kernel/current/include/mempoolt.hxx b/packages/kernel/current/include/mempoolt.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mempoolt.hxx @@ -0,0 +1,112 @@ +#ifndef CYGONCE_KERNEL_MEMPOOLT_HXX +#define CYGONCE_KERNEL_MEMPOOLT_HXX + +//========================================================================== +// +// mempoolt.hxx +// +// Mempoolt (Memory pool template) class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Define Mempoolt class interface + +// Description: The class defined here provides the APIs for thread-safe, +// kernel-savvy memory managers; make a class with the +// underlying allocator as the template parameter. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include + +template +class Cyg_Mempoolt +{ +private: + T pool; // underlying memory manager + Cyg_ThreadQueue queue; // queue of waiting threads + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Mempoolt( + cyg_uint8 *base, + cyg_int32 size, + CYG_ADDRWORD arg_thru ); // Constructor + ~Cyg_Mempoolt(); // Destructor + + // get some memory; wait if none available; return NULL if failed + // due to interrupt + cyg_uint8 *alloc( cyg_int32 size ); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + // get some memory with a timeout; return NULL if failed + // due to interrupt or timeout + cyg_uint8 *alloc( cyg_int32 size, cyg_tick_count abs_timeout ); +#endif + + // get some memory, return NULL if none available + cyg_uint8 *try_alloc( cyg_int32 size ); + + // free the memory back to the pool + cyg_bool free( cyg_uint8 *p, cyg_int32 size ); + + // if applicable: return -1 if not fixed size + cyg_int32 get_blocksize(); + + // is anyone waiting for memory? + cyg_bool waiting() { return ! queue.empty(); } + + // these two are obvious and generic + cyg_int32 get_totalmem(); + cyg_int32 get_freemem(); + + // get information about the construction parameters for external + // freeing after the destruction of the holding object. + void get_arena( + cyg_uint8 * &base, + cyg_int32 &size, + CYG_ADDRWORD &arg_thru ); + + // Return the size of the memory allocation (previously returned + // by alloc() or try_alloc() ) at ptr. Returns -1 if not found + cyg_int32 + get_allocation_size( cyg_uint8 * /* ptr */ ); +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MEMPOOLT_HXX +// EOF mempoolt.hxx diff --git a/packages/kernel/current/include/mempoolt.inl b/packages/kernel/current/include/mempoolt.inl new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mempoolt.inl @@ -0,0 +1,382 @@ +#ifndef CYGONCE_KERNEL_MEMPOOLT_INL +#define CYGONCE_KERNEL_MEMPOOLT_INL + +//========================================================================== +// +// mempoolt.inl +// +// Mempoolt (Memory pool template) class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-10 +// Purpose: Define Mempoolt class interface + +// Description: The class defined here provides the APIs for thread-safe, +// kernel-savvy memory managers; make a class with the +// underlying allocator as the template parameter. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // implementation eg. Cyg_Thread::self(); +#include // implementation eg. Cyg_Scheduler::lock(); + +// ------------------------------------------------------------------------- +// Constructor; we _require_ these arguments and just pass them through to +// the implementation memory pool in use. +template +Cyg_Mempoolt::Cyg_Mempoolt( + cyg_uint8 *base, + cyg_int32 size, + CYG_ADDRWORD arg_thru) // Constructor + : pool( base, size, arg_thru ) +{ +} + + +template +Cyg_Mempoolt::~Cyg_Mempoolt() // destructor +{ + // Prevent preemption + Cyg_Scheduler::lock(); + + while ( ! queue.empty() ) { + Cyg_Thread *thread = queue.dequeue(); + thread->set_wake_reason( Cyg_Thread::DESTRUCT ); + thread->wake(); + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); +} + +// ------------------------------------------------------------------------- +// get some memory; wait if none available +template +inline cyg_uint8 * +Cyg_Mempoolt::alloc( cyg_int32 size ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Loop while we got no memory, sleeping each time around the + // loop. This copes with the possibility of a higher priority thread + // grabbing the freed storage between the wakeup in free() and this + // thread actually starting. + cyg_uint8 *ret; + cyg_bool result = true; + while( result && (NULL == (ret = pool.alloc( size ))) ) { + self->set_sleep_reason( Cyg_Thread::WAIT ); + self->sleep(); + queue.enqueue( self ); + + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + CYG_ASSERTCLASS( this, "Bad this pointer"); + + if ( ! result ) + ret = NULL; + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( ret ); + return ret; +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +// ------------------------------------------------------------------------- +// get some memory with a timeout +template +inline cyg_uint8 * +Cyg_Mempoolt::alloc( cyg_int32 size, cyg_tick_count abs_timeout ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Loop while we got no memory, sleeping each time around the + // loop. This copes with the possibility of a higher priority thread + // grabbing the freed storage between the wakeup in free() and this + // thread actually starting. + cyg_uint8 *ret; + cyg_bool result = true; + // Set the timer _once_ outside the loop. + self->set_timer( abs_timeout, Cyg_Thread::TIMEOUT ); + + // If the timeout is in the past, the wake reason will have been + // set to something other than NONE already. Set the result false + // to force an immediate return. + + if( self->get_wake_reason() != Cyg_Thread::NONE ) + result = false; + + while( result && (NULL == (ret = pool.alloc( size ))) ) { + self->set_sleep_reason( Cyg_Thread::TIMEOUT ); + self->sleep(); + queue.enqueue( self ); + + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + result = false; + break; + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + if ( ! result ) + ret = NULL; + + // clear the timer; if it actually fired, no worries. + self->clear_timer(); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( ret ); + return ret; +} +#endif + +// ------------------------------------------------------------------------- +// get some memory, return NULL if none available +template +inline cyg_uint8 * +Cyg_Mempoolt::try_alloc( cyg_int32 size ) +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_uint8 *ret = pool.alloc( size ); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( ret ); + return ret; +} + + +// ------------------------------------------------------------------------- +// free the memory back to the pool +template +cyg_bool +Cyg_Mempoolt::free( cyg_uint8 *p, cyg_int32 size ) +{ + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_int32 ret = pool.free( p, size ); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + while ( ret && !queue.empty() ) { + // we succeeded and there are people waiting + Cyg_Thread *thread = queue.dequeue(); + + CYG_ASSERTCLASS( thread, "Bad thread pointer"); + + // we wake them all up (ie. broadcast) to cope with variable block + // allocators freeing a big block when lots of small allocs wait. + thread->set_wake_reason( Cyg_Thread::DONE ); + thread->wake(); + // we cannot yield here; if a higher prio thread can't satisfy its + // request it would re-queue and we would loop forever + } + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + return ret; +} + +// ------------------------------------------------------------------------- +// if applicable: return -1 if not fixed size +template +inline cyg_int32 +Cyg_Mempoolt::get_blocksize() +{ + // there should not be any atomicity issues here + return pool.get_blocksize(); +} + +// ------------------------------------------------------------------------- +// these two are obvious and generic, but need atomicity protection (maybe) +template +inline cyg_int32 +Cyg_Mempoolt::get_totalmem() +{ + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_int32 ret = pool.get_totalmem(); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + return ret; +} + +template +inline cyg_int32 +Cyg_Mempoolt::get_freemem() +{ + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_int32 ret = pool.get_freemem(); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + return ret; +} + +// ------------------------------------------------------------------------- +// get information about the construction parameters for external +// freeing after the destruction of the holding object +template +inline void +Cyg_Mempoolt::get_arena( + cyg_uint8 * &base, cyg_int32 &size, CYG_ADDRWORD &arg_thru ) +{ + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + pool.get_arena( base, size, arg_thru ); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); +} + +// ------------------------------------------------------------------------- +// Return the size of the memory allocation (previously returned +// by alloc() or try_alloc() ) at ptr. Returns -1 if not found +template +cyg_int32 +Cyg_Mempoolt::get_allocation_size( cyg_uint8 *ptr ) +{ + cyg_int32 ret; + + // Prevent preemption + Cyg_Scheduler::lock(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + ret = pool.get_allocation_size( ptr ); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return ret; +} + +// ------------------------------------------------------------------------- +// debugging/assert function + +#ifdef CYGDBG_USE_ASSERTS + +template +inline cyg_bool +Cyg_Mempoolt::check_this(cyg_assert_class_zeal zeal) +{ + CYG_REPORT_FUNCTION(); + + if ( Cyg_Thread::DESTRUCT == Cyg_Thread::self()->get_wake_reason() ) + // then the whole thing is invalid, and we know it. + // so return OK, since this check should NOT make an error. + return true; + + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + + return true; +} +#endif + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MEMPOOLT_INL +// EOF mempoolt.inl diff --git a/packages/kernel/current/include/memvar.hxx b/packages/kernel/current/include/memvar.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/memvar.hxx @@ -0,0 +1,129 @@ +#ifndef CYGONCE_KERNEL_MEMVAR_HXX +#define CYGONCE_KERNEL_MEMVAR_HXX + +//========================================================================== +// +// memvar.hxx +// +// Memory pool with variable block class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-05-21 +// Purpose: Define Memvar class interface +// Description: Inline class for constructing a variable block allocator +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // kernel types +#include // assertion macros + +#ifdef CYGIMP_MEM_USE_MEMPOOLT_PLAIN +#include // kernel safe mempool template +#else +#include // kernel safe mempool template +#endif + +#include // implementation of a variable mem pool + +class Cyg_Mempool_Variable { +private: +#ifdef CYGIMP_MEM_USE_MEMPOOLT_PLAIN + Cyg_Mempoolt mypool; +#else + Cyg_Mempolt2 mypool; +#endif + +public: + // this API makes concrete a class which implements a thread-safe + // kernel-savvy memory pool which manages variable size blocks. + + CYGDBG_DEFINE_CHECK_THIS + + // Constructor: gives the base and size of the arena in which memory is + // to be carved out, note that management structures are taken from the + // same arena. Alignment is the alignment of allocated blocks. + Cyg_Mempool_Variable( + cyg_uint8 * /* base */, + cyg_int32 /* size */); + + // Destructor + ~Cyg_Mempool_Variable(); + + // get some memory; wait if none available + cyg_uint8 * + alloc(cyg_int32 /* size */); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + // get some memory with a timeout + cyg_uint8 * + alloc(cyg_int32 /* size */, cyg_tick_count /* delay_timeout */ ); +#endif + + // get some memory, return NULL if none available + cyg_uint8 * + try_alloc(cyg_int32 /* size */ ); + + // free the memory back to the pool + cyg_bool + free( cyg_uint8 * /* ptr */, cyg_int32 /* size */ ); + + // is anyone waiting for memory? + cyg_bool + waiting( void ); + + // read the fixed allocation size (-1 indicates variable) + cyg_int32 + get_blocksize( void ); + + // these two are obvious and generic + cyg_int32 + get_totalmem( void ); + + cyg_int32 + get_freemem( void ); + + // get information about the construction parameters for external + // freeing after the destruction of the holding object + // also finds largest free block + void + get_arena( cyg_uint8 * & /* base */, cyg_int32 & /* size */, + CYG_ADDRWORD & /* maxfree */ ); + + // Return the size of the memory allocation (previously returned + // by alloc() or try_alloc() ) at ptr. Returns -1 if not found + cyg_int32 + get_allocation_size( cyg_uint8 * /* ptr */ ); +}; + +#endif // ifndef CYGONCE_KERNEL_MEMVAR_HXX +// EOF memvar.hxx diff --git a/packages/kernel/current/include/mfiximpl.hxx b/packages/kernel/current/include/mfiximpl.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mfiximpl.hxx @@ -0,0 +1,118 @@ +#ifndef CYGONCE_KERNEL_MFIXIMPL_HXX +#define CYGONCE_KERNEL_MFIXIMPL_HXX + +//========================================================================== +// +// mfiximpl.hxx +// +// Memory pool with fixed block class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-23 +// Purpose: Define Mfiximpl class interface +// Description: Inline class for constructing a fixed block allocator +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include + +class Cyg_Mempool_Fixed_Implementation { +private: + // these constructors are explicitly disallowed + Cyg_Mempool_Fixed_Implementation() {}; +// Cyg_Mempool_Fixed_Implementation( Cyg_Mempool_Fixed_Implementation &ref ) +// {}; + Cyg_Mempool_Fixed_Implementation & + operator=( Cyg_Mempool_Fixed_Implementation &ref ) + { return ref; }; + +private: + cyg_uint32 *bitmap; + cyg_int32 maptop; + cyg_uint8 *mempool; + cyg_int32 numblocks; + cyg_int32 freeblocks; + cyg_int32 blocksize; + cyg_int32 firstfree; + cyg_uint8 *top; + +public: + // THIS is the public API of memory pools generally that can have the + // kernel oriented thread-safe package layer atop. + // + // The kernel package is a template whose type parameter is one of + // these. That is the reason there are superfluous parameters here and + // more genereralization than might be expected in a fixed block + // allocator. + + // Constructor: gives the base and size of the arena in which memory is + // to be carved out, note that management structures are taken from the + // same arena. The alloc_unit may be any other param in general; it + // comes through from the outer constructor unchanged. + Cyg_Mempool_Fixed_Implementation( + cyg_uint8 *base, + cyg_int32 size, + CYG_ADDRWORD alloc_unit ); + + // Destructor + ~Cyg_Mempool_Fixed_Implementation(); + + // get some memory; size is ignored in a fixed block allocator + inline cyg_uint8 *alloc( cyg_int32 size ); + + // free the memory back to the pool; size ignored here + inline cyg_bool free( cyg_uint8 *p, cyg_int32 size ); + + // if applicable: return -1 if not fixed size + inline cyg_int32 get_blocksize() { return blocksize; } + + // these two are obvious and generic + inline cyg_int32 get_totalmem() { return blocksize * numblocks; } + inline cyg_int32 get_freemem() { return blocksize * freeblocks; } + + // get information about the construction parameters for external + // freeing after the destruction of the holding object + inline void get_arena( cyg_uint8 * &base, cyg_int32 &size, CYG_ADDRWORD &alloc ) + { + base = (cyg_uint8 *)bitmap; + size = top - base; + alloc = blocksize; + } + +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MFIXIMPL_HXX +// EOF mfiximpl.hxx diff --git a/packages/kernel/current/include/mfiximpl.inl b/packages/kernel/current/include/mfiximpl.inl new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mfiximpl.inl @@ -0,0 +1,155 @@ +#ifndef CYGONCE_KERNEL_MFIXIMPL_INL +#define CYGONCE_KERNEL_MFIXIMPL_INL + +//========================================================================== +// +// mfiximpl.inl +// +// Memory pool with fixed block class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-23 +// Purpose: Define Mfiximpl class interface +// Description: Inline class for constructing a fixed block allocator +// Usage: #include +// #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // HAL_LSBIT_INDEX magic asm code + + +Cyg_Mempool_Fixed_Implementation::Cyg_Mempool_Fixed_Implementation( + cyg_uint8 *base, + cyg_int32 size, + CYG_ADDRWORD alloc_unit ) +{ + cyg_int32 i; + bitmap = (cyg_uint32 *)base; + blocksize = alloc_unit; + numblocks = size / blocksize; + top = base + size; + + CYG_ASSERT( blocksize > 0, "Bad blocksize" ); + CYG_ASSERT( size > 2, "Bad blocksize" ); + CYG_ASSERT( blocksize < size, "blocksize, size bad" ); + CYG_ASSERT( numblocks >= 2, "numblocks bad" ); + + i = (numblocks + 31)/32; // number of words to map blocks + while ( (i * 4 + numblocks * blocksize) > size ) { + numblocks --; // steal one block for admin + i = (numblocks + 31)/32; // number of words to map blocks + } + + CYG_ASSERT( 0 < i, "Bad word count for bitmap after fitment" ); + CYG_ASSERT( 0 < numblocks, "Bad block count after fitment" ); + + maptop = i; + // this should leave space for the bitmap and maintain alignment + mempool = top - (numblocks * blocksize); + CYG_ASSERT( base < mempool && mempool < top, "mempool escaped" ); + CYG_ASSERT( (cyg_uint8 *)(&bitmap[ maptop ]) <= mempool, + "mempool overwrites bitmap" ); + CYG_ASSERT( &mempool[ numblocks * blocksize ] <= top, + "mempool overflows top" ); + freeblocks = numblocks; + firstfree = 0; + + // clear out the bitmap; no blocks allocated yet + for ( i = 0; i < maptop; i++ ) + bitmap[ i ] = 0; + // apart from the non-existent ones at the top + for ( i = ((numblocks-1)&31) + 1; i < 32; i++ ) + bitmap[ maptop - 1 ] |= ( 1 << i ); +} + +Cyg_Mempool_Fixed_Implementation::~Cyg_Mempool_Fixed_Implementation() +{ +} + +inline cyg_uint8 * +Cyg_Mempool_Fixed_Implementation::alloc( cyg_int32 size ) +{ + // size parameter is not used + CYG_UNUSED_PARAM( cyg_int32, size ); + if ( 0 >= freeblocks ) + return NULL; + cyg_int32 i = firstfree; + cyg_uint8 *p = NULL; + do { + if ( 0xffffffff != bitmap[ i ] ) { + // then there is a free block in this bucket + register cyg_uint32 j, k; + k = ~bitmap[ i ]; // look for a 1 in complement + HAL_LSBIT_INDEX( j, k ); + CYG_ASSERT( 0 <= j && j <= 31, "Bad bit index" ); + CYG_ASSERT( 0 == (bitmap[ i ] & (1 << j)), "Found bit not clear" ); + bitmap[ i ] |= (1 << j); // set it allocated + firstfree = i; + freeblocks--; + CYG_ASSERT( freeblocks >= 0, "allocated too many" ); + p = &mempool[ ((32 * i) + j) * blocksize ]; + break; + } + if ( ++i >= maptop ) + i = 0; // wrap if at top + } while ( i != firstfree ); // prevent hang if internal error + CYG_ASSERT( NULL != p, "Should have a block here" ); + CYG_ASSERT( mempool <= p && p <= top, "alloc mem escaped" ); + return p; +} + +inline cyg_bool +Cyg_Mempool_Fixed_Implementation::free( cyg_uint8 *p, cyg_int32 size ) +{ + // size parameter is not used + CYG_UNUSED_PARAM( cyg_int32, size ); + if ( p < mempool || p >= top ) + return false; // address way out of bounds + cyg_int32 i = p - mempool; + i = i / blocksize; + if ( &mempool[ i * blocksize ] != p ) + return false; // address not aligned + cyg_int32 j = i / 32; + CYG_ASSERT( 0 <= j && j < maptop, "map index escaped" ); + i = i - 32 * j; + CYG_ASSERT( 0 <= i && i < 32, "map bit index escaped" ); + if ( ! ((1 << i) & bitmap[ j ] ) ) + return false; // block was not allocated + bitmap[ j ] &=~(1 << i); // clear the bit + freeblocks++; // count the block + CYG_ASSERT( freeblocks <= numblocks, "freeblocks overflow" ); + return true; +} + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MFIXIMPL_INL +// EOF mfiximpl.inl diff --git a/packages/kernel/current/include/mlqueue.hxx b/packages/kernel/current/include/mlqueue.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mlqueue.hxx @@ -0,0 +1,243 @@ +#ifndef CYGONCE_KERNEL_MLQUEUE_HXX +#define CYGONCE_KERNEL_MLQUEUE_HXX + +//========================================================================== +// +// mlqueue.hxx +// +// Multi-Level Queue scheduler class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-10 +// Purpose: Define multilevel queue scheduler implementation +// Description: The classes defined here are used as base classes +// by the common classes that define schedulers and thread +// things. The MLQ scheduler in various configurations +// provides standard FIFO, round-robin and single priority +// schedulers. +// Usage: Included according to configuration by +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +// ------------------------------------------------------------------------- +// The macro CYGNUM_KERNEL_SCHED_PRIORITIES contains the number of priorities +// supported by the scheduler. + +#ifndef CYGNUM_KERNEL_SCHED_PRIORITIES +#define CYGNUM_KERNEL_SCHED_PRIORITIES 32 // define a default +#endif + +// set bitmap size +#define CYGNUM_KERNEL_SCHED_BITMAP_SIZE CYGNUM_KERNEL_SCHED_PRIORITIES + +// ------------------------------------------------------------------------- +// The macro CYGNUM_KERNEL_SCHED_BITMAP_SIZE contains the number of bits that the +// scheduler bitmap should contain. It is derived from the number of prioirity +// levels defined by the configuration. + +#if CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 8 +typedef cyg_ucount8 cyg_sched_bitmap; +#elif CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 16 +typedef cyg_ucount16 cyg_sched_bitmap; +#elif CYGNUM_KERNEL_SCHED_BITMAP_SIZE <= 32 +typedef cyg_ucount32 cyg_sched_bitmap; +#else +#error Bitmaps greater than 32 bits not currently allowed +#endif + +// ------------------------------------------------------------------------- +// Customize the scheduler + +#define CYGIMP_THREAD_PRIORITY 1 // Threads have changable priorities +#define CYG_SCHED_UNIQUE_PRIORITIES 0 // Threads don't have unique priorities + +#define CYG_THREAD_MIN_PRIORITY (CYGNUM_KERNEL_SCHED_PRIORITIES-1) +#define CYG_THREAD_MAX_PRIORITY 0 + +// set default scheduling info value for thread constructors. +#define CYG_SCHED_DEFAULT_INFO CYG_THREAD_MAX_PRIORITY + +// ------------------------------------------------------------------------- +// Thread queue implementation. +// This class provides the (scheduler specific) implementation of the +// thread queue class. + +class Cyg_ThreadQueue_Implementation +{ + friend class Cyg_Scheduler_Implementation; + friend class Cyg_SchedThread_Implementation; + + Cyg_Thread *queue; + +protected: + + // API used by Cyg_ThreadQueue + + Cyg_ThreadQueue_Implementation(); // Constructor + + // Add thread to queue + void enqueue(Cyg_Thread *thread); + + // return first thread on queue + Cyg_Thread *highpri(); + + // remove first thread on queue + Cyg_Thread *dequeue(); + + // remove specified thread from queue + void remove(Cyg_Thread *thread); + + // test if queue is empty + cyg_bool empty(); + + void rotate(); // Rotate the queue +}; + +inline cyg_bool Cyg_ThreadQueue_Implementation::empty() +{ + return queue == NULL; +} + +// ------------------------------------------------------------------------- +// This class contains the implementation details of the scheduler, and +// provides a standard API for accessing it. + +class Cyg_Scheduler_Implementation + : public Cyg_Scheduler_Base +{ + friend class Cyg_ThreadQueue_Implementation; + friend class Cyg_SchedThread_Implementation; + friend class Cyg_HardwareThread; + + // Mask of which run queues have ready threads + cyg_sched_bitmap queue_map; + + // Each run queue is a double linked circular list of threads. + // These pointers point to the head element of each list. + Cyg_ThreadQueue_Implementation run_queue[CYGNUM_KERNEL_SCHED_PRIORITIES]; + +protected: + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + + // Timeslice counter. This is decremented on each + // clock tick, and a timeslice is performed each + // time it zeroes. + + static cyg_ucount32 timeslice_count; + + static void reset_timeslice_count(); + +#endif + + Cyg_Scheduler_Implementation(); // Constructor + + // The following functions provide the scheduler implementation + // interface to the Cyg_Scheduler class. These are protected + // so that only the scheduler can call them. + + // choose a new thread + Cyg_Thread *schedule(); + + // make thread schedulable + void add_thread(Cyg_Thread *thread); + + // make thread un-schedulable + void rem_thread(Cyg_Thread *thread); + + // register thread with scheduler + void register_thread(Cyg_Thread *thread); + + // deregister thread + void deregister_thread(Cyg_Thread *thread); + + // Test the given priority for uniqueness + cyg_bool unique( cyg_priority priority); + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + + // If timeslicing is enbled, define a scheduler + // entry point to do timeslicing. This will be + // called from the RTC DSR. +public: + void timeslice(); + +#endif + +}; + +// ------------------------------------------------------------------------- +// Cyg_Scheduler_Implementation inlines + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + +inline void Cyg_Scheduler_Implementation::reset_timeslice_count() +{ + timeslice_count = CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS; +} + +#endif + +// ------------------------------------------------------------------------- +// Scheduler thread implementation. +// This class provides the implementation of the scheduler specific parts +// of each thread. + +class Cyg_SchedThread_Implementation +{ + friend class Cyg_Scheduler_Implementation; + friend class Cyg_ThreadQueue_Implementation; + + Cyg_Thread *next; // next thread in queue + Cyg_Thread *prev; // previous thread in queue + + void insert( Cyg_Thread *thread ); // Insert thread in front of this + + void remove(); // remove this from queue + +protected: + + cyg_priority priority; // current thread priority + + Cyg_SchedThread_Implementation(CYG_ADDRWORD sched_info); + + void yield(); // Yield CPU to next thread + + static void rotate_queue( cyg_priority pri ); + // Rotate that run queue +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MLQUEUE_HXX +// EOF mlqueue.hxx diff --git a/packages/kernel/current/include/mutex.hxx b/packages/kernel/current/include/mutex.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mutex.hxx @@ -0,0 +1,120 @@ +#ifndef CYGONCE_KERNEL_MUTEX_HXX +#define CYGONCE_KERNEL_MUTEX_HXX + +//========================================================================== +// +// mutex.hxx +// +// Mutex class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Define Mutex class interfaces +// Description: The classes defined here provide the APIs for mutexes +// and condition variables. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros + +#include + +// ------------------------------------------------------------------------- +// Mutex. + +class Cyg_Mutex +{ + friend class Cyg_Condition_Variable; + + cyg_atomic locked; // true if locked + + Cyg_Thread *owner; // Current locking thread + + Cyg_ThreadQueue queue; // Queue of waiting threads + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Mutex(); // Create in unlocked state + + ~Cyg_Mutex(); // Destructor + + cyg_bool lock(); // lock and/or wait + + cyg_bool trylock(); // try to lock and return success + + void unlock(); // unlock + +}; + +// ------------------------------------------------------------------------- +// Condition variable. + +class Cyg_Condition_Variable +{ + Cyg_Mutex *mutex; // Associated mutex + + Cyg_ThreadQueue queue; // Queue of waiting threads + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Condition_Variable( + Cyg_Mutex &mutex // linked mutex + ); + + ~Cyg_Condition_Variable(); // Destructor + + void wait(); // Wait for condition to be true + + void signal(); // Set cond true, wake one thread + + void broadcast(); // Set cond true, wake all threads + +#ifdef CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT + + // Wait until a signal or timeout expiry + cyg_bool wait( cyg_tick_count timeout ); + +#endif + +}; + + +// ------------------------------------------------------------------------- + +#endif // ifndef CYGONCE_KERNEL_MUTEX_HXX +// EOF mutex.hxx diff --git a/packages/kernel/current/include/mvarimpl.hxx b/packages/kernel/current/include/mvarimpl.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mvarimpl.hxx @@ -0,0 +1,130 @@ +#ifndef CYGONCE_KERNEL_MVARIMPL_HXX +#define CYGONCE_KERNEL_MVARIMPL_HXX + +//========================================================================== +// +// mvarimpl.hxx +// +// Memory pool with variable block class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-05-21 +// Purpose: Define Mvarimpl class interface +// Description: Inline class for constructing a variable block allocator +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include + +class Cyg_Mempool_Variable_Implementation { +private: + // these constructors are explicitly disallowed + Cyg_Mempool_Variable_Implementation() {}; +// Cyg_Mempool_Variable_Implementation( Cyg_Mempool_Variable_Implementation &ref ) +// {}; + Cyg_Mempool_Variable_Implementation & + operator=( Cyg_Mempool_Variable_Implementation &ref ) + { return ref; }; + +private: + struct memdq { + struct memdq *prev, *next; + cyg_int32 size; + }; + + struct memdq head; + cyg_uint8 *obase; + cyg_int32 osize; + cyg_int32 oalign; + cyg_uint8 *bottom; + cyg_uint8 *top; + cyg_int32 alignment; + cyg_int32 freemem; + + // round up size passed to alloc/free to a size that will be used + // for allocation + cyg_int32 + roundup(cyg_int32 size); + +public: + // THIS is the public API of memory pools generally that can have the + // kernel oriented thread-safe package layer atop. + + // Constructor: gives the base and size of the arena in which memory is + // to be carved out. + Cyg_Mempool_Variable_Implementation( + cyg_uint8 * /* base */, + cyg_int32 /* size */, + CYG_ADDRWORD /* alignment */); + + // Destructor + ~Cyg_Mempool_Variable_Implementation(); + + // get size bytes of memory + inline cyg_uint8 * + alloc( cyg_int32 /* size */ ); + + // free size bytes of memory back to the pool + inline cyg_bool + free( cyg_uint8 * /* ptr */, + cyg_int32 /* size */ ); + + // returns -1 as not variable size + inline cyg_int32 + get_blocksize( void ) { return -1; } + + // these two are obvious and generic + inline cyg_int32 + get_totalmem( void ) { return top-bottom; } + + inline cyg_int32 + get_freemem( void ) { return freemem; } + + // get information about the construction parameters for external + // freeing after the destruction of the holding object + inline void + get_arena( cyg_uint8 * & /* base */, + cyg_int32 & /* size */, + CYG_ADDRWORD & /* maxfree */ ); + + // Return the size of the memory allocation (previously returned + // by alloc() or try_alloc() ) at ptr. Returns -1 if not found + inline cyg_int32 + get_allocation_size( cyg_uint8 * /* ptr */ ); + +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MVARIMPL_HXX +// EOF mvarimpl.hxx diff --git a/packages/kernel/current/include/mvarimpl.inl b/packages/kernel/current/include/mvarimpl.inl new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/mvarimpl.inl @@ -0,0 +1,283 @@ +#ifndef CYGONCE_KERNEL_MVARIMPL_INL +#define CYGONCE_KERNEL_MVARIMPL_INL + +//========================================================================== +// +// mvarimpl.inl +// +// Memory pool with variable block class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-23 +// Purpose: Define Mvarimpl class interface +// Description: Inline class for constructing a variable block allocator +// Usage: #include +// #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +// Simple non-coalescing allocator + +// The free list is stored on a doubly linked list, each member of +// which is stored in the body of the free memory. The head of the +// list has the same structure but its size field is zero. This +// resides in the memory pool structure. Always having at least one +// item on the list simplifies the alloc and free code. + +// +inline cyg_int32 +Cyg_Mempool_Variable_Implementation::roundup( cyg_int32 size ) +{ + + size += sizeof(struct memdq); + size = (size + alignment - 1) & -alignment; + return size; +} + +Cyg_Mempool_Variable_Implementation::Cyg_Mempool_Variable_Implementation( + cyg_uint8 *base, + cyg_int32 size, + CYG_ADDRWORD align ) +{ + CYG_ASSERT( align > 0, "Bad alignment" ); + CYG_ASSERT( size > 0, "Bad size" ); + CYG_ASSERT(0!=align ,"align is zero"); + CYG_ASSERT(0==(align & align-1),"align not a power of 2"); + + obase=base; + osize=size; + oalign=align; + + alignment = align; + while(alignment < (cyg_int32)sizeof(struct memdq)) + alignment += alignment; + CYG_ASSERT(0==(alignment & alignment-1),"alignment not a power of 2"); + + bottom = (cyg_uint8 *)roundup((cyg_int32)base); + top = (cyg_uint8 *)((cyg_int32)(base+size) & -alignment); + + CYG_ASSERT( top > bottom , "heap too small" ); + CYG_ASSERT( ((cyg_int32)bottom & alignment-1)==0, "bottom badly aligned" ); + CYG_ASSERT( ((cyg_int32)top & alignment-1)==0, "top badly aligned" ); + + struct memdq *hdq = &head, *dq = (struct memdq *)bottom; + + hdq->prev = hdq->next = dq; + hdq->size = 0; + dq->prev = dq->next = hdq; + + freemem = dq->size = top-bottom; +} + +Cyg_Mempool_Variable_Implementation::~Cyg_Mempool_Variable_Implementation() +{ +} + +// allocation is simple +// First we look down the free list for a large enough block +// If we find a block the right size, we unlink the block from +// the free list and return a pointer to it. +// If we find a larger block, we chop a piece off the end +// and return that +// Otherwise we will eventually get back to the head of the list +// and return NULL +inline cyg_uint8 * +Cyg_Mempool_Variable_Implementation::alloc( cyg_int32 size ) +{ + struct memdq *dq = &head; + cyg_uint8 *alloced; + + size = roundup(size); + + do { + CYG_ASSERT( dq->next->prev==dq, "Bad link in dq"); + dq = dq->next; + if(0 == dq->size) { + CYG_ASSERT(dq == &head, "bad free block"); + return NULL; + } + } while(dq->size < size); + + if( size == dq->size ) { + // exact fit -- unlink from free list + dq->prev->next = dq->next; + dq->next->prev = dq->prev; + alloced = (cyg_uint8 *)dq; + } else { + + CYG_ASSERT( dq->size > size, "block found is too small"); + + // allocate portion of memory from end of block + + dq->size -=size; + + // The portion left over has to be large enough to store a + // struct memdq. This is guaranteed because the alignment is + // larger than the size of this structure. + + CYG_ASSERT( (cyg_int32)sizeof(struct memdq)<=dq->size , + "not enough space for list item" ); + + alloced = (cyg_uint8 *)dq + dq->size; + } + + CYG_ASSERT( bottom<=alloced && alloced<=top, "alloced outside pool" ); + + // Set size on allocated block + + dq = (struct memdq *)alloced; + dq->size = size; + dq->next = dq->prev = (struct memdq *)0xd530d53; // magic number + + freemem -=size; + return alloced + sizeof(struct memdq); +} + +// As no coalescing is done, free is simply a matter of using the +// freed memory as an element of the free list linking it in at the +// start. + +inline cyg_bool +Cyg_Mempool_Variable_Implementation::free( cyg_uint8 *p, cyg_int32 size ) +{ + if(!(bottom<=p&&p<=top)) + return false; + + struct memdq *hdq=&head,*dq=(struct memdq *)(p-sizeof(struct memdq)); + + // check magic number in block to be freed + if(dq->next != dq->prev || dq->next != (struct memdq *)0xd530d53) + return false; + + if(0==size) { + size = dq->size; + } else { + size = roundup(size); + } + + if(dq->size != size) + return false; + + CYG_ASSERT( (cyg_int32)sizeof(struct memdq)<=size , + "not enough space for list item" ); + +#ifdef CYGSEM_KERNEL_MEMORY_COALESCE +// For simple coalescing have the free list be sorted by memory base address + struct memdq *idq; + + for (idq = hdq->next; idq != hdq; idq = idq->next) { + if (idq < dq) + break; + } + dq->size = size; + if (idq != hdq) { + dq->prev = idq; + dq->next = idq->next; + idq->next = dq; + dq->next->prev = dq; + } else { + dq->next = idq; + dq->prev = idq->prev; + idq->prev = dq; + dq->prev->next = dq; + } + // Now do coalescing + if ((char *)dq + dq->size == (char *)dq->next) { + dq->size += dq->next->size; + dq->next = dq->next->next; + dq->next->prev = dq; + } + if ((char *)dq->prev + dq->prev->size == (char *)dq) { + dq->prev->size += dq->size; + dq->prev->next = dq->next; + dq->next->prev = dq->prev; + dq = dq->prev; + } +#else + dq->prev = hdq; + dq->next = hdq->next; + dq->size = size; + hdq->next = dq; + dq->next->prev=dq; +#endif + + freemem +=size; + return true; +} + + +inline void +Cyg_Mempool_Variable_Implementation::get_arena( + cyg_uint8 * &base, + cyg_int32 &size, + CYG_ADDRWORD &maxfree) +{ + struct memdq *dq = &head; + cyg_int32 mf = 0; + + do { + CYG_ASSERT( dq->next->prev==dq, "Bad link in dq"); + dq = dq->next; + if(0 == dq->size) { + CYG_ASSERT(dq == &head, "bad free block"); + break; + } + if(dq->size > mf) + mf = dq->size; + } while(1); + + base = obase; + size = osize; + maxfree = mf; +} + + +inline cyg_int32 +Cyg_Mempool_Variable_Implementation::get_allocation_size( cyg_uint8 *ptr ) +{ + CYG_CHECK_DATA_PTR(ptr, "Requested allocation size of bad data pointer!"); + + if(!(bottom<=ptr && ptr<=top)) + return -1; + + struct memdq *dq=(struct memdq *)(ptr-sizeof(struct memdq)); + + // check magic number in block to be freed + if(dq->next != dq->prev || dq->next != (struct memdq *)0xd530d53) + return -1; + + return dq->size; + +} // get_allocation_size() + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_MVARIMPL_INL +// EOF mvarimpl.inl diff --git a/packages/kernel/current/include/pkgconf/kernel.h b/packages/kernel/current/include/pkgconf/kernel.h new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/pkgconf/kernel.h @@ -0,0 +1,1229 @@ +#ifndef CYGONCE_PKGCONF_KERNEL_H +#define CYGONCE_PKGCONF_KERNEL_H +// ==================================================================== +// +// pkgconf/kernel.h +// +// Kernel configuration file +// +// ==================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +// ==================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-29 +// Purpose: To allow the user to edit kernel configuration options. +// Description: +// +//####DESCRIPTIONEND#### +// +// ==================================================================== + +/* --------------------------------------------------------------------- + * Some of the kernel configuration options depend on global options, + * so it is necessary to include the global options first. + */ + +#include + +/* Only define options if the kernel is to be present */ +#ifdef CYGPKG_KERNEL + +#include +#include + +/* --------------------------------------------------------------------- + * The overall package definition. + + {{CFG_DATA + + cdl_package CYGPKG_KERNEL { + display "eCos kernel" + type boolean + requires CYGFUN_HAL_COMMON_KERNEL_SUPPORT + description " + This package contains the core functionality of the eCos + kernel. It relies on functionality provided by various HAL + packages and by the eCos infrastructure. In turn the eCos + kernel provides support for other packages such as the device + drivers and the uITRON compatibility layer." + doc ref/ecos-ref/ecos-kernel-overview.html + } + + }}CFG_DATA */ + +/* --------------------------------------------------------------------- + * The first component within the kernel is related to interrupt + * handling. + {{CFG_DATA + + cdl_component CYGPKG_KERNEL_INTERRUPTS { + display "Kernel interrupt handling" + parent CYGPKG_KERNEL + type dummy + description " + The majority of configuration options related to interrupt + handling are in the HAL packages, since usually the code has + to be platform-specific. There are a number of options + provided within the kernel related to slightly higher-level + concepts, for example Delayed Service Routines." + doc ref/ecos-ref/interrupts.html + } + + # In the absence of active-if support this has to be + # a sub-component. It does not use the CYGPKG_ prefix to make + # it easier to change back into an ordinary option later on. + cdl_component CYGIMP_KERNEL_INTERRUPTS_DSRS { + display "Use delayed service routines (DSRs)" + parent CYGPKG_KERNEL_INTERRUPTS + description " + In eCos the recommended way to handle device interrupts is to + do a minimum amount of work inside the low level interrupt + handler itself, and instead do as much as possible in a + Delayed Service Routine or DSR. If an application does not + make use of DSRs directly or indirectly then it is possible + to disable the DSR support completely, which reduces the + overheads of context switches and interrupt handling. Note + that the kernel real-time clock makes use of DSRs, as do many + of the device drivers. " + doc ref/ecos-ref/interrupt-and-exception-handlers.html + } + + # NOTE: the choice of list vs table should not be two separate + # options. There is a single option which must have one of + # two legal values. + cdl_option CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST { + display "Use linked lists for DSRs" + parent CYGIMP_KERNEL_INTERRUPTS_DSRS + type radio + description " + When DSR support is enabled the kernel must keep track of all + the DSRs that are pending. This information can be kept in a + fixed-size table or in a linked list. The list implementation + requires that the kernel disable interrupts for a very short + period of time outside interrupt handlers, but there is no + possibility of a table overflow occurring." + doc ref/ecos-ref/interrupts.html + } + + cdl_option CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE { + display "Use fixed-size table for DSRs" + parent CYGIMP_KERNEL_INTERRUPTS_DSRS + type radio + description " + When DSR support is enabled the kernel must keep track of all + the DSRs that are pending. This information can be kept in a + fixed-size table or in a linked list. The table + implementation involves a very small risk of overflow at + run-time if a given interrupt source is able to have more + than one pending DSR. However it has the advantage that + the kernel does not need to disable interrupts outside + interrupt handlers." + doc ref/ecos-ref/interrupts.html + } + + cdl_option CYGNUM_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE { + display "Number of entries in fixed-size DSR table" + parent CYGIMP_KERNEL_INTERRUPTS_DSRS + type count + legal_values 2 to 1024 + #active_if CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE + description " + When DSR support is enabled the kernel must keep track of all + the DSRs that are pending. One approach involves a fixed-size + table, which involves a very small risk of overflow at + run-time. By increasing the table size it is possible to reduce + this risk." + doc ref/ecos-ref/interrupts.html + } + + cdl_option CYGIMP_KERNEL_INTERRUPTS_CHAIN { + display "Chain all interrupts together" + parent CYGPKG_KERNEL_INTERRUPTS + requires CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN + description " + Interrupts can be attached to vectors either singly, or be + chained together. The latter is necessary if there is no way + of discovering which device has interrupted without + inspecting the device itself. It can also reduce the amount + of RAM needed for interrupt decoding tables and code." + doc ref/ecos-ref/interrupts.html + } + + }}CFG_DATA */ + +#define CYGIMP_KERNEL_INTERRUPTS_DSRS +#define CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST +#undef CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE +#define CYGNUM_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE 32 +#undef CYGIMP_KERNEL_INTERRUPTS_CHAIN + +/* --------------------------------------------------------------------- + * Exceptions. Currently there are only two options. The first + * determines whether or not exceptions are enabled at all. The + * second controls whether they apply globally or on a per-thread + * basis. There should probably be more options, but the boundary + * between the HAL and kernel becomes blurred. + + {{CFG_DATA + + cdl_component CYGPKG_KERNEL_EXCEPTIONS { + display "Exception handling" + parent CYGPKG_KERNEL + requires CYGPKG_HAL_EXCEPTIONS + description " + In the context of the eCos kernel exceptions are unexpected + events detected by the hardware, for example an attempt to + execute an illegal instruction. There is no relation with + other forms of exception, for example the catch and throw + facilities of languages like C++. It is possible to disable + all support for exceptions and thus save some memory." + doc ref/ecos-ref/exceptions.html + } + + cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE { + display "Decode exception types in kernel" + parent CYGPKG_KERNEL_EXCEPTIONS + description " + On targets where several different types of exception are + possible, for example executing an illegal instruction and + division by zero, it is possible for the kernel to do some + decoding of the exception type and deliver the different + types of exception to different handlers in the application + code. Alternatively the kernel can simply pass all + exceptions directly to application code, leaving the + decoding to be done by the application" + doc ref/ecos-ref/exceptions.html + } + + cdl_option CYGSEM_KERNEL_EXCEPTIONS_GLOBAL { + display "Use global exception handlers" + parent CYGPKG_KERNEL_EXCEPTIONS + description " + In the context of the eCos kernel exceptions are unexpected + events detected by the hardware, for example an attempt to + execute an illegal instruction. If the kernel is configured + to support exceptions then two implementations are + possible. The default implementation involves a single set + of exception handlers that are in use for the entire + system. The alternative implementation allows different + exception handlers to be specified for each thread." + doc ref/ecos-ref/exceptions.html + } + + }}CFG_DATA */ + +#define CYGPKG_KERNEL_EXCEPTIONS +#undef CYGSEM_KERNEL_EXCEPTIONS_DECODE +#define CYGSEM_KERNEL_EXCEPTIONS_GLOBAL + + +/* --------------------------------------------------------------------- + * {{CFG_DATA + + cdl_component CYGPKG_KERNEL_SCHED { + display "Kernel schedulers" + type dummy + parent CYGPKG_KERNEL + description " + The eCos kernel provides a choice of schedulers. In addition + there are a number of configuration options to control the + detailed behaviour of these schedulers. + " + doc ref/ecos-ref/ecos-kernel-overview.html#THE-SCHEDULER + } + + cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE { + display "Multi-level queue scheduler" + type radio + parent CYGPKG_KERNEL_SCHED + description " + The multi-level queue scheduler supports multiple priority + levels and multiple threads at each priority level. + Preemption between priority levels is automatic. Timeslicing + within a given priority level is controlled by a separate + configuration option" + doc ref/ecos-ref/ecos-kernel-overview.html#THE-SCHEDULER + } + + cdl_option CYGSEM_KERNEL_SCHED_BITMAP { + display "Bitmap scheduler" + type radio + parent CYGPKG_KERNEL_SCHED + description " + The bitmap scheduler supports multiple priority levels but + only one thread can exist at each priority level. This means + that scheduling decisions are very simple and hence the + scheduler is efficient. Preemption between priority levels is + automatic. Timeslicing within a given priority level is + irrelevant since there can be only one thread at each + priority level." + doc ref/ecos-ref/ecos-kernel-overview.html#THE-SCHEDULER + } + + #cdl_option CYGSEM_KERNEL_SCHED_LOTTERY { + # display "Lottery scheduler" + # type radio + # parent CYGPKG_KERNEL_SCHED + # description " + # This scheduler is not yet available." + #} + + # NOTE: this option only makes sense if the current scheduler + # supports multiple priority levels. + cdl_option CYGNUM_KERNEL_SCHED_PRIORITIES { + display "Number of priority levels" + type count + legal_values 1 to 32 + parent CYGPKG_KERNEL_SCHED + #active_if CYGINT_KERNEL_SCHED_PRIORITY_SCHEDULER + description " + This option controls the number of priority levels that are + available. For some types of scheduler including the bitmap + scheduler this may impose an upper bound on the number of + threads in the system. For other schedulers such as the + mlqueue scheduler the number of threads is independent from + the number of priority levels. Note that the lowest priority + level is normally used only by the idle thread, although + application threads can run at this priority if necessary." + doc ref/ecos-ref/ecos-kernel-overview.html#THE-SCHEDULER + } + + # NOTE: this option only makes sense for some of the schedulers. + # Timeslicing is irrelevant for bitmap schedulers. + cdl_option CYGSEM_KERNEL_SCHED_TIMESLICE { + display "Scheduler timeslicing" + parent CYGPKG_KERNEL_SCHED + requires !CYGSEM_KERNEL_SCHED_BITMAP + requires CYGVAR_KERNEL_COUNTERS_CLOCK + description " + Some schedulers including the mlqueue scheduler support + timeslicing. This means that the kernel will check regularly + whether or not there is another runnable thread with the + same priority, and if there is such a thread there will be + an automatic context switch. Not all applications require + timeslicing, for example because every thread performs a + blocking operation regularly. For these applications it is + possible to disable timeslicing, which reduces the overheads + associated with timer interrupts." + } + + cdl_option CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS { + display "Number of clock ticks between timeslices" + parent CYGPKG_KERNEL_SCHED + type count + legal_values 1 to 65535 + #active_if CYGSEM_KERNEL_SCHED_TIMESLICE + description " + Assuming timeslicing is enabled, how frequently should it + take place? The value of this option corresponds to the + number of clock ticks that should occur before a timeslice + takes place, so increasing the value reduces the frequency + of timeslices." + } + + }}CFG_DATA */ + +#define CYGSEM_KERNEL_SCHED_MLQUEUE +#undef CYGSEM_KERNEL_SCHED_BITMAP +#undef CYGSEM_KERNEL_SCHED_LOTTERY +#define CYGNUM_KERNEL_SCHED_PRIORITIES 32 +#define CYGSEM_KERNEL_SCHED_TIMESLICE +#define CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS 5 + +/* --------------------------------------------------------------------- + * Counters and clocks. + + {{CFG_DATA + + cdl_component CYGPKG_KERNEL_COUNTERS { + display "Counters and clocks" + parent CYGPKG_KERNEL + type dummy + description " + The counter objects provided by the kernel provide an + abstraction of the clock facility that is generally provided. + Application code can associate alarms with counters, where an + alarm is identified by the number of ticks until it triggers, + the action to be taken on triggering, and whether or not the + alarm should be repeated." + doc ref/ecos-ref/counters-clocks-and-alarms.html + } + + cdl_option CYGVAR_KERNEL_COUNTERS_CLOCK { + display "Provide real-time clock" + parent CYGPKG_KERNEL_COUNTERS + requires CYGIMP_KERNEL_INTERRUPTS_DSRS + description " + On all current target systems the kernel can provide a + real-time clock. This clock serves two purposes. First it is + necessary to support clock and alarm related functions. + Second it is needed to implement timeslicing in some of the + schedulers including the mlqueue scheduler. If the + application does not require any of these facilities then it + is possible to disable the real time clock support + completely." + doc ref/ecos-ref/counters-clocks-and-alarms.html + } + + cdl_component CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE { + display "Override default clock settings" + parent CYGPKG_KERNEL_COUNTERS + requires CYGVAR_KERNEL_COUNTERS_CLOCK + type bool + description " + The kernel has default settings for the clock interrupt + frequency. These settings will vary from platform to + platform, but typically there will be a 100 clock interrupts + every second. It is possible to change this frequency, but + it requires some knowledge of the target hardware. + " + } + + cdl_option CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_PERIOD { + display "Clock hardware initialization value" + parent CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE + type count + legal_values 1 to 0x7fffffff + description " + During system initialization this value is used to initialize + the clock hardware. The exact meaning of the value and the + range of legal values therefore depends on the target hardware, + and the hardware documentation should be consulted for further + details. In addition the clock resolution numerator and + denominator values should be updated. Typical values for + this option would be 150000 on the MN10300 stdeval1 board, + 15625 on the tx39 jmr3904 board, and 20625 on the powerpc + cogent board." + } + + cdl_option CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_NUMERATOR { + display "Clock resolution numerator" + parent CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE + type count + legal_values 1 to 0x7fffffff + description " + If a non-default clock interrupt frequency is used then it + is necessary to specify the clock resolution explicitly. + This resolution involves two separate values, the numerator + and the denominator. The result of dividing the numerator by + the denominator should correspond to the number of + nanoseconds between clock interrupts. For example a + numerator of 1000000000 and a denominator of 100 means that + there are 10000000 nanoseconds (or 10 milliseconds) between + clock interrupts. Expressing the resolution as a fraction + should minimize clock drift even for frequencies that cannot + be expressed as a simple integer. For example a frequency of + 60Hz corresponds to a clock resolution of 16666666.66... + nanoseconds. This can be expressed accurately as 1000000000 + over 60." + } + + cdl_option CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_DENOMINATOR { + display "Clock resolution denominator" + parent CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE + type count + legal_values 1 to 0x7fffffff + description " + If a non-default clock interrupt frequency is used then it + is necessary to specify the clock resolution explicitly. + This resolution involves two separate values, the numerator + and the denominator. The result of dividing the numerator by + the denominator should correspond to the number of + nanoseconds between clock interrupts. For example a + numerator of 1000000000 and a denominator of 100 means that + there are 10000000 nanoseconds (or 10 milliseconds) between + clock interrupts. Expressing the resolution as a fraction + should minimize clock drift even for frequencies that cannot + be expressed as a simple integer. For example a frequency of + 60Hz corresponds to a clock resolution of 16666666.66... + nanoseconds. This can be expressed accurately as 1000000000 + over 60." + } + + + # NOTE: these option should really be a single enum. + cdl_option CYGIMP_KERNEL_COUNTERS_SINGLE_LIST { + display "Implement counters using a single list" + parent CYGPKG_KERNEL_COUNTERS + type radio + description " + There are two different implementations of the counter + objects. The first implementation stores all alarms in a + single linked list. The alternative implementation uses a + table of linked lists. A single list is more efficient in + terms of memory usage and is generally adequate when the + application only makes use of a small number of alarms." + doc ref/ecos-ref/counters-clocks-and-alarms.html + } + + cdl_option CYGIMP_KERNEL_COUNTERS_MULTI_LIST { + display "Implement counters using a table of lists" + parent CYGPKG_KERNEL_COUNTERS + type radio + description " + There are two different implementations of the counter + objects. The first implementation stores all alarms in a + single linked list. The alternative implementation uses a + table of linked lists, with the size of the table being a + separate configurable option. For more complicated + operations it is better to have a table of lists since this + reduces the amount of computation whenever the timer goes + off. Assuming a table size of 8 (the default value) on + average the timer code will only need to check 1/8 of the + pending alarms instead of all of them." + doc ref/ecos-ref/counters-clocks-and-alarms.html + } + + cdl_option CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE { + display "Size of counter list table" + parent CYGPKG_KERNEL_COUNTERS + type count + legal_values 1 to 1024 + #active_if CYGIMP_KERNEL_COUNTERS_MULTI_LIST + description " + If counters are implemented using an array of linked lists + then this option controls the size of the array. A larger + size reduces the amount of computation that needs to take + place whenever the timer goes off, but requires extra + memory." + doc ref/ecos-ref/counters-clocks-and-alarms.html + } + + }}CFG_DATA */ + +#define CYGVAR_KERNEL_COUNTERS_CLOCK +#undef CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE +#define CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_PERIOD 9999 +#define CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_NUMERATOR 1000000000 +#define CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_DENOMINATOR 100 +#define CYGIMP_KERNEL_COUNTERS_SINGLE_LIST +#undef CYGIMP_KERNEL_COUNTERS_MULTI_LIST +#define CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE 8 + +/* --------------------------------------------------------------------- + * Thread-related options + {{CFG_DATA + + cdl_component CYGPKG_KERNEL_THREADS { + display "Thread-related options" + type dummy + parent CYGPKG_KERNEL + description " + There are a number of configuration options related to the + implementation of threads, for example whether or not the + eCos kernel supports per-thread data." + doc ref/ecos-ref/thread-operations.html + } + + cdl_option CYGFUN_KERNEL_THREADS_TIMER { + display "Allow per-thread timers" + parent CYGPKG_KERNEL_THREADS + requires CYGVAR_KERNEL_COUNTERS_CLOCK + description " + This option controls whether or not the kernel should support + per-thread clock and alarm related functions. Also some of + the synchronization primitives such as semaphore and + condition variable timed wait operations require per-thread + timer support. If none of these facilities are required then + the option can be disabled." + doc ref/ecos-ref/thread-operations.html + } + + cdl_option CYGVAR_KERNEL_THREADS_NAME { + display "Support optional name for each thread" + parent CYGPKG_KERNEL_THREADS + description " + Threads may optionally be supplied with a name string that is + used to identify them during debugging. This name is only + present if `this option is defined. Disabling it reduces both + code and data size." + doc ref/ecos-ref/thread-operations.html + } + + cdl_option CYGVAR_KERNEL_THREADS_LIST { + display "Keep track of all threads using a linked list" + parent CYGPKG_KERNEL_THREADS + description " + Threads may optionally be placed on a housekeeping list so + that all threads may be located easily. This is useful mainly + in conjunction with source-level debugging." + doc ref/ecos-ref/thread-operations.html + } + + cdl_option CYGFUN_KERNEL_THREADS_STACK_LIMIT { + display "Keep track of the base of each thread's stack" + parent CYGPKG_KERNEL_THREADS + description " + This option makes the kernel keep track of the lower limit on + each thread's stack. It allows the kernel to adjust the lower + limit, thus making space for per-thread data. Note that it + does not imply any form of run-time stack overflow checking." + doc ref/ecos-ref/thread-operations.html + } + + cdl_option CYGVAR_KERNEL_THREADS_DATA { + display "Support for per-thread data" + parent CYGPKG_KERNEL_THREADS + requires CYGFUN_KERNEL_THREADS_STACK_LIMIT + description " + It is possible for the kernel to support per-thread data, in + other words an area of memory specific to each thread which + can be used to store data for that thread. This per-thread + data can be used by applications or by other packages such as + the ISO C library." + doc ref/ecos-ref/thread-operations.html + } + + cdl_option CYGNUM_KERNEL_THREADS_DATA_MAX { + display "Number of words of per-thread data" + parent CYGPKG_KERNEL_THREADS + #active_if CYGVAR_KERNEL_THREADS_DATA + type count + legal_values 1 to 65535 + description " + It is possible for the kernel to support per-thread data, in + other words an area of memory specific to each thread which + can be used to store data for that thread. This per-thread + data can be used by applications or by other packages such as + the ISO C library. This configuration option controls the + number of words of per-thread data that the kernel will + allow." + doc ref/ecos-ref/thread-operations.html + } + + cdl_option CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE { + display "Stack size for the idle thread" + parent CYGPKG_KERNEL_THREADS + type count + legal_values 512 to 65536 + description " + This configuration option specifies the stack size in bytes + for the idle thread. Unless the HAL is configured to use a + separate interrupt stack this size must be sufficient to meet + the requirements of all interrupt handlers - these + requirements are cumulative if nested interrupted are + enabled. Depending on the target architecture, the stack size + typically has to be a multiple of eight or sixteen bytes." + + doc ref/ecos-ref/thread-operations.html + } + + }}CFG_DATA */ + +#define CYGFUN_KERNEL_THREADS_TIMER +#define CYGVAR_KERNEL_THREADS_NAME +#define CYGVAR_KERNEL_THREADS_LIST +#define CYGFUN_KERNEL_THREADS_STACK_LIMIT +#define CYGVAR_KERNEL_THREADS_DATA +#define CYGNUM_KERNEL_THREADS_DATA_MAX 6 +#define CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE 2048 + + +/* --------------------------------------------------------------------- + * Synchronization primitives. + + {{CFG_DATA + + cdl_component CYGPKG_KERNEL_SYNCH { + display "Synchronization primitives" + type dummy + parent CYGPKG_KERNEL + description " + The eCos kernel supports a number of different + synchronization primitives such as mutexes, semaphores, + condition variables, and message boxes. There are + configuration options to control the exact behaviour of some + of these synchronization primitives. + " + doc ref/ecos-ref/thread-synchronization.html + } + + # NOTE: the requires statement is only valid for the current kernel. + # Priority inheritance is possible in other schedulers as well + # but is not yet implemented. + cdl_option CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE { + display "Simple mutex priority inheritance" + requires CYGSEM_KERNEL_SCHED_MLQUEUE + parent CYGPKG_KERNEL_SYNCH + description " + This option enables a relatively simple implementation of + mutex priority inheritance. The implementation will only work + in the mlqueue scheduler, and it does not handle the rare + case of nested mutexes completely correctly. However it is + both fast and deterministic. Mutex priority inheritance can + be disabled if the application does not require it, which + will reduce both code size and data space." + doc ref/ecos-ref/synchronization.html#MUTEXES + } + + cdl_option CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT { + display "Message box blocking put support" + parent CYGPKG_KERNEL_SYNCH + description " + Message boxes can support three different versions of the + put-message operation. The first is tryput(), which will fail + if the message box is already full. The other two are the + ordinary put() function which will block if the message box + is full, and a timed put() operation which will block for + upto a certain length of time if the message box is currently + full. The blocking versions require extra memory in the + message box data structure and extra code in the other + message box functions, so they can be disabled if the + application does not require them. If this option is enabled + then the system will always provide the blocking put() + function, and it will also provide the timed put() function + if thread timers are enabled." + doc ref/ecos-ref/message-boxes.html + } + + cdl_option CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE { + display "Message box queue size" + parent CYGPKG_KERNEL_SYNCH + type count + legal_values 1 to 65535 + description " + This configuration option controls the number of messages + that can be queued in a message box before a non-blocking + put() operation will fail or a blocking put() operation will + block. The cost in memory is one pointer per message box for + each possible message." + } + + cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT { + display "Condition variable timed-wait support" + parent CYGPKG_KERNEL_SYNCH + requires CYGVAR_KERNEL_COUNTERS_CLOCK + description " + This option enables the condition variable timed wait + facility." + doc ref/ecos-ref/synchronization.html#CONDITION-VARIABLES + } + + }}CFG_DATA + + */ + +#define CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE +#define CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT +#define CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE 10 +#define CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT + +/* --------------------------------------------------------------------- + {{CFG_DATA + + cdl_component CYGPKG_KERNEL_INSTRUMENT { + display "Kernel instrumentation" + parent CYGPKG_KERNEL + description " + The current release of the kernel contains an initial version + of instrumentation support. The various parts of the kernel + will invoke instrumentation routines whenever appropriate + events occur, and these will be stored in a circular buffer + for later reference." + } + + + cdl_option CYGNUM_KERNEL_INSTRUMENT_BUFFER_SIZE { + display "Size of instrumentation buffer size" + parent CYGPKG_KERNEL_INSTRUMENT + type count + legal_values 16 to 0x100000 + description " + If kernel instrumentation is enabled then the instrumentation + data goes into a circular buffer. A larger buffer allows + more data to be stored, but at a significant cost in memory. + The value of this option corresponds to the number of entries + in the table, and typically each entry will require 16 bytes + of memory." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_FLAGS { + display "Perform selective instrumentation" + parent CYGPKG_KERNEL_INSTRUMENT + description " + The kernel can either collect all instrumentation events, or + it can filter out events at runtime based on a set of flags. + For example it would be possible to decide at runtime that + only scheduler and interrupt instrumentation flags are of + interest and that all other flags should be ignored. This + flag mechanism involves extra code and processor cycle + overhead in the instrumentation code, so it can be disabled + if the application developer is interested in all + instrumentation events." + } + + # NOTE: many of these options should only be active if the appropriate + # component is active. + cdl_option CYGDBG_KERNEL_INSTRUMENT_SCHED { + display "Instrument the scheduler" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the scheduling code." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_THREAD { + display "Instrument thread operations" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the code that manipulates threads." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_INTR { + display "Instrument interrupts" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the interrupt handling code." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_MUTEX { + display "Instrument mutex operations" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the mutex code." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_CONDVAR { + display "Instrument condition variable operations" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the condition variable code." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_BINSEM { + display "Instrument binary semaphore operations" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the binary semaphore code." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_CNTSEM { + display "Instrument counting semaphore operations" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the counting semaphore code." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_MBOXT { + display "Instrument message box operations" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the message box code." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_CLOCK { + display "Instrument clock operations" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the real-time clock code." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_ALARM { + display "Instrument alarm-related operations" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not instrumentation support is compiled into + the code related to alarm operations." + } + + cdl_option CYGDBG_KERNEL_INSTRUMENT_USER { + display "Support application-level instrumentation" + parent CYGPKG_KERNEL_INSTRUMENT + description " + It is possible to perform selective instrumentation at + run-time. It is also possible to disable instrumentation + in various kernel components at compile-time, thus + reducing the code size overheads. This option controls + whether or not application-level instrumentation gets + compiled in." + } + + }}CFG_DATA +*/ + +#undef CYGPKG_KERNEL_INSTRUMENT +#undef CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER +#define CYGNUM_KERNEL_INSTRUMENT_BUFFER_SIZE 256 +#define CYGDBG_KERNEL_INSTRUMENT_FLAGS +#define CYGDBG_KERNEL_INSTRUMENT_SCHED +#define CYGDBG_KERNEL_INSTRUMENT_THREAD +#define CYGDBG_KERNEL_INSTRUMENT_INTR +#define CYGDBG_KERNEL_INSTRUMENT_MUTEX +#define CYGDBG_KERNEL_INSTRUMENT_CONDVAR +#define CYGDBG_KERNEL_INSTRUMENT_BINSEM +#define CYGDBG_KERNEL_INSTRUMENT_CNTSEM +#define CYGDBG_KERNEL_INSTRUMENT_CLOCK +#define CYGDBG_KERNEL_INSTRUMENT_ALARM +#define CYGDBG_KERNEL_INSTRUMENT_MBOXT +#define CYGDBG_KERNEL_INSTRUMENT_USER + +/* --------------------------------------------------------------------- + * There appears to be somewhat of a lack of configuration options here. + {{CFG_DATA + + cdl_component CYGPKG_KERNEL_MEMORY { + display "Memory allocators" + type dummy + parent CYGPKG_KERNEL + description " + Configuration options related to the kernel memory allocation + support." + } + + cdl_option CYGSEM_KERNEL_MEMORY_COALESCE { + display "Coalesce memory in the variable-block allocator" + parent CYGPKG_KERNEL_MEMORY + description " + The variable-block memory allocator can perform coalescing + of memory whenever the application code releases memory back + to the pool. This coalescing reduces the possibility of + memory fragmentation problems, but involves extra code and + processor cycles." + } + + }}CFG_DATA */ + +#define CYGSEM_KERNEL_MEMORY_COALESCE + +/* --------------------------------------------------------------------- + * Options related to source-level debugging and diagnostics. + + {{CFG_DATA + + cdl_component CYGPKG_KERNEL_DEBUG { + display "Source-level debugging support" + type dummy + parent CYGPKG_KERNEL + description " + If the source level debugger gdb is to be used for debugging + application code then it may be necessary to configure in support + for this in the kernel." + } + + # NOTE: does this require any other support ? + cdl_option CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT { + display "Include GDB multi-threading debug support" + parent CYGPKG_KERNEL_DEBUG + requires CYGVAR_KERNEL_THREADS_LIST + requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT + description " + This option enables some extra kernel code which is needed + to support multi-threaded source level debugging." + } + + }}CFG_DATA */ + +#define CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + +/* --------------------------------------------------------------------- + * Kernel API's. The C++ one is the default. A C API is optional. + * Support for other languages is possible. + + {{CFG_DATA + + cdl_component CYGPKG_KERNEL_API { + display "Kernel APIs" + type dummy + parent CYGPKG_KERNEL + description " + The eCos kernel is implemented in C++, so a C++ interface + to the kernel is always available. There is also an optional + C API. Additional API's may be provided in future versions." + doc ref/ecos-ref/kernel-apis.html + } + + cdl_option CYGFUN_KERNEL_API_C { + display "Provide C API" + parent CYGPKG_KERNEL_API + description " + The eCos kernel is implemented in C++, but there is an + optional C API for use by application code. This C API can be + disabled if the application code does not invoke the kernel + directly, but instead uses higher level code such as the + uITRON compatibility layer." + } + + }}CFG_DATA */ + +#define CYGFUN_KERNEL_API_C + +/* --------------------------------------------------------------------- + * The rest of this header file contains various fix-ups and + * options which cannot yet be controlled via the GUI tool. + * + * First some miscellaneous scheduler support, all calculated. + */ + +#if defined(CYGSEM_KERNEL_SCHED_TIMESLICE) && defined(CYGSEM_KERNEL_SCHED_BITMAP) +# error Timeslicing cannot be enabled if the bitmap scheduler is used. +#endif + +/* + * These #define's are for the system's internal use only and should + * not be edited by users. */ +#ifdef CYGSEM_KERNEL_SCHED_BITMAP +# define CYGPRI_KERNEL_SCHED_IMPL_HXX +#elif defined(CYGSEM_KERNEL_SCHED_MLQUEUE) +# define CYGPRI_KERNEL_SCHED_IMPL_HXX +#elif defined(CYGSEM_KERNEL_SCHED_LOTTERY) +# define CYGPRI_KERNEL_SCHED_IMPL_HXX +#else +#error No Scheduler defined +#endif + +#define CYGNUM_KERNEL_SCHED_BITMAP_SIZE CYGNUM_KERNEL_SCHED_PRIORITIES + +/* --------------------------------------------------------------------- + * Counter and clock related miscellania. + * + * If a real-time clock is enabled then there are additional + * configuration options controlling the resolution of the clock, + * CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION and + * CYGNUM_KERNEL_COUNTERS_RTC_PERIOD. Different targets require + * different default values, and the current configuration tool cannot + * deal with this yet. Also the exact details of the resolution and + * period values are still subject to change. + * + * To allow the clock settings to be controlled in some fashion, + * there is a configuration option to override the default settings. + * If this option is enabled then the resolution and period + * #define's will come from configuration options (which do not + * necessarily have sensible defaults, and which are not validated). + * Otherwise the platform-specific numbers below are used. On + * hardware this result in 100 clock interrupts every second. + * For simulators slightly different values are used, so that the + * various test cases run faster. + */ + +#ifdef CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE + +# define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION \ + { CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_NUMERATOR, \ + CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_DENOMINATOR } + +# define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD CYGNUM_KERNEL_COUNTERS_CLOCK_OVERRIDE_PERIOD + +#else /* CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE */ + +#if defined(CYG_HAL_MN10300_STDEVAL1) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 150000 + +#endif +#if defined(CYG_HAL_MN10300_SIM) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 9999 + +#endif + +#if defined(CYG_HAL_MIPS_JMR3904) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 15360 + +#endif + +#if defined(CYG_HAL_MIPS_SIM) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 999 + +#endif + +#if defined(CYG_HAL_POWERPC_MP860) + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 20625 + +#endif + + +#ifndef CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION + +#define CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION {1000000000, 100} +#define CYGNUM_KERNEL_COUNTERS_RTC_PERIOD 9999 + +#endif + +#endif /* CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE */ + +/* --------------------------------------------------------------------- + * Thread-related miscellania. + * + * These options provide for an assertion that the count value for counted + * thread wakeups or for thread suspends do not exceed set limits. This is + * to help with debugging, to allow a runaaway loop, for example, to be + * detected more easily. + * + * If the option is not defined, no assert is included. Whether asserts + * are themselves included depends on infrastructure configury in infra.h + * + * It is hoped that these defaults are helpful rather than interfering. + */ +#define CYGNUM_KERNEL_MAX_SUSPEND_COUNT_ASSERT (500) +#define CYGNUM_KERNEL_MAX_COUNTED_WAKE_COUNT_ASSERT (500) + +/* + * If the scheduler configuration only has a single priority level, + * then the idle thread must yield each time around its loop. + */ + +#if CYGNUM_KERNEL_SCHED_PRIORITIES == 1 +# define CYGIMP_IDLE_THREAD_YIELD +#endif + +/* + * Per thread data options. Per thread data suuport is based loosely + * on that define by POSIX. Each thread has an array of slots, up to + * CYGNUM_KERNEL_THREADS_DATA_MAX, that may contain data. Some of the + * slots have been preallocated to specific packages. Others may be + * allocated dynamically. + */ + +#define CYGNUM_KERNEL_THREADS_DATA_KERNEL 0 +#define CYGNUM_KERNEL_THREADS_DATA_ITRON 1 +#define CYGNUM_KERNEL_THREADS_DATA_LIBC 2 +#define CYGNUM_KERNEL_THREADS_DATA_POSIX 3 + +#define CYGNUM_KERNEL_THREADS_DATA_ALL 0xF + +/* + * Some consistency checks. + */ +#if defined(CYGFUN_KERNEL_THREADS_TIMER) && !defined(CYGVAR_KERNEL_COUNTERS_CLOCK) +# error "Cannot have Thread Timers without Real Time Clock" +#endif + +#if defined(CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT) && !defined(CYGVAR_KERNEL_THREADS_LIST) +# error "GDB thread support requires a list of all known threads." +#endif + +/* --------------------------------------------------------------------- + * Synchronization primitives miscellania. + * + * These lines should not be edited by users. + */ +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE +# define CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE +#endif +#if defined(CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE) && !defined(CYGSEM_KERNEL_SCHED_MLQUEUE) +# error "Priority inheritance can only be enabled if the mlqueue scheduler is used." +#endif + +/* --------------------------------------------------------------------- + * This code allows the kernel build to be configured as a GDB + * stub ROM monitor. It is only intended for internal use. + */ + +/* + * BLV: This code must be kept commented out for now, as it can + * confuse the configuration tool. The correct solution is to have a + * standard configuration for the system as represented by e.g. a + * .ptest file which does the right thing. A ROM monitor is an + * application, and application-specific configuration stuff should + * not live in the master header file. + */ + +/* +#undef CYG_HAL_ROM_MONITOR + +#ifdef CYG_HAL_ROM_MONITOR + +#undef CYGFUN_HAL_COMMON_KERNEL_SUPPORT +#undef CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT +#undef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK +#undef CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING +#undef CYGIMP_KERNEL_INTERRUPTS_CHAIN +#undef CYGVAR_KERNEL_COUNTERS_CLOCK +#undef CYGFUN_KERNEL_THREADS_TIMER +#undef CYGPKG_KERNEL_EXCEPTIONS +#undef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE +#undef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE +#undef CYGPKG_KERNEL_INSTRUMENT +#undef CYGDBG_INFRA_DIAG_USE_DEVICE // now lives in infra + +#define CYGDBG_KERNEL_DEBUG_GDB_INCLUDE_STUBS + +#endif +*/ + +/* -------------------------------------------------------------------*/ + +#endif /* ifdef CYGPKG_KERNEL */ + +/* -------------------------------------------------------------------*/ +#endif /* CYGONCE_PKGCONF_KERNEL_H */ +/* EOF kernel.h */ diff --git a/packages/kernel/current/include/sched.hxx b/packages/kernel/current/include/sched.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/sched.hxx @@ -0,0 +1,228 @@ +#ifndef CYGONCE_KERNEL_SCHED_HXX +#define CYGONCE_KERNEL_SCHED_HXX + +//========================================================================== +// +// sched.hxx +// +// Scheduler class declaration(s) +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Define Scheduler class interfaces +// Description: These class definitions supply the internal API +// used to scheduler threads. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros + +// ------------------------------------------------------------------------- +// Scheduler base class. This defines stuff that is needed by the +// specific scheduler implementation. Each scheduler comprises three +// classes: Cyg_Scheduler_Base, Cyg_Scheduler_Implementation which +// inherits from it and Cyg_Scheduler which inherits from _it_ in turn. + +class Cyg_Scheduler_Base +{ + friend class Cyg_HardwareThread; + friend class Cyg_SchedThread; + +protected: + // The following variables are implicit in the API, but are + // not publically visible. + + static volatile cyg_ucount32 sched_lock; // lock counter + + static Cyg_Thread *current_thread; // current running thread + + static cyg_bool need_reschedule; // set when schedule needed + + static cyg_ucount32 thread_switches; // count of number of thread switches +}; + +// ------------------------------------------------------------------------- +// Include the scheduler implementation header + +#include CYGPRI_KERNEL_SCHED_IMPL_HXX + +// Do some checking that we have a consistent universe. + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE +# ifndef CYGIMP_THREAD_PRIORITY +# error Priority inheritance will not work without priorities!!! +# endif +# if CYG_SCHED_UNIQUE_PRIORITIES +# error Priority inheritance needs non-unique priorities!!! +# endif +#endif + +// ------------------------------------------------------------------------- +// Scheduler class. This is the public scheduler interface seen by the +// rest of the kernel. + +class Cyg_Scheduler + : public Cyg_Scheduler_Implementation +{ + friend class Cyg_Thread; + + // This function is the actual implementation of the unlock + // function. The unlock() later is an inline shell that deals + // with the common case. + + static void unlock_inner(); + +public: + + CYGDBG_DEFINE_CHECK_THIS + + // The following API functions are common to all scheduler + // implementations. + + // claim the preemption lock + static void lock(); + + // release the preemption lock + static void unlock(); + + // return a pointer to the current thread + static Cyg_Thread *get_current_thread(); + + // Return current value of lock + static cyg_ucount32 get_sched_lock(); + + // Return current number of thread switches + static cyg_ucount32 get_thread_switches(); + + // Start execution of the scheduler + static void start() __attribute__ ((noreturn)); + + // The only scheduler instance should be this one... + static Cyg_Scheduler scheduler; + +}; + +// ------------------------------------------------------------------------- +// This class encapsulates the scheduling abstractions in a thread. +// Cyg_SchedThread is included as a base class of Cyg_Thread. The actual +// implementation of the abstractions is in Cyg_SchedThread_Implementation +// so this class has little to do. + +class Cyg_SchedThread + : public Cyg_SchedThread_Implementation +{ + friend class Cyg_ThreadQueue_Implementation; + friend class Cyg_Scheduler_Implementation; + + Cyg_ThreadQueue *queue; + + +public: + + Cyg_SchedThread(Cyg_Thread *thread, CYG_ADDRWORD sched_info); + + // Return current queue pointer + + Cyg_ThreadQueue *get_current_queue(); + + // Remove this thread from current queue + void remove(); + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + +private: + + // For all priority inheritance mechanisms we need to + // keep track of how many mutexes we have locked. + cyg_count32 mutex_count; + +public: + // Count and uncount the number of mutexes held by + // this thread. + void count_mutex() { mutex_count++; }; + void uncount_mutex() { mutex_count--; }; + +protected: +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE + + // The simple priority inheritance mechanism simply needs + // somewhere to store the base priority of the current thread. + + cyg_priority original_priority; // our original priority + + cyg_bool priority_inherited; // have we inherited? + +#endif + +public: + + // Inherit the priority of the provided thread if it + // has higher priority than this. + void inherit_priority( Cyg_Thread *thread); + + // Lose priority inheritance + void disinherit_priority(); + +#endif + +}; + +// ------------------------------------------------------------------------- +// Simple inline accessor functions + +inline Cyg_Thread *Cyg_Scheduler::get_current_thread() +{ + return current_thread; +} + +// Return current value of lock +inline cyg_ucount32 Cyg_Scheduler::get_sched_lock() +{ + return sched_lock; +} + +// Return current number of thread switches +inline cyg_ucount32 Cyg_Scheduler::get_thread_switches() +{ + return thread_switches; +} + +// Return current queue pointer +inline Cyg_ThreadQueue *Cyg_SchedThread::get_current_queue() +{ + return queue; +} + +// ------------------------------------------------------------------------- +#endif // ifndef __SCHED_HXX__ +// EOF sched.hxx diff --git a/packages/kernel/current/include/sched.inl b/packages/kernel/current/include/sched.inl new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/sched.inl @@ -0,0 +1,108 @@ +#ifndef CYGONCE_KERNEL_SCHED_INL +#define CYGONCE_KERNEL_SCHED_INL + +//========================================================================== +// +// sched.inl +// +// Scheduler class inlines +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Define inlines for scheduler classes +// Description: Inline functions for the scheduler classes. These are +// not defined in the header so that we have the option +// of making them non-inline. +// Usage: +// #include +// ... +// #include +// ... +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // we use some thread inlines here + +// ------------------------------------------------------------------------- +// Inlines for Cyg_Scheduler class + +inline void Cyg_Scheduler::lock() +{ + // We do not need to do a read-modify-write sequence here because + // the scheduler lock is strictly nesting. Even if we are interrupted + // partway through the increment, the lock will be returned to the same + // value before we are resumed/rescheduled. + + sched_lock++; + + HAL_REORDER_BARRIER(); + + CYG_INSTRUMENT_SCHED(LOCK,sched_lock,0); +}; + +inline void Cyg_Scheduler::unlock() +{ + // This is an inline wrapper for the real scheduler unlock function in + // Cyg_Scheduler::unlock_inner(). + + // Only do anything if the lock is about to go zero, otherwise we simply + // decrement and return. As with lock() we do not need any special code + // to decrement the lock counter. + + CYG_INSTRUMENT_SCHED(UNLOCK,sched_lock,0); + + HAL_REORDER_BARRIER(); + + register cyg_ucount32 lock = sched_lock - 1; + + if( lock == 0 ) unlock_inner(); + else sched_lock = lock; +} + + +// ------------------------------------------------------------------------- +// Inlines for Cyg_SchedThread class + +inline void Cyg_SchedThread::remove() +{ + if( queue != NULL ) + { + queue->remove((Cyg_Thread *)this); + queue = NULL; + } +} + +// ------------------------------------------------------------------------- + +#endif // ifndef CYGONCE_KERNEL_SCHED_INL +// EOF sched.inl diff --git a/packages/kernel/current/include/sema.hxx b/packages/kernel/current/include/sema.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/sema.hxx @@ -0,0 +1,122 @@ +#ifndef CYGONCE_KERNEL_SEMA_HXX +#define CYGONCE_KERNEL_SEMA_HXX + +//========================================================================== +// +// sema.hxx +// +// Semaphore class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Define Semaphore class interfaces +// Description: The classes defined here provide the APIs for binary +// and counting semaphores. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include + +// ------------------------------------------------------------------------- +// Binary semaphore. This has only two states: posted and not-posted. + +class Cyg_Binary_Semaphore +{ + cyg_bool state; // The binary semaphore state + + Cyg_ThreadQueue queue; // Queue of waiting threads + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Binary_Semaphore( // Constructor + cyg_bool init_state = false // Initial state value + ); + + ~Cyg_Binary_Semaphore(); // Destructor + + cyg_bool wait(); // Wait until state == true + + cyg_bool trywait(); // Set state false if possible + + void post(); // Increment count + + cyg_bool posted(); // Get current state + +}; + +// ------------------------------------------------------------------------- +// Counting semaphore. This implements the usual counter based semaphore. + +class Cyg_Counting_Semaphore +{ + cyg_count32 count; // The semaphore count + + Cyg_ThreadQueue queue; // Queue of waiting threads + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Counting_Semaphore( // Constructor + cyg_count32 init_count = 0 // Initial count value + ); + + ~Cyg_Counting_Semaphore(); // Destructor + + cyg_bool wait(); // Wait until decrement + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_bool wait( cyg_tick_count timeout ); +#endif // Wait until decrement or timeout + + cyg_bool trywait(); // Try to decrement + + void post(); // Increment count + + cyg_count32 peek(); // Get current count value + + inline + cyg_bool waiting() // Is anyone waiting? + { + return !queue.empty(); + } + +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_SEMA_HXX +// EOF sema.hxx diff --git a/packages/kernel/current/include/sema2.hxx b/packages/kernel/current/include/sema2.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/sema2.hxx @@ -0,0 +1,126 @@ +#ifndef CYGONCE_KERNEL_SEMA2_HXX +#define CYGONCE_KERNEL_SEMA2_HXX + +//========================================================================== +// +// sema2.hxx +// +// Semaphore class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Define Semaphore class interfaces +// Description: The classes defined here provide the APIs for binary +// and counting semaphores. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include + +#if 0 +// THERE IS NO BINARY-SEMAPHORE-2 + +// ------------------------------------------------------------------------- +// Binary semaphore. This has only two states: posted and not-posted. + +class Cyg_Binary_Semaphore2 +{ + cyg_bool state; // The binary semaphore state + + Cyg_ThreadQueue queue; // Queue of waiting threads + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Binary_Semaphore2( // Constructor + cyg_bool init_state = false // Initial state value + ); + + ~Cyg_Binary_Semaphore2(); // Destructor + + cyg_bool wait(); // Wait until state == true + + cyg_bool trywait(); // Set state false if possible + + void post(); // Increment count + + cyg_bool posted(); // Get current state + +}; +#endif + +// ------------------------------------------------------------------------- +// Counting semaphore. This implements the usual counter based semaphore. + +class Cyg_Counting_Semaphore2 +{ + cyg_count32 count; // The semaphore count + + Cyg_ThreadQueue queue; // Queue of waiting threads + +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Counting_Semaphore2( // Constructor + cyg_count32 init_count = 0 // Initial count value + ); + + ~Cyg_Counting_Semaphore2(); // Destructor + + cyg_bool wait(); // Wait until decrement + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_bool wait( cyg_tick_count abs_timeout ); +#endif // Wait until decrement or timeout + + cyg_bool trywait(); // Try to decrement + + void post(); // Increment count + + cyg_count32 peek(); // Get current count value + + inline + cyg_bool waiting() // Is anyone waiting? + { + return !queue.empty(); + } + +}; + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_SEMA2_HXX +// EOF sema2.hxx diff --git a/packages/kernel/current/include/thread.hxx b/packages/kernel/current/include/thread.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/thread.hxx @@ -0,0 +1,540 @@ +#ifndef CYGONCE_KERNEL_THREAD_HXX +#define CYGONCE_KERNEL_THREAD_HXX + +//========================================================================== +// +// thread.hxx +// +// Thread class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Define Thread class interfaces +// Description: The classes defined here collectively implement the +// internal API used to create, configure and manage threads. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include +#include +#include + +#include + +// ------------------------------------------------------------------------- +// Miscellaneous types + +typedef void cyg_thread_entry(CYG_ADDRWORD data);// Thread entry point function + +// ------------------------------------------------------------------------- +// Hardware thread interface. +// The implementation of this class is provided by the HAL. + +class Cyg_HardwareThread +{ + friend class Cyg_Scheduler; + +protected: + + CYG_ADDRESS stack_base; // pointer to base of stack area + + cyg_uint32 stack_size; // size of stack area in bytes + +#ifdef CYGFUN_KERNEL_THREADS_STACK_LIMIT + CYG_ADDRESS stack_limit; // movable stack limit +#endif + + CYG_ADDRESS stack_ptr; // pointer to saved state on stack + + cyg_thread_entry *entry_point; // main entry point (code pointer!) + + CYG_ADDRWORD entry_data; // entry point argument + +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + + HAL_SavedRegisters *saved_context; // If non-zero, this points at a more + // interesting context than stack_ptr. +#endif + + Cyg_HardwareThread( + cyg_thread_entry *entry_point, // entry point function + CYG_ADDRWORD entry_data, // entry data + cyg_ucount32 stack_size = 0, // stack size, 0 = use default + CYG_ADDRESS stack_base = 0 // stack base, NULL = allocate + ); + + // Thread entry point. This is where all threads begin execution. + // This routine does a little housekeeping and then call the main + // entry_point specified above. + static void thread_entry(Cyg_Thread *thread); + + // Initialize the context of the thread to start execution at thread_entry + void init_context( Cyg_Thread *thread ); + + // Save current thread's context and load that of the given next thread. + void switch_context(Cyg_HardwareThread *next); + + // load this thread's context without saving current context + void load_context(); + + // attach a stack to this thread + void attach_stack(CYG_ADDRESS stack, cyg_uint32 stack_size); + + // detach the stack from this thread + CYG_ADDRESS detach_stack(); + + // Adjust the thread's saved state to call the exception + // handler when next executed. + void prepare_exception ( + cyg_exception_handler *exception_handler, + CYG_ADDRWORD exception_data, + cyg_code exception_number, + CYG_ADDRWORD exception_info + ); + +public: + + CYGDBG_DEFINE_CHECK_THIS + + // Get and set entry_data. + + void set_entry_data( CYG_ADDRWORD data ); + + CYG_ADDRWORD get_entry_data(); + +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + // Return the current saved state for this thread. + HAL_SavedRegisters *get_saved_context(); + + // Set the saved context pointer. + void set_saved_context(HAL_SavedRegisters *ctx); +#endif + + // get the size/base of this thread's stack + CYG_ADDRESS get_stack_base(); + + cyg_uint32 get_stack_size(); + +#ifdef CYGFUN_KERNEL_THREADS_STACK_LIMIT + // Allocate some memory at the lower end of the stack + // by moving the stack limit pointer. + + void *increment_stack_limit( cyg_ucount32 size); + + CYG_ADDRESS get_stack_limit(); +#endif +}; + +// ------------------------------------------------------------------------- +// Per-thread timer support class. +// This is only included when required. + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + +class Cyg_ThreadTimer + : public Cyg_Alarm +{ + friend class Cyg_Thread; + + // Pointer to current thread + Cyg_Thread *thread; + + // Constructor + Cyg_ThreadTimer( + Cyg_Thread *thread + ); + + // Alarm function + static void alarm( Cyg_Alarm *alarm, CYG_ADDRWORD data); + + CYGDBG_DEFINE_CHECK_THIS + +}; + +#endif + +// ------------------------------------------------------------------------- +// Main Thread class. +// This provides the public API for controlling threads. + +class Cyg_Thread + : public Cyg_HardwareThread, // provides hardware abstractions + public Cyg_SchedThread // provides scheduling abstractions +{ + friend class Cyg_Scheduler; + friend void deliver_exception( CYG_WORD code, CYG_ADDRWORD data ); + + // The following definitions are used by all variants of the + // basic thread object. + +public: + enum { // Thread state values + + RUNNING = 0, // Thread is runnable or running + SLEEPING = 1, // Thread is waiting for something to happen + COUNTSLEEP = 2, // Sleep in counted manner + SUSPENDED = 4, // Suspend count is non-zero + CREATING = 8, // Thread is being created + EXITED = 16, // Thread has exited + + // This is the set of bits that must be cleared by a generic + // wake() or release(). + SLEEPSET = (SLEEPING | COUNTSLEEP) + }; + +private: + // Current thread state, a logical OR of the above values. + // Only if this word is zero can the thread execute. + cyg_uint32 state; + + // Suspension counter, if > 0, the thread is suspended + cyg_ucount32 suspend_count; + + // Wakeup counter, if > 0, sleep will not sleep, just decrement + cyg_ucount32 wakeup_count; + + // A word of data used in syncronization object to communicate + // information between sleepers and wakers. + CYG_ADDRWORD wait_info; + + // Unique thread id assigned on creation + cyg_uint16 unique_id; + +#ifdef CYGPKG_KERNEL_EXCEPTIONS + + // If exceptions are supported, define an exception control + // object that will be used to manage and deliver them. If + // exceptions are global there is a single static instance + // of this object, if they are per-thread then there is one + // for each thread. +private: + +#ifdef CYGSEM_KERNEL_EXCEPTIONS_GLOBAL + static +#endif + Cyg_Exception_Control exception_control; + +public: + + static void register_exception( + cyg_code exception_number, // exception number + cyg_exception_handler handler, // handler function + CYG_ADDRWORD data, // data argument + cyg_exception_handler **old_handler, // handler function + CYG_ADDRWORD *old_data // data argument + ); + + static void deregister_exception( + cyg_code exception_number // exception number + ); + + void deliver_exception( + cyg_code exception_number, // exception being raised + CYG_ADDRWORD exception_info // exception specific info + ); + +#endif + + +public: + + CYGDBG_DEFINE_CHECK_THIS + + // Constructor, Initialize the thread structure. The thread is + // created in suspended state, and needs to be resumed to execute. + // It is also started at some (configurable) default priority, which + // may need to be changed before calling resume. + + Cyg_Thread ( + cyg_thread_entry *entry, // entry point function + CYG_ADDRWORD entry_data, // entry data + cyg_ucount32 stack_size = 0, // stack size, 0 = use default + CYG_ADDRESS stack_base = 0 // stack base, NULL = allocate + ); + + Cyg_Thread ( + CYG_ADDRWORD sched_info, // Scheduling parameter(s) + cyg_thread_entry *entry, // entry point function + CYG_ADDRWORD entry_data, // entry data + char *name, // thread name + CYG_ADDRESS stack_base = 0, // stack base, NULL = allocate + cyg_ucount32 stack_size = 0 // stack size, 0 = use default + ); + + // Re-initialize the thread back to it's initial state. + void Cyg_Thread::reinitialize(); + + ~Cyg_Thread(); + + // The following are invoked implicitly on the current thread, + // hence they are static member functions. + + static void sleep(); // Put thread to sleep + + static void counted_sleep();// Decrement counter or put + // thread to sleep +#ifdef CYGFUN_KERNEL_THREADS_TIMER + static void counted_sleep( cyg_tick_count delay ); + // ...for delay ticks +#endif + + static void exit(); // Terminate thread + + static void yield(); // Yield CPU to another thread + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE + static void rotate_queue( cyg_priority pri ); + // Rotate that run queue +#endif + + static Cyg_Thread *self(); // Return current thread + + + // The following are called on threads other than the current one. + + void wake(); // Wake this thread from sleep. + + void counted_wake(); // Increment counter or wake thread + cyg_uint32 cancel_counted_wake(); + // Cancel counted wakeups for this + // thread and return how many were + // pending + + void suspend(); // Suspend this thread: increment counter and + // deschedule. + + void resume(); // Resume this thread: decrement counter and + // reschedule if counter is zero. + + void release(); // Release thread from sleep with BREAK + // wake_reason. + + void kill(); // Kill this thread + + void force_resume(); // Resume this thread: set counter to zero. + + cyg_uint32 get_state(); // Return current thread state. + + + // Accessor functions to set and get wait_info. + + void set_wait_info(CYG_ADDRWORD data); + + CYG_ADDRWORD get_wait_info(); + + // This part of the API is used if we have a clock and want + // per-thread timers for doing delays and timeouts. + + // delay the given number of ticks + void delay( cyg_tick_count delay ); + + + enum cyg_reason // sleep/wakeup reason codes + { + NONE, // No recorded reason + WAIT, // Wait with no timeout + DELAY, // Simple time delay + TIMEOUT, // Wait with timeout/timeout expired + BREAK, // forced break out of sleep + DESTRUCT, // wait object destroyed[note] + EXIT, // forced termination + DONE // Wait/delay complete + }; + // [note] NOT the thread, some object it was waiting on. + // Thread destruction would first involve EXITing it. + +private: + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + Cyg_ThreadTimer timer; // per-thread timer +#endif + + cyg_reason sleep_reason; // reason for sleeping + + cyg_reason wake_reason; // reason for waking + +#ifdef CYGIMP_THREAD_PRIORITY + +public: + + // If the scheduler implements priorities, provide + // functions to set and get it. + + void set_priority( cyg_priority pri ); + + cyg_priority get_priority(); + + // This returns the current dispatching priority of the + // thread. This may differ from the result of get_priority() + // in the presence of priority inheritance or certain + // scheduling algorithms. + cyg_priority get_current_priority(); + +#endif + +#ifdef CYGVAR_KERNEL_THREADS_DATA + +private: + // Array of single word entries for each index. + CYG_ADDRWORD thread_data[CYGNUM_KERNEL_THREADS_DATA_MAX]; + + // Map of free thread_data indexes. Each bit represents an index + // and is 1 if that index is free, and 0 if it is in use. + static cyg_ucount32 thread_data_map; + +public: + + static CYG_ADDRWORD get_data( cyg_ucount32 index ); + + static CYG_ADDRWORD *get_data_ptr( cyg_ucount32 index ); + + void set_data( cyg_ucount32 index, CYG_ADDRWORD data ); + + static cyg_ucount32 new_data_index(); + + static void free_data_index( cyg_ucount32 index ); + +#endif + +#ifdef CYGVAR_KERNEL_THREADS_NAME + +private: + // An optional thread name string, for humans to read + char *name; + +public: + // function to get the name string + char *get_name(); + +#endif + + +#ifdef CYGVAR_KERNEL_THREADS_LIST + + // Housekeeping list that tracks all threads +private: + Cyg_Thread *list_next; + static Cyg_Thread *thread_list; + + void add_to_list( void ); + void remove_from_list( void ); +public: + + static Cyg_Thread *get_list_head(); + + Cyg_Thread *get_list_next(); + +#endif + +public: + + // Set sleep reason to reason and wake reason to NONE + static void set_sleep_reason( cyg_reason reason = WAIT); + + cyg_reason get_sleep_reason(); + + // Set the wakeup reason to the given value + void set_wake_reason( cyg_reason reason = DONE); + + // Get current wake reason + cyg_reason get_wake_reason(); + + static void set_timer( // Set timeout and sleep reason + cyg_tick_count trigger, // Absolute wakeup time + cyg_reason sleep_reason // reason for sleeping + ); + + static void clear_timer(); // disable thread timer + + // Get a 16 bit unique id for this thread. This is + // used in tracing and instrumentation to identify the + // current thread. + + cyg_uint16 get_unique_id(); + +}; + +// ------------------------------------------------------------------------- +// Thread Queue class. +// This defines the main API for manipulating queues of threads. + +class Cyg_ThreadQueue + : private Cyg_ThreadQueue_Implementation +{ + +public: + + CYGDBG_DEFINE_CHECK_THIS + + // API used by rest of kernel. + + // Add thread to queue + void enqueue(Cyg_Thread *thread); + + // return first thread on queue + Cyg_Thread *highpri(); + + // remove first thread on queue + Cyg_Thread *dequeue(); + + // remove specified thread from queue + void remove(Cyg_Thread *thread); + + // test if queue is empty + cyg_bool empty(); + +}; + +// ------------------------------------------------------------------------- +// Thread inlines + +// Return current thread state. +inline cyg_uint32 Cyg_Thread::get_state() +{ + return state; +} + +inline void Cyg_Thread::set_wait_info(CYG_ADDRWORD data) +{ + wait_info = data; +} + +inline CYG_ADDRWORD Cyg_Thread::get_wait_info() +{ + return wait_info; +} + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_THREAD_HXX +// EOF thread.hxx diff --git a/packages/kernel/current/include/thread.inl b/packages/kernel/current/include/thread.inl new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/thread.inl @@ -0,0 +1,473 @@ +#ifndef CYGONCE_KERNEL_THREAD_INL +#define CYGONCE_KERNEL_THREAD_INL + +//========================================================================== +// +// thread.inl +// +// Thread class inlines +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-09 +// Purpose: Define inlines for thread classes +// Description: Inline implementations of various member functions defined +// in various Thread classes. +// Usage: +// #include +// ... +// #include +// ... + +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include + +#include + +//========================================================================== +// Inlines for Cyg_HardwareThread + +// ------------------------------------------------------------------------- +// Attach a stack to this thread. If there is a HAL defined macro to +// do this, then we use that, otherwise assume a falling stack. +inline void Cyg_HardwareThread::attach_stack(CYG_ADDRESS s_base, cyg_uint32 s_size) +{ + stack_base = s_base; + stack_size = s_size; +#ifdef CYGFUN_KERNEL_THREADS_STACK_LIMIT + stack_limit = s_base; +#endif + +#ifdef HAL_THREAD_ATTACH_STACK + + HAL_THREAD_ATTACH_STACK(stack_ptr, stack_base, stack_size); + +#else + + stack_ptr = stack_base + stack_size; + +#endif +} + +// ------------------------------------------------------------------------- + +inline Cyg_HardwareThread::Cyg_HardwareThread( + cyg_thread_entry *e_point, // entry point function + CYG_ADDRWORD e_data, // entry data + cyg_ucount32 s_size, // stack size, 0 = use default + CYG_ADDRESS s_base // stack base, NULL = allocate +) +{ + entry_point = e_point; + entry_data = e_data; +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + saved_context = 0; +#endif + + attach_stack( s_base, s_size ); +}; + +// ------------------------------------------------------------------------- +// get the size/base of this thread's stack + +inline CYG_ADDRESS +Cyg_HardwareThread::get_stack_base() +{ + return stack_base; +} + +inline cyg_uint32 +Cyg_HardwareThread::get_stack_size() +{ + return stack_size; +} + +// ------------------------------------------------------------------------- + +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + +// Return the current saved state for this thread. +inline HAL_SavedRegisters *Cyg_HardwareThread::get_saved_context() +{ + HAL_SavedRegisters *regs; + if( saved_context != 0 ) regs = saved_context; + else HAL_THREAD_GET_SAVED_REGISTERS( stack_ptr, regs ); + return regs; +} + +inline void Cyg_HardwareThread::set_saved_context(HAL_SavedRegisters *ctx) +{ + saved_context = ctx; +} + +#endif + +// ------------------------------------------------------------------------- +// (declare this inline before its first use) + +inline cyg_uint16 Cyg_Thread::get_unique_id() +{ + return unique_id; +} + +// ------------------------------------------------------------------------- +// Initialize the context of this thread. + +inline void Cyg_HardwareThread::init_context(Cyg_Thread *thread) +{ +#ifdef CYGPKG_INFRA_DEBUG + cyg_uint32 threadid = thread->get_unique_id()*0x01010000; +#else + cyg_uint32 threadid = 0x11110000; +#endif + HAL_THREAD_INIT_CONTEXT( stack_ptr, thread, thread_entry, threadid ); +} + + + +// ------------------------------------------------------------------------- +// Load thread context without saving current context. +// This function is only really here for completeness, the +// kernel generally calls the HAL macros directly. + +inline void Cyg_HardwareThread::load_context() +{ + CYG_ADDRESS dummy_stack_ptr; + + HAL_THREAD_SWITCH_CONTEXT( &dummy_stack_ptr, &stack_ptr ); +} + +// ------------------------------------------------------------------------- +// Save current thread's context and load that of the given next thread. +// This function is only really here for completeness, the +// kernel generally calls the HAL macros directly. + +inline void Cyg_HardwareThread::switch_context(Cyg_HardwareThread *next) +{ + HAL_THREAD_SWITCH_CONTEXT( &stack_ptr, &next->stack_ptr ); +} + +// ------------------------------------------------------------------------- +// Get and set entry_data. + +inline void Cyg_HardwareThread::set_entry_data( CYG_ADDRWORD data ) +{ + entry_data = data; +} + +inline CYG_ADDRWORD Cyg_HardwareThread::get_entry_data() +{ + return entry_data; +} + +// ------------------------------------------------------------------------- +// Allocate some memory at the lower end of the stack +// by moving the stack limit pointer. + +#ifdef CYGFUN_KERNEL_THREADS_STACK_LIMIT + +inline void *Cyg_HardwareThread::increment_stack_limit( cyg_ucount32 size) +{ + stack_limit += size; + return (void *)(stack_limit - size); +} + + +inline CYG_ADDRESS +Cyg_HardwareThread::get_stack_limit() +{ + return stack_limit; +} + +#endif + +//========================================================================== +// Inlines for Cyg_Thread class + +inline Cyg_Thread *Cyg_Thread::self() +{ + return Cyg_Scheduler::get_current_thread(); +} + +// ------------------------------------------------------------------------- + +inline void Cyg_Thread::yield() +{ + self()->Cyg_SchedThread::yield(); +} + +// ------------------------------------------------------------------------- + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE +inline void +Cyg_Thread::rotate_queue( cyg_priority pri ) +{ + self()->Cyg_SchedThread::rotate_queue( pri ); +} +#endif + +// ------------------------------------------------------------------------- + +#ifdef CYGIMP_THREAD_PRIORITY + +inline cyg_priority Cyg_Thread::get_priority() +{ +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE + + // If we have an inherited priority, return our original + // priority rather than the current one. + + if( priority_inherited ) return original_priority; + +#endif + + return priority; +} + +// Return the actual dispatching priority of the thread +// regardless of inheritance or scheduling concerns. +inline cyg_priority Cyg_Thread::get_current_priority() +{ + return priority; +} + +#endif + +// ------------------------------------------------------------------------- + +inline void Cyg_Thread::set_sleep_reason( cyg_reason reason) +{ + self()->sleep_reason = reason; + self()->wake_reason = NONE; +} + +// ------------------------------------------------------------------------- + +inline Cyg_Thread::cyg_reason Cyg_Thread::get_sleep_reason() +{ + return sleep_reason; +} + +// ------------------------------------------------------------------------- + +inline void Cyg_Thread::set_wake_reason( cyg_reason reason ) +{ + sleep_reason = NONE; + wake_reason = reason; +} + +// ------------------------------------------------------------------------- + +inline Cyg_Thread::cyg_reason Cyg_Thread::get_wake_reason() +{ + return wake_reason; +} + +// ------------------------------------------------------------------------- + +inline void Cyg_Thread::set_timer( + cyg_tick_count trigger, + cyg_reason reason +) +{ +#ifdef CYGFUN_KERNEL_THREADS_TIMER + self()->sleep_reason = reason; + self()->wake_reason = NONE; + self()->timer.initialize( trigger); +#endif +} + +// ------------------------------------------------------------------------- + +inline void Cyg_Thread::clear_timer() +{ +#ifdef CYGFUN_KERNEL_THREADS_TIMER + self()->timer.disable(); +#endif +} + +// ------------------------------------------------------------------------- + +#ifdef CYGVAR_KERNEL_THREADS_DATA + +inline CYG_ADDRWORD Cyg_Thread::get_data( cyg_ucount32 index ) +{ + CYG_ASSERT( index < CYGNUM_KERNEL_THREADS_DATA_MAX, + "Per thread data index out of bounds"); + CYG_ASSERT( (thread_data_map & (1<thread_data[index]; +} + +inline CYG_ADDRWORD *Cyg_Thread::get_data_ptr( cyg_ucount32 index ) +{ + CYG_ASSERT( index < CYGNUM_KERNEL_THREADS_DATA_MAX, + "Per thread data index out of bounds"); + CYG_ASSERT( (thread_data_map & (1<thread_data[index]); +} + +inline void Cyg_Thread::set_data( cyg_ucount32 index, CYG_ADDRWORD data ) +{ + CYG_ASSERT( index < CYGNUM_KERNEL_THREADS_DATA_MAX, + "Per thread data index out of bounds"); + CYG_ASSERT( (thread_data_map & (1<list_next:0; +} + +inline Cyg_Thread *Cyg_Thread::get_list_next() +{ + return (this==thread_list)?0:list_next; +} + +#endif + + +// ------------------------------------------------------------------------- + +#ifdef CYGPKG_KERNEL_EXCEPTIONS + +inline void Cyg_Thread::register_exception( + cyg_code exception_number, // exception number + cyg_exception_handler handler, // handler function + CYG_ADDRWORD data, // data argument + cyg_exception_handler **old_handler, // handler function + CYG_ADDRWORD *old_data // data argument + ) +{ + self()->exception_control.register_exception( + exception_number, + handler, + data, + old_handler, + old_data + ); +} + +inline void Cyg_Thread::deregister_exception( + cyg_code exception_number // exception number + ) +{ + self()->exception_control.deregister_exception( + exception_number + ); +} + +#endif + +//========================================================================== +// Inlines for Cyg_ThreadTimer class + +// ------------------------------------------------------------------------- +#if defined(CYGFUN_KERNEL_THREADS_TIMER) && defined(CYGVAR_KERNEL_COUNTERS_CLOCK) + +inline Cyg_ThreadTimer::Cyg_ThreadTimer( + Cyg_Thread *th + ) + : Cyg_Alarm(Cyg_Clock::real_time_clock, + &alarm, + CYG_ADDRWORD(this) + ) +{ + thread = th; +} + +#endif + +//========================================================================== +// Inlines for Cyg_ThreadQueue class + + +inline void Cyg_ThreadQueue::enqueue(Cyg_Thread *thread) +{ + Cyg_ThreadQueue_Implementation::enqueue(thread); +} + +// ------------------------------------------------------------------------- + +inline Cyg_Thread *Cyg_ThreadQueue::highpri() +{ + return Cyg_ThreadQueue_Implementation::highpri(); +} + +// ------------------------------------------------------------------------- + +inline Cyg_Thread *Cyg_ThreadQueue::dequeue() +{ + return Cyg_ThreadQueue_Implementation::dequeue(); +} + +// ------------------------------------------------------------------------- + +inline void Cyg_ThreadQueue::remove(Cyg_Thread *thread) +{ + Cyg_ThreadQueue_Implementation::remove(thread); +} + +// ------------------------------------------------------------------------- + +inline cyg_bool Cyg_ThreadQueue::empty() +{ + return Cyg_ThreadQueue_Implementation::empty(); +} + +// ------------------------------------------------------------------------- +#endif // ifndef CYGONCE_KERNEL_THREAD_INL +// EOF thread.inl diff --git a/packages/kernel/current/include/timer.hxx b/packages/kernel/current/include/timer.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/include/timer.hxx @@ -0,0 +1,116 @@ +#ifndef CYGONCE_KERNEL_TIMER_HXX +#define CYGONCE_KERNEL_TIMER_HXX + +//========================================================================== +// +// timer.hxx +// +// Timer handler class declaration(s) +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-10 +// Purpose: Define Timer class interfaces +// Description: This file defines the Timer class which is derived from +// the Alarm class to support uITRON type functionality +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include +#include // assertion macros +#include // Cyg_Alarm + +// ------------------------------------------------------------------------- +// Timer handler class + +class Cyg_Timer + : public Cyg_Alarm +{ +public: + + CYGDBG_DEFINE_CHECK_THIS + + Cyg_Timer(); + + ~Cyg_Timer(); + + enum { + DISABLE = 0, + ENABLE = 1, + RESET = 2, + }; + + void initialize( + Cyg_Counter *counter, + cyg_alarm_fn alarm_fn, + CYG_ADDRWORD data, + cyg_tick_count trigger, // absolute time + cyg_tick_count interval, // 0 => one shot, else repeating + cyg_uint32 action // (DISABLE | ENABLE) + ); + + void activate(cyg_uint32 action); // (DISABLE | ENABLE) [|RESET] + + cyg_tick_count get_trigger(); + cyg_bool is_enabled(); + cyg_bool is_initialized(); + CYG_ADDRWORD get_data(); +}; + +// ------------------------------------------------------------------------- +// Timer inlines + +inline cyg_tick_count +Cyg_Timer::get_trigger() +{ + return trigger; +} + +inline cyg_bool +Cyg_Timer::is_initialized() +{ + return NULL != counter; +} + +inline cyg_bool +Cyg_Timer::is_enabled() +{ + return enabled; +} + +inline CYG_ADDRWORD +Cyg_Timer::get_data() +{ + return data; +} + +#endif // ifndef CYGONCE_KERNEL_TIMER_HXX +// EOF timer.hxx diff --git a/packages/kernel/current/src/PKGconf.mak b/packages/kernel/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/PKGconf.mak @@ -0,0 +1,51 @@ +#=============================================================================== +# +# makefile +# +# kernel/src +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := kernel +include ../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := common/clock.cxx common/timer.cxx \ + common/kapi.cxx common/thread.cxx common/except.cxx \ + instrmnt/meminst.cxx instrmnt/nullinst.cxx \ + intr/intr.cxx \ + mem/memfixed.cxx mem/memvar.cxx \ + sched/bitmap.cxx sched/lottery.cxx sched/mlqueue.cxx \ + sched/sched.cxx \ + sync/bin_sem.cxx sync/cnt_sem.cxx sync/flag.cxx \ + sync/cnt_sem2.cxx sync/mbox.cxx sync/mutex.cxx \ + debug/dbg-thread-demux.c debug/dbg_gdb.cxx + +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/kernel/current/src/common/clock.cxx b/packages/kernel/current/src/common/clock.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/common/clock.cxx @@ -0,0 +1,642 @@ +//========================================================================== +// +// common/clock.cxx +// +// Clock class implementations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-15 +// Purpose: Clock class implementation +// Description: This file contains the definitions of the counter, +// clock and alarm class member functions that are common +// to all clock implementations. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros + +#include // our header + +#include // scheduler definitions +#include // thread definitions +#include // interrupt definitions + +#include // scheduler inlines +#include // Clock inlines + +// ------------------------------------------------------------------------- +// Static variables + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK + +Cyg_Clock *Cyg_Clock::real_time_clock = NULL; // System real time clock + +#endif + +//========================================================================== +// Constructor for counter object + +Cyg_Counter::Cyg_Counter( + cyg_uint32 incr + ) +{ + CYG_REPORT_FUNCTION(); + + counter = 0; + increment = incr; +#if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) + + alarm_list = NULL; // Linear list of Alarms + +#elif defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) + + for(cyg_ucount32 i=0; i < CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE; i++) { + alarm_list[i] = NULL; + } + +#else +#error "No CYGIMP_KERNEL_COUNTERS_x_LIST config" +#endif + +} + +// ------------------------------------------------------------------------- +// Destructor for Counter object + +Cyg_Counter::~Cyg_Counter() +{ + CYG_REPORT_FUNCTION(); + + +} + +// ------------------------------------------------------------------------- +// + +#ifdef CYGDBG_USE_ASSERTS + +bool Cyg_Counter::check_this( cyg_assert_class_zeal zeal) +{ + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + + switch( zeal ) + { + case cyg_system_test: + case cyg_extreme: + case cyg_thorough: + case cyg_quick: + case cyg_trivial: + case cyg_none: + default: + break; + }; + + return true; +} + +#endif + +// ------------------------------------------------------------------------- +// Counter tick function + +void Cyg_Counter::tick( cyg_uint32 ticks ) +{ +// CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad counter object" ); + + // Increment the counter in a loop so we process + // each tick separately. This is easier than trying + // to cope with a range of increments. + + while( ticks-- ) + { + Cyg_Scheduler::lock(); + + // increment the counter, note that it is + // allowed to wrap. + counter += increment; + + // now check for any expired alarms + + Cyg_Alarm **alarm_list_ptr; // pointer to list + +#if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) + + alarm_list_ptr = &alarm_list; + +#elif defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) + + // With multiple lists, each one contains only the alarms + // that will expire at a given tick modulo the list number. + // So we only have a fraction of the alarms to check here. + + alarm_list_ptr = &(alarm_list[ + (counter/increment) % CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE ] ); + +#else +#error "No CYGIMP_KERNEL_COUNTERS_x_LIST config" +#endif + + // Now that we have the list pointer, we can use common code for + // both list oragnizations. + + while( *alarm_list_ptr != NULL ) + { + Cyg_Alarm *alarm = *alarm_list_ptr; + + CYG_ASSERTCLASS(alarm, "Bad alarm in counter list" ); + + if( alarm->trigger <= counter ) + { + // remove alarm from list + *alarm_list_ptr = alarm->next; + + if( alarm->interval != 0 ) + { + // The alarm has a retrigger interval. + // Reset the trigger time and requeue + // the alarm. + alarm->trigger += alarm->interval; + add_alarm( alarm ); + } + else alarm->enabled = false; + + CYG_INSTRUMENT_ALARM( CALL, this, alarm ); + + // call alarm function + alarm->alarm(alarm, alarm->data); + + // all done, loop + } + else break; + } + + Cyg_Scheduler::unlock(); + + } + +} + +// ------------------------------------------------------------------------- +// Add an alarm to this counter + +void Cyg_Counter::add_alarm( Cyg_Alarm *alarm ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad counter object" ); + CYG_ASSERTCLASS( alarm, "Bad alarm passed" ); + + Cyg_Scheduler::lock(); + + // set this now to allow an immediate handler call to manipulate + // this alarm sensibly. + alarm->enabled = true; + + // Check here for an alarm that triggers now or in the past and + // call its alarm function immediately. + if( alarm->trigger <= counter ) + { + CYG_INSTRUMENT_ALARM( CALL, this, alarm ); + + // call alarm function. Note that this is being + // called here before the add_alarm has returned. + // Note that this function may disable the alarm. + + alarm->alarm(alarm, alarm->data); + + // Note that this extra check on alarm->enabled is in case the + // handler function disables this alarm! + if( alarm->interval != 0 && alarm->enabled ) + { + // The alarm has a retrigger interval. + // Reset the trigger interval and drop + // through to queue it. + alarm->trigger += alarm->interval; + // ensure the next alarm time is in our future, and in phase + // with the original time requested. + alarm->synchronize(); + } + else + { + // The alarm is all done with, disable it + // unlock and return. + alarm->enabled = false; + Cyg_Scheduler::unlock(); + return; + } + } + + CYG_INSTRUMENT_ALARM( ADD, this, alarm ); + + { + // Find the pointer to the relevant list _after_ a retrigger + // alarm has been given its new trigger time. + + Cyg_Alarm **alarm_list_ptr; // pointer to list + +#if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) + + alarm_list_ptr = &alarm_list; + +#elif defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) + + // Each alarm must go into the list that covers the tick that is + // going to happen _after_ the trigger time (or at it if trigger + // happens to fall on a tick. + + alarm_list_ptr = &(alarm_list[ + ((alarm->trigger+increment-1)/increment) % + CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE ] ); + +#else +#error "No CYGIMP_KERNEL_COUNTERS_x_LIST config" +#endif + + + // Now that we have the list pointer, we can use common code for + // both list oragnizations. + + while( *alarm_list_ptr != NULL ) + { + Cyg_Alarm *list_alarm = *alarm_list_ptr; + + CYG_ASSERTCLASS(list_alarm, "Bad alarm in counter list" ); + + // The alarms are in ascending trigger order. When we + // find an alarm that is later than us, we go in front of + // it. + + if( list_alarm->trigger > alarm->trigger ) break; + else alarm_list_ptr = &list_alarm->next; + } + + // Insert the new alarm at *alarm_list_ptr + + alarm->next = *alarm_list_ptr; + *alarm_list_ptr = alarm; + + Cyg_Scheduler::unlock(); + } +} + +// ------------------------------------------------------------------------- +// Remove an alarm from this counter + +void Cyg_Counter::rem_alarm( Cyg_Alarm *alarm ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad counter object" ); + CYG_ASSERTCLASS( alarm, "Bad alarm passed" ); + + Cyg_Alarm **alarm_list_ptr; // pointer to list + +#if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) + + alarm_list_ptr = &alarm_list; + +#elif defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) + + alarm_list_ptr = &(alarm_list[ + ((alarm->trigger+increment-1)/increment) % + CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE ] ); + +#else +#error "No CYGIMP_KERNEL_COUNTERS_x_LIST config" +#endif + + // Now that we have the list pointer, we can use common code for + // both list organizations. + + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_ALARM( REM, this, alarm ); + + while( *alarm_list_ptr != NULL ) + { + Cyg_Alarm *list_alarm = *alarm_list_ptr; + + CYG_ASSERTCLASS(list_alarm, "Bad alarm in counter list" ); + + if( list_alarm == alarm ) break; + else alarm_list_ptr = &list_alarm->next; + } + + // If the alarm was found, remove it from the list. + if( *alarm_list_ptr != NULL ) + { + *alarm_list_ptr = alarm->next; + alarm->enabled = false; + } + + Cyg_Scheduler::unlock(); +} + +//========================================================================== +// Constructor for clock object + +Cyg_Clock::Cyg_Clock( + cyg_resolution res + ) +{ + CYG_REPORT_FUNCTION(); + + resolution = res; +} + +// ------------------------------------------------------------------------- +// Destructor for Clock objects + +Cyg_Clock::~Cyg_Clock() +{ + CYG_REPORT_FUNCTION(); + +} + +// ------------------------------------------------------------------------- +// + +#ifdef CYGDBG_USE_ASSERTS + +bool Cyg_Clock::check_this( cyg_assert_class_zeal zeal) +{ + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + + switch( zeal ) + { + case cyg_system_test: + case cyg_extreme: + case cyg_thorough: + case cyg_quick: + case cyg_trivial: + case cyg_none: + default: + break; + }; + + return true; +} + +#endif + +//========================================================================== +// Constructor for alarm object + +Cyg_Alarm::Cyg_Alarm( + Cyg_Counter *c, // Attached to this counter + cyg_alarm_fn *a, // Call-back function + CYG_ADDRWORD d // Call-back data + ) +{ + CYG_REPORT_FUNCTION(); + + counter = c; + alarm = a; + data = d; + trigger = 0; + interval = 0; + enabled = false; + +#if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) || defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) + next = NULL; +#endif + +} + +Cyg_Alarm::Cyg_Alarm(){} + +// ------------------------------------------------------------------------- +// Destructor + +Cyg_Alarm::~Cyg_Alarm() +{ + CYG_REPORT_FUNCTION(); + + disable(); +} + +// ------------------------------------------------------------------------- +// + +#ifdef CYGDBG_USE_ASSERTS + +bool Cyg_Alarm::check_this( cyg_assert_class_zeal zeal) +{ + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + + switch( zeal ) + { + case cyg_system_test: + case cyg_extreme: + case cyg_thorough: + if( trigger != 0 && !enabled ) return false; + case cyg_quick: + case cyg_trivial: + case cyg_none: + default: + break; + }; + + return true; +} + +#endif + +// ------------------------------------------------------------------------- +// Initialize Alarm and enable + +void Cyg_Alarm::initialize( + cyg_tick_count t, // Absolute trigger time + cyg_tick_count i // Relative retrigger interval + ) +{ + CYG_REPORT_FUNCTION(); + + // If already enabled, remove from counter + + if( enabled ) counter->rem_alarm(this); + + CYG_INSTRUMENT_ALARM( INIT, this, 0 ); + CYG_INSTRUMENT_ALARM( TRIGGER, + ((cyg_uint32 *)&t)[0], + ((cyg_uint32 *)&t)[1] ); + CYG_INSTRUMENT_ALARM( INTERVAL, + ((cyg_uint32 *)&i)[0], + ((cyg_uint32 *)&i)[1] ); + + trigger = t; + interval = i; + + counter->add_alarm(this); +} + +// ------------------------------------------------------------------------- +// Synchronize with a past alarm stream that had been disabled, +// bring past times into synch, and the like. + +void +Cyg_Alarm::synchronize( void ) +{ + if( interval != 0 ) { + // This expression sets the trigger to the next whole interval + // at or after the current time. This means that alarms will + // continue at the same intervals as if they had never been + // disabled. The alternative would be to just set trigger to + // (counter->counter + interval), but this is less satisfying + // than preserving the original intervals. That behaviour can + // always be obtained by using initialize() rather than + // enable(), while the current behaviour would be more + // difficult to achieve that way. + cyg_tick_count d; + d = counter->current_value() + interval - trigger; + if ( d > interval ) { + // then trigger was in the past, so resynchronize + trigger += interval * ((d - 1) / interval ); + } + // otherwise, we were just set up, so no worries. + } +} + +// ------------------------------------------------------------------------- +// Ensure alarm enabled + +void Cyg_Alarm::enable() +{ + if( !enabled ) + { + // ensure the alarm time is in our future: + synchronize(); + enabled = true; + counter->add_alarm(this); + } +} + +//========================================================================== +// System clock object + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK + +class Cyg_RealTimeClock + : public Cyg_Clock +{ + Cyg_Interrupt interrupt; + + static cyg_uint32 isr(cyg_vector vector, CYG_ADDRWORD data); + + static void dsr(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data); + + Cyg_RealTimeClock(); + + static Cyg_RealTimeClock rtc; +}; + +Cyg_Clock::cyg_resolution rtc_resolution = CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION; + +//Cyg_RealTimeClock Cyg_RealTimeClock::rtc __attribute__((init_priority (1))); + +Cyg_RealTimeClock Cyg_RealTimeClock::rtc CYG_INIT_PRIORITY( CLOCK ); + +// ------------------------------------------------------------------------- + +Cyg_RealTimeClock::Cyg_RealTimeClock() + : Cyg_Clock(rtc_resolution), + interrupt(CYG_VECTOR_RTC, 1, (CYG_ADDRWORD)this, isr, dsr) +{ + CYG_REPORT_FUNCTION(); + + HAL_CLOCK_INITIALIZE( CYGNUM_KERNEL_COUNTERS_RTC_PERIOD ); + + interrupt.attach(); + + interrupt.unmask_interrupt(CYG_VECTOR_RTC); + + Cyg_Clock::real_time_clock = this; +} + +// ------------------------------------------------------------------------- + +cyg_uint32 Cyg_RealTimeClock::isr(cyg_vector vector, CYG_ADDRWORD data) +{ +// CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_CLOCK( ISR, 0, 0); + + HAL_CLOCK_RESET( CYG_VECTOR_RTC, CYGNUM_KERNEL_COUNTERS_RTC_PERIOD ); + + Cyg_Interrupt::acknowledge_interrupt(CYG_VECTOR_RTC); + + return Cyg_Interrupt::CALL_DSR; +} + +// ------------------------------------------------------------------------- + +void Cyg_RealTimeClock::dsr(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data) +{ +// CYG_REPORT_FUNCTION(); + + Cyg_RealTimeClock *rtc = (Cyg_RealTimeClock *)data; + + CYG_INSTRUMENT_CLOCK( TICK_START, + rtc->current_value_lo(), + rtc->current_value_hi()); + + rtc->tick( count ); + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE +#if 0 == CYG_SCHED_UNIQUE_PRIORITIES + + // If timeslicing is enabled, call the scheduler to + // handle it. But not if we have unique priorities. + + Cyg_Scheduler::scheduler.timeslice(); + +#endif +#endif + + CYG_INSTRUMENT_CLOCK( TICK_END, + rtc->current_value_lo(), + rtc->current_value_hi()); + +} + +#endif + +// ------------------------------------------------------------------------- +// EOF common/clock.cxx diff --git a/packages/kernel/current/src/common/except.cxx b/packages/kernel/current/src/common/except.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/common/except.cxx @@ -0,0 +1,230 @@ +//========================================================================== +// +// common/except.cxx +// +// Exception handling implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-04-09 +// Purpose: Exception handling implementation +// Description: This file contains the code that registers and delivers +// exceptions. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // our header + +#include // architecture definitions +#include // vector definitions + +#include // thread interface + +#include // thread inlines + +#ifdef CYGPKG_KERNEL_EXCEPTIONS + +// ------------------------------------------------------------------------- +// Null exception handler. This is used to capture exceptions that are +// not caught by user supplied handlers. + +void cyg_null_exception_handler( + CYG_ADDRWORD data, // user supplied data + cyg_code exception_number, // exception being raised + CYG_ADDRWORD exception_info // any exception specific info + ) +{ + CYG_TRACE1( 1, "Uncaught exception: %d", exception_number); +} + +// ------------------------------------------------------------------------- +// Exception Controller constructor. + +Cyg_Exception_Control::Cyg_Exception_Control() +{ +#ifdef CYGSEM_KERNEL_EXCEPTIONS_DECODE + + for( int i = 0; i < CYG_EXCEPTION_COUNT ; i++ ) + exception_handler[i] = cyg_null_exception_handler, + exception_data[i] = 0; +#else + + exception_handler = cyg_null_exception_handler; + exception_data = 0; + +#endif + +} + +// ------------------------------------------------------------------------- +// Exception registation. Stores the handler function and data to be used +// for handling the given exception number. Where exceptions are not decoded +// only a single handler may be registered for all exceptions. This function +// also returns the old values of the exception handler and data to allow +// chaining to be implemented. + +void Cyg_Exception_Control::register_exception( + cyg_code exception_number, // exception number + cyg_exception_handler handler, // handler function + CYG_ADDRWORD data, // data argument + cyg_exception_handler **old_handler, // handler function + CYG_ADDRWORD *old_data // data argument + ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( exception_number <= CYG_EXCEPTION_MAX, + "Out of range exception number"); + CYG_ASSERT( exception_number >= CYG_EXCEPTION_MIN, + "Out of range exception number"); + + + // Should we complain if there is already a registered + // handler, or should we just replace is silently? + +#ifdef CYGSEM_KERNEL_EXCEPTIONS_DECODE + + if( old_handler != NULL ) + *old_handler = exception_handler[exception_number]; + if( old_data != NULL ) + *old_data = exception_data[exception_number]; + exception_handler[exception_number] = handler; + exception_data[exception_number] = data; + +#else + + if( old_handler != NULL ) + *old_handler = exception_handler; + if( old_data != NULL ) + *old_data = exception_data; + exception_handler = handler; + exception_data = data; + +#endif + +} + +// ------------------------------------------------------------------------- +// Exception deregistation. Revert the handler for the exception number +// to the default. + +void Cyg_Exception_Control::deregister_exception( + cyg_code exception_number // exception number + ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( exception_number <= CYG_EXCEPTION_MAX, + "Out of range exception number"); + CYG_ASSERT( exception_number >= CYG_EXCEPTION_MIN, + "Out of range exception number"); + +#ifdef CYGSEM_KERNEL_EXCEPTIONS_DECODE + + exception_handler[exception_number] = cyg_null_exception_handler; + exception_data[exception_number] = 0; + +#else + + exception_handler = cyg_null_exception_handler; + exception_data = 0; + +#endif + +} + +// ------------------------------------------------------------------------- +// Exception delivery. Call the appropriate exception handler. + +void Cyg_Exception_Control::deliver_exception( + cyg_code exception_number, // exception being raised + CYG_ADDRWORD exception_info // exception specific info + ) +{ + cyg_exception_handler *handler = NULL; + CYG_ADDRWORD data = 0; + + CYG_ASSERT( exception_number <= CYG_EXCEPTION_MAX, + "Out of range exception number"); + CYG_ASSERT( exception_number >= CYG_EXCEPTION_MIN, + "Out of range exception number"); + +#ifdef CYGSEM_KERNEL_EXCEPTIONS_DECODE + + handler = exception_handler[exception_number]; + data = exception_data[exception_number]; + +#else + + handler = exception_handler; + data = exception_data; + +#endif + + // The handler will always be a callable function: either the user's + // registered function or the null handler. So it is always safe to + // just go ahead and call it. + + handler( data, exception_number, exception_info ); + +} + +// ------------------------------------------------------------------------- +// Exception delivery function called from the HAL as a result of a +// hardware exception being raised. + +externC void deliver_exception( CYG_WORD code, CYG_ADDRWORD data ) +{ + Cyg_Thread::self()->deliver_exception( code, data ); +} + +// ------------------------------------------------------------------------- +// Where exceptions are global, there is a single static instance of the +// exception control object. Define it here. + +#ifdef CYGSEM_KERNEL_EXCEPTIONS_GLOBAL + +Cyg_Exception_Control Cyg_Thread::exception_control; + +#endif + +// ------------------------------------------------------------------------- + +#endif + +// ------------------------------------------------------------------------- +// EOF common/except.cxx diff --git a/packages/kernel/current/src/common/kapi.cxx b/packages/kernel/current/src/common/kapi.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/common/kapi.cxx @@ -0,0 +1,1070 @@ +//========================================================================== +// +// common/kapi.cxx +// +// C API Implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg, dsm +// Contributors: nickg +// Date: 1998-03-02 +// Purpose: C API Implementation +// Description: C++ implementation of the C API +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation +#include + +#include +#include // thread inlines +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include // scheduler inlines +#include // clock inlines + +#include // C API + +// ------------------------------------------------------------------------- +// Magic new function + +inline void *operator new(size_t size, void *ptr) +{ + CYG_CHECK_DATA_PTR( ptr, "Bad pointer" ); + return ptr; +} + +// ------------------------------------------------------------------------- + +#ifdef CYGDBG_USE_ASSERTS + +#define CYG_ASSERT_SIZES(cstruct, cxxstruct) \ +CYG_MACRO_START \ + char *msg = "Size of C struct " #cstruct \ + " != size of C++ struct " #cxxstruct ; \ + CYG_ASSERT( sizeof(cstruct) == sizeof(cxxstruct) , msg ); \ +CYG_MACRO_END + +#else + +#define CYG_ASSERT_SIZES(cstruct, cxxstruct) + +#endif + +/*---------------------------------------------------------------------------*/ +/* Scheduler operations */ + +/* Starts scheduler with created threads. Never returns. */ +externC void cyg_scheduler_start(void) +{ + Cyg_Scheduler::start(); +} + +/* Lock the scheduler. We only allow this to take the lock from */ +/* zero to 1. Any other transition implies that this function */ +/* is being called from an ISR/DSR or some other illegal place. */ +externC void cyg_scheduler_lock(void) +{ + Cyg_Scheduler::lock(); + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1 , + "Cannot nest calls to cyg_scheduler_lock"); + + if( Cyg_Scheduler::get_sched_lock() != 1 ) + Cyg_Scheduler::unlock(); +} + +/* Unlock the scheduler. Like lock, we only allow a 1->0 */ +/* transition. */ +externC void cyg_scheduler_unlock(void) +{ + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1 , + "Bad call to cyg_scheduler_unlock"); + + if( Cyg_Scheduler::get_sched_lock() == 1 ) + Cyg_Scheduler::unlock(); + +} + +/*---------------------------------------------------------------------------*/ +/* Thread operations */ + +externC void cyg_thread_create( + cyg_addrword_t sched_info, /* scheduling info (eg pri) */ + cyg_thread_entry_t *entry, /* entry point function */ + cyg_addrword_t entry_data, /* entry data */ + char *name, /* optional thread name */ + void *stack_base, /* stack base, NULL = alloc */ + cyg_ucount32 stack_size, /* stack size, 0 = default */ + cyg_handle_t *handle, /* returned thread handle */ + cyg_thread *thread /* put thread here */ +) +{ + CYG_ASSERT_SIZES( cyg_thread, Cyg_Thread ); + + Cyg_Thread *t = new((void *)thread) Cyg_Thread ( + (CYG_ADDRWORD) sched_info, + (cyg_thread_entry *)entry, + (CYG_ADDRWORD) entry_data, + name, + (CYG_ADDRWORD) stack_base, + stack_size + ); + t=t; + + CYG_CHECK_DATA_PTR( handle, "Bad handle pointer" ); + *handle = (cyg_handle_t)thread; +} + +externC void cyg_thread_exit() +{ + Cyg_Thread::exit(); +} + +externC void cyg_thread_suspend(cyg_handle_t thread) +{ + ((Cyg_Thread *)thread)->suspend(); +} + +externC void cyg_thread_resume(cyg_handle_t thread) +{ + Cyg_Thread *th = (Cyg_Thread *)thread; + + // If we are resuming an exited thread then + // reinitialize it. + + if( th->get_state() == Cyg_Thread::EXITED ) + th->reinitialize(); + + th->resume(); +} + +externC void cyg_thread_kill( cyg_handle_t thread) +{ + ((Cyg_Thread *)thread)->kill(); +} + +externC void cyg_thread_yield() +{ + Cyg_Thread::yield(); +} + +externC cyg_handle_t cyg_thread_self() +{ + return (cyg_handle_t)Cyg_Thread::self(); +} + +/* Priority manipulation */ +externC void cyg_thread_set_priority( + cyg_handle_t thread, cyg_priority_t priority ) +{ + ((Cyg_Thread *)thread)->set_priority(priority); +} + +externC cyg_priority_t cyg_thread_get_priority(cyg_handle_t thread) +{ + return ((Cyg_Thread *)thread)->get_priority(); +} + +/* Deadline scheduling control (optional) */ + +externC void cyg_thread_deadline_wait( + cyg_tick_count_t start_time, /* abs earliest start time */ + cyg_tick_count_t run_time, /* worst case execution time */ + cyg_tick_count_t deadline /* absolute deadline */ +) +{ + CYG_ASSERT(0,"Not implemented"); +} + +externC void cyg_thread_delay(cyg_tick_count_t delay) +{ + Cyg_Thread::self()->delay(delay); +} + + +/*---------------------------------------------------------------------------*/ +/* Exception handling. */ + +#ifdef CYGPKG_KERNEL_EXCEPTIONS +externC void cyg_exception_set_handler( + cyg_code_t exception_number, + cyg_exception_handler_t *new_handler, + cyg_addrword_t new_data, + cyg_exception_handler_t **old_handler, + cyg_addrword_t *old_data +) +{ + Cyg_Thread::register_exception( + exception_number, + (cyg_exception_handler *)new_handler, + (CYG_ADDRWORD)new_data, + (cyg_exception_handler **)old_handler, + (CYG_ADDRWORD *)old_data + ); +} + +/* Clear exception handler to default */ +externC void cyg_exception_clear_handler( + cyg_code_t exception_number +) +{ + Cyg_Thread::deregister_exception( exception_number ); +} + +/* Invoke exception handler */ +externC void cyg_exception_call_handler( + cyg_handle_t thread, + cyg_code_t exception_number, + cyg_code_t error_code +) +{ + Cyg_Thread *t = (Cyg_Thread *)thread; + + t->deliver_exception( exception_number, error_code ); +} +#endif + +/*---------------------------------------------------------------------------*/ +/* Interrupt handling */ + +externC void cyg_interrupt_create( + cyg_vector_t vector, /* Vector to attach to */ + cyg_priority_t priority, /* Queue priority */ + cyg_addrword_t data, /* Data pointer */ + cyg_ISR_t *isr, /* Interrupt Service Routine */ + cyg_DSR_t *dsr, /* Deferred Service Routine */ + cyg_handle_t *handle, /* returned handle */ + cyg_interrupt *intr /* put interrupt here */ +) +{ + CYG_ASSERT_SIZES( cyg_interrupt, Cyg_Interrupt ); + + Cyg_Interrupt *t = new((void *)intr) Cyg_Interrupt ( + (cyg_vector)vector, + (cyg_priority)priority, + (CYG_ADDRWORD)data, + (cyg_ISR *)isr, + (cyg_DSR *)dsr ); + t=t; + + CYG_CHECK_DATA_PTR( handle, "Bad handle pointer" ); + *handle = (cyg_handle_t)intr; +} + +externC void cyg_interrupt_delete( cyg_handle_t interrupt) +{ + ((Cyg_Interrupt *)interrupt)->~Cyg_Interrupt(); +} + +void cyg_interrupt_attach( cyg_handle_t interrupt ) +{ + ((Cyg_Interrupt *)interrupt)->attach(); +} + +void cyg_interrupt_detach( cyg_handle_t interrupt ) +{ + ((Cyg_Interrupt *)interrupt)->detach(); +} + +/* VSR manipulation */ + +externC void cyg_interrupt_get_vsr( + cyg_vector_t vector, /* vector to get */ + cyg_VSR_t **vsr /* vsr got */ +) +{ + Cyg_Interrupt::get_vsr( (cyg_vector)vector, (cyg_VSR **)vsr); +} + +externC void cyg_interrupt_set_vsr( + cyg_vector_t vector, /* vector to set */ + cyg_VSR_t *vsr /* vsr to set */ +) +{ + Cyg_Interrupt::set_vsr( (cyg_vector)vector, (cyg_VSR *)vsr); +} + +/* CPU level interrupt mask */ +externC void cyg_interrupt_disable() +{ + Cyg_Interrupt::disable_interrupts(); +} + +externC void cyg_interrupt_enable() +{ + Cyg_Interrupt::enable_interrupts(); +} + +/* Interrupt controller access */ +externC void cyg_interrupt_mask(cyg_vector_t vector) +{ + Cyg_Interrupt::mask_interrupt( (cyg_vector)vector); +} + +externC void cyg_interrupt_unmask(cyg_vector_t vector) +{ + Cyg_Interrupt::unmask_interrupt( (cyg_vector)vector); +} + + +externC void cyg_interrupt_acknowledge(cyg_vector_t vector) +{ + Cyg_Interrupt::acknowledge_interrupt( (cyg_vector)vector); +} + + +externC void cyg_interrupt_configure( + cyg_vector_t vector, /* vector to configure */ + cyg_bool_t level, /* level or edge triggered */ + cyg_bool_t up /* rising/faling edge, high/low level*/ +) +{ + Cyg_Interrupt::configure_interrupt( (cyg_vector)vector, level, up ); +} + + +/*---------------------------------------------------------------------------*/ +/* Counters, Clocks and Alarms */ + +externC void cyg_counter_create( + cyg_handle_t *handle, /* returned counter handle */ + cyg_counter *counter /* put counter here */ +) +{ + CYG_ASSERT_SIZES( cyg_counter, Cyg_Counter ); + + Cyg_Counter *t = new((void *)counter) Cyg_Counter (); + t=t; + + CYG_CHECK_DATA_PTR( handle, "Bad handle pointer" ); + *handle = (cyg_handle_t)counter; +} + +externC void cyg_counter_delete(cyg_handle_t counter) +{ + ((Cyg_Counter *)counter)->~Cyg_Counter(); +} + +/* Return current value of counter */ +externC cyg_tick_count_t cyg_counter_current_value(cyg_handle_t counter) +{ + return ((Cyg_Counter *)counter)->current_value(); +} + +/* Set new current value */ +externC void cyg_counter_set_value( + cyg_handle_t counter, + cyg_tick_count_t new_value +) +{ + ((Cyg_Counter *)counter)->set_value( new_value ); +} + +/* Advance counter by one tick */ +externC void cyg_counter_tick(cyg_handle_t counter) +{ + ((Cyg_Counter *)counter)->tick(); +} + +/* Create a clock object */ +externC void cyg_clock_create( + cyg_resolution_t resolution, /* Initial resolution */ + cyg_handle_t *handle, /* Returned clock handle */ + cyg_clock *clock /* put clock here */ +) +{ + CYG_ASSERT_SIZES( cyg_clock, Cyg_Clock ); + + Cyg_Clock::cyg_resolution res; + + res.dividend = resolution.dividend; + res.divisor = resolution.divisor; + + Cyg_Clock *t = new((void *)clock) Cyg_Clock ( res ); + t=t; + + CYG_CHECK_DATA_PTR( handle, "Bad handle pointer" ); + *handle = (cyg_handle_t)clock; +} + +externC void cyg_clock_delete(cyg_handle_t clock) +{ + ((Cyg_Clock *)clock)->~Cyg_Clock(); +} + +/* convert a clock handle to a counter handle so we can use the */ +/* counter API on it. */ +externC void cyg_clock_to_counter( + cyg_handle_t clock, + cyg_handle_t *counter +) +{ + CYG_CHECK_DATA_PTR( counter, "Bad counter handle pointer" ); + *counter = (cyg_handle_t)(Cyg_Counter *)clock; +} + +externC void cyg_clock_set_resolution( + cyg_handle_t clock, + cyg_resolution_t resolution /* New resolution */ +) +{ + Cyg_Clock::cyg_resolution res; + + res.dividend = resolution.dividend; + res.divisor = resolution.divisor; + + ((Cyg_Clock *)clock)->set_resolution( res ); +} + +externC cyg_resolution_t cyg_clock_get_resolution(cyg_handle_t clock) +{ + Cyg_Clock::cyg_resolution res = + ((Cyg_Clock *)clock)->get_resolution(); + + cyg_resolution_t resolution; + + resolution.dividend = res.dividend; + resolution.divisor = res.divisor; + + return resolution; +} + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK +externC cyg_handle_t cyg_real_time_clock(void) +{ + return (cyg_handle_t)Cyg_Clock::real_time_clock; +} + +externC cyg_tick_count_t cyg_current_time(void) +{ + return Cyg_Clock::real_time_clock->current_value(); +} +#endif + +externC void cyg_alarm_create( + cyg_handle_t counter, /* Attached to this counter */ + cyg_alarm_t *alarmfn, /* Call-back function */ + cyg_addrword_t data, /* Call-back data */ + cyg_handle_t *handle, /* Returned alarm object */ + cyg_alarm *alarm /* put alarm here */ +) +{ + CYG_ASSERT_SIZES( cyg_alarm, Cyg_Alarm ); + + Cyg_Alarm *t = new((void *)alarm) Cyg_Alarm ( + (Cyg_Counter *)counter, + (cyg_alarm_fn *)alarmfn, + (CYG_ADDRWORD)data + ); + t=t; + + CYG_CHECK_DATA_PTR( handle, "Bad handle pointer" ); + *handle = (cyg_handle_t)alarm; +} + +/* Disable alarm, detach from counter and invalidate handles */ +externC void cyg_alarm_delete( cyg_handle_t alarm) +{ + ((Cyg_Alarm *)alarm)->~Cyg_Alarm(); +} + +externC void cyg_alarm_initialize( + cyg_handle_t alarm, + cyg_tick_count_t trigger, /* Absolute trigger time */ + cyg_tick_count_t interval /* Relative retrigger interval */ +) +{ + ((Cyg_Alarm *)alarm)->initialize( + (cyg_tick_count)trigger, + (cyg_tick_count)interval); +} + +externC void cyg_alarm_enable( cyg_handle_t alarm ) +{ + ((Cyg_Alarm *)alarm)->enable(); +} + +externC void cyg_alarm_disable( cyg_handle_t alarm ) +{ + ((Cyg_Alarm *)alarm)->disable(); +} + +/*---------------------------------------------------------------------------*/ +/* Mail boxes */ + +externC void cyg_mbox_create( + cyg_handle_t *handle, + cyg_mbox *mbox +) +{ + CYG_ASSERT_SIZES( cyg_mbox, Cyg_Mbox ); + + Cyg_Mbox *t = new((void *)mbox) Cyg_Mbox(); + t=t; + + CYG_CHECK_DATA_PTR( handle, "Bad handle pointer" ); + *handle = (cyg_handle_t)mbox; +} + +externC void cyg_mbox_delete(cyg_handle_t mbox) +{ + ((Cyg_Mbox *)mbox)->~Cyg_Mbox(); +} + +externC void *cyg_mbox_get(cyg_handle_t mbox) +{ + return ((Cyg_Mbox *)mbox)->get(); +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +void *cyg_mbox_timed_get( + cyg_handle_t mbox, + cyg_tick_count_t abstime + ) +{ + return ((Cyg_Mbox *)mbox)->get(abstime); +} +#endif + +externC void *cyg_mbox_tryget(cyg_handle_t mbox) +{ + return ((Cyg_Mbox *)mbox)->tryget(); +} + +externC void *cyg_mbox_peek_item(cyg_handle_t mbox) +{ + return ((Cyg_Mbox *)mbox)->peek_item(); +} + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT +externC cyg_bool_t cyg_mbox_put(cyg_handle_t mbox, void *item) +{ + return ((Cyg_Mbox *)mbox)->put(item); +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +externC cyg_bool_t cyg_mbox_timed_put( + cyg_handle_t mbox, + void *item, + cyg_tick_count_t abstime + ) +{ + return ((Cyg_Mbox *)mbox)->put(item, abstime); +} +#endif +#endif + +externC cyg_bool_t cyg_mbox_tryput(cyg_handle_t mbox, void *item) +{ + return ((Cyg_Mbox *)mbox)->tryput(item); +} + +externC cyg_count32 cyg_mbox_peek(cyg_handle_t mbox) +{ + return ((Cyg_Mbox *)mbox)->peek(); +} + +externC cyg_bool_t cyg_mbox_waiting_to_get(cyg_handle_t mbox) +{ + return ((Cyg_Mbox *)mbox)->waiting_to_get(); +} + +externC cyg_bool_t cyg_mbox_waiting_to_put(cyg_handle_t mbox) +{ + return ((Cyg_Mbox *)mbox)->waiting_to_put(); +} + + +/*-----------------------------------------------------------------------*/ +/* Memory pools */ + +/* Create a variable size memory pool */ +externC void cyg_mempool_var_create( + void *base, /* base of memory to use for pool */ + cyg_int32 size, /* size of memory in bytes */ + cyg_handle_t *handle, /* returned handle of memory pool */ + cyg_mempool_var *var /* space to put pool structure in */ + ) +{ + CYG_ASSERT_SIZES( cyg_mempool_var, Cyg_Mempool_Variable ); + + Cyg_Mempool_Variable *t = new((void *)var) Cyg_Mempool_Variable ( + (cyg_uint8 *)base, + size + ); + t=t; + + CYG_CHECK_DATA_PTR( handle, "Bad handle pointer" ); + *handle = (cyg_handle_t)var; +} + +/* Delete variable size memory pool */ +externC void cyg_mempool_var_delete(cyg_handle_t varpool) +{ + ((Cyg_Mempool_Variable *)varpool)->~Cyg_Mempool_Variable(); +} + +/* Allocates a block of length size. This waits if the memory is not + currently available. */ +externC void *cyg_mempool_var_alloc(cyg_handle_t varpool, cyg_int32 size) +{ + return ((Cyg_Mempool_Variable *)varpool)->alloc(size); +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + +/* Allocates a block of length size. This waits for up to delay + ticks, if the memory is not already available. NULL is returned if + no memory is available. */ +externC void *cyg_mempool_var_timed_alloc( + cyg_handle_t varpool, + cyg_int32 size, + cyg_tick_count_t abstime) +{ + return ((Cyg_Mempool_Variable *)varpool)->alloc(size, abstime); +} + +#endif + +/* Allocates a block of length size. NULL is returned if no memory is + available. */ +externC void *cyg_mempool_var_try_alloc( + cyg_handle_t varpool, + cyg_int32 size) +{ + return ((Cyg_Mempool_Variable *)varpool)->try_alloc(size); +} + +/* Frees memory back into variable size pool. */ +externC void cyg_mempool_var_free(cyg_handle_t varpool, void *p) +{ + cyg_bool b; + b = ((Cyg_Mempool_Variable *)varpool)->free((cyg_uint8 *)p, 0); + CYG_ASSERT( b, "Bad free"); +} + + +/* Returns true if there are any threads waiting for memory in the + given memory pool. */ +externC cyg_bool_t cyg_mempool_var_waiting(cyg_handle_t varpool) +{ + return ((Cyg_Mempool_Variable *)varpool)->waiting(); +} + +/* Puts information about a variable memory pool into the structure + provided. */ +externC void cyg_mempool_var_get_info( + cyg_handle_t varpool, + cyg_mempool_info *info) +{ + Cyg_Mempool_Variable *v = (Cyg_Mempool_Variable *)varpool; + cyg_uint8 *base; + CYG_ADDRWORD maxfree; + + info->totalmem = v->get_totalmem(); + info->freemem = v->get_freemem(); + v->get_arena(base, info->size, maxfree); + info->base = (void *)base; + info->blocksize = -1; + info->maxfree = maxfree; +} + + +/* Create a fixed size memory pool */ +externC void cyg_mempool_fix_create( + void *base, // base of memory to use for pool + cyg_int32 size, // size of memory in byte + cyg_int32 blocksize, // size of allocation in bytes + cyg_handle_t *handle, // handle of memory pool + cyg_mempool_fix *fix // space to put pool structure in + ) +{ + CYG_ASSERT_SIZES( cyg_mempool_fix, Cyg_Mempool_Fixed ); + + Cyg_Mempool_Fixed *t = new((void *)fix) Cyg_Mempool_Fixed ( + (cyg_uint8 *)base, + size, + blocksize + ); + t=t; + + CYG_CHECK_DATA_PTR( handle, "Bad handle pointer" ); + *handle = (cyg_handle_t)fix; +} + +/* Delete fixed size memory pool */ +externC void cyg_mempool_fix_delete(cyg_handle_t fixpool) +{ + ((Cyg_Mempool_Fixed *)fixpool)->~Cyg_Mempool_Fixed(); +} + +/* Allocates a block. This waits if the memory is not + currently available. */ +externC void *cyg_mempool_fix_alloc(cyg_handle_t fixpool) +{ + return ((Cyg_Mempool_Fixed *)fixpool)->alloc(); +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + +/* Allocates a block. This waits for up to delay ticks, if the memory + is not already available. NULL is returned if no memory is + available. */ +externC void *cyg_mempool_fix_timed_alloc( + cyg_handle_t fixpool, + cyg_tick_count_t abstime) +{ + return ((Cyg_Mempool_Fixed *)fixpool)->alloc(abstime); +} + +#endif + +/* Allocates a block. NULL is returned if no memory is available. */ +externC void *cyg_mempool_fix_try_alloc(cyg_handle_t fixpool) +{ + return ((Cyg_Mempool_Fixed *)fixpool)->try_alloc(); +} + +/* Frees memory back into fixed size pool. */ +externC void cyg_mempool_fix_free(cyg_handle_t fixpool, void *p) +{ + cyg_bool b; + b = ((Cyg_Mempool_Fixed *)fixpool)->free((cyg_uint8 *)p); + CYG_ASSERT( b, "Bad free"); +} + +/* Returns true if there are any threads waiting for memory in the + given memory pool. */ +externC cyg_bool_t cyg_mempool_fix_waiting(cyg_handle_t fixpool) +{ + return ((Cyg_Mempool_Fixed *)fixpool)->waiting(); +} + +/* Puts information about a variable memory pool into the structure + provided. */ +externC void cyg_mempool_fix_get_info( + cyg_handle_t fixpool, + cyg_mempool_info *info) +{ + Cyg_Mempool_Fixed *f = (Cyg_Mempool_Fixed *)fixpool; + cyg_uint8 *base; + cyg_addrword_t blocksize; + + info->totalmem = f->get_totalmem(); + info->freemem = f->get_freemem(); + f->get_arena(base, info->size, blocksize); + info->base = (void *)base; + info->maxfree = info->blocksize = (cyg_int32)blocksize; +} + +/*---------------------------------------------------------------------------*/ +/* Semaphores */ + +externC void cyg_semaphore_init( + cyg_sem_t *sem, /* Semaphore to init */ + cyg_ucount32 val /* Initial semaphore value */ +) +{ + CYG_ASSERT_SIZES( cyg_sem_t, Cyg_Counting_Semaphore ); + + Cyg_Counting_Semaphore *t = new((void *)sem) Cyg_Counting_Semaphore(val); + t=t; +} + +externC void cyg_semaphore_destroy( cyg_sem_t *sem ) +{ + ((Cyg_Counting_Semaphore *)sem)->~Cyg_Counting_Semaphore(); +} + +externC void cyg_semaphore_wait( cyg_sem_t *sem ) +{ + ((Cyg_Counting_Semaphore *)sem)->wait(); +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +externC cyg_bool_t cyg_semaphore_timed_wait( + cyg_sem_t *sem, + cyg_tick_count_t abstime + ) +{ + return ((Cyg_Counting_Semaphore *)sem)->wait(abstime); +} +#endif + + +externC int cyg_semaphore_trywait( cyg_sem_t *sem ) +{ + return ((Cyg_Counting_Semaphore *)sem)->trywait(); +} + +externC void cyg_semaphore_post( cyg_sem_t *sem ) +{ + ((Cyg_Counting_Semaphore *)sem)->post(); +} + +externC void cyg_semaphore_peek( cyg_sem_t *sem, cyg_ucount32 *val ) +{ + CYG_CHECK_DATA_PTR( val, "Bad val parameter" ); + + *val = ((Cyg_Counting_Semaphore *)sem)->peek(); +} + + +/*---------------------------------------------------------------------------*/ +/* Flags */ + +void cyg_flag_init( + cyg_flag_t *flag /* Flag to init */ +) +{ + CYG_ASSERT_SIZES( cyg_flag_t, Cyg_Flag ); + CYG_ASSERT( + ( Cyg_Flag::AND == CYG_FLAG_WAITMODE_AND ) && + ( Cyg_Flag::OR == CYG_FLAG_WAITMODE_OR ) && + ( Cyg_Flag::CLR == CYG_FLAG_WAITMODE_CLR ), + "CYG_FLAG_WAITMODE_xxx definition != C++ Cyg_Flag::xxx" ); + + Cyg_Flag *t = new((void *)flag) Cyg_Flag(); + t=t; +} + +void cyg_flag_destroy( cyg_flag_t *flag ) +{ + ((Cyg_Flag *)flag)->~Cyg_Flag(); +} + +void cyg_flag_setbits( cyg_flag_t *flag, cyg_flag_value_t value) +{ + ((Cyg_Flag *)flag)->setbits( value ); +} + +void cyg_flag_maskbits( cyg_flag_t *flag, cyg_flag_value_t value) +{ + ((Cyg_Flag *)flag)->maskbits( value ); +} + +cyg_flag_value_t cyg_flag_wait( cyg_flag_t *flag, + cyg_flag_value_t pattern, + cyg_flag_mode_t mode ) +{ + if ( 0 == pattern || 0 != (mode & ~3) ) + return 0; + return ((Cyg_Flag *)flag)->wait( pattern, mode ); + +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +cyg_flag_value_t cyg_flag_timed_wait( cyg_flag_t *flag, + cyg_flag_value_t pattern, + cyg_flag_mode_t mode, + cyg_tick_count_t abstime ) +{ + if ( 0 == pattern || 0 != (mode & ~3) ) + return 0; + return ((Cyg_Flag *)flag)->wait( pattern, mode, abstime ); + +} +#endif + +cyg_flag_value_t cyg_flag_poll( cyg_flag_t *flag, + cyg_flag_value_t pattern, + cyg_flag_mode_t mode ) +{ + if ( 0 == pattern || 0 != (mode & ~3) ) + return 0; + return ((Cyg_Flag *)flag)->poll( pattern, mode ); + +} + +cyg_flag_value_t cyg_flag_peek( cyg_flag_t *flag ) +{ + return ((Cyg_Flag *)flag)->peek(); +} + +cyg_bool_t cyg_flag_waiting( cyg_flag_t *flag ) +{ + return ((Cyg_Flag *)flag)->waiting(); +} + +/*---------------------------------------------------------------------------*/ +/* Mutex */ + +externC void cyg_mutex_init( + cyg_mutex_t *mutex /* Mutex to init */ +) +{ + CYG_ASSERT_SIZES( cyg_mutex_t, Cyg_Mutex ); + + Cyg_Mutex *m = new((void *)mutex) Cyg_Mutex; + + m=m; +} + +externC void cyg_mutex_destroy( cyg_mutex_t *mutex ) +{ + // no need to do anything here +} + +externC void cyg_mutex_lock( cyg_mutex_t *mutex ) +{ + ((Cyg_Mutex *)mutex)->lock(); +} + +externC cyg_bool_t cyg_mutex_trylock( cyg_mutex_t *mutex ) +{ + return ((Cyg_Mutex *)mutex)->trylock(); +} + +externC void cyg_mutex_unlock( cyg_mutex_t *mutex ) +{ + ((Cyg_Mutex *)mutex)->unlock(); +} + +/*---------------------------------------------------------------------------*/ +/* Condition Variables */ + +externC void cyg_cond_init( + cyg_cond_t *cond, /* condition variable to init */ + cyg_mutex_t *mutex /* associated mutex */ +) +{ + CYG_ASSERT_SIZES( cyg_cond_t, Cyg_Condition_Variable ); + + Cyg_Condition_Variable *t = new((void *)cond) Cyg_Condition_Variable( + *(Cyg_Mutex *)mutex); + t=t; +} + +externC void cyg_cond_destroy( cyg_cond_t *cond ) +{ + ((Cyg_Counting_Semaphore *)cond)->~Cyg_Counting_Semaphore(); +} + +externC void cyg_cond_wait( cyg_cond_t *cond ) +{ + ((Cyg_Condition_Variable *)cond)->wait(); +} + +externC void cyg_cond_signal( cyg_cond_t *cond ) +{ + ((Cyg_Condition_Variable *)cond)->signal(); +} + +externC void cyg_cond_broadcast( cyg_cond_t *cond ) +{ + ((Cyg_Condition_Variable *)cond)->broadcast(); +} + +#ifdef CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT +externC cyg_bool_t cyg_cond_timed_wait( + cyg_cond_t *cond, + cyg_tick_count_t abstime + ) +{ + return ((Cyg_Condition_Variable *)cond)->wait(abstime); +} + +#endif + +// ------------------------------------------------------------------------- +// Check structure sizes. +// This class and constructor get run automatically in debug versions +// of the kernel and check that the structures configured in the C +// code are the same size as the C++ classes they should match. + +#ifdef CYGPKG_INFRA_DEBUG + +class Cyg_Check_Structure_Sizes +{ + int dummy; +public: + Cyg_Check_Structure_Sizes( int x ); + +}; + +#define CYG_CHECK_SIZES(cstruct, cxxstruct) \ +if( sizeof(cstruct) != sizeof(cxxstruct) ) \ +{ \ + char *fmt = "Size of C struct " #cstruct \ + " != size of C++ struct " #cxxstruct ; \ + CYG_TRACE2(1, fmt, sizeof(cstruct) , sizeof(cxxstruct) ); \ + fail = true; \ + fmt = fmt; \ +} + +Cyg_Check_Structure_Sizes::Cyg_Check_Structure_Sizes(int x) +{ + cyg_bool fail = false; + + dummy = x+1; + + CYG_CHECK_SIZES( cyg_thread, Cyg_Thread ); + CYG_CHECK_SIZES( cyg_interrupt, Cyg_Interrupt ); + CYG_CHECK_SIZES( cyg_counter, Cyg_Counter ); + CYG_CHECK_SIZES( cyg_clock, Cyg_Clock ); + CYG_CHECK_SIZES( cyg_alarm, Cyg_Alarm ); + CYG_CHECK_SIZES( cyg_mbox, Cyg_Mbox ); + CYG_CHECK_SIZES( cyg_mempool_var, Cyg_Mempool_Variable ); + CYG_CHECK_SIZES( cyg_mempool_fix, Cyg_Mempool_Fixed ); + CYG_CHECK_SIZES( cyg_sem_t, Cyg_Counting_Semaphore ); + CYG_CHECK_SIZES( cyg_flag_t, Cyg_Flag ); + CYG_CHECK_SIZES( cyg_mutex_t, Cyg_Mutex ); + CYG_CHECK_SIZES( cyg_cond_t, Cyg_Condition_Variable ); + + CYG_ASSERT( !fail, "Size checks failed"); +} + +Cyg_Check_Structure_Sizes check_structure_sizes(1); + +#endif + + +// ------------------------------------------------------------------------- + +#endif +// EOF common/kapi.cxx diff --git a/packages/kernel/current/src/common/thread.cxx b/packages/kernel/current/src/common/thread.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/common/thread.cxx @@ -0,0 +1,1234 @@ +//========================================================================== +// +// common/thread.cxx +// +// Thread class implementations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-15 +// Purpose: Thread class implementation +// Description: This file contains the definitions of the thread class +// member functions that are common to all thread implementations. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include // kernel configuration file + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // our header + +#include // Interrupt support + +#include // thread inlines +#include // scheduler inlines +#include // clock inlines + +// ========================================================================= +// Cyg_HardwareThread members + +// ------------------------------------------------------------------------- +// Thread entry point. +// This is inserted as the PC value in all initial thread contexts. +// It does some housekeeping and then calls the real entry point. + +void +Cyg_HardwareThread::thread_entry( Cyg_Thread *thread ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Scheduler::scheduler.need_reschedule = false; // finished rescheduling + Cyg_Scheduler::scheduler.current_thread = thread; // restore current thread pointer + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + // Reset the timeslice counter so that this thread gets a full + // quantum. + Cyg_Scheduler::reset_timeslice_count(); +#endif + + // Zero the lock + Cyg_Scheduler::sched_lock = 0; + + // Call entry point in a loop. + + for(;;) + { + thread->entry_point(thread->entry_data); + thread->exit(); + } +} + +// ========================================================================= +// Cyg_Thread members + +// ------------------------------------------------------------------------- +// Statics and thread list functions + +#ifdef CYGVAR_KERNEL_THREADS_LIST + +// List of all extant threads +Cyg_Thread *Cyg_Thread::thread_list = 0; + +inline void +Cyg_Thread::add_to_list( void ) +{ + // Add thread to housekeeping list + Cyg_Scheduler::lock(); + + if( thread_list == 0 ) + list_next = this; + else { + Cyg_Thread *prev = thread_list; + do { + if ( this == prev ) + break; // found it already! + prev = prev->list_next; + } while ( prev != thread_list ); + if ( this != prev ) { + // insert it in the list: + list_next = thread_list->list_next; + thread_list->list_next = this; + } + } + thread_list = this; + + Cyg_Scheduler::unlock(); +} + +inline void +Cyg_Thread::remove_from_list( void ) +{ + // remove thread from housekeeping list + Cyg_Scheduler::lock(); + + Cyg_Thread *prev = thread_list; + + do { + if( prev->list_next == this ) { + prev->list_next = list_next; + if( thread_list == this ) + thread_list = list_next; + break; + } + prev = prev->list_next; + } while ( prev != thread_list ); + + Cyg_Scheduler::unlock(); +} + +#endif + +static cyg_uint16 next_unique_id = 1; + +// ------------------------------------------------------------------------- +// Magic new operator to allow the thread constructor to be +// recalled. + +inline void * +operator new(size_t size, Cyg_Thread *ptr) +{ return (void *)ptr; }; + +// Constructor +// This constructor is deprecated and should be replaced with the new +// one below. Until that happens, any changes must be made to both +// constructors. + +Cyg_Thread::Cyg_Thread( + cyg_thread_entry *entry, // entry point function + CYG_ADDRWORD entry_data, // entry data + cyg_ucount32 stack_size, // stack size, 0 = use default + CYG_ADDRESS stack_base // stack base, NULL = allocate +) +: Cyg_HardwareThread(entry, entry_data, stack_size, stack_base), + Cyg_SchedThread(this, CYG_SCHED_DEFAULT_INFO) +#ifdef CYGFUN_KERNEL_THREADS_TIMER + ,timer(this) +#endif +{ + CYG_REPORT_FUNCTION(); + + // Start the thread in suspended state. + state = SUSPENDED; + suspend_count = 1; + + // Initialize sleep_reason which is used by kill, release + sleep_reason = NONE; + wake_reason = NONE; + + // Assign a 16 bit id to the thread. + unique_id = next_unique_id++; + +#ifdef CYGVAR_KERNEL_THREADS_DATA + // Zero all per-thread data entries. + for( int i = 0; i < CYGNUM_KERNEL_THREADS_DATA_MAX; i++ ) + thread_data[i] = 0; +#endif +#ifdef CYGVAR_KERNEL_THREADS_NAME + name = 0; +#endif +#ifdef CYGVAR_KERNEL_THREADS_LIST + // Add thread to housekeeping list + add_to_list(); +#endif + + Cyg_Scheduler::scheduler.register_thread(this); + + init_context(this); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Constructor +// This is an alternative constructor that will become the default +// eventually. + +Cyg_Thread::Cyg_Thread( + CYG_ADDRWORD sched_info, // Scheduling parameter(s) + cyg_thread_entry *entry, // entry point function + CYG_ADDRWORD entry_data, // entry data + char *name_arg, // thread name cookie + CYG_ADDRESS stack_base, // stack base, NULL = allocate + cyg_ucount32 stack_size // stack size, 0 = use default + ) +: Cyg_HardwareThread(entry, entry_data, stack_size, stack_base), + Cyg_SchedThread(this, sched_info) +#ifdef CYGFUN_KERNEL_THREADS_TIMER + ,timer(this) +#endif +{ + CYG_REPORT_FUNCTION(); + + // Start the thread in suspended state. + state = SUSPENDED; + suspend_count = 1; + + // Initialize sleep_reason which is used by kill, release + sleep_reason = NONE; + wake_reason = NONE; + + // Assign a 16 bit id to the thread. + unique_id = next_unique_id++; + +#ifdef CYGVAR_KERNEL_THREADS_DATA + // Zero all per-thread data entries. + for( int i = 0; i < CYGNUM_KERNEL_THREADS_DATA_MAX; i++ ) + thread_data[i] = 0; +#endif +#ifdef CYGVAR_KERNEL_THREADS_NAME + name = name_arg; +#endif +#ifdef CYGVAR_KERNEL_THREADS_LIST + // Add thread to housekeeping list + add_to_list(); +#endif + + Cyg_Scheduler::scheduler.register_thread(this); + + init_context(this); + + CYG_REPORT_RETURN(); +} + + +// ------------------------------------------------------------------------- +// Re-initialize this thread. +// We do this by re-invoking the constructor with the original +// arguments, which are still available in the object. + +void +Cyg_Thread::reinitialize() +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad thread"); + CYG_ASSERT( this != Cyg_Scheduler::get_current_thread(), + "Attempt to reinitialize current thread"); + CYG_ASSERT( get_current_queue() == NULL , "Thread is still on a queue"); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + // Clear the timeout. It is irrelevant whether there was + // actually a timeout pending. + timer.disable(); +#endif + + // Ensure the scheduler has let go of us. + Cyg_Scheduler::scheduler.deregister_thread(this); + + cyg_priority pri = get_priority(); +#ifdef CYGVAR_KERNEL_THREADS_NAME + char * name_arg = name; +#else + char * name_arg = NULL; +#endif + + new(this) Cyg_Thread( pri, + entry_point, entry_data, + name_arg, + stack_base, stack_size ); + // the constructor re-registers the thread with the scheduler. + + CYG_ASSERTCLASS( this, "Thread corrupted by reinitialize"); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Destructor. + +Cyg_Thread::~Cyg_Thread() +{ + CYG_REPORT_FUNCTION(); + + Cyg_Scheduler::scheduler.deregister_thread(this); + +#ifdef CYGVAR_KERNEL_THREADS_LIST + // Remove thread from housekeeping list. + remove_from_list(); +#endif + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Thread consistency checker. + +#ifdef CYGDBG_USE_ASSERTS + +bool +Cyg_Thread::check_this( cyg_assert_class_zeal zeal) +{ +// CYG_REPORT_FUNCTION(); + + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + + switch( zeal ) + { + case cyg_system_test: + case cyg_extreme: + case cyg_thorough: + if( (state & SUSPENDED) && (suspend_count == 0) ) return false; + case cyg_quick: + case cyg_trivial: + case cyg_none: + default: + break; + }; + + return true; +} + +#endif + +// ------------------------------------------------------------------------- +// Put the thread to sleep. +// This can only be called by the current thread on itself, hence +// it is a static function. + +void +Cyg_Thread::sleep() +{ + CYG_REPORT_FUNCTION(); + + Cyg_Thread *current = Cyg_Scheduler::get_current_thread(); + + CYG_ASSERTCLASS( current, "Bad current thread" ); + + CYG_INSTRUMENT_THREAD(SLEEP,current,0); + + // Prevent preemption + Cyg_Scheduler::lock(); + + // If running, remove from run qs + if ( current->state == RUNNING ) + Cyg_Scheduler::scheduler.rem_thread(current); + + // Set the state + current->state |= SLEEPING; + + // Unlock the scheduler and switch threads + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Awaken the thread from sleep. + +void +Cyg_Thread::wake() +{ + CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_THREAD(WAKE,this,Cyg_Scheduler::current_thread); + + // Prevent preemption + Cyg_Scheduler::lock(); + + if( 0 != (state & SLEEPSET) ) + { + // Set the state + state &= ~SLEEPSET; + + // remove from any queue we were on + remove(); + + // If the thread is now runnable, return it to run queue + if( state == RUNNING ) + Cyg_Scheduler::scheduler.add_thread(this); + + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Put the thread to sleep, with wakeup count. +// This can only be called by the current thread on itself, hence +// it is a static function. + +void +Cyg_Thread::counted_sleep() +{ + CYG_REPORT_FUNCTION(); + + Cyg_Thread *current = Cyg_Scheduler::get_current_thread(); + + CYG_ASSERTCLASS( current, "Bad current thread" ); + + CYG_INSTRUMENT_THREAD(SLEEP,current,0); + + // Prevent preemption + Cyg_Scheduler::lock(); + + if ( 0 == current->wakeup_count ) { + set_sleep_reason( Cyg_Thread::WAIT ); + current->sleep(); // prepare to sleep + current->state |= COUNTSLEEP; // Set the state + } + else + // there is a queued wakeup, do not sleep + current->wakeup_count--; + + // Unlock the scheduler and switch threads + Cyg_Scheduler::unlock(); + + // and deal with anything we must do when we return + switch( current->wake_reason ) { + case DESTRUCT: + case EXIT: + current->exit(); + break; + + default: + break; + } + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Put the thread to sleep for a delay, with wakeup count. +// This can only be called by the current thread on itself, hence +// it is a static function. + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +void +Cyg_Thread::counted_sleep( cyg_tick_count delay ) +{ + CYG_REPORT_FUNCTION(); + + Cyg_Thread *current = Cyg_Scheduler::get_current_thread(); + + CYG_ASSERTCLASS( current, "Bad current thread" ); + + CYG_INSTRUMENT_THREAD(SLEEP,current,0); + + // Prevent preemption + Cyg_Scheduler::lock(); + + if ( 0 == current->wakeup_count ) { + + // Set the timer (once outside any waiting loop.) + set_timer( Cyg_Clock::real_time_clock->current_value()+delay, + Cyg_Thread::TIMEOUT ); + + // If the timeout is in the past, the wake reason will have been + // set to something other than NONE already. + + if( current->get_wake_reason() == Cyg_Thread::NONE ) + { + set_sleep_reason( Cyg_Thread::TIMEOUT ); + current->sleep(); // prepare to sleep + current->state |= COUNTSLEEP; // Set the state + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, + "Called with non-zero scheduler lock"); + + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + // clear the timer; if it actually fired, no worries. + clear_timer(); + } + } + else + // there is a queued wakeup, do not sleep + current->wakeup_count--; + + // Unlock the scheduler and switch threads + Cyg_Scheduler::unlock(); + + // and deal with anything we must do when we return + switch( current->wake_reason ) { + case DESTRUCT: + case EXIT: + current->exit(); + break; + + default: + break; + } + + CYG_REPORT_RETURN(); +} +#endif + +// ------------------------------------------------------------------------- +// Awaken the thread from sleep. + +void +Cyg_Thread::counted_wake() +{ + CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_THREAD(WAKE,this,Cyg_Scheduler::current_thread); + + // Prevent preemption + Cyg_Scheduler::lock(); + + if ( 0 == (state & COUNTSLEEP) ) // already awake, or waiting: + wakeup_count++; // not in a counted sleep anyway. + else { + sleep_reason = NONE; + wake_reason = DONE; + wake(); // and awaken the thread + } + +#ifdef CYGNUM_KERNEL_MAX_COUNTED_WAKE_COUNT_ASSERT + CYG_ASSERT( CYGNUM_KERNEL_MAX_COUNTED_WAKE_COUNT_ASSERT > wakeup_count, + "wakeup_count overflow" ); +#endif + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Cancel wakeups for this thread and return how many were pending +cyg_uint32 +Cyg_Thread::cancel_counted_wake() +{ + CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_THREAD(WAKE,this,Cyg_Scheduler::current_thread); + + // Prevent preemption + Cyg_Scheduler::lock(); + + cyg_uint32 result = wakeup_count; + wakeup_count = 0; + + // Unlock the scheduler + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETVAL( result ); + return result; +} + +// ------------------------------------------------------------------------- +// Suspend thread. Increment suspend count and deschedule thread +// if still running. + +void +Cyg_Thread::suspend() +{ + CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_THREAD(SUSPEND,this,Cyg_Scheduler::current_thread); + + // Prevent preemption + Cyg_Scheduler::lock(); + + suspend_count++; + +#ifdef CYGNUM_KERNEL_MAX_SUSPEND_COUNT_ASSERT + CYG_ASSERT( CYGNUM_KERNEL_MAX_SUSPEND_COUNT_ASSERT > suspend_count, + "suspend_count overflow" ); +#endif + + // If running, remove from run qs + if( state == RUNNING ) + Cyg_Scheduler::scheduler.rem_thread(this); + + // Set the state + state |= SUSPENDED; + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Resume thread. Decrement suspend count and reschedule if it +// is zero. + +void +Cyg_Thread::resume() +{ + CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_THREAD(RESUME,this,Cyg_Scheduler::current_thread); + + // Prevent preemption + Cyg_Scheduler::lock(); + + // If we are about to zero the count, clear the state bit and + // reschedule the thread if possible. + + if( suspend_count == 1 ) + { + suspend_count = 0; + + CYG_ASSERT( (state & SUSPENDED) != 0, "SUSPENDED bit not set" ); + + // Set the state + state &= ~SUSPENDED; + + // Return thread to scheduler if runnable + if( state == RUNNING ) + Cyg_Scheduler::scheduler.add_thread(this); + } + else + if( suspend_count > 0 ) + suspend_count--; + // else ignore attempt to resume + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Forced Resume thread. Zero suspend count and reschedule... + +void +Cyg_Thread::force_resume() +{ + CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_THREAD(RESUME,this,Cyg_Scheduler::current_thread); + + // Prevent preemption + Cyg_Scheduler::lock(); + + // If we are about to zero the count, clear the state bit and + // reschedule the thread if possible. + + if ( 0 < suspend_count ) { + suspend_count = 0; + + CYG_ASSERT( (state & SUSPENDED) != 0, "SUSPENDED bit not set" ); + + // Set the state + state &= ~SUSPENDED; + + // Return thread to scheduler if runnable + if( state == RUNNING ) + Cyg_Scheduler::scheduler.add_thread(this); + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Force thread to wake up from a sleep with a wake_reason of +// BREAK. It is the responsibility of the woken thread to detect +// the release() and do the right thing. + +void +Cyg_Thread::release() +{ + CYG_REPORT_FUNCTION(); + // Prevent preemption + Cyg_Scheduler::lock(); + + // If the thread is in any of the sleep states, set the + // wake reason and wake it up. + + switch( sleep_reason ) + { + + case NONE: + // The thread is not sleeping for any reason, do nothing. + // drop through... + + case DESTRUCT: + case BREAK: + case EXIT: + case DONE: + // Do nothing in any of these cases. They are here to + // keep the compiler happy. + + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); + return; + + case WAIT: + // The thread was waiting for some sync object to do + // something. + // drop through... + + case TIMEOUT: + // The thread was waiting on a sync object with a timeout. + // drop through... + + case DELAY: + // The thread was simply delaying, unless it has been + // woken up for some other reason, wake it now. + sleep_reason = NONE; + wake_reason = BREAK; + break; + } + + wake(); + + // Allow preemption + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Exit thread. This puts the thread into EXITED state. + +void +Cyg_Thread::exit() +{ + // The thread should never return from this function. + + Cyg_Thread *self = Cyg_Thread::self(); + + Cyg_Scheduler::lock(); + + // clear the timer; if there was none, no worries. + clear_timer(); + + self->state = EXITED; + + Cyg_Scheduler::scheduler.rem_thread(self); + + // Un-nest any scheduler locks we have until we + // suspend. + for( ;; ) Cyg_Scheduler::unlock(); +} + +// ------------------------------------------------------------------------- +// Kill thread. Force the thread into EXITED state externally, or +// make it wake up and call exit(). + +void +Cyg_Thread::kill() +{ + CYG_REPORT_FUNCTION(); + // If this is called by the current thread on itself, + // just call exit(), which is what he should have done + // in the first place. + if( this == Cyg_Scheduler::get_current_thread() ) + exit(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + // We are killing someone else. Find out what state he is + // in and force him to wakeup and call exit(). + + force_resume(); // this is necessary for when + // he is asleep AND suspended. +#ifdef CYGFUN_KERNEL_THREADS_TIMER + timer.disable(); // and make sure the timer + // does not persist. +#endif + + switch( sleep_reason ) + { + + case NONE: + // The thread is not sleeping for any reason, it must be + // on a run queue. + // We can safely deschedule and set its state. + if( state == RUNNING ) Cyg_Scheduler::scheduler.rem_thread(this); + state = EXITED; + break; + + case DESTRUCT: + case BREAK: + case EXIT: + case DONE: + // Do nothing in any of these cases. They are here to + // keep the compiler happy. + + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); + return; + + case WAIT: + // The thread was waiting for some sync object to do + // something. + // drop through... + + case TIMEOUT: + // The thread was waiting on a sync object with a timeout. + // drop through... + + case DELAY: + // The thread was simply delaying, unless it has been + // woken up for some other reason, wake it now. + sleep_reason = NONE; + wake_reason = EXIT; + break; + } + + wake(); + + // Allow preemption + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Set thread priority + +#ifdef CYGIMP_THREAD_PRIORITY + +void +Cyg_Thread::set_priority( cyg_priority new_priority ) +{ + CYG_REPORT_FUNCTION(); + +// CYG_ASSERT( new_priority >= CYG_THREAD_MAX_PRIORITY, "Priority out of range"); +// CYG_ASSERT( new_priority <= CYG_THREAD_MIN_PRIORITY, "Priority out of range"); + + CYG_INSTRUMENT_THREAD(PRIORITY,this,priority); + + // Prevent preemption + Cyg_Scheduler::lock(); + + Cyg_ThreadQueue *queue = NULL; + + // If running, remove from run qs + if( state == RUNNING ) + Cyg_Scheduler::scheduler.rem_thread(this); + else if( state & SLEEPING ) + { + // Remove thread from current queue. + queue = get_current_queue(); + // if indeed we are on a queue + if ( NULL != queue ) { + CYG_CHECK_DATA_PTR(queue, "Bad queue pointer"); + remove(); + } + } + + Cyg_Scheduler::scheduler.deregister_thread(this); + +#if CYG_SCHED_UNIQUE_PRIORITIES + + // Check that there are no other threads at this priority. + // If so, leave is as it is. + + CYG_ASSERT( Cyg_Scheduler::scheduler.unique(new_priority), "Priority not unique"); + + if( Cyg_Scheduler::scheduler.unique(new_priority) ) + priority = new_priority; + +#else // !CYG_SCHED_UNIQUE_PRIORITIES + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE + + // When we have priority inheritance, we must update the original + // priority and not the inherited one. If the new priority is + // better than the current inherited one, then use that + // immediately. We remain in inherited state to avoid problems + // with multiple mutex inheritances. + + if( priority_inherited ) + { + original_priority = new_priority; + if( priority > new_priority ) priority = new_priority; + } + else priority = new_priority; + +#else + + priority = new_priority; + +#endif + +#endif // CYG_SCHED_UNIQUE_PRIORITIES + + Cyg_Scheduler::scheduler.register_thread(this); + + // Return thread to scheduler if runnable + if( state == RUNNING ) + Cyg_Scheduler::scheduler.add_thread(this); + else if ( state & SLEEPING ) + { + // return to current queue + // if indeed we are on a queue + if ( NULL != queue ) { + CYG_CHECK_DATA_PTR(queue, "Bad queue pointer"); + queue->enqueue(this); + } + } + + // If the current thread is being reprioritized, set the + // reschedule flag to ensure that it gets rescheduled if + // necessary. (Strictly we only need to do this if the new + // priority is less than that of some other runnable thread, in + // practice checking that is as expensive as what the scheduler + // will do anyway). + + if( this == Cyg_Scheduler::get_current_thread() ) + Cyg_Scheduler::need_reschedule = true; + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +#endif + + +// ------------------------------------------------------------------------- +// Thread delay function + +void +Cyg_Thread::delay( cyg_tick_count delay) +{ + CYG_REPORT_FUNCTION(); + +#if defined(CYGFUN_KERNEL_THREADS_TIMER) && defined(CYGVAR_KERNEL_COUNTERS_CLOCK) + + CYG_INSTRUMENT_THREAD(DELAY,this,delay); + + // Prevent preemption + Cyg_Scheduler::lock(); + + sleep(); + + set_timer( Cyg_Clock::real_time_clock->current_value()+delay, DELAY ); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + // Clear the timeout. It is irrelevant whether the alarm has + // actually gone off or not. + clear_timer(); + + // and deal with anything else we must do when we return + switch( wake_reason ) { + case DESTRUCT: + case EXIT: + exit(); + break; + + default: + break; + } +#endif + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// + +#ifdef CYGPKG_KERNEL_EXCEPTIONS + +void +Cyg_Thread::deliver_exception( + cyg_code exception_number, // exception being raised + CYG_ADDRWORD exception_info // exception specific info + ) +{ + if( this == Cyg_Scheduler::get_current_thread() ) + { + // Delivering to current thread, probably as a result + // of a real hardware exception. Simply invoke the appropriate + // handler. + + exception_control.deliver_exception( exception_number, exception_info ); + } +#ifdef CYGIMP_EXCEPTION_ASYNC + else + { + // Delivering to another thread, probably as a result of one thread + // invoking this function on another thread. Adjust the other thread's + // state to make it execute the exception routine when it next runs. + + // At present there is an unresolved problem here. We do not know what + // state the destination thread is in. It may not be a suitable point at + // which to invoke an exception routine. In most cases the exception + // routine will be run in the scheduler thread switch code, where the world is + // in an inconsistent state. We really need to run the routine at the + // end of unlock_inner(). However this would add extra code to the scheduler, + // and require a way of storing pending exceptions. So for now this option is + // disabled and not yet implemented, it may never be. + + } +#endif +} + +#endif + +// ------------------------------------------------------------------------- +// Per-thread data support + +#ifdef CYGVAR_KERNEL_THREADS_DATA + +// Set the data map bits for each free slot in the data array. +cyg_ucount32 Cyg_Thread::thread_data_map = (~CYGNUM_KERNEL_THREADS_DATA_ALL) & + ((1<thread; + + CYG_INSTRUMENT_THREAD(ALARM, 0, 0); + + Cyg_Scheduler::lock(); + + Cyg_Thread::cyg_reason sleep_reason = thread->get_sleep_reason(); + + switch( sleep_reason ) { + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + case Cyg_Thread::EXIT: + case Cyg_Thread::NONE: + case Cyg_Thread::WAIT: + case Cyg_Thread::DONE: + // Do nothing in any of these cases. Most are here to + // keep the compiler happy. + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); + return; + + case Cyg_Thread::DELAY: + // The thread was simply delaying, unless it has been + // woken up for some other reason, wake it now. + thread->set_wake_reason(Cyg_Thread::DONE); + break; + + case Cyg_Thread::TIMEOUT: + // The thread has timed out, set the wake reason to + // TIMEOUT and restart. + thread->set_wake_reason(Cyg_Thread::TIMEOUT); + break; + } + + thread->wake(); + + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +#endif + +// ========================================================================= +// The Idle thread +// The idle thread is implemented as a single instance of the +// Cyg_IdleThread class. This is so that it can be initialized before +// main in a static constructor. + +// ------------------------------------------------------------------------- +// Data definitions + +// stack + +#ifdef CYG_HAL_MIPS +extern char idle_thread_stack[CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE]; +#else +char idle_thread_stack[CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE]; +#endif + +// Loop counter for debugging/housekeeping +cyg_uint32 idle_thread_loops = 1; + +// ------------------------------------------------------------------------- +// Idle thread code. + +void +idle_thread_main( CYG_ADDRESS data ) +{ + CYG_REPORT_FUNCTION(); + + for(;;) + { + idle_thread_loops++; + + HAL_IDLE_THREAD_ACTION(idle_thread_loops); + +#if 0 + // For testing, it is useful to be able to fake + // clock interrupts in the idle thread. + + Cyg_Clock::real_time_clock->tick(); +#endif +#ifdef CYGIMP_IDLE_THREAD_YIELD + // In single priority and non-preemptive systems, + // the idle thread should yield repeatedly to + // other threads. + Cyg_Thread::yield(); +#endif + } +} + +// ------------------------------------------------------------------------- +// Idle thread class + +class Cyg_IdleThread : public Cyg_Thread +{ +public: + Cyg_IdleThread( + cyg_thread_entry *entry, // entry point function + CYG_ADDRWORD entry_data, // entry data + cyg_ucount32 stack_size = 0, // stack size, 0 = use default + CYG_ADDRESS stack_base = 0 // stack base, NULL = allocate + ); + +}; + +// ------------------------------------------------------------------------- +// Idle threads constructor + +Cyg_IdleThread::Cyg_IdleThread( + cyg_thread_entry *entry, // entry point function + CYG_ADDRWORD entry_data, // entry data + cyg_ucount32 stack_size, // stack size, 0 = use default + CYG_ADDRESS stack_base // stack base, NULL = allocate + ) + : Cyg_Thread( CYG_THREAD_MIN_PRIORITY, + entry, + entry_data, + "Idle Thread", + stack_base, + stack_size) +{ + CYG_REPORT_FUNCTION(); + + resume(); + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Instantiate the idle thread + +Cyg_IdleThread idle_thread CYG_INIT_PRIORITY( IDLE_THREAD ) = +Cyg_IdleThread( idle_thread_main, + 0, + CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE, + CYG_ADDRESS(idle_thread_stack) + ); + + +// ------------------------------------------------------------------------- +// EOF common/thread.cxx diff --git a/packages/kernel/current/src/common/timer.cxx b/packages/kernel/current/src/common/timer.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/common/timer.cxx @@ -0,0 +1,114 @@ +//========================================================================== +// +// common/timer.cxx +// +// Timer class implementations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-11 +// Purpose: Clock class implementation +// Description: This file implements the Timer class which is derived from +// the Alarm class to support uITRON type functionality +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros + +#include +#include + +#include // Clock inlines + +// ------------------------------------------------------------------------- + +Cyg_Timer::Cyg_Timer() +{ +} + +Cyg_Timer::~Cyg_Timer() +{ + CYG_REPORT_FUNCTION(); + + disable(); + counter = NULL; +} + +// ------------------------------------------------------------------------- + +void +Cyg_Timer::initialize( + Cyg_Counter *c, + cyg_alarm_fn a, + CYG_ADDRWORD d, + cyg_tick_count t, // absolute time + cyg_tick_count i, // 0 => one shot, else repeating + cyg_uint32 action // (DISABLE | ENABLE) + ) +{ + CYG_REPORT_FUNCTION(); + + counter = c; + alarm = a; + data = d; + trigger = t; + interval = i; + enabled = false; + + CYG_ASSERT(0 == (action & ~ENABLE), "unknown action"); + + if(action & ENABLE) + enable(); +} + +void +Cyg_Timer::activate(cyg_uint32 action) // (DISABLE | ENABLE) [|RESET] +{ + if(!(action & ENABLE)) + disable(); + + if((action & RESET)) + { + cyg_tick_count t; + t = counter->current_value(); + trigger = t + interval; + } + + if((action & ENABLE)) { + enable(); + } +} + +// ------------------------------------------------------------------------- +// EOF common/timer.cxx diff --git a/packages/kernel/current/src/debug/dbg-thread-demux.c b/packages/kernel/current/src/debug/dbg-thread-demux.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/debug/dbg-thread-demux.c @@ -0,0 +1,160 @@ +/*========================================================================== +// +// dbg-thread-demux.c +// +// GDB Stub ROM system calls +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: +// Date: 1998-09-03 +// Purpose: GDB Stub ROM system calls +// Description: +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + + +/* This file implements system calls out from the ROM debug stub into + the operating environment. + We assume they exist in the same address space. + This file should be linked into your operating environment, your O.S. + or whatever is managing multiple saved process contexts. + Your O.S. needs to implement and provide + dbg_thread_capabilities + dbg_currthread + dbg_threadlist + dbg_threadinfo + dbg_getthreadreg + dbg_setthreadreg + + The debug stub will call this function by calling it indirectly + vis a pre-assigned location possably somthing like a virtual vector table. + Where this is exactly is platform specific. + + The O.S. should call patch_dbg_syscalls() and pass the address of the + location to be patched with the dbg_thread_syscall_rmt function. + Nothing really calls this by name. + + This scheme would also work if we wanted to use a real trapped system call. + */ + +// ------------------------------------------------------------------------- + +#include + +#include "cyg/hal/dbg-threads-api.h" +#include "dbg-thread-syscall.h" + +// ------------------------------------------------------------------------- + +static int dbg_thread_syscall_rmt( + enum dbg_syscall_ids id, + union dbg_thread_syscall_parms * p + ) +{ + switch (id) + { + case dbg_null_func : return 1 ; /* test the syscall apparatus */ + +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + case dbg_capabilities_func : + return dbg_thread_capabilities(p->cap_parms.abilities) ; + break ; + case dbg_currthread_func : + return dbg_currthread(p->currthread_parms.ref) ; + break ; + case dbg_threadlist_func : + return dbg_threadlist(p->threadlist_parms.startflag, + p->threadlist_parms.lastid, + p->threadlist_parms.nextthreadid) ; + break ; + case dbg_threadinfo_func : + return dbg_threadinfo(p->info_parms.ref, + p->info_parms.info + ) ; + break ; + case dbg_getthreadreg_func : + return dbg_getthreadreg(p->reg_parms.thread, + p->reg_parms.regcount, + p->reg_parms.registers) ; + break ; + case dbg_setthreadreg_func : + return dbg_setthreadreg(p->reg_parms.thread, + p->reg_parms.regcount, + p->reg_parms.registers) ; + break ; +#endif /* CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT */ + default : + return 0 ; /* failure tue to non-implementation */ + } +} + +// ------------------------------------------------------------------------- +// When Cygmon calls us on the TX39 It has its own value in GP. We need to +// save that and set our own before proceeding. + +#ifdef CYG_HAL_TX39 +static int dbg_thread_syscall_rmt_1( + enum dbg_syscall_ids id, + union dbg_thread_syscall_parms * p + ) +{ + + register long gp_save; + int r; + asm ( "move %0,$28;" + ".extern _gp;" + "la $gp,_gp;" + : "=r"(gp_save) + ); + + r = dbg_thread_syscall_rmt( id, p ); + + asm ( "move $gp,%0;" :: "r"(gp_save) ); + + return r; + +} +#endif + +// ------------------------------------------------------------------------- + +void patch_dbg_syscalls(void * vector) +{ + dbg_syscall_func * f ; + f = vector ; +#ifdef CYG_HAL_TX39 + *f = dbg_thread_syscall_rmt_1 ; +#else + *f = dbg_thread_syscall_rmt ; +#endif +} + +// ------------------------------------------------------------------------- +// End of dbg-thread-demux.c diff --git a/packages/kernel/current/src/debug/dbg-thread-syscall.h b/packages/kernel/current/src/debug/dbg-thread-syscall.h new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/debug/dbg-thread-syscall.h @@ -0,0 +1,70 @@ + +/* + * Copyright (c) 1998 Cygnus Support + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +/* This file should be included only by + thread-syscall-relay.c and + dbg-thread-demux.c + */ + + + +enum dbg_syscall_ids + { + dbg_null_func , + dbg_capabilities_func, + dbg_currthread_func, + dbg_threadlist_func, + dbg_threadinfo_func, + dbg_getthreadreg_func, + dbg_setthreadreg_func + } ; + + +union dbg_thread_syscall_parms +{ + struct + { + struct dbg_capabilities * abilities ; + } cap_parms ; + + struct + { + threadref * ref ; + } currthread_parms ; + + struct + { + int startflag ; + threadref * lastid ; + threadref * nextthreadid ; + } threadlist_parms ; + + struct + { + threadref * ref ; + struct cygmon_thread_debug_info * info ; + } info_parms ; + + struct + { + threadref * thread ; + int regcount ; + void * registers ; + } reg_parms ; +} ; + + +typedef int (*dbg_syscall_func) (enum dbg_syscall_ids id, + union dbg_thread_syscall_parms * p ) ; diff --git a/packages/kernel/current/src/debug/dbg_gdb.cxx b/packages/kernel/current/src/debug/dbg_gdb.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/debug/dbg_gdb.cxx @@ -0,0 +1,388 @@ +/*========================================================================== +// +// dbg_gdb.c +// +// GDB Debugging Interface +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-08-22 +// Purpose: GDB Debugging Interface +// Description: Interface for calls from GDB stubs into the OS. These +// currently mostly support thread awareness. +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + +#include +#include // CYG_HAL_USE_ROM_MONITOR_CYGMON + +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + +#include + +#include +#include + +#include +#include + +#include + +#if !defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) \ + && defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) +// FIXME: This really needs to be handled in some other way. +#include +externC void __stub_copy_registers(target_register_t * dest, + target_register_t *src); +#endif + +extern "C" +{ +#include +}; + +#define USE_ID 1 + +#if (CYG_BYTEORDER == CYG_LSBFIRST) + +unsigned long swap32(unsigned long x) +{ + unsigned long r = 0; + + r |= (x>>24)&0xFF; + r |= ((x>>16)&0xFF)<<8; + r |= ((x>>8)&0xFF)<<16; + r |= ((x)&0xFF)<<24; + + return r; +} + +#else + +#define swap32(x) ((unsigned long)(x)) + +#endif + +//-------------------------------------------------------------------------- + +externC int dbg_thread_capabilities(struct dbg_capabilities * cpb) +{ + cpb->mask1 = has_thread_current | + has_thread_registers | + has_thread_reg_change | + has_thread_list | + has_thread_info ; + return 1 ; +} + +//-------------------------------------------------------------------------- + +static void dbg_make_threadref(Cyg_Thread *thread, threadref *ref ) +{ + cyg_uint16 id = thread->get_unique_id(); + +#if USE_ID + ((unsigned long *)ref)[0] = (unsigned long)thread; + ((unsigned long *)ref)[1] = (unsigned long)swap32(id); +#else + ((unsigned long *)ref)[1] = (unsigned long)thread; + ((unsigned long *)ref)[0] = (unsigned long)id; +#endif + +} + +static Cyg_Thread *dbg_get_thread( threadref *ref) +{ +#if USE_ID + + cyg_uint16 id = 0; + + id = (cyg_uint16)swap32(((unsigned long *)ref)[1]); + + Cyg_Thread *th = Cyg_Thread::get_list_head(); + while( th != 0 ) + { + if( th->get_unique_id() == id ) break; + th = th->get_list_next(); + } + +// if( thread->get_unique_id() != id ) th = 0; + +#else + + cyg_uint16 id = 0; + + Cyg_Thread *thread = (Cyg_Thread *)(((unsigned long *)ref)[1]); + id = (cyg_uint16)(((unsigned long *)ref)[0]); + + // Validate the thread. + Cyg_Thread *th = Cyg_Thread::get_list_head(); + while( th != 0 ) + { + if( th == thread ) break; + th = th->get_list_next(); + } + +// if( thread->get_unique_id() != id ) th = 0; + +#endif + + return th; +} + +//-------------------------------------------------------------------------- + +externC int dbg_currthread(threadref * varparm) +{ + Cyg_Thread *thread = Cyg_Scheduler::get_current_thread(); + + dbg_make_threadref(thread, varparm ); + + return 1 ; +} + +//-------------------------------------------------------------------------- + +externC int dbg_currthread_id(void) +{ + Cyg_Thread *thread = Cyg_Scheduler::get_current_thread(); + return thread->get_unique_id (); +} + +//-------------------------------------------------------------------------- + +externC int dbg_threadlist(int startflag, + threadref * lastthreadid, + threadref * next_thread) +{ + Cyg_Thread *thread; + if( startflag ) + { + thread = Cyg_Thread::get_list_head(); + dbg_make_threadref(thread, next_thread); + } + else + { + thread = dbg_get_thread(lastthreadid); + + if( thread == 0 ) return 0; + thread = thread->get_list_next(); + + if( thread == 0 ) return 0; + dbg_make_threadref(thread, next_thread); + } + return 1 ; +} + +//-------------------------------------------------------------------------- +// Some support routines for manufacturing thread info strings + +static char *dbg_addstr(char *s, char *t) +{ + while( (*s++ = *t++) != 0 ); + + return s-1; +} + +static char *dbg_addint(char *s, int n, int base) +{ + char buf[16]; + char sign = '+'; + cyg_count8 bpos; + char *digits = "0123456789ABCDEF"; + + if( n < 0 ) n = -n, sign = '-'; + + /* Set pos to start */ + bpos = 0; + + /* construct digits into buffer in reverse order */ + if( n == 0 ) buf[bpos++] = '0'; + else while( n != 0 ) + { + cyg_ucount8 d = n % base; + buf[bpos++] = digits[d]; + n /= base; + } + + /* set sign if negative. */ + if( sign == '-' ) + { + buf[bpos] = sign; + } + else bpos--; + + /* Now write it out in correct order. */ + while( bpos >= 0 ) + *s++ = buf[bpos--]; + + *s = 0; + + return s; +} + +static char *dbg_adddec(char *s, int x) +{ + return dbg_addint(s, x, 10); +} + +//-------------------------------------------------------------------------- + +externC int dbg_threadinfo( + threadref * threadid, + struct cygmon_thread_debug_info * info) +{ + static char statebuf[60]; + + Cyg_Thread *thread = dbg_get_thread(threadid); + if( thread == 0 ) return 0; + + info->context_exists = 1; + + char *sbp = statebuf; + char *s; + + if( thread->get_state() & Cyg_Thread::SUSPENDED ) + { + sbp = dbg_addstr( sbp, "suspended+"); + } + + switch( thread->get_state() & ~Cyg_Thread::SUSPENDED ) + { + case Cyg_Thread::RUNNING: + s = "running"; break; + case Cyg_Thread::SLEEPING: + s = "sleeping"; break; + case Cyg_Thread::COUNTSLEEP: + s = "counted sleep"; break; + case Cyg_Thread::CREATING: + s = "creating"; break; + case Cyg_Thread::EXITED: + s = "exited"; break; + default: + s = "unknown state"; break; + } + + sbp = dbg_addstr( sbp, s ); + sbp = dbg_addstr( sbp, ", Priority: " ); + sbp = dbg_adddec( sbp, thread->get_priority() ); + + info->thread_display = statebuf; + +#ifdef CYGVAR_KERNEL_THREADS_NAME + info->unique_thread_name = thread->get_name(); +#else + info->unique_thread_name = 0; +#endif + + info->more_display = 0; + + return 1 ; +} + +//-------------------------------------------------------------------------- + +externC int dbg_getthreadreg( + threadref * osthreadid, + int regcount, /* count of registers in the array */ + void * regval) /* fillin this array */ +{ + Cyg_Thread *thread = dbg_get_thread(osthreadid); + + if( thread == 0 ) return 0; + + if( thread == Cyg_Scheduler::get_current_thread() ) + { +#if defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + // We have no state for the current thread, Cygmon has + // got that and we cannot get at it. + return 0; +#elif defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) + // _registers hold the state of the current thread. + extern target_register_t * _registers; + + __stub_copy_registers ((target_register_t *)regval, _registers); +#else + return 0; +#endif + } + else + { + HAL_SavedRegisters *regs = thread->get_saved_context(); + if( regs == 0 ) return 0; + + HAL_GET_GDB_REGISTERS (regval, regs); + } + + return 1 ; +} + +//-------------------------------------------------------------------------- + +externC int dbg_setthreadreg( + threadref * osthreadid, + int regcount , /* number of registers */ + void * regval) +{ + Cyg_Thread *thread = dbg_get_thread(osthreadid); + + if( thread == 0 ) return 0; + + if( thread == Cyg_Scheduler::get_current_thread() ) + { +#if defined(CYG_HAL_USE_ROM_MONITOR_CYGMON) + // We have no state for the current thread, Cygmon has + // got that and we cannot get at it. + return 0; +#elif defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) + // _registers hold the state of the current thread. + extern target_register_t * _registers; + + __stub_copy_registers (_registers, (target_register_t *)regval); +#else + return 0; +#endif + } + else + { + HAL_SavedRegisters *regs = thread->get_saved_context(); + if( regs == 0 ) return 0; + + HAL_SET_GDB_REGISTERS (regs, regval); + } + + + return 1; +} + +#endif // CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + +//-------------------------------------------------------------------------- +// End of dbg_gdb.cxx diff --git a/packages/kernel/current/src/instrmnt/meminst.cxx b/packages/kernel/current/src/instrmnt/meminst.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/instrmnt/meminst.cxx @@ -0,0 +1,186 @@ +//========================================================================== +// +// instrmnt/meminst.cxx +// +// Memory buffer instrumentation functions +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-10-27 +// Purpose: Instrumentation functions +// Description: The functions in this file are implementations of the +// standard instrumentation functions that place records +// into a memory buffer. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // interrupt control +#include // scheduler defines + +#include // scheduler inlines +#include // clock inlines + +#ifdef CYGPKG_KERNEL_INSTRUMENT + +// ------------------------------------------------------------------------- +// Instrumentation record. + +struct Instrument_Record +{ + CYG_WORD16 type; // record type + CYG_WORD16 thread; // current thread id + CYG_WORD timestamp; // 32 bit timestamp + CYG_WORD arg1; // first arg + CYG_WORD arg2; // second arg +}; + +// ------------------------------------------------------------------------- +// Buffer base and end. This buffer must be a whole number of + +#ifdef CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER + +externC Instrument_Record instrument_buffer[]; +externC cyg_uint32 instrument_buffer_size; + +#else + +extern "C" +{ + +Instrument_Record instrument_buffer[CYGNUM_KERNEL_INSTRUMENT_BUFFER_SIZE]; + +cyg_uint32 instrument_buffer_size = CYGNUM_KERNEL_INSTRUMENT_BUFFER_SIZE; + +}; + +#endif + +extern "C" +{ + +#define instrument_buffer_start instrument_buffer[0] +#define instrument_buffer_end instrument_buffer[instrument_buffer_size] + +extern "C" +{ +Instrument_Record *instrument_buffer_pointer = &instrument_buffer_start; +}; + +#ifdef CYGDBG_KERNEL_INSTRUMENT_FLAGS + +// This array contains a 32 bit word for each event class. The +// bits in the word correspond to events. By setting or clearing +// the appropriate bit, the selected instrumentation event may +// be enabled or disabled dynamically. + +cyg_uint32 instrument_flags[(CYG_INSTRUMENT_CLASS_MAX>>8)+1]; + +#endif + +}; + +// ------------------------------------------------------------------------- + +void cyg_instrument( cyg_uint32 type, CYG_ADDRWORD arg1, CYG_ADDRWORD arg2 ) +{ + + cyg_uint32 old_ints; + +#ifdef CYGDBG_KERNEL_INSTRUMENT_FLAGS + + cyg_ucount8 cl = (type>>8)&0xff; + cyg_ucount8 event = type&0xff; + + if( instrument_flags[cl] & (1<type = type; + p->thread = (t==0)?0xFFFF:t->get_unique_id(); +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK +// p->timestamp = Cyg_Clock::real_time_clock->current_value_lo(); + HAL_CLOCK_READ( &p->timestamp ); +#else + p->timestamp = 0; +#endif + p->arg1 = arg1; + p->arg2 = arg2; + + p++; + if( p == &instrument_buffer_end ) + instrument_buffer_pointer = &instrument_buffer_start; + else instrument_buffer_pointer = p; + + HAL_RESTORE_INTERRUPTS(old_ints); + } + + return; +} + +// ------------------------------------------------------------------------- +// Functions to enable and disable selected instrumentation events +// when the flags are enabled. + +#ifdef CYGDBG_KERNEL_INSTRUMENT_FLAGS + +externC void cyg_instrument_enable( cyg_uint32 cl, cyg_uint32 event) +{ + if( 0 != event ) + instrument_flags[cl>>8] |= 1<>8] = ~0; +} + +externC void cyg_instrument_disable( cyg_uint32 cl, cyg_uint32 event) +{ + if( 0 != event ) + instrument_flags[cl>>8] &= ~(1<>8] = 0; + +} + +#endif + +// ------------------------------------------------------------------------- + +#endif // CYGPKG_KERNEL_INSTRUMENT + +// EOF instrmnt/null.cxx diff --git a/packages/kernel/current/src/instrmnt/nullinst.cxx b/packages/kernel/current/src/instrmnt/nullinst.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/instrmnt/nullinst.cxx @@ -0,0 +1,64 @@ +//========================================================================== +// +// instrmnt/null.cxx +// +// Null instrumentation functions +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-10-24 +// Purpose: Instrumentation functions +// Description: The functions in this file are null implementations of the +// standard instrumentation functions. These can be used to +// eliminate all instrumentation without recompiling. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#ifdef CYGPKG_KERNEL_INSTRUMENT + +// ------------------------------------------------------------------------- + +void cyg_instrument( cyg_uint32 type, CYG_ADDRWORD arg1, CYG_ADDRWORD arg2 ) +{ + return; +} + +// ------------------------------------------------------------------------- + +#endif //CYGPKG_KERNEL_INSTRUMENT + +// EOF instrmnt/null.cxx diff --git a/packages/kernel/current/src/intr/intr.cxx b/packages/kernel/current/src/intr/intr.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/intr/intr.cxx @@ -0,0 +1,523 @@ +//========================================================================== +// +// intr/intr.cxx +// +// Interrupt class implementations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-10-15 +// Purpose: Interrupt class implementation +// Description: This file contains the definitions of the interrupt +// class. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // our header + +#include // scheduler + +#include + +// ------------------------------------------------------------------------- + +Cyg_Interrupt::Cyg_Interrupt( + cyg_vector vec, // Vector to attach to + cyg_priority pri, // Queue priority + CYG_ADDRWORD d, // Data pointer + cyg_ISR *ir, // Interrupt Service Routine + cyg_DSR *dr // Deferred Service Routine + ) +{ + vector = vec; + priority = pri; + isr = ir; + dsr = dr; + data = d; + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST + + dsr_count = 0; + next_dsr = NULL; + +#endif + +#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN + + next = NULL; + +#endif + +}; + +// ------------------------------------------------------------------------- + +Cyg_Interrupt::~Cyg_Interrupt() +{ + detach(); +}; + +// ------------------------------------------------------------------------- +// DSR handling statics: + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE + +Cyg_Interrupt *Cyg_Interrupt::dsr_table[CYGNUM_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE]; + +cyg_ucount32 Cyg_Interrupt::dsr_table_head = 0; + +cyg_ucount32 Cyg_Interrupt::dsr_table_tail = 0; + +#endif + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST + +Cyg_Interrupt *Cyg_Interrupt::dsr_list = NULL; + +#endif + +// ------------------------------------------------------------------------- +// Call any pending DSRs + +void Cyg_Interrupt::call_pending_DSRs() +{ +// CYG_REPORT_FUNCTION(); + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE + + while( dsr_table_head != dsr_table_tail ) + { + Cyg_Interrupt *intr = dsr_table[dsr_table_head]; + + dsr_table_head++; + if( dsr_table_head >= CYGNUM_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE ) + dsr_table_head = 0; + + CYG_INSTRUMENT_INTR(CALL_DSR, intr->vector, 0); + + intr->dsr( intr->vector, 1, (CYG_ADDRWORD)intr->data ); + } + +#endif + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST + + while( dsr_list != NULL ) + { + Cyg_Interrupt *intr; + cyg_uint32 old_intr; + cyg_count32 count; + + HAL_DISABLE_INTERRUPTS(old_intr); + + intr = dsr_list; + dsr_list = intr->next_dsr; + count = intr->dsr_count; + intr->dsr_count = 0; + + HAL_RESTORE_INTERRUPTS(old_intr); + + intr->dsr( intr->vector, count, (CYG_ADDRWORD)intr->data ); + + } + +#endif + +}; + +// ------------------------------------------------------------------------- + +void Cyg_Interrupt::post_dsr() +{ +// CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_INTR(POST_DSR, vector, 0); + + cyg_uint32 old_intr; + + // We need to disable interrupts during this part to + // guard against nested interrupts. + + HAL_DISABLE_INTERRUPTS(old_intr); + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE + + dsr_table[dsr_table_tail++] = this; + if( dsr_table_tail >= CYGNUM_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE ) + dsr_table_tail = 0; + +#endif + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST + + // Only add the interrupt to the dsr list if this is + // the first DSR call. + // At present DSRs are pushed onto the list and will be + // called in reverse order. We do not define the order + // in which DSRs are called, so this is acceptable. + + if( dsr_count++ == 0 ) + { + next_dsr = dsr_list; + dsr_list = this; + } + +#endif + + HAL_RESTORE_INTERRUPTS(old_intr); +}; + +// ------------------------------------------------------------------------- + +externC void interrupt_end( + cyg_uint32 isr_ret, + Cyg_Interrupt *intr, + HAL_SavedRegisters *regs + ) +{ +// CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_INTR(END, intr->vector, isr_ret); + +#ifndef CYGIMP_KERNEL_INTERRUPTS_CHAIN + + // Only do this if we are in a non-chained configuration. + // If we are chained, then chain_isr below will do the DSR + // posting. + + if( isr_ret & 2 ) intr->post_dsr(); + +#endif + +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + + // If we have GDB support enabled, and there is the possibility + // that this thread will be context switched as a result of this + // interrupt, then save the pointer to the saved thread context in + // the thread object so that GDB can get a meaningful context to + // look at. + + Cyg_Scheduler::get_current_thread()->set_saved_context(regs); + +#endif + + // Now unlock the scheduler, which may also call DSRs + // and cause a thread switch to happen. + + Cyg_Scheduler::unlock(); + +#ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT + + Cyg_Scheduler::get_current_thread()->set_saved_context(0); + +#endif + + + CYG_INSTRUMENT_INTR(RESTORE, intr->vector, 0); +} + +// ------------------------------------------------------------------------- +// Interrupt chaining statics. + +#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN + +Cyg_Interrupt *Cyg_Interrupt::chain_list[CYG_ISR_COUNT]; + +#endif + +// ------------------------------------------------------------------------- +// Chaining ISR inserted in HAL vector + +#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN + +cyg_uint32 Cyg_Interrupt::chain_isr(cyg_vector vector, CYG_ADDRWORD data) +{ + Cyg_Interrupt *p = *(Cyg_Interrupt **)data; + + CYG_INSTRUMENT_INTR(CHAIN_ISR, vector, 0); + + while( p != NULL ) + { + if( p->vector == vector ) + { + register cyg_uint32 isr_ret = p->isr(vector, p->data); + + if( isr_ret & 2 ) p->post_dsr(); + + if( isr_ret & 1 ) break; + } + + p = p->next; + } + + return 0; +} + +#endif + +// ------------------------------------------------------------------------- +// Attach an ISR to an interrupt vector. + +void Cyg_Interrupt::attach() +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( vector >= CYG_ISR_MIN, "Invalid vector"); + CYG_ASSERT( vector <= CYG_ISR_MAX, "Invalid vector"); + + CYG_INSTRUMENT_INTR(ATTACH, vector, 0); + + HAL_INTERRUPT_SET_LEVEL( vector, priority ); + +#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN + + CYG_ASSERT( next == NULL , "Cyg_Interrupt already on a list"); + + cyg_uint32 index; + + HAL_TRANSLATE_VECTOR( vector, index ); + + if( chain_list[index] == NULL ) + { + // First Interrupt on this chain, just assign it and register + // the chain_isr with the HAL. + + chain_list[index] = this; + + HAL_INTERRUPT_ATTACH( vector, chain_isr, &chain_list[index], NULL ); + } + else + { + // There are already interrupts chained, add this one into the + // chain in priority order. + + Cyg_Interrupt **p = &chain_list[index]; + + while( *p != NULL ) + { + Cyg_Interrupt *n = *p; + + if( n->priority < priority ) break; + + p = &n->next; + } + next = *p; + *p = this; + } + +#else + + HAL_INTERRUPT_ATTACH( vector, isr, data, this ); + +#endif +} + +// ------------------------------------------------------------------------- +// Detach the ISR from the vector + +void Cyg_Interrupt::detach() +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( vector >= CYG_ISR_MIN, "Invalid vector"); + CYG_ASSERT( vector <= CYG_ISR_MAX, "Invalid vector"); + + CYG_INSTRUMENT_INTR(DETACH, vector, 0); + +#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN + + // Remove the interrupt object from the vector chain. + + Cyg_Interrupt **p = &chain_list[vector]; + + while( *p != NULL ) + { + Cyg_Interrupt *n = *p; + + if( n == this ) + { + *p = next; + break; + } + + p = &n->next; + } + + // If this was the last one, detach the vector. + + if( chain_list[vector] == NULL ) + HAL_INTERRUPT_DETACH( vector, chain_isr ); + +#else + + HAL_INTERRUPT_DETACH( vector, isr ); + +#endif + +} + +// ------------------------------------------------------------------------- +// Get the current service routine + +void Cyg_Interrupt::get_vsr(cyg_vector vector, cyg_VSR **vsr) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( vector >= CYG_VSR_MIN, "Invalid vector"); + CYG_ASSERT( vector <= CYG_VSR_MAX, "Invalid vector"); + + HAL_VSR_GET( vector, vsr ); +} + +// ------------------------------------------------------------------------- +// Install a vector service routine + +void Cyg_Interrupt::set_vsr(cyg_vector vector, cyg_VSR *vsr, cyg_VSR **old) +{ + CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_INTR(SET_VSR, vector, vsr); + + CYG_ASSERT( vector >= CYG_VSR_MIN, "Invalid vector"); + CYG_ASSERT( vector <= CYG_VSR_MAX, "Invalid vector"); + + CYG_INTERRUPT_STATE old_ints; + + HAL_DISABLE_INTERRUPTS(old_ints); + + HAL_VSR_SET( vector, vsr, old ); + + HAL_RESTORE_INTERRUPTS(old_ints); +} + +// ------------------------------------------------------------------------- +// Disable interrupts at the CPU + + +void Cyg_Interrupt::disable_interrupts() +{ + CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_INTR(DISABLE, 0, 0); + + CYG_INTERRUPT_STATE dummy; + + HAL_DISABLE_INTERRUPTS(dummy); + + // Keep a disable level counter?? +} + + +// ------------------------------------------------------------------------- +// Re-enable CPU interrupts + +void Cyg_Interrupt::enable_interrupts() +{ + CYG_REPORT_FUNCTION(); + + CYG_INSTRUMENT_INTR(ENABLE, 0, 0); + + HAL_ENABLE_INTERRUPTS(); +} + +// ------------------------------------------------------------------------- +// Mask a specific interrupt in a PIC + +void Cyg_Interrupt::mask_interrupt(cyg_vector vector) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( vector >= CYG_ISR_MIN, "Invalid vector"); + CYG_ASSERT( vector <= CYG_ISR_MAX, "Invalid vector"); + + CYG_INSTRUMENT_INTR(MASK, vector, 0); + + HAL_INTERRUPT_MASK( vector ) +} + +// ------------------------------------------------------------------------- +// Clear PIC mask + +void Cyg_Interrupt::unmask_interrupt(cyg_vector vector) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( vector >= CYG_ISR_MIN, "Invalid vector"); + CYG_ASSERT( vector <= CYG_ISR_MAX, "Invalid vector"); + + CYG_INSTRUMENT_INTR(UNMASK, vector, 0); + + HAL_INTERRUPT_UNMASK( vector ); +} + + +// ------------------------------------------------------------------------- +// Acknowledge interrupt at PIC + +void Cyg_Interrupt::acknowledge_interrupt(cyg_vector vector) +{ +// CYG_REPORT_FUNCTION(); + + CYG_ASSERT( vector >= CYG_ISR_MIN, "Invalid vector"); + CYG_ASSERT( vector <= CYG_ISR_MAX, "Invalid vector"); + + CYG_INSTRUMENT_INTR(ACK, vector, 0); + + HAL_INTERRUPT_ACKNOWLEDGE( vector ); +} + +// ------------------------------------------------------------------------- +// Change interrupt detection at PIC + +void Cyg_Interrupt::configure_interrupt( + cyg_vector vector, // vector to control + cyg_bool level, // level or edge triggered + cyg_bool up // hi/lo level, rising/falling edge + ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( vector >= CYG_ISR_MIN, "Invalid vector"); + CYG_ASSERT( vector <= CYG_ISR_MAX, "Invalid vector"); + + CYG_INSTRUMENT_INTR(CONFIGURE, vector, (level<<1)|up); + + HAL_INTERRUPT_CONFIGURE( vector, level, up ); +} + +// ------------------------------------------------------------------------- +// EOF intr/intr.cxx diff --git a/packages/kernel/current/src/mem/memfixed.cxx b/packages/kernel/current/src/mem/memfixed.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/mem/memfixed.cxx @@ -0,0 +1,169 @@ +//========================================================================== +// +// memfixed.cxx +// +// Memory pool with fixed block class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-03-23 +// Purpose: Define Memfixed class interface +// Description: Inline class for constructing a fixed block allocator +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include + +// implementation that we want to make concrete +#ifdef CYGIMP_MEM_USE_MEMPOOLT_PLAIN +#include // kernel safe mempool template +#else +// tell it to optimize for the fixed block one-to-one case +#define CYGIMP_MEM_T_ONEFREE_TO_ONEALLOC +#include // kernel safe mempool template +#endif + +#include // implementation of a fixed mem pool + +// ------------------------------------------------------------------------- +// debugging/assert function + +#ifdef CYGDBG_USE_ASSERTS +cyg_bool +Cyg_Mempool_Fixed::check_this(cyg_assert_class_zeal zeal) +{ + CYG_REPORT_FUNCTION(); + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + return mypool.check_this( zeal ); +} +#endif + +// ------------------------------------------------------------------------- +// Constructor: gives the base and size of the arena in which memory is +// to be carved out, note that management structures are taken from the +// same arena. Alloc_unit is the blocksize allocated. +Cyg_Mempool_Fixed::Cyg_Mempool_Fixed( + cyg_uint8 *base, + cyg_int32 size, + CYG_ADDRWORD alloc_unit ) + : mypool( base, size, alloc_unit ) +{ +} + +// Destructor +Cyg_Mempool_Fixed::~Cyg_Mempool_Fixed() +{ +} + +// ------------------------------------------------------------------------- +// get some memory; wait if none available +cyg_uint8 * +Cyg_Mempool_Fixed::alloc() +{ + return mypool.alloc( 0 ); +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +// get some memory with a timeout +cyg_uint8 * +Cyg_Mempool_Fixed::alloc(cyg_tick_count delay_timeout ) +{ + return mypool.alloc( 0, delay_timeout ); +} +#endif + +// get some memory, return NULL if none available +cyg_uint8 * +Cyg_Mempool_Fixed::try_alloc() +{ + return mypool.try_alloc( 0 ); +} + +// free the memory back to the pool +cyg_bool +Cyg_Mempool_Fixed::free( cyg_uint8 *p ) +{ + return mypool.free( p, 0 ); +} + +// is anyone waiting for memory? +cyg_bool +Cyg_Mempool_Fixed::waiting() +{ + return mypool.waiting(); +} + +// read the fixed allocation size +cyg_int32 +Cyg_Mempool_Fixed::get_blocksize() +{ + return mypool.get_blocksize(); +} + +// these two are obvious and generic +cyg_int32 +Cyg_Mempool_Fixed::get_totalmem() { + return mypool.get_totalmem(); +} +cyg_int32 +Cyg_Mempool_Fixed::get_freemem() { + return mypool.get_freemem(); +} + +// get information about the construction parameters for external +// freeing after the destruction of the holding object +void +Cyg_Mempool_Fixed::get_arena( + cyg_uint8 * &base, cyg_int32 &size, CYG_ADDRWORD &alloc ) +{ + mypool.get_arena( base, size, alloc ); +} + +// Return the size of the memory allocation (previously returned +// by alloc() or try_alloc() ) at ptr. Returns -1 if not found +cyg_int32 +Cyg_Mempool_Fixed::get_allocation_size( cyg_uint8 *ptr ) +{ + // can only be one size for the fixed block allocator + return mypool.get_blocksize(); +} +// ------------------------------------------------------------------------- + +// End of memfixed.cxx diff --git a/packages/kernel/current/src/mem/memvar.cxx b/packages/kernel/current/src/mem/memvar.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/mem/memvar.cxx @@ -0,0 +1,164 @@ +//========================================================================== +// +// memvar.cxx +// +// Memory pool with variable block class declarations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-05-22 +// Description: +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include + +// implementation that we want to make concrete +#ifdef CYGIMP_MEM_USE_MEMPOOLT_PLAIN +#include // kernel safe mempool template +#else +#include // kernel safe mempool template +#endif + +#include // mem pool implementation + +// ------------------------------------------------------------------------- +// debugging/assert function + +#ifdef CYGDBG_USE_ASSERTS +cyg_bool +Cyg_Mempool_Variable::check_this(cyg_assert_class_zeal zeal) +{ + CYG_REPORT_FUNCTION(); + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + return mypool.check_this( zeal ); +} +#endif + +// ------------------------------------------------------------------------- +// Constructor: gives the base and size of the arena in which memory is +// to be carved out +Cyg_Mempool_Variable::Cyg_Mempool_Variable( + cyg_uint8 *base, + cyg_int32 size) + : mypool( base, size, (CYG_ADDRWORD)4 ) +{ +} + +// Destructor +Cyg_Mempool_Variable::~Cyg_Mempool_Variable() +{ +} + +// ------------------------------------------------------------------------- +// get some memory; wait if none available +cyg_uint8 * +Cyg_Mempool_Variable::alloc(cyg_int32 size) +{ + return mypool.alloc( size ); +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +// get some memory with a timeout +cyg_uint8 * +Cyg_Mempool_Variable::alloc(cyg_int32 size, cyg_tick_count delay_timeout ) +{ + return mypool.alloc( size , delay_timeout ); +} +#endif + +// get some memory, return NULL if none available +cyg_uint8 * +Cyg_Mempool_Variable::try_alloc(cyg_int32 size) +{ + return mypool.try_alloc( size ); +} + +// free the memory back to the pool +cyg_bool +Cyg_Mempool_Variable::free( cyg_uint8 *p, cyg_int32 size ) +{ + return mypool.free( p, size ); +} + +// is anyone waiting for memory? +cyg_bool +Cyg_Mempool_Variable::waiting() +{ + return mypool.waiting(); +} + +// read the fixed allocation size (will be -1 as variable) +cyg_int32 +Cyg_Mempool_Variable::get_blocksize() +{ + return mypool.get_blocksize(); +} + +// these two are obvious and generic +cyg_int32 +Cyg_Mempool_Variable::get_totalmem() { + return mypool.get_totalmem(); +} +cyg_int32 +Cyg_Mempool_Variable::get_freemem() { + return mypool.get_freemem(); +} + +// get information about the construction parameters for external +// freeing after the destruction of the holding object +void +Cyg_Mempool_Variable::get_arena( + cyg_uint8 * &base, cyg_int32 &size, CYG_ADDRWORD &maxfree ) +{ + mypool.get_arena( base, size, maxfree ); +} + +// Return the size of the memory allocation (previously returned +// by alloc() or try_alloc() ) at ptr. Returns -1 if not found +cyg_int32 +Cyg_Mempool_Variable::get_allocation_size( cyg_uint8 *ptr ) +{ + return mypool.get_allocation_size( ptr ); +} + +// ------------------------------------------------------------------------- + +// End of memvar.cxx diff --git a/packages/kernel/current/src/sched/bitmap.cxx b/packages/kernel/current/src/sched/bitmap.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sched/bitmap.cxx @@ -0,0 +1,290 @@ +//========================================================================== +// +// sched/bitmap.cxx +// +// Bitmap scheduler class implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-16 +// Purpose: Bitmap scheduler class implementation +// Description: This file contains the implementations of +// Cyg_Scheduler_Implementation and Cyg_SchedThread_Implementation. +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros + +#include // our header + +#include // Architecture specific definitions + +#include // thread inlines +#include // scheduler inlines + +#ifdef CYGSEM_KERNEL_SCHED_BITMAP + +//========================================================================== +// Cyg_Scheduler_Implementation class members + +// ------------------------------------------------------------------------- +// Constructor. + +Cyg_Scheduler_Implementation::Cyg_Scheduler_Implementation() +{ + CYG_REPORT_FUNCTION(); + + // At present we cannot init run_queue here because the absence of + // ordering of static constructors means that we could do this + // after the static idle thread has been created. (Guess how I + // found this out!) +// run_queue = 0; + +} + +// ------------------------------------------------------------------------- +// Choose the best thread to run next + +Cyg_Thread *Cyg_Scheduler_Implementation::schedule() +{ + CYG_REPORT_FUNCTION(); + + // The run queue may _never_ be empty, there is always + // an idle thread at the lowest priority. + + CYG_ASSERT(run_queue != 0, "Run queue empty"); + + cyg_uint32 index; + + HAL_LSBIT_INDEX(index, run_queue); + + return thread_table[index]; +} + +// ------------------------------------------------------------------------- + +void Cyg_Scheduler_Implementation::add_thread(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( thread_table[thread->priority] == NULL || + thread_table[thread->priority] == thread, + "Duplicate thread priorities" ); + + CYG_ASSERT( (run_queue & (1<priority)) == 0, + "Run queue bit already set" ); + + // If the thread is on some other queue, remove it + // here. + if( thread->queue != NULL ) + { + thread->queue->remove(thread); + thread->queue = NULL; + } + + run_queue |= 1<priority; + + // If the new thread is higher priority than the + // current thread, request a reschedule. + + if( thread->priority < Cyg_Scheduler::get_current_thread()->priority ) + need_reschedule = true; +} + +// ------------------------------------------------------------------------- + +void Cyg_Scheduler_Implementation::rem_thread(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( thread_table[thread->priority] == thread, + "Invalid thread priority" ); + + CYG_ASSERT( (run_queue & (1<priority)) != 0, + "Run queue bit not set" ); + + run_queue &= ~(1<priority); + + if( thread == Cyg_Scheduler::get_current_thread() ) + need_reschedule = true; +} + +// ------------------------------------------------------------------------- +// register thread with scheduler + +void Cyg_Scheduler_Implementation::register_thread(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + thread_table[thread->priority] = thread; +} + +// ------------------------------------------------------------------------- + +// deregister thread +void Cyg_Scheduler_Implementation::deregister_thread(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + thread_table[thread->priority] = NULL; +} + +// ------------------------------------------------------------------------- +// Test the given priority for uniqueness + +cyg_bool Cyg_Scheduler_Implementation::unique( cyg_priority priority) +{ + CYG_REPORT_FUNCTION(); + + return thread_table[priority] == NULL; +} + + +//========================================================================== +// Cyg_Cyg_SchedThread_Implementation class members + +Cyg_SchedThread_Implementation::Cyg_SchedThread_Implementation +( + CYG_ADDRWORD sched_info +) +{ + CYG_REPORT_FUNCTION(); + +#if 1 + // Assign this thread's priority to the supplied sched_info + // or the next highest priority available. + + priority = cyg_priority(sched_info); + + while( !Cyg_Scheduler::scheduler.unique(priority) ) + priority++; + +#else + // Assign initial priorities to threads in descending order of + // creation. + + static cyg_priority init_priority = 0; + + priority = init_priority++; +#endif + +} + +// ------------------------------------------------------------------------- + +void Cyg_SchedThread_Implementation::yield() +{ + CYG_REPORT_FUNCTION(); + + // We cannot yield in this scheduler +} + +//========================================================================== +// Cyg_ThreadQueue_Implementation class members + +Cyg_ThreadQueue_Implementation::Cyg_ThreadQueue_Implementation() +{ + CYG_REPORT_FUNCTION(); + + wait_queue = 0; // empty queue +} + + +void Cyg_ThreadQueue_Implementation::enqueue(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + wait_queue |= 1<priority; + thread->queue = CYG_CLASSFROMBASE(Cyg_ThreadQueue, + Cyg_ThreadQueue_Implementation, + this); +} + +// ------------------------------------------------------------------------- + +Cyg_Thread *Cyg_ThreadQueue_Implementation::dequeue() +{ + CYG_REPORT_FUNCTION(); + + // Isolate ls bit in run_queue. + cyg_sched_bitmap next_thread = wait_queue & -wait_queue; + + if( next_thread == 0 ) return NULL; + + wait_queue &= ~next_thread; + + cyg_uint32 index; + + HAL_LSBIT_INDEX(index, next_thread); + + Cyg_Thread *thread = Cyg_Scheduler::scheduler.thread_table[index]; + + thread->queue = NULL; + + return thread; +} + +// ------------------------------------------------------------------------- + +Cyg_Thread *Cyg_ThreadQueue_Implementation::highpri() +{ + CYG_REPORT_FUNCTION(); + + // Isolate ls bit in run_queue. + cyg_sched_bitmap next_thread = wait_queue & -wait_queue; + + if( next_thread == 0 ) return NULL; + + cyg_uint32 index; + + HAL_LSBIT_INDEX(index, next_thread); + + return Cyg_Scheduler::scheduler.thread_table[index]; +} + +// ------------------------------------------------------------------------- + +void Cyg_ThreadQueue_Implementation::remove(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + wait_queue &= ~(1<priority); + thread->queue = NULL; +} + +#endif + +// ------------------------------------------------------------------------- +// EOF sched/bitmap.cxx diff --git a/packages/kernel/current/src/sched/lottery.cxx b/packages/kernel/current/src/sched/lottery.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sched/lottery.cxx @@ -0,0 +1,445 @@ +//========================================================================== +// +// sched/lottery.cxx +// +// Lottery scheduler class implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-16 +// Purpose: Lottery scheduler class implementation +// Description: This file contains the implementations of +// Cyg_Scheduler_Implementation and +// Cyg_SchedThread_Implementation. +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros + +#include // our header +#include // interrupt defines, for Cyg_HAL_Clock + +#include // Architecture specific definitions + + +#include // thread inlines +#include // scheduler inlines + +#ifdef CYGSEM_KERNEL_SCHED_LOTTERY + +#define CYG_ENABLE_TRACE 1 + +//========================================================================== +// Cyg_Scheduler_Implementation class static members + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + +cyg_count32 Cyg_Scheduler_Implementation::timeslice_count = + CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS; + +#endif + +//========================================================================== +// Cyg_Scheduler_Implementation class members + +// ------------------------------------------------------------------------- +// Constructor. + +Cyg_Scheduler_Implementation::Cyg_Scheduler_Implementation() +{ + CYG_REPORT_FUNCTION(); + + total_tickets = 0; + rand_seed = 1; +} + +// ------------------------------------------------------------------------- +// Choose the best thread to run next + +Cyg_Thread *Cyg_Scheduler_Implementation::schedule() +{ + CYG_REPORT_FUNCTION(); + +#ifdef CYG_HAL_POWERPC + + // PowerPc specific version of random number generator. + register cyg_int32 r1 asm("r4"); + r1 = rand_seed; + asm( + "li 7,0;" + "ori 7,7,33614;" + "mulhwu 5,7,%0;" + "mullw 6,7,%0;" + "srawi 6,6,1;" + "add %0,5,6;" + "cmpwi %0,0;" + "bge 1f;" + "slwi %0,%0,1;" + "srwi %0,%0,1;" + "addi %0,%0,1;" + "1:;" + : "=r"(r1) + : "0"(r1) + : "r5", "r6", "r7" + ); + rand_seed = r1; + +#else +#if 1 + rand_seed = (rand_seed * 1103515245) + 1234; + cyg_int32 r1 = rand_seed & 0x7FFFFFFF; +#else + // Generic implementation of RNG. +#if( CYG_BYTEORDER == CYG_MSBFIRST ) +#define _LO 1 +#define _HI 0 +#else +#define _LO 0 +#define _HI 1 +#endif + union { cyg_int64 r64; cyg_int32 r32[2]; } u; + u.r64 = (cyg_int64)rand_seed * 33614LL; + cyg_int32 r1 = u.r32[_HI] + (u.r32[_LO]>>1); + if( r1 < 0 ) + r1 = (r1 & 0x7FFFFFFF) + 1; + rand_seed = r1; +#undef _LO +#undef _HI +#endif +#endif + + cyg_int32 ticket = r1 % total_tickets; + cyg_int32 tick = ticket; + Cyg_Thread *thread = run_queue.highpri(); + + // Search the run queue for the thread with the + // given ticket. + while( ticket > 0 ) + { + ticket -= thread->priority; + if( ticket <= 0 ) break; + thread = thread->next; + + CYG_ASSERT( thread != run_queue.highpri(), "Looping in scheduler"); + } + + CYG_TRACE3( CYG_ENABLE_TRACE, + "seed %08x ticket %d thread %08x", + rand_seed, tick, thread); + + // If the thread has any compensation tickets, take them away since + // it has just won. + + if( thread->compensation_tickets > 0 ) + { + thread->priority -= thread->compensation_tickets; + total_tickets -= thread->compensation_tickets; + thread->compensation_tickets = 0; + } + + // Re-insert thread at head of list. This reduces runtime by + // putting the large ticket holders at the front of the list. + +// run_queue.remove(thread); +// run_queue.enqueue(thread); + + CYG_CHECK_DATA_PTR( thread, "Invalid next thread pointer"); + CYG_ASSERTCLASS( thread, "Bad next thread" ); + + return thread; +} + +// ------------------------------------------------------------------------- + +void Cyg_Scheduler_Implementation::add_thread(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + // If the thread is on some other queue, remove it + // here. + if( thread->queue != NULL ) + { + thread->queue->remove(thread); + thread->queue = NULL; + } + + total_tickets += thread->priority; + + run_queue.enqueue(thread); +} + +// ------------------------------------------------------------------------- + +void Cyg_Scheduler_Implementation::rem_thread(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + run_queue.remove(thread); + + total_tickets -= thread->priority; + + // Compensate the thread for the segment of the quantum that + // it used. This makes it more likely to win the lottery next time + // it is scheduled. We only do this for threads that have voluntarily + // given up the CPU. + +// if( thread->get_state() != Cyg_Thread::RUNNING ) + { +#if 0 + cyg_uint32 hal_ticks; + HAL_CLOCK_READ( &hal_ticks ); + thread->compensation_tickets = thread->priority * + CYGNUM_KERNEL_COUNTERS_RTC_PERIOD / hal_ticks; +#else + thread->compensation_tickets = (thread->priority * + CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS) / timeslice_count; + +#endif + thread->priority += thread->compensation_tickets; + } +} + +// ------------------------------------------------------------------------- +// register thread with scheduler + +void Cyg_Scheduler_Implementation::register_thread(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + // No registration necessary in this scheduler +} + +// ------------------------------------------------------------------------- + +// deregister thread +void Cyg_Scheduler_Implementation::deregister_thread(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + // No registration necessary in this scheduler +} + +// ------------------------------------------------------------------------- +// Test the given priority for uniqueness + +cyg_bool Cyg_Scheduler_Implementation::unique( cyg_priority priority) +{ + CYG_REPORT_FUNCTION(); + + // Priorities are not unique + return true; +} + +//========================================================================== +// Support for timeslicing option + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + +void Cyg_Scheduler_Implementation::timeslice() +{ + CYG_REPORT_FUNCTION(); + + if( --timeslice_count <= 0 ) + { + CYG_INSTRUMENT_SCHED(TIMESLICE,0,0); + + // Force a reschedule on each timeslice + need_reschedule = true; + timeslice_count = CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS; + } +} + +#endif + +//========================================================================== +// Cyg_Cyg_SchedThread_Implementation class members + +Cyg_SchedThread_Implementation::Cyg_SchedThread_Implementation +( + CYG_ADDRWORD sched_info +) +{ + CYG_REPORT_FUNCTION(); + + priority = cyg_priority(sched_info); + + // point the next and prev field at this thread. + + next = prev = CYG_CLASSFROMBASE(Cyg_Thread, + Cyg_SchedThread_Implementation, + this); +} + +// ------------------------------------------------------------------------- +// Insert thread in front of this + +void Cyg_SchedThread_Implementation::insert( Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + thread->next = CYG_CLASSFROMBASE(Cyg_Thread, + Cyg_SchedThread_Implementation, + this); + thread->prev = prev; + prev->next = thread; + prev = thread; +} + +// ------------------------------------------------------------------------- +// remove this from queue + +void Cyg_SchedThread_Implementation::remove() +{ + CYG_REPORT_FUNCTION(); + + next->prev = prev; + prev->next = next; + next = prev = CYG_CLASSFROMBASE(Cyg_Thread, + Cyg_SchedThread_Implementation, + this); +} + +// ------------------------------------------------------------------------- +// Yield the processor to another thread + +void Cyg_SchedThread_Implementation::yield() +{ + CYG_REPORT_FUNCTION(); + + +} + +//========================================================================== +// Cyg_ThreadQueue_Implementation class members + +void Cyg_ThreadQueue_Implementation::enqueue(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + // Always put thread at head of queue + if( queue == NULL ) queue = thread; + else + { + queue->insert(thread); +// queue->next->insert(thread); +// queue = thread; + } + + thread->queue = CYG_CLASSFROMBASE(Cyg_ThreadQueue, + Cyg_ThreadQueue_Implementation, + this); +} + +// ------------------------------------------------------------------------- + +Cyg_Thread *Cyg_ThreadQueue_Implementation::dequeue() +{ + CYG_REPORT_FUNCTION(); + + if( queue == NULL ) return NULL; + + Cyg_Thread *thread = queue; + + if( thread->next == thread ) + { + // sole thread on list, NULL out ptr + queue = NULL; + } + else + { + // advance to next and remove thread + queue = thread->next; + thread->remove(); + } + + thread->queue = NULL; + + return thread; +} + +// ------------------------------------------------------------------------- + +Cyg_Thread *Cyg_ThreadQueue_Implementation::highpri() +{ + CYG_REPORT_FUNCTION(); + + return queue; +} + +// ------------------------------------------------------------------------- + +void Cyg_ThreadQueue_Implementation::remove(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + // If the thread we want is the at the head + // of the list, and is on its own, clear the + // list and return. Otherwise advance to the + // next thread and remove ours. If the thread + // is not at the head of the list, just dequeue + // it. + + thread->queue = NULL; + + if( queue == thread ) + { + if( thread->next == thread ) + { + queue = NULL; + return; + } + else queue = thread->next; + } + + thread->Cyg_SchedThread_Implementation::remove(); + +} + +// ------------------------------------------------------------------------- +// Rotate the front thread on the queue to the back. + +void Cyg_ThreadQueue_Implementation::rotate() +{ + CYG_REPORT_FUNCTION(); + + queue = queue->next; +} + +// ------------------------------------------------------------------------- + +#endif + +// ------------------------------------------------------------------------- +// EOF sched/lottery.cxx diff --git a/packages/kernel/current/src/sched/mlqueue.cxx b/packages/kernel/current/src/sched/mlqueue.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sched/mlqueue.cxx @@ -0,0 +1,486 @@ +//========================================================================== +// +// sched/mlqueue.cxx +// +// Multi-level queue scheduler class implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-16 +// Purpose: Multilevel queue scheduler class implementation +// Description: This file contains the implementations of +// Cyg_Scheduler_Implementation and Cyg_SchedThread_Implementation. +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros + +#include // our header + +#include // Architecture specific definitions + +#include // thread inlines +#include // scheduler inlines + +#ifdef CYGSEM_KERNEL_SCHED_MLQUEUE + +//------------------------------------------------------------------------- +// Some local tracing control - a default. +#ifdef CYGDBG_USE_TRACING +# if !defined( CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE ) && \ + !defined( CYGDBG_INFRA_DEBUG_TRACE_ASSERT_FANCY ) + // ie. not a tracing implementation that takes a long time to output + +# ifndef CYGDBG_KERNEL_TRACE_TIMESLICE +# define CYGDBG_KERNEL_TRACE_TIMESLICE +# endif // control not already defined + +# endif // trace implementation not ..._SIMPLE && not ..._FANCY +#endif // CYGDBG_USE_TRACING + +//========================================================================== +// Cyg_Scheduler_Implementation class static members + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + +cyg_ucount32 Cyg_Scheduler_Implementation::timeslice_count = + CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS; + +#endif + + +//========================================================================== +// Cyg_Scheduler_Implementation class members + +// ------------------------------------------------------------------------- +// Constructor. + +Cyg_Scheduler_Implementation::Cyg_Scheduler_Implementation() +{ + CYG_REPORT_FUNCTION(); + + queue_map = 0; +} + +// ------------------------------------------------------------------------- +// Choose the best thread to run next + +Cyg_Thread *Cyg_Scheduler_Implementation::schedule() +{ + CYG_REPORT_FUNCTION(); + + // The run queue may _never_ be empty, there is always + // an idle thread at the lowest priority. + + CYG_ASSERT( queue_map != 0, "Run queue empty"); + CYG_ASSERT( queue_map & (1<priority; + Cyg_ThreadQueue_Implementation *queue = &run_queue[pri]; + + // If the thread is on some other queue, remove it + // here. + if( thread->queue != NULL ) + { + thread->queue->remove(thread); + thread->queue = NULL; + } + + if( queue->empty() ) + { + // set the map bit and ask for a reschedule if this is a + // new highest priority thread. + + queue_map |= (1<priority ) + need_reschedule = true; + + } + // else the queue already has an occupant, queue behind him + + CYG_ASSERT( queue_map != 0, "Run queue empty"); + CYG_ASSERT( queue_map & (1<enqueue(thread); +} + +// ------------------------------------------------------------------------- + +void Cyg_Scheduler_Implementation::rem_thread(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( queue_map != 0, "Run queue empty"); + + cyg_priority pri = thread->priority; + Cyg_ThreadQueue_Implementation *queue = &run_queue[pri]; + + CYG_ASSERT( pri != CYG_THREAD_MIN_PRIORITY, "Idle thread trying to sleep!"); + CYG_ASSERT( queue_map & (1<remove(thread); + + if( queue->empty() ) + { + // If this was only thread in + // queue, clear map. + + queue_map &= ~(1<yield(); + } + + CYG_ASSERT( queue_map & (1<next = CYG_CLASSFROMBASE(Cyg_Thread, + Cyg_SchedThread_Implementation, + this); + thread->prev = prev; + prev->next = thread; + prev = thread; +} + +// ------------------------------------------------------------------------- +// remove this from queue + +void Cyg_SchedThread_Implementation::remove() +{ + CYG_REPORT_FUNCTION(); + + next->prev = prev; + prev->next = next; + next = prev = CYG_CLASSFROMBASE(Cyg_Thread, + Cyg_SchedThread_Implementation, + this); +} + +// ------------------------------------------------------------------------- +// Yield the processor to another thread + +void Cyg_SchedThread_Implementation::yield() +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + Cyg_Thread *thread = CYG_CLASSFROMBASE(Cyg_Thread, + Cyg_SchedThread_Implementation, + this); + + // Only do this if this thread is running. If it is not, there + // is no point. + + if( thread->get_state() == Cyg_Thread::RUNNING ) + { + // To yield we simply rotate the appropriate + // run queue to the next thread and reschedule. + + CYG_ASSERTCLASS( thread, "Bad current thread"); + + Cyg_Scheduler *sched = &Cyg_Scheduler::scheduler; + + CYG_ASSERTCLASS( sched, "Bad scheduler"); + + cyg_priority pri = thread->priority; + Cyg_ThreadQueue_Implementation *queue = &sched->run_queue[pri]; + + queue->rotate(); + + if( queue->highpri() != thread ) + sched->need_reschedule = true; +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + // Reset the timeslice counter so that this thread gets a full + // quantum. + else Cyg_Scheduler::reset_timeslice_count(); +#endif + } + + // Unlock the scheduler and switch threads + Cyg_Scheduler::unlock(); + +} + +// ------------------------------------------------------------------------- +// Rotate the run queue at a specified priority. +// (pri is the decider, no this, so the routine is static) + +void +Cyg_SchedThread_Implementation::rotate_queue( cyg_priority pri ) +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + Cyg_Scheduler *sched = &Cyg_Scheduler::scheduler; + + CYG_ASSERTCLASS( sched, "Bad scheduler"); + + Cyg_ThreadQueue_Implementation *queue = &sched->run_queue[pri]; + + if ( !queue->empty() ) { + queue->rotate(); + sched->need_reschedule = true; + } + + // Unlock the scheduler and switch threads + Cyg_Scheduler::unlock(); + +} + +//========================================================================== +// Cyg_ThreadQueue_Implementation class members + +Cyg_ThreadQueue_Implementation::Cyg_ThreadQueue_Implementation() +{ + CYG_REPORT_FUNCTION(); + + queue = NULL; // empty queue +} + + + +void Cyg_ThreadQueue_Implementation::enqueue(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + if( queue == NULL ) queue = thread; + else queue->insert(thread); + + thread->queue = CYG_CLASSFROMBASE(Cyg_ThreadQueue, + Cyg_ThreadQueue_Implementation, + this); + +} + +// ------------------------------------------------------------------------- + +Cyg_Thread *Cyg_ThreadQueue_Implementation::dequeue() +{ + CYG_REPORT_FUNCTION(); + + if( queue == NULL ) return NULL; + + Cyg_Thread *thread = queue; + + if( thread->next == thread ) + { + // sole thread on list, NULL out ptr + queue = NULL; + } + else + { + // advance to next and remove thread + queue = thread->next; + thread->remove(); + } + + thread->queue = NULL; + + return thread; +} + +// ------------------------------------------------------------------------- + +Cyg_Thread *Cyg_ThreadQueue_Implementation::highpri() +{ + CYG_REPORT_FUNCTION(); + + return queue; +} + +// ------------------------------------------------------------------------- + +void Cyg_ThreadQueue_Implementation::remove(Cyg_Thread *thread) +{ + CYG_REPORT_FUNCTION(); + + // If the thread we want it the at the head + // of the list, and is on its own, clear the + // list and return. Otherwise advance to the + // next thread and remove ours. If the thread + // is not at the head of the list, just dequeue + // it. + + thread->queue = NULL; + + if( queue == thread ) + { + if( thread->next == thread ) + { + queue = NULL; + return; + } + else queue = thread->next; + } + + thread->Cyg_SchedThread_Implementation::remove(); + +} + +// ------------------------------------------------------------------------- +// Rotate the front thread on the queue to the back. + +void Cyg_ThreadQueue_Implementation::rotate() +{ + CYG_REPORT_FUNCTION(); + + queue = queue->next; +} + +// ------------------------------------------------------------------------- + +#endif + +// ------------------------------------------------------------------------- +// EOF sched/mlqueue.cxx diff --git a/packages/kernel/current/src/sched/sched.cxx b/packages/kernel/current/src/sched/sched.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sched/sched.cxx @@ -0,0 +1,374 @@ +//========================================================================== +// +// sched/sched.cxx +// +// Scheduler class implementations +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-15 +// Purpose: Scheduler class implementation +// Description: This file contains the definitions of the scheduler class +// member functions that are common to all scheduler +// implementations. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // our header + +#include // thread classes +#include // Interrupt interface + +#include // Architecture specific definitions + +#include // thread inlines + +//------------------------------------------------------------------------- +// Some local tracing control - a default. +#ifdef CYGDBG_USE_TRACING +# if !defined( CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE ) && \ + !defined( CYGDBG_INFRA_DEBUG_TRACE_ASSERT_FANCY ) + // ie. not a tracing implementation that takes a long time to output + +# ifndef CYGDBG_KERNEL_TRACE_UNLOCK_INNER +# define CYGDBG_KERNEL_TRACE_UNLOCK_INNER +# endif // control not already defined + +# endif // trace implementation not ..._SIMPLE && not ..._FANCY +#endif // CYGDBG_USE_TRACING + +// ------------------------------------------------------------------------- +// Static Cyg_Scheduler class members + +// We start with sched_lock at 1 so that any kernel code we +// call during initialization will not try to reschedule. + +volatile cyg_ucount32 Cyg_Scheduler_Base::sched_lock = 1; + +Cyg_Thread *Cyg_Scheduler_Base::current_thread = NULL; + +cyg_bool Cyg_Scheduler_Base::need_reschedule = false; + +Cyg_Scheduler Cyg_Scheduler::scheduler CYG_INIT_PRIORITY( SCHEDULER ); + +cyg_ucount32 Cyg_Scheduler_Base::thread_switches = 0; + +// ------------------------------------------------------------------------- +// Scheduler unlock function. +// This is only called when the lock is to be decremented to zero and there +// is the potential for real work to be done. Other cases are handled in +// Cyg_Scheduler::unlock() which is an inline. + +void Cyg_Scheduler::unlock_inner() +{ +#ifdef CYGDBG_KERNEL_TRACE_UNLOCK_INNER + CYG_REPORT_FUNCTION(); +#endif + + do { + + CYG_PRECONDITION( sched_lock == 1 , "sched_lock not 1" ); + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS + + // Call any pending DSRs. Do this here to ensure that any + // threads that get awakened are properly scheduled. + + if( Cyg_Interrupt::DSRs_pending() ) + Cyg_Interrupt::call_pending_DSRs(); +#endif + + Cyg_Thread *current = current_thread; + + CYG_ASSERTCLASS( current, "Bad current thread" ); + + // If the current thread is going to sleep, or someone + // wants a reschedule, choose another thread to run + + if( current->state != Cyg_Thread::RUNNING || need_reschedule ) { + + CYG_INSTRUMENT_SCHED(RESCHEDULE,0,0); + + // Get the next thread to run from scheduler + Cyg_Thread *next = scheduler.schedule(); + + CYG_CHECK_DATA_PTR( next, "Invalid next thread pointer"); + CYG_ASSERTCLASS( next, "Bad next thread" ); + + if( current != next ) + { + + CYG_INSTRUMENT_THREAD(SWITCH,current,next); + + // Count this thread switch + thread_switches++; + + // Switch contexts + HAL_THREAD_SWITCH_CONTEXT( ¤t->stack_ptr, + &next->stack_ptr ); + + // Worry here about possible compiler + // optimizations across the above call that may try to + // propogate common subexpresions. We would end up + // with the expression from one thread in its + // successor. This is only a worry if we do not save + // and restore the complete register set. We need a + // way of marking functions that return into a + // different context. A temporary fix would be to + // disable CSE (-fdisable-cse) in the compiler. + + // We return here only when the current thread is + // rescheduled. There is a bit of housekeeping to do + // here before we are allowed to go on our way. + + CYG_CHECK_DATA_PTR( current, "Invalid current thread pointer"); + CYG_ASSERTCLASS( current, "Bad current thread" ); + + current_thread = current; // restore current thread pointer + + } + +#ifdef CYGSEM_KERNEL_SCHED_TIMESLICE + // Reset the timeslice counter so that this thread gets a full + // quantum. + reset_timeslice_count(); +#endif + + need_reschedule = false; // finished rescheduling + } + + sched_lock = 0; // Clear the lock + +#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS + + // Now check whether any DSRs got posted during the thread + // switch and if so, go around again. Making this test after + // the lock has been zeroed avoids a race condition in which + // a DSR could have been posted during a reschedule, but would + // not be run until the _next_ time we release the sched lock. + + HAL_REORDER_BARRIER(); + + if( Cyg_Interrupt::DSRs_pending() ) { + sched_lock = 1; // reclaim the lock + continue; // go back to head of loop + } + +#endif + // Otherwise the lock is zero, we can return. + + CYG_POSTCONDITION( sched_lock == 0, "sched_lock not zero" ); + +#ifdef CYGDBG_KERNEL_TRACE_UNLOCK_INNER + CYG_REPORT_RETURN(); +#endif + return; + + } while( 1 ); + + CYG_FAIL( "Should not be executed" ); +} + +// ------------------------------------------------------------------------- +// Start the scheduler. This is called after the initial threads have been +// created to start scheduling. + +void Cyg_Scheduler::start() +{ + CYG_REPORT_FUNCTION(); + + // Get the first thread to run from scheduler + register Cyg_Thread *next = scheduler.schedule(); + + CYG_ASSERTCLASS( next, "Bad initial thread" ); + + need_reschedule = false; // finished rescheduling + current_thread = next; // restore current thread pointer + + // Let the interrupts go + Cyg_Interrupt::enable_interrupts(); + + HAL_THREAD_LOAD_CONTEXT( &next->stack_ptr ); + +} + +// ------------------------------------------------------------------------- +// Consistency checker + +#ifdef CYGDBG_USE_ASSERTS + +bool Cyg_Scheduler::check_this( cyg_assert_class_zeal zeal) +{ + CYG_REPORT_FUNCTION(); + + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + + switch( zeal ) + { + case cyg_system_test: + case cyg_extreme: + case cyg_thorough: + if( !current_thread->check_this(zeal) ) return false; + case cyg_quick: + case cyg_trivial: + case cyg_none: + default: + break; + }; + + return true; +} + +#endif + +//========================================================================== +// SchedThread members + +// ------------------------------------------------------------------------- +// Constructor + +Cyg_SchedThread::Cyg_SchedThread(Cyg_Thread *thread, CYG_ADDRWORD sched_info) +: Cyg_SchedThread_Implementation(sched_info) +{ + CYG_REPORT_FUNCTION(); + + queue = NULL; + + if( Cyg_Scheduler::current_thread == NULL ) + Cyg_Scheduler::current_thread = thread; + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE + + mutex_count = 0; + priority_inherited = false; + +#endif + +} + +// ------------------------------------------------------------------------- +// Priority inheritance support. + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + +// ------------------------------------------------------------------------- +// Inherit the priority of the provided thread if it +// has a higher priority than ours. + +void Cyg_SchedThread::inherit_priority( Cyg_Thread *thread) +{ +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE + + // A simple implementation of priority inheritance. If the other + // thread is of higher priority, reset our priority to his. The + // first time we do this, save our original priority. + + Cyg_Thread *self = CYG_CLASSFROMBASE(Cyg_Thread, + Cyg_SchedThread, + this); + + CYG_ASSERT( mutex_count > 0, "Non-positive mutex count"); + CYG_ASSERT( self != thread, "Trying to inherit from self!"); + + if( thread->get_priority() < priority ) + { + cyg_priority mypri = priority; + + if( !priority_inherited ) + { + // If this is first inheritance, copy the old pri + // and set inherited flag. We do this after setting the + // pri since set_priority() is inheritance aware. + + self->set_priority( thread->get_priority() ); + priority_inherited = true, + original_priority = mypri; + } + else + { + // Already in inherited state, and new pri is higher + // than old. Just change the pri. + + self->set_priority( thread->get_priority() ); + } + } + +#endif +} + +// ------------------------------------------------------------------------- +// Lose a priority inheritance + +void Cyg_SchedThread::disinherit_priority() +{ +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE + + // A simple implementation of priority inheritance. The + // simplification in this algorithm is that we do not reduce our + // priority until we have freed all mutexes claimed. Hence we can + // continue to run at an artificially high priority even when we + // should not. However, since nested mutexes are rare, the thread + // we have inherited from is likely to be locking the same mutexes + // we are, and mutex claim periods should be very short, the + // performance difference between this and a more complex algorithm + // should be negligible. The most important advantage of this + // algorithm is that it is fast and deterministic. + + Cyg_Thread *self = CYG_CLASSFROMBASE(Cyg_Thread, + Cyg_SchedThread, + this); + + CYG_ASSERT( mutex_count >= 0, "Non-positive mutex count"); + + if( mutex_count == 0 && priority_inherited ) + { + priority_inherited = false; + + // Only make an effort if the priority must change + if( priority < original_priority ) + self->set_priority( original_priority ); + + } + +#endif +} + +#endif + +// ------------------------------------------------------------------------- +// EOF sched/sched.cxx diff --git a/packages/kernel/current/src/sync/bin_sem.cxx b/packages/kernel/current/src/sync/bin_sem.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sync/bin_sem.cxx @@ -0,0 +1,188 @@ +//========================================================================== +// +// sync/bin_sem.cxx +// +// Binary semaphore implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-24 +// Purpose: Cyg_Binary_Semaphore implementation +// Description: This file contains the implementations of the binary semaphore +// class. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // Cyg_Thread inlines + +#include // our header + +#include // scheduler inlines + +// ------------------------------------------------------------------------- + +Cyg_Binary_Semaphore::Cyg_Binary_Semaphore ( + cyg_bool init_state +) +{ + state = init_state; +} + +// ------------------------------------------------------------------------- + +Cyg_Binary_Semaphore::~Cyg_Binary_Semaphore ( ) +{ +} + +// ------------------------------------------------------------------------- + +cyg_bool Cyg_Binary_Semaphore::wait() +{ + cyg_bool result = true; + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_BINSEM( CLAIM, this, state ); + + while( !state && result ) + { + self->set_sleep_reason( Cyg_Thread::WAIT ); + + self->sleep(); + + queue.enqueue( self ); + + CYG_INSTRUMENT_BINSEM( WAIT, this, 0 ); + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, "Called with non-zero scheduler lock"); + + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_BINSEM( WOKE, this, state ); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + + } + + if( result ) state = false; + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return result; +} + +// ------------------------------------------------------------------------- + +cyg_bool Cyg_Binary_Semaphore::trywait() +{ + cyg_bool result = true; + + // Prevent preemption + Cyg_Scheduler::lock(); + + if( state ) state = false; + else result = false; + + CYG_INSTRUMENT_BINSEM( TRY, this, result ); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return result; +} + +// ------------------------------------------------------------------------- + +void Cyg_Binary_Semaphore::post() +{ + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_BINSEM( POST, this, 0 ); + + state = true; + + if( !queue.empty() ) { + + // The queue is non-empty, so grab the next + // thread from it and wake it up. The waiter + // will clear the flag. + + Cyg_Thread *thread = queue.dequeue(); + + thread->set_wake_reason( Cyg_Thread::DONE ); + + thread->wake(); + + CYG_INSTRUMENT_BINSEM( WAKE, this, thread ); + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + +} + +// ------------------------------------------------------------------------- + +cyg_bool Cyg_Binary_Semaphore::posted() +{ + // This is a single read of the value of state. + // This is already atomic, hence there is no need + // to lock the scheduler. + + return state; +} + +// ------------------------------------------------------------------------- +// EOF sync/bin_sem.cxx diff --git a/packages/kernel/current/src/sync/cnt_sem.cxx b/packages/kernel/current/src/sync/cnt_sem.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sync/cnt_sem.cxx @@ -0,0 +1,275 @@ +//========================================================================== +// +// sync/cnt_sem.cxx +// +// Counting semaphore implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-24 +// Purpose: Cyg_Counting_Semaphore implementation +// Description: This file contains the implementations of the counting semaphore +// class. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // Cyg_Thread inlines + +#include // our header + +#include // scheduler inlines + +// ------------------------------------------------------------------------- +// Constructor + +Cyg_Counting_Semaphore::Cyg_Counting_Semaphore( + cyg_count32 init_count // Initial count value + ) +{ + count = init_count; +} + +// ------------------------------------------------------------------------- +// Destructor + +Cyg_Counting_Semaphore::~Cyg_Counting_Semaphore() +{ + CYG_ASSERT( queue.empty(), "Destroying semaphore with waiting threads"); +} + +// ------------------------------------------------------------------------- +// Wait until the count can be decremented without it becoming +// negative. + +cyg_bool Cyg_Counting_Semaphore::wait() +{ + cyg_bool result = true; + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CNTSEM( CLAIM, this, count ); + + while( count == 0 && result ) + { + self->set_sleep_reason( Cyg_Thread::WAIT ); + + self->sleep(); + + queue.enqueue( self ); + + CYG_INSTRUMENT_CNTSEM( WAIT, this, 0 ); + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, "Called with non-zero scheduler lock"); + + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CNTSEM( WOKE, this, count ); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + if( result ) count--; + + // Unlock the scheduler + Cyg_Scheduler::unlock(); + + return result; +} + +// ------------------------------------------------------------------------- +// Wait until the count can be decremented without it becoming +// negative. + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + +cyg_bool +Cyg_Counting_Semaphore::wait( cyg_tick_count timeout ) +{ + cyg_bool result = true; + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CNTSEM( CLAIM, this, count ); + + // Set the timer _once_ outside the loop. + self->set_timer( timeout, Cyg_Thread::TIMEOUT ); + + // If the timeout is in the past, the wake reason will have been + // set to something other than NONE already. Set the result false + // to force an immediate return. + + if( self->get_wake_reason() != Cyg_Thread::NONE ) + result = false; + + while ( 0 == count && result ) { + + // must reset the sleep reason every time + self->set_sleep_reason( Cyg_Thread::TIMEOUT ); + + self->sleep(); + + queue.enqueue( self ); + + CYG_INSTRUMENT_CNTSEM( WAIT, this, 0 ); + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, + "Called with non-zero scheduler lock"); + + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CNTSEM( WOKE, this, count ); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + result = false; + CYG_INSTRUMENT_CNTSEM( TIMEOUT, this, count); + break; + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + // Clear the timeout. It is irrelevant whether the alarm has + // actually gone off or not. + self->clear_timer(); + + if ( result ) count--; + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return result; +} + +#endif // CYGFUN_KERNEL_THREADS_TIMER + +// ------------------------------------------------------------------------- +// Try to decrement, but fail if not possible + +cyg_bool Cyg_Counting_Semaphore::trywait() +{ + cyg_bool result = true; + + // Prevent preemption + Cyg_Scheduler::lock(); + + if( count > 0 ) count--; + else result = false; + + CYG_INSTRUMENT_CNTSEM( TRY, this, result ); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return result; +} + +// ------------------------------------------------------------------------- +// Increment count + +void Cyg_Counting_Semaphore::post() +{ + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CNTSEM( POST, this, 0 ); + + count++; + + if( !queue.empty() ) { + + // The queue is non-empty, so grab the next + // thread from it and wake it up. The waiter + // will decrement the count when he is awakened. + + Cyg_Thread *thread = queue.dequeue(); + + thread->set_wake_reason( Cyg_Thread::DONE ); + + thread->wake(); + + CYG_INSTRUMENT_CNTSEM( WAKE, this, thread ); + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); +} + +// ------------------------------------------------------------------------- +// Get current count value + +cyg_count32 Cyg_Counting_Semaphore::peek() +{ + // This is a single read of the value of count. + // This is already atomic, hence there is no need + // to lock the scheduler. + + return count; +} + +// ------------------------------------------------------------------------- +// EOF sync/cnt_sem.cxx diff --git a/packages/kernel/current/src/sync/cnt_sem2.cxx b/packages/kernel/current/src/sync/cnt_sem2.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sync/cnt_sem2.cxx @@ -0,0 +1,289 @@ +//========================================================================== +// +// sync/cnt_sem2.cxx +// +// Counting semaphore implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-09-24 +// Purpose: Cyg_Counting_Semaphore implementation +// Description: This file contains the implementations of the counting semaphore +// class. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // Cyg_Thread inlines + +#include // our header + +#include // scheduler inlines + +// ------------------------------------------------------------------------- +// Constructor + +Cyg_Counting_Semaphore2::Cyg_Counting_Semaphore2( + cyg_count32 init_count // Initial count value + ) +{ + count = init_count; +} + +// ------------------------------------------------------------------------- +// Destructor + +Cyg_Counting_Semaphore2::~Cyg_Counting_Semaphore2() +{ + CYG_REPORT_FUNCTION(); +#if 0 + CYG_ASSERT( queue.empty(), "Destroying semaphore with waiting threads"); +#endif + // Prevent preemption + Cyg_Scheduler::lock(); + + while ( ! queue.empty() ) { + Cyg_Thread *thread = queue.dequeue(); + thread->set_wake_reason( Cyg_Thread::DESTRUCT ); + thread->wake(); + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Wait until the count can be decremented without it becoming +// negative. + +cyg_bool Cyg_Counting_Semaphore2::wait() +{ + CYG_REPORT_FUNCTION(); + Cyg_Thread *self = Cyg_Thread::self(); + cyg_bool result = true; + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CNTSEM( CLAIM, this, count ); + + if ( 0 < count ) { + count--; + Cyg_Scheduler::unlock(); + } + else { + self->set_sleep_reason( Cyg_Thread::WAIT ); + self->sleep(); + queue.enqueue( self ); + + CYG_INSTRUMENT_CNTSEM( WAIT, this, 0 ); + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, + "Called with non-zero scheduler lock"); + + Cyg_Scheduler::unlock(); + + CYG_INSTRUMENT_CNTSEM( WOKE, this, count ); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + CYG_REPORT_RETVAL( result ); + return result; +} + +// ------------------------------------------------------------------------- +// Wait until the count can be decremented without it becoming +// negative. + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + +cyg_bool +Cyg_Counting_Semaphore2::wait( cyg_tick_count abs_timeout ) +{ + CYG_REPORT_FUNCTION(); + Cyg_Thread *self = Cyg_Thread::self(); + cyg_bool result = true; + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CNTSEM( CLAIM, this, count ); + + if ( 0 < count ) { + count--; + Cyg_Scheduler::unlock(); + } + else { + + // Put thread in sleep state before setting timer since if the + // timeout is in the past, it will be re-awoken + // immediately. If this happens then wake_reason will not be + // NONE. + + self->sleep(); + + self->set_timer( abs_timeout, Cyg_Thread::TIMEOUT ); + + // only enqueue if the timeout did not already happen + if( Cyg_Thread::NONE == self->get_wake_reason() ) + queue.enqueue( self ); + + CYG_INSTRUMENT_CNTSEM( WAIT, this, 0 ); + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, + "Called with non-zero scheduler lock"); + + Cyg_Scheduler::unlock(); + + // Clear the timeout. It is irrelevant whether the alarm has + // actually gone off or not. + self->clear_timer(); + + CYG_INSTRUMENT_CNTSEM( WOKE, this, count ); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + result = false; + CYG_INSTRUMENT_CNTSEM( TIMEOUT, this, count); + break; + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + CYG_REPORT_RETVAL( result ); + return result; +} + +#endif // CYGFUN_KERNEL_THREADS_TIMER + +// ------------------------------------------------------------------------- +// Try to decrement, but fail if not possible + +cyg_bool Cyg_Counting_Semaphore2::trywait() +{ + CYG_REPORT_FUNCTION(); + cyg_bool result = true; + + // Prevent preemption + Cyg_Scheduler::lock(); + + if( 0 < count ) count--; + else result = false; + + CYG_INSTRUMENT_CNTSEM( TRY, this, result ); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETVAL( result ); + return result; +} + +// ------------------------------------------------------------------------- +// Increment count + +void Cyg_Counting_Semaphore2::post() +{ + CYG_REPORT_FUNCTION(); + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CNTSEM( POST, this, 0 ); + + if( queue.empty() ) { + count++; + } + else { + // The queue is non-empty, so grab the next + // thread from it and wake it up. The waiter + // won't decrement the count when he is awakened, + // for we never incremented it in the first place + + Cyg_Thread *thread = queue.dequeue(); + + thread->set_wake_reason( Cyg_Thread::DONE ); + + thread->wake(); + + CYG_INSTRUMENT_CNTSEM( WAKE, this, thread ); + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Get current count value + +cyg_count32 Cyg_Counting_Semaphore2::peek() +{ + // This is a single read of the value of count. + // This is already atomic, hence there is no need + // to lock the scheduler. + + return count; +} + +// ------------------------------------------------------------------------- +// EOF sync/cnt_sem2.cxx diff --git a/packages/kernel/current/src/sync/flag.cxx b/packages/kernel/current/src/sync/flag.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sync/flag.cxx @@ -0,0 +1,415 @@ +//========================================================================== +// +// flag.cxx +// +// Flag class implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-11 +// Purpose: Flag implementation +// Description: This file contains the implementations of the flag class +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // thread inlines + +#include // our own header + +#include // scheduler inlines +#include // clock inlines + +// ------------------------------------------------------------------------- +// Constructor + +Cyg_Flag::Cyg_Flag( Cyg_FlagValue init = 0 ) +{ + CYG_REPORT_FUNCTION(); + value = init; + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Destructor + +Cyg_Flag::~Cyg_Flag() +{ + CYG_REPORT_FUNCTION(); +#if 0 + CYG_ASSERT( queue.empty(), "Deleting flag with threads waiting"); +#endif + // Prevent preemption + Cyg_Scheduler::lock(); + + while ( ! queue.empty() ) { + Cyg_Thread *thread = queue.dequeue(); + thread->set_wake_reason( Cyg_Thread::DESTRUCT ); + thread->wake(); + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// debugging/assert function + +#ifdef CYGDBG_USE_ASSERTS +cyg_bool +Cyg_Flag::check_this(cyg_assert_class_zeal zeal) +{ + CYG_REPORT_FUNCTION(); + + if ( Cyg_Thread::DESTRUCT == Cyg_Thread::self()->get_wake_reason() ) + // then the whole thing is invalid, and we know it. + // so return OK, since this check should NOT make an error. + return true; + + // check that we have a non-NULL pointer first + if( this == NULL ) { + CYG_REPORT_RETVAL( false ); + return false; + } + + // there ain't a lot to check here. + CYG_REPORT_RETVAL( true ); + return true; +} +#endif + +// ------------------------------------------------------------------------- +// now the members themselves: + +// clear some bits in the value (all of them by default) by ANDing with the +// argument. This cannot make a wait condition become true, so there's not +// much to it. +void +Cyg_Flag::maskbits( Cyg_FlagValue arg = 0 ) +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + value &= arg; + // no need to wake anyone up; no waiter can become valid in + // consequence of this operation. + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + + +// ------------------------------------------------------------------------- +// set some bits in the value (all of them by default) and wake up any +// affected waiting threads; we do the decision making here so as to get +// atomicity wrt the other threads waking up - the value might have changed +// by the time they get to run. + +void +Cyg_Flag::setbits( Cyg_FlagValue arg = ~0 ) +{ + CYG_REPORT_FUNCTION(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Prevent preemption + Cyg_Scheduler::lock(); + + // OR in the argument to get a new flag value. + value |= arg; + + // anyone waiting? + if ( !(queue.empty()) ) { + FlagWaitInfo *p; + Cyg_Thread *thread; + Cyg_ThreadQueue holding; + + do { + thread = queue.dequeue(); + p = (FlagWaitInfo *)(thread->get_wait_info()); + + CYG_ASSERT( (p->allmask == 0) != (p->anymask == 0), + "Both masks set" ); + CYG_ASSERT( 0 == p->value_out, "Thread already awoken?" ); + + if ( ((p->allmask != 0) && (p->allmask & value) == p->allmask) || + ((p->anymask & value) != 0 ) ) { + // success! awaken the thread + thread->set_wake_reason( Cyg_Thread::DONE ); + thread->wake(); + // return the successful value to it + p->value_out = value; + // do we clear the value; is this the end? + if ( p->do_clear ) { + // we can break here but need to preserve ordering + value = 0; + // so let it cycle the whole queue regardless + } + } + else { + // preserve the entry on the holding queue + holding.enqueue( thread ); + } + } while ( !(queue.empty()) ); + + // Now re-queue the unaffected threads back into the flag queue + while ( !(holding.empty()) ) { + queue.enqueue( holding.dequeue() ); + } + } + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + CYG_REPORT_RETURN(); +} + +// ------------------------------------------------------------------------- +// Wait for a match on our pattern, according to the flags given. +// Return the matching value. +Cyg_FlagValue +Cyg_Flag::wait( Cyg_FlagValue pattern, WaitMode mode ) +{ + CYG_REPORT_FUNCTION(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERT( Cyg_Flag::MASK >= mode, "Bad mode" ); + + Cyg_FlagValue result; + + // Prevent preemption so that we compare atomically + Cyg_Scheduler::lock(); + + // try the current value + result = poll( pattern, mode ); + + if ( 0 != result ) { + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( result ); + return result; // all done + } + + // we have to wait until we are awoken + Cyg_Thread *self = Cyg_Thread::self(); + + FlagWaitInfo saveme; + saveme.allmask = (Cyg_Flag::OR & mode) ? 0 : pattern; + saveme.anymask = (Cyg_Flag::OR & mode) ? pattern : 0; + saveme.do_clear = (0 != (Cyg_Flag::CLR & mode)); + + self->set_wait_info( (CYG_ADDRWORD)&saveme ); + + result = true; // just being used as an early-out flag now + // this loop allows us to deal correctly with spurious wakeups + while ( result && (0 == saveme.value_out) ) { + self->set_sleep_reason( Cyg_Thread::WAIT ); + self->sleep(); + // keep track of myself on the queue of waiting threads + queue.enqueue( self ); + + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_ASSERT( ((CYG_ADDRWORD)&saveme) == + Cyg_Thread::self()->get_wait_info(), + "Wait info lost" ); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + CYG_ASSERT( (false == result) ^ (0 != saveme.value_out), + "Break out but also good result!" ); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( saveme.value_out ); + return saveme.value_out; +} + +// ------------------------------------------------------------------------- +// Wait for a match on our pattern, with a timeout. +// Return the matching value, or zero if timed out. +// (zero cannot match any pattern). +#ifdef CYGFUN_KERNEL_THREADS_TIMER +Cyg_FlagValue +Cyg_Flag::wait( Cyg_FlagValue pattern, WaitMode mode, + cyg_tick_count abs_timeout ) +{ + CYG_REPORT_FUNCTION(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERT( Cyg_Flag::MASK >= mode, "Bad mode" ); + + Cyg_FlagValue result; + + // Prevent preemption so that we compare atomically + Cyg_Scheduler::lock(); + + // try the current value + result = poll( pattern, mode ); + + if ( 0 != result ) { + Cyg_Scheduler::unlock(); + CYG_REPORT_RETVAL( result ); + return result; // all done + } + + // we have to wait until we are awoken + Cyg_Thread *self = Cyg_Thread::self(); + + FlagWaitInfo saveme; + saveme.allmask = (Cyg_Flag::OR & mode) ? 0 : pattern; + saveme.anymask = (Cyg_Flag::OR & mode) ? pattern : 0; + saveme.do_clear = (0 != (Cyg_Flag::CLR & mode)); + + self->set_wait_info( (CYG_ADDRWORD)&saveme ); + + // Set the timer _once_ outside the loop. + self->set_timer( abs_timeout, Cyg_Thread::TIMEOUT ); + + // If the timeout was in the past, it will have changed the value + // of wake_reason, so avoid going into the loop. + if( self->get_wake_reason() != Cyg_Thread::NONE ) + result = false; + else result = true; + + // Result is just being used as an early-out flag now. This loop + // allows us to deal correctly with spurious wakeups. + + while ( result && (0 == saveme.value_out) ) { + self->set_sleep_reason( Cyg_Thread::TIMEOUT ); + self->sleep(); + // keep track of myself on the queue of waiting threads + queue.enqueue( self ); + + CYG_ASSERT( 1 == Cyg_Scheduler::get_sched_lock(), + "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_ASSERT( ((CYG_ADDRWORD)&saveme) == + Cyg_Thread::self()->get_wait_info(), + "Wait info lost" ); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + result = false; + break; + + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + } + + CYG_ASSERT( (false == result) ^ (0 != saveme.value_out), + "Break out but also good result!" ); + + // clear the timer; if it actually fired, no worries. + self->clear_timer(); + + // Unlock scheduler and allow other threads to run + Cyg_Scheduler::unlock(); + // in this version, value_out might be zero meaning timed out. + CYG_REPORT_RETVAL( saveme.value_out ); + return saveme.value_out; +} +#endif // CYGFUN_KERNEL_THREADS_TIMER + +// ------------------------------------------------------------------------- +// Test for a match on our pattern, according to the flags given. +// Return the matching value if success, else zero. +Cyg_FlagValue +Cyg_Flag::poll( Cyg_FlagValue pattern, WaitMode mode ) +{ + CYG_REPORT_FUNCTION(); + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERT( Cyg_Flag::MASK >= mode, "Bad mode" ); + + // Prevent preemption so that we compare atomically + Cyg_Scheduler::lock(); + + Cyg_FlagValue result = 0; + + if ( Cyg_Flag::OR & mode ) { + if ( 0 != (value & pattern) ) + result = value; + } + else { // Cyg_Flag::AND - all must be set + if ( (pattern != 0) && (pattern == (value & pattern)) ) + result = value; + } + + // result != 0 <=> test passed + if ( result && (Cyg_Flag::CLR & mode) ) + value = 0; + + Cyg_Scheduler::unlock(); + + CYG_REPORT_RETVAL( result ); + return result; +} + + +// ------------------------------------------------------------------------- +// EOF flag.cxx diff --git a/packages/kernel/current/src/sync/mbox.cxx b/packages/kernel/current/src/sync/mbox.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sync/mbox.cxx @@ -0,0 +1,159 @@ +//========================================================================== +// +// mbox.cxx +// +// Mbox mbox template class implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): hmt +// Contributors: hmt +// Date: 1998-02-11 +// Purpose: Mbox implementation +// Description: This file contains the implementations of the mbox class +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // Cyg_Thread inlines + +#include // our own header + +#ifndef CYGIMP_MBOXT_INLINE // force inlining +#define CYGIMP_MBOXT_INLINE // of implementation +#endif + +#ifdef CYGIMP_MBOX_USE_MBOXT_PLAIN +#include // mbox template implementation +#else +#include // mbox template implementation +#endif + +// ------------------------------------------------------------------------- +// This module exists to cause exactly one instance of these functions to +// exist; this is just like a vanilla class, except we use the template +// class to acquire an implementation. The template functions are inlined +// in each of these methods. + + +// ------------------------------------------------------------------------- +// Constructor + +Cyg_Mbox::Cyg_Mbox() +{ +} + +// ------------------------------------------------------------------------- +// Destructor + +Cyg_Mbox::~Cyg_Mbox() +{ +} + +// ------------------------------------------------------------------------- +// debugging/assert function + +#ifdef CYGDBG_USE_ASSERTS +cyg_bool +Cyg_Mbox::check_this(cyg_assert_class_zeal zeal) +{ + return m.check_this(zeal); +} +#endif + +// ------------------------------------------------------------------------- +// now the members themselves: + +void * +Cyg_Mbox::get() +{ + void * p; + if ( ! m.get( p ) ) + return NULL; + return p; +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +void * +Cyg_Mbox::get( cyg_tick_count timeout ) +{ + void * p; + if ( ! m.get( p, timeout ) ) + return NULL; + return p; +} +#endif + +void * +Cyg_Mbox::tryget() +{ + void * p; + if ( ! m.tryget( p ) ) + return NULL; + return p; +} + +#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT +cyg_bool +Cyg_Mbox::put( void *item ) +{ + return m.put( item ); +} + +#ifdef CYGFUN_KERNEL_THREADS_TIMER +cyg_bool +Cyg_Mbox::put( void *item, cyg_tick_count timeout ) +{ + return m.put( item, timeout ); +} +#endif +#endif // CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT + +cyg_bool +Cyg_Mbox::tryput( void *item ) +{ + return m.tryput( item ); +} + +void * +Cyg_Mbox::peek_item() // Get next item to be returned +{ + void *p; + if ( ! m.peek_item( p ) ) + return NULL; + return p; +} + +// ------------------------------------------------------------------------- +// EOF mbox.cxx diff --git a/packages/kernel/current/src/sync/mutex.cxx b/packages/kernel/current/src/sync/mutex.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/src/sync/mutex.cxx @@ -0,0 +1,562 @@ +//========================================================================== +// +// sync/mutex.cxx +// +// Mutex and condition variable implementation +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1997-10-21 +// Purpose: Mutex implementation +// Description: This file contains the implementations of the mutex +// and condition variable classes. +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include // base kernel types +#include // tracing macros +#include // assertion macros +#include // instrumentation + +#include // our header + +#include // thread inlines +#include // scheduler inlines +#include // clock inlines + + +// ------------------------------------------------------------------------- +// Constructor + +Cyg_Mutex::Cyg_Mutex() +{ + CYG_REPORT_FUNCTION(); + + locked = false; + owner = NULL; +} + +// ------------------------------------------------------------------------- +// Destructor + +Cyg_Mutex::~Cyg_Mutex() +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( owner == NULL, "Deleting mutex with owner"); + CYG_ASSERT( queue.empty(), "Deleting mutex with waiting threads"); +} + +// ------------------------------------------------------------------------- + +#ifdef CYGDBG_USE_ASSERTS + +bool Cyg_Mutex::check_this( cyg_assert_class_zeal zeal) +{ +// CYG_REPORT_FUNCTION(); + + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + + switch( zeal ) + { + case cyg_system_test: + case cyg_extreme: + case cyg_thorough: + case cyg_quick: + case cyg_trivial: + if( locked && owner == NULL ) return false; + if( !locked && owner != NULL ) return false; + case cyg_none: + default: + break; + }; + + return true; +} + +#endif + +// ------------------------------------------------------------------------- +// Lock and/or wait + +cyg_bool Cyg_Mutex::lock() +{ + CYG_REPORT_FUNCTION(); + + cyg_bool result = true; + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + CYG_INSTRUMENT_MUTEX(LOCK, this, 0); + + // Loop while the mutex is locked, sleeping each time around + // the loop. This copes with the possibility of a higher priority + // thread grabbing the mutex between the wakeup in unlock() and + // this thread actually starting. + + while( locked ) + { + CYG_ASSERT( self != owner, "Locking mutex I already own"); + + self->set_sleep_reason( Cyg_Thread::WAIT ); + + self->sleep(); + + queue.enqueue( self ); + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + + owner->inherit_priority(self); + +#endif + + CYG_INSTRUMENT_MUTEX(WAIT, this, 0); + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, "Called with non-zero scheduler lock"); + + // Unlock scheduler and allow other threads + // to run + Cyg_Scheduler::unlock(); + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::DESTRUCT: + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + + } + + if( result ) + { + locked = true; + owner = self; + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + + self->count_mutex(); + +#endif + + CYG_INSTRUMENT_MUTEX(LOCKED, this, 0); + } + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + return result; +} + +// ------------------------------------------------------------------------- +// Try to lock and return success + +cyg_bool Cyg_Mutex::trylock() +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + cyg_bool result = true; + + // Prevent preemption + Cyg_Scheduler::lock(); + + // If the mutex is not locked, grab it + // for ourself. Otherwise return failure. + if( !locked ) + { + Cyg_Thread *self = Cyg_Thread::self(); + + locked = true; + owner = self; + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + + self->count_mutex(); + +#endif + } + else result = false; + + CYG_INSTRUMENT_MUTEX(TRY, this, result); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + + return result; +} + +// ------------------------------------------------------------------------- +// unlock + +void Cyg_Mutex::unlock() +{ + CYG_REPORT_FUNCTION(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_MUTEX(UNLOCK, this, 0); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERT( locked, "Unlock mutex that is not locked"); + CYG_ASSERT( owner == Cyg_Thread::self(), "Unlock mutex I do not own"); + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + + owner->uncount_mutex(); + owner->disinherit_priority(); + +#endif + + locked = false; + owner = NULL; + + if( !queue.empty() ) { + + // The queue is non-empty, so grab the next + // thread from it and wake it up. + + Cyg_Thread *thread = queue.dequeue(); + + CYG_ASSERTCLASS( thread, "Bad thread pointer"); + + thread->set_wake_reason( Cyg_Thread::DONE ); + + thread->wake(); + + CYG_INSTRUMENT_MUTEX(WAKE, this, thread); + + } + + CYG_ASSERTCLASS( this, "Bad this pointer"); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + +} + +//========================================================================== +// Condition variables + +Cyg_Condition_Variable::Cyg_Condition_Variable( + Cyg_Mutex &mx // linked mutex + ) +{ + CYG_REPORT_FUNCTION(); + + mutex = &mx; + + CYG_ASSERTCLASS( mutex, "Invalid mutex argument"); +} + +// ------------------------------------------------------------------------- +// Destructor + +Cyg_Condition_Variable::~Cyg_Condition_Variable() +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERT( queue.empty(), "Deleting condvar with waiting threads"); +} + +// ------------------------------------------------------------------------- + +#ifdef CYGDBG_USE_ASSERTS + +bool Cyg_Condition_Variable::check_this( cyg_assert_class_zeal zeal) +{ + CYG_REPORT_FUNCTION(); + + // check that we have a non-NULL pointer first + if( this == NULL ) return false; + + switch( zeal ) + { + case cyg_system_test: + case cyg_extreme: + case cyg_thorough: + if( !mutex->check_this(zeal) ) return false; + case cyg_quick: + case cyg_trivial: + case cyg_none: + default: + break; + }; + + return true; +} + +#endif + +// ------------------------------------------------------------------------- +// Wait for condition to be true + +void Cyg_Condition_Variable::wait() +{ + CYG_REPORT_FUNCTION(); + + Cyg_Thread *self = Cyg_Thread::self(); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + CYG_ASSERTCLASS( self, "Bad self thread"); + + CYG_INSTRUMENT_CONDVAR(WAIT, this, 0); + + mutex->unlock(); + + self->set_sleep_reason( Cyg_Thread::WAIT ); + + self->sleep(); + + queue.enqueue( self ); + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, "Called with non-zero scheduler lock"); + + // Unlock the scheduler and switch threads + Cyg_Scheduler::unlock(); + + CYG_INSTRUMENT_CONDVAR(WOKE, this, self->get_wake_reason()); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + + + // When we awake, we must re-acquire the mutex. Note that while + // it is essential to release the mutex and queue on the CV + // atomically relative to other threads, to avoid races, it is not + // necessary for us to re-acquire the mutex in the same atomic + // action. Hence we can do it after unlocking the scheduler. + + mutex->lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + CYG_ASSERT( mutex->owner == self, "Not mutex owner"); +} + +// ------------------------------------------------------------------------- +// Wake one thread + +void Cyg_Condition_Variable::signal() +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CONDVAR(SIGNAL, this, 0); + + if( !queue.empty() ) + { + // The queue is non-empty, so grab the next + // thread from it and wake it up. + + Cyg_Thread *thread = queue.dequeue(); + + CYG_ASSERTCLASS( thread, "Bad thread pointer"); + + thread->set_wake_reason( Cyg_Thread::DONE ); + + thread->wake(); + + CYG_INSTRUMENT_CONDVAR(WAKE, this, thread); + + } + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); + +} + +// ------------------------------------------------------------------------- +// Set cond true, wake all threads + +void Cyg_Condition_Variable::broadcast() +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CONDVAR(BROADCAST, this, 0); + + // Grab all the threads from the queue and let them + // go. + + while( !queue.empty() ) + { + Cyg_Thread *thread = queue.dequeue(); + + CYG_ASSERTCLASS( thread, "Bad thread pointer"); + + thread->set_wake_reason( Cyg_Thread::DONE ); + + thread->wake(); + + CYG_INSTRUMENT_CONDVAR(WAKE, this, thread); + } + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + + // Unlock the scheduler and maybe switch threads + Cyg_Scheduler::unlock(); +} + +// ------------------------------------------------------------------------- +// Optional timed wait on a CV + +#if defined(CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT) && defined(CYGFUN_KERNEL_THREADS_TIMER) + +cyg_bool Cyg_Condition_Variable::wait( cyg_tick_count timeout ) +{ + CYG_REPORT_FUNCTION(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + + cyg_bool result = true; + + Cyg_Thread *self = Cyg_Thread::self(); + + CYG_ASSERTCLASS( self, "Bad self thread"); + + // Prevent preemption + Cyg_Scheduler::lock(); + + CYG_INSTRUMENT_CONDVAR(TIMED_WAIT, this, 0 ); + + mutex->unlock(); + + // The ordering of sleep() and set_timer() here are + // important. If the timeout is in the past, the thread + // will be woken up immediately and will not sleep. + + self->sleep(); + + // Set the timer and sleep reason + self->set_timer( timeout, Cyg_Thread::TIMEOUT ); + + // Only enqueue if the timeout has not already fired. + if( self->get_wake_reason() == Cyg_Thread::NONE ) + queue.enqueue( self ); + + CYG_ASSERT( Cyg_Scheduler::get_sched_lock() == 1, "Called with non-zero scheduler lock"); + + // Unlock the scheduler and switch threads + Cyg_Scheduler::unlock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + + self->clear_timer(); + + CYG_INSTRUMENT_CONDVAR(WOKE, this, self->get_wake_reason()); + + switch( self->get_wake_reason() ) + { + case Cyg_Thread::TIMEOUT: + case Cyg_Thread::DESTRUCT: // which, the cv or the mutex? + case Cyg_Thread::BREAK: + result = false; + break; + + case Cyg_Thread::EXIT: + self->exit(); + break; + + default: + break; + } + + + // When we awake, we must re-acquire the mutex. Note that while + // it is essential to release the mutex and queue on the CV + // atomically relative to other threads, to avoid races, it is not + // necessary for us to re-acquire the mutex in the same atomic + // action. Hence we can do it after unlocking the scheduler. + + mutex->lock(); + + CYG_ASSERTCLASS( this, "Bad this pointer"); + CYG_ASSERTCLASS( mutex, "Corrupt mutex"); + + return result; +} + +#endif + + +// ------------------------------------------------------------------------- +// EOF sync/mutex.cxx diff --git a/packages/kernel/current/tests/PKGconf.mak b/packages/kernel/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/PKGconf.mak @@ -0,0 +1,45 @@ +#=============================================================================== +# +# makefile +# +# kernel/tests +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +PACKAGE := kernel +include ../../../pkgconf/pkgconf.mak + +TESTS := bin_sem0 bin_sem1 bin_sem2 clock0 clock1 cnt_sem0 cnt_sem1 \ + except1 flag0 flag1 intr0\ + kclock0 kclock1 kexcept1 kintr0 kmbox1 kmemfix1 kmemvar1 \ + kmutex0 kmutex1 ksched1 ksem0 ksem1 kcache1 kflag0 kflag1 \ + kthread0 kthread1 mbox1 memfix1 memfix2 memvar1 memvar2\ + mutex0 mutex1 sched1 sync2 sync3 \ + thread0 thread1 thread2 release kill thread_gdb + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst + + + diff --git a/packages/kernel/current/tests/bin_sem0.cxx b/packages/kernel/current/tests/bin_sem0.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/bin_sem0.cxx @@ -0,0 +1,75 @@ +//========================================================================== +// +// bin_sem0.cxx +// +// Binary semaphore test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-24 +// Description: Limited to checking constructors/destructors +//####DESCRIPTIONEND#### + +#include + +#include + +#include + +#include "testaux.hxx" + +static Cyg_Binary_Semaphore sema0, sema1(false), sema2(true); + + +static bool flash( void ) +{ + Cyg_Binary_Semaphore s0; + + Cyg_Binary_Semaphore s1(true); + + Cyg_Binary_Semaphore s2(false); + + return true; +} + +void bin_sem0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + CYG_TEST_PASS_FINISH("Binary Semaphore 0 OK"); +} + +externC void +cyg_start( void ) +{ + bin_sem0_main(); +} +// EOF bin_sem0.cxx diff --git a/packages/kernel/current/tests/bin_sem1.cxx b/packages/kernel/current/tests/bin_sem1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/bin_sem1.cxx @@ -0,0 +1,111 @@ +//========================================================================== +// +// bin_sem1.cxx +// +// Binary semaphore test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-24 +// Description: Tests basic binary semaphore functionality. +//####DESCRIPTIONEND#### + +#include + +#include // Cyg_Scheduler::start() +#include // Cyg_Thread +#include + +#include + +#include + +#include + +#define NTHREADS 2 + +#include "testaux.hxx" + +static Cyg_Binary_Semaphore s0(true), s1(false), s2; + +static volatile cyg_ucount8 q = 0; + +static void entry0( CYG_ADDRWORD data ) +{ + s0.wait(); + CHECK( 0 == q++ ); + s1.post(); + s0.wait(); + CHECK( 2 == q++ ); + CHECK( ! s0.posted() ); + CHECK( ! s0.trywait() ); + s0.post(); + CHECK( 3 == q++ ); + CHECK( s0.posted() ); + s1.post(); + CHECK( ! s2.posted() ); + s2.wait(); + CHECK( 5 == q++ ); + CYG_TEST_PASS_FINISH("Binary Semaphore 1 OK"); +} + +static void entry1( CYG_ADDRWORD data ) +{ + CHECK( s1.posted() ); + s1.wait(); + CHECK( 1 == q++ ); + CHECK( ! s0.posted() ); + s0.post(); + s1.wait(); + CHECK( 4 == q++ ); + CHECK( s0.posted() ); + CHECK( s0.trywait() ); + CHECK( ! s0.posted() ); + s2.post(); + s0.wait(); + CYG_TEST_FAIL_FINISH("Not reached"); +} + +void bin_sem1_main( void ) +{ + CYG_TEST_INIT(); + + new_thread( entry0, 0); + new_thread( entry1, 1); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + bin_sem1_main(); +} +// EOF bin_sem1.cxx diff --git a/packages/kernel/current/tests/bin_sem2.cxx b/packages/kernel/current/tests/bin_sem2.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/bin_sem2.cxx @@ -0,0 +1,215 @@ +//========================================================================== +// +// bin_sem2.cxx +// +// Binary semaphore test 2 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg,dsm +// Contributors: dsm +// Date: 1998-03-10 +// Description: +// Dining philosophers test. Based on philo.cxx +//####DESCRIPTIONEND#### + +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#if defined(CYG_HAL_MIPS_SIM) +// Reduce number of loops in simulated TX39 so that +// it runs within the timeout. +#define PHILO_LOOPS 100 +#else + +#define PHILO_LOOPS 1000 + +#endif + +#define PHILOSOPHERS 15 +#define NTHREADS PHILOSOPHERS +#include "testaux.hxx" + +static Cyg_Binary_Semaphore chopstick[PHILOSOPHERS]; + +static char pstate[PHILOSOPHERS+1]; // state of each philosopher + +static cyg_ucount8 state_changes = 0; +// state_changes keep track of number of changes to pstate so +// we can exit after we've seen enough. + + +static Cyg_Mutex pstate_mutex; +static Cyg_Mutex cycle_mutex; + +static inline int left(cyg_count8 i) +{ + return (0 == i) ? PHILOSOPHERS-1 : i-1 ; +} +static inline int right(cyg_count8 i) +{ + return (PHILOSOPHERS == i+1) ? 0 : i+1 ; +} + +void change_state(int id, char newstate) +{ + if (PHILO_LOOPS == state_changes++) + CYG_TEST_PASS_FINISH("Binary Semaphore 2 OK"); + + + pstate_mutex.lock(); { + pstate[id] = newstate; + bool all_hungry = true; // until proved otherwise + for(cyg_ucount8 i=0; i < PHILOSOPHERS; i++) { + if('E' == pstate[i]) { + CHECK('E' != pstate[left(i)]); + CHECK('E' != pstate[right(i)]); + } + if('H' != pstate[i]) { + all_hungry = false; + } + } + // Theoretically it is possible for all the philosophers to be + // hungry but not waiting on semaphores. But in practice this + // means something is wrong. + CHECK(false == all_hungry); + } pstate_mutex.unlock(); +} + +char get_state(int id) +{ + pstate_mutex.lock(); + + char s = pstate[id]; + + pstate_mutex.unlock(); + + return s; +} + +// ------------------------------------------------------------------------- +// Thread to behave like a philosopher + +void Philosopher( CYG_ADDRESS id ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + Cyg_Binary_Semaphore *first_stick = &chopstick[id]; + Cyg_Binary_Semaphore *second_stick = &chopstick[(id+1)%PHILOSOPHERS]; + + CHECK( id >= 0 && id < PHILOSOPHERS); + + // Deadlock avoidance. The easiest way to make the philosophers + // behave is to make each pick up the lowest numbered stick + // first. This is how it works out anyway for all the philosophers + // except the last, who must have his sticks swapped. + + if( id == PHILOSOPHERS-1 ) + { + Cyg_Binary_Semaphore *t = first_stick; + first_stick = second_stick; + second_stick = t; + } + + + // The following variable is shared by all philosophers. + // It is incremented unprotected, but this does not matter + // since it is only present to introduce a little variability + // into the think and eat times. + + static int cycle = 0; + + for(;;) + { + // Think for a bit + + self->delay((id+cycle++)%12); // Cogito ergo sum... + + // I am now hungry, try to get the chopsticks + change_state(id,'H'); + + // Get the sticks + first_stick->wait(); + second_stick->wait(); + + // Got them, now eat + change_state(id,'E'); + + // Check that the world is as I think it is... + CYG_TEST_CHECK( !first_stick->posted(), + "Not got first stick"); + CYG_TEST_CHECK( !second_stick->posted(), + "Not got second stick"); + CYG_TEST_CHECK( get_state(left(id)) != 'E', + "Left neighbour also eating!!"); + CYG_TEST_CHECK( get_state(right(id)) != 'E', + "Right neighbour also eating!!"); + + self->delay((id+cycle++)%6); // munch munch + + // Finished eating, put down sticks. + + change_state(id,'T'); + + // put sticks back on table + first_stick->post(); + second_stick->post(); + } +} + +// ------------------------------------------------------------------------- + +void bin_sem2_main( void ) +{ + CYG_TEST_INIT(); + + for( int i = 0; i < PHILOSOPHERS; i++ ) + { + pstate[i] = 'T'; // starting state + new_thread(Philosopher, i); + + // make the matching chopstick present + chopstick[i].post(); + } + + Cyg_Scheduler::scheduler.start(); +} + +externC void +cyg_start( void ) +{ + bin_sem2_main(); +} +// EOF bin_sem2.cxx diff --git a/packages/kernel/current/tests/clock0.cxx b/packages/kernel/current/tests/clock0.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/clock0.cxx @@ -0,0 +1,272 @@ +//========================================================================== +// +// clock0.cxx +// +// Clock test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-13 +// Description: Tests some basic clock functions. +// Omissions: Doesn't test likely boundary conditions for +// CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE +// Real Time Clock Testing is limited +// Options: +// CYGIMP_KERNEL_COUNTERS_SINGLE_LIST +// CYGIMP_KERNEL_COUNTERS_MULTI_LIST +// CYGVAR_KERNEL_COUNTERS_CLOCK +// CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE +// Assumptions: This assumes we have long long support and +// that counters are 64 bits. +//####DESCRIPTIONEND#### + +#include + +#include + +#include + +#include + +#include "testaux.hxx" + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK + +cyg_alarm_fn call_me; + +bool flash( void ) +{ + Cyg_Counter counter0 = Cyg_Counter(); + Cyg_Counter counter1 = Cyg_Counter(723); + + CYG_ASSERTCLASSO( counter0, "error" ); + CYG_ASSERTCLASSO( counter1, "error" ); + + Cyg_Alarm alarm0 = Cyg_Alarm(&counter0, call_me, 12); + + CYG_ASSERTCLASSO( alarm0, "error" ); + + Cyg_Clock::cyg_resolution res = {1,2}; + + Cyg_Clock clock0(res); + + CYG_ASSERTCLASSO( clock0, "error" ); + + return true; +} + +// Testing alarms +// +// call_me is a function that will be called when an alarm is +// triggered. It updates a global variable called which is CHECKed +// explicitly to see if the approriate alarms have been called. + +cyg_uint16 called = 0x0; + +void call_me(Cyg_Alarm *alarm, CYG_ADDRWORD data) +{ + called ^= data; +} + +void call_me2(Cyg_Alarm *alarm, CYG_ADDRWORD data) +{ + call_me(alarm, data^0x10); +} + + +void clock0_main(void) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + const cyg_uint32 big_number = 3333222111u; + Cyg_Counter counter0 = Cyg_Counter(); + + CHECK( 0 == counter0.current_value() ); + CHECK( 0 == counter0.current_value_lo() ); + CHECK( 0 == counter0.current_value_hi() ); + + counter0.tick(); + + CHECK( 1 == counter0.current_value() ); + CHECK( 1 == counter0.current_value_lo() ); + CHECK( 0 == counter0.current_value_hi() ); + + counter0.tick(6); + + CHECK( 7 == counter0.current_value() ); + CHECK( 7 == counter0.current_value_lo() ); + CHECK( 0 == counter0.current_value_hi() ); + + counter0.set_value( 0xfffffffc ); + + CHECK( 0xfffffffc == counter0.current_value() ); + CHECK( 0xfffffffc == counter0.current_value_lo() ); + CHECK( 0 == counter0.current_value_hi() ); + + counter0.tick( 0x13 ); // Overflows 32 bits + + CHECK( 0x10000000fULL == counter0.current_value() ); + CHECK( 0xf == counter0.current_value_lo() ); + CHECK( 0x1 == counter0.current_value_hi() ); + + + Cyg_Counter counter1 = Cyg_Counter(big_number); + + CHECK( 0 == counter1.current_value() ); + CHECK( 0 == counter1.current_value_lo() ); + CHECK( 0 == counter1.current_value_hi() ); + + counter1.tick(2); + + CHECK( 2ll*big_number == counter1.current_value() ); + CHECK( ((2ll*big_number) & 0xffffffff) == + counter1.current_value_lo() ); + CHECK( ((2ll*big_number) >> 32) == counter1.current_value_hi() ); + + counter1.tick(); + + CHECK( 3ll*big_number == counter1.current_value() ); + CHECK( ((3ll*big_number) & 0xffffffff) == + counter1.current_value_lo() ); + CHECK( ((3ll*big_number) >> 32) == counter1.current_value_hi() ); + + counter1.tick(); + + CHECK( 4ll*big_number == counter1.current_value() ); + CHECK( ((4ll*big_number) & 0xffffffff) == + counter1.current_value_lo() ); + CHECK( ((4ll*big_number) >> 32) == counter1.current_value_hi() ); + + counter1.set_value(1222333444555ll); + CHECK( 1222333444555ll == counter1.current_value() ); + + counter0.set_value(11); + CHECK( 11 == counter0.current_value() ); + + // the call_me functions cause the "called" bits to toggle + // CHECKing the value of called TEST_CHECKs the parity of # of calls + // made by each alarm. + + Cyg_Alarm alarm0 = Cyg_Alarm(&counter0, call_me, 0x1); + Cyg_Alarm alarm1 = Cyg_Alarm(&counter0, call_me, 0x2); + Cyg_Alarm alarm2 = Cyg_Alarm(&counter0, call_me2, 0x4); + + CHECK( 0x00 == called ); + alarm0.initialize(12,3); + alarm2.initialize(21,2); + CHECK( 0x00 == called ); + + counter0.tick(); // 12 a0 + CHECK( 0x01 == called ); + + alarm1.initialize(13,0); + counter0.tick(); // 13 a1 + CHECK( 0x03 == called ); + + alarm1.initialize(17,0); + counter0.tick(); // 14 + CHECK( 0x03 == called ); + + counter0.tick(); // 15 a0 + CHECK( 0x02 == called ); + + counter0.tick(2); // 17 a1 + CHECK( 0x00 == called ); + + counter0.tick(); // 18 a0 + CHECK( 0x01 == called ); + + counter0.tick(3); // 21 a0 a2 + CHECK( 0x14 == called ); + + counter0.tick(2); // 23 a2 + CHECK( 0x00 == called ); + + alarm2.disable(); + + counter0.tick(2); // 25 a0(24) + CHECK( 0x01 == called ); + + alarm2.enable(); // a2 (enabled at 25) + CHECK( 0x15 == called ); + + counter0.tick(); // 26 + CHECK( 0x15 == called ); + + counter0.tick(2); // 28 a0(27) a2(27) + CHECK( 0x00 == called ); + + counter0.tick(3); // 31 a0(30) a2(29 31) + CHECK( 0x01 == called ); + + Cyg_Clock::cyg_resolution res0; + + res0.dividend = 100; + res0.divisor = 3; + + Cyg_Clock::cyg_resolution res1; + + Cyg_Clock clock0 = Cyg_Clock(res0); + + res1 = clock0.get_resolution(); + CHECK( res0.dividend == res1.dividend ); + CHECK( res0.divisor == res1.divisor ); + + res1.dividend = 12; + res1.divisor = 25; + + clock0.set_resolution(res1); + res0 = clock0.get_resolution(); + CHECK( res0.dividend == res1.dividend ); + CHECK( res0.divisor == res1.divisor ); + + res0 = Cyg_Clock::real_time_clock->get_resolution(); + + CYG_TEST_PASS_FINISH("Clock 0 OK"); +} + +externC void +cyg_start( void ) +{ + clock0_main(); +} + +#else // def CYGVAR_KERNEL_COUNTERS_CLOCK + +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH( "N/A: Kernel real-time clock disabled"); +} + +#endif // def CYGVAR_KERNEL_COUNTERS_CLOCK +// EOF clock0.cxx diff --git a/packages/kernel/current/tests/clock1.cxx b/packages/kernel/current/tests/clock1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/clock1.cxx @@ -0,0 +1,119 @@ +//========================================================================== +// +// clock1.cxx +// +// Clock test 1 - Real Time Clock +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-16 +// Description: Tests the Kernel Real Time Clock +// This test creates a thread, starts the scheduler and +// delays for a time of about 5 seconds. This test should +// be expected to run for about this length of time. +// Omissions: +// Doesn't test alarms attached to RTC. +// Assumptions: +// CYGVAR_KERNEL_COUNTERS_CLOCK must be set. +// Resolution of clock small compared with 5s. +// Overhead small compared with 5s. +// Options: +// CYGIMP_KERNEL_COUNTERS_SINGLE_LIST +// CYGIMP_KERNEL_COUNTERS_MULTI_LIST +// CYGVAR_KERNEL_COUNTERS_CLOCK +// CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE +//####DESCRIPTIONEND#### + +#include + +#include +#include + +#include + +#include +#include + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK + +#if defined(CYG_HAL_MIPS_SIM) +// Reduce time in simulated TX39 so that +// it runs within the timeout. +#define TEST_DELAY 1000000000ll +#else + +#define TEST_DELAY 5000000000ll + +#endif + +#define NTHREADS 1 +#include "testaux.hxx" + +static cyg_uint32 ticks; // Number of ticks thread[0] will delay for + +static void entry0( CYG_ADDRWORD data ) +{ + ((Cyg_Thread *)data)->delay(ticks); + + CYG_TEST_PASS_FINISH("Clock 1 OK"); +} + +void clock1_main( void ) +{ + CYG_TEST_INIT(); + + new_thread(entry0, (CYG_ADDRWORD)&thread_obj[0]); + + Cyg_Clock::cyg_resolution res; + + res = Cyg_Clock::real_time_clock->get_resolution (); + + // RTC takes res.dividend/res.divisor ns/tick + ticks = ((cyg_uint64)TEST_DELAY * res.divisor) / res.dividend; + + Cyg_Scheduler::start(); +} + +externC void +cyg_start( void ) +{ + clock1_main(); +} + +#else // def CYGVAR_KERNEL_COUNTERS_CLOCK + +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH( "N/A: Kernel real-time clock disabled"); +} + +#endif // def CYGVAR_KERNEL_COUNTERS_CLOCK + +// EOF clock1.cxx diff --git a/packages/kernel/current/tests/cnt_sem0.cxx b/packages/kernel/current/tests/cnt_sem0.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/cnt_sem0.cxx @@ -0,0 +1,75 @@ +//========================================================================== +// +// cnt_sem0.cxx +// +// Counting semaphore test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-24 +// Description: Limited to checking constructors/destructors +//####DESCRIPTIONEND#### + +#include + +#include + +#include + +static Cyg_Counting_Semaphore sema0, sema1(0), sema2(1); + +#include "testaux.hxx" + +static bool flash( void ) +{ + Cyg_Counting_Semaphore s0; + + Cyg_Counting_Semaphore s1(97); + + Cyg_Counting_Semaphore s2(0); + + return true; +} + +void cnt_sem0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + CYG_TEST_PASS_FINISH("Counting Semaphore 0 OK"); +} + +externC void +cyg_start( void ) +{ + cnt_sem0_main(); +} + +// EOF cnt_sem0.cxx diff --git a/packages/kernel/current/tests/cnt_sem1.cxx b/packages/kernel/current/tests/cnt_sem1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/cnt_sem1.cxx @@ -0,0 +1,121 @@ +//========================================================================== +// +// cnt_sem1.cxx +// +// Counting semaphore test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-24 +// Description: Tests basic counting semaphore functionality. +//####DESCRIPTIONEND#### + +#include + +#include // Cyg_Thread +#include +#include // Cyg_Scheduler::start() + +#include + +#include + +#include + + +#define NTHREADS 2 +#include "testaux.hxx" + +static Cyg_Counting_Semaphore s0(0), s1(2), s2; + +static volatile cyg_ucount8 q = 0; + +static void entry0( CYG_ADDRWORD data ) +{ + s0.wait(); + CHECK( 1 == q++ ); + s1.post(); + s0.wait(); + CHECK( 3 == q++ ); + CHECK( 0 == s0.peek() ); + CHECK( ! s0.trywait() ); + s0.post(); + CHECK( 4 == q++ ); + CHECK( 1 == s0.peek() ); + s0.post(); + CHECK( 2 == s0.peek() ); + s1.post(); + CHECK( 0 == s2.peek() ); + s2.wait(); + CHECK( 6 == q++ ); + CYG_TEST_PASS_FINISH("Counting Semaphore 1 OK"); +} + +static void entry1( CYG_ADDRWORD data ) +{ + CHECK( 2 == s1.peek() ); + s1.wait(); + CHECK( 1 == s1.peek() ); + s1.wait(); + CHECK( 0 == q++ ); + CHECK( 0 == s0.peek() ); + s0.post(); + s1.wait(); + CHECK( 2 == q++ ); + s0.post(); + s1.wait(); + CHECK( 5 == q++ ); + CHECK( 2 == s0.peek() ); + CHECK( s0.trywait() ); + CHECK( 1 == s0.peek() ); + CHECK( s0.trywait() ); + CHECK( 0 == s0.peek() ); + s2.post(); + s0.wait(); + CYG_TEST_FAIL_FINISH("Not reached"); +} + +void cnt_sem1_main( void ) +{ + CYG_TEST_INIT(); + + new_thread(entry0, 0); + new_thread(entry1, 1); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + cnt_sem1_main(); +} + +// EOF cnt_sem1.cxx diff --git a/packages/kernel/current/tests/except1.cxx b/packages/kernel/current/tests/except1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/except1.cxx @@ -0,0 +1,191 @@ +//================================================================= +// +// except1.cxx +// +// Exception test 1 +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-15 +// Description: Test basic exception functionality +//####DESCRIPTIONEND#### + +#include + +#include + +#ifdef CYGPKG_KERNEL_EXCEPTIONS + +#include // Cyg_Scheduler::start() +#include // Cyg_Thread +#include // cyg_VSR + +#include // exception ranges + +#include +#include + +#define NTHREADS 1 +#include "testaux.hxx" + +static cyg_exception_handler handler0; +static int d0; + +static void handler0(CYG_ADDRWORD data, cyg_code number, CYG_ADDRWORD info) +{ + CYG_TEST_INFO("handler 0 called"); + + CYG_TEST_CHECK((CYG_ADDRWORD)123 == data, "handler given wrong data"); + + // ignore machine specific stuff + CYG_UNUSED_PARAM(cyg_code, number); + CYG_UNUSED_PARAM(CYG_ADDRWORD, info); + + CYG_TEST_PASS_FINISH("Except 1 OK"); +} + +static void handler1(CYG_ADDRWORD data, cyg_code number, CYG_ADDRWORD info) +{ + CYG_TEST_INFO("handler 1 called"); + + CYG_TEST_CHECK((CYG_ADDRWORD)&d0 == data, "handler given wrong data"); + +#ifdef CYGSEM_KERNEL_EXCEPTIONS_DECODE + CYG_TEST_CHECK(number == CYG_EXCEPTION_MAX, "handler given wrong number"); +#else + CYG_UNUSED_PARAM(cyg_code, number); +#endif + + CYG_TEST_CHECK((CYG_ADDRWORD)99 == info, "handler given wrong info"); +} + + +// The following function attempts to cause an exception in various +// hacky ways. It is machine dependent what exception is generated. +// It does reads rather than writes hoping not to corrupt anything +// important. +void cause_exception(void) +{ + int x; + unsigned int p=0; + + do { + x=*(volatile int *)(p-1)/p; + p+=0x100000; + } while(p != 0); +} + +static void entry0( CYG_ADDRWORD data ) +{ + cyg_code n; + cyg_exception_handler *old_handler, *old_handler1; + CYG_ADDRWORD old_data, old_data1; + Cyg_Thread *p=Cyg_Thread::self(); + + CYG_UNUSED_PARAM(CYG_ADDRESS, data); + + p->register_exception( + CYG_EXCEPTION_MAX, + &handler1, + (CYG_ADDRWORD)&d0, + &old_handler, + &old_data); + + p->register_exception( + CYG_EXCEPTION_MAX, + &handler1, + (CYG_ADDRWORD)&d0, + &old_handler1, + &old_data1); + + CYG_TEST_CHECK(old_handler1 == &handler1, + "register exception: old_handler not the one previously registered"); + CYG_TEST_CHECK(old_data1 == (CYG_ADDRWORD)&d0, + "register exception: old_data not those previously registered"); + + p->deliver_exception(CYG_EXCEPTION_MAX, (CYG_ADDRWORD)99); + + CYG_TEST_INFO("handler 1 returned"); + + p->deregister_exception(CYG_EXCEPTION_MAX); + p->deregister_exception(CYG_EXCEPTION_MAX); + + for(n = CYG_EXCEPTION_MIN; n <= CYG_EXCEPTION_MAX; n++) { + p->register_exception( + n, + handler0, + (CYG_ADDRWORD)123, + &old_handler1, + &old_data1); + } + + CYG_TEST_INFO("Attempting to provoke exception"); + + cause_exception(); + + CYG_TEST_FAIL_FINISH("Couldn't cause exception"); +} + +#ifdef CYG_HAL_TX39_JMR3904 + +externC cyg_VSR __default_exception_vsr; +cyg_VSR *old_vsr; + +#endif + +void except0_main( void ) +{ + CYG_TEST_INIT(); + +#ifdef CYG_HAL_TX39_JMR3904 + + HAL_VSR_SET( CYG_VECTOR_LOAD_ADDRESS, __default_exception_vsr, &old_vsr ); + +#endif + + new_thread(entry0, 0); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} +externC void +cyg_start( void ) +{ + except0_main(); +} +#else // def CYGPKG_KERNEL_EXCEPTIONS +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("NA: Exceptions disabled"); +} +#endif // def CYGPKG_KERNEL_EXCEPTIONS + +// EOF except1.cxx diff --git a/packages/kernel/current/tests/flag0.cxx b/packages/kernel/current/tests/flag0.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/flag0.cxx @@ -0,0 +1,74 @@ +//========================================================================== +// +// flag0.cxx +// +// Flag test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-05-11 +// Description: Limited to checking constructors/destructors +//####DESCRIPTIONEND#### + +#include + +#include + +#include + +#include "testaux.hxx" + +static Cyg_Flag f0, f1; + + +static bool flash( void ) +{ + Cyg_Flag f0; + + Cyg_Flag f1; + + return true; +} + +void flag0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + CYG_TEST_PASS_FINISH("Flag 0 OK"); + +} + +externC void +cyg_start( void ) +{ + flag0_main(); +} +// EOF flag0.cxx diff --git a/packages/kernel/current/tests/flag1.cxx b/packages/kernel/current/tests/flag1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/flag1.cxx @@ -0,0 +1,202 @@ +//========================================================================== +// +// flag1.cxx +// +// Flag test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author: dsm +// Contributors: dsm +// Date: 1998-05-11 +// Description: Tests basic flag functionality. +//####DESCRIPTIONEND#### + +#include + +#include // Cyg_Thread +#include +#include // Cyg_Scheduler::start() + +#include + +#include + +#include + + +#define NTHREADS 3 +#include "testaux.hxx" + +static Cyg_Flag f0, f1; +#ifdef CYGFUN_KERNEL_THREADS_TIMER +static Cyg_Flag f2; +#endif + +static volatile cyg_atomic q = 0; + +static void entry0( CYG_ADDRWORD data ) +{ + CYG_TEST_INFO("Testing setbits() and maskbits()"); + CYG_TEST_CHECK(0==f0.peek(), "flag not initialized properly"); + f0.setbits(0x1); + CYG_TEST_CHECK(1==f0.peek(), "setbits"); + f0.setbits(0x3); + CYG_TEST_CHECK(3==f0.peek(), "setbits"); + f0.maskbits(~0x5); + CYG_TEST_CHECK(2==f0.peek(), "maskbits"); + f0.setbits(); + CYG_TEST_CHECK(~0u==f0.peek(), "setbits no arg"); + f0.maskbits(); + CYG_TEST_CHECK(0==f0.peek(), "maskbits no arg"); + CYG_TEST_CHECK(0==q++, "bad synchronization"); + + CYG_TEST_INFO("Testing wait()"); + f1.setbits(0x4); + CYG_TEST_CHECK(0x4==f1.peek(), "maskbits no arg"); + CYG_TEST_CHECK(1==q++, "bad synchronization"); + f1.setbits(0x18); // wake t1 + f1.wait(0x11, Cyg_Flag::AND | Cyg_Flag::CLR); + CYG_TEST_CHECK(0==f1.peek(), "flag value wrong"); + CYG_TEST_CHECK(3==q++, "bad synchronization"); + f0.setbits(0x2); // wake t1 + f1.wait(0x10, Cyg_Flag::AND ); + f0.setbits(0x1); // wake t1 + + f1.wait(0x11, Cyg_Flag::AND | Cyg_Flag::CLR); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + f2.wait(0x2, Cyg_Flag::OR); + CYG_TEST_CHECK(20==q,"bad synchronization"); + f2.wait(0x10, Cyg_Flag::AND, + Cyg_Clock::real_time_clock->current_value()+20); + CYG_TEST_CHECK(21==q++,"bad synchronization"); +#endif + f0.wait(1, Cyg_Flag::OR); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +static void entry1( CYG_ADDRWORD data ) +{ + f1.wait(0xc, Cyg_Flag::AND); + CYG_TEST_CHECK(2==q++, "bad synchronization"); + CYG_TEST_CHECK(0x1c==f1.peek(), "flag value wrong"); + f1.setbits(0x1); // wake t0 + f0.wait(0x3, Cyg_Flag::OR); + CYG_TEST_CHECK(4==q++, "bad synchronization"); + CYG_TEST_CHECK(2==f0.peek(), "flag value wrong"); + + f1.setbits(0xf0); // wake t0,t2 + f0.wait(0x5, Cyg_Flag::AND | Cyg_Flag::CLR); // wait for t0 & t2 + CYG_TEST_CHECK(0==f0.peek(), "flag value wrong"); + CYG_TEST_CHECK(0xf0==f1.peek(), "flag value wrong"); + CYG_TEST_CHECK(5==q++, "bad synchronization"); + f1.maskbits(); + CYG_TEST_CHECK(0==f1.peek(), "flag value wrong"); + + CYG_TEST_INFO("Testing poll()"); + f0.setbits(0x55); + CYG_TEST_CHECK(0x55==f0.peek(), "flag value wrong"); + CYG_TEST_CHECK(0x55==f0.poll(0x3, Cyg_Flag::OR),"bad poll() return"); + CYG_TEST_CHECK(0==f0.poll(0xf, Cyg_Flag::AND),"poll()"); + CYG_TEST_CHECK(0==f0.poll(0xa, Cyg_Flag::OR),"poll()"); + CYG_TEST_CHECK(0x55==f0.peek(), "flag value wrong"); + CYG_TEST_CHECK(0x55==f0.poll(0xf, Cyg_Flag::OR | Cyg_Flag::CLR),"poll"); + CYG_TEST_CHECK(0x0==f0.peek(), "flag value wrong"); + f0.setbits(0x50); + CYG_TEST_CHECK(0x50==f0.poll(0x10, Cyg_Flag::AND | Cyg_Flag::CLR),"poll"); + CYG_TEST_CHECK(0x0==f0.peek(), "flag value wrong"); + + CYG_TEST_INFO("Testing waiting()"); + f0.maskbits(); + CYG_TEST_CHECK(!f0.waiting(), "waiting()"); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + thread[1]->delay(10); // allow other threads to reach wait on f1 + CYG_TEST_CHECK(f1.waiting(), "waiting() not true"); + f1.setbits(); // wake one of t0,t2 + CYG_TEST_CHECK(f1.waiting(), "waiting() not true"); +#else + f1.setbits(0x11); // wake one of t0,t2 +#endif + f1.setbits(0x11); // wake other of t0,t2 + CYG_TEST_CHECK(!f1.waiting(), "waiting not false"); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + CYG_TEST_INFO("Testing wait() with timeout"); + q=20; + f2.setbits(0x2); // synchronize with t0,t2 + CYG_TEST_CHECK(20==q,"bad synchronization"); + f2.wait(0x20, Cyg_Flag::AND, + Cyg_Clock::real_time_clock->current_value()+10); + CYG_TEST_CHECK(22==q++,"bad synchronization"); +#endif + + CYG_TEST_PASS_FINISH("Flag 1 OK"); +} + +static void entry2( CYG_ADDRWORD data ) +{ + f1.wait(0x60, Cyg_Flag::OR); + f0.setbits(0x4); + + f1.wait(0x11, Cyg_Flag::AND | Cyg_Flag::CLR); +#ifdef CYGFUN_KERNEL_THREADS_TIMER + f2.wait(0x2, Cyg_Flag::OR); + CYG_TEST_CHECK(20==q,"bad synchronization"); + CYG_TEST_CHECK(0==f2.wait(0x40, Cyg_Flag::AND, + Cyg_Clock::real_time_clock->current_value()+5), + "timed wait() wrong"); + CYG_TEST_CHECK(20==q++,"bad synchronization"); + // Now wake t0 before it times out + f2.setbits(0x10); +#endif + f0.wait(1, Cyg_Flag::OR); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +void flag1_main( void ) +{ + CYG_TEST_INIT(); + + new_thread(entry0, 0); + new_thread(entry1, 1); + new_thread(entry2, 2); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + flag1_main(); +} + +// EOF flag1.cxx diff --git a/packages/kernel/current/tests/intr0.cxx b/packages/kernel/current/tests/intr0.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/intr0.cxx @@ -0,0 +1,162 @@ +//================================================================= +// +// intr0.cxx +// +// Interrupt test 0 +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-15 +// Description: Very basic test of interrupt objects +// Options: +// CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE +// CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE +// CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST +//####DESCRIPTIONEND#### + +#include + +#include +#include + +#include + +#include "testaux.hxx" + +static cyg_ISR isr0, isr1; +static cyg_DSR dsr0, dsr1; + +static cyg_uint32 isr0(cyg_vector vector, CYG_ADDRWORD data) +{ + CYG_UNUSED_PARAM(CYG_ADDRWORD, data); + + Cyg_Interrupt::acknowledge_interrupt(vector); + return 0; +} + +static void dsr0(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data) +{ + CYG_UNUSED_PARAM(cyg_vector, vector); + CYG_UNUSED_PARAM(cyg_ucount32, count); + CYG_UNUSED_PARAM(CYG_ADDRWORD, data); +} + +static cyg_uint32 isr1(cyg_vector vector, CYG_ADDRWORD data) +{ + CYG_UNUSED_PARAM(cyg_vector, vector); + CYG_UNUSED_PARAM(CYG_ADDRWORD, data); + return 0; +} + +static void dsr1(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data) +{ + CYG_UNUSED_PARAM(cyg_vector, vector); + CYG_UNUSED_PARAM(cyg_ucount32, count); + CYG_UNUSED_PARAM(CYG_ADDRWORD, data); +} + +static bool flash( void ) +{ + Cyg_Interrupt intr0 = Cyg_Interrupt( 0, 0, (CYG_ADDRWORD)333, isr0, dsr0 ); + + return true; +} + +static cyg_VSR vsr0; + +static void vsr0() +{ +} + +void intr0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + Cyg_Interrupt intr0 = + Cyg_Interrupt( 1 % (CYG_ISR_COUNT), 1, (CYG_ADDRWORD)777, isr0, dsr0 ); + + Cyg_Interrupt intr1 = + Cyg_Interrupt( 15 % (CYG_ISR_COUNT), 1, 888, isr1, dsr1 ); + + + // Check these functions at least exist + + Cyg_Interrupt::enable_interrupts(); + Cyg_Interrupt::disable_interrupts(); + + intr0.attach(); + intr1.attach(); + intr0.detach(); + intr1.detach(); + + // If this attaching interrupt replaces the previous interrupt + // instead of adding to it we could be in a big mess if the + // vector is being used by something important. + + cyg_vector v = 11 % CYG_VSR_COUNT; + cyg_VSR *old_vsr, *new_vsr; + Cyg_Interrupt::set_vsr( v, vsr0, &old_vsr ); + Cyg_Interrupt::get_vsr( v, &new_vsr ); + CHECK( vsr0 == new_vsr ); + + new_vsr = NULL; + Cyg_Interrupt::set_vsr( v, old_vsr, &new_vsr ); + CHECK( new_vsr == vsr0 ); + + Cyg_Interrupt::set_vsr( v, new_vsr ); + new_vsr = NULL; + Cyg_Interrupt::get_vsr( v, &new_vsr ); + CHECK( vsr0 == new_vsr ); + + Cyg_Interrupt::set_vsr( v, old_vsr ); + CHECK( vsr0 == new_vsr ); + new_vsr = NULL; + Cyg_Interrupt::get_vsr( v, &new_vsr ); + CHECK( old_vsr == new_vsr ); + + CHECK( NULL != vsr0 ); + + cyg_vector v1 = 6 % CYG_ISR_COUNT; + + Cyg_Interrupt::mask_interrupt(v1); + Cyg_Interrupt::unmask_interrupt(v1); + + Cyg_Interrupt::configure_interrupt(v1, true, true); + + CYG_TEST_PASS_FINISH("Intr 0 OK"); +} + +externC void +cyg_start( void ) +{ + intr0_main(); +} +// EOF intr0.cxx diff --git a/packages/kernel/current/tests/kcache1.c b/packages/kernel/current/tests/kcache1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kcache1.c @@ -0,0 +1,206 @@ +/*================================================================= +// +// kcache1.c +// +// Cache timing test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm, nickg +// Date: 1998-06-18 +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK +#ifdef CYGFUN_KERNEL_API_C + +#include +#include + +// ------------------------------------------------------------------------- +// If the HAL does not supply this, we supply our own version + +#ifndef HAL_DCACHE_PURGE_ALL + +static cyg_uint8 dca[HAL_DCACHE_SIZE + HAL_DCACHE_LINE_SIZE*2]; + +#define HAL_DCACHE_PURGE_ALL() \ +CYG_MACRO_START \ + volatile cyg_uint8 *addr = &dca[HAL_DCACHE_LINE_SIZE]; \ + volatile cyg_uint8 tmp = 0; \ + int i; \ + for( i = 0; i < HAL_DCACHE_SIZE; i += HAL_DCACHE_LINE_SIZE ) \ + { \ + tmp = addr[i]; \ + } \ +CYG_MACRO_END + +#endif + +// ------------------------------------------------------------------------- + +#define NTHREADS 1 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + +#define MAXSIZE 1<<18 + +volatile char m[MAXSIZE]; + +// ------------------------------------------------------------------------- + +static void time0(register cyg_uint32 stride) +{ + register cyg_uint32 j,k; + cyg_tick_count_t count0, count1; + cyg_ucount32 t; + register char c; + + count0 = cyg_current_time(); + + for(k=0; k<4000;k++) { + for(j=0; j<(HAL_DCACHE_SIZE/HAL_DCACHE_LINE_SIZE); j++) { + c=m[stride*j]; + } + } + + count1 = cyg_current_time(); + t = count1 - count0; + diag_printf("stride=%d, time=%d\n", stride, t); +} + +// ------------------------------------------------------------------------- + +void time1(void) +{ + cyg_uint32 i; + + for(i=1; i<65; i+=i) { + time0(i); + } +} + +// ------------------------------------------------------------------------- +// This test could be improved by counting number of passes possible +// in a given number of ticks. + +static void entry0( cyg_addrword_t data ) +{ + HAL_DCACHE_PURGE_ALL(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + CYG_TEST_INFO("Dcache off Icache off"); + time1(); + + HAL_DCACHE_PURGE_ALL(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_ENABLE(); + CYG_TEST_INFO("Dcache on Icache off"); + time1(); + + HAL_DCACHE_PURGE_ALL(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_ENABLE(); + HAL_DCACHE_DISABLE(); + CYG_TEST_INFO("Dcache off Icache on"); + time1(); + + HAL_DCACHE_PURGE_ALL(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_ENABLE(); + HAL_DCACHE_ENABLE(); + CYG_TEST_INFO("Dcache on Icache on"); + time1(); + + + HAL_DCACHE_PURGE_ALL(); + HAL_ICACHE_INVALIDATE_ALL(); + HAL_DCACHE_INVALIDATE_ALL(); + HAL_ICACHE_DISABLE(); + HAL_DCACHE_DISABLE(); + CYG_TEST_INFO("Dcache off Icache off"); + time1(); + + + CYG_TEST_PASS_FINISH("End of test"); +} + +// ------------------------------------------------------------------------- + +void kcache2_main( void ) +{ + CYG_TEST_INIT(); + + cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "kcache1", + (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_scheduler_start(); +} + +// ------------------------------------------------------------------------- + +externC void +cyg_start( void ) +{ + kcache2_main(); +} + +// ------------------------------------------------------------------------- + +#else // def CYGFUN_KERNEL_API_C +#define N_A_MSG "Kernel C API layer disabled" +#endif // def CYGFUN_KERNEL_API_C +#else // def CYGVAR_KERNEL_COUNTERS_CLOCK +#define N_A_MSG "Kernel real-time clock disabled" +#endif // def CYGVAR_KERNEL_COUNTERS_CLOCK + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("N/A: " N_A_MSG); +} +#endif // N_A_MSG + +// ------------------------------------------------------------------------- +/* EOF kcache1.c */ diff --git a/packages/kernel/current/tests/kclock0.c b/packages/kernel/current/tests/kclock0.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kclock0.c @@ -0,0 +1,263 @@ +/*================================================================= +// +// kclock0.c +// +// Kernel C API Clock test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-20 +// Description: Tests some basic clock functions. +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +cyg_alarm_t call_me; + +cyg_counter counter0o, counter1o; +cyg_handle_t counter0, counter1; + +cyg_alarm alarmo[3]; +cyg_handle_t alarm0, alarm1, alarm2; + +cyg_resolution_t res, res0, res1; + +cyg_clock clock0o; +cyg_handle_t clock0; + +const cyg_uint32 big_number = 3333222111u; + +cyg_bool_t flash( void ) +{ + cyg_counter_create( &counter0, &counter0o ); + cyg_counter_create( &counter1, &counter1o ); + + cyg_alarm_create( counter0, + call_me, + (cyg_addrword_t)12, + &alarm0, + &alarmo[0]); + + res.dividend = 1; + res.divisor = 2; + + cyg_clock_create( res, &clock0, &clock0o ); + cyg_clock_delete( clock0 ); + + cyg_alarm_delete( alarm0 ); + + cyg_counter_delete( counter0 ); + cyg_counter_delete( counter1 ); + + return true; +} + +/* Testing alarms +// +// call_me is a function that will be called when an alarm is +// triggered. It updates a global variable called which is CHECKed +// explicitly to see if the approriate alarms have been called. +*/ + +cyg_uint16 called = 0x0; + +void call_me(cyg_handle_t alarm, cyg_addrword_t data) +{ + called ^= (int)data; +} + +void call_me2(cyg_handle_t alarm, cyg_addrword_t data) +{ + call_me(alarm, (cyg_addrword_t)((int)data^0x10)); +} + + +void kclock0_main(void) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + cyg_counter_create( &counter0, &counter0o); + + CHECK( 0 == cyg_counter_current_value( counter0 ) ); + + cyg_counter_tick(counter0); + + CHECK( 1 == cyg_counter_current_value(counter0) ); + + cyg_counter_tick(counter0); + + CHECK( 2 == cyg_counter_current_value(counter0) ); + + cyg_counter_set_value( counter0, 0xffffffff ); + + CHECK( 0xffffffff == cyg_counter_current_value(counter0) ); + + cyg_counter_tick(counter0); // Overflows 32 bits + + CHECK( 0x100000000ULL == cyg_counter_current_value(counter0) ); + + cyg_counter_set_value(counter0, 11); + CHECK( 11 == cyg_counter_current_value(counter0) ); + + /* the call_me functions cause the "called" bits to toggle + // checking the value of called checks the parity of # of calls + // made by each alarm. + */ + + cyg_alarm_create(counter0, + call_me, (cyg_addrword_t)0x1, &alarm0, &alarmo[0]); + cyg_alarm_create(counter0, + call_me, (cyg_addrword_t)0x2, &alarm1, &alarmo[1]); + cyg_alarm_create(counter0, + call_me2, (cyg_addrword_t)0x4, &alarm2, &alarmo[2]); + + CHECK( 0x00 == called ); + cyg_alarm_initialize(alarm0, 12,3); + cyg_alarm_initialize(alarm2, 21,2); + CHECK( 0x00 == called ); + + cyg_counter_tick(counter0); /* 12 a0 */ + CHECK( 0x01 == called ); + + cyg_alarm_initialize(alarm1, 13,0); + cyg_counter_tick(counter0); /* 13 a1 */ + CHECK( 0x03 == called ); + + cyg_alarm_initialize(alarm1, 17,0); + cyg_counter_tick(counter0); /* 14 */ + CHECK( 0x03 == called ); + + cyg_counter_tick(counter0); /* 15 a0 */ + CHECK( 0x02 == called ); + + cyg_counter_tick(counter0); /* 16 */ + cyg_counter_tick(counter0); /* 17 a1 */ + CHECK( 0x00 == called ); + + cyg_counter_tick(counter0); /* 18 a0 */ + CHECK( 0x01 == called ); + + cyg_counter_tick(counter0); /* 19 */ + cyg_counter_tick(counter0); /* 20 */ + cyg_counter_tick(counter0); /* 21 a0 a2 */ + CHECK( 0x14 == called ); + + cyg_counter_tick(counter0); /* 22 */ + cyg_counter_tick(counter0); /* 23 a2 */ + CHECK( 0x00 == called ); + + cyg_alarm_disable(alarm2); + + cyg_counter_tick(counter0); /* 24 a0 */ + cyg_counter_tick(counter0); /* 25 */ + CHECK( 0x01 == called ); + + cyg_alarm_enable(alarm2); /* a2 (enabled at 25) */ + CHECK( 0x15 == called ); + + cyg_counter_tick(counter0); /* 26 */ + CHECK( 0x15 == called ); + + cyg_counter_tick(counter0); /* 27 a0 a2 */ + cyg_counter_tick(counter0); /* 28 */ + CHECK( 0x00 == called ); + + cyg_counter_tick(counter0); /* 29 a2 */ + cyg_counter_tick(counter0); /* 30 a0 */ + cyg_counter_tick(counter0); /* 31 a2 */ + CHECK( 0x01 == called ); + + res0.dividend = 100; + res0.divisor = 3; + + cyg_clock_create( res0, &clock0, &clock0o ); + + res1 = cyg_clock_get_resolution(clock0); + CHECK( res0.dividend == res1.dividend ); + CHECK( res0.divisor == res1.divisor ); + + res1.dividend = 12; + res1.divisor = 25; + + cyg_clock_set_resolution(clock0, res1); + res0 = cyg_clock_get_resolution(clock0); + CHECK( res0.dividend == res1.dividend ); + CHECK( res0.divisor == res1.divisor ); + + cyg_clock_to_counter(clock0, &counter1); + + CHECK( 0 == cyg_counter_current_value( counter1 ) ); + CHECK( 0 == cyg_current_time() ); + + cyg_counter_tick(counter1); + + CHECK( 1 == cyg_counter_current_value(counter1) ); + + res0 = cyg_clock_get_resolution(cyg_real_time_clock()); + + /* Current time should be 0 as interrupts will still be disabled */ + CHECK( 0 == cyg_current_time() ); + + CYG_TEST_PASS_FINISH("Kernel C API Clock 0 OK"); +} + +externC void +cyg_start( void ) +{ + kclock0_main(); +} + +#else // def CYGFUN_KERNEL_API_C +#define N_A_MSG "Kernel C API layer disabled" +#endif // def CYGFUN_KERNEL_API_C +#else // def CYGVAR_KERNEL_COUNTERS_CLOCK +#define N_A_MSG "Kernel real-time clock disabled" +#endif // def CYGVAR_KERNEL_COUNTERS_CLOCK + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("N/A: " N_A_MSG); +} +#endif // N_A_MSG + +// EOF kclock0.c diff --git a/packages/kernel/current/tests/kclock1.c b/packages/kernel/current/tests/kclock1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kclock1.c @@ -0,0 +1,145 @@ +/*================================================================= +// +// kclock1.c +// +// Kernel C API Clock test 1 - Real Time Clock +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-20 +// Description: Tests the Kernel Real Time Clock +// This test creates a thread, starts the scheduler and +// delays for a time of about 5 seconds. This test should +// be expected to run for about this length of time. +// Omissions: +// Doesn't test alarms attached to RTC. +// Assumptions: +// CYGVAR_KERNEL_COUNTERS_CLOCK must be set. +// Resolution of clock small compared with 5s. +// Overhead small compared with 5s. +// Options: +// CYGIMP_KERNEL_COUNTERS_SINGLE_LIST +// CYGIMP_KERNEL_COUNTERS_MULTI_LIST +// CYGVAR_KERNEL_COUNTERS_CLOCK +// CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#if defined(CYG_HAL_MIPS_SIM) + +// Reduce time in simulated TX39 so that +// it runs within the timeout. + +#define TEST_DELAY 1000000000ll + +#else + +#define TEST_DELAY 5000000000ll + +#endif + +#if defined(CYGVAR_KERNEL_COUNTERS_CLOCK) \ + && defined(CYGFUN_KERNEL_THREADS_TIMER) + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +#define NTHREADS 1 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + +static void entry0( cyg_addrword_t data ) +{ + cyg_resolution_t res; + cyg_uint32 ticks; + cyg_tick_count_t count0, count1; + cyg_handle_t rtclock, rtcounter; + + rtclock = cyg_real_time_clock(); + cyg_clock_to_counter(rtclock, &rtcounter); + + res = cyg_clock_get_resolution (rtclock); + + /* RTC takes res.dividend/res.divisor ns/tick */ + ticks = ((cyg_uint64)TEST_DELAY * res.divisor) / res.dividend; + + count0 = cyg_counter_current_value(rtcounter); + cyg_thread_delay(ticks); + count1 = cyg_counter_current_value(rtcounter); + + CYG_TEST_CHECK(count0+ticks <= count1, + "real time clock's counter not counting"); + + CYG_TEST_CHECK(count1 <= cyg_current_time(),"cyg_current_time()"); + + CYG_TEST_PASS_FINISH("Kernel C API Clock 1 OK"); +} + +void kclock1_main( void ) +{ + CYG_TEST_INIT(); + + cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "kclock1", + (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_scheduler_start(); +} + +externC void +cyg_start( void ) +{ + kclock1_main(); +} + +#else // def CYGFUN_KERNEL_API_C +#define N_A_MSG "Kernel C API layer disabled" +#endif // def CYGFUN_KERNEL_API_C +#else // def CYGVAR_KERNEL_COUNTERS_CLOCK && CYGFUN_KERNEL_THREADS_TIMER +#define N_A_MSG "Kernel real-time clock/threads timer disabled" +#endif // def CYGVAR_KERNEL_COUNTERS_CLOCK && CYGFUN_KERNEL_THREADS_TIMER + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("N/A: " N_A_MSG); +} +#endif // N_A_MSG + +// EOF kclock1.c diff --git a/packages/kernel/current/tests/kexcept1.c b/packages/kernel/current/tests/kexcept1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kexcept1.c @@ -0,0 +1,207 @@ +/*================================================================= +// +// kexcept1.cxx +// +// Kernel C API Exception test 1 +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-15 +// Description: Test basic exception functionality +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGPKG_KERNEL_EXCEPTIONS + +#ifdef CYGFUN_KERNEL_API_C + +#include // exception ranges + +#include "testaux.h" + +#define NTHREADS 1 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + + +static cyg_exception_handler_t handler0; +static int d0; + +static void handler0(cyg_addrword_t data, cyg_code_t number, cyg_addrword_t info) +{ + CYG_TEST_INFO("handler 0 called"); + + CYG_TEST_CHECK((cyg_addrword_t)123 == data, "handler given wrong data"); + + // ignore machine specific stuff + CYG_UNUSED_PARAM(cyg_code_t, number); + CYG_UNUSED_PARAM(cyg_addrword_t, info); + + CYG_TEST_PASS_FINISH("Except 1 OK"); +} + +static void handler1(cyg_addrword_t data, cyg_code_t number, cyg_addrword_t info) +{ + CYG_TEST_INFO("handler 1 called"); + + CYG_TEST_CHECK((cyg_addrword_t)&d0 == data, "handler given wrong data"); + +#ifdef CYGSEM_KERNEL_EXCEPTIONS_DECODE + CYG_TEST_CHECK(number == CYG_EXCEPTION_MAX, "handler given wrong number"); +#else + CYG_UNUSED_PARAM(cyg_code_t, number); +#endif + + CYG_TEST_CHECK((cyg_addrword_t)99 == info, "handler given wrong info"); +} + + +// The following function attempts to cause an exception in various +// hacky ways. It is machine dependent what exception is generated. +// It does reads rather than writes hoping not to corrupt anything +// important. +void cause_exception(void) +{ + int x; + unsigned int p=0; + + do { + x=*(volatile int *)(p-1)/p; + p+=0x100000; + } while(p != 0); +} + +static void entry0( CYG_ADDRWORD data ) +{ + cyg_code_t n; + cyg_exception_handler_t *old_handler, *old_handler1; + cyg_addrword_t old_data, old_data1; + + CYG_UNUSED_PARAM(CYG_ADDRESS, data); + + cyg_exception_set_handler( + CYG_EXCEPTION_MAX, + &handler1, + (cyg_addrword_t)&d0, + &old_handler, + &old_data); + + cyg_exception_set_handler( + CYG_EXCEPTION_MAX, + &handler1, + (cyg_addrword_t)&d0, + &old_handler1, + &old_data1); + + CYG_TEST_CHECK(old_handler1 == &handler1, + "register exception: old_handler not the one previously registered"); + CYG_TEST_CHECK(old_data1 == (cyg_addrword_t)&d0, + "register exception: old_data not those previously registered"); + + cyg_exception_call_handler( + cyg_thread_self(), + CYG_EXCEPTION_MAX, + (cyg_addrword_t)99); + + CYG_TEST_INFO("handler 1 returned"); + + cyg_exception_clear_handler(CYG_EXCEPTION_MAX); + cyg_exception_clear_handler(CYG_EXCEPTION_MAX); + + for(n = CYG_EXCEPTION_MIN; n <= CYG_EXCEPTION_MAX; n++) { + cyg_exception_set_handler( + n, + handler0, + (cyg_addrword_t)123, + &old_handler1, + &old_data1); + } + + CYG_TEST_INFO("Attempting to provoke exception"); + + cause_exception(); + + CYG_TEST_FAIL_FINISH("Couldn't cause exception"); +} + +#ifdef CYG_HAL_TX39_JMR3904 + +extern void __default_exception_vsr(void); + +#endif + +void except0_main( void ) +{ + CYG_TEST_INIT(); + +#ifdef CYG_HAL_TX39_JMR3904 + + cyg_interrupt_set_vsr( CYG_VECTOR_LOAD_ADDRESS, __default_exception_vsr ); + +#endif + + cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "kexcept1", + (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + except0_main(); +} + +#else // def CYGFUN_KERNEL_API_C +#define N_A_MSG "Kernel C API layer disabled" +#endif // def CYGFUN_KERNEL_API_C +#else // def CYGPKG_KERNEL_EXCEPTIONS +#define N_A_MSG "Exceptions disabled" +#endif // def CYGPKG_KERNEL_EXCEPTIONS + +#ifdef N_A_MSG +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH( "N/A: " N_A_MSG); +} +#endif // N_A_MSG + +/* EOF kexcept1.c */ diff --git a/packages/kernel/current/tests/kflag0.c b/packages/kernel/current/tests/kflag0.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kflag0.c @@ -0,0 +1,88 @@ +/*========================================================================== +// +// kflag0.cxx +// +// Kernel C API Flag test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: hmt +// Date: 1998-10-19 +// Description: Limited to checking constructors/destructors +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +cyg_flag_t f0, f1, f2; + +static bool flash( void ) +{ + cyg_flag_init( &f0 ); + cyg_flag_init( &f1 ); + cyg_flag_init( &f2 ); + + cyg_flag_destroy( &f0 ); + cyg_flag_destroy( &f1 ); + cyg_flag_destroy( &f2 ); + + return true; +} + +void kflag0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + CYG_TEST_PASS_FINISH("Kernel C API Flag 0 OK"); + +} + +externC void +cyg_start( void ) +{ + kflag0_main(); +} + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +// EOF kflag0.cxx diff --git a/packages/kernel/current/tests/kflag1.c b/packages/kernel/current/tests/kflag1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kflag1.c @@ -0,0 +1,228 @@ +/*========================================================================== +// +// kflag1.cxx +// +// Kernel C API Flag test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author: dsm +// Contributors: hmt +// Date: 1998-10-19 +// Description: Tests basic flag functionality. +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + + +#define NTHREADS 3 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + +static cyg_flag_t f0, f1; +#ifdef CYGFUN_KERNEL_THREADS_TIMER +static cyg_flag_t f2; +#endif + +static volatile cyg_ucount8 q = 0; + +static void entry0( cyg_addrword_t data ) +{ + CYG_TEST_INFO("Testing cyg_flag_setbits() and cyg_flag_maskbits()"); + CYG_TEST_CHECK(0==cyg_flag_peek( &f0 ), "flag not initialized properly"); + cyg_flag_setbits( &f0, 0x1); + CYG_TEST_CHECK(1==cyg_flag_peek( &f0 ), "setbits"); + cyg_flag_setbits( &f0, 0x3); + CYG_TEST_CHECK(3==cyg_flag_peek( &f0 ), "setbits"); + cyg_flag_maskbits( &f0, ~0x5); + CYG_TEST_CHECK(2==cyg_flag_peek( &f0 ), "maskbits"); + cyg_flag_setbits( &f0, ~0 ); + CYG_TEST_CHECK(~0u==cyg_flag_peek( &f0 ), "setbits all set"); + cyg_flag_maskbits( &f0, 0 ); + CYG_TEST_CHECK(0==cyg_flag_peek( &f0 ), "maskbits all clear"); + CYG_TEST_CHECK(0==q++, "bad synchronization"); + + CYG_TEST_INFO("Testing cyg_flag_wait()"); + cyg_flag_setbits( &f1, 0x4); + CYG_TEST_CHECK(0x4==cyg_flag_peek( &f1 ), "setbits"); + CYG_TEST_CHECK(1==q++, "bad synchronization"); + cyg_flag_setbits( &f1, 0x18); // wake t1 + cyg_flag_wait( &f1, 0x11, CYG_FLAG_WAITMODE_AND | CYG_FLAG_WAITMODE_CLR); + CYG_TEST_CHECK(0==cyg_flag_peek( &f1 ), "flag value wrong"); + CYG_TEST_CHECK(3==q++, "bad synchronization"); + cyg_flag_setbits( &f0, 0x2); // wake t1 + cyg_flag_wait( &f1, 0x10, CYG_FLAG_WAITMODE_AND ); + cyg_flag_setbits( &f0, 0x1); // wake t1 + + cyg_flag_wait( &f1, 0x11, CYG_FLAG_WAITMODE_AND | CYG_FLAG_WAITMODE_CLR); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_flag_wait( &f2, 0x2, CYG_FLAG_WAITMODE_OR); + CYG_TEST_CHECK(20==q,"bad synchronization"); + cyg_flag_timed_wait( &f2, 0x10, CYG_FLAG_WAITMODE_AND, + cyg_current_time()+20); + CYG_TEST_CHECK(21==q++,"bad synchronization"); +#endif + cyg_flag_wait( &f0, 1, CYG_FLAG_WAITMODE_OR); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +static void entry1( cyg_addrword_t data ) +{ + cyg_flag_wait( &f1, 0xc, CYG_FLAG_WAITMODE_AND); + CYG_TEST_CHECK(2==q++, "bad synchronization"); + CYG_TEST_CHECK(0x1c==cyg_flag_peek( &f1 ), "flag value wrong"); + cyg_flag_setbits( &f1, 0x1); // wake t0 + cyg_flag_wait( &f0, 0x3, CYG_FLAG_WAITMODE_OR); + CYG_TEST_CHECK(4==q++, "bad synchronization"); + CYG_TEST_CHECK(2==cyg_flag_peek( &f0 ), "flag value wrong"); + + cyg_flag_setbits( &f1, 0xf0); // wake t0,t2 + cyg_flag_wait( &f0, 0x5, CYG_FLAG_WAITMODE_AND | CYG_FLAG_WAITMODE_CLR); + CYG_TEST_CHECK(0==cyg_flag_peek( &f0 ), "flag value wrong"); + CYG_TEST_CHECK(0xf0==cyg_flag_peek( &f1 ), "flag value wrong"); + CYG_TEST_CHECK(5==q++, "bad synchronization"); + cyg_flag_maskbits( &f1, 0 ); + CYG_TEST_CHECK(0==cyg_flag_peek( &f1 ), "flag value wrong"); + + CYG_TEST_INFO("Testing cyg_flag_poll()"); + cyg_flag_setbits( &f0, 0x55); + CYG_TEST_CHECK(0x55==cyg_flag_peek( &f0 ), "flag value wrong"); + CYG_TEST_CHECK(0x55==cyg_flag_poll( &f0, 0x3, CYG_FLAG_WAITMODE_OR),"bad poll() return"); + CYG_TEST_CHECK(0==cyg_flag_poll( &f0, 0xf, CYG_FLAG_WAITMODE_AND),"poll()"); + CYG_TEST_CHECK(0==cyg_flag_poll( &f0, 0xa, CYG_FLAG_WAITMODE_OR),"poll()"); + CYG_TEST_CHECK(0x55==cyg_flag_peek( &f0 ), "flag value wrong"); + CYG_TEST_CHECK(0x55==cyg_flag_poll( &f0, 0xf, CYG_FLAG_WAITMODE_OR | CYG_FLAG_WAITMODE_CLR),"poll"); + CYG_TEST_CHECK(0x0==cyg_flag_peek( &f0 ), "flag value wrong"); + cyg_flag_setbits( &f0, 0x50); + CYG_TEST_CHECK(0x50==cyg_flag_poll( &f0, 0x10, CYG_FLAG_WAITMODE_AND | CYG_FLAG_WAITMODE_CLR),"poll"); + CYG_TEST_CHECK(0x0==cyg_flag_peek( &f0 ), "flag value wrong"); + + CYG_TEST_INFO("Testing cyg_flag_waiting()"); + cyg_flag_maskbits( &f0, 0 ); + CYG_TEST_CHECK(!cyg_flag_waiting( &f0 ), "waiting()"); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_thread_delay( 10 ); // allow other threads to reach wait on f1 + CYG_TEST_CHECK(cyg_flag_waiting( &f1 ), "waiting() not true"); + cyg_flag_setbits( &f1, ~0 ); // wake one of t0,t2 + CYG_TEST_CHECK(cyg_flag_waiting( &f1 ),"waiting() not true"); +#else + cyg_flag_setbits( &f1, 0x11); // wake one of t0,t2 +#endif + cyg_flag_setbits( &f1, 0x11); // wake other of t0,t2 + CYG_TEST_CHECK(!cyg_flag_waiting( &f1 ),"waiting not false"); + CYG_TEST_CHECK(0x0==cyg_flag_peek( &f1 ), "flag value wrong"); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + CYG_TEST_INFO("Testing cyg_flag_timed_wait()"); + q=20; + cyg_flag_setbits( &f2, 0x2); // synchronize with t0,t2 + CYG_TEST_CHECK(20==q,"bad synchronization"); + cyg_flag_timed_wait( &f2, 0x20, CYG_FLAG_WAITMODE_AND, + cyg_current_time()+10); + CYG_TEST_CHECK(22==q++,"bad synchronization"); +#endif + + CYG_TEST_PASS_FINISH("Kernel C API Flag 1 OK"); +} + +static void entry2( cyg_addrword_t data ) +{ + cyg_flag_wait( &f1, 0x60, CYG_FLAG_WAITMODE_OR); + cyg_flag_setbits( &f0, 0x4); + + cyg_flag_wait( &f1, 0x11, CYG_FLAG_WAITMODE_AND | CYG_FLAG_WAITMODE_CLR); +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_flag_wait( &f2, 0x2, CYG_FLAG_WAITMODE_OR); + CYG_TEST_CHECK(20==q,"bad synchronization"); + CYG_TEST_CHECK(0==cyg_flag_timed_wait( &f2, 0x40, CYG_FLAG_WAITMODE_AND, + cyg_current_time()+2), + "timed wait() wrong"); + CYG_TEST_CHECK(20==q++,"bad synchronization"); + // Now wake t0 before it times out + cyg_flag_setbits( &f2, 0x10); +#endif + cyg_flag_wait( &f0, 1, CYG_FLAG_WAITMODE_OR); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +void kflag1_main( void ) +{ + CYG_TEST_INIT(); + + cyg_flag_init( &f0 ); + cyg_flag_init( &f1 ); +#ifdef CYGFUN_KERNEL_THREADS_TIMER + cyg_flag_init( &f2 ); +#endif + + cyg_thread_create( 1, entry0 , (cyg_addrword_t)0, "kflag1-0", + (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_thread_create( 1, entry1 , (cyg_addrword_t)1, "kflag1-1", + (void *)stack[1], STACKSIZE, &thread[1], &thread_obj[1]); + cyg_thread_resume(thread[1]); + + cyg_thread_create( 1, entry2 , (cyg_addrword_t)2, "kflag1-2", + (void *)stack[2], STACKSIZE, &thread[2], &thread_obj[2]); + cyg_thread_resume(thread[2]); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + kflag1_main(); +} + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +// EOF flag1.cxx diff --git a/packages/kernel/current/tests/kill.cxx b/packages/kernel/current/tests/kill.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kill.cxx @@ -0,0 +1,162 @@ +//========================================================================== +// +// kill.cxx +// +// Thread kill test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-04-24 +// Description: Tests the functionality of thread kill() and +// reinitalize(). +//####DESCRIPTIONEND#### + +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#define NTHREADS 3 + +#include "testaux.hxx" + +static Cyg_Binary_Semaphore s0, s1; + +volatile cyg_atomic thread0_state; +volatile cyg_atomic thread1_state; +volatile cyg_atomic thread2_state; + +static void entry0( CYG_ADDRWORD data ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + + thread0_state = 1; + + s0.wait(); + + thread0_state = 2; + + CYG_TEST_FAIL_FINISH("Thread not killed"); + + self->exit(); +} + + +static void entry1( CYG_ADDRWORD data ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + + thread1_state = 1; + + self->delay(1); + + if( thread2_state != 1 ) + CYG_TEST_FAIL_FINISH("Thread2 in wrong state"); + + thread1_state = 2; + + thread[0]->kill(); + + thread1_state = 3; + + thread[2]->kill(); + + thread1_state = 4; + + self->delay(1); + + thread1_state = 5; + thread2_state = 0; + + thread[2]->reinitialize(); + thread[2]->resume(); + + self->delay(1); + + if( thread2_state != 1 ) + CYG_TEST_FAIL_FINISH("Thread2 in wrong state"); + + thread1_state = 6; + + self->delay(1); + + if( thread2_state != 2 ) + CYG_TEST_FAIL_FINISH("Thread2 in wrong state"); + + thread[2]->kill(); + + thread1_state = 7; + + CYG_TEST_PASS_FINISH("Kill OK"); + + Cyg_Thread::self()->exit(); +} + +static void entry2( CYG_ADDRWORD data ) +{ + thread2_state = 1; + + while( thread1_state != 6 ) continue; + + thread2_state = 2; + + for(;;) continue; + +} + +void release_main(void) +{ + CYG_TEST_INIT(); + + new_thread( entry0, 0); + new_thread( entry1, 1); + new_thread( entry2, 2); + + thread[0]->set_priority(5); + thread[1]->set_priority(6); + thread[2]->set_priority(7); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + release_main(); +} + +// EOF kill.cxx diff --git a/packages/kernel/current/tests/kintr0.c b/packages/kernel/current/tests/kintr0.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kintr0.c @@ -0,0 +1,184 @@ +/*================================================================= +// +// kintr0.c +// +// Kernel C API Intr test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-15 +// Description: Very basic test of interrupt objects +// Options: +// CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE +// CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE_MAX +// CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST +//####DESCRIPTIONEND#### +*/ + +#include +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +static cyg_interrupt intr_obj[2]; + +static cyg_handle_t intr0, intr1; + + +static cyg_ISR_t isr0, isr1; +static cyg_DSR_t dsr0, dsr1; + +static cyg_uint32 isr0(cyg_vector_t vector, cyg_addrword_t data) +{ + CYG_UNUSED_PARAM(cyg_addrword_t, data); + + cyg_interrupt_acknowledge(vector); + return 0; +} + +static void dsr0(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + CYG_UNUSED_PARAM(cyg_vector_t, vector); + CYG_UNUSED_PARAM(cyg_ucount32, count); + CYG_UNUSED_PARAM(cyg_addrword_t, data); +} + +static cyg_uint32 isr1(cyg_vector_t vector, cyg_addrword_t data) +{ + CYG_UNUSED_PARAM(cyg_vector_t, vector); + CYG_UNUSED_PARAM(cyg_addrword_t, data); + return 0; +} + +static void dsr1(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + CYG_UNUSED_PARAM(cyg_vector_t, vector); + CYG_UNUSED_PARAM(cyg_ucount32, count); + CYG_UNUSED_PARAM(cyg_addrword_t, data); +} + +static bool flash( void ) +{ + cyg_handle_t handle; + cyg_interrupt intr; + + cyg_interrupt_create(0, 0, (cyg_addrword_t)333, isr0, dsr0, &handle, &intr ); + cyg_interrupt_delete(handle); + + return true; +} + +static cyg_VSR_t vsr0; + +static void vsr0() +{ +} + +void kintr0_main( void ) +{ + cyg_vector_t v = 11 % CYG_VSR_COUNT; + cyg_vector_t v1 = 6 % CYG_ISR_COUNT; + cyg_VSR_t *old_vsr, *new_vsr; + + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + cyg_interrupt_create(1 % (CYG_ISR_COUNT), 1, (cyg_addrword_t)777, + isr0, dsr0, &intr0, &intr_obj[0]); + + cyg_interrupt_create(15 % (CYG_ISR_COUNT), 1, 888, + isr1, dsr1, &intr1, &intr_obj[1]); + + + // Check these functions at least exist + + cyg_interrupt_enable(); + cyg_interrupt_disable(); + + cyg_interrupt_attach(intr0); + cyg_interrupt_attach(intr1); + cyg_interrupt_detach(intr0); + cyg_interrupt_detach(intr1); + + // If this attaching interrupt replaces the previous interrupt + // instead of adding to it we could be in a big mess if the + // vector is being used by something important. + + cyg_interrupt_get_vsr( v, &old_vsr ); + cyg_interrupt_set_vsr( v, vsr0 ); + cyg_interrupt_get_vsr( v, &new_vsr ); + CHECK( vsr0 == new_vsr ); + + new_vsr = NULL; + cyg_interrupt_get_vsr( v, &new_vsr ); + cyg_interrupt_set_vsr( v, old_vsr ); + CHECK( new_vsr == vsr0 ); + + cyg_interrupt_set_vsr( v, new_vsr ); + new_vsr = NULL; + cyg_interrupt_get_vsr( v, &new_vsr ); + CHECK( vsr0 == new_vsr ); + + cyg_interrupt_set_vsr( v, old_vsr ); + CHECK( vsr0 == new_vsr ); + new_vsr = NULL; + cyg_interrupt_get_vsr( v, &new_vsr ); + CHECK( old_vsr == new_vsr ); + + CHECK( NULL != vsr0 ); + + cyg_interrupt_mask(v1); + cyg_interrupt_unmask(v1); + + cyg_interrupt_configure(v1, true, true); + + CYG_TEST_PASS_FINISH("Kernel C API Intr 0 OK"); +} + +externC void +cyg_start( void ) +{ + kintr0_main(); +} + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF kintr0.c */ diff --git a/packages/kernel/current/tests/kmbox1.c b/packages/kernel/current/tests/kmbox1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kmbox1.c @@ -0,0 +1,204 @@ +/*========================================================================== +// +// kmbox1.cxx +// +// Kernel Mbox test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author: dsm +// Contributors: dsm +// Date: 1998-06-02 +// Description: Tests basic mbox functionality. +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +#define NTHREADS 2 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + +static cyg_handle_t m0, m1, m2; +static cyg_mbox mbox0, mbox1, mbox2; + +static cyg_atomic q = 0; + +#ifndef CYGMTH_MBOX_PUT_CAN_WAIT +#define cyg_mbox_PUT cyg_mbox_tryput +#endif + +static void entry0( cyg_addrword_t data ) +{ + cyg_count8 u,i,j; + + CYG_TEST_INFO("Testing put() and tryput() without wakeup"); + CYG_TEST_CHECK(!cyg_mbox_waiting_to_get(m0), "mbox not initialized properly"); + CYG_TEST_CHECK(0==cyg_mbox_peek(m0), "mbox not initialized properly"); + CYG_TEST_CHECK(NULL==cyg_mbox_peek_item(m0), "mbox not initialized properly"); + cyg_mbox_PUT(m0, (void *)55); + CYG_TEST_CHECK(1==cyg_mbox_peek(m0), "peek() wrong"); + CYG_TEST_CHECK(55==(cyg_count8)cyg_mbox_peek_item(m0), "peek_item() wrong"); + for(u=1; cyg_mbox_tryput(m0, (void*)u); u++) { + CYG_TEST_CHECK(55==(cyg_count8)cyg_mbox_peek_item(m0), "peek_item() wrong"); + CYG_TEST_CHECK(u+1==cyg_mbox_peek(m0), "peek() wrong"); + } + CYG_TEST_CHECK(u == CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE, "mbox not configured size"); + + // m0 now contains ( 55 1 2 .. u-1 ) + CYG_TEST_CHECK(u==cyg_mbox_peek(m0), "peek() wrong"); + CYG_TEST_CHECK(55==(cyg_count8)cyg_mbox_peek_item(m0), "peek_item() wrong"); + + CYG_TEST_INFO("Testing get(), tryget()"); + + i = (cyg_count8)cyg_mbox_tryget(m0); + CYG_TEST_CHECK( 55 == i, "Got wrong message" ); + for(j=1; jdelay(4); // allow t0 to reach put on m1 + CYG_TEST_CHECK(14==q++, "bad synchronization"); + CYG_TEST_CHECK(cyg_mbox_waiting_to_put(m0), "waiting_to_put()"); + do { + // after first get m0 contains ( 6 .. 6 9 ) + i=(cyg_count8)cyg_mbox_tryget(m0); + } while(6==i); + CYG_TEST_CHECK(9==i,"put gone awry"); +#endif +#endif + CYG_TEST_PASS_FINISH("Kernel C API Mbox 1 OK"); +} + +void kmbox1_main( void ) +{ + CYG_TEST_INIT(); + + cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "kmbox1-0", + (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_thread_create(4, entry1 , (cyg_addrword_t)1, "kmbox1-1", + (void *)stack[1], STACKSIZE, &thread[1], &thread_obj[1]); + cyg_thread_resume(thread[1]); + + cyg_mbox_create( &m0, &mbox0 ); + cyg_mbox_create( &m1, &mbox1 ); + cyg_mbox_create( &m2, &mbox2 ); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + kmbox1_main(); +} +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF kmbox1.c */ diff --git a/packages/kernel/current/tests/kmemfix1.c b/packages/kernel/current/tests/kmemfix1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kmemfix1.c @@ -0,0 +1,187 @@ +/*========================================================================== +// +// kmemfix1.cxx +// +// Kernel C API Fixed memory pool test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-09 +// Description: Tests basic fixed memory pool functionality +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +#define NTHREADS 2 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + + +#define MEMSIZE 10240 + +static cyg_uint8 mem[2][MEMSIZE]; + +static cyg_mempool_fix mempool_obj[2]; +static cyg_handle_t mempool0, mempool1; + +static void check_in_mp0(cyg_uint8 *p, cyg_int32 size) +{ + CYG_TEST_CHECK(NULL != p, + "Allocation failed"); + CYG_TEST_CHECK(mem[0] <= p && p+size < mem[1], + "Block outside memory pool"); +} + +static void entry0( cyg_addrword_t data ) +{ + cyg_uint8 *p0, *p1, *p2; + cyg_mempool_info info0, info1, info2; + + cyg_mempool_fix_get_info(mempool0, &info0); + CYG_TEST_CHECK(mem[0] == info0.base, "get_arena: base wrong"); + CYG_TEST_CHECK(MEMSIZE == info0.size, "get_arena: size wrong"); + + CYG_TEST_CHECK(0 < info0.maxfree && info0.maxfree <= info0.size, + "get_arena: maxfree wildly wrong"); + + CYG_TEST_CHECK(100 == info0.blocksize, "get_blocksize wrong" ); + + CYG_TEST_CHECK(info0.totalmem > 0, "Negative total memory" ); + CYG_TEST_CHECK(info0.freemem > 0, "Negative free memory" ); + CYG_TEST_CHECK(info0.totalmem <= MEMSIZE, + "info.totalsize: Too much memory"); + CYG_TEST_CHECK(info0.freemem <= info0.totalmem , + "More memory free than possible" ); + + CYG_TEST_CHECK( !cyg_mempool_fix_waiting(mempool0) , + "Thread waiting for memory; there shouldn't be"); + + p0 = cyg_mempool_fix_alloc(mempool0); + check_in_mp0(p0, 100); + + cyg_mempool_fix_get_info(mempool0, &info1); + CYG_TEST_CHECK(info1.freemem > 0, "Negative free memory" ); + CYG_TEST_CHECK(info1.freemem < info0.freemem, + "Free memory didn't decrease after allocation" ); + + p1 = NULL; + while((p2 = cyg_mempool_fix_try_alloc(mempool0) )) + p1 = p2; + + cyg_mempool_fix_get_info(mempool0, &info1); + cyg_mempool_fix_free(mempool0, p0); + + cyg_mempool_fix_get_info(mempool0, &info2); + CYG_TEST_CHECK(info2.freemem > info1.freemem, + "Free memory didn't increase after free" ); + + // should be able to reallocate now a block is free + p0 = cyg_mempool_fix_try_alloc(mempool0); + check_in_mp0(p0, 100); + + CYG_TEST_CHECK(p1+100 <= p0 || p1 >= p0+100, + "Ranges of allocated memory overlap"); + + cyg_mempool_fix_free(mempool0, p0); + cyg_mempool_fix_free(mempool0, p1); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + // This shouldn't have to wait + p0 = cyg_mempool_fix_timed_alloc(mempool0, cyg_current_time()+100000); + check_in_mp0(p0, 100); + p1 = cyg_mempool_fix_timed_alloc(mempool0, cyg_current_time()+2); + check_in_mp0(p1, 10); + p1 = cyg_mempool_fix_timed_alloc(mempool0, cyg_current_time()+2); + CYG_TEST_CHECK(NULL == p1, "Timed alloc unexpectedly worked"); + + // Expect thread 1 to have run while processing previous timed + // allocation. It should therefore tbe waiting. + CYG_TEST_CHECK(cyg_mempool_fix_waiting(mempool1), + "There should be a thread waiting"); +#endif + + CYG_TEST_PASS_FINISH("Kernal C API Fixed memory pool 1 OK"); +} + +static void entry1( cyg_addrword_t data ) +{ + while(NULL != cyg_mempool_fix_alloc(mempool1)) + ; + CYG_TEST_FAIL("alloc returned NULL"); +} + + +void kmemfix1_main( void ) +{ + CYG_TEST_INIT(); + + cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "kmemfix1-0", + (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_thread_create(4, entry1 , (cyg_addrword_t)1, "kmemfix1-1", + (void *)stack[1], STACKSIZE, &thread[1], &thread_obj[1]); + cyg_thread_resume(thread[1]); + + cyg_mempool_fix_create(mem[0], MEMSIZE, 100, &mempool0, &mempool_obj[0]); + cyg_mempool_fix_create(mem[1], MEMSIZE, 316, &mempool1, &mempool_obj[1]); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + kmemfix1_main(); +} + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF kmemfix1.c */ diff --git a/packages/kernel/current/tests/kmemvar1.c b/packages/kernel/current/tests/kmemvar1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kmemvar1.c @@ -0,0 +1,195 @@ +/*========================================================================== +// +// kmemvar1.cxx +// +// Kernel C API Variable memory pool test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-08 +// Description: Tests basic variable memory pool functionality +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +#define NTHREADS 2 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + + +#define MEMSIZE 10240 + +static cyg_uint8 mem[2][MEMSIZE]; + +static cyg_mempool_var mempool_obj[2]; +static cyg_handle_t mempool0, mempool1; + +static void check_in_mp0(cyg_uint8 *p, cyg_int32 size) +{ + CYG_TEST_CHECK(NULL != p, + "Allocation failed"); + CYG_TEST_CHECK(mem[0] <= p && p+size < mem[1], + "Block outside memory pool"); +} + +static void entry0( cyg_addrword_t data ) +{ + cyg_uint8 *p0, *p1; + cyg_int32 most_of_mem=MEMSIZE/4*3; + cyg_mempool_info info0, info1, info2; + + cyg_mempool_var_get_info(mempool0, &info0); + + CYG_TEST_CHECK(mem[0] == info0.base, "get_arena: base wrong"); + CYG_TEST_CHECK(MEMSIZE == info0.size, "get_arena: size wrong"); + + CYG_TEST_CHECK(0 < info0.maxfree && info0.maxfree <= info0.size, + "get_arena: maxfree wildly wrong"); + + CYG_TEST_CHECK(-1 == info0.blocksize, "get_blocksize wrong" ); + + CYG_TEST_CHECK(info0.totalmem > 0, "Negative total memory" ); + CYG_TEST_CHECK(info0.freemem > 0, "Negative free memory" ); + CYG_TEST_CHECK(info0.totalmem <= MEMSIZE, + "info.totalsize: Too much memory"); + CYG_TEST_CHECK(info0.freemem <= info0.totalmem , + "More memory free than possible" ); + + CYG_TEST_CHECK( !cyg_mempool_var_waiting(mempool0), + "Thread waiting for memory; there shouldn't be"); + + CYG_TEST_CHECK( NULL == cyg_mempool_var_try_alloc(mempool0, MEMSIZE+1), + "Managed to allocate too much memory"); + + p0 = cyg_mempool_var_alloc(mempool0, most_of_mem); + check_in_mp0(p0, most_of_mem); + + cyg_mempool_var_get_info(mempool0, &info1); + + CYG_TEST_CHECK(info1.freemem > 0, "Negative free memory" ); + CYG_TEST_CHECK(info1.freemem < info0.freemem, + "Free memory didn't decrease after allocation" ); + + CYG_TEST_CHECK( NULL == cyg_mempool_var_try_alloc(mempool0, most_of_mem), + "Managed to allocate too much memory"); + + cyg_mempool_var_free(mempool0, p0); + + cyg_mempool_var_get_info(mempool0, &info2); + CYG_TEST_CHECK(info2.freemem > info1.freemem, + "Free memory didn't increase after free" ); + + // should be able to reallocate now memory is free + p0 = cyg_mempool_var_try_alloc(mempool0, most_of_mem); + check_in_mp0(p0, most_of_mem); + + p1 = cyg_mempool_var_try_alloc(mempool0, 10); + check_in_mp0(p1, 10); + + CYG_TEST_CHECK(p1+10 <= p0 || p1 >= p0+MEMSIZE, + "Ranges of allocated memory overlap"); + + cyg_mempool_var_free(mempool0, p0); + cyg_mempool_var_free(mempool0, p1); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + // This shouldn't have to wait + p0 = cyg_mempool_var_timed_alloc(mempool0, most_of_mem, + cyg_current_time()+100000); + check_in_mp0(p0, most_of_mem); + p1 = cyg_mempool_var_timed_alloc(mempool0, most_of_mem, + cyg_current_time()+2); + CYG_TEST_CHECK(NULL == p1, "Timed alloc unexpectedly worked"); + p1 = cyg_mempool_var_timed_alloc(mempool0, 10, + cyg_current_time()+2); + check_in_mp0(p1, 10); + + // Expect thread 1 to have run while processing previous timed + // allocation. It should therefore tbe waiting. + CYG_TEST_CHECK(cyg_mempool_var_waiting(mempool1), "There should be a thread waiting"); +#endif + + CYG_TEST_PASS_FINISH("Kernel C API Variable memory pool 1 OK"); +} + +static void entry1( cyg_addrword_t data ) +{ + cyg_mempool_var_alloc(mempool1, MEMSIZE+1); + CYG_TEST_FAIL("Oversized alloc returned"); +} + + +void kmemvar1_main( void ) +{ + CYG_TEST_INIT(); + + cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "kmemvar1-0", + (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_thread_create(4, entry1 , (cyg_addrword_t)1, "kmemvar1-1", + (void *)stack[1], STACKSIZE, &thread[1], &thread_obj[1]); + cyg_thread_resume(thread[1]); + + cyg_mempool_var_create(mem[0], MEMSIZE, &mempool0, &mempool_obj[0]); + cyg_mempool_var_create(mem[1], MEMSIZE, &mempool1, &mempool_obj[1]); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + kmemvar1_main(); +} + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF kmemvar1.c */ diff --git a/packages/kernel/current/tests/kmutex0.c b/packages/kernel/current/tests/kmutex0.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kmutex0.c @@ -0,0 +1,87 @@ +/*================================================================= +// +// kmutex0.c +// +// Kernel C API Mutex and condition variable test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-23 +// Description: Limited to checking constructors/destructors +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +static cyg_mutex_t mutex0; + +static cyg_cond_t cvar0; + +static bool flash( void ) +{ + cyg_mutex_init( &mutex0 ); + cyg_cond_init( &cvar0, &mutex0 ); + + cyg_cond_destroy( &cvar0 ); + cyg_mutex_destroy( &mutex0 ); + + return true; +} + +void kmutex0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + CYG_TEST_PASS_FINISH("Kernel C API Mutex 0 OK"); +} + +externC void +cyg_start( void ) +{ + kmutex0_main(); +} + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF kmutex0.c */ diff --git a/packages/kernel/current/tests/kmutex1.c b/packages/kernel/current/tests/kmutex1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kmutex1.c @@ -0,0 +1,175 @@ +/*================================================================= +// +// kmutex1.c +// +// Kernel C API Mutex test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-23 +// Description: Tests basic mutex functionality. +// Omissions: Timed wait. +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +#define NTHREADS 3 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + + +static cyg_mutex_t m0, m1; +static cyg_cond_t cvar0, cvar1, cvar2; + +static cyg_ucount8 m0d=0, m1d=0; + +static void finish( cyg_ucount8 t ) +{ + cyg_mutex_lock( &m1 ); { + m1d |= 1< + +#include +#include + +// ------------------------------------------------------------------------- +// Data for the philosophers problem + +#define PHILOSOPHERS 15 // number of philosophers +#define STACKSIZE (2*1024) // size of thread stack + +// array of stacks for philosopher threads +char thread_stack[PHILOSOPHERS][STACKSIZE]; + +// array of threads. +cyg_thread thread[PHILOSOPHERS]; + +cyg_handle_t thread_handle[PHILOSOPHERS]; + +// array of chopsticks +cyg_sem_t chopstick[PHILOSOPHERS]; + +cyg_ucount32 data_index; + +// ------------------------------------------------------------------------- +// State recording and display + +static char pstate[PHILOSOPHERS+1]; // state vector showing what each + // philosopher is doing + +cyg_mutex_t state_mutex; + +#ifdef CYG_HAL_MN10300_MN103002 +static cyg_count8 eaters = 0; +#endif + +void change_state(int id, char newstate) +{ + cyg_mutex_lock(&state_mutex); + +#ifdef CYG_HAL_MN10300_MN103002 + if( pstate[id] == 'E' ) eaters--; + if( newstate == 'E' ) eaters++; +// led(eaters); +#endif + + pstate[id] = newstate; + + diag_write_string(pstate); +#if 0 + diag_write_char(' '); + diag_write_dec(Cyg_Scheduler::get_thread_switches()); +#endif + diag_write_char('\n'); + + cyg_mutex_unlock(&state_mutex); + +} + +char get_state( int id) +{ + char s; + cyg_mutex_lock(&state_mutex); + + s = pstate[id]; + + cyg_mutex_unlock(&state_mutex); + + return s; +} + +// ------------------------------------------------------------------------- +// Thread to behave like a philosopher + +void Philosopher( cyg_addrword_t vid ) +{ + cyg_uint32 id = (cyg_uint32)vid; + cyg_sem_t *first_stick = &chopstick[id]; + cyg_sem_t *second_stick = &chopstick[(id+1)%PHILOSOPHERS]; +#ifdef CYGPKG_INFRA_DEBUG + int left_philo = ((id==0)?PHILOSOPHERS:id)-1; + int right_philo = (id==PHILOSOPHERS-1)?0:(id+1); +#endif + + CYG_ASSERT( id >= 0 && id < PHILOSOPHERS, "Bad id"); + + // Deadlock avoidance. The easiest way to make the philosophers + // behave is to make each pick up the lowest numbered stick + // first. This is how it works out anyway for all the philosophers + // except the last, who must have his sticks swapped. + + if( id == PHILOSOPHERS-1 ) + { + cyg_sem_t *t = first_stick; + first_stick = second_stick; + second_stick = t; + } + + for(;;) + { + cyg_ucount32 val; + + // The following variable is shared by all philosophers. + // It is incremented unprotected, but this does not matter + // since it is only present to introduce a little variability + // into the think and eat times. + + static volatile int cycle = 0; + + // Think for a bit + + cyg_thread_delay((id+cycle++)%12); // Cogito ergo sum... + + // I am now hungry, try to get the chopsticks + + change_state(id,'H'); + + // Get the first stick + cyg_semaphore_wait(first_stick); + + // Get the second stick + cyg_semaphore_wait(second_stick); + + // Got them, now eat + + change_state(id,'E'); + + // Check that the world is as I think it is... + cyg_semaphore_peek( first_stick, &val); + CYG_ASSERT( val == 0, "Not got first stick"); + cyg_semaphore_peek( second_stick, &val); + CYG_ASSERT( val == 0, "Not got second stick"); + CYG_ASSERT( get_state(left_philo) != 'E', "Left neighbour also eating!!"); + CYG_ASSERT( get_state(right_philo) != 'E', "Right neighbour also eating!!"); + + cyg_thread_delay((id+cycle++)%6); // munch munch + + // Finished eating, put down sticks. + + change_state(id,'T'); + + cyg_semaphore_post( first_stick ); + cyg_semaphore_post( second_stick ); + + } +} + +// ------------------------------------------------------------------------- + +externC void +cyg_start( void ) +{ + int i; + + diag_init(); + + diag_write_string("Philosophers\n"); + diag_write_string("Started\n"); + + // Zero last element in state so it acts like + // a string. + pstate[PHILOSOPHERS] = 0; + +#if 1 + for( i = 0; i < PHILOSOPHERS; i++ ) + { + change_state(i,'T'); // starting state + + cyg_thread_create(4, Philosopher, (cyg_addrword_t)i, "philosopher", + (void *)(&thread_stack[i]), STACKSIZE, + &thread_handle[i], &thread[i]); + + // resume it + cyg_thread_resume(thread_handle[i]); + + // and make the matching chopstick present + cyg_semaphore_init( &chopstick[i], 1); + } +#endif + + // Get the world going + cyg_scheduler_start(); + +} + +// ------------------------------------------------------------------------- +// EOF kphilo.c diff --git a/packages/kernel/current/tests/ksched1.c b/packages/kernel/current/tests/ksched1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/ksched1.c @@ -0,0 +1,90 @@ +/*================================================================= +// +// ksched1.c +// +// Kernel C API Sched test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-23 +// Description: Simply checks the world starts +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +#define NTHREADS 2 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + + +static void entry0( cyg_addrword_t data ) +{ + CHECK( 222 == (int)data ); + CYG_TEST_PASS_FINISH( "Kernel C API Sched 1 OK"); +} + +void ksched1_main(void) +{ + CYG_TEST_INIT(); + + cyg_thread_create( 4, entry0 , (cyg_addrword_t)222, "ksched1", + (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + ksched1_main(); +} + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF ksched1.c */ diff --git a/packages/kernel/current/tests/ksem0.c b/packages/kernel/current/tests/ksem0.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/ksem0.c @@ -0,0 +1,89 @@ +/*================================================================= +// +// ksem0.c +// +// Kernel C API Semaphore test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-20 +// Description: Limited to checking initialisation/destruction +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +cyg_sem_t s0, s1, s2; + +static bool flash( void ) +{ + cyg_semaphore_init( &s0, 0 ); + cyg_semaphore_init( &s1, 1 ); + cyg_semaphore_init( &s2, 17 ); + + cyg_semaphore_destroy( &s0 ); + cyg_semaphore_destroy( &s1 ); + cyg_semaphore_destroy( &s2 ); + + return true; +} + +void ksem0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + CYG_TEST_PASS_FINISH("Kernel C API Semaphore 0 OK"); + +} + +externC void +cyg_start( void ) +{ + ksem0_main(); +} + + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF ksem0.c */ diff --git a/packages/kernel/current/tests/ksem1.c b/packages/kernel/current/tests/ksem1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/ksem1.c @@ -0,0 +1,156 @@ +/*================================================================= +// +// ksem1.c +// +// C API semaphore test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-20 +// Description: Tests basic semaphore functionality. +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +#define NTHREADS 2 +#define STACKSIZE 4096 + +static cyg_handle_t thread[NTHREADS]; + +static cyg_thread thread_obj[NTHREADS]; +static char stack[NTHREADS][STACKSIZE]; + + +static cyg_sem_t s0, s1, s2; + +static volatile cyg_ucount8 q = 0; + +static void entry0( cyg_addrword_t data ) +{ + cyg_ucount32 val; + + cyg_semaphore_wait(&s0); + CHECK( 1 == q++ ); + cyg_semaphore_post(&s1); + cyg_semaphore_wait(&s0); + CHECK( 3 == q++ ); + cyg_semaphore_peek(&s0, &val); + CHECK( 0 == val); + CHECK( ! cyg_semaphore_trywait(&s0) ); + cyg_semaphore_post(&s0); + CHECK( 4 == q++ ); + cyg_semaphore_peek(&s0, &val); + CHECK( 1 == val); + cyg_semaphore_post(&s0); + cyg_semaphore_peek(&s0, &val); + CHECK( 2 == val); + cyg_semaphore_post(&s1); + cyg_semaphore_peek(&s2, &val); + CHECK( 0 == val); + cyg_semaphore_wait(&s2); + CHECK( 6 == q++ ); + CYG_TEST_PASS_FINISH("Kernel C API Semaphore 1 OK"); +} + +static void entry1( cyg_addrword_t data ) +{ + cyg_ucount32 val; + + cyg_semaphore_peek(&s1, &val); + CHECK( 2 == val); + cyg_semaphore_wait(&s1); + cyg_semaphore_peek(&s1, &val); + CHECK( 1 == val); + cyg_semaphore_wait(&s1); + CHECK( 0 == q++ ); + cyg_semaphore_peek(&s0, &val); + CHECK( 0 == val); + cyg_semaphore_post(&s0); + cyg_semaphore_wait(&s1); + CHECK( 2 == q++ ); + cyg_semaphore_post(&s0); + cyg_semaphore_wait(&s1); + CHECK( 5 == q++ ); + cyg_semaphore_peek(&s0, &val); + CHECK( 2 == val); + CHECK( cyg_semaphore_trywait(&s0) ); + cyg_semaphore_peek(&s0, &val); + CHECK( 1 == val); + CHECK( cyg_semaphore_trywait(&s0) ); + cyg_semaphore_peek(&s0, &val); + CHECK( 0 == val); + cyg_semaphore_post(&s2); + cyg_semaphore_wait(&s0); + CYG_TEST_FAIL_FINISH("Not reached"); +} + +void ksem1_main( void ) +{ + CYG_TEST_INIT(); + + cyg_semaphore_init( &s0, 0); + cyg_semaphore_init( &s1, 2); + cyg_semaphore_init( &s2, 0); + + cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "ksem1-0", + (void *)stack[0], STACKSIZE,&thread[0], &thread_obj[0]); + cyg_thread_resume(thread[0]); + + cyg_thread_create(4, entry1 , (cyg_addrword_t)1, "ksem1-1", + (void *)stack[1], STACKSIZE, &thread[1], &thread_obj[1]); + cyg_thread_resume(thread[1]); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + ksem1_main(); +} + + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF ksem1.c */ diff --git a/packages/kernel/current/tests/kthread0.c b/packages/kernel/current/tests/kthread0.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kthread0.c @@ -0,0 +1,107 @@ +/*================================================================= +// +// kthread0.c +// +// Kernel C API Thread test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-18 +// Description: Limited to checking constructors/destructors +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +#define STACKSIZE 4096 + +static char stack[STACKSIZE]; + +static cyg_thread_entry_t entry; + +static void entry( cyg_addrword_t data ) +{ +} + +static int *p; + +#if 0 +static cyg_handle_t t0,t1; +static cyg_thread thread0, thread1; +#endif + +static cyg_handle_t t2; +static cyg_thread thread2; + +static bool flash( void ) +{ +#if 0 // no facility to allocate stack exists yet. + cyg_thread_create( entry, 0x111, NULL, 0, &t0, &thread0 ); + + cyg_thread_create( entry, (cyg_addrword_t)&t0, STACKSIZE, 0, &t1, &thread0 ); +#endif + + cyg_thread_create(4, entry, (cyg_addrword_t)p, "kthread0", + (void *)stack, STACKSIZE, &t2, &thread2 ); + + return true; +} + +void kthread0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + CYG_TEST_PASS_FINISH("Kernel C API Thread 0 OK"); + +} + +externC void +cyg_start( void ) +{ + kthread0_main(); +} + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF kthread0.c */ diff --git a/packages/kernel/current/tests/kthread1.c b/packages/kernel/current/tests/kthread1.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/kthread1.c @@ -0,0 +1,119 @@ +/*================================================================= +// +// kthread1.c +// +// Kernel C API Thread test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-18 +// Description: Tests some basic thread functions. +//####DESCRIPTIONEND#### +*/ + +#include + +#include + +#ifdef CYGFUN_KERNEL_API_C + +#include "testaux.h" + +#define STACKSIZE 2000 + +static char stack[2][STACKSIZE]; + +static cyg_thread thread[2]; + +static cyg_handle_t pt0,pt1; + + +static void entry0( cyg_addrword_t data ) +{ + CHECK( 222 == (int)data ); + + cyg_thread_suspend(pt1); + cyg_thread_resume(pt1); + + cyg_thread_delay(1); + + cyg_thread_resume(pt1); + + cyg_thread_delay(1); + + CYG_TEST_PASS_FINISH("Kernel C API Thread 1 OK"); +} + +static void entry1( cyg_addrword_t data ) +{ + cyg_handle_t self; + CHECK( 333 == (int)data ); + + self = cyg_thread_self(); + + CHECK( self == pt1 ); + + cyg_thread_suspend(pt1); + + cyg_thread_exit(); // no guarantee this will be called +} + +void kthread1_main( void ) +{ + CYG_TEST_INIT(); + + cyg_thread_create(4, entry0, (cyg_addrword_t)222, "kthread1-0", + (void *)stack[0], STACKSIZE, &pt0, &thread[0] ); + cyg_thread_create(4, entry1, (cyg_addrword_t)333, "kthread1-1", + (void *)stack[1], STACKSIZE, &pt1, &thread[1] ); + + cyg_thread_resume(pt0); + cyg_thread_resume(pt1); + + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + kthread1_main(); +} + + +#else /* def CYGFUN_KERNEL_API_C */ +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Kernel C API layer disabled"); +} +#endif /* def CYGFUN_KERNEL_API_C */ + +/* EOF kthread1.c */ diff --git a/packages/kernel/current/tests/mbox1.cxx b/packages/kernel/current/tests/mbox1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/mbox1.cxx @@ -0,0 +1,187 @@ +//========================================================================== +// +// mbox1.cxx +// +// Mbox test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author: dsm +// Contributors: dsm +// Date: 1998-05-19 +// Description: Tests basic mbox functionality. +//####DESCRIPTIONEND#### + +#include + +#include // Cyg_Thread +#include +#include // Cyg_Scheduler::start() + +#include + +#include + +#include + +#include // Cyg_Timer +#include // Cyg_Clock + +#define NTHREADS 2 +#include "testaux.hxx" + +static Cyg_Mbox m0, m1, m2; + +static volatile cyg_atomic q = 0; + +#ifndef CYGMTH_MBOX_PUT_CAN_WAIT +#define PUT tryput +#endif + +static void entry0( CYG_ADDRWORD data ) +{ + cyg_count8 u,i; + + CYG_TEST_INFO("Testing put() and tryput() without wakeup"); + CYG_TEST_CHECK(!m0.waiting_to_get(), "mbox not initialized properly"); + CYG_TEST_CHECK(0==m0.peek(), "mbox not initialized properly"); + CYG_TEST_CHECK(NULL==m0.peek_item(), "mbox not initialized properly"); + m0.PUT((void *)55); + CYG_TEST_CHECK(1==m0.peek(), "peek() wrong"); + CYG_TEST_CHECK(55==(cyg_count8)m0.peek_item(), "peek_item() wrong"); + for(u=1; m0.tryput((void*)u); u++) { + CYG_TEST_CHECK(55==(cyg_count8)m0.peek_item(), "peek_item() wrong"); + CYG_TEST_CHECK(u+1==m0.peek(), "peek() wrong"); + } + CYG_TEST_CHECK(u == CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE, "mbox not configured size"); + + // m0 now contains ( 55 1 2 .. u-1 ) + CYG_TEST_CHECK(u==m0.peek(), "peek() wrong"); + CYG_TEST_CHECK(55==(cyg_count8)m0.peek_item(), "peek_item() wrong"); + + CYG_TEST_INFO("Testing get(), tryget()"); + + i = (cyg_count8)m0.tryget(); + CYG_TEST_CHECK( 55 == i, "Got wrong message" ); + for(cyg_count8 j=1; jcurrent_value() + 2), + "unexpectedly found message"); + CYG_TEST_CHECK(3==q++, "bad synchronization"); + // Allow t1 to run as this get times out + // t1 must not be waiting... + CYG_TEST_CHECK(m0.waiting_to_get(), "waiting_to_get()"); + + m0.PUT((void*)7); // wake t1 from timed get +#ifdef CYGMTH_MBOX_PUT_CAN_WAIT + q=10; + while(m0.tryput((void*)6)) // fill m0's queue + ; + // m0 now contains ( 6 ... 6 ) + CYG_TEST_CHECK(10==q++, "bad synchronization"); + m1.put((void*)4); // wake t1 + CYG_TEST_CHECK(!m0.put((void*)8, 2), "timed put() unexpectedly worked"); + CYG_TEST_CHECK(12==q++, "bad synchronization"); + // m0 still contains ( 6 ... 6 ) + m0.put((void*)9); + CYG_TEST_CHECK(13==q++, "bad synchronization"); +#endif +#endif + i=(cyg_count8)m2.get(); + CYG_TEST_FAIL_FINISH("Not reached"); +} + +static void entry1( CYG_ADDRWORD data ) +{ + cyg_count8 i; + i = (cyg_count8)m1.get(); + CYG_TEST_CHECK(1==q++, "bad synchronization"); + m0.PUT((void *)3); // wake t0 + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + CYG_TEST_INFO("Testing timed functions"); + CYG_TEST_CHECK(7==(cyg_count8)m0.get( + Cyg_Clock::real_time_clock->current_value() + 4), "timed get()"); + CYG_TEST_CHECK(4==q++, "bad synchronization"); +#ifdef CYGMTH_MBOX_PUT_CAN_WAIT + CYG_TEST_CHECK(4==(cyg_count8)m1.get()); + + CYG_TEST_CHECK(11==q++, "bad synchronization"); + thread[0]->delay(4); // allow t0 to reach put on m1 + CYG_TEST_CHECK(14==q++, "bad synchronization"); + CYG_TEST_CHECK(m0.waiting_to_put(), "waiting_to_put()"); + do { + // after first get m0 contains ( 6 .. 6 9 ) + i=(cyg_count8)m0.tryget(); + } while(6==i); + CYG_TEST_CHECK(9==i,"put gone awry"); +#endif +#endif + CYG_TEST_PASS_FINISH("Mbox 1 OK"); +} + +void mbox1_main( void ) +{ + CYG_TEST_INIT(); + + new_thread(entry0, 0); + new_thread(entry1, 1); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + mbox1_main(); +} + +// EOF mbox1.cxx diff --git a/packages/kernel/current/tests/memfix1.cxx b/packages/kernel/current/tests/memfix1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/memfix1.cxx @@ -0,0 +1,172 @@ +//========================================================================== +// +// memfix1.cxx +// +// Fixed memory pool test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-09 +// Description: Tests basic fixed memory pool functionality +//####DESCRIPTIONEND#### + +#include + +#include // Cyg_Scheduler::start() +#include // Cyg_Thread + +#include + +#include + +#include +#include + +#include // Cyg_Timer +#include // Cyg_Clock + + +#define NTHREADS 2 +#include "testaux.hxx" + +static const cyg_int32 memsize = 10240; + +static cyg_uint8 mem[2][memsize]; + +static Cyg_Mempool_Fixed mempool0(mem[0], memsize, 100); + +static Cyg_Mempool_Fixed mempool1(mem[1], memsize, 316); + + +static void check_in_mp0(cyg_uint8 *p, cyg_int32 size) +{ + CYG_TEST_CHECK(NULL != p, + "Allocation failed"); + CYG_TEST_CHECK(mem[0] <= p && p+size < mem[1], + "Block outside memory pool"); +} + + +static void entry0( CYG_ADDRWORD data ) +{ + cyg_uint8 *base; + cyg_int32 size; + CYG_ADDRWORD bs; + cyg_int32 f0,f1,f2,t0; + cyg_uint8 *p0, *p1, *p2; + + mempool0.get_arena(base, size, bs); + cyg_int32 blocksize=(cyg_int32)bs; + CYG_TEST_CHECK(mem[0] == base, "get_arena: base wrong"); + CYG_TEST_CHECK(memsize == size, "get_arena: size wrong"); + CYG_TEST_CHECK(100 == blocksize, "get_arena: blocksize wrong"); + + CYG_TEST_CHECK(316 == mempool1.get_blocksize(), "get_blocksize wrong" ); + + t0=mempool0.get_totalmem(); + CYG_TEST_CHECK(t0 > 0, "Negative total memory" ); + f0=mempool0.get_freemem(); + CYG_TEST_CHECK(f0 > 0, "Negative free memory" ); + CYG_TEST_CHECK(t0 <= memsize, "get_totalsize: Too much memory"); + CYG_TEST_CHECK(f0 <= t0 , "More memory free than possible" ); + + CYG_TEST_CHECK( !mempool0.waiting(), + "Thread waiting for memory; there shouldn't be"); + + CYG_TEST_CHECK( !mempool0.free(NULL), "Bogus free worked"); + + p0 = mempool0.alloc(); + check_in_mp0(p0, 100); + + f1 = mempool0.get_freemem(); + CYG_TEST_CHECK(f1 > 0, "Negative free memory" ); + CYG_TEST_CHECK(f1 < f0, "Free memory didn't decrease after allocation" ); + + p1 = NULL; + while((p2 = mempool0.try_alloc())) + p1 = p2; + + f1 = mempool0.get_freemem(); + CYG_TEST_CHECK(mempool0.free(p0), "Couldn't free"); + + f2 = mempool0.get_freemem(); + CYG_TEST_CHECK(f2 > f1, "Free memory didn't increase after free" ); + + // should be able to reallocate now a block is free + p0 = mempool0.try_alloc(); + check_in_mp0(p0, 100); + + CYG_TEST_CHECK(p1+100 <= p0 || p1 >= p0+100, + "Ranges of allocated memory overlap"); + + CYG_TEST_CHECK(mempool0.free(p0), "Couldn't free"); + CYG_TEST_CHECK(mempool0.free(p1), "Couldn't free"); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + // This shouldn't have to wait + p0 = mempool0.alloc(Cyg_Clock::real_time_clock->current_value()+100000); + check_in_mp0(p0, 100); + p1 = mempool0.alloc(Cyg_Clock::real_time_clock->current_value()+2); + check_in_mp0(p1, 10); + p1 = mempool0.alloc(Cyg_Clock::real_time_clock->current_value()+2); + CYG_TEST_CHECK(NULL == p1, "Timed alloc unexpectedly worked"); + + // Expect thread 1 to have run while processing previous timed + // allocation. It should therefore tbe waiting. + CYG_TEST_CHECK(mempool1.waiting(), "There should be a thread waiting"); +#endif + + CYG_TEST_PASS_FINISH("Fixed memory pool 1 OK"); +} + +static void entry1( CYG_ADDRWORD data ) +{ + while(NULL != mempool1.alloc()) + ; + CYG_TEST_FAIL("alloc returned NULL"); +} + + +void memfix1_main( void ) +{ + CYG_TEST_INIT(); + + new_thread(entry0, 0); + new_thread(entry1, 1); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + memfix1_main(); +} +// EOF memfix1.cxx diff --git a/packages/kernel/current/tests/memfix2.cxx b/packages/kernel/current/tests/memfix2.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/memfix2.cxx @@ -0,0 +1,127 @@ +//========================================================================== +// +// memfix2.cxx +// +// Fixed memory pool test 2 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-08 +// Description: test allocation and freeing in fixed memory pools +//####DESCRIPTIONEND#### + +#include + +#include // Cyg_Scheduler::start() +#include // Cyg_Thread +#include +#include + +#include + +#include + +#include + + +#define NTHREADS 1 +#include "testaux.hxx" + +static const cyg_int32 memsize = 1024; + +static cyg_uint8 mem[memsize]; + +#define NUM_PTRS 16 // Should be even +#define BLOCKSIZE 12 + +static Cyg_Mempool_Fixed mempool(mem, memsize, BLOCKSIZE); + +static cyg_uint8 *ptr[NUM_PTRS]; + +// We make a number of passes over a table of pointers which point to +// blocks of allocated memory. The block is freed and a new block +// allocated. The order of the processing of blocks is varied. +static void entry( CYG_ADDRWORD data ) +{ + for(cyg_ucount32 passes = 0; passes < 10; passes++) { + + + // The order which the table is processed varies according to + // stepsize. + cyg_ucount8 stepsize = (passes*2 + 1) % NUM_PTRS; // odd + + + for(cyg_ucount8 c=0, i=0; c < NUM_PTRS; c++) { + i = (i+stepsize) % NUM_PTRS; + if(ptr[i]) { + for(cyg_ucount32 j=BLOCKSIZE;j--;) { + CYG_TEST_CHECK(ptr[i][j]==i, "Memory corrupted"); + } + CYG_TEST_CHECK(mempool.free(ptr[i]), "bad free"); + } + ptr[i] = mempool.try_alloc(); + + CYG_TEST_CHECK(NULL != ptr[i], "Memory pool not big enough"); + CYG_TEST_CHECK(mem<=ptr[i] && ptr[i]+BLOCKSIZE < mem+memsize, + "Allocated region not within pool"); + + // Scribble over memory to check whether region overlaps + // with other regions. The contents of the memory are + // checked on freeing. This also tests that the memory + // does not overlap with allocator memory structures. + for(cyg_ucount32 j=BLOCKSIZE;j--;) { + ptr[i][j]=i; + } + } + } + + CYG_TEST_PASS_FINISH("Fixed memory pool 2 OK"); +} + + +void memfix2_main( void ) +{ + CYG_TEST_INIT(); + + new_thread(entry, 0); + + for(cyg_ucount32 i = 0; i + +#include // Cyg_Scheduler::start() +#include // Cyg_Thread + +#include + +#include + +#include +#include + +#include // Cyg_Timer +#include // Cyg_Clock + + +#define NTHREADS 2 +#include "testaux.hxx" + +static const cyg_int32 memsize = 10240; + +static cyg_uint8 mem[2][memsize]; + +static Cyg_Mempool_Variable mempool0(mem[0], memsize); + +static Cyg_Mempool_Variable mempool1(mem[1], memsize); + + +static void check_in_mp0(cyg_uint8 *p, cyg_int32 size) +{ + CYG_TEST_CHECK(NULL != p, + "Allocation failed"); + CYG_TEST_CHECK(mem[0] <= p && p+size < mem[1], + "Block outside memory pool"); +} + + +static void entry0( CYG_ADDRWORD data ) +{ + cyg_uint8 *base; + cyg_int32 size; + CYG_ADDRWORD maxf; + cyg_int32 f0,f1,f2,t0; + cyg_uint8 *p0, *p1; + cyg_int32 most_of_mem=memsize/4*3; + + mempool0.get_arena(base, size, maxf); + cyg_int32 maxfree=(cyg_int32)maxf; + + CYG_TEST_CHECK(mem[0] == base, "get_arena: base wrong"); + CYG_TEST_CHECK(memsize == size, "get_arena: size wrong"); + + CYG_TEST_CHECK(0 < maxfree && maxfree <= size, + "get_arena: maxfree wildly wrong"); + + CYG_TEST_CHECK(-1 == mempool0.get_blocksize(), "get_blocksize wrong" ); + + t0=mempool0.get_totalmem(); + CYG_TEST_CHECK(t0 > 0, "Negative total memory" ); + f0=mempool0.get_freemem(); + CYG_TEST_CHECK(f0 > 0, "Negative free memory" ); + CYG_TEST_CHECK(t0 <= memsize, "get_totalsize: Too much memory"); + CYG_TEST_CHECK(f0 <= t0 , "More memory free than possible" ); + + CYG_TEST_CHECK( !mempool0.waiting(), + "Thread waiting for memory; there shouldn't be"); + + CYG_TEST_CHECK( !mempool0.free(0,32), "Bogus free worked"); + + CYG_TEST_CHECK( NULL == mempool0.try_alloc(memsize+1), + "Managed to allocate too much memory"); + + p0 = mempool0.alloc(most_of_mem); + check_in_mp0(p0, most_of_mem); + + f1 = mempool0.get_freemem(); + CYG_TEST_CHECK(f1 > 0, "Negative free memory" ); + CYG_TEST_CHECK(f1 < f0, "Free memory didn't decrease after allocation" ); + + CYG_TEST_CHECK( NULL == mempool0.try_alloc(most_of_mem), + "Managed to allocate too much memory"); + + CYG_TEST_CHECK(mempool0.free(p0, most_of_mem), "Couldn't free"); + + f2 = mempool0.get_freemem(); + CYG_TEST_CHECK(f2 > f1, "Free memory didn't increase after free" ); + + // should be able to reallocate now memory is free + p0 = mempool0.try_alloc(most_of_mem); + check_in_mp0(p0, most_of_mem); + + p1 = mempool0.try_alloc(10); + check_in_mp0(p1, 10); + + CYG_TEST_CHECK(p1+10 <= p0 || p1 >= p0+memsize, + "Ranges of allocated memory overlap"); + + CYG_TEST_CHECK(mempool0.free(p0, 0), "Couldn't free"); + CYG_TEST_CHECK(mempool0.free(p1, 10), "Couldn't free"); + +#ifdef CYGFUN_KERNEL_THREADS_TIMER + // This shouldn't have to wait + p0 = mempool0.alloc(most_of_mem, + Cyg_Clock::real_time_clock->current_value() + 100000); + check_in_mp0(p0, most_of_mem); + p1 = mempool0.alloc(most_of_mem, + Cyg_Clock::real_time_clock->current_value() + 2); + CYG_TEST_CHECK(NULL == p1, "Timed alloc unexpectedly worked"); + p1 = mempool0.alloc(10, + Cyg_Clock::real_time_clock->current_value() + 2); + check_in_mp0(p1, 10); + + // Expect thread 1 to have run while processing previous timed + // allocation. It should therefore tbe waiting. + CYG_TEST_CHECK(mempool1.waiting(), "There should be a thread waiting"); +#endif + + CYG_TEST_PASS_FINISH("Variable memory pool 1 OK"); +} + +static void entry1( CYG_ADDRWORD data ) +{ + mempool1.alloc(memsize+1); + CYG_TEST_FAIL("Oversized alloc returned"); +} + + +void memvar1_main( void ) +{ + CYG_TEST_INIT(); + + new_thread(entry0, 0); + new_thread(entry1, 1); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + memvar1_main(); +} +// EOF memvar1.cxx diff --git a/packages/kernel/current/tests/memvar2.cxx b/packages/kernel/current/tests/memvar2.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/memvar2.cxx @@ -0,0 +1,136 @@ +//========================================================================== +// +// memvar2.cxx +// +// Variable memory pool test 2 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-06-08 +// Description: test allocation and freeing in variable memory pools +//####DESCRIPTIONEND#### + +#include + +#include // Cyg_Scheduler::start() +#include // Cyg_Thread +#include +#include + +#include + +#include + +#include + + +#define NTHREADS 1 +#include "testaux.hxx" + +static const cyg_int32 memsize = 10240; + +static cyg_uint8 mem[memsize]; + +static Cyg_Mempool_Variable mempool(mem, memsize); + +#define NUM_PTRS 16 // Should be even + +static cyg_uint8 *ptr[NUM_PTRS]; +static cyg_int32 size[NUM_PTRS]; + +// We make a number of passes over a table of pointers which point to +// blocks of allocated memory. The block is freed and a new block +// allocated. The size and the order of the processing of blocks +// is varied. +static void entry( CYG_ADDRWORD data ) +{ + cyg_uint32 s = 1; + + // The number of passes that can be successfully performed + // depends on the fragmentation performance of the memory + // allocator. + for(cyg_ucount32 passes = 0; passes < 10; passes++) { + + + // The order which the table is processed varies according to + // stepsize. + cyg_ucount8 stepsize = (passes*2 + 1) % NUM_PTRS; // odd + + + for(cyg_ucount8 c=0, i=0; c < NUM_PTRS; c++) { + i = (i+stepsize) % NUM_PTRS; + if(ptr[i]) { + for(cyg_ucount32 j=size[i];j--;) { + CYG_TEST_CHECK(ptr[i][j]==i, "Memory corrupted"); + } + CYG_TEST_CHECK(mempool.free(ptr[i], size[i]), + "bad free"); + } + s = (s*2 + 17) % 100; // size always odds therefore non-0 + ptr[i] = mempool.try_alloc(s); + size[i] = s; + + CYG_TEST_CHECK(NULL != ptr[i], "Memory pool not big enough"); + CYG_TEST_CHECK(mem<=ptr[i] && ptr[i]+s < mem+memsize, + "Allocated region not within pool"); + + // Scribble over memory to check whether region overlaps + // with other regions. The contents of the memory are + // checked on freeing. This also tests that the memory + // does not overlap with allocator memory structures. + for(cyg_ucount32 j=size[i];j--;) { + ptr[i][j]=i; + } + } + } + + CYG_TEST_PASS_FINISH("Variable memory pool 2 OK"); +} + + +void memvar2_main( void ) +{ + CYG_TEST_INIT(); + + new_thread(entry, 0); + + for(cyg_ucount32 i = 0; i + +#include + +#include + +#include "testaux.hxx" + +static Cyg_Mutex mutex0; + +static Cyg_Condition_Variable cvar0( mutex0 ); + +static bool flash( void ) +{ + Cyg_Mutex m0; + + CYG_ASSERTCLASSO(m0, "error"); + + Cyg_Condition_Variable cv0( m0 ); + + CYG_ASSERTCLASSO(cv0, "error"); + + return true; +} + +void mutex0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + CYG_ASSERTCLASSO(mutex0, "error"); + CYG_ASSERTCLASSO(cvar0, "error"); + + CYG_TEST_PASS_FINISH("Mutex 0 OK"); + +} + +externC void +cyg_start( void ) +{ + mutex0_main(); +} +// EOF mutex0.cxx diff --git a/packages/kernel/current/tests/mutex1.cxx b/packages/kernel/current/tests/mutex1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/mutex1.cxx @@ -0,0 +1,148 @@ +//========================================================================== +// +// mutex1.cxx +// +// Mutex test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-24 +// Description: Tests basic mutex functionality. +// Omissions: Timed wait. +//####DESCRIPTIONEND#### + +#include + +#include // Cyg_Scheduler::start() +#include // Cyg_Thread + +#include + +#include + +#include +#include + + +#define NTHREADS 3 +#include "testaux.hxx" + +static Cyg_Mutex m0, m1; +static Cyg_Condition_Variable cvar0( m0 ), cvar1( m0 ), cvar2( m1 ); + +static cyg_ucount8 m0d=0, m1d=0; + +static void finish( cyg_ucount8 t ) +{ + m1.lock(); { + m1d |= 1< + +#include + +// ------------------------------------------------------------------------- +// Data for the philosophers problem + +#define PHILOSOPHERS 15 // number of philosophers +#define STACKSIZE (2*1024) // size of thread stack + +// array of stacks for philosopher threads +char thread_stack[PHILOSOPHERS][STACKSIZE]; + +// array of threads. We use the new operator defined +// below to make these into real threads. +char thread[PHILOSOPHERS][sizeof(Cyg_Thread)]; + +inline void *operator new(size_t size, void *ptr) { return ptr; }; + +// array of chopsticks +Cyg_Binary_Semaphore chopstick[PHILOSOPHERS]; + + +//cyg_thread_entry Philosopher; + +// ------------------------------------------------------------------------- +// State recording and display + +static char pstate[PHILOSOPHERS+1]; // state vector showing what each + // philosopher is doing + +Cyg_Mutex state_mutex; + +#ifdef CYG_HAL_MN10300_MN103002 +static cyg_count8 eaters = 0; +#endif + +void change_state(int id, char newstate) +{ + CYG_INSTRUMENT_USER( 1, 0, 0); + state_mutex.lock(); + CYG_INSTRUMENT_USER( 2, 0, 0); + +#ifdef CYG_HAL_MN10300_MN103002 + if( pstate[id] == 'E' ) eaters--; + if( newstate == 'E' ) eaters++; +// led(eaters); +#endif + + pstate[id] = newstate; + + diag_write_string(pstate); +#if 0 + diag_write_char(' '); + diag_write_dec(Cyg_Scheduler::get_thread_switches()); +#endif + diag_write_char('\n'); + + CYG_INSTRUMENT_USER( 3, 0, 0); + state_mutex.unlock(); + CYG_INSTRUMENT_USER( 4, 0, 0); + +} + +char get_state( int id) +{ + state_mutex.lock(); + + char s = pstate[id]; + + state_mutex.unlock(); + + return s; +} + +// ------------------------------------------------------------------------- +// Thread to behave like a philosopher + +void Philosopher( CYG_ADDRESS id ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + Cyg_Binary_Semaphore *first_stick = &chopstick[id]; + Cyg_Binary_Semaphore *second_stick = &chopstick[(id+1)%PHILOSOPHERS]; +#ifdef CYGPKG_INFRA_DEBUG + int left_philo = ((id==0)?PHILOSOPHERS:id)-1; + int right_philo = (id==PHILOSOPHERS-1)?0:(id+1); +#endif + + CYG_ASSERT( id >= 0 && id < PHILOSOPHERS, "Bad id"); + + // Deadlock avoidance. The easiest way to make the philosophers + // behave is to make each pick up the lowest numbered stick + // first. This is how it works out anyway for all the philosophers + // except the last, who must have his sticks swapped. + + if( id == PHILOSOPHERS-1 ) + { + Cyg_Binary_Semaphore *t = first_stick; + first_stick = second_stick; + second_stick = t; + } + + // The following variable is shared by all philosophers. + // It is incremented unprotected, but this does not matter + // since it is only present to introduce a little variability + // into the think and eat times. + + static int cycle = 0; + + for(;;) + { + // Think for a bit + + self->delay((id+cycle++)%12); // Cogito ergo sum... + + // I am now hungry, try to get the chopsticks + + change_state(id,'H'); + + // Get the first stick + CYG_INSTRUMENT_USER( 5, 0, 0); + first_stick->wait(); + CYG_INSTRUMENT_USER( 6, 0, 0); + + // Get the second stick + CYG_INSTRUMENT_USER( 7, 0, 0); + second_stick->wait(); + CYG_INSTRUMENT_USER( 8, 0, 0); + + // Got them, now eat + + change_state(id,'E'); + + // Check that the world is as I think it is... + CYG_ASSERT( !first_stick->posted(), "Not got first stick"); + CYG_ASSERT( !second_stick->posted(), "Not got second stick"); + CYG_ASSERT( get_state(left_philo) != 'E', "Left neighbour also eating!!"); + CYG_ASSERT( get_state(right_philo) != 'E', "Right neighbour also eating!!"); + + self->delay((id+cycle++)%6); // munch munch + + // Finished eating, put down sticks. + + change_state(id,'T'); + + CYG_INSTRUMENT_USER( 9, 0, 0); + first_stick->post(); + CYG_INSTRUMENT_USER( 10, 0, 0); + second_stick->post(); + CYG_INSTRUMENT_USER( 11, 0, 0); + +// Cyg_Scheduler::lock(); +// Cyg_Scheduler::unlock(); + CYG_INSTRUMENT_USER( 12, 0, 0); + + } +} + +// ------------------------------------------------------------------------- + +externC void +cyg_start( void ) +{ + diag_init(); + + diag_write_string("Philosophers\n"); + diag_write_string("Started\n"); + + // Zero last element in state so it acts like + // a string. + pstate[PHILOSOPHERS] = 0; + +#if 1 + for( int i = 0; i < PHILOSOPHERS; i++ ) + { + change_state(i,'T'); // starting state + + // Start the philosopher + Cyg_Thread *t = new((void *)&thread[i]) Cyg_Thread(Philosopher, + i, + STACKSIZE, + CYG_ADDRESS(&thread_stack[i]) + ); + + // resume it + t->resume(); + + // and make the matching chopstick present + chopstick[i].post(); + } +#endif + + // Get the world going + Cyg_Scheduler::scheduler.start(); + +} + +// ------------------------------------------------------------------------- +// EOF philo.cxx diff --git a/packages/kernel/current/tests/release.cxx b/packages/kernel/current/tests/release.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/release.cxx @@ -0,0 +1,109 @@ +//========================================================================== +// +// release.cxx +// +// Thread release test +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-04-24 +// Description: Tests the functionality of thread release(). +//####DESCRIPTIONEND#### + +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#define NTHREADS 2 + +#include "testaux.hxx" + +static Cyg_Binary_Semaphore s0, s1; + +static void entry0( CYG_ADDRWORD data ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + + if (!s0.wait() ) + { + if( self->get_wake_reason() != Cyg_Thread::BREAK ) + CYG_TEST_FAIL_FINISH("Wake reason not BREAK"); + } + else + { + CYG_TEST_FAIL_FINISH("Thread not released"); + } + + s1.post(); + + self->exit(); +} + + +static void entry1( CYG_ADDRWORD data ) +{ + thread[0]->release(); + + s1.wait(); + + CYG_TEST_PASS_FINISH("Release OK"); + + Cyg_Thread::self()->exit(); +} + +void release_main(void) +{ + CYG_TEST_INIT(); + + new_thread( entry0, 0); + new_thread( entry1, 1); + + thread[0]->set_priority(5); + thread[1]->set_priority(6); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); + +} + +externC void +cyg_start( void ) +{ + release_main(); +} + +// EOF release.cxx diff --git a/packages/kernel/current/tests/sched1.cxx b/packages/kernel/current/tests/sched1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/sched1.cxx @@ -0,0 +1,97 @@ +//========================================================================== +// +// sched1.cxx +// +// Sched test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-26 +// Description: Tests some basic sched functions. +// Omissions: +// Doesn't test Cyg_Scheduler::get_thread_switches() very well +// Cyg_SchedThread +// inherit_priority +// disinherit_priority +// Options: +//####DESCRIPTIONEND#### + +#include + +#include // Cyg_Scheduler::start() +#include // Cyg_Thread + +#include + +#include +#include + +#define NTHREADS 2 + +#include "testaux.hxx" + +static void entry0( CYG_ADDRWORD data ) +{ + CHECK( 0 == Cyg_Scheduler::get_sched_lock() ); + Cyg_Scheduler::lock(); { + CHECK( 1 == Cyg_Scheduler::get_sched_lock() ); + Cyg_Scheduler::lock(); { + CHECK( 2 == Cyg_Scheduler::get_sched_lock() ); + } Cyg_Scheduler::unlock(); + } Cyg_Scheduler::unlock(); + cyg_ucount32 t0=Cyg_Scheduler::get_thread_switches(); + cyg_ucount32 t1=Cyg_Scheduler::get_thread_switches(); + CHECK( t1 >= t0 ); + CHECK( Cyg_Scheduler::get_current_thread() == + Cyg_Thread::self() ); + CYG_TEST_PASS_FINISH( "Sched 1 OK"); +} + +static void entry1( CYG_ADDRWORD data ) +{ + Cyg_Thread::self()->sleep(); +} + +void sched1_main(void) +{ + CYG_TEST_INIT(); + + new_thread(entry0, 222); + new_thread(entry1, 333); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + sched1_main(); +} +// EOF sched1.cxx diff --git a/packages/kernel/current/tests/sync2.cxx b/packages/kernel/current/tests/sync2.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/sync2.cxx @@ -0,0 +1,187 @@ +//========================================================================== +// +// sync2.cxx +// +// Sync test 2 -- test of different locking mechanisms +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-18 +// Description: +// Creates some threads and tests the various synchronization +// mechanisms. Four threads are created t0..t3. t0 and t3 grab a +// mutex and check they have exclusive access to shared variable. +// t0,t1,t2 post each other in a loop with a semaphore so that +// only one is running at any time. t1,t2,t3 do a similar thing +// with counting semaphores, except that there are two active +// threads. +// Omissions: +// Doesn't test condition variables +// +//####DESCRIPTIONEND#### + +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#define NTHREADS 4 + +#include "testaux.hxx" + +static Cyg_Mutex m0; +static Cyg_Binary_Semaphore s0, s1, s2(1); +static Cyg_Counting_Semaphore cs0, cs1, cs2, cs3; + +static const cyg_ucount16 n = 1000; +static cyg_ucount8 m0d=99, sd=2, cd0=99, cd1=99; + +static void entry0( CYG_ADDRWORD data ) +{ + for(cyg_ucount16 i=0; i + +#include +#include +#include +#include +#include + +#include + +#include + +#ifndef CYGIMP_THREAD_PRIORITY +#error "Thread priorities disabled" +#endif + +#define NTHREADS 3 + +#include "testaux.hxx" + +static Cyg_Mutex m0; +static Cyg_Binary_Semaphore s0, s1, s2; + +static cyg_ucount8 m0d = 9; + +static void check_priorities_normal() +{ + CHECK( 5 == thread[0]->get_priority()); + CHECK( 6 == thread[1]->get_priority()); + CHECK( 7 == thread[2]->get_priority()); +} + +static void check_priorities_inherited() +{ + CHECK( 5 == thread[0]->get_priority()); + CHECK( 6 == thread[1]->get_priority()); +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + CHECK( 5 == thread[2]->get_current_priority()); +#endif + CHECK( 7 == thread[2]->get_priority()); + +} + +static void entry0( CYG_ADDRWORD data ) +{ + s0.wait(); // wait until t2 has gained m0.lock + check_priorities_normal(); + m0.lock(); { + check_priorities_normal(); + CHECK( 2 == m0d ); + m0d = 0; + } m0.unlock(); + check_priorities_normal(); +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + CYG_TEST_PASS_FINISH("Sync 3 OK -- priority inheritance worked"); +#else + CYG_TEST_FAIL_FINISH("Sync 3: thread not starved"); +#endif + // NOT REACHED +} + +static void entry1( CYG_ADDRWORD data ) +{ + s1.wait(); + // The delay below will allow testing of the priority inheritance + // mechanism when scheduler does not guarantee to schedule threads + // in strict priority order. + for ( volatile cyg_ucount32 i=0; i < 100000; i++ ) + ; // math is hard + +#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE + // thread0 should have stopped by this point + CYG_TEST_FAIL_FINISH("Sync 3: priority inheritance mechanism failed"); +#else + // With strict priority scheduling and no priority inheritance + // this is expected to happen. + CYG_TEST_PASS_FINISH("Sync 3 OK"); +#endif + CYG_TEST_FAIL_FINISH("Not reached"); +} + +void entry2( CYG_ADDRWORD data ) +{ + m0.lock(); { + CHECK( 9 == m0d ); + check_priorities_normal(); + s0.post(); // Now I have lock on m0, wake t0 then t1 + check_priorities_inherited(); + s1.post(); + check_priorities_inherited(); + m0d = 2; + } m0.unlock(); + check_priorities_normal(); + m0.lock(); { + check_priorities_normal(); + CHECK( 0 == m0d ); + m0d = 21; + s2.wait(); // never posted + } m0.unlock(); +} + + + +void sync3_main(void) +{ + CYG_TEST_INIT(); + + new_thread( entry0, 0); + new_thread( entry1, 1); + new_thread( entry2, 2); + + thread[0]->set_priority(5); + thread[1]->set_priority(6); + thread[2]->set_priority(7); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + sync3_main(); +} + +// EOF sync3.cxx diff --git a/packages/kernel/current/tests/tcdiag.cxx b/packages/kernel/current/tests/tcdiag.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/tcdiag.cxx @@ -0,0 +1,84 @@ +//========================================================================== +// +// tcdiag.cxx +// +// Kernel diag test harness. +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-17 +// Description: Test harness implementation that uses the kernel's +// diag channel. This is intended for manual testing +// of the kernel. +//####DESCRIPTIONEND#### + +#include +#include + +void cyg_test_init() +{ + diag_init(); +} + +void cyg_test_output(int status, char *msg, int line, char *file) +{ + char *st; + + switch (status) { + case 0: + st = "FAIL:"; + break; + case 1: + st = "PASS:"; + break; + case 2: + st = "EXIT:"; + break; + case 3: + st = "INFO:"; + break; + } + + diag_write_string(st); + diag_write_char('<'); + diag_write_string(msg); + diag_write_string("> Line: "); + diag_write_dec(line); + diag_write_string(", File: "); + diag_write_string(file); + diag_write_char('\n'); + +} + +// This is an appropriate function to set a breakpoint on +void cyg_test_exit() +{ + for(;;) + ; +} +// EOF tcdiag.cxx diff --git a/packages/kernel/current/tests/testaux.h b/packages/kernel/current/tests/testaux.h new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/testaux.h @@ -0,0 +1,51 @@ +#ifndef CYGONCE_KERNEL_TESTS_TESTAUX_H +#define CYGONCE_KERNEL_TESTS_TESTAUX_H + +/*================================================================= +// +// testaux.h +// +// Auxiliary test header file +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-09 +// Description: +// Defines some convenience functions to get us going. In +// particular this file reserves space for NTHREADS threads, +// which can be created by calls to aux_new_thread() +// It also defines a CHECK function. +// +//####DESCRIPTIONEND#### +*/ + +#define CHECK(b) CYG_TEST_CHECK(b,#b) + +#endif /* ifndef CYGONCE_KERNEL_TESTS_TESTAUX_H */ + +/* EOF testaux.h */ diff --git a/packages/kernel/current/tests/testaux.hxx b/packages/kernel/current/tests/testaux.hxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/testaux.hxx @@ -0,0 +1,77 @@ +#ifndef CYGONCE_KERNEL_TESTS_TESTAUX_HXX +#define CYGONCE_KERNEL_TESTS_TESTAUX_HXX + +//========================================================================== +// +// testaux.hxx +// +// Auxiliary test header file +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-03-09 +// Description: +// Defines some convenience functions to get us going. In +// particular this file reserves space for NTHREADS threads, +// which can be created by calls to aux_new_thread() +// It also defines a CHECK function. +// +//####DESCRIPTIONEND#### + +#ifdef NTHREADS + +#define STACKSIZE 4096 + +static Cyg_Thread *thread[NTHREADS]; + +static char thread_obj[NTHREADS][sizeof(Cyg_Thread)]; +static char stack[NTHREADS][STACKSIZE]; + +static inline void *operator new(size_t size, void *ptr) { return ptr; }; + +static int nthreads = 0; + +static Cyg_Thread *new_thread(cyg_thread_entry *entry, CYG_ADDRWORD data) { + + CYG_ASSERT(nthreads < NTHREADS, + "Attempt to create more than NTHREADS threads"); + + thread[nthreads] = new( (void *)&thread_obj[nthreads] ) + Cyg_Thread(entry, data, STACKSIZE, (CYG_ADDRESS)stack[nthreads] ); + + thread[nthreads]->resume(); + + return thread[nthreads++]; +} +#endif // defined(NTHREADS) + +#define CHECK(b) CYG_TEST_CHECK(b,#b) + +#endif // ifndef CYGONCE_KERNEL_TESTS_TESTAUX_HXX + +// End of testaux.hxx diff --git a/packages/kernel/current/tests/thread0.cxx b/packages/kernel/current/tests/thread0.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/thread0.cxx @@ -0,0 +1,97 @@ +//========================================================================== +// +// thread0.cxx +// +// Thread test 0 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-11 +// Description: Limited to checking constructors/destructors +// Omissions: +// Thread constructors with 2 or 3 args are not supported at time +// of writing test. +//####DESCRIPTIONEND#### + +#include + +#include + +#include + +#include + +#include "testaux.hxx" + +#define STACKSIZE 4096 + +static char stack[STACKSIZE]; + +static cyg_thread_entry entry; + +static void entry( CYG_ADDRWORD data ) +{ +} + +static int *p; + +static bool flash( void ) +{ +#if 0 // no facility to allocate stack exists yet. + Cyg_Thread t0( entry, 0x111 ); + + CYG_ASSERTCLASS(&t0, "error"); + + Cyg_Thread t1( entry, (CYG_ADDRWORD)&t0, STACKSIZE ); + + CYG_ASSERTCLASS(&t1, "error"); +#endif + Cyg_Thread t2( entry, (CYG_ADDRWORD)p, STACKSIZE, (CYG_ADDRESS)stack ); + + CYG_ASSERTCLASS(&t2, "error"); + + return true; +} + +void thread0_main( void ) +{ + CYG_TEST_INIT(); + + CHECK(flash()); + CHECK(flash()); + + CYG_TEST_PASS_FINISH("Thread 0 OK"); + +} + +externC void +cyg_start( void ) +{ + thread0_main(); +} +// EOF thread0.cxx diff --git a/packages/kernel/current/tests/thread1.cxx b/packages/kernel/current/tests/thread1.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/thread1.cxx @@ -0,0 +1,137 @@ +//========================================================================== +// +// thread1.cxx +// +// Thread test 1 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-11 +// Description: Tests some basic thread functions. +// Omissions: Cyg_ThreadTimer +// Cyg_Thread +// exit -- not necessarily called +// yield +// set_priority +// get_priority +// get/set_sleep_reason +// get/set_wake_reason +// set/clear_timer +// Cyg_ThreadQueue +// +//####DESCRIPTIONEND#### + +#include + +#include +#include + +#include + +#include +#include + +#include "testaux.hxx" + +#define STACKSIZE 2000 + +static char stack[2][STACKSIZE]; + +static char thread[2][sizeof(Cyg_Thread)]; + +inline void *operator new(size_t size, void *ptr) { return ptr; }; + +static Cyg_Thread *pt0,*pt1; +static cyg_uint16 uid0,uid1; + + +static void entry0( CYG_ADDRWORD data ) +{ + CHECK( 222 == data ); + + uid0 = pt0->get_unique_id(); + + pt1->suspend(); + pt1->resume(); + + do { + pt0->delay(1); + } while( Cyg_Thread::RUNNING == pt1->get_state() ); + + CHECK( Cyg_Thread::SLEEPING == pt1->get_state() ); + + pt1->wake(); + + CHECK( uid0 != uid1 ); + + CYG_TEST_PASS_FINISH("Thread 1 OK"); +} + +static void entry1( CYG_ADDRWORD data ) +{ + CHECK( 333 == data ); + + uid1 = pt1->get_unique_id(); + + Cyg_Thread *self = Cyg_Thread::self(); + + CHECK( self == pt1 ); + + pt1->sleep(); + pt1->suspend(); + + Cyg_Thread::exit(); // no guarantee this will be called +} + +void thread1_main( void ) +{ + CYG_TEST_INIT(); + + pt0 = new((void *)&thread[0]) + Cyg_Thread(entry0, 222, STACKSIZE, (CYG_ADDRESS)stack[0] ); + pt1 = new((void *)&thread[1]) + Cyg_Thread(entry1, 333, STACKSIZE, (CYG_ADDRESS)stack[1] ); + + CYG_ASSERTCLASS( pt0, "error" ); + CYG_ASSERTCLASS( pt1, "error" ); + + pt0->resume(); + pt1->resume(); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Not reached"); +} + +externC void +cyg_start( void ) +{ + thread1_main(); +} + +// EOF thread1.cxx diff --git a/packages/kernel/current/tests/thread2.cxx b/packages/kernel/current/tests/thread2.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/thread2.cxx @@ -0,0 +1,196 @@ +//========================================================================== +// +// thread2.cxx +// +// Thread test 2 +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): dsm +// Contributors: dsm +// Date: 1998-02-19 +// Description: +// tests scheduler & threads & priorities +// + create multiple threads with various priorities +// + check highest priority running thread is always running +// + check next highest runs when highest suspended +// + check several threads of equal priority share time +// (only !CYG_SCHED_UNIQUE_PRIORITIES) +// + check other threads are starved +// + check setting priority dynamically causes a thread to +// become/stay current/non-current +// Omissions: +// check yield +// check can set threads with min and max priority +// Options: +// CYG_SCHED_UNIQUE_PRIORITIES +// CYGIMP_THREAD_PRIORITY +// CYGNUM_KERNEL_SCHED_PRIORITIES +// CYGSEM_KERNEL_SCHED_BITMAP +// CYGSEM_KERNEL_SCHED_MLQUEUE +//####DESCRIPTIONEND#### + +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#include "testaux.hxx" + +#ifndef CYGIMP_THREAD_PRIORITY +#error "Test requires thread priorities" +#endif + +#define STACKSIZE 4096 + +static char stack[3][STACKSIZE]; + +static Cyg_Counting_Semaphore s0, s1, s2; + +static volatile cyg_ucount8 q = 0; + +static Cyg_Thread *thread0, *thread1, *thread2; + +static char thread[3][sizeof(Cyg_Thread)]; + +inline void *operator new(size_t size, void *ptr) { return ptr; }; + + +static void entry0( CYG_ADDRWORD data ) +{ + CHECK( 0 == q++ ); + s0.wait(); + CHECK( 3 == q++ ); + s1.post(); + CHECK( 4 == q++ ); + s0.wait(); + s0.wait(); + CYG_TEST_PASS_FINISH("Thread 2 OK"); +} + +static void entry1( CYG_ADDRWORD data ) +{ + CHECK( 1 == q++ ); + s1.wait(); + CHECK( 5 == q++ ); + thread0->set_priority(9); + s0.post(); + CHECK( 6 == q++ ); + thread2->set_priority(3); + CHECK( 8 == q++ ); + s2.post(); + CHECK( 12 == q++ ); + CHECK( 9 == thread0->get_priority() ); + CHECK( 6 == thread1->get_priority() ); + CHECK( 7 == thread2->get_priority() ); + q = 100; +#if !(CYG_SCHED_UNIQUE_PRIORITIES) && defined(CYGSEM_KERNEL_SCHED_TIMESLICE) + thread2->set_priority(6); + CHECK( 6 == thread1->get_priority() ); + CHECK( 6 == thread2->get_priority() ); + + while ( 100 == q ) + ; + CHECK( 101 == q++ ); + s1.wait(); + CHECK( 103 == q++ ); +#endif + s0.post(); + s1.wait(); +} + +static void entry2( CYG_ADDRWORD data ) +{ + CHECK( 2 == q++ ); + s0.post(); + CHECK( 7 == q++ ); + s2.wait(); + CHECK( 9 == q++ ); + thread1->set_priority(6); + CHECK( 10 == q++ ); + thread2->set_priority(2); + CHECK( 11 == q++ ); + thread2->set_priority(7); + +#if !(CYG_SCHED_UNIQUE_PRIORITIES) && defined(CYGSEM_KERNEL_SCHED_TIMESLICE) + CHECK( 6 == thread1->get_priority() ); + CHECK( 6 == thread2->get_priority() ); + + CHECK( 100 == q++ ); + while ( 101 == q ) + ; + CHECK( 102 == q++ ); + s1.post(); +#endif + s0.post(); + s2.wait(); +} + + +void thread2_main( void ) +{ + CYG_TEST_INIT(); + + thread0 = new((void *)&thread[0]) + Cyg_Thread(entry0, 0, STACKSIZE, (CYG_ADDRESS)stack[0] ); + thread1 = new((void *)&thread[1]) + Cyg_Thread(entry1, 1, STACKSIZE, (CYG_ADDRESS)stack[1] ); + thread2 = new((void *)&thread[2]) + Cyg_Thread(entry2, 2, STACKSIZE, (CYG_ADDRESS)stack[2] ); + + thread0->resume(); + thread1->resume(); + thread2->resume(); + + thread0->set_priority(5); + thread1->set_priority(6); + thread2->set_priority(7); + + if( 9 >= CYG_THREAD_MIN_PRIORITY ) + CYG_TEST_FAIL_FINISH("Test requires priorities up to 9"); + + if( 2 <= CYG_THREAD_MAX_PRIORITY ) + CYG_TEST_FAIL_FINISH("Test requires priorities as low as 2"); + + Cyg_Scheduler::start(); + + CYG_TEST_FAIL_FINISH("Unresolved"); +} + +externC void +cyg_start( void ) +{ + thread2_main(); +} + +// EOF thread2.cxx diff --git a/packages/kernel/current/tests/thread_gdb.c b/packages/kernel/current/tests/thread_gdb.c new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/thread_gdb.c @@ -0,0 +1,395 @@ +//========================================================================== +// +// thread_gdb.c +// +// A test for thread support in GDB +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): nickg +// Contributors: nickg +// Date: 1998-09-21 +// Description: GDB thread support test. +//####DESCRIPTIONEND#### +// + +#include + +#include + +#include + +#if defined(CYGFUN_KERNEL_API_C) && defined(CYGSEM_KERNEL_SCHED_MLQUEUE) + +// ------------------------------------------------------------------------- + +#define THREADS 10 + +#define STACKSIZE (2*1024) + +#define CONTROLLER_PRI_HI 0 +#define CONTROLLER_PRI_LO 25 + +#define WORKER_PRI 3 +#define WORKER_PRI_RANGE 20 + + +// ------------------------------------------------------------------------- + +// array of stacks for threads +char thread_stack[THREADS][STACKSIZE]; + +// array of threads. +cyg_thread thread[THREADS]; + +cyg_handle_t thread_handle[THREADS]; + +volatile cyg_uint8 worker_state; + +#define WORKER_STATE_WAIT 1 +#define WORKER_STATE_BREAK 2 +#define WORKER_STATE_EXIT 9 + +cyg_mutex_t worker_mutex; +cyg_cond_t worker_cv; + +cyg_count32 workers_asleep = 0; + +cyg_count32 thread_count[THREADS]; + +cyg_priority_t thread_pri[THREADS]; + + + +// ------------------------------------------------------------------------- + +extern void breakme(void) +{ +} + +// ------------------------------------------------------------------------- + +void worker( cyg_addrword_t id ) +{ + for(;;) + { + thread_count[id]++; + thread_pri[id] = cyg_thread_get_priority( cyg_thread_self() ); + + switch( worker_state ) + { + case WORKER_STATE_BREAK: + if( 0 == (id % 4) ) + breakme(); + + case WORKER_STATE_WAIT: + cyg_mutex_lock( &worker_mutex ); + workers_asleep++; + cyg_cond_wait( &worker_cv ); + workers_asleep--; + cyg_mutex_unlock( &worker_mutex ); + break; + + case WORKER_STATE_EXIT: + cyg_thread_exit(); + + } + } +} + +// ------------------------------------------------------------------------- + +void controller( cyg_addrword_t id ) +{ + cyg_priority_t pri; + int i; + + cyg_mutex_init( &worker_mutex ); + cyg_cond_init( &worker_cv, &worker_mutex ); + +// 1 thread, it is running, it calls BREAKME(); +// +++ Thread status returned: +// +++ 1 thread, running, is the current one + + breakme(); + +// Create N more threads; they are all suspended after creation. Adjust +// the priorities of all the threads to lower than the controlling thread. +// Make them all be distinct priorities as far as possible. BREAKME(); +// +++ 1 thread, running, + N suspended ones of different prios. + + for( i = 1; i < THREADS; i++ ) + { + pri = CONTROLLER_PRI_HI + 1 + i % WORKER_PRI_RANGE; + + cyg_thread_create(pri, worker, (cyg_addrword_t)i, "worker", + (void *)(&thread_stack[i]), STACKSIZE, + &thread_handle[i], &thread[i]); + + } + + breakme(); + +// Adjust the priorities of all the threads to lower than the controlling +// thread. Make them all be THE SAME priority. BREAKME(); +// +++ 1 thread, running, + N suspended ones of same prio. + + for( i = 1; i < THREADS; i++ ) + { + cyg_thread_set_priority( thread_handle[i], WORKER_PRI ); + } + + breakme(); + +// Release all the N threads, BREAKME(); +// +++ 1 thread, running, + N ready ones of same prio. + + for( i = 1; i < THREADS; i++ ) + { + cyg_thread_resume( thread_handle[i] ); + } + + breakme(); + +// Adjust the priorities of all the threads, lower than the controlling +// thread. Make them all be distinct priorities as far as possible. +// BREAKME(); +// +++ 1 thread, running, + N ready ones of different prios. + + for( i = 1; i < THREADS; i++ ) + { + pri = CONTROLLER_PRI_HI + 1 + i % WORKER_PRI_RANGE; + + cyg_thread_set_priority( thread_handle[i], pri ); + } + + breakme(); + +// Command all the N threads to sleep; switch my own priority to lower +// than theirs so that they all run and sleep, then I get back in and +// BREAKME(); +// +++ 1 thread, running, + N sleeping ones of different prios. + + worker_state = WORKER_STATE_WAIT; + + cyg_thread_set_priority( thread_handle[0], CONTROLLER_PRI_LO ); + + breakme(); + +// Make them all be THE SAME priority; BREAKME(); +// +++ 1 thread, running, + N sleeping ones of same prio. + + for( i = 1; i < THREADS; i++ ) + { + cyg_thread_set_priority( thread_handle[i], WORKER_PRI ); + } + + breakme(); + +// Wake them all up, they'll loop once and sleep again; I get in and +// BREAKME(); +// +++ 1 thread, running, + N sleeping ones of same prio. + + cyg_cond_broadcast( &worker_cv ); + + breakme(); + +// Adjust the priorities of all the threads, higher than the controlling +// thread. Make them all be distinct priorities as far as possible. +// BREAKME(); +// +++ 1 thread, running, + N sleeping ones of different prios. + + for( i = 1; i < THREADS; i++ ) + { + pri = CONTROLLER_PRI_HI + 1 + i % WORKER_PRI_RANGE; + + cyg_thread_set_priority( thread_handle[i], pri ); + } + + breakme(); + +// Wake them all up, they'll loop once and sleep again; I get in and +// BREAKME(); +// +++ 1 thread, running, + N sleeping ones of different prios. + + cyg_cond_broadcast( &worker_cv ); + + breakme(); + +// Set them all the same prio, set me to the same prio, BREAKME(); +// +++ 1 running, + N sleeping, *all* the same prio. + + for( i = 0; i < THREADS; i++ ) + { + cyg_thread_set_priority( thread_handle[i], WORKER_PRI ); + } + + breakme(); + +// Wake them all up, they'll loop once and sleep again; I get in and +// BREAKME(); repeatedly until they have all slept again. +// +++ 1 running, + some sleeping, some ready, *all* the same prio. + + cyg_cond_broadcast( &worker_cv ); + +// cyg_thread_yield(); + + do + { + breakme(); + + } while( workers_asleep != THREADS-1 ); + + breakme(); + +// Suspend some of the threads, BREAKME(); +// +++ 1 running, + some sleeping, some suspended, *all* the same prio. + + for( i = 1; i < THREADS; i++ ) + { + // suspend every 3rd thread + if( 0 == (i % 3) ) cyg_thread_suspend( thread_handle[i] ); + } + + breakme(); + + +// Change the prios all different, change my prio to highest , BREAKME(); +// +++ 1 running, + some sleeping, some suspended, different prios. + + cyg_thread_set_priority( thread_handle[0], CONTROLLER_PRI_HI ); + + for( i = 1; i < THREADS; i++ ) + { + pri = CONTROLLER_PRI_HI + 1 + i % WORKER_PRI_RANGE; + + cyg_thread_set_priority( thread_handle[i], pri ); + } + + breakme(); + +// Wake up all the threads, BREAKME(); +// +++ 1 running, + some ready, some suspended/ready, different prios. + + cyg_cond_broadcast( &worker_cv ); + + breakme(); + + +// Change my prio to lowest, let all the threads run, BREAKME(). +// +++ 1 running + some sleeping, some suspended/ready, different prios. + + cyg_thread_set_priority( thread_handle[0], CONTROLLER_PRI_LO ); + + breakme(); + +// Resume all the threads, BREAKME(); +// +++ 1 running, + N ready, different prios. + + for( i = 1; i < THREADS; i++ ) + { + cyg_thread_resume( thread_handle[i] ); + } + + breakme(); + +// Command some of the N threads to call BREAKME(); themselves (then sleep +// again). Change my prio to low, so that they all get to run and hit the +// breakpoint. +// +++ A different one running every time, others in a mixture of +// ready and sleeping states. + + worker_state = WORKER_STATE_BREAK; + + cyg_cond_broadcast( &worker_cv ); + + cyg_thread_set_priority( thread_handle[0], CONTROLLER_PRI_LO ); + + breakme(); + +// Command all the threads to exit; switch my own priority to lower +// than theirs so that they all run and exit, then I get back in and +// BREAKME(); +// +++ 1 thread, running, + N dormant ones. + + worker_state = WORKER_STATE_EXIT; + + cyg_cond_broadcast( &worker_cv ); + + breakme(); + +#if 0 + +// Cannot do this yet... + +// Destroy some of the N threads to invalidate their IDs. Re-create them +// with new IDs, so that we get IDs 1,2,4,6,8,11,12,13,14,15 in use instead +// of 1,2,3,4,5,6,7,8,9, if you see what I mean. Do all the above again. +// Loop forever, or whatever... + +#endif + + breakme(); + + CYG_TEST_PASS_FINISH("GDB Thread test OK"); + +} + +// ------------------------------------------------------------------------- + +externC void +cyg_start( void ) +{ + + CYG_TEST_INIT(); + + cyg_thread_create(CONTROLLER_PRI_HI, controller, (cyg_addrword_t)0, "controller", + (void *)(&thread_stack[0]), STACKSIZE, + &thread_handle[0], &thread[0]); + + // resume it + cyg_thread_resume(thread_handle[0]); + + + // Get the world going + cyg_scheduler_start(); + + CYG_TEST_FAIL_FINISH("Not reached"); + +} + +#else /* def CYGFUN_KERNEL_API_C */ + +externC void +cyg_start( void ) +{ + CYG_TEST_INIT(); + CYG_TEST_PASS_FINISH("Incorrect configuration for this test"); +} +#endif /* def CYGFUN_KERNEL_API_C && !def CYGSEM_KERNEL_SCHED_MLQUEUE */ + +// ------------------------------------------------------------------------- +// EOF thread_gdb.c diff --git a/packages/kernel/current/tests/tm_basic.cxx b/packages/kernel/current/tests/tm_basic.cxx new file mode 100644 --- /dev/null +++ b/packages/kernel/current/tests/tm_basic.cxx @@ -0,0 +1,1302 @@ +//========================================================================== +// +// tm_basic.cxx +// +// Basic timing test / scaffolding +// +//========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas +// Contributors: gthomas +// Date: 1998-10-19 +// Description: Very simple timing test setup +//####DESCRIPTIONEND#### + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#define NTHREADS 1 +#include "testaux.hxx" + +// Structure used to keep track of times +typedef struct fun_times { + cyg_uint32 start; + cyg_uint32 end; +} fun_times; + +#define NSAMPLES 10 +#define NTEST_THREADS 32 +#define NTHREAD_SWITCHES 128 +#define NMUTEXES 32 +#define NMBOXES 32 +#define NSEMAPHORES 32 +#define NSCHEDS 128 +#define NCOUNTERS 32 +#define NALARMS 32 + +#define STACK_SIZE 2048 // Is this large enough? +static char stacks[NTEST_THREADS][STACK_SIZE]; +static cyg_thread test_threads[NTEST_THREADS]; +static cyg_handle_t threads[NTEST_THREADS]; +static int overhead; +static cyg_sem_t synchro; +static fun_times thread_ft[NTEST_THREADS]; + +static fun_times test2_ft[NTHREAD_SWITCHES]; + +static cyg_mutex_t test_mutexes[NMUTEXES]; +static fun_times mutex_ft[NMUTEXES]; +static cyg_thread mutex_test_thread; +static cyg_handle_t mutex_test_thread_handle; + +static cyg_mbox test_mboxes[NMBOXES]; +static cyg_handle_t test_mbox_handles[NMBOXES]; +static fun_times mbox_ft[NMBOXES]; +static cyg_thread mbox_test_thread; +static cyg_handle_t mbox_test_thread_handle; + +static cyg_sem_t test_semaphores[NSEMAPHORES]; +static fun_times semaphore_ft[NSEMAPHORES]; +static cyg_thread semaphore_test_thread; +static cyg_handle_t semaphore_test_thread_handle; + +static fun_times sched_ft[NSCHEDS]; + +static cyg_counter test_counters[NCOUNTERS]; +static cyg_handle_t counters[NCOUNTERS]; +static fun_times counter_ft[NCOUNTERS]; + +static cyg_alarm test_alarms[NALARMS]; +static cyg_handle_t alarms[NALARMS]; +static fun_times alarm_ft[NALARMS]; + +externC void diag_printf(const char *, ...); +externC void sprintf(char *, const char *, ...); + +void run_sched_tests(void); +void run_thread_tests(void); +void run_thread_switch_test(void); +void run_mutex_tests(void); +void run_mutex_circuit_test(void); +void run_mbox_tests(void); +void run_mbox_circuit_test(void); +void run_semaphore_tests(void); +void run_semaphore_circuit_test(void); +void run_counter_tests(void); +void run_alarm_tests(void); + +#ifdef HAL_CLOCK_LATENCY +extern cyg_tick_count total_clock_latency, total_clock_interrupts; +extern cyg_int32 min_clock_latency, max_clock_latency; +#endif + +cyg_uint32 +ticks_to_us(cyg_uint32 ticks) +{ + int us; + // Assumes that the clock is set up for 10ms ticks + us = (10000 * ticks) / CYGNUM_KERNEL_COUNTERS_RTC_PERIOD; + return (us); +} + +// Wait until a clock tick [real time clock] has passed. This should keep it +// from happening again during a measurement, thus minimizing any fluctuations +void +wait_for_tick(void) +{ + cyg_uint32 tv0, tv1; + HAL_CLOCK_READ(&tv0); + while (true) { + HAL_CLOCK_READ(&tv1); + if (tv1 < tv0) break; + tv0 = tv1; + } +} + +// Compute a name for a thread +char * +thread_name(char *basename, int indx) { + return "<>"; // Not currently used +} + +// test0 - null test, never executed +void +test0(cyg_uint32 indx) +{ + diag_printf("test0.%d executed?\n", indx); + cyg_thread_exit(); +} + +// test1 - empty test, simply exit. Last thread signals parent. +void +test1(cyg_uint32 indx) +{ + if (indx == (NTEST_THREADS-1)) { + cyg_semaphore_post(&synchro); // Signal that last thread is dying + } + cyg_thread_exit(); +} + +// test2 - measure thread switch times +void +test2(cyg_uint32 indx) +{ + int i; + for (i = 0; i < NTHREAD_SWITCHES; i++) { + if (indx == 0) { + HAL_CLOCK_READ(&test2_ft[i].start); + } else { + HAL_CLOCK_READ(&test2_ft[i].end); + } + cyg_thread_yield(); + } + if (indx == 1) { + cyg_semaphore_post(&synchro); + } + cyg_thread_exit(); +} + +// Full-circuit mutex unlock/lock test +void +mutex_test(cyg_uint32 indx) +{ + int i; + cyg_mutex_lock(&test_mutexes[0]); + for (i = 0; i < NMUTEXES; i++) { + cyg_semaphore_wait(&synchro); + wait_for_tick(); // Wait until the next clock tick to minimize aberations + HAL_CLOCK_READ(&mutex_ft[i].start); + cyg_mutex_unlock(&test_mutexes[0]); + cyg_mutex_lock(&test_mutexes[0]); + cyg_semaphore_post(&synchro); + } + cyg_thread_exit(); +} + +// Full-circuit mbox put/get test +void +mbox_test(cyg_uint32 indx) +{ + void *item; + do { + item = cyg_mbox_get(test_mbox_handles[0]); + HAL_CLOCK_READ(&mbox_ft[(int)item].end); + cyg_semaphore_post(&synchro); + } while ((int)item != (NMBOXES-1)); + cyg_thread_exit(); +} + +// Full-circuit semaphore post/wait test +void +semaphore_test(cyg_uint32 indx) +{ + int i; + for (i = 0; i < NSEMAPHORES; i++) { + cyg_semaphore_wait(&test_semaphores[0]); + HAL_CLOCK_READ(&semaphore_ft[i].end); + cyg_semaphore_post(&synchro); + } + cyg_thread_exit(); +} + +void +show_times_hdr(void) +{ + diag_printf("\n"); + diag_printf(" Ave Min Max Variance Function\n"); + diag_printf("====== ====== ====== ======== ========\n"); +} + +void +show_times(fun_times ft[], int nsamples, char *title) +{ + int i, delta, min, max; + cyg_uint32 total, ave, var; + total = 0; + min = 0x7FFFFFFF; + max = 0; + for (i = 0; i < nsamples; i++) { + if (ft[i].end < ft[i].start) { + // Clock wrapped around (timer tick) + delta = (ft[i].end+CYGNUM_KERNEL_COUNTERS_RTC_PERIOD) - ft[i].start; + } else { + delta = ft[i].end - ft[i].start; + } + delta -= 2*overhead; + if (delta < 0) delta = 0; + total += delta; + if (delta < min) min = delta; + if (delta > max) max = delta; + } + ave = total / nsamples; + total = 0; + for (i = 0; i < nsamples; i++) { + if (ft[i].end < ft[i].start) { + // Clock wrapped around (timer tick) + delta = (ft[i].end+CYGNUM_KERNEL_COUNTERS_RTC_PERIOD) - ft[i].start; + } else { + delta = ft[i].end - ft[i].start; + } + delta -= 2*overhead; + if (delta < 0) delta = 0; + total = (delta - ave) * (delta - ave); + } + var = total / (nsamples - 1); + diag_printf("%6d %6d %6d %6d %s\n", + ticks_to_us(ave), ticks_to_us(min), ticks_to_us(max), ticks_to_us(var), title); +} + +void +show_test_parameters(void) +{ + diag_printf("\nTesting parameters:\n"); + diag_printf(" Clock samples: %3d\n", NSAMPLES); + diag_printf(" Threads: %3d\n", NTEST_THREADS); + diag_printf(" Thread switches: %3d\n", NTHREAD_SWITCHES); + diag_printf(" Mutexes: %3d\n", NMUTEXES); + diag_printf(" Mailboxes: %3d\n", NMBOXES); + diag_printf(" Semaphores: %3d\n", NSEMAPHORES); + diag_printf(" Scheduler operations: %3d\n", NSCHEDS); + diag_printf(" Counters: %3d\n", NCOUNTERS); + diag_printf(" Alarms: %3d\n", NALARMS); + diag_printf("\n"); +} + +void +run_thread_tests(void) +{ + int i; + cyg_priority_t prio; + + // Set my priority higher than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 2); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_create(10, // Priority - just a number + test0, // entry + i, // index + thread_name("thread", i), // Name + &stacks[i][0], // Stack + STACK_SIZE, // Size + &threads[i], // Handle + &test_threads[i] // Thread data structure + ); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Create thread"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_yield(); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Yield thread [all suspended]"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_suspend(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Suspend [suspended] thread"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_resume(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Resume thread"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_set_priority(threads[i], 11); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Set priority"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + prio = cyg_thread_get_priority(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Get priority"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_kill(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Kill [suspended] thread"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_yield(); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Yield [no other] thread"); + + // Set my priority higher than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 2); + + // Recreate the test set + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_create(10, // Priority - just a number + test0, // entry + i, // index + thread_name("thread", i), // Name + &stacks[i][0], // Stack + STACK_SIZE, // Size + &threads[i], // Handle + &test_threads[i] // Thread data structure + ); + } + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_resume(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Resume [suspended low priority] thread"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_resume(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Resume [runnable low priority] thread"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_suspend(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Suspend [runnable] thread"); + + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_yield(); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Yield [only low prio] thread"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_suspend(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Suspend [runnable->not runnable] thread"); + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_resume(threads[i]); + } + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_kill(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Kill [runnable] thread"); + // Set my priority lower than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 3); + + // Set up the end-of-threads synchronizer + cyg_semaphore_init(&synchro, 0); + + // Recreate the test set + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_create(2, // Priority - just a number + test1, // entry + i, // index + thread_name("thread", i), // Name + &stacks[i][0], // Stack + STACK_SIZE, // Size + &threads[i], // Handle + &test_threads[i] // Thread data structure + ); + } + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NTEST_THREADS; i++) { + HAL_CLOCK_READ(&thread_ft[i].start); + cyg_thread_resume(threads[i]); + HAL_CLOCK_READ(&thread_ft[i].end); + } + show_times(thread_ft, NTEST_THREADS, "Resume [high priority] thread"); + cyg_semaphore_wait(&synchro); // Wait for all threads to finish + // Make sure they are all dead + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_kill(threads[i]); + } + + run_thread_switch_test(); +} + +void +run_thread_switch_test(void) +{ + int i; + + // Set up for thread context switch + for (i = 0; i < 2; i++) { + cyg_thread_create(10, // Priority - just a number + test2, // entry + i, // index + thread_name("thread", i), // Name + &stacks[i][0], // Stack + STACK_SIZE, // Size + &threads[i], // Handle + &test_threads[i] // Thread data structure + ); + cyg_thread_resume(threads[i]); + } + // Set up the end-of-threads synchronizer + cyg_semaphore_init(&synchro, 0); + cyg_semaphore_wait(&synchro); + wait_for_tick(); // Wait until the next clock tick to minimize aberations + show_times(test2_ft, NTHREAD_SWITCHES, "Thread switch"); + // Clean up + for (i = 0; i < 2; i++) { + cyg_thread_kill(threads[i]); + } +} + +void +run_mutex_tests(void) +{ + int i; + + // Mutex primitives + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMUTEXES; i++) { + HAL_CLOCK_READ(&mutex_ft[i].start); + cyg_mutex_init(&test_mutexes[i]); + HAL_CLOCK_READ(&mutex_ft[i].end); + } + show_times(mutex_ft, NMUTEXES, "Init mutex"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMUTEXES; i++) { + HAL_CLOCK_READ(&mutex_ft[i].start); + cyg_mutex_lock(&test_mutexes[i]); + HAL_CLOCK_READ(&mutex_ft[i].end); + } + show_times(mutex_ft, NMUTEXES, "Lock [unlocked] mutex"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMUTEXES; i++) { + HAL_CLOCK_READ(&mutex_ft[i].start); + cyg_mutex_unlock(&test_mutexes[i]); + HAL_CLOCK_READ(&mutex_ft[i].end); + } + show_times(mutex_ft, NMUTEXES, "Unlock [locked] mutex"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMUTEXES; i++) { + HAL_CLOCK_READ(&mutex_ft[i].start); + cyg_mutex_trylock(&test_mutexes[i]); + HAL_CLOCK_READ(&mutex_ft[i].end); + } + show_times(mutex_ft, NMUTEXES, "Trylock [unlocked] mutex"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMUTEXES; i++) { + HAL_CLOCK_READ(&mutex_ft[i].start); + cyg_mutex_trylock(&test_mutexes[i]); + HAL_CLOCK_READ(&mutex_ft[i].end); + } + show_times(mutex_ft, NMUTEXES, "Trylock [locked] mutex"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMUTEXES; i++) { + HAL_CLOCK_READ(&mutex_ft[i].start); + cyg_mutex_destroy(&test_mutexes[i]); + HAL_CLOCK_READ(&mutex_ft[i].end); + } + show_times(mutex_ft, NMUTEXES, "Destroy mutex"); + run_mutex_circuit_test(); +} + +void +run_mutex_circuit_test(void) +{ + int i; + // Set my priority lower than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 4); + // Set up for full mutex unlock/lock test + cyg_mutex_init(&test_mutexes[0]); + cyg_semaphore_init(&synchro, 0); + cyg_thread_create(3, // Priority - just a number + mutex_test, // entry + 0, // index + thread_name("thread", 0), // Name + &stacks[0][0], // Stack + STACK_SIZE, // Size + &mutex_test_thread_handle, // Handle + &mutex_test_thread // Thread data structure + ); + cyg_thread_resume(mutex_test_thread_handle); + // Need to raise priority so that this thread will block on the "lock" + cyg_thread_set_priority(cyg_thread_self(), 2); + for (i = 0; i < NMUTEXES; i++) { + cyg_semaphore_post(&synchro); + cyg_mutex_lock(&test_mutexes[0]); + HAL_CLOCK_READ(&mutex_ft[i].end); + cyg_mutex_unlock(&test_mutexes[0]); + cyg_semaphore_wait(&synchro); + } + show_times(mutex_ft, NMUTEXES, "Unlock/Lock mutex"); +} + +void +run_mbox_tests(void) +{ + int i, cnt; + void *item; + // Mailbox primitives + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cyg_mbox_create(&test_mbox_handles[i], &test_mboxes[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Create mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cnt = cyg_mbox_peek(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Peek [empty] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cyg_mbox_put(test_mbox_handles[i], (void *)i); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Put [first] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cnt = cyg_mbox_peek(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Peek [1 msg] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cyg_mbox_put(test_mbox_handles[i], (void *)i); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Put [second] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cnt = cyg_mbox_peek(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Peek [2 msgs] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + item = cyg_mbox_get(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Get [first] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + item = cyg_mbox_get(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Get [second] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cyg_mbox_tryput(test_mbox_handles[i], (void *)i); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Tryput [first] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + item = cyg_mbox_peek_item(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Peek item [non-empty] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + item = cyg_mbox_tryget(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Tryget [non-empty] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + item = cyg_mbox_peek_item(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Peek item [empty] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + item = cyg_mbox_tryget(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Tryget [empty] mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cyg_mbox_waiting_to_get(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Waiting to get mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cyg_mbox_waiting_to_put(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Waiting to put mbox"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NMBOXES; i++) { + HAL_CLOCK_READ(&mbox_ft[i].start); + cyg_mbox_delete(test_mbox_handles[i]); + HAL_CLOCK_READ(&mbox_ft[i].end); + } + show_times(mbox_ft, NMBOXES, "Delete mbox"); + + run_mbox_circuit_test(); +} + +void +run_mbox_circuit_test(void) +{ + int i; + // Set my priority lower than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 3); + // Set up for full mbox put/get test + cyg_mbox_create(&test_mbox_handles[0], &test_mboxes[0]); + cyg_semaphore_init(&synchro, 0); + cyg_thread_create(2, // Priority - just a number + mbox_test, // entry + 0, // index + thread_name("thread", 0), // Name + &stacks[0][0], // Stack + STACK_SIZE, // Size + &mbox_test_thread_handle, // Handle + &mbox_test_thread // Thread data structure + ); + cyg_thread_resume(mbox_test_thread_handle); + for (i = 0; i < NMBOXES; i++) { + wait_for_tick(); // Wait until the next clock tick to minimize aberations + HAL_CLOCK_READ(&mbox_ft[i].start); + cyg_mbox_put(test_mbox_handles[0], (void *)i); + cyg_semaphore_wait(&synchro); + } + show_times(mbox_ft, NMBOXES, "Put/Get mbox"); +} + +void +run_semaphore_tests(void) +{ + int i; + cyg_ucount32 sem_val; + // Semaphore primitives + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSEMAPHORES; i++) { + HAL_CLOCK_READ(&semaphore_ft[i].start); + cyg_semaphore_init(&test_semaphores[i], 0); + HAL_CLOCK_READ(&semaphore_ft[i].end); + } + show_times(semaphore_ft, NSEMAPHORES, "Init semaphore"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSEMAPHORES; i++) { + HAL_CLOCK_READ(&semaphore_ft[i].start); + cyg_semaphore_post(&test_semaphores[i]); + HAL_CLOCK_READ(&semaphore_ft[i].end); + } + show_times(semaphore_ft, NSEMAPHORES, "Post [0] semaphore"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSEMAPHORES; i++) { + HAL_CLOCK_READ(&semaphore_ft[i].start); + cyg_semaphore_wait(&test_semaphores[i]); + HAL_CLOCK_READ(&semaphore_ft[i].end); + } + show_times(semaphore_ft, NSEMAPHORES, "Wait [1] semaphore"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSEMAPHORES; i++) { + HAL_CLOCK_READ(&semaphore_ft[i].start); + cyg_semaphore_trywait(&test_semaphores[i]); + HAL_CLOCK_READ(&semaphore_ft[i].end); + } + show_times(semaphore_ft, NSEMAPHORES, "Trywait [0] semaphore"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSEMAPHORES; i++) { + cyg_semaphore_post(&test_semaphores[i]); + HAL_CLOCK_READ(&semaphore_ft[i].start); + cyg_semaphore_trywait(&test_semaphores[i]); + HAL_CLOCK_READ(&semaphore_ft[i].end); + } + show_times(semaphore_ft, NSEMAPHORES, "Trywait [1] semaphore"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSEMAPHORES; i++) { + HAL_CLOCK_READ(&semaphore_ft[i].start); + cyg_semaphore_peek(&test_semaphores[i], &sem_val); + HAL_CLOCK_READ(&semaphore_ft[i].end); + } + show_times(semaphore_ft, NSEMAPHORES, "Peek semaphore"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSEMAPHORES; i++) { + HAL_CLOCK_READ(&semaphore_ft[i].start); + cyg_semaphore_destroy(&test_semaphores[i]); + HAL_CLOCK_READ(&semaphore_ft[i].end); + } + show_times(semaphore_ft, NSEMAPHORES, "Destroy semaphore"); + + run_semaphore_circuit_test(); +} + +void +run_semaphore_circuit_test(void) +{ + int i; + // Set my priority lower than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 3); + // Set up for full semaphore post/wait test + cyg_semaphore_init(&test_semaphores[0], 0); + cyg_semaphore_init(&synchro, 0); + cyg_thread_create(2, // Priority - just a number + semaphore_test, // entry + 0, // index + thread_name("thread", 0), // Name + &stacks[0][0], // Stack + STACK_SIZE, // Size + &semaphore_test_thread_handle, // Handle + &semaphore_test_thread // Thread data structure + ); + cyg_thread_resume(semaphore_test_thread_handle); + for (i = 0; i < NSEMAPHORES; i++) { + wait_for_tick(); // Wait until the next clock tick to minimize aberations + HAL_CLOCK_READ(&semaphore_ft[i].start); + cyg_semaphore_post(&test_semaphores[0]); + cyg_semaphore_wait(&synchro); + } + show_times(semaphore_ft, NSEMAPHORES, "Post/Wait semaphore"); +} + +void +run_counter_tests(void) +{ + int i; + cyg_tick_count_t val; + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NCOUNTERS; i++) { + HAL_CLOCK_READ(&counter_ft[i].start); + cyg_counter_create(&counters[i], &test_counters[i]); + HAL_CLOCK_READ(&counter_ft[i].end); + } + show_times(counter_ft, NCOUNTERS, "Create counter"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NCOUNTERS; i++) { + HAL_CLOCK_READ(&counter_ft[i].start); + val = cyg_counter_current_value(counters[i]); + HAL_CLOCK_READ(&counter_ft[i].end); + } + show_times(counter_ft, NCOUNTERS, "Get counter value"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NCOUNTERS; i++) { + HAL_CLOCK_READ(&counter_ft[i].start); + cyg_counter_set_value(counters[i], val); + HAL_CLOCK_READ(&counter_ft[i].end); + } + show_times(counter_ft, NCOUNTERS, "Set counter value"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NCOUNTERS; i++) { + HAL_CLOCK_READ(&counter_ft[i].start); + cyg_counter_tick(counters[i]); + HAL_CLOCK_READ(&counter_ft[i].end); + } + show_times(counter_ft, NCOUNTERS, "Tick counter"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NCOUNTERS; i++) { + HAL_CLOCK_READ(&counter_ft[i].start); + cyg_counter_delete(counters[i]); + HAL_CLOCK_READ(&counter_ft[i].end); + } + show_times(counter_ft, NCOUNTERS, "Delete counter"); +} + +// Alarm callback function +void +alarm_cb(cyg_handle_t alarm, cyg_addrword_t val) +{ + // empty call back +} + +// Callback used to test determinancy +static volatile int alarm_cnt; +void +alarm_cb2(cyg_handle_t alarm, cyg_addrword_t indx) +{ + if (alarm_cnt == NSCHEDS) return; + sched_ft[alarm_cnt].start = 0; + HAL_CLOCK_READ(&sched_ft[alarm_cnt++].end); + if (alarm_cnt == NSCHEDS) { + cyg_semaphore_post(&synchro); + } +} + +// Null thread, used to keep scheduler busy +void +alarm_test(cyg_uint32 id) +{ + while (true) { + cyg_thread_yield(); + } +} + +void +run_alarm_tests(void) +{ + int i; + cyg_tick_count_t init_val, step_val; + cyg_handle_t rtc_handle; + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NCOUNTERS; i++) { + cyg_counter_create(&counters[i], &test_counters[i]); + } + for (i = 0; i < NALARMS; i++) { + HAL_CLOCK_READ(&alarm_ft[i].start); + cyg_alarm_create(counters[0], alarm_cb, 0, &alarms[i], &test_alarms[i]); + HAL_CLOCK_READ(&alarm_ft[i].end); + } + show_times(alarm_ft, NALARMS, "Create alarm"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + init_val = 0; step_val = 0; + for (i = 0; i < NALARMS; i++) { + HAL_CLOCK_READ(&alarm_ft[i].start); + cyg_alarm_initialize(alarms[i], init_val, step_val); + HAL_CLOCK_READ(&alarm_ft[i].end); + } + show_times(alarm_ft, NALARMS, "Initialize alarm"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + init_val = 0; step_val = 0; + for (i = 0; i < NALARMS; i++) { + HAL_CLOCK_READ(&alarm_ft[i].start); + cyg_alarm_disable(alarms[i]); + HAL_CLOCK_READ(&alarm_ft[i].end); + } + show_times(alarm_ft, NALARMS, "Disable alarm"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + init_val = 0; step_val = 0; + for (i = 0; i < NALARMS; i++) { + HAL_CLOCK_READ(&alarm_ft[i].start); + cyg_alarm_enable(alarms[i]); + HAL_CLOCK_READ(&alarm_ft[i].end); + } + show_times(alarm_ft, NALARMS, "Enable alarm"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NALARMS; i++) { + HAL_CLOCK_READ(&alarm_ft[i].start); + cyg_alarm_delete(alarms[i]); + HAL_CLOCK_READ(&alarm_ft[i].end); + } + show_times(alarm_ft, NALARMS, "Delete alarm"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + cyg_counter_create(&counters[0], &test_counters[0]); + cyg_alarm_create(counters[0], alarm_cb, 0, &alarms[0], &test_alarms[0]); + init_val = 9999; step_val = 9999; + cyg_alarm_initialize(alarms[0], init_val, step_val); + cyg_alarm_enable(alarms[0]); + for (i = 0; i < NCOUNTERS; i++) { + HAL_CLOCK_READ(&counter_ft[i].start); + cyg_counter_tick(counters[0]); + HAL_CLOCK_READ(&counter_ft[i].end); + } + show_times(counter_ft, NCOUNTERS, "Tick counter [1 alarm]"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + cyg_counter_create(&counters[0], &test_counters[0]); + for (i = 0; i < NALARMS; i++) { + cyg_alarm_create(counters[0], alarm_cb, 0, &alarms[i], &test_alarms[i]); + init_val = 9999; step_val = 9999; + cyg_alarm_initialize(alarms[i], init_val, step_val); + cyg_alarm_enable(alarms[i]); + } + for (i = 0; i < NCOUNTERS; i++) { + HAL_CLOCK_READ(&counter_ft[i].start); + cyg_counter_tick(counters[0]); + HAL_CLOCK_READ(&counter_ft[i].end); + } + show_times(counter_ft, NCOUNTERS, "Tick counter [many alarms]"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + cyg_counter_create(&counters[0], &test_counters[0]); + cyg_alarm_create(counters[0], alarm_cb, 0, &alarms[0], &test_alarms[0]); + init_val = 1; step_val = 1; + cyg_alarm_initialize(alarms[0], init_val, step_val); + cyg_alarm_enable(alarms[0]); + for (i = 0; i < NCOUNTERS; i++) { + HAL_CLOCK_READ(&counter_ft[i].start); + cyg_counter_tick(counters[0]); + HAL_CLOCK_READ(&counter_ft[i].end); + } + show_times(counter_ft, NCOUNTERS, "Tick & fire counter [1 alarm]"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + cyg_counter_create(&counters[0], &test_counters[0]); + for (i = 0; i < NALARMS; i++) { + cyg_alarm_create(counters[0], alarm_cb, i, &alarms[i], &test_alarms[i]); + init_val = 1; step_val = 1; + cyg_alarm_initialize(alarms[i], init_val, step_val); + cyg_alarm_enable(alarms[i]); + } + for (i = 0; i < NCOUNTERS; i++) { + HAL_CLOCK_READ(&counter_ft[i].start); + cyg_counter_tick(counters[0]); + HAL_CLOCK_READ(&counter_ft[i].end); + } + for (i = 0; i < NALARMS; i++) { + cyg_alarm_delete(alarms[i]); + } + show_times(counter_ft, NCOUNTERS, "Tick & fire counter [many alarms]"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + cyg_clock_to_counter(cyg_real_time_clock(), &rtc_handle); + cyg_alarm_create(rtc_handle, alarm_cb2, 0, &alarms[0], &test_alarms[0]); + init_val = 5; step_val = 5; alarm_cnt = 0; + cyg_alarm_initialize(alarms[0], init_val, step_val); + cyg_semaphore_init(&synchro, 0); + cyg_alarm_enable(alarms[0]); + cyg_semaphore_wait(&synchro); + cyg_alarm_disable(alarms[0]); + cyg_alarm_delete(alarms[0]); + show_times(sched_ft, NSCHEDS, "Alarm latency [0 threads]"); + + // Set my priority higher than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 2); + for (i = 0; i < 2; i++) { + cyg_thread_create(10, // Priority - just a number + alarm_test, // entry + i, // index + thread_name("thread", i), // Name + &stacks[i][0], // Stack + STACK_SIZE, // Size + &threads[i], // Handle + &test_threads[i] // Thread data structure + ); + cyg_thread_resume(threads[i]); + } + wait_for_tick(); // Wait until the next clock tick to minimize aberations + cyg_clock_to_counter(cyg_real_time_clock(), &rtc_handle); + cyg_alarm_create(rtc_handle, alarm_cb2, 0, &alarms[0], &test_alarms[0]); + init_val = 5; step_val = 5; alarm_cnt = 0; + cyg_alarm_initialize(alarms[0], init_val, step_val); + cyg_semaphore_init(&synchro, 0); + cyg_alarm_enable(alarms[0]); + cyg_semaphore_wait(&synchro); + cyg_alarm_disable(alarms[0]); + cyg_alarm_delete(alarms[0]); + show_times(sched_ft, NSCHEDS, "Alarm latency [2 threads]"); + for (i = 0; i < 2; i++) { + cyg_thread_suspend(threads[i]); + cyg_thread_kill(threads[i]); + } + + // Set my priority higher than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 2); + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_create(10, // Priority - just a number + alarm_test, // entry + i, // index + thread_name("thread", i), // Name + &stacks[i][0], // Stack + STACK_SIZE, // Size + &threads[i], // Handle + &test_threads[i] // Thread data structure + ); + cyg_thread_resume(threads[i]); + } + wait_for_tick(); // Wait until the next clock tick to minimize aberations + cyg_clock_to_counter(cyg_real_time_clock(), &rtc_handle); + cyg_alarm_create(rtc_handle, alarm_cb2, 0, &alarms[0], &test_alarms[0]); + init_val = 5; step_val = 5; alarm_cnt = 0; + cyg_alarm_initialize(alarms[0], init_val, step_val); + cyg_semaphore_init(&synchro, 0); + cyg_alarm_enable(alarms[0]); + cyg_semaphore_wait(&synchro); + cyg_alarm_disable(alarms[0]); + cyg_alarm_delete(alarms[0]); + show_times(sched_ft, NSCHEDS, "Alarm latency [many threads]"); + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_suspend(threads[i]); + cyg_thread_kill(threads[i]); + } +} + +void +run_sched_tests(void) +{ + int i; + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSCHEDS; i++) { + HAL_CLOCK_READ(&sched_ft[i].start); + cyg_scheduler_lock(); + HAL_CLOCK_READ(&sched_ft[i].end); + cyg_scheduler_unlock(); + } + show_times(sched_ft, NSCHEDS, "Scheduler lock"); + + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSCHEDS; i++) { + cyg_scheduler_lock(); + HAL_CLOCK_READ(&sched_ft[i].start); + cyg_scheduler_unlock(); + HAL_CLOCK_READ(&sched_ft[i].end); + } + show_times(sched_ft, NSCHEDS, "Scheduler unlock [0 threads]"); + + // Set my priority higher than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 2); + for (i = 0; i < 1; i++) { + cyg_thread_create(10, // Priority - just a number + test0, // entry + i, // index + thread_name("thread", i), // Name + &stacks[i][0], // Stack + STACK_SIZE, // Size + &threads[i], // Handle + &test_threads[i] // Thread data structure + ); + } + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSCHEDS; i++) { + cyg_scheduler_lock(); + HAL_CLOCK_READ(&sched_ft[i].start); + cyg_scheduler_unlock(); + HAL_CLOCK_READ(&sched_ft[i].end); + } + show_times(sched_ft, NSCHEDS, "Scheduler unlock [1 suspended thread]"); + for (i = 0; i < 1; i++) { + cyg_thread_kill(threads[i]); + } + + // Set my priority higher than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 2); + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_create(10, // Priority - just a number + test0, // entry + i, // index + thread_name("thread", i), // Name + &stacks[i][0], // Stack + STACK_SIZE, // Size + &threads[i], // Handle + &test_threads[i] // Thread data structure + ); + } + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSCHEDS; i++) { + cyg_scheduler_lock(); + HAL_CLOCK_READ(&sched_ft[i].start); + cyg_scheduler_unlock(); + HAL_CLOCK_READ(&sched_ft[i].end); + } + show_times(sched_ft, NSCHEDS, "Scheduler unlock [many suspended threads]"); + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_kill(threads[i]); + } + + // Set my priority higher than any I plan to create + cyg_thread_set_priority(cyg_thread_self(), 2); + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_create(10, // Priority - just a number + test0, // entry + i, // index + thread_name("thread", i), // Name + &stacks[i][0], // Stack + STACK_SIZE, // Size + &threads[i], // Handle + &test_threads[i] // Thread data structure + ); + cyg_thread_resume(threads[i]); + } + wait_for_tick(); // Wait until the next clock tick to minimize aberations + for (i = 0; i < NSCHEDS; i++) { + cyg_scheduler_lock(); + HAL_CLOCK_READ(&sched_ft[i].start); + cyg_scheduler_unlock(); + HAL_CLOCK_READ(&sched_ft[i].end); + } + show_times(sched_ft, NSCHEDS, "Scheduler unlock [many low prio threads]"); + for (i = 0; i < NTEST_THREADS; i++) { + cyg_thread_kill(threads[i]); + } +} + +void +run_all_tests(CYG_ADDRESS id) +{ + int i; + cyg_uint32 tv[NSAMPLES], tv0, tv1, us; + cyg_tick_count_t ticks; +#ifdef CYG_SCHEDULER_LOCK_TIMINGS + cyg_uint32 lock_ave, lock_max; +#endif +#ifdef HAL_CLOCK_LATENCY + cyg_int32 clock_ave; +#endif + + for (i = 0; i < NSAMPLES; i++) { + HAL_CLOCK_READ(&tv[i]); + } + diag_printf("Clock: "); + tv0 = 0; + for (i = 0; i < NSAMPLES; i++) { + diag_printf("%x ", tv[i]); + if (i > 0) { + tv0 += tv[i] - tv[i-1]; + } + } + diag_printf("\n"); + + overhead = tv0 / (NSAMPLES-1); + diag_printf("Average %d clock ticks overhead\n", overhead); + + // Try and measure how long the clock interrupt handling takes + HAL_CLOCK_READ(&tv0); + while (true) { + HAL_CLOCK_READ(&tv1); + if (tv1 < tv0) break; + tv0 = tv1; + } + tv1 -= overhead; // Adjust out the cost of getting the timer value + us = ticks_to_us(tv1); + diag_printf("Clock interrupt took %d microseconds (%d clock ticks)\n", us, tv1); + + ticks = cyg_current_time(); + diag_printf("Ticks: %x\n", (int)ticks); + + show_test_parameters(); + show_times_hdr(); + + run_thread_tests(); + run_sched_tests(); + run_mutex_tests(); + run_mbox_tests(); + run_semaphore_tests(); + run_counter_tests(); + run_alarm_tests(); + +#ifdef CYG_SCHEDULER_LOCK_TIMINGS + Cyg_Scheduler::get_lock_times(&lock_ave, &lock_max); + diag_printf("\nMax lock: %d, Ave lock: %d\n", ticks_to_us(lock_max), ticks_to_us(lock_ave)); +#endif + +#ifdef HAL_CLOCK_LATENCY + clock_ave = total_clock_latency / total_clock_interrupts; + diag_printf("\nClock/interrupt latency - ave: %d, min: %d, max: %d\n", + ticks_to_us(clock_ave), ticks_to_us(min_clock_latency), ticks_to_us(max_clock_latency)); +#endif + + ticks = cyg_current_time(); + diag_printf("\nTiming complete - %d ms total\n", (int)ticks*10); + + CYG_TEST_PASS_FINISH("Basic timing OK"); +} + +void tm_basic_main( void ) +{ + CYG_TEST_INIT(); + + new_thread(run_all_tests, 0); + + Cyg_Scheduler::scheduler.start(); +} + +externC void +cyg_start( void ) +{ + tm_basic_main(); +} +// EOF tm_basic.cxx diff --git a/packages/language/c/libc/current/ChangeLog b/packages/language/c/libc/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/ChangeLog @@ -0,0 +1,1643 @@ +Wed Oct 28 17:31:21 1998 Jonathan Larmour + + * src/time/clock.cxx (_clock): + Reorder scaling expression as it was both incorrect and risked + overflow. + Fix for PR 18076 + +Mon Oct 19 14:40:06 1998 Jonathan Larmour + + * include/stdio.h (EOF): + Change from -64 to (-1), to allow broken code to work :-/ + Also change other negative defines to be within parentheses + +1998-10-19 Mark Galassi + + * include/pkgconf/libc.h: updated the doc URL + +Thu Oct 15 21:33:44 1998 Jonathan Larmour + + * src/clibincl/clibdata.hxx: + Only include kernel thread headers when we're in thread-safe mode + + * src/time/clock.cxx: + Only include kernel clock headers if there's a kernel with the + right functionality available + + * tests/time/clock.c: + Remove unnecessary inclusion of + + Above changes are required for PR 17229 + +Wed Oct 14 16:38:55 1998 Jonathan Larmour + + * src/clibincl/clibdata.hxx, src/clibincl/clibdata.inl: + Conditionalise inclusion of clibincl/stdiosupp.hxx and + clibincl/stream.hxx. Tidying up PR 17502 + +Wed Oct 14 14:08:56 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Rename CYGPKG_LIBC_STRING_OPTIMISATIONS to + CYGPKG_LIBC_STRING_OPTIMIZATIONS to make it truely merkin. + +Tue Oct 13 19:34:41 1998 Jonathan Larmour + + * include/pkgconf/libc.h (CYGDAT_LIBC_ARGUMENTS): + Add a default argv[0] of "" as many programs assume argc>0 + The standard allows argv[0] to be "" if the program name + is not available + +1998-09-26 Bart Veer + + * src/clibincl/stdiosupp.hxx: + PR 17502: this header file now does nothing if the stdio option + is disabled completely. This is the same behaviour is + clibincl/stream.hxx, although arguably the #ifdef protection + should happen wherever the header file is #include'd rather than + in the header file itself. + + * src/clibincl/clibdata.hxx: + PR 17502: this header file still #include's internal stdio-related + header files and references the FILE structure, even if stdio is + disabled. There were some #ifdef's for CYGPKG_LIBC_STDIO already. + One more has been added for _fopen() and _fclose(). + +1998-09-25 Bart Veer + + * src/clibincl/streambuf.inl (Cyg_StdioStreamBuffer): + PR 17487: Reorder the calls to initialize member fields, to + eliminate a compiler warning. + +Fri Sep 25 19:04:29 1998 Jonathan Larmour + + * src/errno/errno.cxx, src/stdlib/bsearch.cxx, + src/stdlib/qsort.cxx, src/stdlib/rand.cxx, src/string/strtok.cxx, + src/time/clock.cxx: + Only define tracing variable and tracing level macro when + the relevant tracing level config options are set. Otherwise + keep the tracing level fixed at 0 + Fix for PR 17476 + + * include/pkgconf/libc.h: + Define trace levels only if parent CYGPKG_LIBC_TRACE is defined + for consistency with Configuration Tool + + +Fri Sep 25 17:24:45 1998 Jonathan Larmour + + * src/stdio/common/stdioinlines.cxx: + Make definition of vscanf() dependent on CYGFUN_LIBC_STDIO_ungetc + otherwise _vfscanf() won't be compiled. This therefore would + cause a link fail iff selective linking is not enabled. + Fix for PR 17455 + +Fri Sep 25 17:23:17 1998 Jonathan Larmour + + * src/stdlib/rand.cxx: + Make compilation dependent on CYGPKG_LIBC_RAND + Fix for PR 17473 + + * tests/stdlib/srand.c: + Make definition of dummy test pass conditional on CYGPKG_LIBC_RAND + not being defined, as well as CYGPKG_LIBC + Caused compilation failure when testing PR 17473 fix + +Mon Sep 21 17:11:04 1998 Jonathan Larmour + + * tests/stdio/sscanf.c: + Make sscanf test conditional on CYGFUN_LIBC_STDIO_ungetc since + _vfscanf() only gets compiled if this is defined + Fix for PR 17346 + +1998-09-20 Mark Galassi + + * include/pkgconf/libc.h: updated CDL doc strings. + +Fri Sep 18 22:18:47 1998 Jonathan Larmour + + * src/clibincl/clibdata.inl (get_errno_p): + Rather than this function only being available in thread-safe mode, + instead make what it returns be either the per-thread errno, or + global errno depending on the configuration. + Include (conditionally) to support this change + +Wed Sep 16 11:20:31 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Remove "fix me" comment which I forgot to remove before + +Tue Sep 15 19:27:57 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Updated descriptions and a few other minor things after review. + Notably though, the NDEBUG config option has been removed + +1998-09-15 Bart Veer + + * include/pkgconf/libc.h: + PR 17201: removed dependency on CYGPKG_KERNEL in the option + CYGNUM_LIBC_MAIN_STACK_SIZE, since the actual dependencies cannot + be expressed sensibly in the current system. + +1998-09-11 Bart Veer + + * include/pkgconf/libc.h: + Sorting out dependencies for error package. + +1998-09-10 Mark Galassi + + * include/pkgconf/libc.h: started adding doc fields to the + cdl_package data, as a pilot for now. + +Wed Sep 9 17:41:23 1998 Hugo Tyson + + * include/pkgconf/libc.h: + Add option CYGIMP_LIBC_MALLOC_CXX_DELETE_CALLS_FREE to explicitly + control whether the empty delete functions (currently) in + kernel/.../common/delete.cxx are enabled; controls code bloat, see + the comments in delete.cxx. + +Fri Sep 4 16:43:38 1998 Jonathan Larmour + + * tests/stdio/stdiooutput.c: + Add a default CYG_TEST_PASS() to make sure the test infra doesn't + complain. + Also remove the unused string functionsa + +Fri Sep 4 15:43:48 1998 Hugo Tyson + + * src/stdlib/exit.cxx (__libc_exit): + * src/stdlib/_exit.cxx (__libc__exit): + * src/stdlib/malloc.cxx (_free): + * src/stdlib/abort.cxx (abort): + * src/support/cstartup.cxx (invoke_main): + Tracing system asserted cos it was being called incorrectly; these + are void functions so you shouldn't give a type to the function + reporting call. + +Fri Sep 4 15:03:10 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Fix CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE description to refer to + the table.cxx file, not table.h + +Fri Sep 4 14:38:52 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Add description for CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE since + Proven won't be making any changes to the device driver + implementation after all. + Fix for PR 17148 + + * src/clibincl/stream.inl (set_position): + Remove "fix me" line. It is obvious that this will have to change + with a filesystem interface + Fix for PR 17147 + + * src/stdio/common/freopen.cxx: + Remove "fix me" - I know about this issue + Fix for PR 17145 + + * src/stdio/common/stream.cxx (read): + Remove "fix me" and change to use memcpy + Fix for PR 17144 + +Fri Sep 4 14:36:47 1998 Jonathan Larmour + + * tests/stdio/stdiooutput.c: + Actually add it this time! + +Fri Sep 4 13:48:13 1998 Jonathan Larmour + + * tests/stdio/stdiooutput.c: + Add new tests for misc stdio output functions + + * tests/PKGconf.mak: + Build stdiooutput.c test + +Fri Sep 4 12:52:10 1998 Jonathan Larmour + + * src/clibincl/stream.inl (write_byte): + Remove bogus assert + + * tests/stdlib/getenv.c (main): + Check whether str is NULL before doing a strcmp() + + * tests/stdio/sprintf2.c (main): + Reformat to 76 columns + +Fri Sep 4 02:10:54 1998 Jonathan Larmour + + * src/clibincl/stream.hxx, src/stdio/common/stream.cxx: + Add new peek_byte method to Cyg_StdioStream + + * src/stdio/input/vfscanf.cxx (_vfscanf): + Fix up buffer access to work with new peek_byte method above + Fix for PR 16954 + +Thu Sep 3 19:40:11 1998 Jonathan Larmour + + * tests/stdlib/rand1.c, tests/stdlib/rand2.c, + tests/stdlib/rand3.c: + Add extra check for CYGPKG_LIBC_RAND to decide whether the test + is applicable or not + + * tests/stdlib/rand2.c (test): + Use CYGNUM_LIBC_RAND_SEED for default seed, not 1 + + * tests/string/strtok.c: + Add extra check for CYGFUN_LIBC_strtok to decide whether the + test is applicable or not + +Wed Sep 2 19:11:40 1998 Jonathan Larmour + + * src/stdio/input/fread.cxx, src/stdio/output/fwrite.cxx: + Add fread() and fwrite() functions + + * src/PKGconf.mak: + Build fread.cxx and fwrite.cxx from above + + * src/stdio/common/stream.cxx: + Reformat to 76 columns + In write(), move initialisation of *bytes_written to start + In read(), move initialisation of *bytes_read to start + + * include/stdio.h: + Reformat to 76 columns + + Replace all references to the ANSI + standard to instead by the ISO C standard + + Add commented argument names for "documentation" + + Add fread() and fwrite() prototypes + + * src/clibincl/stdiosupp.hxx: + Copy the above changes from stdio.h, and add _fread() and _fwrite() + prototypes + + * src/stdio/output/fputs.cxx, src/stdio/input/fgets.cxx: + Reformat to 76 columns + +Wed Sep 2 15:41:15 1998 Jonathan Larmour + + * src/stdio/input/vfscanf.cxx: + Reformat to 76 columns + +Wed Sep 2 14:46:18 1998 Jonathan Larmour + + * src/stdio/common/fflush.cxx: + Use trylock_me() instead of lock_me(), and loop to prevent + deadlocks + + * src/clibincl/stream.hxx, src/clibincl/stream.inl: + Add trylock_me() method + + * src/clibincl/stream.hxx, src/clibincl/stream.inl, + src/stdio/common/fflush.cxx: + Reformat to 76 columns + +Wed Sep 2 12:24:27 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Change 0x7fff to 0x7fffffff. Oops! + give main stack size option a legal_values field + Undefine tracing by default + Add some more description in the header + +Tue Sep 1 20:02:07 1998 Jonathan Larmour + + * tests/i18n/setlocale.c (cyg_package_start): + Fix typo - extra "x" for no reason at all! :-) + +Tue Sep 1 19:44:58 1998 Jonathan Larmour + + * src/i18n/locale.cxx: + Fix bug in find_locale_data() that miscalculated size of + all_locales + + Make find_locale_data() match the locale "" and add some + other things in _setlocale() to ensure that "C" gets returned + when the default locale "" is passed. + + Only check the locale pointer when it is non-NULL + + * tests/i18n/setlocale.c: + New tests for setlocale() + + * tests/PKGconf.mak: + Update to build setlocale.c test + + * src/support/cstartup.cxx: + Don't actually call system default main() "main" otherwise GDB + gets confused and thinks its the entry point. Instead make a weak + alias and call the real function something different. + +Tue Sep 1 18:31:42 1998 Jonathan Larmour + + * src/i18n/locale.cxx (_setlocale): + Fix tracing macro name and remove "str maybe used before + initialised" warning + + * tests/stdlib/qsort.c: + Correct file description header + +Tue Sep 1 17:04:32 1998 Jonathan Larmour + + * include/locale.h, src/clibincl/i18nsupp.hxx, src/i18n/locale.cxx: + New files to add support for locales as defined by the ISO C + standard. i.e. setlocale() and localeconv() functions and some + other bits + + * include/pkgconf/libc.h: + Add CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE config option for locale + support + + * src/PKGconf.mak: + build locale.cxx + + * include/errno.h, src/clibincl/ctypesupp.hxx: + Tidy up to 76 columns + +Tue Sep 1 00:24:22 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Move environment-related options from stdlib into new + CYGPKG_LIBC_STARTUP component. Also add options for main()'s + arguments (CYGPKG_LIBC_ARGUMENTS), main()'s default stack size + (CYGNUM_LIBC_MAIN_STACK_SIZE), number of atexit handlers + (CYGNUM_LIBC_ATEXIT_HANDLERS), and whether _exit() stops the + system (CYGSEM_LIBC_EXIT_STOPS_SYSTEM). + + * src/clibincl/stdlibsupp.hxx: + Fix a few comment bugs, and add new + cyg_libc_invoke_atexit_handlers() function prototype + + * src/stdlib/_exit.cxx, src/stdlib/atexit.cxx, src/stdlib/exit.cxx: + Implement exit(), atexit() and _exit() correctly now. Also + includes cyg_libc_invoke_atexit_handlers() in atexit.cxx. Now + we get the correct behaviour of atexit(), and exit() invokes the + atexit handlers and fflushs all the stdio streams. Add plenty of + tracing of asserts too. + + * src/support/cstartup.cxx: + Make main_thread object an exported global. Allow user-settable + arguments. Add MUCH more tracing and asserts. Improve comments. + Tidy up to 76 columns + + * tests/stdlib/atexit.c: + Add simple test for atexit() and it calling registered functions + + * tests/PKGconf.mak: + Build atexit.c test + +Mon Aug 31 18:54:48 1998 Jonathan Larmour + + * src/stdlib/getenv.cxx, tests/stdlib/getenv.c: + Add support for getenv(), and some tests to ensure it works + + * src/PKGconf.mak, tests/PKGconf.mak: + Update to include getenv.cxx and getenv.c test + + * src/clibincl/clibdata.hxx: + remove prototype for environ - we expect files needing it to + define it themselves + + * src/support/clibdata.cxx: + Tidy up to 76 columns and add definition of char **environ, but + with a configurable initialiser (see libc.h below) + + * tests/stdlib/abs.c (main): + Tidy up to 76 columns + + * src/stdlib/malloc.cxx: + Tidy up to 76 columns and remove warning for undefined _memcpy() + by changing to memcpy(), and casting away signedness + + * include/pkgconf/libc.h: + Add CYGPKG_LIBC_ENVIRONMENT and CYGDAT_LIBC_DEFAULT_ENVIRONMENT + configuration options + + * include/pkgconf/libc.h, src/clibincl/clibdata.hxx: + Tidy up to 76 columns + + * include/stdlib.h: + Add getenv() prototype and tidy up to 76 columns + + * src/clibincl/stdlibsupp.hxx: + Add _getenv() prototype + +Mon Aug 31 13:37:08 1998 Jonathan Larmour + + * src/stdlib/malloc.cxx: + Add realloc() + + * tests/stdlib/realloc.c: + Add this file to test new realloc() functionality + + * tests/PKGconf.mak: + Build realloc test + + * tests/stdlib/malloc3.c (main), tests/stdlib/malloc2.c (main), + tests/stdlib/malloc1.c (main): + Conditionalise local vars to prevent warnings + + * tests/stdlib/malloc3.c (fill_with_data): + Move '{' into "verb" line + + * include/pkgconf/libc.h: + Require infra tracing support to allow tracing + + * include/stdlib.h: + Add realloc() + + * src/clibincl/stdlibsupp.hxx: + Update the commented argument names from stdlib.h, including realloc() + +1998-08-28 Bart Veer + + * include/pkgconf/libc.h: + * src/clibincl/clibdata.hxx, src/time/clock.cxx: + + Updated for new kernel configuration option symbol names + +Fri Aug 28 19:18:25 1998 Hugo Tyson + + Changed the entry below to sat "tx39" instead of "mn10300". + It's been a long week. + +Fri Aug 28 18:59:20 1998 Hugo Tyson + + * src/support/cstartup.cxx: Add a weakly named main to allow the + default configuration to link on the tx39 which has no + scalextric linking yet. The static Cyg_Thread main_thread object + below continues to exist, though unreferenced, so all its + descendants must exist too. + +Fri Aug 28 08:54:29 1998 Jonathan Larmour + + * include/stdlib.h: + Add commented argument names Add exit(), and atexit(). And move + these along with abort() and _exit() to a new section. + + * src/stdlib/atexit.cxx, src/stdlib/exit.cxx: + Add trivial versions of atexit() and exit() + + * include/pkgconf/libc.h: + Add CYGNUM_LIBC_MAIN_STACK_SIZE config option + + * include/sys/cstartup.h, src/support/cstartup.cxx, src/PKGconf.mak: + New files to provide a new function cyg_iso_c_support(), which + invokes main "correctly". + + * tests/ctype/ctype.c, tests/setjmp/setjmp.c, tests/stdio/sprintf1.c, + tests/stdio/sprintf2.c, tests/stdio/sscanf.c, tests/stdlib/abs.c, + tests/stdlib/atoi.c, tests/stdlib/atol.c, tests/stdlib/bsearch.c, + tests/stdlib/div.c, tests/stdlib/labs.c, tests/stdlib/ldiv.c, + tests/stdlib/malloc1.c, tests/stdlib/malloc2.c, + tests/stdlib/malloc3.c, tests/stdlib/qsort.c, tests/stdlib/rand1.c, + tests/stdlib/rand2.c, tests/stdlib/rand3.c, tests/stdlib/srand.c, + tests/stdlib/strtol.c, tests/stdlib/strtoul.c, + tests/string/memchr.c, tests/string/memcmp1.c, + tests/string/memcmp2.c, tests/string/memcpy1.c, + tests/string/memcpy2.c, tests/string/memmove1.c, + tests/string/memmove2.c, tests/string/memset.c, + tests/string/strcat1.c, tests/string/strcat2.c, + tests/string/strchr.c, tests/string/strcmp1.c, + tests/string/strcmp2.c, tests/string/strcoll1.c, + tests/string/strcoll2.c, tests/string/strcpy1.c, + tests/string/strcpy2.c, tests/string/strcspn.c, + tests/string/strlen.c, tests/string/strncat1.c, + tests/string/strncat2.c, tests/string/strncpy1.c, + tests/string/strncpy2.c, tests/string/strpbrk.c, + tests/string/strrchr.c, tests/string/strspn.c, + tests/string/strstr.c, tests/string/strtok.c, + tests/string/strxfrm1.c, tests/string/strxfrm2.c, + tests/time/clock.c: + + Modify all tests to use new startup mechanism, and cyg_iso_c_start() + +Fri Aug 28 00:29:38 1998 Jonathan Larmour + + * src/stdio/common/stream.cxx: + Add #ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO around all accesses to + flags.last_buffer_op_was_read. Fix for PR 16997 + +Thu Aug 27 01:12:42 1998 Jonathan Larmour + + * include/sys/file_if.h: + Fix comments and remove cyg_get_file_star() + +Wed Aug 26 20:24:32 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Remove #define CYGPKG_LIBC is that is meant to live in + after all + +Wed Aug 26 19:39:23 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + More fixes to CDL stuff to make it work better, and look better on + the screen + +Tue Aug 25 20:21:41 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Make some fixes after running the ConfigTool + +Tue Aug 25 16:46:28 1998 Jonathan Larmour + + * include/pkgconf/libc.h (CYGNUM_LIBC_STDIO_BUFSIZE): + Fix typo of CYGNUM_LIBC_STDIO_BUFSIZE + +Tue Aug 25 15:10:57 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Tidy up CDL stuff a bit more, prior to checking it actually works. + +Tue Aug 25 11:38:52 1998 Jonathan Larmour + + * tests/stdlib/malloc2.c (main): + Prevent calls to CYG_TEST_STILL_ALIVE for now + +Tue Aug 25 05:39:28 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Change cosmetic paragraph alignment. + +Tue Aug 25 03:11:34 1998 Jonathan Larmour + + * src/support/clibdata.cxx: + Make stderr initialise with buffer size 0. + For PR 16955 + +Mon Aug 24 17:38:46 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + First pass at CDL-ifying the C library configuration. Currently + deliberately disabled as there a few outstanding issues. + +Mon Aug 24 16:14:22 1998 Jonathan Larmour + + * src/stdio/output/vfnprintf.cxx (_vfnprintf): + clear up warning for unused argument + + * tests/stdlib/malloc2.c (NUM_ITERATIONS): + Lower to 100 from 50000 so it won't take too long under the simulator + +Thu Aug 20 17:48:43 1998 Jonathan Larmour + + * src/stdlib/malloc.cxx: + Remove now unnecessary inclusion of kernel/ktypes.h + +Wed Aug 19 19:19:14 1998 Jonathan Larmour + + * tests/stdio/sprintf1.c, tests/stdio/sprintf2.c, + tests/stdio/sscanf.c, tests/stdlib/atoi.c, tests/stdlib/atol.c, + tests/stdlib/rand1.c, tests/stdlib/rand2.c, tests/stdlib/rand3.c, + tests/stdlib/srand.c, tests/stdlib/strtol.c, + tests/stdlib/strtoul.c, tests/string/strtok.c, + tests/time/clock.c: + Add parameters to "main()" to silence warnings + +Wed Aug 19 18:52:59 1998 Jonathan Larmour + + * src/stdio/common/stream.cxx (refill_read_buffer): + Put conditional error check into same #ifdef and if as what was being + checked in the first place! + +Wed Aug 19 18:49:19 1998 Jonathan Larmour + + * src/clibincl/stream.inl: + Reorder Cyg_StdioStream::check_this() to be first to silence + warnings + +Tue Aug 18 16:10:03 1998 Jonathan Larmour + + * ecc/language/c/libc/current/src/clibincl/clibdata.hxx, + ecc/language/c/libc/current/src/errno/errno.cxx, + ecc/language/c/libc/current/src/stdio/common/fopen.cxx, + ecc/language/c/libc/current/src/stdlib/rand.cxx, + ecc/language/c/libc/current/src/string/strtok.cxx: + Rename CYGIMP_LIBC_INTERNAL_DATA_PREAMBLE, + CYGIMP_LIBC_INTERNAL_DATA_ALLOC_CHECK_PREAMBLE, + CYGVAR_LIBC_INTERNAL_DATA, and + CYGIMP_LIBC_INTERNAL_DATA_CHECK to all have CYGPRI_ prefix instead + as recommended by the config name rules + + +Tue Aug 18 14:31:19 1998 Jonathan Larmour + + * src/stdio/common/setvbuf.cxx (_setvbuf): + Rename variable names in assert line, otherwise doesn't build + with asserts on! + +Sun Aug 16 18:15:12 1998 Jonathan Larmour + + * src/stdio/input/vfscanf.cxx (_vfscanf): + Fix some bugs, although there are some left to fix still. Unrelated + to the rest of the checkins, so I will check the partial fix in now. + + * src/clibincl/stream.hxx, src/clibincl/stream.inl, + src/stdio/common/stream.cxx: + Add parameters to constructor to allow more things to be done at + construction time. + + Now we have "new", remove separate "construct" method + + Add more documentation on constructor + + As requested by code review, where possible, move boolean flags + into separate packed bitfield structure for space efficiency + + Make readbuf_char be usable all the time rather than when configured + not to be buffering, as it is also needed for non-buffered mode i.e. + _IONBF + + * src/stdio/common/fopen.cxx: + Change to use new method of construction from above, using new + + Use thread-specific data, rather than global. And so change errnos + to access errno entry specifically + + Make process_mode() check for append mode too + + Reformat for coding standards to have { in same line as "verb" + + * src/stdio/common/setvbuf.cxx: + + Change to cope with different way of dealing with buffering policy + flags etc. in Cyg_StdioStream + + * src/stdio/common/vsnprintf.cxx, src/stdio/common/vsscanf.cxx, + src/support/clibdata.cxx: + Change construction of streams to use new parameters added above, + and change to use _IONBF mode for string stdio functions, + otherwise its a waste of memory. And use _IONBF for stderr as the + ISO standard tells us to! + + Reformat for coding standards to have { in same line as "verb" + + * src/clibincl/streambuf.hxx, src/clibincl/streambuf.inl: + Change constructor so that it can be set with default size and + dynamic buffer (if applicable) + + Fix minor bug in destructor - should only call free when allocated + dynamically + + Change get_buffer_size to return -1 if the buffer was not allowed + to be set up + + * src/stdio/common/streambuf.cxx: + Remove unnecessary stdio.h include and add extra comment to whether + to free bit in set_buffer() + + * src/stdio/common/freopen.cxx: + Change @@@ to standard fix me string + + * src/stdio/output/fputc.cxx: + Remove unnecessary "written" variable + +Thu Aug 13 15:37:28 1998 Jonathan Larmour + + * src/stdlib/_exit.cxx: + Included use of "fix me" line to ensure this is discussed before + release + + * include/stdlib.h, src/stdlib/abort.cxx, src/PKGconf.mak: + Add abort.cxx to implement abort(), albeit naively + +Thu Jul 30 18:03:09 1998 Jonathan Larmour + + * src/stdio/common/vsscanf.cxx (_vsscanf), + src/stdio/common/vsnprintf.cxx (_vsnprintf): + Fix initialiser of pseudo string device table that didn't get updated + when the table changed (Bad proven, no biscuit). + + * src/clibincl/stream.inl (~Cyg_StdioStream): + Move invalidation of magic_validity_word to after unlock_me(), + otherwise it always fails! + +Tue Jul 28 21:29:53 1998 Jonathan Larmour + + * src/clibincl/clibdata.hxx: + Shorten over-long lines + +Tue Jul 28 20:28:23 1998 Jonathan Larmour + + * src/clibincl/stream.hxx (class Cyg_StdioStream), + src/clibincl/stream.inl, src/stdio/common/stream.cxx: + Clarify some comments and get the CYGDBG_DEFINE_CHECK_THIS and + CYG_ASSERTCLASS stuff going + + * src/clibincl/stream.inl: + Put '{'s on same line as "action" as per coding standards + Shorten over-long lines + +Tue Jul 28 15:31:06 1998 Jonathan Larmour + + * src/clibincl/streambuf.inl, src/stdio/common/streambuf.cxx: + Move set_buffer() from streambuf.inl to new file streambuf.cxx + + * src/PKGconf.mak (COMPILE): + Build new file streambuf.cxx + + * src/clibincl/streambuf.hxx (class Cyg_StdioStreamBuffer): + Add METHODS comment + + * src/stdio/common/stream.cxx: + Put '{'s on same line as "action" as per coding standards + Shorten over-long lines + +Tue Jul 28 00:26:36 1998 Jonathan Larmour + + * include/stdlib.inl, src/stdio/input/vfscanf.cxx, + src/stdio/output/vfnprintf.cxx, src/stdlib/div.cxx, + src/stdlib/ldiv.cxx, src/stdlib/qsort.cxx, src/stdlib/strtol.cxx, + src/stdlib/strtoul.cxx, src/string/strtok.cxx: + + Include proper Berkeley license inline in the file, rather than + referring to an external file + + * doc/COPYING.UCB: + Remove, now that it isn't referred to any more + +Mon Jul 27 23:34:26 1998 Jonathan Larmour + + * include/ctype.h, include/ctype.inl, include/errno.h, + include/stdio.h, include/stdio.inl, include/stdlib.h, + include/stdlib.inl, include/string.h, include/string.inl, + include/time.h, include/sys/file_if.h, src/PKGconf.mak, + src/clibincl/clibdata.hxx, src/clibincl/clibdata.inl, + src/clibincl/ctypesupp.hxx, src/clibincl/stdiosupp.hxx, + src/clibincl/stream.hxx, src/clibincl/streambuf.hxx, + src/clibincl/streambuf.inl, src/clibincl/stringsupp.hxx, + src/clibincl/timesupp.hxx, src/ctype/isalnum.cxx, + src/ctype/isalpha.cxx, src/ctype/iscntrl.cxx, + src/ctype/isdigit.cxx, src/ctype/isgraph.cxx, + src/ctype/islower.cxx, src/ctype/isprint.cxx, + src/ctype/ispunct.cxx, src/ctype/isspace.cxx, + src/ctype/isupper.cxx, src/ctype/isxdigit.cxx, + src/ctype/tolower.cxx, src/ctype/toupper.cxx, + src/errno/errno.cxx, src/stdio/common/snprintf.cxx, + src/stdio/common/sprintf.cxx, src/stdio/common/sscanf.cxx, + src/stdio/common/stdioinlines.cxx, src/stdio/common/stream.cxx, + src/stdio/common/ungetc.cxx, src/stdio/common/vsnprintf.cxx, + src/stdio/common/vsscanf.cxx, src/stdio/input/fgetc.cxx, + src/stdio/input/fgets.cxx, src/stdio/input/fscanf.cxx, + src/stdio/input/gets.cxx, src/stdio/input/scanf.cxx, + src/stdio/output/fnprintf.cxx, src/stdio/output/fprintf.cxx, + src/stdio/output/fputc.cxx, src/stdio/output/fputs.cxx, + src/stdio/output/printf.cxx, src/stdlib/_exit.cxx, + src/stdlib/abs.cxx, src/stdlib/atof.cxx, src/stdlib/atoi.cxx, + src/stdlib/atol.cxx, src/stdlib/div.cxx, src/stdlib/labs.cxx, + src/stdlib/ldiv.cxx, src/stdlib/rand.cxx, src/stdlib/strtod.cxx, + src/string/memchr.cxx, src/string/memcmp.cxx, + src/string/memmove.cxx, src/string/strcat.cxx, + src/string/strchr.cxx, src/string/strcmp.cxx, + src/string/strcoll.cxx, src/string/strcpy.cxx, + src/string/strcspn.cxx, src/string/strlen.cxx, + src/string/strncat.cxx, src/string/strncmp.cxx, + src/string/strncpy.cxx, src/string/strpbrk.cxx, + src/string/strrchr.cxx, src/string/strspn.cxx, + src/string/strstr.cxx, src/string/strsuppt.cxx, + src/string/strtok.cxx, src/string/strxfrm.cxx, + src/support/clibdata.cxx, src/time/clock.cxx: + Untabify + +Mon Jul 27 23:14:18 1998 Jonathan Larmour + + * src/errno/errno.cxx, src/stdio/input/vfscanf.cxx, + src/stdio/output/vfnprintf.cxx, src/stdlib/strtol.cxx, + src/stdlib/strtoul.cxx, src/stdlib/malloc.cxx, src/stdlib/qsort.cxx, + tests/ctype/ctype.c, tests/stdlib/rand3.c, tests/stdlib/malloc3.c: + Remove all mentions of "register" in variable declarations. Also + untabify where needed + + * src/stdlib/bsearch.cxx: + Untabify this too + + +Mon Jul 27 22:18:51 1998 Jonathan Larmour + + * src/stdio/output/fputc.cxx (_fputc): + Replace call to stream write() with call to write_byte() + + * src/clibincl/stream.inl (write_byte): + Add asserts for stream write() returning odd values for how much has + been written + + (bytes_available_to_read): + Remove "register" def for variable declaration + +Mon Jul 27 22:06:22 1998 Jonathan Larmour + + * src/stdio/common/stdiosupp.cxx: + Remove #if 0'd cyg_get_file_star() and unnecessary pseudo string + device definition + +Mon Jul 27 21:57:25 1998 Jonathan Larmour + + * include/pkgconf/libc.h, src/support/clibdata.cxx: + Change CYGXXX_LIBC_STDIO_DEFAULT_CONSOLE to + CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE + +Mon Jul 27 21:49:23 1998 Jonathan Larmour + + * src/clibincl/clibdata.hxx, src/clibincl/clibdata.inl, + src/clibincl/ctypesupp.hxx, src/clibincl/setjmpsupp.hxx, + src/clibincl/stdiosupp.hxx, src/clibincl/stdlibsupp.hxx, + src/clibincl/stream.hxx, src/clibincl/stream.inl, + src/clibincl/streambuf.hxx, src/clibincl/streambuf.inl, + src/clibincl/stringsupp.hxx, src/clibincl/timesupp.hxx: + + Change CYGONCE_LIBC_*_{HXX,INL} to CYGONCE_LIBC_CLIBINCL_*_{HXX,INL} + +Mon Jul 27 21:34:05 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Change #define XXXXX 1 to #define XXXXX where applicable as per code + review + + Also remove obsolete CYGIMP_LIBC_THREAD_START_SUSPENDS_SELF + +Mon Jul 27 19:42:27 1998 Jonathan Larmour + + * src/stdio/common/fopen.cxx (_fopen): + Use #ifdef, not #if for config options + +Mon Jul 27 15:01:51 BST 1998 Chris Provenzano + + * src/stdio/common/stream.cxx, src/stdio/common/vsnprintf.cxx + * src/stdio/common/vsscanf.cxx: + Fixes to compile with the new Cyg_IORB field names. + +Thu Jul 9 03:40:21 1998 Jonathan Larmour + + * tests/stdlib/atoi.c, tests/stdlib/atol.c, + tests/stdlib/strtol.c, tests/stdlib/strtoul.c: + Adjust starting of tests to possibly start scheduler since + strtol/stroul rely on errno, which may be a per-thread variable + +Thu Jul 9 03:06:25 1998 Jonathan Larmour + + * src/clibincl/stream.hxx, src/clibincl/stream.inl, + src/stdio/common/stream.cxx, src/stdio/common/setvbuf.cxx: + Consolidate read and write buffers into single buffer, as it should + have been all along + + * src/clibincl/streambuf.hxx, src/clibincl/streambuf.inl: + Add drain_buffer() method to speed up the case when we want the + buffer completely emptied + +Tue Jul 7 21:26:33 1998 Jonathan Larmour + + * tests/stdio/sprintf1.c: + Add a couple of new tests that check that very long strings work too + +Wed Jul 1 19:52:39 1998 Jonathan Larmour + + * src/clibincl/stream.hxx, src/clibincl/streambuf.hxx: + Do not permit copy constructors + + * src/clibincl/stream.inl, src/stdio/common/fclose.cxx: + Make sure we use #ifdef and not #if + + * src/clibincl/streambuf.inl: + Use member initialisation list rather than explicit initialisation to + reduce warnings + +Wed Jul 1 19:17:55 1998 Jonathan Larmour + + * include/pkgconf/libc.h and all files using config options: + Rename configuration defines to make them more standard + +Thu Jun 25 20:09:30 1998 Jonathan Larmour + + * src/string/strcat.cxx: + Add parentheses on check to silence warning + (Verified by proven) + +Thu Jun 25 19:30:01 1998 Jonathan Larmour + + * src/stdlib/malloc.cxx: + Make sure that the malloc pool is initialised before other things + can use it. This is done with the hot new constructor ordering + feature. + +Thu Jun 25 18:27:03 1998 Jonathan Larmour + + * src/stdio/input/vfscanf.cxx: + Remove bogus ifdef if floating point is _not_ wanted + +Thu Jun 25 17:31:42 1998 Jonathan Larmour + + * src/string/strtok.cxx: + Fix argument checking to allow first argument of NULL + +Thu Jun 25 04:18:50 1998 Jonathan Larmour + + * src/clibincl/clibdata.inl (get_strtok_last_p): + Remove bogus assertion + + * src/stdlib/malloc.cxx: + Got sense of alignment check assertion the wrong way round, so negate + it + +Thu Jun 25 03:56:35 1998 Jonathan Larmour + + * src/string/strxfrm.cxx: + Fix argument checking assertions with legitimate nulls here too + +Thu Jun 25 03:46:32 1998 Jonathan Larmour + + * src/stdlib/strtoul.cxx, src/stdlib/strtol.cxx: + Fix argument checking assertions to cope with legitimate nulls + +Wed Jun 24 09:01:45 1998 Jonathan Larmour + + * tests/stdio/sprintf1.c: + Remove extraneous info messages + +Wed Jun 24 05:59:17 1998 Jonathan Larmour + + * tests/stdio/sprintf1.c, tests/stdio/sprintf2.c, tests/stdio/sscanf.c, + tests/stdlib/rand1.c, tests/stdlib/rand2.c, tests/stdlib/rand3.c, + tests/stdlib/srand.c: + + Change large automatic arrays to static arrays to prevent overuse + of a potentially small stack + +Wed Jun 24 05:45:28 1998 Jonathan Larmour + + * tests/stdio/sprintf1.c, tests/stdio/sprintf2.c, tests/stdio/sscanf.c, + tests/stdlib/rand1.c, tests/stdlib/rand2.c, tests/stdlib/rand3.c, + tests/stdlib/srand.c, tests/string/strtok.c, tests/time/clock.c: + + Increase thread stack size from 4K to 32K as in some cases it was + too small. + + +Tue Jun 23 20:12:31 1998 Jonathan Larmour + + * tests/stdio/sscanf.c: + Add extra tests, including floating point conversion testing + +Tue Jun 23 17:01:06 1998 Jonathan Larmour + + * src/string/strtok.cxx: + Make sure this is only compiled if CYGFUN_LIBC_strtok is defined + +Tue Jun 23 06:10:13 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + add some comments - that's all + + * src/stdio/common/stream.cxx: + fix case in refill_read_buffer() for what to do when there's nothing + left. Now return EAGAIN + + * src/stdio/common/vsscanf.cxx, src/stdio/input/vfscanf.cxx: + Get sscanf working properly and passing tests. Also make sure it + ignores FP when its not configured + + * src/stdlib/atof.cxx: + Only compile at all if strtod() is present + + +Mon Jun 22 19:13:42 1998 Jonathan Larmour + + * src/clibincl/clibdata.hxx, src/clibincl/clibdata.inl: + Conditionalise strtok_last and rand_seed better + +Mon Jun 22 14:14:12 1998 Jonathan Larmour + + * tests/stdlib/malloc3.c: + Add test for checking that mallocing and freeing repeatedly works + + * tests/PKGconf.mak: + Update to reflect addition of the above + +Mon Jun 22 13:09:33 BST 1998 Chris Provenzano + + * src/stdio/common/fopen.cxx + * src/stdio/common/stream.cxx + * src/stdio/common/vsnprintf.cxx + * src/stdio/common/vsscanf.cxx + Include cyg/devs/common/iorb.h instead of iorb.hxx + + * src/stdio/common/stream.cxx + Use read_blocking and write_blocking instead of just read and + write when accessing devices through the virtual device table. + +Sun Jun 21 18:19:13 1998 Jonathan Larmour + + * src/stdio/common/stdioinlines.cxx: + Propagate change of return code handling for puts from stdio.inl + into here + + * src/stdio/output/fputc.cxx: + make sure the right type is used for output - byte not int + + * src/support/clibdata.cxx: + Fix #define config mistook. #endif was in wrong place + +Sun Jun 21 16:11:04 1998 Jonathan Larmour + + * src/clibincl/clibdata.hxx, src/clibincl/clibdata.inl: + Allow explicit construction to get around a bug when + dynamically allocating per-thread structure + +Sun Jun 21 16:02:51 1998 Jonathan Larmour + + * tests/ctype/ctype.c, tests/setjmp/setjmp.c, tests/stdio/sprintf1.c, + tests/stdio/sprintf2.c, tests/stdio/sscanf.c, tests/stdlib/abs.c, + tests/stdlib/atoi.c, tests/stdlib/atol.c, tests/stdlib/bsearch.c, + tests/stdlib/div.c, tests/stdlib/labs.c, tests/stdlib/ldiv.c, + tests/stdlib/malloc1.c, tests/stdlib/malloc2.c, tests/stdlib/qsort.c, + tests/stdlib/rand1.c, tests/stdlib/rand2.c, tests/stdlib/rand3.c, + tests/stdlib/srand.c, tests/stdlib/strtol.c, tests/stdlib/strtoul.c, + tests/string/memchr.c, tests/string/memcmp1.c, + tests/string/memcmp2.c, tests/string/memcpy1.c, + tests/string/memcpy2.c, tests/string/memmove1.c, + tests/string/memmove2.c, tests/string/memset.c, + tests/string/strcat1.c, tests/string/strcat2.c, + tests/string/strchr.c, tests/string/strcmp1.c, + tests/string/strcmp2.c, tests/string/strcoll1.c, + tests/string/strcpy1.c, tests/string/strcpy2.c, + tests/string/strcspn.c, tests/string/strlen.c, + tests/string/strncat1.c, tests/string/strncat2.c, + tests/string/strncpy1.c, tests/string/strncpy2.c, + tests/string/strpbrk.c, tests/string/strrchr.c, + tests/string/strspn.c, tests/string/strstr.c, tests/string/strtok.c, + tests/string/strxfrm1.c, tests/string/strxfrm2.c, tests/time/clock.c: + + Update tests to "do the right thing" with all configuration settings + + +Sun Jun 21 04:54:14 1998 Jonathan Larmour + + * tests/setjmp/setjmp.c: + I have to be careful not to use setjmp() in a way not exactly + defined by the standard, so make sure I do, and add a comment + documenting these ways. + + Also ensure this test does the right thing in all configurations + +Sun Jun 21 04:38:15 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Add extra checks for invalid configurations + Also make default for thread safety OFF + + * src/clibincl/clibdata.inl: + Adjust indentation + + * src/stdio/output/vfnprintf.cxx: + Make printf of -0.0 floating point do the right thing + +Sun Jun 21 04:28:00 1998 Jonathan Larmour + + * src/stdio/common/snprintf.cxx, src/stdio/common/sprintf.cxx, + src/stdio/common/sscanf.cxx, src/stdio/input/fscanf.cxx, + src/stdio/input/scanf.cxx, src/stdio/output/fnprintf.cxx, + src/stdio/output/fprintf.cxx, src/stdio/output/printf.cxx: + + Had to remove inline functions with varargs. Which means separating + out each function from stdioinlines.cxx into a separate file, as they + no longer belong there. So all the above files were created. + + * include/stdio.inl, src/PKGconf.mak, + src/stdio/common/stdioinlines.cxx: + Changed to take account of the above + + +Sun Jun 21 03:58:42 1998 Jonathan Larmour + + * tests/stdio/sprintf1.c, tests/stdio/sprintf2.c: + Update with floating-point tests. Also make sure they DTRT in all + configurations + +Fri Jun 19 19:33:06 1998 Jonathan Larmour + + * src/support/clibdata.cxx: + accidentally initialised stdin/out/err twice + +Fri Jun 19 19:09:29 1998 Jonathan Larmour + + * src/support/clibdata.cxx: + Another typo + +Fri Jun 19 18:59:07 1998 Jonathan Larmour + + * src/support/clibdata.cxx: + Missing #endif typo + +Fri Jun 19 18:51:42 1998 Jonathan Larmour + + * src/support/clibdata.cxx: + Fix initialisation of static data members. Unsure how it worked at + all before! + +Fri Jun 19 18:01:01 1998 Jonathan Larmour + + * include/stdio.inl: + puts should check whether fputs returns non-negative, rather than + non-zero + +Fri Jun 19 17:22:52 1998 Jonathan Larmour + + * src/clibincl/clibdata.inl: + Make inclusion of get_errno_p conditional on thread-safety + +Wed Jun 17 10:55:32 1998 Jonathan Larmour + + * src/stdio/input/vfscanf.cxx: + Add weak alias of vfscanf() to _vfscanf() + +Wed Jun 17 09:10:41 1998 Jonathan Larmour + + * src/stdio/common/fflush.cxx: + Initialise err to silence compiler warning + +Wed Jun 17 08:59:20 1998 Jonathan Larmour + + * Most important is the addition of floating point support in + src/stdio/output/vfnprintf.cxx and src/stdio/input/vfscanf.cxx. This + also required the addition of atof() and strtod() in stdlib which is + definitely no bad thing! Other than that... + + * Fix a whole bunch of stuff I messed up first time round. Also the + sprintf and sscanf tests are included again. + +Tue Jun 16 16:38:02 1998 Jonathan Larmour + + * tests/PKGconf.mak: + Typo with not putting comment character at the beginning. Sigh. + +Tue Jun 16 14:53:09 1998 Jonathan Larmour + + * tests/PKGconf.mak: + Forgot to (temporarily) remove fputs test for now + +Mon Jun 15 20:40:03 1998 Jonathan Larmour + + Everything to do with stdio has almost completely changed, so there's + not much point documenting individual changes. + +Mon Jun 15 18:36:01 1998 Jonathan Larmour + + * tests/stdlib/malloc2.c: + Stop it moaning quite as much when it fails by making it exit sooner + + * tests/time/clock.c : + This isn't a compound testcase + +Thu Jun 11 17:59:13 1998 Jonathan Larmour + + * include/assert.h + Reverse sense of NDEBUG ifdef, that was left in accidentally due + to testing + +Thu Jun 11 04:58:08 1998 Jonathan Larmour + + * include/errno.h, include/string.h, src/clibincl/stringsupp.hxx: + Modify as I've now added an "error" package which defines the error + codes and strerror() + + * src/errno/strerror.cxx: + Moved to new error package and thus deleted + +Wed Jun 10 18:37:37 1998 Jonathan Larmour + + * include/assert.h: + create this header and add assert() function + +Wed Jun 10 16:23:57 1998 Jonathan Larmour + + * include/stdlib.h, src/clibincl/stdlibsupp.hxx, src/stdlib/malloc.cxx: + Add malloc(), calloc() and free() functions + + * include/pkgconf/libc.h: + Add malloc memory pool size option + + * tests/stdlib/malloc1.c, tests/stdlib/malloc2.c: + new tests for malloc + + * src/PKGconf.mak, tests/PKGconf.mak: + Update for new files + +Wed Jun 10 15:06:16 1998 Jonathan Larmour + + * tests/setjmp/setjmp.c: + Add another test + +Tue Jun 9 18:20:31 1998 Jonathan Larmour + + * include/pkgconf/libc.h: + Add some setjmp config's and a macro for the noreturn attribute + + * include/setjmp.h, include/setjmp.inl, src/clibincl/setjmpsupp.hxx, + src/setjmp/longjmp.cxx, tests/setjmp/setjmp.c: + Added to implement and test setjmp() and longjmp() + + * src/PKGconf.mak, tests/PKGconf.mak: + Update for newly added files + +Thu Jun 4 01:29:18 1998 Jonathan Larmour + + * src/string/memchr.cxx, src/string/memcmp.cxx, src/string/strcat.cxx, + src/string/strchr.cxx, src/string/strcmp.cxx, src/string/strcpy.cxx, + src/string/strlen.cxx, src/string/strncat.cxx, + src/string/strncmp.cxx, src/string/strncpy.cxx: + Rename CYGIMP_LIBC_PREFER_SMALL_TO_FAST to + CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST + + Also use slower but smaller version when __OPTIMIZE_SIZE__ is + defined (which comes from using gcc -Os) + +Fri May 29 16:15:04 1998 Jonathan Larmour + + * include/ctype.inl, src/ctype/isxdigit.cxx: + Fix bug that numerals aren't considered hex digits + + * include/time.h: + Change clock_t and time_t to be signed so that they can accept -1, as + required by other libc functions + + * src/clibincl/clibdata.hxx: + Fix typo that CYGIMP_LIBC_THREAD_SUPPORT should be ..._SAFETY + Also fix macro to allocate thread-specific data to not set variables + in a different stack-frame + + * tests/ctype/ctype.c: + Fix some misunderstandings in tests, and add a few new ones + + * tests/stdlib/qsort.c: + make ctr unsigned to prevent warnings + + * tests/stdlib/strtol.c, tests/stdlib/strtoul.c: + Fix some misunderstandings in tests, and add a few new ones + + * tests/string/strrchr.c: + Fix off by one error + + * tests/string/strspn.c: + Fix case-sensitivity problem, and off-by-one error + + * tests/string/strxfrm1.c: + Remove bogus bit of test that doesn't apply to strxfrm, and fix typo + + +Fri May 22 16:33:04 1998 Jonathan Larmour + + * src/PKGconf.mak + Remove CXXFLAGS line now that its redundant + + * tests/everything! + Do a blitz change of all tests - break some of them down into + different files, add new tests, standardize format, fix bugs, + update for recent header file changes and much more! + +Wed May 20 17:50:04 1998 Jonathan Larmour + + * tests/PKGconf.mak: + interim checkin for different dir structure for Bart + +Fri May 15 20:30:46 1998 Jonathan Larmour + + * Tidy up some loose ends I forgot: rename src/include directory to + src/clibincl. And add clibdata.inl and timesupp.hxx in there. + +Thu May 14 19:56:32 1998 Jonathan Larmour + + * Basically everything has changed in the C library. Files have + been moved, renamed, deleted and reworked. This is a major + revision, and now starts from this new baseline rather than doing + incremental changes. + +Fri Apr 17 18:43:02 1998 Jonathan Larmour + + * src/ECCconf.mak: + added for new build system (actually Bart did this, but didn't + update this ChangeLog) + +Fri Apr 17 15:03:25 1998 Hugo Tyson + + * src/stdio/device/sim.cxx: + Make it build with CYG_EMPTY_STATEMENT; the unadorned one is being + removed. + +Thu Apr 16 00:24:24 1998 Jonathan Larmour + + * All source files: + replace ECCIMP_LIBC_* conditional ifdef with CYGIMP_LIBC_* + + * include/eccconf/libc.h: + improve comments and reorder a bit + +Wed Apr 8 14:35:20 1998 Jonathan Larmour + + * Makefile.am, src/Makefile.am, tests/Makefile.am, configure.in: + many changes to integrate build structure from release tree + + * src/ctype/Makefile.am, src/ctype/Makefile.in, src/errno/Makefile.am, + src/errno/Makefile.in, src/stdio/Makefile.am, src/stdio/Makefile.in, + src/stdio/common/Makefile.am, src/stdio/common/Makefile.in, + src/stdio/device/Makefile.am, src/stdio/device/Makefile.in, + src/stdio/output/Makefile.am, src/stdio/output/Makefile.in, + src/stdio/input/Makefile.am, src/stdio/input/Makefile.in, + src/stdlib/Makefile.am, src/stdlib/Makefile.in, + src/string/Makefile.am, src/string/Makefile.in, + src/support/Makefile.am, src/support/Makefile.in, + src/time/Makefile.am, src/time/Makefile.in: + Remove as they are now redundant with above changes + + * include/Makefile.am: + Add to support above changes + + * include/eccconf/libc.h: + Change include file for configuration from kernel to system + + * src/include/kerndiag.hxx, src/stdio/device/kerndiag.cxx, + src/time/clockfn.cxx: + Change kernel include file to eccconf/kernel.h + + * src/include/strngdev.h: + remove unnecessary kernel include + + * Makefile.in, aclocal.m4, configure, src/Makefile.in, + tests/Makefile.in, include/Makefile.in: + regenerate + +Mon Apr 6 20:55:07 1998 Jonathan Larmour + + * src/stdlib/abs.cxx, src/stdlib/atoi.cxx, src/stdlib/atol.cxx, + src/stdlib/div.cxx, src/stdlib/labs.cxx, src/stdlib/ldiv.cxx: + Separated out functions from stdlib.cxx into separate files + + * src/stdlib/stdlib.cxx: + removed to be replaced by above files + + * Makefile.am, src/stdlib/Makefile.am: + modified to support building above and not building stdlib.cxx + + * src/support/tsd.cxx: + Remove unnecessary header file includes + + * Makefile.in, src/stdlib/Makefile.in: + regenerated + +Mon Apr 6 19:19:42 1998 Jonathan Larmour + + * src/support/tsd.cxx, include/eccconf/libc.h: + remove lame hack for tx39 compiler now that its fixed + + * src/include/sim.hxx: + define constants as static to placate compiler + +Thu Apr 2 21:01:21 1998 Jonathan Larmour + + * src/ctype/ctype.cxx: + deleted and separated out into below files + + * src/ctype/isalnum.cxx, src/ctype/isalpha.cxx, src/ctype/iscntrl.cxx, + src/ctype/isdigit.cxx, src/ctype/isgraph.cxx, src/ctype/islower.cxx, + src/ctype/isprint.cxx, src/ctype/ispunct.cxx, src/ctype/isspace.cxx, + src/ctype/isupper.cxx, src/ctype/isxdigit.cxx, src/ctype/tolower.cxx, + src/ctype/toupper.cxx: + Separated out individual ctype functions from ctype.cxx into separate + files + + * Makefile.am, src/ctype/Makefile.am: + modified to reflect above deletion/additions + + * Makefile.in, src/ctype/Makefile.in: + regenerated + +Thu Apr 2 19:08:26 1998 Jonathan Larmour + + * src/string/strxfrm.cxx: optimise using prefix increments + +Thu Apr 2 15:18:15 1998 Jonathan Larmour + + * src/string/strchr.cxx: optimise setting of mask a little + +Thu Mar 26 14:07:01 1998 Jonathan Larmour + + * src/support/tsd.cxx: fixed some typos + +Thu Mar 26 11:58:47 1998 Jonathan Larmour + + * include/eccconf/libc.h, src/support/tsd.cxx: + Implement workaround for tx39 compiler bug. + + * src/include/strsuppt.hxx: + remove prototypes for _memcpy() and _memset() as they are now in the + kernel + +Wed Mar 25 18:31:53 1998 Jonathan Larmour + + * Makefile.am, src/string/Makefile.am: memcpy() and memset() are + now in the kernel so remove them from build + * include/string.h: add a comment to say as much + * Makefile.in, src/string/Makefile.in: regenerate + +Wed Mar 25 15:30:42 1998 Jonathan Larmour + + * src/stdlib/_exit.cxx, src/include/file_if.inl: + Change _exit workaround to not cause a compiler optimisation + problem. Now just references _exit rather than calls it. + +Wed Mar 25 14:59:49 1998 Jonathan Larmour + + * src/string/strxfrm.cxx: Fix bug causing tests to fail completely + for this function + +Wed Mar 25 12:55:53 1998 Jonathan Larmour + + * src/include/sim.hxx: add types to constants (oops!) + * Makefile.am: link src/stdio/device/sim.cxx + * Makefile.in: regenerated + +Wed Mar 25 04:14:30 1998 Jonathan Larmour + + * src/include/file_if.hxx, src/include/file_if.inl, + src/include/kerndiag.hxx, src/include/sim.hxx, + src/include/stdio_if.hxx, src/include/strngdev.hxx, + src/include/tsd.hxx, src/stdio/common/clearerr.cxx, + src/stdio/common/clearerr.cxx, src/stdio/common/feof.cxx, + src/stdio/common/ferror.cxx, src/stdio/common/file_if.cxx, + src/stdio/common/vsprintf.cxx, + src/stdio/device/kerndiag.cxx, src/stdio/device/sim.cxx, + src/stdio/device/strngdev.cxx, src/stdio/output/fputc.cxx, + src/stdio/output/fputs.cxx, src/stdio/output/puts.cxx, + src/stdio/output/vfnprintf.cxx, src/support/tsd.cxx: + Modified to support buffered reads including renaming + _EccInternalFileStruct to __EccStdioStream which is what affects + most of these files + * src/include/file_if.inl, src/stdio/common/file_if.cxx: added for + the above reason + * src/stdio/common/sscanf.cxx, src/stdio/input/vfscanf.cxx, + src/stdio/input/Makefile.am: added to provide sscanf() functionality + * include/ctype.h, include/stdio.h, include/stdlib.h, + include/string.h, include/eccconf/libc.h, src/ctype/ctype.cxx, + src/stdlib/stdlib.cxx, src/string/strcoll.cxx, + src/stdio/common/stdio.cxx: + rename *_INLINES macros with prefix CYG rather than ECC + * include/errno.h, src/errno/errno.cxx, src/errno/strerror.cxx: + rename ErrNo to _ErrNo and add EAGAIN and EWOULDBLOCK error codes + * configure.in, Makefile.am, src/stdio/Makefile.am, + src/stdio/input/Makefile.am: add support for building + file_if.cxx sscanf.cxx and vfscanf.cxx + * src/stdio/Makefile.in, src/stdio/common/Makefile.in, + src/stdio/input/Makefile.in, configure, Makefile.in: regenerated + +Tue Mar 24 19:51:40 1998 Jonathan Larmour + + * src/time/clockfn.cxx, src/time/clock.cxx: + Renamed clock.cxx to clockfn.cxx (preserving CVS history) + * Makefile.am, src/time/Makefile.am: updated to reflect name change + * Makefile.in, src/time/Makefile.in: regenerated + +Tue Mar 24 16:28:06 1998 Jonathan Larmour + + * include/ctype.inl: Swap around definitions to get right order so + inlining works + +Tue Mar 24 14:43:05 1998 Jonathan Larmour + + * include/ctype.h, include/stdio.h, include/stdlib.h, include/string.h: + modify to only conditionally include inlines + * src/ctype/ctype.cxx, src/stdio/common/stdio.cxx, + src/stdlib/stdlib.cxx, src/string/strcoll.cxx, + src/ctype/Makefile.am: Add to provide real linkable alternatives + to inline functions + * Makefile.am, configure.in, src/Makefile.am, + src/stdio/common/Makefile.am, src/stdlib/Makefile.am, + src/string/Makefile.am: modified to support previous additions + * include/eccconf/libc.h: redefine inline macro to add extern inline, + and add conditional defines for inline functions. Also rename + space vs. speed macro to have CYG instead of ECC prefix + * include/stdio.inl: fix comment typo + * src/stdlib/qsort.cxx: fix to define inline functions properly + * src/string/memchr.cxx, src/string/memcmp.cxx, src/string/memcpy.cxx, + src/string/memset.cxx, src/string/strcat.cxx, src/string/strchr.cxx, + src/string/strcmp.cxx, src/string/strcpy.cxx, src/string/strlen.cxx, + src/string/strncat.cxx, src/string/strncmp.cxx, + src/string/strncpy.cxx + * Makefile.in, configure, src/Makefile.in, src/ctype/Makefile.in, + src/stdio/common/Makefile.in, src/stdlib/Makefile.in, + src/string/Makefile.in: regenerate + + +Mon Mar 23 19:19:49 1998 Jonathan Larmour + + * src/stdlib/_exit.cxx: added to support temporary _exit + * include/stdlib.h, include/stdlib.inl: added support for _exit and + added abs(), labs(), div() and ldiv() functions + * src/include/file_if.hxx: added support for _exit kludge + * src/stdlib/qsort.cxx: Added Berkeley copyright message + * src/time/clock.cxx: Include correct kernel config header as + CYG_CONFIGURATION rather than + * Makefile.am src/stdlib/Makefile.am: added support for _exit + * Makefile.in, src/stdlib/Makefile.in: regenerated + +Mon Mar 23 14:41:07 1998 Jonathan Larmour + + * Replace ECCPKG_ANSI_LIBC with CYGPKG_ANSI_LIBC in all source files + +Mon Mar 23 14:28:44 1998 Jonathan Larmour + + * include/string.inl: add file to provide strcoll() + * include/string.h: include string.inl + * ctype.h: include ctype.inl (oops!) + * include/stdlib.h: include stdlib.inl (oops!) + +Mon Mar 23 13:30:38 1998 Jonathan Larmour + + * include/ctype.h, include/ctype.inl: added to provide ANSI ctype + functionality + * include/stdlib.h, include/stdlib.inl, src/include/stdlibbsp.hxx, + src/stdlib/Makefile.am, src/stdlib/bsearch.cxx, + src/stdlib/qsort.cxx, src/stdlib/rand.cxx, src/stdlib/srand.cxx, + src/stdlib/strtol.cxx, src/stdlib/strtoul.cxx: Added to provide + many stdlib functions + * src/include/tsd.hxx: modified to support rand() random number + seed, and added some comments + * configure.in, Makefile.am, src/Makefile.am: modified to support + addition of above new sources + * include/eccconf/libc.h: Add extra helpful comments, and #include + kernel config file + * src/time/clock.cxx: #include clock.inl and fix to call + get_resolution() properly now + * Makefile.in, configure, src/Makefile.in, src/errno/Makefile.in, + src/stdio/Makefile.in, src/stdio/common/Makefile.in, + src/stdio/device/Makefile.in, src/stdio/output/Makefile.in, + src/stdlib/Makefile.in, src/strings/Makefile.in, + src/support/Makefile.in, src/time/Makefile.in, + tests/Makefile.in: regenerated + + +Sun Mar 22 21:29:25 1998 Jonathan Larmour + + * include/time.h, src/include/timesupp.hxx, src/time/clock.cxx, + src/time/Makefile.am: added to provide clock() function + * src/Makefile.am: modified to try to build in src/time directory + * include/eccconf/libc.h: added and is now the main configuration + file for this package + * acconfig.h, include/libcconf.h.in, include/stamp-h.in: removed + due to usage of libc.h above instead + * Almost all *.h, *.hxx and *.cxx: replaced LIBC_CONFIG_HEADER + defined include with simple + * configure.in: remove AM_CONFIG_HEADER of libcconf.h and + LIBC_CONFIG_HEADER definition. Also remove usage of builtin + memcpy() etc. from gcc, and generate src/time/Makefile + * Makefile.am: link in src/time/clock.o + * src/include/file_if.hxx, src/include/sim.hxx: use config header + to decide whether C library is to be used + * Makefile.in, aclocal.m4, configure, src/Makefile.in: regenerated + +Fri Mar 20 18:08:10 1998 Jonathan Larmour + + * src/string/strxfrm.cxx: Fixed bug with ignoring terminating NULL + +1998-03-20 Chris Tarpy + + * configure: - regenerated + * Makefile.am: - Support added for libc testcases + * Makefile.in: regenerated + * configure.in: set c compiler, descend test dir + * tests/Makefile.in: added + * tests/Makefile.am: added + * tests/tcdiag.cxx : added + + +Thu Mar 19 11:41:56 1998 Jonathan Larmour + + * Initial check-in of everything + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/language/c/libc/current/include/assert.h b/packages/language/c/libc/current/include/assert.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/assert.h @@ -0,0 +1,81 @@ +#ifndef CYGONCE_LIBC_ASSERT_H +#define CYGONCE_LIBC_ASSERT_H +//=========================================================================== +// +// assert.h +// +// ANSI standard assertion support as per ANSI chapter 7.2 +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: ANSI standard assertion support as per ANSI chapter 7.2 +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Common assertion support + +// MACROS + +// The user should define NDEBUG to turn on these user assertions. Also the +// common infrastructure assertions should be turned on too. + +#ifndef NDEBUG + +# define assert( _bool_ ) ((void)0) + +#else // if NDEBUG is defined + +# define assert( _bool_ ) \ + CYG_MACRO_START \ + CYG_ASSERT( _bool_, "User assertion failed: \"" # _bool_ "\"" ); \ + CYG_MACRO_END + +#endif // if NDEBUG is defined + + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_ASSERT_H multiple inclusion protection + +// EOF assert.h diff --git a/packages/language/c/libc/current/include/ctype.h b/packages/language/c/libc/current/include/ctype.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/ctype.h @@ -0,0 +1,117 @@ +#ifndef CYGONCE_LIBC_CTYPE_H +#define CYGONCE_LIBC_CTYPE_H +//=========================================================================== +// +// ctype.h +// +// ANSI standard ctype routines defined in section 7.3 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + + +// FUNCTION PROTOTYPES + +//=========================================================================== + +// 7.3.1 Character testing functions + +externC int +isalnum( int ); + +externC int +isalpha( int ); + +externC int +iscntrl( int ); + +externC int +isdigit( int ); + +externC int +isgraph( int ); + +externC int +islower( int ); + +externC int +isprint( int ); + +externC int +ispunct( int ); + +externC int +isspace( int ); + +externC int +isupper( int ); + +externC int +isxdigit( int ); + +//=========================================================================== + +// 7.3.2 Character case mapping functions + +externC int +tolower( int ); + +externC int +toupper( int ); + + +// INLINE FUNCTIONS + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#include +#endif + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_CTYPE_H multiple inclusion protection + +// EOF ctype.h diff --git a/packages/language/c/libc/current/include/ctype.inl b/packages/language/c/libc/current/include/ctype.inl new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/ctype.inl @@ -0,0 +1,175 @@ +#ifndef CYGONCE_LIBC_CTYPE_INL +#define CYGONCE_LIBC_CTYPE_INL +//=========================================================================== +// +// ctype.inl +// +// Inline implementations of ANSI standard ctype routines defined in +// section 7.3 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include - do not include this file directly +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Just to be sure, include the real header + +// FUNCTIONS + +//=========================================================================== + +// 7.3.1 Character testing functions + + +CYGPRI_LIBC_INLINE int +isupper( int c ) +{ + return (('A' <= c) && (c <= 'Z')); +} // isupper() + + +CYGPRI_LIBC_INLINE int +islower( int c ) +{ + return (('a' <= c) && (c <= 'z')); +} // islower() + + +CYGPRI_LIBC_INLINE int +isalpha( int c ) +{ + return ( islower(c) || isupper(c) ); +} // isalpha() + + +CYGPRI_LIBC_INLINE int +isdigit( int c ) +{ + return ( ('0' <= c) && (c <= '9') ); +} // isdigit() + + +CYGPRI_LIBC_INLINE int +isalnum( int c ) +{ + return ( isalpha(c) || isdigit(c) ); +} // isalnum() + + +CYGPRI_LIBC_INLINE int +iscntrl( int c ) +{ + // Simple standard 7-bit ASCII map is assumed + return ( ((0 <= c) && (c <= 0x1F)) || + (c == 0x7F) ); +} // iscntrl() + + +CYGPRI_LIBC_INLINE int +isgraph( int c ) +{ + // Simple standard 7-bit ASCII map is assumed + return ( ('!' <= c) && (c <= '~') ); +} // isgraph() + + +CYGPRI_LIBC_INLINE int +isprint( int c ) +{ + // Simple standard 7-bit ASCII map is assumed + return ( (' ' <= c) && (c <= '~') ); +} // isprint() + + +CYGPRI_LIBC_INLINE int +ispunct( int c ) +{ + // Simple standard 7-bit ASCII map is assumed + return ( (('!' <= c) && (c <= '/')) || // ASCII 0x21 - 0x2F + ((':' <= c) && (c <= '@')) || // ASCII 0x3A - 0x40 + (('[' <= c) && (c <= '`')) || // ASCII 0x5B - 0x60 + (('{' <= c) && (c <= '~')) ); // ASCII 0x7B - 0x7E + +} // ispunct() + + +CYGPRI_LIBC_INLINE int +isspace( int c ) +{ + return ( (c == ' ') || (c == '\f') || (c == '\n') || (c == '\r') || + (c == '\t') || (c == '\v') ); +} // isspace() + + +CYGPRI_LIBC_INLINE int +isxdigit( int c ) +{ + return ( isdigit(c) || + (('a' <= c) && (c <= 'f')) || + (('A' <= c) && (c <= 'F')) ); +} // isxdigit() + +//=========================================================================== + +// 7.3.2 Character case mapping functions + + +CYGPRI_LIBC_INLINE int +tolower( int c ) +{ + return isupper(c) ? c - 'A' + 'a' : c; +} // tolower() + + +CYGPRI_LIBC_INLINE int +toupper( int c ) +{ + return islower(c) ? c - 'a' + 'A' : c; +} // toupper() + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_CTYPE_INL multiple inclusion protection + +// EOF ctype.inl diff --git a/packages/language/c/libc/current/include/errno.h b/packages/language/c/libc/current/include/errno.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/errno.h @@ -0,0 +1,83 @@ +#ifndef CYGONCE_LIBC_ERRNO_H +#define CYGONCE_LIBC_ERRNO_H +//======================================================================== +// +// errno.h +// +// ANSI error code routines +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions etc. +#include // Common error code definitions + +// FUNCTION PROTOTYPES + +#ifdef CYGSEM_LIBC_PER_THREAD_ERRNO + +externC Cyg_ErrNo * +cyg_get_errno_p( void ); + +#endif // ifdef CYGSEM_LIBC_PER_THREAD_ERRNO + +// VARIABLES + +#ifdef CYGSEM_LIBC_PER_THREAD_ERRNO + +# define errno (*cyg_get_errno_p()) // Global error status + +#else + +externC Cyg_ErrNo errno; // Global error status + +#endif // ifdef CYGSEM_LIBC_PER_THREAD_ERRNO + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_ERRNO_H multiple inclusion protection + +// EOF errno.h diff --git a/packages/language/c/libc/current/include/locale.h b/packages/language/c/libc/current/include/locale.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/locale.h @@ -0,0 +1,122 @@ +#ifndef CYGONCE_LIBC_LOCALE_H +#define CYGONCE_LIBC_LOCALE_H +//======================================================================== +// +// locale.h +// +// Standard ISO C internationalisation (i18n) and localisation (i10n) +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-08-31 +// Purpose: +// Description: This implementation is designed to implement the contents +// of ISO C section 7.4 +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // locale.h must provide NULL + +// TYPE DEFINITIONS + +// struct lconv contains information about numeric and monetary numbers +// and is described in the ISO C standard section 7.4 + +struct lconv { + + // the following affect formatted NONMONETARY QUANTITIES only + char *decimal_point; // decimal point + char *thousands_sep; // separates groups of digits before decimal + // point + char *grouping; // string whose elements indicate the size + // of each group of digits + + // the following affect formatted MONETARY QUANTITIES only + char *int_curr_symbol; // international curreny symbol + char *currency_symbol; // local currency symbol + char *mon_decimal_point; // decimal point + char *mon_thousands_sep; // separator for groups of digits + // before the decimal point + char *mon_grouping; // string whose elements indicate the size + // of each group of digits + char *positive_sign; // string to indicate zero or positive value + char *negative_sign; // string to indicate negative value + char int_frac_digits; // number of digits after decimal point for + // internationally formatted monetary nums + char frac_digits; // number of digits after decimal point for + // formatted monetary nums + char p_cs_precedes; // 1 if currency_symbol precedes non-negative + // monetary quantity. 0 if succeeds + char p_sep_by_space; // 1 if currency_symbol separated from value + // of non-negative monetary quantity by space. + // Otherwise 0. + char n_cs_precedes; // 1 if currency_symbol precedes negative + // monetary quantity. 0 if succeeds + char n_sep_by_space; // 1 if currency_symbol separated from value + // of negative monetary quantity by space. + // Otherwise 0. + char p_sign_posn; // set according to position of positive_sign + char n_sign_posn; // set according to position of negative_sign +}; + +// CONSTANTS + +#define LC_COLLATE (1<<0) +#define LC_CTYPE (1<<1) +#define LC_MONETARY (1<<2) +#define LC_NUMERIC (1<<3) +#define LC_TIME (1<<4) +#define LC_ALL (LC_COLLATE|LC_CTYPE|LC_MONETARY|LC_NUMERIC|LC_TIME) + +// FUNCTION PROTOTYPES + +externC char * +setlocale( int /* category */, const char * /* locale */ ); + +externC struct lconv * +localeconv( void ); + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_LOCALE_H multiple inclusion protection + +// EOF locale.h diff --git a/packages/language/c/libc/current/include/pkgconf/libc.h b/packages/language/c/libc/current/include/pkgconf/libc.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/pkgconf/libc.h @@ -0,0 +1,1053 @@ +#ifndef CYGONCE_PKGCONF_LIBC_H +#define CYGONCE_PKGCONF_LIBC_H +//======================================================================== +// +// libc.h +// +// Configuration header for the ANSI standard C library +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: Configuration of the ISO C library +// Description: The preprocessor defines here can be used to configure +// the ISO C library, preferably with a graphical tool, +// but also manually if required. +// Usage: #include +// +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// INCLUDES + +// Include system configuration file to work out whether the C library is +// to be included at all +#include + +// Make sure kernel config is already there for +// CYGNUM_KERNEL_THREADS_DATA_LIBC and CYGVAR_KERNEL_THREADS_DATA +#ifdef CYGPKG_KERNEL +# include +#endif + +/* + {{CFG_DATA + + cdl_package CYGPKG_LIBC { + display "C Library" + description "This package enables compatibility with the ISO + C standard - ISO/IEC 9899:1990. This allows the + user application to use well known standard + C library functions, and in eCos starts a + thread to invoke the user function main()" + type boolean + requires CYGPKG_ERROR + doc ref/ecos-ref/the-iso-standard-c-and-math-libraries.html + } + + }}CFG_DATA +*/ + +//======================================================================== + +// CTYPE CONFIGURATION OPTIONS + +/* + {{CFG_DATA + cdl_option CYGIMP_LIBC_CTYPE_INLINES { + display "Inline versions of functions" + description "This option chooses whether the simple character + classification and conversion functions (e.g. + isupper(), isalpha(), toupper(), etc.) + from are available as inline + functions. This may improve performance and as + the functions are small, may even improve code + size." + + type boolean + parent CYGPKG_LIBC + } + }}CFG_DATA +*/ + +#define CYGIMP_LIBC_CTYPE_INLINES + +//======================================================================== + +// STRING CONFIGURATION OPTIONS + +/* + {{CFG_DATA + cdl_component CYGPKG_LIBC_STRING { + display "String functions" + description "Options associated with the standard string + functions" + + type dummy + parent CYGPKG_LIBC + } + + cdl_option CYGIMP_LIBC_STRING_INLINES { + display "Inline versions of functions" + description "This option chooses whether some of the + particularly simple string functions from + are available as inline + functions. This may improve performance, and as + the functions are small, may even improve code + size." + + type boolean + parent CYGPKG_LIBC_STRING + } + + cdl_option CYGFUN_LIBC_strtok { + display "Provides strtok()" + description "This option chooses whether the strtok() function + is to be available. Some space may be saved if + not." + + type boolean + parent CYGPKG_LIBC_STRING + } + + cdl_component CYGPKG_LIBC_STRING_OPTIMIZATIONS { + display "Options for string function optimization" + description "This component lets you choose between different + implementations of the string functions with + different tradeoffs. Most of the string + functions can be implemented in two ways. One + approach is geared towards smaller code size, + while the other tries to improve execution speed + at the expense of code size. " + + type dummy + parent CYGPKG_LIBC_STRING + } + + cdl_option CYGIMP_LIBC_STRING_PREFER_FAST { + display "Fast" + description "This option improves string function execution + speed at the expense of code size. This + option is overriden if the code is + compiled with the -Os option to the compiler." + + type radio + parent CYGPKG_LIBC_STRING_OPTIMIZATIONS + } + + cdl_option CYGIMP_LIBC_STRING_PREFER_SMALL { + display "Small" + description "This option tries to reduce string function + code size at the expense of execution speed. The + same effect can be produced if the code is + compiled with the -Os option to the compiler." + + type radio + parent CYGPKG_LIBC_STRING_OPTIMIZATIONS + } + + }}CFG_DATA +*/ + +#define CYGIMP_LIBC_STRING_INLINES + +#define CYGFUN_LIBC_strtok + +#undef CYGIMP_LIBC_STRING_PREFER_SMALL + +#define CYGIMP_LIBC_STRING_PREFER_FAST + +#ifdef CYGIMP_LIBC_STRING_PREFER_SMALL +# define CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST +#endif + +//======================================================================== + +// SETJMP CONFIGURATION OPTIONS + +/* + {{CFG_DATA + cdl_option CYGIMP_LIBC_SETJMP_INLINES { + display "Inline version of the longjmp() function" + description "This option chooses whether the longjmp() function + is available as an inline function. This may + improve performance, and as the function is small + may even improve code size. " + + type boolean + parent CYGPKG_LIBC + } + }}CFG_DATA +*/ + +#define CYGIMP_LIBC_SETJMP_INLINES + +//======================================================================== + +// STDLIB CONFIGURATION OPTIONS + + +/* + {{CFG_DATA + cdl_component CYGPKG_LIBC_STDLIB { + display "Standard utility functions" + description "Options associated with the standard utility + functions in " + + type dummy + parent CYGPKG_LIBC + } + + cdl_option CYGIMP_LIBC_STDLIB_INLINES { + display "Inline versions of functions" + description "This option chooses whether some of the + particularly simple standard utility functions + from are available as inline + functions. This may improve performance, and as + the functions are small, may even improve code + size." + + type boolean + parent CYGPKG_LIBC_STDLIB + } + + cdl_component CYGPKG_LIBC_RAND { + display "Provide rand() and srand()" + description "This option chooses whether the pseudo-random + number generator functions rand() and + srand() are available. Some space may + saved if not." + + type boolean + parent CYGPKG_LIBC_STDLIB + } + + cdl_option CYGNUM_LIBC_RAND_SEED { + display "Random number seed" + description "This selects the initial random number seed for + rand()'s pseudo-random number generator. For + strict ISO standard compliance, this should be 1, + as per section 7.10.2.2 of the standard." + + type count + legal_values 0 to 0x7fffffff + parent CYGPKG_LIBC_RAND + } + + cdl_component CYGPKG_LIBC_MALLOC { + display "Support for dynamic memory allocation" + description "This enables support for dynamic memory + allocation as supplied by the functions malloc(), + free(), calloc() and realloc(). As these + functions are often used, but can have quite an + overhead, disabling them here can ensure they + cannot even be used accidentally when static + allocation is preferred." + + type boolean + parent CYGPKG_LIBC_STDLIB + requires CYGPKG_KERNEL + } + + cdl_option CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE { + display "Size of the dynamic memory pool in bytes" + description "At this stage, dynamic memory allocation by + malloc() and calloc() must be from a fixed-size, + contiguous memory pool. This option is the size + of that pool, in bytes. Note that not all of + this is available for programs to + use - some is needed for internal information + about memory regions, and some may be lost to + ensure that memory allocation only returns + memory aligned on word (or double word) + boundaries - a very common architecture + constraint." + + type count + legal_values 32 to 0x7fffffff + parent CYGPKG_LIBC_MALLOC + } + + cdl_option CYGIMP_LIBC_MALLOC_CXX_DELETE_CALLS_FREE { + display "Support for C++ delete operator" + description "C++ new and delete operators can call + the C library's malloc() and free() implicitly. + If this is what is required, enable this option. + However, if enabled, the dynamic memory allocation + code is always linked in to the application, + even if it is not explicitly called and new/delete + are not used. + This increases code and data size needlessly." + + type bool + parent CYGPKG_LIBC_MALLOC + } + + cdl_option CYGFUN_LIBC_strtod { + display "Provides strtod() and atof()" + description "This option allows use of the utility function + strtod() (and consequently atof()) to convert + from string to double precision floating point + numbers. Disabling this option removes the + dependency on the math library package." + + type boolean + parent CYGPKG_LIBC_STDLIB + requires CYGPKG_LIBM + } + + }}CFG_DATA +*/ + +#define CYGIMP_LIBC_STDLIB_INLINES + +#define CYGPKG_LIBC_RAND + +#ifdef CYGPKG_LIBC_RAND +#define CYGNUM_LIBC_RAND_SEED 1 +#endif + +#define CYGPKG_LIBC_MALLOC + +#ifdef CYGPKG_LIBC_MALLOC + +#undef CYGIMP_LIBC_MALLOC_CXX_DELETE_CALLS_FREE + +#ifndef CYGPKG_KERNEL +# error You must have the Kernel enabled to use the C library dynamic \ + memory allocation functions +#endif + +#define CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE 32768 + +#endif // ifdef CYGPKG_LIBC_MALLOC + +#define CYGFUN_LIBC_strtod + +#ifdef CYGFUN_LIBC_strtod +# ifndef CYGPKG_LIBM +# error You must enable the Math library package to use strtod() or atof() +# endif +#endif + +//======================================================================== + +// STDIO CONFIGURATION OPTIONS + +/* + {{CFG_DATA + cdl_component CYGPKG_LIBC_STDIO { + display "Standard Input/Output functions" + description "This enables support for standard I/O functions + from ." + + type boolean + parent CYGPKG_LIBC + requires CYGPKG_DEVICES + } + + cdl_option CYGIMP_LIBC_STDIO_INLINES { + display "Inline versions of functions" + description "This option chooses whether some of the + particularly simple functions from + are available as inline + functions. This may improve performance, and as + the functions are small, may even improve code + size." + + type boolean + parent CYGPKG_LIBC_STDIO + } + + cdl_option FOPEN_MAX { + display "Permitted number of open files" + description "This option controls the guaranteed minimum + number of simultaneously open files. The ISO + C standard requires it to be defined (para + 7.9.1), and if strictly compliant, it must be + at least 8 (para 7.9.3). In practice it can be + as low as 3 - for stdin, stdout and stderr." + + type count + legal_values 3 to 0x7fffffff + parent CYGPKG_LIBC_STDIO + } + + cdl_option FILENAME_MAX { + display "Maximum length of filename" + description "This option defines the maximum allowed size of + a filename in characters. The ISO C standard + requires it to be defined (para 7.9.1)." + + type count + legal_values 1 to 0x7fffffff + parent CYGPKG_LIBC_STDIO + } + + cdl_option L_tmpnam { + display "Maximum length of filenames for temporary files" + description "This option defines the maximum allowed size of + filenames for temporary files as generated by + tmpnam(). It is measured in characters, and the + ISO C standard requires it to be defined (para + 7.9.1)." + + type count + legal_values 1 to 0x7fffffff + parent CYGPKG_LIBC_STDIO + } + + cdl_option TMP_MAX { + display "Unique file names generated by tmpnam()" + description "This option defines the minimum number of + unique file names generated by tmpnam(). The + ISO C standard requires it to be defined (para + 7.9.1)." + + type count + legal_values 0 to 0x7fffffff + parent CYGPKG_LIBC_STDIO + } + + cdl_component CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO { + display "Buffered I/O" + description "This option controls whether input/output + through the functions is buffered. + This may save some memory per file. It + is equivalent to putting every file into + non-buffered mode (_IONBF) through setvbuf(), + except now it can never be altered back to + buffered mode. Disabling buffering is strictly + non-compliant with the ISO C standard." + + type boolean + parent CYGPKG_LIBC_STDIO + } + + cdl_option CYGNUM_LIBC_STDIO_BUFSIZE { + display "Default buffer size" + description "This option defines the default size of buffer + used with calls to setbuf(), and is the default + size for buffered streams that have not had + either setbuf() or setvbuf() invoked on them. + It is exactly equivalent to the standard + constant BUFSIZE, except that it is 0 if + CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO is disabled. + The ISO C standard requires this to be defined + (para 7.9.1), and says it must be at least 256 + (para 7.9.2)." + + type count + legal_values 1 to 0x7fffffff + parent CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + } + + cdl_option CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF { + display "setbuf()/setvbuf() uses malloc()" + description "This option controls whether I/O buffers are + implemented dynamically within the stdio + implementation. Otherwise they will be static, + and cannot be changed by setbuf()/setvbuf(). If + they are static (i.e. this option is disabled), + any attempt to use an arbitrary buffer size, or + to pass a user-supplied buffer to setbuf() or + setvbuf() will fail - the buffer is implemented + internally as a static array of taking the size + of the configuration option BUFSIZE. The only + exception is if a user buffer is not supplied, + and the buffer size requested is less than + BUFSIZE. In this case, the buffer will + be configured to only use that amount of + buffering. However the unused memory left over + will NOT be freed. If this option is enabled, + then CYGPKG_LIBC_MALLOC must also + be enabled. Either setting can be considered to + be compliant with the ISO C standard." + + type boolean + parent CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + requires CYGPKG_LIBC_MALLOC + } + + cdl_option CYGFUN_LIBC_STDIO_ungetc { + display "Support for ungetc()" + description "This option controls whether ungetc() is + supported. If not, then some space can be + saved, and speed is improved. Note that you + MUST have this defined if you want to use the + scanf() family of functions." + + type boolean + parent CYGPKG_LIBC_STDIO + } + + cdl_option CYGPKG_LIBC_STDIO_OPEN { + display "Dynamic opening/closing of files" + description "fopen() and fclose() use dynamic memory + allocation routines to allocate memory for + new FILE structure pointers. This option, + along with CYGPKG_LIBC_MALLOC, should be + enabled to use + fopen() and fclose(). If disabled, only the + default console streams - stdin, stdout and + stderr - will be available." + + type boolean + parent CYGPKG_LIBC_STDIO + requires CYGPKG_LIBC_MALLOC + } + + cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE { + display "Default console device" + description "This option allows you to choose the + default console device. In the current + implementation, all these devices begin + with the prefix /dev/ and are followed by + the name of a device as listed in the + devs/common/current/src/table.cxx file in the + source repository. Look at that file to see + list of available devices." + + type string + parent CYGPKG_LIBC_STDIO + } + + cdl_component CYGPKG_LIBC_STDIO_FLOATING_POINT { + display "Floating point support" + description "This component allows floating point support + to be enabled in certain standard I/O + functions." + + type dummy + parent CYGPKG_LIBC_STDIO + } + + cdl_option CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT { + display "printf() family" + description "This option enables the use of floating point + number output in the printf() family (i.e. + printf(), sprintf(), vprintf(), etc.) of + functions. A substantial amount of code space + can be saved if this option is disabled. If it + is disabled then floating point specifiers + (%e, %f, %g) are ignored, and nothing is + output." + + type boolean + parent CYGPKG_LIBC_STDIO_FLOATING_POINT + requires CYGPKG_LIBM + } + + cdl_option CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT { + display "scanf() family" + description "This option enables the use of floating point + number conversion in the scanf() family (i.e. + scanf(), sscanf(), vscanf(), etc.) of + functions. A substantial amount of code space + can be saved if this option is disabled. If it + is disabled then floating point specifiers + (%e, %f, %g) are ignored, and nothing is + converted." + + type boolean + parent CYGPKG_LIBC_STDIO_FLOATING_POINT + requires CYGPKG_LIBM + requires CYGFUN_LIBC_strtod + } + + }}CFG_DATA +*/ + +#define CYGPKG_LIBC_STDIO + +#ifdef CYGPKG_LIBC_STDIO + +#ifndef CYGPKG_DEVICES +# error You must have generic device driver support enabled for C library \ + standard I/O +#endif + +#define CYGIMP_LIBC_STDIO_INLINES + +#define FOPEN_MAX 8 + +#define FILENAME_MAX 16 + +#define L_tmpnam 16 + +#define TMP_MAX 0 + +#define CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + +#define CYGNUM_LIBC_STDIO_BUFSIZE 256 + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO +# define BUFSIZE CYGNUM_LIBC_STDIO_BUFSIZE +#else +# define BUFSIZE 0 +#endif + +#undef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF + +#ifdef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF +# ifndef CYGPKG_LIBC_MALLOC +# error You must have malloc() support if you want dynamic setvbuf \ + support in the C library +# endif +#endif + +#define CYGFUN_LIBC_STDIO_ungetc + +#define CYGPKG_LIBC_STDIO_OPEN + +#ifdef CYGPKG_LIBC_STDIO_OPEN +# ifndef CYGPKG_LIBC_MALLOC +# error You must have malloc() support if you want to use fopen() +# endif +#endif + +// We define a default console so that the console is defined +// statically, to prevent the requirement of dynamic memory allocation, and +// since there is generally only one relevant console which exists for the +// lifetime of the system. See the device driver documentation and examine +// your configuration to find out which device names are available. The +// device names should be prefixed with "/dev/". +// +// So what is the name of the device that is the default console device +#define CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE "/dev/haldiag" + +#define CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT +# ifndef CYGPKG_LIBM +# error You must enable the Math library to use floating point in the \ + *printf() functions +# endif +#endif + +#define CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT + +#ifdef CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT +# ifndef CYGFUN_LIBC_strtod // libm is implicit with this +# error You must enable the use of strtod and the math library to use \ + floating point in the *scanf() functions +# endif +#endif + +#endif // ifdef CYGPKG_LIBC_STDIO + +//======================================================================== + +// THREAD SAFETY CONFIGURATION OPTIONS + +/* + + {{CFG_DATA + + cdl_component CYGSEM_LIBC_THREAD_SAFETY { + display "Thread safety" + description "This option controls whether the C library has + support for thread safe operation in general. + This requires eCos kernel support for per-thread + data, and adjustment of the stack limit." + doc ref/ecos-ref/c-and-math-library-overview-thread-safety.html + type boolean + parent CYGPKG_LIBC + requires CYGPKG_KERNEL + requires CYGVAR_KERNEL_THREADS_DATA + requires CYGFUN_KERNEL_THREADS_STACK_LIMIT + } + + cdl_option CYGSEM_LIBC_PER_THREAD_ERRNO { + display "Per-thread errno" + description "This option controls whether the standard error + code reporting variable errno is a per-thread + variable, rather than global." + type boolean + parent CYGSEM_LIBC_THREAD_SAFETY + } + + cdl_option CYGSEM_LIBC_PER_THREAD_STRTOK { + display "Per-thread strtok()" + description "This option controls whether the string function + strtok() has its state recorded on a per-thread + basis rather than global. If this option is + disabled, some per-thread space can be saved. + Note there is also a POSIX-standard strtok_r() + function to achieve a similar effect with user + support." + type boolean + parent CYGSEM_LIBC_THREAD_SAFETY + } + + cdl_option CYGSEM_LIBC_PER_THREAD_RAND { + display "Per-thread rand()" + description "This option controls whether the pseudo-random + number generation functions rand() and srand() + have their state recorded on a per-thread + basis rather than global. If this option is + disabled, some per-thread space can be saved. + Note there is also a POSIX-standard rand_r() + function to achieve a similar effect with user + support." + type boolean + parent CYGSEM_LIBC_THREAD_SAFETY + } + + cdl_option CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS { + display "Thread safe I/O streams" + description "This option controls whether standard I/O streams + are thread-safe. Having this option set allows + the streams to be locked when accessed by + multiple threads simultaneously." + type boolean + parent CYGSEM_LIBC_THREAD_SAFETY + } + + + + }}CFG_DATA + +*/ + +#undef CYGSEM_LIBC_THREAD_SAFETY + +#ifdef CYGSEM_LIBC_THREAD_SAFETY + +#define CYGSEM_LIBC_PER_THREAD_ERRNO + +#define CYGSEM_LIBC_PER_THREAD_STRTOK + +#define CYGSEM_LIBC_PER_THREAD_RAND + +#define CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + +// Consistency check for kernel support +# if !defined(CYGVAR_KERNEL_THREADS_DATA) || !defined(CYGFUN_KERNEL_THREADS_STACK_LIMIT) + +# error Sorry, the kernel must have per-thread data and stack limit \ + support configured to allow a thread-safe C library + +# endif // if !defined(CYGVAR_KERNEL_THREADS_DATA) || + // !defined(CYGFUN_KERNEL_THREADS_STACK_LIMIT) + +#endif // ifdef CYGSEM_LIBC_THREAD_SAFETY + +//======================================================================== + +// INTERNATIONALIZATION AND LOCALIZATION OPTIONS + +/* + + {{CFG_DATA + + cdl_option CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE { + display "Size of locale name strings" + description "This option controls the maximum size of + locale names and is used, among other things + to instantiate a static string used + as a return value from the + setlocale() function. When requesting the + current locale settings with LC_ALL, a string + must be constructed to contain this data, rather + than just returning a constant string. This + string data is stored in the static string. + This depends on the length of locale names, + hence this option. If just the C locale is + present, this option can be set as low as 2." + + type count + legal_values 2 to 0x7fffffff + parent CYGPKG_LIBC + } + + }}CFG_DATA + +*/ + +#define CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE 16 + +//======================================================================== + +// STARTUP OPTIONS + +/* + {{CFG_DATA + + cdl_component CYGPKG_LIBC_STARTUP { + display "ISO C startup/termination" + description "This component manages the control of the + environment (in the general sense) that the + C library provides for use for full ISO C + compatibility, including a main() entry point + supplied with arguments and an environment + (as retrievable by the getenv() function). + It also includes at the other end of things, + what happens when main() returns or exit() is + called." + doc ref/ecos-ref/c-library-startup.html.html + type dummy + parent CYGPKG_LIBC + } + + cdl_option CYGDAT_LIBC_ARGUMENTS { + display "Arguments to main()" + description "This option allows the setting of the arguments + to the main function. This only has any effect + when cyg_iso_c_start() is used to start the + ISO C compatibility. This will automatically + invoke main() in an ISO C compatible fashion. + This option is in fact used as argv, and so is + an n-tuple of string constants. The final + entry must be NULL. Conventionally if argv[0] + is supplied, it is used to inform the program + of its name." + + type string + parent CYGPKG_LIBC_STARTUP + } + + cdl_option CYGNUM_LIBC_MAIN_STACK_SIZE { + display "main()'s thread stack size" + description "With an eCos kernel, when the cyg_iso_c_start() + function is used to invoke the user-supplied + main() function in an ISO C compatible fashion, + a separate thread is created to call main(). + This option controls the size of that thread's + stack, which is allocated in the BSS. It + must be a multiple of 8." + + type count + legal_values 16 to 0x7fffffff + parent CYGPKG_LIBC_STARTUP + #requires CYGPKG_KERNEL + } + + cdl_option CYGNUM_LIBC_ATEXIT_HANDLERS { + display "Number of functions atexit() supports" + description "This option sets the number of functions + that atexit() has room for. In other words, + the number of separate atexit() calls that + can be made before calling exit() or returning + from main() ( in an environment controlled by + cyg_iso_c_start() ). For strict compliance + with the ISO C standard this should be at + least 32." + + type count + parent CYGPKG_LIBC_STARTUP + legal_values 1 to 0x7fffffff + } + + cdl_option CYGSEM_LIBC_EXIT_STOPS_SYSTEM { + display "_exit() stops all threads" + description "If this option is enabled then _exit(), + which is called from exit() which itself is + called on return from main(), stops the eCos + scheduler. For strict POSIX 1003.1 + compatibility this would be the normal + behaviour. To allow the thread to simply + exit, without affecting other threads, simply + disable this option. If there is no eCos + scheduler, then _exit() simply loops + irrespective of the setting of this option." + + type boolean + parent CYGPKG_LIBC_STARTUP + requires CYGPKG_KERNEL + } + + cdl_component CYGPKG_LIBC_ENVIRONMENT { + display "Provide a system environment" + description "This option allows use of the getenv() function + and the global environment pointer + char **environ defined by POSIX 1003.1. + Disabling this saves a small amount of space." + + type boolean + parent CYGPKG_LIBC_STARTUP + } + + cdl_option CYGDAT_LIBC_DEFAULT_ENVIRONMENT { + display "Default environment" + description "This option allows the setting of the default + contents of the environment. This is in fact + the contents of the global environment pointer + char **environ defined by POSIX 1003.1. Strings + must be of the form NAME=VALUE, and the final + entry must be NULL." + + type string + parent CYGPKG_LIBC_ENVIRONMENT + } + + }}CFG_DATA +*/ + +#define CYGDAT_LIBC_ARGUMENTS { "", NULL } + +#define CYGNUM_LIBC_MAIN_STACK_SIZE 32768 + +#define CYGNUM_LIBC_ATEXIT_HANDLERS 32 + +#undef CYGSEM_LIBC_EXIT_STOPS_SYSTEM + +#define CYGPKG_LIBC_ENVIRONMENT + +#define CYGDAT_LIBC_DEFAULT_ENVIRONMENT { NULL } + + +//======================================================================== + +// TRACING OPTIONS + +/* + {{CFG_DATA + + cdl_component CYGPKG_LIBC_TRACE { + display "Tracing output levels in C library" + description "Tracing support is useful for debugging. Some + C library modules can be configured with + different levels of tracing verbosity. These + levels can be configured here." + + type boolean + requires CYGDBG_USE_TRACING + parent CYGPKG_LIBC + } + + cdl_option CYGNUM_LIBC_RAND_TRACE_LEVEL { + display "rand(), srand() and rand_r()" + description "Trace level for debugging the rand(), srand() + and rand_r() functions." + + type count + legal_values 0 to 1 + parent CYGPKG_LIBC_TRACE + } + + cdl_option CYGNUM_LIBC_ERRNO_TRACE_LEVEL { + display "errno" + description "Trace level for debugging the errno retrieval + mechanism in errno.cxx." + + type count + legal_values 0 to 1 + parent CYGPKG_LIBC_TRACE + } + + cdl_option CYGNUM_LIBC_BSEARCH_TRACE_LEVEL { + display "bsearch()" + description "Trace level for debugging the binary + search function bsearch()." + + type count + legal_values 0 to 1 + parent CYGPKG_LIBC_TRACE + } + + cdl_option CYGNUM_LIBC_QSORT_TRACE_LEVEL { + display "qsort()" + description "Trace level for debugging the + quicksort function qsort()." + + type count + legal_values 0 to 1 + parent CYGPKG_LIBC_TRACE + } + + cdl_option CYGNUM_LIBC_CLOCK_TRACE_LEVEL { + display "clock()" + description "Trace level for debugging the function + clock()." + + type count + legal_values 0 to 1 + parent CYGPKG_LIBC_TRACE + } + + cdl_option CYGNUM_LIBC_STRTOK_TRACE_LEVEL { + display "strtok() and strtok_r()" + description "Trace level for debugging the + functions strtok() and strtok_r()." + + type count + legal_values 0 to 1 + parent CYGPKG_LIBC_TRACE + } + + }}CFG_DATA +*/ + +#undef CYGPKG_LIBC_TRACE + +#ifdef CYGPKG_LIBC_TRACE + +#define CYGNUM_LIBC_RAND_TRACE_LEVEL 0 + +#define CYGNUM_LIBC_ERRNO_TRACE_LEVEL 0 + +#define CYGNUM_LIBC_BSEARCH_TRACE_LEVEL 0 + +#define CYGNUM_LIBC_QSORT_TRACE_LEVEL 0 + +#define CYGNUM_LIBC_CLOCK_TRACE_LEVEL 0 + +#define CYGNUM_LIBC_STRTOK_TRACE_LEVEL 0 + +#endif // ifdef CYGPKG_LIBC_TRACE + +//======================================================================== + +// MISCELLANEOUS CONFIGURATION OPTIONS + +// These are not really adjustable by the user. Do not change these unless +// you know what you are doing! + +// How to define inline functions +#define CYGPRI_LIBC_INLINE extern __inline__ + +// How to define weak symbols - may disappear as this is only relevant for +// ELF and a.out +#define CYGPRI_LIBC_WEAK __attribute__ ((weak)) + +// How to define aliases +#define CYGPRI_LIBC_ALIAS(X) __attribute__ ((alias (X))) + +// How to define weak aliases or an equivalent hack if not available + +#define CYGPRI_LIBC_WEAK_ALIAS(X) __attribute__ ((weak, alias (X))) + +// How to define functions that don't return +#define CYGPRI_LIBC_NORETURN __attribute__ ((noreturn)) + +#endif // CYGONCE_PKGCONF_LIBC_H multiple inclusion protection + +// EOF libc.h diff --git a/packages/language/c/libc/current/include/setjmp.h b/packages/language/c/libc/current/include/setjmp.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/setjmp.h @@ -0,0 +1,89 @@ +#ifndef CYGONCE_LIBC_SETJMP_H +#define CYGONCE_LIBC_SETJMP_H +//=========================================================================== +// +// setjmp.h +// +// ANSI standard non-local jumps +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Header file to implement ANSI standard non-local jumps as +// per ANSI para 7.6 +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Common tracing code +#include // HAL architecture specific implementation + + +// TYPE DEFINITIONS + +// jmp_buf as per ANSI 7.6. This is simply the underlying HAL buffer + +typedef hal_jmp_buf jmp_buf; + +// MACROS + +// setjmp() function, as described in ANSI para 7.6.1.1 +#define setjmp( __env__ ) hal_setjmp( __env__ ) + +// FUNCTION PROTOTYPES + +// longjmp() function, as described in ANSI para 7.6.2.1 +externC void +longjmp( jmp_buf, int ) CYGPRI_LIBC_NORETURN; + + +// INLINE FUNCTIONS + +#ifdef CYGIMP_LIBC_SETJMP_INLINES +# include +#endif + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_SETJMP_H multiple inclusion protection + +// EOF setjmp.h diff --git a/packages/language/c/libc/current/include/setjmp.inl b/packages/language/c/libc/current/include/setjmp.inl new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/setjmp.inl @@ -0,0 +1,92 @@ +#ifndef CYGONCE_LIBC_SETJMP_INL +#define CYGONCE_LIBC_SETJMP_INL +//=========================================================================== +// +// setjmp.inl +// +// Inline functions for ANSI standard non-local jumps +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Inline functions to implement ANSI standard non-local jumps as +// per ANSI para 7.6 +// Usage: Do not include this file, #include instead +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Common tracing code +#include // Common assertion code +#include // Header for this file, just in case +#include // HAL architecture specific implementation + +// INLINE FUNCTIONS + +CYGPRI_LIBC_INLINE void +longjmp( jmp_buf cyg_buf, int cyg_val) +{ + CYG_REPORT_FUNCNAME( "longjmp" ); + CYG_REPORT_FUNCARG2( "&cyg_buf=%08x, cyg_val=%d", &cyg_buf, cyg_val ); + + // ANSI says that if we are passed cyg_val==0, then we change it to 1 + if (cyg_val == 0) + ++cyg_val; + + // we let the HAL do the work + + HAL_REORDER_BARRIER(); // prevent any chance of optimisation re-ordering + hal_longjmp( cyg_buf, cyg_val ); + HAL_REORDER_BARRIER(); // prevent any chance of optimisation re-ordering + +#ifdef CYGDBG_USE_ASSERTS + CYG_ASSERT( 0, "longjmp should not have reached this point!" ); +#else + for (;;) + CYG_EMPTY_STATEMENT; +#endif +} // longjmp() + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_SETJMP_INL multiple inclusion protection + +// EOF setjmp.inl diff --git a/packages/language/c/libc/current/include/stdio.h b/packages/language/c/libc/current/include/stdio.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/stdio.h @@ -0,0 +1,262 @@ +#ifndef CYGONCE_LIBC_STDIO_H +#define CYGONCE_LIBC_STDIO_H +//======================================================================== +// +// stdio.h +// +// ISO C standard I/O routines - with some POSIX 1003.1 extensions +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // common type definitions and support +#include // NULL and size_t from compiler +#include // va_list from compiler +#include // FILE definition + +// CONSTANTS + +// Some of these values are odd to ensure that asserts have better effect +// should spurious values be passed to functions expecting these constants. + +// _IOFBF, _IOLBF, and _IONBF specify full, line or no buffering when used +// with setvbuf() - ISO C standard chap 7.9.1 + +#define _IOFBF (-2) +#define _IOLBF (-4) +#define _IONBF (-8) + +// EOF is a macro defined to any negative integer constant - ISO C standard +// chap. 7.9.1 +#define EOF (-1) + +// SEEK_CUR, SEEK_END and SEEK_SET are used with fseek() as position +// anchors - ISO C standard chap. 7.9.1 +#define SEEK_CUR (-16) +#define SEEK_END (-32) +#define SEEK_SET (-64) + + +// TYPE DEFINITIONS + +// A type capable of specifying uniquely every file position - ISO C +// standard chap 7.9.1 +typedef cyg_ucount32 fpos_t; + + +// EXTERNAL VARIABLES + +// Default file streams for input/output. These only need to be +// expressions, not l-values - ISO C standard chap. 7.9.1 + +externC FILE *stdin, *stdout, *stderr; + +// FUNCTION PROTOTYPES + +//======================================================================== + +// ISO C 7.9.5 File access functions + +externC int +fclose( FILE * /* stream */ ); + +externC int +fflush( FILE * /* stream */ ); + +externC FILE * +fopen( const char * /* filename */, const char * /* mode */ ); + +externC FILE * +freopen( const char * /* filename */, const char * /* mode */, + FILE * /* stream */ ); + +externC void +setbuf( FILE * /* stream */, char * /* buffer */ ); + +externC int +setvbuf( FILE * /* stream */, char * /* buffer */, int /* mode */, + size_t /* size */ ); + +//======================================================================== + +// ISO C 7.9.6 Formatted input/output functions + +externC int +fprintf( FILE * /* stream */, const char * /* format */, ... ); + +externC int +fscanf( FILE * /* stream */, const char * /* format */, ... ); + +externC int +printf( const char * /* format */, ... ); + +externC int +scanf( const char * /* format */, ... ); + +externC int +sprintf( char * /* str */, const char * /* format */, ... ); + +externC int +sscanf( const char * /* str */, const char * /* format */, ... ); + +externC int +vfprintf( FILE * /* stream */, const char * /* format */, + va_list /* args */ ); + +externC int +vprintf( const char * /* format */, va_list /* args */ ); + +externC int +vsprintf( char * /* str */, const char * /* format */, + va_list /* args */ ); + +//======================================================================== + +// ISO C 7.9.7 Character input/output functions + +externC int +fgetc( FILE * /* stream */ ); + +externC char * +fgets( char * /* str */, int /* length */, FILE * /* stream */ ); + +externC int +fputc( int /* c */, FILE * /* stream */ ); + +externC int +fputs( const char * /* str */, FILE * /* stream */ ); + +// no function equivalent is required for these, so we can just #define +// them + +#define getc( __stream ) fgetc( __stream ) + +#define getchar() fgetc( stdin ) + +externC char * +gets( char * ); + +#define putc(__c, __stream) fputc(__c, __stream) + +#define putchar(__c) fputc(__c, stdout) + +externC int +puts( const char * /* str */ ); + +externC int +ungetc( int /* c */, FILE * /* stream */ ); + +//======================================================================== + +// ISO C 7.9.8 Direct input/output functions + +externC size_t +fread( void * /* ptr */, size_t /* object_size */, + size_t /* num_objects */, FILE * /* stream */ ); + +externC size_t +fwrite( const void * /* ptr */, size_t /* object_size */, + size_t /* num_objects */, FILE * /* stream */ ); + + +//======================================================================== + +// ISO C 7.9.10 Error-handling functions + +externC void +clearerr( FILE * /* stream */ ); + +externC int +feof( FILE * /* stream */ ); + +externC int +ferror( FILE * /* stream */ ); + +externC void +perror( const char * /* prefix_str */ ); + +//======================================================================== + +// Other non-ISO C functions + +externC int +fnprintf( FILE * /* stream */, size_t /* length */, + const char * /* format */, ... ); + +externC int +snprintf( char * /* str */, size_t /* length */, const char * /* format */, + ... ); + +externC int +vfnprintf( FILE * /* stream */, size_t /* length */, + const char * /* format */, va_list /* args */ ); + +externC int +vsnprintf( char * /* str */, size_t /* length */, + const char * /* format */, va_list /* args */ ); + +externC int +vscanf( const char * /* format */, va_list /* args */ ); + +externC int +vsscanf( const char * /* str */, const char * /* format */, + va_list /* args */ ); + +externC int +vfscanf( FILE * /* stream */, const char * /* format */, + va_list /* args */ ); + + +// INLINE FUNCTIONS + +#ifdef CYGIMP_LIBC_STDIO_INLINES +#include +#endif + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_STDIO_H multiple inclusion protection + +// EOF stdio.h diff --git a/packages/language/c/libc/current/include/stdio.inl b/packages/language/c/libc/current/include/stdio.inl new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/stdio.inl @@ -0,0 +1,150 @@ +#ifndef CYGONCE_LIBC_STDIO_INL +#define CYGONCE_LIBC_STDIO_INL +//=========================================================================== +// +// stdio.inl +// +// ANSI standard I/O routines - inlined functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include - do not include this file directly +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common type definitions and support +#include // NULL and size_t from compiler +#include // va_list +#include // Just be sure it has been included +#include // Definition of error codes and errno +#include // Definition of strerror() for perror() +#include // INT_MAX + +// INLINE FUNCTION DEFINITIONS + +//=========================================================================== + +// 7.9.5 File access functions + +CYGPRI_LIBC_INLINE void +setbuf( FILE *stream, char *buf ) +{ + if (buf == NULL) + setvbuf( stream, NULL, _IOFBF, BUFSIZE ); + else + setvbuf( stream, buf, _IONBF, BUFSIZE ); + +} // setbuf() + +//=========================================================================== + +// 7.9.6 Formatted input/output functions + +CYGPRI_LIBC_INLINE int +vfprintf( FILE *stream, const char *format, va_list arg ) +{ + return vfnprintf(stream, INT_MAX, format, arg); +} // vfprintf() + + +CYGPRI_LIBC_INLINE int +vprintf( const char *format, va_list arg ) +{ + return vfnprintf(stdout, INT_MAX, format, arg); +} // vprintf() + + +CYGPRI_LIBC_INLINE int +vsprintf( char *s, const char *format, va_list arg ) +{ + return vsnprintf(s, INT_MAX, format, arg); +} // vsprintf() + + +//=========================================================================== + +// 7.9.7 Character input/output functions + +CYGPRI_LIBC_INLINE int +puts( const char *s ) +{ + int rc; + + rc = fputs( s, stdout ); + + if (rc >= 0) + rc = fputc('\n', stdout ); + + return rc; +} // puts() + + +//=========================================================================== + +// 7.9.10 Error-handling functions + +CYGPRI_LIBC_INLINE void +perror( const char *s ) +{ + if (s && *s) + fprintf( stderr, "%s: %s\n", s, strerror(errno) ); + else + fputs( strerror(errno), stderr ); + +} // perror() + +//=========================================================================== + +// Other non-ANSI functions + +CYGPRI_LIBC_INLINE int +vscanf( const char *format, va_list arg ) +{ + return vfscanf( stdin, format, arg ); +} // vscanf() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +#endif // CYGONCE_LIBC_STDIO_INL multiple inclusion protection + +// EOF stdio.inl diff --git a/packages/language/c/libc/current/include/stdlib.h b/packages/language/c/libc/current/include/stdlib.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/stdlib.h @@ -0,0 +1,230 @@ +#ifndef CYGONCE_LIBC_STDLIB_H +#define CYGONCE_LIBC_STDLIB_H +//======================================================================== +// +// stdlib.h +// +// ISO C standard utility functions (ISO C standard section 7.10) +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // NULL, wchar_t and size_t from compiler +#include // for INT_MAX definition used below + +// CONSTANTS + +// as described in ANSI para 7.10 + +// codes to pass to exit() + +#define EXIT_SUCCESS 0 // Successful exit status +#define EXIT_FAILURE 1 // Failing exit status + +// Maximum value returned by rand() + +#define RAND_MAX INT_MAX + + +// Maximum number of bytes in a multibyte character for the current locale + +#define MB_CUR_MAX 1 + + +// TYPE DEFINITIONS + +// as described in ANSI para 7.10 + +// return type of the div() function + +typedef struct { + int quot; // quotient + int rem; // remainder +} div_t; + + +// return type of the ldiv() function + +typedef struct { + long quot; // quotient + long rem; // remainder +} ldiv_t; + +// Unofficial type of comparison function used by both bsearch() and +// qsort() + +typedef int (*Cyg_comparison_fn_t)(const void * /* object1 */, + const void * /* object2 */); + +// Similarly, type of function used by atexit() +typedef void (*Cyg_atexit_fn_t)( void ); + + +// FUNCTION PROTOTYPES + +//======================================================================== + +// 7.10.1 String conversion functions + +externC double +atof( const char * /* double_str */ ); + +externC int +atoi( const char * /* int_str */ ); + +externC long +atol( const char * /* long_str */ ); + +externC double +strtod( const char * /* double_str */, char ** /* endptr */ ); + +externC long +strtol( const char * /* long_str */, char ** /* endptr */, + int /* base */ ); + +externC unsigned long +strtoul( const char * /* ulong_str */, char ** /* endptr */, + int /* base */ ); + +//======================================================================== + +// 7.10.2 Pseudo-random sequence generation functions + +externC int +rand( void ); + +externC void +srand( unsigned int /* seed */ ); + +// POSIX 1003.1 section 8.3.8 rand_r() +externC int +rand_r( unsigned int * /* seed */ ); + +//======================================================================== + +// 7.10.3 Memory management functions + +#ifdef CYGPKG_LIBC_MALLOC + +externC void * +calloc( size_t /* num_objects */, size_t /* object_size */ ); + +externC void +free( void * /* ptr */ ); + +externC void * +malloc( size_t /* size */ ); + +externC void * +realloc( void * /* ptr */, size_t /* size */ ); + +#endif // ifdef CYGPKG_LIBC_MALLOC + +//======================================================================== + +// 7.10.4 Communication with the environment + +externC void +abort( void ) CYGPRI_LIBC_NORETURN; + +externC int +atexit( Cyg_atexit_fn_t /* func_to_register */ ); + +externC void +exit( int /* status */ ) CYGPRI_LIBC_NORETURN; + +/* POSIX 1003.1 section 3.2.2 "Terminate a process" */ + +externC void +_exit( int /* status */ ) CYGPRI_LIBC_NORETURN; + +externC char * +getenv( const char * /* name */ ); + + +//======================================================================== + +// 7.10.5 Searching and sorting utilities + +externC void * +bsearch( const void * /* search_key */, const void * /* first_object */, + size_t /* num_objects */, size_t /* object_size */, + Cyg_comparison_fn_t /* comparison_fn */ ); + +externC void +qsort( void * /* first_object */, size_t /* num_objects */, + size_t /* object_size */, Cyg_comparison_fn_t /* comparison_fn */ ); + + +//======================================================================== + +// 7.10.6 Integer arithmetic functions + +externC int +abs( int /* val */ ); + +externC div_t +div( int /* numerator */, int /* denominator */ ); + +externC long +labs( long /* val */ ); + +externC ldiv_t +ldiv( long /* numerator */, long /* denominator */ ); + +//======================================================================== + +// INLINE FUNCTIONS + +#ifdef CYGIMP_LIBC_STDLIB_INLINES +#include +#endif + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_STDLIB_H multiple inclusion protection + +// EOF stdlib.h diff --git a/packages/language/c/libc/current/include/stdlib.inl b/packages/language/c/libc/current/include/stdlib.inl new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/stdlib.inl @@ -0,0 +1,206 @@ +#ifndef CYGONCE_LIBC_STDLIB_INL +#define CYGONCE_LIBC_STDLIB_INL +//=========================================================================== +// +// stdlib.inl +// +// Inline implementations for the ANSI standard utility functions +// defined in section 7.10 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include - do not include this file directly +// +//####DESCRIPTIONEND#### +// +//=========================================================================== +// +// The div() and ldiv() functions in this file are based on original +// code with the following copyright: +// +// Note that only div() and ldiv() have this copyright +// +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // NULL, wchar_t and size_t from compiler +#include // Just to be sure that the main header is there + +// FUNCTIONS + +//=========================================================================== + +// 7.10.1 String conversion functions + + +CYGPRI_LIBC_INLINE double +atof( const char *nptr ) +{ + return strtod( nptr, (char **)NULL ); +} // atof() + +CYGPRI_LIBC_INLINE int +atoi( const char *nptr ) +{ + return (int)strtol( nptr, (char **)NULL, 10 ); +} // atoi() + + +CYGPRI_LIBC_INLINE long +atol( const char *nptr ) +{ + return strtol( nptr, (char **)NULL, 10 ); +} // atol() + +//=========================================================================== + +// 7.10.6 Integer arithmetic functions + + +CYGPRI_LIBC_INLINE int +abs( int j ) +{ + return (j<0) ? -j : j; +} // abs() + + +CYGPRI_LIBC_INLINE div_t +div( int numer, int denom ) +{ + div_t result; + + // The ANSI standard says that |r.quot| <= |n/d|, where + // n/d is to be computed in infinite precision. In other + // words, we should always truncate the quotient towards + // 0, never -infinity. + // + // Machine division and remainer may work either way when + // one or both of n or d is negative. If only one is + // negative and r.quot has been truncated towards -inf, + // r.rem will have the same sign as denom and the opposite + // sign of num; if both are negative and r.quot has been + // truncated towards -inf, r.rem will be positive (will + // have the opposite sign of num). These are considered + // `wrong'. + // + // If both are num and denom are positive, r will always + // be positive. + // + // This all boils down to: + // if num >= 0, but r.rem < 0, we got the wrong answer. + // In that case, to get the right answer, add 1 to r.quot and + // subtract denom from r.rem. + + result.quot = numer / denom; + result.rem = numer % denom; + + if ( (numer >= 0) && (result.rem < 0) ) + { + result.quot++; + result.rem -= denom; + } // if + + return result; +} // div() + + +CYGPRI_LIBC_INLINE long +labs( long j ) +{ + return (j<0) ? -j : j; +} // labs() + + +CYGPRI_LIBC_INLINE ldiv_t +ldiv( long numer, long denom ) +{ + ldiv_t result; + + result.quot = numer / denom; + result.rem = numer % denom; + + if ( (numer >= 0) && (result.rem < 0) ) + { + result.quot++; + result.rem -= denom; + } // if + + return result; +} // ldiv() + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_STDLIB_INL multiple inclusion protection + +// EOF stdlib.inl diff --git a/packages/language/c/libc/current/include/string.h b/packages/language/c/libc/current/include/string.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/string.h @@ -0,0 +1,171 @@ +#ifndef CYGONCE_LIBC_STRING_H +#define CYGONCE_LIBC_STRING_H +//=========================================================================== +// +// string.h +// +// ANSI standard string and memory area manipulation routines +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Standard definitions including externC +#include // Get size_t and NULL definitions from + // compiler - for ANSI 7.11.1 +#include // for strerror() + +// FUNCTION PROTOTYPES + +//=========================================================================== + +// 7.11.2 Copying functions + +// memcpy is no longer actually implemented in the C library. +// It is now in the HAL + +externC void * +memcpy( void *, const void *, size_t ); + +externC void * +memmove( void *, const void *, size_t ); + +externC char * +strcpy( char *, const char * ); + +externC char * +strncpy( char *, const char *, size_t ); + +//=========================================================================== + +// 7.11.3 Concatenation functions + +externC char * +strcat( char *, const char * ); + +externC char * +strncat( char *, const char *, size_t ); + + +//=========================================================================== + +// 7.11.4 Comparison functions + +externC int +memcmp( const void *, const void *, size_t ); + +externC int +strcmp( const char *, const char * ); + +externC int +strcoll( const char *, const char * ); + +externC int +strncmp( const char *, const char *, size_t ); + +externC size_t +strxfrm( char *, const char *, size_t ); + + +//=========================================================================== + +// 7.11.5 Search functions + +externC void * +memchr( const void *, int, size_t ); + +externC char * +strchr( const char *, int ); + +externC size_t +strcspn( const char *, const char * ); + +externC char * +strpbrk( const char *, const char * ); + +externC char * +strrchr( const char *, int ); + +externC size_t +strspn( const char *, const char * ); + +externC char * +strstr( const char *, const char * ); + +externC char * +strtok( char *, const char * ); + +// POSIX 1003.1 section 8.3.3 strtok_r() + +externC char * +strtok_r( char *, const char *, char ** ); + + +//=========================================================================== + +// 7.11.6 Miscellaneous functions + +// memset is no longer actually implemented in the C library. +// It is now in the HAL + +externC void * +memset( void *, int, size_t ); + +// strerror() is provided in + +externC size_t +strlen( const char * ); + + +// INLINE FUNCTIONS + +#ifdef CYGIMP_LIBC_STRING_INLINES +#include +#endif + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_STRING_H multiple inclusion protection + +// EOF string.h diff --git a/packages/language/c/libc/current/include/string.inl b/packages/language/c/libc/current/include/string.inl new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/string.inl @@ -0,0 +1,70 @@ +#ifndef CYGONCE_LIBC_STRING_INL +#define CYGONCE_LIBC_STRING_INL +//=========================================================================== +// +// string.inl +// +// Inline functions for ANSI standard string and memory area +// manipulation routines described in ANSI para 7.11 +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include - do not include this file directly +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // header for this file just in case, although + // it should have already been included + + +CYGPRI_LIBC_INLINE int +strcoll( const char *s1, const char *s2 ) +{ + return strcmp(s1, s2); +} // strcoll() + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_STRING_INL multiple inclusion protection + +// EOF string.inl diff --git a/packages/language/c/libc/current/include/sys/cstartup.h b/packages/language/c/libc/current/include/sys/cstartup.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/sys/cstartup.h @@ -0,0 +1,66 @@ +#ifndef CYGONCE_LIBC_CSTARTUP_H +#define CYGONCE_LIBC_CSTARTUP_H +//=========================================================================== +// +// cstartup.h +// +// Starting C library support +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-08-27 +// Purpose: +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// FUNCTION PROTOTYPES + +externC void +cyg_iso_c_start( void ); + + +#endif // ifdef CYGPKG_LIBC + +#endif CYGONCE_LIBC_CSTARTUP_H multiple inclusion protection + +// EOF cstartup.h diff --git a/packages/language/c/libc/current/include/sys/file_if.h b/packages/language/c/libc/current/include/sys/file_if.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/sys/file_if.h @@ -0,0 +1,68 @@ +#ifndef CYGONCE_LIBC_FILE_IF_H +#define CYGONCE_LIBC_FILE_IF_H +//=========================================================================== +// +// file_if.h +// +// File interface definitions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// TYPE DEFINITIONS + +typedef CYG_ADDRESS FILE; // This address is cast to an address here. It is + // uncast internally to the C library in stream.hxx + // as the C++ Cyg_StdioStream class. Optional + // run-time checking can be enabled to ensure that + // the cast is valid + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_FILE_IF_H multiple inclusion protection + +// EOF file_if.h diff --git a/packages/language/c/libc/current/include/time.h b/packages/language/c/libc/current/include/time.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/include/time.h @@ -0,0 +1,96 @@ +#ifndef CYGONCE_LIBC_TIME_H +#define CYGONCE_LIBC_TIME_H +//=========================================================================== +// +// time.h +// +// ANSI standard time routines defined in section 7.12 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // ECC common type definitions and support +#include // NULL and size_t from compiler + +// CONSTANTS + +// What to divide clock_t by to get seconds (para 7.12.1) +#define CLOCKS_PER_SEC 1000 + +// TYPE DEFINITIONS + +// as per para 7.12.1 +typedef cyg_int64 clock_t; + +typedef cyg_count32 time_t; + +struct tm { + int tm_sec; // seconds after the minute - [0..61] + int tm_min; // minutes after the hour - [0..59] + int tm_hour; // hours since midnight - [0..23] + int tm_mday; // days of the month - [1..31] + int tm_mon; // months since January - [0..11] + int tm_year; // years since 1900 + int tm_wday; // days since Sunday - [0..6] + int tm_yday; // days since January 1 - [0..365] + int tm_isdst; // Daylight Saving Time flag - positive if DST is in + // effect, 0 if not in effect, and negative if the info + // is not available +}; + +// FUNCTION PROTOTYPES + +//=========================================================================== + +// 7.12.2 Time manipulation functions + +externC clock_t +clock( void ); + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_TIME_H multiple inclusion protection + +// EOF time.h diff --git a/packages/language/c/libc/current/src/PKGconf.mak b/packages/language/c/libc/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/PKGconf.mak @@ -0,0 +1,88 @@ +#========================================================================= +# +# makefile +# +# language/c/libc/src +# +#========================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#========================================================================= + +PACKAGE := libc +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := ctype/isalnum.cxx ctype/isalpha.cxx ctype/iscntrl.cxx \ + ctype/isdigit.cxx ctype/isgraph.cxx ctype/islower.cxx \ + ctype/isprint.cxx ctype/ispunct.cxx ctype/isspace.cxx \ + ctype/isupper.cxx ctype/isxdigit.cxx ctype/tolower.cxx \ + ctype/toupper.cxx \ + \ + errno/errno.cxx \ + \ + i18n/locale.cxx \ + \ + setjmp/longjmp.cxx \ + \ + stdio/common/fclose.cxx stdio/common/fflush.cxx \ + stdio/common/fopen.cxx stdio/common/freopen.cxx \ + stdio/common/setvbuf.cxx stdio/common/snprintf.cxx \ + stdio/common/sprintf.cxx stdio/common/sscanf.cxx \ + stdio/common/stdioinlines.cxx stdio/common/stdiosupp.cxx \ + stdio/common/stream.cxx stdio/common/streambuf.cxx \ + stdio/common/ungetc.cxx stdio/common/vsnprintf.cxx \ + stdio/common/vsscanf.cxx stdio/input/fgetc.cxx \ + stdio/input/fgets.cxx stdio/input/fread.cxx \ + stdio/input/fscanf.cxx stdio/input/gets.cxx \ + stdio/input/scanf.cxx stdio/input/vfscanf.cxx \ + stdio/output/fnprintf.cxx stdio/output/fprintf.cxx \ + stdio/output/fputc.cxx stdio/output/fputs.cxx \ + stdio/output/fwrite.cxx stdio/output/printf.cxx \ + stdio/output/vfnprintf.cxx \ + \ + stdlib/_exit.cxx stdlib/abort.cxx stdlib/abs.cxx \ + stdlib/atexit.cxx stdlib/atof.cxx stdlib/atoi.cxx \ + stdlib/atol.cxx stdlib/bsearch.cxx stdlib/div.cxx \ + stdlib/exit.cxx stdlib/getenv.cxx stdlib/labs.cxx \ + stdlib/ldiv.cxx stdlib/malloc.cxx stdlib/qsort.cxx \ + stdlib/rand.cxx stdlib/strtod.cxx stdlib/strtol.cxx \ + stdlib/strtoul.cxx \ + \ + string/memchr.cxx string/memcmp.cxx string/memmove.cxx \ + string/strcat.cxx string/strchr.cxx string/strcmp.cxx \ + string/strcoll.cxx string/strcpy.cxx string/strcspn.cxx \ + string/strlen.cxx string/strncat.cxx string/strncmp.cxx \ + string/strncpy.cxx string/strpbrk.cxx string/strrchr.cxx \ + string/strspn.cxx string/strstr.cxx string/strsuppt.cxx\ + string/strtok.cxx string/strxfrm.cxx \ + \ + support/clibdata.cxx support/cstartup.cxx \ + \ + time/clock.cxx + +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/language/c/libc/current/src/clibincl/clibdata.hxx b/packages/language/c/libc/current/src/clibincl/clibdata.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/clibdata.hxx @@ -0,0 +1,235 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_CLIBDATA_HXX +#define CYGONCE_LIBC_CLIBINCL_CLIBDATA_HXX +//======================================================================== +// +// clibdata.hxx +// +// C library internal data - held in one place to make thread support +// easier +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "clibincl/clibdata.hxx" +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +#include // Common project-wide type definitions +#include // For errno type + +#ifdef CYGSEM_LIBC_THREAD_SAFETY +# include // Kernel thread support +# include // and inline functions +#endif + +#ifdef CYGPKG_LIBC_STDIO +# include "clibincl/stdiosupp.hxx" // _fopen() declarations +# include "clibincl/stream.hxx" // Cyg_StdioStream internal class +#endif + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS +# include +#endif + + +// TYPE DEFINITIONS + +class Cyg_CLibInternalData +{ +#ifdef CYGPKG_LIBC_STDIO + // allow fopen only to access the files + friend FILE *_fopen( const char *filename, const char *mode ); + friend int _fclose( FILE *stream ); +#endif + +private: + +#ifdef CYGPKG_LIBC_STDIO + // the streams are separated for compatibility with newlib + + static // Make the following members static + Cyg_StdioStream *stdin, *stdout, *stderr; // default I/O streams + + + // List of open files + static // Make the following member static (and initialises to NULL) + Cyg_StdioStream *files[FOPEN_MAX - 3]; // subtract 3 for stdin, stdout, + // and stderr +# ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + // lock for the above + static + Cyg_Mutex files_lock; +# endif + +#endif // ifdef CYGPKG_LIBC_STDIO + + +# ifdef CYGSEM_LIBC_PER_THREAD_ERRNO + Cyg_ErrNo safe_errno; +# endif // ifdef CYGSEM_LIBC_PER_THREAD_ERRNO + + +#ifdef CYGFUN_LIBC_strtok +# ifndef CYGSEM_LIBC_PER_THREAD_STRTOK + static // Make the following member static +# endif + // last saved position of strtok() + char *strtok_last; +#endif // ifdef CYGFUN_LIBC_strtok + + +#ifdef CYGPKG_LIBC_RAND + + typedef cyg_ucount32 Cyg_rand_seed_t; + +# ifndef CYGSEM_LIBC_PER_THREAD_RAND + static // Make the following member static +# endif + // random seed to be used with rand() + Cyg_rand_seed_t rand_seed; +#endif // ifdef CYGPKG_LIBC_RAND + + +public: + + // Normal constructor + Cyg_CLibInternalData( void ); + + // same as above but allows the constructor to be invoked explicitly + // when needed, when it wouldn't otherwise be invoked + void + construct( void ); + +#ifdef CYGFUN_LIBC_strtok + char ** + get_strtok_last_p( void ); +#endif + +#ifdef CYGPKG_LIBC_RAND + Cyg_rand_seed_t * + get_rand_seed_p( void ); +#endif + +#ifdef CYGPKG_LIBC_STDIO + static Cyg_StdioStream * + get_file_stream( cyg_ucount32 fd ); + + static void + set_file_stream( cyg_ucount32 fd, Cyg_StdioStream *stream ); + +#endif // ifdef CYGPKG_LIBC_STDIO + + Cyg_ErrNo * + get_errno_p( void ); + +}; // class Cyg_CLibInternalData + + +// MACROS + +// CYGPRI_LIBC_INTERNAL_DATA_PREAMBLE is used at the start of a function in +// case any "magic" at the start is required for this implementation to get +// at the data. Or in some cases, it may just be helpful for speed. +// +// CYGPRI_LIBC_INTERNAL_DATA_ALLOC_CHECK_PREAMBLE is used at the "upper" +// entry points to the C library, to ensure that the internal data is +// allocated. It also does what CYGPRI_LIBC_INTERNAL_DATA_PREAMBLE does. +// +// CYGPRI_LIBC_INTERNAL_DATA is used to get at the C library internal data, +// available when the above two macros have been invoked. +// +// These macros pollute the namespace of the functions they are invoked in, +// but these should only be used internally by the C library, so that is +// fine. + +#ifdef CYGSEM_LIBC_THREAD_SAFETY + +#define CYGPRI_LIBC_INTERNAL_DATA_PREAMBLE \ + Cyg_CLibInternalData *cyg_tsd_xxx = \ + ( (Cyg_CLibInternalData *)(Cyg_Thread::self()-> \ + get_data(CYGNUM_KERNEL_THREADS_DATA_LIBC)) ) + + +#define CYGPRI_LIBC_INTERNAL_DATA_ALLOC_CHECK_PREAMBLE \ + Cyg_Thread *cyg_self_xxx = Cyg_Thread::self(); \ + Cyg_CLibInternalData *cyg_tsd_xxx; \ + if ( cyg_self_xxx->get_data(CYGNUM_KERNEL_THREADS_DATA_LIBC) == 0 ) \ + { \ + cyg_tsd_xxx = (Cyg_CLibInternalData *)cyg_self_xxx-> \ + increment_stack_limit(sizeof(Cyg_CLibInternalData));\ + cyg_self_xxx->set_data( CYGNUM_KERNEL_THREADS_DATA_LIBC, \ + (CYG_ADDRWORD) cyg_tsd_xxx ); \ + cyg_tsd_xxx->construct(); \ + } \ + else \ + cyg_tsd_xxx = ( (Cyg_CLibInternalData *)(Cyg_Thread::self()-> \ + get_data(CYGNUM_KERNEL_THREADS_DATA_LIBC)) ) + + +#define CYGPRI_LIBC_INTERNAL_DATA (*cyg_tsd_xxx) + +#define CYGPRI_LIBC_INTERNAL_DATA_CHECK \ + CYG_ASSERT( Cyg_Thread::self()-> \ + get_data(CYGNUM_KERNEL_THREADS_DATA_LIBC) != 0, \ + "C library internal data has not been initialised!" ) + +#else // ifdef CYGSEM_LIBC_THREAD_SAFETY + +extern Cyg_CLibInternalData cyg_my_clib_internal_data; + +#define CYGPRI_LIBC_INTERNAL_DATA_ALLOC_CHECK_PREAMBLE CYG_EMPTY_STATEMENT + +#define CYGPRI_LIBC_INTERNAL_DATA_PREAMBLE CYG_EMPTY_STATEMENT + +#define CYGPRI_LIBC_INTERNAL_DATA cyg_my_clib_internal_data + +#define CYGPRI_LIBC_INTERNAL_DATA_CHECK CYG_EMPTY_STATEMENT + +#endif // ifdef CYGSEM_LIBC_THREAD_SAFETY + + +// Inline functions for this class +#include "clibincl/clibdata.inl" + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_CLIBINCL_CLIBDATA_HXX multiple inclusion protection + +// EOF clibdata.hxx diff --git a/packages/language/c/libc/current/src/clibincl/clibdata.inl b/packages/language/c/libc/current/src/clibincl/clibdata.inl new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/clibdata.inl @@ -0,0 +1,174 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_CLIBDATA_INL +#define CYGONCE_LIBC_CLIBINCL_CLIBDATA_INL +//=========================================================================== +// +// clibdata.inl +// +// Inline functions for C library internal data +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: Do not include this file directly. +// Instead #include "clibincl/clibdata.hxx" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +#include // Common project-wide type definitions +#include // Assert interface +#include "clibincl/clibdata.hxx" // header for this file - just in case + +#ifdef CYGPKG_LIBC_STDIO +# include "clibincl/stream.hxx" // Cyg_StdioStream internal class +#endif + +#ifndef CYGSEM_LIBC_PER_THREAD_ERRNO +# include // for errno variable +#endif + + +// INLINE METHODS + +inline void +Cyg_CLibInternalData::construct( void ) +{ + +#ifdef CYGSEM_LIBC_PER_THREAD_ERRNO + // errno is initialised to 0 at program startup - ANSI 7.1.4 + safe_errno = 0; +#endif // ifdef CYGSEM_LIBC_PER_THREAD_ERRNO + + +#ifdef CYGPKG_LIBC_RAND + // Initialise seed for rand() + rand_seed = CYGNUM_LIBC_RAND_SEED; +#endif + +} // construct() + +inline +Cyg_CLibInternalData::Cyg_CLibInternalData( void ) +{ + construct(); +} // Cyg_CLibInternalData() constructor + + +#ifdef CYGFUN_LIBC_strtok +inline char ** +Cyg_CLibInternalData::get_strtok_last_p( void ) +{ + return &strtok_last; +} // get_strtok_last_p() +#endif + + + +#ifdef CYGPKG_LIBC_RAND +inline Cyg_CLibInternalData::Cyg_rand_seed_t * +Cyg_CLibInternalData::get_rand_seed_p( void ) +{ + return &rand_seed; +} // get_rand_seed_p() +#endif + + +#ifdef CYGPKG_LIBC_STDIO + +inline Cyg_StdioStream * +Cyg_CLibInternalData::get_file_stream( cyg_ucount32 fd ) +{ + CYG_PRECONDITION( (fd < FOPEN_MAX), + "Attempt to open larger file descriptor than FOPEN_MAX!" ); + + switch (fd) + { + case 0: + return stdin; + case 1: + return stdout; + case 2: + return stderr; + default: + return files[fd - 3]; // shift 3 for stdin/stdout/stderr + } // switch + +} // get_file_stream() + + +inline void +Cyg_CLibInternalData::set_file_stream( cyg_ucount32 fd, + Cyg_StdioStream *stream ) +{ + CYG_PRECONDITION( (fd < FOPEN_MAX), + "Attempt to set larger file descriptor than FOPEN_MAX!" ); + + switch (fd) + { + case 0: + stdin = stream; + break; + case 1: + stdout = stream; + break; + case 2: + stderr = stream; + break; + default: + files[fd - 3] = stream; // shift 3 for stdin/stdout/stderr + break; + } // switch +} // set_file_stream() + +#endif // ifdef CYGPKG_LIBC_STDIO + +inline Cyg_ErrNo * +Cyg_CLibInternalData::get_errno_p( void ) +{ +#ifdef CYGSEM_LIBC_PER_THREAD_ERRNO + return &safe_errno; +#else + return &errno; +#endif +} // get_errno_p() + +#endif // ifdef CYGPKG_LIBC + +#endif CYGONCE_LIBC_CLIBINCL_CLIBDATA_INL multiple inclusion protection + +// EOF clibdata.inl diff --git a/packages/language/c/libc/current/src/clibincl/ctypesupp.hxx b/packages/language/c/libc/current/src/clibincl/ctypesupp.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/ctypesupp.hxx @@ -0,0 +1,114 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_CTYPESUPP_HXX +#define CYGONCE_LIBC_CLIBINCL_CTYPESUPP_HXX +//======================================================================== +// +// ctypesupp.hxx +// +// Support for ANSI ctype functions +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "clibincl/ctypesupp.hxx" +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + + +// FUNCTION PROTOTYPES + +// These are function prototypes for the aliased functions that actually +// implement the ctype functions + +//======================================================================== + +// 7.3.1 Character testing functions + +externC int +_isalnum( int ); + +externC int +_isalpha( int ); + +externC int +_iscntrl( int ); + +externC int +_isdigit( int ); + +externC int +_isgraph( int ); + +externC int +_islower( int ); + +externC int +_isprint( int ); + +externC int +_ispunct( int ); + +externC int +_isspace( int ); + +externC int +_isupper( int ); + +externC int +_isxdigit( int ); + +//======================================================================== + +// 7.3.2 Character case mapping functions + +externC int +_tolower( int ); + +externC int +_toupper( int ); + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_CLIBINCL_CTYPESUPP_HXX multiple inclusion protection + +// EOF ctypesupp.hxx diff --git a/packages/language/c/libc/current/src/clibincl/i18nsupp.hxx b/packages/language/c/libc/current/src/clibincl/i18nsupp.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/i18nsupp.hxx @@ -0,0 +1,76 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_I18NSUPP_HXX +#define CYGONCE_LIBC_CLIBINCL_I18NSUPP_HXX +//======================================================================== +// +// i18nsupp.hxx +// +// Support for ISO C internationalisation (i18n) functions +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.com +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-08-31 +// Purpose: +// Description: +// Usage: #include "clibincl/i18nsupp.hxx" +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // struct lconv + + +// FUNCTION PROTOTYPES + +// These are function prototypes for the aliased functions that actually +// implement the i18n functions + +//======================================================================== + +externC char * +_setlocale( int /* category */, const char * /* locale */ ); + +externC struct lconv * +_localeconv( void ); + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_CLIBINCL_I18NSUPP_HXX multiple inclusion protection + +// EOF i18nsupp.hxx diff --git a/packages/language/c/libc/current/src/clibincl/setjmpsupp.hxx b/packages/language/c/libc/current/src/clibincl/setjmpsupp.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/setjmpsupp.hxx @@ -0,0 +1,69 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_SETJMPSUPP_HXX +#define CYGONCE_LIBC_CLIBINCL_SETJMPSUPP_HXX +//=========================================================================== +// +// setjmpsupp.hxx +// +// Support header file for ANSI standard non-local jumps +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Header file to support ANSI standard non-local jumps as +// per ANSI para 7.6 +// Usage: #include "clibincl/setjmpsupp.hxx" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Normal setjmp header for jmp_buf + +// FUNCTION PROTOTYPES + +// longjmp() function, as described in ANSI para 7.6.2.1 +externC void +_longjmp( jmp_buf, int ) CYGPRI_LIBC_NORETURN; + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_CLIBINCL_SETJMPSUPP_HXX multiple inclusion protection + +// EOF setjmpsupp.hxx diff --git a/packages/language/c/libc/current/src/clibincl/stdiosupp.hxx b/packages/language/c/libc/current/src/clibincl/stdiosupp.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/stdiosupp.hxx @@ -0,0 +1,218 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_STDIOSUPP_HXX +#define CYGONCE_LIBC_CLIBINCL_STDIOSUPP_HXX +//======================================================================== +// +// stdiosupp.hxx +// +// Support for C library standard I/O routines +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "clibincl/stdiosupp.hxx" +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // common type definitions and support +#include // NULL and size_t from compiler +#include // va_list from compiler +#include // Main standard I/O header +#include // Device table + + +// FUNCTION PROTOTYPES + +//======================================================================== + +// Miscellaneous support functions + +extern struct Cyg_Device_Table_t * +Cyg_libc_stdio_find_filename( const char *filename ); + + +//======================================================================== + +// ISO C 7.9.5 File access functions + +externC int +_fclose( FILE * /* stream */ ); + +externC int +_fflush( FILE * /* stream */ ); + +externC FILE * +_fopen( const char * /* filename */, const char * /* mode */ ); + +externC FILE * +_freopen( const char * /* filename */, const char * /* mode */, + FILE * /* stream */ ); + +externC void +_setbuf( FILE * /* stream */, char * /* buffer */ ); + +externC int +_setvbuf( FILE * /* stream */, char * /* buffer */, int /* mode */, + size_t /* size */ ); + +//======================================================================== + +// ISO C 7.9.6 Formatted input/output functions + +externC int +_fprintf( FILE * /* stream */, const char * /* format */, ... ); + +externC int +_fscanf( FILE * /* stream */, const char * /* format */, ... ); + +externC int +_printf( const char * /* format */, ... ); + +externC int +_scanf( const char * /* format */, ... ); + +externC int +_sprintf( char * /* str */, const char * /* format */, ... ); + +externC int +_sscanf( const char * /* str */, const char * /* format */, ... ); + +externC int +_vfprintf( FILE * /* stream */, const char * /* format */, + va_list /* args */ ); + +externC int +_vprintf( const char * /* format */, va_list /* args */ ); + +externC int +_vsprintf( char * /* str */, const char * /* format */, + va_list /* args */ ); + +//======================================================================== + +// ISO C 7.9.7 Character input/output functions + +externC int +_fgetc( FILE * /* stream */ ); + +externC char * +_fgets( char * /* str */, int /* length */, FILE * /* stream */ ); + +externC int +_fputc( int /* c */, FILE * /* stream */ ); + +externC int +_fputs( const char * /* str */, FILE * /* stream */ ); + +externC char * +_gets( char * ); + +externC int +_puts( const char * /* str */ ); + +externC int +_ungetc( int /* c */, FILE * /* stream */ ); + +//======================================================================== + +// ISO C 7.9.8 Direct input/output functions + +externC size_t +_fread( void * /* ptr */, size_t /* object_size */, + size_t /* num_objects */, FILE * /* stream */ ); + +externC size_t +_fwrite( const void * /* ptr */, size_t /* object_size */, + size_t /* num_objects */, FILE * /* stream */ ); + + +//======================================================================== + +// ISO C 7.9.10 Error-handling functions + +externC void +_clearerr( FILE * /* stream */ ); + +externC int +_feof( FILE * /* stream */ ); + +externC int +_ferror( FILE * /* stream */ ); + +externC void +_perror( const char * /* prefix_str */ ); + +//======================================================================== + +// Other non-ISO C functions + +externC int +_fnprintf( FILE * /* stream */, size_t /* length */, + const char * /* format */, ... ); + +externC int +_snprintf( char * /* str */, size_t /* length */, + const char * /* format */, ... ); + +externC int +_vfnprintf( FILE * /* stream */, size_t /* length */, + const char * /* format */, va_list /* args */ ); + +externC int +_vsnprintf( char * /* str */, size_t /* length */, + const char * /* format */, va_list /* args */ ); + +externC int +_vscanf( const char * /* format */, va_list /* args */ ); + +externC int +_vsscanf( const char * /* str */, const char * /* format */, + va_list /* args */ ); + +externC int +_vfscanf( FILE * /* stream */, const char * /* format */, + va_list /* args */ ); + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +#endif // CYGONCE_LIBC_CLIBINCL_STDIOSUPP_HXX multiple inclusion protection + +// EOF stdiosupp.hxx diff --git a/packages/language/c/libc/current/src/clibincl/stdlibsupp.hxx b/packages/language/c/libc/current/src/clibincl/stdlibsupp.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/stdlibsupp.hxx @@ -0,0 +1,189 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_STDLIBSUPP_HXX +#define CYGONCE_LIBC_CLIBINCL_STDLIBSUPP_HXX +//======================================================================== +// +// stdlibsupp.hxx +// +// Support for ANSI standard utility functions +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "clibincl/stdlibsupp.hxx" +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common project-wide type definitions +#include // Header for the standard utility functions + // including definition of + // Cyg_comparison_fn_t and Cyg_atexit_fn_t + +// FUNCTION PROTOTYPES + +// Allow the atexit handlers to be invoked +externC void +cyg_libc_invoke_atexit_handlers( void ); + +// These are function prototypes for the aliased functions that actually +// implement the stdlib functions + +//======================================================================== + +// 7.10.1 String conversion functions + +externC double +_atof( const char * /* double_str */ ); + +externC int +_atoi( const char * /* int_str */ ); + +externC long +_atol( const char * /* long_str */ ); + +externC double +_strtod( const char * /* double_str */, char ** /* endptr */ ); + +externC long +_strtol( const char * /* long_str */, char ** /* endptr */, + int /* base */ ); + +externC unsigned long +_strtoul( const char * /* ulong_str */, char ** /* endptr */, + int /* base */ ); + +//======================================================================== + +// 7.10.2 Pseudo-random sequence generation functions + +externC int +_rand( void ); + +externC void +_srand( unsigned int /* seed */ ); + +// POSIX 1003.1 section 8.3.8 rand_r() +externC int +_rand_r( unsigned int * /* seed */ ); + +//======================================================================== + +// 7.10.3 Memory management functions + +#ifdef CYGPKG_LIBC_MALLOC + +externC void * +_calloc( size_t /* num_objects */, size_t /* object_size */ ); + +externC void +_free( void * /* ptr */ ); + +externC void * +_malloc( size_t /* size */ ); + +externC void * +_realloc( void * /* ptr */, size_t /* size */ ); + +#endif // ifdef CYGPKG_LIBC_MALLOC + +//======================================================================== + +// 7.10.4 Communication with the environment + +externC void +_abort( void ) CYGPRI_LIBC_NORETURN; + +externC int +_atexit( Cyg_atexit_fn_t /* func_to_register */ ); + +// The "real" names for exit() and _exit() are different for obvious name +// clash issues + +externC void +__libc_exit( int /* status */ ) CYGPRI_LIBC_NORETURN; + +// POSIX 1003.1 section 3.2.2 "Terminate a process" + +externC void +__libc__exit( int /* status */ ) CYGPRI_LIBC_NORETURN; + +externC char * +_getenv( const char * /* name */ ); + +//======================================================================== + +// 7.10.5 Searching and sorting utilities + +externC void * +_bsearch( const void * /* search_key */, const void * /* first_object */, + size_t /* num_objects */, size_t /* object_size */, + Cyg_comparison_fn_t /* comparison_fn */ ); + +externC void +_qsort( void * /* first_object */, size_t /* num_objects */, + size_t /* object_size */, + Cyg_comparison_fn_t /* comparison_fn */ ); + + +//======================================================================== + +// 7.10.6 Integer arithmetic functions + +externC int +_abs( int /* val */ ); + +externC div_t +_div( int /* numerator */, int /* denominator */ ); + +externC long +_labs( long /* val */ ); + +externC ldiv_t +_ldiv( long /* numerator */, long /* denominator */ ); + +//======================================================================== + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_CLIBINCL_STDLIBSUPP_HXX multiple inclusion + // protection + +// EOF stdlibsupp.hxx diff --git a/packages/language/c/libc/current/src/clibincl/stream.hxx b/packages/language/c/libc/current/src/clibincl/stream.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/stream.hxx @@ -0,0 +1,302 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_STREAM_HXX +#define CYGONCE_LIBC_CLIBINCL_STREAM_HXX +//======================================================================== +// +// stream.hxx +// +// Internal C library stdio stream interface definitions +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "clibincl/stream.hxx" +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + + +// INCLUDES + +#include // Common project-wide type definitions +#include // Cyg_ErrNo +#include // fpos_t and IOBUF defines +#include "clibincl/streambuf.hxx" // Stdio stream file buffers +#include "clibincl/stdiosupp.hxx" // for _setvbuf() +#include // Device table for Cyg_Device_Table_t + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS +#include // Cyg_Mutex +#endif + +// TYPE DEFINITIONS + + +class Cyg_StdioStream +{ + friend int _setvbuf( FILE *, char *, int, size_t ); + +private: + + // error status for this file + Cyg_ErrNo error; + + + struct Cyg_Device_Table_t *my_device; + +#ifdef CYGFUN_LIBC_STDIO_ungetc + cyg_uint8 unread_char_buf; +#endif + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + Cyg_StdioStreamBuffer io_buf; // read/write buffer +#endif + cyg_uint8 readbuf_char; // a one character emergency "buffer" + // only used when configured to not buffer + // (i.e. !CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO) + // or set at runtime to not buffer (i.e. + // buffering mode is _IONBF) + + // some flags indicating the state of the file. Some of it is internal + // state, which should not be public. Use bitfields to save + // space, which means using "unsigned int" rather than cyg_uintX + struct { + unsigned int at_eof : 1; // Have we reached eof? + + unsigned int opened_for_read : 1; // opened_for_read and + + unsigned int opened_for_write : 1; // opened_for_write can + // be set simultaneously + + unsigned int binary : 1; // opened for binary or + // text mode? + +#ifdef CYGFUN_LIBC_STDIO_ungetc + unsigned int unread_char_buf_in_use : 1; // unget buf in use? +#endif + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + unsigned int buffering : 1; // Is this file buffered? + + unsigned int line_buffering : 1; // If so, is it line + // buffered? If it is + // buffered, but NOT line + // buffered, it must be + // fully buffered + + unsigned int last_buffer_op_was_read : 1; // did we last read from + // the buffer. If not we + // must have written +#endif + unsigned int readbuf_char_in_use : 1; // is the above + // readbuf_char in use? + + } flags; + + // current position for reading/writing + fpos_t position; + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + Cyg_Mutex stream_lock; // used for locking this stream +#endif // ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + +#ifdef CYGDBG_USE_ASSERTS + // a value to check that this class is hopefully valid + cyg_ucount32 magic_validity_word; +#endif + + // do not permit a copy constructor (yet) + Cyg_StdioStream( const Cyg_StdioStream & ); + +public: + // different modes when constructing (i.e. opening). + typedef enum { + CYG_STREAM_READ, + CYG_STREAM_WRITE, + CYG_STREAM_READWRITE + } OpenMode; + + // CONSTRUCTORS + + // This constructs the stream - effectively opens the file. This is + // used for static initialisation, and actually calls construct below + // + // dev is a valid Cyg_Device_Table_t, although it does not have to + // be a member of the device table object itself + // + // open_mode is one of CYG_STREAM_READ, CYG_STREAM_WRITE or + // CYG_STREAM_READWRITE + // + // append is true if the file position should be set at EOF on opening + // + // binary is true if this is a binary stream. Otherwise it is a text + // stream and character conversions (especially newline) may occur + // + // buffer_mode is one of _IONBF, _IOLBF, _IOFBF (from ) + // If buffer_mode is _IONBF, buffer_size should still be set to 0 + // and buffer_addr to NULL. If buffering is not configured, none + // of buffer_mode, buffer_size and buffer_addr have any effect + // + // buffer_size is the size of buffer to use + // + // buffer_addr is the address of a user supplied buffer. By default + // (when NULL) a system one is provided. + // + // The "return code" is set by assignment to the error member of this + // stream - use the get_error() method to check + + Cyg_StdioStream( Cyg_Device_Table_t *dev, OpenMode open_mode, + cyg_bool append, cyg_bool binary, int buffer_mode, + cyg_ucount32 buffer_size=BUFSIZE, + cyg_uint8 *buffer_addr=NULL ); + + // DESTRUCTOR + + ~Cyg_StdioStream(); + + + // MEMBER FUNCTIONS + + + // Refill read buffer from the stream - note this blocks until + // something arrives on the stream + Cyg_ErrNo + refill_read_buffer( void ); + + + // Read not more than buffer_length bytes from the read buffer into the + // user buffer. + // The number of bytes put into the user buffer is written + // into *bytes_read + Cyg_ErrNo + read( cyg_uint8 *user_buffer, cyg_ucount32 buffer_length, + cyg_ucount32 *bytes_read ); + + + // Read a single byte from the stream. Returns EAGAIN if no character + // available or EEOF if end of file (as well as setting the EOF state) + Cyg_ErrNo + read_byte( cyg_uint8 *c ); + + // Read a single byte from the stream, but don't remove it. Returns + // EAGAIN if no character available or EEOF if end of file (as well + // as setting the EOF state) + Cyg_ErrNo + peek_byte( cyg_uint8 *c ); + + + // Return a byte into the stream - basically the same as ungetc() + Cyg_ErrNo + unread_byte( cyg_uint8 c ); + + // the number of bytes available to read without needing to refill the + // buffer + cyg_ucount32 + bytes_available_to_read( void ); + + + Cyg_ErrNo + write( const cyg_uint8 *buffer, cyg_ucount32 buffer_length, + cyg_ucount32 *bytes_written ); + + Cyg_ErrNo + write_byte( cyg_uint8 c ); + + + Cyg_ErrNo + flush_output( void ); + + Cyg_ErrNo + flush_output_unlocked( void ); + + // prevent multiple access in thread safe mode + + // lock_me() returns false if it couldn't be locked, which could + // happen if the file descriptor is bad + + cyg_bool + lock_me( void ); + + // trylock_me() returns false if it couldn't be locked, probably + // because it is already locked + cyg_bool + trylock_me( void ); + + void + unlock_me( void ); + + // get error status for this file + Cyg_ErrNo + get_error( void ); + + // set error status for this file. + void + set_error( Cyg_ErrNo errno_to_set ); + +public: + // are we at EOF? true means we are, false means no + cyg_bool + get_eof_state( void ); + +private: + + // Set whether we are at EOF. + void + set_eof_state( cyg_bool eof_to_set ); + +public: + // retrieve position + Cyg_ErrNo + get_position( fpos_t *pos ); + + // set absolute position. whence is SEEK_SET, SEEK_CUR, or SEEK_END + Cyg_ErrNo + set_position( fpos_t pos, int whence ); + + CYGDBG_DEFINE_CHECK_THIS +}; + +// INLINE FUNCTIONS + +#include "clibincl/stream.inl" + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +#endif CYGONCE_LIBC_CLIBINCL_STREAM_HXX multiple inclusion protection + +// EOF stream.hxx diff --git a/packages/language/c/libc/current/src/clibincl/stream.inl b/packages/language/c/libc/current/src/clibincl/stream.inl new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/stream.inl @@ -0,0 +1,381 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_STREAM_INL +#define CYGONCE_LIBC_CLIBINCL_STREAM_INL +//======================================================================== +// +// stream.inl +// +// Inline functions for internal C library stdio stream interface +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: Do not include this file - +// #include "clibincl/stream.hxx" instead. +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // Error codes +#include "clibincl/stream.hxx" // Just be sure that this really is + // included + +// FUNCTIONS + +#ifdef CYGDBG_USE_ASSERTS +inline bool +Cyg_StdioStream::check_this( cyg_assert_class_zeal zeal ) +{ + // check that it has the magic word set meaning it is valid. + if ( magic_validity_word != 0x7b4321ce ) + return false; + return true; +} // check_this() + +#endif // ifdef CYGDBG_USE_ASSERTS + + + +// LOCKING FUNCTIONS + +// returns true on success +inline cyg_bool +Cyg_StdioStream::lock_me( void ) +{ + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + return stream_lock.lock(); +#else + // otherwise it "worked" + return true; +#endif + +} // lock_me() + + +// returns true on success +inline cyg_bool +Cyg_StdioStream::trylock_me( void ) +{ + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + return stream_lock.trylock(); +#else + // otherwise it "worked" + return true; +#endif + +} // lock_me() + + +inline void +Cyg_StdioStream::unlock_me( void ) +{ + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + stream_lock.unlock(); +#endif +} // unlock_me() + + +// DESTRUCTOR + +inline +Cyg_StdioStream::~Cyg_StdioStream() +{ + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + return; + + flush_output_unlocked(); + + if (my_device->close) { + (*my_device->close)( my_device->cookie ); // @@@ discard error? + } // if + + unlock_me(); + +#ifdef CYGDBG_USE_ASSERTS + magic_validity_word = 0xbadbad; +#endif +} // Cyg_StdioStream destructor + + +// MEMBER FUNCTIONS + + +// this is currently just a wrapper around write, but having this interface +// leaves scope for optimisations in future +inline Cyg_ErrNo +Cyg_StdioStream::write_byte( cyg_uint8 c ) +{ + cyg_ucount32 dummy_bytes_written; + Cyg_ErrNo err; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + err = write( &c, 1, &dummy_bytes_written ); + + CYG_ASSERT( (err!=ENOERR) || (dummy_bytes_written==1), + "Single byte not written, but no error returned!" ); + + return err; +} // write_byte() + + +inline Cyg_ErrNo +Cyg_StdioStream::unread_byte( cyg_uint8 c ) +{ + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + +#ifdef CYGFUN_LIBC_STDIO_ungetc + if (!lock_me()) + return EBADF; // assume file is now invalid + + if (flags.unread_char_buf_in_use) { + unlock_me(); + return ENOMEM; + } // if + + flags.unread_char_buf_in_use = true; + unread_char_buf = c; + + // can't be at EOF any more + flags.at_eof = false; + + if (position) // position is always 0 for certain devices + --position; + + unlock_me(); + + return ENOERR; + +#else // ifdef CYGFUN_LIBC_STDIO_ungetc + + return ENOSYS; +#endif // ifdef CYGFUN_LIBC_STDIO_ungetc +} // unread_byte() + + +inline cyg_ucount32 +Cyg_StdioStream::bytes_available_to_read( void ) +{ + cyg_ucount32 bytes=0; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + +#ifdef CYGFUN_LIBC_STDIO_ungetc + if (flags.unread_char_buf_in_use) + ++bytes; +#endif + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + + // either the last operation was a read, which attempted to read bytes + // into the buffer, or there are no bytes in the buffer + + if (flags.buffering) { + if (flags.last_buffer_op_was_read == true) + bytes += io_buf.get_buffer_space_used(); + } + else + +#endif + + if (flags.readbuf_char_in_use) + ++bytes; + + return bytes; +} // bytes_available_to_read() + + + +inline Cyg_ErrNo +Cyg_StdioStream::flush_output( void ) +{ + Cyg_ErrNo err; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + return EBADF; // assume file is now invalid + + err = flush_output_unlocked(); + + unlock_me(); + + return err; +} // flush_output() + + +// get error status for this file +inline Cyg_ErrNo +Cyg_StdioStream::get_error( void ) +{ + Cyg_ErrNo err_temp; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + return EBADF; // well, we've certainly got an error now! + + err_temp = error; + + unlock_me(); + + return err_temp; +} // get_error() + + +// set error status for this file +inline void +Cyg_StdioStream::set_error( Cyg_ErrNo errno_to_set ) +{ + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + { + errno = EBADF; // best we can do - we can't trust error to be there + return; + } // if + + errno = error = errno_to_set; +} // set_error() + + +// are we at EOF? true means we are, false means no +inline cyg_bool +Cyg_StdioStream::get_eof_state( void ) +{ + cyg_bool eof_temp; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + return false; // not much we can do here + + eof_temp = flags.at_eof; + + unlock_me(); + + return eof_temp; +} // get_eof_state() + + +// Set whether we are at EOF. +inline void +Cyg_StdioStream::set_eof_state( cyg_bool eof_to_set ) +{ + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + return; // not much we can do here + + flags.at_eof = eof_to_set; + + unlock_me(); +} // set_eof_state() + + +// retrieve position +inline Cyg_ErrNo +Cyg_StdioStream::get_position( fpos_t *pos ) +{ + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + return EBADF; // assume file is now invalid + + *pos = position; + + unlock_me(); + + return ENOERR; +} // get_position() + + +// set absolute position +inline Cyg_ErrNo +Cyg_StdioStream::set_position( fpos_t pos, int whence ) +{ + // this is currently a workaround until we have real files + // this will be corrected when we decide the true filesystem interface + + Cyg_ErrNo err; + cyg_uint8 c; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if ((whence != SEEK_CUR) || pos < 0) + return ENOSYS; + + if (!lock_me()) + return EBADF; // assume file is now invalid + + // Drain read buffer + + for ( ; whence > 0 ; whence-- ) { + err = read_byte( &c ); + if (err == EAGAIN) + err=refill_read_buffer(); + + // if read_byte retured error, or refill_read_buffer returned error + if (err) { + unlock_me(); + return err; + } // if + } // for + + unlock_me(); + + return ENOERR; +} // set_position() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +#endif CYGONCE_LIBC_CLIBINCL_STREAM_INL multiple inclusion protection + +// EOF stream.inl diff --git a/packages/language/c/libc/current/src/clibincl/streambuf.hxx b/packages/language/c/libc/current/src/clibincl/streambuf.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/streambuf.hxx @@ -0,0 +1,156 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_STREAMBUF_HXX +#define CYGONCE_LIBC_CLIBINCL_STREAMBUF_HXX +//=========================================================================== +// +// streambuf.hxx +// +// Internal C library stdio stream buffer interface definitions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: This file implements the buffer class used by Cyg_StdioStream +// for file buffers. It is simple, and not thread-safe - that +// is better done at a higher level for our purposes. +// Usage: #include "clibincl/streambuf.hxx" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? And buffered I/O? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && \ + defined(CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO) + + +// INCLUDES + +#include // Common project-wide type definitions +#include // Cyg_ErrNo + + +// TYPE DEFINITIONS + + +class Cyg_StdioStreamBuffer +{ +private: + // Buffering data + +#ifdef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF + cyg_uint8 *buffer_bottom; + cyg_bool call_free; // should we free the old buffer if set_buffer is + // called? +#else + cyg_uint8 buffer_bottom[BUFSIZE]; +#endif + + cyg_ucount32 buffer_size; + + cyg_uint8 *buffer_top; + + cyg_uint8 *current_buffer_position; + + // do not permit a copy constructor + Cyg_StdioStreamBuffer( const Cyg_StdioStreamBuffer & ); + +public: + + // CONSTRUCTORS + + // You can change the size, or even supply your own buffer, although + // this only has an effect with dynamic buffers. Otherwise it is + // silently ignored + Cyg_StdioStreamBuffer( cyg_ucount32 size=BUFSIZE, + cyg_uint8 *new_buffer=NULL ); + + + // DESTRUCTORS + + ~Cyg_StdioStreamBuffer(); + + // METHODS + + // Set up the buffer. As with the constructor, supplying a new_buffer + // only has an effect with dynamic buffers, although EINVAL is returned + // in that case. ENOMEM may also be returned + Cyg_ErrNo + set_buffer( cyg_ucount32 size=BUFSIZE, cyg_uint8 *new_buffer=NULL ); + + // Find out how much buffer space is in use + cyg_ucount32 + get_buffer_space_used( void ); + + + // What total size is the current buffer set to be. Can be -1 if the + // the buffer is invalid + cyg_count32 + get_buffer_size( void ); + + + // get buffer address to read from, and return the number of bytes + // available to read + cyg_ucount32 + get_buffer_addr_to_read( cyg_uint8 **buffer ); + + // when finished reading from said space, tell the buffer how much was + // actually read + void + set_bytes_read( cyg_ucount32 bytes ); + + // return address of buffer that can be used to write into, and its + // available capacity + cyg_ucount32 + get_buffer_addr_to_write( cyg_uint8 **buffer ); + + // when finished writing into said space, tell the buffer how much was + // actually written + void + set_bytes_written( cyg_ucount32 bytes ); + + // just empty the whole buffer contents + void + drain_buffer( void ); +}; // class Cyg_StdioStreamBuffer + +// INLINE FUNCTIONS + +#include "clibincl/streambuf.inl" + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && + // defined(CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO) + +#endif CYGONCE_LIBC_CLIBINCL_STREAMBUF_HXX multiple inclusion protection + +// EOF streambuf.hxx diff --git a/packages/language/c/libc/current/src/clibincl/streambuf.inl b/packages/language/c/libc/current/src/clibincl/streambuf.inl new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/streambuf.inl @@ -0,0 +1,171 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_STREAMBUF_INL +#define CYGONCE_LIBC_CLIBINCL_STREAMBUF_INL +//=========================================================================== +// +// streambuf.inl +// +// Internal C library stdio stream buffer inline functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: Do not include this file directly, instead +// #include "clibincl/streambuf.hxx" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? And buffered I/O? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && \ + defined(CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO) + + +// INCLUDES + +#include // Common project-wide type definitions +#include // Assertion support +#include // Cyg_ErrNo +#include // fpos_t and iobuf defines +#include "clibincl/stdlibsupp.hxx"// _malloc() and _free() +#include "clibincl/streambuf.hxx" // header for this file, just in case + +// FUNCTIONS + +inline +Cyg_StdioStreamBuffer::Cyg_StdioStreamBuffer( cyg_ucount32 size=BUFSIZE, + cyg_uint8 *new_buffer=NULL ) : +#ifdef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF + buffer_bottom( NULL ), + call_free(false), + buffer_size(0), +#else + buffer_size(sizeof(buffer_bottom)), // size of the array +#endif + buffer_top(NULL), + current_buffer_position(NULL) +{ + // NB Many of the above members in the initialisation list may seem + // unnecessary, but it is to ensure a defined state if e.g. the malloc + // in set_buffer() should fail + + (void)set_buffer(size, new_buffer); +} // Cyg_StdioStreamBuffer constructor + + +inline +Cyg_StdioStreamBuffer::~Cyg_StdioStreamBuffer() +{ +#ifdef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF + if ((buffer_bottom != NULL) && call_free) + _free( buffer_bottom ); +#endif +} // Cyg_StdioStreamBuffer destructor + + +inline cyg_ucount32 +Cyg_StdioStreamBuffer::get_buffer_space_used( void ) +{ + return (buffer_top - current_buffer_position); +} // get_buffer_space_used() + + +inline cyg_count32 +Cyg_StdioStreamBuffer::get_buffer_size( void ) +{ +#ifdef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF + if (buffer_bottom==NULL) + return -1; +#endif + return buffer_size; +} // get_buffer_size() + + +inline cyg_ucount32 +Cyg_StdioStreamBuffer::get_buffer_addr_to_read( cyg_uint8 **buffer ) +{ + *buffer = current_buffer_position; + + return (buffer_top - current_buffer_position); +} // get_buffer_addr_to_read() + +inline void +Cyg_StdioStreamBuffer::set_bytes_read( cyg_ucount32 bytes ) +{ + cyg_uint8 *buffer_max = &buffer_bottom[ get_buffer_size() ]; + + current_buffer_position += bytes; + + CYG_ASSERT( (current_buffer_position <= buffer_top), + "read too many bytes from buffer" ); + + if (current_buffer_position == buffer_max) + current_buffer_position = buffer_top = &buffer_bottom[0]; + +} // set_bytes_read() + + +inline cyg_ucount32 +Cyg_StdioStreamBuffer::get_buffer_addr_to_write( cyg_uint8 **buffer ) +{ + cyg_uint8 *buffer_max = &buffer_bottom[ get_buffer_size() ]; + + *buffer = buffer_top; + + return (buffer_max - buffer_top); +} // get_buffer_addr_to_write() + + +inline void +Cyg_StdioStreamBuffer::set_bytes_written( cyg_ucount32 bytes ) +{ + buffer_top += bytes; + + CYG_ASSERT( (buffer_top <= &buffer_bottom[ get_buffer_size() ]), + "wrote too many bytes into buffer" ); +} // set_bytes_written() + + +inline void +Cyg_StdioStreamBuffer::drain_buffer( void ) +{ + buffer_top = current_buffer_position = &buffer_bottom[0]; +} // drain_buffer() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && + // defined(CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO) + +#endif CYGONCE_LIBC_CLIBINCL_STREAMBUF_INL multiple inclusion protection + +// EOF streambuf.inl diff --git a/packages/language/c/libc/current/src/clibincl/stringsupp.hxx b/packages/language/c/libc/current/src/clibincl/stringsupp.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/stringsupp.hxx @@ -0,0 +1,230 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_STRINGSUPP_HXX +#define CYGONCE_LIBC_CLIBINCL_STRINGSUPP_HXX +//=========================================================================== +// +// stringsupp.hxx +// +// Support for the ANSI standard string functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Compiler definitions such as + // size_t, NULL etc. + +// CONSTANTS + +#ifndef CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST + +// Masks for CYG_LIBC_STR_DETECTNULL below +externC const cyg_uint64 Cyg_libc_str_null_mask_1; +externC const cyg_uint64 Cyg_libc_str_null_mask_2; + +#endif + +// MACROS + +// Nonzero if X is not aligned on a word boundary. +#define CYG_LIBC_STR_UNALIGNED(X) ((CYG_WORD)(X) & (sizeof (CYG_WORD) - 1)) + +// Nonzero if either X or Y is not aligned on a word boundary. +#define CYG_LIBC_STR_UNALIGNED2(X , Y) \ + (((CYG_WORD)(X) & (sizeof (CYG_WORD) - 1)) | \ + ((CYG_WORD)(Y) & (sizeof (CYG_WORD) - 1))) + +// Nonzero if any byte of X contains a NULL. +#define CYG_LIBC_STR_DETECTNULL(X) \ + (((X) - (CYG_WORD)Cyg_libc_str_null_mask_1) & \ + ~(X) & (CYG_WORD)Cyg_libc_str_null_mask_2) + +// How many bytes are copied each iteration of the 4X unrolled loop in the +// optimised string implementations +#define CYG_LIBC_STR_OPT_BIGBLOCKSIZE (sizeof(CYG_WORD) << 2) + +// How many bytes are copied each iteration of the word copy loop in the +// optimised string implementations +#define CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE (sizeof (CYG_WORD)) + +// Threshold for punting to the byte copier in the optimised string +// implementations +#define CYG_LIBC_STR_OPT_TOO_SMALL(LEN) \ + ((LEN) < CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE) + + +// FUNCTION PROTOTYPES + +// These are function prototypes for the aliased functions that actually +// implement the string functions + +//=========================================================================== + +// 7.11.2 Copying functions + + + +// memcpy is no longer implemented in the C library. It is now in the kernel +// However, the prototype is retained for consistency + +externC void * +_memcpy( void *, const void *, size_t ); + + +externC void * +_memmove( void *, const void *, size_t ); + + +externC char * +_strcpy( char *, const char * ); + + +externC char * +_strncpy( char *, const char *, size_t ); + + +//=========================================================================== + +// 7.11.3 Concatenation functions + + +externC char * +_strcat( char *, const char * ); + + +externC char * +_strncat( char *, const char *, size_t ); + + +//=========================================================================== + +// 7.11.4 Comparison functions + +externC int +_memcmp( const void *, const void *, size_t ); + + +externC int +_strcmp( const char *, const char * ); + + +externC int +_strcoll( const char *, const char * ); + + +externC int +_strncmp( const char *, const char *, size_t ); + + +externC size_t +_strxfrm( char *, const char *, size_t ); + + +//=========================================================================== + +// 7.11.5 Search functions + + +externC void * +_memchr( const void *, int , size_t ); + + +externC char * +_strchr( const char *, int ); + + +externC size_t +_strcspn( const char *, const char * ); + + +externC char * +_strpbrk( const char *, const char * ); + + +externC char * +_strrchr( const char *, int ); + + +externC size_t +_strspn( const char *, const char * ); + + +externC char * +_strstr( const char *, const char * ); + + +externC char * +_strtok( char *, const char * ); + +// For POSIX 1003.1 section 8.3.3 strtok_r() + +externC char * +_strtok_r( char *, const char *, char ** ); + + +//=========================================================================== + +// 7.11.6 Miscellaneous functions + +// memset is no longer implemented in the C library. It is now in the kernel +// However, the prototype is retained for consistency + +externC void * +_memset( void *, int, size_t ); + + +// _strerror is no longer in the C library, but in the error package. But +// the prototype is still here for symmetry as _strerror is still present +externC char * +_strerror( int ); + + +externC size_t +_strlen( const char * ); + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_CLIBINCL_STRINGSUPP_HXX multiple inclusion protection + +// EOF stringsupp.hxx diff --git a/packages/language/c/libc/current/src/clibincl/timesupp.hxx b/packages/language/c/libc/current/src/clibincl/timesupp.hxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/clibincl/timesupp.hxx @@ -0,0 +1,73 @@ +#ifndef CYGONCE_LIBC_CLIBINCL_TIMESUPP_HXX +#define CYGONCE_LIBC_CLIBINCL_TIMESUPP_HXX +//=========================================================================== +// +// timesupp.hxx +// +// Support for the ANSI standard time functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions + +// FUNCTION PROTOTYPES + +// These are function prototypes for the aliased functions that actually +// implement the time functions + +//=========================================================================== + +// 7.12.2 Time manipulation functions + +externC clock_t +_clock( void ); + + +#endif // ifdef CYGPKG_LIBC + +#endif // CYGONCE_LIBC_CLIBINCL_TIMESUPP_HXX multiple inclusion protection + +// EOF timesupp.hxx diff --git a/packages/language/c/libc/current/src/ctype/isalnum.cxx b/packages/language/c/libc/current/src/ctype/isalnum.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/isalnum.cxx @@ -0,0 +1,81 @@ +//=========================================================================== +// +// isalnum.cxx +// +// Real alternative for inline implementation of ANSI standard +// isalnum() ctype routine defined in section 7.3.1.1 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +isalnum( int c ) CYGPRI_LIBC_WEAK_ALIAS("_isalnum"); + + +// FUNCTIONS + +int +_isalnum( int c ) +{ + return ( _isalpha(c) || _isdigit(c) ); +} // _isalnum() + + +#endif // ifdef CYGPKG_LIBC + +// EOF isalnum.cxx diff --git a/packages/language/c/libc/current/src/ctype/isalpha.cxx b/packages/language/c/libc/current/src/ctype/isalpha.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/isalpha.cxx @@ -0,0 +1,81 @@ +//=========================================================================== +// +// isalpha.cxx +// +// Real alternative for inline implementation of ANSI standard +// isalpha() ctype routine defined in section 7.3.1.2 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +isalpha( int c ) CYGPRI_LIBC_WEAK_ALIAS("_isalpha"); + + +// FUNCTIONS + +int +_isalpha( int c ) +{ + return ( _islower(c) || _isupper(c) ); +} // _isalpha() + + +#endif // ifdef CYGPKG_LIBC + +// EOF isalpha.cxx diff --git a/packages/language/c/libc/current/src/ctype/iscntrl.cxx b/packages/language/c/libc/current/src/ctype/iscntrl.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/iscntrl.cxx @@ -0,0 +1,83 @@ +//=========================================================================== +// +// iscntrl.cxx +// +// Real alternative for inline implementation of ANSI standard +// iscntrl() ctype routine defined in section 7.3.1.3 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +iscntrl( int c ) CYGPRI_LIBC_WEAK_ALIAS("_iscntrl"); + + +// FUNCTIONS + +int +_iscntrl( int c ) +{ + // Simple standard 7-bit ASCII map is assumed + return ( ((0 <= c) && (c <= 0x1F)) || + (c == 0x7F) ); +} // _iscntrl() + + +#endif // ifdef CYGPKG_LIBC + +// EOF iscntrl.cxx diff --git a/packages/language/c/libc/current/src/ctype/isdigit.cxx b/packages/language/c/libc/current/src/ctype/isdigit.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/isdigit.cxx @@ -0,0 +1,81 @@ +//=========================================================================== +// +// isdigit.cxx +// +// Real alternative for inline implementation of ANSI standard +// isdigit() ctype routine defined in section 7.3.1.4 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +isdigit( int c ) CYGPRI_LIBC_WEAK_ALIAS("_isdigit"); + + +// FUNCTIONS + +int +_isdigit( int c ) +{ + return ( ('0' <= c) && (c <= '9') ); +} // _isdigit() + + +#endif // ifdef CYGPKG_LIBC + +// EOF isdigit.cxx diff --git a/packages/language/c/libc/current/src/ctype/isgraph.cxx b/packages/language/c/libc/current/src/ctype/isgraph.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/isgraph.cxx @@ -0,0 +1,82 @@ +//=========================================================================== +// +// isgraph.cxx +// +// Real alternative for inline implementation of ANSI standard +// isgraph() ctype routine defined in section 7.3.1.5 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +isgraph( int c ) CYGPRI_LIBC_WEAK_ALIAS("_isgraph"); + + +// FUNCTIONS + +int +_isgraph( int c ) +{ + // Simple standard 7-bit ASCII map is assumed + return ( ('!' <= c) && (c <= '~') ); +} // _isgraph() + + +#endif // ifdef CYGPKG_LIBC + +// EOF isgraph.cxx diff --git a/packages/language/c/libc/current/src/ctype/islower.cxx b/packages/language/c/libc/current/src/ctype/islower.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/islower.cxx @@ -0,0 +1,81 @@ +//=========================================================================== +// +// islower.cxx +// +// Real alternative for inline implementation of ANSI standard +// islower() ctype routine defined in section 7.3.1.6 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +islower( int c ) CYGPRI_LIBC_WEAK_ALIAS("_islower"); + + +// FUNCTIONS + +int +_islower( int c ) +{ + return (('a' <= c) && (c <= 'z')); +} // _islower() + + +#endif // ifdef CYGPKG_LIBC + +// EOF islower.cxx diff --git a/packages/language/c/libc/current/src/ctype/isprint.cxx b/packages/language/c/libc/current/src/ctype/isprint.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/isprint.cxx @@ -0,0 +1,82 @@ +//=========================================================================== +// +// isprint.cxx +// +// Real alternative for inline implementation of ANSI standard +// isprint() ctype routine defined in section 7.3.1.7 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +isprint( int c ) CYGPRI_LIBC_WEAK_ALIAS("_isprint"); + + +// FUNCTIONS + +int +_isprint( int c ) +{ + // Simple standard 7-bit ASCII map is assumed + return ( (' ' <= c) && (c <= '~') ); +} // _isprint() + + +#endif // ifdef CYGPKG_LIBC + +// EOF isprint.cxx diff --git a/packages/language/c/libc/current/src/ctype/ispunct.cxx b/packages/language/c/libc/current/src/ctype/ispunct.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/ispunct.cxx @@ -0,0 +1,86 @@ +//=========================================================================== +// +// ispunct.cxx +// +// Real alternative for inline implementation of ANSI standard +// ispunct() ctype routine defined in section 7.3.1.8 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +ispunct( int c ) CYGPRI_LIBC_WEAK_ALIAS("_ispunct"); + + +// FUNCTIONS + +int +_ispunct( int c ) +{ + // Simple standard 7-bit ASCII map is assumed + return ( (('!' <= c) && (c <= '/')) || // ASCII 0x21 - 0x2F + ((':' <= c) && (c <= '@')) || // ASCII 0x3A - 0x40 + (('[' <= c) && (c <= '`')) || // ASCII 0x5B - 0x60 + (('{' <= c) && (c <= '~')) ); // ASCII 0x7B - 0x7E + +} // _ispunct() + + +#endif // ifdef CYGPKG_LIBC + +// EOF ispunct.cxx diff --git a/packages/language/c/libc/current/src/ctype/isspace.cxx b/packages/language/c/libc/current/src/ctype/isspace.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/isspace.cxx @@ -0,0 +1,82 @@ +//=========================================================================== +// +// isspace.cxx +// +// Real alternative for inline implementation of ANSI standard +// isspace() ctype routine defined in section 7.3.1.9 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +isspace( int c ) CYGPRI_LIBC_WEAK_ALIAS("_isspace"); + + +// FUNCTIONS + +int +_isspace( int c ) +{ + return ( (c == ' ') || (c == '\f') || (c == '\n') || (c == '\r') || + (c == '\t') || (c == '\v') ); +} // _isspace() + + +#endif // ifdef CYGPKG_LIBC + +// EOF isspace.cxx diff --git a/packages/language/c/libc/current/src/ctype/isupper.cxx b/packages/language/c/libc/current/src/ctype/isupper.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/isupper.cxx @@ -0,0 +1,81 @@ +//=========================================================================== +// +// isupper.cxx +// +// Real alternative for inline implementation of ANSI standard +// ctype routine defined in section 7.3.1.10 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +isupper( int c ) CYGPRI_LIBC_WEAK_ALIAS("_isupper"); + + +// FUNCTIONS + +int +_isupper( int c ) +{ + return (('A' <= c) && (c <= 'Z')); +} // _isupper() + + +#endif // ifdef CYGPKG_LIBC + +// EOF isupper.cxx diff --git a/packages/language/c/libc/current/src/ctype/isxdigit.cxx b/packages/language/c/libc/current/src/ctype/isxdigit.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/isxdigit.cxx @@ -0,0 +1,83 @@ +//=========================================================================== +// +// isxdigit.cxx +// +// Real alternative for inline implementation of ANSI standard +// isxdigit() ctype routine defined in section 7.3.1.11 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +isxdigit( int c ) CYGPRI_LIBC_WEAK_ALIAS("_isxdigit"); + + +// FUNCTIONS + +int +_isxdigit( int c ) +{ + return ( _isdigit(c) || + (('a' <= c) && (c <= 'f')) || + (('A' <= c) && (c <= 'F')) ); +} // _isxdigit() + + +#endif // ifdef CYGPKG_LIBC + +// EOF isxdigit.cxx diff --git a/packages/language/c/libc/current/src/ctype/tolower.cxx b/packages/language/c/libc/current/src/ctype/tolower.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/tolower.cxx @@ -0,0 +1,81 @@ +//=========================================================================== +// +// tolower.cxx +// +// Real alternative for inline implementation of ANSI standard +// tolower() ctype routine defined in section 7.3.2.1 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +tolower( int c ) CYGPRI_LIBC_WEAK_ALIAS("_tolower"); + + +// FUNCTIONS + +int +_tolower( int c ) +{ + return _isupper(c) ? c - 'A' + 'a' : c; +} // _tolower() + + +#endif // ifdef CYGPKG_LIBC + +// EOF tolower.cxx diff --git a/packages/language/c/libc/current/src/ctype/toupper.cxx b/packages/language/c/libc/current/src/ctype/toupper.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/ctype/toupper.cxx @@ -0,0 +1,81 @@ +//=========================================================================== +// +// toupper.cxx +// +// Real alternative for inline implementation of ANSI standard +// toupper() ctype routine defined in section 7.3.2.2 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support + +// We don't want the inline versions of ctype functions defined here + +#ifdef CYGIMP_LIBC_CTYPE_INLINES +#undef CYGIMP_LIBC_CTYPE_INLINES +#endif + +#include // Main header for ctype functions +#include "clibincl/ctypesupp.hxx" // Support for ctype functions + +// EXPORTED SYMBOLS + +externC int +toupper( int c ) CYGPRI_LIBC_WEAK_ALIAS("_toupper"); + + +// FUNCTIONS + +int +_toupper( int c ) +{ + return _islower(c) ? c - 'a' + 'A' : c; +} // _toupper() + + +#endif // ifdef CYGPKG_LIBC + +// EOF toupper.cxx diff --git a/packages/language/c/libc/current/src/errno/errno.cxx b/packages/language/c/libc/current/src/errno/errno.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/errno/errno.cxx @@ -0,0 +1,106 @@ +//=========================================================================== +// +// errno.cxx +// +// ANSI error code +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common project-wide type definitions +#include // Common tracing functions +#include // Header for this file + +#ifdef CYGSEM_LIBC_PER_THREAD_ERRNO +# include "clibincl/clibdata.hxx" // C library internal data +#endif + +// GLOBAL VARIABLES + +#ifndef CYGSEM_LIBC_PER_THREAD_ERRNO + +// errno is initialised to 0 at program startup - ANSI 7.1.4 +Cyg_ErrNo errno = 0; + +#else // ifndef CYGSEM_LIBC_PER_THREAD_ERRNO + +# if defined(CYGDBG_USE_TRACING) && defined(CYGNUM_LIBC_ERRNO_TRACE_LEVEL) +static int errno_trace = CYGNUM_LIBC_ERRNO_TRACE_LEVEL; +# define TL1 (0 < errno_trace) +# else +# define TL1 (0) +# endif + +// FUNCTIONS + +Cyg_ErrNo * +cyg_get_errno_p( void ) +{ + Cyg_ErrNo *errno_p; + + CYG_REPORT_FUNCNAMETYPE( "cyg_get_errno_p", "&errno is %d"); + + // set up the thread data, allocating if necessary (even though the + // user _shouldn't_ read errno before its set, we can't stop them - and + // ANSI prescribes it has a sensible value (0) before its set too anyway. + + CYGPRI_LIBC_INTERNAL_DATA_ALLOC_CHECK_PREAMBLE; + + errno_p = CYGPRI_LIBC_INTERNAL_DATA.get_errno_p(); + + CYG_TRACE1( TL1, "errno is %d", *errno_p ); + + CYG_REPORT_RETVAL( errno_p ); + + // return the internal data's errno + return errno_p; +} // cyg_get_errno_p() + + +#endif // ifndef CYGSEM_LIBC_PER_THREAD_ERRNO + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF errno.cxx diff --git a/packages/language/c/libc/current/src/i18n/locale.cxx b/packages/language/c/libc/current/src/i18n/locale.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/i18n/locale.cxx @@ -0,0 +1,370 @@ +//======================================================================== +// +// locale.cxx +// +// Implementation of ISO C internationalisation (i18n) locales +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.com +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-08-31 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Common tracing support +#include // Common assertion support +#include // struct lconv +#include // several string functions +#include // CHAR_MAX +#include "clibincl/i18nsupp.hxx" // Support for i18n functions + +// SYMBOLS + +externC char * +setlocale( int, const char * ) CYGPRI_LIBC_WEAK_ALIAS("_setlocale"); + +externC struct lconv * +localeconv( void ) CYGPRI_LIBC_WEAK_ALIAS("_localeconv"); + +// TYPE DEFINITIONS + +// define a type to encapsulate the locale. In time this will get much +// richer and complete + +typedef struct { + + const char *name; + struct lconv numdata; + +} Cyg_libc_locale_t; + + +// CONSTANTS + +// define the "C" locale +static const Cyg_libc_locale_t +C_locale = { "C", + { ".", "", "", "", "", "", "", "", "", "", + CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, + CHAR_MAX, CHAR_MAX + } + }; + +// only one locale now, but leave room for expansion +static const Cyg_libc_locale_t *all_locales[] = { &C_locale }; + +// GLOBALS + +// the current locales. Our default is the C locale +static const Cyg_libc_locale_t *current_collate_locale = &C_locale; +static const Cyg_libc_locale_t *current_ctype_locale = &C_locale; +static const Cyg_libc_locale_t *current_monetary_locale = &C_locale; +static const Cyg_libc_locale_t *current_numeric_locale = &C_locale; +static const Cyg_libc_locale_t *current_time_locale = &C_locale; + +// FUNCTIONS + +static const Cyg_libc_locale_t * +find_locale_data( const char *locale_str, cyg_ucount32 checklen ) +{ + CYG_REPORT_FUNCNAMETYPE( "find_locale_data", "returning %08x" ); + CYG_REPORT_FUNCARG1( "locale_str=%s", locale_str ); + + const Cyg_libc_locale_t *temp_locale, *curr_locale=NULL; + cyg_ucount32 i; + + // is it "" i.e. use the default? + if (*locale_str=='\0') { + curr_locale = &C_locale; + CYG_REPORT_RETVAL( curr_locale ); + return curr_locale; + } // if + + for (i=0; iname, locale_str, checklen) ) + curr_locale = temp_locale; + } // for + + CYG_REPORT_RETVAL( curr_locale ); + return curr_locale; +} // find_locale_data() + + +externC char * +_setlocale( int category, const char *locale ) +{ + CYG_REPORT_FUNCNAMETYPE("_setlocale", "returning %08x"); + CYG_REPORT_FUNCARG2( "category=%d, locale=%s", category, locale ); + + if (locale != NULL) + CYG_CHECK_DATA_PTR( locale, "locale pointer is invalid!" ); + + const char *str; + + // special case if locale==NULL, return current locale name + if (locale==NULL) { + + CYG_TRACE0( true, "Getting current locale value" ); + + switch (category) { + + case LC_COLLATE: + str = current_collate_locale->name; + break; + case LC_CTYPE: + str = current_ctype_locale->name; + break; + case LC_MONETARY: + str = current_monetary_locale->name; + break; + case LC_NUMERIC: + str = current_numeric_locale->name; + break; + case LC_TIME: + str = current_time_locale->name; + break; + case LC_ALL: + + // create static string to give a constructed string back + // to the user. The size is the number of categories other + // than LC_ALL times the maximum name size, and add a constant + // for the delimiting octothorpes + static char my_str[ CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE*5+10 ]; + + strcpy( my_str, "#" ); + strcat( my_str, current_collate_locale->name ); + strcat( my_str, "#" ); + strcat( my_str, current_ctype_locale->name ); + strcat( my_str, "#" ); + strcat( my_str, current_monetary_locale->name ); + strcat( my_str, "#" ); + strcat( my_str, current_numeric_locale->name ); + strcat( my_str, "#" ); + strcat( my_str, current_time_locale->name ); + strcat( my_str, "#" ); + + str = &my_str[0]; + break; + default: + str=NULL; + CYG_FAIL("setlocale() passed bad category!" ); + break; + + } // switch + + CYG_REPORT_RETVAL( (char *)str); + return (char *)str; + } // if + + // we only get here if locale is non-NULL, i.e. we want to set it + + const Cyg_libc_locale_t *loc; + cyg_bool default_locale = (*locale=='\0'); + + CYG_TRACE0( true, "Setting current locale value" ); + + switch( category ) { + case LC_COLLATE: + loc = find_locale_data( locale, CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE ); + if (loc != NULL) // found it + current_collate_locale=loc; + break; + + case LC_CTYPE: + loc = find_locale_data( locale, CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE ); + if (loc != NULL) // found it + current_ctype_locale=loc; + break; + + case LC_MONETARY: + loc = find_locale_data( locale, CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE ); + if (loc != NULL) // found it + current_monetary_locale=loc; + break; + + case LC_NUMERIC: + loc = find_locale_data( locale, CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE ); + if (loc != NULL) // found it + current_numeric_locale=loc; + break; + + case LC_TIME: + loc = find_locale_data( locale, CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE ); + if (loc != NULL) // found it + current_time_locale=loc; + break; + + case LC_ALL: + // first try and match it exactly + loc = find_locale_data( locale, CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE ); + if (loc != NULL) { // found it + + CYG_TRACE0(true, "Matched locale string exactly"); + current_collate_locale = current_ctype_locale = loc; + current_monetary_locale = current_numeric_locale = loc; + current_time_locale = loc; + } // if + else { + CYG_TRACE0( true, "Attempting to parse string previously " + "returned from setlocale()" ); + // now try and see if it is a compound string returned + // earlier by setlocale( LC_ALL, NULL ); + + // Note we don't do much checking here. This could be + // much more rigorous (but at the expense of speed/size?) + + const Cyg_libc_locale_t *temp_collate_locale, + *temp_ctype_locale, *temp_monetary_locale, + *temp_numeric_locale, *temp_time_locale; + + cyg_ucount32 token_len; + + str = &locale[0]; + if ( *str=='#' ) { + ++str; + token_len = strcspn( str, "#" ); + loc = find_locale_data( str, token_len ); + if (loc!=NULL) { + temp_collate_locale=loc; + str += token_len+1; + token_len = strcspn( str, "#" ); + loc = find_locale_data( str, token_len ); + } // if + if (loc!=NULL) { + temp_ctype_locale=loc; + str += token_len+1; + token_len = strcspn( str, "#" ); + loc = find_locale_data( str, token_len ); + } // if + if (loc!=NULL) { + temp_monetary_locale=loc; + str += token_len+1; + token_len = strcspn( str, "#" ); + loc = find_locale_data( str, token_len ); + } // if + if (loc!=NULL) { + temp_numeric_locale=loc; + str += token_len+1; + token_len = strcspn( str, "#" ); + loc = find_locale_data( str, token_len ); + } // if + if (loc!=NULL) { + temp_time_locale=loc; + str += token_len+1; + token_len = strcspn( str, "#" ); + loc = find_locale_data( str, token_len ); + } // if + if (loc!=NULL) { + // if we've got this far and loc still isn't NULL, + // then everything's fine, and we've matched everything + + current_collate_locale = temp_collate_locale; + current_ctype_locale = temp_ctype_locale; + current_monetary_locale = temp_monetary_locale; + current_numeric_locale = temp_numeric_locale; + current_time_locale = temp_time_locale; + + } // if + } // if + + } // else + break; // case LC_ALL + + default: + CYG_FAIL("setlocale() passed bad category!" ); + loc=NULL; + break; + } // switch + + if (loc==NULL) { + CYG_REPORT_RETVAL( NULL ); + return NULL; + } // if + else if (default_locale==true) { + CYG_REPORT_RETVAL(C_locale.name); + return (char *)C_locale.name; + } // else if + else { + CYG_REPORT_RETVAL(locale); + return (char *)locale; + } // else +} + +externC struct lconv * +_localeconv( void ) +{ + CYG_REPORT_FUNCNAMETYPE( "_localeconv", "returning %08x" ); + CYG_REPORT_FUNCARGVOID(); + + static struct lconv static_lconv; + + static_lconv.decimal_point = + current_numeric_locale->numdata.decimal_point; + + static_lconv.thousands_sep = + current_numeric_locale->numdata.thousands_sep; + + static_lconv.grouping = + current_numeric_locale->numdata.grouping; + + // we cheat a bit, but it should be worth it - a lot of these are + // constants which optimise nicely + cyg_ucount32 size_used; + size_used = (char *)&static_lconv.int_curr_symbol - + (char *)&static_lconv; + + memcpy( &(static_lconv.int_curr_symbol), + &(current_monetary_locale->numdata.int_curr_symbol), + sizeof(struct lconv) - size_used ); + + + CYG_REPORT_RETVAL( &static_lconv ); + return &static_lconv; +} + + +#endif // ifdef CYGPKG_LIBC + +// EOF locale.cxx diff --git a/packages/language/c/libc/current/src/setjmp/longjmp.cxx b/packages/language/c/libc/current/src/setjmp/longjmp.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/setjmp/longjmp.cxx @@ -0,0 +1,105 @@ +//=========================================================================== +// +// longjmp.cxx +// +// ANSI standard longjmp() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Implements ANSI standard non-local jump function longjmp() +// per ANSI para 7.6.2.1. This is the "real" alternative to +// the inline version of longjmp() +// +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Common tracing code +#include // Common assertion code +#include // HAL architecture specific implementation + +// We don't want the inline version of longjmp() defined here +#ifdef CYGIMP_LIBC_SETJMP_INLINES +# undef CYGIMP_LIBC_SETJMP_INLINES +#endif + +#include // Header for setjmp/longjmp +#include "clibincl/setjmpsupp.hxx" // Support for setjmp/longjmp functions + + +// EXPORTED SYMBOLS + +externC void +longjmp( jmp_buf cyg_buf, int cyg_val) CYGPRI_LIBC_WEAK_ALIAS("_longjmp") + CYGPRI_LIBC_NORETURN; + + +// INLINE FUNCTIONS + +void +_longjmp( jmp_buf cyg_buf, int cyg_val) +{ + CYG_REPORT_FUNCNAME( "longjmp" ); + CYG_REPORT_FUNCARG2( "&cyg_buf=%08x, cyg_val=%d", &cyg_buf, cyg_val ); + + // ANSI says that if we are passed cyg_val==0, then we change it to 1 + if (cyg_val == 0) + ++cyg_val; + + // we let the HAL do the work + + HAL_REORDER_BARRIER(); // prevent any chance of optimisation re-ordering + hal_longjmp( cyg_buf, cyg_val ); + HAL_REORDER_BARRIER(); // prevent any chance of optimisation re-ordering + +#ifdef CYGDBG_USE_ASSERTS + CYG_ASSERT( 0, "longjmp should not have reached this point!" ); +#else + for (;;) + CYG_EMPTY_STATEMENT; +#endif +} // _longjmp() + + +#endif // ifdef CYGPKG_LIBC + +// EOF longjmp.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/fclose.cxx b/packages/language/c/libc/current/src/stdio/common/fclose.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/fclose.cxx @@ -0,0 +1,118 @@ +//=========================================================================== +// +// fclose.cxx +// +// Implementation of C library file close function as per ANSI 7.9.5.1 +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + + +// Include the C library? And do we want the stdio stuff? And we can't have +// fclose() without fopen() +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && \ + defined(CYGPKG_LIBC_STDIO_OPEN) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // Error codes +#include // header for fclose() +#include "clibincl/stdlibsupp.hxx" // _free() +#include "clibincl/clibdata.hxx" // C library private data +#include "clibincl/stream.hxx" // C libray streams +#include "clibincl/stdiosupp.hxx" // support for stdio + + +// EXPORTED SYMBOLS + +externC int +fclose( FILE * ) CYGPRI_LIBC_WEAK_ALIAS("_fclose"); + + +// FUNCTIONS + + +externC int +_fclose( FILE *stream ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + int i; + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + Cyg_CLibInternalData::files_lock.lock(); +#endif // CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + + // find the stream in the table + for (i=0; i < FOPEN_MAX; i++) + { + if (real_stream == Cyg_CLibInternalData::get_file_stream(i)) + break; + } // for + + if (i == FOPEN_MAX) // didn't find it + { + errno = EBADF; + + return EOF; + } // if + + // Explicitly call destructor - this flushes the output too + real_stream->~Cyg_StdioStream(); + + // and free it + _free(real_stream); + + // and mark the stream available for use + Cyg_CLibInternalData::set_file_stream(i, NULL); + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + Cyg_CLibInternalData::files_lock.unlock(); +#endif // CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + + return 0; + +} // _fclose() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && + // defined(CYGPKG_LIBC_STDIO_OPEN) + +// EOF fclose.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/fflush.cxx b/packages/language/c/libc/current/src/stdio/common/fflush.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/fflush.cxx @@ -0,0 +1,129 @@ +//======================================================================== +// +// fflush.cxx +// +// Implementation of C library file flush function as per ANSI 7.9.5.2 +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // Error codes +#include // header for fflush() +#include "clibincl/stream.hxx" // C library streams +#include "clibincl/clibdata.hxx" // C library private data +#include "clibincl/stdiosupp.hxx" // support for stdio + + +// EXPORTED SYMBOLS + +externC int +fflush( FILE * ) CYGPRI_LIBC_WEAK_ALIAS("_fflush"); + + +// FUNCTIONS + + +externC int +_fflush( FILE *stream ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + int i; + Cyg_ErrNo err=ENOERR; + + if (stream == NULL) { // tells us to flush ALL streams + cyg_bool files_flushed[FOPEN_MAX] = { false }; // sets all to 0 + cyg_bool loop_again; + + do { + loop_again = false; + + for (i=0; (itrylock_me() ) { + err = real_stream->flush_output_unlocked(); + real_stream->unlock_me(); + files_flushed[i] = true; + } // if + else + loop_again = true; + } // else + } // if + } // for + } // do + while(loop_again && !err); + + } // if + else { + err = real_stream->flush_output(); + } // else + + if (err) { + errno = err; + return EOF; + } // if + + return 0; + +} // _fflush() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fflush.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/fopen.cxx b/packages/language/c/libc/current/src/stdio/common/fopen.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/fopen.cxx @@ -0,0 +1,210 @@ +//=========================================================================== +// +// fopen.cxx +// +// Implementation of C library file open function as per ANSI 7.9.5.3 +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + + +// Include the C library? And do we want the stdio stuff? And fopen()? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && \ + defined(CYGPKG_LIBC_STDIO_OPEN) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // Error codes +#include // Cyg_IORB +#include // Device table +#include // header for fopen() +#include "clibincl/stdlibsupp.hxx" // _malloc() +#include "clibincl/stringsupp.hxx" // _strncmp() and _strcmp() +#include "clibincl/clibdata.hxx" // C library private data +#include "clibincl/stream.hxx" // C library streams +#include "clibincl/stdiosupp.hxx" // support for stdio + + +// EXPORTED SYMBOLS + +externC FILE * +fopen( const char *, const char * ) CYGPRI_LIBC_WEAK_ALIAS("_fopen"); + + +// FUNCTIONS + +// process the mode string. Return true on error +static cyg_bool +process_mode( const char *mode, Cyg_StdioStream::OpenMode *rw, + cyg_bool *binary, cyg_bool *append ) +{ + *binary = *append = false; // default + + switch (mode[0]) { + case 'r': + *rw = Cyg_StdioStream::CYG_STREAM_READ; + break; + + case 'w': + case 'a': + *rw = Cyg_StdioStream::CYG_STREAM_WRITE; + *append = true; + break; + + default: + return true; + } // switch + + // ANSI says additional characters may follow the sequences, that we + // don't necessarily recognise so we just ignore them, and pretend that + // its the end of the string + + switch (mode[1]) { + case 'b': + *binary = true; + break; + case '+': + *rw = Cyg_StdioStream::CYG_STREAM_READWRITE; + break; + default: + return false; + } // switch + + switch (mode[2]) { + case 'b': + *binary = true; + break; + case '+': + *rw = Cyg_StdioStream::CYG_STREAM_READWRITE; + break; + default: + return false; + } // switch + + return false; +} // process_mode() + + +externC FILE * +_fopen( const char *filename, const char *mode ) +{ + struct Cyg_Device_Table_t *dev; + Cyg_StdioStream *curr_stream; + int i; + Cyg_ErrNo err; + Cyg_StdioStream::OpenMode open_mode; + cyg_bool binary, append; + + CYGPRI_LIBC_INTERNAL_DATA_ALLOC_CHECK_PREAMBLE; + + dev = Cyg_libc_stdio_find_filename( filename ); + + // if not found + if (!dev) { + *CYGPRI_LIBC_INTERNAL_DATA.get_errno_p() = ENOENT; + return NULL; + } // if + + // process_mode returns true on error + if (process_mode( mode, &open_mode, &binary, &append )) { + *CYGPRI_LIBC_INTERNAL_DATA.get_errno_p() = EINVAL; + return NULL; + } // if + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + CYGPRI_LIBC_INTERNAL_DATA.files_lock.lock(); +#endif // CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + + // find an empty slot + for (i=0; i < FOPEN_MAX; i++) { + curr_stream = CYGPRI_LIBC_INTERNAL_DATA.get_file_stream(i); + if (curr_stream == NULL) + break; + } // for + + if (i == FOPEN_MAX) { // didn't find an empty slot + *CYGPRI_LIBC_INTERNAL_DATA.get_errno_p() = EMFILE; + + return NULL; + } // if + + // allocate it some memory and construct it. Currently we only have + // potentially interactive devices, so as per ANSI 7.9.3 it must not + // be buffered + curr_stream = new Cyg_StdioStream( dev, open_mode, append, binary, + _IONBF ); + + if (curr_stream == NULL) { + *CYGPRI_LIBC_INTERNAL_DATA.get_errno_p() = ENOMEM; + return NULL; + } // if + + + // it puts any error in its own error flag + if (( err=curr_stream->get_error() )) { + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + CYGPRI_LIBC_INTERNAL_DATA.files_lock.unlock(); +#endif // CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + + _free( curr_stream ); + + *CYGPRI_LIBC_INTERNAL_DATA.get_errno_p() = err; + + return NULL; + + } // if + + CYGPRI_LIBC_INTERNAL_DATA.set_file_stream(i, curr_stream); + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + CYGPRI_LIBC_INTERNAL_DATA.files_lock.unlock(); +#endif // CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + + return (FILE *)(curr_stream); + +} // _fopen() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && + // defined(CYGPKG_LIBC_STDIO_OPEN) + +// EOF fopen.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/freopen.cxx b/packages/language/c/libc/current/src/stdio/common/freopen.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/freopen.cxx @@ -0,0 +1,85 @@ +//======================================================================== +// +// freopen.cxx +// +// Implementation of C library freopen() function +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Implementation of C library freopen() function as per +// ISO C standard chap. 7.9.5.4 +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + + +// Include the C library? And do we want the stdio stuff? And we only want +// freopen if we have fopen() +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && \ + defined(CYGPKG_LIBC_STDIO_OPEN) + + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // Error codes +#include // header for freopen() +#include "clibincl/stream.hxx" // C libray streams +#include "clibincl/clibdata.hxx" // C library private data +#include "clibincl/stdiosupp.hxx" // support for stdio + + +// EXPORTED SYMBOLS + +externC FILE * +freopen( const char *, const char *, FILE * ) + CYGPRI_LIBC_WEAK_ALIAS("_freopen"); + + +// FUNCTIONS + + +externC FILE * +_freopen( const char *, const char *, FILE * ) +{ + return NULL; // Returning NULL is valid! +} // _freopen() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && + // defined(CYGPKG_LIBC_STDIO_OPEN) + +// EOF freopen.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/setvbuf.cxx b/packages/language/c/libc/current/src/stdio/common/setvbuf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/setvbuf.cxx @@ -0,0 +1,131 @@ +//=========================================================================== +// +// setvbuf.cxx +// +// Implementation of C library buffering setup as per ANSI 7.9.5.6 +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // Error codes +#include // header for setvbuf() +#include "clibincl/stream.hxx" // C libray streams +#include "clibincl/stdiosupp.hxx" // support for stdio + + +// EXPORTED SYMBOLS + +externC int +setvbuf( FILE *, char *, int, size_t ) CYGPRI_LIBC_WEAK_ALIAS("_setvbuf"); + + +// FUNCTIONS + + +externC int +_setvbuf( FILE *stream, char *buf, int mode, size_t size ) +{ +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + Cyg_ErrNo err; + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + if ( !real_stream->lock_me() ) { + errno = EBADF; + return EBADF; + } // if +#endif + + err = real_stream->io_buf.set_buffer( (cyg_ucount32) size, + (cyg_uint8 *) buf ); + if (!err) { + switch (mode) { + case _IONBF: + CYG_ASSERT( (size == 0) && (buf == NULL), + "No buffering wanted but size/address specified!" ); + real_stream->flags.buffering = false; + real_stream->flags.line_buffering = false; + break; + case _IOLBF: + real_stream->flags.buffering = true; + real_stream->flags.line_buffering = true; + break; + case _IOFBF: + real_stream->flags.buffering = true; + real_stream->flags.line_buffering = false; + break; + default: + err = EINVAL; + break; + } // switch + } // if + +#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS + real_stream->unlock_me(); +#endif + + if (err) { + errno = err; + return err; + } // if + + return 0; + +#else // ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + + errno = ENOSUPP; + return ENOSUPP; + +#endif // ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + +} // _setvbuf() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF setvbuf.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/snprintf.cxx b/packages/language/c/libc/current/src/stdio/common/snprintf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/snprintf.cxx @@ -0,0 +1,85 @@ +//=========================================================================== +// +// snprintf.cxx +// +// ANSI Stdio snprintf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include "clibincl/stdiosupp.hxx" // Support functions for stdio + +// EXPORTED SYMBOLS + +externC int +snprintf( char *, size_t, const char *, ... ) + CYGPRI_LIBC_WEAK_ALIAS("_snprintf"); + + +// FUNCTIONS + +externC int +_snprintf( char *s, size_t size, const char *format, ... ) +{ + int rc; // return code + va_list ap; // for variable args + + va_start(ap, format); // init specifying last non-var arg + + rc = _vsnprintf(s, size, format, ap); + + va_end(ap); // end var args + + return rc; +} // _snprintf() + + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF snprintf.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/sprintf.cxx b/packages/language/c/libc/current/src/stdio/common/sprintf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/sprintf.cxx @@ -0,0 +1,84 @@ +//=========================================================================== +// +// sprintf.cxx +// +// ANSI Stdio sprintf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // INT_MAX +#include "clibincl/stdiosupp.hxx" // Support functions for stdio + +// EXPORTED SYMBOLS + +externC int +sprintf( char *, const char *, ... ) CYGPRI_LIBC_WEAK_ALIAS("_sprintf"); + + +// FUNCTIONS + +externC int +_sprintf( char *s, const char *format, ... ) +{ + int rc; // return code + va_list ap; // for variable args + + va_start(ap, format); // init specifying last non-var arg + + rc = _vsnprintf(s, INT_MAX, format, ap); + + va_end(ap); // end var args + + return rc; +} // _sprintf() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF sprintf.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/sscanf.cxx b/packages/language/c/libc/current/src/stdio/common/sscanf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/sscanf.cxx @@ -0,0 +1,83 @@ +//=========================================================================== +// +// sscanf.cxx +// +// ANSI Stdio sscanf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include "clibincl/stdiosupp.hxx" // Support functions for stdio + +// EXPORTED SYMBOLS + +externC int +sscanf( const char *, const char *, ... ) CYGPRI_LIBC_WEAK_ALIAS("_sscanf"); + + +// FUNCTIONS + +externC int +_sscanf( const char *s, const char *format, ... ) +{ + int rc; // return code + va_list ap; // for variable args + + va_start(ap, format); // init specifying last non-var arg + + rc = _vsscanf(s, format, ap); + + va_end(ap); // end var args + + return rc; +} // _sscanf() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF sscanf.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/stdioinlines.cxx b/packages/language/c/libc/current/src/stdio/common/stdioinlines.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/stdioinlines.cxx @@ -0,0 +1,181 @@ +//=========================================================================== +// +// stdioinlines.cxx +// +// ANSI standard I/O routines - real alternatives for inlined functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +// We don't want the inline versions of stdio functions defined here + +#ifdef CYGIMP_LIBC_STDIO_INLINES +#undef CYGIMP_LIBC_STDIO_INLINES +#endif + +#include // Common type definitions and support +#include // NULL and size_t from compiler +#include // va_list +#include // Header for this file +#include // Definition of error codes and errno +#include // Definition of strerror() for perror() +#include // INT_MAX +#include "clibincl/stdiosupp.hxx" // Support for stdio + + +// EXPORTED SYMBOLS + +externC void +setbuf( FILE *, char * ) CYGPRI_LIBC_WEAK_ALIAS("_setbuf"); + +externC int +vfprintf( FILE *, const char *, va_list ) CYGPRI_LIBC_WEAK_ALIAS("_vfprintf"); + +externC int +vprintf( const char *, va_list ) CYGPRI_LIBC_WEAK_ALIAS("_vprintf"); + +externC int +vsprintf( char *, const char *, va_list ) CYGPRI_LIBC_WEAK_ALIAS("_vsprintf"); + +externC int +puts( const char *s ) CYGPRI_LIBC_WEAK_ALIAS("_puts"); + +externC void +perror( const char * ) CYGPRI_LIBC_WEAK_ALIAS("_perror"); + +#ifdef CYGFUN_LIBC_STDIO_ungetc +externC int +vscanf( const char *, va_list ) CYGPRI_LIBC_WEAK_ALIAS("_vscanf"); +#endif + +// FUNCTIONS + +//=========================================================================== + +// 7.9.5 File access functions + +externC void +_setbuf( FILE *stream, char *buf ) +{ + if (buf == NULL) + _setvbuf( stream, NULL, _IOFBF, BUFSIZE ); + else + _setvbuf( stream, buf, _IONBF, BUFSIZE ); + +} // _setbuf() + +//=========================================================================== + +// 7.9.6 Formatted input/output functions + + +externC int +_vfprintf( FILE *stream, const char *format, va_list arg ) +{ + return _vfnprintf(stream, INT_MAX, format, arg); +} // _vfprintf() + + +externC int +_vprintf( const char *format, va_list arg) +{ + return _vfnprintf( stdout, INT_MAX, format, arg ); +} // _vprintf() + + +externC int +_vsprintf( char *s, const char *format, va_list arg ) +{ + return _vsnprintf(s, INT_MAX, format, arg); +} // _vsprintf() + + +//=========================================================================== + +// 7.9.7 Character input/output functions + +externC int +_puts( const char *s ) +{ + int rc; + + rc = _fputs( s, stdout ); + + if (rc >= 0) + rc = _fputc('\n', stdout ); + + return rc; +} // _puts() + + +//=========================================================================== + +// 7.9.10 Error-handling functions + +externC void +_perror( const char *s ) +{ + if (s && *s) + _fprintf( stderr, "%s: %s\n", s, strerror(errno) ); + else + _fputs( strerror(errno), stderr ); + +} // _perror() + +//=========================================================================== + +// Other non-ANSI functions + +#ifdef CYGFUN_LIBC_STDIO_ungetc +externC int +_vscanf( const char *format, va_list arg ) +{ + return _vfscanf( stdin, format, arg ); +} // _vscanf() +#endif + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF stdioinlines.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/stdiosupp.cxx b/packages/language/c/libc/current/src/stdio/common/stdiosupp.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/stdiosupp.cxx @@ -0,0 +1,88 @@ +//=========================================================================== +// +// stdiosupp.cxx +// +// Helper C library functions for standard I/O +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // Device table +#include "clibincl/stringsupp.hxx" // _strncmp() and _strcmp() +#include "clibincl/stdiosupp.hxx" // Header for this file + + +struct Cyg_Device_Table_t * +Cyg_libc_stdio_find_filename( const char *filename ) +{ + int i; + struct Cyg_Device_Table_t *dev=NULL; + + // Find the "file" in the device table + if ( _strncmp( filename, "/dev/", 5) ) + { + return NULL; + } // if + + // match the bit after the "/dev/" + for (i=0; (Cyg_Device_Table[i].name != NULL); i++ ) + { + if ( !_strcmp( &filename[5], Cyg_Device_Table[i].name) ) + { + dev=&Cyg_Device_Table[i]; + break; + } + } // for + + return dev; // dev will still be NULL if the filename wasn't found +} // Cyg_libc_stdio_find_filename() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF stdiosupp.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/stream.cxx b/packages/language/c/libc/current/src/stdio/common/stream.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/stream.cxx @@ -0,0 +1,623 @@ +//======================================================================== +// +// stream.cxx +// +// Implementations of internal C library stdio stream functions +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // Error codes +#include "clibincl/stringsupp.hxx" // _memcpy() +#include "clibincl/stream.hxx" // Header for this file +#include // Cyg_IORB +#include // Device table + + +// FUNCTIONS + +Cyg_StdioStream::Cyg_StdioStream(Cyg_Device_Table_t *dev, + OpenMode open_mode, + cyg_bool append, cyg_bool binary, + int buffer_mode, cyg_ucount32 buffer_size, + cyg_uint8 *buffer_addr ) +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + : io_buf( buffer_size, buffer_addr ) +#endif + +{ +#ifdef CYGDBG_USE_ASSERTS + magic_validity_word = 0xbadbad; +#endif + + my_device = dev; + + // Clear all flags + _memset( &flags, 0, sizeof(flags) ); + + switch (open_mode) { + case CYG_STREAM_READ: + flags.opened_for_read = true; + break; + case CYG_STREAM_WRITE: + flags.opened_for_write = true; + break; + case CYG_STREAM_READWRITE: + flags.opened_for_read = true; + flags.opened_for_write = true; + break; + default: + error=EINVAL; + return; + } // switch + + + if (flags.opened_for_write) { + if (!my_device->write_blocking) { + error = EDEVNOSUPP; + return; + } // if + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + flags.last_buffer_op_was_read = false; +#endif + } // if + + + if (flags.opened_for_read) { + if (!my_device->read_blocking) { + error = EDEVNOSUPP; + return; + } // if + + // NB also if opened for read AND write, then say last op was read +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + flags.last_buffer_op_was_read = true; +#endif + } // if + + flags.binary = binary ? 1 : 0; + + error = ENOERR; + + // in due course we would do an equivalent to fseek(...,0, SEEK_END); + // when appending. for now, there's nothing, except set eof + + flags.at_eof = append ? 1 : 0; + + position = 0; + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + + switch (buffer_mode) { + case _IONBF: + CYG_ASSERT( (buffer_size == 0) && (buffer_addr == NULL), + "No buffering wanted but size/address specified!" ); + flags.buffering = flags.line_buffering = false; + break; + case _IOLBF: + flags.buffering = true; + flags.line_buffering = true; + break; + case _IOFBF: + flags.buffering = true; + flags.line_buffering = false; + break; + default: + error = EINVAL; + return; + } // switch + + // one way of checking the buffer was set up correctly + if (io_buf.get_buffer_size()==-1) { + error = ENOMEM; + return; + } + +#endif + + if (my_device->open) { + error = (*my_device->open)( my_device->cookie, + binary ? CYG_DEVICE_OPEN_MODE_RAW + : CYG_DEVICE_OPEN_MODE_TEXT ); + if (error != ENOERR) + return; // keep error code the same + } // if + + +#ifdef CYGDBG_USE_ASSERTS + magic_validity_word = 0x7b4321ce; +#endif + +} // Cyg_StdioStream constructor + + + +Cyg_ErrNo +Cyg_StdioStream::refill_read_buffer( void ) +{ + Cyg_ErrNo read_err; + Cyg_IORB iorb; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + return EBADF; // assume file is now invalid + + // first just check that we _can_ read this device! + if (!flags.opened_for_read) { + unlock_me(); + return EINVAL; + } + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + // If there is pending output to write, then this will check and + // write it + if (flags.buffering) { + read_err = flush_output_unlocked(); + + if (read_err != ENOERR) { + unlock_me(); + return read_err; + } // if + } // if +#endif + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + // we're now reading + flags.last_buffer_op_was_read = true; + + if (flags.buffering) { + iorb.buffer_length = + io_buf.get_buffer_addr_to_write( (cyg_uint8**)&iorb.buffer ); + } + else +#endif + + if (!flags.readbuf_char_in_use) { + iorb.buffer_length = 1; + iorb.buffer = &readbuf_char; + } + else + iorb.buffer_length = 0; + + if (!iorb.buffer_length) { // no buffer space available + unlock_me(); + return ENOERR; // isn't an error, just needs user to read out data + } // if + + read_err = (*my_device->read_blocking)( my_device->cookie, &iorb ); + + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + if (flags.buffering) + io_buf.set_bytes_written( iorb.xferred_length ); + else +#endif + flags.readbuf_char_in_use = iorb.xferred_length ? 1 : 0; + + unlock_me(); + + if (read_err == ENOERR) { + if (iorb.xferred_length == 0) + read_err = EAGAIN; + } // if + + return read_err; +} // refill_read_buffer() + + +Cyg_ErrNo +Cyg_StdioStream::read( cyg_uint8 *user_buffer, cyg_ucount32 buffer_length, + cyg_ucount32 *bytes_read ) +{ + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + *bytes_read = 0; + + if (!lock_me()) + return EBADF; // assume file is now invalid + + if (!flags.opened_for_read) { + unlock_me(); + return EINVAL; + } + +#ifdef CYGFUN_LIBC_STDIO_ungetc + if (flags.unread_char_buf_in_use && buffer_length) { + *user_buffer++ = unread_char_buf; + ++*bytes_read; + flags.unread_char_buf_in_use = false; + --buffer_length; + } // if + +#endif // ifdef CYGFUN_LIBC_STDIO_ungetc + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + if (flags.buffering) { + cyg_uint8 *buff_to_read_from; + cyg_ucount32 bytes_available; + Cyg_ErrNo err; + + // this should really only be called after refill_read_buffer, but + // just in case + err = flush_output_unlocked(); + + if (err != ENOERR) { + unlock_me(); + return err; + } + + // we're now reading + flags.last_buffer_op_was_read = true; + + bytes_available = io_buf.get_buffer_addr_to_read( + (cyg_uint8 **)&buff_to_read_from ); + + *bytes_read += (bytes_available < buffer_length) ? bytes_available + : buffer_length; + if (*bytes_read) { + memcpy( user_buffer, buff_to_read_from, *bytes_read ); + io_buf.set_bytes_read( *bytes_read ); + } // if + + } // if + else + +#endif + + if (flags.readbuf_char_in_use && buffer_length) { + *user_buffer = readbuf_char; + *bytes_read = 1; + flags.readbuf_char_in_use = false; + } + + unlock_me(); + + return ENOERR; +} // read() + + +Cyg_ErrNo +Cyg_StdioStream::read_byte( cyg_uint8 *c ) +{ + Cyg_ErrNo err=ENOERR; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + return EBADF; // assume file is now invalid + + if (!flags.opened_for_read) { + unlock_me(); + return EINVAL; + } + + // this should really only be called after refill_read_buffer, but just + // in case +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + if (flags.buffering) + err = flush_output_unlocked(); + + if (err != ENOERR) + return err; + + // we're now reading + flags.last_buffer_op_was_read = true; +#endif + +# ifdef CYGFUN_LIBC_STDIO_ungetc + if (flags.unread_char_buf_in_use) { + *c = unread_char_buf; + flags.unread_char_buf_in_use = false; + unlock_me(); + return ENOERR; + } // if +# endif // ifdef CYGFUN_LIBC_STDIO_ungetc + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + if (flags.buffering) { + cyg_uint8 *buff_to_read_from; + cyg_ucount32 bytes_available; + + bytes_available=io_buf.get_buffer_addr_to_read(&buff_to_read_from); + + if (bytes_available) { + *c = *buff_to_read_from; + io_buf.set_bytes_read(1); + } + else + err = EAGAIN; + } // if + else + +#endif + + + if (flags.readbuf_char_in_use) { + *c = readbuf_char; + flags.readbuf_char_in_use = false; + } + else + err = EAGAIN; + + unlock_me(); + + return err; +} // read_byte() + + +Cyg_ErrNo +Cyg_StdioStream::peek_byte( cyg_uint8 *c ) +{ + Cyg_ErrNo err=ENOERR; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if (!lock_me()) + return EBADF; // assume file is now invalid + + if (!flags.opened_for_read) { + unlock_me(); + return EINVAL; + } + + // this should really only be called after refill_read_buffer, but just + // in case +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + if (flags.buffering) + err = flush_output_unlocked(); + + if (err != ENOERR) + return err; + + // we're now reading + flags.last_buffer_op_was_read = true; +#endif + +# ifdef CYGFUN_LIBC_STDIO_ungetc + if (flags.unread_char_buf_in_use) { + *c = unread_char_buf; + unlock_me(); + return ENOERR; + } // if +# endif // ifdef CYGFUN_LIBC_STDIO_ungetc + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + if (flags.buffering) { + cyg_uint8 *buff_to_read_from; + cyg_ucount32 bytes_available; + + bytes_available=io_buf.get_buffer_addr_to_read(&buff_to_read_from); + + if (bytes_available) { + *c = *buff_to_read_from; + } + else + err = EAGAIN; + } // if + else + +#endif + + + if (flags.readbuf_char_in_use) { + *c = readbuf_char; + } + else + err = EAGAIN; + + unlock_me(); + + return err; +} // peek_byte() + + +Cyg_ErrNo +Cyg_StdioStream::flush_output_unlocked( void ) +{ +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + Cyg_IORB iorb; + Cyg_ErrNo write_err=ENOERR; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + if ( flags.last_buffer_op_was_read ) + return ENOERR; + + // first just check that we _can_ write to the device! + if ( !flags.opened_for_write ) + return EINVAL; + + // shortcut if nothing to do + if (io_buf.get_buffer_space_used() == 0) + return ENOERR; + + iorb.buffer_length = + io_buf.get_buffer_addr_to_read( (cyg_uint8 **)&iorb.buffer ); + + CYG_ASSERT( iorb.buffer_length > 0, + "There should be data to read but there isn't!"); + + write_err = (*my_device->write_blocking)( my_device->cookie, &iorb ); + + // we've just read it all, so just wipe it out + io_buf.drain_buffer(); + + return write_err; + +#else // ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + return ENOERR; + +#endif // ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO +} // flush_output_unlocked() + + + +Cyg_ErrNo +Cyg_StdioStream::write( const cyg_uint8 *buffer, + cyg_ucount32 buffer_length, + cyg_ucount32 *bytes_written ) +{ + Cyg_ErrNo write_err = ENOERR; + + CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" ); + + *bytes_written = 0; + + if (!lock_me()) + return EBADF; // assume file is now invalid + + // first just check that we _can_ write to the device! + if ( !flags.opened_for_write ) { + unlock_me(); + return EINVAL; + } + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + if (flags.last_buffer_op_was_read == true) + io_buf.drain_buffer(); // nuke input bytes to prevent confusion + + flags.last_buffer_op_was_read = false; + + if (!flags.buffering) { +#endif + Cyg_IORB iorb; + iorb.buffer = (char *)buffer; + iorb.buffer_length = buffer_length; + + write_err = (*my_device->write_blocking)( my_device->cookie, + &iorb ); + + *bytes_written = iorb.xferred_length; + +#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO + } // if + else { + cyg_ucount32 bytes_available; + cyg_ucount32 bytes_to_write; + cyg_ucount32 newline_pos; + cyg_uint8 *write_addr; + cyg_bool must_flush = false; + + while ( buffer_length > 0 ) { + bytes_available = + io_buf.get_buffer_addr_to_write( &write_addr ); + + // we need to flush if we've no room or the buffer has an up + // and coming newline + if ( !bytes_available || must_flush ) { + write_err = flush_output_unlocked(); + + // harmless even if there was an error + bytes_available = + io_buf.get_buffer_addr_to_write( &write_addr ); + + CYG_ASSERT( bytes_available > 0, + "Help! still no bytes available in " + "write buffer" ); + } // if + + if (write_err) { + unlock_me(); + return write_err; + } // if + + // choose the lower of the buffer available and the length + // to write + bytes_to_write=(bytes_available < buffer_length) + ? bytes_available + : buffer_length; + + // if we're line buffered, we may want want to flush if there's + // a newline character, so lets find out + + if (flags.line_buffering) { + for (newline_pos=0; + newline_pos // Configuration header + +// Include the C library? And do we want the stdio stuff? And buffered I/O? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && \ + defined(CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO) + + +// INCLUDES + +#include // Common project-wide type definitions +#include // Assertion support +#include // Cyg_ErrNo +#include "clibincl/stdlibsupp.hxx"// _malloc() and _free() +#include "clibincl/streambuf.hxx" // header for this file, just in case + +// FUNCTIONS + +Cyg_ErrNo +Cyg_StdioStreamBuffer::set_buffer( cyg_ucount32 size=BUFSIZE, + cyg_uint8 *new_buffer=NULL ) +{ + +#ifdef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF + + // user-supplied buffer? + if (new_buffer != NULL) { + CYG_CHECK_DATA_PTR(new_buffer, "new_buffer not valid"); + // first check if we were responsible for the old buffer + if (call_free) { + _free(buffer_bottom); + call_free = false; + } + buffer_bottom = new_buffer; + } + else if ( size != get_buffer_size() ) { // as long as its different from + // what we've got now + cyg_uint8 *malloced_buf; + + malloced_buf = (cyg_uint8 * )_malloc( size ); + if (malloced_buf == NULL) + return ENOMEM; + + // should the old buffer be freed? This waits till after we know + // whether the malloc succeeded + if (call_free) + _free( buffer_bottom ); + + buffer_bottom = malloced_buf; + + call_free=true; + + } // else if + + +#else // ifdef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF + + // In this config we can't use a different buffer, or set a + // size greater than now. We can pretend to shrink it though + + // Note on the next line we compare it with the size of buffer_bottom + // and not the current size, as that's what is the limiting factor + if ( (new_buffer != NULL) || (size > sizeof(buffer_bottom)) ) + return EINVAL; + +#endif // ifdef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF + + buffer_top = current_buffer_position = &buffer_bottom[0]; + buffer_size = size; + + return ENOERR; + +} // set_buffer() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && + // defined(CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO) + + +// EOF streambuf.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/ungetc.cxx b/packages/language/c/libc/current/src/stdio/common/ungetc.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/ungetc.cxx @@ -0,0 +1,94 @@ +//=========================================================================== +// +// ungetc.cxx +// +// ANSI Stdio ungetc() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream +#include "clibincl/stringsupp.hxx" // _strlen() + +// EXPORTED SYMBOLS + +externC int +ungetc( int, FILE * ) CYGPRI_LIBC_WEAK_ALIAS("_ungetc"); + +// FUNCTIONS + +externC int +_ungetc( int c, FILE *stream ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + Cyg_ErrNo err; + cyg_uint8 real_c; + + if (c == EOF) + return EOF; + + real_c = (cyg_uint8) c; + + err = real_stream->unread_byte( real_c ); + + if (err) + { + errno = err; + return EOF; + } // if + + + return (int)real_c; + +} // _ungetc() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF ungetc.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/vsnprintf.cxx b/packages/language/c/libc/current/src/stdio/common/vsnprintf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/vsnprintf.cxx @@ -0,0 +1,128 @@ +//=========================================================================== +// +// vsnprintf.cxx +// +// ANSI Stdio vsnprintf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include // Device table stuff +#include // IORBs +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream + + +// EXPORTED SYMBOLS + +externC int +vsnprintf( char *, size_t, const char *, va_list ) + CYGPRI_LIBC_WEAK_ALIAS("_vsnprintf"); + +// FUNCTIONS + + +static Cyg_ErrNo +str_write( CYG_ADDRWORD cookie, Cyg_IORB *iorb ) +{ + cyg_uint8 **str_p = (cyg_uint8 **) cookie; + cyg_ucount32 i=0; + + // I suspect most strings passed to vsnprintf will be relatively short, + // so we just take the simple approach rather than have the overhead + // of calling memcpy etc. + + // simply copy string until we run out of user space + + for (i=0; i < iorb->buffer_length; i++, (*str_p)++ ) + { + **str_p = *((char *)iorb->buffer + i); + } // for + + iorb->xferred_length = i; + + return ENOERR; + +} // str_write() + + +externC int +_vsnprintf( char *s, size_t size, const char *format, va_list arg ) +{ + int rc; + // construct a fake device with the address of the string we've + // been passed as its private data. This way we can use the data + // directly + struct Cyg_Device_Table_t strdev = { "strdev", + (CYG_ADDRWORD) &s, + NULL, // open + NULL, // read_cancel + NULL, // write_cancel + NULL, // read_blocking + &str_write, // write_blocking + NULL, // read_asynchronous + NULL, // write_asynchronous + NULL, // close + 0 }; // ioctl + Cyg_StdioStream my_stream( &strdev, Cyg_StdioStream::CYG_STREAM_WRITE, + false, false, _IONBF, 0, NULL ); + + rc = _vfnprintf( (FILE *)&my_stream, size, format, arg ); + + // Null-terminate it, but note that s has been changed by str_write(), so + // that it now points to the end of the string + s[0] = '\0'; + + return rc; + +} // _vsnprintf() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF vsnprintf.cxx diff --git a/packages/language/c/libc/current/src/stdio/common/vsscanf.cxx b/packages/language/c/libc/current/src/stdio/common/vsscanf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/common/vsscanf.cxx @@ -0,0 +1,136 @@ +//=========================================================================== +// +// vsscanf.cxx +// +// ANSI Stdio vsscanf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include // Device table stuff +#include // IORBs +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream + + +// EXPORTED SYMBOLS + +externC int +vsscanf( const char *, const char *, va_list ) + CYGPRI_LIBC_WEAK_ALIAS("_vsscanf"); + +// FUNCTIONS + +static Cyg_ErrNo +str_read( CYG_ADDRWORD cookie, Cyg_IORB *iorb ) +{ + cyg_uint8 **str_p = (cyg_uint8 **) cookie; + cyg_ucount32 i; + + // we set *str_p to NULL further down when the string has finished being + // read + if (*str_p == NULL) + { + iorb->xferred_length = 0; + return ENOERR; + } // if + + // I suspect most strings passed to sprintf will be relatively short, + // so we just take the simple approach rather than have the overhead + // of calling memcpy etc. + + // copy string until run out of user space, or we reach its end + for (i=0; (i < iorb->buffer_length) ; ++i) + { + *((char *)iorb->buffer + i) = **str_p; + + if (**str_p == '\0') + { + *str_p = NULL; + ++i; + break; + } // if + + ++(*str_p); + } // for + + iorb->xferred_length = i; + + return ENOERR; + +} // str_read() + + +externC int +_vsscanf( const char *s, const char *format, va_list arg ) +{ + // construct a fake device with the address of the string we've + // been passed as its private data. This way we can use the data + // directly + struct Cyg_Device_Table_t strdev = { "strdev", + (CYG_ADDRWORD) &s, + NULL, // open + NULL, // read_cancel + NULL, // write_cancel + &str_read, // read_blocking + NULL, // write_blocking + NULL, // read_asynchronous + NULL, // write_asynchronous + NULL, // close + 0 }; // ioctl + Cyg_StdioStream my_stream( &strdev, Cyg_StdioStream::CYG_STREAM_READ, + false, false, _IONBF, 0, NULL ); + + return _vfscanf( (FILE *)&my_stream, format, arg ); + +} // _vsscanf() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF vsscanf.cxx diff --git a/packages/language/c/libc/current/src/stdio/input/fgetc.cxx b/packages/language/c/libc/current/src/stdio/input/fgetc.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/input/fgetc.cxx @@ -0,0 +1,95 @@ +//=========================================================================== +// +// fgetc.cxx +// +// ANSI Stdio fgetc() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream + +// EXPORTED SYMBOLS + +externC int +fgetc( FILE * ) CYGPRI_LIBC_WEAK_ALIAS("_fgetc"); + +// FUNCTIONS + +externC int +_fgetc( FILE *stream ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + cyg_ucount32 bytes_read; + Cyg_ErrNo err; + cyg_uint8 c; + + err = real_stream->read( &c, 1, &bytes_read ); + + if (!err && !bytes_read) // if no err, but nothing to read, try again + { + real_stream->refill_read_buffer(); + err = real_stream->read( &c, 1, &bytes_read ); + } // if + + if (err) + { + real_stream->set_error( err ); + errno = err; + return EOF; + } // if + + return (int)c; + +} // _fgetc() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fgetc.cxx diff --git a/packages/language/c/libc/current/src/stdio/input/fgets.cxx b/packages/language/c/libc/current/src/stdio/input/fgets.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/input/fgets.cxx @@ -0,0 +1,97 @@ +//======================================================================== +// +// fgets.cxx +// +// ANSI Stdio fgets() function +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================= + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream + +// EXPORTED SYMBOLS + +externC char * +fgets( char *, int, FILE * ) CYGPRI_LIBC_WEAK_ALIAS("_fgets"); + +// FUNCTIONS + +externC char * +_fgets( char *s, int n, FILE *stream ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + cyg_ucount32 bytes_read; + Cyg_ErrNo err; + + + err = real_stream->read( (cyg_uint8 *)s, n-1, &bytes_read ); + + if (!err && !bytes_read) { // if no err, but nothing to read, try again + real_stream->refill_read_buffer(); + err = real_stream->read( (cyg_uint8 *)s, n-1, &bytes_read ); + + } // if + + if (err) { + real_stream->set_error( err ); + errno = err; + return NULL; + } // if + + if (bytes_read > 0) + s[bytes_read]='\0'; // NULL terminate it + + return s; + +} // _fgets() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fgets.cxx diff --git a/packages/language/c/libc/current/src/stdio/input/fread.cxx b/packages/language/c/libc/current/src/stdio/input/fread.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/input/fread.cxx @@ -0,0 +1,109 @@ +//======================================================================== +// +// fread.cxx +// +// ANSI Stdio fread() function +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================= + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // Assertion support +#include // Tracing support +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream + +// EXPORTED SYMBOLS + +externC size_t +fread( void *, size_t, size_t, FILE * ) CYGPRI_LIBC_WEAK_ALIAS("_fread"); + +// FUNCTIONS + +externC size_t +_fread( void *ptr, size_t object_size, size_t num_objects, FILE *stream ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + cyg_ucount32 bytes_read; + Cyg_ErrNo err; + + + CYG_REPORT_FUNCNAMETYPE( "_fread", "read %d objects" ); + CYG_REPORT_FUNCARG4( "ptr=%08x, object_size=%d, num_objects=%d, " + "stream=%08x", ptr, object_size, num_objects, + stream ); + + if ( (object_size==0) || (num_objects==0) ) { + CYG_REPORT_RETVAL(0); + return 0; + } // if + + err = real_stream->read( (cyg_uint8 *)ptr, object_size*num_objects, + &bytes_read ); + + if (!err && !bytes_read) { // if no err, but nothing to read, try again + real_stream->refill_read_buffer(); + err = real_stream->read( (cyg_uint8 *)ptr, object_size*num_objects, + &bytes_read ); + } // if + + if (err) { + real_stream->set_error( err ); + errno = err; + } // if + + // we return the number of _objects_ read. Simple division is + // sufficient as this returns the quotient rather than rounding + CYG_REPORT_RETVAL( bytes_read/object_size ); + return bytes_read/object_size; + +} // _fread() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fread.cxx diff --git a/packages/language/c/libc/current/src/stdio/input/fscanf.cxx b/packages/language/c/libc/current/src/stdio/input/fscanf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/input/fscanf.cxx @@ -0,0 +1,84 @@ +//=========================================================================== +// +// fscanf.cxx +// +// ANSI Stdio fscanf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // INT_MAX +#include "clibincl/stdiosupp.hxx" // Support functions for stdio + +// EXPORTED SYMBOLS + +externC int +fscanf( FILE *, const char *, ... ) CYGPRI_LIBC_WEAK_ALIAS("_fscanf"); + + +// FUNCTIONS + +externC int +_fscanf( FILE *stream, const char *format, ... ) +{ + int rc; // return code + va_list ap; // for variable args + + va_start(ap, format); // init specifying last non-var arg + + rc = _vfscanf( stream, format, ap ); + + va_end(ap); // end var args + + return rc; +} // _fscanf() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fscanf.cxx diff --git a/packages/language/c/libc/current/src/stdio/input/gets.cxx b/packages/language/c/libc/current/src/stdio/input/gets.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/input/gets.cxx @@ -0,0 +1,106 @@ +//=========================================================================== +// +// gets.cxx +// +// ANSI Stdio gets() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include // UINT_MAX +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream + +// EXPORTED SYMBOLS + +externC char * +gets( char * ) CYGPRI_LIBC_WEAK_ALIAS("_gets"); + +// FUNCTIONS + +externC char * +_gets( char *s ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stdin; + cyg_ucount32 bytes_read; + Cyg_ErrNo err; + + + err = real_stream->read( (cyg_uint8 *)s, UINT_MAX, &bytes_read ); + + if (!err && !bytes_read) // if no err, but nothing to read, try again + { + real_stream->refill_read_buffer(); + err = real_stream->read( (cyg_uint8 *)s, UINT_MAX, &bytes_read ); + + } // if + + if (err) + { + real_stream->set_error( err ); + errno = err; + return NULL; + } // if + + if (bytes_read > 0) + { + // NULL terminate it + if (s[bytes_read-1] == '\n') + s[bytes_read-1] = '\0'; + else + s[bytes_read]='\0'; + } // if + + return s; + +} // _gets() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF gets.cxx diff --git a/packages/language/c/libc/current/src/stdio/input/scanf.cxx b/packages/language/c/libc/current/src/stdio/input/scanf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/input/scanf.cxx @@ -0,0 +1,84 @@ +//=========================================================================== +// +// scanf.cxx +// +// ANSI Stdio scanf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include "clibincl/stdiosupp.hxx" // Support functions for stdio + +// EXPORTED SYMBOLS + +externC int +scanf( const char *, ... ) CYGPRI_LIBC_WEAK_ALIAS("_scanf"); + + +// FUNCTIONS + + +externC int +_scanf( const char *format, ... ) +{ + int rc; // return code + va_list ap; // for variable args + + va_start(ap, format); // init specifying last non-var arg + + rc = _vfscanf( stdin, format, ap ); + + va_end(ap); // end var args + + return rc; +} // _scanf() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF scanf.cxx diff --git a/packages/language/c/libc/current/src/stdio/input/vfscanf.cxx b/packages/language/c/libc/current/src/stdio/input/vfscanf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/input/vfscanf.cxx @@ -0,0 +1,973 @@ +//======================================================================== +// +// vfscanf.cxx +// +// I/O routines for vfscanf() for use with ANSI C library +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== +// +// This code is based on original code with the following copyright: +// +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? And we have to +// have ungetc for this to work +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && \ + defined(CYGFUN_LIBC_STDIO_ungetc) + + +// INCLUDES + +#include // Common type definitions and support +#include // Variable argument definitions +#include // Standard header for all stdio files +#include // isspace() and isupper() +#include // standard utility functions e.g. strtol +#include "clibincl/stream.hxx" // C library streams +#include "clibincl/stdiosupp.hxx" // Support for stdio functions + +// EXPORTED SYMBOLS + +externC int +vfscanf (FILE *fp, const char *fmt0, va_list ap) + CYGPRI_LIBC_WEAK_ALIAS("_vfscanf"); + + +#ifdef CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT + +#include + +# define MAXFRACT DBL_DIG +# define MAXEXP DBL_MAX_10_EXP + +# define BUF (MAXEXP+MAXFRACT+3) /* 3 = sign + decimal point + NUL */ + +#else // ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + +# define BUF 40 + +#endif // ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + +/* + * Flags used during conversion. + */ + +#define LONG 0x01 /* l: long or double */ +#define LONGDBL 0x02 /* L: long double; unimplemented */ +#define SHORT 0x04 /* h: short */ +#define SUPPRESS 0x08 /* suppress assignment */ +#define POINTER 0x10 /* weird %p pointer (`fake hex') */ +#define NOSKIP 0x20 /* do not skip blanks */ + +/* + * The following are used in numeric conversions only: + * SIGNOK, NDIGITS, DPTOK, and EXPOK are for floating point; + * SIGNOK, NDIGITS, PFXOK, and NZDIGITS are for integral. + */ + +#define SIGNOK 0x40 /* +/- is (still) legal */ +#define NDIGITS 0x80 /* no digits detected */ + +#define DPTOK 0x100 /* (float) decimal point is still legal */ +#define EXPOK 0x200 /* (float) exponent (e+3, etc) still + legal */ + +#define PFXOK 0x100 /* 0x prefix is (still) legal */ +#define NZDIGITS 0x200 /* no zero digits detected */ + +/* + * Conversion types. + */ + +#define CT_CHAR 0 /* %c conversion */ +#define CT_CCL 1 /* %[...] conversion */ +#define CT_STRING 2 /* %s conversion */ +#define CT_INT 3 /* integer, i.e., strtol or strtoul */ +#define CT_FLOAT 4 /* floating, i.e., strtod */ + +#if 0 +#define u_char unsigned char +#endif +#define u_char char +#define u_long unsigned long + +typedef unsigned long (*strtoul_t)(const char *, char **endptr, int base); + +static u_char * +__sccl (char *tab, u_char *fmt); + + +/* + * vfscanf + */ + +#define _CAST_VOID + +#define CURR_POS (file->peek_byte( (cyg_uint8 *)&curr_byte),&curr_byte ) + +#define INC_CURR_POS ( file->read_byte( (cyg_uint8 *)&curr_byte ) ) + +#define MOVE_CURR_POS(x) (file->set_position( (x), SEEK_CUR )) + +#define SPACE_LEFT (file->bytes_available_to_read()) + +#define REFILL (file->refill_read_buffer()) + +#define BufferEmpty ( !SPACE_LEFT && \ + (REFILL, (!SPACE_LEFT)) ) + +externC int +_vfscanf (FILE *fp, const char *fmt0, va_list ap) +{ + u_char *fmt = (u_char *) fmt0; + int c; /* character from format, or conversion */ + size_t width; /* field width, or 0 */ + char *p; /* points into all kinds of strings */ + int n; /* handy integer */ + int flags; /* flags as defined above */ + char *p0; /* saves original value of p when necessary */ + int nassigned; /* number of fields assigned */ + int nread; /* number of characters consumed from fp */ + int base = 0; /* base argument to strtol/strtoul */ + + strtoul_t ccfn = NULL; /* conversion function (strtol/strtoul) */ + char ccltab[256]; /* character class table for %[...] */ + char buf[BUF]; /* buffer for numeric conversions */ + + Cyg_StdioStream *file = (Cyg_StdioStream *)fp; + char curr_byte; + + short *sp; + int *ip; + float *flp; + long double *ldp; + double *dp; + long *lp; + + /* `basefix' is used to avoid `if' tests in the integer scanner */ + static const short basefix[17] = + {10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; + + nassigned = 0; + nread = 0; + for (;;) + { + c = *fmt++; + if (c == 0) + return nassigned; + if (isspace (c)) + { + for (;;) + { + if (BufferEmpty) + return nassigned; + if (!isspace (*CURR_POS)) + break; + nread++, INC_CURR_POS; + } + continue; + } + if (c != '%') + goto literal; + width = 0; + flags = 0; + + /* + * switch on the format. continue if done; break once format + * type is derived. + */ + +again: + c = *fmt++; + + switch (c) + { + case '%': +literal: + if (BufferEmpty) + goto input_failure; + if (*CURR_POS != c) + goto match_failure; + INC_CURR_POS; + nread++; + continue; + + case '*': + flags |= SUPPRESS; + goto again; + case 'l': + flags |= LONG; + goto again; + case 'L': + flags |= LONGDBL; + goto again; + case 'h': + flags |= SHORT; + goto again; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + width = width * 10 + c - '0'; + goto again; + + /* + * Conversions. Those marked `compat' are for + * 4.[123]BSD compatibility. + * + * (According to ANSI, E and X formats are supposed to + * the same as e and x. Sorry about that.) + */ + + case 'D': /* compat */ + flags |= LONG; + /* FALLTHROUGH */ + case 'd': + c = CT_INT; + ccfn = (strtoul_t)strtol; + base = 10; + break; + + case 'i': + c = CT_INT; + ccfn = (strtoul_t)strtol; + base = 0; + break; + + case 'O': /* compat */ + flags |= LONG; + /* FALLTHROUGH */ + case 'o': + c = CT_INT; + ccfn = strtoul; + base = 8; + break; + + case 'u': + c = CT_INT; + ccfn = strtoul; + base = 10; + break; + + case 'X': /* compat XXX */ + case 'x': + flags |= PFXOK; /* enable 0x prefixing */ + c = CT_INT; + ccfn = strtoul; + base = 16; + break; + + case 'E': /* compat XXX */ + case 'G': /* compat XXX */ +/* ANSI says that E,G and X behave the same way as e,g,x */ + /* FALLTHROUGH */ + case 'e': + case 'f': + case 'g': + c = CT_FLOAT; + break; + + case 's': + c = CT_STRING; + break; + + case '[': + fmt = __sccl (ccltab, fmt); + flags |= NOSKIP; + c = CT_CCL; + break; + + case 'c': + flags |= NOSKIP; + c = CT_CHAR; + break; + + case 'p': /* pointer format is like hex */ + flags |= POINTER | PFXOK; + c = CT_INT; + ccfn = strtoul; + base = 16; + break; + + case 'n': + if (flags & SUPPRESS) /* ??? */ + continue; + if (flags & SHORT) + { + sp = va_arg (ap, short *); + *sp = nread; + } + else if (flags & LONG) + { + lp = va_arg (ap, long *); + *lp = nread; + } + else + { + ip = va_arg (ap, int *); + *ip = nread; + } + continue; + + /* + * Disgusting backwards compatibility hacks. XXX + */ + case '\0': /* compat */ + return EOF; + + default: /* compat */ + if (isupper (c)) + flags |= LONG; + c = CT_INT; + ccfn = (strtoul_t)strtol; + base = 10; + break; + } + + /* + * We have a conversion that requires input. + */ + if (BufferEmpty) + goto input_failure; + + /* + * Consume leading white space, except for formats that + * suppress this. + */ + if ((flags & NOSKIP) == 0) + { + while (isspace (*CURR_POS)) + { + nread++; + INC_CURR_POS; + if (SPACE_LEFT == 0) +#ifndef CYGNUS_NEC + if (REFILL) +#endif + goto input_failure; + } + /* + * Note that there is at least one character in the + * buffer, so conversions that do not set NOSKIP ca + * no longer result in an input failure. + */ + } + + /* + * Do the conversion. + */ + switch (c) + { + + case CT_CHAR: + /* scan arbitrary characters (sets NOSKIP) */ + if (width == 0) + width = 1; + if (flags & SUPPRESS) + { + size_t sum = 0; + + for (;;) + { + if ((n = SPACE_LEFT) < (signed)width) + { + sum += n; + width -= n; + MOVE_CURR_POS(n-1); + INC_CURR_POS; +#ifndef CYGNUS_NEC + if (REFILL) + { +#endif + if (sum == 0) + goto input_failure; + break; +#ifndef CYGNUS_NEC + } +#endif + } + else + { + sum += width; + MOVE_CURR_POS(width - 1); + INC_CURR_POS; + break; + } + } + nread += sum; + } + else + { + /* Kludge city for the moment */ + char *dest = va_arg (ap, char *); + int n = width; + if (SPACE_LEFT == 0) +#ifndef CYGNUS_NEC + if (REFILL) +#endif + goto input_failure; + + while (n && !BufferEmpty) + { + *dest++ = *CURR_POS; + INC_CURR_POS; + n--; + nread++; + } + nassigned++; + } + break; + + case CT_CCL: + /* scan a (nonempty) character class (sets NOSKIP) */ + if (width == 0) + width = ~0; /* `infinity' */ + /* take only those things in the class */ + if (flags & SUPPRESS) + { + n = 0; + while (ccltab[*CURR_POS]) + { + n++, INC_CURR_POS; + if (--width == 0) + break; + if (BufferEmpty) + { + if (n == 0) + goto input_failure; + break; + } + } + if (n == 0) + goto match_failure; + } + else + { + p0 = p = va_arg (ap, char *); + while (ccltab[*CURR_POS]) + { + *p++ = *CURR_POS; + INC_CURR_POS; + if (--width == 0) + break; + if (BufferEmpty) + { + if (p == p0) + goto input_failure; + break; + } + } + n = p - p0; + if (n == 0) + goto match_failure; + *p = 0; + nassigned++; + } + nread += n; + break; + + case CT_STRING: + /* like CCL, but zero-length string OK, & no NOSKIP */ + if (width == 0) + width = ~0; + if (flags & SUPPRESS) + { + n = 0; + while (!isspace (*CURR_POS)) + { + n++, INC_CURR_POS; + if (--width == 0) + break; + if (BufferEmpty) + break; + } + nread += n; + } + else + { + p0 = p = va_arg (ap, char *); + while (!isspace (*CURR_POS)) + { + *p++ = *CURR_POS; + INC_CURR_POS; + if (--width == 0) + break; + if (BufferEmpty) + break; + } + *p = 0; + nread += p - p0; + nassigned++; + } + continue; + + case CT_INT: + /* scan an integer as if by strtol/strtoul */ +#ifdef hardway + if (width == 0 || width > sizeof (buf) - 1) + width = sizeof (buf) - 1; +#else + /* size_t is unsigned, hence this optimisation */ + if (--width > sizeof (buf) - 2) + width = sizeof (buf) - 2; + width++; +#endif + flags |= SIGNOK | NDIGITS | NZDIGITS; + for (p = buf; width; width--) + { + c = *CURR_POS; + /* + * Switch on the character; `goto ok' if we + * accept it as a part of number. + */ + switch (c) + { + /* + * The digit 0 is always legal, but is special. + * For %i conversions, if no digits (zero or nonzero) + * have been scanned (only signs), we will have base==0 + * In that case, we should set it to 8 and enable 0x + * prefixing. Also, if we have not scanned zero digits + * before this, do not turn off prefixing (someone else + * will turn it off if we have scanned any nonzero + * digits). + */ + case '0': + if (base == 0) + { + base = 8; + flags |= PFXOK; + } + if (flags & NZDIGITS) + flags &= ~(SIGNOK | NZDIGITS | NDIGITS); + else + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* 1 through 7 always legal */ + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + base = basefix[base]; + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* digits 8 and 9 ok iff decimal or hex */ + case '8': + case '9': + base = basefix[base]; + if (base <= 8) + break; /* not legal here */ + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* letters ok iff hex */ + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + /* no need to fix base here */ + if (base <= 10) + break; /* not legal here */ + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* sign ok only as first character */ + case '+': + case '-': + if (flags & SIGNOK) + { + flags &= ~SIGNOK; + goto ok; + } + break; + + /* x ok iff flag still set & 2nd char */ + case 'x': + case 'X': + if (flags & PFXOK && p == buf + 1) + { + base = 16;/* if %i */ + flags &= ~PFXOK; + goto ok; + } + break; + } + + /* + * If we got here, c is not a legal character + * for a number. Stop accumulating digits. + */ + break; + ok: + /* + * c is legal: store it and look at the next. + */ + *p++ = c; + INC_CURR_POS; + if (SPACE_LEFT == 0) +#ifndef CYGNUS_NEC + if (REFILL) +#endif + break; /* EOF */ + } + /* + * If we had only a sign, it is no good; push back the sign. + * If the number ends in `x', it was [sign] '0' 'x', so push + * back the x and treat it as [sign] '0'. + */ + if (flags & NDIGITS) + { + if (p > buf) + _CAST_VOID _ungetc (*(u_char *)-- p, fp); + goto match_failure; + } + c = ((u_char *) p)[-1]; + if (c == 'x' || c == 'X') + { + --p; + /*(void)*/ _ungetc (c, fp); + } + if ((flags & SUPPRESS) == 0) + { + u_long res; + + *p = 0; + res = (*ccfn) (buf, (char **) NULL, base); + if (flags & POINTER) + *(va_arg (ap, char **)) = (char *) (CYG_ADDRESS) res; + else if (flags & SHORT) + { + sp = va_arg (ap, short *); + *sp = res; + } + else if (flags & LONG) + { + lp = va_arg (ap, long *); + *lp = res; + } + else + { + ip = va_arg (ap, int *); + *ip = res; + } + nassigned++; + } + nread += p - buf; + break; + + case CT_FLOAT: + /* scan a floating point number as if by strtod */ + +#ifdef hardway + if (width == 0 || width > sizeof (buf) - 1) + width = sizeof (buf) - 1; +#else + /* size_t is unsigned, hence this optimisation */ + if (--width > sizeof (buf) - 2) + width = sizeof (buf) - 2; + width++; +#endif // ifdef hardway + + flags |= SIGNOK | NDIGITS | DPTOK | EXPOK; + for (p = buf; width; width--) + { + c = *CURR_POS; + /* + * This code mimicks the integer conversion + * code, but is much simpler. + */ + switch (c) + { + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + flags &= ~(SIGNOK | NDIGITS); + goto fok; + + case '+': + case '-': + if (flags & SIGNOK) + { + flags &= ~SIGNOK; + goto fok; + } + break; + case '.': + if (flags & DPTOK) + { + flags &= ~(SIGNOK | DPTOK); + goto fok; + } + break; + case 'e': + case 'E': + /* no exponent without some digits */ + if ((flags & (NDIGITS | EXPOK)) == EXPOK) + { + flags = + (flags & ~(EXPOK | DPTOK)) | + SIGNOK | NDIGITS; + goto fok; + } + break; + } + break; + fok: + *p++ = c; + INC_CURR_POS; + if (SPACE_LEFT == 0) +#ifndef CYGNUS_NEC + if (REFILL) +#endif + break; /* EOF */ + } + /* + * If no digits, might be missing exponent digits + * (just give back the exponent) or might be missing + * regular digits, but had sign and/or decimal point. + */ + if (flags & NDIGITS) + { + if (flags & EXPOK) + { + /* no digits at all */ + while (p > buf) + _ungetc (*(u_char *)-- p, fp); + goto match_failure; + } + /* just a bad exponent (e and maybe sign) */ + c = *(u_char *)-- p; + if (c != 'e' && c != 'E') + { + _CAST_VOID _ungetc (c, fp); /* sign */ + c = *(u_char *)-- p; + } + _CAST_VOID _ungetc (c, fp); + } + if ((flags & SUPPRESS) == 0) + { + double res; + + *p = 0; +#ifdef CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT + res = atof (buf); +#else + res = 0.0; +#endif + if (flags & LONG) + { + dp = va_arg (ap, double *); + *dp = res; + } + else if (flags & LONGDBL) + { + ldp = va_arg (ap, long double *); + *ldp = res; + } + else + { + flp = va_arg (ap, float *); + *flp = res; + } + nassigned++; + } + nread += p - buf; + break; + } + } + +input_failure: + return nassigned ? nassigned : -1; +match_failure: + return nassigned; +} // _vfscanf() + +/* + * Fill in the given table from the scanset at the given format + * (just after `['). Return a pointer to the character past the + * closing `]'. The table has a 1 wherever characters should be + * considered part of the scanset. + */ + +/*static*/ +u_char * +__sccl (char *tab, u_char *fmt) +{ + int c, n, v; + + /* first `clear' the whole table */ + c = *fmt++; /* first char hat => negated scanset */ + if (c == '^') + { + v = 1; /* default => accept */ + c = *fmt++; /* get new first char */ + } + else + v = 0; /* default => reject */ + /* should probably use memset here */ + for (n = 0; n < 256; n++) + tab[n] = v; + if (c == 0) + return fmt - 1; /* format ended before closing ] */ + + /* + * Now set the entries corresponding to the actual scanset to the + * opposite of the above. + * + * The first character may be ']' (or '-') without being special; the + * last character may be '-'. + */ + + v = 1 - v; + for (;;) + { + tab[c] = v; /* take character c */ + doswitch: + n = *fmt++; /* and examine the next */ + switch (n) + { + + case 0: /* format ended too soon */ + return fmt - 1; + + case '-': + /* + * A scanset of the form [01+-] is defined as `the digit 0, the + * digit 1, the character +, the character -', but the effect + * of a scanset such as [a-zA-Z0-9] is implementation defined. + * The V7 Unix scanf treats `a-z' as `the letters a through z', + * but treats `a-a' as `the letter a, the character -, and the + * letter a'. + * + * For compatibility, the `-' is not considerd to define a + * range if the character following it is either a close + * bracket (required by ANSI) or is not numerically greater + * than the character we just stored in the table (c). + */ + n = *fmt; + if (n == ']' || n < c) + { + c = '-'; + break; /* resume the for(;;) */ + } + fmt++; + do + { /* fill in the range */ + tab[++c] = v; + } + while (c < n); +#if 1 /* XXX another disgusting compatibility hack */ + /* + * Alas, the V7 Unix scanf also treats formats such + * as [a-c-e] as `the letters a through e'. This too + * is permitted by the standard.... + */ + goto doswitch; +#else + c = *fmt++; + if (c == 0) + return fmt - 1; + if (c == ']') + return fmt; +#endif + + break; + + + case ']': /* end of scanset */ + return fmt; + + default: /* just another character */ + c = n; + break; + } + } + /* NOTREACHED */ +} // __sccl() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && + // defined(CYGFUN_LIBC_STDIO_ungetc) + +// EOF vfscanf.cxx diff --git a/packages/language/c/libc/current/src/stdio/output/fnprintf.cxx b/packages/language/c/libc/current/src/stdio/output/fnprintf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/output/fnprintf.cxx @@ -0,0 +1,84 @@ +//=========================================================================== +// +// fnprintf.cxx +// +// ANSI Stdio fnprintf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include "clibincl/stdiosupp.hxx" // Support functions for stdio + +// EXPORTED SYMBOLS + +externC int +fnprintf( FILE *, size_t, const char *, ... ) + CYGPRI_LIBC_WEAK_ALIAS("_fnprintf"); + + +// FUNCTIONS + +externC int +_fnprintf( FILE *stream, size_t size, const char *format, ... ) +{ + int rc; // return code + va_list ap; // for variable args + + va_start(ap, format); // init specifying last non-var arg + + rc = _vfnprintf(stream, size, format, ap); + + va_end(ap); // end var args + + return rc; +} // _fnprintf() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fnprintf.cxx diff --git a/packages/language/c/libc/current/src/stdio/output/fprintf.cxx b/packages/language/c/libc/current/src/stdio/output/fprintf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/output/fprintf.cxx @@ -0,0 +1,84 @@ +//=========================================================================== +// +// fprintf.cxx +// +// ANSI Stdio fprintf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // INT_MAX +#include "clibincl/stdiosupp.hxx" // Support functions for stdio + +// EXPORTED SYMBOLS + +externC int +fprintf( FILE *, const char *, ... ) CYGPRI_LIBC_WEAK_ALIAS("_fprintf"); + + +// FUNCTIONS + +externC int +_fprintf( FILE *stream, const char *format, ... ) +{ + int rc; // return code + va_list ap; // for variable args + + va_start(ap, format); // init specifying last non-var arg + + rc = _vfnprintf(stream, INT_MAX, format, ap); + + va_end(ap); // end var args + + return rc; +} // _fprintf() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fprintf.cxx diff --git a/packages/language/c/libc/current/src/stdio/output/fputc.cxx b/packages/language/c/libc/current/src/stdio/output/fputc.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/output/fputc.cxx @@ -0,0 +1,89 @@ +//=========================================================================== +// +// fputc.cxx +// +// ANSI Stdio fputc() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream + +// EXPORTED SYMBOLS + +externC int +fputc( int, FILE * ) CYGPRI_LIBC_WEAK_ALIAS("_fputc"); + +// FUNCTIONS + +externC int +_fputc( int c, FILE *stream ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + Cyg_ErrNo err; + cyg_uint8 real_c = (cyg_uint8) c; + + err = real_stream->write_byte( real_c ); + + if (err) + { + real_stream->set_error( err ); + errno = err; + return EOF; + } // if + + + return (int)real_c; + +} // _fputc() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fputc.cxx diff --git a/packages/language/c/libc/current/src/stdio/output/fputs.cxx b/packages/language/c/libc/current/src/stdio/output/fputs.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/output/fputs.cxx @@ -0,0 +1,90 @@ +//======================================================================== +// +// fputs.cxx +// +// ANSI Stdio fputs() function +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream +#include "clibincl/stringsupp.hxx" // _strlen() + +// EXPORTED SYMBOLS + +externC int +fputs( const char *s, FILE *stream ) CYGPRI_LIBC_WEAK_ALIAS("_fputs"); + +// FUNCTIONS + +externC int +_fputs( const char *s, FILE *stream ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + cyg_ucount32 size = _strlen(s); + cyg_ucount32 written; + Cyg_ErrNo err; + + err = real_stream->write( (cyg_uint8 *)s, size, &written ); + + if (err) { + real_stream->set_error( err ); + errno = err; + return EOF; + } // if + + + return written; + +} // _fputs() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fputs.cxx diff --git a/packages/language/c/libc/current/src/stdio/output/fwrite.cxx b/packages/language/c/libc/current/src/stdio/output/fwrite.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/output/fwrite.cxx @@ -0,0 +1,104 @@ +//======================================================================== +// +// fwrite.cxx +// +// ANSI Stdio fwrite() function +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // Assertion support +#include // Tracing support +#include // NULL and size_t from compiler +#include // header for this file +#include // error codes +#include "clibincl/stdiosupp.hxx" // Support functions for stdio +#include "clibincl/stream.hxx" // Cyg_StdioStream + +// EXPORTED SYMBOLS + +externC size_t +fwrite( const void *, size_t, size_t , FILE * ) + CYGPRI_LIBC_WEAK_ALIAS("_fwrite"); + +// FUNCTIONS + +externC size_t +_fwrite( const void *ptr, size_t object_size, size_t num_objects, + FILE *stream ) +{ + Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream; + cyg_ucount32 written; + Cyg_ErrNo err; + + CYG_REPORT_FUNCNAMETYPE( "_fwrite", "wrote %d objects" ); + CYG_REPORT_FUNCARG4( "ptr=%08x, object_size=%d, num_objects=%d, " + "stream=%08x", ptr, object_size, num_objects, + stream ); + + if ( (object_size==0) || (num_objects==0) ) { + CYG_REPORT_RETVAL(0); + return 0; + } // if + + err = real_stream->write( (cyg_uint8 *)ptr, num_objects*object_size, + &written ); + + if (err) { + real_stream->set_error( err ); + errno = err; + } // if + + // we return the number of _objects_ written. Simple division is + // sufficient as this returns the quotient rather than rounding + + CYG_REPORT_RETVAL( written/object_size ); + return written/object_size; +} // _fwrite() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF fwrite.cxx diff --git a/packages/language/c/libc/current/src/stdio/output/printf.cxx b/packages/language/c/libc/current/src/stdio/output/printf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/output/printf.cxx @@ -0,0 +1,83 @@ +//=========================================================================== +// +// printf.cxx +// +// ANSI Stdio printf() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common project-wide type definitions +#include // NULL and size_t from compiler +#include // header for this file +#include // INT_MAX +#include "clibincl/stdiosupp.hxx" // Support functions for stdio + +// EXPORTED SYMBOLS + +externC int +printf( const char *, ... ) CYGPRI_LIBC_WEAK_ALIAS("_printf"); + +// FUNCTIONS + +externC int +_printf( const char *format, ... ) +{ + int rc; // return code + va_list ap; // for variable args + + va_start(ap, format); // init specifying last non-var arg + + rc = _vfnprintf(stdout, INT_MAX, format, ap); + + va_end(ap); // end var args + + return rc; +} // _printf() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF printf.cxx diff --git a/packages/language/c/libc/current/src/stdio/output/vfnprintf.cxx b/packages/language/c/libc/current/src/stdio/output/vfnprintf.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdio/output/vfnprintf.cxx @@ -0,0 +1,914 @@ +//=========================================================================== +// +// vfnprintf.c +// +// I/O routines for vfnprintf() for use with ANSI C library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== +// +// This code is based on original code with the following copyright: +// +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want the stdio stuff? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// INCLUDES + +#include // Common type definitions and support +#include // Variable argument definitions +#include // Standard header for all stdio files +#include "clibincl/stringsupp.hxx"// _memchr() and _strlen() functions +#include "clibincl/stream.hxx" // C library streams + + +// EXPORTED SYMBOLS + +externC int +vfnprintf ( FILE *, size_t, const char *, va_list ) + CYGPRI_LIBC_WEAK_ALIAS("_vfnprintf"); + + +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + +# include // for DBL_DIG etc. below +# include // for modf() +# include // Cyg_libm_ieee_double_shape_type + +# define MAXFRACT DBL_DIG +# define MAXEXP DBL_MAX_10_EXP + +# define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */ +# define DEFPREC 6 + +static int +cvt( double, int, int, char *, int, char *, char * ); + +#else // ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + +# define BUF 40 + +#endif // ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + +/* + * Actual printf innards. + * + * This code is large and complicated... + */ + + + +/* + * Macros for converting digits to letters and vice versa + */ +#define to_digit(c) ((c) - '0') +#define is_digit(c) ((unsigned)to_digit(c) <= 9) +#define to_char(n) ((n) + '0') + +/* + * Flags used during conversion. + */ +#define ALT 0x001 /* alternate form */ +#define HEXPREFIX 0x002 /* add 0x or 0X prefix */ +#define LADJUST 0x004 /* left adjustment */ +#define LONGDBL 0x008 /* long double; unimplemented */ +#define LONGINT 0x010 /* long integer */ +#define QUADINT 0x020 /* quad integer */ +#define SHORTINT 0x040 /* short integer */ +#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */ +#define FPT 0x100 /* Floating point number */ + +static int +__mbtowc(char *pwc, const char *s, size_t n) +{ + if (s == NULL) + return 0; + if (n == 0) + return -1; + if (pwc) + *pwc = (char) *s; + return (*s != '\0'); +} + + +externC int +_vfnprintf ( FILE *stream, size_t n, const char *format, va_list arg) +{ + char *fmt; /* format string */ + int ch; /* character from fmt */ + int x, y; /* handy integers (short term usage) */ + char *cp; /* handy char pointer (short term usage) */ + int flags; /* flags as above */ + int ret; /* return value accumulator */ + int width; /* width from format (%8d), or 0 */ + int prec; /* precision from format (%.3d), or -1 */ + char sign; /* sign prefix (' ', '+', '-', or \0) */ + char wc; + +#define quad_t long long +#define u_quad_t unsigned long long + + u_quad_t _uquad; /* integer arguments %[diouxX] */ + enum { OCT, DEC, HEX } base;/* base for [diouxX] conversion */ + int dprec; /* a copy of prec if [diouxX], 0 otherwise */ + int fieldsz; /* field size expanded by sign, etc */ + int realsz; /* field size expanded by dprec */ + int size; /* size of converted field or string */ + char *xdigs; /* digits for [xX] conversion */ +#define NIOV 8 + char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ + char ox[2]; /* space for 0x hex-prefix */ +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + char softsign; /* temporary negative sign for floats */ + double _double; /* double precision arguments %[eEfgG] */ + int fpprec; /* `extra' floating precision in [eEfgG] */ +#endif + + /* + * Choose PADSIZE to trade efficiency vs. size. If larger printf + * fields occur frequently, increase PADSIZE and make the initialisers + * below longer. + */ +#define PADSIZE 16 /* pad chunk size */ + static char blanks[PADSIZE] = + {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; + static char zeroes[PADSIZE] = + {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + + /* + * BEWARE, these `goto error' on error, and PAD uses `n'. + */ +#define PRINT(ptr, len) { cyg_ucount32 length = len; \ + if (((Cyg_StdioStream *)stream)->write( (const cyg_uint8 *)ptr, \ + (cyg_ucount32) len, &length )) \ + goto error; } + + +#define PAD(howmany, with) { \ + if ((x = (howmany)) > 0) { \ + while (x > PADSIZE) { \ + PRINT(with, PADSIZE); \ + x -= PADSIZE; \ + } \ + PRINT(with, x); \ + } \ +} +#define FLUSH() { if (((Cyg_StdioStream *)stream)->flush_output()) \ + goto error; } + + /* + * To extend shorts properly, we need both signed and unsigned + * argument extraction methods. + */ + +#define SARG() \ + (flags&QUADINT ? va_arg(arg, cyg_int64) : \ + flags&LONGINT ? va_arg(arg, cyg_int32) : \ + flags&SHORTINT ? (long)va_arg(arg, cyg_int32) : \ + (long)va_arg(arg, cyg_int32)) +#define UARG() \ + (flags&QUADINT ? va_arg(arg, cyg_uint64) : \ + flags&LONGINT ? va_arg(arg, cyg_uint32) : \ + flags&SHORTINT ? (unsigned long)va_arg(arg, cyg_uint32) : \ + (unsigned long)va_arg(arg, cyg_uint32)) + + + xdigs = NULL; // stop compiler whinging + fmt = (char *)format; + ret = 0; + + /* + * Scan the format for conversions (`%' character). + */ + for (;;) { + cp = (char *)fmt; + while ((x = __mbtowc(&wc, fmt, 1)) > 0) { + fmt += x; + if (wc == '%') { + fmt--; + break; + } + } + if ((y = fmt - cp) != 0) { + PRINT(cp, y); + ret += y; + } + if ((x <= 0) || (ret >= (int)n)) // @@@ this check with n isn't good enough + goto done; + fmt++; /* skip over '%' */ + + flags = 0; + dprec = 0; +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + fpprec = 0; +#endif + width = 0; + prec = -1; + sign = '\0'; + +rflag: ch = *fmt++; +reswitch: switch (ch) { + case ' ': + /* + * ``If the space and + flags both appear, the space + * flag will be ignored.'' + * -- ANSI X3J11 + */ + if (!sign) + sign = ' '; + goto rflag; + case '#': + flags |= ALT; + goto rflag; + case '*': + /* + * ``A negative field width argument is taken as a + * - flag followed by a positive field width.'' + * -- ANSI X3J11 + * They don't exclude field widths read from args. + */ + if ((width = va_arg(arg, int)) >= 0) + goto rflag; + width = -width; + /* FALLTHROUGH */ + case '-': + flags |= LADJUST; + goto rflag; + case '+': + sign = '+'; + goto rflag; + case '.': + if ((ch = *fmt++) == '*') { + x = va_arg(arg, int); + prec = x < 0 ? -1 : x; + goto rflag; + } + x = 0; + while (is_digit(ch)) { + x = 10 * x + to_digit(ch); + ch = *fmt++; + } + prec = x < 0 ? -1 : x; + goto reswitch; + case '0': + /* + * ``Note that 0 is taken as a flag, not as the + * beginning of a field width.'' + * -- ANSI X3J11 + */ + flags |= ZEROPAD; + goto rflag; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + x = 0; + do { + x = 10 * x + to_digit(ch); + ch = *fmt++; + } while (is_digit(ch)); + width = x; + goto reswitch; +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + case 'L': + flags |= LONGDBL; + goto rflag; +#endif + case 'h': + flags |= SHORTINT; + goto rflag; + case 'l': + if (*fmt == 'l') { + fmt++; + flags |= QUADINT; + } else { + flags |= LONGINT; + } + goto rflag; + case 'q': + flags |= QUADINT; + goto rflag; + case 'c': + *(cp = buf) = va_arg(arg, int); + size = 1; + sign = '\0'; + break; + case 'D': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'd': + case 'i': + _uquad = SARG(); +#ifndef _NO_LONGLONG + if ((quad_t)_uquad < 0) +#else + if ((long) _uquad < 0) +#endif + { + + _uquad = -_uquad; + sign = '-'; + } + base = DEC; + goto number; + +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + _double = va_arg(arg, double); + /* + * don't do unrealistic precision; just pad it with + * zeroes later, so buffer size stays rational. + */ + if (prec > MAXFRACT) { + if ((ch != 'g' && ch != 'G') || (flags&ALT)) + fpprec = prec - MAXFRACT; + prec = MAXFRACT; + } else if (prec == -1) + prec = DEFPREC; + /* + * cvt may have to round up before the "start" of + * its buffer, i.e. ``intf("%.2f", (double)9.999);''; + * if the first character is still NUL, it did. + * softsign avoids negative 0 if _double < 0 but + * no significant digits will be shown. + */ + cp = buf; + *cp = '\0'; + size = cvt(_double, prec, flags, &softsign, ch, + cp, buf + sizeof(buf)); + if (softsign) + sign = '-'; + if (*cp == '\0') + cp++; + break; +#else + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + // Output nothing at all + (void) va_arg(arg, double); // take off arg anyway + cp = ""; + size = 0; + sign = '\0'; + break; + + +#endif // ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + + case 'n': +#ifndef _NO_LONGLONG + if (flags & QUADINT) + *va_arg(arg, quad_t *) = ret; + else +#endif + if (flags & LONGINT) + *va_arg(arg, long *) = ret; + else if (flags & SHORTINT) + *va_arg(arg, short *) = ret; + else + *va_arg(arg, int *) = ret; + continue; /* no output */ + case 'O': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'o': + _uquad = UARG(); + base = OCT; + goto nosign; + case 'p': + /* + * ``The argument shall be a pointer to void. The + * value of the pointer is converted to a sequence + * of printable characters, in an implementation- + * defined manner.'' + * -- ANSI X3J11 + */ + /* NOSTRICT */ + _uquad = (unsigned long)va_arg(arg, void *); + base = HEX; + xdigs = "0123456789abcdef"; + flags |= HEXPREFIX; + ch = 'x'; + goto nosign; + case 's': + if ((cp = va_arg(arg, char *)) == NULL) + cp = "(null)"; + if (prec >= 0) { + /* + * can't use strlen; can only look for the + * NUL in the first `prec' characters, and + * strlen() will go further. + */ + char *p = (char *)_memchr(cp, 0, prec); + + if (p != NULL) { + size = p - cp; + if (size > prec) + size = prec; + } else + size = prec; + } else + size = _strlen(cp); + sign = '\0'; + break; + case 'U': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'u': + _uquad = UARG(); + base = DEC; + goto nosign; + case 'X': + xdigs = "0123456789ABCDEF"; + goto hex; + case 'x': + xdigs = "0123456789abcdef"; +hex: _uquad = UARG(); + base = HEX; + /* leading 0x/X only if non-zero */ + if (flags & ALT && _uquad != 0) + flags |= HEXPREFIX; + + /* unsigned conversions */ +nosign: sign = '\0'; + /* + * ``... diouXx conversions ... if a precision is + * specified, the 0 flag will be ignored.'' + * -- ANSI X3J11 + */ +number: if ((dprec = prec) >= 0) + flags &= ~ZEROPAD; + + /* + * ``The result of converting a zero value with an + * explicit precision of zero is no characters.'' + * -- ANSI X3J11 + */ + cp = buf + BUF; + if (_uquad != 0 || prec != 0) { + /* + * Unsigned mod is hard, and unsigned mod + * by a constant is easier than that by + * a variable; hence this switch. + */ + switch (base) { + case OCT: + do { + *--cp = to_char(_uquad & 7); + _uquad >>= 3; + } while (_uquad); + /* handle octal leading 0 */ + if (flags & ALT && *cp != '0') + *--cp = '0'; + break; + + case DEC: + /* many numbers are 1 digit */ + while (_uquad >= 10) { + *--cp = to_char(_uquad % 10); + _uquad /= 10; + } + *--cp = to_char(_uquad); + break; + + case HEX: + do { + *--cp = xdigs[_uquad & 15]; + _uquad >>= 4; + } while (_uquad); + break; + + default: + cp = "bug in vfprintf: bad base"; + size = _strlen(cp); + goto skipsize; + } + } + size = buf + BUF - cp; + skipsize: + break; + default: /* "%?" prints ?, unless ? is NUL */ + if (ch == '\0') + goto done; + /* pretend it was %c with argument ch */ + cp = buf; + *cp = ch; + size = 1; + sign = '\0'; + break; + } + + /* + * All reasonable formats wind up here. At this point, `cp' + * points to a string which (if not flags&LADJUST) should be + * padded out to `width' places. If flags&ZEROPAD, it should + * first be prefixed by any sign or other prefix; otherwise, + * it should be blank padded before the prefix is emitted. + * After any left-hand padding and prefixing, emit zeroes + * required by a decimal [diouxX] precision, then print the + * string proper, then emit zeroes required by any leftover + * floating precision; finally, if LADJUST, pad with blanks. + * + * Compute actual size, so we know how much to pad. + * fieldsz excludes decimal prec; realsz includes it. + */ +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + fieldsz = size + fpprec; +#else + fieldsz = size; +#endif + if (sign) + fieldsz++; + else if (flags & HEXPREFIX) + fieldsz+= 2; + realsz = dprec > fieldsz ? dprec : fieldsz; + + /* right-adjusting blank padding */ + if ((flags & (LADJUST|ZEROPAD)) == 0) + PAD(width - realsz, blanks); + + /* prefix */ + if (sign) { + PRINT(&sign, 1); + } else if (flags & HEXPREFIX) { + ox[0] = '0'; + ox[1] = ch; + PRINT(ox, 2); + } + + /* right-adjusting zero padding */ + if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) + PAD(width - realsz, zeroes); + + /* leading zeroes from decimal precision */ + PAD(dprec - fieldsz, zeroes); + + /* the string or number proper */ + PRINT(cp, size); + +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + /* trailing f.p. zeroes */ + PAD(fpprec, zeroes); +#endif + + /* left-adjusting padding (always blank) */ + if (flags & LADJUST) + PAD(width - realsz, blanks); + + /* finally, adjust ret */ + ret += width > realsz ? width : realsz; + + FLUSH(); /* copy out the I/O vectors */ + } +done: + FLUSH(); +error: + return (((Cyg_StdioStream *) stream)->get_error() ? EOF : ret); + /* NOTREACHED */ +} + + +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + +static char * +round(double fract, int *exp, char *start, char *end, char ch, char *signp) +{ + double tmp; + + if (fract) + (void)modf(fract * 10, &tmp); + else + tmp = to_digit(ch); + if (tmp > 4) + for (;; --end) { + if (*end == '.') + --end; + if (++*end <= '9') + break; + *end = '0'; + if (end == start) { + if (exp) { /* e/E; increment exponent */ + *end = '1'; + ++*exp; + } + else { /* f; add extra digit */ + *--end = '1'; + --start; + } + break; + } + } + /* ``"%.3f", (double)-0.0004'' gives you a negative 0. */ + else if (*signp == '-') + for (;; --end) { + if (*end == '.') + --end; + if (*end != '0') + break; + if (end == start) + *signp = 0; + } + return (start); +} // round() + + +static char * +exponent(char *p, int exp, int fmtch) +{ + char *t; + char expbuf[MAXEXP]; + + *p++ = fmtch; + if (exp < 0) { + exp = -exp; + *p++ = '-'; + } + else + *p++ = '+'; + t = expbuf + MAXEXP; + if (exp > 9) { + do { + *--t = to_char(exp % 10); + } while ((exp /= 10) > 9); + *--t = to_char(exp); + for (; t < expbuf + MAXEXP; *p++ = *t++); + } + else { + *p++ = '0'; + *p++ = to_char(exp); + } + return (p); +} // exponent() + + +static int +cvt(double number, int prec, int flags, char *signp, int fmtch, char *startp, + char *endp) +{ + char *p, *t; + double fract; + int dotrim, expcnt, gformat; + double integer, tmp; + Cyg_libm_ieee_double_shape_type ieeefp; + + dotrim = expcnt = gformat = 0; + ieeefp.value = number; + if ( ieeefp.number.sign ){ // this checks for <0.0 and -0.0 + number = -number; + *signp = '-'; + } else + *signp = 0; + + fract = modf(number, &integer); + + /* get an extra slot for rounding. */ + t = ++startp; + + /* + * get integer portion of number; put into the end of the buffer; the + * .01 is added for modf(356.0 / 10, &integer) returning .59999999... + */ + for (p = endp - 1; integer; ++expcnt) { + tmp = modf(integer / 10, &integer); + *p-- = to_char((int)((tmp + .01) * 10)); + } + switch (fmtch) { + case 'f': + /* reverse integer into beginning of buffer */ + if (expcnt) + for (; ++p < endp; *t++ = *p); + else + *t++ = '0'; + /* + * if precision required or alternate flag set, add in a + * decimal point. + */ + if (prec || flags&ALT) + *t++ = '.'; + /* if requires more precision and some fraction left */ + if (fract) { + if (prec) + do { + fract = modf(fract * 10, &tmp); + *t++ = to_char((int)tmp); + } while (--prec && fract); + if (fract) + startp = round(fract, (int *)NULL, startp, + t - 1, (char)0, signp); + } + for (; prec--; *t++ = '0'); + break; + case 'e': + case 'E': +eformat: if (expcnt) { + *t++ = *++p; + if (prec || flags&ALT) + *t++ = '.'; + /* if requires more precision and some integer left */ + for (; prec && ++p < endp; --prec) + *t++ = *p; + /* + * if done precision and more of the integer component, + * round using it; adjust fract so we don't re-round + * later. + */ + if (!prec && ++p < endp) { + fract = 0; + startp = round((double)0, &expcnt, startp, + t - 1, *p, signp); + } + /* adjust expcnt for digit in front of decimal */ + --expcnt; + } + /* until first fractional digit, decrement exponent */ + else if (fract) { + /* adjust expcnt for digit in front of decimal */ + for (expcnt = -1;; --expcnt) { + fract = modf(fract * 10, &tmp); + if (tmp) + break; + } + *t++ = to_char((int)tmp); + if (prec || flags&ALT) + *t++ = '.'; + } + else { + *t++ = '0'; + if (prec || flags&ALT) + *t++ = '.'; + } + /* if requires more precision and some fraction left */ + if (fract) { + if (prec) + do { + fract = modf(fract * 10, &tmp); + *t++ = to_char((int)tmp); + } while (--prec && fract); + if (fract) + startp = round(fract, &expcnt, startp, + t - 1, (char)0, signp); + } + /* if requires more precision */ + for (; prec--; *t++ = '0'); + + /* unless alternate flag, trim any g/G format trailing 0's */ + if (gformat && !(flags&ALT)) { + while (t > startp && *--t == '0'); + if (*t == '.') + --t; + ++t; + } + t = exponent(t, expcnt, fmtch); + break; + case 'g': + case 'G': + /* a precision of 0 is treated as a precision of 1. */ + if (!prec) + ++prec; + /* + * ``The style used depends on the value converted; style e + * will be used only if the exponent resulting from the + * conversion is less than -4 or greater than the precision.'' + * -- ANSI X3J11 + */ + if (expcnt > prec || (!expcnt && fract && fract < .0001)) { + /* + * g/G format counts "significant digits, not digits of + * precision; for the e/E format, this just causes an + * off-by-one problem, i.e. g/G considers the digit + * before the decimal point significant and e/E doesn't + * count it as precision. + */ + --prec; + fmtch -= 2; /* G->E, g->e */ + gformat = 1; + goto eformat; + } + /* + * reverse integer into beginning of buffer, + * note, decrement precision + */ + if (expcnt) + for (; ++p < endp; *t++ = *p, --prec); + else + *t++ = '0'; + /* + * if precision required or alternate flag set, add in a + * decimal point. If no digits yet, add in leading 0. + */ + if (prec || flags&ALT) { + dotrim = 1; + *t++ = '.'; + } + else + dotrim = 0; + /* if requires more precision and some fraction left */ + if (fract) { + if (prec) { + do { + fract = modf(fract * 10, &tmp); + *t++ = to_char((int)tmp); + } while(!tmp); + while (--prec && fract) { + fract = modf(fract * 10, &tmp); + *t++ = to_char((int)tmp); + } + } + if (fract) + startp = round(fract, (int *)NULL, startp, + t - 1, (char)0, signp); + } + /* alternate format, adds 0's for precision, else trim 0's */ + if (flags&ALT) + for (; prec--; *t++ = '0'); + else if (dotrim) { + while (t > startp && *--t == '0'); + if (*t != '.') + ++t; + } + } + return (t - startp); +} // cvt() + +#endif // ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// EOF vfnprintf.cxx diff --git a/packages/language/c/libc/current/src/stdlib/_exit.cxx b/packages/language/c/libc/current/src/stdlib/_exit.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/_exit.cxx @@ -0,0 +1,107 @@ +//======================================================================== +// +// _exit.cxx +// +// _exit() as from POSIX 1003.1 section 3.2.2 "Terminate a process" +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Common tracing support +#include // Common assertion support +#include // Header for all stdlib functions + // (like this one) +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions +#ifdef CYGPKG_KERNEL +# include // eCos kernel for thread termination +# include // and +# include // for stopping the scheduler +# include +#endif + + +// SYMBOLS + +externC void +_exit( int ) CYGPRI_LIBC_WEAK_ALIAS("__libc__exit") CYGPRI_LIBC_NORETURN; + +// FUNCTIONS + +externC void +__libc__exit( int status ) +{ + CYG_REPORT_FUNCTION(); // shouldn't return, but CYG_FAIL will catch it + CYG_REPORT_FUNCARG1DV( status ); + +#ifdef CYGPKG_KERNEL + +# ifdef CYGSEM_LIBC_EXIT_STOPS_SYSTEM + + Cyg_Scheduler::lock(); // prevent rescheduling + + for (;;) + CYG_EMPTY_STATEMENT; + +# else + + Cyg_Thread::exit(); + +# endif +#endif + + // loop forever + for (;;) + CYG_EMPTY_STATEMENT; + + CYG_FAIL( "__libc__exit() returning!!!" ); + + CYG_REPORT_RETURN(); +} // _exit() + + +#endif // ifdef CYGPKG_LIBC + +// EOF _exit.cxx diff --git a/packages/language/c/libc/current/src/stdlib/abort.cxx b/packages/language/c/libc/current/src/stdlib/abort.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/abort.cxx @@ -0,0 +1,75 @@ +//=========================================================================== +// +// abort.cxx +// +// Implementation of the abort() function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support + +#include // Header for all stdlib functions + // (like this one) + +// FUNCTIONS + +externC void +abort( void ) +{ + CYG_REPORT_FUNCNAME( "abort" ); + + // loop forever + for (;;) + CYG_EMPTY_STATEMENT; + + CYG_REPORT_RETURN(); +} // abort() + + +#endif // ifdef CYGPKG_LIBC + +// EOF abort.cxx diff --git a/packages/language/c/libc/current/src/stdlib/abs.cxx b/packages/language/c/libc/current/src/stdlib/abs.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/abs.cxx @@ -0,0 +1,91 @@ +//=========================================================================== +// +// abs.cxx +// +// Real alternative for inline implementation of the ANSI standard +// abs() utility function defined in section 7.10.6.1 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support + +// We don't want the inline versions of stdlib functions defined here + +#ifdef CYGIMP_LIBC_STDLIB_INLINES +#undef CYGIMP_LIBC_STDLIB_INLINES +#endif + +#include // Main header for stdlib functions +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// EXPORTED SYMBOLS + +externC int +abs( int j ) CYGPRI_LIBC_WEAK_ALIAS("_abs"); + + +// FUNCTIONS + +int +_abs( int j ) +{ + int retval; + + CYG_REPORT_FUNCNAMETYPE( "_abs", "returning %d" ); + + retval = (j<0) ? -j : j; + + CYG_REPORT_RETVAL( retval ); + + return retval; +} // _abs() + + +#endif // ifdef CYGPKG_LIBC + +// EOF abs.cxx diff --git a/packages/language/c/libc/current/src/stdlib/atexit.cxx b/packages/language/c/libc/current/src/stdlib/atexit.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/atexit.cxx @@ -0,0 +1,134 @@ +//======================================================================== +// +// atexit.cxx +// +// Implementation of the atexit() function +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-08-31 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Common tracing support +#include // Common assertion support +#include // Header for all stdlib functions + // (like this one) +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + +// SYMBOLS + +externC int +atexit( Cyg_atexit_fn_t ) CYGPRI_LIBC_WEAK_ALIAS("_atexit"); + + +// STATICS + +// cyg_libc_atexit_handlers contains the functions to call. +// cyg_libc_atexit_handlers_count contains the number of valid handlers +// or you can consider the next free handler slot in +// cyg_libc_atexit_handlers. + +static Cyg_atexit_fn_t +cyg_libc_atexit_handlers[ CYGNUM_LIBC_ATEXIT_HANDLERS ]; + +static cyg_ucount32 cyg_libc_atexit_handlers_count; + + +// FUNCTIONS + +externC void +cyg_libc_invoke_atexit_handlers( void ) +{ + CYG_REPORT_FUNCNAMETYPE( "cyg_libc_invoke_atexit_handlers", + "returning" ); + CYG_REPORT_FUNCARGVOID(); + + cyg_ucount32 i; + + for (i=cyg_libc_atexit_handlers_count; i>0; --i) { + + CYG_TRACE1( true, + "Calling function registered with atexit at addr %08x", + cyg_libc_atexit_handlers[i-1] ); + CYG_CHECK_FUNC_PTR( cyg_libc_atexit_handlers[i-1], + "Function to call in atexit handler list " + "isn't valid! Even though it was when " + "entered!" ); + + (*cyg_libc_atexit_handlers[i-1])(); + + } // for + + CYG_REPORT_RETURN(); +} // cyg_libc_invoke_atexit_handlers() + + +externC int +_atexit( Cyg_atexit_fn_t func_to_register ) +{ + CYG_REPORT_FUNCNAMETYPE( "_atexit", "returning %d" ); + CYG_REPORT_FUNCARG1XV( func_to_register ); + + CYG_CHECK_FUNC_PTR( func_to_register, + "_atexit() not passed a valid function argument!" ); + + // have we any slots left? + if (cyg_libc_atexit_handlers_count >= + sizeof(cyg_libc_atexit_handlers)/sizeof(Cyg_atexit_fn_t) ) { + + CYG_REPORT_RETVAL( 1 ); + return 1; // failure + } // if + + cyg_libc_atexit_handlers[cyg_libc_atexit_handlers_count++] = + func_to_register; + + CYG_REPORT_RETVAL(0); + return 0; +} // _atexit() + + +#endif // ifdef CYGPKG_LIBC + +// EOF atexit.cxx diff --git a/packages/language/c/libc/current/src/stdlib/atof.cxx b/packages/language/c/libc/current/src/stdlib/atof.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/atof.cxx @@ -0,0 +1,95 @@ +//=========================================================================== +// +// atof.cxx +// +// Real alternative for inline implementation of the ANSI standard +// atof() utility function defined in section 7.10.1.1 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And strtod() which we use? +#if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtod) + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support + +// We don't want the inline versions of stdlib functions defined here + +#ifdef CYGIMP_LIBC_STDLIB_INLINES +#undef CYGIMP_LIBC_STDLIB_INLINES +#endif + +#include // NULL, wchar_t and size_t from compiler +#include // Main header for stdlib functions +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// EXPORTED SYMBOLS + +externC double +atof( const char * ) CYGPRI_LIBC_WEAK_ALIAS("_atof"); + + +// FUNCTIONS + +double +_atof( const char *nptr ) +{ + double retval; + + CYG_REPORT_FUNCNAMETYPE( "_atof", "returning %f" ); + + CYG_CHECK_DATA_PTR( nptr, "nptr is an invalid pointer!" ); + + retval = _strtod( nptr, (char **)NULL ); + + CYG_REPORT_RETVAL( retval ); + + return retval; +} // _atof() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtod) + +// EOF atof.cxx diff --git a/packages/language/c/libc/current/src/stdlib/atoi.cxx b/packages/language/c/libc/current/src/stdlib/atoi.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/atoi.cxx @@ -0,0 +1,95 @@ +//=========================================================================== +// +// atoi.cxx +// +// Real alternative for inline implementation of the ANSI standard +// atoi() utility function defined in section 7.10.1.2 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support + +// We don't want the inline versions of stdlib functions defined here + +#ifdef CYGIMP_LIBC_STDLIB_INLINES +#undef CYGIMP_LIBC_STDLIB_INLINES +#endif + +#include // NULL, wchar_t and size_t from compiler +#include // Main header for stdlib functions +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// EXPORTED SYMBOLS + +externC int +atoi( const char *nptr ) CYGPRI_LIBC_WEAK_ALIAS("_atoi"); + + +// FUNCTIONS + +int +_atoi( const char *nptr ) +{ + int retval; + + CYG_REPORT_FUNCNAMETYPE( "_atoi", "returning %d" ); + + CYG_CHECK_DATA_PTR( nptr, "nptr is an invalid pointer!" ); + + retval = (int)_strtol( nptr, (char **)NULL, 10 ); + + CYG_REPORT_RETVAL( retval ); + + return retval; +} // _atoi() + + +#endif // ifdef CYGPKG_LIBC + +// EOF atoi.cxx diff --git a/packages/language/c/libc/current/src/stdlib/atol.cxx b/packages/language/c/libc/current/src/stdlib/atol.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/atol.cxx @@ -0,0 +1,95 @@ +//=========================================================================== +// +// atol.cxx +// +// Real alternative for inline implementation of the ANSI standard +// atol() utility function defined in section 7.10.1.3 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support + +// We don't want the inline versions of stdlib functions defined here + +#ifdef CYGIMP_LIBC_STDLIB_INLINES +#undef CYGIMP_LIBC_STDLIB_INLINES +#endif + +#include // NULL, wchar_t and size_t from compiler +#include // Main header for stdlib functions +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// EXPORTED SYMBOLS + +externC long +atol( const char *nptr ) CYGPRI_LIBC_WEAK_ALIAS("_atol"); + + +// FUNCTIONS + +long +_atol( const char *nptr ) +{ + long retval; + + CYG_REPORT_FUNCNAMETYPE( "_atol", "returning %d" ); + + CYG_CHECK_DATA_PTR( nptr, "nptr is an invalid pointer!" ); + + retval = _strtol( nptr, (char **)NULL, 10 ); + + CYG_REPORT_RETVAL( retval ); + + return retval; +} // _atol() + + +#endif // ifdef CYGPKG_LIBC + +// EOF atol.cxx diff --git a/packages/language/c/libc/current/src/stdlib/bsearch.cxx b/packages/language/c/libc/current/src/stdlib/bsearch.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/bsearch.cxx @@ -0,0 +1,133 @@ +//=========================================================================== +// +// bsearch.cxx +// +// ANSI standard binary search function defined in section 7.10.5.1 +// of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support +#include // Header for all stdlib functions + // (like this one) +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + +// TRACING + +# if defined(CYGDBG_USE_TRACING) && \ + defined(CYGNUM_LIBC_BSEARCH_TRACE_LEVEL) +static int bsearch_trace = CYGNUM_LIBC_BSEARCH_TRACE_LEVEL; +# define TL1 (0 < bsearch_trace) +# else +# define TL1 (0) +# endif + + +// EXPORTED SYMBOLS + +externC void * +bsearch( const void *key, const void *base, size_t nmemb, size_t size, + Cyg_comparison_fn_t compar ) CYGPRI_LIBC_WEAK_ALIAS("_bsearch"); + +// FUNCTIONS + +externC void * +_bsearch( const void *key, const void *base, size_t nmemb, size_t size, + Cyg_comparison_fn_t compar ) +{ + CYG_REPORT_FUNCNAMETYPE( "_bsearch", "returning %08x" ); + + CYG_REPORT_FUNCARG5( "key=%08x, base=%08x, nmemb=%d, size=%d, " + "compar=%08x", key, base, nmemb, size, compar ); + + CYG_CHECK_DATA_PTR( key, "key is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( base, "base is not a valid pointer!" ); + CYG_CHECK_FUNC_PTR( compar, "compar is not a valid function pointer!" ); + + CYG_ADDRESS current; + size_t lower = 0; + size_t upper = nmemb; + size_t index; + int result; + + if (nmemb == 0 || size == 0) + { + CYG_TRACE2( TL1, "Warning! either nmemb (%d) or size (%d) is 0", + nmemb, size ); + CYG_REPORT_RETVAL( NULL ); + return NULL; + } // if + + while (lower < upper) + { + index = (lower + upper) / 2; + current = (CYG_ADDRESS) (((char *) base) + (index * size)); + + CYG_TRACE2( TL1, "About to call comparison function with " + "key=%08x, current=%08x", key, current ); + result = compar (key, (void *) current); + CYG_TRACE1( TL1, "Comparison function returned %d", result ); + + if (result < 0) + upper = index; + else if (result > 0) + lower = index + 1; + else + { + CYG_REPORT_RETVAL( current ); + return (void *)current; + } // else + } // while + + CYG_REPORT_RETVAL( NULL ); + return NULL; +} // _bsearch() + +#endif // ifdef CYGPKG_LIBC + +// EOF bsearch.cxx diff --git a/packages/language/c/libc/current/src/stdlib/div.cxx b/packages/language/c/libc/current/src/stdlib/div.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/div.cxx @@ -0,0 +1,160 @@ +//=========================================================================== +// +// div.cxx +// +// Real alternative for inline implementation of the ANSI standard +// div() utility function defined in section 7.10.6.2 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== +// +// This code is based on code with the following copyright: +// +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support + +// We don't want the inline versions of stdlib functions defined here + +#ifdef CYGIMP_LIBC_STDLIB_INLINES +#undef CYGIMP_LIBC_STDLIB_INLINES +#endif + +#include // NULL, wchar_t and size_t from compiler +#include // Main header for stdlib functions +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// EXPORTED SYMBOLS + +externC div_t +div( int numer, int denom ) CYGPRI_LIBC_WEAK_ALIAS("_div"); + + +// FUNCTIONS + +div_t +_div( int numer, int denom ) +{ + div_t result; + + CYG_REPORT_FUNCNAMETYPE( "_div", "quotient: %d"); + CYG_REPORT_FUNCARG2DV( numer, denom ); + + // The ANSI standard says that |r.quot| <= |n/d|, where + // n/d is to be computed in infinite precision. In other + // words, we should always truncate the quotient towards + // 0, never -infinity. + // + // Machine division and remainer may work either way when + // one or both of n or d is negative. If only one is + // negative and r.quot has been truncated towards -inf, + // r.rem will have the same sign as denom and the opposite + // sign of num; if both are negative and r.quot has been + // truncated towards -inf, r.rem will be positive (will + // have the opposite sign of num). These are considered + // `wrong'. + // + // If both are num and denom are positive, r will always + // be positive. + // + // This all boils down to: + // if num >= 0, but r.rem < 0, we got the wrong answer. + // In that case, to get the right answer, add 1 to r.quot and + // subtract denom from r.rem. + + result.quot = numer / denom; + result.rem = numer % denom; + + if ( (numer >= 0) && (result.rem < 0) ) + { + result.quot++; + result.rem -= denom; + } // if + + CYG_REPORT_RETVAL( result.quot ); + + return result; +} // _div() + +#endif // ifdef CYGPKG_LIBC + +// EOF div.cxx diff --git a/packages/language/c/libc/current/src/stdlib/exit.cxx b/packages/language/c/libc/current/src/stdlib/exit.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/exit.cxx @@ -0,0 +1,106 @@ +//========================================================================= +// +// exit.cxx +// +// Implementation of the exit() function +// +//========================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//========================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-08-31 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//========================================================================= + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Common tracing support +#include // Common assertion support +#include // fflush() +#include // errno +#include // Header for all stdlib functions + // (like this one) +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + +// SYMBOLS + +externC void +exit( int ) CYGPRI_LIBC_WEAK_ALIAS("__libc_exit") CYGPRI_LIBC_NORETURN; + +// FUNCTIONS + +externC void +__libc_exit( int status ) +{ + CYG_REPORT_FUNCTION(); // shouldn't return, but CYG_FAIL will catch it + CYG_REPORT_FUNCARG1DV( status ); + + // Strictly the only thing exit() does is invoke the atexit handlers + // and flush stdio buffers. Anything else is for _exit() (aka + // __libc__exit() within the implementation) + + // we start with the atexit handlers + cyg_libc_invoke_atexit_handlers(); + +// we only need to flush stdio if we have buffered I/O. +#if defined(CYGPKG_LIBC_STDIO) && \ + defined(CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO) + + int rc; + + CYG_TRACE0( true, "Calling fflush( NULL )" ); + rc = fflush( NULL ); + + CYG_TRACE2( rc != 0, "fflush() returned non-zero. It returned %d and " + "errno indicates the error: %s", rc, strerror(errno) ); + + +#endif + + __libc__exit( status ); + + CYG_FAIL( "__libc_exit() returning!!!" ); + + CYG_REPORT_RETURN(); +} // __libc_exit() + + +#endif // ifdef CYGPKG_LIBC + +// EOF exit.cxx diff --git a/packages/language/c/libc/current/src/stdlib/getenv.cxx b/packages/language/c/libc/current/src/stdlib/getenv.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/getenv.cxx @@ -0,0 +1,138 @@ +//======================================================================== +// +// getenv.cxx +// +// Implementation of the ISO C standard getenv() function +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-08-31 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_ENVIRONMENT) + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Tracing support +#include // Main header for stdlib functions +#include // strchr(), strlen() and strncmp() +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// VARIABLES + +externC char **environ; // standard definition of environ + +// EXPORTED SYMBOLS + +externC char * +getenv( const char *name ) CYGPRI_LIBC_WEAK_ALIAS("_getenv"); + + +// FUNCTIONS + +extern char * +_getenv( const char *name ) +{ + // This function assumes the POSIX 1003.1 layout of the environment + // in the environ variable, i.e. extern char **environ is a pointer + // to an array of character pointers to the environment strings + // (POSIX 3.1.2.2 and 2.6). + // + // getenv() searches the environment list for a string of the form + // "name=value" (POSIX 4.6.1). The strings must have this form + // (POSIX 2.6) + + CYG_REPORT_FUNCNAMETYPE( "_getenv", "returning %08x" ); + + CYG_PRECONDITION( name != NULL, "getenv() called with NULL string!" ); + + CYG_REPORT_FUNCARG1( "name=%s", name ); + + CYG_PRECONDITION( environ != NULL, + "environ not set i.e. environ == NULL" ); + + CYG_CHECK_DATA_PTR( environ, "environ isn't a valid pointer!" ); + + CYG_CHECK_DATA_PTR( name, "name isn't a valid pointer!" ); + + // check name doesn't contain '=' + CYG_PRECONDITION( strchr(name, '=') == NULL, + "name contains '='!" ); + + char **env_str_p; + cyg_ucount32 len = strlen( name ); + + for (env_str_p = environ; *env_str_p != NULL; ++env_str_p ) { + + CYG_CHECK_DATA_PTR( env_str_p, + "current environment string isn't valid!" ); + + CYG_CHECK_DATA_PTR( *env_str_p, + "current environment string isn't valid!" ); + + // do we have a match? + if ( !strncmp(*env_str_p, name, len) ) { + // but it could be just a prefix i.e. we could have + // matched MYNAMEFRED when we're looking for just MYNAME, so: + + if ( (*env_str_p)[len] == '=' ) { + // we got a match + CYG_REPORT_RETVAL( *env_str_p + len + 1 ); + + return (*env_str_p + len + 1); + } // if + } // if + + // check the next pointer isn't NULL, as we're about to dereference + // it + CYG_ASSERT( env_str_p+1 != NULL, + "environment contains a NULL pointer!" ); + } // for + + CYG_REPORT_RETVAL( NULL ); + return NULL; +} // getenv() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_ENVIRONMENT) + +// EOF getenv.cxx diff --git a/packages/language/c/libc/current/src/stdlib/labs.cxx b/packages/language/c/libc/current/src/stdlib/labs.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/labs.cxx @@ -0,0 +1,91 @@ +//=========================================================================== +// +// labs.cxx +// +// Real alternative for inline implementation of the ANSI standard +// labs() utility function defined in section 7.10.6.3 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support + +// We don't want the inline versions of stdlib functions defined here + +#ifdef CYGIMP_LIBC_STDLIB_INLINES +#undef CYGIMP_LIBC_STDLIB_INLINES +#endif + +#include // Main header for stdlib functions +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// EXPORTED SYMBOLS + +externC long +labs( long j ) CYGPRI_LIBC_WEAK_ALIAS("_labs"); + + +// FUNCTIONS + +long +_labs( long j ) +{ + long retval; + + CYG_REPORT_FUNCNAMETYPE( "_labs", "returning %d" ); + + retval = (j<0) ? -j : j; + + CYG_REPORT_RETVAL( retval ); + + return retval; +} // _labs() + + +#endif // ifdef CYGPKG_LIBC + +// EOF labs.cxx diff --git a/packages/language/c/libc/current/src/stdlib/ldiv.cxx b/packages/language/c/libc/current/src/stdlib/ldiv.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/ldiv.cxx @@ -0,0 +1,160 @@ +//=========================================================================== +// +// ldiv.cxx +// +// Real alternative for inline implementation of the ANSI standard +// ldiv() utility function defined in section 7.10.6.4 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== +// +// This code is based on code with the following copyright: +// +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support + +// We don't want the inline versions of stdlib functions defined here + +#ifdef CYGIMP_LIBC_STDLIB_INLINES +#undef CYGIMP_LIBC_STDLIB_INLINES +#endif + +#include // NULL, wchar_t and size_t from compiler +#include // Main header for stdlib functions +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// EXPORTED SYMBOLS + +externC ldiv_t +ldiv( long numer, long denom ) CYGPRI_LIBC_WEAK_ALIAS("_ldiv"); + + +// FUNCTIONS + +ldiv_t +_ldiv( long numer, long denom ) +{ + ldiv_t result; + + CYG_REPORT_FUNCNAMETYPE( "_ldiv", "quotient: %d"); + CYG_REPORT_FUNCARG2( "numer=%d, denom=%d", numer, denom ); + + // The ANSI standard says that |r.quot| <= |n/d|, where + // n/d is to be computed in infinite precision. In other + // words, we should always truncate the quotient towards + // 0, never -infinity. + // + // Machine ldivision and remainer may work either way when + // one or both of n or d is negative. If only one is + // negative and r.quot has been truncated towards -inf, + // r.rem will have the same sign as denom and the opposite + // sign of num; if both are negative and r.quot has been + // truncated towards -inf, r.rem will be positive (will + // have the opposite sign of num). These are considered + // `wrong'. + // + // If both are num and denom are positive, r will always + // be positive. + // + // This all boils down to: + // if num >= 0, but r.rem < 0, we got the wrong answer. + // In that case, to get the right answer, add 1 to r.quot and + // subtract denom from r.rem. + + result.quot = numer / denom; + result.rem = numer % denom; + + if ( (numer >= 0) && (result.rem < 0) ) + { + result.quot++; + result.rem -= denom; + } // if + + CYG_REPORT_RETVAL( result.quot ); + + return result; +} // _ldiv() + +#endif // ifdef CYGPKG_LIBC + +// EOF ldiv.cxx diff --git a/packages/language/c/libc/current/src/stdlib/malloc.cxx b/packages/language/c/libc/current/src/stdlib/malloc.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/malloc.cxx @@ -0,0 +1,223 @@ +//======================================================================== +// +// malloc.cxx +// +// Implementation of ANSI standard allocation routines +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Implementation of ANSI standard allocation routines as per +// ANSI section 7.10.3 +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// And do we want these functions? +#ifdef CYGPKG_LIBC_MALLOC + +// INCLUDES + +#include // Common type definitions and support +#include // Common tracing support +#include // Common assertion support +#include // For memset() and memcpy() +#include // header for this file +#include // Kernel variable size block allocator + +#include "clibincl/stdlibsupp.hxx" // Additional support for stdlib stuff + // internal to the C library + +// EXPORTED SYMBOLS + +externC void * +calloc( size_t, size_t ) CYGPRI_LIBC_WEAK_ALIAS("_calloc"); + +externC void +free( void * ) CYGPRI_LIBC_WEAK_ALIAS("_free"); + +externC void * +malloc( size_t ) CYGPRI_LIBC_WEAK_ALIAS("_malloc"); + +externC void * +realloc( void *, size_t ) CYGPRI_LIBC_WEAK_ALIAS("_realloc"); + + +// STATIC VARIABLES + +// the data space for the memory pool +static cyg_uint8 pooldata[ CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE ]; + +// the memory pool object itself +static Cyg_Mempool_Variable pool CYG_INIT_PRIORITY( LIBC ) = +Cyg_Mempool_Variable( pooldata, CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE ); + + +// FUNCTIONS + +void * +_malloc( size_t size ) +{ + void *data_ptr; + + CYG_REPORT_FUNCNAMETYPE( "_malloc", "returning pointer %08x" ); + + CYG_REPORT_FUNCARG1DV( size ); + + // first check if size wanted is 0 + if (!size) { + CYG_REPORT_RETVAL( NULL ); + return NULL; + } // if + + // ask the pool for the data + data_ptr = pool.try_alloc( size ); + + // if it isn't NULL is the pointer valid? + if (data_ptr != NULL) { + CYG_CHECK_DATA_PTR( data_ptr, + "allocator returned invalid pointer!" ); + + // And just check its alignment + CYG_ASSERT( !((CYG_ADDRWORD)data_ptr & (sizeof(CYG_ADDRWORD) - 1)), + "Allocator has returned badly aligned data!"); + } // if + + CYG_REPORT_RETVAL( data_ptr ); + + return data_ptr; +} // _malloc() + + +void +_free( void *ptr ) +{ + CYG_REPORT_FUNCNAME( "_free"); + + CYG_REPORT_FUNCARG1XV( ptr ); + + // if null pointer, do nothing as per spec + if (ptr==NULL) + return; + + CYG_CHECK_DATA_PTR( ptr, "Pointer to free isn't even valid!" ); + + // get pool to free it. Use size==0 for pool to determine the size + // Also ignore return value - there's nothing we can do with it + pool.free( (cyg_uint8 *) ptr, 0 ); + + CYG_REPORT_RETURN(); + +} // _free() + + +void * +_calloc( size_t nmemb, size_t size ) +{ + void *data_ptr; + cyg_ucount32 realsize; + + CYG_REPORT_FUNCNAMETYPE( "_calloc", "returning pointer %08x" ); + + CYG_REPORT_FUNCARG2DV( nmemb, size ); + + realsize = nmemb * size; + + data_ptr = _malloc( realsize ); + + // Fill with 0's if non-NULL + if (data_ptr != NULL) + memset( data_ptr, 0, realsize ); + + CYG_REPORT_RETVAL( data_ptr ); + return data_ptr; +} // _calloc() + + +externC void * +_realloc( void *ptr, size_t size ) +{ + void *ret_ptr; + cyg_int32 oldsize; + + CYG_REPORT_FUNCNAMETYPE( "_realloc", "returning pointer %08x" ); + + CYG_REPORT_FUNCARG2( "ptr=%08x, size=%d", ptr, size ); + + // if pointer is NULL, we must malloc it + if (ptr == NULL) { + ret_ptr = _malloc( size ); + CYG_REPORT_RETVAL( ret_ptr ); + return ret_ptr; + } // if + + CYG_CHECK_DATA_PTR( ptr, "_realloc() passed a bogus pointer!" ); + + // if size is 0, we must free it + if (size == 0) { + _free(ptr); + CYG_REPORT_RETVAL( NULL ); + return NULL; + } // if + + + oldsize = pool.get_allocation_size( (cyg_uint8 *)ptr ); + + CYG_ASSERT( oldsize != -1, + "_realloc() couldn't find allocation size!" ); + + ret_ptr = _malloc( size ); + + // as long as malloc succeeded + if (ret_ptr != NULL) { + // copy old contents + memcpy( ret_ptr, ptr, size < (size_t) oldsize ? size + : (size_t) oldsize ); + + _free(ptr); + } // if + + CYG_REPORT_RETVAL( ret_ptr ); + return ret_ptr; +} // _realloc() + +#endif // ifdef CYGPKG_LIBC_MALLOC + +#endif // ifdef CYGPKG_LIBC + +// EOF malloc.cxx diff --git a/packages/language/c/libc/current/src/stdlib/qsort.cxx b/packages/language/c/libc/current/src/stdlib/qsort.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/qsort.cxx @@ -0,0 +1,290 @@ +//=========================================================================== +// +// qsort.cxx +// +// ANSI standard sorting function defined in section 7.10.5.2 +// of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== +// +// This code is based on original code with the following copyright: +// +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support +#include // Header for all stdlib functions + // (like this one) +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + +// TRACING + +# if defined(CYGDBG_USE_TRACING) && defined(CYGNUM_LIBC_QSORT_TRACE_LEVEL) +static int qsort_trace = CYGNUM_LIBC_QSORT_TRACE_LEVEL; +# define TL1 (0 < qsort_trace) +# else +# define TL1 (0) +# endif + + +// EXPORTED SYMBOLS + +externC void +qsort( void *base, size_t nmemb, size_t size, Cyg_comparison_fn_t compar ) \ + CYGPRI_LIBC_WEAK_ALIAS("_qsort"); + + +// FUNCTION PROTOTYPES + +static __inline__ char *med3(char *, char *, char *, Cyg_comparison_fn_t); +static __inline__ void swapfunc(char *, char *, int, int); + + +// MACRO FUNCTIONS + +#define min(a, b) ((a) < (b) ? (a) : (b)) + +// +// Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". +// + +#define swapcode(TYPE, parmi, parmj, n) do { \ + long i = (n) / sizeof (TYPE); \ + TYPE *pi = (TYPE *) (parmi); \ + TYPE *pj = (TYPE *) (parmj); \ + do { \ + TYPE t = *pi; \ + *pi++ = *pj; \ + *pj++ = t; \ + } while (--i > 0); \ +} while (0) + +#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ + es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; + + +#define swap(a, b) \ + if (swaptype == 0) { \ + long t = *(long *)(a); \ + *(long *)(a) = *(long *)(b); \ + *(long *)(b) = t; \ + } else \ + swapfunc(a, b, size, swaptype) + +#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) + + +// FUNCTIONS + +// Debug wrapper for comparison function +static __inline__ int +cmp_wrapper( Cyg_comparison_fn_t cmp, void *x, void *y ) +{ + int retval; + CYG_TRACE3( TL1, "Calling comparison function address %08x with args " + "( %08x, %08x )", cmp, x, y ); + retval = cmp(x, y); + + CYG_TRACE1( TL1, "Comparison function returned %d", retval ); + + return retval; +} // cmp_wrapper() + +static __inline__ void +swapfunc( char *a, char *b, int n, int swaptype) +{ + if(swaptype <= 1) + swapcode(long, a, b, n); + else + swapcode(char, a, b, n); +} // swapfunc() + + +static __inline__ char * +med3( char *a, char *b, char *c, Cyg_comparison_fn_t cmp ) +{ + return cmp_wrapper(cmp, a, b) < 0 ? + (cmp_wrapper(cmp, b, c) < 0 ? b : (cmp_wrapper(cmp, a, c) < 0 ? c : a )) + :(cmp_wrapper(cmp, b, c) > 0 ? b : (cmp_wrapper(cmp, a, c) < 0 ? a : c )); +} // med3() + + +void +_qsort( void *base, size_t nmemb, size_t size, Cyg_comparison_fn_t compar ) +{ + char *pa, *pb, *pc, *pd, *pl, *pm, *pn; + int d, r, swaptype, swap_cnt; + + CYG_REPORT_FUNCNAMETYPE( "_qsort", "returning" ); + CYG_REPORT_FUNCARG4( "base=%08x, nmemb=%d, size=%d, compar=%08x", + base, nmemb, size, compar ); + + CYG_CHECK_DATA_PTR( base, "base is not a valid pointer!" ); + CYG_CHECK_FUNC_PTR( compar, "compar is not a valid function pointer!" ); + +loop: + SWAPINIT(base, size); + swap_cnt = 0; + if (nmemb < 7) { + for (pm = (char *) base + size; + pm < (char *) base + nmemb * size; + pm += size) + for (pl = pm; pl > (char *) base && cmp_wrapper( compar, pl - size, pl) > 0; + pl -= size) + swap(pl, pl - size); + { + CYG_REPORT_RETURN(); + return; + } // for + } // if + pm = (char *) base + (nmemb / 2) * size; + if (nmemb > 7) { + pl = (char *) base; + pn = (char *) base + (nmemb - 1) * size; + if (nmemb > 40) { + d = (nmemb / 8) * size; + pl = med3(pl, pl + d, pl + 2 * d, compar); + pm = med3(pm - d, pm, pm + d, compar); + pn = med3(pn - 2 * d, pn - d, pn, compar); + } // if + pm = med3(pl, pm, pn, compar); + } // if + swap( (char *)base, pm ); + pa = pb = (char *) base + size; + + pc = pd = (char *) base + (nmemb - 1) * size; + for (;;) { + while (pb <= pc && (r = cmp_wrapper( compar, pb, base)) <= 0) { + if (r == 0) { + swap_cnt = 1; + swap(pa, pb); + pa += size; + } // if + pb += size; + } // while + while (pb <= pc && (r = cmp_wrapper( compar, pc, base)) >= 0) { + if (r == 0) { + swap_cnt = 1; + swap(pc, pd); + pd -= size; + } // if + pc -= size; + } // while + if (pb > pc) + break; + swap(pb, pc); + swap_cnt = 1; + pb += size; + pc -= size; + } // for + if (swap_cnt == 0) { // Switch to insertion sort + for (pm = (char *) base + size; + pm < (char *) base + nmemb * size; + pm += size) + for (pl = pm; pl > (char *) base && cmp_wrapper( compar, pl - size, pl) > 0; + pl -= size) + swap(pl, pl - size); + { + CYG_REPORT_RETURN(); + return; + } // for + } //if + + pn = (char *) base + nmemb * size; + r = min(pa - (char *)base, pb - pa); + vecswap((char *)base, pb - r, r); + r = min( (unsigned)(pd - pc), pn - pd - size ); + vecswap(pb, pn - r, r); + if ((unsigned)(r = pb - pa) > size) + _qsort(base, r / size, size, compar); + if ((unsigned)(r = pd - pc) > size) { + // Iterate rather than recurse to save stack space + base = pn - r; + nmemb = r / size; + goto loop; + } // if +/* qsort(pn - r, r / size, size, compar);*/ + + CYG_REPORT_RETURN(); +} // _qsort() + +#endif // ifdef CYGPKG_LIBC + +// EOF qsort.cxx diff --git a/packages/language/c/libc/current/src/stdlib/rand.cxx b/packages/language/c/libc/current/src/stdlib/rand.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/rand.cxx @@ -0,0 +1,159 @@ +//=========================================================================== +// +// rand.cxx +// +// ANSI and POSIX 1003.1 standard random number generation functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: This implements rand() and srand() of section 7.10.2.1 of +// the ANSI standard. Also rand_r() defined in section 8.3.8 +// of the POSIX 1003.1 standard +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support +#include // Header for all stdlib functions + // (like this one) +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions +#include "clibincl/clibdata.hxx" // Header for thread-specific data such + // as random seed + +// TRACE + +#if defined(CYGDBG_USE_TRACING) && defined(CYGNUM_LIBC_RAND_TRACE_LEVEL) +static int rand_trace = CYGNUM_LIBC_RAND_TRACE_LEVEL; +# define TL1 (0 < rand_trace) +#else +# define TL1 (0) +#endif + + +// EXPORTED SYMBOLS + +externC int +rand( void ) CYGPRI_LIBC_WEAK_ALIAS("_rand"); + +externC int +rand_r( unsigned int *seed ) CYGPRI_LIBC_WEAK_ALIAS("_rand_r"); + +externC void +srand( unsigned int seed ) CYGPRI_LIBC_WEAK_ALIAS("_srand"); + + +// FUNCTIONS + +int +_rand( void ) +{ + Cyg_CLibInternalData::Cyg_rand_seed_t *seed_p; + int retval; + + CYG_REPORT_FUNCNAMETYPE( "_rand", "returning %d" ); + + CYGPRI_LIBC_INTERNAL_DATA_ALLOC_CHECK_PREAMBLE; + + // get seed for this thread (if relevant ) + seed_p = CYGPRI_LIBC_INTERNAL_DATA.get_rand_seed_p(); + + CYG_TRACE2( TL1, "Retrieved seed address %08x containing %d", + seed_p, *seed_p ); + + retval = _rand_r( (unsigned int *) seed_p ); + + CYG_REPORT_RETVAL( retval ); + + return retval; + +} // _rand() + + +int +_rand_r( unsigned int *seed ) +{ + int retval; + + CYG_REPORT_FUNCNAMETYPE( "_rand_r", "returning %d" ); + + CYG_CHECK_DATA_PTR( seed, "pointer to seed invalid!" ); + + *seed = (*seed * 1103515245) + 12345; // permutate seed + + retval = (int)( *seed & RAND_MAX ); + + CYG_REPORT_RETVAL( retval ); + + return retval; + +} // _rand_r() + + +void +_srand( unsigned int seed ) +{ + Cyg_CLibInternalData::Cyg_rand_seed_t *seed_p; + + CYG_REPORT_FUNCNAMETYPE( "_srand", "returning %d" ); + + CYG_REPORT_FUNCARG1DV( (int)seed ); + + CYGPRI_LIBC_INTERNAL_DATA_ALLOC_CHECK_PREAMBLE; + + // get seed for this thread ( if relevant ) + seed_p = CYGPRI_LIBC_INTERNAL_DATA.get_rand_seed_p(); + + CYG_CHECK_DATA_PTR( seed_p, "Help! Returned address of seed is invalid!" ); + + CYG_TRACE1( TL1, "Retrieved seed address %08x", seed_p ); + + *seed_p = (Cyg_CLibInternalData::Cyg_rand_seed_t) seed; + + CYG_REPORT_RETURN(); + +} // _srand() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +// EOF rand.cxx diff --git a/packages/language/c/libc/current/src/stdlib/strtod.cxx b/packages/language/c/libc/current/src/stdlib/strtod.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/strtod.cxx @@ -0,0 +1,258 @@ +//=========================================================================== +// +// strtod.cxx +// +// ANSI String to double-precision floating point conversion +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And strtod()? +#if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtod) + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support +#include // NULL, wchar_t and size_t from compiler +#include // Main header for stdlib functions +#include // isspace() and isdigit() +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions +#include // DBL_MIN_10_EXP and DBL_MAX_10_EXP +#include // HUGE_VAL +#include // errno + +// EXPORTED SYMBOLS + +externC double +strtod( const char *, char ** ) CYGPRI_LIBC_WEAK_ALIAS("_strtod"); + +// CONSTANTS + +#define MAXE (DBL_MAX_10_EXP) +#define MINE (DBL_MIN_10_EXP) + +// flags +#define SIGN 0x01 +#define ESIGN 0x02 +#define DECP 0x04 + + +// MACROS + +#define Ise(c) ((c == 'e') || (c == 'E') || (c == 'd') || (c == 'D')) +#define Issign(c) ((c == '-') || (c == '+')) +#define Val(c) ((c - '0')) + + +// FUNCTIONS + +/* + * [atw] multiply 64 bit accumulator by 10 and add digit. + * The KA/CA way to do this should be to use + * a 64-bit integer internally and use "adjust" to + * convert it to float at the end of processing. + */ +static int +ten_mul(double *acc, int digit) +{ + /* [atw] Crude, but effective (at least on a KB)... + */ + *acc *= 10; + *acc += digit; + + return 0; /* no overflow */ +} // ten_mul() + + +/* + * compute 10**x by successive squaring. + */ + +static const double +exp10(unsigned x) +{ + static double powtab[] = {1.0, + 10.0, + 100.0, + 1000.0, + 10000.0}; + + if (x < (sizeof(powtab)/sizeof(double))) + return powtab[x]; + else if (x & 1) + return 10.0 * exp10(x-1); + else + return exp10(x/2) * exp10(x/2); +} // exp10() + + +/* + * return (*acc) scaled by 10**dexp. + */ + +static double +adjust(double *acc, int dexp, int sign) + /* *acc the 64 bit accumulator */ + /* dexp decimal exponent */ + /* sign sign flag */ +{ + double r; + + if (dexp > MAXE) + { + errno = ERANGE; + return (sign) ? -HUGE_VAL : HUGE_VAL; + } + else if (dexp < MINE) + { + errno = ERANGE; + return 0.0; + } + + r = *acc; + if (sign) + r = -r; + if (dexp==0) + return r; + + if (dexp < 0) + return r / exp10(abs(dexp)); + else + return r * exp10(dexp); +} // adjust() + + +externC double +_strtod( const char *nptr, char **endptr ) +{ + const char *start=nptr; + double accum = 0.0; + int flags = 0; + int texp = 0; + int e = 0; + int conv_done = 0; + + double retval; + + CYG_REPORT_FUNCNAMETYPE( "_strtod", "returning %f" ); + + CYG_CHECK_DATA_PTR( nptr, "nptr is an invalid pointer!" ); + + // endptr is allowed to be NULL, but if it isn't, we check it + if (endptr != NULL) + CYG_CHECK_DATA_PTR( endptr, "endptr is an invalid pointer!" ); + + while(isspace(*nptr)) nptr++; + if(*nptr == '\0') + { /* just leading spaces */ + if(endptr != NULL) *endptr = (char *)start; + return 0.0; + } + + + if(Issign(*nptr)) + { + if(*nptr == '-') flags = SIGN; + if(*++nptr == '\0') + { /* "+|-" : should be an error ? */ + if(endptr != NULL) *endptr = (char *)start; + return 0.0; + } + } + + for(; (isdigit(*nptr) || (*nptr == '.')); nptr++) + { + conv_done = 1; + if(*nptr == '.') + flags |= DECP; + else + { + if( ten_mul(&accum, Val(*nptr)) ) texp++; + if(flags & DECP) texp--; + } + } + + if(Ise(*nptr)) + { + conv_done = 1; + if(*++nptr != '\0') /* skip e|E|d|D */ + { /* ! ([nptr]xxx[.[yyy]]e) */ + + while(isspace(*nptr)) nptr++; /* Ansi allows spaces after e */ + if(*nptr != '\0') + { /* ! ([nptr]xxx[.[yyy]]e[space]) */ + + if(Issign(*nptr)) + if(*nptr++ == '-') flags |= ESIGN; + + if(*nptr != '\0') + { /* ! ([nptr]xxx[.[yyy]]e[nptr]) -- error?? */ + + for(; isdigit(*nptr); nptr++) + if (e < MAXE) /* prevent from grossly overflowing */ + e = e*10 + Val(*nptr); + + /* dont care what comes after this */ + if(flags & ESIGN) + texp -= e; + else + texp += e; + } + } + } + } + + if(endptr != NULL) + *endptr = (char *)((conv_done) ? nptr : start); + + retval = adjust(&accum, (int)texp, (int)(flags & SIGN)); + + + CYG_REPORT_RETVAL( retval ); + + return retval; +} // _strtod() + + +#endif // if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtod) + +// EOF strtod.cxx diff --git a/packages/language/c/libc/current/src/stdlib/strtol.cxx b/packages/language/c/libc/current/src/stdlib/strtol.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/strtol.cxx @@ -0,0 +1,208 @@ +//=========================================================================== +// +// strtol.cxx +// +// ANSI standard string to long int conversion function defined in +// section 7.10.1.5 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== +// +// This code is based on original code with the following copyright: +// +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support +#include // Definition of LONG_MIN and LONG_MAX +#include // Definition of many ctype functions +#include // Error code definitions +#include // Header for all stdlib functions + // (like this one) +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// EXPORTED SYMBOLS + +externC long +strtol( const char *nptr, char **endptr, int base ) \ + CYGPRI_LIBC_WEAK_ALIAS("_strtol"); + +// FUNCTIONS + +// +// Convert a string to a long integer. +// +// Ignores `locale' stuff. Assumes that the upper and lower case +// alphabets and digits are each contiguous. +// + +long +_strtol( const char *nptr, char **endptr, int base ) +{ + const char *s = nptr; + unsigned long acc; + int c; + unsigned long cutoff; + int neg = 0, any, cutlim; + + CYG_REPORT_FUNCNAMETYPE( "_strtol", "returning long %d" ); + CYG_REPORT_FUNCARG3( "nptr=%08x, endptr=%08x, base=%d", + nptr, endptr, base ); + CYG_CHECK_DATA_PTR( nptr, "nptr is not a valid pointer!" ); + + if (endptr != NULL) + CYG_CHECK_DATA_PTR( endptr, "endptr is not a valid pointer!" ); + + // + // Skip white space and pick up leading +/- sign if any. + // If base is 0, allow 0x for hex and 0 for octal, else + // assume decimal; if base is already 16, allow 0x. + // + + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else if (c == '+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + + // + // Compute the cutoff value between legal numbers and illegal + // numbers. That is the largest legal value, divided by the + // base. An input number that is greater than this value, if + // followed by a legal input character, is too big. One that + // is equal to this value may be valid or not; the limit + // between valid and invalid numbers is then based on the last + // digit. For instance, if the range for longs is + // [-2147483648..2147483647] and the input base is 10, + // cutoff will be set to 214748364 and cutlim to either + // 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated + // a value > 214748364, or equal but the next digit is > 7 (or 8), + // the number is too big, and we will return a range error. + // + // Set any if any `digits' consumed; make it negative to indicate + // overflow. + // + + cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; + cutlim = cutoff % (unsigned long)base; + cutoff /= (unsigned long)base; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? LONG_MIN : LONG_MAX; + errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *) (any ? s - 1 : nptr); + + CYG_REPORT_RETVAL ( acc ); + + return acc; +} // _strtol() + +#endif // ifdef CYGPKG_LIBC + +// EOF strtol.cxx diff --git a/packages/language/c/libc/current/src/stdlib/strtoul.cxx b/packages/language/c/libc/current/src/stdlib/strtoul.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/stdlib/strtoul.cxx @@ -0,0 +1,184 @@ +//=========================================================================== +// +// strtoul.cxx +// +// ANSI standard string to long int conversion function defined in +// section 7.10.1.6 of the standard +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== +// +// This code is based on original code with the following copyright: +// +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support +#include // Definition of ULONG_MAX +#include // Definition of many ctype functions +#include // Error code definitions +#include // Header for all stdlib functions + // (like this one) +#include "clibincl/stdlibsupp.hxx" // Support for stdlib functions + + +// EXPORTED SYMBOLS + +externC unsigned long +strtoul( const char *nptr, char **endptr, int base ) \ + CYGPRI_LIBC_WEAK_ALIAS("_strtoul"); + +// FUNCTIONS + +// +// Convert a string to an unsigned long integer. +// +// Ignores `locale' stuff. Assumes that the upper and lower case +// alphabets and digits are each contiguous. +// + +unsigned long +_strtoul( const char *nptr, char **endptr, int base ) +{ + const char *s = nptr; + unsigned long acc; + int c; + unsigned long cutoff; + int neg = 0, any, cutlim; + + CYG_REPORT_FUNCNAMETYPE( "_strtoul", "returning long %d" ); + CYG_REPORT_FUNCARG3( "nptr=%08x, endptr=%08x, base=%d", + nptr, endptr, base ); + CYG_CHECK_DATA_PTR( nptr, "nptr is not a valid pointer!" ); + + if (endptr != NULL) + CYG_CHECK_DATA_PTR( endptr, "endptr is not a valid pointer!" ); + // + // See strtol for comments as to the logic used. + // + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else if (c == '+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; + cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULONG_MAX; + errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *) (any ? s - 1 : nptr); + + CYG_REPORT_RETVAL( acc ); + + return acc; +} // _strtoul() + +#endif // ifdef CYGPKG_LIBC + +// EOF strtoul.cxx diff --git a/packages/language/c/libc/current/src/string/memchr.cxx b/packages/language/c/libc/current/src/string/memchr.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/memchr.cxx @@ -0,0 +1,168 @@ +//=========================================================================== +// +// memchr.cxx +// +// ANSI standard memchr() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC void * +memchr( const void *s, int c, size_t n ) CYGPRI_LIBC_WEAK_ALIAS("_memchr"); + +// FUNCTIONS + +void * +_memchr( const void *s, int c, size_t n ) +{ + CYG_REPORT_FUNCNAMETYPE( "_memchr", "returning addr %08x" ); + CYG_REPORT_FUNCARG3( "s=%08x, c=%d, n=%d", s, c, n ); + + CYG_CHECK_DATA_PTR( s, "s is not a valid pointer!" ); + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + const unsigned char *src = (const unsigned char *) s; + + while (n--) + { + if (*src == c) + { + CYG_REPORT_RETVAL( src ); + return (void *) src; + } // if + src++; + } + CYG_REPORT_RETVAL( NULL ); + return NULL; +#else + const unsigned char *src = (const unsigned char *) s; + CYG_WORD *aligned_src; + CYG_WORD buffer; + CYG_WORD mask; + cyg_ucount8 i; + + // If the size is small, or src is unaligned, then + // use the bytewise loop. We can hope this is rare. + if (CYG_LIBC_STR_OPT_TOO_SMALL (n) || CYG_LIBC_STR_UNALIGNED (src)) + { + while (n--) + { + if (*src == c) + { + CYG_REPORT_RETVAL( src ); + return (void *) src; + } // if + src++; + } + CYG_REPORT_RETVAL( NULL ); + return NULL; + } + + // The fast code reads the ASCII one word at a time and only + // performs the bytewise search on word-sized segments if they + // contain the search character, which is detected by XORing + // the word-sized segment with a word-sized block of the search + // character and then detecting for the presence of NULL in the + // result. + + aligned_src = (CYG_WORD *) src; + mask = 0; + for (i = 0; i < CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE; i++) + mask = (mask << 8) + c; + + while (n > CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE) + { + buffer = *aligned_src; + buffer ^= mask; + if (CYG_LIBC_STR_DETECTNULL (buffer)) + { + src = (unsigned char*) aligned_src; + for ( i = 0; i < CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE; i++ ) + { + if (*src == c) + { + CYG_REPORT_RETVAL( src ); + return (void *) src; + } // if + src++; + } + } + n -= CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE; + aligned_src++; + } + + // If there are fewer than CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE characters + // left, then we resort to the bytewise loop. + + src = (const unsigned char *) aligned_src; + while (n--) + { + if (*src == c) + { + CYG_REPORT_RETVAL( src ); + return (void *) src; + } // if + src++; + } + + CYG_REPORT_RETVAL( NULL ); + return NULL; +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _memchr() + +#endif // ifdef CYGPKG_LIBC + +// EOF memchr.cxx diff --git a/packages/language/c/libc/current/src/string/memcmp.cxx b/packages/language/c/libc/current/src/string/memcmp.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/memcmp.cxx @@ -0,0 +1,179 @@ +//=========================================================================== +// +// memcmp.cxx +// +// ANSI standard memcmp() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + + +// EXPORTED SYMBOLS + +externC int +memcmp( const void *s1, const void *s2, size_t n ) \ + CYGPRI_LIBC_WEAK_ALIAS("_memcmp"); + +// FUNCTIONS + +int +_memcmp( const void *s1, const void *s2, size_t n ) +{ + int retval; + + CYG_REPORT_FUNCNAMETYPE( "_memcmp", "returning %d" ); + CYG_REPORT_FUNCARG3( "s1=%08x, s2=%08x, n=%d", s1, s2, n ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + const unsigned char *m1 = (const unsigned char *) s1; + const unsigned char *m2 = (const unsigned char *) s2; + + while (n--) + { + if (*m1 != *m2) + { + retval = *m1 - *m2; + CYG_REPORT_RETVAL( retval ); + return retval; + } + m1++; + m2++; + } + CYG_REPORT_RETVAL( 0 ); + return 0; +#else + const unsigned char *m1 = (const unsigned char *) s1; + const unsigned char *m2 = (const unsigned char *) s2; + const CYG_WORD *aligned_m1; + const CYG_WORD *aligned_m2; + + // If the size is too small, or either pointer is unaligned, + // then we punt to the byte compare loop. Hopefully this will + // not turn up in inner loops. + if (CYG_LIBC_STR_OPT_TOO_SMALL(n) || CYG_LIBC_STR_UNALIGNED2(m1,m2)) + { + while (n--) + { + if (*m1 != *m2) + { + retval = *m1 - *m2; + CYG_REPORT_RETVAL( retval ); + return retval; + } + m1++; + m2++; + } + CYG_REPORT_RETVAL( 0 ); + return 0; + } + + // Otherwise, load and compare the blocks of memory one + // word at a time. + aligned_m1 = (const CYG_WORD *) m1; + aligned_m2 = (const CYG_WORD *) m2; + while (n > CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE) + { + if (*aligned_m1 != *aligned_m2) + { + // This block of characters has a mismatch, somewhere. + // xoring them together and then testing for null would + // be fastest, but this is clearer code. + m1 = (const unsigned char *)aligned_m1; + m2 = (const unsigned char *)aligned_m2; + while (n--) + { + if (*m1 != *m2) + { + retval = *m1 - *m2; + CYG_REPORT_RETVAL( retval ); + return retval; + } + m1++; + m2++; + } + // NOT REACHED + } + aligned_m1++; + aligned_m2++; + n -= CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE; + } + + // checking the last few characters + + m1 = (const unsigned char *)aligned_m1; + m2 = (const unsigned char *)aligned_m2; + + while (n--) + { + if (*m1 != *m2) + { + retval = *m1 - *m2; + CYG_REPORT_RETVAL( retval ); + return retval; + } + m1++; + m2++; + } + + CYG_REPORT_RETVAL( 0 ); + return 0; +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _memcmp() + +#endif // CYGPKG_LIBC + +// EOF memcmp.cxx diff --git a/packages/language/c/libc/current/src/string/memmove.cxx b/packages/language/c/libc/current/src/string/memmove.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/memmove.cxx @@ -0,0 +1,105 @@ +//=========================================================================== +// +// memmove.cxx +// +// ANSI standard memmove() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC void * +memmove( void *s1, const void *s2, size_t n ) \ + CYGPRI_LIBC_WEAK_ALIAS("_memmove"); + +// FUNCTIONS + +void * +_memmove( void *s1, const void *s2, size_t n ) +{ + char *dst = (char *)s1; + const char *src = (const char *)s2; + + CYG_REPORT_FUNCNAMETYPE( "_memmove", "returning %08x" ); + CYG_REPORT_FUNCARG3( "s1=%08x, s2=%08x, n=%d", s1, s2, n ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + if ((src < dst) && (dst < (src + n))) + { + // Have to copy backwards + src += n; + dst += n; + while (n--) + { + *--dst = *--src; + } + } + else + { + while (n--) + { + *dst++ = *src++; + } + } + + CYG_REPORT_RETVAL( s1 ); + + return s1; +} // _memmove() + +#endif // ifdef CYGPKG_LIBC + +// EOF memmove.cxx diff --git a/packages/language/c/libc/current/src/string/strcat.cxx b/packages/language/c/libc/current/src/string/strcat.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strcat.cxx @@ -0,0 +1,123 @@ +//=========================================================================== +// +// strcat.cxx +// +// ANSI standard strcat() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC char * +strcat( char *s1, const char *s2 ) CYGPRI_LIBC_WEAK_ALIAS("_strcat"); + +// FUNCTIONS + +char * +_strcat( char *s1, const char *s2 ) +{ + CYG_REPORT_FUNCNAMETYPE( "_strcat", "returning %08x" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%08x", s1, s2 ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + char *s = s1; + + while (*s1) + s1++; + + while ((*s1++ = *s2++)) + ; + + CYG_REPORT_RETVAL( s ); + + return s; +#else + char *s = s1; + + + // Skip over the data in s1 as quickly as possible. + if (!CYG_LIBC_STR_UNALIGNED (s1)) + { + CYG_WORD *aligned_s1 = (CYG_WORD *)s1; + while (!CYG_LIBC_STR_DETECTNULL (*aligned_s1)) + aligned_s1++; + + s1 = (char *)aligned_s1; + } + + while (*s1) + s1++; + + // s1 now points to the its trailing null character, we can + // just use strcpy to do the work for us now. + // + // ?!? We might want to just include strcpy here. + // Also, this will cause many more unaligned string copies because + // s1 is much less likely to be aligned. I don't know if its worth + // tweaking strcpy to handle this better. + strcpy (s1, s2); + + CYG_REPORT_RETVAL( s ); + + return s; +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _strcat() + +#endif // ifdef CYGPKG_LIBC + +// EOF strcat.cxx diff --git a/packages/language/c/libc/current/src/string/strchr.cxx b/packages/language/c/libc/current/src/string/strchr.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strchr.cxx @@ -0,0 +1,142 @@ +//=========================================================================== +// +// strchr.cxx +// +// ANSI standard strchr() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC char * +strchr( const char *s, int c ) CYGPRI_LIBC_WEAK_ALIAS("_strchr"); + +// MACROS + +// DETECTCHAR returns nonzero if X contains the byte used +// to fill MASK. +#define DETECTCHAR(X,MASK) (CYG_LIBC_STR_DETECTNULL( (X) ^ (MASK) )) + +// FUNCTIONS + +char * +_strchr( const char *s, int c ) +{ + CYG_REPORT_FUNCNAMETYPE( "_strchr", "returning %08x" ); + CYG_REPORT_FUNCARG2( "s=%08x, c=%d", s, c ); + + CYG_CHECK_DATA_PTR( s, "s is not a valid pointer!" ); + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + char charc = c; + + while (*s && *s != charc) + { + s++; + } + + if (*s != charc) + { + s = NULL; + } + + CYG_REPORT_RETVAL( s ); + + return (char *) s; +#else + char charc = c; + CYG_WORD mask; + CYG_WORD j; + CYG_WORD *aligned_addr; + + if (CYG_LIBC_STR_UNALIGNED (s)) + { + while (*s && *s != charc) + s++; + if (*s != charc) + s = NULL; + + CYG_REPORT_RETVAL( s ); + + return (char *) s; + } + + for (j = 0, mask = 0; j < sizeof(mask); j++) + mask = (mask << 8) + charc; + + aligned_addr = (CYG_WORD *)s; + while (!CYG_LIBC_STR_DETECTNULL (*aligned_addr) && + !DETECTCHAR (*aligned_addr, mask)) + aligned_addr++; + + // The block of bytes currently pointed to by aligned_addr + // contains either a null or the target char, or both. We + // catch it using the bytewise search. + + s = (char *)aligned_addr; + while (*s && *s != charc) + s++; + if (*s != charc) + s = NULL; + + CYG_REPORT_RETVAL( s ); + + return (char *)s; +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _strchr() + +#endif // ifdef CYGPKG_LIBC + +// EOF strchr.cxx diff --git a/packages/language/c/libc/current/src/string/strcmp.cxx b/packages/language/c/libc/current/src/string/strcmp.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strcmp.cxx @@ -0,0 +1,151 @@ +//=========================================================================== +// +// strcmp.cxx +// +// ANSI standard strcmp() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC int +strcmp( const char *s1, const char *s2 ) CYGPRI_LIBC_WEAK_ALIAS("_strcmp"); + +// FUNCTIONS + +int +_strcmp( const char *s1, const char *s2 ) +{ + CYG_REPORT_FUNCNAMETYPE( "_strcmp", "returning %d" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%08x", s1, s2 ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + int retval; + + CYG_UNUSED_PARAM( int, retval ); // in case tracing is off + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + while (*s1 != '\0' && *s1 == *s2) + { + s1++; + s2++; + } + + retval = (*(unsigned char *) s1) - (*(unsigned char *) s2); + + CYG_REPORT_RETVAL( retval ); + + return retval; +#else + const CYG_WORD *aligned_s1; + const CYG_WORD *aligned_s2; + + // If s1 or s2 are unaligned, then compare bytes. + if (CYG_LIBC_STR_UNALIGNED2 (s1, s2)) + { + while (*s1 != '\0' && *s1 == *s2) + { + s1++; + s2++; + } + retval = (*(unsigned char *) s1) - (*(unsigned char *) s2); + + CYG_REPORT_RETVAL( retval ); + + return retval; + } + + // If s1 and s2 are word-aligned, compare them a word at a time. + aligned_s1 = (const CYG_WORD *)s1; + aligned_s2 = (const CYG_WORD *)s2; + while (*aligned_s1 == *aligned_s2) + { + // To get here, *aligned_s1 == *aligned_s2, thus if we find a + // null in *aligned_s1, then the strings must be equal, so return + // zero. + if (CYG_LIBC_STR_DETECTNULL (*aligned_s1)) + { + CYG_REPORT_RETVAL( 0 ); + return 0; + } // if + + aligned_s1++; + aligned_s2++; + } + + // A difference was detected in last few bytes of s1, so search bytewise + s1 = (const char *)aligned_s1; + s2 = (const char *)aligned_s2; + + while (*s1 != '\0' && *s1 == *s2) + { + s1++; + s2++; + } + + retval = (*(unsigned char *) s1) - (*(unsigned char *) s2); + + CYG_REPORT_RETVAL( retval ); + + return retval; + +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _strcmp() + +#endif // ifdef CYGPKG_LIBC + +// EOF strcmp.cxx diff --git a/packages/language/c/libc/current/src/string/strcoll.cxx b/packages/language/c/libc/current/src/string/strcoll.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strcoll.cxx @@ -0,0 +1,91 @@ +//=========================================================================== +// +// strcoll.cxx +// +// Real function definition for ANSI string strcoll() function - not +// that there is an inline alternative +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +// We don't want the inline versions of string functions defined here + +#ifdef CYGIMP_LIBC_STRING_INLINES +#undef CYGIMP_LIBC_STRING_INLINES +#endif + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC int +strcoll( const char *s1, const char *s2 ) CYGPRI_LIBC_WEAK_ALIAS("_strcoll"); + + +int +_strcoll( const char *s1, const char *s2 ) +{ + int retval; + + CYG_REPORT_FUNCNAMETYPE( "_strcoll", "returning %d" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%d", s1, s2 ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + retval = _strcmp(s1, s2); + + return retval; +} // _strcoll() + + +#endif // ifdef CYGPKG_LIBC + +// EOF strcoll.cxx diff --git a/packages/language/c/libc/current/src/string/strcpy.cxx b/packages/language/c/libc/current/src/string/strcpy.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strcpy.cxx @@ -0,0 +1,127 @@ +//=========================================================================== +// +// strcpy.cxx +// +// ANSI standard strcpy() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC char * +strcpy( char *s1, const char *s2 ) CYGPRI_LIBC_WEAK_ALIAS("_strcpy"); + +// FUNCTIONS + +char * +_strcpy( char *s1, const char *s2 ) +{ + CYG_REPORT_FUNCNAMETYPE( "_strcpy", "returning addr %08x" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%08x", s1, s2 ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + char *s = s1; + + while ((*s1++ = *s2++) != '\0') + ; + + CYG_REPORT_RETVAL( s ); + + return s; +#else + char *dst = s1; + const char *src = s2; + CYG_WORD *aligned_dst; + const CYG_WORD *aligned_src; + + // If SRC or DEST is unaligned, then copy bytes. + if (CYG_LIBC_STR_UNALIGNED2 (src, dst)) + { + while ((*dst++ = *src++) != '\0') + ; + + CYG_REPORT_RETVAL( s1 ); + + return s1; + } + + aligned_dst = (CYG_WORD *)dst; + aligned_src = (const CYG_WORD *)src; + + // SRC and DEST are both "CYG_WORD" aligned, try to do "CYG_WORD" + // sized copies. + while (!CYG_LIBC_STR_DETECTNULL(*aligned_src)) + { + *aligned_dst++ = *aligned_src++; + } + + dst = (char*)aligned_dst; + src = (char*)aligned_src; + + while ((*dst++ = *src++) != '\0') + ; + + CYG_REPORT_RETVAL( s1 ); + + return s1; +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _strcpy() + +#endif // ifdef CYGPKG_LIBC + +// EOF strcpy.cxx diff --git a/packages/language/c/libc/current/src/string/strcspn.cxx b/packages/language/c/libc/current/src/string/strcspn.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strcspn.cxx @@ -0,0 +1,101 @@ +//=========================================================================== +// +// strcspn.cxx +// +// ANSI standard strcspn() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC size_t +strcspn( const char *s1, const char *s2 ) CYGPRI_LIBC_WEAK_ALIAS("_strcspn"); + +// FUNCTIONS + +size_t +_strcspn( const char *s1, const char *s2 ) +{ + const char *s = s1; + const char *c; + size_t retval; + + CYG_REPORT_FUNCNAMETYPE( "_strcspn", "returning size %d" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%08x", s1, s2 ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + while (*s1) + { + for (c = s2; *c; c++) + { + if (*s1 == *c) + break; + } + if (*c) + break; + s1++; + } + + retval = s1 - s; + + CYG_REPORT_RETVAL( retval ); + + return retval; +} // _strcspn() + +#endif // ifdef CYGPKG_LIBC + +// EOF strcspn.cxx diff --git a/packages/language/c/libc/current/src/string/strlen.cxx b/packages/language/c/libc/current/src/string/strlen.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strlen.cxx @@ -0,0 +1,128 @@ +//=========================================================================== +// +// strlen.cxx +// +// ANSI standard strlen() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC size_t +strlen( const char *s ) CYGPRI_LIBC_WEAK_ALIAS("_strlen"); + +// FUNCTIONS + +size_t +_strlen( const char *s ) +{ + int retval; + + CYG_REPORT_FUNCNAMETYPE( "_strlen", "returning length %d" ); + CYG_REPORT_FUNCARG1( "s=%08x", s ); + + CYG_CHECK_DATA_PTR( s, "s is not a valid pointer!" ); + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + const char *start = s; + + while (*s) + s++; + + retval = s - start; + + CYG_REPORT_RETVAL( retval ); + + return retval; + +#else + + const char *start = s; + CYG_WORD *aligned_addr; + + if (CYG_LIBC_STR_UNALIGNED (s)) + { + while (*s) + s++; + retval = s - start; + + CYG_REPORT_RETVAL( retval ); + + return retval; + } + + // If the string is word-aligned, we can check for the presence of + // a null in each word-sized block. + + aligned_addr = (CYG_WORD *)s; + while (!CYG_LIBC_STR_DETECTNULL (*aligned_addr)) + aligned_addr++; + + // Once a null is detected, we check each byte in that block for a + // precise position of the null. + s = (char*)aligned_addr; + while (*s) + s++; + retval = s - start; + + CYG_REPORT_RETVAL( retval ); + + return retval; +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _strlen() + +#endif // ifdef CYGPKG_LIBC + +// EOF strlen.cxx diff --git a/packages/language/c/libc/current/src/string/strncat.cxx b/packages/language/c/libc/current/src/string/strncat.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strncat.cxx @@ -0,0 +1,129 @@ +//=========================================================================== +// +// strncat.cxx +// +// ANSI standard strncat() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC char * +strncat( char *s1, const char *s2, size_t n ) \ + CYGPRI_LIBC_WEAK_ALIAS("_strncat"); + +// FUNCTIONS + +char * +_strncat( char *s1, const char *s2, size_t n) +{ + CYG_REPORT_FUNCNAMETYPE( "_strncat", "returning %08x" ); + CYG_REPORT_FUNCARG3( "s1=%08x, s2=%08x, n=%d", s1, s2, n ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + char *s = s1; + + while (*s1) + s1++; + while (n-- != 0 && (*s1++ = *s2++)) + { + if (n == 0) + *s1 = '\0'; + } + + CYG_REPORT_RETVAL( s ); + + return s; +#else + char *s = s1; + + // Skip over the data in s1 as quickly as possible. + if (!CYG_LIBC_STR_UNALIGNED (s1)) + { + CYG_WORD *aligned_s1 = (CYG_WORD *)s1; + while (!CYG_LIBC_STR_DETECTNULL (*aligned_s1)) + aligned_s1++; + + s1 = (char *)aligned_s1; + } + + while (*s1) + s1++; + + // s1 now points to the its trailing null character, now copy + // up to N bytes from S2 into S1 stopping if a NULL is encountered + // in S2. + // + // It is not safe to use strncpy here since it copies EXACTLY N + // characters, NULL padding if necessary. + + while (n-- != 0 && (*s1++ = *s2++)) + { + if (n == 0) + *s1 = '\0'; + } + + CYG_REPORT_RETVAL( s ); + + return s; +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _strncat() + +#endif // ifdef CYGPKG_LIBC + +// EOF strncat.cxx diff --git a/packages/language/c/libc/current/src/string/strncmp.cxx b/packages/language/c/libc/current/src/string/strncmp.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strncmp.cxx @@ -0,0 +1,173 @@ +//=========================================================================== +// +// strncmp.cxx +// +// ANSI standard strncmp() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC int +strncmp( const char *s1, const char *s2, size_t n ) \ + CYGPRI_LIBC_WEAK_ALIAS("_strncmp"); + +// FUNCTIONS + +int +_strncmp( const char *s1, const char *s2, size_t n ) +{ + int retval; + + CYG_REPORT_FUNCNAMETYPE( "_strncmp", "returning %d" ); + CYG_REPORT_FUNCARG3( "s1=%08x, s2=%08x, n=%d", s1, s2, n ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + if (n == 0) + return 0; + + while (n-- != 0 && *s1 == *s2) + { + if (n == 0 || *s1 == '\0' || *s2 == '\0') + break; + s1++; + s2++; + } + + retval = (*(unsigned char *) s1) - (*(unsigned char *) s2); + + CYG_REPORT_RETVAL( retval ); + + return retval; +#else + const CYG_WORD *aligned_s1; + const CYG_WORD *aligned_s2; + + if (n == 0) + { + CYG_REPORT_RETVAL( 0 ); + return 0; + } // if + + // If s1 or s2 are unaligned, then compare bytes. + if (CYG_LIBC_STR_UNALIGNED2 (s1, s2)) + { + while (n-- != 0 && *s1 == *s2) + { + // If we've run out of bytes or hit a null, return zero + // since we already know *s1 == *s2. + if (n == 0 || *s1 == '\0') + return 0; + s1++; + s2++; + } + retval = (*(unsigned char *) s1) - (*(unsigned char *) s2); + + CYG_REPORT_RETVAL( retval ); + + return retval; + } //if + + // If s1 and s2 are word-aligned, compare them a word at a time. + aligned_s1 = (const CYG_WORD *)s1; + aligned_s2 = (const CYG_WORD *)s2; + while (n >= sizeof(CYG_WORD) && *aligned_s1 == *aligned_s2) + { + n -= sizeof (CYG_WORD); + + // If we've run out of bytes or hit a null, return zero + // since we already know *aligned_s1 == *aligned_s2. + if (n == 0 || CYG_LIBC_STR_DETECTNULL (*aligned_s1)) + { + CYG_REPORT_RETVAL( 0 ); + return 0; + } // if + + aligned_s1++; + aligned_s2++; + } // while + + // A difference was detected in last few bytes of s1, so search bytewise + s1 = (const char *)aligned_s1; + s2 = (const char *)aligned_s2; + + while (n-- > 0 && *s1 == *s2) + { + // If we've run out of bytes or hit a null, return zero + // since we already know *s1 == *s2. + if (n == 0 || *s1 == '\0') + { + CYG_REPORT_RETVAL( 0 ); + return 0; + } // if + s1++; + s2++; + } // while + + retval = (*(unsigned char *) s1) - (*(unsigned char *) s2); + + CYG_REPORT_RETVAL( retval ); + + return retval; + +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _strncmp() + +#endif // ifdef CYGPKG_LIBC + +// EOF strncmp.cxx diff --git a/packages/language/c/libc/current/src/string/strncpy.cxx b/packages/language/c/libc/current/src/string/strncpy.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strncpy.cxx @@ -0,0 +1,152 @@ +//=========================================================================== +// +// strncpy.cxx +// +// ANSI standard strncpy() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC char * +strncpy( char *s1, const char *s2, size_t n ) \ + CYGPRI_LIBC_WEAK_ALIAS("_strncpy"); + +// FUNCTIONS + +char * +_strncpy( char *s1, const char *s2, size_t n) +{ + CYG_REPORT_FUNCNAMETYPE( "_strncpy", "returning %08x" ); + CYG_REPORT_FUNCARG3( "s1=%08x, s2=%08x, n=%d", s1, s2, n ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + +#if defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || defined(__OPTIMIZE_SIZE__) + char *dscan; + const char *sscan; + + dscan = s1; + sscan = s2; + while (n > 0) + { + --n; + if ((*dscan++ = *sscan++) == '\0') + break; + } + while (n-- > 0) + *dscan++ = '\0'; + + CYG_REPORT_RETVAL( s1 ); + + return s1; +#else + char *dst = s1; + const char *src = s2; + CYG_WORD *aligned_dst; + const CYG_WORD *aligned_src; + + // If SRC or DEST is unaligned, then copy bytes. + if (CYG_LIBC_STR_OPT_TOO_SMALL (n) || CYG_LIBC_STR_UNALIGNED2 (src, dst)) + { + while (n > 0) + { + --n; + if ((*dst++ = *src++) == '\0') + break; + } + + while (n -- > 0) + *dst++ = '\0'; + + CYG_REPORT_RETVAL( s1 ); + + return s1; + } + + aligned_dst = (CYG_WORD *)dst; + aligned_src = (const CYG_WORD *)src; + + // SRC and DEST are both "CYG_WORD" aligned, try to do "CYG_WORD" + // sized copies. + while (n >= sizeof (CYG_WORD) && !CYG_LIBC_STR_DETECTNULL(*aligned_src)) + { + n -= sizeof (CYG_WORD); + *aligned_dst++ = *aligned_src++; + } + + dst = (char *)aligned_dst; + src = (const char *)aligned_src; + + while (n > 0) + { + --n; + if ((*dst++ = *src++) == '\0') + break; + } + + while (n-- > 0) + *dst++ = '\0'; + + CYG_REPORT_RETVAL( s1 ); + + return s1; +#endif // not defined(CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST) || + // defined(__OPTIMIZE_SIZE__) +} // _strncpy() + +#endif // ifdef CYGPKG_LIBC + +// EOF strncpy.cxx diff --git a/packages/language/c/libc/current/src/string/strpbrk.cxx b/packages/language/c/libc/current/src/string/strpbrk.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strpbrk.cxx @@ -0,0 +1,106 @@ +//=========================================================================== +// +// strpbrk.cxx +// +// ANSI standard strpbrk() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC char * +strpbrk( const char *s1, const char *s2 ) CYGPRI_LIBC_WEAK_ALIAS("_strpbrk"); + +// FUNCTIONS + +char * +_strpbrk( const char *s1, const char *s2 ) +{ + const char *c; + + CYG_REPORT_FUNCNAMETYPE( "_strpbrk", "returning %08x" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%08x", s1, s2 ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + if (!*s1) + { + CYG_REPORT_RETVAL( NULL ); + return (char *) NULL; + } // if + + while (*s1) + { + for (c = s2; *c; c++) + { + if (*s1 == *c) + break; + } + if (*c) + break; + s1++; + } + + if (*c == '\0') + s1 = NULL; + + CYG_REPORT_RETVAL( s1 ); + + return (char *) s1; +} // _strpbrk() + +#endif // ifdef CYGPKG_LIBC + +// EOF strpbrk.cxx diff --git a/packages/language/c/libc/current/src/string/strrchr.cxx b/packages/language/c/libc/current/src/string/strrchr.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strrchr.cxx @@ -0,0 +1,99 @@ +//=========================================================================== +// +// strrchr.cxx +// +// ANSI standard strrchr() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC char * +strrchr( const char *s, int c ) CYGPRI_LIBC_WEAK_ALIAS("_strrchr"); + +// FUNCTIONS + +char * +_strrchr( const char *s, int c ) +{ + const char *last = NULL; + const char charc = c; + + CYG_REPORT_FUNCNAMETYPE( "_strrchr", "returning %08x" ); + CYG_REPORT_FUNCARG2( "s=%08x, c=%d", s, c ); + + CYG_CHECK_DATA_PTR( s, "s is not a valid pointer!" ); + + while (*s) + { + if (*s == charc) + { + last = s; + } + s++; + } + + if (*s == charc) + { + last = s; + } + + CYG_REPORT_RETVAL( last ); + + return (char *) last; +} // _strrchr() + +#endif // ifdef CYGPKG_LIBC + +// EOF strrchr.cxx diff --git a/packages/language/c/libc/current/src/string/strspn.cxx b/packages/language/c/libc/current/src/string/strspn.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strspn.cxx @@ -0,0 +1,101 @@ +//=========================================================================== +// +// strspn.cxx +// +// ANSI standard strspn() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC size_t +strspn( const char *s1, const char *s2 ) CYGPRI_LIBC_WEAK_ALIAS("_strspn"); + +// FUNCTIONS + +size_t +_strspn( const char *s1, const char *s2 ) +{ + const char *s = s1; + const char *c; + size_t retval; + + CYG_REPORT_FUNCNAMETYPE( "_strspn", "returning size %d" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%08x", s1, s2 ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + while (*s1) + { + for (c = s2; *c; c++) + { + if (*s1 == *c) + break; + } + if (*c == '\0') + break; + s1++; + } + + retval = s1 - s; + + CYG_REPORT_RETVAL( retval ); + + return retval; +} // _strspn() + +#endif // ifdef CYGPKG_LIBC + +// EOF strspn.cxx diff --git a/packages/language/c/libc/current/src/string/strstr.cxx b/packages/language/c/libc/current/src/string/strstr.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strstr.cxx @@ -0,0 +1,117 @@ +//=========================================================================== +// +// strstr.cxx +// +// ANSI standard strstr() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC char * +strstr( const char *s1, const char *s2 ) CYGPRI_LIBC_WEAK_ALIAS("_strstr"); + +// FUNCTIONS + +char * +_strstr( const char *s1, const char *s2 ) +{ + CYG_REPORT_FUNCNAMETYPE( "_strstr", "returning %08x" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%08x", s1, s2 ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + if (*s1 == '\0') + { + if (*s2) + { + CYG_REPORT_RETVAL( NULL ); + return (char *) NULL; + } // if + else + { + CYG_REPORT_RETVAL( s1 ); + return (char *) s1; + } // else + } // if + + while (*s1) + { + cyg_ucount32 i; + + for (i=0 ; ; i++) + { + if (s2[i] == '\0') + { + CYG_REPORT_RETVAL( s1 ); + return (char *) s1; + } // if + + if (s2[i] != s1[i]) + { + break; + } // if + } // for + s1++; + } // while + + CYG_REPORT_RETVAL( NULL ); + + return (char *) NULL; +} // _strstr() + +#endif // ifdef CYGPKG_LIBC + +// EOF strstr.cxx diff --git a/packages/language/c/libc/current/src/string/strsuppt.cxx b/packages/language/c/libc/current/src/string/strsuppt.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strsuppt.cxx @@ -0,0 +1,64 @@ +//=========================================================================== +// +// strsuppt.cxx +// +// Support for the ANSI standard string functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include "clibincl/stringsupp.hxx" // Header for this file + +// CONSTANTS + +// Masks for CYG_LIBC_DETECTNULL macro so they are only defined once in +// the library +const cyg_uint64 Cyg_libc_str_null_mask_1 = 0x0101010101010101LL; +const cyg_uint64 Cyg_libc_str_null_mask_2 = 0x8080808080808080LL; + +#endif // ifdef CYGPKG_LIBC + +// EOF strsuppt.cxx diff --git a/packages/language/c/libc/current/src/string/strtok.cxx b/packages/language/c/libc/current/src/string/strtok.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strtok.cxx @@ -0,0 +1,211 @@ +//=========================================================================== +// +// strtok.cxx +// +// ANSI standard strtok() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== +// +// This code is based on original code with the following copyright: +// +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? And do we want strtok() at all? +#if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtok) + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes +#include "clibincl/clibdata.hxx" // C library internal data + +// EXPORTED SYMBOLS + +externC char * +strtok( char *s1, const char *s2 ) CYGPRI_LIBC_WEAK_ALIAS("_strtok"); + +externC char * +strtok_r( char *s1, const char *s2, char **lasts ) \ + CYGPRI_LIBC_WEAK_ALIAS("_strtok_r"); + +// TRACE + +#if defined(CYGDBG_USE_TRACING) && defined(CYGNUM_LIBC_STRTOK_TRACE_LEVEL) +static int strtok_trace = CYGNUM_LIBC_STRTOK_TRACE_LEVEL; +# define TL1 (0 < strtok_trace) +#else +# define TL1 (0) +#endif + + +// FUNCTIONS + +char * +_strtok( char *s1, const char *s2 ) +{ + char **lasts; + char *retval; + + CYG_REPORT_FUNCNAMETYPE( "_strtok", "returning %08x" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%08x", s1, s2 ); + + if (s1 != NULL) + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + CYGPRI_LIBC_INTERNAL_DATA_ALLOC_CHECK_PREAMBLE; + + lasts = CYGPRI_LIBC_INTERNAL_DATA.get_strtok_last_p(); + + CYG_TRACE2( TL1, "Retrieved strtok_last address %08x containing %s", + lasts, *lasts ); + + retval = _strtok_r( s1, s2, lasts ); + + CYG_REPORT_RETVAL( retval ); + + return retval; +} // _strtok() + +char * +_strtok_r( char *s1, const char *s2, char **lasts ) +{ + char *spanp; + int c, sc; + char *tok; + + CYG_REPORT_FUNCNAMETYPE( "_strtok_r", "returning %08x" ); + CYG_REPORT_FUNCARG3( "s1=%08x, s2=%08x, lasts=%08x", s1, s2, lasts ); + + if (s1 != NULL) + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( lasts, "lasts is not a valid pointer!" ); + + + if (s1 == NULL && (s1 = *lasts) == NULL) + { + CYG_REPORT_RETVAL( NULL ); + return NULL; + } // if + + // + // Skip (span) leading delimiters (s += strspn(s, delim), sort of). + // +cont: + c = *s1++; + for (spanp = (char *)s2; (sc = *spanp++) != 0;) { + if (c == sc) + goto cont; + } // for + + if (c == 0) { // no non-delimiter characters + *lasts = NULL; + + CYG_REPORT_RETVAL( NULL ); + return NULL; + } // if + tok = s1 - 1; + + // + // Scan token (scan for delimiters: s += strcspn(s, delim), sort of). + // Note that delim must have one NUL; we stop if we see that, too. + // + for (;;) { + c = *s1++; + spanp = (char *)s2; + do { + if ((sc = *spanp++) == c) { + if (c == 0) + s1 = NULL; + else + s1[-1] = 0; + *lasts = s1; + + CYG_REPORT_RETVAL( tok ); + + return (tok); + } // if + } while (sc != 0); + } // for + // NOTREACHED +} // _strtok_r() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtok) + +// EOF strtok.cxx diff --git a/packages/language/c/libc/current/src/string/strxfrm.cxx b/packages/language/c/libc/current/src/string/strxfrm.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/string/strxfrm.cxx @@ -0,0 +1,104 @@ +//=========================================================================== +// +// strxfrm.cxx +// +// ANSI standard strxfrm() routine +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions +#include // Tracing support +#include // Assertion support +#include // Header for this file +#include // Compiler definitions such as size_t, NULL etc. +#include "clibincl/stringsupp.hxx" // Useful string function support and + // prototypes + +// EXPORTED SYMBOLS + +externC size_t +strxfrm( char *s1, const char *s2, size_t n ) \ + CYGPRI_LIBC_WEAK_ALIAS("_strxfrm"); + +// FUNCTIONS + +size_t +_strxfrm( char *s1, const char *s2, size_t n ) +{ + size_t res = 0; + + CYG_REPORT_FUNCNAMETYPE( "_strxfrm", "returning size %d" ); + CYG_REPORT_FUNCARG3( "s1=%08x, s2=%08x, n=%d", s1, s2, n ); + + if (s1 != NULL) + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + while (n-- > 0) + { + if ((*s1++ = *s2++) != '\0') + ++res; + else + { + CYG_REPORT_RETVAL( res ); + return res; + } // else + } // while + + while (*s2) + { + ++s2; + ++res; + } // while + + CYG_REPORT_RETVAL( res ); + + return res; +} // _strxfrm() + +#endif // ifdef CYGPKG_LIBC + +// EOF strxfrm.cxx diff --git a/packages/language/c/libc/current/src/support/clibdata.cxx b/packages/language/c/libc/current/src/support/clibdata.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/support/clibdata.cxx @@ -0,0 +1,130 @@ +//======================================================================== +// +// clibdata.cxx +// +// C library internal data support module +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//========================================================================= + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common project-wide type definitions +#include // FILE and fopen() +#include "clibincl/stream.hxx" // Internal per-file class +#include "clibincl/clibdata.hxx" // Header and class definition for this + // file + +#ifdef CYGPKG_LIBC_STDIO +# include "clibincl/stdiosupp.hxx" // Support for stdio +#endif + +// GLOBAL VARIABLES + +#ifndef CYGSEM_LIBC_THREAD_SAFETY +// No thread support means use a global structure +Cyg_CLibInternalData cyg_my_clib_internal_data; +#endif // ifndef CYGSEM_LIBC_THREAD_SAFETY + + +#ifdef CYGPKG_LIBC_STDIO +Cyg_StdioStream *Cyg_CLibInternalData::files[FOPEN_MAX-3]; +# ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS +Cyg_Mutex Cyg_CLibInternalData::files_lock; +# endif +#endif // ifdef CYGPKG_LIBC_STDIO + +#ifdef CYGFUN_LIBC_strtok +# ifndef CYGSEM_LIBC_PER_THREAD_STRTOK +char *Cyg_CLibInternalData::strtok_last; +# endif +#endif + +#ifdef CYGPKG_LIBC_RAND +# ifndef CYGSEM_LIBC_PER_THREAD_RAND +Cyg_CLibInternalData::Cyg_rand_seed_t Cyg_CLibInternalData::rand_seed; +# endif +#endif + +#ifdef CYGPKG_LIBC_ENVIRONMENT + +// The global environment. The default can be configured in +// +externC char *environ[]; + +char *environ[] = CYGDAT_LIBC_DEFAULT_ENVIRONMENT ; + +#endif + + +// STATIC INITIALISATION + +#ifdef CYGPKG_LIBC_STDIO + +static Cyg_StdioStream cyg_stdio_stdin( + Cyg_libc_stdio_find_filename(CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE), + Cyg_StdioStream::CYG_STREAM_READ, false, false, _IOLBF ); + +static Cyg_StdioStream cyg_stdio_stdout( + Cyg_libc_stdio_find_filename(CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE), + Cyg_StdioStream::CYG_STREAM_WRITE, false, false, _IOLBF ); + + +static Cyg_StdioStream cyg_stdio_stderr( + Cyg_libc_stdio_find_filename(CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE), + Cyg_StdioStream::CYG_STREAM_WRITE, false, false, _IONBF, 0, NULL ); + + +Cyg_StdioStream *Cyg_CLibInternalData::stdin = &cyg_stdio_stdin; +Cyg_StdioStream *Cyg_CLibInternalData::stdout = &cyg_stdio_stdout; +Cyg_StdioStream *Cyg_CLibInternalData::stderr = &cyg_stdio_stderr; + +FILE *stdin = (FILE *)&cyg_stdio_stdin; +FILE *stdout = (FILE *)&cyg_stdio_stdout; +FILE *stderr = (FILE *)&cyg_stdio_stderr; + +#endif // CYGPKG_LIBC_STDIO + +#endif // ifdef CYGPKG_LIBC + +// EOF clibdata.cxx diff --git a/packages/language/c/libc/current/src/support/cstartup.cxx b/packages/language/c/libc/current/src/support/cstartup.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/support/cstartup.cxx @@ -0,0 +1,166 @@ +//======================================================================= +// +// cstartup.cxx +// +// Starting C library support +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-08-27 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Common tracing support +#include // Common assertion support +#include "clibincl/stdlibsupp.hxx" // __libc_exit() ( i.e. exit() ) + +#ifdef CYGPKG_KERNEL +# include // eCos thread support +# include +#endif + + +// FUNCTION PROTOTYPES + +// We provide a weakly named main to allow this to link if the user +// doesn't provide their own main. This isn't strictly good behaviour, +// but if the user wants good performance then of _course_ they should +// play with the config options and this won't be called. Or it might +// be "giving them enough rope" etc. :-) + +// The definition of the normal user-supplied main() is here aliased +// to a dummy main function. It isn't called main itself in order to +// throw GDB off the scent, which otherwise gets confused. These +// attributes have no effect on a user-supplied main() if one is supplied + +externC int +cyg_libc_dummy_main( int argc, char *argv[] ); + +externC int +main( int argc, char *argv[] ) + CYGPRI_LIBC_WEAK_ALIAS("cyg_libc_dummy_main"); + +static inline void +invoke_main( CYG_ADDRWORD ); + +// STATICS + +#ifdef CYGPKG_KERNEL +static cyg_uint8 main_stack[ CYGNUM_LIBC_MAIN_STACK_SIZE ]; + + +// GLOBALS + +// let the main thread be global so people can play with it (e.g. suspend +// or resume etc.) if that's what they want to do +Cyg_Thread cyg_libc_main_thread( &invoke_main, (CYG_ADDRWORD) 0, + CYGNUM_LIBC_MAIN_STACK_SIZE, + (CYG_ADDRESS) &main_stack ); +#endif + + +// FUNCTIONS + +externC int +cyg_libc_dummy_main( int argc, char *argv[] ) +{ + CYG_REPORT_FUNCNAMETYPE("main", "returning %d" ); + + // try to be helpful by diagnosing malformed arguments + CYG_PRECONDITION( argv != NULL, "argv is NULL!" ); + CYG_PRECONDITION( argv[argc] == NULL, "argv[argc] isn't NULL!" ); + + CYG_REPORT_FUNCARG2("argc=%d, argv[0]=%s", argc, + (argv[0]==NULL) ? "NULL" : argv[0] ); + + CYG_TRACE0( true, "This is the system-supplied default main()" ); + + CYG_REPORT_RETVAL(0); + return 0; // some CPUs have 0 hard-wired - faster than a reg +} + +// Making invoke_main() static inline has no effect if the kernel is +// present, and makes it inline if not! Cor. +static inline void +invoke_main( CYG_ADDRWORD ) +{ + CYG_REPORT_FUNCNAME( "invoke_main" ); + CYG_REPORT_FUNCARG1( "argument is %s", "ignored" ); + + // argv[argc] must be NULL according to the ISO C standard 5.1.2.2.1 + char *temp_argv[] = CYGDAT_LIBC_ARGUMENTS ; + int rc; + + rc = main( (sizeof(temp_argv)/sizeof(char *)) - 1, &temp_argv[0] ); + + CYG_TRACE1( true, "main() has returned with code %d. Calling exit()", + rc ); + + __libc_exit(rc); + + CYG_FAIL( "__libc_exit() returned!!!" ); + + CYG_REPORT_RETURN(); + +} // invoke_main(); + +externC void +cyg_iso_c_start( void ) +{ + CYG_REPORT_FUNCNAME( "cyg_iso_c_start" ); + CYG_REPORT_FUNCARGVOID(); + +#ifdef CYGPKG_KERNEL + CYG_TRACE0( true, "Resuming cyg_libc_main_thread" ); + cyg_libc_main_thread.resume(); +#else + invoke_main(0); +#endif + + CYG_REPORT_RETURN(); +} // cyg_iso_c_start() + + +#endif // ifdef CYGPKG_LIBC + +// EOF cstartup.cxx diff --git a/packages/language/c/libc/current/src/time/clock.cxx b/packages/language/c/libc/current/src/time/clock.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/src/time/clock.cxx @@ -0,0 +1,130 @@ +//=========================================================================== +// +// clock.cxx +// +// ANSI standard clock() routine defined in section 7.12.2.1 +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +#ifdef CYGPKG_KERNEL +# include // Kernel config header +#endif + +// Include the C library? +#ifdef CYGPKG_LIBC + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing support +#include // Assertion support +#include // NULL and size_t from compiler + +#include // Header for all time-related functions +#include "clibincl/timesupp.hxx" // Support for time functions + +#if defined(CYGFUN_KERNEL_THREADS_TIMER) && \ + defined(CYGVAR_KERNEL_COUNTERS_CLOCK) +# include // Kernel clock definitions +# include // Kernel clock inline functions +#endif + + +// TRACE + +# if defined(CYGDBG_USE_TRACING) && defined(CYGNUM_LIBC_CLOCK_TRACE_LEVEL) +static int clock_trace = CYGNUM_LIBC_CLOCK_TRACE_LEVEL; +# define TL1 (0 < clock_trace) +# else +# define TL1 (0) +# endif + + +// EXPORTED SYMBOLS + +externC clock_t +clock( void ) CYGPRI_LIBC_WEAK_ALIAS("_clock"); + +// FUNCTIONS + +clock_t +_clock( void ) +{ + CYG_REPORT_FUNCNAMETYPE( "_clock", "returning clock tick %d" ); + CYG_REPORT_FUNCARGVOID(); + + // Only if the kernel has clock device support +#if defined(CYGFUN_KERNEL_THREADS_TIMER) && defined(CYGVAR_KERNEL_COUNTERS_CLOCK) + cyg_tick_count curr_clock; // kernel clock value + Cyg_Clock::cyg_resolution resolution; // kernel clock resolution + clock_t clocks; + + CYG_TRACE0( TL1, "getting clock resolution" ); + + // get the resolution + resolution = Cyg_Clock::real_time_clock->get_resolution(); + + CYG_TRACE2( TL1, "got resolution dividend %d divisor %d. Getting " + "clock value", resolution.dividend, resolution.divisor ); + + // get the value + curr_clock = Cyg_Clock::real_time_clock->current_value(); + + CYG_TRACE1( TL1, "got clock value %d", curr_clock ); + + // scale the value so that clock()/CLOCKS_PER_SEC works - clock_t + // should be big enough to cope + clocks = ((clock_t)curr_clock * resolution.dividend) / + (resolution.divisor * (1000000000 / CLOCKS_PER_SEC)); + + CYG_REPORT_RETVAL( clocks ); + return clocks; + +#else + CYG_REPORT_RETVAL( -1 ); + return (clock_t) -1; +#endif + +} // _clock() + +#endif // ifdef CYGPKG_LIBC + +// EOF clock.cxx diff --git a/packages/language/c/libc/current/tests/PKGconf.mak b/packages/language/c/libc/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/PKGconf.mak @@ -0,0 +1,65 @@ +#============================================================================= +# +# makefile +# +# language/c/libc/tests +# +#============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================= + +PACKAGE := libc +include ../../../../../pkgconf/pkgconf.mak + +TESTS := ctype/ctype \ + \ + i18n/setlocale \ + \ + setjmp/setjmp \ + \ + stdio/sprintf1 stdio/sprintf2 stdio/sscanf \ + stdio/stdiooutput \ + \ + stdlib/abs stdlib/atexit stdlib/atoi stdlib/atol \ + stdlib/bsearch stdlib/div stdlib/getenv \ + stdlib/labs stdlib/ldiv stdlib/qsort stdlib/malloc1 \ + stdlib/malloc2 stdlib/malloc3 stdlib/rand1 \ + stdlib/rand2 stdlib/rand3 stdlib/realloc stdlib/srand\ + stdlib/strtol stdlib/strtoul \ + \ + string/memchr string/memcmp1 string/memcmp2 \ + string/memcpy1 string/memcpy2 string/memmove1 \ + string/memmove2 string/memset string/strcat1 \ + string/strcat2 string/strchr string/strcmp1 \ + string/strcmp2 string/strcoll1 string/strcoll2 \ + string/strcpy1 string/strcpy2 string/strcspn \ + string/strcspn string/strlen string/strncat1 \ + string/strncat2 string/strncpy1 string/strncpy2 \ + string/strpbrk string/strrchr string/strspn \ + string/strstr string/strtok string/strxfrm1 \ + string/strxfrm2 \ + \ + time/clock + + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst diff --git a/packages/language/c/libc/current/tests/ctype/ctype.c b/packages/language/c/libc/current/tests/ctype/ctype.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/ctype/ctype.c @@ -0,0 +1,235 @@ +//================================================================= +// +// ctype.c +// +// General testcase for C library ctype functions +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains general testcode for C library ctype functions +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + +// INCLUDES + +#include +#include +#include +#include + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + int c; // character we use as a parameter +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO( "Starting tests from testcase " __FILE__ " for C library " + " functions" ); + +#ifdef CYGPKG_LIBC + + // Check isalnum + c = 't'; + CYG_TEST_PASS_FAIL( isalnum(c), "isalnum('t')"); + c = '2'; + CYG_TEST_PASS_FAIL( isalnum(c), "isalnum('2')"); + c = 2; + CYG_TEST_PASS_FAIL( !isalnum(c), "!isalnum(2)"); + c = 127; + CYG_TEST_PASS_FAIL( !isalnum(c), "!isalnum(127)"); + + // Check isalpha + c = 'A'; + CYG_TEST_PASS_FAIL( isalpha(c), "isalpha('A')"); + c = 'a'; + CYG_TEST_PASS_FAIL( isalpha(c), "isalpha('a')"); + c = '2'; + CYG_TEST_PASS_FAIL( !isalpha(c), "!isalpha('2')"); + c = '\n'; + CYG_TEST_PASS_FAIL( !isalpha(c), "!isalpha('newline')"); + + // Check iscntrl + c = 'a'; + CYG_TEST_PASS_FAIL( !iscntrl(c), "!iscntrl('a')"); + c = 7; + CYG_TEST_PASS_FAIL( iscntrl(c), "iscntrl('7')"); + c = '\n'; + CYG_TEST_PASS_FAIL( iscntrl(c), "iscntrl(newline)"); + c = 0x7F; + CYG_TEST_PASS_FAIL( iscntrl(c), "iscntrl(0x7F)"); + + // Check isdigit + c = '2'; + CYG_TEST_PASS_FAIL( isdigit(c), "isdigit('2')"); + c = '0'; + CYG_TEST_PASS_FAIL( isdigit(c), "isdigit('0')"); + c = 't'; + CYG_TEST_PASS_FAIL( !isdigit(c), "!isdigit('t')"); + + // Check isgraph + c = ')'; + CYG_TEST_PASS_FAIL( isgraph(c), "isgraph(')')"); + c = '~'; + CYG_TEST_PASS_FAIL( isgraph(c), "isgraph('~')"); + c = '9'; + CYG_TEST_PASS_FAIL( isgraph(c), "isgraph('9')"); + c = 9; + CYG_TEST_PASS_FAIL( !isgraph(c), "!isgraph(9)"); + c = ' '; + CYG_TEST_PASS_FAIL( !isgraph(c), "!isgraph(' ')"); + c = '\t'; + CYG_TEST_PASS_FAIL( !isgraph(c), "!isgraph(tab)"); + c = '\n'; + CYG_TEST_PASS_FAIL( !isgraph(c), "!isgraph(newline)"); + c = 0x7F; + CYG_TEST_PASS_FAIL( !isgraph(c), "!isgraph(DEL)"); + c = 200; + CYG_TEST_PASS_FAIL( !isgraph(c), "!isgraph(200)"); + c = '\0'; + CYG_TEST_PASS_FAIL( !isgraph(c), "!isgraph(NUL)"); + + // Check islower + c = 'J'; + CYG_TEST_PASS_FAIL( !islower(c), "islower('J')"); + c = 'j'; + CYG_TEST_PASS_FAIL( islower(c), "islower('j')"); + c = '5'; + CYG_TEST_PASS_FAIL( !islower(c), "!islower(5)"); + + // Check isprint + c = ' '; + CYG_TEST_PASS_FAIL( isprint(c), "isprint(' ')"); + c = 'x'; + CYG_TEST_PASS_FAIL( isprint(c), "isprint('x')"); + c = '\b'; + CYG_TEST_PASS_FAIL( !isprint(c), "!isprint(backspace)"); + + // Check ispunct + c = '.'; + CYG_TEST_PASS_FAIL( ispunct(c), "ispunct('.')"); + c = '#'; + CYG_TEST_PASS_FAIL( ispunct(c), "ispunct('#')"); + c = '@'; + CYG_TEST_PASS_FAIL( ispunct(c), "ispunct('@')"); + c = 'f'; + CYG_TEST_PASS_FAIL( !ispunct(c), "!ispunct('f')"); + c = '7'; + CYG_TEST_PASS_FAIL( !ispunct(c), "!ispunct('7')"); + c = '\n'; + CYG_TEST_PASS_FAIL( !ispunct(c), "!ispunct('newline')"); + + // Check isspace + c = ' '; + CYG_TEST_PASS_FAIL( isspace(c), "isspace(' ')"); + c = '\t'; + CYG_TEST_PASS_FAIL( isspace(c), "isspace(tab)"); + c = '\r'; + CYG_TEST_PASS_FAIL( isspace(c), "isspace(return)"); + c = '\v'; + CYG_TEST_PASS_FAIL( isspace(c), "isspace(vertical tab)"); + c = '\n'; + CYG_TEST_PASS_FAIL( isspace(c), "isspace(newline)"); + c = 'd'; + CYG_TEST_PASS_FAIL( !isspace(c), "!isspace('d')"); + c = ','; + CYG_TEST_PASS_FAIL( !isspace(c), "!isspace(',')"); + + // Check isupper + c = 'A'; + CYG_TEST_PASS_FAIL( isupper(c), "isupper('A')"); + c = 'a'; + CYG_TEST_PASS_FAIL( !isupper(c), "!isupper('a')"); + c = '2'; + CYG_TEST_PASS_FAIL( !isupper(c), "!isupper('2')"); + c = '\b'; + CYG_TEST_PASS_FAIL( !isupper(c), "!isupper(backspace)"); + + // Check isxdigit + c = 'f'; + CYG_TEST_PASS_FAIL( isxdigit(c), "isxdigit('f')"); + c = 'D'; + CYG_TEST_PASS_FAIL( isxdigit(c), "isxdigit('D')"); + c = '1'; + CYG_TEST_PASS_FAIL( isxdigit(c), "isxdigit('1')"); + c = '0'; + CYG_TEST_PASS_FAIL( isxdigit(c), "isxdigit('0')"); + c = 'g'; + CYG_TEST_PASS_FAIL( !isxdigit(c), "!isxdigit('g')"); + c = 'x'; + CYG_TEST_PASS_FAIL( !isxdigit(c), "!isxdigit('x')"); + + // Check tolower + c = 'F'; + CYG_TEST_PASS_FAIL( tolower(c) == 'f', "tolower('F')"); + c = 'g'; + CYG_TEST_PASS_FAIL( tolower(c) == 'g', "tolower('g')"); + c = '3'; + CYG_TEST_PASS_FAIL( tolower(c) == '3', "tolower('3')"); + + // Check toupper + c = 'f'; + CYG_TEST_PASS_FAIL( toupper(c) == 'F', "toupper('f')"); + c = 'G'; + CYG_TEST_PASS_FAIL( toupper(c) == 'G', "toupper('G')"); + c = ','; + CYG_TEST_PASS_FAIL( toupper(c) == ',', "toupper(',')"); + + CYG_TEST_FINISH( "Finished tests from testcase " __FILE__ " for C library " + " functions" ); + +#else // ifdef CYGPKG_LIBC + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); +#endif + +} // main() + +// EOF ctype.c diff --git a/packages/language/c/libc/current/tests/i18n/setlocale.c b/packages/language/c/libc/current/tests/i18n/setlocale.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/i18n/setlocale.c @@ -0,0 +1,147 @@ +//================================================================= +// +// setlocale.c +// +// Testcase for C library setlocale() function +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/8/31 +// Description: Contains testcode for C library setlocale() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // header for functions to test +#include // Testcase API +#include // C library initialisation + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) +static int +my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() +#endif + + +int +main( int argc, char *argv[] ) +{ +#if defined(CYGPKG_LIBC) + char *str; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C " + "library setlocale() function"); + +#if defined(CYGPKG_LIBC) + + // Check 1 + str = setlocale(LC_CTYPE, NULL); + CYG_TEST_PASS_FAIL( !my_strcmp(str, "C" ), + "Initial locale for LC_CTYPE is \"C\"" ); + + // Check 2 + str = setlocale(LC_ALL, NULL); + CYG_TEST_PASS_FAIL( !my_strcmp(str, "#C#C#C#C#C#" ), + "Initial locale for LC_ALL is correct" ); + + // Check 3 + str = setlocale(LC_COLLATE, "C"); + CYG_TEST_PASS_FAIL( !my_strcmp(str, "C" ), + "Set locale for LC_COLLATE to \"C\"" ); + + // Check 4 + str = setlocale(LC_MONETARY, ""); + CYG_TEST_PASS_FAIL( !my_strcmp(str, "C" ), + "Set default locale for LC_MONETARY" ); + str = setlocale(LC_MONETARY, NULL); + CYG_TEST_PASS_FAIL( !my_strcmp(str, "C" ), + "Stored default locale for LC_MONETARY" ); + + // Check 5 + str = setlocale(LC_ALL, "C"); + CYG_TEST_PASS_FAIL( !my_strcmp(str, "C" ), + "Set locale for LC_COLLATE to \"C\"" ); + + // Check 6 + str = setlocale(LC_ALL, ""); + CYG_TEST_PASS_FAIL( !my_strcmp(str, "C" ), + "Set locale for LC_COLLATE to default" ); + + // Check 7 + str = setlocale(LC_ALL, NULL); + CYG_TEST_PASS_FAIL( !my_strcmp(str, "#C#C#C#C#C#" ), + "Get locale for LC_ALL" ); + str = setlocale(LC_ALL, str); + CYG_TEST_PASS_FAIL( !my_strcmp(str, "#C#C#C#C#C#" ), + "Set locale for LC_ALL from retrieved locale" ); + +#else + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // if defined(CYGPKG_LIBC) + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C " + "library setlocale() function"); +} // main() + +// EOF setlocale.c diff --git a/packages/language/c/libc/current/tests/setjmp/setjmp.c b/packages/language/c/libc/current/tests/setjmp/setjmp.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/setjmp/setjmp.c @@ -0,0 +1,250 @@ +//=========================================================================== +// +// setjmp.c +// +// Tests for ANSI standard setjmp() and longjmp() functions +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Contains test code for C library setjmp() and longjmp() +// functions +// The ANSI standard allows setjmp calls to be used ONLY in the +// forms: +// while (setjmp (jumpbuf)) +// while (setjmp (jumpbuf) < 42) +// while (!setjmp (jumpbuf)) +// setjmp (jumpbuf); +// result = setjmp(jumpbuf); +// +// Or "while" can also be "if" or "switch" or the implicit +// while of "for". +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include // Test infrastructure header +#include // Header for what we're testing +#include // C library initialisation + +// GLOBALS + +#ifdef CYGPKG_LIBC + +static jmp_buf jbuf, jbuf2, jbuf3; + + +// FUNCTIONS + +static int +test_fun( void ) +{ + volatile int i=0; // add something to the stack to confuse things + + longjmp( jbuf, 5 ); + i+=5; + + return i; +} // test_fun(); + +#endif // ifdef CYGPKG_LIBC + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + static int static_i=0; // temporary variable + int j=0; // ditto + volatile int vol_k=0, vol_l=0; // ditto +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "setjmp()/longjmp() functions"); + +#ifdef CYGPKG_LIBC + // Test 1 + if ( setjmp(jbuf) == 0 ) + { + static_i=1; + longjmp(jbuf, 1); + static_i=2; + } // if + + CYG_TEST_PASS_FAIL( static_i==1, "Simple test 1" ); + + // Test 2 + j=2; + + if ( !setjmp(jbuf) ) + { + static_i=3; + longjmp(jbuf, 1); + static_i=4; + j=3; + } // if + + CYG_TEST_PASS_FAIL( (static_i==3) && (j==2), "Simple test 2" ); + + // Test 3 + + static_i=0; + switch (setjmp(jbuf)) + { + case 0: + static_i++; + if (static_i!=1) + CYG_TEST_FAIL("Test of value passed to longjmp()"); + else + longjmp(jbuf, 5); + break; + case 5: + static_i++; + CYG_TEST_PASS_FAIL( (static_i==2),"Test of value passed to longjmp()"); + break; + default: + CYG_TEST_FAIL( "Test of value passed to longjmp()"); + break; + } // switch + + // Test 3 + + static_i=0; + switch (setjmp(jbuf)) + { + case 0: + static_i++; + if (static_i!=1) + CYG_TEST_FAIL("Test of value passed to longjmp() being 0"); + else + longjmp(jbuf, 0); + break; + case 1: + static_i++; + CYG_TEST_PASS_FAIL( (static_i==2), + "Test of value passed to longjmp() being 0"); + break; + default: + CYG_TEST_FAIL( "Test of value passed to longjmp() being 0"); + break; + } // switch + + + // Test 4 + + vol_k=0; + static_i=0; + setjmp( jbuf ); + + static_i++; + setjmp( jbuf2 ); + + static_i++; + setjmp( jbuf3 ); + + if (vol_k==0) + { + vol_k++; + longjmp( jbuf2, 1 ); + } + else + { + CYG_TEST_PASS_FAIL( (vol_k==1) && (static_i==3), "Multiple setjmp's" ); + } + + // Test 5 + + vol_k=3; + if ( (j=setjmp(jbuf)) == 0 ) + { + volatile int l; // put something extra on the stack to confuse things + + vol_k++; + l=test_fun(); + l++; + vol_k=l; + } // if + + CYG_TEST_PASS_FAIL( (j==5) && (vol_k==4), "longjmp from a function" ); + + // Test 6 + + vol_k=0; + + vol_l=setjmp(jbuf); + + vol_k += 3; + + if (!vol_l) + test_fun(); + + vol_l=setjmp(jbuf); + + vol_k += 7; + + if (!vol_l) + test_fun(); + + CYG_TEST_PASS_FAIL ( (vol_k == 20), "Repeated longjmps from a function" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "setjmp()/longjmp() functions"); + +} // main() + +// EOF setjmp.c diff --git a/packages/language/c/libc/current/tests/stdio/sprintf1.c b/packages/language/c/libc/current/tests/stdio/sprintf1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdio/sprintf1.c @@ -0,0 +1,616 @@ +//================================================================= +// +// sprintf1.c +// +// Testcase for C library sprintf() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library sprintf() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include +#include +#include // C library initialisation + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// Functions to avoid having to use libc strings + +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + + +static void test(CYG_ADDRWORD data) +{ + static char x[500]; + static char y[500]; + int ret; + int tmp; + int *ptr; + + + // Check 1 + ret = sprintf(x, "%d", 20); + CYG_TEST_PASS_FAIL(my_strcmp(x, "20")==0, "%d test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%d test return code"); + + // Check 2 + my_strcpy(y, "Pigs noses. Get 'em while there 'ot"); + ret = sprintf(x, "%s", y); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%s test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%s test return code"); + + // Check 3 + ret = sprintf(x, "||%7d||", 2378); + CYG_TEST_PASS_FAIL(my_strcmp(x, "|| 2378||")==0, "padding test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "padding test return code"); + + // Check 4 + ret = sprintf(x, "%x", 3573); + CYG_TEST_PASS_FAIL(my_strcmp(x, "df5")==0, "hex conversion (lowercase)"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "hex conv (lowercase) return code"); + + // Check 5 + ret = sprintf(x, "%X", 3573); + CYG_TEST_PASS_FAIL(my_strcmp(x, "DF5")==0, "hex conversion (uppercase)"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "hex conv (upperbase ) return code"); + + // Check 6 + ret = sprintf(x, "%c", 65); + CYG_TEST_PASS_FAIL(my_strcmp(x, "A")==0, "%c test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%c test return code"); + + // Check 7 + ret = sprintf(x, "%o",4628); + CYG_TEST_PASS_FAIL(my_strcmp(x, "11024")==0, "octal conversion"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "octal conversion return code"); + + // Check 8 + ret = sprintf(x, "%u", (unsigned int) 4738); + CYG_TEST_PASS_FAIL(my_strcmp(x, "4738")==0, "%u test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%u test return code"); + + // Check 9 + ptr = &tmp; + ret = sprintf(x, "1234567x%n||", ptr); + CYG_TEST_PASS_FAIL(tmp==8, "%n test"); + CYG_TEST_PASS_FAIL(ret==10, "%n test return code"); + + // Check 10 + ret = sprintf(x, "%%"); + CYG_TEST_PASS_FAIL(my_strcmp(x, "%")==0, "%% test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%% test return code"); + + // Check 11 + ret = sprintf(x, "%ld", (long)1<<30); + CYG_TEST_PASS_FAIL(my_strcmp(x, "1073741824")==0, "%ld test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%ld test return code"); + + // Check 12 + ret = sprintf(x, "%lu", (unsigned long)(1<<31) + 100); + CYG_TEST_PASS_FAIL(my_strcmp(x, "2147483748")==0, "%lu test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%lu test return code"); + + // Check 13 + ret = sprintf(x, "%x", 0x789a); + CYG_TEST_PASS_FAIL(my_strcmp(x, "789a")==0, "%x test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%x test return code"); + + // Check 14 + ret = sprintf(x, "%X", 0x789ab2); + CYG_TEST_PASS_FAIL(my_strcmp(x, "789AB2")==0, "%X test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%x test return code"); + + // Check 15 + ret = sprintf(x, "%08x", 0xdea2f2); + CYG_TEST_PASS_FAIL(my_strcmp(x, "00dea2f2")==0, "%0x test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%0x test return code"); + + // Check 16 + ret = sprintf(x, "%09X", 0x12fa1c); + CYG_TEST_PASS_FAIL(my_strcmp(x, "00012FA1C")==0, "%0X test"); + CYG_TEST_PASS_FAIL(ret==my_strlen(x), "%0X test return code"); + + // Check 17 + ptr=&tmp; + ret = sprintf(x, "%p", (void *)ptr); + // just check _something_ was returned + CYG_TEST_PASS_FAIL((ret==my_strlen(x)) && (ret > 0), + "%p test return code"); + +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + + CYG_TEST_INFO("Starting floating point specific tests"); + + // Check 18 + ret = sprintf(x, "%f", 2.5); + my_strcpy( y, "2.500000" ); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "simple %f test #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "simple %f test #1 return code"); + + // Check 19 + ret = sprintf(x, "hello %f world", 1.234); + my_strcpy( y, "hello 1.234000 world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "simple %f test #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "simple %f test #2 return code"); + + // Check 20 + ret = sprintf(x, "hello%fworld", 2.3456781); + my_strcpy( y, "hello2.345678world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "simple %f test #3"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "simple %f test #3 return code"); + + // Check 21 + ret = sprintf(x, "%s%f%d%s", "testing", -0.591, 3, "123"); + my_strcpy( y, "testing-0.5910003123"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%f mixed with others"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y),"%f mixed with others return code"); + + // Check 22 + ret = sprintf(x, "%s%f%d%s", "testing", -0.591, 3, "123"); + my_strcpy( y, "testing-0.5910003123"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%f mixed with others"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y),"%f mixed with others return code"); + + // Check 23 + ret = sprintf(x, "hello%fworld", 2.3456786); + my_strcpy( y, "hello2.345679world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "rounding test #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "rounding test #1 return code"); + + // Check 24 + ret = sprintf(x, "hello%fworld", -2.3456786); + my_strcpy( y, "hello-2.345679world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "rounding test #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "rounding test #2 return code"); + + // Check 25 + ret = sprintf(x, "hello%+fworld", -6.54321); + my_strcpy( y, "hello-6.543210world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "+ modifier #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "+ modifier #1 return code"); + + // Check 26 + ret = sprintf(x, "hello%+fworld", 6.54321); + my_strcpy( y, "hello+6.543210world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "+ modifier #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "+ modifier #2 return code"); + + // Check 27 + ret = sprintf(x, "hello%5fworld", 6.5); + my_strcpy( y, "hello6.500000world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "width modifier #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "width modifier #1 return code"); + + // Check 28 + ret = sprintf(x, "hello%2fworld", 4.3); + my_strcpy( y, "hello4.300000world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "width modifier #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "width modifier #2 return code"); + + // Check 29 + ret = sprintf(x, "hello%2.1fworld", 5.6); + my_strcpy( y, "hello5.6world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "width and precision modifier #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "width and precision modifier #1 return code"); + + // Check 30 + ret = sprintf(x, "hello%5.1fworld", 6.7); + my_strcpy( y, "hello 6.7world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "width and precision modifier #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "width and precision modifier #2 return code"); + + // Check 31 + ret = sprintf(x, "hello%3.1fworld", 7.8); + my_strcpy( y, "hello7.8world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "width and precision modifier #3"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "width and precision modifier #3 return code"); + + // Check 32 + ret = sprintf(x, "hello%3.2fworld", 7.8); + my_strcpy( y, "hello7.80world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "width and precision modifier #4"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "width and precision modifier #4 return code"); + + // Check 33 + ret = sprintf(x, "hello%05.1fworld", 6.5); + my_strcpy( y, "hello006.5world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "0 modifier #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "0 modifier #1 return code"); + + // Check 34 + ret = sprintf(x, "hello%03.0fworld", 6.2); + my_strcpy( y, "hello006world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "0 modifier #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "0 modifier #2 return code"); + + // Check 35 + ret = sprintf(x, "hello%05.*fworld",2, 7.5); + my_strcpy( y, "hello07.50world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "0 modifier plus *"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "0 modifier plus * return code"); + + // Check 36 + ret = sprintf(x, "hello%03.1fworld",-1.232); + my_strcpy( y, "hello-1.2world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "-ve number with 0 modifier #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "-ve number with 0 modifier #1 return code"); + + // Check 37 + ret = sprintf(x, "hello%04.1fworld",-1.232); + my_strcpy( y, "hello-1.2world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "-ve number with 0 modifier #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "-ve number with 0 modifier #2 return code"); + + // Check 38 + ret = sprintf(x, "hello%05.1fworld",-1.232); + my_strcpy( y, "hello-01.2world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "-ve number with 0 modifier #3"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "-ve number with 0 modifier #3 return code"); + + // Check 39 + ret = sprintf(x, "hello%fworld",0.0); + my_strcpy( y, "hello0.000000world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "0.0 test #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "0.0 test #1 return code"); + + // Check 40 + ret = sprintf(x, "hello%1.0fworld",0.0); + my_strcpy( y, "hello0world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "0.0 test #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "0.0 test #2 return code"); + + // Check 41 + ret = sprintf(x, "hello%1.1fworld",0.0); + my_strcpy( y, "hello0.0world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "0.0 test #3"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "0.0 test #3 return code"); + + // Check 42 + ret = sprintf(x, "hello%5.1fworld",0.0); + my_strcpy( y, "hello 0.0world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "0.0 test #4"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "0.0 test #4 return code"); + + // Check 43 + ret = sprintf(x, "hello%fworld",-0.0); + my_strcpy( y, "hello-0.000000world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "-0.0 test #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "-0.0 test #1 return code"); + + // Check 44 + ret = sprintf(x, "hello%fworld",0.234); + my_strcpy( y, "hello0.234000world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "number less than 1 #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "number less than 1 #1 return code"); + + // Check 45 + ret = sprintf(x, "hello%02fworld",-0.234); + my_strcpy( y, "hello-0.234000world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "number less than 1 #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "number less than 1 #2 return code"); + + // Check 46 + ret = sprintf(x, "hello%02.2fworld",-0.234); + my_strcpy( y, "hello-0.23world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "number less than 1 #3"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "number less than 1 #3 return code"); + + // Check 47 + ret = sprintf(x, "hello%06.2fworld",-0.234); + my_strcpy( y, "hello-00.23world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "number less than 1 #4"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "number less than 1 #4 return code"); + + // Check 48 + ret = sprintf(x, "hello%-6.2fworld",2.345); + my_strcpy( y, "hello2.35 world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "left justification #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "left justification #1 return code"); + + // Check 49 + ret = sprintf(x, "hello%-6.2fworld",2.345); + my_strcpy( y, "hello2.35 world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "left justification #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "left justification #2 return code"); + + // Check 50 + ret = sprintf(x, "hello%-3.2fworld",2.345); + my_strcpy( y, "hello2.35world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "left justification #3"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "left justification #3 return code"); + + // Check 51 + ret = sprintf(x, "hello%#1.0fworld",2.12); + my_strcpy( y, "hello2.world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "# modifier #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "# modifier #1 return code"); + + // Check 52 + ret = sprintf(x, "hello%#1.2fworld",2.0); + my_strcpy( y, "hello2.00world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "# modifier #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "# modifier #2 return code"); + + // Check 53 + ret = sprintf(x, "hello%eworld",2.3456); + my_strcpy( y, "hello2.345600e+00world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%e #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%e #1 return code"); + + // Check 54 + ret = sprintf(x, "hello%4.3eworld",-2.3456e-1); + my_strcpy( y, "hello-2.346e-01world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%e #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%e #2 return code"); + + // Check 55 + ret = sprintf(x, "hello%4.2eworld",2.56e2); + my_strcpy( y, "hello2.56e+02world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%e #3"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%e #3 return code"); + + // Check 56 + ret = sprintf(x, "hello%09.2eworld",2.56e2); + my_strcpy( y, "hello02.56e+02world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%e #4"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%e #4 return code"); + + // Check 57 + ret = sprintf(x, "hello%09.2Eworld",4.23e19); + my_strcpy( y, "hello04.23E+19world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%e #5"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%e #5 return code"); + + // Check 58 + ret = sprintf(x, "hello%gworld",4.0); + my_strcpy( y, "hello4world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #1 return code"); + + // Check 59 + ret = sprintf(x, "hello%gworld",4.56); + my_strcpy( y, "hello4.56world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #2 return code"); + + // Check 60 + ret = sprintf(x, "hello%5.2gworld",4.56); + my_strcpy( y, "hello 4.6world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #3"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #3 return code"); + + // Check 61 + ret = sprintf(x, "hello%gworld",0.002); + my_strcpy( y, "hello0.002world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #4"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #4 return code"); + + // Check 62 + ret = sprintf(x, "hello%06.1gworld",0.0026); + my_strcpy( y, "hello00.003world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #5"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #5 return code"); + + // Check 63 + ret = sprintf(x, "hello%06gworld",0.000026); + my_strcpy( y, "hello2.6e-05world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #5"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #5 return code"); + + // Check 64 + ret = sprintf(x, "hello%06Gworld",0.000037); + my_strcpy( y, "hello3.7E-05world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #6"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #6 return code"); + + // Check 65 + ret = sprintf(x, "hello%08Gworld",-123456.0); + my_strcpy( y, "hello-0123456world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #7"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #7 return code"); + + // Check 66 + ret = sprintf(x, "hello%07gworld",-1234567.0); + my_strcpy( y, "hello-1.23457e+06world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #8"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #8 return code"); + + // Check 67 + ret = sprintf(x, "hello%013Gworld",-1234567.0); + my_strcpy( y, "hello-01.23457E+06world"); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%g #9"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), "%g #9 return code"); + + +#else + CYG_TEST_PASS("Floating point tests skipped - not configured"); +#endif // ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + + // Long string tests + ret = sprintf(x, "This is a very long string so I hope this works as " + "otherwise I would be very, very, sad. The cat sat on the " + "hat, and the mat sat on the rat. Quick brown fax, etc.etc. " + "blah, blah and all that jazz. Isn't he finished yet? My " + "old man's a dustman, why do I have to think up this " + "drivel, isn't that what summer students are for, if " + "anything that seems thinking up mindless drivel seems to " + "be their occupation in life. Yoof of today, eh? What, " + "what? %s So there.", + "And this is a middly bit."); + my_strcpy(y, "This is a very long string so I hope this works as " + "otherwise I would be very, very, sad. The cat sat on the " + "hat, and the mat sat on the rat. Quick brown fax, etc.etc. " + "blah, blah and all that jazz. Isn't he finished yet? My " + "old man's a dustman, why do I have to think up this " + "drivel, isn't that what summer students are for, if " + "anything that seems thinking up mindless drivel seems to " + "be their occupation in life. Yoof of today, eh? What, " + "what? And this is a middly bit. So there."); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "long (480 char) string output #1"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "long (480 char) string output #1 return code"); + + ret = sprintf(x, "Boo! This %s So there.", + "is a very long string so I hope this works as " + "otherwise I would be very, very, sad. The cat sat on the " + "hat, and the mat sat on the rat. Quick brown fax, etc.etc. " + "blah, blah and all that jazz. Isn't he finished yet? My " + "old man's a dustman, why do I have to think up this " + "drivel, isn't that what summer students are for, if " + "anything that seems thinking up mindless drivel seems to " + "be their occupation in life. Yoof of today, eh? What, " + "what? And this is a middly bit."); + my_strcpy(y, "Boo! This is a very long string so I hope this works as " + "otherwise I would be very, very, sad. The cat sat on the " + "hat, and the mat sat on the rat. Quick brown fax, etc.etc. " + "blah, blah and all that jazz. Isn't he finished yet? My " + "old man's a dustman, why do I have to think up this " + "drivel, isn't that what summer students are for, if " + "anything that seems thinking up mindless drivel seems to " + "be their occupation in life. Yoof of today, eh? What, " + "what? And this is a middly bit. So there."); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "long (485 char) string output #2"); + CYG_TEST_PASS_FAIL(ret == my_strlen(y), + "long (485 char) string output #2 return code"); + + + + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "sprintf() function"); + +} // test() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "sprintf() function"); + CYG_TEST_INFO("These test individual features separately"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + +// EOF sprintf1.c diff --git a/packages/language/c/libc/current/tests/stdio/sprintf2.c b/packages/language/c/libc/current/tests/stdio/sprintf2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdio/sprintf2.c @@ -0,0 +1,197 @@ +//================================================================= +// +// sprintf2.c +// +// Testcase for C library sprintf() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library sprintf() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +// Functions to avoid having to use libc strings + +static int +my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int +my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char * +my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + + +static void +test( CYG_ADDRWORD data ) +{ + static char x[200]; + static char y[200]; + static char z[200]; + int ret; + int tmp; + int *ptr; + + // Check 1 + my_strcpy(x, "I'm afraid the shield generator"); + ptr = &tmp; + ret = sprintf(y, "%s%n will be quite operational - %5d%%%c%05X", x, + ptr, 13, '5', 0x89ab); + my_strcpy( z, "I'm afraid the shield generator will be " + "quite operational - 13%5089AB" ); + CYG_TEST_PASS_FAIL(my_strcmp(y,z) == 0, "%s%n%d%%%c%0X test"); + + CYG_TEST_PASS_FAIL(ret == my_strlen(z), + "%s%n%d%%%c%0X test return code" ); + + CYG_TEST_PASS_FAIL(tmp==31, "%n test"); + + // Check 2 + ret = sprintf(y, "|%5d|%10s|%03d|%c|%o|", 2, "times", 6, '=', 10 ); + my_strcpy(z, "| 2| times|006|=|12|"); + + CYG_TEST_PASS_FAIL(my_strcmp(y,z) == 0, "|%5d|%10s|%03d|%c|%o| test"); + + CYG_TEST_PASS_FAIL(ret == my_strlen(z), + "|%5d|%10s|%03d|%c|%o| test return code" ); + +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + + CYG_TEST_INFO("Starting floating point specific tests"); + + // Check 3 + ret = sprintf(y, "|%5f|%10s|%03d|%c|%+-5.2G|%010.3G|", + 2.0, "times", 6, '=', 12.0, -2.345e-6 ); + my_strcpy(z, "|2.000000| times|006|=|+12 |-02.34E-06|"); + + CYG_TEST_PASS_FAIL(my_strcmp(y,z) == 0, + "|%5f|%10s|%03d|%c|%+-5.2G|%010.3G| test"); + + CYG_TEST_PASS_FAIL(ret == my_strlen(z), + "|%5f|%10s|%03d|%c|%+-5.2G|%010.3G| test " + "return code" ); + +#endif // ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ + " for C library sprintf() function"); + +} // test() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C " + "library sprintf() function"); + CYG_TEST_INFO("These test combinations of sprintf() features"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this " + "configuration"); + +} // main() + +// EOF sprintf2.c diff --git a/packages/language/c/libc/current/tests/stdio/sscanf.c b/packages/language/c/libc/current/tests/stdio/sscanf.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdio/sscanf.c @@ -0,0 +1,321 @@ +//================================================================= +// +// sscanf.c +// +// Testcase for C library sscanf() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library sscanf() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && defined(CYGFUN_LIBC_STDIO_ungetc) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && defined(CYGFUN_LIBC_STDIO_ungetc) + +// Functions to avoid having to use libc strings + +static int +my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0') + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char * +my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + +static void +test( CYG_ADDRWORD data ) +{ + static char x[300]; + static char y[300]; + char z[20]; + int ret; + int int_test, int_test2, int_test3, int_test4; + + // Check 1 + my_strcpy(x, "20"); + ret = sscanf(x, "%d", &int_test); + CYG_TEST_PASS_FAIL(int_test==20, "%d test"); + CYG_TEST_PASS_FAIL(ret == 1, "%d test return code"); + + // Check 2 + my_strcpy(y, "PigsNoses"); + ret = sscanf(y, "%s", x); + CYG_TEST_PASS_FAIL(my_strcmp(x, y)==0, "%s test"); + CYG_TEST_PASS_FAIL(ret == 1, "%s test return code"); + + // Check 3 + my_strcpy(x, "FE8C"); + ret = sscanf(x, "%X", &int_test); + CYG_TEST_PASS_FAIL(int_test == 65164, "hex read leading zeroes"); + CYG_TEST_PASS_FAIL(ret == 1, "hex read leading zeroes return code"); + + // Check 4 + my_strcpy(x, "000053Ba"); + ret = sscanf(x, "%x", &int_test); + CYG_TEST_PASS_FAIL(int_test == 21434, "hex read leading zeroes"); + CYG_TEST_PASS_FAIL(ret == 1, "hex read leading zeros return code"); + + // Check 5 + my_strcpy(x, "53Ba"); + ret = sscanf(x, "%3x", &int_test); + CYG_TEST_PASS_FAIL(int_test == 1339, "hex read constrained width"); + CYG_TEST_PASS_FAIL(ret == 1, "hex read constrained width return code"); + + // Check 6 + my_strcpy(x, "get the first char test"); + ret = sscanf(x, "%c", &y[0]); + CYG_TEST_PASS_FAIL(y[0] == 'g', "%c test"); + CYG_TEST_PASS_FAIL(ret == 1, "%c test return code"); + + // Check 7 + my_strcpy(x, "-5"); + ret = sscanf(x, "%d", &int_test); + CYG_TEST_PASS_FAIL(int_test == -5, "negative integer"); + CYG_TEST_PASS_FAIL(ret == 1, "negative integer return code"); + + // Check 8 + my_strcpy(x, "53"); + ret = sscanf(x, "%o", &int_test); + CYG_TEST_PASS_FAIL(int_test == 43, "%o test"); + CYG_TEST_PASS_FAIL(ret == 1, "%o test return code"); + + // Check 9 + int_test=10; + my_strcpy(x, "-5 0"); + ret = sscanf(x, "%*d %d", &int_test); + CYG_TEST_PASS_FAIL(int_test == 0, "assignment suppression"); + CYG_TEST_PASS_FAIL(ret == 1, "assignment suppression return code"); + + // Check 10 + int_test=0; + my_strcpy(x, "052"); + ret = sscanf(x, "%i", &int_test); + CYG_TEST_PASS_FAIL(int_test == 42, "octal with %i"); + CYG_TEST_PASS_FAIL(ret == 1, "octal with %i return code"); + + // Check 10 + int_test=0; + my_strcpy(x, "0x05f"); + ret = sscanf(x, "%i", &int_test); + CYG_TEST_PASS_FAIL(int_test == 95, "hex with %i"); + CYG_TEST_PASS_FAIL(ret == 1, "hex with %i return code"); + + // Check 11 + int_test=0; + my_strcpy(x, "+023456"); + ret = sscanf(x, "%u", &int_test); + CYG_TEST_PASS_FAIL(int_test == 23456, "unsigned int with %u"); + CYG_TEST_PASS_FAIL(ret == 1, "unsigned int with %u return code"); + + // Check 12 + my_strcpy(x, "aString 2747 D"); + ret = sscanf(x, "%s %d %c", y, &int_test, z); + CYG_TEST_PASS_FAIL( (my_strcmp(y, "aString")==0) && + (int_test == 2747) && + (z[0] == 'D'), "A few combinations #1"); + CYG_TEST_PASS_FAIL(ret == 3, "Combinations #1 return code"); + + + // Check 13 + my_strcpy(x, "-6 52 awurble 2747 xxx"); + ret = sscanf(x, "%d %u %s %2d %n %c", + &int_test, &int_test2, y, &int_test3, &int_test4, z); + CYG_TEST_PASS_FAIL( (int_test == -6) && (int_test2 == 52) && + (my_strcmp(y, "awurble")==0) && + (int_test3 == 27) && + (int_test4 == 16) && + (z[0] == '4'), "A few combinations #2"); + CYG_TEST_PASS_FAIL(ret == 5, "Combinations #2 return code"); + + +#ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + +// How much _relative_ error do we allow? +#define FLT_TOLERANCE 1.0e-3 + +#define MY_FABS(x) ((x) < 0.0 ? -(x) : (x)) + + CYG_TEST_INFO("Starting floating point specific tests"); + + { + float flt_test, wanted; + + // Check 14 + my_strcpy(x, "2.5"); + wanted = 2.5; + ret = sscanf(x, "%f", &flt_test); + CYG_TEST_PASS_FAIL( MY_FABS(flt_test - wanted) < + MY_FABS(wanted * FLT_TOLERANCE), + "Simple %f test #1" ); + CYG_TEST_PASS_FAIL( ret == 1, "Simple %f test #1 return code" ); + + + // Check 15 + my_strcpy(x, "-23.472345"); + wanted = -23.472345; + ret = sscanf(x, "%f", &flt_test); + CYG_TEST_PASS_FAIL( MY_FABS(flt_test - wanted) < + MY_FABS(wanted * FLT_TOLERANCE), + "Simple %f test #2" ); + CYG_TEST_PASS_FAIL( ret == 1, "Simple %f test #2 return code" ); + + // Check 16 + my_strcpy(x, "0.0"); + ret = sscanf(x, "%f", &flt_test); + CYG_TEST_PASS_FAIL( flt_test==0.0, "Simple %f test 0.0" ); + CYG_TEST_PASS_FAIL( ret == 1, "Simple %f test 0.0 return code" ); + + + // Check 17 + my_strcpy(x, "-2.6334e00"); + wanted = -2.6334; + ret = sscanf(x, "%e", &flt_test); + CYG_TEST_PASS_FAIL( MY_FABS(flt_test - wanted) < + MY_FABS(wanted * FLT_TOLERANCE), + "Simple %e test #1" ); + CYG_TEST_PASS_FAIL( ret == 1, "Simple %e test #1 return code" ); + + + // Check 18 + my_strcpy(x, "-2.56789e-06"); + wanted = -2.56789e-06; + ret = sscanf(x, "%e", &flt_test); + CYG_TEST_PASS_FAIL( MY_FABS(flt_test-wanted) < + MY_FABS(wanted * FLT_TOLERANCE), + "Simple %e test #2" ); + CYG_TEST_PASS_FAIL( ret == 1, "Simple %e test #2 return code" ); + + + // Check 19 + my_strcpy(x, "-2.12389e-06"); + wanted = -2.12389e-06; + ret = sscanf(x, "%g", &flt_test); + CYG_TEST_PASS_FAIL( MY_FABS(flt_test-wanted) < + MY_FABS(wanted * FLT_TOLERANCE), + "Simple %g test #1" ); + CYG_TEST_PASS_FAIL( ret == 1, "Simple %g test #1 return code" ); + + // Check 20 + my_strcpy(x, "1.3423345"); + wanted = 1.342335; + ret = sscanf(x, "%g", &flt_test); + CYG_TEST_PASS_FAIL( MY_FABS(flt_test-wanted) < + MY_FABS(wanted * FLT_TOLERANCE), + "Simple %g test #2" ); + CYG_TEST_PASS_FAIL( ret == 1, "Simple %g test #2 return code" ); + + + } // compound + +#else + CYG_TEST_PASS("Floating point tests skipped - not configured"); +#endif // ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT + + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "sscanf() function"); + +} // test() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) && defined(CYGFUN_LIBC_STDIO_ungetc) + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "sscanf() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); +} // main() + + +// EOF sscanf.c diff --git a/packages/language/c/libc/current/tests/stdio/stdiooutput.c b/packages/language/c/libc/current/tests/stdio/stdiooutput.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdio/stdiooutput.c @@ -0,0 +1,232 @@ +//================================================================= +// +// stdiooutput.c +// +// Testcase for miscellaneous C library output functions +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/9/4 +// Description: Contains testcode for C library stdio output +// functions +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include // All the stdio functions +#include // errno +#include // Testcase API +#include // C library initialisation + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + + +static void +test( CYG_ADDRWORD data ) +{ + int i; + + + // Check 1 + CYG_TEST_INFO("Expect: Hello printf world 42!"); + printf("Hello printf %s %d!\n", "world", 42); + + // Check 2 + CYG_TEST_INFO("Expect: This is fprintf 0x07f!"); + fprintf(stdout, "This is fprintf 0x%03x!\n", 0x7f); + + // Check 3 + CYG_TEST_INFO("Expect: char tests"); + fputc( 'c', stderr ); + putc( 'h', stdout ); + putchar( 'a' ); + fputc( 'r', stdout ); + putchar( ' ' ); + fflush(stdout); + putc( 't', stderr ); + fputc( 'e', stdout ); + putchar( 's' ); + fflush( NULL ); + putc( 't', stderr ); + fputc( 's', stderr ); + putchar( '\n' ); + + // Check 4 + CYG_TEST_INFO("Expect: puts test"); + puts("puts test"); + + // Check 5 + CYG_TEST_INFO("Expect: fputs test"); + fputs( "fputs test\n", stdout ); + + // Check 6 + CYG_TEST_INFO("Expect: fwrite test"); + fwrite( "fwrite test\n", 6, 2, stderr ); + + // Check 7 + CYG_TEST_INFO("Expect: wibble: No error"); + errno = ENOERR; + perror( "wibble" ); + + // Check 8 + CYG_TEST_INFO("Expect: Long string test!\nSitting on the side of the " + "highway waiting to catch speeding drivers, a State " + "Police Officer sees a car puttering along at 22 MPH. " + "He thinks to himself, \"This driver is just as " + "dangerous as a speeder!\" So he turns on his lights " + "and pulls the driver over. Approaching the car, " + "he notices that there are five old ladies-two in " + "the front seat and three in the back-wide eyed and " + "white as ghosts. The driver, obviously confused, says " + "to him, \"Officer, I don't understand, I was doing " + "exactly the speed limit! What seems to be the " + "problem?\" \"Ma'am,\" the officer replies, \"you " + "weren't speeding, but you should know that driving " + "slower than the speed limit can also be a danger to " + "other drivers.\" \"Slower than the speed limit? No " + "sir, I was doing the speed limit exactly...Twenty-two " + "miles an hour!\" the old woman says a bit proudly. " + "The State Police officer, trying to contain a " + "chuckle explains to her that \"22\" was the route " + "number, not the speed limit. A bit embarrassed, the " + "woman grinned and thanked the officer for pointing " + "out her error. \"But before I let you go, Ma'am, I " + "have to ask... Is everyone in this car OK? These " + "women seem awfully shaken and they haven't muttered a " + "single peep this whole time,\" the officer asks. \"Oh, " + "they'll be all right in a minute officer. We just got " + "off Route 119\"."); + + printf("Long string test!\nSitting on the side of the " + "highway waiting to catch speeding drivers, a State " + "Police Officer sees a car puttering along at %d MPH. " + "He thinks to himself, \"This driver is just as " + "dangerous as a speeder!\" So he turns on his lights " + "and pulls the driver over. Approaching the car, " + "he notices that there are five old ladies-two in " + "the front seat and three in the back-wide eyed and " + "white as ghosts. The driver, obviously confused, says " + "to him, \"Officer, I don't understand, I was doing " + "exactly the speed limit! What seems to be the " + "problem?\" \"Ma'am,\" the officer replies, \"you " + "weren't speeding, but you should know that driving " + "slower than the speed limit can also be a danger to " + "other drivers.\" \"Slower than the speed limit? No " + "sir, I was doing the speed limit exactly...Twenty-two " + "miles an hour!\" the old woman says a bit proudly. " + "The State Police officer, trying to contain a " + "chuckle explains to her that \"%d\" was the route " + "number, not the speed limit. A bit embarrassed, the " + "%coman grinned and thanked the officer for pointing " + "out her error. \"But before I let you go, Ma'am, I " + "have to ask... Is everyone in this car OK? These " + "women seem awfully shaken and they haven't muttered a " + "single peep this whole time,\" the officer asks. \"Oh, " + "they'll be all right in a minute officer. We just got " + "off Route %d\".\n", 22, 22, 'w', 119); + + // Check 9 + CYG_TEST_INFO("Expect: Another puts test, just for fun"); + puts("Another puts test, just for fun"); + + // Check 10 + CYG_TEST_INFO("Expect: more fputs testing"); + fputs( "more fputs testing\n", stderr ); + + // Check 11 + CYG_TEST_INFO("Expect all the numbers from 1 to 100 in 5 columns"); + for (i=1; i<101; ++i) { + + printf("%5d ", i); + if (i%5 == 0) + fputc( '\n', stdout); + + } // for + + CYG_TEST_PASS("Stdio output tests completed"); + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ + " for C library stdio output functions"); + +} // test() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C " + "library stdio output functions"); + CYG_TEST_INFO("The output of these tests needs to be manually " + "verified."); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this " + "configuration"); + +} // main() + +// EOF stdiooutput.c diff --git a/packages/language/c/libc/current/tests/stdlib/abs.c b/packages/language/c/libc/current/tests/stdlib/abs.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/abs.c @@ -0,0 +1,119 @@ +//================================================================= +// +// abs.c +// +// Testcase for C library abs() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library abs() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include +#include // C library initialisation + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + int x; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C " + "library abs() function"); + +#ifdef CYGPKG_LIBC + // Check 1 + x = 5; + CYG_TEST_PASS_FAIL( abs(x) == 5, "abs(5)"); + + // Check 2 + x = -5; + CYG_TEST_PASS_FAIL( abs(x) == 5, "abs(-5)"); + + // Check 3 + x = 12345; + CYG_TEST_PASS_FAIL( abs(x) == 12345, "abs(12345)"); + + // Check 4 + x = -23456; + CYG_TEST_PASS_FAIL( abs(x) == 23456, "abs(-23456"); + + // Check 5 + x = 0; + CYG_TEST_PASS_FAIL( abs(x) == 0, "abs(0)"); + + // Check 6 + x = INT_MAX; + CYG_TEST_PASS_FAIL( abs(x) == INT_MAX, "abs(INT_MAX)"); + + // Check 7 + x = -INT_MAX; + CYG_TEST_PASS_FAIL( abs(x) == INT_MAX, "abs(-INT_MAX)"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C " + "library abs() function"); + +} // main() + +// EOF abs.c diff --git a/packages/language/c/libc/current/tests/stdlib/atexit.c b/packages/language/c/libc/current/tests/stdlib/atexit.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/atexit.c @@ -0,0 +1,143 @@ +//================================================================= +// +// atexit.c +// +// Testcase for C library atexit() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/8/31 +// Description: Contains testcode for C library atexit() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include // Main header for stdlib functions +#include // Testcase API +#include // C library initialisation + + +// STATICS + +static int stage; +static int failed; + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +static void +myfun1( void ) +{ + if (!failed) + { + CYG_TEST_PASS_FAIL( stage==0, "first function called correctly" ); + stage=1; + } // if +} // myfun1() + +static void +myfun2( void ) +{ + if (!failed) + { + CYG_TEST_PASS_FAIL( stage==1, "Second function called correctly" ); + stage=2; + } // if +} // myfun2() + +static void +myfun3( void ) +{ + if (!failed) + { + CYG_TEST_PASS_FAIL( stage==2, "Second function called correctly" ); + stage=3; + } // if + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C " + "library atexit() function"); + +} // myfun3() + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C " + "library atexit() function"); + +#if defined(CYGPKG_LIBC) + + // we only have one test in us! We can only exit once :-) + + CYG_TEST_PASS_FAIL( atexit(&myfun3)==0, + "Simple registration of first atexit() function" ); + + CYG_TEST_PASS_FAIL( atexit(&myfun2)==0, + "Simple registration of second atexit() function" ); + + CYG_TEST_PASS_FAIL( atexit(&myfun1)==0, + "Simple registration of third atexit() function" ); + + return 0; +#else + CYG_TEST_PASS("Testing is not applicable to this configuration"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C " + "library atexit() function"); + +#endif // if defined(CYGPKG_LIBC) + +} // main() + +// EOF atexit.c diff --git a/packages/language/c/libc/current/tests/stdlib/atoi.c b/packages/language/c/libc/current/tests/stdlib/atoi.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/atoi.c @@ -0,0 +1,135 @@ +//================================================================= +// +// atoi.c +// +// Testcase for C library atoi() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library atoi() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC + +static char * +my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + +static void +test( CYG_ADDRWORD data ) +{ + char x[30]; + + // Check 1 + my_strcpy(x, "20"); + CYG_TEST_PASS_FAIL( atoi(x) == 20, "atoi(20)"); + + // Check 2 + my_strcpy(x, "1972"); + CYG_TEST_PASS_FAIL( atoi(x) == 1972, "atoi(1972)"); + + // Check 3 + my_strcpy(x, "-9876"); + CYG_TEST_PASS_FAIL( atoi(x) == -9876, "atoi(-9876)"); + + // Check 4 + my_strcpy(x, " -9876xxx"); + CYG_TEST_PASS_FAIL( atoi(x) == -9876, "atoi( -9876xxx)"); + + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "atoi() function"); +} // test() + +#endif // ifndef CYGPKG_LIBC + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "atoi() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); +} // main() + +// EOF atoi.c diff --git a/packages/language/c/libc/current/tests/stdlib/atol.c b/packages/language/c/libc/current/tests/stdlib/atol.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/atol.c @@ -0,0 +1,134 @@ +//================================================================= +// +// atol.c +// +// Testcase for C library atol() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library atol() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC +static char * +my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + +static void +test( CYG_ADDRWORD data ) +{ + char x[30]; + + // Check 1 + my_strcpy(x, "20"); + CYG_TEST_PASS_FAIL( atol(x) == 20, "atol(20)"); + + // Check 2 + my_strcpy(x, "1972"); + CYG_TEST_PASS_FAIL( atol(x) == 1972, "atol(1972)"); + + // Check 3 + my_strcpy(x, "-98765"); + CYG_TEST_PASS_FAIL( atol(x) == -98765, "atol(-98765)"); + + // Check 4 + my_strcpy(x, " -98765xxx"); + CYG_TEST_PASS_FAIL( atol(x) == -98765, "atol( -98765xxx)"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "atol() function"); +} // test() + +#endif // ifndef CYGPKG_LIBC + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "atol() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); +} // main() + +// EOF atol.c diff --git a/packages/language/c/libc/current/tests/stdlib/bsearch.c b/packages/language/c/libc/current/tests/stdlib/bsearch.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/bsearch.c @@ -0,0 +1,148 @@ +//================================================================= +// +// bsearch.c +// +// Testcase for C library bsearch() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library bsearch() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC +static int +Compar( const void *int1, const void *int2 ) +{ + if ( *(int*)int1 < *(int*)int2 ) + return -1; + else if ( *(int*)int1 == *(int*)int2 ) + return 0; + else + return 1; +} // Compar() +#endif + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + int key; + int *result; + int i_array[] = {1, 5, 8, 35, 84, 258, 1022, 1022, 5300, 7372, 9029}; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "bsearch() function"); + +#ifdef CYGPKG_LIBC + // Test 1 + key = 8; + result = bsearch(&key, i_array, sizeof(i_array)/sizeof(i_array[0]), + sizeof(i_array[0]), &Compar); + CYG_TEST_PASS_FAIL( (result!=NULL) && (*result == 8), + "bsearch() something in the middle"); + + // Test 2 + key = 5300; + result = bsearch(&key, i_array, sizeof(i_array)/sizeof(i_array[0]), + sizeof(i_array[0]), &Compar); + CYG_TEST_PASS_FAIL( (result!=NULL) && (*result == 5300), + "bsearch() something else in the middle"); + + // Test 3 + key = 1; + result = bsearch(&key, i_array, sizeof(i_array)/sizeof(i_array[0]), + sizeof(i_array[0]), &Compar); + CYG_TEST_PASS_FAIL( (result!=NULL) && (*result == 1), + "bsearch() first element"); + + // Test 4 + key = 9029; + result = bsearch(&key, i_array, sizeof(i_array)/sizeof(i_array[0]), + sizeof(i_array[0]), &Compar); + CYG_TEST_PASS_FAIL( (result!=NULL) && (*result == 9029), + "bsearch() last element"); + + // Test 5 + key = 1022; + result = bsearch(&key, i_array, sizeof(i_array)/sizeof(i_array[0]), + sizeof(i_array[0]), &Compar); + CYG_TEST_PASS_FAIL( (result!=NULL) && (*result == 1022), + "bsearch() duplicate element"); + + // Test 6 + key = 2; + result = bsearch(&key, i_array, sizeof(i_array)/sizeof(i_array[0]), + sizeof(i_array[0]), &Compar); + CYG_TEST_PASS_FAIL( result==NULL, "bsearch() nonexistent element"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "bsearch() function"); + +} // main() + + +// EOF bsearch.c diff --git a/packages/language/c/libc/current/tests/stdlib/div.c b/packages/language/c/libc/current/tests/stdlib/div.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/div.c @@ -0,0 +1,110 @@ +//================================================================= +// +// div.c +// +// Testcase for C library div() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library div() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + int num, denom; + div_t result; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "div() function"); + +#ifdef CYGPKG_LIBC + num = 10232; + denom = 43; + result = div(num, denom); + CYG_TEST_PASS_FAIL( (result.quot==237) && (result.rem==41), + "div( 10232, 43 )"); + + num = 4232; + denom = 2000; + result = div(num, denom); + CYG_TEST_PASS_FAIL( (result.quot==2) && (result.rem==232), + "div( 4232, 2000 )"); + + + num = 20; + denom = 20; + result = div(num, denom); + CYG_TEST_PASS_FAIL( (result.quot==1) && (result.rem==0), + "div( 20, 20 )"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "div() function"); + +} // main() + +// EOF div.c diff --git a/packages/language/c/libc/current/tests/stdlib/getenv.c b/packages/language/c/libc/current/tests/stdlib/getenv.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/getenv.c @@ -0,0 +1,156 @@ +//================================================================= +// +// getenv.c +// +// Testcase for C library getenv() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/8/31 +// Description: Contains testcode for C library getenv() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include // Main header for stdlib functions +#include // Testcase API +#include // C library initialisation + +// GLOBALS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_ENVIRONMENT) +extern char **environ; // Standard environment definition +#endif + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + +static int +my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char *str; + + char *env1[] = { NULL }; + char *env2[] = { "WIBBLE=fred", NULL }; + char *env3[] = { "PATH=/usr/local/bin:/usr/bin", + "HOME=/home/fred", + "TEST=1234=5678", + "home=hatstand", + NULL }; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C " + "library getenv() function"); + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_ENVIRONMENT) + // Check 1 + environ = (char **)&env1; + str = getenv("wibble"); + CYG_TEST_PASS_FAIL( str==NULL, "Simple getenv() with empty environ" ); + + // Check 2 + environ = (char **)&env2; + str = getenv("WIBBLE"); + CYG_TEST_PASS_FAIL( (str != NULL) && !my_strcmp(str, "fred"), + "Simple getenv()" ); + + // Check 3 + str = getenv("wibble"); + CYG_TEST_PASS_FAIL( str==NULL, + "Simple getenv() for something not in the " + "environment" ); + + // Check 4 + environ = (char **)&env3; + str = getenv("PATH"); + CYG_TEST_PASS_FAIL( (str!= NULL) && + !my_strcmp(str,"/usr/local/bin:/usr/bin"), + "Multiple string environment" ); + + // Check 5 + str = getenv("PATh"); + CYG_TEST_PASS_FAIL( str==NULL, "getenv() for something not in the " + "environment for multiple string environment" ); + + // Check 6 + str = getenv("home"); + CYG_TEST_PASS_FAIL( (str != NULL) && !my_strcmp(str, "hatstand"), + "Case-sensitive environment names" ); + + // Check 7 + str = getenv("TEST"); + CYG_TEST_PASS_FAIL( (str != NULL) && !my_strcmp(str, "1234=5678"), + "environment value containing '='" ); + + +#else + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_ENVIRONMENT) + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C " + "library getenv() function"); + +} // main() + +// EOF getenv.c diff --git a/packages/language/c/libc/current/tests/stdlib/labs.c b/packages/language/c/libc/current/tests/stdlib/labs.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/labs.c @@ -0,0 +1,113 @@ +//================================================================= +// +// labs.c +// +// Testcase for C library labs() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library labs() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + int x; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "labs() function"); + +#ifdef CYGPKG_LIBC + // Check 1 + x = 5; + CYG_TEST_PASS_FAIL( labs(x) == 5, "labs(5)"); + + // Check 2 + x = -5; + CYG_TEST_PASS_FAIL( labs(x) == 5, "labs(-5)"); + + // Check 3 + x = 12345; + CYG_TEST_PASS_FAIL( labs(x) == 12345, "labs(12345)"); + + // Check 4 + x = -23456; + CYG_TEST_PASS_FAIL( labs(x) == 23456, "labs(-23456"); + + // Check 5 + x = 3456789; + CYG_TEST_PASS_FAIL( labs(x) == 3456789, "labs(3456789"); + + // Check 6 + x = -23456789; + CYG_TEST_PASS_FAIL( labs(x) == 23456789, "labs(-23456789"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "labs() function"); +} // main() + +// EOF labs.c diff --git a/packages/language/c/libc/current/tests/stdlib/ldiv.c b/packages/language/c/libc/current/tests/stdlib/ldiv.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/ldiv.c @@ -0,0 +1,124 @@ +//================================================================= +// +// ldiv.c +// +// Testcase for C library ldiv() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library ldiv() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + long num, denom; + ldiv_t result; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "ldiv() function"); + +#ifdef CYGPKG_LIBC + num = 10232; + denom = 43; + result = ldiv(num, denom); + CYG_TEST_PASS_FAIL( (result.quot==237) && (result.rem==41), + "ldiv( 10232, 43 )"); + + num = 4232; + denom = 2000; + result = ldiv(num, denom); + CYG_TEST_PASS_FAIL( (result.quot==2) && (result.rem==232), + "ldiv( 4232, 2000 )"); + + + num = 20; + denom = 20; + result = ldiv(num, denom); + CYG_TEST_PASS_FAIL( (result.quot==1) && (result.rem==0), + "ldiv( 20, 20 )"); + + num = 90123456; + denom = 12345678; + result = ldiv(num, denom); + CYG_TEST_PASS_FAIL( (result.quot==7) && (result.rem==3703710), + "ldiv( 90123456, 12345678 )"); + + num = 90123456; + denom = 123; + result = ldiv(num, denom); + CYG_TEST_PASS_FAIL( (result.quot==732711) && (result.rem==3), + "ldiv( 90123456, 123 )"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "ldiv() function"); + +} // main() + +// EOF ldiv.c diff --git a/packages/language/c/libc/current/tests/stdlib/malloc1.c b/packages/language/c/libc/current/tests/stdlib/malloc1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/malloc1.c @@ -0,0 +1,236 @@ +//================================================================= +// +// malloc1.c +// +// Testcase for C library malloc(), calloc() and free() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library malloc(), calloc() and +// free() functions +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// INCLUDES + +#include // config header for C library so we can know size + // of malloc pool +#include +#include +#include // C library initialisation + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +int +main( int argc, char *argv[] ) +{ +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + int *i; + char *str, *str2, *str3; + int j; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "malloc(), calloc() and free() functions"); + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + + // Test 1 + i = (int *) malloc( sizeof(int) ); + + // check if it should fit into pool + if (sizeof(int) > CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE) + { + // didn't fit into pool, so should be NULL + CYG_TEST_PASS_FAIL( i == NULL, + "1 int malloc with no space left works" ); + } + else + { + // since it should fit into pool, we can fiddle with i + *i=-12345; + CYG_TEST_PASS_FAIL( i && (*i==-12345), + "1 int malloc with space left works" ); + free(i); + } // else + + // Test 2 + str=(char *) malloc( 4096 ); + + if ( 4096 > CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE) + { + // didn't fit into pool, so should be NULL + CYG_TEST_PASS_FAIL( str == NULL,"4K string with no space left works" ); + } + else + { + // since it should fit into pool, we can fiddle with it. + for (j=0; j<1024; j++) + { + str[j*4] = 'f'; + str[(j*4)+1] = 'r'; + str[(j*4)+2] = 'e'; + str[(j*4)+3] = 'd'; + } // for + + for (j=0; j<1024; j++) + { + if ( ((str[j*4] != 'f') || + (str[(j*4)+1] != 'r') || + (str[(j*4)+2] != 'e') || + (str[(j*4)+3] != 'd')) ) + break; + } // for + + // did j reach the top? + CYG_TEST_PASS_FAIL( j==1024, "4K string with space left works" ); + + free(str); + } // else + + + // Test 3 + str=(char *) calloc( 2, 1024 ); + + if ( 2048 > CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE) + { + // didn't fit into pool, so should be NULL + CYG_TEST_PASS_FAIL( str == NULL, + "calloc 2K string with no space left works" ); + } + else + { + // check its zeroed + for ( j=0; j<2048; j++ ) + { + if (str[j] != 0) + break; + } // for + + CYG_TEST_PASS_FAIL( j==2048, "calloc 2K string is cleared" ); + + // since it should fit into pool, we can fiddle with it. + for (j=0; j<512; j++) + { + str[j*4] = 'j'; + str[(j*4)+1] = 'i'; + str[(j*4)+2] = 'f'; + str[(j*4)+3] = 'l'; + } // for + + for (j=0; j<512; j++) + { + if ( ((str[j*4] != 'j') || + (str[(j*4)+1] != 'i') || + (str[(j*4)+2] != 'f') || + (str[(j*4)+3] != 'l')) ) + break; + } // for + + // did j reach the top? + CYG_TEST_PASS_FAIL( j==512, + "calloc 2K string - with space left works" ); + + free(str); + } // else + + + // Test 4 + str=(char *)malloc( CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE+1 ); + + CYG_TEST_PASS_FAIL( str==NULL, "malloc too much data returns NULL" ); + + // Test 5 + str=(char *)calloc( 1, CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE+1 ); + CYG_TEST_PASS_FAIL( str==NULL, "calloc too much data returns NULL" ); + + // Test 6 + str=(char *)malloc(0); + str=(char *)calloc(0, 1); + str=(char *)calloc(1, 0); + str=(char *)calloc(0, 0); + // simply shouldn't barf by this point + + CYG_TEST_PASS_FAIL( 1, "malloc and calloc of 0 bytes doesn't crash" ); + + // Test 7 + str = (char *)malloc(10); + i = (int *)malloc(sizeof(int)); + str2 = (char *)malloc(10); + + str3=(char *)i; + + CYG_TEST_PASS_FAIL( ((str3 <= str-sizeof(int)) || (str >= &str[10])) && + ((str3 <= str2-sizeof(int)) || (str3 >= &str2[10])) && + ((str+10 <= str2) || (str2+10 <= str)), + "Objects don't overlap" ); + + // Test 8 + + free(i); + i=(int *)malloc(sizeof(int)*2); + str3=(char *)i; + + CYG_TEST_PASS_FAIL( ((str3 <= str-sizeof(int)) || (str3 >= &str[10])) && + ((str3 <= str2-sizeof(int)) || (str3 >= &str2[10])) && + ((&str[10] <= str2) || (&str2[10] <= str)), + "Objects don't overlap when middle is freed" ); + + free(i); + free(str); + free(str2); + +#else + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "malloc(), calloc() and free() functions"); +} // main() + +// EOF malloc1.c diff --git a/packages/language/c/libc/current/tests/stdlib/malloc2.c b/packages/language/c/libc/current/tests/stdlib/malloc2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/malloc2.c @@ -0,0 +1,240 @@ +//================================================================= +// +// malloc2.c +// +// Stress testcase for C library malloc(), calloc() and free() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode to stress-test C library malloc(), +// calloc() and free() functions +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// CYG_TEST_HEARTBEAT=120 + +// INCLUDES + +#include // config header for C library so we can know size + // of malloc pool +#include +#include +#include // C library initialisation + + +// CONSTANTS + +#define NUM_ITERATIONS 1000 + +// GLOBALS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) +static int problem=0; +#endif + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + +static void * +safe_malloc( size_t size ) +{ + void *ptr; + + ptr=malloc(size); + + if (ptr==NULL) + { + CYG_TEST_FAIL( "malloc returned NULL! " + "Perhaps the allocator doesn't coalesce?" ); + problem++; + } // if + + return ptr; +} // safe_malloc() + + +static void * +safe_calloc( size_t size ) +{ + void *ptr; + int i; + + ptr=calloc(size,1); + + if (ptr==NULL) + { + CYG_TEST_FAIL( "calloc returned NULL! " + "Perhaps the allocator doesn't coalesce" ); + problem++; + } // if + else + { + for (i=0; i < size; i++) + { + if (((char *)ptr)[i] != 0) + { + CYG_TEST_FAIL("calloc didn't clear data completely"); + problem++; + return ptr; + } // if + } // for + } // else + + return ptr; +} // safe_calloc() + + +static void +fill_with_data( char *buf, int size ) +{ + int i; + + for (i=0; i < size; i++) + buf[i] = 'f'; + + for (i=0; i < size; i++) + if (buf[i] != 'f') + { + CYG_TEST_FAIL( "data written to buffer does not compare " + "correctly! #1" ); + problem++; + return; + } // if + + + for (i=0; i < size; i++) + buf[i] = 'z'; + + for (i=0; i < size; i++) + if (buf[i] != 'z') + { + CYG_TEST_FAIL( "data written to buffer does not compare " + "correctly! #2" ); + problem++; + return; + } // if + +} // fill_with_data() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + +int +main( int argc, char *argv[] ) +{ +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + char *str1, *str2, *str3; + int j; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting stress tests from testcase " __FILE__ " for C " + "library malloc(), calloc() and free() functions"); + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + + if ( CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE < 300 ) + { + CYG_TEST_FAIL_FINISH("This testcase cannot safely be used with a " + "memory pool for malloc less than 300 bytes"); + } // if + + + for ( j=1; j < NUM_ITERATIONS; j++) + { +// if ((j % 100) == 0) +// CYG_TEST_STILL_ALIVE( j, "Multiple mallocs and frees continuing" ); + + + str1 = (char *)safe_malloc(50); + fill_with_data( str1, 50 ); + str2 = (char *)safe_calloc(11); + fill_with_data( str2, 11 ); + str3 = (char *)safe_malloc(32); + fill_with_data( str3, 32 ); + + free(str2); + free(str1); + + str2 = (char *)safe_calloc(11); + fill_with_data( str2, 11 ); + free(str2); + + str1 = (char *)safe_calloc(50); + fill_with_data( str1, 50 ); + free(str3); + + str3 = (char *)safe_malloc(32); + fill_with_data( str3, 32 ); + free(str1); + + str2 = (char *)safe_calloc(11); + fill_with_data( str2, 11 ); + str1 = (char *)safe_malloc(50); + fill_with_data( str1, 50 ); + + free(str3); + free(str1); + free(str2); + + if (problem != 0) + break; + } // for + + // Did it completely successfully? + if (j==NUM_ITERATIONS) + CYG_TEST_PASS("Stress test completed successfully"); + +#else + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + + + CYG_TEST_FINISH("Finished stress tests from testcase " __FILE__ " for C " + "library malloc(), calloc() and free() functions"); +} // main() + +// EOF malloc2.c diff --git a/packages/language/c/libc/current/tests/stdlib/malloc3.c b/packages/language/c/libc/current/tests/stdlib/malloc3.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/malloc3.c @@ -0,0 +1,178 @@ +//================================================================= +// +// malloc3.c +// +// Testcase for C library malloc(), calloc() and free() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library malloc(), calloc() and +// free() functions +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// INCLUDES + +#include // config header for C library so we can know size + // of malloc pool +#include +#include +#include // C library initialisation + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) +static int +fill_with_data( char *buf, int size ) +{ + int i; + + for (i=0; i < size; i++) + buf[i] = 'f'; + + for (i=0; i < size; i++) + if (buf[i] != 'f') { + CYG_TEST_FAIL( "data written to buffer does not compare " + "correctly! #1" ); + return 0; + } // if + + + for (i=0; i < size; i++) + buf[i] = 'z'; + + for (i=0; i < size; i++) + if (buf[i] != 'z') { + CYG_TEST_FAIL( "data written to buffer does not compare " + "correctly! #2" ); + return 0; + } // if + + return 1; +} // fill_with_data() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + +int +main( int argc, char *argv[] ) +{ +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + char *str; + int size = CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE/2; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "malloc() and free() functions"); + CYG_TEST_INFO("This checks allocation and freeing of large regions"); + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + + // Don't allocate all the memory at once - leave room for any structures + // used to manage the memory + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 1"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ), "allocation 1 usability"); + free( str ); + + + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 2"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ), "allocation 2 usability"); + free( str ); + + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 3"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ), "allocation 3 usability"); + free( str ); + + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 4"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ), "allocation 4 usability"); + free( str ); + + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 5"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ), "allocation 5 usability"); + free( str ); + + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 6"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ), "allocation 6 usability"); + free( str ); + + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 7"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ), "allocation 7 usability"); + free( str ); + + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 8"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ), "allocation 8 usability"); + free( str ); + + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 9"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ), "allocation 9 usability"); + free( str ); + + str = (char *)malloc( size ); + CYG_TEST_PASS_FAIL( str != NULL, "allocation 10"); + CYG_TEST_PASS_FAIL( fill_with_data( str, size ),"allocation 10 usability"); + free( str ); + + +#else + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "malloc() and free() functions"); +} // main() + +// EOF malloc3.c diff --git a/packages/language/c/libc/current/tests/stdlib/qsort.c b/packages/language/c/libc/current/tests/stdlib/qsort.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/qsort.c @@ -0,0 +1,123 @@ +//================================================================= +// +// qsort.c +// +// Testcase for C library qsort() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library qsort() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC +static int +Compar( const void *int1, const void *int2 ) +{ + if ( *(int*)int1 < *(int*)int2 ) + return -1; + else if ( *(int*)int1 == *(int*)int2 ) + return 0; + else + return 1; +} // Compar() +#endif + + +int +main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + unsigned int ctr; + int fail=0; + int i_array_sorted[] = {1, 5, 8, 35, 84, 258, 1022, 5300, 7372, 9029}; + int i_array_unsorted[] = {258, 8, 7372, 1, 5, 9029, 1022, 35, 5300, 84}; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "qsort() function"); + +#ifdef CYGPKG_LIBC + qsort(i_array_unsorted, + sizeof(i_array_unsorted) / sizeof(i_array_unsorted[0]), + sizeof(int), &Compar); + + for (ctr = 0; + ctr < (sizeof(i_array_unsorted) / sizeof(i_array_unsorted[0])); + ++ctr) + { + if (i_array_sorted[ctr] != i_array_unsorted[ctr]) + ++fail; + } // for + + CYG_TEST_PASS_FAIL( fail == 0, "qsort() sorts correctly" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "qsort() function"); + +} // main() + +// EOF qsort.c diff --git a/packages/language/c/libc/current/tests/stdlib/rand1.c b/packages/language/c/libc/current/tests/stdlib/rand1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/rand1.c @@ -0,0 +1,129 @@ +//================================================================= +// +// rand1.c +// +// Testcase for C library rand() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library rand() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif // if defined(CYGPKG_LIBC) + + +// CONSTANTS + +// This is the max allowable hits, where a hit is an element +// of a random array being the same as index+1 or index+2 +#define TOLERANCE 2 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +static void +test( CYG_ADDRWORD data ) +{ + int ctr; + static int array[1024]; + int hits=0; + + for (ctr=0; ctr<1024; ctr++) + array[ctr] = rand(); + + for (ctr=0; ctr< 1021; ctr++) + if ((array[ctr]==array[ctr+1]) || + (array[ctr]==array[ctr+2]) || + (array[ctr]==array[ctr+3])) + hits++; + + CYG_TEST_PASS_FAIL(hits <= TOLERANCE, "Simple test for rand() repetition"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "rand() function"); +} // test() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "rand() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); +} // main() + +// EOF rand1.c diff --git a/packages/language/c/libc/current/tests/stdlib/rand2.c b/packages/language/c/libc/current/tests/stdlib/rand2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/rand2.c @@ -0,0 +1,138 @@ +//================================================================= +// +// rand2.c +// +// Testcase for C library rand() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library rand() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include // CYGNUM_LIBC_RAND_SEED +#include +#include +#include // C library initialisation + + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif // if defined(CYGPKG_LIBC) + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +static void +test( CYG_ADDRWORD data ) +{ + static int rand_data1[100]; + static int rand_data2[100]; + int count; + int fail=0; + + // Test that rand starts with the seed as CYGNUM_LIBC_RAND_SEED + + for ( count=0; count < 100; ++count ) + { + rand_data1[count] = rand(); + } // for + + // set seed to CYGNUM_LIBC_RAND_SEED + srand(CYGNUM_LIBC_RAND_SEED); + + for ( count=0; count < 100; ++count ) + { + rand_data2[count] = rand(); + } // for + + for ( count=0; count < 100; ++count ) + { + if (rand_data1[count] != rand_data2[count]) + ++fail; + } // for + + CYG_TEST_PASS_FAIL(fail==0, "rand() has seed initialised to " + "CYGNUM_LIBC_RAND_SEED"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C " + "library rand() function"); +} // test() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C " + "library rand() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this " + "configuration"); +} // main() + + +// EOF rand2.c diff --git a/packages/language/c/libc/current/tests/stdlib/rand3.c b/packages/language/c/libc/current/tests/stdlib/rand3.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/rand3.c @@ -0,0 +1,162 @@ +//================================================================= +// +// rand3.c +// +// Testcase for C library rand() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library rand() function. This tests +// that random numbers are distributed well between 0 and +// RAND_MAX +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif // if defined(CYGPKG_LIBC) + + +// CONSTANTS + +#define NUM_BUCKETS 1024 // how many categories to define +#define TEST_LENGTH 100000 // how many samples to take +#define BUCKET_DIFF_TOLERANCE 4 // how much the buckets can vary at the end + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +static int +my_abs(int i) +{ + return (i < 0) ? -i : i; +} // my_abs() + +static void +test( CYG_ADDRWORD data ) +{ + static cyg_uint8 rand_bucket[NUM_BUCKETS]; // divide the space from + // 0..RAND_MAX into + // NUM_BUCKETS categories + cyg_ucount32 count; // loop variable + int r; // temp for rand() variable + cyg_ucount32 sum; // sum of bucket contents + cyg_ucount32 average; // average of bucket contents + + // initialise all buckets to 0 - do it ourselves rather than rely on memset + for ( count=0; count < NUM_BUCKETS; ++count ) + { + rand_bucket[ count ] = 0; + } // for + + for ( count=0; count < TEST_LENGTH; ++count ) + { + r = rand(); + ++rand_bucket[ r % NUM_BUCKETS ]; + } // for + + for ( sum=0, count=0; count < NUM_BUCKETS; ++count ) + { + sum += rand_bucket[ count ]; + } // for + + average = sum / NUM_BUCKETS; + + for ( count=0; count < NUM_BUCKETS; ++count ) + { + if ( my_abs(rand_bucket[count] - average) > BUCKET_DIFF_TOLERANCE ) + break; + } // for + + CYG_TEST_PASS_FAIL( (count >= NUM_BUCKETS), "even distribution of rand()"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "rand() function"); +} // test() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "rand() function"); + + CYG_TEST_INFO("This test tests the distribution of random numbers and"); + CYG_TEST_INFO("may take some time"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); +} // main() + + +// EOF rand3.c diff --git a/packages/language/c/libc/current/tests/stdlib/realloc.c b/packages/language/c/libc/current/tests/stdlib/realloc.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/realloc.c @@ -0,0 +1,174 @@ +//================================================================= +// +// realloc.c +// +// Testcase for C library realloc() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/8/31 +// Description: Contains testcode for C library realloc() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// INCLUDES + +#include // config header for C library so we can know size + // of malloc pool +#include +#include +#include // C library initialisation + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + +static const char alphabet[]="abcdefghijklmnopqrstuvwxyz{-}[]#';:@~!$^&*()" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; + +static int +compare_with_alphabet( char *buf, int size, int offset ) +{ + int i, buf_offset; + + for (i=offset, buf_offset=0; + buf_offset < size; + buf_offset++,i++ ) { + + if ( i==sizeof(alphabet)-1 ) + i=0; + + if ( buf[buf_offset] != alphabet[i] ) { + CYG_TEST_FAIL( "buffer has not retained correct data!"); + return 0; // fail + } // if + } // for + + return 1; // success +} // compare_with_alphabet() + +static int +fill_with_alphabet( char *buf, int size, int offset ) +{ + int i, buf_offset; + + for (i=offset, buf_offset=0; + buf_offset < size; + buf_offset++,i++ ) { + + if ( i==sizeof(alphabet)-1 ) + i=0; + + buf[buf_offset] = alphabet[i]; + + } // for + + return compare_with_alphabet( buf, size, offset); // be sure +} // fill_with_alphabet() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + +int +main( int argc, char *argv[] ) +{ +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + char *str; + int size = CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE/2; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "realloc() function"); + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + + str = (char *)realloc( NULL, size ); + CYG_TEST_PASS_FAIL( str != NULL, "realloc doing only allocation"); + CYG_TEST_PASS_FAIL( fill_with_alphabet( str, size, 0 ), + "allocation usability"); + + str = (char *)realloc( str, 0 ); + CYG_TEST_PASS_FAIL( str == NULL, "realloc doing implicit free" ); + + str = (char *)realloc( NULL, size/2 ); + CYG_TEST_PASS_FAIL( str != NULL, "realloc doing allocation to half size"); + CYG_TEST_PASS_FAIL( fill_with_alphabet( str, size/2, 5 ), + "half allocation usability"); + + str = (char *)realloc( str, size ); + CYG_TEST_PASS_FAIL( str != NULL, + "reallocing allocation back to normal size"); + CYG_TEST_PASS_FAIL( compare_with_alphabet(str, size/2, 5), + "after realloc to normal size, old contents kept" ); + CYG_TEST_PASS_FAIL( fill_with_alphabet( str, size, 3 ), + "reallocation normal size usability"); + + str = (char *)realloc( str, size/4 ); + CYG_TEST_PASS_FAIL( str != NULL, "reallocing allocation to quarter size"); + CYG_TEST_PASS_FAIL( compare_with_alphabet(str, size/4, 3), + "after realloc to quarter size, old contents kept" ); + CYG_TEST_PASS_FAIL( fill_with_alphabet( str, size/4, 1 ), + "reallocation quarter size usability"); + + CYG_TEST_PASS_FAIL( realloc( str, size*100 ) == NULL, + "reallocing allocation that is too large" ); + CYG_TEST_PASS_FAIL( compare_with_alphabet( str, size/4, 1 ), + "Checking old contents maintained despite failure" ); + + str = (char *)realloc( str, 0 ); + CYG_TEST_PASS_FAIL( str == NULL, "realloc doing implicit free again" ); + + +#else + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "realloc() function"); +} // main() + +// EOF realloc.c diff --git a/packages/language/c/libc/current/tests/stdlib/srand.c b/packages/language/c/libc/current/tests/stdlib/srand.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/srand.c @@ -0,0 +1,159 @@ +//================================================================= +// +// srand.c +// +// Testcase for C library srand() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library srand() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + + +// CONSTANTS + +// Max cross correlation value of two sequences of +// different seed +#define X_CORREL 10 + +// size of arrays to use for testing +#define TEST_SIZE 1024 + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_RAND) + +static void +test( CYG_ADDRWORD data ) +{ + int ctr; + static int array_1[TEST_SIZE]; + static int array_2[TEST_SIZE]; + static int array_3[TEST_SIZE]; + int hits; + int fail; + + + srand(3); + for (ctr=0; ctr // Configuration header + +// INCLUDES + +#include +#include +#include +#include +#include // C library initialisation + + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif + + +// FUNCTIONS + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC +static char * +my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + +static void +test( CYG_ADDRWORD data ) +{ + char x[30]; + long z; + char *endptr; + + my_strcpy(x, "20"); + CYG_TEST_PASS_FAIL( strtol(x, (char**)NULL, 10) == 20, + "Simple strtol(20 ,...)" ); + + my_strcpy(x, "1972100"); + CYG_TEST_PASS_FAIL( strtol(x, (char**)NULL, 10) == 1972100, + "Simple strtol(1972100, ..." ); + + my_strcpy(x, "0xFFEE"); + z = strtol(x, (char**)NULL, 16); + CYG_TEST_PASS_FAIL(z == 65518, "Hex base strtol()"); + + my_strcpy(x, "100111011"); + z = strtol(x, (char**)NULL, 2); + CYG_TEST_PASS_FAIL(z == 315, "Binary base strtol()"); + + my_strcpy(x, "10372"); + z = strtol(x, (char**)NULL, 8); + CYG_TEST_PASS_FAIL(z == 4346, "Octal base strtol()" ); + + my_strcpy(x, "317823"); + z = strtol(x, (char**)NULL, 8); + CYG_TEST_PASS_FAIL(z == 207, "Partial string" ); + + my_strcpy(x, " 53ab823"); + z = strtol(x, &endptr, 10); + CYG_TEST_PASS_FAIL((z == 53) && (endptr==&x[3]), "Correct end pointer" ); + + my_strcpy(x, "-479"); + z = strtol(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL(z == -479, "Negative string"); + + my_strcpy(x, "+4796"); + z = strtol(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL(z == 4796, "Positive string"); + + my_strcpy(x, ""); + z = strtol(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL(z == 0, "Empty string"); + + my_strcpy(x, ""); + z = strtol(x, &endptr, 10); + CYG_TEST_PASS_FAIL((z == 0) && (endptr==x), + "Empty string sets endptr correctly"); + + my_strcpy(x, " "); + z = strtol(x, &endptr, 10); + CYG_TEST_PASS_FAIL((z == 0) && (endptr==x), + "White space only string sets endptr correctly"); + + my_strcpy(x, "0XFFEE"); + z = strtol(x, (char**)NULL, 0); + CYG_TEST_PASS_FAIL(z == 65518, "Base 0 but hex"); + + my_strcpy(x, "\t 0629"); + z = strtol(x, (char**)NULL, 0); + CYG_TEST_PASS_FAIL(z == 50, "Base 0 but octal"); + + my_strcpy(x, "42"); + z = strtol(x, (char**)NULL, 0); + CYG_TEST_PASS_FAIL(z == 42, "Base 0 but decimal"); + + my_strcpy(x, "hello"); + z = strtol(x, &endptr, 0); + CYG_TEST_PASS_FAIL((z == 0) && (endptr==x), + "endptr set correctly on conversion failure"); + + my_strcpy(x, "z2f"); + z = strtol(x, (char**)NULL, 36); + CYG_TEST_PASS_FAIL(z == 45447, "Base==36"); + + my_strcpy(x, "h547324"); + z = strtol(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL(z == 0, "No valid number string"); + + my_strcpy(x, "545425876654547324"); + z = strtol(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL( (z == LONG_MAX) && (errno == ERANGE), + "Number out of range"); + + my_strcpy(x, "-545425876654547324"); + z = strtol(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL( (z == LONG_MIN) && (errno == ERANGE), + "Number out of range"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strtol() function"); +} // test() + +#endif // ifndef CYGPKG_LIBC + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strtol() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); +} // main() + +// EOF strtol.c diff --git a/packages/language/c/libc/current/tests/stdlib/strtoul.c b/packages/language/c/libc/current/tests/stdlib/strtoul.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/stdlib/strtoul.c @@ -0,0 +1,207 @@ +//================================================================= +// +// strtoul.c +// +// Testcase for C library strtoul() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strtoul() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include +#include +#include +#include +#include // C library initialisation + + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC +static char * +my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + +static void +test( CYG_ADDRWORD data ) +{ + char x[30]; + unsigned long z; + char *endptr; + + my_strcpy(x, "20"); + CYG_TEST_PASS_FAIL( strtoul(x, (char**)NULL, 10) == 20, + "Simple strtoul(20 ,...)" ); + + my_strcpy(x, "1972100"); + CYG_TEST_PASS_FAIL( strtoul(x, (char**)NULL, 10) == 1972100, + "Simple strtoul(1972100, ..." ); + + my_strcpy(x, "0xFFEE"); + z = strtoul(x, (char**)NULL, 16); + CYG_TEST_PASS_FAIL(z == 65518, "Hex base strtoul()"); + + my_strcpy(x, "100111011"); + z = strtoul(x, (char**)NULL, 2); + CYG_TEST_PASS_FAIL(z == 315, "Binary base strtoul()"); + + my_strcpy(x, "10372"); + z = strtoul(x, (char**)NULL, 8); + CYG_TEST_PASS_FAIL(z == 4346, "Octal base strtoul()" ); + + my_strcpy(x, "317823"); + z = strtoul(x, (char**)NULL, 8); + CYG_TEST_PASS_FAIL(z == 207, "Partial string" ); + + my_strcpy(x, " 53ab823"); + z = strtoul(x, &endptr, 10); + CYG_TEST_PASS_FAIL( (z == 53) && (endptr==&x[3]), "Correct end pointer" ); + + my_strcpy(x, "-479"); + z = strtoul(x, (char**)NULL, 0); + CYG_TEST_PASS_FAIL( (z == (unsigned long) -479), + "Negative string"); + + my_strcpy(x, "+4796"); + z = strtoul(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL(z == 4796, "Positive string"); + + my_strcpy(x, ""); + z = strtoul(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL(z == 0, "Empty string"); + + my_strcpy(x, ""); + z = strtoul(x, &endptr, 10); + CYG_TEST_PASS_FAIL( (z == 0) && (endptr==x), + "Empty string sets endptr correctly"); + + my_strcpy(x, " "); + z = strtoul(x, &endptr, 10); + CYG_TEST_PASS_FAIL( (z == 0) && (endptr==x), + "White space only string sets endptr correctly"); + + my_strcpy(x, "0XFFEE"); + z = strtoul(x, (char**)NULL, 0); + CYG_TEST_PASS_FAIL(z == 65518, "Base 0 but hex"); + + my_strcpy(x, "\t 0629"); + z = strtoul(x, (char**)NULL, 0); + CYG_TEST_PASS_FAIL(z == 50, "Base 0 but octal"); + + my_strcpy(x, "42"); + z = strtoul(x, (char**)NULL, 0); + CYG_TEST_PASS_FAIL(z == 42, "Base 0 but decimal"); + + my_strcpy(x, "hello"); + z = strtoul(x, &endptr, 0); + CYG_TEST_PASS_FAIL((z == 0) && (endptr==x), + "endptr set correctly on conversion failure"); + + my_strcpy(x, "z2f"); + z = strtoul(x, (char**)NULL, 36); + CYG_TEST_PASS_FAIL(z == 45447, "Base==36"); + + my_strcpy(x, "h547324"); + z = strtoul(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL(z == 0, "No valid number string"); + + my_strcpy(x, "545425876654547324"); + z = strtoul(x, (char**)NULL, 10); + CYG_TEST_PASS_FAIL( (z == ULONG_MAX) && (errno == ERANGE), + "Number out of range"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strtoul() function"); +} // test() + +#endif // ifndef CYGPKG_LIBC + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strtoul() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); +} // main() + +// EOF strtoul.c diff --git a/packages/language/c/libc/current/tests/string/memchr.c b/packages/language/c/libc/current/tests/string/memchr.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/memchr.c @@ -0,0 +1,133 @@ +//================================================================= +// +// memchr.c +// +// Testcase for C library memchr() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library memchr() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() +#endif + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[] = "Your feeble skills are no match for the power of " + "the dark side!"; + void *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "memchr() function"); + +#ifdef CYGPKG_LIBC + // Check 1 + ret = memchr(x, (int)'k', sizeof(x)); + CYG_TEST_PASS_FAIL( (my_strcmp(ret, x+13) == 0), "Simple test 1" ); + + // Check 2 + ret = memchr(x, (int)'p', sizeof(x)); + CYG_TEST_PASS_FAIL( (my_strcmp(ret, x+40) == 0), "Simple test 2" ); + + // Check 3 + ret = memchr(x, (int)'z', sizeof(x)); + CYG_TEST_PASS_FAIL( (ret == NULL), "Simple test 3" ); + + // Check 4 (boundary condition) + ret = memchr(x, (int)'\0', sizeof(x)); + CYG_TEST_PASS_FAIL( ret == (x+sizeof(x)-1), "Boundary test 1" ); + + // Check 5 (boundary condition) + ret = memchr(x, (int)'\0', sizeof(x)-1); + CYG_TEST_PASS_FAIL( ret == NULL, "Boundary test 2" ); + + // Check 6 (boundary condition) + ret = memchr( (void *)"", (int)'\0', 0 ); + CYG_TEST_PASS_FAIL( ret == NULL, "Boundary test 3" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "memchr() function"); +} // main() + +// EOF memchr.c diff --git a/packages/language/c/libc/current/tests/string/memcmp1.c b/packages/language/c/libc/current/tests/string/memcmp1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/memcmp1.c @@ -0,0 +1,163 @@ +//================================================================= +// +// memcmp1.c +// +// Testcase for C library memcmp() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library memcmp() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "memcmp() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "I have become, comfortably numb"); + my_strcpy(y, "I have become, comfortably numb"); + CYG_TEST_PASS_FAIL( (memcmp(x, y, my_strlen(x)) == 0), "Simple compare"); + + + // Check 2 + my_strcpy(x, ""); + my_strcpy(y, ""); + CYG_TEST_PASS_FAIL( (memcmp(x, y, 0) == 0), "Simple empty string compare"); + + + // Check 3 + my_strcpy(x, "..shall snuff it. And the Lord did grin"); + my_strcpy(y, "..shall snuff it. And the Lord did grio"); + CYG_TEST_PASS_FAIL( (memcmp(x, y, my_strlen(x)) < 0), + "Memory less than #1" ); + + + // Check 4 + my_strcpy(x, "A reading from the Book of Armaments, Chapter 4, " + "Verses 16 to 20:"); + my_strcpy(y, "Bless this, O Lord, that with it thou mayst blow thine " + "enemies to tiny bits, in thy mercy."); + CYG_TEST_PASS_FAIL( (memcmp(x, y, my_strlen(x)) < 0), + "Memory less than #2"); + + // Check 5 + my_strcpy(x, "Lobeth this thy holy hand grenade at thy foe"); + my_strcpy(y, "Lobeth this thy holy hand grenade at thy fod"); + CYG_TEST_PASS_FAIL( (memcmp(x, y, my_strlen(x)) > 0), + "Memory greater than #1" ); + + + // Check 6 + my_strcpy(y, "Three shall be the number of the counting and the"); + my_strcpy(x, "number of the counting shall be three"); + CYG_TEST_PASS_FAIL( (memcmp(x, y, my_strlen(x)) > 0), + "Memory greater than #2" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "memcmp() function"); +} // main() + + + +// EOF memcmp1.c diff --git a/packages/language/c/libc/current/tests/string/memcmp2.c b/packages/language/c/libc/current/tests/string/memcmp2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/memcmp2.c @@ -0,0 +1,148 @@ +//================================================================= +// +// memcmp2.c +// +// Testcase for C library memcmp() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library memcmp() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char z[300]; + int ctr; + int fail; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "memcmp() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + +#ifdef CYGPKG_LIBC + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) + { + my_strcpy(x, "Spare a talent for an old ex-leper"); + my_strcpy(y, "Spare a talent for an old ex-leper"); + my_strcpy(z, "I was hopping along, when suddenly he"); + + if (memcmp(x, y,my_strlen(x)) != 0) + { + fail = 1; + break; + } + if (memcmp(x, z, my_strlen(z)) == 0) + { + fail = 1; + break; + } // if + } // for + + CYG_TEST_PASS_FAIL( (fail==0), "Robustness test"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "memcmp() function"); +} // main() + + +// EOF memcmp2.c diff --git a/packages/language/c/libc/current/tests/string/memcpy1.c b/packages/language/c/libc/current/tests/string/memcpy1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/memcpy1.c @@ -0,0 +1,172 @@ +//================================================================= +// +// memcpy1.c +// +// Testcase for C library memcpy() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library memcpy() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + void *ret, *ptr1, *ptr2; + char *c_ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "memcpy() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + ptr1 = x; + ptr2 = y; + my_strcpy(x, "Great shot kid! That was one in a million!"); + ret = memcpy(ptr2, ptr1, my_strlen(x) + 1); + CYG_TEST_PASS_FAIL( (my_strcmp(x, ptr2)==0), "Simple copy" ); + + // Check return value + CYG_TEST_PASS_FAIL( (my_strcmp(ret, ptr2)==0), "Simple copy return value"); + + + // Check 2 + ptr1 = x; + ptr2 = y; + my_strcpy(x, ""); + my_strcpy(y, "xxxx"); // Bogus val to get overwritten + ret = memcpy(ptr2, ptr1, 1); + c_ret = ret; + if ((*c_ret == '\0') && (y[0] == '\0') && (y[1] == 'x')) + CYG_TEST_PASS("Simple copy with boundary check worked"); + else + CYG_TEST_FAIL("Simple copy with boundary check failed"); + + // Check 3 + ptr1 = x; + ptr2 = y; + my_strcpy(x, "xxxx"); + my_strcpy(y, "yyyy"); + ret = memcpy(ptr1, ptr2, 0); + c_ret = ret; + if ((*c_ret =='x') && (x[0] == 'x')) + CYG_TEST_PASS("Simple copy with size=0 worked"); + else + CYG_TEST_FAIL("Simple copy with size=0 failed"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "memcpy() function"); +} // main() + + +// EOF memcpy1.c diff --git a/packages/language/c/libc/current/tests/string/memcpy2.c b/packages/language/c/libc/current/tests/string/memcpy2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/memcpy2.c @@ -0,0 +1,159 @@ +//================================================================= +// +// memcpy2.c +// +// Testcase for C library memcpy() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library memcpy() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + void *ret, *ptr1, *ptr2; + char *c_ret; + int ctr; + int fail; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "memcpy() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + + +#ifdef CYGPKG_LIBC + + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) { + my_strcpy(x, "in the land of Mordor"); + my_strcpy(y, " "); + ptr1 = x; + ptr2 = y; + ret = memcpy(ptr2, ptr1, my_strlen(x) + 1); + c_ret = ret; + if ((my_strcmp(y, x) != 0) || (my_strcmp(c_ret, x)!=0)) { + fail = 1; + break; + } + } + + CYG_TEST_PASS_FAIL( (fail == 0), "Robustness test"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "memcpy() function"); +} // main() + + +// EOF memcpy2.c diff --git a/packages/language/c/libc/current/tests/string/memmove1.c b/packages/language/c/libc/current/tests/string/memmove1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/memmove1.c @@ -0,0 +1,195 @@ +//================================================================= +// +// memmove1.c +// +// Testcase for C library memmove() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library memmove() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + void *ret, *ptr1, *ptr2; + char *c_ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "memmove() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + ptr1 = x; + ptr2 = y; + my_strcpy(x, "Great shot kid! That was one in a million!"); + ret = memmove(ptr2, ptr1, my_strlen(x) + 1); + CYG_TEST_PASS_FAIL( (my_strcmp(x, ptr2)==0), "Simple copy" ); + + // Check return value + CYG_TEST_PASS_FAIL( (my_strcmp(ret, ptr2)==0), "Simple copy return value"); + + + // Check 2 + ptr1 = x; + ptr2 = y; + my_strcpy(x, ""); + my_strcpy(y, "xxxx"); // Bogus val to get overwritten + ret = memmove(ptr2, ptr1, 1); + c_ret = ret; + if ((*c_ret == '\0') && (y[0] == '\0') && (y[1] == 'x')) + CYG_TEST_PASS("Simple copy with boundary check worked"); + else + CYG_TEST_FAIL("Simple copy with boundary check failed"); + + // Check 3 + ptr1 = x; + ptr2 = y; + my_strcpy(x, "xxxx"); + my_strcpy(y, "yyyy"); + ret = memmove(ptr1, ptr2, 0); + c_ret = ret; + if ((*c_ret =='x') && (x[0] == 'x')) + CYG_TEST_PASS("Simple copy with size=0 worked"); + else + CYG_TEST_FAIL("Simple copy with size=0 failed"); + + // Check 4 + ptr1 = &x[0]; + ptr2 = &x[1]; + my_strcpy(x, "abcd"); + ret = memmove(ptr1, ptr2, 4); + c_ret = ret; + if ( (c_ret==x) && (my_strcmp(x, "bcd")==0) ) + CYG_TEST_PASS("Overlapping copy #1 worked"); + else + CYG_TEST_FAIL("Overlapping copy #1 worked"); + + // Check 5 + ptr1 = &x[0]; + ptr2 = &x[4]; + my_strcpy(x, "abcdefghijk"); + ret = memmove(ptr1, ptr2, 6); + c_ret = ret; + if ( (c_ret==x) && (my_strcmp(x, "efghijghijk")==0) ) + CYG_TEST_PASS("Overlapping copy #2 worked"); + else + CYG_TEST_FAIL("Overlapping copy #2 worked"); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "memmove() function"); +} // main() + + +// EOF memmove1.c diff --git a/packages/language/c/libc/current/tests/string/memmove2.c b/packages/language/c/libc/current/tests/string/memmove2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/memmove2.c @@ -0,0 +1,159 @@ +//================================================================= +// +// memmove2.c +// +// Testcase for C library memmove() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library memmove() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + void *ret, *ptr1, *ptr2; + char *c_ret; + int ctr; + int fail; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "memmove() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + + +#ifdef CYGPKG_LIBC + + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) { + my_strcpy(x, "in the land of Mordor"); + my_strcpy(y, " "); + ptr1 = x; + ptr2 = y; + ret = memmove(ptr2, ptr1, my_strlen(x) + 1); + c_ret = ret; + if ((my_strcmp(y, x) != 0) || (my_strcmp(c_ret, x)!=0)) { + fail = 1; + break; + } + } + + CYG_TEST_PASS_FAIL( (fail == 0), "Robustness test"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "memmove() function"); +} // main() + + +// EOF memmove2.c diff --git a/packages/language/c/libc/current/tests/string/memset.c b/packages/language/c/libc/current/tests/string/memset.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/memset.c @@ -0,0 +1,140 @@ +//================================================================= +// +// memset.c +// +// Testcase for C library memset() function +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library memset() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + + +#ifdef CYGPKG_LIBC +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "memset() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, " "); + ret = memset(x, 'X', 5); + if ((my_strcmp(x, "XXXXX ") == 0) && (ret == x)) + CYG_TEST_PASS("Simple memset"); + else + CYG_TEST_FAIL("Simple memset"); + + // Check 2 + my_strcpy(x, "XXXXX "); + ret = memset(x, 'Y', 0); + if ((my_strcmp(x, "XXXXX ") == 0) && (ret == x)) + CYG_TEST_PASS("Boundary case of 0 bytes"); + else + CYG_TEST_FAIL("Boundary case of 0 bytes"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "memset() function"); + +} // main() + +// EOF memset.c diff --git a/packages/language/c/libc/current/tests/string/strcat1.c b/packages/language/c/libc/current/tests/string/strcat1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strcat1.c @@ -0,0 +1,162 @@ +//================================================================= +// +// strcat1.c +// +// Testcase for C library strcat() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strcat() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strcat() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "One ring to rule them all."); + my_strcpy(y, "One ring to find them."); + ret = strcat(x, y); + if ( my_strcmp(x, "One ring to rule them all.One ring to find them.")==0 ) + CYG_TEST_PASS("Simple concatenation"); + else + CYG_TEST_FAIL("Simple concatenation"); + // Check return val + CYG_TEST_PASS_FAIL( ( ret == x ), "Simple concatenation return value" ); + + + // Check 2 + my_strcpy(x, "One ring to bring them all,"); + my_strcpy(y, ""); + ret = strcat(x, y); + if ( my_strcmp(x, "One ring to bring them all,")==0 ) + CYG_TEST_PASS("Concatenation of empty string"); + else + CYG_TEST_FAIL("Concatenation of empty string"); + // Check return val + CYG_TEST_PASS_FAIL( ( ret == x ), + "Concatenation of empty string return value" ); + + + // Check 3 + my_strcpy(x, "and in the darkness bind them"); + my_strcpy(y, ""); + ret = strcat(y, x); + if ( my_strcmp(x, "and in the darkness bind them")==0 ) + CYG_TEST_PASS("Concatenation to empty string"); + else + CYG_TEST_FAIL("Concatenation to empty string"); + // Check return val + CYG_TEST_PASS_FAIL( ( ret == y ), + "Concatenation to empty string return value" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strcat() function"); +} // main() + + +// EOF strcat1.c diff --git a/packages/language/c/libc/current/tests/string/strcat2.c b/packages/language/c/libc/current/tests/string/strcat2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strcat2.c @@ -0,0 +1,150 @@ +//================================================================= +// +// strcat2.c +// +// Testcase for C library strcat() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strcat() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; + int ctr; + int fail; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strcat() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + +#ifdef CYGPKG_LIBC + + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) + { + my_strcpy(x, "in the land of Mordor, "); + my_strcpy(y, "where the shadows lie."); + ret = strcat(x, y); + if ((my_strcmp(x, "in the land of Mordor, where the shadows lie.")!=0)) + { + fail = 1; + break; + } // if + if (ret != x) + { + fail = 1; + break; + } // if + } + CYG_TEST_PASS_FAIL( (fail == 0), "Robustness test passed" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strcat() function"); + +} // main() + + +// EOF strcat2.c diff --git a/packages/language/c/libc/current/tests/string/strchr.c b/packages/language/c/libc/current/tests/string/strchr.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strchr.c @@ -0,0 +1,132 @@ +//================================================================= +// +// strchr.c +// +// Testcase for C library strchr() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strchr() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() +#endif + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[] = "Your feeble skills are no match for the power of " + "the dark side!"; + char empty_str[] = ""; + char *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strchr() function"); + +#ifdef CYGPKG_LIBC + + // Check 1 + ret = strchr(x, (int)'k'); + CYG_TEST_PASS_FAIL( (my_strcmp(ret, x+13) == 0), "Simple test 1" ); + + // Check 2 + ret = strchr(x, (int)'p'); + CYG_TEST_PASS_FAIL( (my_strcmp(ret, x+40) == 0), "Simple test 2" ); + + // Check 3 + ret = strchr(x, (int)'z'); + CYG_TEST_PASS_FAIL( (ret == NULL), "Simple test 3" ); + + // Check 4 (boundary condition) + ret = strchr(x, (int)'\0'); + CYG_TEST_PASS_FAIL( ret == (x+sizeof(x)-1), "Boundary test 1" ); + + // Check 5 (boundary condition) + ret = strchr( empty_str, (int)'\0' ); + CYG_TEST_PASS_FAIL( ret == empty_str, "Boundary test 2" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strchr() function"); +} // main() + +// EOF strchr.c diff --git a/packages/language/c/libc/current/tests/string/strcmp1.c b/packages/language/c/libc/current/tests/string/strcmp1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strcmp1.c @@ -0,0 +1,153 @@ +//================================================================= +// +// strcmp1.c +// +// Testcase for C library strcmp() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strcmp() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + + +#ifdef CYGPKG_LIBC +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strcmp() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "I have become, comfortably numb"); + my_strcpy(y, "I have become, comfortably numb"); + CYG_TEST_PASS_FAIL( (strcmp(x, y) == 0), "Simple compare"); + + + // Check 2 + my_strcpy(x, ""); + my_strcpy(y, ""); + CYG_TEST_PASS_FAIL( (strcmp(x, y) == 0), "Simple empty string compare"); + + + // Check 3 + my_strcpy(x, "..shall snuff it. And the Lord did grin"); + my_strcpy(y, "..shall snuff it. And the Lord did grio"); + CYG_TEST_PASS_FAIL( (strcmp(x, y) < 0), + "Memory less than #1" ); + + + // Check 4 + my_strcpy(x, "A reading from the Book of Armaments, Chapter 4, " + "Verses 16 to 20:"); + my_strcpy(y, "Bless this, O Lord, that with it thou mayst blow thine " + "enemies to tiny bits, in thy mercy."); + CYG_TEST_PASS_FAIL( (strcmp(x, y) < 0), + "Memory less than #2"); + + // Check 5 + my_strcpy(x, "Lobeth this thy holy hand grenade at thy foe"); + my_strcpy(y, "Lobeth this thy holy hand grenade at thy fod"); + CYG_TEST_PASS_FAIL( (strcmp(x, y) > 0), + "Memory greater than #1" ); + + + // Check 6 + my_strcpy(y, "Three shall be the number of the counting and the"); + my_strcpy(x, "number of the counting shall be three"); + CYG_TEST_PASS_FAIL( (strcmp(x, y) > 0), + "Memory greater than #2" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strcmp() function"); +} // main() + + + +// EOF strcmp1.c diff --git a/packages/language/c/libc/current/tests/string/strcmp2.c b/packages/language/c/libc/current/tests/string/strcmp2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strcmp2.c @@ -0,0 +1,140 @@ +//================================================================= +// +// strcmp2.c +// +// Testcase for C library strcmp() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strcmp() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + + +#ifdef CYGPKG_LIBC +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char z[300]; + int ctr; + int fail; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strcmp() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + +#ifdef CYGPKG_LIBC + + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) + { + my_strcpy(x, "Spare a talent for an old ex-leper"); + my_strcpy(y, "Spare a talent for an old ex-leper"); + my_strcpy(z, "I was hopping along, when suddenly he"); + + if (strcmp(x, y) != 0) + { + fail = 1; + break; + } + if (strcmp(x, z) == 0) + { + fail = 1; + break; + } // if + } // for + + CYG_TEST_PASS_FAIL( (fail==0), "Robustness test"); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strcmp() function"); +} // main() + + +// EOF strcmp2.c diff --git a/packages/language/c/libc/current/tests/string/strcoll1.c b/packages/language/c/libc/current/tests/string/strcoll1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strcoll1.c @@ -0,0 +1,154 @@ +//================================================================= +// +// strcoll1.c +// +// Testcase for C library strcoll() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strcoll() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + + +#ifdef CYGPKG_LIBC +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strcoll() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "I have become, comfortably numb"); + my_strcpy(y, "I have become, comfortably numb"); + CYG_TEST_PASS_FAIL( (strcoll(x, y) == 0), "Simple compare"); + + + // Check 2 + my_strcpy(x, ""); + my_strcpy(y, ""); + CYG_TEST_PASS_FAIL( (strcoll(x, y) == 0), "Simple empty string compare"); + + + // Check 3 + my_strcpy(x, "..shall snuff it. And the Lord did grin"); + my_strcpy(y, "..shall snuff it. And the Lord did grio"); + CYG_TEST_PASS_FAIL( (strcoll(x, y) < 0), + "Memory less than #1" ); + + + // Check 4 + my_strcpy(x, "A reading from the Book of Armaments, Chapter 4, " + "Verses 16 to 20:"); + my_strcpy(y, "Bless this, O Lord, that with it thou mayst blow thine " + "enemies to tiny bits, in thy mercy."); + CYG_TEST_PASS_FAIL( (strcoll(x, y) < 0), + "Memory less than #2"); + + // Check 5 + my_strcpy(x, "Lobeth this thy holy hand grenade at thy foe"); + my_strcpy(y, "Lobeth this thy holy hand grenade at thy fod"); + CYG_TEST_PASS_FAIL( (strcoll(x, y) > 0), + "Memory greater than #1" ); + + + // Check 6 + my_strcpy(y, "Three shall be the number of the counting and the"); + my_strcpy(x, "number of the counting shall be three"); + CYG_TEST_PASS_FAIL( (strcoll(x, y) > 0), + "Memory greater than #2" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strcoll() function"); +} // main() + + + +// EOF strcoll1.c diff --git a/packages/language/c/libc/current/tests/string/strcoll2.c b/packages/language/c/libc/current/tests/string/strcoll2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strcoll2.c @@ -0,0 +1,124 @@ +//================================================================= +// +// strcoll2.c +// +// Testcase for C library strcoll() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strcoll() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + +int main( int argc, char *argv[] ) +{ + char x[300]; + char y[300]; + char z[300]; + int ctr; + int fail; + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strcoll() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) + { + my_strcpy(x, "Spare a talent for an old ex-leper"); + my_strcpy(y, "Spare a talent for an old ex-leper"); + my_strcpy(z, "I was hopping along, when suddenly he"); + + if (strcoll(x, y) != 0) + { + fail = 1; + break; + } + if (strcoll(x, z) == 0) + { + fail = 1; + break; + } // if + } // for + + CYG_TEST_PASS_FAIL( (fail==0), "Robustness test"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strcoll() function"); +} // main() + + +// EOF strcoll2.c diff --git a/packages/language/c/libc/current/tests/string/strcpy1.c b/packages/language/c/libc/current/tests/string/strcpy1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strcpy1.c @@ -0,0 +1,141 @@ +//================================================================= +// +// strcpy1.c +// +// Testcase for C library strcpy() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strcpy() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC + +// Functions to avoid having to use libc strings + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strcpy() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "Nine rings for men doomed to die"); + ret = strcpy(y, "Nine rings for men doomed to die"); + CYG_TEST_PASS_FAIL( (my_strcmp(x, y) == 0), "Simple copy" ); + // Check return value + CYG_TEST_PASS_FAIL( (y == ret), "Simple copy return value" ); + + + // Check 2 + my_strcpy(x, ""); + my_strcpy(y, "Seven rings for the dwarves in their halls of stone"); + ret = strcpy(y, x); + CYG_TEST_PASS_FAIL( (my_strcmp(y, "") == 0), "Copy empty string" ); + // Check return value + CYG_TEST_PASS_FAIL( (y == ret), "Copy empty string return value" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strcpy() function"); + +} // main() + +// EOF strcpy1.c diff --git a/packages/language/c/libc/current/tests/string/strcpy2.c b/packages/language/c/libc/current/tests/string/strcpy2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strcpy2.c @@ -0,0 +1,143 @@ +//================================================================= +// +// strcpy2.c +// +// Testcase for C library strcpy() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strcpy() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; + int ctr; + int fail; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strcpy() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + +#ifdef CYGPKG_LIBC + + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) { + my_strcpy(x, "Green plastic watering can, "); + my_strcpy(y, "for her fake Chineese rubber plant"); + ret = strcpy(x, y); + if ( (my_strcmp(x, "for her fake Chineese rubber plant") != 0) || + ( ret != x ) ) + { + fail = 1; + break; + } // if + } // for + CYG_TEST_PASS_FAIL( (fail == 0), "Robustness test" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strcpy() function"); +} // main() + +// EOF strcpy2.c diff --git a/packages/language/c/libc/current/tests/string/strcspn.c b/packages/language/c/libc/current/tests/string/strcspn.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strcspn.c @@ -0,0 +1,162 @@ +//================================================================= +// +// strcspn.c +// +// Testcase for C library strcspn() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strcspn() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC + +// Functions to avoid having to use libc strings + +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + int ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strcspn() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "ah blow my nose at you, so-called Arthur king!"); + my_strcpy(y, "A"); + ret = strcspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 34), "Simple strcspn() for one char" ); + + + // Check 2 + my_strcpy(x, "Not bad for a little fur ball. You! Stay here."); + my_strcpy(y, "fd"); + ret = strcspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 6), "Simple strcspn() for two chars" ); + + // Check 3 (boundary condition) + my_strcpy(x, ""); + my_strcpy(y, "zx"); + ret = strcspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 0), "Empty string to search"); + + + // Check 4 (boundary condition) + my_strcpy(x, "So, if she weighs the same as a duck, she's made of wood!"); + my_strcpy(y, "zx"); + ret = strcspn(x, y); + CYG_TEST_PASS_FAIL( (ret == my_strlen(x)), "Characters not in string" ); + + // Check 5 (boundary condition) + my_strcpy(x, "So, if she weighs the same as a duck, she's made of wood!"); + my_strcpy(y, "S"); + ret = strcspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 0), "First character of string" ); + + // Check 6 (boundary condition) + my_strcpy(x, "So, if she weighs the same as a duck, she's made of wood!"); + my_strcpy(y, "!"); + ret = strcspn(x, y); + CYG_TEST_PASS_FAIL( (ret == (my_strlen(x) - 1)), + "Penultimate character of string" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strcspn() function"); +} // main() + +// EOF strcspn.c diff --git a/packages/language/c/libc/current/tests/string/strlen.c b/packages/language/c/libc/current/tests/string/strlen.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strlen.c @@ -0,0 +1,103 @@ +//================================================================= +// +// strlen.c +// +// Testcase for C library strlen() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strlen() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[]=""; + char y[]="The force is strong in this one"; + char z[]="I told you. We're an anarcho-cynicalist commune"; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strlen() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + CYG_TEST_PASS_FAIL( (strlen(x) == 0), "strlen(\"\")" ); + + CYG_TEST_PASS_FAIL( (strlen(y) == 31), "Simple length check #1" ); + + CYG_TEST_PASS_FAIL( (strlen(z) == 47), "Simple length check #2" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strlen() function"); +} // main() + + +// EOF strlen.c diff --git a/packages/language/c/libc/current/tests/string/strncat1.c b/packages/language/c/libc/current/tests/string/strncat1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strncat1.c @@ -0,0 +1,188 @@ +//================================================================= +// +// strncat1.c +// +// Testcase for C library strncat() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strncat() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +#ifdef CYGPKG_LIBC + +// Functions to avoid having to use libc strings + +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "memmove() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "One ring to rule them all."); + my_strcpy(y, "One ring to find them."); + ret = strncat(x, y, my_strlen(y)+1); + if ( my_strcmp(x, "One ring to rule them all.One ring to find them.")==0 ) + CYG_TEST_PASS("Simple concatenation"); + else + CYG_TEST_FAIL("Simple concatenation"); + // Check return val + CYG_TEST_PASS_FAIL( ( ret == x ), "Simple concatenation return value" ); + + + // Check 2 + my_strcpy(x, "One ring to bring them all,"); + my_strcpy(y, ""); + ret = strncat(x, y, my_strlen(y)+1); + if ( my_strcmp(x, "One ring to bring them all,")==0 ) + CYG_TEST_PASS("Concatenation of empty string"); + else + CYG_TEST_FAIL("Concatenation of empty string"); + // Check return val + CYG_TEST_PASS_FAIL( ( ret == x ), + "Concatenation of empty string return value" ); + + + // Check 3 + my_strcpy(x, "and in the darkness bind them"); + my_strcpy(y, ""); + ret = strncat(y, x, my_strlen(x)+1 ); + if ( my_strcmp(x, "and in the darkness bind them")==0 ) + CYG_TEST_PASS("Concatenation to empty string"); + else + CYG_TEST_FAIL("Concatenation to empty string"); + // Check return val + CYG_TEST_PASS_FAIL( ( ret == y ), + "Concatenation to empty string return value" ); + + // Check 4 + my_strcpy(x, "in the land of "); + my_strcpy(y, "Mordor, where the shadows lie"); + ret = strncat(x, y, 6 ); + if ( my_strcmp(x, "in the land of Mordor")==0 ) + CYG_TEST_PASS("Concatenation of partial string string"); + else + CYG_TEST_FAIL("Concatenation of partial string"); + // Check return val + CYG_TEST_PASS_FAIL( ( ret == x ), + "Concatenation to empty string return value" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strncat() function"); +} // main() + + +// EOF strncat1.c diff --git a/packages/language/c/libc/current/tests/string/strncat2.c b/packages/language/c/libc/current/tests/string/strncat2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strncat2.c @@ -0,0 +1,163 @@ +//================================================================= +// +// strncat2.c +// +// Testcase for C library strncat() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strncat() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; + int ctr; + int fail; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strncat() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + +#ifdef CYGPKG_LIBC + + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) + { + my_strcpy(x, "in the land of Mordor, "); + my_strcpy(y, "where the shadows lie."); + ret = strncat(x, y, my_strlen(y)+1 ); + if ((my_strcmp(x, "in the land of Mordor, where the shadows lie.")!=0)) + { + fail = 1; + break; + } // if + if (ret != x) + { + fail = 1; + break; + } // if + } + CYG_TEST_PASS_FAIL( (fail == 0), "Robustness test passed" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strncat() function"); + +} // main() + + +// EOF strncat2.c diff --git a/packages/language/c/libc/current/tests/string/strncpy1.c b/packages/language/c/libc/current/tests/string/strncpy1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strncpy1.c @@ -0,0 +1,164 @@ +//================================================================= +// +// strncpy1.c +// +// Testcase for C library strncpy() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strncpy() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strncpy() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "Nine rings for men doomed to die"); + ret = strncpy(y, "Nine rings for men doomed to die", my_strlen(x)); + CYG_TEST_PASS_FAIL( (my_strcmp(x, y) == 0), "Simple copy" ); + // Check return value + CYG_TEST_PASS_FAIL( (y == ret), "Simple copy return value" ); + + + // Check 2 + my_strcpy(x, ""); + my_strcpy(y, "Seven rings for the dwarves in their halls of stone"); + ret = strncpy(y, x, 1); + CYG_TEST_PASS_FAIL( (my_strcmp(y, "") == 0), "Copy empty string" ); + // Check return value + CYG_TEST_PASS_FAIL( (y == ret), "Copy empty string return value" ); + + // Check 3 + my_strcpy(x, ""); + my_strcpy(y, "Seven rings for the dwarves in their halls of stone"); + ret = strncpy(y, x, 0); + if (my_strcmp(y, "Seven rings for the dwarves in their halls of stone") == 0) + CYG_TEST_PASS("Copy 0 characters"); + else + CYG_TEST_FAIL("Copy 0 characters"); + // Check return value + CYG_TEST_PASS_FAIL( (y == ret), "Copy empty string return value" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strncpy() function"); + +} // main() + +// EOF strncpy1.c diff --git a/packages/language/c/libc/current/tests/string/strncpy2.c b/packages/language/c/libc/current/tests/string/strncpy2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strncpy2.c @@ -0,0 +1,155 @@ +//================================================================= +// +// strncpy2.c +// +// Testcase for C library strncpy() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strncpy() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC + +// Functions to avoid having to use libc strings + +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; + int ctr; + int fail; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strncpy() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + +#ifdef CYGPKG_LIBC + + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) { + my_strcpy(x, "Green plastic watering can, "); + my_strcpy(y, "for her fake Chineese rubber plant"); + ret = strncpy(x, y, my_strlen(y)+1); + if ( (my_strcmp(x, "for her fake Chineese rubber plant") != 0) || + ( ret != x ) ) + { + fail = 1; + break; + } // if + } // for + CYG_TEST_PASS_FAIL( (fail == 0), "Robustness test" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strncpy() function"); +} // main() + +// EOF strncpy2.c diff --git a/packages/language/c/libc/current/tests/string/strpbrk.c b/packages/language/c/libc/current/tests/string/strpbrk.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strpbrk.c @@ -0,0 +1,143 @@ +//================================================================= +// +// strpbrk.c +// +// Testcase for C library strpbrk() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strpbrk() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + + +#ifdef CYGPKG_LIBC +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strpbrk() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "I will not have my fwends widiculed by the common soldiewy"); + my_strcpy(y, "zpm1"); // Finds the 'm' + ret = strpbrk(x, y); + CYG_TEST_PASS_FAIL( (ret == &x[16]), "Simple strpbrk()" ); + + // Check 2 + my_strcpy(x, "Not bad for a little fur ball. You! Stay here."); + my_strcpy(y, "zx"); + ret = strpbrk(x, y); + CYG_TEST_PASS_FAIL( (ret == NULL), "Letters not found"); + + // Check 3 (boundary condition) + my_strcpy(x, ""); + my_strcpy(y, "zx"); + ret = strpbrk(x, y); + CYG_TEST_PASS_FAIL( (ret == NULL), "String to search empty" ); + + // Check 4 (boundary condition) + my_strcpy(x, "zx"); + my_strcpy(y, ""); + ret = strpbrk(x, y); + CYG_TEST_PASS_FAIL( (ret == NULL), "Empty search string" ); + + // Check 5 (boundary condition) + my_strcpy(x, ""); + my_strcpy(y, ""); + ret = strpbrk(x, y); + CYG_TEST_PASS_FAIL( (ret == NULL), "Both strings empty" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strpbrk() function"); + +} // main() + +// EOF strpbrk.c diff --git a/packages/language/c/libc/current/tests/string/strrchr.c b/packages/language/c/libc/current/tests/string/strrchr.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strrchr.c @@ -0,0 +1,138 @@ +//================================================================= +// +// strrchr.c +// +// Testcase for C library strrchr() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strrchr() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + + +#ifdef CYGPKG_LIBC +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strrchr() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "I will not have my fwends widiculed by the common soldiewy"); + ret = strrchr(x, (int) 'c'); + CYG_TEST_PASS_FAIL( (ret == &x[43]), "Simple strrchr()" ); + + // Check 2 + my_strcpy(x, "Not bad for a little fur ball. You! Stay here."); + ret = strrchr(x, (int) 'z'); + CYG_TEST_PASS_FAIL( (ret == NULL), "Character not found"); + + // Check 3 (boundary condition) + my_strcpy(x, ""); + ret = strrchr(x, (int) 'c'); + CYG_TEST_PASS_FAIL( (ret == NULL), "String to search empty" ); + + // Check 4 (boundary condition) + my_strcpy(x, "zx"); + ret = strrchr(x, '\0'); + CYG_TEST_PASS_FAIL( (ret == &x[2]), "Null search character" ); + + // Check 5 (boundary condition) + my_strcpy(x, ""); + ret = strrchr(x, '\0'); + CYG_TEST_PASS_FAIL( (ret == x), "String empty and null search char" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strrchr() function"); + +} // main() + +// EOF strrchr.c diff --git a/packages/language/c/libc/current/tests/string/strspn.c b/packages/language/c/libc/current/tests/string/strspn.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strspn.c @@ -0,0 +1,151 @@ +//================================================================= +// +// strspn.c +// +// Testcase for C library strspn() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strspn() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + +#ifdef CYGPKG_LIBC +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + int ret; +#endif + + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strspn() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "ah blow my nose at you, so-called Arthur king!"); + my_strcpy(y, "wolbah "); + ret = strspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 8), "Simple strspn() #1" ); + + + // Check 2 + my_strcpy(x, "Not bad for a little fur ball. You! Stay here."); + my_strcpy(y, "litea rofdbN"); + ret = strspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 22), "Simple strspn() #2" ); + + // Check 3 + my_strcpy(x, "Not bad for a little fur ball. You! Stay here."); + my_strcpy(y, "litearofdbN"); + ret = strspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 3), "Simple strspn() #3"); + + // Check 4 (boundary condition) + my_strcpy(x, "Not bad for a little fur ball. You! Stay here."); + my_strcpy(y, "litearofdb"); + ret = strspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 0), "First character not in string"); + + + // Check 5 (boundary condition) + my_strcpy(x, "So, if she weighs the same as a duck, she's made of wood!"); + my_strcpy(y, "zx"); + ret = strspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 0), "No characters in string" ); + + // Check 6 (boundary condition) + my_strcpy(x, ""); + my_strcpy(y, "qwerty"); + ret = strspn(x, y); + CYG_TEST_PASS_FAIL( (ret == 0), "Empty search string" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strspn() function"); +} // main() + +// EOF strspn.c diff --git a/packages/language/c/libc/current/tests/string/strstr.c b/packages/language/c/libc/current/tests/string/strstr.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strstr.c @@ -0,0 +1,146 @@ +//================================================================= +// +// strstr.c +// +// Testcase for C library strstr() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strstr() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + + +// Functions to avoid having to use libc strings + + +#ifdef CYGPKG_LIBC +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() +#endif + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + char *ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strstr() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "I will not have my fwends widiculed by the common soldiewy"); + my_strcpy(y, "fwends"); + ret = strstr(x, y); + CYG_TEST_PASS_FAIL( (ret == &x[19]), "Simple strstr()" ); + + + // Check 2 (boundary condition) + my_strcpy(x, "Not bad for a little fur ball. You! Stay here."); + my_strcpy(y, "ball "); + ret = strstr(x, y); + CYG_TEST_PASS_FAIL( (ret == NULL), "String to search for not present" ); + + + // Check 3 (boundary condition) + my_strcpy(x, ""); + my_strcpy(y, "zx"); + ret = strstr(x, y); + CYG_TEST_PASS_FAIL( (ret == NULL), "Empty string to search" ); + + + // Check 4 (boundary condition) + my_strcpy(x, "fdafdafdfahjgf"); + my_strcpy(y, ""); + ret = strstr(x, y); + CYG_TEST_PASS_FAIL( (ret == x), "Empty search string" ); + + // Check 5 (boundary condition) + my_strcpy(x, ""); + my_strcpy(y, ""); + ret = strstr(x, y); + CYG_TEST_PASS_FAIL( (ret == x), "Both strings empty" ); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strstr() function"); + +} // main() + +// EOF strstr.c diff --git a/packages/language/c/libc/current/tests/string/strtok.c b/packages/language/c/libc/current/tests/string/strtok.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strtok.c @@ -0,0 +1,187 @@ +//================================================================= +// +// strtok.c +// +// Testcase for C library strtok() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strtok() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtok) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif // if defined(CYGPKG_LIBC) + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtok) + +// Functions to avoid having to use libc strings + + +static int +my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char * +my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + + +static void +test( CYG_ADDRWORD data ) +{ + char x[300]; + + // Check 1 + my_strcpy(x, "tok1 tok2 3kot"); + if (( my_strcmp("tok1", strtok(x, " ")) == 0 ) && + ( my_strcmp("tok2", strtok(NULL, " ")) == 0 ) && + ( my_strcmp("3kot", strtok(NULL, " ")) == 0 )) + + CYG_TEST_PASS("Simple strtok() #1"); + else + CYG_TEST_FAIL("Simple strtok() #1"); + + // Check 2 + my_strcpy(x, "Hitteth@ye *not, the vicar"); + if (( my_strcmp("Hitteth", strtok(x, "@,*")) == 0 ) && + ( my_strcmp("ye ", strtok(NULL, ",@*")) == 0 ) && + ( my_strcmp("not", strtok(NULL, "*@,")) == 0 ) && + ( my_strcmp(" the vicar", strtok(NULL, "*@,")) == 0 ) ) + + CYG_TEST_PASS("Simple strtok() #2"); + else + CYG_TEST_FAIL("Simple strtok() #2"); + + // Check 3 + my_strcpy(x, "on his bonce, with thine football"); + if ( my_strcmp(strtok(x, "@*"), x) == 0 ) + CYG_TEST_PASS("strtok() with token delimiters not found"); + else + CYG_TEST_FAIL("strtok() with token delimiters not found"); + + // Check 4 + my_strcpy(x, "@@@,,,...@,.,.@"); + if (strtok(x, "@,.") == NULL) + CYG_TEST_PASS("All characters of string are token delimiters"); + else + CYG_TEST_FAIL("All characters of string are token delimiters"); + + // Check 5 + my_strcpy(x, ""); + if (strtok(x, "@,.") == NULL) + CYG_TEST_PASS("String to tokenize empty"); + else + CYG_TEST_FAIL("String to tokenize empty"); + + // Check 6 + my_strcpy(x, "fdafda"); + if (strtok(x, "") == x) + CYG_TEST_PASS("String to tokenize empty"); + else + CYG_TEST_FAIL("String to tokenize empty"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strtok() function"); + +} // test() + +#endif // if defined(CYGPKG_LIBC) && defined(CYGFUN_LIBC_strtok) + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strtok() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); +} // main() + + +// EOF strtok.c diff --git a/packages/language/c/libc/current/tests/string/strxfrm1.c b/packages/language/c/libc/current/tests/string/strxfrm1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strxfrm1.c @@ -0,0 +1,168 @@ +//================================================================= +// +// strxfrm1.c +// +// Testcase for C library strxfrm() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strxfrm() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC + +// Functions to avoid having to use libc strings + +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + int ret; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strxfrm() function"); + CYG_TEST_INFO("This testcase provides simple basic tests"); + +#ifdef CYGPKG_LIBC + + // Check 1 + my_strcpy(x, "Nine rings for men doomed to die"); + ret = strxfrm(y, x, my_strlen(x)+1); + if (my_strcmp(x, y) == 0) + CYG_TEST_PASS("Simple strxfrm()"); + else + CYG_TEST_FAIL("Simple strxfrm()"); + // Check return value + CYG_TEST_PASS_FAIL( (my_strlen(x) == ret), + "Simple strxfrm() return value"); + + // Check 2 + x[0] = '\0'; + my_strcpy(y, "Seven rings for the dwarves in their halls of stone"); + ret = strxfrm(y, x, my_strlen(x)+1); + if (my_strcmp(y, "") == 0) + CYG_TEST_PASS("strxfrm() of empty string"); + else + CYG_TEST_FAIL("strxfrm() of empty string"); + // Check return value + CYG_TEST_PASS_FAIL( (my_strlen(x) == ret), + "strxfrm() of empty string return value"); + + // Check 3 + my_strcpy(y, "Seven rings for the dwarves in their halls of stone"); + ret = strxfrm(NULL, y, 0); + + // Check return value + CYG_TEST_PASS_FAIL( (my_strlen(y) == ret), + "strxfrm() of NULL string for 0 bytes return value"); + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strxfrm() function"); +} // main() + + +// EOF strxfrm1.c diff --git a/packages/language/c/libc/current/tests/string/strxfrm2.c b/packages/language/c/libc/current/tests/string/strxfrm2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/string/strxfrm2.c @@ -0,0 +1,156 @@ +//================================================================= +// +// strxfrm2.c +// +// Testcase for C library strxfrm() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library strxfrm() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE +// COMPOUND_TESTCASE + + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + +// CONSTANTS + +#define NUM_ROBUSTNESS_RUNS 300 + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC + +// Functions to avoid having to use libc strings + +static int my_strlen(const char *s) +{ + const char *ptr; + + ptr = s; + for ( ptr=s ; *ptr != '\0' ; ptr++ ) + ; + + return (int)(ptr-s); +} // my_strlen() + + +static int my_strcmp(const char *s1, const char *s2) +{ + for ( ; *s1 == *s2 ; s1++,s2++ ) + { + if ( *s1 == '\0' ) + break; + } // for + + return (*s1 - *s2); +} // my_strcmp() + + +static char *my_strcpy(char *s1, const char *s2) +{ + while (*s2 != '\0') { + *(s1++) = *(s2++); + } + *s1 = '\0'; + + return s1; +} // my_strcpy() + +#endif // ifdef CYGPKG_LIBC + + +int main( int argc, char *argv[] ) +{ +#ifdef CYGPKG_LIBC + char x[300]; + char y[300]; + int ret; + int ctr; + int fail; +#endif + + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "strxfrm() function"); + CYG_TEST_INFO("This testcase tests robustness, and may take some time"); + +#ifdef CYGPKG_LIBC + + fail = 0; + for (ctr = 0; ctr < NUM_ROBUSTNESS_RUNS; ctr++) { + my_strcpy(x, "Green plastic watering can, "); + my_strcpy(y, "for her fake Chineese rubber plant"); + ret = strxfrm(x, y, my_strlen(y)+1); + if ( (my_strcmp(x, "for her fake Chineese rubber plant") != 0) || + (my_strlen(y) != ret) ) { + fail = 1; + break; + } + } + CYG_TEST_PASS_FAIL( (fail == 0), "Robustness test" ); + + +#else // ifndef CYGPKG_LIBC + CYG_TEST_PASS("Testing is not applicable to this configuration"); +#endif // ifndef CYGPKG_LIBC + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "strxfrm() function"); +} // main() + +// EOF strxfrm2.c diff --git a/packages/language/c/libc/current/tests/time/clock.c b/packages/language/c/libc/current/tests/time/clock.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/current/tests/time/clock.c @@ -0,0 +1,190 @@ +//================================================================= +// +// clock.c +// +// Testcase for C library clock() +// +//================================================================= +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ctarpy@cygnus.co.uk, jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998/6/3 +// Description: Contains testcode for C library clock() function +// +// +//####DESCRIPTIONEND#### + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + +// CONFIGURATION + +#include // Configuration header + +// INCLUDES + +#include +#include +#include // C library initialisation + + +// HOW TO START TESTS + +#if defined(CYGPKG_LIBC) + +# define START_TEST( test ) test(0) + +#else + +# define START_TEST( test ) CYG_EMPTY_STATEMENT + +#endif + + +// CONSTANTS + +// This defines how many loops before we decide that +// the clock doesnt work +#define MAX_TIMEOUT 1000000 + +// Percentage error before we declare fail: range 0 - 100 +#define TOLERANCE 20 + + +// FUNCTIONS + + +externC void +cyg_package_start( void ) +{ +#ifdef CYGPKG_LIBC + cyg_iso_c_start(); +#else + (void)main(0, NULL); +#endif +} // cyg_package_start() + + +#ifdef CYGPKG_LIBC + +static int +my_abs(int i) +{ + return (i < 0) ? -i : i; +} // my_abs() + + +static void +test( CYG_ADDRWORD data ) +{ + unsigned long ctr, ctr2, err; + clock_t clock_init; + clock_t clock_first, clock_second, clock_third; + + // This waits for a clock tick, to ensure that we are at the + // start of a clock period. Then sit in a tight loop to get + // the clock period. Repeat this, and make sure that it the + // two timed periods are acceptably close. + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "clock() function"); + + err = 101; + clock_init = clock(); + + if (clock_init == -1) // unimplemented is just as valid + { + CYG_TEST_PASS_FINISH( "clock() returns -1, meaning unimplemented"); + } // if + + for (ctr = 0; ctr clock_init) + break; // Hit the next clock pulse + } + if (ctr < MAX_TIMEOUT) + { + // We hit a clock pulse, rather than a timeout + // Now we are at the beginning of a pulse, so time until the + // next one in order to get a measure of the length. + for (ctr = 0; ctr clock_first) + break; // Hit the next clock pulse + } // for + if (ctr < MAX_TIMEOUT) + { + // We hit a clock pulse, rather than a timeout. ctr contains + // the number of loops/tick. Measure this again, and see if + // the two results are acceptably close. + for (ctr2 = 0; ctr2 clock_second) + break; // Hit the next clock pulse + } // for + if (ctr < MAX_TIMEOUT) + { + err = (100 * my_abs(ctr-ctr2)) / ctr; + } // if (ctr < MAX_TIMEOUT) + else + { + CYG_TEST_FAIL_FINISH("No change in clock state!"); + } // else (ctr < MAX_TIMEOUT) + } // if (ctr < MAX_TIMEOUT) + else + { + CYG_TEST_FAIL_FINISH("No change in clock state!"); + } // else (ctr < MAX_TIMEOUT) + + } // if (ctr < MAX_TIMEOUT) + else + { + CYG_TEST_FAIL_FINISH("No change in clock state!"); + } // else (ctr < MAX_TIMEOUT) + + CYG_TEST_PASS_FAIL(err < TOLERANCE, "clock() stability"); + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library " + "clock() function"); +} // test() +#endif + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for C library " + "clock() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + +// EOF clock.c diff --git a/packages/language/c/libm/current/ChangeLog b/packages/language/c/libm/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/ChangeLog @@ -0,0 +1,576 @@ +Fri Oct 23 19:27:04 1998 Jonathan Larmour + + * tests/vectors/vector_support.h (START_TEST): + Ensure that dummy START_TEST (the one used when the test should + *not* be run) does have a reference to the test function. And + make sure that there is a default one if there's no C API + + * src/mathincl/fdlibm.h: + Add matherr() prototype if no namespace pollution + + Fixes for PR 17972 + +1998-10-22 Jesper Skov + PR 17925 + + * include/pkgconf/libm.h: + * src/misc/matherr.c: + Removed the CYGFUN_LIBM_matherr config. The function is already + weakly defined so shouldn't need to be configured out. + +1998-10-19 Mark Galassi + + * include/pkgconf/libm.h: updated the doc URL + +Thu Oct 15 21:36:12 1998 Jonathan Larmour + + * src/misc/compatmode.cxx, src/misc/signgam.cxx: + Only include kernel headers if we want thread-safe operation + Required for PR 17229 + +Wed Oct 14 17:24:46 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Make CYGPKG_LIBM_COMPATIBILITY_DEFAULT require CYGPKG_LIBC + rather than all of libm, and put a check (with #error) that + this is the case + + * src/double/ieee754-api/w_scalb.c: + Only include errno.h if we aren't IEEE-only + + * src/double/portable-api/s_ldexp.c, src/misc/standard.c: + Make the error checking in s_ldexp.c more like every other libm + sources by putting the actual error handling into standard.c. + The error handling is just like scalb + + * tests/vectors/acos.c, tests/vectors/asin.c, + tests/vectors/atan.c, tests/vectors/atan2.c, + tests/vectors/ceil.c, tests/vectors/cos.c, tests/vectors/cosh.c, + tests/vectors/exp.c, tests/vectors/fabs.c, + tests/vectors/floor.c, tests/vectors/fmod.c, + tests/vectors/frexp.c, tests/vectors/ldexp.c, + tests/vectors/log.c, tests/vectors/log10.c, + tests/vectors/modf.c, tests/vectors/pow.c, tests/vectors/sin.c, + tests/vectors/sinh.c, tests/vectors/sqrt.c, tests/vectors/tan.c, + tests/vectors/tanh.c: + Remove unnecessary include of + + * tests/vectors/vector_support.h: + Only include errno.h if we aren't IEEE-only. + If we don't have Cyg_ErrNo, just use a cyg_int32 instead, to + make sure that the fields are still correct for the input + test vector. + In doTestVec(), before checking errno, check if we're + in IEEE mode (either compiled in or set at runtime) because if + so, and errno is set in the errno field of the input test + vector, then we have to skip this, since we can't validate the + output. + In all modes, if errno is set in the input test vector, don't + bother checking the actual values + + All of the above changes are for PR 17503 + + * tests/vectors/pow.c: + Remove requirement of being in POSIX mode, as the change to + vector_support.h should make this work better now. + + +Sun Sep 27 20:46:09 1998 David Moore + + * include/pkgconf/libm.h: + PR 17515: Corrected notcdl doc string. + +1998-09-26 Bart Veer + + * include/pkgconf/libm.h: + PR 17503: there are uses of errno in a couple of places in libm, + and errno will only be available if the C library is present. + Therefore libm requires libc. + + +Fri Sep 25 19:00:35 1998 Jonathan Larmour + + * src/misc/compatmode.cxx: + Make sure CYGNUM_LIBM_COMPATMODE_TRACE_LEVEL is defined before + we attempt tracing, otherwise set trace level to 0 i.e. never + + * src/misc/signgam.cxx: + Make sure CYGNUM_LIBM_SIGNGAM_TRACE_LEVEL is defined before + we attempt tracing, otherwise set trace level to 0 i.e. never + Fix for PR 17478 + + * include/pkgconf/libm.h: + Define trace levels only if parent CYGPKG_LIBM_TRACE is defined + for consistency with Configuration Tool + +Fri Sep 25 18:25:02 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Only check valid compatibility setting if we aren't IEEE-only + mode + Fix for PR 17481 + +Fri Sep 25 18:13:24 1998 Jonathan Larmour + + * src/mathincl/fdlibm.h: + * src/double/ieee754-core/e_scalb.c: + * src/double/ieee754-api/w_scalb.c: + Use CYGFUN_LIBM_SVID3_scalb for whether 2nd arg of scalb is + double or int, rather than _SCALB_INT. + Fix for PR 17479 + +Wed Sep 23 08:07:48 1998 Jonathan Larmour + + * tests/vectors/pow.c (test): + Make pow test conditional on being in POSIX compatibility mode. + This is the only mode that can set errno correctly, in + relation to what the tests expect. + Fix for PR 16933 + +1998-09-20 Mark Galassi + + * include/pkgconf/libm.h: updated CDL doc strings. + +Thu Sep 17 17:10:47 1998 Jonathan Larmour + + * tests/vectors/vector_support.h (checkErrorAcceptable): + Move check for signed-ness after all of the special cases + Fix for PR 16933 + +Tue Sep 15 19:26:32 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Updated descriptions and a few other minor things after review + +1998-09-11 Bart Veer + + * include/pkgconf/libm.h: + Sorting out dependencies for error package. + +Fri Sep 4 14:20:04 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Fix thread-safe modes "requires" lines not to be associated + with the dummy parent package, but with the options themselves. + Also we don't need "requires CYGPKG_KERNEL" if we already require + a particular kernel option anyway. + +Thu Sep 3 09:50:20 1998 Tim Goodwin + + * tests/vectors/vector_support.h + Change to cyg_thread_create() interface. + +Wed Sep 2 14:41:54 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Add default define for CYGPKG_LIBM_COMPATIBILITY_DEFAULT, + and shorten some display texts + +Wed Sep 2 13:15:43 1998 Jonathan Larmour + + * src/double/ieee754-core/e_pow.c: + Fix bug for when x is negative and y isn't an integer. A CYGNUS + LOCAL change got it wrong when casting a signed integer to + unsigned before right shifting. + + Reformat for 76 columns + + * src/double/ieee754-api/w_pow.c: + Reformat for 76 columns + + +Wed Sep 2 12:30:11 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Default tracing to off + Reformat for 76 columns + + * tests/vectors/vector_support.h: + Align '{'s and "verbs" on the same line. Tidy to 76 columns + +Mon Aug 31 13:38:25 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Require infra tracing support to allow tracing + +1998-08-28 Bart Veer + + * include/pkgconf/libm.h: + * src/misc/compatmode.cxx, src/misc/signgam.cxx: + * tests/vectors/vector_support.h + + Updated for new kernel configuration option symbol names + +Fri Aug 28 09:07:07 1998 Jonathan Larmour + + * tests/vectors/vector_support.h: + Change START_TEST macro, adjust config options and add + cyg_package_start() to get tests working correctly with new entry + point mechanism, including cyg_iso_c_start() if available + +Wed Aug 26 20:25:36 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Remove #define CYGPKG_LIBM is that is meant to live in + after all + + +Wed Aug 26 19:38:54 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + More fixes to CDL stuff to make it work better, and look better on + the screen + +Tue Aug 25 20:23:25 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Make some fixes after running the ConfigTool + +Tue Aug 25 16:59:11 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Turns out the nesting wasn't quite right. Correct it, and replace + the "not" prefix on CFG_DATA, which slipped in to the previous change. + +Tue Aug 25 16:53:03 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Ensure there is a default compatibility mode and fix the + ifdef nesting for the compat modes + +Tue Aug 25 15:24:51 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Tidy up CDL stuff prior to checking if it all actually works! + +Tue Aug 25 05:17:55 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Do a first pass of CDLification of configuration data + + * include/pkgconf/libm.h, src/misc/matherr.c: + Rename CYGFUN_LIBC_matherr to CYGFUN_LIBM_matherr + +Wed Aug 19 19:35:16 1998 Jonathan Larmour + + * tests/vectors/acos.c, tests/vectors/cosh.c, tests/vectors/ldexp.c, + tests/vectors/sinh.c, tests/vectors/asin.c, tests/vectors/exp.c, + tests/vectors/log.c, tests/vectors/sqrt.c, tests/vectors/atan.c, + tests/vectors/fabs.c, tests/vectors/log10.c, tests/vectors/tan.c, + tests/vectors/atan2.c, tests/vectors/floor.c, tests/vectors/modf.c, + tests/vectors/tanh.c, tests/vectors/ceil.c, tests/vectors/fmod.c, + tests/vectors/pow.c, tests/vectors/cos.c, tests/vectors/frexp.c, + tests/vectors/sin.c + + * tests/vectors/vector_support.h (doTestVec): + Remove "register" on variable + +Wed Aug 19 18:59:47 1998 Jonathan Larmour + + * src/double/ieee754-core/e_gamma.c, + src/double/ieee754-core/e_lgamma.c, + src/double/ieee754-api/w_gamma.c, + src/double/ieee754-api/w_lgamma.c: + Remove direct reference to extern int signgam and include + instead + +Mon Jul 27 23:47:52 1998 Jonathan Larmour + + * include/math.h, include/pkgconf/libm.h, + src/double/ieee754-api/w_acos.c, src/double/ieee754-api/w_acosh.c, + src/double/ieee754-api/w_asin.c, src/double/ieee754-api/w_atan2.c, + src/double/ieee754-api/w_atanh.c, src/double/ieee754-api/w_cosh.c, + src/double/ieee754-api/w_exp.c, src/double/ieee754-api/w_fmod.c, + src/double/ieee754-api/w_gamma.c, + src/double/ieee754-api/w_gamma_r.c, + src/double/ieee754-api/w_hypot.c, src/double/ieee754-api/w_j0.c, + src/double/ieee754-api/w_j1.c, src/double/ieee754-api/w_jn.c, + src/double/ieee754-api/w_lgamma.c, + src/double/ieee754-api/w_lgamma_r.c, + src/double/ieee754-api/w_log.c, + src/double/ieee754-api/w_log10.c, src/double/ieee754-api/w_pow.c, + src/double/ieee754-api/w_remainder.c, + src/double/ieee754-api/w_scalb.c, src/double/ieee754-api/w_sinh.c, + src/double/ieee754-api/w_sqrt.c, src/double/ieee754-core/e_acos.c, + src/double/ieee754-core/e_acosh.c, + src/double/ieee754-core/e_asin.c, + src/double/ieee754-core/e_atan2.c, + src/double/ieee754-core/e_atanh.c, + src/double/ieee754-core/e_cosh.c, + src/double/ieee754-core/e_exp.c, src/double/ieee754-core/e_fmod.c, + src/double/ieee754-core/e_gamma.c, + src/double/ieee754-core/e_gamma_r.c, + src/double/ieee754-core/e_hypot.c, src/double/ieee754-core/e_j0.c, + src/double/ieee754-core/e_j1.c, src/double/ieee754-core/e_jn.c, + src/double/ieee754-core/e_lgamma.c, + src/double/ieee754-core/e_lgamma_r.c, + src/double/ieee754-core/e_log.c, src/double/ieee754-core/e_log10.c, + src/double/ieee754-core/e_pow.c, + src/double/ieee754-core/e_rem_pio2.c, + src/double/ieee754-core/e_remainder.c, + src/double/ieee754-core/e_scalb.c, + src/double/ieee754-core/e_sinh.c, + src/double/ieee754-core/e_sqrt.c, src/double/internal/k_cos.c, + src/double/internal/k_rem_pio2.c, src/double/internal/k_sin.c, + src/double/internal/k_tan.c, src/double/portable-api/s_asinh.c, + src/double/portable-api/s_atan.c, src/double/portable-api/s_cbrt.c, + src/double/portable-api/s_ceil.c, + src/double/portable-api/s_copysign.c, + src/double/portable-api/s_cos.c, src/double/portable-api/s_erf.c, + src/double/portable-api/s_expm1.c, + src/double/portable-api/s_fabs.c, + src/double/portable-api/s_finite.c, + src/double/portable-api/s_floor.c, + src/double/portable-api/s_frexp.c, + src/double/portable-api/s_ilogb.c, + src/double/portable-api/s_isnan.c, + src/double/portable-api/s_ldexp.c, + src/double/portable-api/s_log1p.c, + src/double/portable-api/s_logb.c, + src/double/portable-api/s_modf.c, + src/double/portable-api/s_nextafter.c, + src/double/portable-api/s_rint.c, + src/double/portable-api/s_scalbn.c, + src/double/portable-api/s_significand.c, + src/double/portable-api/s_sin.c, src/double/portable-api/s_tan.c, + src/double/portable-api/s_tanh.c, src/mathincl/fdlibm.h, + src/misc/standard.c: + + Untabify + +Mon Jul 27 22:52:24 1998 Jonathan Larmour + + * tests/vectors/vector_support.h (doTestVec): + Remove "register" when declaring variable i + + * host/acosgen.c, host/cosgen.c, host/fmodgen.c, host/modfgen.c, + host/tangen.c, host/asingen.c, host/coshgen.c, host/frexpgen.c, + host/powgen.c, host/tanhgen.c, host/atan2gen.c, host/expgen.c, + host/ldexpgen.c, host/singen.c, host/atangen.c, host/fabsgen.c, + host/log10gen.c, host/sinhgen.c, host/ceilgen.c, host/floorgen.c, + host/loggen.c, host/sqrtgen.c: + Remove "register" when declaring variable "int x" + +Mon Jul 27 22:45:01 1998 Jonathan Larmour + + * tests/vectors/vector_support.h (checkErrorAcceptable): + Add extra check for tolerance acceptance so it behaves correctly with + underflow and overflow + + Also reverse sense of checkErrorAcceptable() so it now returns + false on success and true on failure, as suggested by hmt. Change + this in doTestVec() (which is where it is called) too. + + * tests/vectors/vector_support.h: + Remove #if 0'd shift_double() function + +Mon Jul 27 21:55:04 1998 Jonathan Larmour + + * src/mathincl/fdlibm.h: + Rename CYGONCE_LIBM_FDLIBM_H to CYGONCE_LIBM_MATHINCL_FDLIBM_H as per + code review comments + +Fri Jul 24 22:20:42 1998 Jonathan Larmour + + * include/math.h, include/pkgconf/libm.h, + src/double/ieee754-api/w_acos.c, src/double/ieee754-api/w_acosh.c, + src/double/ieee754-api/w_asin.c, src/double/ieee754-api/w_atan2.c, + src/double/ieee754-api/w_atanh.c, src/double/ieee754-api/w_cosh.c, + src/double/ieee754-api/w_exp.c, src/double/ieee754-api/w_fmod.c, + src/double/ieee754-api/w_gamma.c, src/double/ieee754-api/w_gamma_r.c, + src/double/ieee754-api/w_hypot.c, src/double/ieee754-api/w_j0.c, + src/double/ieee754-api/w_j1.c, src/double/ieee754-api/w_jn.c, + src/double/ieee754-api/w_lgamma.c, + src/double/ieee754-api/w_lgamma_r.c, src/double/ieee754-api/w_log.c, + src/double/ieee754-api/w_log10.c, src/double/ieee754-api/w_pow.c, + src/double/ieee754-api/w_remainder.c, + src/double/ieee754-api/w_scalb.c, src/double/ieee754-api/w_sinh.c, + src/double/ieee754-api/w_sqrt.c, src/mathincl/fdlibm.h, + src/misc/compatmode.cxx, src/misc/matherr.c, src/misc/signgam.cxx, + src/misc/standard.c: + + Rename libm config option names as per the libm coding standard + review. Chiefly ensuring that CYGXXX_ prefixes are correct + + * src/misc/matherr.c, include/pkgconf/libm.h: + Add new CYGFUN_LIBC_matherr config option to prevent inclusion of + default matherr + +Mon Jul 20 18:07:31 1998 Jonathan Larmour + + * src/misc/infconst.c: + Oops. Don't let cyg_libm_infinity be static! + +Thu Jul 16 20:07:26 1998 Jonathan Larmour + + * include/math.h, include/sys/ieeefp.h, src/misc/infconst.c: + Remove union Cyg_libm_int_double from math.h, which was used to + define infinity, and replace with use of + Cyg_libm_ieee_double_shape_type from ieeefp.h + + That type (which is a union) is now reordered so that it can be + initialised in terms of two int's + +Mon Jul 13 21:55:06 1998 Jonathan Larmour + + * src/double/ieee754-api/w_acos.c, src/double/ieee754-api/w_acosh.c, + src/double/ieee754-api/w_asin.c, src/double/ieee754-api/w_atan2.c, + src/double/ieee754-api/w_atanh.c, src/double/ieee754-api/w_cosh.c, + src/double/ieee754-api/w_exp.c, src/double/ieee754-api/w_fmod.c, + src/double/ieee754-api/w_gamma.c, src/double/ieee754-api/w_gamma_r.c, + src/double/ieee754-api/w_hypot.c, src/double/ieee754-api/w_j0.c, + src/double/ieee754-api/w_j1.c, src/double/ieee754-api/w_jn.c, + src/double/ieee754-api/w_lgamma.c, + src/double/ieee754-api/w_lgamma_r.c, src/double/ieee754-api/w_log.c, + src/double/ieee754-api/w_log10.c, src/double/ieee754-api/w_pow.c, + src/double/ieee754-api/w_remainder.c, + src/double/ieee754-api/w_scalb.c, src/double/ieee754-api/w_sinh.c, + src/double/ieee754-api/w_sqrt.c, src/double/ieee754-core/e_acos.c, + src/double/ieee754-core/e_acosh.c, src/double/ieee754-core/e_asin.c, + src/double/ieee754-core/e_atan2.c, src/double/ieee754-core/e_atanh.c, + src/double/ieee754-core/e_cosh.c, src/double/ieee754-core/e_exp.c, + src/double/ieee754-core/e_fmod.c, src/double/ieee754-core/e_gamma.c, + src/double/ieee754-core/e_gamma_r.c, + src/double/ieee754-core/e_hypot.c, src/double/ieee754-core/e_j0.c, + src/double/ieee754-core/e_j1.c, src/double/ieee754-core/e_jn.c, + src/double/ieee754-core/e_lgamma.c, + src/double/ieee754-core/e_lgamma_r.c, + src/double/ieee754-core/e_log.c, src/double/ieee754-core/e_log10.c, + src/double/ieee754-core/e_pow.c, + src/double/ieee754-core/e_rem_pio2.c, + src/double/ieee754-core/e_remainder.c, + src/double/ieee754-core/e_scalb.c, src/double/ieee754-core/e_sinh.c, + src/double/ieee754-core/e_sqrt.c, src/double/internal/k_cos.c, + src/double/internal/k_rem_pio2.c, src/double/internal/k_sin.c, + src/double/internal/k_tan.c, src/double/portable-api/s_asinh.c, + src/double/portable-api/s_atan.c, src/double/portable-api/s_cbrt.c, + src/double/portable-api/s_ceil.c, + src/double/portable-api/s_copysign.c, + src/double/portable-api/s_cos.c, src/double/portable-api/s_erf.c, + src/double/portable-api/s_expm1.c, src/double/portable-api/s_fabs.c, + src/double/portable-api/s_finite.c, + src/double/portable-api/s_floor.c, src/double/portable-api/s_frexp.c, + src/double/portable-api/s_ilogb.c, src/double/portable-api/s_isnan.c, + src/double/portable-api/s_ldexp.c, src/double/portable-api/s_log1p.c, + src/double/portable-api/s_logb.c, src/double/portable-api/s_modf.c, + src/double/portable-api/s_nextafter.c, + src/double/portable-api/s_rint.c, src/double/portable-api/s_scalbn.c, + src/double/portable-api/s_significand.c, + src/double/portable-api/s_sin.c, src/double/portable-api/s_tan.c, + src/double/portable-api/s_tanh.c, src/misc/standard.c: + + Make #ifdef __STDC__ bits compulsory and remove the associated #else + clause. We know that gcc is ISO C compatible! + +Tue Jul 7 16:05:48 1998 Jonathan Larmour + + * src/misc/compatmode.cxx: + Fix conditionalisation to prevent unused variable warning for tracing + +Thu Jun 25 04:58:21 1998 Jonathan Larmour + + * tests/vectors/acos.c, tests/vectors/acos.h, tests/vectors/asin.c, + tests/vectors/asin.h, tests/vectors/atan.c, tests/vectors/atan.h, + tests/vectors/atan2.c, tests/vectors/atan2.h, tests/vectors/ceil.c, + tests/vectors/ceil.h, tests/vectors/cos.c, tests/vectors/cos.h, + tests/vectors/cosh.c, tests/vectors/cosh.h, tests/vectors/exp.c, + tests/vectors/exp.h, tests/vectors/fabs.c, tests/vectors/fabs.h, + tests/vectors/floor.c, tests/vectors/floor.h, tests/vectors/fmod.c, + tests/vectors/fmod.h, tests/vectors/frexp.c, tests/vectors/frexp.h, + tests/vectors/ldexp.c, tests/vectors/ldexp.h, tests/vectors/log.c, + tests/vectors/log.h, tests/vectors/log10.c, tests/vectors/log10.h, + tests/vectors/modf.c, tests/vectors/modf.h, tests/vectors/pow.c, + tests/vectors/pow.h, tests/vectors/sin.c, tests/vectors/sin.h, + tests/vectors/sinh.c, tests/vectors/sinh.h, tests/vectors/sqrt.c, + tests/vectors/sqrt.h, tests/vectors/tan.c, tests/vectors/tan.h, + tests/vectors/tanh.c, tests/vectors/tanh.h, + tests/vectors/vector_support.h: + Add math library tests for functions specified in the ISO standard. + These are based on precomputed test vectors + + * tests/PKGconf.mak: + Create with above files being built + + * host/acosgen.c, host/asingen.c, host/atan2gen.c, host/atangen.c, + host/ceilgen.c, host/cosgen.c, host/coshgen.c, host/expgen.c, + host/fabsgen.c, host/floorgen.c, host/fmodgen.c, host/frexpgen.c, + host/ldexpgen.c, host/log10gen.c, host/loggen.c, host/modfgen.c, + host/powgen.c, host/singen.c, host/sinhgen.c, host/sqrtgen.c, + host/tangen.c, host/tanhgen.c: + Host-side (and currently linux-specific) sources to automatically + generate test vector data used by the above tests. + + * include/pkgconf/libm.h: + Ensure the kernel C API is available if we want thread safety + +Wed Jun 24 15:42:31 1998 Jonathan Larmour + + * src/misc/standard.c: + Fix typo in ifdef + +Wed Jun 24 13:04:30 1998 Jonathan Larmour + + * src/misc/standard.c: + Fix #defines for IEEE mode, revealed by permutation testing + +Mon Jun 22 14:42:50 1998 Jonathan Larmour + + * src/misc/infconst.c: + Fix compiler warning + +Sun Jun 21 04:42:18 1998 Jonathan Larmour + + * include/sys/ieeefp.h: + Add this to allow bitfield break down of IEEE floating point doubles + +Wed Jun 17 08:55:21 1998 Jonathan Larmour + + * include/pkgconf/libm.h: + Make the use of stderr for messages _not_ the default + Make thread safety the default + + * src/misc/standard.c: + Change alternative for fprintf(stderr,...) _not_ being used from + "CYG_EMPTY_STATEMENT" to just "0" to placate compiler. + +Mon Jun 15 19:59:36 1998 Jonathan Larmour + + * src/misc/compatmode.cxx: + Fix typo in compatibility mode name + +Fri Jun 5 16:31:26 1998 Jonathan Larmour + + * src/misc/signgam.cxx, src/misc/compatmode.cxx: + Fix some minor typos when thread safety is turned on + + * src/misc/matherr.c + Correct syntax of weak attribute + +Fri Jun 5 07:07:03 1998 Jonathan Larmour + + * Initial check-in of all math library sources. Based on fdlibm-5.2. + + +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== diff --git a/packages/language/c/libm/current/include/math.h b/packages/language/c/libm/current/include/math.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/include/math.h @@ -0,0 +1,290 @@ +#ifndef CYGONCE_LIBM_MATH_H +#define CYGONCE_LIBM_MATH_H +//=========================================================================== +// +// math.h +// +// Standard mathematical functions conforming to ANSI and other standards +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Standard mathematical functions. These can be +// configured to conform to ANSI section 7.5. There are also +// a number of extensions conforming to IEEE-754 and behaviours +// compatible with other standards +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// INCLUDES + +#include // Common type definitions and support +#include // Properties of FP representation on this + // platform +#include // Cyg_libm_ieee_double_shape_type + +// CONSTANT DEFINITIONS + + +// HUGE_VAL is a positive double (not necessarily representable as a float) +// representing infinity as specified in ANSI 7.5. cyg_libm_infinity is +// defined further down +#define HUGE_VAL (cyg_libm_infinity.value) + + +#ifndef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION +// HUGE is defined in System V Interface Definition 3 (SVID3) as the largest +// finite single precision number +#define HUGE FLT_MAX // from float.h + + +// Values used in the type field of struct exception below + +#define DOMAIN 1 +#define SING 2 +#define OVERFLOW 3 +#define UNDERFLOW 4 +#define TLOSS 5 +#define PLOSS 6 + + +// TYPE DEFINITIONS + +// Things required to support matherr() ( see comments in ) + +struct exception { + int type; // One of DOMAIN, SING, OVERFLOW, UNDERFLOW, TLOSS, PLOSS + char *name; // Name of the function generating the exception + double arg1; // First argument to the function + double arg2; // Second argument to the function + double retval; // Value to be returned - can be altered by matherr() +}; + +#endif // ifndef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION + + +// GLOBALS + +externC const Cyg_libm_ieee_double_shape_type cyg_libm_infinity; + +//=========================================================================== +// FUNCTION PROTOTYPES + +// Functions not part of a standard + +// This retrieves a pointer to the current compatibility mode of the Math +// library. See for the definition of Cyg_libm_compat_t + +#ifdef CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE + +externC Cyg_libm_compat_t +cyg_libm_get_compat_mode( void ); + +externC Cyg_libm_compat_t +cyg_libm_set_compat_mode( Cyg_libm_compat_t ); + +#else + +externC Cyg_libm_compat_t cygvar_libm_compat_mode; + +// Defined as static inline as it is unlikely that anyone wants to take the +// address of these functions. +// +// This returns the current compatibility mode + +static inline Cyg_libm_compat_t +cyg_libm_get_compat_mode( void ) +{ + return cygvar_libm_compat_mode; +} + +// This sets the compatibility mode, and returns the previous mode +static inline Cyg_libm_compat_t +cyg_libm_set_compat_mode( Cyg_libm_compat_t math_compat_mode) +{ + Cyg_libm_compat_t oldmode; + + oldmode = cygvar_libm_compat_mode; + cygvar_libm_compat_mode = math_compat_mode; + return oldmode; +} + +#endif // ifdef CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE + + +//=========================================================================== +// Standard ANSI functions. Angles are always in radians + +// Trigonometric functions - ANSI 7.5.2 + +externC double +acos( double ); // arc cosine i.e. inverse cos + +externC double +asin( double ); // arc sine i.e. inverse sin + +externC double +atan( double ); // arc tan i.e. inverse tan + +externC double +atan2( double, double ); // arc tan of (first arg/second arg) using signs + // of args to determine quadrant + +externC double +cos( double ); // cosine + +externC double +sin( double ); // sine + +externC double +tan( double ); // tangent + +// Hyperbolic functions - ANSI 7.5.3 + +externC double +cosh( double ); // hyperbolic cosine + +externC double +sinh( double ); // hyperbolic sine + +externC double +tanh( double ); // hyperbolic tangent + +// Exponential and Logarithmic Functions - ANSI 7.5.4 + +externC double +exp( double ); // exponent + +externC double +frexp( double, int * ); // break number into normalized fraction (returned) + // and integral power of 2 (second arg) + +externC double +ldexp( double, int ); // multiples number by integral power of 2 + +externC double +log( double ); // natural logarithm + +externC double +log10( double ); // base ten logarithm + +externC double +modf( double, double * ); // break number into integral and fractional + // parts, each of which has same sign as arg. + // It returns signed fractional part, and + // puts integral part in second arg + +// Power Functions - ANSI 7.5.5 + +externC double +pow( double, double ); // (1st arg) to the power of (2nd arg) + +externC double +sqrt( double ); // square root + +// Nearest integer, absolute value and remainder functions - ANSI 7.5.6 + +externC double +ceil( double ); // smallest integer >= arg + +externC double +fabs( double ); // absolute value + +externC double +floor( double ); // largest integer <= arg + +externC double +fmod( double, double ); // remainder of (1st arg)/(2nd arg) + +//=========================================================================== +// Other standard functions + +#ifndef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION +externC int +matherr( struct exception * ); // User-overridable error handling - see +#endif // for a discussion + +// scalb*() + +externC double // scalbn(x,n) returns x*(2**n) +scalbn( double, int ); + +#ifdef CYGFUN_LIBM_SVID3_scalb + +externC double +scalb( double, double ); // as above except n is a floating point arg + +#else +externC double +scalb( double, int ); // as scalbn() + +#endif // ifdef CYGFUN_LIBM_SVID3_scalb + +// And the rest + + +externC int // whether the argument is NaN +isnan( double ); + +externC int +finite( double ); // whether the argument is finite + + +//=========================================================================== +// Non-standard functions + +externC double // copysign(x,y) returns a number with +copysign ( double, double ); // the absolute value of x and the sign of y + +externC double // rounds to an integer according to the +rint( double ); // current rounding mode + + +// BSD functions + +externC double // expm1(x) returns the equivalent of +expm1( double ); // (exp(x) - 1) but more accurately when + // x tends to zero + + +#endif // ifdef CYGPKG_LIBM + +#endif // CYGONCE_LIBM_MATH_H multiple inclusion protection + +// EOF math.h diff --git a/packages/language/c/libm/current/include/pkgconf/libm.h b/packages/language/c/libm/current/include/pkgconf/libm.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/include/pkgconf/libm.h @@ -0,0 +1,438 @@ +#ifndef CYGONCE_PKGCONF_LIBM_H +#define CYGONCE_PKGCONF_LIBM_H +//======================================================================== +// +// libm.h +// +// Configuration header for mathematical function library +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: Configuration of the standard mathematical function library +// Description: Configuration header for mathematical function library +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//======================================================================== + + +//======================================================================== +// +// A NOTE ON COMPATIBILITY MODES +// +// This math library is capable of being operated in several different +// compatibility modes. These options deal solely with how errors are +// handled. +// +// There are 4 compatibility modes: ANSI/POSIX 1003.1; IEEE-754; X/Open +// Portability Guide issue 3 (XPG3); and System V Interface Definition +// Edition 3. +// +// In IEEE mode, the matherr() function (see below) is never called, no +// warning messages are printed on the stderr output stream, and errno is +// never set. +// +// In ANSI/POSIX mode, errno is set correctly, but matherr() is never +// called and no warning messages are printed on the stderr output stream. +// +// In X/Open mode, errno is set correctly, matherr() is called, but no +// warning messages are printed on the stderr output stream. +// +// In SVID mode, functions which overflow return a value "HUGE" (defined in +// math.h), which is the maximum single precision floating point value +// (as opposed to HUGE_VAL which is meant to stand for infinity). errno is +// set correctly and matherr() is called. If matherr() returns 0, warning +// messages are printed on the stderr output stream for some errors. +// +// The mode can be compiled-in as IEEE-only, or any one of the above +// methods settable at run-time. See the configuration options below for +// more. +// +//======================================================================== +// +// MATHERR() +// +// As said, in X/Open or SVID modes, the user can supply a function +// matherr() of the form: +// +// int matherr( struct exception * ); +// +// where: +// struct exception { +// int type; +// char *name; +// double arg1, arg2, retval; +// }; +// +// - type is the exception type and is one of: +// DOMAIN - argument domain exception +// SING - argument singularity +// OVERFLOW - overflow range exception +// UNDERFLOW - underflow range exception +// TLOSS - total loss of significance +// PLOSS - partial loss of significance +// +// - name is a string containing the name of the function +// - arg1 and arg2 are the arguments passed to the function +// - retval is the default value that will be returned by the function, and +// can be changed by matherr +// +// matherr must have "C" linkage, not C++ +// +// If matherr returns zero, or the user doesn't supply their own matherr, +// then the following _usually_ happens in SVID mode: +// +// If type is: +// DOMAIN - 0.0 returned, errno=EDOM, and a message printed on stderr +// SING - HUGE of appropriate sign is returned, errno=EDOM, and a +// message is printed on stderr +// OVERFLOW - HUGE of appropriate sign is returned, and errno=ERANGE +// UNDERFLOW - 0.0 is returned and errno=ERANGE +// TLOSS - 0.0 is returned, errno=ERANGE, and a message is printed on +// stderr +// PLOSS - The current implementation doesn't return this type +// +// X/Open mode is similar except that the message is not printed on stderr +// and HUGE_VAL is used in place of HUGE +// +//======================================================================== +// +// THREAD-SAFETY AND RE-ENTRANCY +// +// With the appropriate configuration options set below, the math library +// is fully thread-safe if: +// +// - Depending on the compatibility mode, the setting of the errno variable +// from the C library is thread-safe +// +// - Depending on the compatibility mode, sending error messages to the +// stderr output stream using the C library fputs() function is +// thread-safe +// +// - Depending on the compatibility mode, the user-supplied matherr() +// function and anything it depends on are thread-safe +// +// In addition, with the exception of the gamma*() and lgamma*() functions, +// the math library is re-entrant (and thus safe to use from interrupt +// handlers) if the Math library is always in IEEE mode +// +//======================================================================== +// +// Also note that this math library assumes the hardware (or software +// floating point emulation) supports IEEE-754 style arithmetic, 32-bit +// 2's complement integer arithmetic, doubles are in 64-bit +// IEEE-754 format. +// +//======================================================================== + + +// INCLUDES + +// Include system configuration file to work out whether the Math library +// is to be included at all +#include + +// We want to check if the kernel supports per-thread data +#ifdef CYGPKG_KERNEL +# include +#endif + +/* + + {{CFG_DATA + cdl_package CYGPKG_LIBM { + display "Math Library" + description "ISO standard floating point mathematical library + containing many useful functions for mathematical + calculations." + type boolean + requires CYGPKG_ERROR + doc ref/ecos-ref/the-iso-standard-c-and-math-libraries.html + } + }}CFG_DATA + +*/ + +// TYPE DEFINITIONS + +// Compatibility mode selector - required for default below + +typedef enum { + CYGNUM_LIBM_COMPAT_UNINIT= 0, // Default state. DO NOT set it to this + CYGNUM_LIBM_COMPAT_POSIX = 1, // ANSI/POSIX 1003.1 + CYGNUM_LIBM_COMPAT_IEEE = 2, // IEEE-754 + CYGNUM_LIBM_COMPAT_XOPEN = 3, // X/OPEN Portability guide issue 3 + // (XPG3) + CYGNUM_LIBM_COMPAT_SVID = 4 // System V Interface Definition 3rd + // edition +} Cyg_libm_compat_t; + + +//======================================================================== +// +// COMPATIBILITY-MODE RELATED CONFIGURATION OPTIONS + +/* + {{CFG_DATA + + cdl_component CYGPKG_LIBM_COMPATIBILITY { + display "Compatibility mode" + description "These options deal with behaviour related to + the various compatibility modes - POSIX, IEEE, + X/OPEN and SVID." + doc ref/ecos-ref/math-library-compatibility-modes.html + type dummy + parent CYGPKG_LIBM + } + + cdl_option CYGSEM_LIBM_COMPAT_IEEE_ONLY { + display "IEEE-only" + description "The math library can be hard-coded to only + behave in one compatibility mode - IEEE. This + cannot be changed at run-time. IEEE mode is the + most minimal of the compatibility modes, and so + this will best help code size and speed, as well + as omitting the code for other compatibility + modes. If not defined, the math library can be + set at run-time to any of the supported + compatibility modes." + type radio + parent CYGPKG_LIBM_COMPATIBILITY + } + + cdl_component CYGPKG_LIBM_COMPATIBILITY_DEFAULT { + display "Default mode" + description "If you want to have support for more than one + compatibility mode settable at run-time, rather + than hard-coded IEEE mode, this component lets + you choose which mode should be the default." + type radio + parent CYGPKG_LIBM_COMPATIBILITY + requires CYGPKG_LIBC + } + + cdl_option CYGNUM_LIBM_COMPATIBILITY_POSIX { + display "POSIX" + description "This sets the default compatibility mode to + POSIX" + type radio + parent CYGPKG_LIBM_COMPATIBILITY_DEFAULT + } + + cdl_option CYGNUM_LIBM_COMPATIBILITY_IEEE { + display "IEEE" + description "This sets the default compatibility mode to IEEE" + type radio + parent CYGPKG_LIBM_COMPATIBILITY_DEFAULT + } + + cdl_option CYGNUM_LIBM_COMPATIBILITY_XOPEN { + display "X/OPEN" + description "This sets the default compatibility mode to + X/OPEN" + type radio + parent CYGPKG_LIBM_COMPATIBILITY_DEFAULT + } + + cdl_option CYGNUM_LIBM_COMPATIBILITY_SVID { + display "SVID" + description "This sets the default compatibility mode to SVID" + type radio + parent CYGPKG_LIBM_COMPATIBILITY_DEFAULT + } + + cdl_option CYGFUN_LIBM_SVID3_scalb { + display "SVID3-style scalb()" + description "SVID3 defined the scalb() function as double + scalb(double, double) rather than double + scalb(double, int) which is used by IBM, DEC, and + probably others. Enabling this option chooses + the (double, double) version. Note there is a + function double scalbn(double, int) which is + unaffected by this choice." + type boolean + parent CYGPKG_LIBM_COMPATIBILITY + } + + cdl_option CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION { + display "Reduce namespace pollution" + description "If you do not want to use either the X/Open or + SVID3 compatibility modes, you may want to define + this option to reduce the chance of namespace + pollution. This is particularly likely to occur + here as these standards define symbols with + names that often appear in applications, such as + exception, DOMAIN, OVERFLOW, etc. If your + application also used these names, it may cause + problems." + type boolean + parent CYGPKG_LIBM_COMPATIBILITY + } + + cdl_option CYGSEM_LIBM_USE_STDERR { + display "Output to stderr for math errors" + description "The SVID3 standard says that error + messages should be output on the stderr console + output stream. This option allows this ability + to be explicitly controlled. However, this still + only has an effect in SVID3 compatibility mode." + type boolean + requires !CYGSEM_LIBM_COMPAT_IEEE_ONLY + requires CYGPKG_LIBC_STDIO + parent CYGPKG_LIBM_COMPATIBILITY + } + + }}CFG_DATA +*/ + +#undef CYGSEM_LIBM_COMPAT_IEEE_ONLY +#define CYGPKG_LIBM_COMPATIBILITY_DEFAULT + +#ifdef CYGPKG_LIBM_COMPATIBILITY_DEFAULT +# ifndef CYGPKG_LIBC +# error You must include the libc package if enabling \ + CYGPKG_LIBM_COMPATIBILITY_DEFAULT +# endif +#endif + +#define CYGNUM_LIBM_COMPATIBILITY_POSIX +#undef CYGNUM_LIBM_COMPATIBILITY_IEEE +#undef CYGNUM_LIBM_COMPATIBILITY_XOPEN +#undef CYGNUM_LIBM_COMPATIBILITY_SVID + + +#if defined(CYGPKG_LIBM_COMPATIBILITY_DEFAULT) +# if defined(CYGNUM_LIBM_COMPATIBILITY_POSIX) +# define CYGNUM_LIBM_COMPAT_DEFAULT CYGNUM_LIBM_COMPAT_POSIX +# elif defined(CYGNUM_LIBM_COMPATIBILITY_IEEE) +# define CYGNUM_LIBM_COMPAT_DEFAULT CYGNUM_LIBM_COMPAT_IEEE +# elif defined(CYGNUM_LIBM_COMPATIBILITY_XOPEN) +# define CYGNUM_LIBM_COMPAT_DEFAULT CYGNUM_LIBM_COMPAT_XOPEN +# elif defined(CYGNUM_LIBM_COMPATIBILITY_SVID) +# define CYGNUM_LIBM_COMPAT_DEFAULT CYGNUM_LIBM_COMPAT_SVID +# else +# error Configuration broken - no default mode set +# endif +#endif + +#define CYGFUN_LIBM_SVID3_scalb + +#undef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION + +#undef CYGSEM_LIBM_USE_STDERR + +//======================================================================== +// +// THREAD-SAFETY CONFIGURATION OPTIONS + +/* + {{CFG_DATA + + cdl_component CYGPKG_LIBM_THREAD_SAFETY { + display "Thread safety" + description "This option controls whether the C library has + support for thread safe operation in general. + This requires eCos kernel support for per-thread + data, and adjustment of the stack limit." + type dummy + parent CYGPKG_LIBM + doc ref/ecos-ref/c-and-math-library-overview-thread-safety.html + } + + cdl_option CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE { + display "Compatibility mode setting" + description "This option makes the setting of the compatiblity + mode be a per-thread property. This directly + implies that it also becomes thread-safe." + requires !CYGSEM_LIBM_COMPAT_IEEE_ONLY + requires CYGVAR_KERNEL_THREADS_DATA + parent CYGPKG_LIBM_THREAD_SAFETY + } + }}CFG_DATA + +*/ + + +#ifndef CYGSEM_LIBM_COMPAT_IEEE_ONLY // irrelevant if mode is constant +#undef CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE +#endif + +#if ( (defined(CYGSEM_LIBM_THREAD_SAFE_GAMMA_FUNCTIONS) || \ + defined(CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE)) && \ + !defined(CYGVAR_KERNEL_THREADS_DATA) ) +# error The kernel must have thread-specific data (CYGVAR_KERNEL_THREADS_DATA) \ + turned on for a thread-safe math library +#endif + +//======================================================================== +// +// TRACING OPTIONS + +/* + {{CFG_DATA + + cdl_component CYGPKG_LIBM_TRACE { + display "Tracing output levels in Math library" + description "Tracing support is useful for debugging. Some + Math library modules can be configured with + different levels of tracing verbosity. These + levels can be configured here." + type boolean + requires CYGDBG_USE_TRACING + parent CYGPKG_LIBM + } + + cdl_option CYGNUM_LIBM_COMPATMODE_TRACE_LEVEL { + display "Compatibility mode get/set" + description "Trace level for debugging the getting and + setting of the compatibility mode when it is + configured to be thread-safe." + type count + legal_values 0 to 1 + requires CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE + parent CYGPKG_LIBM_TRACE + } + }}CFG_DATA + +*/ + +#undef CYGPKG_LIBM_TRACE + +#ifdef CYGPKG_LIBM_TRACE + +#define CYGNUM_LIBM_COMPATMODE_TRACE_LEVEL 0 + + +#endif + + +#endif // CYGONCE_PKGCONF_LIBM_H multiple inclusion protection + +// EOF libm.h diff --git a/packages/language/c/libm/current/include/sys/ieeefp.h b/packages/language/c/libm/current/include/sys/ieeefp.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/include/sys/ieeefp.h @@ -0,0 +1,196 @@ +#ifndef CYGONCE_LIBM_SYS_IEEEFP_H +#define CYGONCE_LIBM_SYS_IEEEFP_H +//=========================================================================== +// +// ieeefp.h +// +// Definitions specific to IEEE-754 floating-point format +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Definitions specific to IEEE-754 floating-point format +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// INCLUDES + +#include // Common type definitions and support + // including endian-ness + +#if (CYG_BYTEORDER == CYG_MSBFIRST) // Big endian + +typedef union +{ + cyg_int32 asi32[2]; + + cyg_int64 asi64; + + double value; + + struct + { + unsigned int sign : 1; + unsigned int exponent: 11; + unsigned int fraction0:4; + unsigned int fraction1:16; + unsigned int fraction2:16; + unsigned int fraction3:16; + + } number; + + struct + { + unsigned int sign : 1; + unsigned int exponent: 11; + unsigned int quiet:1; + unsigned int function0:3; + unsigned int function1:16; + unsigned int function2:16; + unsigned int function3:16; + } nan; + + struct + { + cyg_uint32 msw; + cyg_uint32 lsw; + } parts; + +} Cyg_libm_ieee_double_shape_type; + + +typedef union +{ + cyg_int32 asi32; + + float value; + + struct + { + unsigned int sign : 1; + unsigned int exponent: 8; + unsigned int fraction0: 7; + unsigned int fraction1: 16; + } number; + + struct + { + unsigned int sign:1; + unsigned int exponent:8; + unsigned int quiet:1; + unsigned int function0:6; + unsigned int function1:16; + } nan; + +} Cyg_libm_ieee_float_shape_type; + + +#else // Little endian + +typedef union +{ + cyg_int32 asi32[2]; + + cyg_int64 asi64; + + double value; + + struct + { + unsigned int fraction3:16; + unsigned int fraction2:16; + unsigned int fraction1:16; + unsigned int fraction0: 4; + unsigned int exponent :11; + unsigned int sign : 1; + } number; + + struct + { + unsigned int function3:16; + unsigned int function2:16; + unsigned int function1:16; + unsigned int function0:3; + unsigned int quiet:1; + unsigned int exponent: 11; + unsigned int sign : 1; + } nan; + + struct + { + cyg_uint32 lsw; + cyg_uint32 msw; + } parts; + +} Cyg_libm_ieee_double_shape_type; + + +typedef union +{ + cyg_int32 asi32; + + float value; + + struct + { + unsigned int fraction0: 7; + unsigned int fraction1: 16; + unsigned int exponent: 8; + unsigned int sign : 1; + } number; + + struct + { + unsigned int function1:16; + unsigned int function0:6; + unsigned int quiet:1; + unsigned int exponent:8; + unsigned int sign:1; + } nan; + +} Cyg_libm_ieee_float_shape_type; + +#endif // little-endian + + +#endif // ifdef CYGPKG_LIBM + +#endif // CYGONCE_LIBM_SYS_IEEEFP_H multiple inclusion protection + +// EOF ieeefp.h diff --git a/packages/language/c/libm/current/src/PKGconf.mak b/packages/language/c/libm/current/src/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/PKGconf.mak @@ -0,0 +1,74 @@ +#========================================================================= +# +# makefile +# +# language/c/libm/src +# +#========================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#========================================================================= + +PACKAGE := libm +include ../../../../../pkgconf/pkgconf.mak + +LIBRARY := libtarget.a +COMPILE := misc/matherr.c misc/standard.c misc/compatmode.cxx \ + misc/infconst.c \ + \ + double/ieee754-core/e_acos.c double/ieee754-core/e_asin.c \ + double/ieee754-core/e_atan2.c double/ieee754-core/e_cosh.c \ + double/ieee754-core/e_exp.c double/ieee754-core/e_fmod.c \ + double/ieee754-core/e_log.c double/ieee754-core/e_log10.c \ + double/ieee754-core/e_pow.c \ + double/ieee754-core/e_rem_pio2.c \ + double/ieee754-core/e_scalb.c double/ieee754-core/e_sinh.c \ + double/ieee754-core/e_sqrt.c \ + \ + double/ieee754-api/w_acos.c double/ieee754-api/w_asin.c \ + double/ieee754-api/w_atan2.c double/ieee754-api/w_cosh.c \ + double/ieee754-api/w_exp.c double/ieee754-api/w_fmod.c \ + double/ieee754-api/w_log.c double/ieee754-api/w_log10.c \ + double/ieee754-api/w_pow.c double/ieee754-api/w_scalb.c \ + double/ieee754-api/w_sinh.c double/ieee754-api/w_sqrt.c \ + \ + double/internal/k_cos.c double/internal/k_rem_pio2.c \ + double/internal/k_sin.c double/internal/k_tan.c \ + \ + double/portable-api/s_atan.c double/portable-api/s_ceil.c \ + double/portable-api/s_copysign.c \ + double/portable-api/s_cos.c double/portable-api/s_expm1.c \ + double/portable-api/s_fabs.c double/portable-api/s_finite.c\ + double/portable-api/s_floor.c double/portable-api/s_frexp.c\ + double/portable-api/s_isnan.c double/portable-api/s_ldexp.c\ + double/portable-api/s_rint.c double/portable-api/s_scalbn.c\ + double/portable-api/s_sin.c double/portable-api/s_tan.c \ + double/portable-api/s_modf.c double/portable-api/s_tanh.c + + + +OTHER_OBJS := +OTHER_TARGETS := +OTHER_CLEAN := + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.src + diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_acos.c b/packages/language/c/libm/current/src/double/ieee754-api/w_acos.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_acos.c @@ -0,0 +1,89 @@ +//=========================================================================== +// +// w_acos.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_acos.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrap_acos(x) + */ + +#include "mathincl/fdlibm.h" + + + double acos(double x) /* wrapper acos */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_acos(x); +#else + double z; + z = __ieee754_acos(x); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x)) return z; + if(fabs(x)>1.0) { + return __kernel_standard(x,x,1); /* acos(|x|>1) */ + } else + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_acos.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_asin.c b/packages/language/c/libm/current/src/double/ieee754-api/w_asin.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_asin.c @@ -0,0 +1,91 @@ +//=========================================================================== +// +// w_asin.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_asin.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + */ + +/* + * wrapper asin(x) + */ + + +#include "mathincl/fdlibm.h" + + + double asin(double x) /* wrapper asin */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_asin(x); +#else + double z; + z = __ieee754_asin(x); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x)) return z; + if(fabs(x)>1.0) { + return __kernel_standard(x,x,2); /* asin(|x|>1) */ + } else + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_asin.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_atan2.c b/packages/language/c/libm/current/src/double/ieee754-api/w_atan2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_atan2.c @@ -0,0 +1,90 @@ +//=========================================================================== +// +// w_atan2.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_atan2.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + */ + +/* + * wrapper atan2(y,x) + */ + +#include "mathincl/fdlibm.h" + + + double atan2(double y, double x) /* wrapper atan2 */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_atan2(y,x); +#else + double z; + z = __ieee754_atan2(y,x); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE||isnan(x)||isnan(y)) return z; + if(x==0.0&&y==0.0) { + return __kernel_standard(y,x,3); /* atan2(+-0,+-0) */ + } else + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_atan2.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_cosh.c b/packages/language/c/libm/current/src/double/ieee754-api/w_cosh.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_cosh.c @@ -0,0 +1,88 @@ +//=========================================================================== +// +// w_cosh.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_cosh.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper cosh(x) + */ + +#include "mathincl/fdlibm.h" + + double cosh(double x) /* wrapper cosh */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_cosh(x); +#else + double z; + z = __ieee754_cosh(x); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x)) return z; + if(fabs(x)>7.10475860073943863426e+02) { + return __kernel_standard(x,x,5); /* cosh overflow */ + } else + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_cosh.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_exp.c b/packages/language/c/libm/current/src/double/ieee754-api/w_exp.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_exp.c @@ -0,0 +1,95 @@ +//=========================================================================== +// +// w_exp.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_exp.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper exp(x) + */ + +#include "mathincl/fdlibm.h" + +static const double +o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */ +u_threshold= -7.45133219101941108420e+02; /* 0xc0874910, 0xD52D3051 */ + + double exp(double x) /* wrapper exp */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_exp(x); +#else + double z; + z = __ieee754_exp(x); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return z; + if(finite(x)) { + if(x>o_threshold) + return __kernel_standard(x,x,6); /* exp overflow */ + else if(x // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_fmod.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper fmod(x,y) + */ + +#include "mathincl/fdlibm.h" + + + double fmod(double x, double y) /* wrapper fmod */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_fmod(x,y); +#else + double z; + z = __ieee754_fmod(x,y); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE ||isnan(y)||isnan(x)) return z; + if(y==0.0) { + return __kernel_standard(x,y,27); /* fmod(x,0) */ + } else + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_fmod.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_log.c b/packages/language/c/libm/current/src/double/ieee754-api/w_log.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_log.c @@ -0,0 +1,89 @@ +//=========================================================================== +// +// w_log.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_log.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper log(x) + */ + +#include "mathincl/fdlibm.h" + + + double log(double x) /* wrapper log */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_log(x); +#else + double z; + z = __ieee754_log(x); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x) || x > 0.0) return z; + if(x==0.0) + return __kernel_standard(x,x,16); /* log(0) */ + else + return __kernel_standard(x,x,17); /* log(x<0) */ +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_log.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_log10.c b/packages/language/c/libm/current/src/double/ieee754-api/w_log10.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_log10.c @@ -0,0 +1,92 @@ +//=========================================================================== +// +// w_log10.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_log10.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper log10(X) + */ + +#include "mathincl/fdlibm.h" + + + double log10(double x) /* wrapper log10 */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_log10(x); +#else + double z; + z = __ieee754_log10(x); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x)) return z; + if(x<=0.0) { + if(x==0.0) + return __kernel_standard(x,x,18); /* log10(0) */ + else + return __kernel_standard(x,x,19); /* log10(x<0) */ + } else + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_log10.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_pow.c b/packages/language/c/libm/current/src/double/ieee754-api/w_pow.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_pow.c @@ -0,0 +1,112 @@ +//======================================================================== +// +// w_pow.c +// +// Part of the standard mathematical function library +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + + +/* @(#)w_pow.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper pow(x,y) return x**y + */ + +#include "mathincl/fdlibm.h" + + + double pow(double x, double y) /* wrapper pow */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_pow(x,y); +#else + double z; + z=__ieee754_pow(x,y); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE|| + isnan(y)) + return z; + if(isnan(x)) { + if(y==0.0) + return __kernel_standard(x,y,42); /* pow(NaN,0.0) */ + else + return z; + } + if(x==0.0){ + if(y==0.0) + return __kernel_standard(x,y,20); /* pow(0.0,0.0) */ + if(finite(y)&&y<0.0) + return __kernel_standard(x,y,23); /* pow(0.0,negative) */ + return z; + } + if(!finite(z)) { + if(finite(x)&&finite(y)) { + if(isnan(z)) + return __kernel_standard(x,y,24);/* pow neg**non-int */ + else + return __kernel_standard(x,y,21); /* pow overflow */ + } + } + if(z==0.0&&finite(x)&&finite(y)) + return __kernel_standard(x,y,22); /* pow underflow */ + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_pow.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_scalb.c b/packages/language/c/libm/current/src/double/ieee754-api/w_scalb.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_scalb.c @@ -0,0 +1,104 @@ +//=========================================================================== +// +// w_scalb.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_scalb.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper scalb(double x, double fn) is provide for + * passing various standard test suite. One + * should use scalbn() instead. + */ + +#include "mathincl/fdlibm.h" + +#ifndef CYGSEM_LIBM_COMPAT_IEEE_ONLY +# include +#endif + +#ifdef CYGFUN_LIBM_SVID3_scalb + double scalb(double x, double fn) /* wrapper scalb */ +#else + double scalb(double x, int fn) /* wrapper scalb */ +#endif +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_scalb(x,fn); +#else + double z; + z = __ieee754_scalb(x,fn); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return z; + if(!(finite(z)||isnan(z))&&finite(x)) { + return __kernel_standard(x,(double)fn,32); /* scalb overflow */ + } + if(z==0.0&&z!=x) { + return __kernel_standard(x,(double)fn,33); /* scalb underflow */ + } +#ifdef CYGFUN_LIBM_SVID3_scalb + if(!finite(fn)) errno = ERANGE; +#endif + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_scalb.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_sinh.c b/packages/language/c/libm/current/src/double/ieee754-api/w_sinh.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_sinh.c @@ -0,0 +1,88 @@ +//=========================================================================== +// +// w_sinh.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_sinh.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper sinh(x) + */ + +#include "mathincl/fdlibm.h" + + double sinh(double x) /* wrapper sinh */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_sinh(x); +#else + double z; + z = __ieee754_sinh(x); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return z; + if(!finite(z)&&finite(x)) { + return __kernel_standard(x,x,25); /* sinh overflow */ + } else + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_sinh.c diff --git a/packages/language/c/libm/current/src/double/ieee754-api/w_sqrt.c b/packages/language/c/libm/current/src/double/ieee754-api/w_sqrt.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-api/w_sqrt.c @@ -0,0 +1,88 @@ +//=========================================================================== +// +// w_sqrt.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)w_sqrt.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper sqrt(x) + */ + +#include "mathincl/fdlibm.h" + + double sqrt(double x) /* wrapper sqrt */ +{ +#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY + return __ieee754_sqrt(x); +#else + double z; + z = __ieee754_sqrt(x); + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x)) return z; + if(x<0.0) { + return __kernel_standard(x,x,26); /* sqrt(negative) */ + } else + return z; +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF w_sqrt.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_acos.c b/packages/language/c/libm/current/src/double/ieee754-core/e_acos.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_acos.c @@ -0,0 +1,151 @@ +//=========================================================================== +// +// e_acos.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_acos.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_acos(x) + * Method : + * acos(x) = pi/2 - asin(x) + * acos(-x) = pi/2 + asin(x) + * For |x|<=0.5 + * acos(x) = pi/2 - (x + x*x^2*R(x^2)) (see asin.c) + * For x>0.5 + * acos(x) = pi/2 - (pi/2 - 2asin(sqrt((1-x)/2))) + * = 2asin(sqrt((1-x)/2)) + * = 2s + 2s*z*R(z) ...z=(1-x)/2, s=sqrt(z) + * = 2f + (2c + 2s*z*R(z)) + * where f=hi part of s, and c = (z-f*f)/(s+f) is the correction term + * for f so that f+c ~ sqrt(z). + * For x<-0.5 + * acos(x) = pi - 2asin(sqrt((1-|x|)/2)) + * = pi - 0.5*(s+s*z*R(z)), where z=(1-|x|)/2,s=sqrt(z) + * + * Special cases: + * if x is NaN, return x itself; + * if |x|>1, return NaN with invalid signal. + * + * Function needed: sqrt + */ + +#include "mathincl/fdlibm.h" + +static const double +one= 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ +pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */ +pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */ +pio2_lo = 6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */ +pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */ +pS1 = -3.25565818622400915405e-01, /* 0xBFD4D612, 0x03EB6F7D */ +pS2 = 2.01212532134862925881e-01, /* 0x3FC9C155, 0x0E884455 */ +pS3 = -4.00555345006794114027e-02, /* 0xBFA48228, 0xB5688F3B */ +pS4 = 7.91534994289814532176e-04, /* 0x3F49EFE0, 0x7501B288 */ +pS5 = 3.47933107596021167570e-05, /* 0x3F023DE1, 0x0DFDF709 */ +qS1 = -2.40339491173441421878e+00, /* 0xC0033A27, 0x1C8A2D4B */ +qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */ +qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */ +qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */ + + double __ieee754_acos(double x) +{ + double z,p,q,r,w,s,c,df; + int hx,ix; + hx = CYG_LIBM_HI(x); + ix = hx&0x7fffffff; + if(ix>=0x3ff00000) { /* |x| >= 1 */ + if(((ix-0x3ff00000)|CYG_LIBM_LO(x))==0) { /* |x|==1 */ + if(hx>0) return 0.0; /* acos(1) = 0 */ + else return pi+2.0*pio2_lo; /* acos(-1)= pi */ + } + return (x-x)/(x-x); /* acos(|x|>1) is NaN */ + } + if(ix<0x3fe00000) { /* |x| < 0.5 */ + if(ix<=0x3c600000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/ + z = x*x; + p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5))))); + q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4))); + r = p/q; + return pio2_hi - (x - (pio2_lo-x*r)); + } else if (hx<0) { /* x < -0.5 */ + z = (one+x)*0.5; + p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5))))); + q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4))); + s = sqrt(z); + r = p/q; + w = r*s-pio2_lo; + return pi - 2.0*(s+w); + } else { /* x > 0.5 */ + z = (one-x)*0.5; + s = sqrt(z); + df = s; + CYG_LIBM_LO(df) = 0; + c = (z-df*df)/(s+df); + p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5))))); + q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4))); + r = p/q; + w = r*s+c; + return 2.0*(df+w); + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_acos.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_asin.c b/packages/language/c/libm/current/src/double/ieee754-core/e_asin.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_asin.c @@ -0,0 +1,162 @@ +//=========================================================================== +// +// e_asin.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_asin.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_asin(x) + * Method : + * Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ... + * we approximate asin(x) on [0,0.5] by + * asin(x) = x + x*x^2*R(x^2) + * where + * R(x^2) is a rational approximation of (asin(x)-x)/x^3 + * and its remez error is bounded by + * |(asin(x)-x)/x^3 - R(x^2)| < 2^(-58.75) + * + * For x in [0.5,1] + * asin(x) = pi/2-2*asin(sqrt((1-x)/2)) + * Let y = (1-x), z = y/2, s := sqrt(z), and pio2_hi+pio2_lo=pi/2; + * then for x>0.98 + * asin(x) = pi/2 - 2*(s+s*z*R(z)) + * = pio2_hi - (2*(s+s*z*R(z)) - pio2_lo) + * For x<=0.98, let pio4_hi = pio2_hi/2, then + * f = hi part of s; + * c = sqrt(z) - f = (z-f*f)/(s+f) ...f+c=sqrt(z) + * and + * asin(x) = pi/2 - 2*(s+s*z*R(z)) + * = pio4_hi+(pio4-2s)-(2s*z*R(z)-pio2_lo) + * = pio4_hi+(pio4-2f)-(2s*z*R(z)-(pio2_lo+2c)) + * + * Special cases: + * if x is NaN, return x itself; + * if |x|>1, return NaN with invalid signal. + * + */ + + +#include "mathincl/fdlibm.h" + +static const double +one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ +huge = 1.000e+300, +pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */ +pio2_lo = 6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */ +pio4_hi = 7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */ + /* coefficient for R(x^2) */ +pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */ +pS1 = -3.25565818622400915405e-01, /* 0xBFD4D612, 0x03EB6F7D */ +pS2 = 2.01212532134862925881e-01, /* 0x3FC9C155, 0x0E884455 */ +pS3 = -4.00555345006794114027e-02, /* 0xBFA48228, 0xB5688F3B */ +pS4 = 7.91534994289814532176e-04, /* 0x3F49EFE0, 0x7501B288 */ +pS5 = 3.47933107596021167570e-05, /* 0x3F023DE1, 0x0DFDF709 */ +qS1 = -2.40339491173441421878e+00, /* 0xC0033A27, 0x1C8A2D4B */ +qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */ +qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */ +qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */ + + double __ieee754_asin(double x) +{ + double t,w,p,q,c,r,s; + int hx,ix; + + hx = CYG_LIBM_HI(x); + ix = hx&0x7fffffff; + if(ix>= 0x3ff00000) { /* |x|>= 1 */ + if(((ix-0x3ff00000)|CYG_LIBM_LO(x))==0) + /* asin(1)=+-pi/2 with inexact */ + return x*pio2_hi+x*pio2_lo; + return (x-x)/(x-x); /* asin(|x|>1) is NaN */ + } else if (ix<0x3fe00000) { /* |x|<0.5 */ + if(ix<0x3e400000) { /* if |x| < 2**-27 */ + if(huge+x>one) return x;/* return x with inexact if x!=0*/ + } else { + t = x*x; + p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); + q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); + w = p/q; + return x+x*w; + } + } + /* 1> |x|>= 0.5 */ + w = one-fabs(x); + t = w*0.5; + p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); + q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); + s = sqrt(t); + if(ix>=0x3FEF3333) { /* if |x| > 0.975 */ + w = p/q; + t = pio2_hi-(2.0*(s+s*w)-pio2_lo); + } else { + w = s; + CYG_LIBM_LO(w) = 0; + c = (t-w*w)/(s+w); + r = p/q; + p = 2.0*s*r-(pio2_lo-2.0*c); + q = pio4_hi-2.0*w; + t = pio4_hi-(p-q); + } + if(hx>0) return t; else return -t; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_asin.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_atan2.c b/packages/language/c/libm/current/src/double/ieee754-core/e_atan2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_atan2.c @@ -0,0 +1,169 @@ +//=========================================================================== +// +// e_atan2.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_atan2.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + */ + +/* __ieee754_atan2(y,x) + * Method : + * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x). + * 2. Reduce x to positive by (if x and y are unexceptional): + * ARG (x+iy) = arctan(y/x) ... if x > 0, + * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0, + * + * Special cases: + * + * ATAN2((anything), NaN ) is NaN; + * ATAN2(NAN , (anything) ) is NaN; + * ATAN2(+-0, +(anything but NaN)) is +-0 ; + * ATAN2(+-0, -(anything but NaN)) is +-pi ; + * ATAN2(+-(anything but 0 and NaN), 0) is +-pi/2; + * ATAN2(+-(anything but INF and NaN), +INF) is +-0 ; + * ATAN2(+-(anything but INF and NaN), -INF) is +-pi; + * ATAN2(+-INF,+INF ) is +-pi/4 ; + * ATAN2(+-INF,-INF ) is +-3pi/4; + * ATAN2(+-INF, (anything but,0,NaN, and INF)) is +-pi/2; + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "mathincl/fdlibm.h" + +static const double +tiny = 1.0e-300, +zero = 0.0, +pi_o_4 = 7.8539816339744827900E-01, /* 0x3FE921FB, 0x54442D18 */ +pi_o_2 = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */ +pi = 3.1415926535897931160E+00, /* 0x400921FB, 0x54442D18 */ +pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ + + double __ieee754_atan2(double y, double x) +{ + double z; + int k,m,hx,hy,ix,iy; + unsigned lx,ly; + + hx = CYG_LIBM_HI(x); ix = hx&0x7fffffff; + lx = CYG_LIBM_LO(x); + hy = CYG_LIBM_HI(y); iy = hy&0x7fffffff; + ly = CYG_LIBM_LO(y); + if(((ix|((lx|-lx)>>31))>0x7ff00000)|| + ((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */ + return x+y; + if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */ + m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ + + /* when y = 0 */ + if((iy|ly)==0) { + switch(m) { + case 0: + case 1: return y; /* atan(+-0,+anything)=+-0 */ + case 2: return pi+tiny;/* atan(+0,-anything) = pi */ + case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ + } + } + /* when x = 0 */ + if((ix|lx)==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + + /* when x is INF */ + if(ix==0x7ff00000) { + if(iy==0x7ff00000) { + switch(m) { + case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */ + case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */ + case 2: return 3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/ + case 3: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/ + } + } else { + switch(m) { + case 0: return zero ; /* atan(+...,+INF) */ + case 1: return -zero ; /* atan(-...,+INF) */ + case 2: return pi+tiny ; /* atan(+...,-INF) */ + case 3: return -pi-tiny ; /* atan(-...,-INF) */ + } + } + } + /* when y is INF */ + if(iy==0x7ff00000) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + + /* compute y/x */ + k = (iy-ix)>>20; + if(k > 60) z=pi_o_2+0.5*pi_lo; /* |y/x| > 2**60 */ + else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */ + else z=atan(fabs(y/x)); /* safe to do y/x */ + switch (m) { + case 0: return z ; /* atan(+,+) */ + case 1: CYG_LIBM_HI(z) ^= 0x80000000; + return z ; /* atan(-,+) */ + case 2: return pi-(z-pi_lo);/* atan(+,-) */ + default: /* case 3 */ + return (z-pi_lo)-pi;/* atan(-,-) */ + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_atan2.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_cosh.c b/packages/language/c/libm/current/src/double/ieee754-core/e_cosh.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_cosh.c @@ -0,0 +1,135 @@ +//=========================================================================== +// +// e_cosh.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_cosh.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_cosh(x) + * Method : + * mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2 + * 1. Replace x by |x| (cosh(x) = cosh(-x)). + * 2. + * [ exp(x) - 1 ]^2 + * 0 <= x <= ln2/2 : cosh(x) := 1 + ------------------- + * 2*exp(x) + * + * exp(x) + 1/exp(x) + * ln2/2 <= x <= 22 : cosh(x) := ------------------- + * 2 + * 22 <= x <= lnovft : cosh(x) := exp(x)/2 + * lnovft <= x <= ln2ovft: cosh(x) := exp(x/2)/2 * exp(x/2) + * ln2ovft < x : cosh(x) := huge*huge (overflow) + * + * Special cases: + * cosh(x) is |x| if x is +INF, -INF, or NaN. + * only cosh(0)=1 is exact for finite x. + */ + +#include "mathincl/fdlibm.h" + +static const double one = 1.0, half=0.5, huge = 1.0e300; + + double __ieee754_cosh(double x) +{ + double t,w; + int ix; + unsigned lx; + + /* High word of |x|. */ + ix = CYG_LIBM_HI(x); + ix &= 0x7fffffff; + + /* x is INF or NaN */ + if(ix>=0x7ff00000) return x*x; + + /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */ + if(ix<0x3fd62e43) { + t = expm1(fabs(x)); + w = one+t; + if (ix<0x3c800000) return w; /* cosh(tiny) = 1 */ + return one+(t*t)/(w+w); + } + + /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */ + if (ix < 0x40360000) { + t = __ieee754_exp(fabs(x)); + return half*t+half/t; + } + + /* |x| in [22, log(maxdouble)] return half*exp(|x|) */ + if (ix < 0x40862E42) return half*__ieee754_exp(fabs(x)); + + /* |x| in [log(maxdouble), overflowthresold] */ + lx = *( (((*(unsigned*)&one)>>29)) + (unsigned*)&x); + if (ix<0x408633CE || + ((ix==0x408633ce)&&(lx<=(unsigned)0x8fb9f87d))) { + w = __ieee754_exp(half*fabs(x)); + t = half*w; + return t*w; + } + + /* |x| > overflowthresold, cosh(x) overflow */ + return huge*huge; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_cosh.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_exp.c b/packages/language/c/libm/current/src/double/ieee754-core/e_exp.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_exp.c @@ -0,0 +1,207 @@ +//=========================================================================== +// +// e_exp.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_exp.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_exp(x) + * Returns the exponential of x. + * + * Method + * 1. Argument reduction: + * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658. + * Given x, find r and integer k such that + * + * x = k*ln2 + r, |r| <= 0.5*ln2. + * + * Here r will be represented as r = hi-lo for better + * accuracy. + * + * 2. Approximation of exp(r) by a special rational function on + * the interval [0,0.34658]: + * Write + * R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ... + * We use a special Reme algorithm on [0,0.34658] to generate + * a polynomial of degree 5 to approximate R. The maximum error + * of this polynomial approximation is bounded by 2**-59. In + * other words, + * R(z) ~ 2.0 + P1*z + P2*z**2 + P3*z**3 + P4*z**4 + P5*z**5 + * (where z=r*r, and the values of P1 to P5 are listed below) + * and + * | 5 | -59 + * | 2.0+P1*z+...+P5*z - R(z) | <= 2 + * | | + * The computation of exp(r) thus becomes + * 2*r + * exp(r) = 1 + ------- + * R - r + * r*R1(r) + * = 1 + r + ----------- (for better accuracy) + * 2 - R1(r) + * where + * 2 4 10 + * R1(r) = r - (P1*r + P2*r + ... + P5*r ). + * + * 3. Scale back to obtain exp(x): + * From step 1, we have + * exp(x) = 2^k * exp(r) + * + * Special cases: + * exp(INF) is INF, exp(NaN) is NaN; + * exp(-INF) is 0, and + * for finite argument, only exp(0)=1 is exact. + * + * Accuracy: + * according to an error analysis, the error is always less than + * 1 ulp (unit in the last place). + * + * Misc. info. + * For IEEE double + * if x > 7.09782712893383973096e+02 then exp(x) overflow + * if x < -7.45133219101941108420e+02 then exp(x) underflow + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "mathincl/fdlibm.h" + +static const double +one = 1.0, +halF[2] = {0.5,-0.5,}, +huge = 1.0e+300, +twom1000= 9.33263618503218878990e-302, /* 2**-1000=0x01700000,0*/ +o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */ +u_threshold= -7.45133219101941108420e+02, /* 0xc0874910, 0xD52D3051 */ +ln2HI[2] ={ 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */ + -6.93147180369123816490e-01,},/* 0xbfe62e42, 0xfee00000 */ +ln2LO[2] ={ 1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */ + -1.90821492927058770002e-10,},/* 0xbdea39ef, 0x35793c76 */ +invln2 = 1.44269504088896338700e+00, /* 0x3ff71547, 0x652b82fe */ +P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */ +P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */ +P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */ +P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */ +P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ + + + double __ieee754_exp(double x) /* default IEEE double exp */ +{ + double y,hi,lo,c,t; + int k,xsb; + unsigned hx; + + hi=lo=0.0; /* to placate compiler */ + hx = CYG_LIBM_HI(x); /* high word of x */ + xsb = (hx>>31)&1; /* sign bit of x */ + hx &= 0x7fffffff; /* high word of |x| */ + + /* filter out non-finite argument */ + if(hx >= 0x40862E42) { /* if |x|>=709.78... */ + if(hx>=0x7ff00000) { + if(((hx&0xfffff)|CYG_LIBM_LO(x))!=0) + return x+x; /* NaN */ + else return (xsb==0)? x:0.0; /* exp(+-inf)={inf,0} */ + } + if(x > o_threshold) return huge*huge; /* overflow */ + if(x < u_threshold) return twom1000*twom1000; /* underflow */ + } + + /* argument reduction */ + if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ + if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ + hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb; + } else { + k = invln2*x+halF[xsb]; + t = k; + hi = x - t*ln2HI[0]; /* t*ln2HI is exact here */ + lo = t*ln2LO[0]; + } + x = hi - lo; + } + else if(hx < 0x3e300000) { /* when |x|<2**-28 */ + if(huge+x>one) + return one+x;/* trigger inexact */ + else + k = 0; + } + else k = 0; + + /* x is now in primary range */ + t = x*x; + c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); + if(k==0) return one-((x*c)/(c-2.0)-x); + else y = one-((lo-(x*c)/(2.0-c))-hi); + if(k >= -1021) { + CYG_LIBM_HI(y) += (k<<20); /* add k to y's exponent */ + return y; + } else { + CYG_LIBM_HI(y) += ((k+1000)<<20);/* add k to y's exponent */ + return y*twom1000; + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_exp.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_fmod.c b/packages/language/c/libm/current/src/double/ieee754-core/e_fmod.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_fmod.c @@ -0,0 +1,186 @@ +//=========================================================================== +// +// e_fmod.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_fmod.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * __ieee754_fmod(x,y) + * Return x mod y in exact arithmetic + * Method: shift and subtract + */ + +#include "mathincl/fdlibm.h" + +static const double one = 1.0, Zero[] = {0.0, -0.0,}; + + double __ieee754_fmod(double x, double y) +{ + int n,hx,hy,hz,ix,iy,sx,i; + unsigned lx,ly,lz; + + hx = CYG_LIBM_HI(x); /* high word of x */ + lx = CYG_LIBM_LO(x); /* low word of x */ + hy = CYG_LIBM_HI(y); /* high word of y */ + ly = CYG_LIBM_LO(y); /* low word of y */ + sx = hx&0x80000000; /* sign of x */ + hx ^=sx; /* |x| */ + hy &= 0x7fffffff; /* |y| */ + + /* purge off exception values */ + if((hy|ly)==0||(hx>=0x7ff00000)|| /* y=0,or x not finite */ + ((hy|((ly|-ly)>>31))>0x7ff00000)) /* or y is NaN */ + return (x*y)/(x*y); + if(hx<=hy) { + if((hx>31]; /* |x|=|y| return x*0*/ + } + + /* determine ix = ilogb(x) */ + if(hx<0x00100000) { /* subnormal x */ + if(hx==0) { + for (ix = -1043, i=lx; i>0; i<<=1) ix -=1; + } else { + for (ix = -1022,i=(hx<<11); i>0; i<<=1) ix -=1; + } + } else ix = (hx>>20)-1023; + + /* determine iy = ilogb(y) */ + if(hy<0x00100000) { /* subnormal y */ + if(hy==0) { + for (iy = -1043, i=ly; i>0; i<<=1) iy -=1; + } else { + for (iy = -1022,i=(hy<<11); i>0; i<<=1) iy -=1; + } + } else iy = (hy>>20)-1023; + + /* set up {hx,lx}, {hy,ly} and align y to x */ + if(ix >= -1022) + hx = 0x00100000|(0x000fffff&hx); + else { /* subnormal x, shift x to normal */ + n = -1022-ix; + if(n<=31) { + hx = (hx<>(32-n)); + lx <<= n; + } else { + hx = lx<<(n-32); + lx = 0; + } + } + if(iy >= -1022) + hy = 0x00100000|(0x000fffff&hy); + else { /* subnormal y, shift y to normal */ + n = -1022-iy; + if(n<=31) { + hy = (hy<>(32-n)); + ly <<= n; + } else { + hy = ly<<(n-32); + ly = 0; + } + } + + /* fix point fmod */ + n = ix - iy; + while(n--) { + hz=hx-hy;lz=lx-ly; if(lx>31); lx = lx+lx;} + else { + if((hz|lz)==0) /* return sign(x)*0 */ + return Zero[(unsigned)sx>>31]; + hx = hz+hz+(lz>>31); lx = lz+lz; + } + } + hz=hx-hy;lz=lx-ly; if(lx=0) {hx=hz;lx=lz;} + + /* convert back to floating value and restore the sign */ + if((hx|lx)==0) /* return sign(x)*0 */ + return Zero[(unsigned)sx>>31]; + while(hx<0x00100000) { /* normalize x */ + hx = hx+hx+(lx>>31); lx = lx+lx; + iy -= 1; + } + if(iy>= -1022) { /* normalize output */ + hx = ((hx-0x00100000)|((iy+1023)<<20)); + CYG_LIBM_HI(x) = hx|sx; + CYG_LIBM_LO(x) = lx; + } else { /* subnormal output */ + n = -1022 - iy; + if(n<=20) { + lx = (lx>>n)|((unsigned)hx<<(32-n)); + hx >>= n; + } else if (n<=31) { + lx = (hx<<(32-n))|(lx>>n); hx = sx; + } else { + lx = hx>>(n-32); hx = sx; + } + CYG_LIBM_HI(x) = hx|sx; + CYG_LIBM_LO(x) = lx; + x *= one; /* create necessary signal */ + } + return x; /* exact output */ +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_fmod.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_log.c b/packages/language/c/libm/current/src/double/ieee754-core/e_log.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_log.c @@ -0,0 +1,193 @@ +//=========================================================================== +// +// e_log.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_log.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_log(x) + * Return the logrithm of x + * + * Method : + * 1. Argument Reduction: find k and f such that + * x = 2^k * (1+f), + * where sqrt(2)/2 < 1+f < sqrt(2) . + * + * 2. Approximation of log(1+f). + * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) + * = 2s + 2/3 s**3 + 2/5 s**5 + ....., + * = 2s + s*R + * We use a special Reme algorithm on [0,0.1716] to generate + * a polynomial of degree 14 to approximate R The maximum error + * of this polynomial approximation is bounded by 2**-58.45. In + * other words, + * 2 4 6 8 10 12 14 + * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s + * (the values of Lg1 to Lg7 are listed in the program) + * and + * | 2 14 | -58.45 + * | Lg1*s +...+Lg7*s - R(z) | <= 2 + * | | + * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2. + * In order to guarantee error in log below 1ulp, we compute log + * by + * log(1+f) = f - s*(f - R) (if f is not too large) + * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy) + * + * 3. Finally, log(x) = k*ln2 + log(1+f). + * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo))) + * Here ln2 is split into two floating point number: + * ln2_hi + ln2_lo, + * where n*ln2_hi is always exact for |n| < 2000. + * + * Special cases: + * log(x) is NaN with signal if x < 0 (including -INF) ; + * log(+INF) is +INF; log(0) is -INF with signal; + * log(NaN) is that NaN with no signal. + * + * Accuracy: + * according to an error analysis, the error is always less than + * 1 ulp (unit in the last place). + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "mathincl/fdlibm.h" + +static const double +ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */ +ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */ +two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */ +Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */ +Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */ +Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */ +Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */ +Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */ +Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */ +Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ + +static double zero = 0.0; + + double __ieee754_log(double x) +{ + double hfsq,f,s,z,R,w,t1,t2,dk; + int k,hx,i,j; + unsigned lx; + + hx = CYG_LIBM_HI(x); /* high word of x */ + lx = CYG_LIBM_LO(x); /* low word of x */ + + k=0; + if (hx < 0x00100000) { /* x < 2**-1022 */ + if (((hx&0x7fffffff)|lx)==0) + return -two54/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 54; x *= two54; /* subnormal number, scale up x */ + hx = CYG_LIBM_HI(x); /* high word of x */ + } + if (hx >= 0x7ff00000) return x+x; + k += (hx>>20)-1023; + hx &= 0x000fffff; + i = (hx+0x95f64)&0x100000; + CYG_LIBM_HI(x) = hx|(i^0x3ff00000); /* normalize x or x/2 */ + k += (i>>20); + f = x-1.0; + if((0x000fffff&(2+hx))<3) { /* |f| < 2**-20 */ + if(f==zero) { + if(k==0) return zero; + else { + dk=(double)k; + return dk*ln2_hi+dk*ln2_lo; + } + } + R = f*f*(0.5-0.33333333333333333*f); + if(k==0) return f-R; + else { + dk=(double)k; + return dk*ln2_hi-((R-dk*ln2_lo)-f); + } + } + s = f/(2.0+f); + dk = (double)k; + z = s*s; + i = hx-0x6147a; + w = z*z; + j = 0x6b851-hx; + t1= w*(Lg2+w*(Lg4+w*Lg6)); + t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); + i |= j; + R = t2+t1; + if(i>0) { + hfsq=0.5*f*f; + if(k==0) return f-(hfsq-s*(hfsq+R)); else + return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f); + } else { + if(k==0) return f-s*(f-R); else + return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f); + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_log.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_log10.c b/packages/language/c/libm/current/src/double/ieee754-core/e_log10.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_log10.c @@ -0,0 +1,137 @@ +//=========================================================================== +// +// e_log10.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_log10.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_log10(x) + * Return the base 10 logarithm of x + * + * Method : + * Let log10_2hi = leading 40 bits of log10(2) and + * log10_2lo = log10(2) - log10_2hi, + * ivln10 = 1/log(10) rounded. + * Then + * n = ilogb(x), + * if(n<0) n = n+1; + * x = scalbn(x,-n); + * log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x)) + * + * Note 1: + * To guarantee log10(10**n)=n, where 10**n is normal, the rounding + * mode must set to Round-to-Nearest. + * Note 2: + * [1/log(10)] rounded to 53 bits has error .198 ulps; + * log10 is monotonic at all binary break points. + * + * Special cases: + * log10(x) is NaN with signal if x < 0; + * log10(+INF) is +INF with no signal; log10(0) is -INF with signal; + * log10(NaN) is that NaN with no signal; + * log10(10**N) = N for N=0,1,...,22. + * + * Constants: + * The hexadecimal values are the intended ones for the following constants. + * The decimal values may be used, provided that the compiler will convert + * from decimal to binary accurately enough to produce the hexadecimal values + * shown. + */ + +#include "mathincl/fdlibm.h" + +static const double +two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ +ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */ +log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */ +log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */ + +static double zero = 0.0; + + double __ieee754_log10(double x) +{ + double y,z; + int i,k,hx; + unsigned lx; + + hx = CYG_LIBM_HI(x); /* high word of x */ + lx = CYG_LIBM_LO(x); /* low word of x */ + + k=0; + if (hx < 0x00100000) { /* x < 2**-1022 */ + if (((hx&0x7fffffff)|lx)==0) + return -two54/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 54; x *= two54; /* subnormal number, scale up x */ + hx = CYG_LIBM_HI(x); /* high word of x */ + } + if (hx >= 0x7ff00000) return x+x; + k += (hx>>20)-1023; + i = ((unsigned)k&0x80000000)>>31; + hx = (hx&0x000fffff)|((0x3ff-i)<<20); + y = (double)(k+i); + CYG_LIBM_HI(x) = hx; + z = y*log10_2lo + ivln10*__ieee754_log(x); + return z+y*log10_2hi; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_log10.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_pow.c b/packages/language/c/libm/current/src/double/ieee754-core/e_pow.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_pow.c @@ -0,0 +1,356 @@ +//======================================================================== +// +// e_pow.c +// +// Part of the standard mathematical function library +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_pow.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_pow(x,y) return x**y + * + * n + * Method: Let x = 2 * (1+f) + * 1. Compute and return log2(x) in two pieces: + * log2(x) = w1 + w2, + * where w1 has 53-24 = 29 bit trailing zeros. + * 2. Perform y*log2(x) = n+y' by simulating muti-precision + * arithmetic, where |y'|<=0.5. + * 3. Return x**y = 2**n*exp(y'*log2) + * + * Special cases: + * 1. (anything) ** 0 is 1 + * 2. (anything) ** 1 is itself + * 3. (anything) ** NAN is NAN + * 4. NAN ** (anything except 0) is NAN + * 5. +-(|x| > 1) ** +INF is +INF + * 6. +-(|x| > 1) ** -INF is +0 + * 7. +-(|x| < 1) ** +INF is +0 + * 8. +-(|x| < 1) ** -INF is +INF + * 9. +-1 ** +-INF is NAN + * 10. +0 ** (+anything except 0, NAN) is +0 + * 11. -0 ** (+anything except 0, NAN, odd integer) is +0 + * 12. +0 ** (-anything except 0, NAN) is +INF + * 13. -0 ** (-anything except 0, NAN, odd integer) is +INF + * 14. -0 ** (odd integer) = -( +0 ** (odd integer) ) + * 15. +INF ** (+anything except 0,NAN) is +INF + * 16. +INF ** (-anything except 0,NAN) is +0 + * 17. -INF ** (anything) = -0 ** (-anything) + * 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer) + * 19. (-anything except 0 and inf) ** (non-integer) is NAN + * + * Accuracy: + * pow(x,y) returns x**y nearly rounded. In particular + * pow(integer,integer) + * always returns the correct integer provided it is + * representable. + * + * Constants : + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "mathincl/fdlibm.h" + +static const double +bp[] = {1.0, 1.5,}, +dp_h[] = { 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */ +dp_l[] = { 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */ +zero = 0.0, +one = 1.0, +two = 2.0, +two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */ +huge = 1.0e300, +tiny = 1.0e-300, + /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */ +L1 = 5.99999999999994648725e-01, /* 0x3FE33333, 0x33333303 */ +L2 = 4.28571428578550184252e-01, /* 0x3FDB6DB6, 0xDB6FABFF */ +L3 = 3.33333329818377432918e-01, /* 0x3FD55555, 0x518F264D */ +L4 = 2.72728123808534006489e-01, /* 0x3FD17460, 0xA91D4101 */ +L5 = 2.30660745775561754067e-01, /* 0x3FCD864A, 0x93C9DB65 */ +L6 = 2.06975017800338417784e-01, /* 0x3FCA7E28, 0x4A454EEF */ +P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */ +P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */ +P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */ +P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */ +P5 = 4.13813679705723846039e-08, /* 0x3E663769, 0x72BEA4D0 */ +lg2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */ +lg2_h = 6.93147182464599609375e-01, /* 0x3FE62E43, 0x00000000 */ +lg2_l = -1.90465429995776804525e-09, /* 0xBE205C61, 0x0CA86C39 */ +ovt = 8.0085662595372944372e-0017, /* -(1024-log2(ovfl+.5ulp)) */ +cp = 9.61796693925975554329e-01, /* 0x3FEEC709, 0xDC3A03FD =2/(3ln2) */ +cp_h = 9.61796700954437255859e-01,/* 0x3FEEC709, 0xE0000000 =(float)cp */ +cp_l = -7.02846165095275826516e-09,/* 0xBE3E2FE0,0x145B01F5=tail of cp_h*/ +ivln2 = 1.44269504088896338700e+00, /* 0x3FF71547, 0x652B82FE =1/ln2 */ +ivln2_h = 1.44269502162933349609e+00, /*0x3FF71547,0x60000000=24b 1/ln2*/ +ivln2_l = 1.92596299112661746887e-08;/*0x3E54AE0B,0xF85DDF44=1/ln2 tail*/ + + double __ieee754_pow(double x, double y) +{ + double z,ax,z_h,z_l,p_h,p_l; + double y1,t1,t2,r,s,t,u,v,w; + int i,j,k,yisint,n; + int hx,hy,ix,iy; + unsigned lx,ly; + + hx = CYG_LIBM_HI(x); lx = CYG_LIBM_LO(x); + hy = CYG_LIBM_HI(y); ly = CYG_LIBM_LO(y); + ix = hx&0x7fffffff; iy = hy&0x7fffffff; + + /* y==zero: x**0 = 1 */ + if((iy|ly)==0) return one; + + /* +-NaN return x+y */ + if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) || + iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0))) + return x+y; + + /* determine if y is an odd int when x < 0 + * yisint = 0 ... y is not an integer + * yisint = 1 ... y is an odd int + * yisint = 2 ... y is an even int + */ + yisint = 0; + if(hx<0) { + if(iy>=0x43400000) yisint = 2; /* even integer y */ + else if(iy>=0x3ff00000) { + k = (iy>>20)-0x3ff; /* exponent */ + if(k>20) { + j = ly>>(52-k); + if(((unsigned)j<<(52-k))==ly) yisint = 2-(j&1); + } else if(ly==0) { + j = iy>>(20-k); + if((j<<(20-k))==iy) yisint = 2-(j&1); + } + } + } + + /* special value of y */ + if(ly==0) { + if (iy==0x7ff00000) { /* y is +-inf */ + if(((ix-0x3ff00000)|lx)==0) + return y - y; /* inf**+-1 is NaN */ + else if (ix >= 0x3ff00000)/* (|x|>1)**+-inf = inf,0 */ + return (hy>=0)? y: zero; + else /* (|x|<1)**-,+inf = inf,0 */ + return (hy<0)?-y: zero; + } + if(iy==0x3ff00000) { /* y is +-1 */ + if(hy<0) return one/x; else return x; + } + if(hy==0x40000000) return x*x; /* y is 2 */ + if(hy==0x3fe00000) { /* y is 0.5 */ + if(hx>=0) /* x >= +0 */ + return sqrt(x); + } + } + + ax = fabs(x); + /* special value of x */ + if(lx==0) { + if(ix==0x7ff00000||ix==0||ix==0x3ff00000){ + z = ax; /*x is +-0,+-inf,+-1*/ + if(hy<0) z = one/z; /* z = (1/|x|) */ + if(hx<0) { + if(((ix-0x3ff00000)|yisint)==0) { + z = (z-z)/(z-z); /* (-1)**non-int is NaN */ + } else if(yisint==1) + z = -z; /* (x<0)**odd = -(|x|**odd) */ + } + return z; + } + } + + /* (x<0)**(non-int) is NaN */ + /* CYGNUS LOCAL: This used to be + if((((hx>>31)+1)|yisint)==0) return (x-x)/(x-x); + but ANSI C says a right shift of a signed negative quantity is + implementation defined. */ + + if(((((unsigned)hx>>31)-1)|yisint)==0) + return (x-x)/(x-x); + + /* |y| is huge */ + if(iy>0x41e00000) { /* if |y| > 2**31 */ + if(iy>0x43f00000){ /* if |y| > 2**64, must o/uflow */ + if(ix<=0x3fefffff) return (hy<0)? huge*huge:tiny*tiny; + if(ix>=0x3ff00000) return (hy>0)? huge*huge:tiny*tiny; + } + /* over/underflow if x is not close to one */ + if(ix<0x3fefffff) return (hy<0)? huge*huge:tiny*tiny; + if(ix>0x3ff00000) return (hy>0)? huge*huge:tiny*tiny; + /* now |1-x| is tiny <= 2**-20, suffice to compute + log(x) by x-x^2/2+x^3/3-x^4/4 */ + t = x-1; /* t has 20 trailing zeros */ + w = (t*t)*(0.5-t*(0.3333333333333333333333-t*0.25)); + u = ivln2_h*t; /* ivln2_h has 21 sig. bits */ + v = t*ivln2_l-w*ivln2; + t1 = u+v; + CYG_LIBM_LO(t1) = 0; + t2 = v-(t1-u); + } else { + double s2,s_h,s_l,t_h,t_l; + n = 0; + /* take care subnormal number */ + if(ix<0x00100000) + {ax *= two53; n -= 53; ix = CYG_LIBM_HI(ax); } + n += ((ix)>>20)-0x3ff; + j = ix&0x000fffff; + /* determine interval */ + ix = j|0x3ff00000; /* normalize ix */ + if(j<=0x3988E) k=0; /* |x|>1)|0x20000000)+0x00080000+(k<<18); + t_l = ax - (t_h-bp[k]); + s_l = v*((u-s_h*t_h)-s_h*t_l); + /* compute log(ax) */ + s2 = s*s; + r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6))))); + r += s_l*(s_h+s); + s2 = s_h*s_h; + t_h = 3.0+s2+r; + CYG_LIBM_LO(t_h) = 0; + t_l = r-((t_h-3.0)-s2); + /* u+v = s*(1+...) */ + u = s_h*t_h; + v = s_l*t_h+t_l*s; + /* 2/(3log2)*(s+...) */ + p_h = u+v; + CYG_LIBM_LO(p_h) = 0; + p_l = v-(p_h-u); + z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */ + z_l = cp_l*p_h+p_l*cp+dp_l[k]; + /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */ + t = (double)n; + t1 = (((z_h+z_l)+dp_h[k])+t); + CYG_LIBM_LO(t1) = 0; + t2 = z_l-(((t1-t)-dp_h[k])-z_h); + } + + s = one; /* s (sign of result -ve**odd) = -1 else = 1 */ + if((((hx>>31)+1)|(yisint-1))==0) s = -one;/* (-ve)**(odd int) */ + + /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */ + y1 = y; + CYG_LIBM_LO(y1) = 0; + p_l = (y-y1)*t1+y*t2; + p_h = y1*t1; + z = p_l+p_h; + j = CYG_LIBM_HI(z); + i = CYG_LIBM_LO(z); + if (j>=0x40900000) { /* z >= 1024 */ + if(((j-0x40900000)|i)!=0) /* if z > 1024 */ + return s*huge*huge; /* overflow */ + else { + if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */ + } + } else if((j&0x7fffffff)>=0x4090cc00 ) { /* z <= -1075 */ + if(((j-0xc090cc00)|i)!=0) /* z < -1075 */ + return s*tiny*tiny; /* underflow */ + else { + if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */ + } + } + /* + * compute 2**(p_h+p_l) + */ + i = j&0x7fffffff; + k = (i>>20)-0x3ff; + n = 0; + if(i>0x3fe00000) { /* if |z| > 0.5, set n = [z+0.5] */ + n = j+(0x00100000>>(k+1)); + k = ((n&0x7fffffff)>>20)-0x3ff; /* new k for n */ + t = zero; + CYG_LIBM_HI(t) = (n&~(0x000fffff>>k)); + n = ((n&0x000fffff)|0x00100000)>>(20-k); + if(j<0) n = -n; + p_h -= t; + } + t = p_l+p_h; + CYG_LIBM_LO(t) = 0; + u = t*lg2_h; + v = (p_l-(t-p_h))*lg2+t*lg2_l; + z = u+v; + w = v-(z-u); + t = z*z; + t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); + r = (z*t1)/(t1-two)-(w+z*w); + z = one-(r-z); + j = CYG_LIBM_HI(z); + j += (n<<20); + if((j>>20)<=0) z = scalbn(z,n); /* subnormal output */ + else CYG_LIBM_HI(z) += (n<<20); + return s*z; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_pow.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_rem_pio2.c b/packages/language/c/libm/current/src/double/ieee754-core/e_rem_pio2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_rem_pio2.c @@ -0,0 +1,213 @@ +//=========================================================================== +// +// e_rem_pio2.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_rem_pio2.c 1.4 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + */ + +/* __ieee754_rem_pio2(x,y) + * + * return the remainder of x rem pi/2 in y[0]+y[1] + * use __kernel_rem_pio2() + */ + +#include "mathincl/fdlibm.h" + +/* + * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi + */ +static const int two_over_pi[] = { +0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, +0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A, +0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129, +0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41, +0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8, +0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF, +0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5, +0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08, +0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3, +0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880, +0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B, +}; + +static const int npio2_hw[] = { +0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C, +0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C, +0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A, +0x403DD85A, 0x403F6A7A, 0x40407E4C, 0x4041475C, 0x4042106C, 0x4042D97C, +0x4043A28C, 0x40446B9C, 0x404534AC, 0x4045FDBB, 0x4046C6CB, 0x40478FDB, +0x404858EB, 0x404921FB, +}; + +/* + * invpio2: 53 bits of 2/pi + * pio2_1: first 33 bit of pi/2 + * pio2_1t: pi/2 - pio2_1 + * pio2_2: second 33 bit of pi/2 + * pio2_2t: pi/2 - (pio2_1+pio2_2) + * pio2_3: third 33 bit of pi/2 + * pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3) + */ + +static const double +zero = 0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */ +half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ +two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ +invpio2 = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */ +pio2_1 = 1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */ +pio2_1t = 6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */ +pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */ +pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */ +pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ +pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ + + int __ieee754_rem_pio2(double x, double *y) +{ + double z,w,t,r,fn; + double tx[3]; + int e0,i,j,nx,n,ix,hx; + + hx = CYG_LIBM_HI(x); /* high word of x */ + ix = hx&0x7fffffff; + if(ix<=0x3fe921fb) /* |x| ~<= pi/4 , no need for reduction */ + {y[0] = x; y[1] = 0; return 0;} + if(ix<0x4002d97c) { /* |x| < 3pi/4, special case with n=+-1 */ + if(hx>0) { + z = x - pio2_1; + if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */ + y[0] = z - pio2_1t; + y[1] = (z-y[0])-pio2_1t; + } else { /* near pi/2, use 33+33+53 bit pi */ + z -= pio2_2; + y[0] = z - pio2_2t; + y[1] = (z-y[0])-pio2_2t; + } + return 1; + } else { /* negative x */ + z = x + pio2_1; + if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */ + y[0] = z + pio2_1t; + y[1] = (z-y[0])+pio2_1t; + } else { /* near pi/2, use 33+33+53 bit pi */ + z += pio2_2; + y[0] = z + pio2_2t; + y[1] = (z-y[0])+pio2_2t; + } + return -1; + } + } + if(ix<=0x413921fb) { /* |x| ~<= 2^19*(pi/2), medium size */ + t = fabs(x); + n = (int) (t*invpio2+half); + fn = (double)n; + r = t-fn*pio2_1; + w = fn*pio2_1t; /* 1st round good to 85 bit */ + if(n<32&&ix!=npio2_hw[n-1]) { + y[0] = r-w; /* quick check no cancellation */ + } else { + j = ix>>20; + y[0] = r-w; + i = j-(((CYG_LIBM_HI(y[0]))>>20)&0x7ff); + if(i>16) { /* 2nd iteration needed, good to 118 */ + t = r; + w = fn*pio2_2; + r = t-w; + w = fn*pio2_2t-((t-r)-w); + y[0] = r-w; + i = j-(((CYG_LIBM_HI(y[0]))>>20)&0x7ff); + if(i>49) { /* 3rd iteration need, 151 bits acc */ + t = r; /* will cover all possible cases */ + w = fn*pio2_3; + r = t-w; + w = fn*pio2_3t-((t-r)-w); + y[0] = r-w; + } + } + } + y[1] = (r-y[0])-w; + if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} + else return n; + } + /* + * all other (large) arguments + */ + if(ix>=0x7ff00000) { /* x is inf or NaN */ + y[0]=y[1]=x-x; return 0; + } + /* set z = scalbn(|x|,ilogb(x)-23) */ + CYG_LIBM_LO(z) = CYG_LIBM_LO(x); + e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */ + CYG_LIBM_HI(z) = ix - (e0<<20); + for(i=0;i<2;i++) { + tx[i] = (double)((int)(z)); + z = (z-tx[i])*two24; + } + tx[2] = z; + nx = 3; + while(tx[nx-1]==zero) nx--; /* skip zero term */ + n = __kernel_rem_pio2(tx,y,e0,nx,2,two_over_pi); + if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} + return n; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_rem_pio2.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_scalb.c b/packages/language/c/libm/current/src/double/ieee754-core/e_scalb.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_scalb.c @@ -0,0 +1,96 @@ +//=========================================================================== +// +// e_scalb.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_scalb.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * __ieee754_scalb(x, fn) is provide for + * passing various standard test suite. One + * should use scalbn() instead. + */ + +#include "mathincl/fdlibm.h" + +#ifdef CYGFUN_LIBM_SVID3_scalb + double __ieee754_scalb(double x, double fn) +#else + double __ieee754_scalb(double x, int fn) +#endif +{ +#ifdef CYGFUN_LIBM_SVID3_scalb + if (isnan(x)||isnan(fn)) return x*fn; + if (!finite(fn)) { + if(fn>0.0) return x*fn; + else return x/(-fn); + } + if (rint(fn)!=fn) return (fn-fn)/(fn-fn); + if ( fn > 65000.0) return scalbn(x, 65000); + if (-fn > 65000.0) return scalbn(x,-65000); + return scalbn(x,(int)fn); +#else + return scalbn(x,fn); +#endif +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_scalb.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_sinh.c b/packages/language/c/libm/current/src/double/ieee754-core/e_sinh.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_sinh.c @@ -0,0 +1,128 @@ +//=========================================================================== +// +// e_sinh.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)e_sinh.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_sinh(x) + * Method : + * mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2 + * 1. Replace x by |x| (sinh(-x) = -sinh(x)). + * 2. + * E + E/(E+1) + * 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x) + * 2 + * + * 22 <= x <= lnovft : sinh(x) := exp(x)/2 + * lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2) + * ln2ovft < x : sinh(x) := x*shuge (overflow) + * + * Special cases: + * sinh(x) is |x| if x is +INF, -INF, or NaN. + * only sinh(0)=0 is exact for finite x. + */ + +#include "mathincl/fdlibm.h" + +static const double one = 1.0, shuge = 1.0e307; + + double __ieee754_sinh(double x) +{ + double t,w,h; + int ix,jx; + unsigned lx; + + /* High word of |x|. */ + jx = CYG_LIBM_HI(x); + ix = jx&0x7fffffff; + + /* x is INF or NaN */ + if(ix>=0x7ff00000) return x+x; + + h = 0.5; + if (jx<0) h = -h; + /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */ + if (ix < 0x40360000) { /* |x|<22 */ + if (ix<0x3e300000) /* |x|<2**-28 */ + if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */ + t = expm1(fabs(x)); + if(ix<0x3ff00000) return h*(2.0*t-t*t/(t+one)); + return h*(t+t/(t+one)); + } + + /* |x| in [22, log(maxdouble)] return 0.5*exp(|x|) */ + if (ix < 0x40862E42) return h*__ieee754_exp(fabs(x)); + + /* |x| in [log(maxdouble), overflowthresold] */ + lx = *( (((*(unsigned*)&one)>>29)) + (unsigned*)&x); + if (ix<0x408633CE || ((ix==0x408633ce)&&(lx<=(unsigned)0x8fb9f87d))) { + w = __ieee754_exp(0.5*fabs(x)); + t = h*w; + return t*w; + } + + /* |x| > overflowthresold, sinh(x) overflow */ + return x*shuge; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF e_sinh.c diff --git a/packages/language/c/libm/current/src/double/ieee754-core/e_sqrt.c b/packages/language/c/libm/current/src/double/ieee754-core/e_sqrt.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/ieee754-core/e_sqrt.c @@ -0,0 +1,496 @@ +//=========================================================================== +// +// e_sqrt.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + +/* @(#)e_sqrt.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_sqrt(x) + * Return correctly rounded sqrt. + * ------------------------------------------ + * | Use the hardware sqrt if you have one | + * ------------------------------------------ + * Method: + * Bit by bit method using integer arithmetic. (Slow, but portable) + * 1. Normalization + * Scale x to y in [1,4) with even powers of 2: + * find an integer k such that 1 <= (y=x*2^(2k)) < 4, then + * sqrt(x) = 2^k * sqrt(y) + * 2. Bit by bit computation + * Let q = sqrt(y) truncated to i bit after binary point (q = 1), + * i 0 + * i+1 2 + * s = 2*q , and y = 2 * ( y - q ). (1) + * i i i i + * + * To compute q from q , one checks whether + * i+1 i + * + * -(i+1) 2 + * (q + 2 ) <= y. (2) + * i + * -(i+1) + * If (2) is false, then q = q ; otherwise q = q + 2 . + * i+1 i i+1 i + * + * With some algebric manipulation, it is not difficult to see + * that (2) is equivalent to + * -(i+1) + * s + 2 <= y (3) + * i i + * + * The advantage of (3) is that s and y can be computed by + * i i + * the following recurrence formula: + * if (3) is false + * + * s = s , y = y ; (4) + * i+1 i i+1 i + * + * otherwise, + * -i -(i+1) + * s = s + 2 , y = y - s - 2 (5) + * i+1 i i+1 i i + * + * One may easily use induction to prove (4) and (5). + * Note. Since the left hand side of (3) contain only i+2 bits, + * it does not necessary to do a full (53-bit) comparison + * in (3). + * 3. Final rounding + * After generating the 53 bits result, we compute one more bit. + * Together with the remainder, we can decide whether the + * result is exact, bigger than 1/2ulp, or less than 1/2ulp + * (it will never equal to 1/2ulp). + * The rounding mode can be detected by checking whether + * huge + tiny is equal to huge, and whether huge - tiny is + * equal to huge for some floating point number "huge" and "tiny". + * + * Special cases: + * sqrt(+-0) = +-0 ... exact + * sqrt(inf) = inf + * sqrt(-ve) = NaN ... with invalid signal + * sqrt(NaN) = NaN ... with invalid signal for signaling NaN + * + * Other methods : see the appended file at the end of the program below. + *--------------- + */ + +#include "mathincl/fdlibm.h" + +static const double one = 1.0, tiny=1.0e-300; + + double __ieee754_sqrt(double x) +{ + double z; + int sign = (int)0x80000000; + unsigned r,t1,s1,ix1,q1; + int ix0,s0,q,m,t,i; + + ix0 = CYG_LIBM_HI(x); /* high word of x */ + ix1 = CYG_LIBM_LO(x); /* low word of x */ + + /* take care of Inf and NaN */ + if((ix0&0x7ff00000)==0x7ff00000) { + return x*x+x; /* sqrt(NaN)=NaN, sqrt(+inf)=+inf + sqrt(-inf)=sNaN */ + } + /* take care of zero */ + if(ix0<=0) { + if(((ix0&(~sign))|ix1)==0) return x;/* sqrt(+-0) = +-0 */ + else if(ix0<0) + return (x-x)/(x-x); /* sqrt(-ve) = sNaN */ + } + /* normalize x */ + m = (ix0>>20); + if(m==0) { /* subnormal x */ + while(ix0==0) { + m -= 21; + ix0 |= (ix1>>11); ix1 <<= 21; + } + for(i=0;(ix0&0x00100000)==0;i++) ix0<<=1; + m -= i-1; + ix0 |= (ix1>>(32-i)); + ix1 <<= i; + } + m -= 1023; /* unbias exponent */ + ix0 = (ix0&0x000fffff)|0x00100000; + if(m&1){ /* odd m, double x to make it even */ + ix0 += ix0 + ((ix1&sign)>>31); + ix1 += ix1; + } + m >>= 1; /* m = [m/2] */ + + /* generate sqrt(x) bit by bit */ + ix0 += ix0 + ((ix1&sign)>>31); + ix1 += ix1; + q = q1 = s0 = s1 = 0; /* [q,q1] = sqrt(x) */ + r = 0x00200000; /* r = moving bit from right to left */ + + while(r!=0) { + t = s0+r; + if(t<=ix0) { + s0 = t+r; + ix0 -= t; + q += r; + } + ix0 += ix0 + ((ix1&sign)>>31); + ix1 += ix1; + r>>=1; + } + + r = sign; + while(r!=0) { + t1 = s1+r; + t = s0; + if((t>31); + ix1 += ix1; + r>>=1; + } + + /* use floating add to find out rounding direction */ + if((ix0|ix1)!=0) { + z = one-tiny; /* trigger inexact flag */ + if (z>=one) { + z = one+tiny; + if (q1==(unsigned)0xffffffff) { q1=0; q += 1;} + else if (z>one) { + if (q1==(unsigned)0xfffffffe) q+=1; + q1+=2; + } else + q1 += (q1&1); + } + } + ix0 = (q>>1)+0x3fe00000; + ix1 = q1>>1; + if ((q&1)==1) ix1 |= sign; + ix0 += (m <<20); + CYG_LIBM_HI(z) = ix0; + CYG_LIBM_LO(z) = ix1; + return z; +} + +/* +Other methods (use floating-point arithmetic) +------------- +(This is a copy of a drafted paper by Prof W. Kahan +and K.C. Ng, written in May, 1986) + + Two algorithms are given here to implement sqrt(x) + (IEEE double precision arithmetic) in software. + Both supply sqrt(x) correctly rounded. The first algorithm (in + Section A) uses newton iterations and involves four divisions. + The second one uses reciproot iterations to avoid division, but + requires more multiplications. Both algorithms need the ability + to chop results of arithmetic operations instead of round them, + and the INEXACT flag to indicate when an arithmetic operation + is executed exactly with no roundoff error, all part of the + standard (IEEE 754-1985). The ability to perform shift, add, + subtract and logical AND operations upon 32-bit words is needed + too, though not part of the standard. + +A. sqrt(x) by Newton Iteration + + (1) Initial approximation + + Let x0 and x1 be the leading and the trailing 32-bit words of + a floating point number x (in IEEE double format) respectively + + 1 11 52 ...widths + ------------------------------------------------------ + x: |s| e | f | + ------------------------------------------------------ + msb lsb msb lsb ...order + + + ------------------------ ------------------------ + x0: |s| e | f1 | x1: | f2 | + ------------------------ ------------------------ + + By performing shifts and subtracts on x0 and x1 (both regarded + as integers), we obtain an 8-bit approximation of sqrt(x) as + follows. + + k := (x0>>1) + 0x1ff80000; + y0 := k - T1[31&(k>>15)]. ... y ~ sqrt(x) to 8 bits + Here k is a 32-bit integer and T1[] is an integer array containing + correction terms. Now magically the floating value of y (y's + leading 32-bit word is y0, the value of its trailing word is 0) + approximates sqrt(x) to almost 8-bit. + + Value of T1: + static int T1[32]= { + 0, 1024, 3062, 5746, 9193, 13348, 18162, 23592, + 29598, 36145, 43202, 50740, 58733, 67158, 75992, 85215, + 83599, 71378, 60428, 50647, 41945, 34246, 27478, 21581, + 16499, 12183, 8588, 5674, 3403, 1742, 661, 130,}; + + (2) Iterative refinement + + Apply Heron's rule three times to y, we have y approximates + sqrt(x) to within 1 ulp (Unit in the Last Place): + + y := (y+x/y)/2 ... almost 17 sig. bits + y := (y+x/y)/2 ... almost 35 sig. bits + y := y-(y-x/y)/2 ... within 1 ulp + + + Remark 1. + Another way to improve y to within 1 ulp is: + + y := (y+x/y) ... almost 17 sig. bits to 2*sqrt(x) + y := y - 0x00100006 ... almost 18 sig. bits to sqrt(x) + + 2 + (x-y )*y + y := y + 2* ---------- ...within 1 ulp + 2 + 3y + x + + + This formula has one division fewer than the one above; however, + it requires more multiplications and additions. Also x must be + scaled in advance to avoid spurious overflow in evaluating the + expression 3y*y+x. Hence it is not recommended uless division + is slow. If division is very slow, then one should use the + reciproot algorithm given in section B. + + (3) Final adjustment + + By twiddling y's last bit it is possible to force y to be + correctly rounded according to the prevailing rounding mode + as follows. Let r and i be copies of the rounding mode and + inexact flag before entering the square root program. Also we + use the expression y+-ulp for the next representable floating + numbers (up and down) of y. Note that y+-ulp = either fixed + point y+-1, or multiply y by nextafter(1,+-inf) in chopped + mode. + + I := FALSE; ... reset INEXACT flag I + R := RZ; ... set rounding mode to round-toward-zero + z := x/y; ... chopped quotient, possibly inexact + If(not I) then { ... if the quotient is exact + if(z=y) { + I := i; ... restore inexact flag + R := r; ... restore rounded mode + return sqrt(x):=y. + } else { + z := z - ulp; ... special rounding + } + } + i := TRUE; ... sqrt(x) is inexact + If (r=RN) then z=z+ulp ... rounded-to-nearest + If (r=RP) then { ... round-toward-+inf + y = y+ulp; z=z+ulp; + } + y := y+z; ... chopped sum + y0:=y0-0x00100000; ... y := y/2 is correctly rounded. + I := i; ... restore inexact flag + R := r; ... restore rounded mode + return sqrt(x):=y. + + (4) Special cases + + Square root of +inf, +-0, or NaN is itself; + Square root of a negative number is NaN with invalid signal. + + +B. sqrt(x) by Reciproot Iteration + + (1) Initial approximation + + Let x0 and x1 be the leading and the trailing 32-bit words of + a floating point number x (in IEEE double format) respectively + (see section A). By performing shifs and subtracts on x0 and y0, + we obtain a 7.8-bit approximation of 1/sqrt(x) as follows. + + k := 0x5fe80000 - (x0>>1); + y0:= k - T2[63&(k>>14)]. ... y ~ 1/sqrt(x) to 7.8 bits + + Here k is a 32-bit integer and T2[] is an integer array + containing correction terms. Now magically the floating + value of y (y's leading 32-bit word is y0, the value of + its trailing word y1 is set to zero) approximates 1/sqrt(x) + to almost 7.8-bit. + + Value of T2: + static int T2[64]= { + 0x1500, 0x2ef8, 0x4d67, 0x6b02, 0x87be, 0xa395, 0xbe7a, 0xd866, + 0xf14a, 0x1091b,0x11fcd,0x13552,0x14999,0x15c98,0x16e34,0x17e5f, + 0x18d03,0x19a01,0x1a545,0x1ae8a,0x1b5c4,0x1bb01,0x1bfde,0x1c28d, + 0x1c2de,0x1c0db,0x1ba73,0x1b11c,0x1a4b5,0x1953d,0x18266,0x16be0, + 0x1683e,0x179d8,0x18a4d,0x19992,0x1a789,0x1b445,0x1bf61,0x1c989, + 0x1d16d,0x1d77b,0x1dddf,0x1e2ad,0x1e5bf,0x1e6e8,0x1e654,0x1e3cd, + 0x1df2a,0x1d635,0x1cb16,0x1be2c,0x1ae4e,0x19bde,0x1868e,0x16e2e, + 0x1527f,0x1334a,0x11051,0xe951, 0xbe01, 0x8e0d, 0x5924, 0x1edd,}; + + (2) Iterative refinement + + Apply Reciproot iteration three times to y and multiply the + result by x to get an approximation z that matches sqrt(x) + to about 1 ulp. To be exact, we will have + -1ulp < sqrt(x)-z<1.0625ulp. + + ... set rounding mode to Round-to-nearest + y := y*(1.5-0.5*x*y*y) ... almost 15 sig. bits to 1/sqrt(x) + y := y*((1.5-2^-30)+0.5*x*y*y)... about 29 sig. bits to 1/sqrt(x) + ... special arrangement for better accuracy + z := x*y ... 29 bits to sqrt(x), with z*y<1 + z := z + 0.5*z*(1-z*y) ... about 1 ulp to sqrt(x) + + Remark 2. The constant 1.5-2^-30 is chosen to bias the error so that + (a) the term z*y in the final iteration is always less than 1; + (b) the error in the final result is biased upward so that + -1 ulp < sqrt(x) - z < 1.0625 ulp + instead of |sqrt(x)-z|<1.03125ulp. + + (3) Final adjustment + + By twiddling y's last bit it is possible to force y to be + correctly rounded according to the prevailing rounding mode + as follows. Let r and i be copies of the rounding mode and + inexact flag before entering the square root program. Also we + use the expression y+-ulp for the next representable floating + numbers (up and down) of y. Note that y+-ulp = either fixed + point y+-1, or multiply y by nextafter(1,+-inf) in chopped + mode. + + R := RZ; ... set rounding mode to round-toward-zero + switch(r) { + case RN: ... round-to-nearest + if(x<= z*(z-ulp)...chopped) z = z - ulp; else + if(x<= z*(z+ulp)...chopped) z = z; else z = z+ulp; + break; + case RZ:case RM: ... round-to-zero or round-to--inf + R:=RP; ... reset rounding mod to round-to-+inf + if(x=(z+ulp)*(z+ulp) ...rounded up) z = z+ulp; + break; + case RP: ... round-to-+inf + if(x>(z+ulp)*(z+ulp)...chopped) z = z+2*ulp; else + if(x>z*z ...chopped) z = z+ulp; + break; + } + + Remark 3. The above comparisons can be done in fixed point. For + example, to compare x and w=z*z chopped, it suffices to compare + x1 and w1 (the trailing parts of x and w), regarding them as + two's complement integers. + + ...Is z an exact square root? + To determine whether z is an exact square root of x, let z1 be the + trailing part of z, and also let x0 and x1 be the leading and + trailing parts of x. + + If ((z1&0x03ffffff)!=0) ... not exact if trailing 26 bits of z!=0 + I := 1; ... Raise Inexact flag: z is not exact + else { + j := 1 - [(x0>>20)&1] ... j = logb(x) mod 2 + k := z1 >> 26; ... get z's 25-th and 26-th + fraction bits + I := i or (k&j) or ((k&(j+j+1))!=(x1&3)); + } + R:= r ... restore rounded mode + return sqrt(x):=z. + + If multiplication is cheaper then the foregoing red tape, the + Inexact flag can be evaluated by + + I := i; + I := (z*z!=x) or I. + + Note that z*z can overwrite I; this value must be sensed if it is + True. + + Remark 4. If z*z = x exactly, then bit 25 to bit 0 of z1 must be + zero. + + -------------------- + z1: | f2 | + -------------------- + bit 31 bit 0 + + Further more, bit 27 and 26 of z1, bit 0 and 1 of x1, and the odd + or even of logb(x) have the following relations: + + ------------------------------------------------- + bit 27,26 of z1 bit 1,0 of x1 logb(x) + ------------------------------------------------- + 00 00 odd and even + 01 01 even + 10 10 odd + 10 00 even + 11 01 even + ------------------------------------------------- + + (4) Special cases (see (4) of Section A). + + */ + + +#endif // ifdef CYGPKG_LIBM + +// EOF e_sqrt.c diff --git a/packages/language/c/libm/current/src/double/internal/k_cos.c b/packages/language/c/libm/current/src/double/internal/k_cos.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/internal/k_cos.c @@ -0,0 +1,138 @@ +//=========================================================================== +// +// k_cos.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)k_cos.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * __kernel_cos( x, y ) + * kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164 + * Input x is assumed to be bounded by ~pi/4 in magnitude. + * Input y is the tail of x. + * + * Algorithm + * 1. Since cos(-x) = cos(x), we need only to consider positive x. + * 2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0. + * 3. cos(x) is approximated by a polynomial of degree 14 on + * [0,pi/4] + * 4 14 + * cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x + * where the remez error is + * + * | 2 4 6 8 10 12 14 | -58 + * |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2 + * | | + * + * 4 6 8 10 12 14 + * 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then + * cos(x) = 1 - x*x/2 + r + * since cos(x+y) ~ cos(x) - sin(x)*y + * ~ cos(x) - x*y, + * a correction term is necessary in cos(x) and hence + * cos(x+y) = 1 - (x*x/2 - (r - x*y)) + * For better accuracy when x > 0.3, let qx = |x|/4 with + * the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125. + * Then + * cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)). + * Note that 1-qx and (x*x/2-qx) is EXACT here, and the + * magnitude of the latter is at least a quarter of x*x/2, + * thus, reducing the rounding error in the subtraction. + */ + +#include "mathincl/fdlibm.h" + +static const double +one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ +C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */ +C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */ +C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */ +C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */ +C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */ +C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */ + + double __kernel_cos(double x, double y) +{ + double a,hz,z,r,qx; + int ix; + ix = CYG_LIBM_HI(x)&0x7fffffff; /* ix = |x|'s high word*/ + if(ix<0x3e400000) { /* if x < 2**27 */ + if(((int)x)==0) return one; /* generate inexact */ + } + z = x*x; + r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6))))); + if(ix < 0x3FD33333) /* if |x| < 0.3 */ + return one - (0.5*z - (z*r - x*y)); + else { + if(ix > 0x3fe90000) { /* x > 0.78125 */ + qx = 0.28125; + } else { + CYG_LIBM_HI(qx) = ix-0x00200000; /* x/4 */ + CYG_LIBM_LO(qx) = 0; + } + hz = 0.5*z-qx; + a = one-qx; + return a - (hz - (z*r-x*y)); + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF k_cos.c diff --git a/packages/language/c/libm/current/src/double/internal/k_rem_pio2.c b/packages/language/c/libm/current/src/double/internal/k_rem_pio2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/internal/k_rem_pio2.c @@ -0,0 +1,354 @@ +//=========================================================================== +// +// k_rem_pio2.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)k_rem_pio2.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) + * double x[],y[]; int e0,nx,prec; int ipio2[]; + * + * __kernel_rem_pio2 return the last three digits of N with + * y = x - N*pi/2 + * so that |y| < pi/2. + * + * The method is to compute the integer (mod 8) and fraction parts of + * (2/pi)*x without doing the full multiplication. In general we + * skip the part of the product that are known to be a huge integer ( + * more accurately, = 0 mod 8 ). Thus the number of operations are + * independent of the exponent of the input. + * + * (2/pi) is represented by an array of 24-bit integers in ipio2[]. + * + * Input parameters: + * x[] The input value (must be positive) is broken into nx + * pieces of 24-bit integers in double precision format. + * x[i] will be the i-th 24 bit of x. The scaled exponent + * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0 + * match x's up to 24 bits. + * + * Example of breaking a double positive z into x[0]+x[1]+x[2]: + * e0 = ilogb(z)-23 + * z = scalbn(z,-e0) + * for i = 0,1,2 + * x[i] = floor(z) + * z = (z-x[i])*2**24 + * + * + * y[] ouput result in an array of double precision numbers. + * The dimension of y[] is: + * 24-bit precision 1 + * 53-bit precision 2 + * 64-bit precision 2 + * 113-bit precision 3 + * The actual value is the sum of them. Thus for 113-bit + * precison, one may have to do something like: + * + * long double t,w,r_head, r_tail; + * t = (long double)y[2] + (long double)y[1]; + * w = (long double)y[0]; + * r_head = t+w; + * r_tail = w - (r_head - t); + * + * e0 The exponent of x[0] + * + * nx dimension of x[] + * + * prec an integer indicating the precision: + * 0 24 bits (single) + * 1 53 bits (double) + * 2 64 bits (extended) + * 3 113 bits (quad) + * + * ipio2[] + * integer array, contains the (24*i)-th to (24*i+23)-th + * bit of 2/pi after binary point. The corresponding + * floating value is + * + * ipio2[i] * 2^(-24(i+1)). + * + * External function: + * double scalbn(), floor(); + * + * + * Here is the description of some local variables: + * + * jk jk+1 is the initial number of terms of ipio2[] needed + * in the computation. The recommended value is 2,3,4, + * 6 for single, double, extended,and quad. + * + * jz local integer variable indicating the number of + * terms of ipio2[] used. + * + * jx nx - 1 + * + * jv index for pointing to the suitable ipio2[] for the + * computation. In general, we want + * ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8 + * is an integer. Thus + * e0-3-24*jv >= 0 or (e0-3)/24 >= jv + * Hence jv = max(0,(e0-3)/24). + * + * jp jp+1 is the number of terms in PIo2[] needed, jp = jk. + * + * q[] double array with integral value, representing the + * 24-bits chunk of the product of x and 2/pi. + * + * q0 the corresponding exponent of q[0]. Note that the + * exponent for q[i] would be q0-24*i. + * + * PIo2[] double precision array, obtained by cutting pi/2 + * into 24 bits chunks. + * + * f[] ipio2[] in floating point + * + * iq[] integer array by breaking up q[] in 24-bits chunk. + * + * fq[] final product of x*(2/pi) in fq[0],..,fq[jk] + * + * ih integer. If >0 it indicates q[] is >= 0.5, hence + * it also indicates the *sign* of the result. + * + */ + + +/* + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "mathincl/fdlibm.h" + +static const int init_jk[] = {2,3,4,6}; /* initial value for jk */ + +static const double PIo2[] = { + 1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */ + 7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */ + 5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */ + 3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */ + 1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */ + 1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */ + 2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */ + 2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */ +}; + +static const double +zero = 0.0, +one = 1.0, +two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ +twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */ + + int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int *ipio2) +{ + int jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; + double z,fw,f[20],fq[20],q[20]; + + /* initialize jk*/ + jk = init_jk[prec]; + jp = jk; + + /* determine jx,jv,q0, note that 3>q0 */ + jx = nx-1; + jv = (e0-3)/24; if(jv<0) jv=0; + q0 = e0-24*(jv+1); + + /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */ + j = jv-jx; m = jx+jk; + for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j]; + + /* compute q[0],q[1],...q[jk] */ + for (i=0;i<=jk;i++) { + for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw; + } + + jz = jk; +recompute: + /* distill q[] into iq[] reversingly */ + for(i=0,j=jz,z=q[jz];j>0;i++,j--) { + fw = (double)((int)(twon24* z)); + iq[i] = (int)(z-two24*fw); + z = q[j-1]+fw; + } + + /* compute n */ + z = scalbn(z,q0); /* actual value of z */ + z -= 8.0*floor(z*0.125); /* trim off integer >= 8 */ + n = (int) z; + z -= (double)n; + ih = 0; + if(q0>0) { /* need iq[jz-1] to determine n */ + i = (iq[jz-1]>>(24-q0)); n += i; + iq[jz-1] -= i<<(24-q0); + ih = iq[jz-1]>>(23-q0); + } + else if(q0==0) ih = iq[jz-1]>>23; + else if(z>=0.5) ih=2; + + if(ih>0) { /* q > 0.5 */ + n += 1; carry = 0; + for(i=0;i0) { /* rare case: chance is 1 in 12 */ + switch(q0) { + case 1: + iq[jz-1] &= 0x7fffff; break; + case 2: + iq[jz-1] &= 0x3fffff; break; + } + } + if(ih==2) { + z = one - z; + if(carry!=0) z -= scalbn(one,q0); + } + } + + /* check if recomputation is needed */ + if(z==zero) { + j = 0; + for (i=jz-1;i>=jk;i--) j |= iq[i]; + if(j==0) { /* need recomputation */ + for(k=1;iq[jk-k]==0;k++); /* k = no. of terms needed */ + + for(i=jz+1;i<=jz+k;i++) { /* add q[jz+1] to q[jz+k] */ + f[jx+i] = (double) ipio2[jv+i]; + for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; + q[i] = fw; + } + jz += k; + goto recompute; + } + } + + /* chop off zero terms */ + if(z==0.0) { + jz -= 1; q0 -= 24; + while(iq[jz]==0) { jz--; q0-=24;} + } else { /* break z into 24-bit if necessary */ + z = scalbn(z,-q0); + if(z>=two24) { + fw = (double)((int)(twon24*z)); + iq[jz] = (int)(z-two24*fw); + jz += 1; q0 += 24; + iq[jz] = (int) fw; + } else iq[jz] = (int) z ; + } + + /* convert integer "bit" chunk to floating-point value */ + fw = scalbn(one,q0); + for(i=jz;i>=0;i--) { + q[i] = fw*(double)iq[i]; fw*=twon24; + } + + /* compute PIo2[0,...,jp]*q[jz,...,0] */ + for(i=jz;i>=0;i--) { + for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k]; + fq[jz-i] = fw; + } + + /* compress fq[] into y[] */ + switch(prec) { + case 0: + fw = 0.0; + for (i=jz;i>=0;i--) fw += fq[i]; + y[0] = (ih==0)? fw: -fw; + break; + case 1: + case 2: + fw = 0.0; + for (i=jz;i>=0;i--) fw += fq[i]; + y[0] = (ih==0)? fw: -fw; + fw = fq[0]-fw; + for (i=1;i<=jz;i++) fw += fq[i]; + y[1] = (ih==0)? fw: -fw; + break; + case 3: /* painful */ + for (i=jz;i>0;i--) { + fw = fq[i-1]+fq[i]; + fq[i] += fq[i-1]-fw; + fq[i-1] = fw; + } + for (i=jz;i>1;i--) { + fw = fq[i-1]+fq[i]; + fq[i] += fq[i-1]-fw; + fq[i-1] = fw; + } + for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; + if(ih==0) { + y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; + } else { + y[0] = -fq[0]; y[1] = -fq[1]; y[2] = -fw; + } + } + return n&7; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF k_rem_pio2.c diff --git a/packages/language/c/libm/current/src/double/internal/k_sin.c b/packages/language/c/libm/current/src/double/internal/k_sin.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/internal/k_sin.c @@ -0,0 +1,120 @@ +//=========================================================================== +// +// k_sin.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)k_sin.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __kernel_sin( x, y, iy) + * kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854 + * Input x is assumed to be bounded by ~pi/4 in magnitude. + * Input y is the tail of x. + * Input iy indicates whether y is 0. (if iy=0, y assume to be 0). + * + * Algorithm + * 1. Since sin(-x) = -sin(x), we need only to consider positive x. + * 2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0. + * 3. sin(x) is approximated by a polynomial of degree 13 on + * [0,pi/4] + * 3 13 + * sin(x) ~ x + S1*x + ... + S6*x + * where + * + * |sin(x) 2 4 6 8 10 12 | -58 + * |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2 + * | x | + * + * 4. sin(x+y) = sin(x) + sin'(x')*y + * ~ sin(x) + (1-x*x/2)*y + * For better accuracy, let + * 3 2 2 2 2 + * r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6)))) + * then 3 2 + * sin(x) = x + (S1*x + (x *(r-y/2)+y)) + */ + +#include "mathincl/fdlibm.h" + +static const double +half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ +S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ +S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */ +S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */ +S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */ +S5 = -2.50507602534068634195e-08, /* 0xBE5AE5E6, 0x8A2B9CEB */ +S6 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */ + + double __kernel_sin(double x, double y, int iy) +{ + double z,r,v; + int ix; + ix = CYG_LIBM_HI(x)&0x7fffffff; /* high word of x */ + if(ix<0x3e400000) /* |x| < 2**-27 */ + {if((int)x==0) return x;} /* generate inexact */ + z = x*x; + v = z*x; + r = S2+z*(S3+z*(S4+z*(S5+z*S6))); + if(iy==0) return x+v*(S1+z*r); + else return x-((z*(half*y-v*r)-y)-v*S1); +} + +#endif // ifdef CYGPKG_LIBM + +// EOF k_sin.c diff --git a/packages/language/c/libm/current/src/double/internal/k_tan.c b/packages/language/c/libm/current/src/double/internal/k_tan.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/internal/k_tan.c @@ -0,0 +1,171 @@ +//=========================================================================== +// +// k_tan.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)k_tan.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __kernel_tan( x, y, k ) + * kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854 + * Input x is assumed to be bounded by ~pi/4 in magnitude. + * Input y is the tail of x. + * Input k indicates whether tan (if k=1) or + * -1/tan (if k= -1) is returned. + * + * Algorithm + * 1. Since tan(-x) = -tan(x), we need only to consider positive x. + * 2. if x < 2^-28 (hx<0x3e300000 0), return x with inexact if x!=0. + * 3. tan(x) is approximated by a odd polynomial of degree 27 on + * [0,0.67434] + * 3 27 + * tan(x) ~ x + T1*x + ... + T13*x + * where + * + * |tan(x) 2 4 26 | -59.2 + * |----- - (1+T1*x +T2*x +.... +T13*x )| <= 2 + * | x | + * + * Note: tan(x+y) = tan(x) + tan'(x)*y + * ~ tan(x) + (1+x*x)*y + * Therefore, for better accuracy in computing tan(x+y), let + * 3 2 2 2 2 + * r = x *(T2+x *(T3+x *(...+x *(T12+x *T13)))) + * then + * 3 2 + * tan(x+y) = x + (T1*x + (x *(r+y)+y)) + * + * 4. For x in [0.67434,pi/4], let y = pi/4 - x, then + * tan(x) = tan(pi/4-y) = (1-tan(y))/(1+tan(y)) + * = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y))) + */ + +#include "mathincl/fdlibm.h" +static const double +one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ +pio4 = 7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */ +pio4lo= 3.06161699786838301793e-17, /* 0x3C81A626, 0x33145C07 */ +T[] = { + 3.33333333333334091986e-01, /* 0x3FD55555, 0x55555563 */ + 1.33333333333201242699e-01, /* 0x3FC11111, 0x1110FE7A */ + 5.39682539762260521377e-02, /* 0x3FABA1BA, 0x1BB341FE */ + 2.18694882948595424599e-02, /* 0x3F9664F4, 0x8406D637 */ + 8.86323982359930005737e-03, /* 0x3F8226E3, 0xE96E8493 */ + 3.59207910759131235356e-03, /* 0x3F6D6D22, 0xC9560328 */ + 1.45620945432529025516e-03, /* 0x3F57DBC8, 0xFEE08315 */ + 5.88041240820264096874e-04, /* 0x3F4344D8, 0xF2F26501 */ + 2.46463134818469906812e-04, /* 0x3F3026F7, 0x1A8D1068 */ + 7.81794442939557092300e-05, /* 0x3F147E88, 0xA03792A6 */ + 7.14072491382608190305e-05, /* 0x3F12B80F, 0x32F0A7E9 */ + -1.85586374855275456654e-05, /* 0xBEF375CB, 0xDB605373 */ + 2.59073051863633712884e-05, /* 0x3EFB2A70, 0x74BF7AD4 */ +}; + + double __kernel_tan(double x, double y, int iy) +{ + double z,r,v,w,s; + int ix,hx; + hx = CYG_LIBM_HI(x); /* high word of x */ + ix = hx&0x7fffffff; /* high word of |x| */ + if(ix<0x3e300000) /* x < 2**-28 */ + {if((int)x==0) { /* generate inexact */ + if(((ix|CYG_LIBM_LO(x))|(iy+1))==0) return one/fabs(x); + else return (iy==1)? x: -one/x; + } + } + if(ix>=0x3FE59428) { /* |x|>=0.6744 */ + if(hx<0) {x = -x; y = -y;} + z = pio4-x; + w = pio4lo-y; + x = z+w; y = 0.0; + } + z = x*x; + w = z*z; + /* Break x^5*(T[1]+x^2*T[2]+...) into + * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + + * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) + */ + r = T[1]+w*(T[3]+w*(T[5]+w*(T[7]+w*(T[9]+w*T[11])))); + v = z*(T[2]+w*(T[4]+w*(T[6]+w*(T[8]+w*(T[10]+w*T[12]))))); + s = z*x; + r = y + z*(s*(r+v)+y); + r += T[0]*s; + w = x+r; + if(ix>=0x3FE59428) { + v = (double)iy; + return (double)(1-((hx>>30)&2))*(v-2.0*(x-(w*w/(w+v)-r))); + } + if(iy==1) return w; + else { /* if allow error up to 2 ulp, + simply return -1.0/(x+r) here */ + /* compute -1.0/(x+r) accurately */ + double a,t; + z = w; + CYG_LIBM_LO(z) = 0; + v = r-(z - x); /* z+v = r+x */ + t = a = -1.0/w; /* a = -1.0/w */ + CYG_LIBM_LO(t) = 0; + s = 1.0+t*z; + return t+a*(s+t*v); + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF k_tan.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_atan.c b/packages/language/c/libm/current/src/double/portable-api/s_atan.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_atan.c @@ -0,0 +1,168 @@ +//=========================================================================== +// +// s_atan.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_atan.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + */ + +/* atan(x) + * Method + * 1. Reduce x to positive by atan(x) = -atan(-x). + * 2. According to the integer k=4t+0.25 chopped, t=x, the argument + * is further reduced to one of the following intervals and the + * arctangent of t is evaluated by the corresponding formula: + * + * [0,7/16] atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...) + * [7/16,11/16] atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) ) + * [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) ) + * [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) ) + * [39/16,INF] atan(x) = atan(INF) + atan( -1/t ) + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "mathincl/fdlibm.h" + +static const double atanhi[] = { + 4.63647609000806093515e-01, /* atan(0.5)hi 0x3FDDAC67, 0x0561BB4F */ + 7.85398163397448278999e-01, /* atan(1.0)hi 0x3FE921FB, 0x54442D18 */ + 9.82793723247329054082e-01, /* atan(1.5)hi 0x3FEF730B, 0xD281F69B */ + 1.57079632679489655800e+00, /* atan(inf)hi 0x3FF921FB, 0x54442D18 */ +}; + +static const double atanlo[] = { + 2.26987774529616870924e-17, /* atan(0.5)lo 0x3C7A2B7F, 0x222F65E2 */ + 3.06161699786838301793e-17, /* atan(1.0)lo 0x3C81A626, 0x33145C07 */ + 1.39033110312309984516e-17, /* atan(1.5)lo 0x3C700788, 0x7AF0CBBD */ + 6.12323399573676603587e-17, /* atan(inf)lo 0x3C91A626, 0x33145C07 */ +}; + +static const double aT[] = { + 3.33333333333329318027e-01, /* 0x3FD55555, 0x5555550D */ + -1.99999999998764832476e-01, /* 0xBFC99999, 0x9998EBC4 */ + 1.42857142725034663711e-01, /* 0x3FC24924, 0x920083FF */ + -1.11111104054623557880e-01, /* 0xBFBC71C6, 0xFE231671 */ + 9.09088713343650656196e-02, /* 0x3FB745CD, 0xC54C206E */ + -7.69187620504482999495e-02, /* 0xBFB3B0F2, 0xAF749A6D */ + 6.66107313738753120669e-02, /* 0x3FB10D66, 0xA0D03D51 */ + -5.83357013379057348645e-02, /* 0xBFADDE2D, 0x52DEFD9A */ + 4.97687799461593236017e-02, /* 0x3FA97B4B, 0x24760DEB */ + -3.65315727442169155270e-02, /* 0xBFA2B444, 0x2C6A6C2F */ + 1.62858201153657823623e-02, /* 0x3F90AD3A, 0xE322DA11 */ +}; + + static const double +one = 1.0, +huge = 1.0e300; + + double atan(double x) +{ + double w,s1,s2,z; + int ix,hx,id; + + hx = CYG_LIBM_HI(x); + ix = hx&0x7fffffff; + if(ix>=0x44100000) { /* if |x| >= 2^66 */ + if(ix>0x7ff00000|| + (ix==0x7ff00000&&(CYG_LIBM_LO(x)!=0))) + return x+x; /* NaN */ + if(hx>0) return atanhi[3]+atanlo[3]; + else return -atanhi[3]-atanlo[3]; + } if (ix < 0x3fdc0000) { /* |x| < 0.4375 */ + if (ix < 0x3e200000) { /* |x| < 2^-29 */ + if(huge+x>one) return x; /* raise inexact */ + } + id = -1; + } else { + x = fabs(x); + if (ix < 0x3ff30000) { /* |x| < 1.1875 */ + if (ix < 0x3fe60000) { /* 7/16 <=|x|<11/16 */ + id = 0; x = (2.0*x-one)/(2.0+x); + } else { /* 11/16<=|x|< 19/16 */ + id = 1; x = (x-one)/(x+one); + } + } else { + if (ix < 0x40038000) { /* |x| < 2.4375 */ + id = 2; x = (x-1.5)/(one+1.5*x); + } else { /* 2.4375 <= |x| < 2^66 */ + id = 3; x = -1.0/x; + } + }} + /* end of argument reduction */ + z = x*x; + w = z*z; + /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ + s1 = z*(aT[0]+w*(aT[2]+w*(aT[4]+w*(aT[6]+w*(aT[8]+w*aT[10]))))); + s2 = w*(aT[1]+w*(aT[3]+w*(aT[5]+w*(aT[7]+w*aT[9])))); + if (id<0) return x - x*(s1+s2); + else { + z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x); + return (hx<0)? -z:z; + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_atan.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_ceil.c b/packages/language/c/libm/current/src/double/portable-api/s_ceil.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_ceil.c @@ -0,0 +1,124 @@ +//=========================================================================== +// +// s_ceil.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_ceil.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * ceil(x) + * Return x rounded toward -inf to integral value + * Method: + * Bit twiddling. + * Exception: + * Inexact flag raised if x not equal to ceil(x). + */ + +#include "mathincl/fdlibm.h" + +static const double huge = 1.0e300; + + double ceil(double x) +{ + int i0,i1,j0; + unsigned i,j; + i0 = CYG_LIBM_HI(x); + i1 = CYG_LIBM_LO(x); + j0 = ((i0>>20)&0x7ff)-0x3ff; + if(j0<20) { + if(j0<0) { /* raise inexact if x != 0 */ + if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */ + if(i0<0) {i0=0x80000000;i1=0;} + else if((i0|i1)!=0) { i0=0x3ff00000;i1=0;} + } + } else { + i = (0x000fffff)>>j0; + if(((i0&i)|i1)==0) return x; /* x is integral */ + if(huge+x>0.0) { /* raise inexact flag */ + if(i0>0) i0 += (0x00100000)>>j0; + i0 &= (~i); i1=0; + } + } + } else if (j0>51) { + if(j0==0x400) return x+x; /* inf or NaN */ + else return x; /* x is integral */ + } else { + i = ((unsigned)(0xffffffff))>>(j0-20); + if((i1&i)==0) return x; /* x is integral */ + if(huge+x>0.0) { /* raise inexact flag */ + if(i0>0) { + if(j0==20) i0+=1; + else { + j = i1 + (1<<(52-j0)); + if(j<(unsigned)i1) i0+=1; /* got a carry */ + i1 = j; + } + } + i1 &= (~i); + } + } + CYG_LIBM_HI(x) = i0; + CYG_LIBM_LO(x) = i1; + return x; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_ceil.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_copysign.c b/packages/language/c/libm/current/src/double/portable-api/s_copysign.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_copysign.c @@ -0,0 +1,81 @@ +//=========================================================================== +// +// s_copysign.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_copysign.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * copysign(double x, double y) + * copysign(x,y) returns a value with the magnitude of x and + * with the sign bit of y. + */ + +#include "mathincl/fdlibm.h" + + double copysign(double x, double y) +{ + CYG_LIBM_HI(x) = (CYG_LIBM_HI(x)&0x7fffffff)|(CYG_LIBM_HI(y)&0x80000000); + return x; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_copysign.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_cos.c b/packages/language/c/libm/current/src/double/portable-api/s_cos.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_cos.c @@ -0,0 +1,128 @@ +//=========================================================================== +// +// s_cos.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_cos.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* cos(x) + * Return cosine function of x. + * + * kernel function: + * __kernel_sin ... sine function on [-pi/4,pi/4] + * __kernel_cos ... cosine function on [-pi/4,pi/4] + * __ieee754_rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "mathincl/fdlibm.h" + + double cos(double x) +{ + double y[2],z=0.0; + int n, ix; + + /* High word of x. */ + ix = CYG_LIBM_HI(x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffff; + if(ix <= 0x3fe921fb) return __kernel_cos(x,z); + + /* cos(Inf or NaN) is NaN */ + else if (ix>=0x7ff00000) return x-x; + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2(x,y); + switch(n&3) { + case 0: return __kernel_cos(y[0],y[1]); + case 1: return -__kernel_sin(y[0],y[1],1); + case 2: return -__kernel_cos(y[0],y[1]); + default: + return __kernel_sin(y[0],y[1],1); + } + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_cos.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_expm1.c b/packages/language/c/libm/current/src/double/portable-api/s_expm1.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_expm1.c @@ -0,0 +1,264 @@ +//=========================================================================== +// +// s_expm1.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_expm1.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* expm1(x) + * Returns exp(x)-1, the exponential of x minus 1. + * + * Method + * 1. Argument reduction: + * Given x, find r and integer k such that + * + * x = k*ln2 + r, |r| <= 0.5*ln2 ~ 0.34658 + * + * Here a correction term c will be computed to compensate + * the error in r when rounded to a floating-point number. + * + * 2. Approximating expm1(r) by a special rational function on + * the interval [0,0.34658]: + * Since + * r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 - r^4/360 + ... + * we define R1(r*r) by + * r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 * R1(r*r) + * That is, + * R1(r**2) = 6/r *((exp(r)+1)/(exp(r)-1) - 2/r) + * = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r)) + * = 1 - r^2/60 + r^4/2520 - r^6/100800 + ... + * We use a special Reme algorithm on [0,0.347] to generate + * a polynomial of degree 5 in r*r to approximate R1. The + * maximum error of this polynomial approximation is bounded + * by 2**-61. In other words, + * R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5 + * where Q1 = -1.6666666666666567384E-2, + * Q2 = 3.9682539681370365873E-4, + * Q3 = -9.9206344733435987357E-6, + * Q4 = 2.5051361420808517002E-7, + * Q5 = -6.2843505682382617102E-9; + * (where z=r*r, and the values of Q1 to Q5 are listed below) + * with error bounded by + * | 5 | -61 + * | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2 + * | | + * + * expm1(r) = exp(r)-1 is then computed by the following + * specific way which minimize the accumulation rounding error: + * 2 3 + * r r [ 3 - (R1 + R1*r/2) ] + * expm1(r) = r + --- + --- * [--------------------] + * 2 2 [ 6 - r*(3 - R1*r/2) ] + * + * To compensate the error in the argument reduction, we use + * expm1(r+c) = expm1(r) + c + expm1(r)*c + * ~ expm1(r) + c + r*c + * Thus c+r*c will be added in as the correction terms for + * expm1(r+c). Now rearrange the term to avoid optimization + * screw up: + * ( 2 2 ) + * ({ ( r [ R1 - (3 - R1*r/2) ] ) } r ) + * expm1(r+c)~r - ({r*(--- * [--------------------]-c)-c} - --- ) + * ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 ) + * ( ) + * + * = r - E + * 3. Scale back to obtain expm1(x): + * From step 1, we have + * expm1(x) = either 2^k*[expm1(r)+1] - 1 + * = or 2^k*[expm1(r) + (1-2^-k)] + * 4. Implementation notes: + * (A). To save one multiplication, we scale the coefficient Qi + * to Qi*2^i, and replace z by (x^2)/2. + * (B). To achieve maximum accuracy, we compute expm1(x) by + * (i) if x < -56*ln2, return -1.0, (raise inexact if x!=inf) + * (ii) if k=0, return r-E + * (iii) if k=-1, return 0.5*(r-E)-0.5 + * (iv) if k=1 if r < -0.25, return 2*((r+0.5)- E) + * else return 1.0+2.0*(r-E); + * (v) if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1) + * (vi) if k <= 20, return 2^k((1-2^-k)-(E-r)), else + * (vii) return 2^k(1-((E+2^-k)-r)) + * + * Special cases: + * expm1(INF) is INF, expm1(NaN) is NaN; + * expm1(-INF) is -1, and + * for finite argument, only expm1(0)=0 is exact. + * + * Accuracy: + * according to an error analysis, the error is always less than + * 1 ulp (unit in the last place). + * + * Misc. info. + * For IEEE double + * if x > 7.09782712893383973096e+02 then expm1(x) overflow + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "mathincl/fdlibm.h" + +static const double +one = 1.0, +huge = 1.0e+300, +tiny = 1.0e-300, +o_threshold = 7.09782712893383973096e+02,/* 0x40862E42, 0xFEFA39EF */ +ln2_hi = 6.93147180369123816490e-01,/* 0x3fe62e42, 0xfee00000 */ +ln2_lo = 1.90821492927058770002e-10,/* 0x3dea39ef, 0x35793c76 */ +invln2 = 1.44269504088896338700e+00,/* 0x3ff71547, 0x652b82fe */ + /* scaled coefficients related to expm1 */ +Q1 = -3.33333333333331316428e-02, /* BFA11111 111110F4 */ +Q2 = 1.58730158725481460165e-03, /* 3F5A01A0 19FE5585 */ +Q3 = -7.93650757867487942473e-05, /* BF14CE19 9EAADBB7 */ +Q4 = 4.00821782732936239552e-06, /* 3ED0CFCA 86E65239 */ +Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ + + double expm1(double x) +{ + double y,hi,lo,c,t,e,hxs,hfx,r1; + int k,xsb; + unsigned hx; + + c=0.0; /* placate compiler */ + hx = CYG_LIBM_HI(x); /* high word of x */ + xsb = hx&0x80000000; /* sign bit of x */ + if(xsb==0) y=x; else y= -x; /* y = |x| */ + hx &= 0x7fffffff; /* high word of |x| */ + + /* filter out huge and non-finite argument */ + if(hx >= 0x4043687A) { /* if |x|>=56*ln2 */ + if(hx >= 0x40862E42) { /* if |x|>=709.78... */ + if(hx>=0x7ff00000) { + if(((hx&0xfffff)|CYG_LIBM_LO(x))!=0) + return x+x; /* NaN */ + else return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */ + } + if(x > o_threshold) return huge*huge; /* overflow */ + } + if(xsb!=0) { /* x < -56*ln2, return -1.0 with inexact */ + if(x+tiny<0.0) /* raise inexact */ + return tiny-one; /* return -1 */ + } + } + + /* argument reduction */ + if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ + if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ + if(xsb==0) + {hi = x - ln2_hi; lo = ln2_lo; k = 1;} + else + {hi = x + ln2_hi; lo = -ln2_lo; k = -1;} + } else { + k = invln2*x+((xsb==0)?0.5:-0.5); + t = k; + hi = x - t*ln2_hi; /* t*ln2_hi is exact here */ + lo = t*ln2_lo; + } + x = hi - lo; + c = (hi-x)-lo; + } + else if(hx < 0x3c900000) { /* when |x|<2**-54, return x */ + t = huge+x; /* return x with inexact flags when x!=0 */ + return x - (t-(huge+x)); + } + else k = 0; + + /* x is now in primary range */ + hfx = 0.5*x; + hxs = x*hfx; + r1 = one+hxs*(Q1+hxs*(Q2+hxs*(Q3+hxs*(Q4+hxs*Q5)))); + t = 3.0-r1*hfx; + e = hxs*((r1-t)/(6.0 - x*t)); + if(k==0) return x - (x*e-hxs); /* c is 0 */ + else { + e = (x*(e-c)-c); + e -= hxs; + if(k== -1) return 0.5*(x-e)-0.5; + if(k==1) { + if(x < -0.25) return -2.0*(e-(x+0.5)); + else return one+2.0*(x-e); + } + if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */ + y = one-(e-x); + CYG_LIBM_HI(y) += (k<<20); /* add k to y's exponent */ + return y-one; + } + t = one; + if(k<20) { + CYG_LIBM_HI(t) = 0x3ff00000 - (0x200000>>k); /* t=1-2^-k */ + y = t-(e-x); + CYG_LIBM_HI(y) += (k<<20); /* add k to y's exponent */ + } else { + CYG_LIBM_HI(t) = ((0x3ff-k)<<20); /* 2^-k */ + y = x-(e+t); + y += one; + CYG_LIBM_HI(y) += (k<<20); /* add k to y's exponent */ + } + } + return y; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_expm1.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_fabs.c b/packages/language/c/libm/current/src/double/portable-api/s_fabs.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_fabs.c @@ -0,0 +1,79 @@ +//=========================================================================== +// +// s_fabs.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_fabs.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * fabs(x) returns the absolute value of x. + */ + +#include "mathincl/fdlibm.h" + + double fabs(double x) +{ + CYG_LIBM_HI(x) &= 0x7fffffff; + return x; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_fabs.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_finite.c b/packages/language/c/libm/current/src/double/portable-api/s_finite.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_finite.c @@ -0,0 +1,81 @@ +//=========================================================================== +// +// s_finite.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_finite.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * finite(x) returns 1 is x is finite, else 0; + * no branching! + */ + +#include "mathincl/fdlibm.h" + + int finite(double x) +{ + int hx; + hx = CYG_LIBM_HI(x); + return (unsigned)((hx&0x7fffffff)-0x7ff00000)>>31; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_finite.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_floor.c b/packages/language/c/libm/current/src/double/portable-api/s_floor.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_floor.c @@ -0,0 +1,125 @@ +//=========================================================================== +// +// s_floor.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_floor.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * floor(x) + * Return x rounded toward -inf to integral value + * Method: + * Bit twiddling. + * Exception: + * Inexact flag raised if x not equal to floor(x). + */ + +#include "mathincl/fdlibm.h" + +static const double huge = 1.0e300; + + double floor(double x) +{ + int i0,i1,j0; + unsigned i,j; + i0 = CYG_LIBM_HI(x); + i1 = CYG_LIBM_LO(x); + j0 = ((i0>>20)&0x7ff)-0x3ff; + if(j0<20) { + if(j0<0) { /* raise inexact if x != 0 */ + if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */ + if(i0>=0) {i0=i1=0;} + else if(((i0&0x7fffffff)|i1)!=0) + { i0=0xbff00000;i1=0;} + } + } else { + i = (0x000fffff)>>j0; + if(((i0&i)|i1)==0) return x; /* x is integral */ + if(huge+x>0.0) { /* raise inexact flag */ + if(i0<0) i0 += (0x00100000)>>j0; + i0 &= (~i); i1=0; + } + } + } else if (j0>51) { + if(j0==0x400) return x+x; /* inf or NaN */ + else return x; /* x is integral */ + } else { + i = ((unsigned)(0xffffffff))>>(j0-20); + if((i1&i)==0) return x; /* x is integral */ + if(huge+x>0.0) { /* raise inexact flag */ + if(i0<0) { + if(j0==20) i0+=1; + else { + j = i1+(1<<(52-j0)); + if(j<(unsigned)i1) i0 +=1 ; /* got a carry */ + i1=j; + } + } + i1 &= (~i); + } + } + CYG_LIBM_HI(x) = i0; + CYG_LIBM_LO(x) = i1; + return x; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_floor.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_frexp.c b/packages/language/c/libm/current/src/double/portable-api/s_frexp.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_frexp.c @@ -0,0 +1,102 @@ +//=========================================================================== +// +// s_frexp.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_frexp.c 1.4 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * for non-zero x + * x = frexp(arg,&exp); + * return a double fp quantity x such that 0.5 <= |x| <1.0 + * and the corresponding binary exponent "exp". That is + * arg = x*2^exp. + * If arg is inf, 0.0, or NaN, then frexp(arg,&exp) returns arg + * with *exp=0. + */ + +#include "mathincl/fdlibm.h" + +static const double +two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */ + + double frexp(double x, int *eptr) +{ + int hx, ix, lx; + hx = CYG_LIBM_HI(x); + ix = 0x7fffffff&hx; + lx = CYG_LIBM_LO(x); + *eptr = 0; + if(ix>=0x7ff00000||((ix|lx)==0)) return x; /* 0,inf,nan */ + if (ix<0x00100000) { /* subnormal */ + x *= two54; + hx = CYG_LIBM_HI(x); + ix = hx&0x7fffffff; + *eptr = -54; + } + *eptr += (ix>>20)-1022; + hx = (hx&0x800fffff)|0x3fe00000; + CYG_LIBM_HI(x) = hx; + return x; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_frexp.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_isnan.c b/packages/language/c/libm/current/src/double/portable-api/s_isnan.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_isnan.c @@ -0,0 +1,84 @@ +//=========================================================================== +// +// s_isnan.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_isnan.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * isnan(x) returns 1 is x is nan, else 0; + * no branching! + */ + +#include "mathincl/fdlibm.h" + + int isnan(double x) +{ + int hx,lx; + hx = (CYG_LIBM_HI(x)&0x7fffffff); + lx = CYG_LIBM_LO(x); + hx |= (unsigned)(lx|(-lx))>>31; + hx = 0x7ff00000 - hx; + return ((unsigned)(hx))>>31; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_isnan.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_ldexp.c b/packages/language/c/libm/current/src/double/portable-api/s_ldexp.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_ldexp.c @@ -0,0 +1,89 @@ +//=========================================================================== +// +// s_ldexp.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_ldexp.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include "mathincl/fdlibm.h" + +double +ldexp(double x, int exp) +{ + double z; + + z = scalbn(x,exp); + +#ifndef CYGSEM_LIBM_COMPAT_IEEE_ONLY + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return z; + if(!(finite(z)||isnan(z))&&finite(x)) { + return __kernel_standard(x,(double)exp,43); /* ldexp overflow */ + } + if(z==0.0&&z!=x) { + return __kernel_standard(x,(double)exp,44); /* ldexp underflow */ + } +#endif + + return z; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_ldexp.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_modf.c b/packages/language/c/libm/current/src/double/portable-api/s_modf.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_modf.c @@ -0,0 +1,126 @@ +//=========================================================================== +// +// s_modf.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_modf.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * modf(double x, double *iptr) + * return fraction part of x, and return x's integral part in *iptr. + * Method: + * Bit twiddling. + * + * Exception: + * No exception. + */ + +#include "mathincl/fdlibm.h" + +static const double one = 1.0; + + double modf(double x, double *iptr) +{ + int i0,i1,j0; + unsigned i; + i0 = CYG_LIBM_HI(x); /* high x */ + i1 = CYG_LIBM_LO(x); /* low x */ + j0 = ((i0>>20)&0x7ff)-0x3ff; /* exponent of x */ + if(j0<20) { /* integer part in high x */ + if(j0<0) { /* |x|<1 */ + CYG_LIBM_HIp(iptr) = i0&0x80000000; + CYG_LIBM_LOp(iptr) = 0; /* *iptr = +-0 */ + return x; + } else { + i = (0x000fffff)>>j0; + if(((i0&i)|i1)==0) { /* x is integral */ + *iptr = x; + CYG_LIBM_HI(x) &= 0x80000000; + CYG_LIBM_LO(x) = 0; /* return +-0 */ + return x; + } else { + CYG_LIBM_HIp(iptr) = i0&(~i); + CYG_LIBM_LOp(iptr) = 0; + return x - *iptr; + } + } + } else if (j0>51) { /* no fraction part */ + *iptr = x*one; + CYG_LIBM_HI(x) &= 0x80000000; + CYG_LIBM_LO(x) = 0; /* return +-0 */ + return x; + } else { /* fraction part in low x */ + i = ((unsigned)(0xffffffff))>>(j0-20); + if((i1&i)==0) { /* x is integral */ + *iptr = x; + CYG_LIBM_HI(x) &= 0x80000000; + CYG_LIBM_LO(x) = 0; /* return +-0 */ + return x; + } else { + CYG_LIBM_HIp(iptr) = i0; + CYG_LIBM_LOp(iptr) = i1&(~i); + return x - *iptr; + } + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_modf.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_rint.c b/packages/language/c/libm/current/src/double/portable-api/s_rint.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_rint.c @@ -0,0 +1,130 @@ +//=========================================================================== +// +// s_rint.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_rint.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * rint(x) + * Return x rounded to integral value according to the prevailing + * rounding mode. + * Method: + * Using floating addition. + * Exception: + * Inexact flag raised if x not equal to rint(x). + */ + +#include "mathincl/fdlibm.h" + +static const double +TWO52[2]={ + 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ + -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */ +}; + + double rint(double x) +{ + int i0,j0,sx; + unsigned i,i1; + double w,t; + i0 = CYG_LIBM_HI(x); + sx = (i0>>31)&1; + i1 = CYG_LIBM_LO(x); + j0 = ((i0>>20)&0x7ff)-0x3ff; + if(j0<20) { + if(j0<0) { + if(((i0&0x7fffffff)|i1)==0) return x; + i1 |= (i0&0x0fffff); + i0 &= 0xfffe0000; + i0 |= ((i1|-i1)>>12)&0x80000; + CYG_LIBM_HI(x)=i0; + w = TWO52[sx]+x; + t = w-TWO52[sx]; + i0 = CYG_LIBM_HI(t); + CYG_LIBM_HI(t) = (i0&0x7fffffff)|(sx<<31); + return t; + } else { + i = (0x000fffff)>>j0; + if(((i0&i)|i1)==0) return x; /* x is integral */ + i>>=1; + if(((i0&i)|i1)!=0) { + if(j0==19) i1 = 0x40000000; else + i0 = (i0&(~i))|((0x20000)>>j0); + } + } + } else if (j0>51) { + if(j0==0x400) return x+x; /* inf or NaN */ + else return x; /* x is integral */ + } else { + i = ((unsigned)(0xffffffff))>>(j0-20); + if((i1&i)==0) return x; /* x is integral */ + i>>=1; + if((i1&i)!=0) i1 = (i1&(~i))|((0x40000000)>>(j0-20)); + } + CYG_LIBM_HI(x) = i0; + CYG_LIBM_LO(x) = i1; + w = TWO52[sx]+x; + return w-TWO52[sx]; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_rint.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_scalbn.c b/packages/language/c/libm/current/src/double/portable-api/s_scalbn.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_scalbn.c @@ -0,0 +1,110 @@ +//=========================================================================== +// +// s_scalbn.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_scalbn.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * scalbn (double x, int n) + * scalbn(x,n) returns x* 2**n computed by exponent + * manipulation rather than by actually performing an + * exponentiation or a multiplication. + */ + +#include "mathincl/fdlibm.h" + +static const double +two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ +twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ +huge = 1.0e+300, +tiny = 1.0e-300; + + double scalbn (double x, int n) +{ + int k,hx,lx; + hx = CYG_LIBM_HI(x); + lx = CYG_LIBM_LO(x); + k = (hx&0x7ff00000)>>20; /* extract exponent */ + if (k==0) { /* 0 or subnormal x */ + if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */ + x *= two54; + hx = CYG_LIBM_HI(x); + k = ((hx&0x7ff00000)>>20) - 54; + if (n< -50000) return tiny*x; /*underflow*/ + } + if (k==0x7ff) return x+x; /* NaN or Inf */ + k = k+n; + if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */ + if (k > 0) /* normal result */ + {CYG_LIBM_HI(x) = (hx&0x800fffff)|(k<<20); return x;} + if (k <= -54) { + if (n > 50000) /* in case integer overflow in n+k */ + return huge*copysign(huge,x); /*overflow*/ + else return tiny*copysign(tiny,x); /*underflow*/ + } + k += 54; /* subnormal result */ + CYG_LIBM_HI(x) = (hx&0x800fffff)|(k<<20); + return x*twom54; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_scalbn.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_sin.c b/packages/language/c/libm/current/src/double/portable-api/s_sin.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_sin.c @@ -0,0 +1,128 @@ +//=========================================================================== +// +// s_sin.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_sin.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* sin(x) + * Return sine function of x. + * + * kernel function: + * __kernel_sin ... sine function on [-pi/4,pi/4] + * __kernel_cos ... cose function on [-pi/4,pi/4] + * __ieee754_rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "mathincl/fdlibm.h" + + double sin(double x) +{ + double y[2],z=0.0; + int n, ix; + + /* High word of x. */ + ix = CYG_LIBM_HI(x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffff; + if(ix <= 0x3fe921fb) return __kernel_sin(x,z,0); + + /* sin(Inf or NaN) is NaN */ + else if (ix>=0x7ff00000) return x-x; + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2(x,y); + switch(n&3) { + case 0: return __kernel_sin(y[0],y[1],1); + case 1: return __kernel_cos(y[0],y[1]); + case 2: return -__kernel_sin(y[0],y[1],1); + default: + return -__kernel_cos(y[0],y[1]); + } + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_sin.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_tan.c b/packages/language/c/libm/current/src/double/portable-api/s_tan.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_tan.c @@ -0,0 +1,122 @@ +//=========================================================================== +// +// s_tan.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_tan.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* tan(x) + * Return tangent function of x. + * + * kernel function: + * __kernel_tan ... tangent function on [-pi/4,pi/4] + * __ieee754_rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "mathincl/fdlibm.h" + + double tan(double x) +{ + double y[2],z=0.0; + int n, ix; + + /* High word of x. */ + ix = CYG_LIBM_HI(x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffff; + if(ix <= 0x3fe921fb) return __kernel_tan(x,z,1); + + /* tan(Inf or NaN) is NaN */ + else if (ix>=0x7ff00000) return x-x; /* NaN */ + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2(x,y); + return __kernel_tan(y[0],y[1],1-((n&1)<<1)); /* 1 -- n even + -1 -- n odd */ + } +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_tan.c diff --git a/packages/language/c/libm/current/src/double/portable-api/s_tanh.c b/packages/language/c/libm/current/src/double/portable-api/s_tanh.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/double/portable-api/s_tanh.c @@ -0,0 +1,128 @@ +//=========================================================================== +// +// s_tanh.c +// +// Part of the standard mathematical function library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// Derived from code with the following copyright + + +/* @(#)s_tanh.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* Tanh(x) + * Return the Hyperbolic Tangent of x + * + * Method : + * x -x + * e - e + * 0. tanh(x) is defined to be ----------- + * x -x + * e + e + * 1. reduce x to non-negative by tanh(-x) = -tanh(x). + * 2. 0 <= x <= 2**-55 : tanh(x) := x*(one+x) + * -t + * 2**-55 < x <= 1 : tanh(x) := -----; t = expm1(-2x) + * t + 2 + * 2 + * 1 <= x <= 22.0 : tanh(x) := 1- ----- ; t=expm1(2x) + * t + 2 + * 22.0 < x <= INF : tanh(x) := 1. + * + * Special cases: + * tanh(NaN) is NaN; + * only tanh(0)=0 is exact for finite argument. + */ + +#include "mathincl/fdlibm.h" + +static const double one=1.0, two=2.0, tiny = 1.0e-300; + + double tanh(double x) +{ + double t,z; + int jx,ix; + + /* High word of |x|. */ + jx = CYG_LIBM_HI(x); + ix = jx&0x7fffffff; + + /* x is INF or NaN */ + if(ix>=0x7ff00000) { + if (jx>=0) return one/x+one; /* tanh(+-inf)=+-1 */ + else return one/x-one; /* tanh(NaN) = NaN */ + } + + /* |x| < 22 */ + if (ix < 0x40360000) { /* |x|<22 */ + if (ix<0x3c800000) /* |x|<2**-55 */ + return x*(one+x); /* tanh(small) = small */ + if (ix>=0x3ff00000) { /* |x|>=1 */ + t = expm1(two*fabs(x)); + z = one - two/(t+two); + } else { + t = expm1(-two*fabs(x)); + z= -t/(t+two); + } + /* |x| > 22, return +-1 */ + } else { + z = one - tiny; /* raised inexact flag */ + } + return (jx>=0)? z: -z; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF s_tanh.c diff --git a/packages/language/c/libm/current/src/mathincl/fdlibm.h b/packages/language/c/libm/current/src/mathincl/fdlibm.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/mathincl/fdlibm.h @@ -0,0 +1,188 @@ +#ifndef CYGONCE_LIBM_MATHINCL_FDLIBM_H +#define CYGONCE_LIBM_MATHINCL_FDLIBM_H +//=========================================================================== +// +// fdlibm.h +// +// Internal definitions for math library implementation based on fdlibm +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Internal implementation-specific header for math library +// based on fdlibm +// Usage: From within this package, #include "mathincl/fdlibm.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// INCLUDES + +#include // Common type definitions and support +#include // Main header for math library +#include // Properties of FP representation on this + // platform + +// SANITY CHECKS + +// Just check that we support IEEE-style 64-bit doubles. If not, this +// math library will not work +// This check will go away when support for single-precision alternatives are +// provided + +#if DBL_MAX_EXP != 1024 +# error IEEE-style 64-bit doubles are required to use the math library +#endif // if DBL_MAX_EXP == 1024 + + +// MACRO DEFINITIONS + + +#if (CYG_BYTEORDER == CYG_LSBFIRST) // little endian +#define CYG_LIBM_HI(x) (*(1+(cyg_int32*)&(x))) +#define CYG_LIBM_LO(x) (*(cyg_int32*)&(x)) +#define CYG_LIBM_HIp(x) (*(1+(cyg_int32*)(x))) +#define CYG_LIBM_LOp(x) (*(cyg_int32*)(x)) +#else // big endian +#define CYG_LIBM_HI(x) (*(cyg_int32*)&(x)) +#define CYG_LIBM_LO(x) (*(1+(cyg_int32*)&(x))) +#define CYG_LIBM_HIp(x) (*(cyg_int32*)(x)) +#define CYG_LIBM_LOp(x) (*(1+(cyg_int32*)(x))) +#endif + + +// REPLACEMENTS FOR STUFF FROM MATH.H DUE TO CONFIG OPTION + +#ifdef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION + +#define HUGE FLT_MAX // from float.h +#define DOMAIN 1 +#define SING 2 +#define OVERFLOW 3 +#define UNDERFLOW 4 +#define TLOSS 5 +#define PLOSS 6 + +struct exception { + int type; // One of DOMAIN, SING, OVERFLOW, UNDERFLOW, TLOSS, PLOSS + char *name; // Name of the function generating the exception + double arg1; // First argument to the function + double arg2; // Second argument to the function + double retval; // Value to be returned - can be altered by matherr() +}; + +externC int +matherr( struct exception * ); // User-overridable error handling - see + // for a discussion +#endif // ifdef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION + + + +// FUNCTION PROTOTYPES + +// IEEE-754 style elementary functions */ + +externC double +__ieee754_sqrt( double ); + +externC double +__ieee754_acos( double ); + + +externC double +__ieee754_log( double ); + + +externC double +__ieee754_asin( double ); + +externC double +__ieee754_atan2( double, double ); + +externC double +__ieee754_exp( double ); + +externC double +__ieee754_cosh( double ); + +externC double +__ieee754_fmod( double, double ); + +externC double +__ieee754_pow( double, double ); + + +externC double +__ieee754_log10( double ); + +externC double +__ieee754_sinh( double ); + + +externC int +__ieee754_rem_pio2( double, double * ); + +#ifdef CYGFUN_LIBM_SVID3_scalb +externC double +__ieee754_scalb( double, double ); +#else +externC double +__ieee754_scalb( double, int ); +#endif + +// FDLIBM kernel functions + +externC double +__kernel_standard( double, double, int ); + +externC double +__kernel_sin( double, double, int ); + +externC double +__kernel_cos( double, double ); + +externC double +__kernel_tan( double, double, int ); + +externC int +__kernel_rem_pio2( double *, double *, int, int, int, const int * ); + +#endif // ifdef CYGPKG_LIBM + +#endif // CYGONCE_LIBM_MATHINCL_FDLIBM_H multiple inclusion protection + +// EOF fdlibm.h diff --git a/packages/language/c/libm/current/src/misc/compatmode.cxx b/packages/language/c/libm/current/src/misc/compatmode.cxx new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/misc/compatmode.cxx @@ -0,0 +1,203 @@ +//=========================================================================== +// +// compatmode.cxx +// +// Compatibility mode setting for Math library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Contains the accessor functions to get and set the standards +// compatibility mode of the Math library +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing macros + +#include // Main header for math library + +#ifdef CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE +# include // Kernel thread header +# include // and its associated inlines +# include // We need mutexes too +#endif + +// GLOBAL VARIABLES + +#ifndef CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE + +# ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY +Cyg_libm_compat_t cygvar_libm_compat_mode = CYGNUM_LIBM_COMPAT_IEEE; +# else +Cyg_libm_compat_t cygvar_libm_compat_mode = CYGNUM_LIBM_COMPAT_DEFAULT; +# endif + +#else // ifndef CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE + +static Cyg_Mutex cyg_libm_mode_thread_data_index_mutex; +static cyg_count32 cyg_libm_mode_thread_data_index = CYGNUM_KERNEL_THREADS_DATA_MAX; + + +# if defined(CYGDBG_USE_TRACING) && \ + defined(CYGNUM_LIBM_COMPATMODE_TRACE_LEVEL) +static int libm_compatmode_trace = CYGNUM_LIBM_COMPATMODE_TRACE_LEVEL; +# define TL1 (0 < libm_compatmode_trace ) +# else +# define TL1 (0) +# endif + +// FUNCTIONS + + +Cyg_libm_compat_t +cyg_libm_get_compat_mode( void ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + CYG_ADDRWORD current_val; + + CYG_REPORT_FUNCNAMETYPE( "Cyg_libm_get_compat_mode", "mode is %d" ); + + // First check if this is the first thread to get here, and if so, + // initialise the thread data index + + if (cyg_libm_mode_thread_data_index == CYGNUM_KERNEL_THREADS_DATA_MAX) + { + CYG_TRACE0( TL1, "Index unset, locking mutex to allocate" ); + + // Lock mutex and then check again - less overhead for normal + // execution path + cyg_libm_mode_thread_data_index_mutex.lock(); + + if (cyg_libm_mode_thread_data_index == CYGNUM_KERNEL_THREADS_DATA_MAX) + { + CYG_TRACE0( TL1, "Allocating index" ); + cyg_libm_mode_thread_data_index = self->new_data_index(); + + } // if + + cyg_libm_mode_thread_data_index_mutex.unlock(); + + self->set_data( cyg_libm_mode_thread_data_index, + CYGNUM_LIBM_COMPAT_DEFAULT ); + + // But if we've gone through this, then we know what the mode is! + CYG_REPORT_RETVAL( CYGNUM_LIBM_COMPAT_DEFAULT ); + return CYGNUM_LIBM_COMPAT_DEFAULT; + } // if + + CYG_TRACE0( TL1, "Index set, now fetching per-thread data" ); + + // If we're here, then the index is set up + + current_val = self->get_data( cyg_libm_mode_thread_data_index ); + + // If its at the "default" setting, then return the default + if (current_val == CYGNUM_LIBM_COMPAT_UNINIT) + { + CYG_REPORT_RETVAL( CYGNUM_LIBM_COMPAT_DEFAULT ); + return CYGNUM_LIBM_COMPAT_DEFAULT; + } // if + + CYG_REPORT_RETVAL( current_val ); + return (Cyg_libm_compat_t) current_val; +} // cyg_libm_get_compat_mode() + + +Cyg_libm_compat_t +cyg_libm_set_compat_mode( Cyg_libm_compat_t new_mode ) +{ + Cyg_Thread *self = Cyg_Thread::self(); + CYG_ADDRWORD current_val; + + CYG_REPORT_FUNCNAMETYPE( "Cyg_libm_set_compat_mode", "old mode was %d" ); + CYG_REPORT_FUNCARG1DV( new_mode ); + + // First check if this is the first thread to get here, and if so, + // initialise the thread data index + + if (cyg_libm_mode_thread_data_index == CYGNUM_KERNEL_THREADS_DATA_MAX) + { + CYG_TRACE0( TL1, "Index unset, locking mutex to allocate" ); + + // Lock mutex and then check again - less overhead for normal + // execution path + cyg_libm_mode_thread_data_index_mutex.lock(); + + if (cyg_libm_mode_thread_data_index == CYGNUM_KERNEL_THREADS_DATA_MAX) + { + CYG_TRACE0( TL1, "Allocating index" ); + cyg_libm_mode_thread_data_index = self->new_data_index(); + + } // if + + cyg_libm_mode_thread_data_index_mutex.unlock(); + + self->set_data( cyg_libm_mode_thread_data_index, + new_mode ); + + // But if we've gone through this, then we know what the old mode was! + + CYG_REPORT_RETVAL( CYGNUM_LIBM_COMPAT_UNINIT ); + return CYGNUM_LIBM_COMPAT_UNINIT; + + } // if + + // If we're here, then the index is set up + + CYG_TRACE0( TL1, "Index set, now fetching per-thread data" ); + + current_val = self->get_data( cyg_libm_mode_thread_data_index ); + + self->set_data( cyg_libm_mode_thread_data_index, + new_mode ); + + CYG_REPORT_RETVAL( current_val ); + return (Cyg_libm_compat_t) current_val; + +} // cyg_libm_set_compat_mode() + +#endif // ifdef CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE + + +#endif // ifdef CYGPKG_LIBM + +// EOF compatmode.cxx diff --git a/packages/language/c/libm/current/src/misc/infconst.c b/packages/language/c/libm/current/src/misc/infconst.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/misc/infconst.c @@ -0,0 +1,73 @@ +//=========================================================================== +// +// infconst.c +// +// Infinity constant +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Defines a constant cyg_libm_infinity so that we can define +// HUGE_VAL +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// INCLUDES + +#include // Common type definitions and support + // including endian-ness +#include // Main header for math library +#include // Cyg_libm_ieee_double_shape_type + + +// GLOBALS + +#if (CYG_BYTEORDER == CYG_MSBFIRST) // Big endian + +const Cyg_libm_ieee_double_shape_type cyg_libm_infinity = { {0x7ff00000, 0} }; + +#else // Little endian + +const Cyg_libm_ieee_double_shape_type cyg_libm_infinity = { {0, 0x7ff00000} }; + +#endif + +#endif // ifdef CYGPKG_LIBM + +// EOF infconst.c diff --git a/packages/language/c/libm/current/src/misc/matherr.c b/packages/language/c/libm/current/src/misc/matherr.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/misc/matherr.c @@ -0,0 +1,77 @@ +//=========================================================================== +// +// matherr.c +// +// Default matherr() error handler +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Contains an empty default matherr() function which the user +// can override if they want +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#if defined(CYGPKG_LIBM) + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing macros + +#include // Main header for math library +#include "mathincl/fdlibm.h" // Internal header for math library + +int +matherr( struct exception *x ) __attribute__ ((weak)); + +int +matherr( struct exception *x ) +{ + CYG_REPORT_FUNCNAMETYPE( "matherr", "returning %d" ); + + CYG_UNUSED_PARAM( struct exception *, x ); + CYG_EMPTY_STATEMENT; + + CYG_REPORT_RETVAL( 0 ); + return 0; +} // matherr() + + +#endif // if defined(CYGPKG_LIBM) + +// EOF matherr.c diff --git a/packages/language/c/libm/current/src/misc/standard.c b/packages/language/c/libm/current/src/misc/standard.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/src/misc/standard.c @@ -0,0 +1,821 @@ +//=========================================================================== +// +// signgam.cxx +// +// Support sign of the gamma*() functions in Math library +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: Contains the accessor functions to get and set the stored sign +// of the gamma*() functions in the math library +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +/* @(#)k_standard.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + * + */ + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// INCLUDES + +#include // Common type definitions and support +#include // Tracing macros + +#include // Main header for math library +#include "mathincl/fdlibm.h" // Internal header for math library + +#include // standard error codes + +#ifndef CYGSEM_LIBM_COMPAT_IEEE_ONLY +#include +#else +static int errno; // this whole file won't be used if we're IEEE only, but + // doing this keeps the compiler happy +#endif + +#ifdef CYGSEM_LIBM_USE_STDERR + +#include +#define WRITE2(u,v) fputs(u, stderr) + +#else + +#define WRITE2(u,v) 0 + +#endif // ifdef CYGSEM_LIBM_USE_STDERR + + +// GLOBALS + +static const double zero = 0.0; + +// FUNCTIONS + +/* + * Standard conformance (non-IEEE) on exception cases. + * Mapping: + * 1 -- acos(|x|>1) + * 2 -- asin(|x|>1) + * 3 -- atan2(+-0,+-0) + * 4 -- hypot overflow + * 5 -- cosh overflow + * 6 -- exp overflow + * 7 -- exp underflow + * 8 -- y0(0) + * 9 -- y0(-ve) + * 10-- y1(0) + * 11-- y1(-ve) + * 12-- yn(0) + * 13-- yn(-ve) + * 14-- lgamma(finite) overflow + * 15-- lgamma(-integer) + * 16-- log(0) + * 17-- log(x<0) + * 18-- log10(0) + * 19-- log10(x<0) + * 20-- pow(0.0,0.0) + * 21-- pow(x,y) overflow + * 22-- pow(x,y) underflow + * 23-- pow(0,negative) + * 24-- pow(neg,non-integral) + * 25-- sinh(finite) overflow + * 26-- sqrt(negative) + * 27-- fmod(x,0) + * 28-- remainder(x,0) + * 29-- acosh(x<1) + * 30-- atanh(|x|>1) + * 31-- atanh(|x|=1) + * 32-- scalb overflow + * 33-- scalb underflow + * 34-- j0(|x|>X_TLOSS) + * 35-- y0(x>X_TLOSS) + * 36-- j1(|x|>X_TLOSS) + * 37-- y1(x>X_TLOSS) + * 38-- jn(|x|>X_TLOSS, n) + * 39-- yn(x>X_TLOSS, n) + * 40-- gamma(finite) overflow + * 41-- gamma(-integer) + * 42-- pow(NaN,0.0) + * 43-- ldexp overflow + * 44-- ldexp underflow + */ + + +double +__kernel_standard(double x, double y, int type) +{ + struct exception exc; + +#ifdef CYGSEM_LIBM_USE_STDERR + (void) fflush(stdout); +#endif + exc.arg1 = x; + exc.arg2 = y; + switch(type) { + case 1: + /* acos(|x|>1) */ + exc.type = DOMAIN; + exc.name = "acos"; + exc.retval = zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("acos: DOMAIN error\n", 19); + } + errno = EDOM; + } + break; + case 2: + /* asin(|x|>1) */ + exc.type = DOMAIN; + exc.name = "asin"; + exc.retval = zero; + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("asin: DOMAIN error\n", 19); + } + errno = EDOM; + } + break; + case 3: + /* atan2(+-0,+-0) */ + exc.arg1 = y; + exc.arg2 = x; + exc.type = DOMAIN; + exc.name = "atan2"; + exc.retval = zero; + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("atan2: DOMAIN error\n", 20); + } + errno = EDOM; + } + break; + case 4: + /* hypot(finite,finite) overflow */ + exc.type = OVERFLOW; + exc.name = "hypot"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = HUGE; + else + exc.retval = HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 5: + /* cosh(finite) overflow */ + exc.type = OVERFLOW; + exc.name = "cosh"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = HUGE; + else + exc.retval = HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 6: + /* exp(finite) overflow */ + exc.type = OVERFLOW; + exc.name = "exp"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = HUGE; + else + exc.retval = HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 7: + /* exp(finite) underflow */ + exc.type = UNDERFLOW; + exc.name = "exp"; + exc.retval = zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 8: + /* y0(0) = -inf */ + exc.type = DOMAIN; /* should be SING for IEEE */ + exc.name = "y0"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("y0: DOMAIN error\n", 17); + } + errno = EDOM; + } + break; + case 9: + /* y0(x<0) = NaN */ + exc.type = DOMAIN; + exc.name = "y0"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("y0: DOMAIN error\n", 17); + } + errno = EDOM; + } + break; + case 10: + /* y1(0) = -inf */ + exc.type = DOMAIN; /* should be SING for IEEE */ + exc.name = "y1"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("y1: DOMAIN error\n", 17); + } + errno = EDOM; + } + break; + case 11: + /* y1(x<0) = NaN */ + exc.type = DOMAIN; + exc.name = "y1"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("y1: DOMAIN error\n", 17); + } + errno = EDOM; + } + break; + case 12: + /* yn(n,0) = -inf */ + exc.type = DOMAIN; /* should be SING for IEEE */ + exc.name = "yn"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("yn: DOMAIN error\n", 17); + } + errno = EDOM; + } + break; + case 13: + /* yn(x<0) = NaN */ + exc.type = DOMAIN; + exc.name = "yn"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("yn: DOMAIN error\n", 17); + } + errno = EDOM; + } + break; + case 14: + /* lgamma(finite) overflow */ + exc.type = OVERFLOW; + exc.name = "lgamma"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = HUGE; + else + exc.retval = HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 15: + /* lgamma(-integer) or lgamma(0) */ + exc.type = SING; + exc.name = "lgamma"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = HUGE; + else + exc.retval = HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("lgamma: SING error\n", 19); + } + errno = EDOM; + } + break; + case 16: + /* log(0) */ + exc.type = SING; + exc.name = "log"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("log: SING error\n", 16); + } + errno = EDOM; + } + break; + case 17: + /* log(x<0) */ + exc.type = DOMAIN; + exc.name = "log"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("log: DOMAIN error\n", 18); + } + errno = EDOM; + } + break; + case 18: + /* log10(0) */ + exc.type = SING; + exc.name = "log10"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("log10: SING error\n", 18); + } + errno = EDOM; + } + break; + case 19: + /* log10(x<0) */ + exc.type = DOMAIN; + exc.name = "log10"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = -HUGE; + else + exc.retval = -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("log10: DOMAIN error\n", 20); + } + errno = EDOM; + } + break; + case 20: + /* pow(0.0,0.0) */ + /* error only if cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID */ + exc.type = DOMAIN; + exc.name = "pow"; + exc.retval = zero; + if (cyg_libm_get_compat_mode() != CYGNUM_LIBM_COMPAT_SVID) exc.retval = 1.0; + else if (!matherr(&exc)) { + (void) WRITE2("pow(0,0): DOMAIN error\n", 23); + errno = EDOM; + } + break; + case 21: + /* pow(x,y) overflow */ + exc.type = OVERFLOW; + exc.name = "pow"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + exc.retval = HUGE; + y *= 0.5; + if(xzero) ? HUGE : -HUGE); + else + exc.retval = ( (x>zero) ? HUGE_VAL : -HUGE_VAL); + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 26: + /* sqrt(x<0) */ + exc.type = DOMAIN; + exc.name = "sqrt"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = zero; + else + exc.retval = zero/zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("sqrt: DOMAIN error\n", 19); + } + errno = EDOM; + } + break; + case 27: + /* fmod(x,0) */ + exc.type = DOMAIN; + exc.name = "fmod"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = x; + else + exc.retval = zero/zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("fmod: DOMAIN error\n", 20); + } + errno = EDOM; + } + break; + case 28: + /* remainder(x,0) */ + exc.type = DOMAIN; + exc.name = "remainder"; + exc.retval = zero/zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("remainder: DOMAIN error\n", 24); + } + errno = EDOM; + } + break; + case 29: + /* acosh(x<1) */ + exc.type = DOMAIN; + exc.name = "acosh"; + exc.retval = zero/zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("acosh: DOMAIN error\n", 20); + } + errno = EDOM; + } + break; + case 30: + /* atanh(|x|>1) */ + exc.type = DOMAIN; + exc.name = "atanh"; + exc.retval = zero/zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("atanh: DOMAIN error\n", 20); + } + errno = EDOM; + } + break; + case 31: + /* atanh(|x|=1) */ + exc.type = SING; + exc.name = "atanh"; + exc.retval = x/zero; /* sign(x)*inf */ + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("atanh: SING error\n", 18); + } + errno = EDOM; + } + break; + case 32: + /* scalb overflow; SVID also returns +-HUGE_VAL */ + exc.type = OVERFLOW; + exc.name = "scalb"; + exc.retval = x > zero ? HUGE_VAL : -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 33: + /* scalb underflow */ + exc.type = UNDERFLOW; + exc.name = "scalb"; + exc.retval = copysign(zero,x); + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 34: + /* j0(|x|>X_TLOSS) */ + exc.type = TLOSS; + exc.name = "j0"; + exc.retval = zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2(exc.name, 2); + (void) WRITE2(": TLOSS error\n", 14); + } + errno = ERANGE; + } + break; + case 35: + /* y0(x>X_TLOSS) */ + exc.type = TLOSS; + exc.name = "y0"; + exc.retval = zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2(exc.name, 2); + (void) WRITE2(": TLOSS error\n", 14); + } + errno = ERANGE; + } + break; + case 36: + /* j1(|x|>X_TLOSS) */ + exc.type = TLOSS; + exc.name = "j1"; + exc.retval = zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2(exc.name, 2); + (void) WRITE2(": TLOSS error\n", 14); + } + errno = ERANGE; + } + break; + case 37: + /* y1(x>X_TLOSS) */ + exc.type = TLOSS; + exc.name = "y1"; + exc.retval = zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2(exc.name, 2); + (void) WRITE2(": TLOSS error\n", 14); + } + errno = ERANGE; + } + break; + case 38: + /* jn(|x|>X_TLOSS) */ + exc.type = TLOSS; + exc.name = "jn"; + exc.retval = zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2(exc.name, 2); + (void) WRITE2(": TLOSS error\n", 14); + } + errno = ERANGE; + } + break; + case 39: + /* yn(x>X_TLOSS) */ + exc.type = TLOSS; + exc.name = "yn"; + exc.retval = zero; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2(exc.name, 2); + (void) WRITE2(": TLOSS error\n", 14); + } + errno = ERANGE; + } + break; + case 40: + /* gamma(finite) overflow */ + exc.type = OVERFLOW; + exc.name = "gamma"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = HUGE; + else + exc.retval = HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 41: + /* gamma(-integer) or gamma(0) */ + exc.type = SING; + exc.name = "gamma"; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) + exc.retval = HUGE; + else + exc.retval = HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = EDOM; + else if (!matherr(&exc)) { + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID) { + (void) WRITE2("gamma: SING error\n", 18); + } + errno = EDOM; + } + break; + case 42: + /* pow(NaN,0.0) */ + /* error only if cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_SVID & CYGNUM_LIBM_COMPAT_XOPEN */ + exc.type = DOMAIN; + exc.name = "pow"; + exc.retval = x; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || + cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) exc.retval = 1.0; + else if (!matherr(&exc)) { + errno = EDOM; + } + break; + case 43: + /* ldexp overflow; SVID also returns +-HUGE_VAL */ + exc.type = OVERFLOW; + exc.name = "ldexp"; + exc.retval = x > zero ? HUGE_VAL : -HUGE_VAL; + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + case 44: + /* ldexp underflow */ + exc.type = UNDERFLOW; + exc.name = "ldexp"; + exc.retval = copysign(zero,x); + if (cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_POSIX) + errno = ERANGE; + else if (!matherr(&exc)) { + errno = ERANGE; + } + break; + } + return exc.retval; +} + +#endif // ifdef CYGPKG_LIBM + +// EOF standard.c diff --git a/packages/language/c/libm/current/tests/PKGconf.mak b/packages/language/c/libm/current/tests/PKGconf.mak new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/PKGconf.mak @@ -0,0 +1,42 @@ +#============================================================================= +# +# makefile +# +# language/c/libm/tests +# +#============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================= + +PACKAGE := libm +include ../../../../../pkgconf/pkgconf.mak + +TESTS := vectors/acos vectors/asin vectors/atan vectors/atan2 \ + vectors/ceil vectors/cos vectors/cosh vectors/exp \ + vectors/fabs vectors/floor vectors/fmod vectors/frexp \ + vectors/ldexp vectors/log vectors/log10 vectors/modf \ + vectors/pow vectors/sin vectors/sinh vectors/sqrt \ + vectors/tan vectors/tanh + + +include $(COMPONENT_REPOSITORY)/pkgconf/makrules.tst diff --git a/packages/language/c/libm/current/tests/vectors/acos.c b/packages/language/c/libm/current/tests/vectors/acos.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/acos.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// acos.c +// +// Test of acos() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/acos.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(acos_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &acos, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &acos_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("acos() is stable"); + } // if + else + { + CYG_TEST_FAIL("acos() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library acos() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "acos() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF acos.c diff --git a/packages/language/c/libm/current/tests/vectors/acos.h b/packages/language/c/libm/current/tests/vectors/acos.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/acos.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_ACOS_H +#define CYGONCE_LIBM_ACOS_H +//=========================================================================== +// +// acos.h +// +// Test vectors for testing of acos() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/acos.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define ACOS_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t acos_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 604042796u, 2506787616u, 3214772338u, 2077734866u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 2, 182169888u, 3065862417u, 1106988572u, 4273582707u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 3, 2664755801u, 1226547830u, 1071032732u, 3857964939u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 4, 94291757u, 4010703484u, 1081727025u, 4287567452u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 5, 118911615u, 2977931045u, 1104283808u, 3843658091u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 6, 2656608405u, 3088088668u, 1073408149u, 2318866154u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 7, 263730613u, 2451317798u, 3210911814u, 1038562750u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 8, 580821368u, 2221564313u, 1059115557u, 977275158u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 9, 399687375u, 97950278u, 3204919842u, 1605286142u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 10, 460757591u, 4233776869u, 1087533966u, 1919858904u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 11, 2870376804u, 1472965721u, 3230691143u, 2574511435u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 12, 2882092039u, 1204637550u, 3213143089u, 2421516003u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 13, 3037750340u, 3337705339u, 3238331976u, 3183442542u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 14, 2949649050u, 1086075996u, 1067714579u, 3477152375u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 15, 535591366u, 247024800u, 1040265469u, 3354345619u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 16, 63178737u, 2781269805u, 3188799281u, 3391715197u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 17, 768313194u, 865544864u, 3230216062u, 1200273272u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 18, 591877388u, 3157038143u, 3249401130u, 314151656u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 19, 3219509280u, 1564829925u, 1065671376u, 3088950051u, 1073910026u, 254064179u, 0, ACOS_TOLERANCE, 0}, +{ 20, 141374533u, 3933975298u, 1065991760u, 2304772640u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 21, 2396283075u, 1799495751u, 1094899225u, 1827380665u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 22, 2598153594u, 1112370977u, 1061103890u, 196988907u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 23, 1040851532u, 490122851u, 3216810265u, 576637874u, 1073291771u, 1410328704u, 0, ACOS_TOLERANCE, 0}, +{ 24, 849190915u, 1390621543u, 1055043150u, 915412872u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 25, 488493877u, 2591320551u, 1070339013u, 1237443094u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 26, 3077582663u, 3936235618u, 1099376266u, 1904940295u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 27, 71827124u, 222155510u, 1044902177u, 252085215u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 28, 2583183683u, 4139068910u, 3215004552u, 4245048106u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 29, 32118299u, 168794155u, 1090475726u, 3160414606u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 30, 975557826u, 4157503437u, 1104600163u, 1792103377u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 31, 137283993u, 1382645956u, 3240285101u, 4024164216u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 32, 118046910u, 3480120317u, 1100404348u, 478417819u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 33, 2828521286u, 2549311006u, 1055917530u, 3778440054u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 34, 2530903114u, 1593784258u, 1069213493u, 1951351053u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 35, 3103251986u, 631744430u, 3206072611u, 1047143174u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 36, 722650436u, 1584726864u, 3215417793u, 624695933u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 37, 2434300838u, 705725219u, 3217662205u, 1967294577u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 38, 664091785u, 2952818482u, 3239402263u, 1848641259u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 39, 642185311u, 1370937055u, 1055482637u, 2410810400u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 40, 889092079u, 1330047076u, 1093469262u, 1857263512u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 41, 2562391789u, 1246486570u, 1067165665u, 743938884u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 42, 1013509315u, 3107531809u, 1058433800u, 958446936u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 43, 2379321348u, 1698195744u, 3234826710u, 1808768063u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 44, 223594865u, 2594747457u, 1045397427u, 3927603841u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 45, 2251329048u, 348093397u, 1064733299u, 1710279345u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 46, 3162272236u, 3528946000u, 1045927362u, 1602290403u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 47, 2415703348u, 398813542u, 1052866292u, 1436851684u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 48, 1033199706u, 3319748577u, 3227196113u, 3607301229u, 1073291771u, 1413732247u, 0, ACOS_TOLERANCE, 0}, +{ 49, 23891811u, 2548745907u, 1105253912u, 370162110u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 50, 764517244u, 4204294028u, 3192923960u, 2626702805u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 51, 173888262u, 390319448u, 1104422077u, 120202647u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 52, 2730779741u, 2815627218u, 1099019491u, 731750493u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 53, 864070021u, 3900661840u, 3200970392u, 2907096477u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 54, 842667049u, 4269246624u, 3222902057u, 2762779203u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 55, 2347188326u, 184131949u, 3225314008u, 2237882876u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 56, 2323813472u, 4276663739u, 3254076585u, 4265258845u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 57, 560407162u, 1656691045u, 3252113914u, 4132573504u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 58, 271448936u, 1052817888u, 1061186300u, 352861436u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 59, 2742827957u, 636068836u, 1093702210u, 4149510462u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 60, 3110435514u, 1869774195u, 1056841761u, 2029664212u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 61, 2782135403u, 481356510u, 1098012633u, 1760061418u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 62, 2210852465u, 2918398424u, 1066749948u, 3643952367u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 63, 2255864064u, 3722025458u, 3192516074u, 1732245037u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 64, 984980019u, 1533536108u, 3226159655u, 3412938290u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 65, 2302294008u, 3539403428u, 1044896671u, 2743023547u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 66, 2437282418u, 965485575u, 1074677964u, 2239092099u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 67, 3161462367u, 479602785u, 3245398415u, 1570702137u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 68, 454239397u, 3987656554u, 3201134469u, 2639458165u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 69, 270690192u, 902270460u, 3200236493u, 2060263082u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 70, 3101979469u, 119561873u, 1067242459u, 4238218095u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 71, 342005410u, 1489535917u, 1052674720u, 3229843554u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 72, 2431479818u, 1372780257u, 1087299442u, 2877794600u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 73, 749807578u, 547642046u, 1068507828u, 2261901967u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 74, 2886390034u, 2655610998u, 1063417350u, 3897975437u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 75, 250812866u, 3444039742u, 3204905205u, 72985499u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 76, 2855285209u, 685471642u, 1052893000u, 3994091533u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 77, 438792265u, 3273039144u, 3234242951u, 2105125638u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 78, 2645727074u, 1149591862u, 1079300031u, 2852890893u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 79, 2752966212u, 964007987u, 1089046728u, 3863233156u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 80, 512535166u, 27186676u, 1092292231u, 131338606u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 81, 670177097u, 2614232599u, 3216359929u, 1186945904u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 82, 3154698801u, 1896750851u, 3253696392u, 920368431u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 83, 2442691738u, 29704081u, 3253306050u, 1477489465u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 84, 2226625355u, 1908380994u, 1041152721u, 3015183476u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 85, 681844560u, 470785250u, 3211309660u, 1296080311u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 86, 3173267991u, 3766553196u, 1063117318u, 3703961407u, 1073291771u, 1413754298u, 0, ACOS_TOLERANCE, 0}, +{ 87, 2455017061u, 4149594176u, 1090202405u, 3293225914u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 88, 313616459u, 77747397u, 3224848375u, 1095737976u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 89, 3083383675u, 594138985u, 3217133121u, 1435082240u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 90, 2240663447u, 1803548147u, 3240157452u, 4122845725u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 91, 692524862u, 311336721u, 1045850005u, 536548906u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 92, 39331613u, 1667857221u, 1062792545u, 2329662186u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 93, 2957138228u, 1918705224u, 1059647808u, 2861487662u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 94, 3070750532u, 3709104626u, 3220237199u, 997732637u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 95, 2444448896u, 1774627130u, 3192826790u, 2597228841u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 96, 702397604u, 2705552003u, 1041691115u, 3314033947u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 97, 2530979608u, 820086279u, 1085001393u, 3341643348u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 98, 481329467u, 3136820894u, 1093140313u, 4023285864u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 99, 2613158354u, 443835590u, 3197412883u, 166402802u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 100, 2939403391u, 3572369260u, 3225005050u, 1183942370u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 101, 456836645u, 2446986142u, 1100226690u, 3561788365u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 102, 995574146u, 279968558u, 1056612692u, 605059609u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 103, 2720425755u, 1360758659u, 1045149981u, 3634982365u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 104, 219648965u, 4068690904u, 3212392076u, 3185930294u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 105, 245268713u, 1440185463u, 1067865294u, 2959231845u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 106, 3124081158u, 3352139409u, 3211602972u, 64439686u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 107, 2799322658u, 1508169460u, 3213875925u, 3893561170u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 108, 2966132661u, 146763905u, 1061635587u, 1173102190u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 109, 2950948333u, 2882725208u, 1046547680u, 3137609802u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 110, 281607514u, 2987408195u, 1104831334u, 2360906919u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 111, 583237163u, 2272922429u, 3230247604u, 3220743043u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 112, 2279259017u, 486798710u, 1051847313u, 1164056378u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 113, 2707413568u, 14851197u, 3194383659u, 2622433447u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 114, 2729877535u, 1346176789u, 1059030682u, 1585821890u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 115, 925396515u, 1008663444u, 3253626162u, 1058337847u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 116, 2213579028u, 3506658319u, 3219431539u, 543446309u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 117, 3163196851u, 3413687955u, 1072253426u, 343404215u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 118, 334409439u, 4266232536u, 3240608065u, 4109813813u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 119, 3177753519u, 1144242316u, 1071012025u, 2790944540u, 1073291771u, 1413757294u, 0, ACOS_TOLERANCE, 0}, +{ 120, 2754858880u, 265926617u, 1095794063u, 1345870736u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 121, 49590943u, 3193385121u, 1097323612u, 2009367488u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 122, 2389359641u, 1233370553u, 1064565351u, 322637795u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 123, 954404777u, 3410634251u, 3243916607u, 4042570547u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 124, 2849680709u, 2524001714u, 1072116817u, 3983083207u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 125, 959555327u, 3501343645u, 3237287213u, 1887353658u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 126, 2934409098u, 689800034u, 3246333414u, 2135700283u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 127, 263792941u, 4171919805u, 3238308636u, 3129081398u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 128, 926728083u, 1550999328u, 3219525990u, 2031663879u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 129, 2989628620u, 949669377u, 3226383614u, 3948448651u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 130, 2243494997u, 4293630712u, 1060526636u, 438407499u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 131, 2756107420u, 1535381711u, 1054391309u, 4072415576u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 132, 3025827769u, 1347758084u, 3238820771u, 1059069486u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 133, 3294258u, 3498512759u, 1092903052u, 2047817298u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 134, 2919775476u, 1226560794u, 1069263873u, 685537815u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 135, 982026620u, 4000990876u, 1076297936u, 3803689997u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 136, 499108416u, 2263729518u, 3254424928u, 3450332551u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 137, 347296393u, 1637536851u, 3238793417u, 747232103u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 138, 34763760u, 902498990u, 3205956257u, 245434170u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 139, 3201690145u, 1482770161u, 3244873095u, 2292235133u, 1073291776u, 3469509425u, 0, ACOS_TOLERANCE, 0}, +{ 140, 2990655242u, 36045768u, 1071182448u, 3868790688u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 141, 3083340050u, 1885951730u, 3207806174u, 2553919637u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 142, 2693238911u, 4059459408u, 1055146851u, 2731735627u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 143, 2290935302u, 3819720014u, 3203031655u, 4218515595u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 144, 2348280948u, 3038411370u, 3236511256u, 2472176453u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 145, 2880785553u, 182132862u, 3252592387u, 1793714415u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 146, 2799656331u, 4227997622u, 1087681073u, 3265812129u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 147, 801513493u, 1010183244u, 1091844280u, 675001864u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 148, 318478599u, 4193366103u, 1056610361u, 3831235255u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 149, 2378498000u, 465836562u, 3189131504u, 1330642846u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 150, 43741656u, 1192547728u, 1080448013u, 2251835756u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 151, 172875845u, 2123384287u, 3198090050u, 2528390848u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 152, 911443207u, 3964517760u, 3252496130u, 1755935266u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 153, 844811578u, 2753105123u, 3223721534u, 3995725873u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 154, 151452687u, 777231627u, 1042074674u, 36182517u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 155, 3158956730u, 3937520057u, 3230206414u, 1507556284u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 156, 910363913u, 1910829179u, 1052726418u, 90890556u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 157, 3107838682u, 1962827704u, 1080960105u, 1706263669u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 158, 2177675826u, 3863498922u, 1084020789u, 2439263794u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 159, 2909835385u, 2329801749u, 1098707350u, 2852802137u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 160, 2979393160u, 3548991905u, 3213586763u, 3269946829u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 161, 790744031u, 2009174302u, 1097495331u, 312449728u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 162, 2160628293u, 648730712u, 3246307879u, 4265764460u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 163, 1000831562u, 366653268u, 1051541874u, 1478215551u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 164, 2470023790u, 2605647918u, 1042539011u, 969681033u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 165, 2322196276u, 1909222641u, 1092825252u, 3029685419u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 166, 3159166635u, 1128432313u, 3200082887u, 2582838060u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 167, 2525309230u, 546560372u, 1070003814u, 2343707656u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 168, 849110626u, 309618405u, 3246395018u, 3002005209u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 169, 2706804529u, 3151760818u, 3196548461u, 1969485838u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 170, 639469972u, 3667631361u, 3196181592u, 3743448274u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 171, 2658009958u, 3097521578u, 3216630070u, 1141349287u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 172, 918158805u, 3403438584u, 3208257181u, 2221276438u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 173, 2401852086u, 1683102397u, 3250341256u, 108768173u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 174, 2343899229u, 564813835u, 1064153550u, 3058531228u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 175, 2813220880u, 131949913u, 1090262840u, 2146798879u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 176, 2465897203u, 1934391255u, 3188783235u, 1341236714u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 177, 1070130951u, 418478585u, 3248733961u, 5029000u, 1073086461u, 494572026u, 0, ACOS_TOLERANCE, 0}, +{ 178, 453997460u, 2676092597u, 1105486693u, 1833595891u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 179, 522042376u, 1030769844u, 1071155175u, 2766628533u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 180, 2635141434u, 1153943376u, 3209762784u, 953839852u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 181, 1029467775u, 143071571u, 1050966579u, 2318822594u, 1073291771u, 1413752317u, 0, ACOS_TOLERANCE, 0}, +{ 182, 287910954u, 1347533411u, 3242337825u, 3256720041u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 183, 444067826u, 1840809642u, 1105293543u, 639604076u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 184, 37282545u, 113530717u, 3194758036u, 699784099u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 185, 435549826u, 2950098243u, 1061587493u, 3565445501u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 186, 2385974507u, 2103316697u, 1076082218u, 4043789060u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 187, 811546601u, 1521715421u, 3251785075u, 651105558u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 188, 491306771u, 2545467538u, 3213898932u, 3889824094u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 189, 503065027u, 4133138143u, 3246676260u, 2160225215u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 190, 994621531u, 836655570u, 3245194924u, 2865254908u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 191, 2309344440u, 1678396836u, 3226762726u, 424413376u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 192, 2164934365u, 2155776900u, 3222643433u, 2889736031u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 193, 3003862757u, 33676353u, 1090754016u, 4128530794u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 194, 2386204171u, 3176672093u, 1052578754u, 2282864811u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 195, 446288958u, 2747259961u, 1103923331u, 1909074501u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 196, 3119895314u, 482497137u, 3223384022u, 3259766501u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 197, 2460401984u, 1710626079u, 3222593534u, 834878686u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 198, 3041977808u, 4271421721u, 1047020885u, 1742757458u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 199, 2215391645u, 1265459564u, 1080678447u, 685348463u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 200, 2688170568u, 4066044320u, 1054128905u, 376413109u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 201, 716821218u, 3237497681u, 3242751645u, 260260645u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 202, 2385659123u, 2882820086u, 1085407846u, 2301658312u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 203, 420514989u, 3656359254u, 3203021744u, 2817965308u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 204, 2841879402u, 2859722465u, 3197490752u, 3892072777u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 205, 2665431021u, 2538156443u, 3215734057u, 831239754u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 206, 953028035u, 3071308141u, 3231671892u, 30345936u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 207, 2210978501u, 3595439756u, 3214985609u, 739408315u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 208, 3029757061u, 3298589427u, 3196131526u, 2084665197u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 209, 2823345962u, 3955601456u, 1076543910u, 3304852042u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 210, 640515933u, 2419975459u, 1073769087u, 1988016581u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 211, 2453833475u, 2659973204u, 3216007439u, 2731594173u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 212, 697318369u, 3938264868u, 1062532020u, 2975148216u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 213, 225366869u, 453215326u, 3200044385u, 467903731u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 214, 499614828u, 372130653u, 3235313361u, 3772501596u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 215, 2298173054u, 2406734491u, 1099766912u, 3221574013u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 216, 211434314u, 2841672781u, 3228298587u, 2623399873u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 217, 2562278951u, 2034292219u, 3248774822u, 699680428u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 218, 1030621435u, 1386943632u, 1088782030u, 3724905992u, 1073291771u, 1413750292u, 0, ACOS_TOLERANCE, 0}, +{ 219, 217306301u, 1495300013u, 3240548807u, 1518804038u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 220, 362076244u, 3050489517u, 1049468975u, 2940604216u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 221, 516072020u, 387594449u, 3238538261u, 3010872301u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 222, 2417270868u, 1683571756u, 1098214271u, 3243467912u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 223, 2453871840u, 547789874u, 1074621795u, 671680995u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 224, 819681449u, 2315535361u, 1076278343u, 3851723081u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 225, 925396663u, 2690952636u, 3195785827u, 1648844317u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 226, 835916575u, 2105507379u, 1060210356u, 2061848524u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 227, 2882329693u, 1771437899u, 1102743884u, 4195142780u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 228, 547945591u, 1310074754u, 1072476006u, 1313198415u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 229, 979656894u, 3914592621u, 3228159980u, 2457917034u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 230, 2718226491u, 2240965174u, 3236288087u, 3605857252u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 231, 41761399u, 196714912u, 1054040628u, 3084755276u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 232, 2665587864u, 2058851477u, 1052873711u, 1233598120u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 233, 101299669u, 1909994277u, 3220384775u, 2863812374u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 234, 532015965u, 3697551156u, 1083211400u, 2869735287u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 235, 2830857894u, 2697221770u, 1092525956u, 2160271449u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 236, 230734239u, 2762796844u, 1059257507u, 3160137573u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 237, 247044829u, 1758968847u, 1101109420u, 3270770898u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 238, 73012604u, 4005141897u, 3216213297u, 4129052985u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 239, 2970233606u, 137758261u, 1060349030u, 3082136857u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 240, 1068792039u, 2371653203u, 3211892131u, 3951914469u, 1073207827u, 951674575u, 0, ACOS_TOLERANCE, 0}, +{ 241, 3109437504u, 3213595557u, 1043958672u, 2986160931u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 242, 575927156u, 2540046258u, 3208370548u, 2048583911u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 243, 546830286u, 2264504930u, 3228769528u, 1854181735u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 244, 2183016286u, 3809768956u, 1054933586u, 595351688u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 245, 723947614u, 3071069520u, 3207129696u, 3120974660u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 246, 945283056u, 1952618732u, 3236532520u, 1540955277u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 247, 747620529u, 1438803217u, 1049266525u, 957676449u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 248, 92767291u, 4222295662u, 1076131984u, 2183319069u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 249, 334611718u, 3887074118u, 3191649564u, 3233378721u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 250, 771768198u, 2099099488u, 3222430705u, 2071674991u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 251, 2409204087u, 2295269094u, 3196265320u, 3987032629u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 252, 2377503648u, 4200095882u, 1086809994u, 1339996745u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 253, 797809565u, 2431996507u, 1102017594u, 242934189u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 254, 2312749311u, 2330084417u, 1043172813u, 4043102110u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 255, 988771849u, 1106978707u, 1082509751u, 2520765777u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 256, 864960887u, 3192168224u, 1066340820u, 3603945646u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 257, 2589695756u, 1952396835u, 3199434577u, 3703639356u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 258, 320682810u, 1198219673u, 3230438668u, 2418060633u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 259, 551093026u, 2638353760u, 1093840413u, 1751560711u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 260, 540797521u, 180987057u, 1085420898u, 530063370u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 261, 2760303516u, 3179145654u, 1048020008u, 3061407249u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 262, 162525363u, 1884787302u, 1068713554u, 1737020797u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 263, 214216231u, 3459566012u, 3251200938u, 4126298722u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 264, 2764328342u, 1036370112u, 3235918644u, 3898933279u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 265, 653867113u, 3276084832u, 3189072211u, 1864601262u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 266, 298324788u, 263075055u, 1100754245u, 1667825741u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 267, 3015536039u, 2387220960u, 3253010819u, 3505575323u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 268, 642739166u, 3154304623u, 1063475914u, 3150741666u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 269, 332025563u, 4200269406u, 3194288972u, 3577694711u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 270, 2339885777u, 2064011737u, 1089860833u, 3657008595u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 271, 842190281u, 210665237u, 3197168874u, 510714829u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 272, 728283504u, 1589701259u, 3251310843u, 17001602u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 273, 975043445u, 2928317152u, 3246958541u, 122162205u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 274, 3101610657u, 1288582346u, 1071556960u, 4177188454u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 275, 151289169u, 3962848462u, 3243017171u, 3661038757u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 276, 2755192415u, 2162985241u, 3226640955u, 1639319068u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 277, 2942384609u, 1996676305u, 1099130747u, 3840380763u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 278, 134315769u, 550040067u, 3241901241u, 3372594924u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 279, 3137373248u, 3164451169u, 1076627605u, 317246751u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 280, 2423768299u, 784217153u, 1066058157u, 1225003160u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 281, 2378706924u, 1715871558u, 1101460352u, 3401958038u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 282, 363631767u, 4086269531u, 1102279679u, 2517481591u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 283, 2329360168u, 2624677381u, 1085107111u, 1970804718u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 284, 1010793546u, 3379532114u, 3249898830u, 3723025783u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 285, 999588552u, 2651435439u, 3229039621u, 1030985387u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 286, 3145033808u, 1199535056u, 1077836259u, 3604666660u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 287, 2548507371u, 3115209742u, 3237451386u, 3863935859u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 288, 2398143146u, 4209496277u, 3199416183u, 1216202995u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 289, 614398964u, 2544695332u, 3210577461u, 596332114u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 290, 514278395u, 1338323803u, 1041925718u, 99526924u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 291, 856573491u, 3149653097u, 1103058665u, 2483495776u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 292, 2339743312u, 280536835u, 1044395245u, 3715707641u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 293, 128894757u, 3670016377u, 1050809029u, 3775007802u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 294, 3109073100u, 3526859225u, 3222673081u, 4030462447u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 295, 640779949u, 1602527268u, 3242467576u, 2018361566u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 296, 957271688u, 3985805054u, 1088518381u, 1679321540u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 297, 2801498828u, 1663896708u, 3248819198u, 4229852270u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 298, 467728155u, 2346627527u, 3239438934u, 2290493820u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 299, 2208629720u, 2296736794u, 3207683799u, 1456667044u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 300, 2958022504u, 4132454009u, 1106540396u, 4243490703u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 301, 235395447u, 1359445676u, 3190130903u, 1569883678u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 302, 277859320u, 333214083u, 1076552006u, 1385185236u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 303, 2942645471u, 950097945u, 1041232546u, 3621700966u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 304, 370898672u, 149336372u, 3191764868u, 2940199511u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 305, 2384610875u, 2875684421u, 3249377056u, 4253432396u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 306, 837504978u, 2081484836u, 3199314748u, 2264912911u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 307, 632882934u, 3967859615u, 3229710481u, 2667348142u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 308, 2181979516u, 3630082248u, 3227364534u, 4156569147u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 309, 946956756u, 2993509124u, 1091331299u, 4018898246u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 310, 338207615u, 1642285349u, 3208379731u, 1196091123u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 311, 4693283u, 3356597889u, 1040231079u, 2420753479u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 312, 2762118529u, 977967943u, 3228887283u, 807395730u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 313, 2919435607u, 2730725979u, 3207120390u, 3867917386u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 314, 999294480u, 3504746045u, 1075794770u, 665882260u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 315, 2269075155u, 3385464702u, 1049896268u, 2757059958u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 316, 536095951u, 1299923384u, 1101872081u, 2574386817u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 317, 2675071145u, 3171042375u, 1078533152u, 2312086600u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 318, 2360735442u, 4236561530u, 1068042271u, 256515531u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 319, 2609926553u, 4152554926u, 1100304772u, 3545562886u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 320, 2403546570u, 350924105u, 1040286251u, 1468770658u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 321, 544551146u, 3000822699u, 3232925779u, 2540988650u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 322, 2780107631u, 2928199244u, 3245167989u, 44275991u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 323, 2165210001u, 1174874204u, 1057110584u, 848081004u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 324, 2354568060u, 1412948540u, 3239110676u, 3215002775u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 325, 863277892u, 2701562677u, 1065879622u, 2897481417u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 326, 199312991u, 2980401690u, 3216742908u, 2549609731u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 327, 2827983212u, 585456984u, 3201746087u, 638714580u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 328, 575008531u, 4260896505u, 1089137884u, 4274648992u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 329, 2728904219u, 4055046173u, 3198391736u, 3482894513u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 330, 341009704u, 2493198836u, 3198094528u, 2484800635u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 331, 3153287889u, 599921010u, 1103847606u, 1674254897u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 332, 104926329u, 217148561u, 1097066495u, 3536010689u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 333, 933395812u, 1605519917u, 3225218243u, 2732577078u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 334, 573219110u, 417261654u, 3246267157u, 3401343872u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 335, 1039272770u, 2150330697u, 1080405602u, 3197535445u, 1073291771u, 1412571606u, 0, ACOS_TOLERANCE, 0}, +{ 336, 1065739247u, 2334624779u, 1070288136u, 147709079u, 1073280563u, 1049296574u, 0, ACOS_TOLERANCE, 0}, +{ 337, 3178645135u, 665848401u, 3235013045u, 2195099382u, 1073291771u, 1413759839u, 0, ACOS_TOLERANCE, 0}, +{ 338, 364316788u, 238721142u, 3238780023u, 2612316049u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 339, 2974180417u, 328119069u, 3231550903u, 696220816u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 340, 649641437u, 2886210843u, 1055433962u, 3331415058u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 341, 335135121u, 2420250111u, 3214614526u, 510850312u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 342, 2216193203u, 1658541647u, 1071956366u, 53496813u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 343, 2567194005u, 3872563165u, 1098494887u, 2790313039u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 344, 3219733872u, 3859621368u, 3205775949u, 4015749711u, 1073993256u, 2063983841u, 0, ACOS_TOLERANCE, 0}, +{ 345, 311334852u, 1732769560u, 1052132915u, 2774541952u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 346, 317917675u, 1689088021u, 1066883290u, 3270546122u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 347, 491335395u, 1959705843u, 1106618962u, 4198868105u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 348, 124503353u, 3906315805u, 3235289682u, 1109820549u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 349, 3036818075u, 3370448446u, 1063890856u, 4022784584u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 350, 323334929u, 3264056381u, 1104622566u, 3697934821u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 351, 82666680u, 2912871781u, 3242116859u, 1560571600u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 352, 2776916990u, 3103325650u, 3237224234u, 3681651958u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 353, 333678608u, 3330581237u, 1086856468u, 3110345659u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 354, 2487169180u, 2478706589u, 1099546513u, 4177071445u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 355, 3183204741u, 3514067221u, 3247338343u, 585148435u, 1073291771u, 1413868209u, 0, ACOS_TOLERANCE, 0}, +{ 356, 2811486197u, 3689342853u, 3208758774u, 200507809u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 357, 3116462959u, 1049872171u, 3210445232u, 1453705582u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 358, 3129943472u, 1932668626u, 1098808013u, 1044068983u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 359, 2295964401u, 4093388677u, 3210795947u, 1617393713u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 360, 2293016564u, 778812087u, 3246232571u, 731905539u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 361, 2907822649u, 4050829759u, 1086605180u, 1863848117u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 362, 6647363u, 718161191u, 1071063889u, 2637291484u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 363, 224521970u, 1909842364u, 1102747575u, 3614304657u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 364, 761500166u, 895493977u, 3236485375u, 1701194116u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 365, 2171563276u, 1493115846u, 3233339987u, 296022762u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 366, 2783624899u, 4099447408u, 3187790416u, 3564720305u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 367, 848425142u, 2404172709u, 3219922640u, 2284484846u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 368, 2654315895u, 3240896015u, 3208621510u, 1226668421u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 369, 2488218361u, 4127752456u, 3200753143u, 2161953369u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 370, 489605006u, 1168774591u, 3191311819u, 2375467787u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 371, 347845914u, 2883145553u, 3234998320u, 3286468014u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 372, 2588007471u, 3007671464u, 1102234703u, 1209628408u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 373, 127334109u, 571692916u, 3243349276u, 1910625797u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 374, 524138712u, 2510184860u, 1089525631u, 2209639467u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 375, 2615466346u, 1945605229u, 3227105252u, 3777119615u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 376, 398493829u, 215226593u, 3235434773u, 224271737u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 377, 2242993828u, 2134662911u, 1080232319u, 1056746021u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 378, 2923358085u, 1099524039u, 1085032107u, 3905384073u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 379, 842579915u, 985866260u, 3225437419u, 3120783698u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 380, 2589795066u, 1700432859u, 3230345428u, 3505263023u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 381, 2297683903u, 953966053u, 1090810641u, 151959421u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 382, 2887420078u, 1520016810u, 1096148013u, 1974161688u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 383, 2738297064u, 1577726432u, 1080717542u, 3407236142u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 384, 3154840433u, 358621181u, 3214344145u, 3735144364u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 385, 2521491907u, 4023613376u, 1095386964u, 959640601u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 386, 2369008919u, 4136915018u, 1042238319u, 1264360404u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 387, 2906418341u, 3543839161u, 1093859356u, 2852227162u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 388, 2218509603u, 2154399659u, 3218171985u, 2610173674u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 389, 165687034u, 2502718011u, 1105407582u, 4037997673u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 390, 3034344010u, 2429891750u, 3220651893u, 3433646170u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 391, 397029567u, 1233242847u, 3233842223u, 1978947905u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 392, 32753845u, 3055512924u, 1085895689u, 2569766862u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 393, 498004465u, 3103627383u, 1075642950u, 676014010u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 394, 2622487710u, 3587249671u, 1050343198u, 2034180320u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 395, 2559467693u, 1175750283u, 3228052153u, 441772035u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 396, 639279177u, 1096886368u, 1067186387u, 4256284279u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 397, 208471934u, 2746455711u, 3243186220u, 383175406u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 398, 2829822244u, 1056466374u, 3247450556u, 3263564076u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 399, 2468230336u, 1734210936u, 3195265560u, 514072505u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 400, 758811245u, 1728341051u, 1092832248u, 3823410158u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 401, 2347191449u, 1235712656u, 3219475794u, 3622129011u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 402, 79742765u, 1575194991u, 3197615492u, 3446988115u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 403, 2161423950u, 2362441752u, 1088255327u, 270039934u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 404, 3010727959u, 3063626339u, 1105039555u, 1845818221u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 405, 192788472u, 3718151518u, 3240183167u, 3113149567u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 406, 313112913u, 3686096237u, 3199484638u, 191185038u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 407, 195422631u, 3680158556u, 1105637038u, 349436087u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 408, 2844026099u, 150975354u, 1100107824u, 729077351u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 409, 3016106050u, 2974566906u, 1091481543u, 195479384u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 410, 2820952232u, 953930448u, 3232752339u, 1009878771u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 411, 179600265u, 3369386607u, 1057414346u, 1319431804u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 412, 586131522u, 3279403983u, 3223631624u, 3404608264u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 413, 937427869u, 559918757u, 1105263000u, 1026957442u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 414, 128542208u, 2658716822u, 1104708872u, 996387212u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 415, 2731512332u, 3244026687u, 1047704829u, 2987820261u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 416, 829571115u, 1205633467u, 3212336151u, 731560768u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 417, 2850353849u, 3269211356u, 3233229218u, 2632041754u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 418, 1070113635u, 1007200508u, 1086406456u, 1484610595u, 1073088667u, 1300367880u, 0, ACOS_TOLERANCE, 0}, +{ 419, 968866968u, 3805991624u, 1101562011u, 3292762908u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 420, 2437809818u, 3314105762u, 3211254740u, 3489200637u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 421, 2571363594u, 3198252706u, 3200980182u, 558779875u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 422, 2377866012u, 2338464653u, 1083319346u, 4167405697u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 423, 2919015115u, 2320792999u, 3245310028u, 2734025087u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 424, 2318992495u, 832495279u, 3189857572u, 919851193u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 425, 3116721767u, 594640291u, 1077503330u, 976536412u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 426, 3139145310u, 79400523u, 3241084263u, 3353474633u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 427, 3132785785u, 1078965987u, 3233772596u, 3496966466u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 428, 892587941u, 4243435186u, 1078663150u, 2446827483u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 429, 644490711u, 699817447u, 1081268534u, 2111588814u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 430, 536635513u, 177265199u, 3233855943u, 965677531u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 431, 624474831u, 3957229084u, 1065403841u, 3870961932u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 432, 2495519163u, 2768873929u, 3212244708u, 4127917680u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 433, 445621604u, 3639227340u, 1068863190u, 4192848976u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 434, 2543806408u, 2824651320u, 1092946600u, 2150743372u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 435, 417715333u, 1542109195u, 3223841580u, 2386809036u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 436, 192029360u, 1374810628u, 3218415587u, 1623455911u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 437, 733790955u, 226433601u, 1048463914u, 2667067819u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 438, 768579443u, 1339325351u, 1074062507u, 701901582u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 439, 2920705365u, 3631553324u, 1068350633u, 1231934926u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 440, 2933708324u, 603977748u, 1098802865u, 1502493757u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 441, 852954796u, 4255242031u, 1076182326u, 2417637015u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 442, 3089857028u, 3270297477u, 1057486942u, 2885336275u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 443, 2809553007u, 1162164397u, 3250508564u, 2047944882u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 444, 2875372587u, 129658419u, 3243244851u, 817360375u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 445, 286421081u, 4166988101u, 3246796270u, 1780823036u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 446, 668574270u, 418009120u, 1081026514u, 909013508u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 447, 3082072506u, 4186670845u, 1073362089u, 2619129420u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 448, 795252317u, 1348987467u, 3217165795u, 4162017137u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 449, 2946795826u, 2808968027u, 1057864611u, 275397670u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 450, 513174607u, 240711581u, 3188571226u, 991292615u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 451, 2439023326u, 1881121353u, 1082366688u, 3029043132u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 452, 192508083u, 4250650421u, 3246612558u, 2498768625u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 453, 3180747941u, 2999983605u, 1096654323u, 2577373394u, 1073291771u, 1413777035u, 0, ACOS_TOLERANCE, 0}, +{ 454, 868314815u, 1300140379u, 3213491585u, 55226854u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 455, 49966445u, 13489454u, 3217461344u, 1447224005u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 456, 2210271568u, 180789028u, 3221481024u, 2263184048u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 457, 2397088667u, 426293588u, 3239818611u, 1789635787u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 458, 302342406u, 1048286093u, 3227133745u, 2920139253u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 459, 540854981u, 287184966u, 1093076159u, 1371882685u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 460, 770805810u, 2474797470u, 1065280366u, 1506889536u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 461, 2555731452u, 345487446u, 1053421486u, 1197157341u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 462, 2628226629u, 515700445u, 3214016873u, 2783826669u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 463, 467959892u, 1025779807u, 3217947229u, 937205825u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 464, 3185898801u, 503864881u, 1076822915u, 2345033570u, 1073291771u, 1414440881u, 0, ACOS_TOLERANCE, 0}, +{ 465, 393896468u, 596014050u, 3250464728u, 3171536734u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 466, 2267420964u, 3948135817u, 3235208235u, 557360557u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 467, 2954074298u, 110029735u, 1081878271u, 658156641u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 468, 566438875u, 2733782773u, 1068148429u, 2141208212u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 469, 2666943954u, 790308557u, 1107048971u, 563615979u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 470, 2405996540u, 2566307075u, 1083723970u, 1428203311u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 471, 2270749356u, 3880424699u, 3236471057u, 2886278126u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 472, 524758414u, 2701977458u, 1043006318u, 4263191658u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 473, 2942114697u, 1360096867u, 3234511235u, 722957892u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 474, 3154505042u, 1993420044u, 1095357710u, 2156133394u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 475, 2461372509u, 3917014693u, 3239137997u, 3218865041u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 476, 2423614376u, 3840388050u, 1044708748u, 3339981792u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 477, 68664930u, 2548196869u, 1075650752u, 2503792874u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 478, 27003265u, 3589631476u, 3235077884u, 2445744426u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 479, 520248228u, 203410210u, 1058974455u, 4258595472u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 480, 191352353u, 3053913996u, 1043884546u, 2757616601u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 481, 2602287836u, 1038998189u, 3205430458u, 3695555540u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 482, 2449136794u, 4118722076u, 1042468417u, 3583005947u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 483, 2166884388u, 1539535238u, 3246934215u, 508708967u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 484, 2298893886u, 1355147861u, 3251354609u, 4133432965u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 485, 826309703u, 1630207738u, 3189562989u, 2643371954u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 486, 1044987158u, 3806259293u, 3242741783u, 15657985u, 1073291771u, 1360824892u, 0, ACOS_TOLERANCE, 0}, +{ 487, 497456897u, 151607638u, 3227697753u, 467630898u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 488, 3017637501u, 1016107066u, 1077142954u, 2195497000u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 489, 2893082164u, 605010161u, 1050995677u, 3081653542u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 490, 469011148u, 4071435209u, 3207925259u, 1894382776u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 491, 2531356920u, 1522707251u, 3218735666u, 1578075186u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 492, 431642664u, 1500392608u, 3190947192u, 3634607405u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 493, 2582144456u, 3646244007u, 3197852749u, 3808681655u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 494, 233126338u, 1821773119u, 1094752155u, 1757234723u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 495, 2765502023u, 3794954283u, 3238755664u, 1209121339u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 496, 2342622984u, 1775878726u, 1096028209u, 221183908u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 497, 231520693u, 615054313u, 1105995987u, 1405024657u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 498, 2401381272u, 2784860416u, 1074009275u, 787419698u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 499, 943699878u, 2079960298u, 1074123223u, 2100091620u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 500, 592542034u, 311050208u, 3211234312u, 806358659u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 501, 554939259u, 898080849u, 1106754706u, 2510882902u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 502, 2949198761u, 2015533813u, 1089275809u, 298982001u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 503, 989540066u, 914741728u, 1092886795u, 464054401u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 504, 2304253208u, 3863739765u, 3214711653u, 3915767823u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 505, 958251880u, 3239739200u, 1104805370u, 2971054003u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 506, 2670649374u, 2491104644u, 3198242303u, 2559304728u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 507, 939123286u, 684435317u, 1055177809u, 2787628393u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 508, 2541359251u, 1636085321u, 1069717586u, 4235233108u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 509, 1044593898u, 202708387u, 3196003256u, 482423661u, 1073291771u, 1373409239u, 0, ACOS_TOLERANCE, 0}, +{ 510, 139626925u, 2518164801u, 3206911657u, 1250530357u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 511, 2850784019u, 3737313137u, 1045922781u, 3136078996u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 512, 2263385372u, 2650572904u, 3215945256u, 2341430700u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 513, 2703884311u, 4279456618u, 1045375126u, 3817511514u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 514, 2332933790u, 1898920133u, 3238856617u, 3322385778u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 515, 628125129u, 769863378u, 3205646293u, 3033900668u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 516, 3150112853u, 2363605017u, 1057042323u, 3607277737u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 517, 453059902u, 2102433536u, 1073687186u, 1772007848u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 518, 3088101403u, 1756195518u, 3225902960u, 1222779056u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 519, 936228020u, 1142293403u, 3242693386u, 741039297u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 520, 1034983355u, 2830408439u, 1041913758u, 3306391490u, 1073291771u, 1413686173u, 0, ACOS_TOLERANCE, 0}, +{ 521, 2352979086u, 2205233857u, 1075419064u, 4008575827u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 522, 445518797u, 2566866389u, 1094655457u, 4036587454u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 523, 311145393u, 1824828952u, 3243078353u, 4292530873u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 524, 2553824191u, 4155068217u, 3207589361u, 3447729183u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 525, 2798856384u, 2756570858u, 1076273685u, 3333057399u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 526, 2550428645u, 1207089191u, 1092166391u, 1769908602u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 527, 554295846u, 859290299u, 1041428225u, 1286082196u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 528, 246159230u, 2207831048u, 1106576697u, 1339163028u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 529, 2239899566u, 1165991857u, 3203879091u, 4174125604u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 530, 182461702u, 2169701868u, 3241819561u, 4227279451u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 531, 2888196098u, 2123622490u, 1052662593u, 2279271809u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 532, 702835388u, 695374285u, 1047701002u, 522745399u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 533, 280094216u, 1510677208u, 1076782817u, 1111322288u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 534, 179077993u, 2623205988u, 1103171923u, 4172761053u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 535, 2177736938u, 4217535562u, 1105411820u, 178360855u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 536, 682463458u, 3302529767u, 3204908280u, 3960051056u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 537, 398729522u, 3128926115u, 3230393394u, 689920399u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 538, 2611898873u, 2975884353u, 1080874032u, 706326922u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 539, 893776139u, 198291836u, 1095644375u, 1686271744u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 540, 2380685920u, 3678973777u, 3196054178u, 2497695971u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 541, 2240996065u, 3714083293u, 3243953714u, 2851269113u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 542, 7542429u, 2117586075u, 1087270529u, 1032855763u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 543, 2223653732u, 3495001046u, 1086693149u, 4162905644u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 544, 2567370325u, 2825204949u, 3197807718u, 3067810875u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 545, 2595670946u, 3719019697u, 1095625346u, 658578931u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 546, 387363057u, 2429869396u, 3239113006u, 3188949762u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 547, 396063874u, 322135328u, 3248332291u, 1527590526u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 548, 2461424020u, 2823164069u, 3201760069u, 602345917u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 549, 654769735u, 720378027u, 1076110022u, 259686655u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 550, 2360883068u, 625961575u, 1060816217u, 2476435835u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 551, 788830837u, 606139429u, 3232916885u, 3326100828u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 552, 3212982376u, 2141060868u, 1067726443u, 252856858u, 1073301100u, 1153746486u, 0, ACOS_TOLERANCE, 0}, +{ 553, 3127084040u, 474202816u, 1089644854u, 1764399210u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 554, 1019198392u, 2947116437u, 1041572001u, 3959708969u, 1073291771u, 1413754134u, 0, ACOS_TOLERANCE, 0}, +{ 555, 3213251752u, 4230614930u, 1056210276u, 3150822221u, 1073303204u, 3762064379u, 0, ACOS_TOLERANCE, 0}, +{ 556, 696157297u, 3263173528u, 1080112083u, 1228319033u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 557, 124362722u, 500312015u, 1063102682u, 2095470952u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 558, 2571317678u, 989529088u, 1056203473u, 3527737002u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 559, 2250338535u, 1703579132u, 3224570219u, 634351649u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 560, 2855421441u, 66133u, 3240749422u, 3515147331u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 561, 2627889255u, 2627336059u, 1089793281u, 1944911728u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 562, 759942356u, 2319970119u, 3249679385u, 445677602u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 563, 2547610355u, 3313890389u, 1096842854u, 754196284u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 564, 2871033704u, 1726998596u, 3210485282u, 4166556675u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 565, 501872914u, 486863841u, 3218994498u, 2509132460u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 566, 1002164234u, 2205707903u, 1085826634u, 3041478081u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 567, 525633549u, 4009409345u, 1040942443u, 2147611409u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 568, 2251207280u, 2036870072u, 1084696514u, 3107506430u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 569, 756690877u, 690866455u, 3226560542u, 2431563109u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 570, 998557361u, 3129862588u, 3198582472u, 2304023232u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 571, 2906016865u, 3579751536u, 3209420505u, 975391569u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 572, 2560287784u, 546279008u, 1081489128u, 2489420520u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 573, 31598644u, 3355765111u, 3194253290u, 994990765u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 574, 2828168124u, 1040855381u, 1043794244u, 3259056345u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 575, 2926398160u, 3002823940u, 1089005277u, 3148403594u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 576, 860472364u, 4135775260u, 1062496213u, 1421204191u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 577, 2375372972u, 1772673503u, 1068413298u, 3250253780u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 578, 2382680286u, 1058735200u, 3198812726u, 2912456147u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 579, 207257772u, 3116809444u, 3228961207u, 1489607764u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 580, 3161255502u, 3193356522u, 1098081503u, 3349879051u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 581, 2263814703u, 3863515794u, 3224248078u, 811645039u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 582, 2558000392u, 257027843u, 3188376713u, 3688710472u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 583, 1047583344u, 1618589681u, 3252953815u, 1796441468u, 1073291771u, 1131003064u, 0, ACOS_TOLERANCE, 0}, +{ 584, 963715447u, 2772711004u, 1068817762u, 1417472413u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 585, 2899022012u, 3229431619u, 1048945392u, 2667359336u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 586, 39332833u, 3031365654u, 3254047221u, 3088152449u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 587, 2400099045u, 1889351944u, 1105391374u, 3778764776u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 588, 2853164987u, 2277852166u, 3203738947u, 1874699830u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 589, 2730925178u, 341842475u, 1075005257u, 146768835u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 590, 2308700527u, 2872887668u, 1084601028u, 2879218577u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 591, 2587566446u, 1935797167u, 1071669036u, 2712989912u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 592, 253790896u, 1441615044u, 1092569414u, 3235243477u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 593, 2246162369u, 3221475559u, 1076923264u, 1614189331u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 594, 883591469u, 1521698692u, 1063187098u, 2905773788u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 595, 578813437u, 1875339612u, 1097776841u, 3512997257u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 596, 313284539u, 1310991474u, 1042232933u, 315006632u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 597, 2187872770u, 400944269u, 1084139528u, 1113187101u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 598, 2196755783u, 4228884820u, 1086244087u, 4239134992u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 599, 625667119u, 3885190346u, 1076394312u, 1081883031u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 600, 102978620u, 1185360438u, 1047721048u, 3255616886u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 601, 253870868u, 3242646057u, 3206743917u, 2797651324u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 602, 2741016991u, 2374818327u, 3200069106u, 409774909u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 603, 541948600u, 129626762u, 3222418776u, 3265842151u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 604, 409023275u, 2563211098u, 3195891786u, 3312029907u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 605, 590108432u, 2326742435u, 1061528026u, 3658027611u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 606, 47946496u, 4130434851u, 1086613209u, 1406937614u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 607, 2203282384u, 694337229u, 1098392210u, 673996985u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 608, 383120483u, 2165782899u, 3201118320u, 755437166u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 609, 2738514249u, 1631447464u, 1073129346u, 1109813769u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 610, 996195808u, 1404490212u, 3191965790u, 388374829u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 611, 621407424u, 1187403069u, 3249235911u, 2333348025u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 612, 2238876819u, 3949359805u, 3217090542u, 278931643u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 613, 122205568u, 3433131795u, 3216075884u, 1048643019u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 614, 378630966u, 2161249988u, 1080050285u, 1886767872u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 615, 2469519430u, 56508471u, 1101093005u, 3134765996u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 616, 2160574759u, 390814486u, 3252597757u, 4155481783u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 617, 244834788u, 2634623473u, 1106605935u, 3462407026u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 618, 3068667858u, 1081553801u, 3212510682u, 3597193645u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 619, 2681145113u, 2712139310u, 1067397110u, 3991830201u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 620, 2469611210u, 1021245839u, 1043439185u, 1476242017u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 621, 605118806u, 3027425274u, 1057959382u, 1693579371u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 622, 723258643u, 890268116u, 3208358957u, 2499328701u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 623, 3012075542u, 2762939960u, 1094140192u, 1946947338u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 624, 2624504981u, 2848774892u, 1043728239u, 1868742480u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 625, 631395565u, 2118639219u, 3208384560u, 392586300u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 626, 3100564519u, 3212404590u, 3227625019u, 2217276325u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 627, 2726525578u, 3155371392u, 1098886483u, 418306480u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 628, 404732165u, 2073105109u, 3222252812u, 4126276047u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 629, 666104043u, 3942715706u, 3225850891u, 2149087853u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 630, 691861022u, 2516919494u, 1054814504u, 3292931762u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 631, 158110000u, 1551415022u, 3207905213u, 640268289u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 632, 3017186687u, 576149615u, 1089986684u, 1988363455u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 633, 2189052396u, 3827250147u, 1092018604u, 3082769758u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 634, 2963530013u, 2640124381u, 3224863391u, 3684597672u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 635, 2674433095u, 3504206450u, 3208001954u, 1486636350u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 636, 172271302u, 3087550224u, 1050189716u, 1104066383u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 637, 2937291508u, 3152457596u, 3248116497u, 1671039260u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 638, 743510680u, 3745833360u, 1104273854u, 220649566u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 639, 455612679u, 3044998553u, 3244012440u, 3016971473u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 640, 2707727413u, 3615317113u, 1060844794u, 880769846u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 641, 91972307u, 663715669u, 1063876456u, 1939925527u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 642, 1031258381u, 3544355485u, 1082114513u, 2610512411u, 1073291771u, 1413748055u, 0, ACOS_TOLERANCE, 0}, +{ 643, 3062260532u, 4072884955u, 1076396408u, 1001273000u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 644, 169240433u, 1808609104u, 3232187528u, 3260138616u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 645, 982018300u, 1018873491u, 3222306114u, 3725685935u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 646, 601770903u, 200987283u, 1044223733u, 3512285706u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 647, 2542854589u, 4073670723u, 1077133533u, 2092229545u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 648, 2434772723u, 1045739827u, 1099698978u, 2401260358u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 649, 513980741u, 4127547980u, 1041823582u, 96012619u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 650, 2244412580u, 685986273u, 3236054528u, 743504842u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 651, 3152410687u, 3762173332u, 3229804761u, 4257281451u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 652, 2398221552u, 883225705u, 1052657715u, 3748197546u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 653, 2914372880u, 1745689276u, 3189483003u, 3144701638u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 654, 584466975u, 1188703132u, 3241765574u, 2567092606u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 655, 3142928545u, 1507281554u, 1093182670u, 3093165197u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 656, 525538133u, 2853215019u, 1102960933u, 4219424176u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 657, 743378254u, 3350157882u, 3218026125u, 3380902958u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 658, 2920865644u, 3965656635u, 1041729367u, 1488955390u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 659, 76342162u, 4066317764u, 3250193636u, 3709306303u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 660, 778187300u, 3648159195u, 1060671775u, 4137599200u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 661, 298140314u, 1730811304u, 3218425255u, 3228251203u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 662, 548008019u, 1112642402u, 1046926075u, 2339033206u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 663, 373953465u, 3920135590u, 1068578082u, 3455242298u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 664, 466000998u, 171021716u, 1104170032u, 643991456u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 665, 2888399469u, 2072550721u, 3230599505u, 973021091u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 666, 50905317u, 2724027649u, 1085564300u, 4142466137u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 667, 143727064u, 2551822580u, 3246069024u, 1987298072u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 668, 890335217u, 3397840241u, 3222713245u, 1041924997u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 669, 2679007644u, 1492572480u, 1050371810u, 2325437597u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 670, 114124970u, 2135762681u, 3203689878u, 3625230590u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 671, 2580021722u, 3462823473u, 1042304476u, 902729486u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 672, 2558456833u, 652173352u, 1093628675u, 363109783u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 673, 2931846653u, 3131010476u, 3195084967u, 2163853087u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 674, 2860857242u, 2962422808u, 3191806742u, 291534500u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 675, 3180910087u, 148717545u, 3227570855u, 1176638793u, 1073291771u, 1413779568u, 0, ACOS_TOLERANCE, 0}, +{ 676, 846507519u, 592218494u, 3236967859u, 3643659929u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 677, 799992724u, 3637018510u, 1096065187u, 2759677467u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 678, 2669496048u, 1394154169u, 3225515010u, 2895919661u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 679, 2888699650u, 2576460670u, 3195138207u, 278693366u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 680, 2397030301u, 3525993125u, 1046206559u, 960482701u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 681, 566728356u, 3623493345u, 3245957327u, 2358092842u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 682, 2920406944u, 1470157513u, 1068598730u, 2360266862u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 683, 287105933u, 2673272949u, 3190126532u, 3307152371u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 684, 2190509100u, 3554040933u, 3243091661u, 1074231128u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 685, 2949859096u, 506000682u, 1099596445u, 3719284608u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 686, 143293603u, 1500851201u, 1079029789u, 395506977u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 687, 2216398316u, 2396922893u, 3215773801u, 3631674284u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 688, 94791165u, 265423085u, 1064366729u, 2757995135u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 689, 2260683291u, 3335726874u, 3204388695u, 1913160810u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 690, 985593981u, 177525642u, 1089544219u, 1163479070u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 691, 1059251204u, 1356562406u, 3218720719u, 3954981400u, 1073291620u, 874618229u, 0, ACOS_TOLERANCE, 0}, +{ 692, 199560954u, 2411049585u, 3200282058u, 4212977532u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 693, 3115392997u, 1969400668u, 1082838033u, 792484989u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 694, 413791550u, 3185069889u, 1102744820u, 1679200952u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 695, 816641623u, 2092563199u, 1077400892u, 3625477257u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 696, 990732070u, 3645477920u, 3233940628u, 730323504u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 697, 2640158643u, 1955024619u, 3229376333u, 3062236193u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 698, 748924276u, 673553144u, 3222681322u, 3821101717u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 699, 872312580u, 2833907590u, 1087265939u, 2570284543u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 700, 531712086u, 2911302424u, 1088378861u, 3400401866u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 701, 541730201u, 552676385u, 1048022712u, 1642148205u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 702, 323876482u, 3259465719u, 1063427827u, 4168942284u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 703, 2757624524u, 757177023u, 3224829944u, 54374532u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 704, 25847614u, 3253287925u, 3239197056u, 3859570507u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 705, 2460961478u, 3154974007u, 1089011136u, 3913013165u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 706, 311234957u, 2785357403u, 1103967007u, 2809598610u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 707, 484603275u, 3644503084u, 1071705136u, 2739219317u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 708, 2578002590u, 3518663743u, 1085926548u, 3708967464u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 709, 3007242152u, 731479478u, 1076236288u, 2805941787u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 710, 2619048947u, 779131141u, 3197589176u, 237706897u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 711, 2641650858u, 2888131473u, 3245067887u, 2007039966u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 712, 878934658u, 2219795442u, 1097959451u, 920385234u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 713, 970070259u, 1786246284u, 3210593296u, 3141517655u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 714, 28474706u, 1268866168u, 1056332378u, 3807437549u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 715, 593283356u, 2441697849u, 1095257734u, 352511160u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 716, 537273837u, 3291810518u, 1078085447u, 381074875u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 717, 466362499u, 387817055u, 3243585398u, 409681933u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 718, 337512666u, 139599181u, 1104463616u, 3501253426u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 719, 152302801u, 1804177501u, 1107025740u, 30866148u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 720, 2982215560u, 793748989u, 1082924614u, 1001569450u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 721, 3089760601u, 959143764u, 1058620462u, 2685722619u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 722, 2594786226u, 1587148467u, 1069298743u, 2465926195u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 723, 932092665u, 2374376082u, 1041131964u, 1275798358u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 724, 3064898943u, 732591095u, 1105513168u, 188500721u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 725, 833576046u, 2203077164u, 1086779764u, 2814822707u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 726, 414881598u, 3478844638u, 1064472491u, 3289144186u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 727, 964227992u, 2435698269u, 3249016304u, 440309030u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 728, 2567296069u, 3788040806u, 3187722224u, 3342255097u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 729, 723295838u, 2455751020u, 1103514973u, 3245053142u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 730, 844693850u, 4056651767u, 3239516201u, 4169582895u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 731, 550385160u, 2093642662u, 1100623425u, 792491672u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 732, 2816313046u, 83889365u, 1087600688u, 1006331335u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 733, 2572367713u, 1140517802u, 3243890765u, 4090711271u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 734, 666576601u, 2418701513u, 3216964687u, 1555649649u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 735, 2251046969u, 1215163489u, 1051353113u, 3503287900u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 736, 3159618610u, 641457589u, 1051716814u, 4121125128u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 737, 401932052u, 321857207u, 3250350790u, 1246006125u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 738, 2953696013u, 120564990u, 1097266968u, 300149226u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 739, 2254220803u, 3244980052u, 1076924215u, 847775621u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 740, 2771951028u, 112839452u, 3212858842u, 1569943525u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 741, 2165404842u, 2934678057u, 3212657738u, 3091042797u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 742, 2704093164u, 547060795u, 1079752403u, 4043827022u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 743, 244578012u, 1790462845u, 1067969586u, 2345441039u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 744, 2182959566u, 2353653565u, 1049624664u, 882286568u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 745, 462586144u, 1186302263u, 1078662178u, 2626148789u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 746, 279527707u, 4121656076u, 3224287260u, 1299277508u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 747, 470047975u, 2010385858u, 3233120941u, 4186702461u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 748, 2221693080u, 1323708810u, 3211281520u, 1640799315u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 749, 3124323904u, 3503897938u, 3210262651u, 258643165u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 750, 2619485313u, 2959074653u, 1058897059u, 4239182527u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 751, 302551175u, 153547307u, 1099812861u, 3156123094u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 752, 420210788u, 3996883503u, 1071341265u, 72657681u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 753, 158488136u, 1698212750u, 1068334402u, 160302703u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 754, 289138234u, 2257686389u, 1051856116u, 430357614u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 755, 2795510903u, 395145384u, 1046317717u, 1912800227u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 756, 935515004u, 674021561u, 3222496667u, 743247292u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 757, 2822969173u, 1075007837u, 3222487779u, 639284837u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 758, 924678051u, 3492386324u, 3251519349u, 1241408247u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 759, 2881777125u, 3998363272u, 3228147294u, 365769855u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 760, 2662939411u, 4030509561u, 1066028735u, 1163947030u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 761, 564717585u, 1914428658u, 3214617694u, 4147847493u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 762, 993107584u, 2889684117u, 1042972779u, 1225674604u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 763, 750290683u, 273406410u, 3206108502u, 145234164u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 764, 3157290800u, 912384201u, 3237262916u, 3366320623u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 765, 3022814103u, 349339167u, 3197347448u, 3262060258u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 766, 393652178u, 2097272974u, 1064845294u, 1630215394u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 767, 2250994257u, 3355589350u, 3243019072u, 2316123825u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 768, 307759713u, 1457407347u, 1101422760u, 4120356538u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 769, 2168158322u, 3228185359u, 3198251445u, 3743078041u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 770, 880898735u, 1289357713u, 3230160936u, 2794962547u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 771, 903112316u, 1699456459u, 1083794396u, 4195811825u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 772, 129746399u, 1949114369u, 1084908557u, 1325384361u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 773, 709313868u, 3979168763u, 1049036668u, 2542947959u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 774, 776361251u, 676749439u, 3192662415u, 4013712036u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 775, 255079628u, 3701636708u, 1042322101u, 3983171212u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 776, 2885977639u, 3830039616u, 3239465315u, 175489420u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 777, 2871663155u, 2897269792u, 3230650366u, 3102389747u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 778, 515647990u, 582170006u, 1068093936u, 3324264433u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 779, 870187117u, 3574970337u, 1061955111u, 637826033u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 780, 2474474250u, 1733806710u, 3216760526u, 3188307974u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 781, 25157138u, 2296028823u, 1096788400u, 1413568905u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 782, 967771954u, 1627289946u, 1046506286u, 1860326351u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 783, 876029804u, 1139086265u, 3242570406u, 3276908361u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 784, 444923881u, 3323762166u, 3206918506u, 946766885u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 785, 2438959626u, 188768962u, 1088324147u, 4105901663u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 786, 2731858209u, 460037366u, 3227174677u, 2159793181u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 787, 647960579u, 2589781051u, 3243737020u, 107237481u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 788, 342985206u, 3519881651u, 1057272132u, 2685921459u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 789, 620434247u, 1169160155u, 3206674485u, 3139856281u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 790, 1000422649u, 1898254525u, 3196770014u, 2458988443u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 791, 756268268u, 2023065054u, 1050415907u, 4070768353u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 792, 284716157u, 3336260906u, 3237972475u, 3524355405u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 793, 2520138858u, 3298979042u, 3250099033u, 1003322861u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 794, 780415343u, 1629423892u, 1061722650u, 2396420130u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 795, 2512306741u, 1945417606u, 3192839521u, 1585136212u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 796, 2649414854u, 1527139640u, 1076681917u, 4150904895u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 797, 315452952u, 267572666u, 1088475235u, 1517640973u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 798, 948438656u, 1100855041u, 3229298529u, 2451533501u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 799, 2280476280u, 853088805u, 1050931318u, 3551516956u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 800, 927051214u, 1317953425u, 3217154900u, 431061758u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 801, 803065499u, 2317271661u, 1070436470u, 4014139535u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 802, 2766450812u, 3959292396u, 3249638947u, 906232948u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 803, 475259033u, 1939780068u, 3253991906u, 906880052u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 804, 174037547u, 4170524292u, 3237763507u, 4075099457u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 805, 3111709674u, 3520923293u, 1067530616u, 2252399455u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 806, 705974097u, 1097415680u, 1055600706u, 2690540698u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 807, 465450487u, 3086226264u, 3213898048u, 3220232067u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 808, 2906752413u, 2955360278u, 1051258339u, 557182478u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 809, 2407140190u, 186287752u, 1104388811u, 1727111982u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 810, 3170043637u, 4057007843u, 1076281145u, 2008293104u, 1073291771u, 1413754155u, 0, ACOS_TOLERANCE, 0}, +{ 811, 3198834469u, 2741338484u, 3252544447u, 1207037505u, 1073291772u, 654137907u, 0, ACOS_TOLERANCE, 0}, +{ 812, 625923799u, 102938901u, 3218894213u, 3620282197u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 813, 2527426501u, 763746284u, 1060949875u, 80236875u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 814, 3055119358u, 1117970157u, 1084109014u, 939675744u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 815, 1002709241u, 3478694019u, 1105453279u, 2493398454u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 816, 278925941u, 2014323735u, 1096417600u, 1077078168u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 817, 22160783u, 1569149351u, 1091835152u, 3751608506u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 818, 2855839310u, 930375071u, 1084274438u, 1096450032u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 819, 949603377u, 4197396799u, 3220768028u, 3419252837u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 820, 2427096043u, 2553375912u, 3237078043u, 1357572894u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 821, 2946808178u, 703318468u, 3198897773u, 3216391250u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 822, 682409255u, 3167959965u, 1069972300u, 4099039274u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 823, 551957760u, 1199490036u, 1047137152u, 2723130471u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 824, 2635855937u, 933683213u, 3243757155u, 1468458131u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 825, 954259401u, 763829445u, 3190480801u, 1772616584u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 826, 1017324786u, 3416067384u, 1056206159u, 172017902u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 827, 2553315334u, 2799176222u, 1099022088u, 1324575553u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 828, 54501096u, 2237472662u, 3202361378u, 1770080863u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 829, 697886575u, 1509098263u, 3227321831u, 3313535397u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 830, 2834201307u, 1157206501u, 3201667023u, 2771836065u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 831, 2845352423u, 841047693u, 3220229941u, 3851041620u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 832, 2559038255u, 1637635007u, 1096670395u, 363436727u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 833, 895812927u, 544867276u, 3250055151u, 2005291812u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 834, 613660095u, 1577788839u, 3213516258u, 3678234583u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 835, 2787880976u, 3005922702u, 1060624530u, 3900344258u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 836, 369490497u, 4206745890u, 3212325607u, 3363748875u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 837, 547531448u, 2586849496u, 3195881612u, 1817038482u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 838, 2947779739u, 3675119568u, 3217354316u, 1280515099u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 839, 2360207944u, 3785128270u, 3206980957u, 986337114u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 840, 30415045u, 1959045465u, 3205100821u, 2165602568u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 841, 2874345345u, 4164694429u, 3228096442u, 1919088329u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 842, 430207315u, 1381882442u, 3215734246u, 2587666792u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 843, 721933456u, 3295845115u, 1099763106u, 4189733918u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 844, 1020902692u, 528513718u, 3241318094u, 2446416887u, 1073291771u, 1413754130u, 0, ACOS_TOLERANCE, 0}, +{ 845, 23459988u, 2336116589u, 1065985897u, 3314083915u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 846, 666699893u, 3946191348u, 3195771050u, 906783975u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 847, 2277669009u, 1307551746u, 3210796216u, 988905760u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 848, 659686858u, 3690487540u, 1056058539u, 3252665112u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 849, 42479044u, 1832665932u, 1055271260u, 2605540156u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 850, 158726331u, 4095344603u, 3215114657u, 3444794506u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 851, 2383875900u, 1287837711u, 3242597773u, 4213798139u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 852, 3153341967u, 2816125725u, 1059414555u, 1477859711u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 853, 935772631u, 714564399u, 3193282956u, 2533012202u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 854, 626995971u, 3592268374u, 1058283383u, 2901729097u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 855, 793386186u, 3559004137u, 1068514800u, 3160920849u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 856, 292955800u, 691190239u, 3222935981u, 1615104840u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 857, 239139675u, 2475984769u, 1103239897u, 703637359u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 858, 710643921u, 441140946u, 3190536898u, 3492228424u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 859, 161483935u, 3877369975u, 3202400099u, 3215202168u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 860, 2961770699u, 1491180815u, 3239294185u, 1154272588u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 861, 3205774388u, 3583450204u, 1087671320u, 674510731u, 1073291852u, 1159169230u, 0, ACOS_TOLERANCE, 0}, +{ 862, 2732840881u, 3456820098u, 1089546472u, 2907918480u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 863, 685577817u, 81928569u, 1075278180u, 1990416786u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 864, 1038142999u, 1400620994u, 3225378967u, 1180415269u, 1073291771u, 1413203469u, 0, ACOS_TOLERANCE, 0}, +{ 865, 821776812u, 2762887697u, 3211549123u, 335890509u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 866, 3188234303u, 1362922028u, 3190091315u, 3628762502u, 1073291771u, 1416977815u, 0, ACOS_TOLERANCE, 0}, +{ 867, 721900432u, 3813492886u, 3202458179u, 1901070055u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 868, 2869411161u, 242471816u, 1098704131u, 1526904338u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 869, 1027232266u, 671155008u, 1093002146u, 4241764136u, 1073291771u, 1413753715u, 0, ACOS_TOLERANCE, 0}, +{ 870, 2277521859u, 4097248738u, 1056810493u, 578681886u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 871, 277897075u, 2743813242u, 1048038468u, 2228686199u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 872, 2669729433u, 777624847u, 3204357191u, 721009894u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 873, 900729335u, 724757172u, 1074804044u, 1443361721u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 874, 2794978652u, 1829019782u, 1092425225u, 921360204u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 875, 1055573469u, 599714409u, 3252379270u, 4008804686u, 1073291757u, 4048919351u, 0, ACOS_TOLERANCE, 0}, +{ 876, 2335315701u, 1009458928u, 1083845809u, 4245287698u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 877, 407962355u, 1393652229u, 3198335362u, 477976573u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 878, 119992u, 617334033u, 3226883256u, 1392617441u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 879, 2526781811u, 3189972160u, 1058939729u, 1442809487u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 880, 2785887182u, 1497507448u, 3207820115u, 1605709634u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 881, 400505812u, 1497124553u, 1056018407u, 1916183627u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 882, 379250418u, 187810760u, 1045258725u, 2282203450u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 883, 619840292u, 3486351235u, 3238811394u, 4182495542u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 884, 2587166700u, 1845445426u, 1101440582u, 1926724082u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 885, 2208479151u, 3630948001u, 3210436304u, 3757166747u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 886, 156467129u, 2426945694u, 1100551290u, 691736139u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 887, 3176502800u, 648364171u, 1041433075u, 4184885944u, 1073291771u, 1413755518u, 0, ACOS_TOLERANCE, 0}, +{ 888, 1000987303u, 4288583860u, 1088664697u, 2475611219u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 889, 1063779408u, 1032586628u, 1093050016u, 1335820726u, 1073288701u, 721808240u, 0, ACOS_TOLERANCE, 0}, +{ 890, 2203998268u, 1808427032u, 1080779860u, 3408316613u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 891, 2973050448u, 377900895u, 3246382680u, 3547565419u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 892, 2189796743u, 2323627716u, 1059972652u, 2094048557u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 893, 3196853156u, 698816446u, 3234028118u, 1825626029u, 1073291771u, 2356901228u, 0, ACOS_TOLERANCE, 0}, +{ 894, 3053056428u, 4246800079u, 3198693322u, 1124410156u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 895, 418318520u, 2453135589u, 1055899444u, 314708747u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 896, 2903016736u, 3296787864u, 1068197912u, 3000361169u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 897, 3078102424u, 2237367418u, 1089582486u, 4042266354u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 898, 3141633458u, 3484406269u, 3222793392u, 1868977643u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 899, 551079618u, 3353193428u, 1046058481u, 1204175477u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 900, 372140985u, 2936300483u, 3219636923u, 3841711417u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 901, 673975119u, 1967394048u, 1058351548u, 460961975u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 902, 186542430u, 2037284927u, 3201399531u, 2969937827u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 903, 605316943u, 4193097538u, 3187909191u, 3039418420u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 904, 560007813u, 3490045229u, 1095745195u, 4291149159u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 905, 2719344253u, 2428281947u, 3244840847u, 1401325941u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 906, 3086950621u, 2958762056u, 1053682542u, 1079751324u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 907, 2586448231u, 4153073282u, 3242138780u, 2976596113u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 908, 2225350223u, 3033242648u, 3218615502u, 4046734098u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 909, 144835976u, 3784918863u, 3247369913u, 2134568674u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 910, 1037093430u, 2677404300u, 1085544968u, 741961444u, 1073291771u, 1413479051u, 0, ACOS_TOLERANCE, 0}, +{ 911, 3191671070u, 3184472282u, 1092761713u, 2878921656u, 1073291771u, 1444200196u, 0, ACOS_TOLERANCE, 0}, +{ 912, 2174282657u, 3434230759u, 3221702019u, 3917984952u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 913, 2545165920u, 2576188896u, 3242449625u, 1091446541u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 914, 331286912u, 1182911629u, 3252138078u, 370659473u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 915, 2176330507u, 1444733769u, 1073172315u, 1980291498u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 916, 2678247043u, 2360783610u, 3208952465u, 1231254630u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 917, 2305545884u, 3838689849u, 1072879962u, 256746588u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 918, 2902784540u, 3667306355u, 3251214292u, 749864809u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 919, 2604503669u, 507891905u, 1053625983u, 2704533753u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 920, 1030839861u, 3584765547u, 3245124397u, 2257447093u, 1073291771u, 1413749690u, 0, ACOS_TOLERANCE, 0}, +{ 921, 3066547476u, 3315149772u, 1066493112u, 1016007949u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 922, 449363956u, 825363580u, 3232843486u, 209798625u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 923, 835609236u, 3268577204u, 1096097376u, 1911303780u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 924, 2498038993u, 1753975943u, 1042812372u, 3813343580u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 925, 2711382061u, 729612230u, 3214799337u, 998858159u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 926, 362629194u, 436029885u, 1040410334u, 1429955158u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 927, 535596587u, 3221540113u, 1098769124u, 1388898057u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 928, 3182989542u, 324306108u, 3236216574u, 3657300235u, 1073291771u, 1413854759u, 0, ACOS_TOLERANCE, 0}, +{ 929, 2615512563u, 583339032u, 1059119779u, 2312064517u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 930, 1018901539u, 1094068533u, 3243006833u, 3107499181u, 1073291771u, 1413754135u, 0, ACOS_TOLERANCE, 0}, +{ 931, 621064893u, 2330095236u, 1045494806u, 3166363539u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 932, 848850921u, 2922855425u, 1055270013u, 3382352474u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 933, 2636544164u, 2042479846u, 1052493506u, 1108839173u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 934, 14409368u, 3796172167u, 1093571065u, 169360454u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 935, 792852082u, 1860101737u, 1103906352u, 1684270183u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 936, 857946959u, 1478693394u, 1081338739u, 2709296315u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 937, 148167699u, 2960729928u, 1099267383u, 1713640531u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 938, 385577172u, 3119726590u, 1073506160u, 3652712370u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 939, 2345316997u, 2223927344u, 1087592708u, 1855918127u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 940, 283564999u, 1025757067u, 1082898254u, 4130586757u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 941, 248963649u, 1732390968u, 3252871699u, 2342842299u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 942, 968306674u, 284897931u, 3252953804u, 1924892993u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 943, 2792404953u, 3037915642u, 3201314702u, 236884699u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 944, 2786424109u, 2193269825u, 1080777124u, 2443415975u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 945, 519195528u, 875427160u, 3254060908u, 2005185235u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 946, 2834778379u, 1185249950u, 3192573802u, 43728140u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 947, 941414883u, 1968452001u, 3208083074u, 2872106033u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 948, 1058483372u, 1955688296u, 1041438818u, 4288876237u, 1073291678u, 2710722764u, 0, ACOS_TOLERANCE, 0}, +{ 949, 260098041u, 1687624754u, 1047766046u, 3073412424u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 950, 3060253014u, 1209878394u, 1095484022u, 291364597u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 951, 468175369u, 3483008135u, 1104326057u, 3143994227u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 952, 2417131043u, 3223340235u, 1090336173u, 1399132887u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 953, 783617139u, 4188530565u, 1049645776u, 3448942728u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 954, 660957346u, 1627557770u, 1058246656u, 2945931719u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 955, 1018601337u, 3373123648u, 3197792793u, 672208537u, 1073291771u, 1413754135u, 0, ACOS_TOLERANCE, 0}, +{ 956, 408015225u, 3778617114u, 1062846388u, 1358342023u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 957, 410316381u, 2900182547u, 3199310787u, 414812664u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 958, 633591966u, 2464347659u, 3205131467u, 3988778663u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 959, 229808805u, 3135249601u, 1100087621u, 4100875262u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 960, 793399715u, 2358359525u, 1045184735u, 1183252266u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 961, 971564307u, 1400352853u, 3240053853u, 734055542u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 962, 348066411u, 1753967678u, 3224978909u, 1995531974u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 963, 2638555255u, 1500031970u, 3233676488u, 4052958340u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 964, 536164755u, 1866935720u, 3200756597u, 3746696244u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 965, 91363664u, 2978288684u, 1106515721u, 564707827u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 966, 447397583u, 1517077030u, 1044934689u, 4156529635u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 967, 884390674u, 1427263585u, 3247549500u, 559009887u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 968, 709965825u, 427386166u, 3224310223u, 2897984604u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 969, 748422445u, 984833499u, 1086168339u, 3414464869u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 970, 3037316018u, 1275655663u, 1051250192u, 1788042252u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 971, 647298401u, 1752811522u, 1054424401u, 3069200833u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 972, 336691782u, 4159629802u, 3227935989u, 905739373u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 973, 840207318u, 3449457931u, 1053675501u, 651755324u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 974, 588654397u, 824950980u, 1063835328u, 2970166564u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 975, 1002643220u, 3980858800u, 1097889355u, 860102770u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 976, 2925126437u, 3352952738u, 1087086428u, 1202852913u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 977, 3153295755u, 3493096285u, 3210665381u, 1226230602u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 978, 2861370199u, 2237153875u, 1063605905u, 2592496943u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 979, 812704965u, 1204681469u, 1084151922u, 928193012u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 980, 717902981u, 1892558657u, 3188880850u, 472712482u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 981, 206133394u, 1107589453u, 3240016549u, 2840254081u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 982, 645145771u, 1760994629u, 3217094564u, 2931138356u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 983, 2682176516u, 3313118532u, 1095060283u, 1256408484u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 984, 958852249u, 2822240883u, 3191644368u, 1759139386u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 985, 3064303449u, 3148616726u, 3216643810u, 4033784566u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 986, 2672549129u, 50508488u, 3234572856u, 2196737134u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 987, 199760205u, 1739301489u, 1047113374u, 2964036605u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 988, 2742280838u, 32766355u, 1078278376u, 684801414u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 989, 860036812u, 2725458084u, 3197542874u, 3768641510u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 990, 602166919u, 2877639205u, 3248394899u, 2733580401u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 991, 217158246u, 3237117913u, 1086314718u, 1194088701u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 992, 507701220u, 2969027390u, 3254737744u, 2845466153u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 993, 39202927u, 1308825168u, 3231339694u, 1185199746u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 994, 2538930797u, 3429306274u, 3236439133u, 3100989857u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 995, 2251277391u, 4179597430u, 1060231463u, 2735521684u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 996, 863742433u, 1926531024u, 1040565159u, 1724549325u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 997, 344684868u, 1215071411u, 1068384117u, 483238293u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 998, 317818997u, 197061949u, 1043473339u, 249253513u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, +{ 999, 2250299688u, 1410107326u, 3198269248u, 2880209598u, 1073291771u, 1413754136u, 0, ACOS_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_ACOS_H multiple inclusion protection + +// EOF acos.h diff --git a/packages/language/c/libm/current/tests/vectors/asin.c b/packages/language/c/libm/current/tests/vectors/asin.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/asin.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// asin.c +// +// Test of asin() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/asin.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(asin_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &asin, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &asin_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("asin() is stable"); + } // if + else + { + CYG_TEST_FAIL("asin() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library asin() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "asin() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF asin.c diff --git a/packages/language/c/libm/current/tests/vectors/asin.h b/packages/language/c/libm/current/tests/vectors/asin.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/asin.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_ASIN_H +#define CYGONCE_LIBM_ASIN_H +//=========================================================================== +// +// asin.h +// +// Test vectors for testing of asin() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/asin.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define ASIN_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t asin_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 604042796u, 2506787616u, 3214772338u, 2077734866u, 604042796u, 2506787616u, 0, ASIN_TOLERANCE, 0}, +{ 2, 182169888u, 3065862417u, 1106988572u, 4273582707u, 182169888u, 3065862417u, 0, ASIN_TOLERANCE, 0}, +{ 3, 2664755801u, 1226547830u, 1071032732u, 3857964939u, 2664755801u, 1226547830u, 0, ASIN_TOLERANCE, 0}, +{ 4, 94291757u, 4010703484u, 1081727025u, 4287567452u, 94291757u, 4010703484u, 0, ASIN_TOLERANCE, 0}, +{ 5, 118911615u, 2977931045u, 1104283808u, 3843658091u, 118911615u, 2977931045u, 0, ASIN_TOLERANCE, 0}, +{ 6, 2656608405u, 3088088668u, 1073408149u, 2318866154u, 2656608405u, 3088088668u, 0, ASIN_TOLERANCE, 0}, +{ 7, 263730613u, 2451317798u, 3210911814u, 1038562750u, 263730613u, 2451317798u, 0, ASIN_TOLERANCE, 0}, +{ 8, 580821368u, 2221564313u, 1059115557u, 977275158u, 580821368u, 2221564313u, 0, ASIN_TOLERANCE, 0}, +{ 9, 399687375u, 97950278u, 3204919842u, 1605286142u, 399687375u, 97950278u, 0, ASIN_TOLERANCE, 0}, +{ 10, 460757591u, 4233776869u, 1087533966u, 1919858904u, 460757591u, 4233776869u, 0, ASIN_TOLERANCE, 0}, +{ 11, 2870376804u, 1472965721u, 3230691143u, 2574511435u, 2870376804u, 1472965721u, 0, ASIN_TOLERANCE, 0}, +{ 12, 2882092039u, 1204637550u, 3213143089u, 2421516003u, 2882092039u, 1204637550u, 0, ASIN_TOLERANCE, 0}, +{ 13, 3037750340u, 3337705339u, 3238331976u, 3183442542u, 3037750340u, 3337705339u, 0, ASIN_TOLERANCE, 0}, +{ 14, 2949649050u, 1086075996u, 1067714579u, 3477152375u, 2949649050u, 1086075996u, 0, ASIN_TOLERANCE, 0}, +{ 15, 535591366u, 247024800u, 1040265469u, 3354345619u, 535591366u, 247024800u, 0, ASIN_TOLERANCE, 0}, +{ 16, 63178737u, 2781269805u, 3188799281u, 3391715197u, 63178737u, 2781269805u, 0, ASIN_TOLERANCE, 0}, +{ 17, 768313194u, 865544864u, 3230216062u, 1200273272u, 768313194u, 865544864u, 0, ASIN_TOLERANCE, 0}, +{ 18, 591877388u, 3157038143u, 3249401130u, 314151656u, 591877388u, 3157038143u, 0, ASIN_TOLERANCE, 0}, +{ 19, 3219509280u, 1564829925u, 1065671376u, 3088950051u, 3219652657u, 2483715739u, 0, ASIN_TOLERANCE, 0}, +{ 20, 141374533u, 3933975298u, 1065991760u, 2304772640u, 141374533u, 3933975298u, 0, ASIN_TOLERANCE, 0}, +{ 21, 2396283075u, 1799495751u, 1094899225u, 1827380665u, 2396283075u, 1799495751u, 0, ASIN_TOLERANCE, 0}, +{ 22, 2598153594u, 1112370977u, 1061103890u, 196988907u, 2598153594u, 1112370977u, 0, ASIN_TOLERANCE, 0}, +{ 23, 1040851532u, 490122851u, 3216810265u, 576637874u, 1040851532u, 490122851u, 0, ASIN_TOLERANCE, 0}, +{ 24, 849190915u, 1390621543u, 1055043150u, 915412872u, 849190915u, 1390621543u, 0, ASIN_TOLERANCE, 0}, +{ 25, 488493877u, 2591320551u, 1070339013u, 1237443094u, 488493877u, 2591320551u, 0, ASIN_TOLERANCE, 0}, +{ 26, 3077582663u, 3936235618u, 1099376266u, 1904940295u, 3077582663u, 3936235618u, 0, ASIN_TOLERANCE, 0}, +{ 27, 71827124u, 222155510u, 1044902177u, 252085215u, 71827124u, 222155510u, 0, ASIN_TOLERANCE, 0}, +{ 28, 2583183683u, 4139068910u, 3215004552u, 4245048106u, 2583183683u, 4139068910u, 0, ASIN_TOLERANCE, 0}, +{ 29, 32118299u, 168794155u, 1090475726u, 3160414606u, 32118299u, 168794155u, 0, ASIN_TOLERANCE, 0}, +{ 30, 975557826u, 4157503437u, 1104600163u, 1792103377u, 975557826u, 4157503437u, 0, ASIN_TOLERANCE, 0}, +{ 31, 137283993u, 1382645956u, 3240285101u, 4024164216u, 137283993u, 1382645956u, 0, ASIN_TOLERANCE, 0}, +{ 32, 118046910u, 3480120317u, 1100404348u, 478417819u, 118046910u, 3480120317u, 0, ASIN_TOLERANCE, 0}, +{ 33, 2828521286u, 2549311006u, 1055917530u, 3778440054u, 2828521286u, 2549311006u, 0, ASIN_TOLERANCE, 0}, +{ 34, 2530903114u, 1593784258u, 1069213493u, 1951351053u, 2530903114u, 1593784258u, 0, ASIN_TOLERANCE, 0}, +{ 35, 3103251986u, 631744430u, 3206072611u, 1047143174u, 3103251986u, 631744430u, 0, ASIN_TOLERANCE, 0}, +{ 36, 722650436u, 1584726864u, 3215417793u, 624695933u, 722650436u, 1584726864u, 0, ASIN_TOLERANCE, 0}, +{ 37, 2434300838u, 705725219u, 3217662205u, 1967294577u, 2434300838u, 705725219u, 0, ASIN_TOLERANCE, 0}, +{ 38, 664091785u, 2952818482u, 3239402263u, 1848641259u, 664091785u, 2952818482u, 0, ASIN_TOLERANCE, 0}, +{ 39, 642185311u, 1370937055u, 1055482637u, 2410810400u, 642185311u, 1370937055u, 0, ASIN_TOLERANCE, 0}, +{ 40, 889092079u, 1330047076u, 1093469262u, 1857263512u, 889092079u, 1330047076u, 0, ASIN_TOLERANCE, 0}, +{ 41, 2562391789u, 1246486570u, 1067165665u, 743938884u, 2562391789u, 1246486570u, 0, ASIN_TOLERANCE, 0}, +{ 42, 1013509315u, 3107531809u, 1058433800u, 958446936u, 1013509315u, 3107531809u, 0, ASIN_TOLERANCE, 0}, +{ 43, 2379321348u, 1698195744u, 3234826710u, 1808768063u, 2379321348u, 1698195744u, 0, ASIN_TOLERANCE, 0}, +{ 44, 223594865u, 2594747457u, 1045397427u, 3927603841u, 223594865u, 2594747457u, 0, ASIN_TOLERANCE, 0}, +{ 45, 2251329048u, 348093397u, 1064733299u, 1710279345u, 2251329048u, 348093397u, 0, ASIN_TOLERANCE, 0}, +{ 46, 3162272236u, 3528946000u, 1045927362u, 1602290403u, 3162272236u, 3528946000u, 0, ASIN_TOLERANCE, 0}, +{ 47, 2415703348u, 398813542u, 1052866292u, 1436851684u, 2415703348u, 398813542u, 0, ASIN_TOLERANCE, 0}, +{ 48, 1033199706u, 3319748577u, 3227196113u, 3607301229u, 1033199706u, 3319748577u, 0, ASIN_TOLERANCE, 0}, +{ 49, 23891811u, 2548745907u, 1105253912u, 370162110u, 23891811u, 2548745907u, 0, ASIN_TOLERANCE, 0}, +{ 50, 764517244u, 4204294028u, 3192923960u, 2626702805u, 764517244u, 4204294028u, 0, ASIN_TOLERANCE, 0}, +{ 51, 173888262u, 390319448u, 1104422077u, 120202647u, 173888262u, 390319448u, 0, ASIN_TOLERANCE, 0}, +{ 52, 2730779741u, 2815627218u, 1099019491u, 731750493u, 2730779741u, 2815627218u, 0, ASIN_TOLERANCE, 0}, +{ 53, 864070021u, 3900661840u, 3200970392u, 2907096477u, 864070021u, 3900661840u, 0, ASIN_TOLERANCE, 0}, +{ 54, 842667049u, 4269246624u, 3222902057u, 2762779203u, 842667049u, 4269246624u, 0, ASIN_TOLERANCE, 0}, +{ 55, 2347188326u, 184131949u, 3225314008u, 2237882876u, 2347188326u, 184131949u, 0, ASIN_TOLERANCE, 0}, +{ 56, 2323813472u, 4276663739u, 3254076585u, 4265258845u, 2323813472u, 4276663739u, 0, ASIN_TOLERANCE, 0}, +{ 57, 560407162u, 1656691045u, 3252113914u, 4132573504u, 560407162u, 1656691045u, 0, ASIN_TOLERANCE, 0}, +{ 58, 271448936u, 1052817888u, 1061186300u, 352861436u, 271448936u, 1052817888u, 0, ASIN_TOLERANCE, 0}, +{ 59, 2742827957u, 636068836u, 1093702210u, 4149510462u, 2742827957u, 636068836u, 0, ASIN_TOLERANCE, 0}, +{ 60, 3110435514u, 1869774195u, 1056841761u, 2029664212u, 3110435514u, 1869774195u, 0, ASIN_TOLERANCE, 0}, +{ 61, 2782135403u, 481356510u, 1098012633u, 1760061418u, 2782135403u, 481356510u, 0, ASIN_TOLERANCE, 0}, +{ 62, 2210852465u, 2918398424u, 1066749948u, 3643952367u, 2210852465u, 2918398424u, 0, ASIN_TOLERANCE, 0}, +{ 63, 2255864064u, 3722025458u, 3192516074u, 1732245037u, 2255864064u, 3722025458u, 0, ASIN_TOLERANCE, 0}, +{ 64, 984980019u, 1533536108u, 3226159655u, 3412938290u, 984980019u, 1533536108u, 0, ASIN_TOLERANCE, 0}, +{ 65, 2302294008u, 3539403428u, 1044896671u, 2743023547u, 2302294008u, 3539403428u, 0, ASIN_TOLERANCE, 0}, +{ 66, 2437282418u, 965485575u, 1074677964u, 2239092099u, 2437282418u, 965485575u, 0, ASIN_TOLERANCE, 0}, +{ 67, 3161462367u, 479602785u, 3245398415u, 1570702137u, 3161462367u, 479602785u, 0, ASIN_TOLERANCE, 0}, +{ 68, 454239397u, 3987656554u, 3201134469u, 2639458165u, 454239397u, 3987656554u, 0, ASIN_TOLERANCE, 0}, +{ 69, 270690192u, 902270460u, 3200236493u, 2060263082u, 270690192u, 902270460u, 0, ASIN_TOLERANCE, 0}, +{ 70, 3101979469u, 119561873u, 1067242459u, 4238218095u, 3101979469u, 119561873u, 0, ASIN_TOLERANCE, 0}, +{ 71, 342005410u, 1489535917u, 1052674720u, 3229843554u, 342005410u, 1489535917u, 0, ASIN_TOLERANCE, 0}, +{ 72, 2431479818u, 1372780257u, 1087299442u, 2877794600u, 2431479818u, 1372780257u, 0, ASIN_TOLERANCE, 0}, +{ 73, 749807578u, 547642046u, 1068507828u, 2261901967u, 749807578u, 547642046u, 0, ASIN_TOLERANCE, 0}, +{ 74, 2886390034u, 2655610998u, 1063417350u, 3897975437u, 2886390034u, 2655610998u, 0, ASIN_TOLERANCE, 0}, +{ 75, 250812866u, 3444039742u, 3204905205u, 72985499u, 250812866u, 3444039742u, 0, ASIN_TOLERANCE, 0}, +{ 76, 2855285209u, 685471642u, 1052893000u, 3994091533u, 2855285209u, 685471642u, 0, ASIN_TOLERANCE, 0}, +{ 77, 438792265u, 3273039144u, 3234242951u, 2105125638u, 438792265u, 3273039144u, 0, ASIN_TOLERANCE, 0}, +{ 78, 2645727074u, 1149591862u, 1079300031u, 2852890893u, 2645727074u, 1149591862u, 0, ASIN_TOLERANCE, 0}, +{ 79, 2752966212u, 964007987u, 1089046728u, 3863233156u, 2752966212u, 964007987u, 0, ASIN_TOLERANCE, 0}, +{ 80, 512535166u, 27186676u, 1092292231u, 131338606u, 512535166u, 27186676u, 0, ASIN_TOLERANCE, 0}, +{ 81, 670177097u, 2614232599u, 3216359929u, 1186945904u, 670177097u, 2614232599u, 0, ASIN_TOLERANCE, 0}, +{ 82, 3154698801u, 1896750851u, 3253696392u, 920368431u, 3154698801u, 1896750851u, 0, ASIN_TOLERANCE, 0}, +{ 83, 2442691738u, 29704081u, 3253306050u, 1477489465u, 2442691738u, 29704081u, 0, ASIN_TOLERANCE, 0}, +{ 84, 2226625355u, 1908380994u, 1041152721u, 3015183476u, 2226625355u, 1908380994u, 0, ASIN_TOLERANCE, 0}, +{ 85, 681844560u, 470785250u, 3211309660u, 1296080311u, 681844560u, 470785250u, 0, ASIN_TOLERANCE, 0}, +{ 86, 3173267991u, 3766553196u, 1063117318u, 3703961407u, 3173267991u, 3766553196u, 0, ASIN_TOLERANCE, 0}, +{ 87, 2455017061u, 4149594176u, 1090202405u, 3293225914u, 2455017061u, 4149594176u, 0, ASIN_TOLERANCE, 0}, +{ 88, 313616459u, 77747397u, 3224848375u, 1095737976u, 313616459u, 77747397u, 0, ASIN_TOLERANCE, 0}, +{ 89, 3083383675u, 594138985u, 3217133121u, 1435082240u, 3083383675u, 594138985u, 0, ASIN_TOLERANCE, 0}, +{ 90, 2240663447u, 1803548147u, 3240157452u, 4122845725u, 2240663447u, 1803548147u, 0, ASIN_TOLERANCE, 0}, +{ 91, 692524862u, 311336721u, 1045850005u, 536548906u, 692524862u, 311336721u, 0, ASIN_TOLERANCE, 0}, +{ 92, 39331613u, 1667857221u, 1062792545u, 2329662186u, 39331613u, 1667857221u, 0, ASIN_TOLERANCE, 0}, +{ 93, 2957138228u, 1918705224u, 1059647808u, 2861487662u, 2957138228u, 1918705224u, 0, ASIN_TOLERANCE, 0}, +{ 94, 3070750532u, 3709104626u, 3220237199u, 997732637u, 3070750532u, 3709104626u, 0, ASIN_TOLERANCE, 0}, +{ 95, 2444448896u, 1774627130u, 3192826790u, 2597228841u, 2444448896u, 1774627130u, 0, ASIN_TOLERANCE, 0}, +{ 96, 702397604u, 2705552003u, 1041691115u, 3314033947u, 702397604u, 2705552003u, 0, ASIN_TOLERANCE, 0}, +{ 97, 2530979608u, 820086279u, 1085001393u, 3341643348u, 2530979608u, 820086279u, 0, ASIN_TOLERANCE, 0}, +{ 98, 481329467u, 3136820894u, 1093140313u, 4023285864u, 481329467u, 3136820894u, 0, ASIN_TOLERANCE, 0}, +{ 99, 2613158354u, 443835590u, 3197412883u, 166402802u, 2613158354u, 443835590u, 0, ASIN_TOLERANCE, 0}, +{ 100, 2939403391u, 3572369260u, 3225005050u, 1183942370u, 2939403391u, 3572369260u, 0, ASIN_TOLERANCE, 0}, +{ 101, 456836645u, 2446986142u, 1100226690u, 3561788365u, 456836645u, 2446986142u, 0, ASIN_TOLERANCE, 0}, +{ 102, 995574146u, 279968558u, 1056612692u, 605059609u, 995574146u, 279968558u, 0, ASIN_TOLERANCE, 0}, +{ 103, 2720425755u, 1360758659u, 1045149981u, 3634982365u, 2720425755u, 1360758659u, 0, ASIN_TOLERANCE, 0}, +{ 104, 219648965u, 4068690904u, 3212392076u, 3185930294u, 219648965u, 4068690904u, 0, ASIN_TOLERANCE, 0}, +{ 105, 245268713u, 1440185463u, 1067865294u, 2959231845u, 245268713u, 1440185463u, 0, ASIN_TOLERANCE, 0}, +{ 106, 3124081158u, 3352139409u, 3211602972u, 64439686u, 3124081158u, 3352139409u, 0, ASIN_TOLERANCE, 0}, +{ 107, 2799322658u, 1508169460u, 3213875925u, 3893561170u, 2799322658u, 1508169460u, 0, ASIN_TOLERANCE, 0}, +{ 108, 2966132661u, 146763905u, 1061635587u, 1173102190u, 2966132661u, 146763905u, 0, ASIN_TOLERANCE, 0}, +{ 109, 2950948333u, 2882725208u, 1046547680u, 3137609802u, 2950948333u, 2882725208u, 0, ASIN_TOLERANCE, 0}, +{ 110, 281607514u, 2987408195u, 1104831334u, 2360906919u, 281607514u, 2987408195u, 0, ASIN_TOLERANCE, 0}, +{ 111, 583237163u, 2272922429u, 3230247604u, 3220743043u, 583237163u, 2272922429u, 0, ASIN_TOLERANCE, 0}, +{ 112, 2279259017u, 486798710u, 1051847313u, 1164056378u, 2279259017u, 486798710u, 0, ASIN_TOLERANCE, 0}, +{ 113, 2707413568u, 14851197u, 3194383659u, 2622433447u, 2707413568u, 14851197u, 0, ASIN_TOLERANCE, 0}, +{ 114, 2729877535u, 1346176789u, 1059030682u, 1585821890u, 2729877535u, 1346176789u, 0, ASIN_TOLERANCE, 0}, +{ 115, 925396515u, 1008663444u, 3253626162u, 1058337847u, 925396515u, 1008663444u, 0, ASIN_TOLERANCE, 0}, +{ 116, 2213579028u, 3506658319u, 3219431539u, 543446309u, 2213579028u, 3506658319u, 0, ASIN_TOLERANCE, 0}, +{ 117, 3163196851u, 3413687955u, 1072253426u, 343404215u, 3163196851u, 3413687955u, 0, ASIN_TOLERANCE, 0}, +{ 118, 334409439u, 4266232536u, 3240608065u, 4109813813u, 334409439u, 4266232536u, 0, ASIN_TOLERANCE, 0}, +{ 119, 3177753519u, 1144242316u, 1071012025u, 2790944540u, 3177753519u, 1144242316u, 0, ASIN_TOLERANCE, 0}, +{ 120, 2754858880u, 265926617u, 1095794063u, 1345870736u, 2754858880u, 265926617u, 0, ASIN_TOLERANCE, 0}, +{ 121, 49590943u, 3193385121u, 1097323612u, 2009367488u, 49590943u, 3193385121u, 0, ASIN_TOLERANCE, 0}, +{ 122, 2389359641u, 1233370553u, 1064565351u, 322637795u, 2389359641u, 1233370553u, 0, ASIN_TOLERANCE, 0}, +{ 123, 954404777u, 3410634251u, 3243916607u, 4042570547u, 954404777u, 3410634251u, 0, ASIN_TOLERANCE, 0}, +{ 124, 2849680709u, 2524001714u, 1072116817u, 3983083207u, 2849680709u, 2524001714u, 0, ASIN_TOLERANCE, 0}, +{ 125, 959555327u, 3501343645u, 3237287213u, 1887353658u, 959555327u, 3501343645u, 0, ASIN_TOLERANCE, 0}, +{ 126, 2934409098u, 689800034u, 3246333414u, 2135700283u, 2934409098u, 689800034u, 0, ASIN_TOLERANCE, 0}, +{ 127, 263792941u, 4171919805u, 3238308636u, 3129081398u, 263792941u, 4171919805u, 0, ASIN_TOLERANCE, 0}, +{ 128, 926728083u, 1550999328u, 3219525990u, 2031663879u, 926728083u, 1550999328u, 0, ASIN_TOLERANCE, 0}, +{ 129, 2989628620u, 949669377u, 3226383614u, 3948448651u, 2989628620u, 949669377u, 0, ASIN_TOLERANCE, 0}, +{ 130, 2243494997u, 4293630712u, 1060526636u, 438407499u, 2243494997u, 4293630712u, 0, ASIN_TOLERANCE, 0}, +{ 131, 2756107420u, 1535381711u, 1054391309u, 4072415576u, 2756107420u, 1535381711u, 0, ASIN_TOLERANCE, 0}, +{ 132, 3025827769u, 1347758084u, 3238820771u, 1059069486u, 3025827769u, 1347758084u, 0, ASIN_TOLERANCE, 0}, +{ 133, 3294258u, 3498512759u, 1092903052u, 2047817298u, 3294258u, 3498512759u, 0, ASIN_TOLERANCE, 0}, +{ 134, 2919775476u, 1226560794u, 1069263873u, 685537815u, 2919775476u, 1226560794u, 0, ASIN_TOLERANCE, 0}, +{ 135, 982026620u, 4000990876u, 1076297936u, 3803689997u, 982026620u, 4000990876u, 0, ASIN_TOLERANCE, 0}, +{ 136, 499108416u, 2263729518u, 3254424928u, 3450332551u, 499108416u, 2263729518u, 0, ASIN_TOLERANCE, 0}, +{ 137, 347296393u, 1637536851u, 3238793417u, 747232103u, 347296393u, 1637536851u, 0, ASIN_TOLERANCE, 0}, +{ 138, 34763760u, 902498990u, 3205956257u, 245434170u, 34763760u, 902498990u, 0, ASIN_TOLERANCE, 0}, +{ 139, 3201690145u, 1482770161u, 3244873095u, 2292235133u, 3201690145u, 1482798226u, 0, ASIN_TOLERANCE, 0}, +{ 140, 2990655242u, 36045768u, 1071182448u, 3868790688u, 2990655242u, 36045768u, 0, ASIN_TOLERANCE, 0}, +{ 141, 3083340050u, 1885951730u, 3207806174u, 2553919637u, 3083340050u, 1885951730u, 0, ASIN_TOLERANCE, 0}, +{ 142, 2693238911u, 4059459408u, 1055146851u, 2731735627u, 2693238911u, 4059459408u, 0, ASIN_TOLERANCE, 0}, +{ 143, 2290935302u, 3819720014u, 3203031655u, 4218515595u, 2290935302u, 3819720014u, 0, ASIN_TOLERANCE, 0}, +{ 144, 2348280948u, 3038411370u, 3236511256u, 2472176453u, 2348280948u, 3038411370u, 0, ASIN_TOLERANCE, 0}, +{ 145, 2880785553u, 182132862u, 3252592387u, 1793714415u, 2880785553u, 182132862u, 0, ASIN_TOLERANCE, 0}, +{ 146, 2799656331u, 4227997622u, 1087681073u, 3265812129u, 2799656331u, 4227997622u, 0, ASIN_TOLERANCE, 0}, +{ 147, 801513493u, 1010183244u, 1091844280u, 675001864u, 801513493u, 1010183244u, 0, ASIN_TOLERANCE, 0}, +{ 148, 318478599u, 4193366103u, 1056610361u, 3831235255u, 318478599u, 4193366103u, 0, ASIN_TOLERANCE, 0}, +{ 149, 2378498000u, 465836562u, 3189131504u, 1330642846u, 2378498000u, 465836562u, 0, ASIN_TOLERANCE, 0}, +{ 150, 43741656u, 1192547728u, 1080448013u, 2251835756u, 43741656u, 1192547728u, 0, ASIN_TOLERANCE, 0}, +{ 151, 172875845u, 2123384287u, 3198090050u, 2528390848u, 172875845u, 2123384287u, 0, ASIN_TOLERANCE, 0}, +{ 152, 911443207u, 3964517760u, 3252496130u, 1755935266u, 911443207u, 3964517760u, 0, ASIN_TOLERANCE, 0}, +{ 153, 844811578u, 2753105123u, 3223721534u, 3995725873u, 844811578u, 2753105123u, 0, ASIN_TOLERANCE, 0}, +{ 154, 151452687u, 777231627u, 1042074674u, 36182517u, 151452687u, 777231627u, 0, ASIN_TOLERANCE, 0}, +{ 155, 3158956730u, 3937520057u, 3230206414u, 1507556284u, 3158956730u, 3937520057u, 0, ASIN_TOLERANCE, 0}, +{ 156, 910363913u, 1910829179u, 1052726418u, 90890556u, 910363913u, 1910829179u, 0, ASIN_TOLERANCE, 0}, +{ 157, 3107838682u, 1962827704u, 1080960105u, 1706263669u, 3107838682u, 1962827704u, 0, ASIN_TOLERANCE, 0}, +{ 158, 2177675826u, 3863498922u, 1084020789u, 2439263794u, 2177675826u, 3863498922u, 0, ASIN_TOLERANCE, 0}, +{ 159, 2909835385u, 2329801749u, 1098707350u, 2852802137u, 2909835385u, 2329801749u, 0, ASIN_TOLERANCE, 0}, +{ 160, 2979393160u, 3548991905u, 3213586763u, 3269946829u, 2979393160u, 3548991905u, 0, ASIN_TOLERANCE, 0}, +{ 161, 790744031u, 2009174302u, 1097495331u, 312449728u, 790744031u, 2009174302u, 0, ASIN_TOLERANCE, 0}, +{ 162, 2160628293u, 648730712u, 3246307879u, 4265764460u, 2160628293u, 648730712u, 0, ASIN_TOLERANCE, 0}, +{ 163, 1000831562u, 366653268u, 1051541874u, 1478215551u, 1000831562u, 366653268u, 0, ASIN_TOLERANCE, 0}, +{ 164, 2470023790u, 2605647918u, 1042539011u, 969681033u, 2470023790u, 2605647918u, 0, ASIN_TOLERANCE, 0}, +{ 165, 2322196276u, 1909222641u, 1092825252u, 3029685419u, 2322196276u, 1909222641u, 0, ASIN_TOLERANCE, 0}, +{ 166, 3159166635u, 1128432313u, 3200082887u, 2582838060u, 3159166635u, 1128432313u, 0, ASIN_TOLERANCE, 0}, +{ 167, 2525309230u, 546560372u, 1070003814u, 2343707656u, 2525309230u, 546560372u, 0, ASIN_TOLERANCE, 0}, +{ 168, 849110626u, 309618405u, 3246395018u, 3002005209u, 849110626u, 309618405u, 0, ASIN_TOLERANCE, 0}, +{ 169, 2706804529u, 3151760818u, 3196548461u, 1969485838u, 2706804529u, 3151760818u, 0, ASIN_TOLERANCE, 0}, +{ 170, 639469972u, 3667631361u, 3196181592u, 3743448274u, 639469972u, 3667631361u, 0, ASIN_TOLERANCE, 0}, +{ 171, 2658009958u, 3097521578u, 3216630070u, 1141349287u, 2658009958u, 3097521578u, 0, ASIN_TOLERANCE, 0}, +{ 172, 918158805u, 3403438584u, 3208257181u, 2221276438u, 918158805u, 3403438584u, 0, ASIN_TOLERANCE, 0}, +{ 173, 2401852086u, 1683102397u, 3250341256u, 108768173u, 2401852086u, 1683102397u, 0, ASIN_TOLERANCE, 0}, +{ 174, 2343899229u, 564813835u, 1064153550u, 3058531228u, 2343899229u, 564813835u, 0, ASIN_TOLERANCE, 0}, +{ 175, 2813220880u, 131949913u, 1090262840u, 2146798879u, 2813220880u, 131949913u, 0, ASIN_TOLERANCE, 0}, +{ 176, 2465897203u, 1934391255u, 3188783235u, 1341236714u, 2465897203u, 1934391255u, 0, ASIN_TOLERANCE, 0}, +{ 177, 1070130951u, 418478585u, 3248733961u, 5029000u, 1070141425u, 3058489590u, 0, ASIN_TOLERANCE, 0}, +{ 178, 453997460u, 2676092597u, 1105486693u, 1833595891u, 453997460u, 2676092597u, 0, ASIN_TOLERANCE, 0}, +{ 179, 522042376u, 1030769844u, 1071155175u, 2766628533u, 522042376u, 1030769844u, 0, ASIN_TOLERANCE, 0}, +{ 180, 2635141434u, 1153943376u, 3209762784u, 953839852u, 2635141434u, 1153943376u, 0, ASIN_TOLERANCE, 0}, +{ 181, 1029467775u, 143071571u, 1050966579u, 2318822594u, 1029467775u, 143071571u, 0, ASIN_TOLERANCE, 0}, +{ 182, 287910954u, 1347533411u, 3242337825u, 3256720041u, 287910954u, 1347533411u, 0, ASIN_TOLERANCE, 0}, +{ 183, 444067826u, 1840809642u, 1105293543u, 639604076u, 444067826u, 1840809642u, 0, ASIN_TOLERANCE, 0}, +{ 184, 37282545u, 113530717u, 3194758036u, 699784099u, 37282545u, 113530717u, 0, ASIN_TOLERANCE, 0}, +{ 185, 435549826u, 2950098243u, 1061587493u, 3565445501u, 435549826u, 2950098243u, 0, ASIN_TOLERANCE, 0}, +{ 186, 2385974507u, 2103316697u, 1076082218u, 4043789060u, 2385974507u, 2103316697u, 0, ASIN_TOLERANCE, 0}, +{ 187, 811546601u, 1521715421u, 3251785075u, 651105558u, 811546601u, 1521715421u, 0, ASIN_TOLERANCE, 0}, +{ 188, 491306771u, 2545467538u, 3213898932u, 3889824094u, 491306771u, 2545467538u, 0, ASIN_TOLERANCE, 0}, +{ 189, 503065027u, 4133138143u, 3246676260u, 2160225215u, 503065027u, 4133138143u, 0, ASIN_TOLERANCE, 0}, +{ 190, 994621531u, 836655570u, 3245194924u, 2865254908u, 994621531u, 836655570u, 0, ASIN_TOLERANCE, 0}, +{ 191, 2309344440u, 1678396836u, 3226762726u, 424413376u, 2309344440u, 1678396836u, 0, ASIN_TOLERANCE, 0}, +{ 192, 2164934365u, 2155776900u, 3222643433u, 2889736031u, 2164934365u, 2155776900u, 0, ASIN_TOLERANCE, 0}, +{ 193, 3003862757u, 33676353u, 1090754016u, 4128530794u, 3003862757u, 33676353u, 0, ASIN_TOLERANCE, 0}, +{ 194, 2386204171u, 3176672093u, 1052578754u, 2282864811u, 2386204171u, 3176672093u, 0, ASIN_TOLERANCE, 0}, +{ 195, 446288958u, 2747259961u, 1103923331u, 1909074501u, 446288958u, 2747259961u, 0, ASIN_TOLERANCE, 0}, +{ 196, 3119895314u, 482497137u, 3223384022u, 3259766501u, 3119895314u, 482497137u, 0, ASIN_TOLERANCE, 0}, +{ 197, 2460401984u, 1710626079u, 3222593534u, 834878686u, 2460401984u, 1710626079u, 0, ASIN_TOLERANCE, 0}, +{ 198, 3041977808u, 4271421721u, 1047020885u, 1742757458u, 3041977808u, 4271421721u, 0, ASIN_TOLERANCE, 0}, +{ 199, 2215391645u, 1265459564u, 1080678447u, 685348463u, 2215391645u, 1265459564u, 0, ASIN_TOLERANCE, 0}, +{ 200, 2688170568u, 4066044320u, 1054128905u, 376413109u, 2688170568u, 4066044320u, 0, ASIN_TOLERANCE, 0}, +{ 201, 716821218u, 3237497681u, 3242751645u, 260260645u, 716821218u, 3237497681u, 0, ASIN_TOLERANCE, 0}, +{ 202, 2385659123u, 2882820086u, 1085407846u, 2301658312u, 2385659123u, 2882820086u, 0, ASIN_TOLERANCE, 0}, +{ 203, 420514989u, 3656359254u, 3203021744u, 2817965308u, 420514989u, 3656359254u, 0, ASIN_TOLERANCE, 0}, +{ 204, 2841879402u, 2859722465u, 3197490752u, 3892072777u, 2841879402u, 2859722465u, 0, ASIN_TOLERANCE, 0}, +{ 205, 2665431021u, 2538156443u, 3215734057u, 831239754u, 2665431021u, 2538156443u, 0, ASIN_TOLERANCE, 0}, +{ 206, 953028035u, 3071308141u, 3231671892u, 30345936u, 953028035u, 3071308141u, 0, ASIN_TOLERANCE, 0}, +{ 207, 2210978501u, 3595439756u, 3214985609u, 739408315u, 2210978501u, 3595439756u, 0, ASIN_TOLERANCE, 0}, +{ 208, 3029757061u, 3298589427u, 3196131526u, 2084665197u, 3029757061u, 3298589427u, 0, ASIN_TOLERANCE, 0}, +{ 209, 2823345962u, 3955601456u, 1076543910u, 3304852042u, 2823345962u, 3955601456u, 0, ASIN_TOLERANCE, 0}, +{ 210, 640515933u, 2419975459u, 1073769087u, 1988016581u, 640515933u, 2419975459u, 0, ASIN_TOLERANCE, 0}, +{ 211, 2453833475u, 2659973204u, 3216007439u, 2731594173u, 2453833475u, 2659973204u, 0, ASIN_TOLERANCE, 0}, +{ 212, 697318369u, 3938264868u, 1062532020u, 2975148216u, 697318369u, 3938264868u, 0, ASIN_TOLERANCE, 0}, +{ 213, 225366869u, 453215326u, 3200044385u, 467903731u, 225366869u, 453215326u, 0, ASIN_TOLERANCE, 0}, +{ 214, 499614828u, 372130653u, 3235313361u, 3772501596u, 499614828u, 372130653u, 0, ASIN_TOLERANCE, 0}, +{ 215, 2298173054u, 2406734491u, 1099766912u, 3221574013u, 2298173054u, 2406734491u, 0, ASIN_TOLERANCE, 0}, +{ 216, 211434314u, 2841672781u, 3228298587u, 2623399873u, 211434314u, 2841672781u, 0, ASIN_TOLERANCE, 0}, +{ 217, 2562278951u, 2034292219u, 3248774822u, 699680428u, 2562278951u, 2034292219u, 0, ASIN_TOLERANCE, 0}, +{ 218, 1030621435u, 1386943632u, 1088782030u, 3724905992u, 1030621435u, 1386943632u, 0, ASIN_TOLERANCE, 0}, +{ 219, 217306301u, 1495300013u, 3240548807u, 1518804038u, 217306301u, 1495300013u, 0, ASIN_TOLERANCE, 0}, +{ 220, 362076244u, 3050489517u, 1049468975u, 2940604216u, 362076244u, 3050489517u, 0, ASIN_TOLERANCE, 0}, +{ 221, 516072020u, 387594449u, 3238538261u, 3010872301u, 516072020u, 387594449u, 0, ASIN_TOLERANCE, 0}, +{ 222, 2417270868u, 1683571756u, 1098214271u, 3243467912u, 2417270868u, 1683571756u, 0, ASIN_TOLERANCE, 0}, +{ 223, 2453871840u, 547789874u, 1074621795u, 671680995u, 2453871840u, 547789874u, 0, ASIN_TOLERANCE, 0}, +{ 224, 819681449u, 2315535361u, 1076278343u, 3851723081u, 819681449u, 2315535361u, 0, ASIN_TOLERANCE, 0}, +{ 225, 925396663u, 2690952636u, 3195785827u, 1648844317u, 925396663u, 2690952636u, 0, ASIN_TOLERANCE, 0}, +{ 226, 835916575u, 2105507379u, 1060210356u, 2061848524u, 835916575u, 2105507379u, 0, ASIN_TOLERANCE, 0}, +{ 227, 2882329693u, 1771437899u, 1102743884u, 4195142780u, 2882329693u, 1771437899u, 0, ASIN_TOLERANCE, 0}, +{ 228, 547945591u, 1310074754u, 1072476006u, 1313198415u, 547945591u, 1310074754u, 0, ASIN_TOLERANCE, 0}, +{ 229, 979656894u, 3914592621u, 3228159980u, 2457917034u, 979656894u, 3914592621u, 0, ASIN_TOLERANCE, 0}, +{ 230, 2718226491u, 2240965174u, 3236288087u, 3605857252u, 2718226491u, 2240965174u, 0, ASIN_TOLERANCE, 0}, +{ 231, 41761399u, 196714912u, 1054040628u, 3084755276u, 41761399u, 196714912u, 0, ASIN_TOLERANCE, 0}, +{ 232, 2665587864u, 2058851477u, 1052873711u, 1233598120u, 2665587864u, 2058851477u, 0, ASIN_TOLERANCE, 0}, +{ 233, 101299669u, 1909994277u, 3220384775u, 2863812374u, 101299669u, 1909994277u, 0, ASIN_TOLERANCE, 0}, +{ 234, 532015965u, 3697551156u, 1083211400u, 2869735287u, 532015965u, 3697551156u, 0, ASIN_TOLERANCE, 0}, +{ 235, 2830857894u, 2697221770u, 1092525956u, 2160271449u, 2830857894u, 2697221770u, 0, ASIN_TOLERANCE, 0}, +{ 236, 230734239u, 2762796844u, 1059257507u, 3160137573u, 230734239u, 2762796844u, 0, ASIN_TOLERANCE, 0}, +{ 237, 247044829u, 1758968847u, 1101109420u, 3270770898u, 247044829u, 1758968847u, 0, ASIN_TOLERANCE, 0}, +{ 238, 73012604u, 4005141897u, 3216213297u, 4129052985u, 73012604u, 4005141897u, 0, ASIN_TOLERANCE, 0}, +{ 239, 2970233606u, 137758261u, 1060349030u, 3082136857u, 2970233606u, 137758261u, 0, ASIN_TOLERANCE, 0}, +{ 240, 1068792039u, 2371653203u, 3211892131u, 3951914469u, 1068793473u, 3098305686u, 0, ASIN_TOLERANCE, 0}, +{ 241, 3109437504u, 3213595557u, 1043958672u, 2986160931u, 3109437504u, 3213595557u, 0, ASIN_TOLERANCE, 0}, +{ 242, 575927156u, 2540046258u, 3208370548u, 2048583911u, 575927156u, 2540046258u, 0, ASIN_TOLERANCE, 0}, +{ 243, 546830286u, 2264504930u, 3228769528u, 1854181735u, 546830286u, 2264504930u, 0, ASIN_TOLERANCE, 0}, +{ 244, 2183016286u, 3809768956u, 1054933586u, 595351688u, 2183016286u, 3809768956u, 0, ASIN_TOLERANCE, 0}, +{ 245, 723947614u, 3071069520u, 3207129696u, 3120974660u, 723947614u, 3071069520u, 0, ASIN_TOLERANCE, 0}, +{ 246, 945283056u, 1952618732u, 3236532520u, 1540955277u, 945283056u, 1952618732u, 0, ASIN_TOLERANCE, 0}, +{ 247, 747620529u, 1438803217u, 1049266525u, 957676449u, 747620529u, 1438803217u, 0, ASIN_TOLERANCE, 0}, +{ 248, 92767291u, 4222295662u, 1076131984u, 2183319069u, 92767291u, 4222295662u, 0, ASIN_TOLERANCE, 0}, +{ 249, 334611718u, 3887074118u, 3191649564u, 3233378721u, 334611718u, 3887074118u, 0, ASIN_TOLERANCE, 0}, +{ 250, 771768198u, 2099099488u, 3222430705u, 2071674991u, 771768198u, 2099099488u, 0, ASIN_TOLERANCE, 0}, +{ 251, 2409204087u, 2295269094u, 3196265320u, 3987032629u, 2409204087u, 2295269094u, 0, ASIN_TOLERANCE, 0}, +{ 252, 2377503648u, 4200095882u, 1086809994u, 1339996745u, 2377503648u, 4200095882u, 0, ASIN_TOLERANCE, 0}, +{ 253, 797809565u, 2431996507u, 1102017594u, 242934189u, 797809565u, 2431996507u, 0, ASIN_TOLERANCE, 0}, +{ 254, 2312749311u, 2330084417u, 1043172813u, 4043102110u, 2312749311u, 2330084417u, 0, ASIN_TOLERANCE, 0}, +{ 255, 988771849u, 1106978707u, 1082509751u, 2520765777u, 988771849u, 1106978707u, 0, ASIN_TOLERANCE, 0}, +{ 256, 864960887u, 3192168224u, 1066340820u, 3603945646u, 864960887u, 3192168224u, 0, ASIN_TOLERANCE, 0}, +{ 257, 2589695756u, 1952396835u, 3199434577u, 3703639356u, 2589695756u, 1952396835u, 0, ASIN_TOLERANCE, 0}, +{ 258, 320682810u, 1198219673u, 3230438668u, 2418060633u, 320682810u, 1198219673u, 0, ASIN_TOLERANCE, 0}, +{ 259, 551093026u, 2638353760u, 1093840413u, 1751560711u, 551093026u, 2638353760u, 0, ASIN_TOLERANCE, 0}, +{ 260, 540797521u, 180987057u, 1085420898u, 530063370u, 540797521u, 180987057u, 0, ASIN_TOLERANCE, 0}, +{ 261, 2760303516u, 3179145654u, 1048020008u, 3061407249u, 2760303516u, 3179145654u, 0, ASIN_TOLERANCE, 0}, +{ 262, 162525363u, 1884787302u, 1068713554u, 1737020797u, 162525363u, 1884787302u, 0, ASIN_TOLERANCE, 0}, +{ 263, 214216231u, 3459566012u, 3251200938u, 4126298722u, 214216231u, 3459566012u, 0, ASIN_TOLERANCE, 0}, +{ 264, 2764328342u, 1036370112u, 3235918644u, 3898933279u, 2764328342u, 1036370112u, 0, ASIN_TOLERANCE, 0}, +{ 265, 653867113u, 3276084832u, 3189072211u, 1864601262u, 653867113u, 3276084832u, 0, ASIN_TOLERANCE, 0}, +{ 266, 298324788u, 263075055u, 1100754245u, 1667825741u, 298324788u, 263075055u, 0, ASIN_TOLERANCE, 0}, +{ 267, 3015536039u, 2387220960u, 3253010819u, 3505575323u, 3015536039u, 2387220960u, 0, ASIN_TOLERANCE, 0}, +{ 268, 642739166u, 3154304623u, 1063475914u, 3150741666u, 642739166u, 3154304623u, 0, ASIN_TOLERANCE, 0}, +{ 269, 332025563u, 4200269406u, 3194288972u, 3577694711u, 332025563u, 4200269406u, 0, ASIN_TOLERANCE, 0}, +{ 270, 2339885777u, 2064011737u, 1089860833u, 3657008595u, 2339885777u, 2064011737u, 0, ASIN_TOLERANCE, 0}, +{ 271, 842190281u, 210665237u, 3197168874u, 510714829u, 842190281u, 210665237u, 0, ASIN_TOLERANCE, 0}, +{ 272, 728283504u, 1589701259u, 3251310843u, 17001602u, 728283504u, 1589701259u, 0, ASIN_TOLERANCE, 0}, +{ 273, 975043445u, 2928317152u, 3246958541u, 122162205u, 975043445u, 2928317152u, 0, ASIN_TOLERANCE, 0}, +{ 274, 3101610657u, 1288582346u, 1071556960u, 4177188454u, 3101610657u, 1288582346u, 0, ASIN_TOLERANCE, 0}, +{ 275, 151289169u, 3962848462u, 3243017171u, 3661038757u, 151289169u, 3962848462u, 0, ASIN_TOLERANCE, 0}, +{ 276, 2755192415u, 2162985241u, 3226640955u, 1639319068u, 2755192415u, 2162985241u, 0, ASIN_TOLERANCE, 0}, +{ 277, 2942384609u, 1996676305u, 1099130747u, 3840380763u, 2942384609u, 1996676305u, 0, ASIN_TOLERANCE, 0}, +{ 278, 134315769u, 550040067u, 3241901241u, 3372594924u, 134315769u, 550040067u, 0, ASIN_TOLERANCE, 0}, +{ 279, 3137373248u, 3164451169u, 1076627605u, 317246751u, 3137373248u, 3164451169u, 0, ASIN_TOLERANCE, 0}, +{ 280, 2423768299u, 784217153u, 1066058157u, 1225003160u, 2423768299u, 784217153u, 0, ASIN_TOLERANCE, 0}, +{ 281, 2378706924u, 1715871558u, 1101460352u, 3401958038u, 2378706924u, 1715871558u, 0, ASIN_TOLERANCE, 0}, +{ 282, 363631767u, 4086269531u, 1102279679u, 2517481591u, 363631767u, 4086269531u, 0, ASIN_TOLERANCE, 0}, +{ 283, 2329360168u, 2624677381u, 1085107111u, 1970804718u, 2329360168u, 2624677381u, 0, ASIN_TOLERANCE, 0}, +{ 284, 1010793546u, 3379532114u, 3249898830u, 3723025783u, 1010793546u, 3379532114u, 0, ASIN_TOLERANCE, 0}, +{ 285, 999588552u, 2651435439u, 3229039621u, 1030985387u, 999588552u, 2651435439u, 0, ASIN_TOLERANCE, 0}, +{ 286, 3145033808u, 1199535056u, 1077836259u, 3604666660u, 3145033808u, 1199535056u, 0, ASIN_TOLERANCE, 0}, +{ 287, 2548507371u, 3115209742u, 3237451386u, 3863935859u, 2548507371u, 3115209742u, 0, ASIN_TOLERANCE, 0}, +{ 288, 2398143146u, 4209496277u, 3199416183u, 1216202995u, 2398143146u, 4209496277u, 0, ASIN_TOLERANCE, 0}, +{ 289, 614398964u, 2544695332u, 3210577461u, 596332114u, 614398964u, 2544695332u, 0, ASIN_TOLERANCE, 0}, +{ 290, 514278395u, 1338323803u, 1041925718u, 99526924u, 514278395u, 1338323803u, 0, ASIN_TOLERANCE, 0}, +{ 291, 856573491u, 3149653097u, 1103058665u, 2483495776u, 856573491u, 3149653097u, 0, ASIN_TOLERANCE, 0}, +{ 292, 2339743312u, 280536835u, 1044395245u, 3715707641u, 2339743312u, 280536835u, 0, ASIN_TOLERANCE, 0}, +{ 293, 128894757u, 3670016377u, 1050809029u, 3775007802u, 128894757u, 3670016377u, 0, ASIN_TOLERANCE, 0}, +{ 294, 3109073100u, 3526859225u, 3222673081u, 4030462447u, 3109073100u, 3526859225u, 0, ASIN_TOLERANCE, 0}, +{ 295, 640779949u, 1602527268u, 3242467576u, 2018361566u, 640779949u, 1602527268u, 0, ASIN_TOLERANCE, 0}, +{ 296, 957271688u, 3985805054u, 1088518381u, 1679321540u, 957271688u, 3985805054u, 0, ASIN_TOLERANCE, 0}, +{ 297, 2801498828u, 1663896708u, 3248819198u, 4229852270u, 2801498828u, 1663896708u, 0, ASIN_TOLERANCE, 0}, +{ 298, 467728155u, 2346627527u, 3239438934u, 2290493820u, 467728155u, 2346627527u, 0, ASIN_TOLERANCE, 0}, +{ 299, 2208629720u, 2296736794u, 3207683799u, 1456667044u, 2208629720u, 2296736794u, 0, ASIN_TOLERANCE, 0}, +{ 300, 2958022504u, 4132454009u, 1106540396u, 4243490703u, 2958022504u, 4132454009u, 0, ASIN_TOLERANCE, 0}, +{ 301, 235395447u, 1359445676u, 3190130903u, 1569883678u, 235395447u, 1359445676u, 0, ASIN_TOLERANCE, 0}, +{ 302, 277859320u, 333214083u, 1076552006u, 1385185236u, 277859320u, 333214083u, 0, ASIN_TOLERANCE, 0}, +{ 303, 2942645471u, 950097945u, 1041232546u, 3621700966u, 2942645471u, 950097945u, 0, ASIN_TOLERANCE, 0}, +{ 304, 370898672u, 149336372u, 3191764868u, 2940199511u, 370898672u, 149336372u, 0, ASIN_TOLERANCE, 0}, +{ 305, 2384610875u, 2875684421u, 3249377056u, 4253432396u, 2384610875u, 2875684421u, 0, ASIN_TOLERANCE, 0}, +{ 306, 837504978u, 2081484836u, 3199314748u, 2264912911u, 837504978u, 2081484836u, 0, ASIN_TOLERANCE, 0}, +{ 307, 632882934u, 3967859615u, 3229710481u, 2667348142u, 632882934u, 3967859615u, 0, ASIN_TOLERANCE, 0}, +{ 308, 2181979516u, 3630082248u, 3227364534u, 4156569147u, 2181979516u, 3630082248u, 0, ASIN_TOLERANCE, 0}, +{ 309, 946956756u, 2993509124u, 1091331299u, 4018898246u, 946956756u, 2993509124u, 0, ASIN_TOLERANCE, 0}, +{ 310, 338207615u, 1642285349u, 3208379731u, 1196091123u, 338207615u, 1642285349u, 0, ASIN_TOLERANCE, 0}, +{ 311, 4693283u, 3356597889u, 1040231079u, 2420753479u, 4693283u, 3356597889u, 0, ASIN_TOLERANCE, 0}, +{ 312, 2762118529u, 977967943u, 3228887283u, 807395730u, 2762118529u, 977967943u, 0, ASIN_TOLERANCE, 0}, +{ 313, 2919435607u, 2730725979u, 3207120390u, 3867917386u, 2919435607u, 2730725979u, 0, ASIN_TOLERANCE, 0}, +{ 314, 999294480u, 3504746045u, 1075794770u, 665882260u, 999294480u, 3504746045u, 0, ASIN_TOLERANCE, 0}, +{ 315, 2269075155u, 3385464702u, 1049896268u, 2757059958u, 2269075155u, 3385464702u, 0, ASIN_TOLERANCE, 0}, +{ 316, 536095951u, 1299923384u, 1101872081u, 2574386817u, 536095951u, 1299923384u, 0, ASIN_TOLERANCE, 0}, +{ 317, 2675071145u, 3171042375u, 1078533152u, 2312086600u, 2675071145u, 3171042375u, 0, ASIN_TOLERANCE, 0}, +{ 318, 2360735442u, 4236561530u, 1068042271u, 256515531u, 2360735442u, 4236561530u, 0, ASIN_TOLERANCE, 0}, +{ 319, 2609926553u, 4152554926u, 1100304772u, 3545562886u, 2609926553u, 4152554926u, 0, ASIN_TOLERANCE, 0}, +{ 320, 2403546570u, 350924105u, 1040286251u, 1468770658u, 2403546570u, 350924105u, 0, ASIN_TOLERANCE, 0}, +{ 321, 544551146u, 3000822699u, 3232925779u, 2540988650u, 544551146u, 3000822699u, 0, ASIN_TOLERANCE, 0}, +{ 322, 2780107631u, 2928199244u, 3245167989u, 44275991u, 2780107631u, 2928199244u, 0, ASIN_TOLERANCE, 0}, +{ 323, 2165210001u, 1174874204u, 1057110584u, 848081004u, 2165210001u, 1174874204u, 0, ASIN_TOLERANCE, 0}, +{ 324, 2354568060u, 1412948540u, 3239110676u, 3215002775u, 2354568060u, 1412948540u, 0, ASIN_TOLERANCE, 0}, +{ 325, 863277892u, 2701562677u, 1065879622u, 2897481417u, 863277892u, 2701562677u, 0, ASIN_TOLERANCE, 0}, +{ 326, 199312991u, 2980401690u, 3216742908u, 2549609731u, 199312991u, 2980401690u, 0, ASIN_TOLERANCE, 0}, +{ 327, 2827983212u, 585456984u, 3201746087u, 638714580u, 2827983212u, 585456984u, 0, ASIN_TOLERANCE, 0}, +{ 328, 575008531u, 4260896505u, 1089137884u, 4274648992u, 575008531u, 4260896505u, 0, ASIN_TOLERANCE, 0}, +{ 329, 2728904219u, 4055046173u, 3198391736u, 3482894513u, 2728904219u, 4055046173u, 0, ASIN_TOLERANCE, 0}, +{ 330, 341009704u, 2493198836u, 3198094528u, 2484800635u, 341009704u, 2493198836u, 0, ASIN_TOLERANCE, 0}, +{ 331, 3153287889u, 599921010u, 1103847606u, 1674254897u, 3153287889u, 599921010u, 0, ASIN_TOLERANCE, 0}, +{ 332, 104926329u, 217148561u, 1097066495u, 3536010689u, 104926329u, 217148561u, 0, ASIN_TOLERANCE, 0}, +{ 333, 933395812u, 1605519917u, 3225218243u, 2732577078u, 933395812u, 1605519917u, 0, ASIN_TOLERANCE, 0}, +{ 334, 573219110u, 417261654u, 3246267157u, 3401343872u, 573219110u, 417261654u, 0, ASIN_TOLERANCE, 0}, +{ 335, 1039272770u, 2150330697u, 1080405602u, 3197535445u, 1039272770u, 2150330697u, 0, ASIN_TOLERANCE, 0}, +{ 336, 1065739247u, 2334624779u, 1070288136u, 147709079u, 1065739274u, 3700895036u, 0, ASIN_TOLERANCE, 0}, +{ 337, 3178645135u, 665848401u, 3235013045u, 2195099382u, 3178645135u, 665848401u, 0, ASIN_TOLERANCE, 0}, +{ 338, 364316788u, 238721142u, 3238780023u, 2612316049u, 364316788u, 238721142u, 0, ASIN_TOLERANCE, 0}, +{ 339, 2974180417u, 328119069u, 3231550903u, 696220816u, 2974180417u, 328119069u, 0, ASIN_TOLERANCE, 0}, +{ 340, 649641437u, 2886210843u, 1055433962u, 3331415058u, 649641437u, 2886210843u, 0, ASIN_TOLERANCE, 0}, +{ 341, 335135121u, 2420250111u, 3214614526u, 510850312u, 335135121u, 2420250111u, 0, ASIN_TOLERANCE, 0}, +{ 342, 2216193203u, 1658541647u, 1071956366u, 53496813u, 2216193203u, 1658541647u, 0, ASIN_TOLERANCE, 0}, +{ 343, 2567194005u, 3872563165u, 1098494887u, 2790313039u, 2567194005u, 3872563165u, 0, ASIN_TOLERANCE, 0}, +{ 344, 3219733872u, 3859621368u, 3205775949u, 4015749711u, 3219985579u, 1133459795u, 0, ASIN_TOLERANCE, 0}, +{ 345, 311334852u, 1732769560u, 1052132915u, 2774541952u, 311334852u, 1732769560u, 0, ASIN_TOLERANCE, 0}, +{ 346, 317917675u, 1689088021u, 1066883290u, 3270546122u, 317917675u, 1689088021u, 0, ASIN_TOLERANCE, 0}, +{ 347, 491335395u, 1959705843u, 1106618962u, 4198868105u, 491335395u, 1959705843u, 0, ASIN_TOLERANCE, 0}, +{ 348, 124503353u, 3906315805u, 3235289682u, 1109820549u, 124503353u, 3906315805u, 0, ASIN_TOLERANCE, 0}, +{ 349, 3036818075u, 3370448446u, 1063890856u, 4022784584u, 3036818075u, 3370448446u, 0, ASIN_TOLERANCE, 0}, +{ 350, 323334929u, 3264056381u, 1104622566u, 3697934821u, 323334929u, 3264056381u, 0, ASIN_TOLERANCE, 0}, +{ 351, 82666680u, 2912871781u, 3242116859u, 1560571600u, 82666680u, 2912871781u, 0, ASIN_TOLERANCE, 0}, +{ 352, 2776916990u, 3103325650u, 3237224234u, 3681651958u, 2776916990u, 3103325650u, 0, ASIN_TOLERANCE, 0}, +{ 353, 333678608u, 3330581237u, 1086856468u, 3110345659u, 333678608u, 3330581237u, 0, ASIN_TOLERANCE, 0}, +{ 354, 2487169180u, 2478706589u, 1099546513u, 4177071445u, 2487169180u, 2478706589u, 0, ASIN_TOLERANCE, 0}, +{ 355, 3183204741u, 3514067221u, 3247338343u, 585148435u, 3183204741u, 3514067221u, 0, ASIN_TOLERANCE, 0}, +{ 356, 2811486197u, 3689342853u, 3208758774u, 200507809u, 2811486197u, 3689342853u, 0, ASIN_TOLERANCE, 0}, +{ 357, 3116462959u, 1049872171u, 3210445232u, 1453705582u, 3116462959u, 1049872171u, 0, ASIN_TOLERANCE, 0}, +{ 358, 3129943472u, 1932668626u, 1098808013u, 1044068983u, 3129943472u, 1932668626u, 0, ASIN_TOLERANCE, 0}, +{ 359, 2295964401u, 4093388677u, 3210795947u, 1617393713u, 2295964401u, 4093388677u, 0, ASIN_TOLERANCE, 0}, +{ 360, 2293016564u, 778812087u, 3246232571u, 731905539u, 2293016564u, 778812087u, 0, ASIN_TOLERANCE, 0}, +{ 361, 2907822649u, 4050829759u, 1086605180u, 1863848117u, 2907822649u, 4050829759u, 0, ASIN_TOLERANCE, 0}, +{ 362, 6647363u, 718161191u, 1071063889u, 2637291484u, 6647363u, 718161191u, 0, ASIN_TOLERANCE, 0}, +{ 363, 224521970u, 1909842364u, 1102747575u, 3614304657u, 224521970u, 1909842364u, 0, ASIN_TOLERANCE, 0}, +{ 364, 761500166u, 895493977u, 3236485375u, 1701194116u, 761500166u, 895493977u, 0, ASIN_TOLERANCE, 0}, +{ 365, 2171563276u, 1493115846u, 3233339987u, 296022762u, 2171563276u, 1493115846u, 0, ASIN_TOLERANCE, 0}, +{ 366, 2783624899u, 4099447408u, 3187790416u, 3564720305u, 2783624899u, 4099447408u, 0, ASIN_TOLERANCE, 0}, +{ 367, 848425142u, 2404172709u, 3219922640u, 2284484846u, 848425142u, 2404172709u, 0, ASIN_TOLERANCE, 0}, +{ 368, 2654315895u, 3240896015u, 3208621510u, 1226668421u, 2654315895u, 3240896015u, 0, ASIN_TOLERANCE, 0}, +{ 369, 2488218361u, 4127752456u, 3200753143u, 2161953369u, 2488218361u, 4127752456u, 0, ASIN_TOLERANCE, 0}, +{ 370, 489605006u, 1168774591u, 3191311819u, 2375467787u, 489605006u, 1168774591u, 0, ASIN_TOLERANCE, 0}, +{ 371, 347845914u, 2883145553u, 3234998320u, 3286468014u, 347845914u, 2883145553u, 0, ASIN_TOLERANCE, 0}, +{ 372, 2588007471u, 3007671464u, 1102234703u, 1209628408u, 2588007471u, 3007671464u, 0, ASIN_TOLERANCE, 0}, +{ 373, 127334109u, 571692916u, 3243349276u, 1910625797u, 127334109u, 571692916u, 0, ASIN_TOLERANCE, 0}, +{ 374, 524138712u, 2510184860u, 1089525631u, 2209639467u, 524138712u, 2510184860u, 0, ASIN_TOLERANCE, 0}, +{ 375, 2615466346u, 1945605229u, 3227105252u, 3777119615u, 2615466346u, 1945605229u, 0, ASIN_TOLERANCE, 0}, +{ 376, 398493829u, 215226593u, 3235434773u, 224271737u, 398493829u, 215226593u, 0, ASIN_TOLERANCE, 0}, +{ 377, 2242993828u, 2134662911u, 1080232319u, 1056746021u, 2242993828u, 2134662911u, 0, ASIN_TOLERANCE, 0}, +{ 378, 2923358085u, 1099524039u, 1085032107u, 3905384073u, 2923358085u, 1099524039u, 0, ASIN_TOLERANCE, 0}, +{ 379, 842579915u, 985866260u, 3225437419u, 3120783698u, 842579915u, 985866260u, 0, ASIN_TOLERANCE, 0}, +{ 380, 2589795066u, 1700432859u, 3230345428u, 3505263023u, 2589795066u, 1700432859u, 0, ASIN_TOLERANCE, 0}, +{ 381, 2297683903u, 953966053u, 1090810641u, 151959421u, 2297683903u, 953966053u, 0, ASIN_TOLERANCE, 0}, +{ 382, 2887420078u, 1520016810u, 1096148013u, 1974161688u, 2887420078u, 1520016810u, 0, ASIN_TOLERANCE, 0}, +{ 383, 2738297064u, 1577726432u, 1080717542u, 3407236142u, 2738297064u, 1577726432u, 0, ASIN_TOLERANCE, 0}, +{ 384, 3154840433u, 358621181u, 3214344145u, 3735144364u, 3154840433u, 358621181u, 0, ASIN_TOLERANCE, 0}, +{ 385, 2521491907u, 4023613376u, 1095386964u, 959640601u, 2521491907u, 4023613376u, 0, ASIN_TOLERANCE, 0}, +{ 386, 2369008919u, 4136915018u, 1042238319u, 1264360404u, 2369008919u, 4136915018u, 0, ASIN_TOLERANCE, 0}, +{ 387, 2906418341u, 3543839161u, 1093859356u, 2852227162u, 2906418341u, 3543839161u, 0, ASIN_TOLERANCE, 0}, +{ 388, 2218509603u, 2154399659u, 3218171985u, 2610173674u, 2218509603u, 2154399659u, 0, ASIN_TOLERANCE, 0}, +{ 389, 165687034u, 2502718011u, 1105407582u, 4037997673u, 165687034u, 2502718011u, 0, ASIN_TOLERANCE, 0}, +{ 390, 3034344010u, 2429891750u, 3220651893u, 3433646170u, 3034344010u, 2429891750u, 0, ASIN_TOLERANCE, 0}, +{ 391, 397029567u, 1233242847u, 3233842223u, 1978947905u, 397029567u, 1233242847u, 0, ASIN_TOLERANCE, 0}, +{ 392, 32753845u, 3055512924u, 1085895689u, 2569766862u, 32753845u, 3055512924u, 0, ASIN_TOLERANCE, 0}, +{ 393, 498004465u, 3103627383u, 1075642950u, 676014010u, 498004465u, 3103627383u, 0, ASIN_TOLERANCE, 0}, +{ 394, 2622487710u, 3587249671u, 1050343198u, 2034180320u, 2622487710u, 3587249671u, 0, ASIN_TOLERANCE, 0}, +{ 395, 2559467693u, 1175750283u, 3228052153u, 441772035u, 2559467693u, 1175750283u, 0, ASIN_TOLERANCE, 0}, +{ 396, 639279177u, 1096886368u, 1067186387u, 4256284279u, 639279177u, 1096886368u, 0, ASIN_TOLERANCE, 0}, +{ 397, 208471934u, 2746455711u, 3243186220u, 383175406u, 208471934u, 2746455711u, 0, ASIN_TOLERANCE, 0}, +{ 398, 2829822244u, 1056466374u, 3247450556u, 3263564076u, 2829822244u, 1056466374u, 0, ASIN_TOLERANCE, 0}, +{ 399, 2468230336u, 1734210936u, 3195265560u, 514072505u, 2468230336u, 1734210936u, 0, ASIN_TOLERANCE, 0}, +{ 400, 758811245u, 1728341051u, 1092832248u, 3823410158u, 758811245u, 1728341051u, 0, ASIN_TOLERANCE, 0}, +{ 401, 2347191449u, 1235712656u, 3219475794u, 3622129011u, 2347191449u, 1235712656u, 0, ASIN_TOLERANCE, 0}, +{ 402, 79742765u, 1575194991u, 3197615492u, 3446988115u, 79742765u, 1575194991u, 0, ASIN_TOLERANCE, 0}, +{ 403, 2161423950u, 2362441752u, 1088255327u, 270039934u, 2161423950u, 2362441752u, 0, ASIN_TOLERANCE, 0}, +{ 404, 3010727959u, 3063626339u, 1105039555u, 1845818221u, 3010727959u, 3063626339u, 0, ASIN_TOLERANCE, 0}, +{ 405, 192788472u, 3718151518u, 3240183167u, 3113149567u, 192788472u, 3718151518u, 0, ASIN_TOLERANCE, 0}, +{ 406, 313112913u, 3686096237u, 3199484638u, 191185038u, 313112913u, 3686096237u, 0, ASIN_TOLERANCE, 0}, +{ 407, 195422631u, 3680158556u, 1105637038u, 349436087u, 195422631u, 3680158556u, 0, ASIN_TOLERANCE, 0}, +{ 408, 2844026099u, 150975354u, 1100107824u, 729077351u, 2844026099u, 150975354u, 0, ASIN_TOLERANCE, 0}, +{ 409, 3016106050u, 2974566906u, 1091481543u, 195479384u, 3016106050u, 2974566906u, 0, ASIN_TOLERANCE, 0}, +{ 410, 2820952232u, 953930448u, 3232752339u, 1009878771u, 2820952232u, 953930448u, 0, ASIN_TOLERANCE, 0}, +{ 411, 179600265u, 3369386607u, 1057414346u, 1319431804u, 179600265u, 3369386607u, 0, ASIN_TOLERANCE, 0}, +{ 412, 586131522u, 3279403983u, 3223631624u, 3404608264u, 586131522u, 3279403983u, 0, ASIN_TOLERANCE, 0}, +{ 413, 937427869u, 559918757u, 1105263000u, 1026957442u, 937427869u, 559918757u, 0, ASIN_TOLERANCE, 0}, +{ 414, 128542208u, 2658716822u, 1104708872u, 996387212u, 128542208u, 2658716822u, 0, ASIN_TOLERANCE, 0}, +{ 415, 2731512332u, 3244026687u, 1047704829u, 2987820261u, 2731512332u, 3244026687u, 0, ASIN_TOLERANCE, 0}, +{ 416, 829571115u, 1205633467u, 3212336151u, 731560768u, 829571115u, 1205633467u, 0, ASIN_TOLERANCE, 0}, +{ 417, 2850353849u, 3269211356u, 3233229218u, 2632041754u, 2850353849u, 3269211356u, 0, ASIN_TOLERANCE, 0}, +{ 418, 1070113635u, 1007200508u, 1086406456u, 1484610595u, 1070123776u, 907090054u, 0, ASIN_TOLERANCE, 0}, +{ 419, 968866968u, 3805991624u, 1101562011u, 3292762908u, 968866968u, 3805991624u, 0, ASIN_TOLERANCE, 0}, +{ 420, 2437809818u, 3314105762u, 3211254740u, 3489200637u, 2437809818u, 3314105762u, 0, ASIN_TOLERANCE, 0}, +{ 421, 2571363594u, 3198252706u, 3200980182u, 558779875u, 2571363594u, 3198252706u, 0, ASIN_TOLERANCE, 0}, +{ 422, 2377866012u, 2338464653u, 1083319346u, 4167405697u, 2377866012u, 2338464653u, 0, ASIN_TOLERANCE, 0}, +{ 423, 2919015115u, 2320792999u, 3245310028u, 2734025087u, 2919015115u, 2320792999u, 0, ASIN_TOLERANCE, 0}, +{ 424, 2318992495u, 832495279u, 3189857572u, 919851193u, 2318992495u, 832495279u, 0, ASIN_TOLERANCE, 0}, +{ 425, 3116721767u, 594640291u, 1077503330u, 976536412u, 3116721767u, 594640291u, 0, ASIN_TOLERANCE, 0}, +{ 426, 3139145310u, 79400523u, 3241084263u, 3353474633u, 3139145310u, 79400523u, 0, ASIN_TOLERANCE, 0}, +{ 427, 3132785785u, 1078965987u, 3233772596u, 3496966466u, 3132785785u, 1078965987u, 0, ASIN_TOLERANCE, 0}, +{ 428, 892587941u, 4243435186u, 1078663150u, 2446827483u, 892587941u, 4243435186u, 0, ASIN_TOLERANCE, 0}, +{ 429, 644490711u, 699817447u, 1081268534u, 2111588814u, 644490711u, 699817447u, 0, ASIN_TOLERANCE, 0}, +{ 430, 536635513u, 177265199u, 3233855943u, 965677531u, 536635513u, 177265199u, 0, ASIN_TOLERANCE, 0}, +{ 431, 624474831u, 3957229084u, 1065403841u, 3870961932u, 624474831u, 3957229084u, 0, ASIN_TOLERANCE, 0}, +{ 432, 2495519163u, 2768873929u, 3212244708u, 4127917680u, 2495519163u, 2768873929u, 0, ASIN_TOLERANCE, 0}, +{ 433, 445621604u, 3639227340u, 1068863190u, 4192848976u, 445621604u, 3639227340u, 0, ASIN_TOLERANCE, 0}, +{ 434, 2543806408u, 2824651320u, 1092946600u, 2150743372u, 2543806408u, 2824651320u, 0, ASIN_TOLERANCE, 0}, +{ 435, 417715333u, 1542109195u, 3223841580u, 2386809036u, 417715333u, 1542109195u, 0, ASIN_TOLERANCE, 0}, +{ 436, 192029360u, 1374810628u, 3218415587u, 1623455911u, 192029360u, 1374810628u, 0, ASIN_TOLERANCE, 0}, +{ 437, 733790955u, 226433601u, 1048463914u, 2667067819u, 733790955u, 226433601u, 0, ASIN_TOLERANCE, 0}, +{ 438, 768579443u, 1339325351u, 1074062507u, 701901582u, 768579443u, 1339325351u, 0, ASIN_TOLERANCE, 0}, +{ 439, 2920705365u, 3631553324u, 1068350633u, 1231934926u, 2920705365u, 3631553324u, 0, ASIN_TOLERANCE, 0}, +{ 440, 2933708324u, 603977748u, 1098802865u, 1502493757u, 2933708324u, 603977748u, 0, ASIN_TOLERANCE, 0}, +{ 441, 852954796u, 4255242031u, 1076182326u, 2417637015u, 852954796u, 4255242031u, 0, ASIN_TOLERANCE, 0}, +{ 442, 3089857028u, 3270297477u, 1057486942u, 2885336275u, 3089857028u, 3270297477u, 0, ASIN_TOLERANCE, 0}, +{ 443, 2809553007u, 1162164397u, 3250508564u, 2047944882u, 2809553007u, 1162164397u, 0, ASIN_TOLERANCE, 0}, +{ 444, 2875372587u, 129658419u, 3243244851u, 817360375u, 2875372587u, 129658419u, 0, ASIN_TOLERANCE, 0}, +{ 445, 286421081u, 4166988101u, 3246796270u, 1780823036u, 286421081u, 4166988101u, 0, ASIN_TOLERANCE, 0}, +{ 446, 668574270u, 418009120u, 1081026514u, 909013508u, 668574270u, 418009120u, 0, ASIN_TOLERANCE, 0}, +{ 447, 3082072506u, 4186670845u, 1073362089u, 2619129420u, 3082072506u, 4186670845u, 0, ASIN_TOLERANCE, 0}, +{ 448, 795252317u, 1348987467u, 3217165795u, 4162017137u, 795252317u, 1348987467u, 0, ASIN_TOLERANCE, 0}, +{ 449, 2946795826u, 2808968027u, 1057864611u, 275397670u, 2946795826u, 2808968027u, 0, ASIN_TOLERANCE, 0}, +{ 450, 513174607u, 240711581u, 3188571226u, 991292615u, 513174607u, 240711581u, 0, ASIN_TOLERANCE, 0}, +{ 451, 2439023326u, 1881121353u, 1082366688u, 3029043132u, 2439023326u, 1881121353u, 0, ASIN_TOLERANCE, 0}, +{ 452, 192508083u, 4250650421u, 3246612558u, 2498768625u, 192508083u, 4250650421u, 0, ASIN_TOLERANCE, 0}, +{ 453, 3180747941u, 2999983605u, 1096654323u, 2577373394u, 3180747941u, 2999983605u, 0, ASIN_TOLERANCE, 0}, +{ 454, 868314815u, 1300140379u, 3213491585u, 55226854u, 868314815u, 1300140379u, 0, ASIN_TOLERANCE, 0}, +{ 455, 49966445u, 13489454u, 3217461344u, 1447224005u, 49966445u, 13489454u, 0, ASIN_TOLERANCE, 0}, +{ 456, 2210271568u, 180789028u, 3221481024u, 2263184048u, 2210271568u, 180789028u, 0, ASIN_TOLERANCE, 0}, +{ 457, 2397088667u, 426293588u, 3239818611u, 1789635787u, 2397088667u, 426293588u, 0, ASIN_TOLERANCE, 0}, +{ 458, 302342406u, 1048286093u, 3227133745u, 2920139253u, 302342406u, 1048286093u, 0, ASIN_TOLERANCE, 0}, +{ 459, 540854981u, 287184966u, 1093076159u, 1371882685u, 540854981u, 287184966u, 0, ASIN_TOLERANCE, 0}, +{ 460, 770805810u, 2474797470u, 1065280366u, 1506889536u, 770805810u, 2474797470u, 0, ASIN_TOLERANCE, 0}, +{ 461, 2555731452u, 345487446u, 1053421486u, 1197157341u, 2555731452u, 345487446u, 0, ASIN_TOLERANCE, 0}, +{ 462, 2628226629u, 515700445u, 3214016873u, 2783826669u, 2628226629u, 515700445u, 0, ASIN_TOLERANCE, 0}, +{ 463, 467959892u, 1025779807u, 3217947229u, 937205825u, 467959892u, 1025779807u, 0, ASIN_TOLERANCE, 0}, +{ 464, 3185898801u, 503864881u, 1076822915u, 2345033570u, 3185898801u, 503864881u, 0, ASIN_TOLERANCE, 0}, +{ 465, 393896468u, 596014050u, 3250464728u, 3171536734u, 393896468u, 596014050u, 0, ASIN_TOLERANCE, 0}, +{ 466, 2267420964u, 3948135817u, 3235208235u, 557360557u, 2267420964u, 3948135817u, 0, ASIN_TOLERANCE, 0}, +{ 467, 2954074298u, 110029735u, 1081878271u, 658156641u, 2954074298u, 110029735u, 0, ASIN_TOLERANCE, 0}, +{ 468, 566438875u, 2733782773u, 1068148429u, 2141208212u, 566438875u, 2733782773u, 0, ASIN_TOLERANCE, 0}, +{ 469, 2666943954u, 790308557u, 1107048971u, 563615979u, 2666943954u, 790308557u, 0, ASIN_TOLERANCE, 0}, +{ 470, 2405996540u, 2566307075u, 1083723970u, 1428203311u, 2405996540u, 2566307075u, 0, ASIN_TOLERANCE, 0}, +{ 471, 2270749356u, 3880424699u, 3236471057u, 2886278126u, 2270749356u, 3880424699u, 0, ASIN_TOLERANCE, 0}, +{ 472, 524758414u, 2701977458u, 1043006318u, 4263191658u, 524758414u, 2701977458u, 0, ASIN_TOLERANCE, 0}, +{ 473, 2942114697u, 1360096867u, 3234511235u, 722957892u, 2942114697u, 1360096867u, 0, ASIN_TOLERANCE, 0}, +{ 474, 3154505042u, 1993420044u, 1095357710u, 2156133394u, 3154505042u, 1993420044u, 0, ASIN_TOLERANCE, 0}, +{ 475, 2461372509u, 3917014693u, 3239137997u, 3218865041u, 2461372509u, 3917014693u, 0, ASIN_TOLERANCE, 0}, +{ 476, 2423614376u, 3840388050u, 1044708748u, 3339981792u, 2423614376u, 3840388050u, 0, ASIN_TOLERANCE, 0}, +{ 477, 68664930u, 2548196869u, 1075650752u, 2503792874u, 68664930u, 2548196869u, 0, ASIN_TOLERANCE, 0}, +{ 478, 27003265u, 3589631476u, 3235077884u, 2445744426u, 27003265u, 3589631476u, 0, ASIN_TOLERANCE, 0}, +{ 479, 520248228u, 203410210u, 1058974455u, 4258595472u, 520248228u, 203410210u, 0, ASIN_TOLERANCE, 0}, +{ 480, 191352353u, 3053913996u, 1043884546u, 2757616601u, 191352353u, 3053913996u, 0, ASIN_TOLERANCE, 0}, +{ 481, 2602287836u, 1038998189u, 3205430458u, 3695555540u, 2602287836u, 1038998189u, 0, ASIN_TOLERANCE, 0}, +{ 482, 2449136794u, 4118722076u, 1042468417u, 3583005947u, 2449136794u, 4118722076u, 0, ASIN_TOLERANCE, 0}, +{ 483, 2166884388u, 1539535238u, 3246934215u, 508708967u, 2166884388u, 1539535238u, 0, ASIN_TOLERANCE, 0}, +{ 484, 2298893886u, 1355147861u, 3251354609u, 4133432965u, 2298893886u, 1355147861u, 0, ASIN_TOLERANCE, 0}, +{ 485, 826309703u, 1630207738u, 3189562989u, 2643371954u, 826309703u, 1630207738u, 0, ASIN_TOLERANCE, 0}, +{ 486, 1044987158u, 3806259293u, 3242741783u, 15657985u, 1044987158u, 3806259293u, 0, ASIN_TOLERANCE, 0}, +{ 487, 497456897u, 151607638u, 3227697753u, 467630898u, 497456897u, 151607638u, 0, ASIN_TOLERANCE, 0}, +{ 488, 3017637501u, 1016107066u, 1077142954u, 2195497000u, 3017637501u, 1016107066u, 0, ASIN_TOLERANCE, 0}, +{ 489, 2893082164u, 605010161u, 1050995677u, 3081653542u, 2893082164u, 605010161u, 0, ASIN_TOLERANCE, 0}, +{ 490, 469011148u, 4071435209u, 3207925259u, 1894382776u, 469011148u, 4071435209u, 0, ASIN_TOLERANCE, 0}, +{ 491, 2531356920u, 1522707251u, 3218735666u, 1578075186u, 2531356920u, 1522707251u, 0, ASIN_TOLERANCE, 0}, +{ 492, 431642664u, 1500392608u, 3190947192u, 3634607405u, 431642664u, 1500392608u, 0, ASIN_TOLERANCE, 0}, +{ 493, 2582144456u, 3646244007u, 3197852749u, 3808681655u, 2582144456u, 3646244007u, 0, ASIN_TOLERANCE, 0}, +{ 494, 233126338u, 1821773119u, 1094752155u, 1757234723u, 233126338u, 1821773119u, 0, ASIN_TOLERANCE, 0}, +{ 495, 2765502023u, 3794954283u, 3238755664u, 1209121339u, 2765502023u, 3794954283u, 0, ASIN_TOLERANCE, 0}, +{ 496, 2342622984u, 1775878726u, 1096028209u, 221183908u, 2342622984u, 1775878726u, 0, ASIN_TOLERANCE, 0}, +{ 497, 231520693u, 615054313u, 1105995987u, 1405024657u, 231520693u, 615054313u, 0, ASIN_TOLERANCE, 0}, +{ 498, 2401381272u, 2784860416u, 1074009275u, 787419698u, 2401381272u, 2784860416u, 0, ASIN_TOLERANCE, 0}, +{ 499, 943699878u, 2079960298u, 1074123223u, 2100091620u, 943699878u, 2079960298u, 0, ASIN_TOLERANCE, 0}, +{ 500, 592542034u, 311050208u, 3211234312u, 806358659u, 592542034u, 311050208u, 0, ASIN_TOLERANCE, 0}, +{ 501, 554939259u, 898080849u, 1106754706u, 2510882902u, 554939259u, 898080849u, 0, ASIN_TOLERANCE, 0}, +{ 502, 2949198761u, 2015533813u, 1089275809u, 298982001u, 2949198761u, 2015533813u, 0, ASIN_TOLERANCE, 0}, +{ 503, 989540066u, 914741728u, 1092886795u, 464054401u, 989540066u, 914741728u, 0, ASIN_TOLERANCE, 0}, +{ 504, 2304253208u, 3863739765u, 3214711653u, 3915767823u, 2304253208u, 3863739765u, 0, ASIN_TOLERANCE, 0}, +{ 505, 958251880u, 3239739200u, 1104805370u, 2971054003u, 958251880u, 3239739200u, 0, ASIN_TOLERANCE, 0}, +{ 506, 2670649374u, 2491104644u, 3198242303u, 2559304728u, 2670649374u, 2491104644u, 0, ASIN_TOLERANCE, 0}, +{ 507, 939123286u, 684435317u, 1055177809u, 2787628393u, 939123286u, 684435317u, 0, ASIN_TOLERANCE, 0}, +{ 508, 2541359251u, 1636085321u, 1069717586u, 4235233108u, 2541359251u, 1636085321u, 0, ASIN_TOLERANCE, 0}, +{ 509, 1044593898u, 202708387u, 3196003256u, 482423661u, 1044593898u, 202708387u, 0, ASIN_TOLERANCE, 0}, +{ 510, 139626925u, 2518164801u, 3206911657u, 1250530357u, 139626925u, 2518164801u, 0, ASIN_TOLERANCE, 0}, +{ 511, 2850784019u, 3737313137u, 1045922781u, 3136078996u, 2850784019u, 3737313137u, 0, ASIN_TOLERANCE, 0}, +{ 512, 2263385372u, 2650572904u, 3215945256u, 2341430700u, 2263385372u, 2650572904u, 0, ASIN_TOLERANCE, 0}, +{ 513, 2703884311u, 4279456618u, 1045375126u, 3817511514u, 2703884311u, 4279456618u, 0, ASIN_TOLERANCE, 0}, +{ 514, 2332933790u, 1898920133u, 3238856617u, 3322385778u, 2332933790u, 1898920133u, 0, ASIN_TOLERANCE, 0}, +{ 515, 628125129u, 769863378u, 3205646293u, 3033900668u, 628125129u, 769863378u, 0, ASIN_TOLERANCE, 0}, +{ 516, 3150112853u, 2363605017u, 1057042323u, 3607277737u, 3150112853u, 2363605017u, 0, ASIN_TOLERANCE, 0}, +{ 517, 453059902u, 2102433536u, 1073687186u, 1772007848u, 453059902u, 2102433536u, 0, ASIN_TOLERANCE, 0}, +{ 518, 3088101403u, 1756195518u, 3225902960u, 1222779056u, 3088101403u, 1756195518u, 0, ASIN_TOLERANCE, 0}, +{ 519, 936228020u, 1142293403u, 3242693386u, 741039297u, 936228020u, 1142293403u, 0, ASIN_TOLERANCE, 0}, +{ 520, 1034983355u, 2830408439u, 1041913758u, 3306391490u, 1034983355u, 2830408439u, 0, ASIN_TOLERANCE, 0}, +{ 521, 2352979086u, 2205233857u, 1075419064u, 4008575827u, 2352979086u, 2205233857u, 0, ASIN_TOLERANCE, 0}, +{ 522, 445518797u, 2566866389u, 1094655457u, 4036587454u, 445518797u, 2566866389u, 0, ASIN_TOLERANCE, 0}, +{ 523, 311145393u, 1824828952u, 3243078353u, 4292530873u, 311145393u, 1824828952u, 0, ASIN_TOLERANCE, 0}, +{ 524, 2553824191u, 4155068217u, 3207589361u, 3447729183u, 2553824191u, 4155068217u, 0, ASIN_TOLERANCE, 0}, +{ 525, 2798856384u, 2756570858u, 1076273685u, 3333057399u, 2798856384u, 2756570858u, 0, ASIN_TOLERANCE, 0}, +{ 526, 2550428645u, 1207089191u, 1092166391u, 1769908602u, 2550428645u, 1207089191u, 0, ASIN_TOLERANCE, 0}, +{ 527, 554295846u, 859290299u, 1041428225u, 1286082196u, 554295846u, 859290299u, 0, ASIN_TOLERANCE, 0}, +{ 528, 246159230u, 2207831048u, 1106576697u, 1339163028u, 246159230u, 2207831048u, 0, ASIN_TOLERANCE, 0}, +{ 529, 2239899566u, 1165991857u, 3203879091u, 4174125604u, 2239899566u, 1165991857u, 0, ASIN_TOLERANCE, 0}, +{ 530, 182461702u, 2169701868u, 3241819561u, 4227279451u, 182461702u, 2169701868u, 0, ASIN_TOLERANCE, 0}, +{ 531, 2888196098u, 2123622490u, 1052662593u, 2279271809u, 2888196098u, 2123622490u, 0, ASIN_TOLERANCE, 0}, +{ 532, 702835388u, 695374285u, 1047701002u, 522745399u, 702835388u, 695374285u, 0, ASIN_TOLERANCE, 0}, +{ 533, 280094216u, 1510677208u, 1076782817u, 1111322288u, 280094216u, 1510677208u, 0, ASIN_TOLERANCE, 0}, +{ 534, 179077993u, 2623205988u, 1103171923u, 4172761053u, 179077993u, 2623205988u, 0, ASIN_TOLERANCE, 0}, +{ 535, 2177736938u, 4217535562u, 1105411820u, 178360855u, 2177736938u, 4217535562u, 0, ASIN_TOLERANCE, 0}, +{ 536, 682463458u, 3302529767u, 3204908280u, 3960051056u, 682463458u, 3302529767u, 0, ASIN_TOLERANCE, 0}, +{ 537, 398729522u, 3128926115u, 3230393394u, 689920399u, 398729522u, 3128926115u, 0, ASIN_TOLERANCE, 0}, +{ 538, 2611898873u, 2975884353u, 1080874032u, 706326922u, 2611898873u, 2975884353u, 0, ASIN_TOLERANCE, 0}, +{ 539, 893776139u, 198291836u, 1095644375u, 1686271744u, 893776139u, 198291836u, 0, ASIN_TOLERANCE, 0}, +{ 540, 2380685920u, 3678973777u, 3196054178u, 2497695971u, 2380685920u, 3678973777u, 0, ASIN_TOLERANCE, 0}, +{ 541, 2240996065u, 3714083293u, 3243953714u, 2851269113u, 2240996065u, 3714083293u, 0, ASIN_TOLERANCE, 0}, +{ 542, 7542429u, 2117586075u, 1087270529u, 1032855763u, 7542429u, 2117586075u, 0, ASIN_TOLERANCE, 0}, +{ 543, 2223653732u, 3495001046u, 1086693149u, 4162905644u, 2223653732u, 3495001046u, 0, ASIN_TOLERANCE, 0}, +{ 544, 2567370325u, 2825204949u, 3197807718u, 3067810875u, 2567370325u, 2825204949u, 0, ASIN_TOLERANCE, 0}, +{ 545, 2595670946u, 3719019697u, 1095625346u, 658578931u, 2595670946u, 3719019697u, 0, ASIN_TOLERANCE, 0}, +{ 546, 387363057u, 2429869396u, 3239113006u, 3188949762u, 387363057u, 2429869396u, 0, ASIN_TOLERANCE, 0}, +{ 547, 396063874u, 322135328u, 3248332291u, 1527590526u, 396063874u, 322135328u, 0, ASIN_TOLERANCE, 0}, +{ 548, 2461424020u, 2823164069u, 3201760069u, 602345917u, 2461424020u, 2823164069u, 0, ASIN_TOLERANCE, 0}, +{ 549, 654769735u, 720378027u, 1076110022u, 259686655u, 654769735u, 720378027u, 0, ASIN_TOLERANCE, 0}, +{ 550, 2360883068u, 625961575u, 1060816217u, 2476435835u, 2360883068u, 625961575u, 0, ASIN_TOLERANCE, 0}, +{ 551, 788830837u, 606139429u, 3232916885u, 3326100828u, 788830837u, 606139429u, 0, ASIN_TOLERANCE, 0}, +{ 552, 3212982376u, 2141060868u, 1067726443u, 252856858u, 3212982392u, 1078759082u, 0, ASIN_TOLERANCE, 0}, +{ 553, 3127084040u, 474202816u, 1089644854u, 1764399210u, 3127084040u, 474202816u, 0, ASIN_TOLERANCE, 0}, +{ 554, 1019198392u, 2947116437u, 1041572001u, 3959708969u, 1019198392u, 2947116437u, 0, ASIN_TOLERANCE, 0}, +{ 555, 3213251752u, 4230614930u, 1056210276u, 3150822221u, 3213251781u, 4230967581u, 0, ASIN_TOLERANCE, 0}, +{ 556, 696157297u, 3263173528u, 1080112083u, 1228319033u, 696157297u, 3263173528u, 0, ASIN_TOLERANCE, 0}, +{ 557, 124362722u, 500312015u, 1063102682u, 2095470952u, 124362722u, 500312015u, 0, ASIN_TOLERANCE, 0}, +{ 558, 2571317678u, 989529088u, 1056203473u, 3527737002u, 2571317678u, 989529088u, 0, ASIN_TOLERANCE, 0}, +{ 559, 2250338535u, 1703579132u, 3224570219u, 634351649u, 2250338535u, 1703579132u, 0, ASIN_TOLERANCE, 0}, +{ 560, 2855421441u, 66133u, 3240749422u, 3515147331u, 2855421441u, 66133u, 0, ASIN_TOLERANCE, 0}, +{ 561, 2627889255u, 2627336059u, 1089793281u, 1944911728u, 2627889255u, 2627336059u, 0, ASIN_TOLERANCE, 0}, +{ 562, 759942356u, 2319970119u, 3249679385u, 445677602u, 759942356u, 2319970119u, 0, ASIN_TOLERANCE, 0}, +{ 563, 2547610355u, 3313890389u, 1096842854u, 754196284u, 2547610355u, 3313890389u, 0, ASIN_TOLERANCE, 0}, +{ 564, 2871033704u, 1726998596u, 3210485282u, 4166556675u, 2871033704u, 1726998596u, 0, ASIN_TOLERANCE, 0}, +{ 565, 501872914u, 486863841u, 3218994498u, 2509132460u, 501872914u, 486863841u, 0, ASIN_TOLERANCE, 0}, +{ 566, 1002164234u, 2205707903u, 1085826634u, 3041478081u, 1002164234u, 2205707903u, 0, ASIN_TOLERANCE, 0}, +{ 567, 525633549u, 4009409345u, 1040942443u, 2147611409u, 525633549u, 4009409345u, 0, ASIN_TOLERANCE, 0}, +{ 568, 2251207280u, 2036870072u, 1084696514u, 3107506430u, 2251207280u, 2036870072u, 0, ASIN_TOLERANCE, 0}, +{ 569, 756690877u, 690866455u, 3226560542u, 2431563109u, 756690877u, 690866455u, 0, ASIN_TOLERANCE, 0}, +{ 570, 998557361u, 3129862588u, 3198582472u, 2304023232u, 998557361u, 3129862588u, 0, ASIN_TOLERANCE, 0}, +{ 571, 2906016865u, 3579751536u, 3209420505u, 975391569u, 2906016865u, 3579751536u, 0, ASIN_TOLERANCE, 0}, +{ 572, 2560287784u, 546279008u, 1081489128u, 2489420520u, 2560287784u, 546279008u, 0, ASIN_TOLERANCE, 0}, +{ 573, 31598644u, 3355765111u, 3194253290u, 994990765u, 31598644u, 3355765111u, 0, ASIN_TOLERANCE, 0}, +{ 574, 2828168124u, 1040855381u, 1043794244u, 3259056345u, 2828168124u, 1040855381u, 0, ASIN_TOLERANCE, 0}, +{ 575, 2926398160u, 3002823940u, 1089005277u, 3148403594u, 2926398160u, 3002823940u, 0, ASIN_TOLERANCE, 0}, +{ 576, 860472364u, 4135775260u, 1062496213u, 1421204191u, 860472364u, 4135775260u, 0, ASIN_TOLERANCE, 0}, +{ 577, 2375372972u, 1772673503u, 1068413298u, 3250253780u, 2375372972u, 1772673503u, 0, ASIN_TOLERANCE, 0}, +{ 578, 2382680286u, 1058735200u, 3198812726u, 2912456147u, 2382680286u, 1058735200u, 0, ASIN_TOLERANCE, 0}, +{ 579, 207257772u, 3116809444u, 3228961207u, 1489607764u, 207257772u, 3116809444u, 0, ASIN_TOLERANCE, 0}, +{ 580, 3161255502u, 3193356522u, 1098081503u, 3349879051u, 3161255502u, 3193356522u, 0, ASIN_TOLERANCE, 0}, +{ 581, 2263814703u, 3863515794u, 3224248078u, 811645039u, 2263814703u, 3863515794u, 0, ASIN_TOLERANCE, 0}, +{ 582, 2558000392u, 257027843u, 3188376713u, 3688710472u, 2558000392u, 257027843u, 0, ASIN_TOLERANCE, 0}, +{ 583, 1047583344u, 1618589681u, 3252953815u, 1796441468u, 1047583344u, 1618589684u, 0, ASIN_TOLERANCE, 0}, +{ 584, 963715447u, 2772711004u, 1068817762u, 1417472413u, 963715447u, 2772711004u, 0, ASIN_TOLERANCE, 0}, +{ 585, 2899022012u, 3229431619u, 1048945392u, 2667359336u, 2899022012u, 3229431619u, 0, ASIN_TOLERANCE, 0}, +{ 586, 39332833u, 3031365654u, 3254047221u, 3088152449u, 39332833u, 3031365654u, 0, ASIN_TOLERANCE, 0}, +{ 587, 2400099045u, 1889351944u, 1105391374u, 3778764776u, 2400099045u, 1889351944u, 0, ASIN_TOLERANCE, 0}, +{ 588, 2853164987u, 2277852166u, 3203738947u, 1874699830u, 2853164987u, 2277852166u, 0, ASIN_TOLERANCE, 0}, +{ 589, 2730925178u, 341842475u, 1075005257u, 146768835u, 2730925178u, 341842475u, 0, ASIN_TOLERANCE, 0}, +{ 590, 2308700527u, 2872887668u, 1084601028u, 2879218577u, 2308700527u, 2872887668u, 0, ASIN_TOLERANCE, 0}, +{ 591, 2587566446u, 1935797167u, 1071669036u, 2712989912u, 2587566446u, 1935797167u, 0, ASIN_TOLERANCE, 0}, +{ 592, 253790896u, 1441615044u, 1092569414u, 3235243477u, 253790896u, 1441615044u, 0, ASIN_TOLERANCE, 0}, +{ 593, 2246162369u, 3221475559u, 1076923264u, 1614189331u, 2246162369u, 3221475559u, 0, ASIN_TOLERANCE, 0}, +{ 594, 883591469u, 1521698692u, 1063187098u, 2905773788u, 883591469u, 1521698692u, 0, ASIN_TOLERANCE, 0}, +{ 595, 578813437u, 1875339612u, 1097776841u, 3512997257u, 578813437u, 1875339612u, 0, ASIN_TOLERANCE, 0}, +{ 596, 313284539u, 1310991474u, 1042232933u, 315006632u, 313284539u, 1310991474u, 0, ASIN_TOLERANCE, 0}, +{ 597, 2187872770u, 400944269u, 1084139528u, 1113187101u, 2187872770u, 400944269u, 0, ASIN_TOLERANCE, 0}, +{ 598, 2196755783u, 4228884820u, 1086244087u, 4239134992u, 2196755783u, 4228884820u, 0, ASIN_TOLERANCE, 0}, +{ 599, 625667119u, 3885190346u, 1076394312u, 1081883031u, 625667119u, 3885190346u, 0, ASIN_TOLERANCE, 0}, +{ 600, 102978620u, 1185360438u, 1047721048u, 3255616886u, 102978620u, 1185360438u, 0, ASIN_TOLERANCE, 0}, +{ 601, 253870868u, 3242646057u, 3206743917u, 2797651324u, 253870868u, 3242646057u, 0, ASIN_TOLERANCE, 0}, +{ 602, 2741016991u, 2374818327u, 3200069106u, 409774909u, 2741016991u, 2374818327u, 0, ASIN_TOLERANCE, 0}, +{ 603, 541948600u, 129626762u, 3222418776u, 3265842151u, 541948600u, 129626762u, 0, ASIN_TOLERANCE, 0}, +{ 604, 409023275u, 2563211098u, 3195891786u, 3312029907u, 409023275u, 2563211098u, 0, ASIN_TOLERANCE, 0}, +{ 605, 590108432u, 2326742435u, 1061528026u, 3658027611u, 590108432u, 2326742435u, 0, ASIN_TOLERANCE, 0}, +{ 606, 47946496u, 4130434851u, 1086613209u, 1406937614u, 47946496u, 4130434851u, 0, ASIN_TOLERANCE, 0}, +{ 607, 2203282384u, 694337229u, 1098392210u, 673996985u, 2203282384u, 694337229u, 0, ASIN_TOLERANCE, 0}, +{ 608, 383120483u, 2165782899u, 3201118320u, 755437166u, 383120483u, 2165782899u, 0, ASIN_TOLERANCE, 0}, +{ 609, 2738514249u, 1631447464u, 1073129346u, 1109813769u, 2738514249u, 1631447464u, 0, ASIN_TOLERANCE, 0}, +{ 610, 996195808u, 1404490212u, 3191965790u, 388374829u, 996195808u, 1404490212u, 0, ASIN_TOLERANCE, 0}, +{ 611, 621407424u, 1187403069u, 3249235911u, 2333348025u, 621407424u, 1187403069u, 0, ASIN_TOLERANCE, 0}, +{ 612, 2238876819u, 3949359805u, 3217090542u, 278931643u, 2238876819u, 3949359805u, 0, ASIN_TOLERANCE, 0}, +{ 613, 122205568u, 3433131795u, 3216075884u, 1048643019u, 122205568u, 3433131795u, 0, ASIN_TOLERANCE, 0}, +{ 614, 378630966u, 2161249988u, 1080050285u, 1886767872u, 378630966u, 2161249988u, 0, ASIN_TOLERANCE, 0}, +{ 615, 2469519430u, 56508471u, 1101093005u, 3134765996u, 2469519430u, 56508471u, 0, ASIN_TOLERANCE, 0}, +{ 616, 2160574759u, 390814486u, 3252597757u, 4155481783u, 2160574759u, 390814486u, 0, ASIN_TOLERANCE, 0}, +{ 617, 244834788u, 2634623473u, 1106605935u, 3462407026u, 244834788u, 2634623473u, 0, ASIN_TOLERANCE, 0}, +{ 618, 3068667858u, 1081553801u, 3212510682u, 3597193645u, 3068667858u, 1081553801u, 0, ASIN_TOLERANCE, 0}, +{ 619, 2681145113u, 2712139310u, 1067397110u, 3991830201u, 2681145113u, 2712139310u, 0, ASIN_TOLERANCE, 0}, +{ 620, 2469611210u, 1021245839u, 1043439185u, 1476242017u, 2469611210u, 1021245839u, 0, ASIN_TOLERANCE, 0}, +{ 621, 605118806u, 3027425274u, 1057959382u, 1693579371u, 605118806u, 3027425274u, 0, ASIN_TOLERANCE, 0}, +{ 622, 723258643u, 890268116u, 3208358957u, 2499328701u, 723258643u, 890268116u, 0, ASIN_TOLERANCE, 0}, +{ 623, 3012075542u, 2762939960u, 1094140192u, 1946947338u, 3012075542u, 2762939960u, 0, ASIN_TOLERANCE, 0}, +{ 624, 2624504981u, 2848774892u, 1043728239u, 1868742480u, 2624504981u, 2848774892u, 0, ASIN_TOLERANCE, 0}, +{ 625, 631395565u, 2118639219u, 3208384560u, 392586300u, 631395565u, 2118639219u, 0, ASIN_TOLERANCE, 0}, +{ 626, 3100564519u, 3212404590u, 3227625019u, 2217276325u, 3100564519u, 3212404590u, 0, ASIN_TOLERANCE, 0}, +{ 627, 2726525578u, 3155371392u, 1098886483u, 418306480u, 2726525578u, 3155371392u, 0, ASIN_TOLERANCE, 0}, +{ 628, 404732165u, 2073105109u, 3222252812u, 4126276047u, 404732165u, 2073105109u, 0, ASIN_TOLERANCE, 0}, +{ 629, 666104043u, 3942715706u, 3225850891u, 2149087853u, 666104043u, 3942715706u, 0, ASIN_TOLERANCE, 0}, +{ 630, 691861022u, 2516919494u, 1054814504u, 3292931762u, 691861022u, 2516919494u, 0, ASIN_TOLERANCE, 0}, +{ 631, 158110000u, 1551415022u, 3207905213u, 640268289u, 158110000u, 1551415022u, 0, ASIN_TOLERANCE, 0}, +{ 632, 3017186687u, 576149615u, 1089986684u, 1988363455u, 3017186687u, 576149615u, 0, ASIN_TOLERANCE, 0}, +{ 633, 2189052396u, 3827250147u, 1092018604u, 3082769758u, 2189052396u, 3827250147u, 0, ASIN_TOLERANCE, 0}, +{ 634, 2963530013u, 2640124381u, 3224863391u, 3684597672u, 2963530013u, 2640124381u, 0, ASIN_TOLERANCE, 0}, +{ 635, 2674433095u, 3504206450u, 3208001954u, 1486636350u, 2674433095u, 3504206450u, 0, ASIN_TOLERANCE, 0}, +{ 636, 172271302u, 3087550224u, 1050189716u, 1104066383u, 172271302u, 3087550224u, 0, ASIN_TOLERANCE, 0}, +{ 637, 2937291508u, 3152457596u, 3248116497u, 1671039260u, 2937291508u, 3152457596u, 0, ASIN_TOLERANCE, 0}, +{ 638, 743510680u, 3745833360u, 1104273854u, 220649566u, 743510680u, 3745833360u, 0, ASIN_TOLERANCE, 0}, +{ 639, 455612679u, 3044998553u, 3244012440u, 3016971473u, 455612679u, 3044998553u, 0, ASIN_TOLERANCE, 0}, +{ 640, 2707727413u, 3615317113u, 1060844794u, 880769846u, 2707727413u, 3615317113u, 0, ASIN_TOLERANCE, 0}, +{ 641, 91972307u, 663715669u, 1063876456u, 1939925527u, 91972307u, 663715669u, 0, ASIN_TOLERANCE, 0}, +{ 642, 1031258381u, 3544355485u, 1082114513u, 2610512411u, 1031258381u, 3544355485u, 0, ASIN_TOLERANCE, 0}, +{ 643, 3062260532u, 4072884955u, 1076396408u, 1001273000u, 3062260532u, 4072884955u, 0, ASIN_TOLERANCE, 0}, +{ 644, 169240433u, 1808609104u, 3232187528u, 3260138616u, 169240433u, 1808609104u, 0, ASIN_TOLERANCE, 0}, +{ 645, 982018300u, 1018873491u, 3222306114u, 3725685935u, 982018300u, 1018873491u, 0, ASIN_TOLERANCE, 0}, +{ 646, 601770903u, 200987283u, 1044223733u, 3512285706u, 601770903u, 200987283u, 0, ASIN_TOLERANCE, 0}, +{ 647, 2542854589u, 4073670723u, 1077133533u, 2092229545u, 2542854589u, 4073670723u, 0, ASIN_TOLERANCE, 0}, +{ 648, 2434772723u, 1045739827u, 1099698978u, 2401260358u, 2434772723u, 1045739827u, 0, ASIN_TOLERANCE, 0}, +{ 649, 513980741u, 4127547980u, 1041823582u, 96012619u, 513980741u, 4127547980u, 0, ASIN_TOLERANCE, 0}, +{ 650, 2244412580u, 685986273u, 3236054528u, 743504842u, 2244412580u, 685986273u, 0, ASIN_TOLERANCE, 0}, +{ 651, 3152410687u, 3762173332u, 3229804761u, 4257281451u, 3152410687u, 3762173332u, 0, ASIN_TOLERANCE, 0}, +{ 652, 2398221552u, 883225705u, 1052657715u, 3748197546u, 2398221552u, 883225705u, 0, ASIN_TOLERANCE, 0}, +{ 653, 2914372880u, 1745689276u, 3189483003u, 3144701638u, 2914372880u, 1745689276u, 0, ASIN_TOLERANCE, 0}, +{ 654, 584466975u, 1188703132u, 3241765574u, 2567092606u, 584466975u, 1188703132u, 0, ASIN_TOLERANCE, 0}, +{ 655, 3142928545u, 1507281554u, 1093182670u, 3093165197u, 3142928545u, 1507281554u, 0, ASIN_TOLERANCE, 0}, +{ 656, 525538133u, 2853215019u, 1102960933u, 4219424176u, 525538133u, 2853215019u, 0, ASIN_TOLERANCE, 0}, +{ 657, 743378254u, 3350157882u, 3218026125u, 3380902958u, 743378254u, 3350157882u, 0, ASIN_TOLERANCE, 0}, +{ 658, 2920865644u, 3965656635u, 1041729367u, 1488955390u, 2920865644u, 3965656635u, 0, ASIN_TOLERANCE, 0}, +{ 659, 76342162u, 4066317764u, 3250193636u, 3709306303u, 76342162u, 4066317764u, 0, ASIN_TOLERANCE, 0}, +{ 660, 778187300u, 3648159195u, 1060671775u, 4137599200u, 778187300u, 3648159195u, 0, ASIN_TOLERANCE, 0}, +{ 661, 298140314u, 1730811304u, 3218425255u, 3228251203u, 298140314u, 1730811304u, 0, ASIN_TOLERANCE, 0}, +{ 662, 548008019u, 1112642402u, 1046926075u, 2339033206u, 548008019u, 1112642402u, 0, ASIN_TOLERANCE, 0}, +{ 663, 373953465u, 3920135590u, 1068578082u, 3455242298u, 373953465u, 3920135590u, 0, ASIN_TOLERANCE, 0}, +{ 664, 466000998u, 171021716u, 1104170032u, 643991456u, 466000998u, 171021716u, 0, ASIN_TOLERANCE, 0}, +{ 665, 2888399469u, 2072550721u, 3230599505u, 973021091u, 2888399469u, 2072550721u, 0, ASIN_TOLERANCE, 0}, +{ 666, 50905317u, 2724027649u, 1085564300u, 4142466137u, 50905317u, 2724027649u, 0, ASIN_TOLERANCE, 0}, +{ 667, 143727064u, 2551822580u, 3246069024u, 1987298072u, 143727064u, 2551822580u, 0, ASIN_TOLERANCE, 0}, +{ 668, 890335217u, 3397840241u, 3222713245u, 1041924997u, 890335217u, 3397840241u, 0, ASIN_TOLERANCE, 0}, +{ 669, 2679007644u, 1492572480u, 1050371810u, 2325437597u, 2679007644u, 1492572480u, 0, ASIN_TOLERANCE, 0}, +{ 670, 114124970u, 2135762681u, 3203689878u, 3625230590u, 114124970u, 2135762681u, 0, ASIN_TOLERANCE, 0}, +{ 671, 2580021722u, 3462823473u, 1042304476u, 902729486u, 2580021722u, 3462823473u, 0, ASIN_TOLERANCE, 0}, +{ 672, 2558456833u, 652173352u, 1093628675u, 363109783u, 2558456833u, 652173352u, 0, ASIN_TOLERANCE, 0}, +{ 673, 2931846653u, 3131010476u, 3195084967u, 2163853087u, 2931846653u, 3131010476u, 0, ASIN_TOLERANCE, 0}, +{ 674, 2860857242u, 2962422808u, 3191806742u, 291534500u, 2860857242u, 2962422808u, 0, ASIN_TOLERANCE, 0}, +{ 675, 3180910087u, 148717545u, 3227570855u, 1176638793u, 3180910087u, 148717545u, 0, ASIN_TOLERANCE, 0}, +{ 676, 846507519u, 592218494u, 3236967859u, 3643659929u, 846507519u, 592218494u, 0, ASIN_TOLERANCE, 0}, +{ 677, 799992724u, 3637018510u, 1096065187u, 2759677467u, 799992724u, 3637018510u, 0, ASIN_TOLERANCE, 0}, +{ 678, 2669496048u, 1394154169u, 3225515010u, 2895919661u, 2669496048u, 1394154169u, 0, ASIN_TOLERANCE, 0}, +{ 679, 2888699650u, 2576460670u, 3195138207u, 278693366u, 2888699650u, 2576460670u, 0, ASIN_TOLERANCE, 0}, +{ 680, 2397030301u, 3525993125u, 1046206559u, 960482701u, 2397030301u, 3525993125u, 0, ASIN_TOLERANCE, 0}, +{ 681, 566728356u, 3623493345u, 3245957327u, 2358092842u, 566728356u, 3623493345u, 0, ASIN_TOLERANCE, 0}, +{ 682, 2920406944u, 1470157513u, 1068598730u, 2360266862u, 2920406944u, 1470157513u, 0, ASIN_TOLERANCE, 0}, +{ 683, 287105933u, 2673272949u, 3190126532u, 3307152371u, 287105933u, 2673272949u, 0, ASIN_TOLERANCE, 0}, +{ 684, 2190509100u, 3554040933u, 3243091661u, 1074231128u, 2190509100u, 3554040933u, 0, ASIN_TOLERANCE, 0}, +{ 685, 2949859096u, 506000682u, 1099596445u, 3719284608u, 2949859096u, 506000682u, 0, ASIN_TOLERANCE, 0}, +{ 686, 143293603u, 1500851201u, 1079029789u, 395506977u, 143293603u, 1500851201u, 0, ASIN_TOLERANCE, 0}, +{ 687, 2216398316u, 2396922893u, 3215773801u, 3631674284u, 2216398316u, 2396922893u, 0, ASIN_TOLERANCE, 0}, +{ 688, 94791165u, 265423085u, 1064366729u, 2757995135u, 94791165u, 265423085u, 0, ASIN_TOLERANCE, 0}, +{ 689, 2260683291u, 3335726874u, 3204388695u, 1913160810u, 2260683291u, 3335726874u, 0, ASIN_TOLERANCE, 0}, +{ 690, 985593981u, 177525642u, 1089544219u, 1163479070u, 985593981u, 177525642u, 0, ASIN_TOLERANCE, 0}, +{ 691, 1059251204u, 1356562406u, 3218720719u, 3954981400u, 1059251204u, 1374970644u, 0, ASIN_TOLERANCE, 0}, +{ 692, 199560954u, 2411049585u, 3200282058u, 4212977532u, 199560954u, 2411049585u, 0, ASIN_TOLERANCE, 0}, +{ 693, 3115392997u, 1969400668u, 1082838033u, 792484989u, 3115392997u, 1969400668u, 0, ASIN_TOLERANCE, 0}, +{ 694, 413791550u, 3185069889u, 1102744820u, 1679200952u, 413791550u, 3185069889u, 0, ASIN_TOLERANCE, 0}, +{ 695, 816641623u, 2092563199u, 1077400892u, 3625477257u, 816641623u, 2092563199u, 0, ASIN_TOLERANCE, 0}, +{ 696, 990732070u, 3645477920u, 3233940628u, 730323504u, 990732070u, 3645477920u, 0, ASIN_TOLERANCE, 0}, +{ 697, 2640158643u, 1955024619u, 3229376333u, 3062236193u, 2640158643u, 1955024619u, 0, ASIN_TOLERANCE, 0}, +{ 698, 748924276u, 673553144u, 3222681322u, 3821101717u, 748924276u, 673553144u, 0, ASIN_TOLERANCE, 0}, +{ 699, 872312580u, 2833907590u, 1087265939u, 2570284543u, 872312580u, 2833907590u, 0, ASIN_TOLERANCE, 0}, +{ 700, 531712086u, 2911302424u, 1088378861u, 3400401866u, 531712086u, 2911302424u, 0, ASIN_TOLERANCE, 0}, +{ 701, 541730201u, 552676385u, 1048022712u, 1642148205u, 541730201u, 552676385u, 0, ASIN_TOLERANCE, 0}, +{ 702, 323876482u, 3259465719u, 1063427827u, 4168942284u, 323876482u, 3259465719u, 0, ASIN_TOLERANCE, 0}, +{ 703, 2757624524u, 757177023u, 3224829944u, 54374532u, 2757624524u, 757177023u, 0, ASIN_TOLERANCE, 0}, +{ 704, 25847614u, 3253287925u, 3239197056u, 3859570507u, 25847614u, 3253287925u, 0, ASIN_TOLERANCE, 0}, +{ 705, 2460961478u, 3154974007u, 1089011136u, 3913013165u, 2460961478u, 3154974007u, 0, ASIN_TOLERANCE, 0}, +{ 706, 311234957u, 2785357403u, 1103967007u, 2809598610u, 311234957u, 2785357403u, 0, ASIN_TOLERANCE, 0}, +{ 707, 484603275u, 3644503084u, 1071705136u, 2739219317u, 484603275u, 3644503084u, 0, ASIN_TOLERANCE, 0}, +{ 708, 2578002590u, 3518663743u, 1085926548u, 3708967464u, 2578002590u, 3518663743u, 0, ASIN_TOLERANCE, 0}, +{ 709, 3007242152u, 731479478u, 1076236288u, 2805941787u, 3007242152u, 731479478u, 0, ASIN_TOLERANCE, 0}, +{ 710, 2619048947u, 779131141u, 3197589176u, 237706897u, 2619048947u, 779131141u, 0, ASIN_TOLERANCE, 0}, +{ 711, 2641650858u, 2888131473u, 3245067887u, 2007039966u, 2641650858u, 2888131473u, 0, ASIN_TOLERANCE, 0}, +{ 712, 878934658u, 2219795442u, 1097959451u, 920385234u, 878934658u, 2219795442u, 0, ASIN_TOLERANCE, 0}, +{ 713, 970070259u, 1786246284u, 3210593296u, 3141517655u, 970070259u, 1786246284u, 0, ASIN_TOLERANCE, 0}, +{ 714, 28474706u, 1268866168u, 1056332378u, 3807437549u, 28474706u, 1268866168u, 0, ASIN_TOLERANCE, 0}, +{ 715, 593283356u, 2441697849u, 1095257734u, 352511160u, 593283356u, 2441697849u, 0, ASIN_TOLERANCE, 0}, +{ 716, 537273837u, 3291810518u, 1078085447u, 381074875u, 537273837u, 3291810518u, 0, ASIN_TOLERANCE, 0}, +{ 717, 466362499u, 387817055u, 3243585398u, 409681933u, 466362499u, 387817055u, 0, ASIN_TOLERANCE, 0}, +{ 718, 337512666u, 139599181u, 1104463616u, 3501253426u, 337512666u, 139599181u, 0, ASIN_TOLERANCE, 0}, +{ 719, 152302801u, 1804177501u, 1107025740u, 30866148u, 152302801u, 1804177501u, 0, ASIN_TOLERANCE, 0}, +{ 720, 2982215560u, 793748989u, 1082924614u, 1001569450u, 2982215560u, 793748989u, 0, ASIN_TOLERANCE, 0}, +{ 721, 3089760601u, 959143764u, 1058620462u, 2685722619u, 3089760601u, 959143764u, 0, ASIN_TOLERANCE, 0}, +{ 722, 2594786226u, 1587148467u, 1069298743u, 2465926195u, 2594786226u, 1587148467u, 0, ASIN_TOLERANCE, 0}, +{ 723, 932092665u, 2374376082u, 1041131964u, 1275798358u, 932092665u, 2374376082u, 0, ASIN_TOLERANCE, 0}, +{ 724, 3064898943u, 732591095u, 1105513168u, 188500721u, 3064898943u, 732591095u, 0, ASIN_TOLERANCE, 0}, +{ 725, 833576046u, 2203077164u, 1086779764u, 2814822707u, 833576046u, 2203077164u, 0, ASIN_TOLERANCE, 0}, +{ 726, 414881598u, 3478844638u, 1064472491u, 3289144186u, 414881598u, 3478844638u, 0, ASIN_TOLERANCE, 0}, +{ 727, 964227992u, 2435698269u, 3249016304u, 440309030u, 964227992u, 2435698269u, 0, ASIN_TOLERANCE, 0}, +{ 728, 2567296069u, 3788040806u, 3187722224u, 3342255097u, 2567296069u, 3788040806u, 0, ASIN_TOLERANCE, 0}, +{ 729, 723295838u, 2455751020u, 1103514973u, 3245053142u, 723295838u, 2455751020u, 0, ASIN_TOLERANCE, 0}, +{ 730, 844693850u, 4056651767u, 3239516201u, 4169582895u, 844693850u, 4056651767u, 0, ASIN_TOLERANCE, 0}, +{ 731, 550385160u, 2093642662u, 1100623425u, 792491672u, 550385160u, 2093642662u, 0, ASIN_TOLERANCE, 0}, +{ 732, 2816313046u, 83889365u, 1087600688u, 1006331335u, 2816313046u, 83889365u, 0, ASIN_TOLERANCE, 0}, +{ 733, 2572367713u, 1140517802u, 3243890765u, 4090711271u, 2572367713u, 1140517802u, 0, ASIN_TOLERANCE, 0}, +{ 734, 666576601u, 2418701513u, 3216964687u, 1555649649u, 666576601u, 2418701513u, 0, ASIN_TOLERANCE, 0}, +{ 735, 2251046969u, 1215163489u, 1051353113u, 3503287900u, 2251046969u, 1215163489u, 0, ASIN_TOLERANCE, 0}, +{ 736, 3159618610u, 641457589u, 1051716814u, 4121125128u, 3159618610u, 641457589u, 0, ASIN_TOLERANCE, 0}, +{ 737, 401932052u, 321857207u, 3250350790u, 1246006125u, 401932052u, 321857207u, 0, ASIN_TOLERANCE, 0}, +{ 738, 2953696013u, 120564990u, 1097266968u, 300149226u, 2953696013u, 120564990u, 0, ASIN_TOLERANCE, 0}, +{ 739, 2254220803u, 3244980052u, 1076924215u, 847775621u, 2254220803u, 3244980052u, 0, ASIN_TOLERANCE, 0}, +{ 740, 2771951028u, 112839452u, 3212858842u, 1569943525u, 2771951028u, 112839452u, 0, ASIN_TOLERANCE, 0}, +{ 741, 2165404842u, 2934678057u, 3212657738u, 3091042797u, 2165404842u, 2934678057u, 0, ASIN_TOLERANCE, 0}, +{ 742, 2704093164u, 547060795u, 1079752403u, 4043827022u, 2704093164u, 547060795u, 0, ASIN_TOLERANCE, 0}, +{ 743, 244578012u, 1790462845u, 1067969586u, 2345441039u, 244578012u, 1790462845u, 0, ASIN_TOLERANCE, 0}, +{ 744, 2182959566u, 2353653565u, 1049624664u, 882286568u, 2182959566u, 2353653565u, 0, ASIN_TOLERANCE, 0}, +{ 745, 462586144u, 1186302263u, 1078662178u, 2626148789u, 462586144u, 1186302263u, 0, ASIN_TOLERANCE, 0}, +{ 746, 279527707u, 4121656076u, 3224287260u, 1299277508u, 279527707u, 4121656076u, 0, ASIN_TOLERANCE, 0}, +{ 747, 470047975u, 2010385858u, 3233120941u, 4186702461u, 470047975u, 2010385858u, 0, ASIN_TOLERANCE, 0}, +{ 748, 2221693080u, 1323708810u, 3211281520u, 1640799315u, 2221693080u, 1323708810u, 0, ASIN_TOLERANCE, 0}, +{ 749, 3124323904u, 3503897938u, 3210262651u, 258643165u, 3124323904u, 3503897938u, 0, ASIN_TOLERANCE, 0}, +{ 750, 2619485313u, 2959074653u, 1058897059u, 4239182527u, 2619485313u, 2959074653u, 0, ASIN_TOLERANCE, 0}, +{ 751, 302551175u, 153547307u, 1099812861u, 3156123094u, 302551175u, 153547307u, 0, ASIN_TOLERANCE, 0}, +{ 752, 420210788u, 3996883503u, 1071341265u, 72657681u, 420210788u, 3996883503u, 0, ASIN_TOLERANCE, 0}, +{ 753, 158488136u, 1698212750u, 1068334402u, 160302703u, 158488136u, 1698212750u, 0, ASIN_TOLERANCE, 0}, +{ 754, 289138234u, 2257686389u, 1051856116u, 430357614u, 289138234u, 2257686389u, 0, ASIN_TOLERANCE, 0}, +{ 755, 2795510903u, 395145384u, 1046317717u, 1912800227u, 2795510903u, 395145384u, 0, ASIN_TOLERANCE, 0}, +{ 756, 935515004u, 674021561u, 3222496667u, 743247292u, 935515004u, 674021561u, 0, ASIN_TOLERANCE, 0}, +{ 757, 2822969173u, 1075007837u, 3222487779u, 639284837u, 2822969173u, 1075007837u, 0, ASIN_TOLERANCE, 0}, +{ 758, 924678051u, 3492386324u, 3251519349u, 1241408247u, 924678051u, 3492386324u, 0, ASIN_TOLERANCE, 0}, +{ 759, 2881777125u, 3998363272u, 3228147294u, 365769855u, 2881777125u, 3998363272u, 0, ASIN_TOLERANCE, 0}, +{ 760, 2662939411u, 4030509561u, 1066028735u, 1163947030u, 2662939411u, 4030509561u, 0, ASIN_TOLERANCE, 0}, +{ 761, 564717585u, 1914428658u, 3214617694u, 4147847493u, 564717585u, 1914428658u, 0, ASIN_TOLERANCE, 0}, +{ 762, 993107584u, 2889684117u, 1042972779u, 1225674604u, 993107584u, 2889684117u, 0, ASIN_TOLERANCE, 0}, +{ 763, 750290683u, 273406410u, 3206108502u, 145234164u, 750290683u, 273406410u, 0, ASIN_TOLERANCE, 0}, +{ 764, 3157290800u, 912384201u, 3237262916u, 3366320623u, 3157290800u, 912384201u, 0, ASIN_TOLERANCE, 0}, +{ 765, 3022814103u, 349339167u, 3197347448u, 3262060258u, 3022814103u, 349339167u, 0, ASIN_TOLERANCE, 0}, +{ 766, 393652178u, 2097272974u, 1064845294u, 1630215394u, 393652178u, 2097272974u, 0, ASIN_TOLERANCE, 0}, +{ 767, 2250994257u, 3355589350u, 3243019072u, 2316123825u, 2250994257u, 3355589350u, 0, ASIN_TOLERANCE, 0}, +{ 768, 307759713u, 1457407347u, 1101422760u, 4120356538u, 307759713u, 1457407347u, 0, ASIN_TOLERANCE, 0}, +{ 769, 2168158322u, 3228185359u, 3198251445u, 3743078041u, 2168158322u, 3228185359u, 0, ASIN_TOLERANCE, 0}, +{ 770, 880898735u, 1289357713u, 3230160936u, 2794962547u, 880898735u, 1289357713u, 0, ASIN_TOLERANCE, 0}, +{ 771, 903112316u, 1699456459u, 1083794396u, 4195811825u, 903112316u, 1699456459u, 0, ASIN_TOLERANCE, 0}, +{ 772, 129746399u, 1949114369u, 1084908557u, 1325384361u, 129746399u, 1949114369u, 0, ASIN_TOLERANCE, 0}, +{ 773, 709313868u, 3979168763u, 1049036668u, 2542947959u, 709313868u, 3979168763u, 0, ASIN_TOLERANCE, 0}, +{ 774, 776361251u, 676749439u, 3192662415u, 4013712036u, 776361251u, 676749439u, 0, ASIN_TOLERANCE, 0}, +{ 775, 255079628u, 3701636708u, 1042322101u, 3983171212u, 255079628u, 3701636708u, 0, ASIN_TOLERANCE, 0}, +{ 776, 2885977639u, 3830039616u, 3239465315u, 175489420u, 2885977639u, 3830039616u, 0, ASIN_TOLERANCE, 0}, +{ 777, 2871663155u, 2897269792u, 3230650366u, 3102389747u, 2871663155u, 2897269792u, 0, ASIN_TOLERANCE, 0}, +{ 778, 515647990u, 582170006u, 1068093936u, 3324264433u, 515647990u, 582170006u, 0, ASIN_TOLERANCE, 0}, +{ 779, 870187117u, 3574970337u, 1061955111u, 637826033u, 870187117u, 3574970337u, 0, ASIN_TOLERANCE, 0}, +{ 780, 2474474250u, 1733806710u, 3216760526u, 3188307974u, 2474474250u, 1733806710u, 0, ASIN_TOLERANCE, 0}, +{ 781, 25157138u, 2296028823u, 1096788400u, 1413568905u, 25157138u, 2296028823u, 0, ASIN_TOLERANCE, 0}, +{ 782, 967771954u, 1627289946u, 1046506286u, 1860326351u, 967771954u, 1627289946u, 0, ASIN_TOLERANCE, 0}, +{ 783, 876029804u, 1139086265u, 3242570406u, 3276908361u, 876029804u, 1139086265u, 0, ASIN_TOLERANCE, 0}, +{ 784, 444923881u, 3323762166u, 3206918506u, 946766885u, 444923881u, 3323762166u, 0, ASIN_TOLERANCE, 0}, +{ 785, 2438959626u, 188768962u, 1088324147u, 4105901663u, 2438959626u, 188768962u, 0, ASIN_TOLERANCE, 0}, +{ 786, 2731858209u, 460037366u, 3227174677u, 2159793181u, 2731858209u, 460037366u, 0, ASIN_TOLERANCE, 0}, +{ 787, 647960579u, 2589781051u, 3243737020u, 107237481u, 647960579u, 2589781051u, 0, ASIN_TOLERANCE, 0}, +{ 788, 342985206u, 3519881651u, 1057272132u, 2685921459u, 342985206u, 3519881651u, 0, ASIN_TOLERANCE, 0}, +{ 789, 620434247u, 1169160155u, 3206674485u, 3139856281u, 620434247u, 1169160155u, 0, ASIN_TOLERANCE, 0}, +{ 790, 1000422649u, 1898254525u, 3196770014u, 2458988443u, 1000422649u, 1898254525u, 0, ASIN_TOLERANCE, 0}, +{ 791, 756268268u, 2023065054u, 1050415907u, 4070768353u, 756268268u, 2023065054u, 0, ASIN_TOLERANCE, 0}, +{ 792, 284716157u, 3336260906u, 3237972475u, 3524355405u, 284716157u, 3336260906u, 0, ASIN_TOLERANCE, 0}, +{ 793, 2520138858u, 3298979042u, 3250099033u, 1003322861u, 2520138858u, 3298979042u, 0, ASIN_TOLERANCE, 0}, +{ 794, 780415343u, 1629423892u, 1061722650u, 2396420130u, 780415343u, 1629423892u, 0, ASIN_TOLERANCE, 0}, +{ 795, 2512306741u, 1945417606u, 3192839521u, 1585136212u, 2512306741u, 1945417606u, 0, ASIN_TOLERANCE, 0}, +{ 796, 2649414854u, 1527139640u, 1076681917u, 4150904895u, 2649414854u, 1527139640u, 0, ASIN_TOLERANCE, 0}, +{ 797, 315452952u, 267572666u, 1088475235u, 1517640973u, 315452952u, 267572666u, 0, ASIN_TOLERANCE, 0}, +{ 798, 948438656u, 1100855041u, 3229298529u, 2451533501u, 948438656u, 1100855041u, 0, ASIN_TOLERANCE, 0}, +{ 799, 2280476280u, 853088805u, 1050931318u, 3551516956u, 2280476280u, 853088805u, 0, ASIN_TOLERANCE, 0}, +{ 800, 927051214u, 1317953425u, 3217154900u, 431061758u, 927051214u, 1317953425u, 0, ASIN_TOLERANCE, 0}, +{ 801, 803065499u, 2317271661u, 1070436470u, 4014139535u, 803065499u, 2317271661u, 0, ASIN_TOLERANCE, 0}, +{ 802, 2766450812u, 3959292396u, 3249638947u, 906232948u, 2766450812u, 3959292396u, 0, ASIN_TOLERANCE, 0}, +{ 803, 475259033u, 1939780068u, 3253991906u, 906880052u, 475259033u, 1939780068u, 0, ASIN_TOLERANCE, 0}, +{ 804, 174037547u, 4170524292u, 3237763507u, 4075099457u, 174037547u, 4170524292u, 0, ASIN_TOLERANCE, 0}, +{ 805, 3111709674u, 3520923293u, 1067530616u, 2252399455u, 3111709674u, 3520923293u, 0, ASIN_TOLERANCE, 0}, +{ 806, 705974097u, 1097415680u, 1055600706u, 2690540698u, 705974097u, 1097415680u, 0, ASIN_TOLERANCE, 0}, +{ 807, 465450487u, 3086226264u, 3213898048u, 3220232067u, 465450487u, 3086226264u, 0, ASIN_TOLERANCE, 0}, +{ 808, 2906752413u, 2955360278u, 1051258339u, 557182478u, 2906752413u, 2955360278u, 0, ASIN_TOLERANCE, 0}, +{ 809, 2407140190u, 186287752u, 1104388811u, 1727111982u, 2407140190u, 186287752u, 0, ASIN_TOLERANCE, 0}, +{ 810, 3170043637u, 4057007843u, 1076281145u, 2008293104u, 3170043637u, 4057007843u, 0, ASIN_TOLERANCE, 0}, +{ 811, 3198834469u, 2741338484u, 3252544447u, 1207037505u, 3198834469u, 2741339245u, 0, ASIN_TOLERANCE, 0}, +{ 812, 625923799u, 102938901u, 3218894213u, 3620282197u, 625923799u, 102938901u, 0, ASIN_TOLERANCE, 0}, +{ 813, 2527426501u, 763746284u, 1060949875u, 80236875u, 2527426501u, 763746284u, 0, ASIN_TOLERANCE, 0}, +{ 814, 3055119358u, 1117970157u, 1084109014u, 939675744u, 3055119358u, 1117970157u, 0, ASIN_TOLERANCE, 0}, +{ 815, 1002709241u, 3478694019u, 1105453279u, 2493398454u, 1002709241u, 3478694019u, 0, ASIN_TOLERANCE, 0}, +{ 816, 278925941u, 2014323735u, 1096417600u, 1077078168u, 278925941u, 2014323735u, 0, ASIN_TOLERANCE, 0}, +{ 817, 22160783u, 1569149351u, 1091835152u, 3751608506u, 22160783u, 1569149351u, 0, ASIN_TOLERANCE, 0}, +{ 818, 2855839310u, 930375071u, 1084274438u, 1096450032u, 2855839310u, 930375071u, 0, ASIN_TOLERANCE, 0}, +{ 819, 949603377u, 4197396799u, 3220768028u, 3419252837u, 949603377u, 4197396799u, 0, ASIN_TOLERANCE, 0}, +{ 820, 2427096043u, 2553375912u, 3237078043u, 1357572894u, 2427096043u, 2553375912u, 0, ASIN_TOLERANCE, 0}, +{ 821, 2946808178u, 703318468u, 3198897773u, 3216391250u, 2946808178u, 703318468u, 0, ASIN_TOLERANCE, 0}, +{ 822, 682409255u, 3167959965u, 1069972300u, 4099039274u, 682409255u, 3167959965u, 0, ASIN_TOLERANCE, 0}, +{ 823, 551957760u, 1199490036u, 1047137152u, 2723130471u, 551957760u, 1199490036u, 0, ASIN_TOLERANCE, 0}, +{ 824, 2635855937u, 933683213u, 3243757155u, 1468458131u, 2635855937u, 933683213u, 0, ASIN_TOLERANCE, 0}, +{ 825, 954259401u, 763829445u, 3190480801u, 1772616584u, 954259401u, 763829445u, 0, ASIN_TOLERANCE, 0}, +{ 826, 1017324786u, 3416067384u, 1056206159u, 172017902u, 1017324786u, 3416067384u, 0, ASIN_TOLERANCE, 0}, +{ 827, 2553315334u, 2799176222u, 1099022088u, 1324575553u, 2553315334u, 2799176222u, 0, ASIN_TOLERANCE, 0}, +{ 828, 54501096u, 2237472662u, 3202361378u, 1770080863u, 54501096u, 2237472662u, 0, ASIN_TOLERANCE, 0}, +{ 829, 697886575u, 1509098263u, 3227321831u, 3313535397u, 697886575u, 1509098263u, 0, ASIN_TOLERANCE, 0}, +{ 830, 2834201307u, 1157206501u, 3201667023u, 2771836065u, 2834201307u, 1157206501u, 0, ASIN_TOLERANCE, 0}, +{ 831, 2845352423u, 841047693u, 3220229941u, 3851041620u, 2845352423u, 841047693u, 0, ASIN_TOLERANCE, 0}, +{ 832, 2559038255u, 1637635007u, 1096670395u, 363436727u, 2559038255u, 1637635007u, 0, ASIN_TOLERANCE, 0}, +{ 833, 895812927u, 544867276u, 3250055151u, 2005291812u, 895812927u, 544867276u, 0, ASIN_TOLERANCE, 0}, +{ 834, 613660095u, 1577788839u, 3213516258u, 3678234583u, 613660095u, 1577788839u, 0, ASIN_TOLERANCE, 0}, +{ 835, 2787880976u, 3005922702u, 1060624530u, 3900344258u, 2787880976u, 3005922702u, 0, ASIN_TOLERANCE, 0}, +{ 836, 369490497u, 4206745890u, 3212325607u, 3363748875u, 369490497u, 4206745890u, 0, ASIN_TOLERANCE, 0}, +{ 837, 547531448u, 2586849496u, 3195881612u, 1817038482u, 547531448u, 2586849496u, 0, ASIN_TOLERANCE, 0}, +{ 838, 2947779739u, 3675119568u, 3217354316u, 1280515099u, 2947779739u, 3675119568u, 0, ASIN_TOLERANCE, 0}, +{ 839, 2360207944u, 3785128270u, 3206980957u, 986337114u, 2360207944u, 3785128270u, 0, ASIN_TOLERANCE, 0}, +{ 840, 30415045u, 1959045465u, 3205100821u, 2165602568u, 30415045u, 1959045465u, 0, ASIN_TOLERANCE, 0}, +{ 841, 2874345345u, 4164694429u, 3228096442u, 1919088329u, 2874345345u, 4164694429u, 0, ASIN_TOLERANCE, 0}, +{ 842, 430207315u, 1381882442u, 3215734246u, 2587666792u, 430207315u, 1381882442u, 0, ASIN_TOLERANCE, 0}, +{ 843, 721933456u, 3295845115u, 1099763106u, 4189733918u, 721933456u, 3295845115u, 0, ASIN_TOLERANCE, 0}, +{ 844, 1020902692u, 528513718u, 3241318094u, 2446416887u, 1020902692u, 528513718u, 0, ASIN_TOLERANCE, 0}, +{ 845, 23459988u, 2336116589u, 1065985897u, 3314083915u, 23459988u, 2336116589u, 0, ASIN_TOLERANCE, 0}, +{ 846, 666699893u, 3946191348u, 3195771050u, 906783975u, 666699893u, 3946191348u, 0, ASIN_TOLERANCE, 0}, +{ 847, 2277669009u, 1307551746u, 3210796216u, 988905760u, 2277669009u, 1307551746u, 0, ASIN_TOLERANCE, 0}, +{ 848, 659686858u, 3690487540u, 1056058539u, 3252665112u, 659686858u, 3690487540u, 0, ASIN_TOLERANCE, 0}, +{ 849, 42479044u, 1832665932u, 1055271260u, 2605540156u, 42479044u, 1832665932u, 0, ASIN_TOLERANCE, 0}, +{ 850, 158726331u, 4095344603u, 3215114657u, 3444794506u, 158726331u, 4095344603u, 0, ASIN_TOLERANCE, 0}, +{ 851, 2383875900u, 1287837711u, 3242597773u, 4213798139u, 2383875900u, 1287837711u, 0, ASIN_TOLERANCE, 0}, +{ 852, 3153341967u, 2816125725u, 1059414555u, 1477859711u, 3153341967u, 2816125725u, 0, ASIN_TOLERANCE, 0}, +{ 853, 935772631u, 714564399u, 3193282956u, 2533012202u, 935772631u, 714564399u, 0, ASIN_TOLERANCE, 0}, +{ 854, 626995971u, 3592268374u, 1058283383u, 2901729097u, 626995971u, 3592268374u, 0, ASIN_TOLERANCE, 0}, +{ 855, 793386186u, 3559004137u, 1068514800u, 3160920849u, 793386186u, 3559004137u, 0, ASIN_TOLERANCE, 0}, +{ 856, 292955800u, 691190239u, 3222935981u, 1615104840u, 292955800u, 691190239u, 0, ASIN_TOLERANCE, 0}, +{ 857, 239139675u, 2475984769u, 1103239897u, 703637359u, 239139675u, 2475984769u, 0, ASIN_TOLERANCE, 0}, +{ 858, 710643921u, 441140946u, 3190536898u, 3492228424u, 710643921u, 441140946u, 0, ASIN_TOLERANCE, 0}, +{ 859, 161483935u, 3877369975u, 3202400099u, 3215202168u, 161483935u, 3877369975u, 0, ASIN_TOLERANCE, 0}, +{ 860, 2961770699u, 1491180815u, 3239294185u, 1154272588u, 2961770699u, 1491180815u, 0, ASIN_TOLERANCE, 0}, +{ 861, 3205774388u, 3583450204u, 1087671320u, 674510731u, 3205774388u, 3589106472u, 0, ASIN_TOLERANCE, 0}, +{ 862, 2732840881u, 3456820098u, 1089546472u, 2907918480u, 2732840881u, 3456820098u, 0, ASIN_TOLERANCE, 0}, +{ 863, 685577817u, 81928569u, 1075278180u, 1990416786u, 685577817u, 81928569u, 0, ASIN_TOLERANCE, 0}, +{ 864, 1038142999u, 1400620994u, 3225378967u, 1180415269u, 1038142999u, 1400620994u, 0, ASIN_TOLERANCE, 0}, +{ 865, 821776812u, 2762887697u, 3211549123u, 335890509u, 821776812u, 2762887697u, 0, ASIN_TOLERANCE, 0}, +{ 866, 3188234303u, 1362922028u, 3190091315u, 3628762502u, 3188234303u, 1362922028u, 0, ASIN_TOLERANCE, 0}, +{ 867, 721900432u, 3813492886u, 3202458179u, 1901070055u, 721900432u, 3813492886u, 0, ASIN_TOLERANCE, 0}, +{ 868, 2869411161u, 242471816u, 1098704131u, 1526904338u, 2869411161u, 242471816u, 0, ASIN_TOLERANCE, 0}, +{ 869, 1027232266u, 671155008u, 1093002146u, 4241764136u, 1027232266u, 671155008u, 0, ASIN_TOLERANCE, 0}, +{ 870, 2277521859u, 4097248738u, 1056810493u, 578681886u, 2277521859u, 4097248738u, 0, ASIN_TOLERANCE, 0}, +{ 871, 277897075u, 2743813242u, 1048038468u, 2228686199u, 277897075u, 2743813242u, 0, ASIN_TOLERANCE, 0}, +{ 872, 2669729433u, 777624847u, 3204357191u, 721009894u, 2669729433u, 777624847u, 0, ASIN_TOLERANCE, 0}, +{ 873, 900729335u, 724757172u, 1074804044u, 1443361721u, 900729335u, 724757172u, 0, ASIN_TOLERANCE, 0}, +{ 874, 2794978652u, 1829019782u, 1092425225u, 921360204u, 2794978652u, 1829019782u, 0, ASIN_TOLERANCE, 0}, +{ 875, 1055573469u, 599714409u, 3252379270u, 4008804686u, 1055573469u, 599919108u, 0, ASIN_TOLERANCE, 0}, +{ 876, 2335315701u, 1009458928u, 1083845809u, 4245287698u, 2335315701u, 1009458928u, 0, ASIN_TOLERANCE, 0}, +{ 877, 407962355u, 1393652229u, 3198335362u, 477976573u, 407962355u, 1393652229u, 0, ASIN_TOLERANCE, 0}, +{ 878, 119992u, 617334033u, 3226883256u, 1392617441u, 119992u, 617334033u, 0, ASIN_TOLERANCE, 0}, +{ 879, 2526781811u, 3189972160u, 1058939729u, 1442809487u, 2526781811u, 3189972160u, 0, ASIN_TOLERANCE, 0}, +{ 880, 2785887182u, 1497507448u, 3207820115u, 1605709634u, 2785887182u, 1497507448u, 0, ASIN_TOLERANCE, 0}, +{ 881, 400505812u, 1497124553u, 1056018407u, 1916183627u, 400505812u, 1497124553u, 0, ASIN_TOLERANCE, 0}, +{ 882, 379250418u, 187810760u, 1045258725u, 2282203450u, 379250418u, 187810760u, 0, ASIN_TOLERANCE, 0}, +{ 883, 619840292u, 3486351235u, 3238811394u, 4182495542u, 619840292u, 3486351235u, 0, ASIN_TOLERANCE, 0}, +{ 884, 2587166700u, 1845445426u, 1101440582u, 1926724082u, 2587166700u, 1845445426u, 0, ASIN_TOLERANCE, 0}, +{ 885, 2208479151u, 3630948001u, 3210436304u, 3757166747u, 2208479151u, 3630948001u, 0, ASIN_TOLERANCE, 0}, +{ 886, 156467129u, 2426945694u, 1100551290u, 691736139u, 156467129u, 2426945694u, 0, ASIN_TOLERANCE, 0}, +{ 887, 3176502800u, 648364171u, 1041433075u, 4184885944u, 3176502800u, 648364171u, 0, ASIN_TOLERANCE, 0}, +{ 888, 1000987303u, 4288583860u, 1088664697u, 2475611219u, 1000987303u, 4288583860u, 0, ASIN_TOLERANCE, 0}, +{ 889, 1063779408u, 1032586628u, 1093050016u, 1335820726u, 1063779410u, 2088980724u, 0, ASIN_TOLERANCE, 0}, +{ 890, 2203998268u, 1808427032u, 1080779860u, 3408316613u, 2203998268u, 1808427032u, 0, ASIN_TOLERANCE, 0}, +{ 891, 2973050448u, 377900895u, 3246382680u, 3547565419u, 2973050448u, 377900895u, 0, ASIN_TOLERANCE, 0}, +{ 892, 2189796743u, 2323627716u, 1059972652u, 2094048557u, 2189796743u, 2323627716u, 0, ASIN_TOLERANCE, 0}, +{ 893, 3196853156u, 698816446u, 3234028118u, 1825626029u, 3196853156u, 698816504u, 0, ASIN_TOLERANCE, 0}, +{ 894, 3053056428u, 4246800079u, 3198693322u, 1124410156u, 3053056428u, 4246800079u, 0, ASIN_TOLERANCE, 0}, +{ 895, 418318520u, 2453135589u, 1055899444u, 314708747u, 418318520u, 2453135589u, 0, ASIN_TOLERANCE, 0}, +{ 896, 2903016736u, 3296787864u, 1068197912u, 3000361169u, 2903016736u, 3296787864u, 0, ASIN_TOLERANCE, 0}, +{ 897, 3078102424u, 2237367418u, 1089582486u, 4042266354u, 3078102424u, 2237367418u, 0, ASIN_TOLERANCE, 0}, +{ 898, 3141633458u, 3484406269u, 3222793392u, 1868977643u, 3141633458u, 3484406269u, 0, ASIN_TOLERANCE, 0}, +{ 899, 551079618u, 3353193428u, 1046058481u, 1204175477u, 551079618u, 3353193428u, 0, ASIN_TOLERANCE, 0}, +{ 900, 372140985u, 2936300483u, 3219636923u, 3841711417u, 372140985u, 2936300483u, 0, ASIN_TOLERANCE, 0}, +{ 901, 673975119u, 1967394048u, 1058351548u, 460961975u, 673975119u, 1967394048u, 0, ASIN_TOLERANCE, 0}, +{ 902, 186542430u, 2037284927u, 3201399531u, 2969937827u, 186542430u, 2037284927u, 0, ASIN_TOLERANCE, 0}, +{ 903, 605316943u, 4193097538u, 3187909191u, 3039418420u, 605316943u, 4193097538u, 0, ASIN_TOLERANCE, 0}, +{ 904, 560007813u, 3490045229u, 1095745195u, 4291149159u, 560007813u, 3490045229u, 0, ASIN_TOLERANCE, 0}, +{ 905, 2719344253u, 2428281947u, 3244840847u, 1401325941u, 2719344253u, 2428281947u, 0, ASIN_TOLERANCE, 0}, +{ 906, 3086950621u, 2958762056u, 1053682542u, 1079751324u, 3086950621u, 2958762056u, 0, ASIN_TOLERANCE, 0}, +{ 907, 2586448231u, 4153073282u, 3242138780u, 2976596113u, 2586448231u, 4153073282u, 0, ASIN_TOLERANCE, 0}, +{ 908, 2225350223u, 3033242648u, 3218615502u, 4046734098u, 2225350223u, 3033242648u, 0, ASIN_TOLERANCE, 0}, +{ 909, 144835976u, 3784918863u, 3247369913u, 2134568674u, 144835976u, 3784918863u, 0, ASIN_TOLERANCE, 0}, +{ 910, 1037093430u, 2677404300u, 1085544968u, 741961444u, 1037093430u, 2677404300u, 0, ASIN_TOLERANCE, 0}, +{ 911, 3191671070u, 3184472282u, 1092761713u, 2878921656u, 3191671070u, 3184472282u, 0, ASIN_TOLERANCE, 0}, +{ 912, 2174282657u, 3434230759u, 3221702019u, 3917984952u, 2174282657u, 3434230759u, 0, ASIN_TOLERANCE, 0}, +{ 913, 2545165920u, 2576188896u, 3242449625u, 1091446541u, 2545165920u, 2576188896u, 0, ASIN_TOLERANCE, 0}, +{ 914, 331286912u, 1182911629u, 3252138078u, 370659473u, 331286912u, 1182911629u, 0, ASIN_TOLERANCE, 0}, +{ 915, 2176330507u, 1444733769u, 1073172315u, 1980291498u, 2176330507u, 1444733769u, 0, ASIN_TOLERANCE, 0}, +{ 916, 2678247043u, 2360783610u, 3208952465u, 1231254630u, 2678247043u, 2360783610u, 0, ASIN_TOLERANCE, 0}, +{ 917, 2305545884u, 3838689849u, 1072879962u, 256746588u, 2305545884u, 3838689849u, 0, ASIN_TOLERANCE, 0}, +{ 918, 2902784540u, 3667306355u, 3251214292u, 749864809u, 2902784540u, 3667306355u, 0, ASIN_TOLERANCE, 0}, +{ 919, 2604503669u, 507891905u, 1053625983u, 2704533753u, 2604503669u, 507891905u, 0, ASIN_TOLERANCE, 0}, +{ 920, 1030839861u, 3584765547u, 3245124397u, 2257447093u, 1030839861u, 3584765547u, 0, ASIN_TOLERANCE, 0}, +{ 921, 3066547476u, 3315149772u, 1066493112u, 1016007949u, 3066547476u, 3315149772u, 0, ASIN_TOLERANCE, 0}, +{ 922, 449363956u, 825363580u, 3232843486u, 209798625u, 449363956u, 825363580u, 0, ASIN_TOLERANCE, 0}, +{ 923, 835609236u, 3268577204u, 1096097376u, 1911303780u, 835609236u, 3268577204u, 0, ASIN_TOLERANCE, 0}, +{ 924, 2498038993u, 1753975943u, 1042812372u, 3813343580u, 2498038993u, 1753975943u, 0, ASIN_TOLERANCE, 0}, +{ 925, 2711382061u, 729612230u, 3214799337u, 998858159u, 2711382061u, 729612230u, 0, ASIN_TOLERANCE, 0}, +{ 926, 362629194u, 436029885u, 1040410334u, 1429955158u, 362629194u, 436029885u, 0, ASIN_TOLERANCE, 0}, +{ 927, 535596587u, 3221540113u, 1098769124u, 1388898057u, 535596587u, 3221540113u, 0, ASIN_TOLERANCE, 0}, +{ 928, 3182989542u, 324306108u, 3236216574u, 3657300235u, 3182989542u, 324306108u, 0, ASIN_TOLERANCE, 0}, +{ 929, 2615512563u, 583339032u, 1059119779u, 2312064517u, 2615512563u, 583339032u, 0, ASIN_TOLERANCE, 0}, +{ 930, 1018901539u, 1094068533u, 3243006833u, 3107499181u, 1018901539u, 1094068533u, 0, ASIN_TOLERANCE, 0}, +{ 931, 621064893u, 2330095236u, 1045494806u, 3166363539u, 621064893u, 2330095236u, 0, ASIN_TOLERANCE, 0}, +{ 932, 848850921u, 2922855425u, 1055270013u, 3382352474u, 848850921u, 2922855425u, 0, ASIN_TOLERANCE, 0}, +{ 933, 2636544164u, 2042479846u, 1052493506u, 1108839173u, 2636544164u, 2042479846u, 0, ASIN_TOLERANCE, 0}, +{ 934, 14409368u, 3796172167u, 1093571065u, 169360454u, 14409368u, 3796172167u, 0, ASIN_TOLERANCE, 0}, +{ 935, 792852082u, 1860101737u, 1103906352u, 1684270183u, 792852082u, 1860101737u, 0, ASIN_TOLERANCE, 0}, +{ 936, 857946959u, 1478693394u, 1081338739u, 2709296315u, 857946959u, 1478693394u, 0, ASIN_TOLERANCE, 0}, +{ 937, 148167699u, 2960729928u, 1099267383u, 1713640531u, 148167699u, 2960729928u, 0, ASIN_TOLERANCE, 0}, +{ 938, 385577172u, 3119726590u, 1073506160u, 3652712370u, 385577172u, 3119726590u, 0, ASIN_TOLERANCE, 0}, +{ 939, 2345316997u, 2223927344u, 1087592708u, 1855918127u, 2345316997u, 2223927344u, 0, ASIN_TOLERANCE, 0}, +{ 940, 283564999u, 1025757067u, 1082898254u, 4130586757u, 283564999u, 1025757067u, 0, ASIN_TOLERANCE, 0}, +{ 941, 248963649u, 1732390968u, 3252871699u, 2342842299u, 248963649u, 1732390968u, 0, ASIN_TOLERANCE, 0}, +{ 942, 968306674u, 284897931u, 3252953804u, 1924892993u, 968306674u, 284897931u, 0, ASIN_TOLERANCE, 0}, +{ 943, 2792404953u, 3037915642u, 3201314702u, 236884699u, 2792404953u, 3037915642u, 0, ASIN_TOLERANCE, 0}, +{ 944, 2786424109u, 2193269825u, 1080777124u, 2443415975u, 2786424109u, 2193269825u, 0, ASIN_TOLERANCE, 0}, +{ 945, 519195528u, 875427160u, 3254060908u, 2005185235u, 519195528u, 875427160u, 0, ASIN_TOLERANCE, 0}, +{ 946, 2834778379u, 1185249950u, 3192573802u, 43728140u, 2834778379u, 1185249950u, 0, ASIN_TOLERANCE, 0}, +{ 947, 941414883u, 1968452001u, 3208083074u, 2872106033u, 941414883u, 1968452001u, 0, ASIN_TOLERANCE, 0}, +{ 948, 1058483372u, 1955688296u, 1041438818u, 4288876237u, 1058483372u, 1964184798u, 0, ASIN_TOLERANCE, 0}, +{ 949, 260098041u, 1687624754u, 1047766046u, 3073412424u, 260098041u, 1687624754u, 0, ASIN_TOLERANCE, 0}, +{ 950, 3060253014u, 1209878394u, 1095484022u, 291364597u, 3060253014u, 1209878394u, 0, ASIN_TOLERANCE, 0}, +{ 951, 468175369u, 3483008135u, 1104326057u, 3143994227u, 468175369u, 3483008135u, 0, ASIN_TOLERANCE, 0}, +{ 952, 2417131043u, 3223340235u, 1090336173u, 1399132887u, 2417131043u, 3223340235u, 0, ASIN_TOLERANCE, 0}, +{ 953, 783617139u, 4188530565u, 1049645776u, 3448942728u, 783617139u, 4188530565u, 0, ASIN_TOLERANCE, 0}, +{ 954, 660957346u, 1627557770u, 1058246656u, 2945931719u, 660957346u, 1627557770u, 0, ASIN_TOLERANCE, 0}, +{ 955, 1018601337u, 3373123648u, 3197792793u, 672208537u, 1018601337u, 3373123648u, 0, ASIN_TOLERANCE, 0}, +{ 956, 408015225u, 3778617114u, 1062846388u, 1358342023u, 408015225u, 3778617114u, 0, ASIN_TOLERANCE, 0}, +{ 957, 410316381u, 2900182547u, 3199310787u, 414812664u, 410316381u, 2900182547u, 0, ASIN_TOLERANCE, 0}, +{ 958, 633591966u, 2464347659u, 3205131467u, 3988778663u, 633591966u, 2464347659u, 0, ASIN_TOLERANCE, 0}, +{ 959, 229808805u, 3135249601u, 1100087621u, 4100875262u, 229808805u, 3135249601u, 0, ASIN_TOLERANCE, 0}, +{ 960, 793399715u, 2358359525u, 1045184735u, 1183252266u, 793399715u, 2358359525u, 0, ASIN_TOLERANCE, 0}, +{ 961, 971564307u, 1400352853u, 3240053853u, 734055542u, 971564307u, 1400352853u, 0, ASIN_TOLERANCE, 0}, +{ 962, 348066411u, 1753967678u, 3224978909u, 1995531974u, 348066411u, 1753967678u, 0, ASIN_TOLERANCE, 0}, +{ 963, 2638555255u, 1500031970u, 3233676488u, 4052958340u, 2638555255u, 1500031970u, 0, ASIN_TOLERANCE, 0}, +{ 964, 536164755u, 1866935720u, 3200756597u, 3746696244u, 536164755u, 1866935720u, 0, ASIN_TOLERANCE, 0}, +{ 965, 91363664u, 2978288684u, 1106515721u, 564707827u, 91363664u, 2978288684u, 0, ASIN_TOLERANCE, 0}, +{ 966, 447397583u, 1517077030u, 1044934689u, 4156529635u, 447397583u, 1517077030u, 0, ASIN_TOLERANCE, 0}, +{ 967, 884390674u, 1427263585u, 3247549500u, 559009887u, 884390674u, 1427263585u, 0, ASIN_TOLERANCE, 0}, +{ 968, 709965825u, 427386166u, 3224310223u, 2897984604u, 709965825u, 427386166u, 0, ASIN_TOLERANCE, 0}, +{ 969, 748422445u, 984833499u, 1086168339u, 3414464869u, 748422445u, 984833499u, 0, ASIN_TOLERANCE, 0}, +{ 970, 3037316018u, 1275655663u, 1051250192u, 1788042252u, 3037316018u, 1275655663u, 0, ASIN_TOLERANCE, 0}, +{ 971, 647298401u, 1752811522u, 1054424401u, 3069200833u, 647298401u, 1752811522u, 0, ASIN_TOLERANCE, 0}, +{ 972, 336691782u, 4159629802u, 3227935989u, 905739373u, 336691782u, 4159629802u, 0, ASIN_TOLERANCE, 0}, +{ 973, 840207318u, 3449457931u, 1053675501u, 651755324u, 840207318u, 3449457931u, 0, ASIN_TOLERANCE, 0}, +{ 974, 588654397u, 824950980u, 1063835328u, 2970166564u, 588654397u, 824950980u, 0, ASIN_TOLERANCE, 0}, +{ 975, 1002643220u, 3980858800u, 1097889355u, 860102770u, 1002643220u, 3980858800u, 0, ASIN_TOLERANCE, 0}, +{ 976, 2925126437u, 3352952738u, 1087086428u, 1202852913u, 2925126437u, 3352952738u, 0, ASIN_TOLERANCE, 0}, +{ 977, 3153295755u, 3493096285u, 3210665381u, 1226230602u, 3153295755u, 3493096285u, 0, ASIN_TOLERANCE, 0}, +{ 978, 2861370199u, 2237153875u, 1063605905u, 2592496943u, 2861370199u, 2237153875u, 0, ASIN_TOLERANCE, 0}, +{ 979, 812704965u, 1204681469u, 1084151922u, 928193012u, 812704965u, 1204681469u, 0, ASIN_TOLERANCE, 0}, +{ 980, 717902981u, 1892558657u, 3188880850u, 472712482u, 717902981u, 1892558657u, 0, ASIN_TOLERANCE, 0}, +{ 981, 206133394u, 1107589453u, 3240016549u, 2840254081u, 206133394u, 1107589453u, 0, ASIN_TOLERANCE, 0}, +{ 982, 645145771u, 1760994629u, 3217094564u, 2931138356u, 645145771u, 1760994629u, 0, ASIN_TOLERANCE, 0}, +{ 983, 2682176516u, 3313118532u, 1095060283u, 1256408484u, 2682176516u, 3313118532u, 0, ASIN_TOLERANCE, 0}, +{ 984, 958852249u, 2822240883u, 3191644368u, 1759139386u, 958852249u, 2822240883u, 0, ASIN_TOLERANCE, 0}, +{ 985, 3064303449u, 3148616726u, 3216643810u, 4033784566u, 3064303449u, 3148616726u, 0, ASIN_TOLERANCE, 0}, +{ 986, 2672549129u, 50508488u, 3234572856u, 2196737134u, 2672549129u, 50508488u, 0, ASIN_TOLERANCE, 0}, +{ 987, 199760205u, 1739301489u, 1047113374u, 2964036605u, 199760205u, 1739301489u, 0, ASIN_TOLERANCE, 0}, +{ 988, 2742280838u, 32766355u, 1078278376u, 684801414u, 2742280838u, 32766355u, 0, ASIN_TOLERANCE, 0}, +{ 989, 860036812u, 2725458084u, 3197542874u, 3768641510u, 860036812u, 2725458084u, 0, ASIN_TOLERANCE, 0}, +{ 990, 602166919u, 2877639205u, 3248394899u, 2733580401u, 602166919u, 2877639205u, 0, ASIN_TOLERANCE, 0}, +{ 991, 217158246u, 3237117913u, 1086314718u, 1194088701u, 217158246u, 3237117913u, 0, ASIN_TOLERANCE, 0}, +{ 992, 507701220u, 2969027390u, 3254737744u, 2845466153u, 507701220u, 2969027390u, 0, ASIN_TOLERANCE, 0}, +{ 993, 39202927u, 1308825168u, 3231339694u, 1185199746u, 39202927u, 1308825168u, 0, ASIN_TOLERANCE, 0}, +{ 994, 2538930797u, 3429306274u, 3236439133u, 3100989857u, 2538930797u, 3429306274u, 0, ASIN_TOLERANCE, 0}, +{ 995, 2251277391u, 4179597430u, 1060231463u, 2735521684u, 2251277391u, 4179597430u, 0, ASIN_TOLERANCE, 0}, +{ 996, 863742433u, 1926531024u, 1040565159u, 1724549325u, 863742433u, 1926531024u, 0, ASIN_TOLERANCE, 0}, +{ 997, 344684868u, 1215071411u, 1068384117u, 483238293u, 344684868u, 1215071411u, 0, ASIN_TOLERANCE, 0}, +{ 998, 317818997u, 197061949u, 1043473339u, 249253513u, 317818997u, 197061949u, 0, ASIN_TOLERANCE, 0}, +{ 999, 2250299688u, 1410107326u, 3198269248u, 2880209598u, 2250299688u, 1410107326u, 0, ASIN_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_ASIN_H multiple inclusion protection + +// EOF asin.h diff --git a/packages/language/c/libm/current/tests/vectors/atan.c b/packages/language/c/libm/current/tests/vectors/atan.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/atan.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// atan.c +// +// Test of atan() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/atan.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(atan_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &atan, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &atan_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("atan() is stable"); + } // if + else + { + CYG_TEST_FAIL("atan() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library atan() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "atan() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF atan.c diff --git a/packages/language/c/libm/current/tests/vectors/atan.h b/packages/language/c/libm/current/tests/vectors/atan.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/atan.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_ATAN_H +#define CYGONCE_LIBM_ATAN_H +//=========================================================================== +// +// atan.h +// +// Test vectors for testing of atan() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/atan.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define ATAN_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t atan_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1073260870u, 80828740u, 0, ATAN_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 3218127952u, 2148913948u, 0, ATAN_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 3220775416u, 3427719722u, 0, ATAN_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1073291769u, 1152807046u, 0, ATAN_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 3220284243u, 1650435225u, 0, ATAN_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1073291754u, 2004116794u, 0, ATAN_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1047953160u, 183014779u, 0, ATAN_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 3213485944u, 373769876u, 0, ATAN_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1058795730u, 594792680u, 0, ATAN_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 3204919842u, 1601026149u, 0, ATAN_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1060343410u, 1694216909u, 0, ATAN_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1073291771u, 1408066806u, 0, ATAN_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1073291520u, 2395617049u, 0, ATAN_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 3207559790u, 1202538732u, 0, ATAN_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1073291770u, 1987690820u, 0, ATAN_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1073291771u, 1400039033u, 0, ATAN_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1071055683u, 2564295466u, 0, ATAN_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1071920653u, 944685799u, 0, ATAN_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 3194849109u, 213658764u, 0, ATAN_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 3220775419u, 1412984998u, 0, ATAN_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 3216259867u, 2055429970u, 0, ATAN_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 1049848642u, 541549191u, 0, ATAN_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1073291547u, 2294903094u, 0, ATAN_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1060548195u, 1044477369u, 0, ATAN_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 3208865645u, 2710529722u, 0, ATAN_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 1071007346u, 3244807363u, 0, ATAN_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1052861772u, 331689558u, 0, ATAN_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 3220775419u, 1411490992u, 0, ATAN_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1044902177u, 252085215u, 0, ATAN_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 3220563640u, 3145808599u, 0, ATAN_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1073291771u, 1413208284u, 0, ATAN_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1073291771u, 1253599848u, 0, ATAN_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 3220775272u, 1617169199u, 0, ATAN_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 3195247552u, 472004918u, 0, ATAN_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 1054226850u, 4085705359u, 0, ATAN_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 1057053639u, 2053704821u, 0, ATAN_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 3188976647u, 3725731239u, 0, ATAN_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 3220734833u, 3583708004u, 0, ATAN_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 3206052774u, 685688214u, 0, ATAN_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 3207367087u, 4175325358u, 0, ATAN_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 3220775417u, 1227029661u, 0, ATAN_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 3218937769u, 460181535u, 0, ATAN_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1073291771u, 1404124390u, 0, ATAN_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1073291753u, 550827505u, 0, ATAN_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 1054885127u, 644456791u, 0, ATAN_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1073291716u, 3181235278u, 0, ATAN_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1073291771u, 593146344u, 0, ATAN_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 1064733284u, 2087599474u, 0, ATAN_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 1061536351u, 1264224322u, 0, ATAN_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1057248676u, 2646116431u, 0, ATAN_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 3194422028u, 1839068696u, 0, ATAN_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1046493630u, 772102379u, 0, ATAN_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 3220773222u, 3213354261u, 0, ATAN_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 1051172137u, 506285757u, 0, ATAN_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1073290176u, 1772815414u, 0, ATAN_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1073289605u, 4100112063u, 0, ATAN_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 3211536908u, 3829698748u, 0, ATAN_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 3199680614u, 184127759u, 0, ATAN_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 3220672839u, 3275979607u, 0, ATAN_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1073291771u, 1373060099u, 0, ATAN_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1073291771u, 1412663036u, 0, ATAN_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1073291731u, 1683126600u, 0, ATAN_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 1069372110u, 661828638u, 0, ATAN_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 3220775351u, 2592582459u, 0, ATAN_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 3203224610u, 1473327771u, 0, ATAN_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1073291771u, 1405982747u, 0, ATAN_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 3192516074u, 1732245037u, 0, ATAN_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 3220775419u, 1393227976u, 0, ATAN_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 3220775419u, 870751708u, 0, ATAN_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 3206903253u, 2157488019u, 0, ATAN_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1073257971u, 3212130123u, 0, ATAN_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1073289688u, 970851516u, 0, ATAN_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1073291770u, 3104111779u, 0, ATAN_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1044571091u, 2759019783u, 0, ATAN_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 3212931254u, 4118622275u, 0, ATAN_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1073291771u, 1010517977u, 0, ATAN_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1073291651u, 4087685810u, 0, ATAN_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1073050451u, 1298823045u, 0, ATAN_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 1061342535u, 3181387989u, 0, ATAN_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 3200834423u, 2588046871u, 0, ATAN_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 3206978856u, 782105851u, 0, ATAN_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 3205576370u, 3085721192u, 0, ATAN_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 3218277070u, 170982227u, 0, ATAN_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 3220775419u, 786115172u, 0, ATAN_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 3193326350u, 2265437200u, 0, ATAN_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 3216356510u, 3130045131u, 0, ATAN_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1073288986u, 1599297092u, 0, ATAN_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 3220661545u, 2360188947u, 0, ATAN_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 3220775393u, 1564574150u, 0, ATAN_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1064345010u, 91354218u, 0, ATAN_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 3220775419u, 1229020839u, 0, ATAN_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 3207257417u, 3153390830u, 0, ATAN_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1073290724u, 450646531u, 0, ATAN_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 3188695272u, 3011191657u, 0, ATAN_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 1063235021u, 18397155u, 0, ATAN_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1073291061u, 3360101992u, 0, ATAN_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 1051139427u, 1769685264u, 0, ATAN_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1073266134u, 3382378805u, 0, ATAN_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1073291771u, 1404523163u, 0, ATAN_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1072935915u, 2808066494u, 0, ATAN_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1073290001u, 1019866120u, 0, ATAN_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 3220775419u, 1320468477u, 0, ATAN_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 3193663083u, 3467757355u, 0, ATAN_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 3220775416u, 3317262141u, 0, ATAN_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 3197412883u, 166402619u, 0, ATAN_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1073289428u, 3826672040u, 0, ATAN_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1062392908u, 146390139u, 0, ATAN_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1073290138u, 799707370u, 0, ATAN_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 3195629021u, 2055773713u, 0, ATAN_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 3220775403u, 2314140343u, 0, ATAN_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 1065715974u, 35998340u, 0, ATAN_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 3206539410u, 2198680371u, 0, ATAN_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 3209424905u, 3566213783u, 0, ATAN_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 3220775419u, 1411894679u, 0, ATAN_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 3220775406u, 1991373169u, 0, ATAN_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 3212663441u, 557352853u, 0, ATAN_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 1057720186u, 181489071u, 0, ATAN_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 3220775401u, 2935191220u, 0, ATAN_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 1057135741u, 753852027u, 0, ATAN_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1061623064u, 2803417540u, 0, ATAN_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 3195290997u, 2676398675u, 0, ATAN_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1065079362u, 1525379125u, 0, ATAN_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1073263078u, 3456048071u, 0, ATAN_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1071998637u, 1520446375u, 0, ATAN_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 3220775418u, 1726748208u, 0, ATAN_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1073129556u, 465493249u, 0, ATAN_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 3219741172u, 402094487u, 0, ATAN_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1064600501u, 2906031848u, 0, ATAN_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 1045423002u, 967350971u, 0, ATAN_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 3220775419u, 1410264341u, 0, ATAN_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 3189614508u, 2863482262u, 0, ATAN_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 3202629313u, 2801605942u, 0, ATAN_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 3220775268u, 601862620u, 0, ATAN_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 1056516397u, 4170560568u, 0, ATAN_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 3219712844u, 4031557243u, 0, ATAN_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1073291771u, 1408998203u, 0, ATAN_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1042279322u, 4170235262u, 0, ATAN_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1073288505u, 1128617660u, 0, ATAN_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1061684276u, 3374504276u, 0, ATAN_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1073116881u, 2973410148u, 0, ATAN_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1073291771u, 753307915u, 0, ATAN_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1073288702u, 3862163748u, 0, ATAN_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1073200832u, 550615540u, 0, ATAN_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1073291771u, 1388641055u, 0, ATAN_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1069094882u, 2881866002u, 0, ATAN_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 3188629767u, 978126928u, 0, ATAN_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 3220529367u, 1621616907u, 0, ATAN_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 3220775419u, 1379804590u, 0, ATAN_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 3202707679u, 2599736239u, 0, ATAN_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1073291771u, 1411721947u, 0, ATAN_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1073181201u, 2704068544u, 0, ATAN_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 1042831340u, 1958025850u, 0, ATAN_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 3220775227u, 87898411u, 0, ATAN_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 3220774310u, 1330759385u, 0, ATAN_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1073290999u, 3351093382u, 0, ATAN_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1073286719u, 1180729218u, 0, ATAN_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1073291770u, 3999438264u, 0, ATAN_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1058377732u, 2307222569u, 0, ATAN_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1073275178u, 629967402u, 0, ATAN_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 3220775408u, 2267284262u, 0, ATAN_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 3220775419u, 1304613937u, 0, ATAN_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 3220680727u, 2268085707u, 0, ATAN_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 1040986626u, 672789828u, 0, ATAN_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1068388550u, 2060043978u, 0, ATAN_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 3210046176u, 1879315059u, 0, ATAN_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1067680266u, 836859157u, 0, ATAN_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1073268156u, 2368365124u, 0, ATAN_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 1042898869u, 3807416441u, 0, ATAN_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 3216097138u, 1587837360u, 0, ATAN_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 3220775414u, 3572787935u, 0, ATAN_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 1049684114u, 1160161907u, 0, ATAN_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1073291771u, 1402320498u, 0, ATAN_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 3220761198u, 99640567u, 0, ATAN_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 3220775417u, 3281157886u, 0, ATAN_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 3191030402u, 3117037091u, 0, ATAN_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1051974004u, 749716276u, 0, ATAN_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 1044833651u, 1966536294u, 0, ATAN_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1073291771u, 1186380431u, 0, ATAN_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1073288095u, 975760224u, 0, ATAN_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1073291430u, 4231533096u, 0, ATAN_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 3216624327u, 2984333214u, 0, ATAN_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 3220774349u, 64738554u, 0, ATAN_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1073291771u, 1234985800u, 0, ATAN_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 3220775327u, 2154288794u, 0, ATAN_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 1055231263u, 3936048875u, 0, ATAN_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 3207981719u, 1040984050u, 0, ATAN_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 3208148223u, 747412838u, 0, ATAN_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 3217052992u, 1555622102u, 0, ATAN_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1073291734u, 3631354939u, 0, ATAN_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1050652945u, 977585456u, 0, ATAN_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1073291771u, 1411393777u, 0, ATAN_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 3190565456u, 1371169579u, 0, ATAN_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 3220775419u, 1410112575u, 0, ATAN_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 3220775419u, 1319429561u, 0, ATAN_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 3220423383u, 4080038932u, 0, ATAN_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1072297380u, 2183099160u, 0, ATAN_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 3220775350u, 32520571u, 0, ATAN_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 3220775413u, 407383253u, 0, ATAN_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1073291771u, 1264692187u, 0, ATAN_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 3220775419u, 1308217418u, 0, ATAN_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1073291771u, 853683724u, 0, ATAN_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1070942026u, 2210584062u, 0, ATAN_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 3220774259u, 253905046u, 0, ATAN_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 3220775419u, 1308384776u, 0, ATAN_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1073166574u, 1025940890u, 0, ATAN_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1073291769u, 3589520410u, 0, ATAN_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 3193169876u, 2782073371u, 0, ATAN_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1073291771u, 1253307985u, 0, ATAN_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 3220775413u, 4039361968u, 0, ATAN_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 3192664477u, 1265459564u, 0, ATAN_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1073289278u, 188086895u, 0, ATAN_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 3220775419u, 1385126805u, 0, ATAN_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 3206272087u, 4111519788u, 0, ATAN_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 3220775419u, 1401915076u, 0, ATAN_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 3220775419u, 1374959245u, 0, ATAN_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1073287341u, 203181843u, 0, ATAN_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 3215732190u, 1095526509u, 0, ATAN_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 3220751942u, 961394714u, 0, ATAN_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 3220775419u, 1408422145u, 0, ATAN_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 3194765687u, 1840632530u, 0, ATAN_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 3220774835u, 107798951u, 0, ATAN_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1071153116u, 955946986u, 0, ATAN_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 3220775419u, 255807873u, 0, ATAN_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 3198264929u, 1614536736u, 0, ATAN_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 3220775419u, 1407480385u, 0, ATAN_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1072293047u, 4133707511u, 0, ATAN_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 3196802686u, 2406734385u, 0, ATAN_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 3195751081u, 1618759113u, 0, ATAN_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1055357248u, 3589759702u, 0, ATAN_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 3189943060u, 2431246964u, 0, ATAN_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1073291755u, 3364626322u, 0, ATAN_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 3220775374u, 760015622u, 0, ATAN_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1046553348u, 1839214509u, 0, ATAN_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1058073864u, 732999146u, 0, ATAN_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 3200324971u, 2143369580u, 0, ATAN_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1073013435u, 3897459075u, 0, ATAN_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 3214165815u, 3584504723u, 0, ATAN_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 3189989959u, 1578976988u, 0, ATAN_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 3220620607u, 1469862024u, 0, ATAN_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 3208432764u, 3113624660u, 0, ATAN_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 1060196346u, 2070620457u, 0, ATAN_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 3220473326u, 1149516223u, 0, ATAN_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 3187706018u, 3570940805u, 0, ATAN_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 3208209565u, 623194338u, 0, ATAN_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1073291771u, 1347956769u, 0, ATAN_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 1047115221u, 1909994271u, 0, ATAN_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1060855260u, 1232553651u, 0, ATAN_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 1059496132u, 1388651658u, 0, ATAN_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 3220775394u, 2429171461u, 0, ATAN_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1073291771u, 1232796133u, 0, ATAN_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 3220775419u, 1404666552u, 0, ATAN_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 1054174923u, 3548669145u, 0, ATAN_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1073257387u, 1653316307u, 0, ATAN_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1073291258u, 1832453141u, 0, ATAN_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 1043958672u, 2986160931u, 0, ATAN_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 3220775379u, 435052465u, 0, ATAN_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1073291771u, 1325856743u, 0, ATAN_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 1040415832u, 2283342035u, 0, ATAN_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 3213249290u, 1435325825u, 0, ATAN_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 3211562370u, 1298984321u, 0, ATAN_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 3192989874u, 286247089u, 0, ATAN_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1073291770u, 1437106148u, 0, ATAN_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1073290727u, 2010468964u, 0, ATAN_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 3201695807u, 2256289754u, 0, ATAN_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 3204024695u, 2293847985u, 0, ATAN_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1073265066u, 4256021444u, 0, ATAN_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 3220255295u, 271607952u, 0, ATAN_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 3220775414u, 2439297396u, 0, ATAN_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 1043015571u, 174689677u, 0, ATAN_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1073291763u, 450648504u, 0, ATAN_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1064525890u, 1715802635u, 0, ATAN_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 3213791678u, 3007257663u, 0, ATAN_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 3213663259u, 311185822u, 0, ATAN_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1073291770u, 2029975416u, 0, ATAN_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 1066754387u, 4086493895u, 0, ATAN_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 3189290617u, 1578223762u, 0, ATAN_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 1058506965u, 2093127013u, 0, ATAN_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 3220774972u, 910304915u, 0, ATAN_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1073291771u, 1380457062u, 0, ATAN_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 3197002651u, 330905559u, 0, ATAN_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1040729961u, 4162008079u, 0, ATAN_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1073287540u, 2371515359u, 0, ATAN_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 3220775419u, 1400414230u, 0, ATAN_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 1060785883u, 3802506466u, 0, ATAN_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1073284806u, 1247593837u, 0, ATAN_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 3220775419u, 1328022993u, 0, ATAN_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1073291754u, 2923568867u, 0, ATAN_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 3218681850u, 1847050563u, 0, ATAN_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 3207908064u, 2076460116u, 0, ATAN_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1054766684u, 1856443407u, 0, ATAN_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1073179730u, 1409096648u, 0, ATAN_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 3220775419u, 22547020u, 0, ATAN_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1073291771u, 1303083258u, 0, ATAN_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 3220775419u, 1409081748u, 0, ATAN_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 1043665640u, 3441419500u, 0, ATAN_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 3220775414u, 912315842u, 0, ATAN_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 3220405998u, 2405698646u, 0, ATAN_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1073281057u, 3850595125u, 0, ATAN_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1072179536u, 576294670u, 0, ATAN_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1073291771u, 1198344675u, 0, ATAN_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1073291502u, 668770754u, 0, ATAN_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 3199083880u, 1346860680u, 0, ATAN_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 3212255963u, 2575368903u, 0, ATAN_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 3220719302u, 4010635913u, 0, ATAN_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 3219988674u, 723943353u, 0, ATAN_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 3205481779u, 1521480496u, 0, ATAN_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 3201033321u, 89295233u, 0, ATAN_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 3192325102u, 747591401u, 0, ATAN_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1073291766u, 964142956u, 0, ATAN_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 3220770052u, 2371897689u, 0, ATAN_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 3197179414u, 3119528849u, 0, ATAN_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 3220775418u, 4001726821u, 0, ATAN_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 1070112385u, 2324629516u, 0, ATAN_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1073157149u, 2384478230u, 0, ATAN_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1073291771u, 1391862546u, 0, ATAN_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1073291771u, 508366786u, 0, ATAN_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 3220775419u, 1413042086u, 0, ATAN_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 3220757999u, 2601919599u, 0, ATAN_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 3203678820u, 264315986u, 0, ATAN_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1067299954u, 4125060907u, 0, ATAN_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1050106742u, 4027114920u, 0, ATAN_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 3202500155u, 2875554229u, 0, ATAN_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 1063244409u, 1905701370u, 0, ATAN_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1073291771u, 1390334372u, 0, ATAN_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 1064853141u, 4034264880u, 0, ATAN_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 3220775419u, 827896136u, 0, ATAN_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 3213436271u, 1847005657u, 0, ATAN_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 3191951036u, 469586759u, 0, ATAN_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1073284977u, 3192771017u, 0, ATAN_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 3210826983u, 1096190575u, 0, ATAN_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 3207120390u, 3784882034u, 0, ATAN_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 1064522270u, 1282391261u, 0, ATAN_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1073291735u, 2479837516u, 0, ATAN_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 3202970118u, 2179867188u, 0, ATAN_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 3197084744u, 394130621u, 0, ATAN_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 1044237059u, 849581558u, 0, ATAN_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 3210140013u, 3254290288u, 0, ATAN_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1073291481u, 1130560623u, 0, ATAN_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1073291771u, 1382955631u, 0, ATAN_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 3220775419u, 1411174993u, 0, ATAN_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 3189668753u, 1174874204u, 0, ATAN_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1073291771u, 1408870945u, 0, ATAN_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 3220775419u, 580952561u, 0, ATAN_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 1058121042u, 435005828u, 0, ATAN_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1068847283u, 1453079796u, 0, ATAN_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 3220775419u, 1413212472u, 0, ATAN_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1073291702u, 1923249299u, 0, ATAN_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 3200952547u, 2511891688u, 0, ATAN_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 1069970272u, 3725464389u, 0, ATAN_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1073291771u, 1408851704u, 0, ATAN_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 3211263950u, 1129887755u, 0, ATAN_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 3195249375u, 3509997268u, 0, ATAN_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1047182435u, 2156824607u, 0, ATAN_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 3213264025u, 3343823185u, 0, ATAN_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 3190593412u, 4261696995u, 0, ATAN_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 3220775419u, 660142742u, 0, ATAN_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 3220775416u, 84151276u, 0, ATAN_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1073267908u, 2262143575u, 0, ATAN_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 3217300970u, 3407849933u, 0, ATAN_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 1060749713u, 2046999671u, 0, ATAN_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1073289487u, 3892573379u, 0, ATAN_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 1041622738u, 2682092368u, 0, ATAN_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1056312613u, 4174257689u, 0, ATAN_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1073291768u, 2828785388u, 0, ATAN_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 3213890776u, 3394288938u, 0, ATAN_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 3220775418u, 2166514155u, 0, ATAN_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1073291231u, 2806829990u, 0, ATAN_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 3203475098u, 1379636450u, 0, ATAN_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1063890851u, 1803848101u, 0, ATAN_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1044637404u, 1778509100u, 0, ATAN_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 3216720517u, 1754322990u, 0, ATAN_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 1048277388u, 4128020170u, 0, ATAN_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 3193183163u, 2454653986u, 0, ATAN_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 3220775419u, 1412610186u, 0, ATAN_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 3220775419u, 1302286191u, 0, ATAN_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 3220498805u, 206635599u, 0, ATAN_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 1069008339u, 2594825754u, 0, ATAN_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 3192291109u, 2960339502u, 0, ATAN_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 3196691185u, 4093388589u, 0, ATAN_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1073291765u, 4232917553u, 0, ATAN_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 3209294194u, 1724814107u, 0, ATAN_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1069200730u, 2838359932u, 0, ATAN_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1073291771u, 1407620370u, 0, ATAN_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1054300653u, 622431858u, 0, ATAN_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1073291771u, 1413015906u, 0, ATAN_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1073287386u, 3992075709u, 0, ATAN_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1073291223u, 177779348u, 0, ATAN_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 3219591699u, 1256648668u, 0, ATAN_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 3220775384u, 4026022101u, 0, ATAN_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 3220775419u, 1410898849u, 0, ATAN_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 3220739994u, 2897296068u, 0, ATAN_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 3200484782u, 592570987u, 0, ATAN_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1059518664u, 1711804542u, 0, ATAN_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 3220775419u, 1312568063u, 0, ATAN_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 1069503457u, 2348282124u, 0, ATAN_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 3220283027u, 1002653763u, 0, ATAN_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1073291771u, 1407227492u, 0, ATAN_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 3193003684u, 2134662911u, 0, ATAN_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1073286198u, 3085447705u, 0, ATAN_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 3219558298u, 2269278275u, 0, ATAN_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 3196410507u, 3683897869u, 0, ATAN_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1073291762u, 1307929677u, 0, ATAN_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 3211635383u, 3022112621u, 0, ATAN_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1042339597u, 904146293u, 0, ATAN_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 3195694970u, 1894173438u, 0, ATAN_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1073291766u, 2357955634u, 0, ATAN_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1073291771u, 106237732u, 0, ATAN_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 1064005444u, 2749041560u, 0, ATAN_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 3220775414u, 3709335570u, 0, ATAN_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1068207430u, 8813710u, 0, ATAN_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 3212768322u, 1671039386u, 0, ATAN_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 3220775418u, 2886941600u, 0, ATAN_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1073291771u, 1409876384u, 0, ATAN_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 3220621353u, 4001909775u, 0, ATAN_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 3220775396u, 810338157u, 0, ATAN_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1073291769u, 4139613811u, 0, ATAN_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 3213778971u, 1246708253u, 0, ATAN_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 3213904103u, 1713739478u, 0, ATAN_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1073291762u, 4182981995u, 0, ATAN_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1073291506u, 3512049895u, 0, ATAN_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1073291767u, 243274939u, 0, ATAN_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 1066678898u, 1238205004u, 0, ATAN_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1073290795u, 1157092083u, 0, ATAN_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1073270688u, 982942339u, 0, ATAN_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 1046570941u, 2228057307u, 0, ATAN_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1073291736u, 2441167806u, 0, ATAN_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 3219055128u, 4177082013u, 0, ATAN_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1073291771u, 330699280u, 0, ATAN_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 3205195072u, 2375758791u, 0, ATAN_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1073291566u, 1019663749u, 0, ATAN_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 1051092760u, 2798719163u, 0, ATAN_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 3220774741u, 2601378473u, 0, ATAN_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 3220591958u, 589886074u, 0, ATAN_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 3220202601u, 1052314086u, 0, ATAN_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 3220055200u, 2406131310u, 0, ATAN_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1073291771u, 1145555305u, 0, ATAN_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 1042677918u, 2026673913u, 0, ATAN_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 3220775419u, 1413170689u, 0, ATAN_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1057479809u, 3134693707u, 0, ATAN_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 3220775401u, 761552601u, 0, ATAN_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1056505004u, 3803371882u, 0, ATAN_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 3220775419u, 1065981758u, 0, ATAN_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 3203939880u, 2156476156u, 0, ATAN_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1073289773u, 4195207371u, 0, ATAN_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 3200980182u, 558753393u, 0, ATAN_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 1045705464u, 1703969218u, 0, ATAN_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 3220775410u, 1673085403u, 0, ATAN_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1064752065u, 1009918850u, 0, ATAN_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1065665325u, 3871906750u, 0, ATAN_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 3220775416u, 1964605070u, 0, ATAN_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 1068637227u, 91739263u, 0, ATAN_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 3220772114u, 723621190u, 0, ATAN_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1073291770u, 2965076896u, 0, ATAN_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1073291105u, 2619236622u, 0, ATAN_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1073281171u, 1434939574u, 0, ATAN_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 3220459365u, 39489730u, 0, ATAN_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 3220775407u, 212221075u, 0, ATAN_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 3214433173u, 346054303u, 0, ATAN_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1073135949u, 3455617632u, 0, ATAN_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 3208774795u, 1977672474u, 0, ATAN_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1072334401u, 1635343292u, 0, ATAN_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 3219598396u, 649284778u, 0, ATAN_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 3200062692u, 2871637541u, 0, ATAN_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 1068348446u, 1625121175u, 0, ATAN_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 3195449689u, 2386312530u, 0, ATAN_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1073291725u, 4058436244u, 0, ATAN_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1073291771u, 1412554883u, 0, ATAN_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1045506226u, 2342364630u, 0, ATAN_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 3201169162u, 2911512210u, 0, ATAN_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 1050472772u, 1836215904u, 0, ATAN_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1070156256u, 362413592u, 0, ATAN_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 3208554596u, 2352342162u, 0, ATAN_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 3193931414u, 1565550567u, 0, ATAN_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 3220775406u, 3707453445u, 0, ATAN_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1053576974u, 1492592410u, 0, ATAN_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 3220505917u, 3954374385u, 0, ATAN_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 3217873918u, 333405695u, 0, ATAN_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 3220774402u, 3286568866u, 0, ATAN_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1060199382u, 1568543297u, 0, ATAN_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 3220775418u, 3447477152u, 0, ATAN_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1073288091u, 1693769373u, 0, ATAN_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 3210671075u, 3602355648u, 0, ATAN_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 3220775417u, 83447410u, 0, ATAN_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1073291771u, 1228578841u, 0, ATAN_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1063211458u, 3300269630u, 0, ATAN_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1073291771u, 1330575128u, 0, ATAN_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1073291620u, 2500359190u, 0, ATAN_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 3220774553u, 3165117407u, 0, ATAN_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 3220775419u, 1175063706u, 0, ATAN_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1064761227u, 4272869931u, 0, ATAN_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 3212669497u, 590425081u, 0, ATAN_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 1062762007u, 4093486714u, 0, ATAN_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 3220775412u, 3424876321u, 0, ATAN_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 3189496738u, 4063688092u, 0, ATAN_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1062350618u, 2844377288u, 0, ATAN_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 3220764918u, 3109126767u, 0, ATAN_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 3220775265u, 1029631236u, 0, ATAN_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1073290373u, 3708271087u, 0, ATAN_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1044581201u, 2869128958u, 0, ATAN_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1051832506u, 3112379362u, 0, ATAN_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 3220774764u, 4185567984u, 0, ATAN_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 3220775415u, 2726236893u, 0, ATAN_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1048415431u, 336846925u, 0, ATAN_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 1055954236u, 3638851837u, 0, ATAN_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 3211904785u, 3655851692u, 0, ATAN_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 3220775419u, 1410560001u, 0, ATAN_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1073290945u, 3772521170u, 0, ATAN_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 3205806444u, 3548533416u, 0, ATAN_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 3209906076u, 93300911u, 0, ATAN_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1066720634u, 3245875704u, 0, ATAN_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1073291771u, 881861522u, 0, ATAN_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1073291767u, 1919667150u, 0, ATAN_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 3190626018u, 3739770117u, 0, ATAN_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 3220774457u, 2412695394u, 0, ATAN_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1072756380u, 1060157024u, 0, ATAN_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 1054849265u, 2352933591u, 0, ATAN_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 3220775419u, 1408923688u, 0, ATAN_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 3220775412u, 3006302837u, 0, ATAN_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 3199712298u, 36850854u, 0, ATAN_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1073291111u, 960893753u, 0, ATAN_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 3197852749u, 3808681228u, 0, ATAN_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 1040685928u, 3175490326u, 0, ATAN_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 1042302993u, 3124482451u, 0, ATAN_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 1045245695u, 2751606435u, 0, ATAN_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1073291771u, 304476461u, 0, ATAN_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 3199349254u, 1019914835u, 0, ATAN_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 3199478752u, 2060430582u, 0, ATAN_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 3191180557u, 1098469906u, 0, ATAN_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 3209974707u, 75604910u, 0, ATAN_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 3220329431u, 3837208282u, 0, ATAN_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1073291771u, 1394003992u, 0, ATAN_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 3220775401u, 3148250534u, 0, ATAN_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 3220775419u, 1240250322u, 0, ATAN_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1073291771u, 1308903742u, 0, ATAN_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 1062971251u, 1915359509u, 0, ATAN_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 3213772969u, 2265240188u, 0, ATAN_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1045656117u, 1385714427u, 0, ATAN_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1050527919u, 599267995u, 0, ATAN_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 1069940106u, 2132233565u, 0, ATAN_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1045922781u, 3136078995u, 0, ATAN_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 3220775283u, 2202674566u, 0, ATAN_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1073291771u, 1413021149u, 0, ATAN_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 3189114773u, 1922837702u, 0, ATAN_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 3220775419u, 620238805u, 0, ATAN_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1073291771u, 382605392u, 0, ATAN_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 3220772746u, 1206299653u, 0, ATAN_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 3196182703u, 1085283146u, 0, ATAN_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1073291767u, 1016111287u, 0, ATAN_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 3218757631u, 103356347u, 0, ATAN_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 3201277070u, 2205191738u, 0, ATAN_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1067698962u, 1743785447u, 0, ATAN_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 3210833090u, 4113949558u, 0, ATAN_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 3204950351u, 965469711u, 0, ATAN_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 3220775415u, 227572644u, 0, ATAN_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 3206031242u, 1465977202u, 0, ATAN_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 3202074143u, 690043153u, 0, ATAN_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1073291771u, 573823006u, 0, ATAN_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 3220775344u, 3178743683u, 0, ATAN_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 3203879091u, 4173044074u, 0, ATAN_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 3220775419u, 255456628u, 0, ATAN_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1073232022u, 1403395700u, 0, ATAN_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1073291245u, 2121958750u, 0, ATAN_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1073291771u, 1340790833u, 0, ATAN_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 3220775419u, 1412348225u, 0, ATAN_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 3220774009u, 56229122u, 0, ATAN_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1073283214u, 546297662u, 0, ATAN_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1073258092u, 3166288107u, 0, ATAN_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 1070734947u, 1769347893u, 0, ATAN_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1073291771u, 630771632u, 0, ATAN_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1073263250u, 3774528357u, 0, ATAN_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 3204570464u, 1774153099u, 0, ATAN_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 3193845708u, 2614400264u, 0, ATAN_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 3213982567u, 1570677133u, 0, ATAN_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1073291378u, 600985871u, 0, ATAN_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 3220774941u, 2964952981u, 0, ATAN_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1073291771u, 1153051410u, 0, ATAN_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 3196739825u, 784208675u, 0, ATAN_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 3220775419u, 1377500189u, 0, ATAN_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 3220775400u, 2379450018u, 0, ATAN_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1073291028u, 2762329418u, 0, ATAN_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1073291768u, 279335930u, 0, ATAN_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 3220759309u, 1835502520u, 0, ATAN_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1043995372u, 4274131512u, 0, ATAN_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 3198822121u, 2648931893u, 0, ATAN_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1064563225u, 1790170628u, 0, ATAN_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 1061084774u, 777797761u, 0, ATAN_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 3220773754u, 1865928231u, 0, ATAN_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1048158178u, 500311993u, 0, ATAN_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 3220329869u, 3571128500u, 0, ATAN_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1073291771u, 1321968173u, 0, ATAN_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1058013442u, 1429747799u, 0, ATAN_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 3214538255u, 731111446u, 0, ATAN_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1073224818u, 2264453881u, 0, ATAN_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 3220586287u, 1628037007u, 0, ATAN_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1073291771u, 1393259219u, 0, ATAN_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1073291771u, 1311113410u, 0, ATAN_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 3218867430u, 403113079u, 0, ATAN_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 3204860597u, 1225527184u, 0, ATAN_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 3220699293u, 1573791609u, 0, ATAN_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 3197712584u, 4277540717u, 0, ATAN_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 3195975013u, 900999556u, 0, ATAN_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1073213521u, 1835490717u, 0, ATAN_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1048668084u, 2154187846u, 0, ATAN_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 3220655327u, 2167262020u, 0, ATAN_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 3220775241u, 2726413826u, 0, ATAN_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 3220775417u, 3403014384u, 0, ATAN_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 3220775401u, 3651312642u, 0, ATAN_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 3217294032u, 3185958956u, 0, ATAN_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 1050438056u, 3655291713u, 0, ATAN_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 3220775419u, 309136010u, 0, ATAN_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 3220775239u, 811985673u, 0, ATAN_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1073291756u, 841732295u, 0, ATAN_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 3206733664u, 1899280125u, 0, ATAN_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1073291771u, 1404163801u, 0, ATAN_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1073291771u, 1408967836u, 0, ATAN_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 3220775419u, 1412087754u, 0, ATAN_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 3204276820u, 2093520013u, 0, ATAN_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 3192954620u, 2892538035u, 0, ATAN_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 3220775418u, 4281124194u, 0, ATAN_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 3191562216u, 607966734u, 0, ATAN_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 3216386175u, 1322685163u, 0, ATAN_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 3220775406u, 1494646968u, 0, ATAN_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 3212912280u, 3578229329u, 0, ATAN_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1073291771u, 1066273712u, 0, ATAN_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 1049886858u, 2958421157u, 0, ATAN_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 3193026497u, 3221475559u, 0, ATAN_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1071119536u, 1826918111u, 0, ATAN_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 3220775418u, 3374233364u, 0, ATAN_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 3210617890u, 945751955u, 0, ATAN_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1040575629u, 90378038u, 0, ATAN_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1073291771u, 1413091807u, 0, ATAN_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1073272117u, 1819728786u, 0, ATAN_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1051205256u, 2034777067u, 0, ATAN_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 1051063028u, 1489111380u, 0, ATAN_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 3206743917u, 2760020153u, 0, ATAN_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1073291737u, 575189280u, 0, ATAN_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 1065927257u, 3181844983u, 0, ATAN_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1069889350u, 2230613097u, 0, ATAN_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 3220775419u, 1071139528u, 0, ATAN_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 3209301560u, 2938734198u, 0, ATAN_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1052313869u, 2852345698u, 0, ATAN_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 1043946301u, 3589563265u, 0, ATAN_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 3190610826u, 1766416701u, 0, ATAN_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 3219820855u, 3731536090u, 0, ATAN_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1073281659u, 4030188121u, 0, ATAN_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1073291771u, 1409057565u, 0, ATAN_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 3210792095u, 3824997910u, 0, ATAN_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1069595014u, 1384544234u, 0, ATAN_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 1058947127u, 2548184513u, 0, ATAN_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 1046157033u, 15816843u, 0, ATAN_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1042413021u, 1051983351u, 0, ATAN_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 3201249525u, 2003775571u, 0, ATAN_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1052556037u, 3671476720u, 0, ATAN_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1067396479u, 1346565657u, 0, ATAN_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1064194382u, 3949880665u, 0, ATAN_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 1052140785u, 4167783152u, 0, ATAN_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1073291576u, 74764910u, 0, ATAN_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 1049366282u, 953085077u, 0, ATAN_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1069492363u, 118491179u, 0, ATAN_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1067219125u, 347575134u, 0, ATAN_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 3220775419u, 1407328857u, 0, ATAN_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 3220775342u, 3099784857u, 0, ATAN_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1069606504u, 224366851u, 0, ATAN_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1073288484u, 3698902139u, 0, ATAN_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 3198557846u, 86295309u, 0, ATAN_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 3220775419u, 1151245100u, 0, ATAN_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1073288198u, 790114970u, 0, ATAN_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 3220775419u, 1405151179u, 0, ATAN_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1073289237u, 2972570011u, 0, ATAN_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 3220775419u, 1182273584u, 0, ATAN_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1058899062u, 931827316u, 0, ATAN_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1072339043u, 656785282u, 0, ATAN_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 3220775419u, 1372965423u, 0, ATAN_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1057078797u, 649807813u, 0, ATAN_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 3207115731u, 1340677698u, 0, ATAN_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 3201597307u, 921031302u, 0, ATAN_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1067509892u, 653900706u, 0, ATAN_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 3220768180u, 2143621544u, 0, ATAN_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1073291601u, 555702737u, 0, ATAN_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1073291768u, 1306532201u, 0, ATAN_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 3220775264u, 2245620163u, 0, ATAN_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 3220775417u, 1361316791u, 0, ATAN_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 3211846071u, 2937369977u, 0, ATAN_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1073291771u, 1396407837u, 0, ATAN_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 3217407951u, 2906082294u, 0, ATAN_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 3189302097u, 3775270392u, 0, ATAN_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 3204330900u, 3096874134u, 0, ATAN_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 3201591712u, 3718395815u, 0, ATAN_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1044131371u, 508048351u, 0, ATAN_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 3198611627u, 2784737154u, 0, ATAN_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 3220750049u, 2204586419u, 0, ATAN_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1073291770u, 131697235u, 0, ATAN_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 3216576868u, 1585853008u, 0, ATAN_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 1048430980u, 2083412111u, 0, ATAN_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1073123748u, 1365709044u, 0, ATAN_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 3220775419u, 1368106620u, 0, ATAN_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 3220775419u, 1409778101u, 0, ATAN_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1067683288u, 309601593u, 0, ATAN_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1073291770u, 3852398620u, 0, ATAN_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 3202965930u, 330602253u, 0, ATAN_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1073291757u, 2392636410u, 0, ATAN_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 3220775338u, 4066583188u, 0, ATAN_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 3192972706u, 1566376352u, 0, ATAN_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1073291771u, 16684148u, 0, ATAN_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 3216666310u, 4273937132u, 0, ATAN_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1073288903u, 298132872u, 0, ATAN_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1072614497u, 1900219019u, 0, ATAN_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 1066482836u, 3239967720u, 0, ATAN_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 1066091894u, 2830833949u, 0, ATAN_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 3220775232u, 2570987938u, 0, ATAN_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 3195084967u, 2163853080u, 0, ATAN_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1073138032u, 1287113367u, 0, ATAN_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 3220775419u, 1321484326u, 0, ATAN_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 3201904086u, 2571271300u, 0, ATAN_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 3220774302u, 1520882757u, 0, ATAN_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 3220775262u, 3650169817u, 0, ATAN_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 3220772555u, 2963463001u, 0, ATAN_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 3220775418u, 1721031217u, 0, ATAN_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 3198632935u, 2527384545u, 0, ATAN_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 3220775418u, 3531975415u, 0, ATAN_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 1058857869u, 2640355150u, 0, ATAN_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1073291771u, 1410427816u, 0, ATAN_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1073291771u, 1324712742u, 0, ATAN_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 3220187055u, 1880552726u, 0, ATAN_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 3220775419u, 1404848096u, 0, ATAN_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 3191401834u, 3850162281u, 0, ATAN_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1073291771u, 110453937u, 0, ATAN_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 3220775419u, 295857859u, 0, ATAN_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 3220775419u, 1363530930u, 0, ATAN_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 3218637316u, 182033963u, 0, ATAN_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1073291633u, 3636630034u, 0, ATAN_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 3198234428u, 1551747647u, 0, ATAN_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 3220723263u, 3080632334u, 0, ATAN_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 3203949705u, 3601826749u, 0, ATAN_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 3198824584u, 3961206662u, 0, ATAN_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1073054787u, 2691726615u, 0, ATAN_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 3213275596u, 1913974053u, 0, ATAN_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1073291771u, 1413218495u, 0, ATAN_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 1049661768u, 1454212756u, 0, ATAN_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1072980428u, 3659931870u, 0, ATAN_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 3216405497u, 2100918285u, 0, ATAN_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1073254572u, 482439875u, 0, ATAN_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1066526916u, 1172927590u, 0, ATAN_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 3220775417u, 552152825u, 0, ATAN_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1073291231u, 2753811470u, 0, ATAN_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 3203199850u, 1831549326u, 0, ATAN_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1073251851u, 4090842556u, 0, ATAN_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 3220775379u, 154801752u, 0, ATAN_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1073196975u, 1827002005u, 0, ATAN_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 3220763881u, 1037935400u, 0, ATAN_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 3215945090u, 1354108515u, 0, ATAN_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1073200262u, 1491562591u, 0, ATAN_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 3192897879u, 1307010017u, 0, ATAN_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 3220775419u, 1300294502u, 0, ATAN_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 3188230541u, 760006940u, 0, ATAN_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 3220775410u, 1490604965u, 0, ATAN_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 3191802156u, 545462045u, 0, ATAN_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 1061232136u, 3219724183u, 0, ATAN_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1049883857u, 1804177335u, 0, ATAN_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1073225351u, 2385733259u, 0, ATAN_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1055471915u, 1599039729u, 0, ATAN_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 3207502326u, 2851086652u, 0, ATAN_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 3220775419u, 1412236097u, 0, ATAN_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 3198416643u, 150890277u, 0, ATAN_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 1062008938u, 2250748144u, 0, ATAN_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 3220775419u, 1409585431u, 0, ATAN_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1064841853u, 959039477u, 0, ATAN_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 3220775419u, 1391435146u, 0, ATAN_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1073291771u, 1368903776u, 0, ATAN_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 1042137451u, 2497054124u, 0, ATAN_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1047037641u, 790219078u, 0, ATAN_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 1057781400u, 1141591028u, 0, ATAN_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 3202729813u, 2684133556u, 0, ATAN_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1073291770u, 4276458873u, 0, ATAN_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 1063230984u, 951005581u, 0, ATAN_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 1064863529u, 156085544u, 0, ATAN_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 3204547572u, 839532312u, 0, ATAN_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 1064632072u, 97645502u, 0, ATAN_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 3220775419u, 1188307079u, 0, ATAN_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 3191062890u, 2002049816u, 0, ATAN_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 3220772535u, 2404832840u, 0, ATAN_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 3220775122u, 3765834803u, 0, ATAN_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 3196861276u, 3899474901u, 0, ATAN_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1073291754u, 114116815u, 0, ATAN_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1073291771u, 1373058424u, 0, ATAN_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1054806016u, 1479681591u, 0, ATAN_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1073272411u, 3681422370u, 0, ATAN_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1073289053u, 815191780u, 0, ATAN_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 3193829772u, 41779310u, 0, ATAN_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1058131100u, 1385469640u, 0, ATAN_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1072049769u, 3735827532u, 0, ATAN_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 3220775419u, 1413126891u, 0, ATAN_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 3195453512u, 35164280u, 0, ATAN_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1073291435u, 1993247669u, 0, ATAN_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1068841127u, 3974629702u, 0, ATAN_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1046252518u, 981897613u, 0, ATAN_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 3220767284u, 128407746u, 0, ATAN_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 1069766183u, 1729676079u, 0, ATAN_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1073291674u, 4097535485u, 0, ATAN_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 3218057649u, 2810753583u, 0, ATAN_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 3220775419u, 1354698203u, 0, ATAN_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1073291771u, 1406287239u, 0, ATAN_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 3194118956u, 709803843u, 0, ATAN_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 3193280779u, 744421178u, 0, ATAN_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1073291769u, 2902193025u, 0, ATAN_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 3206108502u, 123036041u, 0, ATAN_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 3220775417u, 3831840535u, 0, ATAN_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 3220775419u, 1408333280u, 0, ATAN_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 3203476252u, 3791963717u, 0, ATAN_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 3205316273u, 2107016210u, 0, ATAN_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 3220775419u, 1410801605u, 0, ATAN_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 3194595076u, 2991290477u, 0, ATAN_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1073291761u, 66967298u, 0, ATAN_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 3220775419u, 1407967006u, 0, ATAN_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 1053236165u, 3748916443u, 0, ATAN_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1073291419u, 1282433458u, 0, ATAN_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1053106984u, 1449151986u, 0, ATAN_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1071324467u, 3218427578u, 0, ATAN_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1073087652u, 2777987846u, 0, ATAN_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 3200308256u, 3315121534u, 0, ATAN_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 3196425891u, 2246037450u, 0, ATAN_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 3193006859u, 4191285446u, 0, ATAN_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1073291769u, 2887266886u, 0, ATAN_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1073283083u, 111073037u, 0, ATAN_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1073291771u, 871166501u, 0, ATAN_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 3191549550u, 3797143370u, 0, ATAN_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 3220775419u, 1410805976u, 0, ATAN_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1073291687u, 2163190817u, 0, ATAN_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 3200980575u, 3309652299u, 0, ATAN_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 3220378535u, 2927260740u, 0, ATAN_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 1067019331u, 3482482559u, 0, ATAN_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 3220775419u, 1394100471u, 0, ATAN_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1073284877u, 2447232217u, 0, ATAN_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 3220775385u, 1169410173u, 0, ATAN_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1073291719u, 1930580370u, 0, ATAN_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 1064074687u, 1409027919u, 0, ATAN_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1073291733u, 320751146u, 0, ATAN_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1052843785u, 351054996u, 0, ATAN_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1054128006u, 1365196637u, 0, ATAN_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1064122377u, 1946325669u, 0, ATAN_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 3220775419u, 1408697885u, 0, ATAN_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1073291732u, 1376045510u, 0, ATAN_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 3198135087u, 1636965592u, 0, ATAN_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 1050931318u, 3551516295u, 0, ATAN_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 3220773724u, 50491510u, 0, ATAN_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 3220775408u, 717252040u, 0, ATAN_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1073244175u, 2030721393u, 0, ATAN_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1073291771u, 1341911326u, 0, ATAN_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 3220775419u, 1407439174u, 0, ATAN_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 3205479397u, 3429005786u, 0, ATAN_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 3213993874u, 2371201783u, 0, ATAN_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 3220505888u, 3375236297u, 0, ATAN_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 3220775419u, 1276615550u, 0, ATAN_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 3204057950u, 184780236u, 0, ATAN_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1073291771u, 1039639815u, 0, ATAN_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 1042654053u, 2171898436u, 0, ATAN_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 3220775419u, 637635996u, 0, ATAN_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1073291768u, 1714660265u, 0, ATAN_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 3205426509u, 1229110840u, 0, ATAN_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 3210978635u, 2253688262u, 0, ATAN_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 1050299283u, 3772748579u, 0, ATAN_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 3220774468u, 1035678043u, 0, ATAN_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1073291768u, 611077343u, 0, ATAN_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 3198617153u, 1518333114u, 0, ATAN_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 1047317453u, 2825203162u, 0, ATAN_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1073291771u, 1350285403u, 0, ATAN_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 3216387601u, 4098199039u, 0, ATAN_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1073291771u, 1409602963u, 0, ATAN_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 3208098435u, 1555193049u, 0, ATAN_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 3220775419u, 1352240263u, 0, ATAN_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 3220667101u, 3771485332u, 0, ATAN_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 3219303954u, 2708833062u, 0, ATAN_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 3212869615u, 1098347868u, 0, ATAN_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 3202279557u, 1562193851u, 0, ATAN_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 3220775158u, 140561636u, 0, ATAN_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 3219296527u, 1491630951u, 0, ATAN_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1073291771u, 1351935916u, 0, ATAN_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 3213082453u, 2479375184u, 0, ATAN_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1072134131u, 784335985u, 0, ATAN_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 3198075559u, 3891229992u, 0, ATAN_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1073246412u, 2690826313u, 0, ATAN_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1060624530u, 3604130788u, 0, ATAN_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 3220768486u, 1656700840u, 0, ATAN_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1073291627u, 948489182u, 0, ATAN_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1073291771u, 1404277038u, 0, ATAN_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 1064980291u, 1134578128u, 0, ATAN_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1072967440u, 3478680514u, 0, ATAN_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 3213429084u, 554927145u, 0, ATAN_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1073291501u, 3676281215u, 0, ATAN_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 1048333111u, 3566257237u, 0, ATAN_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 3220775419u, 770928296u, 0, ATAN_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1041627284u, 2336116589u, 0, ATAN_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 1058567659u, 887688527u, 0, ATAN_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 1044467183u, 2818710946u, 0, ATAN_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 3189504094u, 4099522736u, 0, ATAN_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1073291769u, 277932339u, 0, ATAN_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1073291771u, 1411647529u, 0, ATAN_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 3220775415u, 1092893741u, 0, ATAN_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1073291329u, 222247607u, 0, ATAN_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 1052415330u, 458751459u, 0, ATAN_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 3193282956u, 2533012201u, 0, ATAN_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 3203364780u, 4107609388u, 0, ATAN_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1073291763u, 2924714246u, 0, ATAN_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 3193980043u, 1213941006u, 0, ATAN_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1073291771u, 897967252u, 0, ATAN_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1073291771u, 240417192u, 0, ATAN_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1073291111u, 1032347836u, 0, ATAN_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1073291770u, 2398529340u, 0, ATAN_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1073218543u, 1579157249u, 0, ATAN_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 3220775419u, 1411180698u, 0, ATAN_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1073290644u, 3391630935u, 0, ATAN_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 1041110867u, 2076689028u, 0, ATAN_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1047307438u, 1376882086u, 0, ATAN_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1073284167u, 545905631u, 0, ATAN_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 3220757517u, 953792288u, 0, ATAN_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1043564602u, 3685851715u, 0, ATAN_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1040244055u, 3974431579u, 0, ATAN_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 3191496789u, 3819109588u, 0, ATAN_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 1072215921u, 2918165436u, 0, ATAN_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1048038468u, 2228686181u, 0, ATAN_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 3220774839u, 4032438805u, 0, ATAN_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1073291771u, 1409017496u, 0, ATAN_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 1045883607u, 1278581411u, 0, ATAN_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 3220539858u, 4248673150u, 0, ATAN_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1073291771u, 1412874493u, 0, ATAN_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1072771439u, 2289580023u, 0, ATAN_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 3220774834u, 945795067u, 0, ATAN_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 3220736549u, 2407476344u, 0, ATAN_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 3220775419u, 1410919766u, 0, ATAN_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1065302956u, 2901868158u, 0, ATAN_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1058468363u, 818420201u, 0, ATAN_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1057279949u, 2136218948u, 0, ATAN_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 3189636931u, 851569132u, 0, ATAN_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 3220775272u, 1543167911u, 0, ATAN_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 3220743880u, 1522537798u, 0, ATAN_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1073291184u, 310117365u, 0, ATAN_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 3220769009u, 1748628101u, 0, ATAN_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 3220643553u, 1526559974u, 0, ATAN_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1073291769u, 3927597683u, 0, ATAN_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 1061442762u, 4211298986u, 0, ATAN_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 3191395187u, 2372623300u, 0, ATAN_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1073291771u, 1376490868u, 0, ATAN_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 1062262700u, 2842818152u, 0, ATAN_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 1057172551u, 3618948239u, 0, ATAN_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1073291766u, 3217095478u, 0, ATAN_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 3220775419u, 1285213958u, 0, ATAN_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1073291771u, 1409250064u, 0, ATAN_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 3220775419u, 1403626769u, 0, ATAN_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1072964666u, 202373549u, 0, ATAN_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 1068217026u, 479221391u, 0, ATAN_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1073291763u, 821836508u, 0, ATAN_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 1068067111u, 2464247744u, 0, ATAN_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 3208484674u, 372849960u, 0, ATAN_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1073291771u, 236074415u, 0, ATAN_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 3220775410u, 546977720u, 0, ATAN_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 1049139928u, 1469010744u, 0, ATAN_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1072922065u, 3238144722u, 0, ATAN_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 3220775418u, 3499927600u, 0, ATAN_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1073291771u, 1264666645u, 0, ATAN_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 3220775418u, 3013522169u, 0, ATAN_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1047279982u, 3840538366u, 0, ATAN_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 3217591674u, 1542745806u, 0, ATAN_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 3220775419u, 1387845116u, 0, ATAN_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1044195166u, 3510904416u, 0, ATAN_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 3220775418u, 4234354237u, 0, ATAN_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1073291413u, 2103282272u, 0, ATAN_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1046586062u, 2207037104u, 0, ATAN_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 3197884060u, 3838689400u, 0, ATAN_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1073291614u, 2021593024u, 0, ATAN_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 3199540805u, 3502368360u, 0, ATAN_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1064676129u, 736153526u, 0, ATAN_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 3193514956u, 3653237930u, 0, ATAN_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1053588582u, 376499284u, 0, ATAN_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 3220775418u, 4047410047u, 0, ATAN_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 3220728061u, 2553280327u, 0, ATAN_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1073291768u, 2586254000u, 0, ATAN_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 3214798778u, 470120798u, 0, ATAN_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 3205946965u, 979971726u, 0, ATAN_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 3220772194u, 2914363116u, 0, ATAN_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 3220775409u, 2061634836u, 0, ATAN_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 3220774372u, 2525024706u, 0, ATAN_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1073291753u, 2038737724u, 0, ATAN_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 3220775393u, 415839685u, 0, ATAN_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1073285756u, 1224181296u, 0, ATAN_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 1041545782u, 2024044989u, 0, ATAN_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 1053207518u, 2564950092u, 0, ATAN_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1073291757u, 332418688u, 0, ATAN_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1059802968u, 477147092u, 0, ATAN_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 3193155705u, 659070057u, 0, ATAN_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 3217660522u, 22885475u, 0, ATAN_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 3220638407u, 1068937368u, 0, ATAN_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1056934836u, 1947891957u, 0, ATAN_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 1057530368u, 2070509097u, 0, ATAN_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 3200839250u, 3792911087u, 0, ATAN_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 3220775419u, 1412661288u, 0, ATAN_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 3201314702u, 236862084u, 0, ATAN_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1064936571u, 2938837843u, 0, ATAN_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1073291195u, 3362761430u, 0, ATAN_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1073291770u, 2015396783u, 0, ATAN_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_ATAN_H multiple inclusion protection + +// EOF atan.h diff --git a/packages/language/c/libm/current/tests/vectors/atan2.c b/packages/language/c/libm/current/tests/vectors/atan2.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/atan2.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// atan2.c +// +// Test of atan2() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/atan2.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(atan2_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &atan2, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_DOUBLE, CYG_LIBM_TEST_VEC_DOUBLE, + &atan2_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("atan2() is stable"); + } // if + else + { + CYG_TEST_FAIL("atan2() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library atan2() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "atan2() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF atan2.c diff --git a/packages/language/c/libm/current/tests/vectors/atan2.h b/packages/language/c/libm/current/tests/vectors/atan2.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/atan2.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_ATAN2_H +#define CYGONCE_LIBM_ATAN2_H +//=========================================================================== +// +// atan2.h +// +// Test vectors for testing of atan2() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/atan2.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define ATAN2_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t atan2_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1060516776u, 3333805635u, 0, ATAN2_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 3220775415u, 4052029953u, 0, ATAN2_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 3220782531u, 1779867601u, 0, ATAN2_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1073291771u, 1413786937u, 0, ATAN2_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 3193768732u, 1507839071u, 0, ATAN2_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1073291771u, 1413304009u, 0, ATAN2_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1074333583u, 830538607u, 0, ATAN2_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 3220775417u, 1364230657u, 0, ATAN2_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1073291567u, 1591891568u, 0, ATAN2_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 3208670066u, 3166828529u, 0, ATAN2_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1074340322u, 2934931366u, 0, ATAN2_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1073291708u, 833789888u, 0, ATAN2_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1073291765u, 3052119569u, 0, ATAN2_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 3199327084u, 1658797856u, 0, ATAN2_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1073291771u, 1413754161u, 0, ATAN2_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1073293288u, 2536055081u, 0, ATAN2_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1073291773u, 202528659u, 0, ATAN2_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1073291800u, 1460654986u, 0, ATAN2_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 3221823995u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 3220775419u, 1413754137u, 0, ATAN2_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 3221823975u, 3066300469u, 0, ATAN2_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 1025866913u, 476012722u, 0, ATAN2_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1073291771u, 1413740793u, 0, ATAN2_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1073291146u, 519406859u, 0, ATAN2_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 3202985534u, 429824132u, 0, ATAN2_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 1044197651u, 157929467u, 0, ATAN2_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1073292642u, 574335499u, 0, ATAN2_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 3220775418u, 2037904225u, 0, ATAN2_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1074340347u, 353869949u, 0, ATAN2_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 3220775414u, 3448122542u, 0, ATAN2_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1073452282u, 2384968155u, 0, ATAN2_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1073314265u, 1225245499u, 0, ATAN2_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 3221794005u, 2449967509u, 0, ATAN2_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 3221823995u, 1411895162u, 0, ATAN2_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 1020493089u, 2638422367u, 0, ATAN2_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 1074340347u, 1374947702u, 0, ATAN2_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 3199932056u, 1923516624u, 0, ATAN2_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 3220777273u, 3001432630u, 0, ATAN2_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 3221823995u, 1412243119u, 0, ATAN2_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 3220775314u, 1019381704u, 0, ATAN2_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 3220775419u, 1277923777u, 0, ATAN2_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 3220774777u, 3808345438u, 0, ATAN2_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1073291771u, 1413754121u, 0, ATAN2_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1073291771u, 1413768676u, 0, ATAN2_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 1045549451u, 3020174776u, 0, ATAN2_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1073291917u, 3856099993u, 0, ATAN2_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1073290279u, 1748157573u, 0, ATAN2_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 1074340347u, 1413741153u, 0, ATAN2_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 1050700637u, 377777497u, 0, ATAN2_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1073280985u, 3990294061u, 0, ATAN2_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 3189688821u, 1967505573u, 0, ATAN2_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1074340347u, 1369193237u, 0, ATAN2_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 3220775419u, 1413496309u, 0, ATAN2_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 1028910280u, 474546229u, 0, ATAN2_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1073291757u, 3973879027u, 0, ATAN2_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1071562234u, 1135817425u, 0, ATAN2_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 3221823713u, 2124571212u, 0, ATAN2_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 3221823995u, 1413754126u, 0, ATAN2_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 3220772807u, 557213311u, 0, ATAN2_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1073291771u, 1413781856u, 0, ATAN2_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1071781660u, 855449165u, 0, ATAN2_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1056426594u, 575941403u, 0, ATAN2_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 1036481790u, 348598352u, 0, ATAN2_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 3220775420u, 3252379851u, 0, ATAN2_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 3172842030u, 737633450u, 0, ATAN2_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1073291771u, 1413562337u, 0, ATAN2_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 3163763824u, 3335080682u, 0, ATAN2_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 3220539236u, 1047035747u, 0, ATAN2_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 3220775419u, 1413754137u, 0, ATAN2_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 3220775248u, 3541319657u, 0, ATAN2_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1074332102u, 862538429u, 0, ATAN2_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1073291771u, 1477715401u, 0, ATAN2_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1073291771u, 1413753803u, 0, ATAN2_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1074340347u, 1406300672u, 0, ATAN2_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 3186444617u, 2240666822u, 0, ATAN2_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1073290287u, 1237501481u, 0, ATAN2_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1073291771u, 1413897047u, 0, ATAN2_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1056430437u, 2142332257u, 0, ATAN2_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 1074340347u, 1413753663u, 0, ATAN2_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 3221812019u, 1159724914u, 0, ATAN2_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 3206202985u, 1543004313u, 0, ATAN2_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 3220775474u, 3829350416u, 0, ATAN2_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 3220775612u, 2162833348u, 0, ATAN2_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 3220775419u, 1478098953u, 0, ATAN2_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 3221823995u, 1413754055u, 0, ATAN2_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 3221823995u, 1413524923u, 0, ATAN2_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1073065835u, 1428060798u, 0, ATAN2_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 3221821257u, 2386162209u, 0, ATAN2_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 3220775419u, 1413742479u, 0, ATAN2_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1073291775u, 1852788729u, 0, ATAN2_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 3213798660u, 2452948390u, 0, ATAN2_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 3197354937u, 308479596u, 0, ATAN2_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1059162114u, 2426041278u, 0, ATAN2_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 3157459107u, 1210059648u, 0, ATAN2_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 1074340347u, 1405882205u, 0, ATAN2_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1073291787u, 2877164985u, 0, ATAN2_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 1074340347u, 1413751438u, 0, ATAN2_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1047044850u, 2730590439u, 0, ATAN2_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1073291771u, 1190439791u, 0, ATAN2_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1074329532u, 3989379092u, 0, ATAN2_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1073267610u, 3785540369u, 0, ATAN2_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 3220775419u, 1404513616u, 0, ATAN2_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 3221823994u, 4086286991u, 0, ATAN2_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 3220775419u, 1410255195u, 0, ATAN2_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 3221823995u, 1413745566u, 0, ATAN2_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1073291771u, 1519999247u, 0, ATAN2_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1072286622u, 2053442458u, 0, ATAN2_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1073291744u, 192894795u, 0, ATAN2_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 3221823995u, 1413753462u, 0, ATAN2_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 3220775419u, 1531585924u, 0, ATAN2_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 1074340347u, 1393012109u, 0, ATAN2_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 3221823995u, 1413714848u, 0, ATAN2_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 3207769238u, 3405578258u, 0, ATAN2_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 3220775419u, 1413752816u, 0, ATAN2_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 3220775413u, 2250709746u, 0, ATAN2_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 3213153234u, 3944566878u, 0, ATAN2_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 1074340347u, 1384861709u, 0, ATAN2_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 3220774780u, 3778488872u, 0, ATAN2_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 1048061879u, 2604201297u, 0, ATAN2_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1074340265u, 1685661745u, 0, ATAN2_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 3162834191u, 1491700165u, 0, ATAN2_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1073291844u, 921212635u, 0, ATAN2_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1073292950u, 3329090447u, 0, ATAN2_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1073291150u, 501359091u, 0, ATAN2_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 3220774597u, 4214455842u, 0, ATAN2_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1073291771u, 1414082445u, 0, ATAN2_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 3221823961u, 492279224u, 0, ATAN2_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1073291763u, 2709355216u, 0, ATAN2_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 1024927028u, 3174699925u, 0, ATAN2_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 3220775419u, 1413240381u, 0, ATAN2_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 3221823975u, 3715901097u, 0, ATAN2_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 3221823621u, 954825115u, 0, ATAN2_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 3221823883u, 3803937142u, 0, ATAN2_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 1046327908u, 2131334968u, 0, ATAN2_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 3209067280u, 2184469635u, 0, ATAN2_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1073291802u, 1446271064u, 0, ATAN2_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1063064177u, 4271069553u, 0, ATAN2_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1074340347u, 171714992u, 0, ATAN2_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1073291448u, 606986359u, 0, ATAN2_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1073291770u, 827852710u, 0, ATAN2_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1073291771u, 1413754121u, 0, ATAN2_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1073973865u, 4157892710u, 0, ATAN2_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1073246514u, 2513688842u, 0, ATAN2_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1073291771u, 1413697311u, 0, ATAN2_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1073291771u, 1392147632u, 0, ATAN2_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 3159628256u, 3479115227u, 0, ATAN2_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 3220775419u, 1410994916u, 0, ATAN2_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 3220775419u, 1407667849u, 0, ATAN2_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 3171224256u, 3042081445u, 0, ATAN2_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1073291771u, 1413753286u, 0, ATAN2_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1073286682u, 1089370823u, 0, ATAN2_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 1074340347u, 1413754013u, 0, ATAN2_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 3221823989u, 3586265324u, 0, ATAN2_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 3220775420u, 2282135818u, 0, ATAN2_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1073291771u, 1452045876u, 0, ATAN2_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1073291771u, 1703571112u, 0, ATAN2_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1073291771u, 1412929411u, 0, ATAN2_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1073122183u, 140532146u, 0, ATAN2_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1073291771u, 1499402253u, 0, ATAN2_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 3220775419u, 1413762806u, 0, ATAN2_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 3220775514u, 1729092407u, 0, ATAN2_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 3220775419u, 1274081208u, 0, ATAN2_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 1074340347u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1070763061u, 223510141u, 0, ATAN2_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 3221823995u, 1413486700u, 0, ATAN2_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1073291851u, 263621047u, 0, ATAN2_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1073525032u, 1065629369u, 0, ATAN2_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 1039579594u, 530920292u, 0, ATAN2_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 3210619589u, 3844263673u, 0, ATAN2_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 3220775419u, 1455260758u, 0, ATAN2_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 1074340347u, 1413754119u, 0, ATAN2_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1073291771u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 3220809586u, 1181173116u, 0, ATAN2_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 3220775419u, 1413770632u, 0, ATAN2_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 3221823995u, 1413754104u, 0, ATAN2_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1074340347u, 1147805547u, 0, ATAN2_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 1074340347u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1064597908u, 3248929885u, 0, ATAN2_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1058514691u, 93854393u, 0, ATAN2_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1073291771u, 1413752504u, 0, ATAN2_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 3191856322u, 2454091642u, 0, ATAN2_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 3221823994u, 786236647u, 0, ATAN2_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1073291693u, 3122589465u, 0, ATAN2_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 3220775419u, 264803512u, 0, ATAN2_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 1023949209u, 2552938589u, 0, ATAN2_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 3220775571u, 86427973u, 0, ATAN2_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 3221823923u, 3911059063u, 0, ATAN2_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 3220778823u, 3018255129u, 0, ATAN2_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1073291771u, 1283584478u, 0, ATAN2_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1074340110u, 49491821u, 0, ATAN2_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1073291771u, 1413754372u, 0, ATAN2_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 3206111337u, 3190732180u, 0, ATAN2_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 3220775419u, 1414383540u, 0, ATAN2_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 3220775417u, 1756718867u, 0, ATAN2_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 3221823995u, 6147356u, 0, ATAN2_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1073291771u, 1408585582u, 0, ATAN2_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 3220775419u, 1413748104u, 0, ATAN2_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 3220775419u, 1552605650u, 0, ATAN2_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1073291771u, 1413753931u, 0, ATAN2_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 3216654218u, 2665088407u, 0, ATAN2_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1074203548u, 1093101691u, 0, ATAN2_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1073291768u, 2831089077u, 0, ATAN2_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 3220775419u, 2783017523u, 0, ATAN2_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 3220775419u, 1413754137u, 0, ATAN2_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1074335508u, 2461266247u, 0, ATAN2_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1073075348u, 3825695664u, 0, ATAN2_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 3219463075u, 3544171608u, 0, ATAN2_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1073291771u, 1413754142u, 0, ATAN2_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 3220775419u, 1413753090u, 0, ATAN2_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 3221547303u, 87902914u, 0, ATAN2_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1074331765u, 569600306u, 0, ATAN2_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 3220775419u, 1427849851u, 0, ATAN2_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 3220803925u, 1098100543u, 0, ATAN2_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 3220775615u, 2924037437u, 0, ATAN2_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 3220775419u, 1413760594u, 0, ATAN2_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1068509660u, 2200288765u, 0, ATAN2_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 3188590794u, 2538532254u, 0, ATAN2_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 3195711492u, 1207470557u, 0, ATAN2_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 3220774976u, 2444948188u, 0, ATAN2_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 3170912079u, 2161799950u, 0, ATAN2_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 3220775423u, 2550216294u, 0, ATAN2_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1074339805u, 56671396u, 0, ATAN2_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 3220752859u, 3608022711u, 0, ATAN2_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 3195627327u, 334480517u, 0, ATAN2_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 3220775419u, 1413708205u, 0, ATAN2_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1074340323u, 4069514407u, 0, ATAN2_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 3220766878u, 1711852653u, 0, ATAN2_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 3221245977u, 1315689607u, 0, ATAN2_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1074339412u, 819341061u, 0, ATAN2_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 3221823995u, 1413754133u, 0, ATAN2_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1073291771u, 1644226526u, 0, ATAN2_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 3220775419u, 1395556462u, 0, ATAN2_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1074339988u, 3977110612u, 0, ATAN2_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1074340343u, 987307560u, 0, ATAN2_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 3174560640u, 1856766382u, 0, ATAN2_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1055995824u, 3605199018u, 0, ATAN2_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 3220775422u, 1539133503u, 0, ATAN2_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 3196301980u, 310302479u, 0, ATAN2_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 3197161903u, 3540713705u, 0, ATAN2_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 3210005619u, 3640098698u, 0, ATAN2_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 1031784915u, 3988125478u, 0, ATAN2_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 3216184372u, 556023485u, 0, ATAN2_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 3221823995u, 1413752869u, 0, ATAN2_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 3201044813u, 1604476516u, 0, ATAN2_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1073291771u, 1413753998u, 0, ATAN2_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 1034770959u, 240841472u, 0, ATAN2_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1059176465u, 271458589u, 0, ATAN2_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 1074340346u, 4259233439u, 0, ATAN2_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 3220797503u, 1340620628u, 0, ATAN2_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1073297577u, 3650346549u, 0, ATAN2_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 3220775419u, 1413754135u, 0, ATAN2_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 1040701220u, 3078453447u, 0, ATAN2_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1049638005u, 306477302u, 0, ATAN2_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1074026983u, 3357817851u, 0, ATAN2_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 1040481408u, 1957853232u, 0, ATAN2_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 3220775419u, 409538388u, 0, ATAN2_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1073291771u, 1413091321u, 0, ATAN2_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 1034620223u, 4280831376u, 0, ATAN2_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 3182636588u, 2434396909u, 0, ATAN2_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 3221146045u, 2893060263u, 0, ATAN2_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 3180476761u, 2988831978u, 0, ATAN2_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1073291771u, 1413754124u, 0, ATAN2_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1073291762u, 692166418u, 0, ATAN2_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 3221823994u, 3139624897u, 0, ATAN2_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 3192196347u, 1542977546u, 0, ATAN2_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1058529089u, 1126344259u, 0, ATAN2_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 3220510929u, 1739151392u, 0, ATAN2_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 3221763183u, 1965202253u, 0, ATAN2_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 1036280030u, 1927977740u, 0, ATAN2_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1074306661u, 1328138233u, 0, ATAN2_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1073291770u, 1848879823u, 0, ATAN2_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 3221011893u, 656866874u, 0, ATAN2_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 3221823995u, 1390307120u, 0, ATAN2_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1073291768u, 1461994101u, 0, ATAN2_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 1050767840u, 2486862394u, 0, ATAN2_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 3221823995u, 1413587503u, 0, ATAN2_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 1044967070u, 1980882681u, 0, ATAN2_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 3220736532u, 3007186906u, 0, ATAN2_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1073290350u, 575898392u, 0, ATAN2_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 3183433692u, 3286143315u, 0, ATAN2_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1074331505u, 371434821u, 0, ATAN2_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1073292151u, 3278130121u, 0, ATAN2_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 3220775419u, 1413722619u, 0, ATAN2_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 1074340347u, 1397586603u, 0, ATAN2_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1074336029u, 2538208560u, 0, ATAN2_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 3221770256u, 2268809344u, 0, ATAN2_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1056527653u, 2039806622u, 0, ATAN2_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 3220775419u, 1396003111u, 0, ATAN2_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 3221823995u, 1413753895u, 0, ATAN2_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1073292007u, 3529587265u, 0, ATAN2_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1073291771u, 1443899242u, 0, ATAN2_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 3221202626u, 668180253u, 0, ATAN2_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1073291771u, 1413754122u, 0, ATAN2_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 3220775509u, 2468332239u, 0, ATAN2_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 1074340347u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 3220775419u, 1413783313u, 0, ATAN2_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 3221812687u, 4212242567u, 0, ATAN2_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1070683852u, 2913647986u, 0, ATAN2_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1073372815u, 1982011803u, 0, ATAN2_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1073292503u, 2915421251u, 0, ATAN2_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1074339506u, 1441440662u, 0, ATAN2_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 3193939787u, 236456121u, 0, ATAN2_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 3185604502u, 1834083044u, 0, ATAN2_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 3220775419u, 744152180u, 0, ATAN2_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 3218111449u, 1089451389u, 0, ATAN2_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 3214971596u, 4023288564u, 0, ATAN2_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 3194423243u, 1680654607u, 0, ATAN2_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 3192742867u, 3338280103u, 0, ATAN2_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1073291771u, 1413753983u, 0, ATAN2_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 3221823995u, 206920092u, 0, ATAN2_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 3221823994u, 1688936819u, 0, ATAN2_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 3214206928u, 1981300716u, 0, ATAN2_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 1074340347u, 414981618u, 0, ATAN2_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1074340347u, 1394882706u, 0, ATAN2_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1073291771u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1073291771u, 1442479033u, 0, ATAN2_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 3220775419u, 1413753470u, 0, ATAN2_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 3200863282u, 3341642384u, 0, ATAN2_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 3212430502u, 3276978561u, 0, ATAN2_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1073291505u, 3692883481u, 0, ATAN2_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1073313139u, 1714711090u, 0, ATAN2_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 3221823995u, 1256167845u, 0, ATAN2_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 1074340347u, 1395039177u, 0, ATAN2_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1073291771u, 1436432035u, 0, ATAN2_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 1074340347u, 606725624u, 0, ATAN2_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 3221812706u, 1843639519u, 0, ATAN2_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 3220787976u, 2072716519u, 0, ATAN2_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 3172708289u, 1238338899u, 0, ATAN2_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1073542769u, 2645651585u, 0, ATAN2_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 3220834344u, 690081828u, 0, ATAN2_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 3177757862u, 681445639u, 0, ATAN2_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 1074340347u, 1412866626u, 0, ATAN2_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1073291753u, 3619892060u, 0, ATAN2_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 3221822198u, 3917681358u, 0, ATAN2_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 3221823995u, 1413753942u, 0, ATAN2_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 1074340347u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 3221823995u, 1413739684u, 0, ATAN2_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1074340335u, 477454515u, 0, ATAN2_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1073291771u, 1413765596u, 0, ATAN2_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 3220784654u, 1958963073u, 0, ATAN2_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 3221823993u, 17073376u, 0, ATAN2_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1073291771u, 1413757228u, 0, ATAN2_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 3220775419u, 1413754133u, 0, ATAN2_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 1074340347u, 1413754113u, 0, ATAN2_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1073291767u, 3450375180u, 0, ATAN2_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 3220775487u, 1146283756u, 0, ATAN2_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1074308487u, 1585139852u, 0, ATAN2_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 3221823992u, 844994325u, 0, ATAN2_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 1074340347u, 1355093335u, 0, ATAN2_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1073291771u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 3220775438u, 3970492568u, 0, ATAN2_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 3221823995u, 1413754135u, 0, ATAN2_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1073252154u, 1874059179u, 0, ATAN2_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 3221823995u, 1413691462u, 0, ATAN2_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 3221819545u, 2412162891u, 0, ATAN2_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 3220775419u, 1413762298u, 0, ATAN2_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 3220743669u, 1057087085u, 0, ATAN2_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1073291771u, 1419790643u, 0, ATAN2_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 3220775341u, 2458523280u, 0, ATAN2_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 1074340347u, 1407000771u, 0, ATAN2_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1073559895u, 2540803742u, 0, ATAN2_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 1074340347u, 1413753885u, 0, ATAN2_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1074314072u, 2132070035u, 0, ATAN2_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1073287925u, 2150158548u, 0, ATAN2_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 3221823995u, 1413714868u, 0, ATAN2_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 3220776287u, 4291004252u, 0, ATAN2_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1073287848u, 1423905059u, 0, ATAN2_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 3221823995u, 1404084868u, 0, ATAN2_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1073181451u, 2212869656u, 0, ATAN2_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1074340346u, 3646177722u, 0, ATAN2_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 3209461833u, 611904534u, 0, ATAN2_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 1044611053u, 3338545369u, 0, ATAN2_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 3221823995u, 1413666460u, 0, ATAN2_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 3220774543u, 2493910209u, 0, ATAN2_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 3221606608u, 1846608622u, 0, ATAN2_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 3203149602u, 1308976114u, 0, ATAN2_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 1045979362u, 2828014773u, 0, ATAN2_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 3166150248u, 3509208877u, 0, ATAN2_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 3173885469u, 2460479362u, 0, ATAN2_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1073291771u, 1413756459u, 0, ATAN2_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 3220619483u, 2585915607u, 0, ATAN2_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1073297233u, 3539037555u, 0, ATAN2_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1073282199u, 3269960540u, 0, ATAN2_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1060246537u, 266655134u, 0, ATAN2_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1073440841u, 3047088221u, 0, ATAN2_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1074330042u, 3439698595u, 0, ATAN2_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1074321255u, 2259334167u, 0, ATAN2_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 3221344398u, 1036409683u, 0, ATAN2_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 3215529370u, 1708242537u, 0, ATAN2_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 3220775419u, 1500189746u, 0, ATAN2_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 3209756652u, 2187415228u, 0, ATAN2_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 3221263565u, 54087162u, 0, ATAN2_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1073290725u, 3056176809u, 0, ATAN2_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 3220775408u, 1967527865u, 0, ATAN2_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 1062279619u, 4183240111u, 0, ATAN2_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 3221823995u, 1340091316u, 0, ATAN2_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1073291809u, 4062239471u, 0, ATAN2_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 3220965703u, 3612754429u, 0, ATAN2_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1073137367u, 4138084895u, 0, ATAN2_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 3220775541u, 2626113219u, 0, ATAN2_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 3221823995u, 1413754091u, 0, ATAN2_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1073291771u, 1413754030u, 0, ATAN2_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 3199412565u, 1145585977u, 0, ATAN2_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1054052163u, 4258128573u, 0, ATAN2_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 3221823995u, 1413702026u, 0, ATAN2_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1073291771u, 1413623295u, 0, ATAN2_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1073291771u, 1413760436u, 0, ATAN2_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 1030661409u, 3624861327u, 0, ATAN2_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 3221639371u, 1915145318u, 0, ATAN2_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1073291795u, 3854512035u, 0, ATAN2_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 3220797863u, 3282093125u, 0, ATAN2_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 3220775419u, 1414332672u, 0, ATAN2_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1073291771u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 3214651748u, 1763368877u, 0, ATAN2_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 3220775419u, 1413754321u, 0, ATAN2_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1073291771u, 1413751780u, 0, ATAN2_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 3221823995u, 193169772u, 0, ATAN2_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 3221823992u, 302653567u, 0, ATAN2_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1073291771u, 1413752610u, 0, ATAN2_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1074317335u, 873791565u, 0, ATAN2_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1073291771u, 1413756305u, 0, ATAN2_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 1074340347u, 1413405465u, 0, ATAN2_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1073291770u, 4033660480u, 0, ATAN2_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1073291783u, 2788085280u, 0, ATAN2_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 1034945225u, 467130534u, 0, ATAN2_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1074328321u, 219326390u, 0, ATAN2_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 3220781276u, 2851272908u, 0, ATAN2_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1073291771u, 1413901700u, 0, ATAN2_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 3221823995u, 1413753624u, 0, ATAN2_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1054091500u, 1719659965u, 0, ATAN2_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 1036752895u, 2144561956u, 0, ATAN2_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 3221823903u, 116437322u, 0, ATAN2_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 3204253019u, 2715940239u, 0, ATAN2_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 3199154933u, 3610356391u, 0, ATAN2_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 3221754802u, 2891454013u, 0, ATAN2_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1073291771u, 1413767229u, 0, ATAN2_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 1074340347u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 3220775421u, 3630480682u, 0, ATAN2_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1073291197u, 3198614702u, 0, ATAN2_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 3220781547u, 4079724151u, 0, ATAN2_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1056202262u, 2398795457u, 0, ATAN2_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 3220775415u, 1970569558u, 0, ATAN2_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 3169961636u, 2316676483u, 0, ATAN2_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1069044663u, 4073200908u, 0, ATAN2_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 3221583019u, 555325381u, 0, ATAN2_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 1074340347u, 1413683705u, 0, ATAN2_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 3220775419u, 1413718442u, 0, ATAN2_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1070744968u, 3181926916u, 0, ATAN2_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1072661657u, 531964835u, 0, ATAN2_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 3220775419u, 1413215646u, 0, ATAN2_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 1074340347u, 1413245175u, 0, ATAN2_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 3220775434u, 929725042u, 0, ATAN2_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1073291771u, 1413757756u, 0, ATAN2_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1074244980u, 2177313032u, 0, ATAN2_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1073291771u, 1384232668u, 0, ATAN2_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 3221823990u, 1797654074u, 0, ATAN2_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 3220775737u, 2309730354u, 0, ATAN2_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 3221823989u, 3589711354u, 0, ATAN2_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1071135059u, 4292477773u, 0, ATAN2_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 3221823995u, 1407380935u, 0, ATAN2_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1073291780u, 1496672534u, 0, ATAN2_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 3220775419u, 1441424078u, 0, ATAN2_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 3221823995u, 1413739665u, 0, ATAN2_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 1074340346u, 3494178900u, 0, ATAN2_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 3204951074u, 3755432132u, 0, ATAN2_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1073291771u, 1413746598u, 0, ATAN2_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1073291771u, 1413741681u, 0, ATAN2_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1066714524u, 2880653042u, 0, ATAN2_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 3168518603u, 844773889u, 0, ATAN2_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 1022062603u, 1216305448u, 0, ATAN2_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1074324365u, 3536638492u, 0, ATAN2_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 3220328328u, 288777588u, 0, ATAN2_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 3221823995u, 945021310u, 0, ATAN2_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 3220775419u, 1413048557u, 0, ATAN2_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1074340330u, 264751044u, 0, ATAN2_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 3221811860u, 3636053881u, 0, ATAN2_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 3220776548u, 1089393941u, 0, ATAN2_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 3220974844u, 1105605327u, 0, ATAN2_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1073816480u, 3931324112u, 0, ATAN2_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 3221802400u, 4209025746u, 0, ATAN2_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1074330881u, 1020150355u, 0, ATAN2_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 3207686623u, 217150313u, 0, ATAN2_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 3220775419u, 1412136057u, 0, ATAN2_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1073291771u, 1413751773u, 0, ATAN2_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1073311204u, 2140119256u, 0, ATAN2_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1073291771u, 1414172319u, 0, ATAN2_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1073291771u, 1342216949u, 0, ATAN2_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 3220775419u, 1327341624u, 0, ATAN2_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 3220775419u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1074324685u, 1952296142u, 0, ATAN2_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 3221823751u, 2613443644u, 0, ATAN2_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 1074340347u, 1260049180u, 0, ATAN2_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 3220775419u, 1413752935u, 0, ATAN2_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 3221823934u, 3816398185u, 0, ATAN2_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1073283845u, 959751544u, 0, ATAN2_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 3209165854u, 1292588262u, 0, ATAN2_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 3219675001u, 3783008083u, 0, ATAN2_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1073291771u, 1413462044u, 0, ATAN2_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1046218742u, 3600433113u, 0, ATAN2_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1073284014u, 394367749u, 0, ATAN2_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 3210179336u, 3523569011u, 0, ATAN2_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 3220775419u, 1414402421u, 0, ATAN2_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1068438792u, 192900885u, 0, ATAN2_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 1047380116u, 1418730997u, 0, ATAN2_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 3221351312u, 3588680507u, 0, ATAN2_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 3220775419u, 1413754137u, 0, ATAN2_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1073291771u, 1503946902u, 0, ATAN2_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 3221823971u, 3716500468u, 0, ATAN2_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 3221820838u, 3835685689u, 0, ATAN2_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1073353629u, 2620328931u, 0, ATAN2_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1074335577u, 920847588u, 0, ATAN2_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1074080031u, 3469111725u, 0, ATAN2_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 3203677087u, 531400053u, 0, ATAN2_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 3212021431u, 3055804927u, 0, ATAN2_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1074340091u, 3753688227u, 0, ATAN2_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 1074340347u, 1413183585u, 0, ATAN2_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 3221007119u, 1196948856u, 0, ATAN2_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 3220775382u, 1176824223u, 0, ATAN2_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 3219796789u, 1538651707u, 0, ATAN2_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1073291762u, 3770602758u, 0, ATAN2_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 3216282753u, 3281781855u, 0, ATAN2_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 1074340347u, 1413736777u, 0, ATAN2_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 1074340347u, 1413754135u, 0, ATAN2_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 1074340347u, 1413753413u, 0, ATAN2_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1073291832u, 2077035738u, 0, ATAN2_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 3221823994u, 3006114625u, 0, ATAN2_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 3196292051u, 3745275776u, 0, ATAN2_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 3180910912u, 1878107189u, 0, ATAN2_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 3221823995u, 1413752696u, 0, ATAN2_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 3204675530u, 1916238001u, 0, ATAN2_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1073291771u, 1413754457u, 0, ATAN2_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 3221802250u, 4147736145u, 0, ATAN2_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 3221821028u, 2832318322u, 0, ATAN2_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1074337339u, 2213018396u, 0, ATAN2_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 1052027372u, 2137620050u, 0, ATAN2_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 3221776824u, 2068034092u, 0, ATAN2_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1064889029u, 3113089001u, 0, ATAN2_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1074283173u, 929217064u, 0, ATAN2_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 1074340321u, 3999351917u, 0, ATAN2_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1074105927u, 590486715u, 0, ATAN2_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 3221823991u, 2496769912u, 0, ATAN2_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1074002337u, 362953818u, 0, ATAN2_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 3221823995u, 1389021617u, 0, ATAN2_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 3220775419u, 1414613829u, 0, ATAN2_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1073291770u, 4226382170u, 0, ATAN2_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 3215570352u, 202287484u, 0, ATAN2_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 3220779448u, 4046094648u, 0, ATAN2_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1074340271u, 691217786u, 0, ATAN2_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 3220775419u, 1397936212u, 0, ATAN2_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 3221818537u, 1523568185u, 0, ATAN2_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1067558816u, 3460237978u, 0, ATAN2_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 3221819514u, 1434032788u, 0, ATAN2_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 3221823995u, 1413753949u, 0, ATAN2_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 3221562416u, 2532873783u, 0, ATAN2_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 3221823966u, 1068911363u, 0, ATAN2_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 3220776028u, 1200694377u, 0, ATAN2_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1073291750u, 2707627380u, 0, ATAN2_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 3214660300u, 2118714483u, 0, ATAN2_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 3220752732u, 2940092767u, 0, ATAN2_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 3220770998u, 473091542u, 0, ATAN2_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1073291771u, 1305948110u, 0, ATAN2_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1056121962u, 2155693925u, 0, ATAN2_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1073291771u, 1417594236u, 0, ATAN2_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 3219549310u, 1137203995u, 0, ATAN2_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 3221823964u, 1382018570u, 0, ATAN2_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1074135537u, 1233729334u, 0, ATAN2_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1073291772u, 2099425605u, 0, ATAN2_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 1062513334u, 56068251u, 0, ATAN2_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1073291771u, 1413723011u, 0, ATAN2_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1074275855u, 1050043332u, 0, ATAN2_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 3182823388u, 104028836u, 0, ATAN2_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 3192781387u, 1626220884u, 0, ATAN2_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 3180936001u, 2419673162u, 0, ATAN2_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1059630438u, 3464345415u, 0, ATAN2_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 3220775419u, 1413963663u, 0, ATAN2_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1073291771u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 3180585169u, 3597293877u, 0, ATAN2_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 3220775419u, 1413760318u, 0, ATAN2_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 3220775419u, 1432381898u, 0, ATAN2_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1073291771u, 728789785u, 0, ATAN2_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1073291245u, 3038388733u, 0, ATAN2_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 3220774475u, 1873701732u, 0, ATAN2_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1068906481u, 294299579u, 0, ATAN2_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 3186835493u, 2577112950u, 0, ATAN2_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1073291772u, 1457340120u, 0, ATAN2_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 1053688799u, 141831638u, 0, ATAN2_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 3220549842u, 2563506636u, 0, ATAN2_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1074340339u, 347747626u, 0, ATAN2_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 3206528841u, 3354973379u, 0, ATAN2_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1073291771u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1074339955u, 491143107u, 0, ATAN2_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 3221770058u, 4164466189u, 0, ATAN2_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1074126327u, 3636244148u, 0, ATAN2_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 3220775419u, 1323885970u, 0, ATAN2_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1073291771u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1073291771u, 1413734333u, 0, ATAN2_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 3188800500u, 294117429u, 0, ATAN2_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 3221793662u, 1326681588u, 0, ATAN2_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 3220775419u, 1735373547u, 0, ATAN2_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 3221695345u, 1984385336u, 0, ATAN2_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 3221823995u, 1413737317u, 0, ATAN2_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1052645882u, 3518566757u, 0, ATAN2_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1074340347u, 1395868720u, 0, ATAN2_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 3194162327u, 3750694524u, 0, ATAN2_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 3220775418u, 4246419046u, 0, ATAN2_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 3220775419u, 1413754101u, 0, ATAN2_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 3220775419u, 1400657488u, 0, ATAN2_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 3220775417u, 921891724u, 0, ATAN2_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 1036624858u, 475016719u, 0, ATAN2_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 3220775419u, 1413760603u, 0, ATAN2_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 3220775419u, 4089363966u, 0, ATAN2_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1073238012u, 3737306125u, 0, ATAN2_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 3190509777u, 202615889u, 0, ATAN2_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1073291771u, 1413752826u, 0, ATAN2_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1073291771u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 3220747548u, 2609071137u, 0, ATAN2_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 3198949108u, 3506668202u, 0, ATAN2_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 3220636609u, 2779526109u, 0, ATAN2_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 3220775463u, 2181727803u, 0, ATAN2_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 3221823995u, 1413753807u, 0, ATAN2_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 3220775419u, 148829918u, 0, ATAN2_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 3220775419u, 1414845619u, 0, ATAN2_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 3221823995u, 1413661911u, 0, ATAN2_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1073263856u, 4163257255u, 0, ATAN2_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 1029993820u, 2650395805u, 0, ATAN2_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 3220574466u, 4033073907u, 0, ATAN2_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1073563291u, 393357359u, 0, ATAN2_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 3220814119u, 4061758705u, 0, ATAN2_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 3216328042u, 4025987202u, 0, ATAN2_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1056070011u, 3438784268u, 0, ATAN2_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1073291770u, 2975921270u, 0, ATAN2_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1073291771u, 2403360128u, 0, ATAN2_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1052762949u, 1804888531u, 0, ATAN2_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 1047017153u, 543502372u, 0, ATAN2_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 3221823990u, 3194962175u, 0, ATAN2_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1073291771u, 1413812610u, 0, ATAN2_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 1051506182u, 645526797u, 0, ATAN2_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1073281562u, 2426331355u, 0, ATAN2_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 3220775419u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 3220774208u, 3143699731u, 0, ATAN2_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1073278769u, 3336064018u, 0, ATAN2_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 1074340347u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 3162792535u, 3345390793u, 0, ATAN2_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 3220775419u, 1447365675u, 0, ATAN2_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1073231724u, 1380720998u, 0, ATAN2_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1073296080u, 1944358343u, 0, ATAN2_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 3213991705u, 3440225918u, 0, ATAN2_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1072684782u, 1392514266u, 0, ATAN2_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 1074340347u, 1409168979u, 0, ATAN2_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 1074340347u, 1413744680u, 0, ATAN2_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1065797572u, 550508248u, 0, ATAN2_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 3187798553u, 386045479u, 0, ATAN2_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1058149106u, 738340401u, 0, ATAN2_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1073301897u, 3275314629u, 0, ATAN2_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1073366603u, 4187390466u, 0, ATAN2_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 1047701412u, 2769143733u, 0, ATAN2_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1073163145u, 2304339909u, 0, ATAN2_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 1074340347u, 1409675598u, 0, ATAN2_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1068527205u, 3011997510u, 0, ATAN2_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1067322952u, 2531443543u, 0, ATAN2_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 3220775419u, 1413754139u, 0, ATAN2_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 3221823119u, 1223534454u, 0, ATAN2_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1074322768u, 4161006152u, 0, ATAN2_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1074339837u, 4214439887u, 0, ATAN2_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 3185349731u, 1378952538u, 0, ATAN2_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 3220780967u, 3151936427u, 0, ATAN2_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1073287300u, 3286497747u, 0, ATAN2_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 3220775463u, 678532829u, 0, ATAN2_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1072290306u, 1387932236u, 0, ATAN2_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 3220775419u, 1413727211u, 0, ATAN2_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1070733396u, 2152071558u, 0, ATAN2_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1074290700u, 4010416330u, 0, ATAN2_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 3220775336u, 1353975065u, 0, ATAN2_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1073290326u, 3091630475u, 0, ATAN2_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 3221823995u, 1413749504u, 0, ATAN2_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 3221823772u, 2602079138u, 0, ATAN2_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1073291771u, 2003260141u, 0, ATAN2_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 3221823995u, 1051816922u, 0, ATAN2_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1064782100u, 2170004731u, 0, ATAN2_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1073991133u, 3276387394u, 0, ATAN2_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 3220783256u, 3628350787u, 0, ATAN2_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 3220775419u, 1413754077u, 0, ATAN2_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 3220775291u, 1955003682u, 0, ATAN2_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1073291771u, 1413749224u, 0, ATAN2_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 3185585387u, 586885303u, 0, ATAN2_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 3220430633u, 299595201u, 0, ATAN2_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 3221823995u, 1413754125u, 0, ATAN2_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 3221823946u, 2698546149u, 0, ATAN2_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1074340344u, 4091089530u, 0, ATAN2_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 3197820279u, 3513523264u, 0, ATAN2_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 3221823901u, 665368638u, 0, ATAN2_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1073291769u, 3354646889u, 0, ATAN2_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 3220775418u, 703396355u, 0, ATAN2_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 1074340347u, 1413754135u, 0, ATAN2_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1074340347u, 1052137291u, 0, ATAN2_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 3220775419u, 1413754149u, 0, ATAN2_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 3220775419u, 1413670044u, 0, ATAN2_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1073307236u, 3521042184u, 0, ATAN2_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1073291773u, 4074425891u, 0, ATAN2_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 3196402333u, 892154681u, 0, ATAN2_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1058160566u, 3592673961u, 0, ATAN2_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 3221823979u, 976904869u, 0, ATAN2_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 3198331639u, 58854265u, 0, ATAN2_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1073291771u, 1413754107u, 0, ATAN2_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 3207594510u, 1614453351u, 0, ATAN2_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1073332786u, 2544037221u, 0, ATAN2_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1073291771u, 1503809650u, 0, ATAN2_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 1061882003u, 4129058843u, 0, ATAN2_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 1059638635u, 2919242557u, 0, ATAN2_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 3221823161u, 2290088398u, 0, ATAN2_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 3221823995u, 1413701232u, 0, ATAN2_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1074339717u, 3204214582u, 0, ATAN2_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 3220775419u, 1413754821u, 0, ATAN2_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 3221823995u, 1413754071u, 0, ATAN2_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 3199382139u, 1688527123u, 0, ATAN2_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 3220809825u, 1922530241u, 0, ATAN2_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 3220775419u, 1406013846u, 0, ATAN2_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 3220775419u, 1413754484u, 0, ATAN2_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 3221823995u, 1413751986u, 0, ATAN2_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 3220775419u, 1264760787u, 0, ATAN2_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 1048801884u, 2557353137u, 0, ATAN2_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1073293255u, 4018883609u, 0, ATAN2_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1073291771u, 1744171590u, 0, ATAN2_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 3220775419u, 1213858796u, 0, ATAN2_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 3220754033u, 3507098293u, 0, ATAN2_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 3221823995u, 559612876u, 0, ATAN2_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1073291769u, 1172661418u, 0, ATAN2_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 3220775419u, 1413754028u, 0, ATAN2_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 3220775419u, 1413754308u, 0, ATAN2_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 3220775416u, 265482486u, 0, ATAN2_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1070423314u, 2140711951u, 0, ATAN2_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 3221823995u, 1413735819u, 0, ATAN2_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 3192283287u, 3180534849u, 0, ATAN2_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 3220792598u, 1407700740u, 0, ATAN2_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 3221823994u, 2070913575u, 0, ATAN2_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1073291771u, 1793592252u, 0, ATAN2_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 3221823995u, 1413749611u, 0, ATAN2_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1073291771u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 1033955871u, 433439011u, 0, ATAN2_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1073291771u, 1414986120u, 0, ATAN2_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 3221822841u, 368629664u, 0, ATAN2_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1074340347u, 1401469941u, 0, ATAN2_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1074337761u, 2544098624u, 0, ATAN2_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 3210979126u, 546260523u, 0, ATAN2_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1073291617u, 1822008293u, 0, ATAN2_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 3220715608u, 2372960006u, 0, ATAN2_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1073291771u, 1530025068u, 0, ATAN2_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 3221823993u, 1545003765u, 0, ATAN2_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1073312202u, 752599186u, 0, ATAN2_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 3215037690u, 1099146425u, 0, ATAN2_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 3210424496u, 1927458872u, 0, ATAN2_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1073291771u, 1433180377u, 0, ATAN2_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 3204269045u, 482593707u, 0, ATAN2_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 3220775420u, 3069422109u, 0, ATAN2_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 3206624492u, 1915116447u, 0, ATAN2_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 3220772679u, 2931651306u, 0, ATAN2_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 3221823986u, 2010884417u, 0, ATAN2_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 1029332208u, 1488430477u, 0, ATAN2_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1074340265u, 3051910954u, 0, ATAN2_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1073291771u, 1412275434u, 0, ATAN2_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1070122997u, 3364139310u, 0, ATAN2_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 3220804374u, 2593366982u, 0, ATAN2_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 3220775419u, 1413753688u, 0, ATAN2_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 3215069881u, 3889068227u, 0, ATAN2_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 1041113051u, 1338284599u, 0, ATAN2_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 3220775419u, 1416106592u, 0, ATAN2_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1073968750u, 275989965u, 0, ATAN2_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 3220775419u, 1414229923u, 0, ATAN2_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1073291771u, 1413774920u, 0, ATAN2_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 1025616722u, 2513164301u, 0, ATAN2_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1065042572u, 1694162441u, 0, ATAN2_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 1034706901u, 248813312u, 0, ATAN2_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 3221722120u, 2311307993u, 0, ATAN2_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1073291771u, 1413753034u, 0, ATAN2_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 1032850256u, 1811766756u, 0, ATAN2_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 1049151887u, 2167853176u, 0, ATAN2_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 3220745564u, 2691718244u, 0, ATAN2_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 1048123417u, 2145888320u, 0, ATAN2_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 3220775419u, 1413754217u, 0, ATAN2_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 3186691732u, 124527913u, 0, ATAN2_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 3204625670u, 352490214u, 0, ATAN2_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 3216545426u, 3469149501u, 0, ATAN2_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 3220784376u, 1632762114u, 0, ATAN2_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1073290579u, 134776887u, 0, ATAN2_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1071609951u, 4174474007u, 0, ATAN2_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1068043651u, 1103081642u, 0, ATAN2_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1073291770u, 1703111061u, 0, ATAN2_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1073291771u, 1413714853u, 0, ATAN2_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 3184769750u, 931842167u, 0, ATAN2_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1064363798u, 3338784388u, 0, ATAN2_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1074232654u, 3847296290u, 0, ATAN2_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 3220775419u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 3221821072u, 921668424u, 0, ATAN2_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1073917536u, 1948610443u, 0, ATAN2_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1070164574u, 3625167357u, 0, ATAN2_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1067011170u, 354654443u, 0, ATAN2_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 3220782177u, 3061517349u, 0, ATAN2_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 1059516989u, 1833533046u, 0, ATAN2_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1073291771u, 1431205630u, 0, ATAN2_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 3219081495u, 709990262u, 0, ATAN2_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 3220775419u, 1413754137u, 0, ATAN2_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1073291771u, 1413670857u, 0, ATAN2_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 3218022939u, 534303821u, 0, ATAN2_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 3196614187u, 2494083211u, 0, ATAN2_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1073291771u, 1413754222u, 0, ATAN2_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 3221823995u, 1413753742u, 0, ATAN2_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 3210335220u, 3011373223u, 0, ATAN2_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 3220775419u, 1413754519u, 0, ATAN2_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 3205947910u, 772395157u, 0, ATAN2_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 3211717170u, 2903498297u, 0, ATAN2_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 3220775311u, 4210718762u, 0, ATAN2_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 3170363903u, 1152911974u, 0, ATAN2_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1073304727u, 1466275977u, 0, ATAN2_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 3220775419u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 1040975136u, 1061872090u, 0, ATAN2_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1073291771u, 1346022414u, 0, ATAN2_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1068835310u, 2233667149u, 0, ATAN2_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1074336328u, 2154761046u, 0, ATAN2_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1073289575u, 665876277u, 0, ATAN2_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 3221823995u, 1413653654u, 0, ATAN2_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 3219265397u, 3120866378u, 0, ATAN2_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 3221823995u, 1256907098u, 0, ATAN2_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1073291771u, 1413754124u, 0, ATAN2_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1059244818u, 1996287231u, 0, ATAN2_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1068518947u, 593268660u, 0, ATAN2_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 3221786035u, 3455361964u, 0, ATAN2_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 3220775419u, 1413754154u, 0, ATAN2_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1073287202u, 2642395946u, 0, ATAN2_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 3220708701u, 2221508932u, 0, ATAN2_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 3213282538u, 2235616094u, 0, ATAN2_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 1045726264u, 1944163328u, 0, ATAN2_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 3221722205u, 213023999u, 0, ATAN2_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1062416921u, 1262863215u, 0, ATAN2_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 3220775419u, 1413783386u, 0, ATAN2_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1073291771u, 2454988713u, 0, ATAN2_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 1074340347u, 1345027317u, 0, ATAN2_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1073289644u, 755714436u, 0, ATAN2_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1073313270u, 355092716u, 0, ATAN2_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1062344050u, 495680488u, 0, ATAN2_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1074310351u, 2466004034u, 0, ATAN2_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 3220775419u, 1413719208u, 0, ATAN2_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1070996179u, 4085289987u, 0, ATAN2_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 3184639773u, 3394102605u, 0, ATAN2_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 1025641396u, 1368967953u, 0, ATAN2_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 3220775419u, 1413650357u, 0, ATAN2_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 3220775419u, 1413754217u, 0, ATAN2_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1074340347u, 208897435u, 0, ATAN2_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1073291771u, 1413754182u, 0, ATAN2_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 3220779777u, 3566318511u, 0, ATAN2_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 3210670740u, 2012261983u, 0, ATAN2_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 3220775418u, 2767564002u, 0, ATAN2_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 3220775419u, 1379506546u, 0, ATAN2_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 3220775419u, 1413754034u, 0, ATAN2_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 3215337589u, 2988894665u, 0, ATAN2_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1073782276u, 2156372686u, 0, ATAN2_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 1074340347u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 3220775420u, 1993273617u, 0, ATAN2_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1073291771u, 1413754149u, 0, ATAN2_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 3220775411u, 31997672u, 0, ATAN2_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 3220782480u, 4270673353u, 0, ATAN2_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 1074340347u, 1407725920u, 0, ATAN2_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 3220768061u, 1643198396u, 0, ATAN2_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1073301826u, 595681186u, 0, ATAN2_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 3221817306u, 182536129u, 0, ATAN2_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 1074340347u, 1413754128u, 0, ATAN2_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1073290986u, 3643162396u, 0, ATAN2_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 3220775422u, 3388704618u, 0, ATAN2_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1073291771u, 1413753820u, 0, ATAN2_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 3221823995u, 976478716u, 0, ATAN2_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 3220775419u, 1413754141u, 0, ATAN2_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 3220775417u, 4289426805u, 0, ATAN2_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 3220775388u, 1737272404u, 0, ATAN2_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 3220775178u, 2551348560u, 0, ATAN2_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 3205159915u, 2748849209u, 0, ATAN2_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 3220775419u, 1413755541u, 0, ATAN2_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 3221823995u, 428635924u, 0, ATAN2_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1074043530u, 2892706507u, 0, ATAN2_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 3221823993u, 2663678875u, 0, ATAN2_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1073290960u, 1729538575u, 0, ATAN2_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 3174736143u, 1169587240u, 0, ATAN2_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1074340344u, 1565319825u, 0, ATAN2_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1069629764u, 2839338122u, 0, ATAN2_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 3220775420u, 3189340425u, 0, ATAN2_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1073419589u, 4281458404u, 0, ATAN2_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1072975720u, 993068035u, 0, ATAN2_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 1045716932u, 2509120352u, 0, ATAN2_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1041677676u, 1377895141u, 0, ATAN2_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 3221256426u, 3241735598u, 0, ATAN2_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1073345459u, 4019048881u, 0, ATAN2_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 1074340347u, 1413742719u, 0, ATAN2_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 3220955949u, 3460464085u, 0, ATAN2_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1074338425u, 2087543934u, 0, ATAN2_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 1074340347u, 1413509500u, 0, ATAN2_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 1074340347u, 1413754136u, 0, ATAN2_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 3221823995u, 1413753234u, 0, ATAN2_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1073291422u, 3702106658u, 0, ATAN2_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1073291771u, 1413752463u, 0, ATAN2_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 3220775421u, 814296740u, 0, ATAN2_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1073290895u, 1562105886u, 0, ATAN2_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 1074340347u, 1413753975u, 0, ATAN2_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 3185979307u, 1334096542u, 0, ATAN2_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 3212934262u, 2831896370u, 0, ATAN2_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1066805658u, 3576017509u, 0, ATAN2_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 3161101858u, 1045382940u, 0, ATAN2_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1072884258u, 299169485u, 0, ATAN2_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1067656316u, 3239195794u, 0, ATAN2_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1074340334u, 2638957542u, 0, ATAN2_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1073291771u, 1413753878u, 0, ATAN2_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1073446099u, 4118972885u, 0, ATAN2_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 3220775377u, 924297922u, 0, ATAN2_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1073291771u, 1333500091u, 0, ATAN2_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 1032105870u, 2189756965u, 0, ATAN2_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1074340335u, 3795290484u, 0, ATAN2_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1073291771u, 1517013776u, 0, ATAN2_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 3220772215u, 3534603495u, 0, ATAN2_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1073414842u, 717988197u, 0, ATAN2_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1060326955u, 3757392299u, 0, ATAN2_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 3215624523u, 3633980967u, 0, ATAN2_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 1040583710u, 116780352u, 0, ATAN2_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1074340347u, 1224061139u, 0, ATAN2_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 3220775419u, 1444564580u, 0, ATAN2_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1073291771u, 1952326317u, 0, ATAN2_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 1074340347u, 1413753988u, 0, ATAN2_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 3190073218u, 825152016u, 0, ATAN2_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1073291771u, 1413753652u, 0, ATAN2_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1074340345u, 2611506058u, 0, ATAN2_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 3220775419u, 1413966943u, 0, ATAN2_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 3220749837u, 1360925482u, 0, ATAN2_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 3220775419u, 1413754977u, 0, ATAN2_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1073291640u, 2499100608u, 0, ATAN2_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1066470556u, 466056744u, 0, ATAN2_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1067078210u, 3565683614u, 0, ATAN2_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 3203690931u, 1174625892u, 0, ATAN2_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 3221823780u, 2314535601u, 0, ATAN2_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 3220775418u, 3925564355u, 0, ATAN2_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1073291771u, 1759371343u, 0, ATAN2_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 3220775413u, 1869564977u, 0, ATAN2_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 3221823995u, 1303273732u, 0, ATAN2_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1073291771u, 1413754179u, 0, ATAN2_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 1030563958u, 2155523489u, 0, ATAN2_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 3221823993u, 944878367u, 0, ATAN2_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1073291771u, 1413754138u, 0, ATAN2_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 1074340347u, 882688839u, 0, ATAN2_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 1051863094u, 2047525699u, 0, ATAN2_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1073291785u, 847648949u, 0, ATAN2_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 3220775419u, 638443521u, 0, ATAN2_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1074271176u, 988519976u, 0, ATAN2_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 3220775419u, 1474327357u, 0, ATAN2_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1073407236u, 930383142u, 0, ATAN2_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 1074340331u, 1830442673u, 0, ATAN2_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1073291771u, 1413782756u, 0, ATAN2_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 1074340347u, 1413138407u, 0, ATAN2_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 3193147149u, 825567430u, 0, ATAN2_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1073397034u, 442547018u, 0, ATAN2_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 3220775301u, 3644296250u, 0, ATAN2_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 1074340347u, 1412935968u, 0, ATAN2_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1073291771u, 1126213076u, 0, ATAN2_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 3220775419u, 1413754157u, 0, ATAN2_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1073291771u, 1413754184u, 0, ATAN2_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 3220775447u, 3103713544u, 0, ATAN2_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1073222655u, 1301141788u, 0, ATAN2_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 3221823820u, 2268572874u, 0, ATAN2_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 3220775420u, 1653278234u, 0, ATAN2_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1074340347u, 1409654532u, 0, ATAN2_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 3216067959u, 360964177u, 0, ATAN2_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1051818097u, 3124787863u, 0, ATAN2_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1074340320u, 445352385u, 0, ATAN2_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 3221560746u, 4289727603u, 0, ATAN2_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1074335045u, 3897696078u, 0, ATAN2_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 3220772082u, 3302400771u, 0, ATAN2_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1073292124u, 2933408544u, 0, ATAN2_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 3221823551u, 3069459565u, 0, ATAN2_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1052360250u, 175060874u, 0, ATAN2_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 3220775419u, 1413752475u, 0, ATAN2_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 3220775647u, 560712828u, 0, ATAN2_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1073291771u, 1413754147u, 0, ATAN2_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 3220711413u, 180436215u, 0, ATAN2_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 3220775757u, 324606460u, 0, ATAN2_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 3220775558u, 1564964409u, 0, ATAN2_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 3220775604u, 837415965u, 0, ATAN2_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 3220775419u, 1413011838u, 0, ATAN2_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1073292043u, 3341519446u, 0, ATAN2_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 3220775419u, 1413295040u, 0, ATAN2_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1074340116u, 3087849834u, 0, ATAN2_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 1039286335u, 808027052u, 0, ATAN2_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 1032305490u, 1058083632u, 0, ATAN2_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1073291771u, 1413754453u, 0, ATAN2_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1073291817u, 1431758766u, 0, ATAN2_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 3192681709u, 3727162695u, 0, ATAN2_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 3221391407u, 3507577205u, 0, ATAN2_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 3220784131u, 2542415732u, 0, ATAN2_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1073378861u, 3957378310u, 0, ATAN2_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 1074340347u, 1413753886u, 0, ATAN2_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 3221787339u, 285205990u, 0, ATAN2_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 3220775419u, 1477691882u, 0, ATAN2_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 3221823995u, 1363133298u, 0, ATAN2_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1073291767u, 148052633u, 0, ATAN2_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1060156118u, 1063067065u, 0, ATAN2_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1074283401u, 2306469720u, 0, ATAN2_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_ATAN2_H multiple inclusion protection + +// EOF atan2.h diff --git a/packages/language/c/libm/current/tests/vectors/ceil.c b/packages/language/c/libm/current/tests/vectors/ceil.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/ceil.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// ceil.c +// +// Test of ceil() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/ceil.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(ceil_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &ceil, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &ceil_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("ceil() is stable"); + } // if + else + { + CYG_TEST_FAIL("ceil() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library ceil() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "ceil() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF ceil.c diff --git a/packages/language/c/libm/current/tests/vectors/ceil.h b/packages/language/c/libm/current/tests/vectors/ceil.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/ceil.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_CEIL_H +#define CYGONCE_LIBM_CEIL_H +//=========================================================================== +// +// ceil.h +// +// Test vectors for testing of ceil() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/ceil.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define CEIL_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t ceil_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1078001664u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 3239659800u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1092554364u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 3220176896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1089363200u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1103599987u, 3984588800u, 0, CEIL_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1085298176u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1093826502u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1102287487u, 268435456u, 0, CEIL_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 3254112288u, 1564475392u, 0, CEIL_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1085427200u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 3252528934u, 2319450112u, 0, CEIL_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 3222274048u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1107213408u, 428867584u, 0, CEIL_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1098568019u, 3758096384u, 0, CEIL_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 3233537792u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 3224961024u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 3240055220u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1102831658u, 3422552064u, 0, CEIL_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1089216896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1087554112u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1096085375u, 3221225472u, 0, CEIL_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 3229470720u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1082429440u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1082019840u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 3223584768u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1100636863u, 469762048u, 0, CEIL_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1106165945u, 3774873600u, 0, CEIL_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1088005120u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 3234741504u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1103185231u, 4244635648u, 0, CEIL_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 3249153995u, 1811939328u, 0, CEIL_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 3244270463u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1077936128u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1082097664u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1094345281u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1097158000u, 536870912u, 0, CEIL_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1086400512u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1075052544u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 3243990857u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1081577472u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 3223453696u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 3236149248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 3245817826u, 4026531840u, 0, CEIL_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1083133952u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1083643904u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1078231040u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1102910577u, 4076863488u, 0, CEIL_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1074266112u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1082296320u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 3246851392u, 1073741824u, 0, CEIL_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 3239643132u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1081868288u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1082398720u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 3236968032u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 3252816791u, 3036676096u, 0, CEIL_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 3237209568u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 3236758496u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1078099968u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 3241230836u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1075576832u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 3220176896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 3251845859u, 104857600u, 0, CEIL_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 3233486592u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1103902874u, 3464495104u, 0, CEIL_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1081352192u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1075314688u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1096418100u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1081434112u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1076363264u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1101357261u, 2818572288u, 0, CEIL_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 3222274048u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 3248464040u, 3355443200u, 0, CEIL_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1105232623u, 3617587200u, 0, CEIL_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1076101120u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 3233106944u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 3230500864u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1083523072u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1080688640u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1094982162u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1078984704u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 3237458784u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 3246632231u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 3223715840u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1078362112u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 3238819360u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1102543434u, 369098752u, 0, CEIL_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 3226615808u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 3240391116u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1098048435u, 4026531840u, 0, CEIL_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1081204736u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1084756480u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 3230570496u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1098385019u, 2952790016u, 0, CEIL_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 3234221312u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1088164160u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1104965247u, 146800640u, 0, CEIL_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 3251793336u, 2256535552u, 0, CEIL_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 3246834775u, 1476395008u, 0, CEIL_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 3221225472u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1073741824u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 3234695936u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 3238299664u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1098698804u, 3221225472u, 0, CEIL_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 3246676260u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1096723627u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 3230414848u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 3246678378u, 2415919104u, 0, CEIL_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1075970048u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1092971884u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1098564822u, 3489660928u, 0, CEIL_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 3238510816u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1081757696u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 3248668920u, 1241513984u, 0, CEIL_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 3249974392u, 1912602624u, 0, CEIL_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 3248205162u, 939524096u, 0, CEIL_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1080926208u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 3225812992u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 3251186706u, 2038431744u, 0, CEIL_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 3231451136u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 3243093065u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 3250939070u, 3539992576u, 0, CEIL_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1073741824u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1089501104u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 3235294656u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1074790400u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 3222798336u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 3221749760u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1099977124u, 2617245696u, 0, CEIL_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 3236211936u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1098365967u, 1342177280u, 0, CEIL_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 3250424296u, 1711276032u, 0, CEIL_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1077870592u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1084224512u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 3235476544u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1099460228u, 2550136832u, 0, CEIL_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1093670501u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1083140096u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1078198272u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 3220176896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 3238715968u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1090461872u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1093840414u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 3231863296u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1101012904u, 2483027968u, 0, CEIL_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1081016320u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 3249807211u, 3724541952u, 0, CEIL_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1080221696u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 3246984334u, 2013265920u, 0, CEIL_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1089388800u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1076101120u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 3242767010u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1099130747u, 3892314112u, 0, CEIL_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 3251419593u, 92274688u, 0, CEIL_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 3238593552u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 3221225472u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1079541760u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1098117193u, 1610612736u, 0, CEIL_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1085173760u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 3224502272u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 3220176896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1091113784u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 3228065792u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 3242467576u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1075838976u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1101563433u, 2113929216u, 0, CEIL_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1095956900u, 1073741824u, 0, CEIL_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 3254226900u, 3249537024u, 0, CEIL_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 3226337280u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1101458560u, 3154116608u, 0, CEIL_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 3244118788u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1080254464u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1088201856u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1085029888u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1101098629u, 838860800u, 0, CEIL_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 3252290835u, 1870659584u, 0, CEIL_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1103854676u, 939524096u, 0, CEIL_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 3243548934u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 3254712629u, 4001366016u, 0, CEIL_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1087224704u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1103847606u, 1677721600u, 0, CEIL_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 3243690997u, 3221225472u, 0, CEIL_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 3239270012u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1078329344u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1081917440u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1092089628u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 3241371250u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1084120064u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 3253556483u, 1354760192u, 0, CEIL_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 3246605302u, 2550136832u, 0, CEIL_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 3221749760u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1091040304u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1103487420u, 1954545664u, 0, CEIL_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1106688493u, 1491075072u, 0, CEIL_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1080950784u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1084089344u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 3235759680u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 3252125916u, 3393191936u, 0, CEIL_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 3225223168u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 3246733598u, 134217728u, 0, CEIL_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 3220176896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1103401096u, 2239758336u, 0, CEIL_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1080532992u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1090280944u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1091225344u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1095386964u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 3238832640u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 3241695853u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1104236126u, 507510784u, 0, CEIL_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 3222798336u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 3236306976u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1093103614u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1090429888u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1085209088u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1091433856u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1083231232u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1078525952u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1088255360u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1095743887u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1085536512u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 3231198208u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 3222536192u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 3220176896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 3220176896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1097859997u, 805306368u, 0, CEIL_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 3254567259u, 3945791488u, 0, CEIL_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 3236705472u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 3244864299u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1082157056u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 3237782256u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 3239463228u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 3228815360u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1094257659u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1083744256u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1079558144u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 3221749760u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 3237271776u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1075576832u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1073741824u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1087803456u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1105984188u, 3554672640u, 0, CEIL_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 3237251376u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 3221749760u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 3230669824u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 3242091486u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1081200640u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 3239818608u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1098330542u, 268435456u, 0, CEIL_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1099551055u, 1207959552u, 0, CEIL_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1086008320u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 3230854144u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 3245473391u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 3238238392u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 3227041792u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 3233453056u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1082619904u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 3231254528u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 3239137996u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 3251962512u, 3762290688u, 0, CEIL_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1083431936u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1096820310u, 1073741824u, 0, CEIL_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1091599432u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 3230730240u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1073741824u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 3251357992u, 1543503872u, 0, CEIL_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 3238219512u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1083757568u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1095694737u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 3221225472u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1101737698u, 939524096u, 0, CEIL_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 3236763872u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 3245916442u, 1879048192u, 0, CEIL_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1099201341u, 2281701376u, 0, CEIL_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 3233687552u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1106699146u, 2589982720u, 0, CEIL_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 3243615868u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1095805233u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 3229122560u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1091520176u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 3238915816u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1096053811u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 3234559232u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 3243092475u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1077018624u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1084173312u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1099787952u, 1879048192u, 0, CEIL_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 3253198302u, 710934528u, 0, CEIL_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 3230087168u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1079951360u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1077936128u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1096151307u, 1073741824u, 0, CEIL_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1078099968u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1084544512u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 3231786496u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1097890173u, 4026531840u, 0, CEIL_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 3248332291u, 1476395008u, 0, CEIL_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 3236644128u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1083576320u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1091804012u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 3226484736u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 3229853696u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 3221225472u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1099392394u, 2415919104u, 0, CEIL_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1076887552u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 3222536192u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1101672960u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1099230238u, 671088640u, 0, CEIL_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 3223977984u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1076625408u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 3223322624u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 3233221888u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 3240415850u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 3236776640u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 3243186948u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 3233201152u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1089530528u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1102839166u, 536870912u, 0, CEIL_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1103891140u, 2315255808u, 0, CEIL_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 3252953815u, 1795162112u, 0, CEIL_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 3242725751u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 3237197952u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1097382011u, 1073741824u, 0, CEIL_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 3242028999u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1106859172u, 1610612736u, 0, CEIL_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1078657024u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1088287296u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 3244888667u, 2684354560u, 0, CEIL_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 3220176896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1079640064u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1103926251u, 1719664640u, 0, CEIL_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1085602048u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 3250906006u, 780140544u, 0, CEIL_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 3234511744u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1081344000u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 3245366392u, 2952790016u, 0, CEIL_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1081237504u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 3250533347u, 3170893824u, 0, CEIL_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1081729024u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 3245510120u, 3221225472u, 0, CEIL_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1073741824u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 3248116497u, 1610612736u, 0, CEIL_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 3227648000u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1085804800u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1091905604u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 3233445120u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 3240087112u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1101984574u, 1442840576u, 0, CEIL_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 3225714688u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1093182672u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1075576832u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 3247932863u, 3690987520u, 0, CEIL_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 3251691738u, 3107979264u, 0, CEIL_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1094877811u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1089640096u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 3234429440u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1095276570u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1081532416u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1073741824u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 3233148672u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1075576832u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 3246868002u, 268435456u, 0, CEIL_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 3230486528u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 3233426688u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 3229016064u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 3241229215u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 3242168799u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1104424147u, 3598712832u, 0, CEIL_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1099439656u, 4160749568u, 0, CEIL_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 3220176896u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 3250463757u, 2483027968u, 0, CEIL_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1095392536u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 3243162735u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 3247792416u, 402653184u, 0, CEIL_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1086180096u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 3224633344u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1075052544u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1107251806u, 1863319552u, 0, CEIL_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1074790400u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1077739520u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 3239908660u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1084120064u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1077608448u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 3235473856u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1076363264u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 3226894336u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1076363264u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 3246583139u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 3237773376u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1076887552u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 3253082770u, 1864368128u, 0, CEIL_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 3251640614u, 4047503360u, 0, CEIL_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 3249016304u, 436207616u, 0, CEIL_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1100476615u, 939524096u, 0, CEIL_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1095236966u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 3245542663u, 536870912u, 0, CEIL_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 3229003776u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 3232473600u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1089312608u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1100636791u, 4026531840u, 0, CEIL_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1078689792u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1081614336u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 3254435674u, 1894776832u, 0, CEIL_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1084777984u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 3227516928u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1086668928u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 3247582856u, 4026531840u, 0, CEIL_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1103231387u, 3590324224u, 0, CEIL_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1092835970u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 3240510664u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 3251159663u, 377487360u, 0, CEIL_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 3252075185u, 1228931072u, 0, CEIL_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1090048608u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 3251056964u, 1711276032u, 0, CEIL_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1084704256u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1075314688u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1092833310u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1079918592u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1096788400u, 2147483648u, 0, CEIL_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 3252077393u, 2805989376u, 0, CEIL_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1086877440u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 3221225472u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 3249230091u, 1342177280u, 0, CEIL_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1080238080u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 3235778816u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1087618304u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1088079040u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 3251276671u, 746586112u, 0, CEIL_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1088045120u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 3229831168u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 3237408576u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1077346304u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1099818036u, 671088640u, 0, CEIL_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 3250929921u, 687865856u, 0, CEIL_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 3221749760u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 3246346629u, 2415919104u, 0, CEIL_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1097266673u, 3758096384u, 0, CEIL_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 3243647673u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1091950576u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 3230742528u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1091835156u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1100016363u, 536870912u, 0, CEIL_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1104161422u, 2726297600u, 0, CEIL_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 3247535245u, 671088640u, 0, CEIL_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 3223453696u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 3232716800u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1100045965u, 939524096u, 0, CEIL_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1077411840u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 3227705344u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1086090496u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1102861084u, 469762048u, 0, CEIL_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1074790400u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1085171712u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 3243948477u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1092371280u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1105189691u, 1652555776u, 0, CEIL_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 3239012808u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1084392960u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1090567272u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1096853359u, 536870912u, 0, CEIL_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1095583910u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1083757568u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1093976718u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1076756480u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 3252294615u, 2982150144u, 0, CEIL_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1082988544u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1080115200u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 3226271744u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 3231466496u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1103910407u, 4093640704u, 0, CEIL_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 3222274048u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1106449055u, 754974720u, 0, CEIL_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1073741824u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 3231449088u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 3225026560u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 3252137283u, 3460300800u, 0, CEIL_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 3233537536u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 3225452544u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1083959296u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 3227803648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 3223060480u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1093050018u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1100796069u, 805306368u, 0, CEIL_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1091301992u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 3246437611u, 134217728u, 0, CEIL_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1104006296u, 503316480u, 0, CEIL_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 3250225541u, 2986344448u, 0, CEIL_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1074790400u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1090483536u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1095576833u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 3237728784u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1074266112u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 3242138780u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1098698481u, 1073741824u, 0, CEIL_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 3241770810u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 3248797869u, 100663296u, 0, CEIL_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 3242675715u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1084679680u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1085938944u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 3242503851u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 3224764416u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1092057104u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 3228848128u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 3237608944u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 3230615552u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1089252640u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 3236136064u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1080418304u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1089599104u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 3223060480u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 3253646370u, 3428843520u, 0, CEIL_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 2147483648u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1072693248u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1083996160u, 0u, 0, CEIL_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1093835582u, 0u, 0, CEIL_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_CEIL_H multiple inclusion protection + +// EOF ceil.h diff --git a/packages/language/c/libm/current/tests/vectors/cos.c b/packages/language/c/libm/current/tests/vectors/cos.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/cos.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// cos.c +// +// Test of cos() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/cos.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(cos_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &cos, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &cos_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("cos() is stable"); + } // if + else + { + CYG_TEST_FAIL("cos() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library cos() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "cos() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF cos.c diff --git a/packages/language/c/libm/current/tests/vectors/cos.h b/packages/language/c/libm/current/tests/vectors/cos.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/cos.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_COS_H +#define CYGONCE_LIBM_COS_H +//=========================================================================== +// +// cos.h +// +// Test vectors for testing of cos() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/cos.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define COS_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t cos_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 3219768992u, 2016484542u, 0, COS_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 1072618594u, 3065796144u, 0, COS_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 3220123085u, 3078481391u, 0, COS_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1072356932u, 4042953682u, 0, COS_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 3218685952u, 3960691400u, 0, COS_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1071809942u, 2003021887u, 0, COS_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1072693247u, 4294967264u, 0, COS_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 1072693080u, 978212037u, 0, COS_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1072693247u, 4243804449u, 0, COS_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 1072693247u, 4286151936u, 0, COS_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1072693247u, 3893935114u, 0, COS_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1071013305u, 501046957u, 0, COS_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 3220173381u, 184726421u, 0, COS_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 1072693247u, 4035214061u, 0, COS_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1070032383u, 2277446950u, 0, COS_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 3220176170u, 1767461132u, 0, COS_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1072546806u, 3686417449u, 0, COS_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1072156649u, 125344954u, 0, COS_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 1072693247u, 4294967282u, 0, COS_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 3219660486u, 631679371u, 0, COS_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 1072686675u, 1944236140u, 0, COS_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 1072693247u, 4294966919u, 0, COS_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 3218068798u, 3978347379u, 0, COS_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1072693247u, 3755541054u, 0, COS_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 1072693247u, 2715744996u, 0, COS_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 1072556722u, 3142942532u, 0, COS_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1072693247u, 4294947929u, 0, COS_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 3219826880u, 2920996550u, 0, COS_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 1069929628u, 2708927296u, 0, COS_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1072002281u, 2267619153u, 0, COS_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 3219267113u, 2318350078u, 0, COS_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 3219363466u, 1974819849u, 0, COS_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 1072693247u, 4294967272u, 0, COS_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 1072693247u, 4294840843u, 0, COS_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 1072693247u, 4290030503u, 0, COS_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 1072212739u, 3548552865u, 0, COS_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 1072693247u, 4255683871u, 0, COS_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 1072693247u, 4081475017u, 0, COS_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 1069174826u, 481201061u, 0, COS_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 1072447760u, 3428441333u, 0, COS_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 3220176232u, 3352970825u, 0, COS_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1072276901u, 3815649632u, 0, COS_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 1072693247u, 4294696242u, 0, COS_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1071648109u, 1545486473u, 0, COS_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 3220172495u, 3110868414u, 0, COS_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 1072693216u, 1050271320u, 0, COS_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 1072693247u, 2309107782u, 0, COS_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1072693247u, 4288192616u, 0, COS_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 1072693247u, 4294967288u, 0, COS_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1072693247u, 4294967292u, 0, COS_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 1072667959u, 113041016u, 0, COS_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 1072693247u, 4294965066u, 0, COS_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 3219455129u, 3620968391u, 0, COS_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1072492615u, 1705681540u, 0, COS_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 1072693235u, 2601745815u, 0, COS_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 1072693247u, 4294958646u, 0, COS_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 3219593076u, 1010749237u, 0, COS_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 3219470205u, 1406323978u, 0, COS_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1072606016u, 4140994146u, 0, COS_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 3218242952u, 3735681066u, 0, COS_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 1072679384u, 936725322u, 0, COS_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 1071799931u, 384567806u, 0, COS_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 1072693247u, 4294086482u, 0, COS_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 3219397655u, 2052311207u, 0, COS_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 3218112666u, 1530833864u, 0, COS_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 1069791519u, 4238814723u, 0, COS_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 1072693247u, 4174238446u, 0, COS_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1072524971u, 2288078414u, 0, COS_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1072177416u, 1438672983u, 0, COS_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1072449430u, 350777572u, 0, COS_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 1072693171u, 4105298358u, 0, COS_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 3218695462u, 3908126164u, 0, COS_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1072655927u, 2126353027u, 0, COS_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 3218833636u, 2717799458u, 0, COS_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 1072693247u, 2812236346u, 0, COS_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 1072693247u, 4294927751u, 0, COS_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 1072693247u, 4160909940u, 0, COS_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 1072693247u, 4275548308u, 0, COS_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 1072595762u, 1566396021u, 0, COS_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 3216839369u, 80524119u, 0, COS_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 1072685678u, 821616092u, 0, COS_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1072458457u, 954886600u, 0, COS_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 3220110252u, 3100390877u, 0, COS_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 3219564158u, 3741596795u, 0, COS_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1072693230u, 3195985048u, 0, COS_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 1070492631u, 2055939015u, 0, COS_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 1072693247u, 4105778929u, 0, COS_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 3219419842u, 1550029926u, 0, COS_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 1072693244u, 343002006u, 0, COS_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1070821938u, 789880753u, 0, COS_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 1072693247u, 4294965159u, 0, COS_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 3220173977u, 2550253995u, 0, COS_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1072637279u, 908201379u, 0, COS_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 3220077595u, 2239968209u, 0, COS_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 3217602657u, 1772072422u, 0, COS_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 1071168295u, 2722648006u, 0, COS_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 1072693247u, 4294967293u, 0, COS_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 3218963721u, 2907233862u, 0, COS_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 1072693247u, 4294966870u, 0, COS_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1067566718u, 4225817352u, 0, COS_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1072693246u, 2641702618u, 0, COS_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1071165698u, 123828766u, 0, COS_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 1072693247u, 4294967256u, 0, COS_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 1071882731u, 2672345646u, 0, COS_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 1072693132u, 218165317u, 0, COS_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 1072693247u, 4228241722u, 0, COS_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 1072693247u, 1021260099u, 0, COS_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 3219266232u, 3815073247u, 0, COS_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 3219903600u, 3901518120u, 0, COS_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 1072693194u, 625444171u, 0, COS_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 1072693247u, 4282550564u, 0, COS_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 3219972032u, 2985029200u, 0, COS_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 1072693247u, 4289292207u, 0, COS_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1072693247u, 2060251828u, 0, COS_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 1072693247u, 4294967270u, 0, COS_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1072693199u, 2671749887u, 0, COS_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1071211061u, 1694081574u, 0, COS_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1072071754u, 2362655966u, 0, COS_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 1067970065u, 236323897u, 0, COS_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1072675750u, 738312426u, 0, COS_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 1071704804u, 3513111898u, 0, COS_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1072693221u, 2992922303u, 0, COS_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 1070874665u, 4056918988u, 0, COS_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 1072693247u, 4294547593u, 0, COS_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 1071423350u, 1925583622u, 0, COS_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 1072693247u, 4292374246u, 0, COS_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 1071752494u, 1517813325u, 0, COS_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1072655531u, 1757361807u, 0, COS_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1072317229u, 4079105971u, 0, COS_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1072693247u, 1875738416u, 0, COS_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1072570919u, 238752392u, 0, COS_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 3219637414u, 3481518986u, 0, COS_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 3219678173u, 2534237273u, 0, COS_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1071580496u, 1399605139u, 0, COS_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1066778374u, 860886019u, 0, COS_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1072683116u, 2152105890u, 0, COS_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 3219138641u, 3149630976u, 0, COS_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 1072628731u, 666198183u, 0, COS_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 1072693247u, 4294496550u, 0, COS_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 3219551476u, 3842454686u, 0, COS_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 3220176319u, 3761295717u, 0, COS_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 1070916656u, 1268984698u, 0, COS_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 3220161476u, 3827356380u, 0, COS_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 3218326965u, 3272616966u, 0, COS_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1072648192u, 1641985006u, 0, COS_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 3219670357u, 1996358820u, 0, COS_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1072693247u, 4264496700u, 0, COS_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1072561713u, 3617278346u, 0, COS_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 3219831914u, 2197099287u, 0, COS_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 3219393991u, 4244268719u, 0, COS_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 1068007582u, 3698554498u, 0, COS_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1072689564u, 1480933942u, 0, COS_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 1072693246u, 894071046u, 0, COS_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1072691724u, 2004754951u, 0, COS_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1072516434u, 2675973119u, 0, COS_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 1072688194u, 283976070u, 0, COS_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 1072644591u, 1123227723u, 0, COS_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 1072693247u, 4294967010u, 0, COS_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 3219743093u, 986998908u, 0, COS_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 3216595555u, 1191345507u, 0, COS_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 1072503248u, 1868121844u, 0, COS_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1072693247u, 4294960992u, 0, COS_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1072691618u, 3041709198u, 0, COS_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 3219755792u, 3979452503u, 0, COS_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 3219261752u, 4208808435u, 0, COS_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 1072682540u, 4092757052u, 0, COS_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 1072449179u, 928800032u, 0, COS_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 3219752042u, 46623548u, 0, COS_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 3219651433u, 2521766740u, 0, COS_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 1072693247u, 4294491692u, 0, COS_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 1072693247u, 3791307599u, 0, COS_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 1072693247u, 3667765955u, 0, COS_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 1072676011u, 2167587667u, 0, COS_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 3216679210u, 1818609093u, 0, COS_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1072693247u, 4294966292u, 0, COS_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 3209527911u, 318935467u, 0, COS_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 1070395363u, 3856479702u, 0, COS_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 3219883428u, 4029972147u, 0, COS_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 3220097672u, 3511674499u, 0, COS_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1071623349u, 3706410280u, 0, COS_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 3219904781u, 703541186u, 0, COS_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 1072599785u, 3720054216u, 0, COS_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 3219456887u, 3838760304u, 0, COS_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 1072687744u, 3313356440u, 0, COS_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1069279907u, 1519263517u, 0, COS_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1072569465u, 2825939377u, 0, COS_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 1071649358u, 2402319227u, 0, COS_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 1070273707u, 639884644u, 0, COS_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 3218973899u, 3343006637u, 0, COS_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1072578768u, 4105682742u, 0, COS_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 3219756194u, 114364412u, 0, COS_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 1068041315u, 3314006670u, 0, COS_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1072515870u, 1309324223u, 0, COS_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 1064607335u, 757792299u, 0, COS_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 1072693247u, 4244211024u, 0, COS_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 3219078023u, 281517845u, 0, COS_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 3216471237u, 123092552u, 0, COS_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 3219070825u, 662210141u, 0, COS_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 1072690066u, 501010715u, 0, COS_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 1072234656u, 1267394401u, 0, COS_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 3218286427u, 4165170757u, 0, COS_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 1072693247u, 4294967284u, 0, COS_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 3219652387u, 1204999511u, 0, COS_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1072525515u, 1870070019u, 0, COS_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 1070394969u, 2858431682u, 0, COS_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 1072693247u, 4294966050u, 0, COS_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 3220046486u, 2008922076u, 0, COS_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1071639174u, 3586456012u, 0, COS_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 1072693247u, 4294967109u, 0, COS_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 1072693247u, 4294967249u, 0, COS_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1072693247u, 4294403060u, 0, COS_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1071959314u, 493775910u, 0, COS_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 1072451569u, 551802197u, 0, COS_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1072693247u, 4294967291u, 0, COS_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1072693247u, 4276192130u, 0, COS_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 1072693247u, 4294948617u, 0, COS_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 3219881910u, 233991145u, 0, COS_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 1072692836u, 3009462380u, 0, COS_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 1072492825u, 2465022517u, 0, COS_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 1072693247u, 3425310116u, 0, COS_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 1072693247u, 3980688356u, 0, COS_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 3220120287u, 1310788330u, 0, COS_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 1072693247u, 3618839550u, 0, COS_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1071831726u, 2415570643u, 0, COS_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 1072693247u, 4294967286u, 0, COS_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1072693247u, 3509653915u, 0, COS_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 1072693247u, 4160742701u, 0, COS_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 1071493159u, 3153711522u, 0, COS_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1072345567u, 1983815099u, 0, COS_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 3220132606u, 3517673695u, 0, COS_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 1072693247u, 4294849699u, 0, COS_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1071848560u, 3295006250u, 0, COS_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 3219569628u, 148313502u, 0, COS_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 3220163367u, 3738180901u, 0, COS_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 3220023311u, 1024828250u, 0, COS_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 1072693123u, 3202070629u, 0, COS_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 1072693235u, 1122971280u, 0, COS_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 3219645414u, 292214014u, 0, COS_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1072067451u, 2731650049u, 0, COS_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 1072693247u, 4294843381u, 0, COS_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 1072693247u, 4292296141u, 0, COS_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1065951213u, 4253023021u, 0, COS_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 3218178568u, 1182312665u, 0, COS_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 1072322220u, 1636652464u, 0, COS_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1072659623u, 24608123u, 0, COS_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1072693224u, 2299206777u, 0, COS_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 1072693014u, 1498352825u, 0, COS_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 1072693043u, 1489106434u, 0, COS_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1072199249u, 2159086108u, 0, COS_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 1072692790u, 3312828073u, 0, COS_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 1072693247u, 4258668672u, 0, COS_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 1064984779u, 600856666u, 0, COS_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1072641608u, 727711588u, 0, COS_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 1072693247u, 4294967065u, 0, COS_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 3220055171u, 952539875u, 0, COS_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 1072328816u, 3934941618u, 0, COS_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 1072693247u, 3569234031u, 0, COS_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1072627959u, 1497207890u, 0, COS_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 1072669917u, 2457870217u, 0, COS_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1072226828u, 3655844754u, 0, COS_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 1072515052u, 1642000346u, 0, COS_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 1072693247u, 3841638975u, 0, COS_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1072693247u, 4294729740u, 0, COS_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 3220166089u, 1388690552u, 0, COS_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 3220090835u, 3150301332u, 0, COS_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1071869811u, 2331064655u, 0, COS_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 1070705466u, 1321517167u, 0, COS_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 3219473031u, 3806360310u, 0, COS_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 3219993277u, 2784902361u, 0, COS_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 3219937861u, 1517430120u, 0, COS_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1071831173u, 3436385363u, 0, COS_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 3220121730u, 2605810833u, 0, COS_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1072691976u, 256415598u, 0, COS_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 1072693247u, 4294963661u, 0, COS_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 1072693214u, 2337531688u, 0, COS_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 1072658737u, 3503272081u, 0, COS_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 1070721812u, 2081699423u, 0, COS_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 1072693247u, 4278430058u, 0, COS_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 1072693247u, 4294917506u, 0, COS_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 3216584532u, 2619540521u, 0, COS_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 1072324141u, 1738955103u, 0, COS_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 1072693247u, 4294967004u, 0, COS_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 1071310530u, 1465528159u, 0, COS_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 1072653605u, 3434577925u, 0, COS_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1069254981u, 541526918u, 0, COS_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1067588739u, 1933402886u, 0, COS_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 3219443322u, 2005695949u, 0, COS_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 1071200278u, 2307560753u, 0, COS_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 3219921214u, 2661345031u, 0, COS_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 1072693247u, 4293286130u, 0, COS_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1072692365u, 802497887u, 0, COS_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1072693247u, 4294966750u, 0, COS_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 1072693247u, 4294625329u, 0, COS_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 1072693244u, 190380283u, 0, COS_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 3219734106u, 2044690356u, 0, COS_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 1072693210u, 3789343972u, 0, COS_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 3218152634u, 3189802031u, 0, COS_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 1072693089u, 3877739302u, 0, COS_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 3220004966u, 1582349409u, 0, COS_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 1072693243u, 1316205920u, 0, COS_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 1072693247u, 4134082073u, 0, COS_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 1072693224u, 2873015107u, 0, COS_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1072356356u, 900001206u, 0, COS_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 1072693247u, 4294304288u, 0, COS_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 1072693247u, 4294967046u, 0, COS_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 1072693245u, 4125642902u, 0, COS_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 3219184738u, 2192070315u, 0, COS_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 3220058761u, 1210702081u, 0, COS_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 3219673004u, 1212928558u, 0, COS_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1072050384u, 2201399798u, 0, COS_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 3219556824u, 3682801548u, 0, COS_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 1072693247u, 4274561110u, 0, COS_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1072685949u, 338147145u, 0, COS_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 1072401494u, 1009857194u, 0, COS_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1070938098u, 1550865209u, 0, COS_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 1072693247u, 4294921809u, 0, COS_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 1072660402u, 2682188932u, 0, COS_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 3219915117u, 1778043083u, 0, COS_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 1072693239u, 2251119u, 0, COS_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 1072693247u, 4294967272u, 0, COS_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1072693247u, 4294967285u, 0, COS_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 1072693121u, 971951768u, 0, COS_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 3217187639u, 1965923119u, 0, COS_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 3216317943u, 1107594577u, 0, COS_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1072690830u, 2257146468u, 0, COS_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 1072666970u, 2047828524u, 0, COS_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 1072693247u, 3599364953u, 0, COS_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1072395803u, 157372037u, 0, COS_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1072693247u, 4292975565u, 0, COS_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 3220015189u, 549505287u, 0, COS_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 1072692989u, 1504542300u, 0, COS_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 3217051824u, 2300101304u, 0, COS_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1069138209u, 4033062893u, 0, COS_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 1072693247u, 4293762459u, 0, COS_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1072693237u, 2967630019u, 0, COS_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 1072681279u, 1528669149u, 0, COS_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 1072693247u, 4294967249u, 0, COS_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 1072638418u, 837638418u, 0, COS_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 3219761412u, 4175373806u, 0, COS_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 3219855658u, 1849229220u, 0, COS_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 1072684160u, 113994776u, 0, COS_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 1072693247u, 4294967132u, 0, COS_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1072560488u, 2443022461u, 0, COS_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 1072693247u, 1472001997u, 0, COS_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1072681761u, 3157012499u, 0, COS_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1072112440u, 3662318513u, 0, COS_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1072693247u, 4294827704u, 0, COS_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1072531194u, 3696734274u, 0, COS_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1072529133u, 2265466345u, 0, COS_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 3219578668u, 4220416571u, 0, COS_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 1071934299u, 2387177578u, 0, COS_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 3220176682u, 887984525u, 0, COS_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 1072048934u, 72512142u, 0, COS_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 3218094098u, 3213564391u, 0, COS_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 1072693247u, 4294942905u, 0, COS_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1072693247u, 4156632868u, 0, COS_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 1068775539u, 2733461858u, 0, COS_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 1072677407u, 497768842u, 0, COS_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 3218664046u, 3484392941u, 0, COS_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1072307444u, 2600424197u, 0, COS_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1072579199u, 1091515037u, 0, COS_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 1071978725u, 4132122137u, 0, COS_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 1072693247u, 4294967182u, 0, COS_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 3216912593u, 4112924109u, 0, COS_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 1072693234u, 1065041327u, 0, COS_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 1072693247u, 4294967252u, 0, COS_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1069825174u, 3031550075u, 0, COS_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1072408754u, 1688369384u, 0, COS_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 1072693236u, 1029150851u, 0, COS_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 1071746292u, 820755399u, 0, COS_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1072690206u, 1917386837u, 0, COS_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 1072693188u, 485711984u, 0, COS_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 3220172545u, 2187450492u, 0, COS_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1069360590u, 620968612u, 0, COS_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 1072462215u, 1450093973u, 0, COS_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 1071955752u, 2076739579u, 0, COS_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 3217171938u, 1684460428u, 0, COS_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 1072693017u, 1305312596u, 0, COS_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 1072692982u, 3293309497u, 0, COS_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1071378480u, 3977336311u, 0, COS_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1072445349u, 2286761790u, 0, COS_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 3218367554u, 1055589159u, 0, COS_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 1072692838u, 3102939233u, 0, COS_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1072675519u, 2422104283u, 0, COS_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1072398277u, 765339862u, 0, COS_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 1072693247u, 4294967291u, 0, COS_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1072685261u, 597425399u, 0, COS_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 1072412012u, 4069431777u, 0, COS_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1072307664u, 1056242430u, 0, COS_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 1072693247u, 4282670870u, 0, COS_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 3217859383u, 2232768404u, 0, COS_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 1072693247u, 4294965288u, 0, COS_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 1067452376u, 2155088169u, 0, COS_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 1072295450u, 3246180215u, 0, COS_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 3216173352u, 2322177502u, 0, COS_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 1070131616u, 4106501870u, 0, COS_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 3218748698u, 3336891511u, 0, COS_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 3220032793u, 4201817022u, 0, COS_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1072693247u, 4285638832u, 0, COS_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 1072173572u, 377670647u, 0, COS_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1072693247u, 4292409955u, 0, COS_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 3219830878u, 3759477379u, 0, COS_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 1072693247u, 4292560021u, 0, COS_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 3220059372u, 216871137u, 0, COS_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 1072693247u, 4294920358u, 0, COS_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 1071954489u, 2643649072u, 0, COS_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1072693215u, 1855155537u, 0, COS_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1072693140u, 962185659u, 0, COS_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 1072154343u, 2087114904u, 0, COS_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 1072687985u, 316016598u, 0, COS_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 3220174506u, 2051663811u, 0, COS_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 3220079650u, 816248961u, 0, COS_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 3218690320u, 4171285285u, 0, COS_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 3215268432u, 3325789246u, 0, COS_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 3220170995u, 2986073122u, 0, COS_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 3219226445u, 571732783u, 0, COS_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 1072692654u, 2166617165u, 0, COS_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1072530509u, 890276858u, 0, COS_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 1072693247u, 2933330625u, 0, COS_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1071483620u, 2208326015u, 0, COS_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 1071925114u, 1313080148u, 0, COS_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 1072693247u, 4294953764u, 0, COS_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 1072689711u, 3639960946u, 0, COS_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 1072693247u, 4294967264u, 0, COS_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1071309674u, 1156953860u, 0, COS_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1072261701u, 1351690325u, 0, COS_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 1072693247u, 4294909830u, 0, COS_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 1072693247u, 4294966458u, 0, COS_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1072651370u, 1135449571u, 0, COS_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 1072693247u, 3309410866u, 0, COS_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 1072693247u, 4294967292u, 0, COS_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 3219252387u, 2702488331u, 0, COS_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1072693247u, 4294916007u, 0, COS_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 3219732412u, 2646352387u, 0, COS_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 1072638326u, 1716712908u, 0, COS_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 1071642741u, 1726723037u, 0, COS_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1072693247u, 3979004235u, 0, COS_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 3219860744u, 3972780260u, 0, COS_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 3219313360u, 2704073029u, 0, COS_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 1072693244u, 1106099360u, 0, COS_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 3218252122u, 1300245564u, 0, COS_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 3220173686u, 2481863579u, 0, COS_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1072693244u, 723005056u, 0, COS_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1072558217u, 132128436u, 0, COS_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1072543618u, 4039777533u, 0, COS_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 1070838822u, 1592886544u, 0, COS_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 1071848551u, 792274594u, 0, COS_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1072693215u, 136408135u, 0, COS_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 1072693193u, 3461766790u, 0, COS_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 1072693245u, 2846151980u, 0, COS_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 1072675170u, 1806823293u, 0, COS_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1072693246u, 3042411977u, 0, COS_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 1072232467u, 3551215499u, 0, COS_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 1072603670u, 2257983600u, 0, COS_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 3219920179u, 2183157773u, 0, COS_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1072693247u, 4294962289u, 0, COS_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 1072630208u, 3590549604u, 0, COS_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 3220112180u, 785845582u, 0, COS_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1072693247u, 4294967241u, 0, COS_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 1072693247u, 4293840918u, 0, COS_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 1072693228u, 1061096244u, 0, COS_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 3219189828u, 425313336u, 0, COS_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1071437392u, 805974233u, 0, COS_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 1072693247u, 4266819760u, 0, COS_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 1072693246u, 2353707925u, 0, COS_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1072692812u, 2318741494u, 0, COS_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 3218616375u, 1623062713u, 0, COS_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 3219829897u, 4235988833u, 0, COS_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 3220160144u, 1401589565u, 0, COS_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 3217768161u, 1085338811u, 0, COS_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 1072693247u, 4294709680u, 0, COS_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 3215432163u, 3255331174u, 0, COS_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 3219474945u, 1396988883u, 0, COS_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 1072693247u, 4294958282u, 0, COS_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1071267149u, 2773154495u, 0, COS_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 1072693247u, 4294966547u, 0, COS_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 3219321161u, 1921838008u, 0, COS_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 1072693247u, 4294961999u, 0, COS_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 1072693247u, 4294960786u, 0, COS_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 1072693246u, 1657835881u, 0, COS_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 3219326801u, 414973546u, 0, COS_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 3219266445u, 2657113532u, 0, COS_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 1069183268u, 3668657064u, 0, COS_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 1070851538u, 2502169401u, 0, COS_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 3220146808u, 409508490u, 0, COS_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 1072693245u, 54512334u, 0, COS_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 1072693018u, 2976670979u, 0, COS_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1072693247u, 4294966409u, 0, COS_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 1072661758u, 3614572093u, 0, COS_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 1068811358u, 4162323614u, 0, COS_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1071784199u, 1738588699u, 0, COS_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 3220053401u, 399142837u, 0, COS_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1072388772u, 1533980329u, 0, COS_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 3219992318u, 2304503256u, 0, COS_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 1072693247u, 4294967216u, 0, COS_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 3218842033u, 2741016994u, 0, COS_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 1072496559u, 2937265603u, 0, COS_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 1072693247u, 4294903341u, 0, COS_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1072691679u, 2327723158u, 0, COS_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 1072693243u, 1098827613u, 0, COS_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 1072693247u, 4285794546u, 0, COS_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 1072341600u, 4056543646u, 0, COS_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 1072693247u, 4256731124u, 0, COS_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 1072693247u, 4294769820u, 0, COS_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1067100091u, 683628693u, 0, COS_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 3219826642u, 2587899721u, 0, COS_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 1072693247u, 4292740708u, 0, COS_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 3220175227u, 1005025558u, 0, COS_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1070589958u, 3572501181u, 0, COS_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 3219547017u, 4126560522u, 0, COS_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 3219658243u, 456488637u, 0, COS_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 3220091089u, 4169062849u, 0, COS_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 3219104826u, 3598702610u, 0, COS_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 3220176734u, 1468291227u, 0, COS_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1072604572u, 802866348u, 0, COS_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 1072605127u, 894556621u, 0, COS_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 3218147467u, 3777186949u, 0, COS_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1071828869u, 1565632238u, 0, COS_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 1072693247u, 4289738353u, 0, COS_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 1072693247u, 4294967292u, 0, COS_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 1072692942u, 1400585228u, 0, COS_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 3220039406u, 2852313542u, 0, COS_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 3219760569u, 3069303987u, 0, COS_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1068863315u, 1513793935u, 0, COS_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 1072693247u, 4294967122u, 0, COS_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 3219246387u, 1629246963u, 0, COS_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 3219160558u, 3753866329u, 0, COS_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 3218175224u, 879726405u, 0, COS_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 3218606506u, 371401132u, 0, COS_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 3219400280u, 3279627080u, 0, COS_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 1072693247u, 4294964560u, 0, COS_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1072693223u, 580769603u, 0, COS_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 1072693247u, 3295800571u, 0, COS_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 1068701740u, 1725760599u, 0, COS_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1072693247u, 4294967255u, 0, COS_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 3219330937u, 1275345573u, 0, COS_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 3219359292u, 736683867u, 0, COS_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1072693247u, 4278181812u, 0, COS_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 1072692573u, 3285328600u, 0, COS_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 3220172073u, 668005656u, 0, COS_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 1072058265u, 439230756u, 0, COS_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 3219105835u, 3752162680u, 0, COS_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1070589874u, 1796035360u, 0, COS_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 1072467656u, 2678741737u, 0, COS_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 1072693247u, 4286825667u, 0, COS_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 1071131091u, 915577737u, 0, COS_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 1072693247u, 4294966660u, 0, COS_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 1072693247u, 4294967237u, 0, COS_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1072043454u, 840440154u, 0, COS_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1072693247u, 4294967220u, 0, COS_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 3219640338u, 2663551801u, 0, COS_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 1071459668u, 723041291u, 0, COS_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 3220037664u, 2966147533u, 0, COS_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 1070487493u, 280321777u, 0, COS_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 1072667250u, 1240548968u, 0, COS_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 1072693247u, 4294966489u, 0, COS_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 1072690054u, 2844567634u, 0, COS_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 3219939961u, 2810857343u, 0, COS_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1071368057u, 1426300390u, 0, COS_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 1072693247u, 4201598491u, 0, COS_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 3220149846u, 3786871735u, 0, COS_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1072693088u, 1521437248u, 0, COS_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 3219885770u, 1681306400u, 0, COS_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 1072693247u, 4291430705u, 0, COS_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 3220168457u, 3307824821u, 0, COS_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 1072685357u, 3355578451u, 0, COS_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 1072684594u, 3660350689u, 0, COS_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 1072693174u, 1974686405u, 0, COS_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1072341321u, 1561640432u, 0, COS_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 1072693247u, 4294966896u, 0, COS_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1072533054u, 1184989401u, 0, COS_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 3215226551u, 294612205u, 0, COS_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 1072693244u, 1937927066u, 0, COS_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 3219904172u, 2335619660u, 0, COS_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 3220172959u, 2167800746u, 0, COS_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1072693247u, 4294964969u, 0, COS_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 1072693247u, 4294965369u, 0, COS_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 1072693247u, 4200044040u, 0, COS_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 3219677965u, 2997914837u, 0, COS_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 1072693094u, 3146758615u, 0, COS_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1072663973u, 178834935u, 0, COS_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 3220173429u, 1922306944u, 0, COS_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 1072693247u, 1447487601u, 0, COS_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1072693247u, 4294957268u, 0, COS_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 1071472690u, 1891493224u, 0, COS_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 3220176149u, 3234833894u, 0, COS_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 3219779573u, 3806121574u, 0, COS_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 1072693243u, 2535529384u, 0, COS_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1072675166u, 2110076227u, 0, COS_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 1072693247u, 4234994396u, 0, COS_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 1072693247u, 4294967293u, 0, COS_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 1072693247u, 4294905031u, 0, COS_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1072693247u, 4294954089u, 0, COS_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1072692275u, 1819605250u, 0, COS_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1072693233u, 2740400643u, 0, COS_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 1072693247u, 4294959272u, 0, COS_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 3220110458u, 913134978u, 0, COS_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 1072693247u, 4294967099u, 0, COS_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1072677579u, 1454510592u, 0, COS_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1072692437u, 31148257u, 0, COS_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 1072326482u, 1005490298u, 0, COS_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 3220102579u, 286327760u, 0, COS_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1072674781u, 2240078613u, 0, COS_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1070049772u, 3039431038u, 0, COS_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 1072693247u, 4294965339u, 0, COS_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 1072495724u, 3575339626u, 0, COS_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 3218189572u, 1975036829u, 0, COS_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 1070382034u, 2139906112u, 0, COS_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1072012843u, 595067820u, 0, COS_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 3220038529u, 1729582222u, 0, COS_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1072693247u, 4237867181u, 0, COS_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1071465516u, 1993418532u, 0, COS_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 1072592394u, 1092605516u, 0, COS_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1072693247u, 4289809738u, 0, COS_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 1072693247u, 4135004220u, 0, COS_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 1072693247u, 4294859733u, 0, COS_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1072692103u, 3067599466u, 0, COS_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 1072574045u, 720418835u, 0, COS_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 3220138856u, 1786848118u, 0, COS_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 3219851592u, 2118474530u, 0, COS_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 1072652853u, 178221240u, 0, COS_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 3216132876u, 902911402u, 0, COS_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 1072693230u, 806668878u, 0, COS_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 3219504796u, 3365923665u, 0, COS_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 1072662457u, 1345840563u, 0, COS_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 1072693247u, 4291229279u, 0, COS_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 1072693247u, 4294860627u, 0, COS_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 1072693247u, 4294965191u, 0, COS_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 3219937123u, 2226610460u, 0, COS_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1072658626u, 3705768894u, 0, COS_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 1072683137u, 376959074u, 0, COS_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 1072693247u, 4294967241u, 0, COS_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1072683587u, 2218972124u, 0, COS_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 3217472000u, 1636461035u, 0, COS_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 3220096880u, 924173556u, 0, COS_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1072691717u, 1073276862u, 0, COS_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 3219298444u, 3078353466u, 0, COS_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 1072693247u, 4294307614u, 0, COS_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 3218245979u, 1623606256u, 0, COS_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 1071794324u, 38624345u, 0, COS_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 3219935193u, 2728293583u, 0, COS_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 1072681999u, 479245867u, 0, COS_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1071247416u, 1032109685u, 0, COS_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1069627701u, 3400212089u, 0, COS_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 1072692950u, 3646272527u, 0, COS_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 1072693062u, 211505646u, 0, COS_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 3217216280u, 1160993324u, 0, COS_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 1072693247u, 4294967278u, 0, COS_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1072448092u, 4287528395u, 0, COS_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 1071938433u, 4284753744u, 0, COS_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 1072693247u, 4294804996u, 0, COS_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 3219842465u, 27990251u, 0, COS_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 3220175570u, 3118267747u, 0, COS_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 3217423140u, 1796767464u, 0, COS_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 3218494133u, 503382599u, 0, COS_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 1072693247u, 4294965131u, 0, COS_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 1071811769u, 2322679045u, 0, COS_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 1072693247u, 4240273089u, 0, COS_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 3218990076u, 882873582u, 0, COS_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1072382483u, 2149265695u, 0, COS_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 3214199757u, 3014160204u, 0, COS_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 3219439509u, 846415884u, 0, COS_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 3220176605u, 763316173u, 0, COS_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 3218801484u, 293093886u, 0, COS_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 1070460862u, 3595673825u, 0, COS_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 1072525389u, 3235166120u, 0, COS_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1072048063u, 2287321430u, 0, COS_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 1072693247u, 4294966115u, 0, COS_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 1070915285u, 3906708154u, 0, COS_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 1072693247u, 4292530155u, 0, COS_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 1072693247u, 4294964552u, 0, COS_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 3218521683u, 3115963704u, 0, COS_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 1072693119u, 989562508u, 0, COS_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1072692742u, 3651849297u, 0, COS_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 1072693247u, 4294967022u, 0, COS_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 3220160068u, 1645620146u, 0, COS_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 1072685145u, 1982517232u, 0, COS_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 3220166825u, 1507155374u, 0, COS_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1072692927u, 866333980u, 0, COS_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 3219483088u, 312673935u, 0, COS_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1069712823u, 2081579337u, 0, COS_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 1072693247u, 4294109029u, 0, COS_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1071367684u, 3164827138u, 0, COS_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 1070842357u, 830343203u, 0, COS_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1067598783u, 2114613609u, 0, COS_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 3220121516u, 1226468903u, 0, COS_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 1072689288u, 2072776390u, 0, COS_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1071311403u, 428792898u, 0, COS_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 1070106130u, 186093997u, 0, COS_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 1071653293u, 2890745849u, 0, COS_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 1072693247u, 3066024794u, 0, COS_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1072693247u, 4294966898u, 0, COS_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 3220173366u, 3524098048u, 0, COS_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1072693247u, 4294315811u, 0, COS_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 1072693247u, 4049483350u, 0, COS_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 1072075197u, 4117100839u, 0, COS_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 1072693247u, 4294965702u, 0, COS_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 1072693247u, 774759105u, 0, COS_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 3220163144u, 1526664806u, 0, COS_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1072693211u, 1740123982u, 0, COS_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 1072432298u, 4033522608u, 0, COS_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1071075046u, 3768110943u, 0, COS_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1072693247u, 4294967287u, 0, COS_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 1072693247u, 4281693680u, 0, COS_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 1072693247u, 4294481603u, 0, COS_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1072584987u, 1443922753u, 0, COS_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 1072693244u, 408413646u, 0, COS_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 1072693210u, 1708888818u, 0, COS_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 1072693247u, 4289940835u, 0, COS_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 1072693220u, 1919890503u, 0, COS_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 1072693235u, 2830234323u, 0, COS_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 1072038033u, 1963592798u, 0, COS_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 1072564300u, 3577222580u, 0, COS_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 1072693247u, 4294967097u, 0, COS_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1071874137u, 2730682483u, 0, COS_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 3219484451u, 3424147024u, 0, COS_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1072693247u, 4294720287u, 0, COS_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 3219613876u, 1330361278u, 0, COS_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 3219753066u, 412003789u, 0, COS_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 1072693247u, 4294967292u, 0, COS_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1072693247u, 4274204595u, 0, COS_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1072010372u, 1965542879u, 0, COS_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 3220102417u, 3146936854u, 0, COS_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 1072693247u, 4294967264u, 0, COS_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1072162155u, 3181474338u, 0, COS_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1072686013u, 2230343919u, 0, COS_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1072693247u, 4294967293u, 0, COS_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 3220169459u, 2232263137u, 0, COS_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 1072668996u, 1466987893u, 0, COS_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 3219517257u, 2508901127u, 0, COS_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 1072626729u, 591520264u, 0, COS_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 1071869692u, 3800681525u, 0, COS_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1071848763u, 1111779157u, 0, COS_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 1072693247u, 4294967291u, 0, COS_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 3217478798u, 567039304u, 0, COS_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 1072693247u, 4252907712u, 0, COS_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 3219875171u, 1925983410u, 0, COS_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 3219300930u, 1175187344u, 0, COS_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 1072693247u, 4293759982u, 0, COS_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 1072693247u, 4280954652u, 0, COS_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 1071705879u, 410002001u, 0, COS_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 1072693247u, 4294967286u, 0, COS_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1070691609u, 1556386840u, 0, COS_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 3218182768u, 148649403u, 0, COS_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 1072693247u, 4294933120u, 0, COS_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1072510630u, 1379118583u, 0, COS_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1072693247u, 4294938702u, 0, COS_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1072483587u, 4085640584u, 0, COS_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1071023686u, 839317700u, 0, COS_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 1072693247u, 4294949171u, 0, COS_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 1072693247u, 4294967179u, 0, COS_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 1072693247u, 4294967295u, 0, COS_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 3219911263u, 3314302700u, 0, COS_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1070649459u, 1482103661u, 0, COS_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1072194163u, 3665765707u, 0, COS_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 1072627981u, 3072040624u, 0, COS_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1072072842u, 3802210842u, 0, COS_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 1072693247u, 4294920337u, 0, COS_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 3219778052u, 4039479565u, 0, COS_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 1072692601u, 1903552662u, 0, COS_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 3220162345u, 2971280959u, 0, COS_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1070643331u, 2801218782u, 0, COS_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 1070379299u, 3057199715u, 0, COS_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1070619806u, 133610425u, 0, COS_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 1072693235u, 1358669674u, 0, COS_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 3220155790u, 45714209u, 0, COS_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1072693247u, 4294948535u, 0, COS_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1072693247u, 4294857423u, 0, COS_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1072693234u, 2835341684u, 0, COS_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 1072606330u, 2168006594u, 0, COS_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1071646891u, 3454715319u, 0, COS_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 1072693247u, 4294966293u, 0, COS_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 1072693247u, 4294965706u, 0, COS_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 3220026354u, 1801307080u, 0, COS_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 1072612586u, 1999902688u, 0, COS_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 3220176264u, 1460906583u, 0, COS_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 3219706915u, 2487592168u, 0, COS_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 1071775653u, 3598656665u, 0, COS_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 1072693247u, 4278467868u, 0, COS_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 1072692936u, 1124230183u, 0, COS_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 3219732967u, 2366498859u, 0, COS_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 3218264361u, 925503775u, 0, COS_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 1072693247u, 4292188934u, 0, COS_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1072524548u, 4130452916u, 0, COS_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 3216262723u, 2584514122u, 0, COS_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1072003878u, 3484848839u, 0, COS_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 1072693247u, 4279296379u, 0, COS_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 1072693241u, 4163824395u, 0, COS_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 1072693247u, 4294966605u, 0, COS_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 3220136004u, 1372765072u, 0, COS_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 3220132976u, 3623370703u, 0, COS_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 1072693247u, 4294965176u, 0, COS_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 1072693247u, 4294967283u, 0, COS_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 3220150773u, 1241950753u, 0, COS_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 1072685342u, 869228503u, 0, COS_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1071768241u, 2917167493u, 0, COS_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 1072693247u, 3706125946u, 0, COS_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 3219909935u, 25169281u, 0, COS_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 3220125731u, 561009732u, 0, COS_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 1072252135u, 485800405u, 0, COS_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 1072693179u, 4024516686u, 0, COS_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 1072693247u, 4294722734u, 0, COS_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 3218702987u, 2062749856u, 0, COS_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 1072258643u, 3149220087u, 0, COS_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1072649916u, 4210399008u, 0, COS_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 1072693150u, 2167949766u, 0, COS_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1071897988u, 2892918300u, 0, COS_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 1072693247u, 4294966350u, 0, COS_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 3218889273u, 1541679478u, 0, COS_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1072693247u, 3698714150u, 0, COS_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 1072487400u, 2159060137u, 0, COS_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1072547244u, 3575258804u, 0, COS_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 3219644021u, 4014018646u, 0, COS_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 1072693204u, 3164110352u, 0, COS_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 3220176737u, 383608412u, 0, COS_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 1072693091u, 1198201690u, 0, COS_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 3218446499u, 2064645583u, 0, COS_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 1072693247u, 4294967246u, 0, COS_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 1072483229u, 3024937276u, 0, COS_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 1072693247u, 4255755669u, 0, COS_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1071946968u, 3038643463u, 0, COS_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1072546853u, 2900471296u, 0, COS_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 3219875653u, 324308466u, 0, COS_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 3219129115u, 4204103924u, 0, COS_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 1072693247u, 4294955989u, 0, COS_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 1072693247u, 4293953329u, 0, COS_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 3218286130u, 3681049170u, 0, COS_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 1072693247u, 4294967292u, 0, COS_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 3219573393u, 1754602802u, 0, COS_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1068927336u, 2077295239u, 0, COS_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1071418891u, 3949394807u, 0, COS_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 3218438567u, 3315807290u, 0, COS_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 3217309822u, 2575252529u, 0, COS_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 3218228705u, 3589822852u, 0, COS_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1071928997u, 950952646u, 0, COS_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1072693247u, 4294967283u, 0, COS_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1072574444u, 2611483025u, 0, COS_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 3218846532u, 839584632u, 0, COS_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 1071774126u, 3327286031u, 0, COS_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1072693247u, 4294967261u, 0, COS_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 1072635801u, 2738772612u, 0, COS_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1072289032u, 2913293455u, 0, COS_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 3218414534u, 3610714925u, 0, COS_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1071265111u, 1731432878u, 0, COS_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 3218175044u, 806346250u, 0, COS_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 1069959173u, 573109192u, 0, COS_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 3218112486u, 3088949577u, 0, COS_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 3219751105u, 1269198118u, 0, COS_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1072693187u, 123521492u, 0, COS_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1072693247u, 4260462906u, 0, COS_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1072693247u, 4287870926u, 0, COS_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 3220170916u, 1054245121u, 0, COS_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 3218059928u, 1414708102u, 0, COS_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1071359590u, 2540863482u, 0, COS_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 1072641997u, 192284648u, 0, COS_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 3215759704u, 503757072u, 0, COS_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 3219084733u, 3748162632u, 0, COS_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 1072693247u, 2561215287u, 0, COS_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1071693271u, 4216870113u, 0, COS_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 1072693246u, 3830754275u, 0, COS_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 1072693247u, 4288944491u, 0, COS_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1072691551u, 1749079179u, 0, COS_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 1067877297u, 2819009254u, 0, COS_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 3219698150u, 64865468u, 0, COS_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 3220149279u, 3918709218u, 0, COS_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 3220175164u, 3474645289u, 0, COS_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 1072690173u, 4193166006u, 0, COS_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 3220146837u, 3066547347u, 0, COS_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 1072690661u, 1965881568u, 0, COS_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 1072693247u, 3376814610u, 0, COS_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1072335093u, 1226745687u, 0, COS_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 1070268616u, 1986930081u, 0, COS_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 1072693247u, 4294967145u, 0, COS_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 3219991316u, 2380401456u, 0, COS_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 3220172732u, 172513277u, 0, COS_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1071759494u, 3992980376u, 0, COS_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 3217749279u, 4237776152u, 0, COS_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1072693247u, 4294967284u, 0, COS_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 1072653824u, 1586377961u, 0, COS_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 1067852060u, 2375960071u, 0, COS_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 3219973609u, 4239809652u, 0, COS_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 3219527636u, 416062612u, 0, COS_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1072693247u, 4294967291u, 0, COS_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 1072693247u, 4294966521u, 0, COS_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1072479604u, 998241152u, 0, COS_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 1072693247u, 4294960160u, 0, COS_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1072693218u, 2810393116u, 0, COS_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1072693247u, 4294915363u, 0, COS_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 3219791395u, 2281335438u, 0, COS_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 3220157703u, 999072486u, 0, COS_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 3220124006u, 1346258070u, 0, COS_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 1072692351u, 1558924925u, 0, COS_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 1072693247u, 4260694082u, 0, COS_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 1066642218u, 885348726u, 0, COS_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 1070775919u, 3997910947u, 0, COS_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 3219998391u, 1479904630u, 0, COS_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1072688786u, 2112803723u, 0, COS_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 1071749943u, 2880945849u, 0, COS_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 3215050687u, 3711582370u, 0, COS_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 1072693248u, 0u, 0, COS_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 1072693247u, 4294934401u, 0, COS_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1071819589u, 759885329u, 0, COS_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1072693247u, 4099451717u, 0, COS_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 1072693247u, 4294967294u, 0, COS_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 1072650297u, 34563883u, 0, COS_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 1070528947u, 553485972u, 0, COS_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1072693247u, 4290891233u, 0, COS_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 1072693247u, 4285025881u, 0, COS_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 1072693247u, 4294927517u, 0, COS_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 3216626144u, 1955101016u, 0, COS_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 1072693247u, 4294900229u, 0, COS_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1072693206u, 3877961227u, 0, COS_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1072631052u, 3150737220u, 0, COS_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1070705706u, 1138580641u, 0, COS_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_COS_H multiple inclusion protection + +// EOF cos.h diff --git a/packages/language/c/libm/current/tests/vectors/cosh.c b/packages/language/c/libm/current/tests/vectors/cosh.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/cosh.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// cosh.c +// +// Test of cosh() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/cosh.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(cosh_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &cosh, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &cosh_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("cosh() is stable"); + } // if + else + { + CYG_TEST_FAIL("cosh() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library cosh() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "cosh() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF cosh.c diff --git a/packages/language/c/libm/current/tests/vectors/cosh.h b/packages/language/c/libm/current/tests/vectors/cosh.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/cosh.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_COSH_H +#define CYGONCE_LIBM_COSH_H +//=========================================================================== +// +// cosh.h +// +// Test vectors for testing of cosh() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/cosh.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define COSH_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t cosh_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1074853420u, 2506787616u, 1090024059u, 3619148316u, 1078025426u, 969469392u, 0, COSH_TOLERANCE, 0}, +{ 2, 3220250806u, 3176730980u, 1051524793u, 2993920299u, 1073353662u, 1862384311u, 0, COSH_TOLERANCE, 0}, +{ 3, 3226028315u, 2725707538u, 3232101343u, 2346810316u, 1148131614u, 3406370818u, 0, COSH_TOLERANCE, 0}, +{ 4, 1078922874u, 2088062470u, 3201242716u, 420891118u, 1165520069u, 2120331304u, 0, COSH_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 1074621306u, 1840668058u, 0, COSH_TOLERANCE, 0}, +{ 6, 1077828855u, 1746012320u, 1054478713u, 3333988501u, 1117516582u, 699114409u, 0, COSH_TOLERANCE, 0}, +{ 7, 1066827528u, 183014794u, 3202039382u, 2016785810u, 1072693501u, 214984896u, 0, COSH_TOLERANCE, 0}, +{ 8, 3219777490u, 2688957927u, 1046089230u, 2709029994u, 1073056030u, 1838945346u, 0, COSH_TOLERANCE, 0}, +{ 9, 1070330066u, 624574473u, 1045840574u, 3473266330u, 1072718329u, 916151728u, 0, COSH_TOLERANCE, 0}, +{ 10, 3217502754u, 1605286142u, 1068931671u, 4233776869u, 1072710512u, 2874087843u, 0, COSH_TOLERANCE, 0}, +{ 11, 1069780594u, 1857607719u, 3222889559u, 3417070006u, 1072705510u, 1532142699u, 0, COSH_TOLERANCE, 0}, +{ 12, 1081579891u, 3981151660u, 1088899021u, 1332651746u, 1642782946u, 1345086100u, 0, COSH_TOLERANCE, 0}, +{ 13, 1075860838u, 3824988054u, 1066856791u, 2070129652u, 1083933725u, 2536695545u, 0, COSH_TOLERANCE, 0}, +{ 14, 3218045550u, 1372884064u, 1080833116u, 3229926662u, 1072725116u, 1230358004u, 0, COSH_TOLERANCE, 0}, +{ 15, 1078097861u, 3217805330u, 3191644264u, 2014578707u, 1127449977u, 1807458751u, 0, COSH_TOLERANCE, 0}, +{ 16, 1080267391u, 265058758u, 3239903247u, 1630600647u, 1308474718u, 1523986687u, 0, COSH_TOLERANCE, 0}, +{ 17, 1073221381u, 1946677669u, 3198462609u, 926009897u, 1073930690u, 1965098529u, 0, COSH_TOLERANCE, 0}, +{ 18, 1073178875u, 2271884183u, 3203741999u, 2118617783u, 1073886257u, 3027131755u, 0, COSH_TOLERANCE, 0}, +{ 19, 3214772053u, 213658772u, 3249401130u, 314151656u, 1072693684u, 2346214u, 0, COSH_TOLERANCE, 0}, +{ 20, 3228946464u, 1564829925u, 3197817016u, 497230814u, 1599525087u, 3665494831u, 0, COSH_TOLERANCE, 0}, +{ 21, 3219408362u, 2075329122u, 3231746400u, 169900577u, 1072910812u, 2781323759u, 0, COSH_TOLERANCE, 0}, +{ 22, 1067674434u, 541549344u, 1096608669u, 3119070100u, 1072694002u, 1218945670u, 0, COSH_TOLERANCE, 0}, +{ 23, 1075989871u, 567496114u, 1045286891u, 1969998540u, 1085434125u, 3238675061u, 0, COSH_TOLERANCE, 0}, +{ 24, 1069985379u, 1299369769u, 1049342524u, 4167404066u, 1072709753u, 436121612u, 0, COSH_TOLERANCE, 0}, +{ 25, 3218302829u, 3348930841u, 1078472138u, 358457347u, 1072741812u, 1512364096u, 0, COSH_TOLERANCE, 0}, +{ 26, 1073166449u, 2192461366u, 1099527247u, 3184735642u, 1073873641u, 4040593230u, 0, COSH_TOLERANCE, 0}, +{ 27, 1068590412u, 331696577u, 3189610016u, 793242270u, 1072695669u, 3489656380u, 0, COSH_TOLERANCE, 0}, +{ 28, 3229460262u, 2322696981u, 1083791358u, 3020766674u, 1789286809u, 4287903039u, 0, COSH_TOLERANCE, 0}, +{ 29, 1066922273u, 252085215u, 3214426435u, 4139068910u, 1072693534u, 2665457975u, 0, COSH_TOLERANCE, 0}, +{ 30, 3221457149u, 105589263u, 1056316170u, 261630827u, 1075259864u, 1375611334u, 0, COSH_TOLERANCE, 0}, +{ 31, 1082047584u, 428765703u, 3251828686u, 2009972239u, 1815498097u, 3462966019u, 0, COSH_TOLERANCE, 0}, +{ 32, 1079693651u, 3517376586u, 3240257920u, 3304487302u, 1233851281u, 1250614638u, 0, COSH_TOLERANCE, 0}, +{ 33, 3224100728u, 237004814u, 3237899261u, 3364008659u, 1092696187u, 168267900u, 0, COSH_TOLERANCE, 0}, +{ 34, 3214121920u, 472004928u, 3226869477u, 1186387580u, 1072693440u, 1076112274u, 0, COSH_TOLERANCE, 0}, +{ 35, 1068906914u, 4085763910u, 1106394906u, 2684738273u, 1072697202u, 594398828u, 0, COSH_TOLERANCE, 0}, +{ 36, 1069636551u, 2055490142u, 3231581370u, 3879040079u, 1072702904u, 4128087196u, 0, COSH_TOLERANCE, 0}, +{ 37, 3213093895u, 3725731239u, 1061652681u, 591292963u, 1072693297u, 2624770646u, 0, COSH_TOLERANCE, 0}, +{ 38, 3221869253u, 1147041027u, 3215417793u, 624695933u, 1076446275u, 1285958834u, 0, COSH_TOLERANCE, 0}, +{ 39, 3217587110u, 705725219u, 3238067573u, 1116238321u, 1072712487u, 3913803238u, 0, COSH_TOLERANCE, 0}, +{ 40, 3217852848u, 7287411u, 1045917232u, 116067742u, 1072719417u, 863220422u, 0, COSH_TOLERANCE, 0}, +{ 41, 3226423734u, 3604989074u, 1066381836u, 545298780u, 1166321280u, 3198996771u, 0, COSH_TOLERANCE, 0}, +{ 42, 3221178088u, 1681476121u, 1060345752u, 3553822398u, 1074581780u, 785211380u, 0, COSH_TOLERANCE, 0}, +{ 43, 1080811562u, 3410480388u, 1052460275u, 1660607230u, 1408926430u, 2715754844u, 0, COSH_TOLERANCE, 0}, +{ 44, 1077682533u, 1494984673u, 3196647153u, 287894723u, 1114110585u, 2741076212u, 0, COSH_TOLERANCE, 0}, +{ 45, 1068516615u, 644548665u, 1081948134u, 2442134629u, 1072695366u, 1384821396u, 0, COSH_TOLERANCE, 0}, +{ 46, 1077068335u, 2312530895u, 3221584595u, 3379665576u, 1100002913u, 3357999194u, 0, COSH_TOLERANCE, 0}, +{ 47, 1079308159u, 3018463866u, 1086226574u, 404012923u, 1198269222u, 2905917257u, 0, COSH_TOLERANCE, 0}, +{ 48, 1071024755u, 1710279345u, 3251401196u, 3528946000u, 1072758958u, 1795613829u, 0, COSH_TOLERANCE, 0}, +{ 49, 1070973535u, 2164450219u, 1083520023u, 3312018966u, 1072754437u, 2812445457u, 0, COSH_TOLERANCE, 0}, +{ 50, 1069831588u, 2648986431u, 1050330591u, 1474376550u, 1072706507u, 2784383684u, 0, COSH_TOLERANCE, 0}, +{ 51, 3214344972u, 1839068700u, 1077406406u, 3013052171u, 1072693512u, 3372008771u, 0, COSH_TOLERANCE, 0}, +{ 52, 1066416574u, 772102380u, 3220729740u, 4219039958u, 1072693379u, 2736422544u, 0, COSH_TOLERANCE, 0}, +{ 53, 3223180765u, 3058618779u, 1046304788u, 3338676024u, 1082858658u, 288113767u, 0, COSH_TOLERANCE, 0}, +{ 54, 1067949353u, 506286854u, 1094907481u, 2217000199u, 1072694363u, 1851415872u, 0, COSH_TOLERANCE, 0}, +{ 55, 1076136854u, 1147428263u, 1065432625u, 3034786717u, 1087127673u, 1640783217u, 0, COSH_TOLERANCE, 0}, +{ 56, 1075725296u, 2844125311u, 1082985198u, 2561492677u, 1083060297u, 812604215u, 0, COSH_TOLERANCE, 0}, +{ 57, 3218876948u, 704542600u, 3222902057u, 2762779203u, 1072796430u, 3706016226u, 0, COSH_TOLERANCE, 0}, +{ 58, 3215409254u, 184131949u, 3249723525u, 1667366082u, 1072694329u, 1957018312u, 0, COSH_TOLERANCE, 0}, +{ 59, 3221512446u, 3904224140u, 1067056698u, 2942159914u, 1075426314u, 1203848820u, 0, COSH_TOLERANCE, 0}, +{ 60, 1080713919u, 426114282u, 3209056785u, 1083606355u, 1390879870u, 3657642479u, 0, COSH_TOLERANCE, 0}, +{ 61, 1082048697u, 3774123863u, 1106787580u, 2722107965u, 1815954824u, 2241806278u, 0, COSH_TOLERANCE, 0}, +{ 62, 1077519332u, 1377734762u, 1104232051u, 2377063483u, 1110428932u, 844049504u, 0, COSH_TOLERANCE, 0}, +{ 63, 1072526287u, 1029739074u, 1105467109u, 3062201018u, 1073169629u, 3757788751u, 0, COSH_TOLERANCE, 0}, +{ 64, 3225304413u, 773857656u, 3214251949u, 335833884u, 1117303861u, 3714139170u, 0, COSH_TOLERANCE, 0}, +{ 65, 3216856098u, 1473865960u, 1103073830u, 4000427507u, 1072700136u, 3810050038u, 0, COSH_TOLERANCE, 0}, +{ 66, 1081165135u, 4242092620u, 1067009473u, 14539161u, 1489589453u, 1225921132u, 0, COSH_TOLERANCE, 0}, +{ 67, 3214536170u, 1732245037u, 1101371955u, 1533536108u, 1072693584u, 789262791u, 0, COSH_TOLERANCE, 0}, +{ 68, 3228182475u, 1833841275u, 1099430098u, 4144145552u, 1388140140u, 2429748539u, 0, COSH_TOLERANCE, 0}, +{ 69, 3227493247u, 935007012u, 3188865420u, 604442938u, 1263004120u, 3099153891u, 0, COSH_TOLERANCE, 0}, +{ 70, 3217389013u, 2211464602u, 1046255144u, 1635910526u, 1072708019u, 4133545447u, 0, COSH_TOLERANCE, 0}, +{ 71, 1074725689u, 2549219008u, 3231633258u, 3733639385u, 1077420993u, 3573315642u, 0, COSH_TOLERANCE, 0}, +{ 72, 1075803633u, 1819374372u, 3202219056u, 2617077637u, 1083464179u, 4070461796u, 0, COSH_TOLERANCE, 0}, +{ 73, 1078616640u, 546465680u, 1048653554u, 532401530u, 1151433358u, 1660202510u, 0, COSH_TOLERANCE, 0}, +{ 74, 1066591187u, 2759019783u, 3221570188u, 3554409630u, 1072693426u, 1804445835u, 0, COSH_TOLERANCE, 0}, +{ 75, 3219222738u, 2527221960u, 1099107978u, 2696971136u, 1072852880u, 4070723488u, 0, COSH_TOLERANCE, 0}, +{ 76, 1079332208u, 173134582u, 1087299442u, 2877794600u, 1200522954u, 2450291402u, 0, COSH_TOLERANCE, 0}, +{ 77, 1076963290u, 547642046u, 3197285510u, 3521286127u, 1097525900u, 1604458500u, 0, COSH_TOLERANCE, 0}, +{ 78, 1073812126u, 1231582831u, 1090971734u, 1653446832u, 1074864811u, 1996198827u, 0, COSH_TOLERANCE, 0}, +{ 79, 1070779719u, 3762182190u, 3252967851u, 2615360375u, 1072738823u, 3172325200u, 0, COSH_TOLERANCE, 0}, +{ 80, 3216563063u, 2588067350u, 3206610957u, 3551059728u, 1072698194u, 4146036215u, 0, COSH_TOLERANCE, 0}, +{ 81, 3217464616u, 845263327u, 1073415902u, 1749010288u, 1072709655u, 139198688u, 0, COSH_TOLERANCE, 0}, +{ 82, 3217110706u, 3092685191u, 3190678390u, 2872219490u, 1072702744u, 974344816u, 0, COSH_TOLERANCE, 0}, +{ 83, 3220412207u, 4107255722u, 3205337291u, 3069068345u, 1073582488u, 3601775790u, 0, COSH_TOLERANCE, 0}, +{ 84, 3227213641u, 2294867524u, 3216653996u, 2860384670u, 1237260976u, 1311152806u, 0, COSH_TOLERANCE, 0}, +{ 85, 3214297870u, 2265437201u, 3240198679u, 1234948614u, 1072693496u, 2160301788u, 0, COSH_TOLERANCE, 0}, +{ 86, 3219505657u, 1186945904u, 3251167793u, 1896750851u, 1072945110u, 2441861331u, 0, COSH_TOLERANCE, 0}, +{ 87, 1075284022u, 3686084548u, 1079286273u, 3309277689u, 1080454737u, 1834280803u, 0, COSH_TOLERANCE, 0}, +{ 88, 3221379088u, 3006860614u, 3231412671u, 2504194724u, 1075053274u, 3685158235u, 0, COSH_TOLERANCE, 0}, +{ 89, 3224614924u, 1948717780u, 1048317852u, 3791803982u, 1101387050u, 776596525u, 0, COSH_TOLERANCE, 0}, +{ 90, 1070636471u, 4272034420u, 3192982124u, 1526175922u, 1072728787u, 177521945u, 0, COSH_TOLERANCE, 0}, +{ 91, 3226943458u, 4108948538u, 1104691287u, 640541190u, 1212283421u, 2139002760u, 0, COSH_TOLERANCE, 0}, +{ 92, 3217743177u, 3259274853u, 1082507103u, 3677038020u, 1072716427u, 776404209u, 0, COSH_TOLERANCE, 0}, +{ 93, 1076841042u, 3781708548u, 1096584871u, 1207386447u, 1095222699u, 77431u, 0, COSH_TOLERANCE, 0}, +{ 94, 3213861096u, 3011191657u, 1103798670u, 1096124830u, 1072693373u, 206751463u, 0, COSH_TOLERANCE, 0}, +{ 95, 1071623631u, 2540404725u, 3240157452u, 4122845725u, 1072824347u, 1612247748u, 0, COSH_TOLERANCE, 0}, +{ 96, 1076303678u, 311336721u, 3214382367u, 4212533768u, 1089026116u, 2664579205u, 0, COSH_TOLERANCE, 0}, +{ 97, 1067916643u, 1769686293u, 3240200923u, 3538602249u, 1072694316u, 3304105254u, 0, COSH_TOLERANCE, 0}, +{ 98, 1075081821u, 508056696u, 1103793878u, 776520138u, 1079295635u, 1807521048u, 0, COSH_TOLERANCE, 0}, +{ 99, 1080890481u, 4064962760u, 1077424413u, 819766631u, 1423488425u, 3317334315u, 0, COSH_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1075907720u, 3448229353u, 0, COSH_TOLERANCE, 0}, +{ 101, 1076003603u, 2514398118u, 1076579751u, 870169764u, 1085567394u, 4040666214u, 0, COSH_TOLERANCE, 0}, +{ 102, 3227977024u, 1190259653u, 1069112254u, 3417249840u, 1350163471u, 1074619959u, 0, COSH_TOLERANCE, 0}, +{ 103, 3214634603u, 3467757357u, 3215075200u, 2168175352u, 1072693624u, 1123141988u, 0, COSH_TOLERANCE, 0}, +{ 104, 3226011647u, 1508888184u, 1060430241u, 3524949092u, 1147319027u, 4152444040u, 0, COSH_TOLERANCE, 0}, +{ 105, 3215238675u, 166402802u, 3237198975u, 3572369260u, 1072694100u, 3674442469u, 0, COSH_TOLERANCE, 0}, +{ 106, 1075575366u, 2441536203u, 3202753937u, 3658194573u, 1082198549u, 1303886570u, 0, COSH_TOLERANCE, 0}, +{ 107, 1070781516u, 2479742828u, 1062342831u, 4214154303u, 1072738957u, 3022776512u, 0, COSH_TOLERANCE, 0}, +{ 108, 1076105338u, 426896765u, 1066474375u, 2201754442u, 1086731957u, 3468972475u, 0, COSH_TOLERANCE, 0}, +{ 109, 3214503389u, 2055773734u, 3239267288u, 291396537u, 1072693571u, 1450513960u, 0, COSH_TOLERANCE, 0}, +{ 110, 3224385121u, 874125203u, 3210508124u, 4091098764u, 1096086990u, 529374978u, 0, COSH_TOLERANCE, 0}, +{ 111, 1072007482u, 120488169u, 3241241441u, 1985269424u, 1072939813u, 2389502735u, 0, COSH_TOLERANCE, 0}, +{ 112, 3218073746u, 2243036871u, 3243941101u, 740033495u, 1072725997u, 3948893692u, 0, COSH_TOLERANCE, 0}, +{ 113, 3218862090u, 1176656356u, 1074261978u, 3588756231u, 1072794750u, 819787567u, 0, COSH_TOLERANCE, 0}, +{ 114, 3228699543u, 3037249392u, 1061635587u, 1173102190u, 1508329855u, 1211293113u, 0, COSH_TOLERANCE, 0}, +{ 115, 3224626669u, 2882725208u, 1071440059u, 69225090u, 1101667894u, 2351994968u, 0, COSH_TOLERANCE, 0}, +{ 116, 3218954930u, 272319256u, 1072073912u, 2493997123u, 1072805489u, 1686170561u, 0, COSH_TOLERANCE, 0}, +{ 117, 1070303098u, 188610379u, 3232757923u, 2209647371u, 1072717593u, 236808659u, 0, COSH_TOLERANCE, 0}, +{ 118, 3225224181u, 1990439193u, 1078073146u, 622849962u, 1115491532u, 3932839728u, 0, COSH_TOLERANCE, 0}, +{ 119, 1069718653u, 756052458u, 1081649113u, 2247475162u, 1072704351u, 3003850457u, 0, COSH_TOLERANCE, 0}, +{ 120, 1071060248u, 3878055211u, 3222407050u, 2979438623u, 1072762188u, 2461618929u, 0, COSH_TOLERANCE, 0}, +{ 121, 3214165365u, 2676398686u, 1105124431u, 3631096636u, 1072693453u, 2018804946u, 0, COSH_TOLERANCE, 0}, +{ 122, 1071370846u, 1697791764u, 3198136112u, 2299842819u, 1072793896u, 2354734361u, 0, COSH_TOLERANCE, 0}, +{ 123, 1074939040u, 1931502677u, 3215264397u, 3016456382u, 1078464791u, 2439295006u, 0, COSH_TOLERANCE, 0}, +{ 124, 1073302002u, 343404215u, 1061072607u, 4266232536u, 1074020614u, 4198175003u, 0, COSH_TOLERANCE, 0}, +{ 125, 3225502196u, 4140316002u, 1082896196u, 868256971u, 1123795724u, 3427688141u, 0, COSH_TOLERANCE, 0}, +{ 126, 1074374234u, 1864139509u, 3187675097u, 3084482407u, 1076410861u, 3327335940u, 0, COSH_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 1073279818u, 1325802416u, 0, COSH_TOLERANCE, 0}, +{ 128, 1070891968u, 3943389284u, 1046724025u, 3626825684u, 1072747579u, 3427003319u, 0, COSH_TOLERANCE, 0}, +{ 129, 1067443098u, 967350972u, 1093012318u, 448002663u, 1072693756u, 2136965429u, 0, COSH_TOLERANCE, 0}, +{ 130, 3228777187u, 105058217u, 1069733884u, 171786224u, 1537057146u, 2944133190u, 0, COSH_TOLERANCE, 0}, +{ 131, 3213731756u, 2863482262u, 3204997271u, 877784425u, 1072693357u, 3990621442u, 0, COSH_TOLERANCE, 0}, +{ 132, 3216260801u, 2801782962u, 3213604117u, 762347195u, 1072696528u, 2729731056u, 0, COSH_TOLERANCE, 0}, +{ 133, 3224049543u, 2317950339u, 3246333414u, 2135700283u, 1092046479u, 699547095u, 0, COSH_TOLERANCE, 0}, +{ 134, 1069099309u, 4171919805u, 1082858682u, 2180920863u, 1072698316u, 2698555179u, 0, COSH_TOLERANCE, 0}, +{ 135, 3221197660u, 1918836931u, 1083603224u, 3137821660u, 1074615975u, 2866178825u, 0, COSH_TOLERANCE, 0}, +{ 136, 1081882778u, 3456203663u, 3235600523u, 2335688936u, 1754633057u, 4057860990u, 0, COSH_TOLERANCE, 0}, +{ 137, 1066396570u, 4170235262u, 1051824459u, 521583737u, 1072693375u, 1572125749u, 0, COSH_TOLERANCE, 0}, +{ 138, 1075056847u, 1296623194u, 3250673860u, 2442872540u, 1079172105u, 4063375717u, 0, COSH_TOLERANCE, 0}, +{ 139, 1071121461u, 289979405u, 1049514449u, 3865737145u, 1072767947u, 1956781744u, 0, COSH_TOLERANCE, 0}, +{ 140, 1074250368u, 3699090239u, 1054539840u, 3259249360u, 1076071149u, 1820335208u, 0, COSH_TOLERANCE, 0}, +{ 141, 1079640884u, 1619819023u, 1045993352u, 1022642459u, 1229016129u, 1444182022u, 0, COSH_TOLERANCE, 0}, +{ 142, 1075141548u, 19455098u, 3229182089u, 2096003654u, 1079643489u, 1763506935u, 0, COSH_TOLERANCE, 0}, +{ 143, 1074200784u, 3803689997u, 1071630912u, 2263729518u, 1075956212u, 541371697u, 0, COSH_TOLERANCE, 0}, +{ 144, 1080385741u, 2816837387u, 1063422305u, 2597606398u, 1330293545u, 1095829056u, 0, COSH_TOLERANCE, 0}, +{ 145, 1072245897u, 3680967506u, 1040201163u, 179224723u, 1073034800u, 1106942961u, 0, COSH_TOLERANCE, 0}, +{ 146, 3213795591u, 978126928u, 1101553990u, 4047893399u, 1072693365u, 1156495186u, 0, COSH_TOLERANCE, 0}, +{ 147, 3221273469u, 4059818629u, 1042678728u, 3640293589u, 1074819359u, 1680813367u, 0, COSH_TOLERANCE, 0}, +{ 148, 3228541096u, 3383497159u, 1070002807u, 1527313008u, 1454398110u, 4173296238u, 0, COSH_TOLERANCE, 0}, +{ 149, 3216339167u, 2599946514u, 1104170406u, 2738675352u, 1072696927u, 3659150073u, 0, COSH_TOLERANCE, 0}, +{ 150, 1081115375u, 3616571377u, 1060859316u, 1130603218u, 1471256027u, 3187069287u, 0, COSH_TOLERANCE, 0}, +{ 151, 1073931644u, 3859211180u, 1067940450u, 1744531824u, 1075145206u, 3259882951u, 0, COSH_TOLERANCE, 0}, +{ 152, 1065900012u, 1958025850u, 3236511256u, 2472176453u, 1072693322u, 327825150u, 0, COSH_TOLERANCE, 0}, +{ 153, 3223669905u, 182132862u, 3250520938u, 3924356991u, 1087674283u, 2611530335u, 0, COSH_TOLERANCE, 0}, +{ 154, 3224210428u, 35632886u, 3209806504u, 1453402523u, 1093919296u, 1099362036u, 0, COSH_TOLERANCE, 0}, +{ 155, 1076182070u, 743225214u, 3202890678u, 142917400u, 1087631855u, 3785393671u, 0, COSH_TOLERANCE, 0}, +{ 156, 1075442096u, 1472665012u, 3203138231u, 256588219u, 1081376587u, 3032890454u, 0, COSH_TOLERANCE, 0}, +{ 157, 1079253522u, 1062927000u, 1061134072u, 931677439u, 1193281892u, 3538812810u, 0, COSH_TOLERANCE, 0}, +{ 158, 1069912068u, 2320910576u, 1055663370u, 288059864u, 1072708161u, 1882746750u, 0, COSH_TOLERANCE, 0}, +{ 159, 1075812365u, 1448349062u, 3199478070u, 3454027134u, 1083509354u, 3244981512u, 0, COSH_TOLERANCE, 0}, +{ 160, 3224875886u, 4215445172u, 3196654963u, 2231888973u, 1107446504u, 159529183u, 0, COSH_TOLERANCE, 0}, +{ 161, 3227757863u, 40413554u, 3232578253u, 983832844u, 1309743639u, 1304081657u, 0, COSH_TOLERANCE, 0}, +{ 162, 3221624382u, 3995725873u, 1050082319u, 777231627u, 1075822815u, 4273229959u, 0, COSH_TOLERANCE, 0}, +{ 163, 1066152450u, 672789828u, 3253385962u, 2982787335u, 1072693347u, 1605275833u, 0, COSH_TOLERANCE, 0}, +{ 164, 1072585179u, 2075971825u, 1070166500u, 4034633931u, 1073201328u, 3750652822u, 0, COSH_TOLERANCE, 0}, +{ 165, 3218434785u, 1018222907u, 3244621407u, 3090050495u, 1072752512u, 3396710540u, 0, COSH_TOLERANCE, 0}, +{ 166, 1071875189u, 937732557u, 3200798890u, 2557898276u, 1072894405u, 2050433952u, 0, COSH_TOLERANCE, 0}, +{ 167, 1075196588u, 130346162u, 3223590310u, 275568693u, 1080037821u, 3469976951u, 0, COSH_TOLERANCE, 0}, +{ 168, 1065967541u, 3807416441u, 1075961161u, 3706820266u, 1072693328u, 2062373411u, 0, COSH_TOLERANCE, 0}, +{ 169, 3219244733u, 1710131411u, 1078123323u, 1900790503u, 1072859242u, 2262607443u, 0, COSH_TOLERANCE, 0}, +{ 170, 3226236449u, 3420420033u, 3210844787u, 588423066u, 1157720745u, 774296256u, 0, COSH_TOLERANCE, 0}, +{ 171, 1067509906u, 1160162008u, 3246307879u, 4265764460u, 1072693819u, 3631349776u, 0, COSH_TOLERANCE, 0}, +{ 172, 1080523338u, 366653268u, 3188814424u, 466059202u, 1355764484u, 760636581u, 0, COSH_TOLERANCE, 0}, +{ 173, 3222433435u, 1325936170u, 3221436876u, 680097612u, 1078530781u, 3669498780u, 0, COSH_TOLERANCE, 0}, +{ 174, 3225711052u, 1827735934u, 3200554324u, 2875599271u, 1133496792u, 2135776268u, 0, COSH_TOLERANCE, 0}, +{ 175, 3213050498u, 3117037091u, 3239246636u, 15838845u, 1072693294u, 1579961608u, 0, COSH_TOLERANCE, 0}, +{ 176, 1067702644u, 749718883u, 3223587064u, 1523766569u, 1072694036u, 422449494u, 0, COSH_TOLERANCE, 0}, +{ 177, 1066853747u, 1966536294u, 3250158026u, 699164258u, 1072693510u, 562801207u, 0, COSH_TOLERANCE, 0}, +{ 178, 1079174067u, 3759049394u, 1106085272u, 1183789499u, 1185944512u, 3807740687u, 0, COSH_TOLERANCE, 0}, +{ 179, 1074910167u, 1970107747u, 1095245453u, 2308233883u, 1078300334u, 1661985235u, 0, COSH_TOLERANCE, 0}, +{ 180, 1076367836u, 1491017852u, 1041444355u, 1723375725u, 1089770148u, 2037745521u, 0, COSH_TOLERANCE, 0}, +{ 181, 3219775798u, 1141349287u, 1097465301u, 3403438584u, 1073055268u, 2358787186u, 0, COSH_TOLERANCE, 0}, +{ 182, 3224280452u, 1711085243u, 3250239076u, 1377484108u, 1094776418u, 2040663178u, 0, COSH_TOLERANCE, 0}, +{ 183, 1079510651u, 2880275004u, 1084039594u, 1611394950u, 1216939131u, 2867297031u, 0, COSH_TOLERANCE, 0}, +{ 184, 3224784251u, 2626629370u, 1063771493u, 1499080813u, 1105335110u, 3654476853u, 0, COSH_TOLERANCE, 0}, +{ 185, 1068862751u, 3936262414u, 1103919063u, 3175668759u, 1072696965u, 3660378434u, 0, COSH_TOLERANCE, 0}, +{ 186, 3217418903u, 1270950554u, 3194616071u, 3680565379u, 1072708656u, 267045490u, 0, COSH_TOLERANCE, 0}, +{ 187, 3217585407u, 1066985223u, 3221613219u, 4089383168u, 1072712446u, 4162711102u, 0, COSH_TOLERANCE, 0}, +{ 188, 3220204567u, 4017329311u, 3208334452u, 1667591498u, 1073295796u, 2773972944u, 0, COSH_TOLERANCE, 0}, +{ 189, 1077678397u, 3154656624u, 1061894279u, 3886344038u, 1114014484u, 1143078455u, 0, COSH_TOLERANCE, 0}, +{ 190, 1068478737u, 977586119u, 3209762784u, 953839852u, 1072695257u, 1568551512u, 0, COSH_TOLERANCE, 0}, +{ 191, 1081896575u, 143071571u, 3206165386u, 913097445u, 1759744561u, 1725664653u, 0, COSH_TOLERANCE, 0}, +{ 192, 3213634128u, 1371169579u, 1057079837u, 2594818628u, 1072693347u, 695760778u, 0, COSH_TOLERANCE, 0}, +{ 193, 3228724664u, 2259342224u, 3217432469u, 1824221478u, 1517614491u, 1347867273u, 0, COSH_TOLERANCE, 0}, +{ 194, 3227960407u, 1576604497u, 1079368611u, 185078728u, 1347106434u, 3370329867u, 0, COSH_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 1075945204u, 3272065637u, 0, COSH_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1073330400u, 1602882483u, 0, COSH_TOLERANCE, 0}, +{ 197, 3225258784u, 1941318385u, 1045807374u, 792193370u, 1116250287u, 3103118402u, 0, COSH_TOLERANCE, 0}, +{ 198, 3225716754u, 1299392207u, 3212131720u, 3205732280u, 1133701703u, 3451158556u, 0, COSH_TOLERANCE, 0}, +{ 199, 1079824436u, 3035093505u, 1052187689u, 3287702190u, 1245928697u, 3659026689u, 0, COSH_TOLERANCE, 0}, +{ 200, 3227801892u, 2160225215u, 1102624859u, 836655570u, 1317853110u, 1753278920u, 0, COSH_TOLERANCE, 0}, +{ 201, 1079946410u, 3360816360u, 3246176356u, 172860634u, 1257254087u, 595783054u, 0, COSH_TOLERANCE, 0}, +{ 202, 1073092940u, 146831910u, 1051558014u, 2340722078u, 1073802343u, 192170069u, 0, COSH_TOLERANCE, 0}, +{ 203, 3224124895u, 1603798153u, 3207725532u, 1099413093u, 1092924694u, 2401380251u, 0, COSH_TOLERANCE, 0}, +{ 204, 3227804010u, 2429340443u, 3190303581u, 3223770005u, 1318235431u, 1901620640u, 0, COSH_TOLERANCE, 0}, +{ 205, 1073785807u, 955542166u, 3230415151u, 275583938u, 1074811387u, 2594666488u, 0, COSH_TOLERANCE, 0}, +{ 206, 1078291818u, 513397822u, 1090646554u, 2089321329u, 1136418636u, 351397573u, 0, COSH_TOLERANCE, 0}, +{ 207, 3214141396u, 2782073372u, 1046063872u, 4023829068u, 1072693446u, 525984948u, 0, COSH_TOLERANCE, 0}, +{ 208, 1079690454u, 3242223094u, 3194111199u, 4264674108u, 1233536710u, 346227329u, 0, COSH_TOLERANCE, 0}, +{ 209, 3225927909u, 3506346169u, 1047020885u, 1742757458u, 1143421892u, 2781434878u, 0, COSH_TOLERANCE, 0}, +{ 210, 3214684573u, 1265459564u, 3193450280u, 3650514880u, 1072693645u, 2020640906u, 0, COSH_TOLERANCE, 0}, +{ 211, 1075464434u, 1525260440u, 3235452527u, 2612331392u, 1081496072u, 2899446050u, 0, COSH_TOLERANCE, 0}, +{ 212, 3227697400u, 1263613754u, 3219096387u, 635677201u, 1298518908u, 459760033u, 0, COSH_TOLERANCE, 0}, +{ 213, 3217806423u, 4140947288u, 3200792376u, 2013265346u, 1072718129u, 500268673u, 0, COSH_TOLERANCE, 0}, +{ 214, 3227954296u, 1912759945u, 3237045253u, 1351396825u, 1345966111u, 1464931509u, 0, COSH_TOLERANCE, 0}, +{ 215, 3228282218u, 1001433078u, 3206926643u, 2741676659u, 1406514744u, 3156202362u, 0, COSH_TOLERANCE, 0}, +{ 216, 1075680726u, 1088945233u, 1085095743u, 3986114865u, 1082750959u, 2813999483u, 0, COSH_TOLERANCE, 0}, +{ 217, 3219928361u, 831239754u, 1099828675u, 3071308141u, 1073127703u, 3507722226u, 0, COSH_TOLERANCE, 0}, +{ 218, 3222688769u, 3473592372u, 1102759382u, 1309576357u, 1080072667u, 3702574099u, 0, COSH_TOLERANCE, 0}, +{ 219, 3229166610u, 2042340367u, 1091945628u, 2062772374u, 1680905763u, 210474498u, 0, COSH_TOLERANCE, 0}, +{ 220, 3214688631u, 1840632537u, 1096533424u, 807510337u, 1072693647u, 938142822u, 0, COSH_TOLERANCE, 0}, +{ 221, 3224111690u, 144814872u, 3212698915u, 2282965697u, 1092794632u, 1680580331u, 0, COSH_TOLERANCE, 0}, +{ 222, 1073333582u, 2552499583u, 3229111426u, 1470130815u, 1074057948u, 4239780720u, 0, COSH_TOLERANCE, 0}, +{ 223, 3227364425u, 2858583811u, 1089760910u, 6360994u, 1251137827u, 697276436u, 0, COSH_TOLERANCE, 0}, +{ 224, 3215042145u, 1614537194u, 1075198900u, 4088705365u, 1072693871u, 435034830u, 0, COSH_TOLERANCE, 0}, +{ 225, 3228918974u, 3545570051u, 1065221325u, 1629217700u, 1589407573u, 229769802u, 0, COSH_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1073324678u, 267422968u, 0, COSH_TOLERANCE, 0}, +{ 227, 3215677054u, 2406734491u, 1042055360u, 89226663u, 1072694743u, 314704995u, 0, COSH_TOLERANCE, 0}, +{ 228, 3214625449u, 1618759139u, 3194723421u, 3888234802u, 1072693620u, 1885675412u, 0, COSH_TOLERANCE, 0}, +{ 229, 1068988736u, 3590035633u, 3212424262u, 2892456615u, 1072697659u, 797486592u, 0, COSH_TOLERANCE, 0}, +{ 230, 3213011732u, 2431246964u, 3241512456u, 183850734u, 1072693291u, 2419777582u, 0, COSH_TOLERANCE, 0}, +{ 231, 1076918189u, 3088319870u, 3211544311u, 862225364u, 1096486112u, 1720101621u, 0, COSH_TOLERANCE, 0}, +{ 232, 3224808904u, 3495352775u, 1058576726u, 596957268u, 1105876117u, 1924270502u, 0, COSH_TOLERANCE, 0}, +{ 233, 1066476292u, 1839214511u, 3205004060u, 1923240983u, 1072693394u, 3599825330u, 0, COSH_TOLERANCE, 0}, +{ 234, 1069608200u, 739619702u, 3223356436u, 2689885273u, 1072702428u, 3984013578u, 0, COSH_TOLERANCE, 0}, +{ 235, 3216053611u, 2143376228u, 1098306332u, 3760236188u, 1072695583u, 2926029591u, 0, COSH_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1077136875u, 826067980u, 0, COSH_TOLERANCE, 0}, +{ 237, 3219408869u, 2493598049u, 3194927008u, 1689107592u, 1072910984u, 1200702158u, 0, COSH_TOLERANCE, 0}, +{ 238, 3213058631u, 1578976988u, 1066368383u, 2117279163u, 1072693294u, 4154544241u, 0, COSH_TOLERANCE, 0}, +{ 239, 3221939535u, 3425290087u, 1098487295u, 1263412017u, 1076683118u, 1001936109u, 0, COSH_TOLERANCE, 0}, +{ 240, 3217869948u, 3635396812u, 1070999426u, 3965655689u, 1072719899u, 4191291117u, 0, COSH_TOLERANCE, 0}, +{ 241, 1069633530u, 2183973116u, 1101098363u, 1118613350u, 1072702853u, 2843946852u, 0, COSH_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 1076706867u, 2653466916u, 0, COSH_TOLERANCE, 0}, +{ 243, 3212871842u, 3570940805u, 3230316437u, 3596080877u, 1072693282u, 733293125u, 0, COSH_TOLERANCE, 0}, +{ 244, 3217646749u, 980880313u, 1079833442u, 884465057u, 1072713949u, 2327888183u, 0, COSH_TOLERANCE, 0}, +{ 245, 1080054180u, 2558179220u, 1052873711u, 1233598120u, 1269060948u, 2524660391u, 0, COSH_TOLERANCE, 0}, +{ 246, 1067038165u, 1909994277u, 1085015978u, 2991527452u, 1072693578u, 2262681612u, 0, COSH_TOLERANCE, 0}, +{ 247, 1070292444u, 1680290941u, 1074309900u, 2943870846u, 1072717305u, 1264785041u, 0, COSH_TOLERANCE, 0}, +{ 248, 1069981892u, 1451927357u, 3228615456u, 1502585517u, 1072709675u, 2378690044u, 0, COSH_TOLERANCE, 0}, +{ 249, 3224677615u, 751136990u, 3230392165u, 3493275472u, 1102866871u, 215829603u, 0, COSH_TOLERANCE, 0}, +{ 250, 1079491599u, 1209623292u, 3238056647u, 979495322u, 1215252451u, 1345426533u, 0, COSH_TOLERANCE, 0}, +{ 251, 3228404200u, 1717672108u, 1048120593u, 531240316u, 1429099700u, 3462906838u, 0, COSH_TOLERANCE, 0}, +{ 252, 1068854987u, 3548721654u, 1086112947u, 3391817224u, 1072696925u, 281688495u, 0, COSH_TOLERANCE, 0}, +{ 253, 1074691123u, 2758195125u, 1100880260u, 2028440924u, 1077320145u, 4283533331u, 0, COSH_TOLERANCE, 0}, +{ 254, 1076883861u, 2750123373u, 3232200256u, 1086294931u, 1095793270u, 788833266u, 0, COSH_TOLERANCE, 0}, +{ 255, 1065978768u, 2986160931u, 1076097908u, 2540046258u, 1072693329u, 2450552268u, 0, COSH_TOLERANCE, 0}, +{ 256, 3224990842u, 451471221u, 1064816262u, 4187644495u, 1110076565u, 655095513u, 0, COSH_TOLERANCE, 0}, +{ 257, 1080585860u, 2439500162u, 1065280276u, 1979490284u, 1367314315u, 4075308906u, 0, COSH_TOLERANCE, 0}, +{ 258, 1065581656u, 2283342035u, 1078398157u, 1345997553u, 1072693295u, 1984477633u, 0, COSH_TOLERANCE, 0}, +{ 259, 3219540804u, 179066662u, 1103272172u, 1217337578u, 1072958184u, 2633513687u, 0, COSH_TOLERANCE, 0}, +{ 260, 3218902409u, 3779303391u, 3210023352u, 3115946280u, 1072799344u, 2662349015u, 0, COSH_TOLERANCE, 0}, +{ 261, 3213961394u, 286247089u, 1085153597u, 713645369u, 1072693395u, 938537965u, 0, COSH_TOLERANCE, 0}, +{ 262, 1077941860u, 1468283899u, 1042831668u, 2022736418u, 1120232171u, 2888650454u, 0, COSH_TOLERANCE, 0}, +{ 263, 1076847649u, 3305564080u, 1065483445u, 482392433u, 1095303241u, 3604886385u, 0, COSH_TOLERANCE, 0}, +{ 264, 3216375871u, 2256346551u, 3222430705u, 2071674991u, 1072697122u, 3114668340u, 0, COSH_TOLERANCE, 0}, +{ 265, 3216607607u, 2295269094u, 1084451053u, 2773103941u, 1072698469u, 1831807840u, 0, COSH_TOLERANCE, 0}, +{ 266, 1075028218u, 1482721827u, 1092243422u, 3125409590u, 1079044245u, 1232254491u, 0, COSH_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 1074398228u, 2786573068u, 0, COSH_TOLERANCE, 0}, +{ 268, 3226133060u, 1105857967u, 3241990046u, 2703723225u, 1152893521u, 2850491479u, 0, COSH_TOLERANCE, 0}, +{ 269, 1066084243u, 174689677u, 1079333374u, 3947057014u, 1072693340u, 742181246u, 0, COSH_TOLERANCE, 0}, +{ 270, 1077878947u, 2023082423u, 3242081486u, 1169047927u, 1118700325u, 3426525989u, 0, COSH_TOLERANCE, 0}, +{ 271, 1070817355u, 3742487766u, 1043425732u, 194972788u, 1072741671u, 3984460825u, 0, COSH_TOLERANCE, 0}, +{ 272, 3220083283u, 2136071361u, 3211529757u, 993675115u, 1073209296u, 2409955736u, 0, COSH_TOLERANCE, 0}, +{ 273, 3219954837u, 210772141u, 3241441539u, 580731413u, 1073141062u, 1932588337u, 0, COSH_TOLERANCE, 0}, +{ 274, 1078111773u, 1751560711u, 1074522705u, 180987057u, 1128126630u, 2518765659u, 0, COSH_TOLERANCE, 0}, +{ 275, 1071997471u, 2552236599u, 1088658621u, 2112468655u, 1072936199u, 2897169212u, 0, COSH_TOLERANCE, 0}, +{ 276, 3213407865u, 1578223762u, 3224596567u, 2456166162u, 1072693324u, 1465320139u, 0, COSH_TOLERANCE, 0}, +{ 277, 1070041301u, 2110924310u, 1086207177u, 3161208323u, 1072711021u, 3971776018u, 0, COSH_TOLERANCE, 0}, +{ 278, 3223474786u, 2352173188u, 1079361728u, 4070222179u, 1085445849u, 578433019u, 0, COSH_TOLERANCE, 0}, +{ 279, 1080041384u, 2481562701u, 1090937016u, 3809489716u, 1266749058u, 404634930u, 0, COSH_TOLERANCE, 0}, +{ 280, 3215877019u, 330905705u, 1086260896u, 90264431u, 1072695095u, 2298955529u, 0, COSH_TOLERANCE, 0}, +{ 281, 1065895785u, 4162008079u, 3194387916u, 759522153u, 1072693321u, 2939280632u, 0, COSH_TOLERANCE, 0}, +{ 282, 1075772157u, 1839697482u, 3216442625u, 2211508949u, 1083313275u, 3907126828u, 0, COSH_TOLERANCE, 0}, +{ 283, 3227787115u, 3736863454u, 1063475914u, 3150741666u, 1315110814u, 1556023783u, 0, COSH_TOLERANCE, 0}, +{ 284, 1070223067u, 4200269406u, 3236646101u, 1061812176u, 1072715473u, 2995155516u, 0, COSH_TOLERANCE, 0}, +{ 285, 1074975099u, 106027290u, 3234978297u, 2245237549u, 1078697327u, 2130268559u, 0, COSH_TOLERANCE, 0}, +{ 286, 3228109966u, 2132131375u, 3250483427u, 3449276437u, 1374762386u, 2754991195u, 0, COSH_TOLERANCE, 0}, +{ 287, 1077854442u, 2334440944u, 1105423490u, 4004336184u, 1118086726u, 1452344798u, 0, COSH_TOLERANCE, 0}, +{ 288, 3220869856u, 4090088208u, 1042030013u, 3898658299u, 1074122930u, 2876824951u, 0, COSH_TOLERANCE, 0}, +{ 289, 3217345248u, 2272831437u, 3253082595u, 2639188641u, 1072707112u, 3996072429u, 0, COSH_TOLERANCE, 0}, +{ 290, 1069446748u, 1856594168u, 3189515294u, 4101853676u, 1072700680u, 1721485335u, 0, COSH_TOLERANCE, 0}, +{ 291, 1073915260u, 2211699255u, 3195060344u, 3865018604u, 1075102800u, 1125779193u, 0, COSH_TOLERANCE, 0}, +{ 292, 3227038370u, 996259334u, 3241496889u, 3782673116u, 1221003247u, 1357097126u, 0, COSH_TOLERANCE, 0}, +{ 293, 1080256379u, 3840380763u, 1048674041u, 550040067u, 1306461489u, 928374556u, 0, COSH_TOLERANCE, 0}, +{ 294, 3229399497u, 95874100u, 3237232828u, 2645647822u, 1766909843u, 3490239415u, 0, COSH_TOLERANCE, 0}, +{ 295, 1065685736u, 3441419500u, 3252367038u, 876710419u, 1072693303u, 2207449341u, 0, COSH_TOLERANCE, 0}, +{ 296, 3226010640u, 2560836004u, 3199616543u, 1180840586u, 1147281949u, 3335028675u, 0, COSH_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 1075740200u, 2468828995u, 0, COSH_TOLERANCE, 0}, +{ 298, 1075345350u, 1447312532u, 1081476588u, 780366847u, 1080842197u, 2196210744u, 0, COSH_TOLERANCE, 0}, +{ 299, 1073618219u, 2842113832u, 3216156731u, 225159029u, 1074454774u, 2913703556u, 0, COSH_TOLERANCE, 0}, +{ 300, 1079242825u, 1601981129u, 3234628869u, 2236538344u, 1192276494u, 2364090570u, 0, COSH_TOLERANCE, 0}, +{ 301, 1076784916u, 2194185737u, 3242362684u, 87913366u, 1094646719u, 2239129684u, 0, COSH_TOLERANCE, 0}, +{ 302, 3215861096u, 1346862963u, 1077836259u, 3604666660u, 1072695066u, 440704647u, 0, COSH_TOLERANCE, 0}, +{ 303, 3218547435u, 3115209742u, 1099332326u, 1325101950u, 1072762515u, 59651451u, 0, COSH_TOLERANCE, 0}, +{ 304, 3221400314u, 3889223100u, 1053247613u, 3371396923u, 1075106387u, 2524506776u, 0, COSH_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 1073688400u, 3535902313u, 0, COSH_TOLERANCE, 0}, +{ 306, 3218064691u, 1532426189u, 1063168268u, 3397022615u, 1072725713u, 1946389065u, 0, COSH_TOLERANCE, 0}, +{ 307, 3216761961u, 89324166u, 1079206060u, 3429424710u, 1072699477u, 4166825646u, 0, COSH_TOLERANCE, 0}, +{ 308, 3214345198u, 747591401u, 1072238381u, 2803213904u, 1072693512u, 3712512165u, 0, COSH_TOLERANCE, 0}, +{ 309, 1078530868u, 271904221u, 1044258318u, 1858545114u, 1147431148u, 2228394364u, 0, COSH_TOLERANCE, 0}, +{ 310, 3222826034u, 314958082u, 3249912496u, 2966213175u, 1080821311u, 3940918208u, 0, COSH_TOLERANCE, 0}, +{ 311, 3215005206u, 3119528953u, 3217179014u, 2908718240u, 1072693831u, 4021851488u, 0, COSH_TOLERANCE, 0}, +{ 312, 3226738936u, 2018361566u, 1100926600u, 3985805054u, 1193401522u, 2660715245u, 0, COSH_TOLERANCE, 0}, +{ 313, 1073278308u, 409584884u, 3239758947u, 755795129u, 1073993396u, 3069689441u, 0, COSH_TOLERANCE, 0}, +{ 314, 1074723870u, 1819156379u, 3251342302u, 2982669005u, 1077415518u, 3369394811u, 0, COSH_TOLERANCE, 0}, +{ 315, 1080591913u, 2080534280u, 3188254060u, 449171797u, 1368425681u, 3068381489u, 0, COSH_TOLERANCE, 0}, +{ 316, 1079179684u, 168744837u, 3214950009u, 1322217822u, 1186375305u, 280204842u, 0, COSH_TOLERANCE, 0}, +{ 317, 3229061076u, 3250487255u, 1062120700u, 1876195180u, 1641903706u, 3427323764u, 0, COSH_TOLERANCE, 0}, +{ 318, 3223197752u, 1336400247u, 1098057903u, 3314079581u, 1082977604u, 2978454035u, 0, COSH_TOLERANCE, 0}, +{ 319, 3216261732u, 265025555u, 1063854282u, 3779482256u, 1072696533u, 1033696308u, 0, COSH_TOLERANCE, 0}, +{ 320, 1072543381u, 887044257u, 1054789618u, 2732056261u, 1073178705u, 3462589012u, 0, COSH_TOLERANCE, 0}, +{ 321, 1067932534u, 4027115185u, 3191764868u, 2940199511u, 1072694339u, 1351370649u, 0, COSH_TOLERANCE, 0}, +{ 322, 3216131643u, 2875684421u, 3227459837u, 2251967570u, 1072695920u, 3217040934u, 0, COSH_TOLERANCE, 0}, +{ 323, 1071633020u, 284173546u, 3238823679u, 3557800647u, 1072825560u, 612997882u, 0, COSH_TOLERANCE, 0}, +{ 324, 1080487040u, 3147771266u, 3220110464u, 2933364246u, 1348984230u, 3038347863u, 0, COSH_TOLERANCE, 0}, +{ 325, 1071144616u, 3366183281u, 3234870843u, 537442654u, 1072770188u, 1133518616u, 0, COSH_TOLERANCE, 0}, +{ 326, 3227341572u, 2529029548u, 3249882819u, 3781513577u, 1249030162u, 3889526767u, 0, COSH_TOLERANCE, 0}, +{ 327, 3219727810u, 1080845539u, 3206760016u, 911778687u, 1073034045u, 1789981630u, 0, COSH_TOLERANCE, 0}, +{ 328, 3213971132u, 469586759u, 1091830022u, 3080528840u, 1072693397u, 3347259082u, 0, COSH_TOLERANCE, 0}, +{ 329, 1075006224u, 2863108169u, 3225605506u, 2508274250u, 1078925453u, 184242647u, 0, COSH_TOLERANCE, 0}, +{ 330, 3218167016u, 4080017377u, 3206492941u, 1470284690u, 1072731933u, 456187951u, 0, COSH_TOLERANCE, 0}, +{ 331, 3217606150u, 3867917386u, 1102054928u, 3504746045u, 1072712948u, 2971602982u, 0, COSH_TOLERANCE, 0}, +{ 332, 1070813735u, 2962134101u, 3244741577u, 3390537350u, 1072741394u, 543292184u, 0, COSH_TOLERANCE, 0}, +{ 333, 1077716053u, 1702237980u, 1071598971u, 1102587474u, 1114898104u, 2058865259u, 0, COSH_TOLERANCE, 0}, +{ 334, 3216601606u, 2180218657u, 3211592260u, 1206527853u, 1072698432u, 76209351u, 0, COSH_TOLERANCE, 0}, +{ 335, 3215959112u, 394130786u, 3242511482u, 2437699868u, 1072695251u, 149960380u, 0, COSH_TOLERANCE, 0}, +{ 336, 1066257155u, 849581558u, 3252006507u, 2008614943u, 1072693358u, 4101451221u, 0, COSH_TOLERANCE, 0}, +{ 337, 3218528622u, 3128971673u, 3249137531u, 2773583059u, 1072760788u, 3100318414u, 0, COSH_TOLERANCE, 0}, +{ 338, 1076641258u, 590727700u, 3248651761u, 2183878539u, 1092924806u, 51935964u, 0, COSH_TOLERANCE, 0}, +{ 339, 1080127109u, 820687580u, 3208143496u, 1402434664u, 1282555424u, 2229435922u, 0, COSH_TOLERANCE, 0}, +{ 340, 3229222163u, 1873709254u, 3245167989u, 44275991u, 1701351914u, 2238140986u, 0, COSH_TOLERANCE, 0}, +{ 341, 3213786001u, 1174874204u, 3208263730u, 2360372288u, 1072693364u, 650293763u, 0, COSH_TOLERANCE, 0}, +{ 342, 1081834580u, 937573440u, 3208953761u, 211240241u, 1736830458u, 1339532059u, 0, COSH_TOLERANCE, 0}, +{ 343, 3226771718u, 2469774991u, 1043117070u, 3380071805u, 1196458784u, 2866315288u, 0, COSH_TOLERANCE, 0}, +{ 344, 1069655378u, 442507560u, 3254252803u, 3257889649u, 1072703227u, 3214474808u, 0, COSH_TOLERANCE, 0}, +{ 345, 1071996248u, 1854921625u, 1049810168u, 2729627545u, 1072935760u, 506924846u, 0, COSH_TOLERANCE, 0}, +{ 346, 3229546805u, 4001809575u, 3240128649u, 278261523u, 1821325618u, 2670070781u, 0, COSH_TOLERANCE, 0}, +{ 347, 1077787510u, 1793907966u, 3238955714u, 398859249u, 1116585698u, 3075914843u, 0, COSH_TOLERANCE, 0}, +{ 348, 3216681187u, 2511916952u, 3219195283u, 1697158299u, 1072698939u, 287923426u, 0, COSH_TOLERANCE, 0}, +{ 349, 1073131276u, 3230931724u, 3243897690u, 3508781585u, 1073838825u, 19759326u, 0, COSH_TOLERANCE, 0}, +{ 350, 1081827510u, 1674254897u, 1046547577u, 217148561u, 1734293969u, 3735031445u, 0, COSH_TOLERANCE, 0}, +{ 351, 3218603986u, 3275604304u, 3194840159u, 2991205850u, 1072767839u, 3088730970u, 0, COSH_TOLERANCE, 0}, +{ 352, 3214123743u, 3509997278u, 3248888030u, 3897986511u, 1072693440u, 3421485015u, 0, COSH_TOLERANCE, 0}, +{ 353, 1067105379u, 2156824613u, 1042295665u, 1239257646u, 1072693605u, 1822348699u, 0, COSH_TOLERANCE, 0}, +{ 354, 3219555541u, 1073153314u, 3250031627u, 2567234990u, 1072963776u, 815746145u, 0, COSH_TOLERANCE, 0}, +{ 355, 3213662084u, 4261696995u, 3197784432u, 323702024u, 1072693350u, 809860393u, 0, COSH_TOLERANCE, 0}, +{ 356, 3226913781u, 4075177615u, 3202791065u, 1919006082u, 1209499947u, 316750843u, 0, COSH_TOLERANCE, 0}, +{ 357, 3225638525u, 386429966u, 1086504491u, 3698826164u, 1130089950u, 2126562020u, 0, COSH_TOLERANCE, 0}, +{ 358, 1075181462u, 1681986446u, 3194985869u, 3072950140u, 1079924277u, 2975252779u, 0, COSH_TOLERANCE, 0}, +{ 359, 3220457661u, 3719038997u, 1055433962u, 3331415058u, 1073654972u, 2206416840u, 0, COSH_TOLERANCE, 0}, +{ 360, 1070186897u, 2420250111u, 3238002206u, 1928661079u, 1072714547u, 3530074895u, 0, COSH_TOLERANCE, 0}, +{ 361, 1075622754u, 3679866727u, 3227386672u, 1273835792u, 1082419812u, 3179745956u, 0, COSH_TOLERANCE, 0}, +{ 362, 1065739986u, 2682092368u, 3234222284u, 1325425811u, 1072693307u, 4126875442u, 0, COSH_TOLERANCE, 0}, +{ 363, 1068895525u, 4175172697u, 3208346191u, 2130706153u, 1072697140u, 2173065822u, 0, COSH_TOLERANCE, 0}, +{ 364, 1078458136u, 1200784450u, 1083605096u, 1248595607u, 1144110494u, 3624009342u, 0, COSH_TOLERANCE, 0}, +{ 365, 3219133743u, 1897285171u, 3251296075u, 944966123u, 1072828490u, 2338958613u, 0, COSH_TOLERANCE, 0}, +{ 366, 3225642610u, 2270747330u, 3230692631u, 422503284u, 1130331904u, 3544140092u, 0, COSH_TOLERANCE, 0}, +{ 367, 1076780005u, 2857564741u, 1075647403u, 3308906709u, 1094572049u, 3220041115u, 0, COSH_TOLERANCE, 0}, +{ 368, 3216058010u, 1380066948u, 3232612906u, 2613634294u, 1072695602u, 333718361u, 0, COSH_TOLERANCE, 0}, +{ 369, 1071230888u, 4022784584u, 1060483857u, 3264056381u, 1072778839u, 2084074650u, 0, COSH_TOLERANCE, 0}, +{ 370, 1066657500u, 1778509100u, 3213146285u, 2665833973u, 1072693446u, 202166455u, 0, COSH_TOLERANCE, 0}, +{ 371, 3219873028u, 1859175955u, 1079949560u, 4258450607u, 1073100545u, 4011898678u, 0, COSH_TOLERANCE, 0}, +{ 372, 1067151756u, 4128020197u, 1076266146u, 4122840980u, 1072693624u, 2563901245u, 0, COSH_TOLERANCE, 0}, +{ 373, 3214154683u, 2454653987u, 3229487005u, 2977478685u, 1072693450u, 768721227u, 0, COSH_TOLERANCE, 0}, +{ 374, 3229439235u, 1355181872u, 1095308770u, 436846481u, 1781587330u, 3622868306u, 0, COSH_TOLERANCE, 0}, +{ 375, 3227730934u, 2592856453u, 3247825559u, 3195234082u, 1304719890u, 3199167818u, 0, COSH_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 1077168356u, 697453788u, 0, COSH_TOLERANCE, 0}, +{ 377, 1072158561u, 1936670355u, 1095715713u, 2958468553u, 1072997987u, 174155697u, 0, COSH_TOLERANCE, 0}, +{ 378, 3214311205u, 2960339502u, 1098808013u, 1044068983u, 1072693501u, 258697260u, 0, COSH_TOLERANCE, 0}, +{ 379, 3215565553u, 4093388677u, 1095478112u, 1735930261u, 1072694562u, 3158378439u, 0, COSH_TOLERANCE, 0}, +{ 380, 1078457390u, 1807398746u, 3195743135u, 4261616162u, 1144084329u, 2733988366u, 0, COSH_TOLERANCE, 0}, +{ 381, 3218731378u, 3250576797u, 1059002384u, 3043079652u, 1072780584u, 935135545u, 0, COSH_TOLERANCE, 0}, +{ 382, 1072352837u, 666051428u, 3208765404u, 1912684117u, 1073083167u, 7373407u, 0, COSH_TOLERANCE, 0}, +{ 383, 1081467324u, 1949030179u, 1096388934u, 896459246u, 1601250663u, 4124280137u, 0, COSH_TOLERANCE, 0}, +{ 384, 1068980717u, 622499767u, 1066707637u, 1490260486u, 1072697613u, 1210054685u, 0, COSH_TOLERANCE, 0}, +{ 385, 1081522669u, 1490616165u, 3251242436u, 795675736u, 1621632025u, 1772451300u, 0, COSH_TOLERANCE, 0}, +{ 386, 1075701016u, 3662877092u, 3234317146u, 3200513112u, 1082885283u, 3445827098u, 0, COSH_TOLERANCE, 0}, +{ 387, 1076748754u, 1356101968u, 3236536816u, 3062844611u, 1094157143u, 1389520040u, 0, COSH_TOLERANCE, 0}, +{ 388, 3220971216u, 2284484846u, 3219498359u, 3240896015u, 1074258386u, 2487677987u, 0, COSH_TOLERANCE, 0}, +{ 389, 3225273929u, 494503287u, 1092811254u, 142673998u, 1116669881u, 3833198838u, 0, COSH_TOLERANCE, 0}, +{ 390, 3229057244u, 3394882641u, 3225306538u, 364852125u, 1640439514u, 3261908140u, 0, COSH_TOLERANCE, 0}, +{ 391, 3222116035u, 193885269u, 1088149839u, 1359805831u, 1077163329u, 456192792u, 0, COSH_TOLERANCE, 0}, +{ 392, 3216213422u, 592580907u, 3199560872u, 3086438952u, 1072696298u, 1737542508u, 0, COSH_TOLERANCE, 0}, +{ 393, 1070004424u, 1778008540u, 1049064687u, 73581647u, 1072710179u, 3864358441u, 0, COSH_TOLERANCE, 0}, +{ 394, 3227859230u, 233240285u, 1081923320u, 2710903921u, 1328471353u, 481819950u, 0, COSH_TOLERANCE, 0}, +{ 395, 1072659495u, 3719878805u, 1079866720u, 3615458228u, 1073243085u, 1076099764u, 0, COSH_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 1074610804u, 1304629615u, 0, COSH_TOLERANCE, 0}, +{ 397, 1081381000u, 2232210456u, 3235434773u, 224271737u, 1569318353u, 1467736445u, 0, COSH_TOLERANCE, 0}, +{ 398, 3213975204u, 2134662911u, 3190390590u, 4239009051u, 1072693398u, 3679984553u, 0, COSH_TOLERANCE, 0}, +{ 399, 1075283265u, 2305279897u, 1077668039u, 1854523320u, 1080450496u, 3286724522u, 0, COSH_TOLERANCE, 0}, +{ 400, 3220912835u, 538224650u, 3206153057u, 1379649610u, 1074178663u, 1101193676u, 0, COSH_TOLERANCE, 0}, +{ 401, 3215284875u, 3683897920u, 3244167599u, 3647579469u, 1072694160u, 399053723u, 0, COSH_TOLERANCE, 0}, +{ 402, 1077698021u, 2694093608u, 1042775347u, 598406111u, 1114529526u, 2696598259u, 0, COSH_TOLERANCE, 0}, +{ 403, 3218975424u, 872706833u, 1084802480u, 2200602798u, 1072807936u, 2094320399u, 0, COSH_TOLERANCE, 0}, +{ 404, 1065408269u, 904146293u, 1060867322u, 1729685598u, 1072693283u, 1926681760u, 0, COSH_TOLERANCE, 0}, +{ 405, 3214569338u, 1894173462u, 3232800651u, 191960416u, 1072693597u, 1873608164u, 0, COSH_TOLERANCE, 0}, +{ 406, 1078642431u, 3521028551u, 1054522089u, 3287274359u, 1152594773u, 3672113002u, 0, COSH_TOLERANCE, 0}, +{ 407, 1079658324u, 959640601u, 3201578263u, 4136915018u, 1230574401u, 2234964481u, 0, COSH_TOLERANCE, 0}, +{ 408, 1071345483u, 1553716379u, 1106027987u, 984725765u, 1072791073u, 2060156860u, 0, COSH_TOLERANCE, 0}, +{ 409, 3226249729u, 2287646644u, 3240329321u, 2276183378u, 1158291111u, 3692605402u, 0, COSH_TOLERANCE, 0}, +{ 410, 1072403478u, 3940225170u, 3199544434u, 997572161u, 1073107368u, 2791800044u, 0, COSH_TOLERANCE, 0}, +{ 411, 3219059817u, 36116288u, 3206886566u, 4196602670u, 1072818306u, 2941799181u, 0, COSH_TOLERANCE, 0}, +{ 412, 3225967213u, 3550227562u, 3207257983u, 2747744117u, 1145259564u, 206811308u, 0, COSH_TOLERANCE, 0}, +{ 413, 1081167454u, 507130047u, 1048359321u, 3229888373u, 1490439745u, 2514231187u, 0, COSH_TOLERANCE, 0}, +{ 414, 3221948202u, 2210969014u, 1081031001u, 1946786091u, 1076714590u, 2720043926u, 0, COSH_TOLERANCE, 0}, +{ 415, 3224772654u, 4059150589u, 3189759234u, 1177045799u, 1105086888u, 932381590u, 0, COSH_TOLERANCE, 0}, +{ 416, 1078423548u, 2664812822u, 1050343198u, 2034180320u, 1142469137u, 3731467255u, 0, COSH_TOLERANCE, 0}, +{ 417, 3220070573u, 1175750283u, 3235559706u, 1424491340u, 1073202287u, 696435719u, 0, COSH_TOLERANCE, 0}, +{ 418, 3219147073u, 1630036121u, 3231972785u, 3195479448u, 1072832007u, 59437127u, 0, COSH_TOLERANCE, 0}, +{ 419, 1077846963u, 2527029044u, 1046927050u, 4000723255u, 1117940775u, 3673409802u, 0, COSH_TOLERANCE, 0}, +{ 420, 1076820069u, 3335703647u, 3237349676u, 3869440059u, 1094992333u, 786911050u, 0, COSH_TOLERANCE, 0}, +{ 421, 1078850936u, 3888398377u, 3196041693u, 1290567220u, 1162199139u, 1366973945u, 0, COSH_TOLERANCE, 0}, +{ 422, 1071921950u, 3242451480u, 3248384948u, 707431021u, 1072909878u, 2311264482u, 0, COSH_TOLERANCE, 0}, +{ 423, 1075890477u, 2739665123u, 1060777905u, 1733073225u, 1084309432u, 2275080127u, 0, COSH_TOLERANCE, 0}, +{ 424, 1075371333u, 1297274853u, 3208848704u, 3341639139u, 1081035738u, 1933977641u, 0, COSH_TOLERANCE, 0}, +{ 425, 1066493885u, 2228057309u, 1084318902u, 1317851136u, 1072693399u, 2039076730u, 0, COSH_TOLERANCE, 0}, +{ 426, 1077769567u, 270039934u, 3241414679u, 3063626339u, 1116118793u, 251426608u, 0, COSH_TOLERANCE, 0}, +{ 427, 3220226926u, 83062251u, 3211262173u, 2659016437u, 1073323369u, 97426660u, 0, COSH_TOLERANCE, 0}, +{ 428, 1080015246u, 3833539373u, 3206667189u, 1567476111u, 1263591609u, 3066665016u, 0, COSH_TOLERANCE, 0}, +{ 429, 3217777984u, 2382776852u, 3249232579u, 1546622468u, 1072717356u, 1187260252u, 0, COSH_TOLERANCE, 0}, +{ 430, 1076099255u, 1714300821u, 1104130938u, 4167591598u, 1086665941u, 3409246207u, 0, COSH_TOLERANCE, 0}, +{ 431, 1067869976u, 2798720100u, 1086978789u, 449990704u, 1072694251u, 3968003626u, 0, COSH_TOLERANCE, 0}, +{ 432, 3223858383u, 4039516226u, 3244344107u, 4272932619u, 1089843021u, 3071656581u, 0, COSH_TOLERANCE, 0}, +{ 433, 3221659865u, 1683007544u, 1091105663u, 3805494321u, 1075903190u, 1030888557u, 0, COSH_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 1074101667u, 3593583933u, 0, COSH_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 1073796246u, 3485288401u, 0, COSH_TOLERANCE, 0}, +{ 436, 1078985629u, 559918757u, 3205077053u, 908100198u, 1168462131u, 348797896u, 0, COSH_TOLERANCE, 0}, +{ 437, 1065746590u, 2026673913u, 3244833635u, 2844573214u, 1072693308u, 2207107495u, 0, COSH_TOLERANCE, 0}, +{ 438, 3229401435u, 3946837259u, 3234993796u, 3850406820u, 1767580525u, 957246048u, 0, COSH_TOLERANCE, 0}, +{ 439, 1070062721u, 3139330994u, 1046133568u, 1539650690u, 1072711520u, 2060768029u, 0, COSH_TOLERANCE, 0}, +{ 440, 3225171164u, 1554593884u, 3228899878u, 2813752562u, 1114234730u, 1205533002u, 0, COSH_TOLERANCE, 0}, +{ 441, 1069087916u, 3804703138u, 1072931071u, 2053677923u, 1072698246u, 3320923600u, 0, COSH_TOLERANCE, 0}, +{ 442, 3227038507u, 289355864u, 1078453818u, 2143066338u, 1221015905u, 3978063874u, 0, COSH_TOLERANCE, 0}, +{ 443, 3216522792u, 2157691971u, 1106629150u, 110806409u, 1072697953u, 960655341u, 0, COSH_TOLERANCE, 0}, +{ 444, 1075865563u, 3570399481u, 1085637605u, 180265334u, 1083999917u, 1645379652u, 0, COSH_TOLERANCE, 0}, +{ 445, 3216708822u, 558779875u, 3202046748u, 2338464653u, 1072699120u, 2955459390u, 0, COSH_TOLERANCE, 0}, +{ 446, 1066676984u, 1703969219u, 3229797258u, 1417521063u, 1072693452u, 36466462u, 0, COSH_TOLERANCE, 0}, +{ 447, 3225199349u, 3917440951u, 1051668894u, 3736066983u, 1114891095u, 1562528722u, 0, COSH_TOLERANCE, 0}, +{ 448, 1071043536u, 3106613409u, 1066627453u, 2735392257u, 1072760657u, 2979979981u, 0, COSH_TOLERANCE, 0}, +{ 449, 1071956828u, 2229777605u, 1065061963u, 2405869925u, 1072921828u, 2085659379u, 0, COSH_TOLERANCE, 0}, +{ 450, 3225831741u, 3967957902u, 1057416138u, 3459188071u, 1138999578u, 515773066u, 0, COSH_TOLERANCE, 0}, +{ 451, 1071784938u, 3699016825u, 3249713090u, 796144848u, 1072866292u, 3094171396u, 0, COSH_TOLERANCE, 0}, +{ 452, 3222524940u, 3285165564u, 3211948811u, 401510871u, 1079100907u, 4162441846u, 0, COSH_TOLERANCE, 0}, +{ 453, 1078529018u, 634857910u, 3199607513u, 914218057u, 1147357727u, 2060143941u, 0, COSH_TOLERANCE, 0}, +{ 454, 1076403304u, 2030735578u, 3233855943u, 965677531u, 1090189121u, 3806649244u, 0, COSH_TOLERANCE, 0}, +{ 455, 1075362511u, 3957229084u, 1051050470u, 3123776651u, 1080967868u, 916230154u, 0, COSH_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 1076427741u, 411926356u, 0, COSH_TOLERANCE, 0}, +{ 457, 3224688874u, 869031839u, 3225020876u, 1344301606u, 1103158924u, 668835625u, 0, COSH_TOLERANCE, 0}, +{ 458, 3219676354u, 946696117u, 3231825228u, 1700703647u, 1073012096u, 2213580531u, 0, COSH_TOLERANCE, 0}, +{ 459, 1074444299u, 3394168074u, 1076939786u, 1666995668u, 1076641844u, 156593023u, 0, COSH_TOLERANCE, 0}, +{ 460, 3218211979u, 2488789804u, 3238508333u, 1506943664u, 1072735077u, 153972805u, 0, COSH_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1073381700u, 2049645902u, 0, COSH_TOLERANCE, 0}, +{ 462, 3220983118u, 1244307192u, 3191297711u, 2540916692u, 1074275226u, 1512921118u, 0, COSH_TOLERANCE, 0}, +{ 463, 3215791332u, 2871645739u, 3239081581u, 1440249115u, 1072694939u, 4017423074u, 0, COSH_TOLERANCE, 0}, +{ 464, 1072544937u, 1231934926u, 3236746788u, 603977748u, 1073179537u, 210999427u, 0, COSH_TOLERANCE, 0}, +{ 465, 3214324057u, 2386312545u, 1063169277u, 2715234268u, 1072693505u, 2110999964u, 0, COSH_TOLERANCE, 0}, +{ 466, 1077317658u, 915867083u, 1046790892u, 3347417612u, 1105687206u, 2072797994u, 0, COSH_TOLERANCE, 0}, +{ 467, 1081866940u, 3553288373u, 1065698616u, 2906680663u, 1748821447u, 2025279999u, 0, COSH_TOLERANCE, 0}, +{ 468, 1066477746u, 2342364630u, 1051356723u, 4019093203u, 1072693395u, 939076334u, 0, COSH_TOLERANCE, 0}, +{ 469, 3216897802u, 2911548084u, 1105282515u, 2476735795u, 1072700439u, 1795805145u, 0, COSH_TOLERANCE, 0}, +{ 470, 1068298564u, 1836216409u, 1101062307u, 2519592554u, 1072694923u, 3337330369u, 0, COSH_TOLERANCE, 0}, +{ 471, 1073323889u, 1235369496u, 3222946447u, 668087854u, 1074046359u, 2670613655u, 0, COSH_TOLERANCE, 0}, +{ 472, 3217991780u, 2981820811u, 1059838516u, 2845580478u, 1072723468u, 3674700934u, 0, COSH_TOLERANCE, 0}, +{ 473, 3214902934u, 1565550570u, 3217165795u, 4162017137u, 1072693744u, 4188183367u, 0, COSH_TOLERANCE, 0}, +{ 474, 3224668466u, 2808968027u, 1055630096u, 1782326814u, 1102624261u, 4229492206u, 0, COSH_TOLERANCE, 0}, +{ 475, 1069305614u, 1492622658u, 3216653077u, 3972512122u, 1072699665u, 2777581694u, 0, COSH_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 1077311445u, 16711136u, 0, COSH_TOLERANCE, 0}, +{ 477, 3221052359u, 899763203u, 3207606001u, 2804747833u, 1074377307u, 3651199518u, 0, COSH_TOLERANCE, 0}, +{ 478, 3223330293u, 3789058912u, 3228095081u, 4135937628u, 1083748658u, 1647653733u, 0, COSH_TOLERANCE, 0}, +{ 479, 1069636566u, 1682808307u, 3206960335u, 232877759u, 1072702905u, 922243855u, 0, COSH_TOLERANCE, 0}, +{ 480, 3226362846u, 2851963139u, 3246852961u, 2590862592u, 1163510742u, 2280263532u, 0, COSH_TOLERANCE, 0}, +{ 481, 1074908950u, 2422232642u, 3234779662u, 290458310u, 1078293793u, 402749758u, 0, COSH_TOLERANCE, 0}, +{ 482, 3219059686u, 1082582386u, 1075605675u, 2602133689u, 1072818290u, 1078745978u, 0, COSH_TOLERANCE, 0}, +{ 483, 3226187123u, 1789635787u, 1059414278u, 1048286093u, 1155460262u, 3672708776u, 0, COSH_TOLERANCE, 0}, +{ 484, 1079456174u, 231339448u, 1055573265u, 504907415u, 1211943927u, 57355760u, 0, COSH_TOLERANCE, 0}, +{ 485, 1071600069u, 1153251200u, 3204617090u, 1772013857u, 1072821329u, 3016594082u, 0, COSH_TOLERANCE, 0}, +{ 486, 1080676687u, 1082898276u, 3212089272u, 1449080862u, 1384085102u, 3383991944u, 0, COSH_TOLERANCE, 0}, +{ 487, 1076571101u, 3177299045u, 1058862813u, 809400815u, 1092108370u, 1324460299u, 0, COSH_TOLERANCE, 0}, +{ 488, 3223514518u, 1924429710u, 1056464743u, 3349283177u, 1085877225u, 3373580267u, 0, COSH_TOLERANCE, 0}, +{ 489, 3226599023u, 42238036u, 1042379500u, 2113559863u, 1180474780u, 3625179367u, 0, COSH_TOLERANCE, 0}, +{ 490, 1071052699u, 3304403230u, 3217556703u, 58952646u, 1072761494u, 3681600331u, 0, COSH_TOLERANCE, 0}, +{ 491, 3218960986u, 1645486982u, 3224301095u, 3636267471u, 1072806209u, 2824736299u, 0, COSH_TOLERANCE, 0}, +{ 492, 1071150617u, 619402181u, 3235208235u, 557360557u, 1072770774u, 2233898320u, 0, COSH_TOLERANCE, 0}, +{ 493, 3225655482u, 110029735u, 1046937383u, 984375729u, 1130844976u, 58252944u, 0, COSH_TOLERANCE, 0}, +{ 494, 3213613986u, 4063688092u, 3203235744u, 1049950343u, 1072693345u, 41676873u, 0, COSH_TOLERANCE, 0}, +{ 495, 1070739227u, 650996069u, 1054971928u, 3953359826u, 1072735857u, 3162766617u, 0, COSH_TOLERANCE, 0}, +{ 496, 3222861501u, 66926332u, 1090561839u, 1379780888u, 1081084622u, 865857900u, 0, COSH_TOLERANCE, 0}, +{ 497, 3224016123u, 2803378256u, 1086057989u, 498534626u, 1091702709u, 731355363u, 0, COSH_TOLERANCE, 0}, +{ 498, 1076327097u, 2846400785u, 1047142525u, 1375153550u, 1089349462u, 3404991026u, 0, COSH_TOLERANCE, 0}, +{ 499, 1066601297u, 2869128958u, 1070972315u, 4246440273u, 1072693429u, 1487293915u, 0, COSH_TOLERANCE, 0}, +{ 500, 1067561146u, 3112381207u, 1044430965u, 3981604561u, 1072693873u, 4119638393u, 0, COSH_TOLERANCE, 0}, +{ 501, 3223914965u, 243303420u, 1093735824u, 1575581926u, 1090564624u, 2235997569u, 0, COSH_TOLERANCE, 0}, +{ 502, 3225506509u, 3218865041u, 3204803496u, 3840388050u, 1124051660u, 1649385448u, 0, COSH_TOLERANCE, 0}, +{ 503, 1067289799u, 336846959u, 1052664471u, 3798336786u, 1072693684u, 2701401211u, 0, COSH_TOLERANCE, 0}, +{ 504, 1068537148u, 3639240976u, 1081202165u, 1844741676u, 1072695448u, 3117267659u, 0, COSH_TOLERANCE, 0}, +{ 505, 3218196249u, 717293069u, 3211534283u, 582401011u, 1072733962u, 3794010205u, 0, COSH_TOLERANCE, 0}, +{ 506, 3228893840u, 3766248610u, 3196520332u, 1174437546u, 1580170719u, 1400243038u, 0, COSH_TOLERANCE, 0}, +{ 507, 1076091194u, 756959182u, 3204099341u, 1581804034u, 1086583042u, 1991670922u, 0, COSH_TOLERANCE, 0}, +{ 508, 3217340780u, 3560686300u, 3220980617u, 4277975772u, 1072707021u, 4141250989u, 0, COSH_TOLERANCE, 0}, +{ 509, 3218294684u, 2598148853u, 3217622194u, 3460421008u, 1072741187u, 2314974653u, 0, COSH_TOLERANCE, 0}, +{ 510, 1071963704u, 136600515u, 3209934920u, 3340653128u, 1072924225u, 3332847417u, 0, COSH_TOLERANCE, 0}, +{ 511, 1078994518u, 1045480938u, 3251354609u, 4133432965u, 1169315390u, 1471292306u, 0, COSH_TOLERANCE, 0}, +{ 512, 1077967943u, 1630207738u, 3239996829u, 2393354808u, 1121432564u, 2643918337u, 0, COSH_TOLERANCE, 0}, +{ 513, 3213694690u, 3739770117u, 1059520750u, 3959551225u, 1072693353u, 3332559954u, 0, COSH_TOLERANCE, 0}, +{ 514, 3223390473u, 1498861716u, 1091297147u, 847410798u, 1084459592u, 850649703u, 0, COSH_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1074299949u, 1095073224u, 0, COSH_TOLERANCE, 0}, +{ 516, 1069529329u, 2353103845u, 3235718771u, 2978889966u, 1072701308u, 3479226514u, 0, COSH_TOLERANCE, 0}, +{ 517, 3229337896u, 1546972125u, 3249076079u, 1987349196u, 1744100073u, 982927834u, 0, COSH_TOLERANCE, 0}, +{ 518, 3225636601u, 2769161072u, 1075207126u, 292616282u, 1129986069u, 2356402899u, 0, COSH_TOLERANCE, 0}, +{ 519, 3215440938u, 36855311u, 1052128202u, 1479039342u, 1072694374u, 3881612387u, 0, COSH_TOLERANCE, 0}, +{ 520, 1076417021u, 2027463605u, 1066023013u, 3369686340u, 1090384091u, 1056865571u, 0, COSH_TOLERANCE, 0}, +{ 521, 3215678541u, 3808681655u, 1054161346u, 1821773119u, 1072694745u, 2393129015u, 0, COSH_TOLERANCE, 0}, +{ 522, 1065851752u, 3175490326u, 3226879970u, 845687760u, 1072693317u, 2845297936u, 0, COSH_TOLERANCE, 0}, +{ 523, 1065371665u, 3124482451u, 3242748377u, 3259417226u, 1072693281u, 584816684u, 0, COSH_TOLERANCE, 0}, +{ 524, 1067265791u, 2751606436u, 3236210939u, 3923142740u, 1072693673u, 3735488274u, 0, COSH_TOLERANCE, 0}, +{ 525, 1079966097u, 2016872044u, 3228408064u, 4201274408u, 1259005133u, 2351383485u, 0, COSH_TOLERANCE, 0}, +{ 526, 3215077894u, 1019916843u, 3219974785u, 1977881787u, 1072693910u, 925185854u, 0, COSH_TOLERANCE, 0}, +{ 527, 3215207392u, 2060433318u, 1075872515u, 366073725u, 1072694061u, 3760406008u, 0, COSH_TOLERANCE, 0}, +{ 528, 3213200653u, 1098469906u, 1082900695u, 2349346832u, 1072693306u, 241149696u, 0, COSH_TOLERANCE, 0}, +{ 529, 3218363315u, 3011196295u, 3252479932u, 2459281672u, 1072746581u, 3475756260u, 0, COSH_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 1074948209u, 2454086122u, 0, COSH_TOLERANCE, 0}, +{ 531, 1080766178u, 914741728u, 3203468059u, 2833809843u, 1400546649u, 1543027566u, 0, COSH_TOLERANCE, 0}, +{ 532, 3225229542u, 1274901962u, 3241535845u, 3759113509u, 1115653811u, 3663915975u, 0, COSH_TOLERANCE, 0}, +{ 533, 3227042074u, 2134927252u, 3253802671u, 3013731444u, 1221386155u, 696872014u, 0, COSH_TOLERANCE, 0}, +{ 534, 1080326973u, 2230655177u, 3254510616u, 1249674366u, 1319431604u, 3545707614u, 0, COSH_TOLERANCE, 0}, +{ 535, 1071359861u, 717357389u, 1083533731u, 3746683362u, 1072792668u, 2873103559u, 0, COSH_TOLERANCE, 0}, +{ 536, 3220064570u, 834976849u, 3217357661u, 2465861779u, 1073198996u, 2186293239u, 0, COSH_TOLERANCE, 0}, +{ 537, 1066627637u, 1385714428u, 1053358395u, 3007113740u, 1072693437u, 350440274u, 0, COSH_TOLERANCE, 0}, +{ 538, 1068353711u, 599268545u, 3201368210u, 2309854744u, 1072695022u, 2853715097u, 0, COSH_TOLERANCE, 0}, +{ 539, 1073100182u, 2840234388u, 3232496515u, 333365983u, 1073809120u, 943021507u, 0, COSH_TOLERANCE, 0}, +{ 540, 1066894301u, 3136078996u, 3194520860u, 2650572904u, 1072693524u, 2113824954u, 0, COSH_TOLERANCE, 0}, +{ 541, 3224250507u, 2405805086u, 3251640319u, 324233833u, 1094385400u, 243647767u, 0, COSH_TOLERANCE, 0}, +{ 542, 1081533322u, 2589598340u, 3254677807u, 952438812u, 1625576728u, 2555502454u, 0, COSH_TOLERANCE, 0}, +{ 543, 3213232021u, 1922837702u, 3216892718u, 3535907549u, 1072693308u, 2850257966u, 0, COSH_TOLERANCE, 0}, +{ 544, 3226838652u, 261447440u, 3209805849u, 1150571079u, 1202630263u, 3739940447u, 0, COSH_TOLERANCE, 0}, +{ 545, 1079028016u, 4026487528u, 1073152064u, 27340691u, 1172419967u, 273403284u, 0, COSH_TOLERANCE, 0}, +{ 546, 3222832236u, 338765118u, 1086225786u, 3207238249u, 1080865281u, 1988978339u, 0, COSH_TOLERANCE, 0}, +{ 547, 3215057071u, 1085283176u, 3187775111u, 1601194210u, 1072693887u, 1234434999u, 0, COSH_TOLERANCE, 0}, +{ 548, 1078937261u, 3031712790u, 3252307859u, 170666844u, 1166209488u, 3602398320u, 0, COSH_TOLERANCE, 0}, +{ 549, 3220959383u, 3148395674u, 1041913758u, 3306391490u, 1074241844u, 1170600793u, 0, COSH_TOLERANCE, 0}, +{ 550, 3217005710u, 2205233857u, 3208100078u, 3993195511u, 1072701252u, 2077853917u, 0, COSH_TOLERANCE, 0}, +{ 551, 1071893912u, 4282766727u, 1072820377u, 1874778218u, 1072900526u, 122630446u, 0, COSH_TOLERANCE, 0}, +{ 552, 3218173124u, 2920860798u, 3218070226u, 3104066154u, 1072732352u, 3593381418u, 0, COSH_TOLERANCE, 0}, +{ 553, 3217533263u, 969991373u, 3250596895u, 1734386152u, 1072711214u, 2580159905u, 0, COSH_TOLERANCE, 0}, +{ 554, 3226332906u, 1218740205u, 3239802737u, 2610078504u, 1162127953u, 443854413u, 0, COSH_TOLERANCE, 0}, +{ 555, 3217565578u, 1485218325u, 3220870240u, 3591664613u, 1072711973u, 2041209195u, 0, COSH_TOLERANCE, 0}, +{ 556, 3216754207u, 690157417u, 3190850619u, 4192347699u, 1072699425u, 761927835u, 0, COSH_TOLERANCE, 0}, +{ 557, 1079276594u, 4009839784u, 1079670252u, 394167192u, 1195402369u, 2525536651u, 0, COSH_TOLERANCE, 0}, +{ 558, 3225122053u, 961532417u, 1092588071u, 2923790239u, 1113093443u, 609779704u, 0, COSH_TOLERANCE, 0}, +{ 559, 3216462003u, 4174125604u, 1050682630u, 2169701868u, 1072697599u, 3489469939u, 0, COSH_TOLERANCE, 0}, +{ 560, 3227363835u, 4146748230u, 1087373950u, 2481478351u, 1251094158u, 2672248790u, 0, COSH_TOLERANCE, 0}, +{ 561, 1073842138u, 3984715440u, 1050421618u, 2446142566u, 1074929194u, 4289031035u, 0, COSH_TOLERANCE, 0}, +{ 562, 1076832374u, 936290150u, 1100614426u, 3625806370u, 1095122996u, 79506389u, 0, COSH_TOLERANCE, 0}, +{ 563, 1080913584u, 1866615265u, 3215651428u, 2337013350u, 1427761572u, 2464900529u, 0, COSH_TOLERANCE, 0}, +{ 564, 3229081054u, 712227971u, 1106004723u, 973148499u, 1649293146u, 2977854696u, 0, COSH_TOLERANCE, 0}, +{ 565, 3223796743u, 3409813738u, 3244817008u, 1933503498u, 1089149243u, 2552950095u, 0, COSH_TOLERANCE, 0}, +{ 566, 1075749429u, 3180389060u, 3228735703u, 83422217u, 1083215044u, 462445497u, 0, COSH_TOLERANCE, 0}, +{ 567, 1074732996u, 556972671u, 3204582372u, 841555801u, 1077443176u, 1826489999u, 0, COSH_TOLERANCE, 0}, +{ 568, 1072864873u, 4189151332u, 1080874032u, 706326922u, 1073487027u, 3634656193u, 0, COSH_TOLERANCE, 0}, +{ 569, 1079374091u, 198291836u, 1057281892u, 2188836928u, 1204328207u, 2535783908u, 0, COSH_TOLERANCE, 0}, +{ 570, 1074946267u, 1219449298u, 3228734687u, 3504562743u, 1078508868u, 3068106638u, 0, COSH_TOLERANCE, 0}, +{ 571, 3217153376u, 1776099219u, 1094316777u, 4188083896u, 1072703477u, 1585085350u, 0, COSH_TOLERANCE, 0}, +{ 572, 3214817228u, 2614400266u, 1073750227u, 3003203347u, 1072693704u, 2559210418u, 0, COSH_TOLERANCE, 0}, +{ 573, 3219225558u, 2959351406u, 1105603716u, 311851587u, 1072853689u, 712516923u, 0, COSH_TOLERANCE, 0}, +{ 574, 1076155826u, 865443613u, 1097532516u, 3622237781u, 1087394673u, 3547871343u, 0, COSH_TOLERANCE, 0}, +{ 575, 3223398058u, 447506102u, 3195759295u, 3603669725u, 1084535881u, 3942095505u, 0, COSH_TOLERANCE, 0}, +{ 576, 1079015805u, 3934398273u, 1040996422u, 2968621268u, 1171312413u, 1233059955u, 0, COSH_TOLERANCE, 0}, +{ 577, 3215614193u, 784208771u, 1088764788u, 2182296421u, 1072694639u, 4197891501u, 0, COSH_TOLERANCE, 0}, +{ 578, 3228409347u, 1527590526u, 3206961556u, 2823164069u, 1430023448u, 2977499390u, 0, COSH_TOLERANCE, 0}, +{ 579, 3225109795u, 3876699591u, 3207481130u, 4028148535u, 1112820018u, 4290703953u, 0, COSH_TOLERANCE, 0}, +{ 580, 1076236154u, 2164249756u, 1059857743u, 1785169952u, 1088299515u, 3030929114u, 0, COSH_TOLERANCE, 0}, +{ 581, 1078172521u, 2079273665u, 1080303860u, 625760474u, 1130877384u, 2820657748u, 0, COSH_TOLERANCE, 0}, +{ 582, 3222291804u, 3636214836u, 1068367620u, 2932621925u, 1077753994u, 327873440u, 0, COSH_TOLERANCE, 0}, +{ 583, 1066015468u, 4274131512u, 1047707755u, 92550763u, 1072693333u, 799714962u, 0, COSH_TOLERANCE, 0}, +{ 584, 3215599337u, 2648933384u, 1084603503u, 3534304873u, 1072694616u, 652218503u, 0, COSH_TOLERANCE, 0}, +{ 585, 1070854691u, 3216750767u, 3191088629u, 547482628u, 1072744584u, 2911958539u, 0, COSH_TOLERANCE, 0}, +{ 586, 1070521958u, 1420360746u, 1080063101u, 1690029499u, 1072723888u, 941039659u, 0, COSH_TOLERANCE, 0}, +{ 587, 3223563908u, 1908572179u, 1080112083u, 1228319033u, 1086478448u, 1758442849u, 0, COSH_TOLERANCE, 0}, +{ 588, 1067032546u, 500312015u, 3212368508u, 3864619086u, 1072693576u, 1399130808u, 0, COSH_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 1074951104u, 2361482956u, 0, COSH_TOLERANCE, 0}, +{ 590, 1080518026u, 2382118000u, 1042665328u, 567154882u, 1354785044u, 2043686521u, 0, COSH_TOLERANCE, 0}, +{ 591, 1069547778u, 1435344339u, 3216303171u, 2275988178u, 1072701454u, 3091158837u, 0, COSH_TOLERANCE, 0}, +{ 592, 3219781499u, 3403659753u, 3218043030u, 1926480488u, 1073057838u, 4175444865u, 0, COSH_TOLERANCE, 0}, +{ 593, 1074743231u, 1198845185u, 3225556149u, 1130089684u, 1077474775u, 701774850u, 0, COSH_TOLERANCE, 0}, +{ 594, 3221614466u, 2183928090u, 1048403956u, 963834821u, 1075784139u, 1781731416u, 0, COSH_TOLERANCE, 0}, +{ 595, 1080701440u, 2120625396u, 1041006976u, 2137548527u, 1388588575u, 2814596158u, 0, COSH_TOLERANCE, 0}, +{ 596, 1080355870u, 586700956u, 1059670521u, 303891699u, 1324761751u, 2561465523u, 0, COSH_TOLERANCE, 0}, +{ 597, 3221091650u, 2509132460u, 1102827530u, 2205707903u, 1074438471u, 4293296615u, 0, COSH_TOLERANCE, 0}, +{ 598, 3217443509u, 1229308263u, 3209170414u, 4206576047u, 1072709189u, 3659228835u, 0, COSH_TOLERANCE, 0}, +{ 599, 3221979137u, 4078010749u, 3199236456u, 733478972u, 1076831279u, 1826871371u, 0, COSH_TOLERANCE, 0}, +{ 600, 3215538376u, 4277541051u, 3199806921u, 397102023u, 1072694520u, 2308144239u, 0, COSH_TOLERANCE, 0}, +{ 601, 3214849381u, 900999594u, 3234720188u, 2530214248u, 1072693719u, 2334938475u, 0, COSH_TOLERANCE, 0}, +{ 602, 1074446396u, 4000609478u, 1096577064u, 4148592328u, 1076649246u, 103153889u, 0, COSH_TOLERANCE, 0}, +{ 603, 1067542452u, 2154187873u, 3224392607u, 3957250362u, 1072693853u, 4008151472u, 0, COSH_TOLERANCE, 0}, +{ 604, 3221316336u, 2867079200u, 1101870326u, 921212001u, 1074908512u, 2509700010u, 0, COSH_TOLERANCE, 0}, +{ 605, 3223784706u, 674547716u, 1063216239u, 3929755226u, 1088993407u, 3179222759u, 0, COSH_TOLERANCE, 0}, +{ 606, 3225735787u, 3158182449u, 1043794244u, 3259056345u, 1134618609u, 4149902865u, 0, COSH_TOLERANCE, 0}, +{ 607, 3225242320u, 3002823940u, 1059511739u, 2832435794u, 1115891743u, 2207198717u, 0, COSH_TOLERANCE, 0}, +{ 608, 3220450550u, 2196511929u, 1049973941u, 3672092877u, 1073643386u, 2318601716u, 0, COSH_TOLERANCE, 0}, +{ 609, 1068263848u, 3655292191u, 1086438127u, 3567072906u, 1072694862u, 4213993228u, 0, COSH_TOLERANCE, 0}, +{ 610, 3227458308u, 1617573614u, 3201863123u, 3090723732u, 1259777410u, 3864691446u, 0, COSH_TOLERANCE, 0}, +{ 611, 3223764196u, 679893506u, 3211547753u, 824081024u, 1088758736u, 857579464u, 0, COSH_TOLERANCE, 0}, +{ 612, 1076947613u, 2285242807u, 1084999409u, 2221731406u, 1097150618u, 2093305440u, 0, COSH_TOLERANCE, 0}, +{ 613, 3217219424u, 1935990727u, 1088822246u, 1058156518u, 1072704666u, 953435733u, 0, COSH_TOLERANCE, 0}, +{ 614, 1080819070u, 521023584u, 1059186903u, 4245163857u, 1410372185u, 1987577595u, 0, COSH_TOLERANCE, 0}, +{ 615, 1081871044u, 2312887617u, 3191771354u, 1885370807u, 1750314185u, 485435265u, 0, COSH_TOLERANCE, 0}, +{ 616, 3228836567u, 1796441468u, 1100030327u, 2772711004u, 1558966124u, 2025534396u, 0, COSH_TOLERANCE, 0}, +{ 617, 3216859732u, 2095685003u, 1077984448u, 2100773742u, 1072700162u, 4253902229u, 0, COSH_TOLERANCE, 0}, +{ 618, 3213926140u, 2892538035u, 1042396334u, 4162200338u, 1072693386u, 569374073u, 0, COSH_TOLERANCE, 0}, +{ 619, 3226997111u, 2177698116u, 3227557177u, 150832500u, 1217246100u, 1325856495u, 0, COSH_TOLERANCE, 0}, +{ 620, 3213582312u, 607966734u, 3236250630u, 4164600559u, 1072693341u, 2889359002u, 0, COSH_TOLERANCE, 0}, +{ 621, 3219535540u, 2830122967u, 1046096700u, 3713346883u, 1072956203u, 1374575132u, 0, COSH_TOLERANCE, 0}, +{ 622, 3224615051u, 2314640506u, 3203696416u, 3276228872u, 1101389827u, 2072666780u, 0, COSH_TOLERANCE, 0}, +{ 623, 3219203763u, 469331883u, 3249037349u, 2999233437u, 1072847499u, 1996240604u, 0, COSH_TOLERANCE, 0}, +{ 624, 1079556219u, 560886625u, 1091899487u, 748795120u, 1221147643u, 1766795176u, 0, COSH_TOLERANCE, 0}, +{ 625, 1067712650u, 2958421324u, 1092569414u, 3235243477u, 1072694048u, 1164281115u, 0, COSH_TOLERANCE, 0}, +{ 626, 3213998017u, 3221475559u, 1043038304u, 915608434u, 1072693404u, 4140936154u, 0, COSH_TOLERANCE, 0}, +{ 627, 1073294682u, 3007808652u, 3216682290u, 2531019474u, 1074012135u, 896886954u, 0, COSH_TOLERANCE, 0}, +{ 628, 3226300359u, 1767658578u, 3237045269u, 2313128318u, 1160682881u, 3225971130u, 0, COSH_TOLERANCE, 0}, +{ 629, 3219006500u, 1926845182u, 1066835624u, 1783256828u, 1072811700u, 601434355u, 0, COSH_TOLERANCE, 0}, +{ 630, 1065741453u, 90378038u, 1057168870u, 164358218u, 1072693308u, 358383822u, 0, COSH_TOLERANCE, 0}, +{ 631, 1081693348u, 1610524680u, 1085283851u, 2903496007u, 1684679818u, 520929572u, 0, COSH_TOLERANCE, 0}, +{ 632, 1075489858u, 4274321404u, 3202913591u, 720121831u, 1081645052u, 1137073838u, 0, COSH_TOLERANCE, 0}, +{ 633, 1067982472u, 2034778236u, 1071133763u, 1413236391u, 1072694411u, 2978736869u, 0, COSH_TOLERANCE, 0}, +{ 634, 1067840244u, 1489112261u, 1076691395u, 348210906u, 1072694211u, 2870609134u, 0, COSH_TOLERANCE, 0}, +{ 635, 3217229677u, 2797651324u, 3224410527u, 2374818327u, 1072704856u, 2869857501u, 0, COSH_TOLERANCE, 0}, +{ 636, 1077801496u, 1823161666u, 3197810695u, 3119680047u, 1116891443u, 2045262415u, 0, COSH_TOLERANCE, 0}, +{ 637, 1072218792u, 3420950657u, 1087084743u, 2136638961u, 1073023120u, 888020177u, 0, COSH_TOLERANCE, 0}, +{ 638, 1073047952u, 3554566429u, 1062907717u, 2736702589u, 1073761419u, 2894883977u, 0, COSH_TOLERANCE, 0}, +{ 639, 3227062875u, 2928437580u, 3187765027u, 1393427873u, 1223274893u, 1790477232u, 0, COSH_TOLERANCE, 0}, +{ 640, 3218738745u, 189447067u, 1051643315u, 828663513u, 1072781353u, 367269471u, 0, COSH_TOLERANCE, 0}, +{ 641, 1068042509u, 2852350928u, 1045683757u, 673354280u, 1072694501u, 3387685354u, 0, COSH_TOLERANCE, 0}, +{ 642, 1065966397u, 3589563265u, 3248741629u, 812657927u, 1072693328u, 1586913836u, 0, COSH_TOLERANCE, 0}, +{ 643, 3213679498u, 1766416701u, 1100392103u, 2185373290u, 1072693352u, 415400947u, 0, COSH_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 1073385772u, 4240820449u, 0, COSH_TOLERANCE, 0}, +{ 645, 1075440832u, 1187403069u, 1075300235u, 336640304u, 1081370125u, 3682779662u, 0, COSH_TOLERANCE, 0}, +{ 646, 1081906155u, 1718795752u, 3243118752u, 683369237u, 1763270328u, 2150807698u, 0, COSH_TOLERANCE, 0}, +{ 647, 3218132129u, 1863545307u, 1069449477u, 3418627399u, 1072729579u, 3284902905u, 0, COSH_TOLERANCE, 0}, +{ 648, 1072747022u, 3295607249u, 1068878592u, 1633297809u, 1073328061u, 1666517126u, 0, COSH_TOLERANCE, 0}, +{ 649, 1070481463u, 2585980994u, 3236670483u, 1286750688u, 1072722668u, 848603239u, 0, COSH_TOLERANCE, 0}, +{ 650, 1067128553u, 15816845u, 3233249283u, 2491924775u, 1072693614u, 4044617895u, 0, COSH_TOLERANCE, 0}, +{ 651, 1065481693u, 1051983351u, 1049180786u, 1474421917u, 1072693288u, 1384210764u, 0, COSH_TOLERANCE, 0}, +{ 652, 3216978165u, 2003816032u, 1086050104u, 668090487u, 1072701040u, 3365823522u, 0, COSH_TOLERANCE, 0}, +{ 653, 1068284677u, 3671484625u, 1067020039u, 430024694u, 1072694899u, 1388039659u, 0, COSH_TOLERANCE, 0}, +{ 654, 1072639990u, 3991830201u, 3207808714u, 1021245839u, 1073231933u, 3593074248u, 0, COSH_TOLERANCE, 0}, +{ 655, 1071534423u, 4255801807u, 3207681716u, 1926756877u, 1072813117u, 3996147524u, 0, COSH_TOLERANCE, 0}, +{ 656, 1067869425u, 4167786896u, 1077097744u, 1775517981u, 1072694251u, 733571701u, 0, COSH_TOLERANCE, 0}, +{ 657, 1076164794u, 3187518564u, 1082437406u, 944672491u, 1087470446u, 2671993134u, 0, COSH_TOLERANCE, 0}, +{ 658, 1068240650u, 953085192u, 3227310828u, 3459155777u, 1072694822u, 4213317825u, 0, COSH_TOLERANCE, 0}, +{ 659, 1072648234u, 1908555460u, 1073640207u, 260441967u, 1073236630u, 142454325u, 0, COSH_TOLERANCE, 0}, +{ 660, 1072462486u, 250762477u, 1072582645u, 2886742039u, 1073136645u, 291307456u, 0, COSH_TOLERANCE, 0}, +{ 661, 3228885910u, 786180031u, 3197734769u, 2788918312u, 1577200566u, 2788902326u, 0, COSH_TOLERANCE, 0}, +{ 662, 3225074643u, 2055912467u, 3244244909u, 1394142937u, 1111997077u, 3336869072u, 0, COSH_TOLERANCE, 0}, +{ 663, 1072758713u, 91984146u, 3222252812u, 4126276047u, 1073342848u, 1253513367u, 0, COSH_TOLERANCE, 0}, +{ 664, 1075048683u, 3942715706u, 3239316352u, 410676547u, 1079134213u, 267559533u, 0, COSH_TOLERANCE, 0}, +{ 665, 3215335062u, 86296211u, 1085850694u, 649202596u, 1072694226u, 2983711788u, 0, COSH_TOLERANCE, 0}, +{ 666, 3226492024u, 3069064472u, 3237358008u, 23209276u, 1170562231u, 633460538u, 0, COSH_TOLERANCE, 0}, +{ 667, 1074943832u, 1867297860u, 1072956607u, 2513414118u, 1078493882u, 1616885989u, 0, COSH_TOLERANCE, 0}, +{ 668, 3228513251u, 3171788768u, 3235208783u, 162138697u, 1449229135u, 3375110619u, 0, COSH_TOLERANCE, 0}, +{ 669, 1075436999u, 1245110700u, 1081653954u, 2584994077u, 1081350721u, 957691310u, 0, COSH_TOLERANCE, 0}, +{ 670, 3226635752u, 3347226587u, 1058962932u, 2291943376u, 1183896710u, 168233073u, 0, COSH_TOLERANCE, 0}, +{ 671, 1070433398u, 966940828u, 1060726420u, 2798041096u, 1072721252u, 2966013057u, 0, COSH_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1073388450u, 3307746147u, 0, COSH_TOLERANCE, 0}, +{ 673, 3228193553u, 1671039260u, 1086395032u, 3745833360u, 1390173013u, 393415964u, 0, COSH_TOLERANCE, 0}, +{ 674, 1069661709u, 651714217u, 1047070645u, 2130549237u, 1072703337u, 2120747923u, 0, COSH_TOLERANCE, 0}, +{ 675, 3217601491u, 1423000172u, 3247822717u, 1551488170u, 1072712835u, 1816865234u, 0, COSH_TOLERANCE, 0}, +{ 676, 3216277371u, 921077236u, 3213332351u, 1431049019u, 1072696611u, 565650984u, 0, COSH_TOLERANCE, 0}, +{ 677, 1071704599u, 655715547u, 3190985373u, 1527556471u, 1072843172u, 1336277049u, 0, COSH_TOLERANCE, 0}, +{ 678, 3222412099u, 4110878657u, 3251297180u, 879739345u, 1078402367u, 500635058u, 0, COSH_TOLERANCE, 0}, +{ 679, 1076367578u, 2623955764u, 1093699897u, 1216444475u, 1089767499u, 3859717334u, 0, COSH_TOLERANCE, 0}, +{ 680, 1078274115u, 107442539u, 3239767031u, 1149813329u, 1135642519u, 2525054892u, 0, COSH_TOLERANCE, 0}, +{ 681, 3224008056u, 1761361082u, 3226030205u, 1121849716u, 1091632053u, 723647737u, 0, COSH_TOLERANCE, 0}, +{ 682, 3226455627u, 2534144722u, 1044223733u, 3512285706u, 1167807417u, 2831697989u, 0, COSH_TOLERANCE, 0}, +{ 683, 3218137533u, 4073670723u, 1050729852u, 3034818849u, 1072729939u, 1759331685u, 0, COSH_TOLERANCE, 0}, +{ 684, 1081013054u, 1421423503u, 1060278048u, 1397153092u, 1446153340u, 3645912721u, 0, COSH_TOLERANCE, 0}, +{ 685, 3220567557u, 1649206019u, 1104525577u, 1267104290u, 1073793966u, 3599940925u, 0, COSH_TOLERANCE, 0}, +{ 686, 3213419345u, 3775270392u, 1040251850u, 68667319u, 1072693325u, 1835336288u, 0, COSH_TOLERANCE, 0}, +{ 687, 3216913812u, 3099226694u, 3254103006u, 4020102648u, 1072700557u, 1248825926u, 0, COSH_TOLERANCE, 0}, +{ 688, 3216271776u, 3718441177u, 3215643451u, 4032951536u, 1072696583u, 704224480u, 0, COSH_TOLERANCE, 0}, +{ 689, 1066151467u, 508048351u, 3210196713u, 1707937896u, 1072693347u, 1151265229u, 0, COSH_TOLERANCE, 0}, +{ 690, 3215388843u, 2784738160u, 1073435430u, 1109346010u, 1072694300u, 2895740676u, 0, COSH_TOLERANCE, 0}, +{ 691, 3222579562u, 3331916473u, 3238794568u, 2707019594u, 1079370721u, 3655030168u, 0, COSH_TOLERANCE, 0}, +{ 692, 1078502606u, 3093165197u, 1072894805u, 2853215019u, 1146174228u, 2594603642u, 0, COSH_TOLERANCE, 0}, +{ 693, 3219727867u, 2135797997u, 1048399559u, 2941926126u, 1073034070u, 1282347664u, 0, COSH_TOLERANCE, 0}, +{ 694, 1067305348u, 2083412145u, 3249335391u, 507212448u, 1072693691u, 2874470125u, 0, COSH_TOLERANCE, 0}, +{ 695, 1074315175u, 4270176401u, 3246546709u, 3288753319u, 1076238829u, 3050002800u, 0, COSH_TOLERANCE, 0}, +{ 696, 3228009919u, 3692175292u, 3197271515u, 3989064196u, 1356228656u, 3358892546u, 0, COSH_TOLERANCE, 0}, +{ 697, 3228623066u, 3111924274u, 1066772558u, 59281695u, 1480086690u, 2342955533u, 0, COSH_TOLERANCE, 0}, +{ 698, 1071878215u, 2135245466u, 3208804313u, 3846547392u, 1072895387u, 4144720311u, 0, COSH_TOLERANCE, 0}, +{ 699, 1079149171u, 972051266u, 3222814246u, 3539700586u, 1183589479u, 2607924773u, 0, COSH_TOLERANCE, 0}, +{ 700, 3216597418u, 330951080u, 1079189813u, 583922384u, 1072698405u, 4243865843u, 0, COSH_TOLERANCE, 0}, +{ 701, 1077057180u, 1711944085u, 1104170032u, 643991456u, 1099706751u, 436337680u, 0, COSH_TOLERANCE, 0}, +{ 702, 3224992365u, 2072550721u, 3250147641u, 4280263530u, 1110117290u, 2591847584u, 0, COSH_TOLERANCE, 0}, +{ 703, 3213944226u, 1566376352u, 1067251433u, 72984588u, 1072693390u, 3254259422u, 0, COSH_TOLERANCE, 0}, +{ 704, 1079547929u, 3103043079u, 1045853123u, 410067497u, 1220439527u, 692790947u, 0, COSH_TOLERANCE, 0}, +{ 705, 3219818221u, 1910366299u, 1081770885u, 634683073u, 1073074645u, 1429806814u, 0, COSH_TOLERANCE, 0}, +{ 706, 1075239232u, 2226525875u, 3224149290u, 2126302825u, 1080223855u, 1320759816u, 0, COSH_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1073857441u, 263464829u, 0, COSH_TOLERANCE, 0}, +{ 708, 1071725823u, 1953339096u, 1077176252u, 1476516558u, 1072849107u, 4237100024u, 0, COSH_TOLERANCE, 0}, +{ 709, 1072383456u, 1306277326u, 1079089150u, 4093716191u, 1073097698u, 3030680746u, 0, COSH_TOLERANCE, 0}, +{ 710, 3223711603u, 51750045u, 3242913901u, 4256866157u, 1088179763u, 3515333215u, 0, COSH_TOLERANCE, 0}, +{ 711, 3213959335u, 2163853087u, 3232053146u, 2962422808u, 1072693394u, 2920600260u, 0, COSH_TOLERANCE, 0}, +{ 712, 1074468369u, 1618388148u, 3233154824u, 3711953164u, 1076728610u, 463521720u, 0, COSH_TOLERANCE, 0}, +{ 713, 3227993634u, 357108214u, 3202294604u, 2306775262u, 1353223522u, 1996029149u, 0, COSH_TOLERANCE, 0}, +{ 714, 3216584150u, 2571356437u, 3249064063u, 2394851808u, 1072698323u, 4161073125u, 0, COSH_TOLERANCE, 0}, +{ 715, 3224196635u, 4273880094u, 1103698617u, 3578832032u, 1093789145u, 485628572u, 0, COSH_TOLERANCE, 0}, +{ 716, 3223989517u, 2091068742u, 3228270226u, 3980489730u, 1091402892u, 675814748u, 0, COSH_TOLERANCE, 0}, +{ 717, 3222725296u, 2772307714u, 1051008486u, 32546576u, 1080235328u, 3668049513u, 0, COSH_TOLERANCE, 0}, +{ 718, 3225500575u, 2143788498u, 3195498043u, 3630119231u, 1123707886u, 237087314u, 0, COSH_TOLERANCE, 0}, +{ 719, 3215410151u, 2527385594u, 3240503648u, 3482095012u, 1072694330u, 3136314740u, 0, COSH_TOLERANCE, 0}, +{ 720, 3226440159u, 2690097362u, 1068598730u, 2360266862u, 1167133545u, 2847015826u, 0, COSH_TOLERANCE, 0}, +{ 721, 1070392205u, 2673272949u, 1082639557u, 522449749u, 1072720067u, 3056493936u, 0, COSH_TOLERANCE, 0}, +{ 722, 1081355475u, 3596379400u, 3242016775u, 2002293002u, 1559892600u, 3057535830u, 0, COSH_TOLERANCE, 0}, +{ 723, 1080565288u, 4113224369u, 3222122439u, 2152316893u, 1363443372u, 2667631927u, 0, COSH_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 1074033558u, 858447424u, 0, COSH_TOLERANCE, 0}, +{ 725, 3228443661u, 2489659568u, 1097051253u, 277506957u, 1436371380u, 1518851146u, 0, COSH_TOLERANCE, 0}, +{ 726, 3213421930u, 3850162281u, 3213841942u, 438724093u, 1072693325u, 2890275848u, 0, COSH_TOLERANCE, 0}, +{ 727, 1079663895u, 2431814052u, 1075518084u, 2672434118u, 1231134099u, 340027527u, 0, COSH_TOLERANCE, 0}, +{ 728, 3227434095u, 391606792u, 1048184750u, 4168944276u, 1257550215u, 1300409563u, 0, COSH_TOLERANCE, 0}, +{ 729, 3227869472u, 457529672u, 3201090276u, 72407935u, 1330311224u, 3560882185u, 0, COSH_TOLERANCE, 0}, +{ 730, 3220817871u, 3954981400u, 1052053242u, 2411049585u, 1074058719u, 3705062022u, 0, COSH_TOLERANCE, 0}, +{ 731, 1076742907u, 485456950u, 1088415093u, 1655397424u, 1094089911u, 1354371166u, 0, COSH_TOLERANCE, 0}, +{ 732, 3215011644u, 1551748070u, 3236871640u, 1329701152u, 1072693838u, 2879963114u, 0, COSH_TOLERANCE, 0}, +{ 733, 3221493394u, 3099222537u, 1104984570u, 4293792842u, 1075366946u, 508314344u, 0, COSH_TOLERANCE, 0}, +{ 734, 3216532617u, 3603065260u, 3197735968u, 2402359253u, 1072698011u, 2766024004u, 0, COSH_TOLERANCE, 0}, +{ 735, 3215601800u, 3961208159u, 3219057584u, 2340553876u, 1072694620u, 379258978u, 0, COSH_TOLERANCE, 0}, +{ 736, 1073833333u, 4014841779u, 3197672877u, 3697233334u, 1074909912u, 2808921288u, 0, COSH_TOLERANCE, 0}, +{ 737, 3219567113u, 1403876392u, 3254028950u, 921363393u, 1072968212u, 2144303717u, 0, COSH_TOLERANCE, 0}, +{ 738, 1082085982u, 1862576361u, 3194031708u, 2476290925u, 1829767895u, 2702820797u, 0, COSH_TOLERANCE, 0}, +{ 739, 1067487560u, 1454212851u, 1088378861u, 3400401866u, 1072693797u, 54461841u, 0, COSH_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1076514406u, 2547119721u, 0, COSH_TOLERANCE, 0}, +{ 741, 3219555010u, 1199568671u, 3225679997u, 46947405u, 1072963573u, 2577290657u, 0, COSH_TOLERANCE, 0}, +{ 742, 1074539809u, 2596231448u, 3253943728u, 2219151748u, 1076949249u, 741854126u, 0, COSH_TOLERANCE, 0}, +{ 743, 1071769915u, 4119719558u, 3222036299u, 1275474618u, 1072861834u, 622536215u, 0, COSH_TOLERANCE, 0}, +{ 744, 3226277175u, 3347296825u, 1101507910u, 1254014794u, 1159605697u, 2046925534u, 0, COSH_TOLERANCE, 0}, +{ 745, 1076779960u, 673775040u, 1070743626u, 244126093u, 1094571370u, 3392967795u, 0, COSH_TOLERANCE, 0}, +{ 746, 3216831338u, 1832066983u, 1051358028u, 3262483417u, 1072699960u, 1544307325u, 0, COSH_TOLERANCE, 0}, +{ 747, 1074413872u, 3962610501u, 3198598777u, 849269178u, 1076537724u, 1233885306u, 0, COSH_TOLERANCE, 0}, +{ 748, 3224988140u, 2497516122u, 3254374111u, 2821429629u, 1110006630u, 4293280082u, 0, COSH_TOLERANCE, 0}, +{ 749, 1074139136u, 2805941787u, 3217785843u, 779131141u, 1075816532u, 1482854069u, 0, COSH_TOLERANCE, 0}, +{ 750, 3222714382u, 723423605u, 1084533420u, 627282213u, 1080184328u, 3302770918u, 0, COSH_TOLERANCE, 0}, +{ 751, 3220141984u, 4292778869u, 1078101071u, 1676860147u, 1073242418u, 3635086186u, 0, COSH_TOLERANCE, 0}, +{ 752, 1074191350u, 3528118587u, 3194648564u, 2363260897u, 1075935555u, 289356259u, 0, COSH_TOLERANCE, 0}, +{ 753, 3214917975u, 1307010018u, 1061248120u, 1468743108u, 1072693752u, 1022163092u, 0, COSH_TOLERANCE, 0}, +{ 754, 3227708771u, 107905661u, 3226089788u, 1943427674u, 1300618543u, 73406449u, 0, COSH_TOLERANCE, 0}, +{ 755, 3213396365u, 760006940u, 1054265604u, 1749976597u, 1072693323u, 1120345363u, 0, COSH_TOLERANCE, 0}, +{ 756, 3225190472u, 2787503556u, 1081282610u, 1195841206u, 1114725979u, 1251355153u, 0, COSH_TOLERANCE, 0}, +{ 757, 3213822252u, 545462045u, 3208381743u, 1981311808u, 1072693368u, 1740079808u, 0, COSH_TOLERANCE, 0}, +{ 758, 1070669320u, 3657978397u, 1104463616u, 3501253426u, 1072730976u, 1944423667u, 0, COSH_TOLERANCE, 0}, +{ 759, 1067709649u, 1804177501u, 3210693633u, 3606766729u, 1072694044u, 2621219149u, 0, COSH_TOLERANCE, 0}, +{ 760, 1074759727u, 1336278526u, 1043741618u, 3165279431u, 1077527020u, 1512975247u, 0, COSH_TOLERANCE, 0}, +{ 761, 1069103403u, 1599382075u, 1058018527u, 4212580517u, 1072698341u, 3629517488u, 0, COSH_TOLERANCE, 0}, +{ 762, 3217988086u, 3007589929u, 3202026547u, 2792028313u, 1072723357u, 1307088321u, 0, COSH_TOLERANCE, 0}, +{ 763, 3228965522u, 1866066996u, 1060329048u, 3727175322u, 1606595077u, 1771558986u, 0, COSH_TOLERANCE, 0}, +{ 764, 3215193859u, 150890940u, 1056025306u, 3082724735u, 1072694045u, 1265676852u, 0, COSH_TOLERANCE, 0}, +{ 765, 1071446123u, 80400395u, 1093584426u, 3478941315u, 1072802523u, 752465669u, 0, COSH_TOLERANCE, 0}, +{ 766, 3228571942u, 4050954182u, 3219263194u, 2537475930u, 1461204778u, 405562207u, 0, COSH_TOLERANCE, 0}, +{ 767, 1071133327u, 2881752155u, 3212589299u, 2559651278u, 1072769091u, 2237199419u, 0, COSH_TOLERANCE, 0}, +{ 768, 3228044784u, 440309030u, 3214267461u, 3788040806u, 1362669700u, 3272529857u, 0, COSH_TOLERANCE, 0}, +{ 769, 1080553671u, 918813144u, 3208535698u, 1607035904u, 1361304066u, 4120585298u, 0, COSH_TOLERANCE, 0}, +{ 770, 1066254699u, 2497054124u, 1089139147u, 2549609010u, 1072693358u, 2903505685u, 0, COSH_TOLERANCE, 0}, +{ 771, 1066960585u, 790219083u, 1054657139u, 2797979479u, 1072693548u, 3389416957u, 0, COSH_TOLERANCE, 0}, +{ 772, 1070364312u, 1149462078u, 1095765205u, 3879963182u, 1072719280u, 154258113u, 0, COSH_TOLERANCE, 0}, +{ 773, 3216361301u, 2684353926u, 3205212854u, 1732474928u, 1072697044u, 3289630565u, 0, COSH_TOLERANCE, 0}, +{ 774, 1079508325u, 2742237025u, 1051317716u, 3386396147u, 1216722133u, 1976234612u, 0, COSH_TOLERANCE, 0}, +{ 775, 1071619594u, 3408320912u, 1103071166u, 4233059513u, 1072823827u, 3155315775u, 0, COSH_TOLERANCE, 0}, +{ 776, 1071155004u, 1077495917u, 1088399968u, 433115118u, 1072771204u, 2638172126u, 0, COSH_TOLERANCE, 0}, +{ 777, 3217130484u, 841366493u, 1051716814u, 4121125128u, 1072703080u, 2725484085u, 0, COSH_TOLERANCE, 0}, +{ 778, 1070923540u, 321857207u, 1089128010u, 1149988239u, 1072750184u, 2497194249u, 0, COSH_TOLERANCE, 0}, +{ 779, 3226668295u, 799866606u, 3197637091u, 3924438208u, 1186900516u, 3227583322u, 0, COSH_TOLERANCE, 0}, +{ 780, 3213082986u, 2002049816u, 1077053447u, 2240354761u, 1072693296u, 3373709313u, 0, COSH_TOLERANCE, 0}, +{ 781, 3222714827u, 478939968u, 1097035749u, 1066716440u, 1080186366u, 2582859282u, 0, COSH_TOLERANCE, 0}, +{ 782, 3224085033u, 1653104725u, 1088548129u, 81977716u, 1092521464u, 1441379124u, 0, COSH_TOLERANCE, 0}, +{ 783, 3215735644u, 3899475018u, 3189694084u, 3330093036u, 1072694842u, 2073424147u, 0, COSH_TOLERANCE, 0}, +{ 784, 1077778247u, 2612450289u, 1079065127u, 603380842u, 1116328756u, 409577748u, 0, COSH_TOLERANCE, 0}, +{ 785, 1080713847u, 3962735564u, 1101570429u, 1372490825u, 1390866750u, 1157784041u, 0, COSH_TOLERANCE, 0}, +{ 786, 1069486080u, 1479841439u, 1059312257u, 541504905u, 1072700976u, 2186360231u, 0, COSH_TOLERANCE, 0}, +{ 787, 1075516450u, 2626148789u, 1057571099u, 4121656076u, 1081817128u, 1530368747u, 0, COSH_TOLERANCE, 0}, +{ 788, 1075321933u, 1902560314u, 1043130231u, 3557671562u, 1080683467u, 1859697987u, 0, COSH_TOLERANCE, 0}, +{ 789, 3214801292u, 41779312u, 1081626342u, 831171823u, 1072693697u, 1186166695u, 0, COSH_TOLERANCE, 0}, +{ 790, 1069665436u, 1393168821u, 1066457405u, 1381616968u, 1072703402u, 1650632034u, 0, COSH_TOLERANCE, 0}, +{ 791, 1073386717u, 3756584649u, 3222267229u, 1423157432u, 1074123576u, 1665585151u, 0, COSH_TOLERANCE, 0}, +{ 792, 3229269850u, 1894912556u, 1042426694u, 155024547u, 1718965712u, 945429025u, 0, COSH_TOLERANCE, 0}, +{ 793, 3214327880u, 35164295u, 3203391785u, 1037041084u, 1072693506u, 3508532193u, 0, COSH_TOLERANCE, 0}, +{ 794, 1076388871u, 3957875950u, 3232195211u, 1590756436u, 1090004859u, 3120776328u, 0, COSH_TOLERANCE, 0}, +{ 795, 1071990050u, 1447585080u, 1071279485u, 1107922438u, 1072933539u, 2209886006u, 0, COSH_TOLERANCE, 0}, +{ 796, 1067224038u, 981897615u, 1051856116u, 430357614u, 1072693655u, 2049552706u, 0, COSH_TOLERANCE, 0}, +{ 797, 3222281335u, 395145384u, 3219821938u, 50586510u, 1077679062u, 1276809098u, 0, COSH_TOLERANCE, 0}, +{ 798, 1072921640u, 750827797u, 1082862669u, 230466783u, 1073571776u, 3511683862u, 0, COSH_TOLERANCE, 0}, +{ 799, 1077231635u, 1365083575u, 3204848310u, 1700831722u, 1103707567u, 2384443675u, 0, COSH_TOLERANCE, 0}, +{ 800, 3220187542u, 344241827u, 1071538935u, 2715566077u, 1073275304u, 928327191u, 0, COSH_TOLERANCE, 0}, +{ 801, 3227659912u, 4069301823u, 3193208760u, 2949125229u, 1291633407u, 3577170264u, 0, COSH_TOLERANCE, 0}, +{ 802, 1081211291u, 3585711710u, 1065801594u, 2302229267u, 1506690422u, 4025253862u, 0, COSH_TOLERANCE, 0}, +{ 803, 3214041900u, 709803845u, 1048741487u, 2296910194u, 1072693417u, 226115727u, 0, COSH_TOLERANCE, 0}, +{ 804, 3214252299u, 744421179u, 1069302001u, 2659232829u, 1072693481u, 1038120994u, 0, COSH_TOLERANCE, 0}, +{ 805, 1078155904u, 1799949903u, 3192522886u, 4212149209u, 1130147983u, 2298972399u, 0, COSH_TOLERANCE, 0}, +{ 806, 3217642838u, 145234164u, 3250614064u, 912384201u, 1072713852u, 135186305u, 0, COSH_TOLERANCE, 0}, +{ 807, 3225830600u, 2784620507u, 1102812948u, 3531481022u, 1138955264u, 414543568u, 0, COSH_TOLERANCE, 0}, +{ 808, 3229139567u, 383952592u, 3205659905u, 3633194728u, 1670843603u, 1189342136u, 0, COSH_TOLERANCE, 0}, +{ 809, 3216059164u, 3792395543u, 1070072378u, 3864816376u, 1072695606u, 3943605180u, 0, COSH_TOLERANCE, 0}, +{ 810, 3217899185u, 2115553675u, 1066288499u, 3538377867u, 1072720735u, 3043278424u, 0, COSH_TOLERANCE, 0}, +{ 811, 3229006513u, 1230026762u, 1090719723u, 440819880u, 1621709547u, 2644861228u, 0, COSH_TOLERANCE, 0}, +{ 812, 3214518020u, 2991290482u, 1096886719u, 1097971167u, 1072693577u, 173583143u, 0, COSH_TOLERANCE, 0}, +{ 813, 1077465688u, 1098035020u, 3230900504u, 1479059095u, 1109134739u, 1050435763u, 0, COSH_TOLERANCE, 0}, +{ 814, 3229036868u, 1719428427u, 3188631907u, 3707377409u, 1632924552u, 1550018828u, 0, COSH_TOLERANCE, 0}, +{ 815, 1068964805u, 3748932896u, 1084908557u, 1325384361u, 1072697522u, 3948486792u, 0, COSH_TOLERANCE, 0}, +{ 816, 1076315468u, 3979168763u, 1057455255u, 2454615952u, 1089181690u, 2958015221u, 0, COSH_TOLERANCE, 0}, +{ 817, 1068835624u, 1449164578u, 1056960316u, 1654931641u, 1072696824u, 1401361151u, 0, COSH_TOLERANCE, 0}, +{ 818, 1073536162u, 2120487381u, 3226298974u, 2364226633u, 1074328434u, 1815453534u, 0, COSH_TOLERANCE, 0}, +{ 819, 1074022852u, 1074268944u, 1065730444u, 280016852u, 1075407548u, 3974776385u, 0, COSH_TOLERANCE, 0}, +{ 820, 3216036896u, 3315127889u, 3236295594u, 2900924954u, 1072695514u, 1876741827u, 0, COSH_TOLERANCE, 0}, +{ 821, 3215300259u, 2246037502u, 1049691002u, 1496066550u, 1072694180u, 1112214741u, 0, COSH_TOLERANCE, 0}, +{ 822, 3213978379u, 4191285446u, 3217936236u, 2382392789u, 1072693399u, 3005009332u, 0, COSH_TOLERANCE, 0}, +{ 823, 1078153244u, 640099844u, 1042152237u, 2064279383u, 1130001370u, 3369789477u, 0, COSH_TOLERANCE, 0}, +{ 824, 1075719134u, 3468560824u, 1093251038u, 310958750u, 1083014335u, 205376381u, 0, COSH_TOLERANCE, 0}, +{ 825, 1080011184u, 1413568905u, 1100941106u, 1627289946u, 1263163319u, 2702685927u, 0, COSH_TOLERANCE, 0}, +{ 826, 3213569646u, 3797143370u, 3195497539u, 3843275034u, 1072693340u, 1523765613u, 0, COSH_TOLERANCE, 0}, +{ 827, 3229008721u, 2806642640u, 3201943068u, 2515980718u, 1622521255u, 1495856927u, 0, COSH_TOLERANCE, 0}, +{ 828, 1077440132u, 632580632u, 1078673506u, 3259601317u, 1108541069u, 1728707154u, 0, COSH_TOLERANCE, 0}, +{ 829, 3216709215u, 3309678799u, 1049337078u, 3056787074u, 1072699123u, 1270833534u, 0, COSH_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 1075372753u, 706611161u, 0, COSH_TOLERANCE, 0}, +{ 831, 1072262554u, 932124675u, 1093915797u, 662682630u, 1073042092u, 3650070814u, 0, COSH_TOLERANCE, 0}, +{ 832, 3228258571u, 1367996113u, 3251723684u, 2974064663u, 1402167137u, 835372527u, 0, COSH_TOLERANCE, 0}, +{ 833, 1074987851u, 323437999u, 1090499064u, 901457511u, 1078787526u, 1748132310u, 0, COSH_TOLERANCE, 0}, +{ 834, 3225293116u, 4184941840u, 3196770014u, 2458988443u, 1117047527u, 356853259u, 0, COSH_TOLERANCE, 0}, +{ 835, 1077132524u, 2023065054u, 3211994098u, 2734612965u, 1101414558u, 3575590741u, 0, COSH_TOLERANCE, 0}, +{ 836, 1071414726u, 3679267365u, 3237728785u, 1699558211u, 1072798880u, 129754064u, 0, COSH_TOLERANCE, 0}, +{ 837, 1077593250u, 1826799031u, 1078709629u, 3986905229u, 1112051516u, 1053308024u, 0, COSH_TOLERANCE, 0}, +{ 838, 1068572425u, 351061688u, 3194386466u, 4105857588u, 1072695593u, 4153306203u, 0, COSH_TOLERANCE, 0}, +{ 839, 1068808070u, 1365244058u, 1064457319u, 1452191426u, 1072696683u, 1681752437u, 0, COSH_TOLERANCE, 0}, +{ 840, 1071462417u, 2463030625u, 3215975031u, 3773488326u, 1072804439u, 2238472752u, 0, COSH_TOLERANCE, 0}, +{ 841, 3229256575u, 752664055u, 1065110394u, 1835931663u, 1714075118u, 149401169u, 0, COSH_TOLERANCE, 0}, +{ 842, 1077559328u, 3496172149u, 1089617208u, 109068701u, 1111311801u, 1798297128u, 0, COSH_TOLERANCE, 0}, +{ 843, 3215960879u, 1636966254u, 1086098766u, 2016598298u, 1072695254u, 1939764603u, 0, COSH_TOLERANCE, 0}, +{ 844, 1067708534u, 3551516956u, 1097969102u, 1317953425u, 1072694043u, 1086280677u, 0, COSH_TOLERANCE, 0}, +{ 845, 3223540761u, 2977627788u, 1045339018u, 516058480u, 1086242904u, 2098662703u, 0, COSH_TOLERANCE, 0}, +{ 846, 3224825666u, 3901731263u, 3189566462u, 32272932u, 1106313364u, 1335776681u, 0, COSH_TOLERANCE, 0}, +{ 847, 1074136068u, 1956025297u, 3246628529u, 3840733905u, 1075804523u, 2847820500u, 0, COSH_TOLERANCE, 0}, +{ 848, 1080943668u, 561057891u, 3198494340u, 4271027193u, 1433394156u, 930486357u, 0, COSH_TOLERANCE, 0}, +{ 849, 3228909825u, 692989850u, 3242630588u, 2492225971u, 1585995290u, 319542345u, 0, COSH_TOLERANCE, 0}, +{ 850, 3218062309u, 3439913962u, 1067477011u, 2973333638u, 1072725638u, 3634823438u, 0, COSH_TOLERANCE, 0}, +{ 851, 3219236869u, 877613377u, 1044917899u, 809672798u, 1072856952u, 2796036778u, 0, COSH_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 1077310812u, 2851365163u, 0, COSH_TOLERANCE, 0}, +{ 853, 3227472261u, 2645567288u, 1051258339u, 557182478u, 1261081230u, 3197735669u, 0, COSH_TOLERANCE, 0}, +{ 854, 3216640862u, 186287752u, 1061342054u, 4054003419u, 1072698679u, 729206068u, 0, COSH_TOLERANCE, 0}, +{ 855, 1079440881u, 3506889716u, 3243866036u, 519056371u, 1210492348u, 931610429u, 0, COSH_TOLERANCE, 0}, +{ 856, 1065722725u, 2171898436u, 3246911982u, 1091500784u, 1072693306u, 2265047919u, 0, COSH_TOLERANCE, 0}, +{ 857, 3226870457u, 368493885u, 3222871893u, 1419055230u, 1205516424u, 2259354588u, 0, COSH_TOLERANCE, 0}, +{ 858, 1078319084u, 2010971245u, 3188804530u, 1518695799u, 1137724679u, 3191526077u, 0, COSH_TOLERANCE, 0}, +{ 859, 3218009421u, 1239207795u, 1040192984u, 2199481342u, 1072724004u, 1939639299u, 0, COSH_TOLERANCE, 0}, +{ 860, 3218318669u, 4264613432u, 3203460972u, 3558930895u, 1072743039u, 1280148500u, 0, COSH_TOLERANCE, 0}, +{ 861, 1068125075u, 3772748958u, 3227667376u, 309688336u, 1072694631u, 780493773u, 0, COSH_TOLERANCE, 0}, +{ 862, 3223403009u, 1077949160u, 1075769893u, 2405271377u, 1084588117u, 750360291u, 0, COSH_TOLERANCE, 0}, +{ 863, 1078203664u, 3751608506u, 3232278094u, 930375071u, 1132383966u, 338172682u, 0, COSH_TOLERANCE, 0}, +{ 864, 3215394369u, 1518334131u, 3205247482u, 791756713u, 1072694308u, 1837710716u, 0, COSH_TOLERANCE, 0}, +{ 865, 1067240397u, 2825203170u, 3245054001u, 1822981827u, 1072693662u, 2728197500u, 0, COSH_TOLERANCE, 0}, +{ 866, 1080093419u, 514474738u, 1089072073u, 3300845441u, 1276320656u, 226623888u, 0, COSH_TOLERANCE, 0}, +{ 867, 3219536978u, 247369460u, 3197320093u, 687450958u, 1072956743u, 2486540699u, 0, COSH_TOLERANCE, 0}, +{ 868, 1081092750u, 2722237629u, 1058272368u, 90602316u, 1462892401u, 1953188388u, 0, COSH_TOLERANCE, 0}, +{ 869, 3217535619u, 1845900544u, 3231520830u, 3389751458u, 1072711269u, 1708331520u, 0, COSH_TOLERANCE, 0}, +{ 870, 3227612301u, 737689911u, 3195377751u, 3462616966u, 1282803389u, 893857503u, 0, COSH_TOLERANCE, 0}, +{ 871, 3221441232u, 3620285831u, 1055501023u, 2708056059u, 1075215165u, 36506447u, 0, COSH_TOLERANCE, 0}, +{ 872, 3220513572u, 4073430285u, 1056206159u, 172017902u, 1073745576u, 1368956281u, 0, COSH_TOLERANCE, 0}, +{ 873, 3219161094u, 2799176222u, 1052706894u, 4083892667u, 1072835757u, 2697030089u, 0, COSH_TOLERANCE, 0}, +{ 874, 3216959621u, 1562351330u, 1069705601u, 1247765260u, 1072700899u, 3715177876u, 0, COSH_TOLERANCE, 0}, +{ 875, 3224328691u, 51853475u, 3189080201u, 2783553144u, 1095270977u, 3427601507u, 0, COSH_TOLERANCE, 0}, +{ 876, 3220502929u, 3851781549u, 3241598113u, 514064046u, 1073730914u, 2250864942u, 0, COSH_TOLERANCE, 0}, +{ 877, 1080123021u, 934745487u, 3248182437u, 2798581921u, 1281762996u, 865963855u, 0, COSH_TOLERANCE, 0}, +{ 878, 3219373949u, 2948648757u, 3232177250u, 4278702895u, 1072899337u, 3276588090u, 0, COSH_TOLERANCE, 0}, +{ 879, 1073534300u, 4259101461u, 1061606772u, 84229920u, 1074325687u, 1565151099u, 0, COSH_TOLERANCE, 0}, +{ 880, 3215901351u, 3891230598u, 1095924595u, 3049217547u, 1072695140u, 4168549617u, 0, COSH_TOLERANCE, 0}, +{ 881, 1074207325u, 3806018919u, 3243191216u, 280177341u, 1075970755u, 2786980301u, 0, COSH_TOLERANCE, 0}, +{ 882, 1070061714u, 3900344258u, 1063647809u, 4206745890u, 1072711496u, 3823741603u, 0, COSH_TOLERANCE, 0}, +{ 883, 3222464456u, 2126253040u, 3207248026u, 808507485u, 1078737170u, 621449966u, 0, COSH_TOLERANCE, 0}, +{ 884, 1076653133u, 3465685634u, 3230391053u, 3754958214u, 1093053515u, 3736100576u, 0, COSH_TOLERANCE, 0}, +{ 885, 1080840988u, 461094531u, 1101110393u, 1316091396u, 1414403053u, 3462873770u, 0, COSH_TOLERANCE, 0}, +{ 886, 1071271770u, 4197635149u, 1091873113u, 1240127141u, 1072783106u, 1748105286u, 0, COSH_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1076291260u, 1720945322u, 0, COSH_TOLERANCE, 0}, +{ 888, 3219720621u, 3744663425u, 3212482771u, 953662066u, 1073030929u, 896575844u, 0, COSH_TOLERANCE, 0}, +{ 889, 1076782697u, 3564196690u, 3228101916u, 904305212u, 1094612637u, 2831822307u, 0, COSH_TOLERANCE, 0}, +{ 890, 1067207479u, 3566257266u, 3235138829u, 2734275140u, 1072693648u, 1269634877u, 0, COSH_TOLERANCE, 0}, +{ 891, 3227171261u, 606044282u, 3241318094u, 2446416887u, 1233304247u, 534441612u, 0, COSH_TOLERANCE, 0}, +{ 892, 1065744532u, 2336116589u, 3197594053u, 2296925138u, 1072693308u, 1465765093u, 0, COSH_TOLERANCE, 0}, +{ 893, 1070101995u, 907670625u, 3240769036u, 1827119006u, 1072712452u, 2747386971u, 0, COSH_TOLERANCE, 0}, +{ 894, 1066487279u, 2818710946u, 3246059905u, 553394170u, 1072693397u, 3115364367u, 0, COSH_TOLERANCE, 0}, +{ 895, 3213621342u, 4099522736u, 3232742168u, 3718083858u, 1072693345u, 3406009066u, 0, COSH_TOLERANCE, 0}, +{ 896, 1078739788u, 1059279404u, 1080245336u, 175941677u, 1157065361u, 1087430260u, 0, COSH_TOLERANCE, 0}, +{ 897, 1082121019u, 1650862428u, 1061816101u, 1723201723u, 1842630885u, 3875297949u, 0, COSH_TOLERANCE, 0}, +{ 898, 3226429902u, 2462163405u, 3218946201u, 3876535372u, 1166601564u, 774021558u, 0, COSH_TOLERANCE, 0}, +{ 899, 1076004278u, 495844137u, 1073721460u, 772777946u, 1085574307u, 3103051899u, 0, COSH_TOLERANCE, 0}, +{ 900, 1068143970u, 458757721u, 3245680321u, 3609892707u, 1072694661u, 2944146062u, 0, COSH_TOLERANCE, 0}, +{ 901, 3214254476u, 2533012202u, 1079980803u, 3592268374u, 1072693481u, 4122712420u, 0, COSH_TOLERANCE, 0}, +{ 902, 3216996268u, 4108274117u, 1063045844u, 571992389u, 1072701179u, 2572750489u, 0, COSH_TOLERANCE, 0}, +{ 903, 1077984359u, 3541110973u, 1096296754u, 3118427427u, 1122209571u, 2499543662u, 0, COSH_TOLERANCE, 0}, +{ 904, 3213902987u, 1213941007u, 1105433735u, 2172963370u, 1072693380u, 1385696423u, 0, COSH_TOLERANCE, 0}, +{ 905, 1079027567u, 272190288u, 1095452370u, 4026581530u, 1172388533u, 1567535437u, 0, COSH_TOLERANCE, 0}, +{ 906, 1079855269u, 2843638672u, 1100510986u, 3190536898u, 1248839882u, 1134925313u, 0, COSH_TOLERANCE, 0}, +{ 907, 1076417062u, 2014317727u, 3247389683u, 2428462015u, 1090384705u, 358950430u, 0, COSH_TOLERANCE, 0}, +{ 908, 1078248077u, 688442200u, 1047852515u, 3035186380u, 1134419607u, 2761855333u, 0, COSH_TOLERANCE, 0}, +{ 909, 1074567060u, 1010095511u, 3221288076u, 405287991u, 1077008382u, 2678639855u, 0, COSH_TOLERANCE, 0}, +{ 910, 3229225943u, 2983070435u, 1089546472u, 2907918480u, 1702816421u, 3410875852u, 0, COSH_TOLERANCE, 0}, +{ 911, 1076696665u, 81928569u, 1056007286u, 2740556321u, 1093638835u, 274386753u, 0, COSH_TOLERANCE, 0}, +{ 912, 1066276691u, 2076689028u, 1081558619u, 3039159031u, 1072693361u, 800822767u, 0, COSH_TOLERANCE, 0}, +{ 913, 1067230382u, 1376882094u, 3211003208u, 1296286481u, 1072693658u, 1054988025u, 0, COSH_TOLERANCE, 0}, +{ 914, 1074871434u, 744133164u, 3200943494u, 955832216u, 1078106333u, 2049981092u, 0, COSH_TOLERANCE, 0}, +{ 915, 3223144598u, 176522478u, 1069999908u, 2891249491u, 1082629674u, 2323388443u, 0, COSH_TOLERANCE, 0}, +{ 916, 1065584698u, 3685851715u, 3187829932u, 2363997529u, 1072693295u, 2956924633u, 0, COSH_TOLERANCE, 0}, +{ 917, 1065409879u, 3974431579u, 1052505165u, 2589067816u, 1072693283u, 2371419071u, 0, COSH_TOLERANCE, 0}, +{ 918, 3213516885u, 3819109588u, 1048561488u, 969143351u, 1072693334u, 4144308189u, 0, COSH_TOLERANCE, 0}, +{ 919, 1073687973u, 4246896124u, 1104584799u, 1940097860u, 1074570627u, 2298933225u, 0, COSH_TOLERANCE, 0}, +{ 920, 1066912836u, 2228686199u, 3220231833u, 777624847u, 1072693531u, 787077708u, 0, COSH_TOLERANCE, 0}, +{ 921, 3224127274u, 4189906558u, 3203004203u, 854242364u, 1092949557u, 959709294u, 0, COSH_TOLERANCE, 0}, +{ 922, 1081890311u, 4089051094u, 3227282692u, 2693170723u, 1757476753u, 2188757040u, 0, COSH_TOLERANCE, 0}, +{ 923, 1066855127u, 1278581412u, 3239296746u, 1774588717u, 1072693510u, 2634419015u, 0, COSH_TOLERANCE, 0}, +{ 924, 3221324110u, 1794845306u, 1104879344u, 4135865182u, 1074925497u, 3906182610u, 0, COSH_TOLERANCE, 0}, +{ 925, 1081283231u, 754938390u, 1061291430u, 2010786993u, 1533223782u, 1531468649u, 0, COSH_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1074396812u, 1237727695u, 0, COSH_TOLERANCE, 0}, +{ 927, 3224109162u, 567588900u, 3195452230u, 1421366017u, 1092771194u, 1959115226u, 0, COSH_TOLERANCE, 0}, +{ 928, 3221944027u, 2708717091u, 1071975971u, 1364590470u, 1076699364u, 3498938298u, 0, COSH_TOLERANCE, 0}, +{ 929, 3229068611u, 3461956134u, 3207820115u, 1605709634u, 1644637705u, 436547866u, 0, COSH_TOLERANCE, 0}, +{ 930, 1071594452u, 1497124553u, 1051715442u, 916736957u, 1072820615u, 3509403797u, 0, COSH_TOLERANCE, 0}, +{ 931, 1070002699u, 834914365u, 1064667143u, 2839166298u, 1072710141u, 49948186u, 0, COSH_TOLERANCE, 0}, +{ 932, 1069862861u, 2139295776u, 1062816721u, 914592523u, 1072707138u, 2831866037u, 0, COSH_TOLERANCE, 0}, +{ 933, 3213754179u, 851569132u, 1058503154u, 1399378677u, 1072693360u, 2063325022u, 0, COSH_TOLERANCE, 0}, +{ 934, 3224100513u, 3897202342u, 3245382590u, 246600375u, 1092694344u, 2855953602u, 0, COSH_TOLERANCE, 0}, +{ 935, 3222314580u, 3620429520u, 1055627557u, 229305u, 1077927721u, 4207295924u, 0, COSH_TOLERANCE, 0}, +{ 936, 1076618801u, 3641997865u, 3206673888u, 93720614u, 1092711110u, 70908616u, 0, COSH_TOLERANCE, 0}, +{ 937, 3222565555u, 32766320u, 1062084905u, 3668443038u, 1079296080u, 3835260610u, 0, COSH_TOLERANCE, 0}, +{ 938, 3222250420u, 2039713492u, 3248699388u, 1346210821u, 1077549839u, 2474839273u, 0, COSH_TOLERANCE, 0}, +{ 939, 1078369952u, 1335820726u, 3191756860u, 1808427032u, 1140014824u, 1082588104u, 0, COSH_TOLERANCE, 0}, +{ 940, 1070879947u, 650692001u, 1103515670u, 2253348763u, 1072746604u, 1613283469u, 0, COSH_TOLERANCE, 0}, +{ 941, 3213415283u, 2372623300u, 3210185343u, 3200572848u, 1072693325u, 180886037u, 0, COSH_TOLERANCE, 0}, +{ 942, 1080873125u, 762317532u, 3194595095u, 3192607437u, 1420280283u, 2571597720u, 0, COSH_TOLERANCE, 0}, +{ 943, 1070651309u, 217775356u, 3232827087u, 2969367386u, 1072729767u, 3026198031u, 0, COSH_TOLERANCE, 0}, +{ 944, 1069755463u, 3621353969u, 1077994795u, 3873976266u, 1072705033u, 1292815252u, 0, COSH_TOLERANCE, 0}, +{ 945, 1078719075u, 268372152u, 3221764390u, 3216978962u, 1156113361u, 77208680u, 0, COSH_TOLERANCE, 0}, +{ 946, 3227563243u, 142942404u, 1075322987u, 1746449109u, 1273775797u, 1613517009u, 0, COSH_TOLERANCE, 0}, +{ 947, 1081986200u, 496534875u, 3254522293u, 2532372502u, 1792868955u, 1796814503u, 0, COSH_TOLERANCE, 0}, +{ 948, 3228205445u, 2999955409u, 3222793392u, 1868977643u, 1392395773u, 861578698u, 0, COSH_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1076249507u, 4249056915u, 0, COSH_TOLERANCE, 0}, +{ 950, 1072413103u, 73646871u, 3231442171u, 3711510104u, 1073112064u, 51329157u, 0, COSH_TOLERANCE, 0}, +{ 951, 1077900612u, 218135177u, 3198908856u, 3082199105u, 1119150740u, 3713509082u, 0, COSH_TOLERANCE, 0}, +{ 952, 1072262784u, 1061628117u, 3248859043u, 86776158u, 1073042194u, 769388057u, 0, COSH_TOLERANCE, 0}, +{ 953, 3217921858u, 938869114u, 1087911145u, 2416710759u, 1072721392u, 3474817236u, 0, COSH_TOLERANCE, 0}, +{ 954, 1079848192u, 2970853959u, 3239543429u, 1887505029u, 1248109254u, 3136433410u, 0, COSH_TOLERANCE, 0}, +{ 955, 3225145875u, 1337895935u, 1076463812u, 1172733328u, 1113691889u, 31768603u, 0, COSH_TOLERANCE, 0}, +{ 956, 1068014296u, 1469010822u, 3229583535u, 551399515u, 1072694459u, 135999803u, 0, COSH_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1075735689u, 4015727387u, 0, COSH_TOLERANCE, 0}, +{ 958, 3226410140u, 2976596113u, 3192137295u, 3033242648u, 1165706945u, 2523414676u, 0, COSH_TOLERANCE, 0}, +{ 959, 1079824113u, 876810930u, 3197470945u, 2571587447u, 1245903887u, 1889039904u, 0, COSH_TOLERANCE, 0}, +{ 960, 3226042170u, 4007797282u, 3225853845u, 4069319648u, 1148697453u, 4203630871u, 0, COSH_TOLERANCE, 0}, +{ 961, 1067202926u, 3840538373u, 1043189552u, 3668774580u, 1072693646u, 1426518963u, 0, COSH_TOLERANCE, 0}, +{ 962, 3220757432u, 200857661u, 3229758439u, 3359367736u, 1073988275u, 2806959022u, 0, COSH_TOLERANCE, 0}, +{ 963, 3227826349u, 111868139u, 3227902082u, 2366064003u, 1322375028u, 1662095535u, 0, COSH_TOLERANCE, 0}, +{ 964, 1066215262u, 3510904416u, 3222131653u, 3822770497u, 1072693354u, 1051116137u, 0, COSH_TOLERANCE, 0}, +{ 965, 3226947075u, 789151814u, 1099269239u, 2958956055u, 1212574387u, 2807768454u, 0, COSH_TOLERANCE, 0}, +{ 966, 1076290712u, 722163228u, 1105524559u, 1534462169u, 1088870444u, 2168724557u, 0, COSH_TOLERANCE, 0}, +{ 967, 1066509006u, 2207037106u, 3208952465u, 1231254630u, 1072693403u, 2222435194u, 0, COSH_TOLERANCE, 0}, +{ 968, 3215709852u, 3838689849u, 3198769679u, 1302617170u, 1072694798u, 1405657813u, 0, COSH_TOLERANCE, 0}, +{ 969, 1076501722u, 2527556476u, 3240373426u, 124352692u, 1091342710u, 1779782796u, 0, COSH_TOLERANCE, 0}, +{ 970, 3215269445u, 3502371499u, 1043411944u, 4190072016u, 1072694140u, 376523261u, 0, COSH_TOLERANCE, 0}, +{ 971, 1070967598u, 1798470077u, 3200116917u, 3421833729u, 1072753924u, 1515331822u, 0, COSH_TOLERANCE, 0}, +{ 972, 3214486476u, 3653237931u, 3204255012u, 3683870669u, 1072693564u, 3470124748u, 0, COSH_TOLERANCE, 0}, +{ 973, 1069317222u, 376530104u, 1073853547u, 565755892u, 1072699746u, 1235915232u, 0, COSH_TOLERANCE, 0}, +{ 974, 3226775211u, 558292492u, 1051772749u, 4267873474u, 1196715895u, 131886187u, 0, COSH_TOLERANCE, 0}, +{ 975, 3221626981u, 509637100u, 3212030069u, 215050379u, 1075833072u, 467034146u, 0, COSH_TOLERANCE, 0}, +{ 976, 1078425613u, 3571665665u, 3188628584u, 757824767u, 1142574424u, 253046892u, 0, COSH_TOLERANCE, 0}, +{ 977, 3220042217u, 998858159u, 1063077962u, 436029885u, 1073186855u, 1202860156u, 0, COSH_TOLERANCE, 0}, +{ 978, 3217481301u, 996300405u, 3193842624u, 80548098u, 1072710027u, 2273904897u, 0, COSH_TOLERANCE, 0}, +{ 979, 3222557384u, 3876129407u, 3215332180u, 2226970413u, 1079254352u, 3066283527u, 0, COSH_TOLERANCE, 0}, +{ 980, 3225026041u, 200013509u, 3224552716u, 414878724u, 1110874928u, 1169612687u, 0, COSH_TOLERANCE, 0}, +{ 981, 3224325637u, 309319541u, 1048979765u, 1261662434u, 1095233986u, 817192005u, 0, COSH_TOLERANCE, 0}, +{ 982, 1077718303u, 4062255924u, 3224274128u, 4289485681u, 1114943885u, 3449799183u, 0, COSH_TOLERANCE, 0}, +{ 983, 3224601748u, 1611969213u, 1053890378u, 3774617276u, 1101126454u, 3591228804u, 0, COSH_TOLERANCE, 0}, +{ 984, 1075169883u, 1752164782u, 3239587974u, 612223386u, 1079838374u, 2949770801u, 0, COSH_TOLERANCE, 0}, +{ 985, 1065663030u, 2024044989u, 1074932678u, 3259111307u, 1072693301u, 3021786197u, 0, COSH_TOLERANCE, 0}, +{ 986, 1068936158u, 2564965629u, 1093571065u, 169360454u, 1072697362u, 2639638506u, 0, COSH_TOLERANCE, 0}, +{ 987, 1077016178u, 1860101737u, 3191222372u, 1676437468u, 1098787212u, 2272979218u, 0, COSH_TOLERANCE, 0}, +{ 988, 1070288728u, 588387057u, 3192103292u, 2495288012u, 1072717205u, 1389707200u, 0, COSH_TOLERANCE, 0}, +{ 989, 3214127225u, 659070058u, 1073095700u, 1393632068u, 1072693441u, 3612914573u, 0, COSH_TOLERANCE, 0}, +{ 990, 3220828991u, 4276187829u, 3217553330u, 1868253275u, 1074072167u, 2887453002u, 0, COSH_TOLERANCE, 0}, +{ 991, 3222171696u, 2085481575u, 3215994784u, 800910002u, 1077311492u, 1227387766u, 0, COSH_TOLERANCE, 0}, +{ 992, 1069517748u, 1950570756u, 3200582211u, 941022151u, 1072701219u, 599507787u, 0, COSH_TOLERANCE, 0}, +{ 993, 1070113280u, 2075610870u, 3250142022u, 3605152103u, 1072712724u, 3542177568u, 0, COSH_TOLERANCE, 0}, +{ 994, 3216567890u, 3792931748u, 3204857863u, 804393211u, 1072698224u, 1504041164u, 0, COSH_TOLERANCE, 0}, +{ 995, 3229529122u, 3430071177u, 3226288311u, 3652522729u, 1814734598u, 874872258u, 0, COSH_TOLERANCE, 0}, +{ 996, 3215994766u, 236884699u, 3227874605u, 2193269825u, 1072695344u, 2273001648u, 0, COSH_TOLERANCE, 0}, +{ 997, 1071228049u, 2744231849u, 1046186036u, 771053722u, 1072778547u, 642403527u, 0, COSH_TOLERANCE, 0}, +{ 998, 1076656004u, 3000189819u, 1096500901u, 2057239777u, 1093086420u, 3545313986u, 0, COSH_TOLERANCE, 0}, +{ 999, 1078106941u, 205759408u, 3244643377u, 2702292618u, 1127858436u, 16441604u, 0, COSH_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_COSH_H multiple inclusion protection + +// EOF cosh.h diff --git a/packages/language/c/libm/current/tests/vectors/exp.c b/packages/language/c/libm/current/tests/vectors/exp.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/exp.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// exp.c +// +// Test of exp() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/exp.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(exp_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &exp, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &exp_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("exp() is stable"); + } // if + else + { + CYG_TEST_FAIL("exp() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library exp() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "exp() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF exp.c diff --git a/packages/language/c/libm/current/tests/vectors/exp.h b/packages/language/c/libm/current/tests/vectors/exp.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/exp.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_EXP_H +#define CYGONCE_LIBM_EXP_H +//=========================================================================== +// +// exp.h +// +// Test vectors for testing of exp() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/exp.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define EXP_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t exp_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1074853420u, 2506787616u, 1090024059u, 3619148316u, 1079073766u, 1147571106u, 0, EXP_TOLERANCE, 0}, +{ 2, 3220250806u, 3176730980u, 1051524793u, 2993920299u, 1070985501u, 3667586384u, 0, EXP_TOLERANCE, 0}, +{ 3, 3226028315u, 2725707538u, 3232101343u, 2346810316u, 996177609u, 2816512701u, 0, EXP_TOLERANCE, 0}, +{ 4, 1078922874u, 2088062470u, 3201242716u, 420891118u, 1166568645u, 2120331304u, 0, EXP_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 1069661382u, 4196142410u, 0, EXP_TOLERANCE, 0}, +{ 6, 1077828855u, 1746012320u, 1054478713u, 3333988501u, 1118565158u, 699114409u, 0, EXP_TOLERANCE, 0}, +{ 7, 1066827528u, 183014794u, 3202039382u, 2016785810u, 1072716539u, 123580646u, 0, EXP_TOLERANCE, 0}, +{ 8, 3219777490u, 2688957927u, 1046089230u, 2709029994u, 1071414232u, 1149200657u, 0, EXP_TOLERANCE, 0}, +{ 9, 1070330066u, 624574473u, 1045840574u, 3473266330u, 1072949041u, 2377226642u, 0, EXP_TOLERANCE, 0}, +{ 10, 3217502754u, 1605286142u, 1068931671u, 4233776869u, 1072345653u, 1083445165u, 0, EXP_TOLERANCE, 0}, +{ 11, 1069780594u, 1857607719u, 3222889559u, 3417070006u, 1072866340u, 2899880271u, 0, EXP_TOLERANCE, 0}, +{ 12, 1081579891u, 3981151660u, 1088899021u, 1332651746u, 1643831522u, 1345086100u, 0, EXP_TOLERANCE, 0}, +{ 13, 1075860838u, 3824988054u, 1066856791u, 2070129652u, 1084982301u, 1912337979u, 0, EXP_TOLERANCE, 0}, +{ 14, 3218045550u, 1372884064u, 1080833116u, 3229926662u, 1072236030u, 3106255365u, 0, EXP_TOLERANCE, 0}, +{ 15, 1078097861u, 3217805330u, 3191644264u, 2014578707u, 1128498553u, 1807458751u, 0, EXP_TOLERANCE, 0}, +{ 16, 1080267391u, 265058758u, 3239903247u, 1630600647u, 1309523294u, 1523986687u, 0, EXP_TOLERANCE, 0}, +{ 17, 1073221381u, 1946677669u, 3198462609u, 926009897u, 1074920988u, 1465131398u, 0, EXP_TOLERANCE, 0}, +{ 18, 1073178875u, 2271884183u, 3203741999u, 2118617783u, 1074874144u, 2764688608u, 0, EXP_TOLERANCE, 0}, +{ 19, 3214772053u, 213658772u, 3249401130u, 314151656u, 1072633636u, 4130392148u, 0, EXP_TOLERANCE, 0}, +{ 20, 3228946464u, 1564829925u, 3197817016u, 497230814u, 544633027u, 34803168u, 0, EXP_TOLERANCE, 0}, +{ 21, 3219408362u, 2075329122u, 3231746400u, 169900577u, 1071709080u, 4184140427u, 0, EXP_TOLERANCE, 0}, +{ 22, 1067674434u, 541549344u, 1096608669u, 3119070100u, 1072733781u, 3804791293u, 0, EXP_TOLERANCE, 0}, +{ 23, 1075989871u, 567496114u, 1045286891u, 1969998540u, 1086482701u, 3180352384u, 0, EXP_TOLERANCE, 0}, +{ 24, 1069985379u, 1299369769u, 1049342524u, 4167404066u, 1072896531u, 1629596946u, 0, EXP_TOLERANCE, 0}, +{ 25, 3218302829u, 3348930841u, 1078472138u, 358457347u, 1072144759u, 3067143552u, 0, EXP_TOLERANCE, 0}, +{ 26, 1073166449u, 2192461366u, 1099527247u, 3184735642u, 1074860805u, 1775317488u, 0, EXP_TOLERANCE, 0}, +{ 27, 1068590412u, 331696577u, 3189610016u, 793242270u, 1072766977u, 1780216299u, 0, EXP_TOLERANCE, 0}, +{ 28, 3229460262u, 2322696981u, 1083791358u, 3020766674u, 354871428u, 1974410974u, 0, EXP_TOLERANCE, 0}, +{ 29, 1066922273u, 252085215u, 3214426435u, 4139068910u, 1072718053u, 1593026232u, 0, EXP_TOLERANCE, 0}, +{ 30, 3221457149u, 105589263u, 1056316170u, 261630827u, 1068909924u, 4008856079u, 0, EXP_TOLERANCE, 0}, +{ 31, 1082047584u, 428765703u, 3251828686u, 2009972239u, 1816546673u, 3462966019u, 0, EXP_TOLERANCE, 0}, +{ 32, 1079693651u, 3517376586u, 3240257920u, 3304487302u, 1234899857u, 1250614638u, 0, EXP_TOLERANCE, 0}, +{ 33, 3224100728u, 237004814u, 3237899261u, 3364008659u, 1051573078u, 1250441695u, 0, EXP_TOLERANCE, 0}, +{ 34, 3214121920u, 472004928u, 3226869477u, 1186387580u, 1072653472u, 186620643u, 0, EXP_TOLERANCE, 0}, +{ 35, 1068906914u, 4085763910u, 1106394906u, 2684738273u, 1072788350u, 3104710386u, 0, EXP_TOLERANCE, 0}, +{ 36, 1069636551u, 2055490142u, 3231581370u, 3879040079u, 1072845542u, 714008610u, 0, EXP_TOLERANCE, 0}, +{ 37, 3213093895u, 3725731239u, 1061652681u, 591292963u, 1072672946u, 3339751925u, 0, EXP_TOLERANCE, 0}, +{ 38, 3221869253u, 1147041027u, 3215417793u, 624695933u, 1067731891u, 1490517545u, 0, EXP_TOLERANCE, 0}, +{ 39, 3217587110u, 705725219u, 3238067573u, 1116238321u, 1072328147u, 3778478168u, 0, EXP_TOLERANCE, 0}, +{ 40, 3217852848u, 7287411u, 1045917232u, 116067742u, 1072274139u, 800660017u, 0, EXP_TOLERANCE, 0}, +{ 41, 3226423734u, 3604989074u, 1066381836u, 545298780u, 977849136u, 1417268874u, 0, EXP_TOLERANCE, 0}, +{ 42, 3221178088u, 1681476121u, 1060345752u, 3553822398u, 1069686696u, 3471070187u, 0, EXP_TOLERANCE, 0}, +{ 43, 1080811562u, 3410480388u, 1052460275u, 1660607230u, 1409975006u, 2715754844u, 0, EXP_TOLERANCE, 0}, +{ 44, 1077682533u, 1494984673u, 3196647153u, 287894723u, 1115159161u, 2741076212u, 0, EXP_TOLERANCE, 0}, +{ 45, 1068516615u, 644548665u, 1081948134u, 2442134629u, 1072762051u, 2743261701u, 0, EXP_TOLERANCE, 0}, +{ 46, 1077068335u, 2312530895u, 3221584595u, 3379665576u, 1101051489u, 3357999194u, 0, EXP_TOLERANCE, 0}, +{ 47, 1079308159u, 3018463866u, 1086226574u, 404012923u, 1199317798u, 2905917257u, 0, EXP_TOLERANCE, 0}, +{ 48, 1071024755u, 1710279345u, 3251401196u, 3528946000u, 1073135949u, 3958225700u, 0, EXP_TOLERANCE, 0}, +{ 49, 1070973535u, 2164450219u, 1083520023u, 3312018966u, 1073117849u, 2216238713u, 0, EXP_TOLERANCE, 0}, +{ 50, 1069831588u, 2648986431u, 1050330591u, 1474376550u, 1072873789u, 3409301846u, 0, EXP_TOLERANCE, 0}, +{ 51, 3214344972u, 1839068700u, 1077406406u, 3013052171u, 1072646645u, 923270809u, 0, EXP_TOLERANCE, 0}, +{ 52, 1066416574u, 772102380u, 3220729740u, 4219039958u, 1072709995u, 1305461407u, 0, EXP_TOLERANCE, 0}, +{ 53, 3223180765u, 3058618779u, 1046304788u, 3338676024u, 1061347966u, 1072422663u, 0, EXP_TOLERANCE, 0}, +{ 54, 1067949353u, 506286854u, 1094907481u, 2217000199u, 1072742741u, 3706634962u, 0, EXP_TOLERANCE, 0}, +{ 55, 1076136854u, 1147428263u, 1065432625u, 3034786717u, 1088176249u, 1631281700u, 0, EXP_TOLERANCE, 0}, +{ 56, 1075725296u, 2844125311u, 1082985198u, 2561492677u, 1084108872u, 2831233524u, 0, EXP_TOLERANCE, 0}, +{ 57, 3218876948u, 704542600u, 3222902057u, 2762779203u, 1071946646u, 190610401u, 0, EXP_TOLERANCE, 0}, +{ 58, 3215409254u, 184131949u, 3249723525u, 1667366082u, 1072600139u, 3411518971u, 0, EXP_TOLERANCE, 0}, +{ 59, 3221512446u, 3904224140u, 1067056698u, 2942159914u, 1068763822u, 1503414230u, 0, EXP_TOLERANCE, 0}, +{ 60, 1080713919u, 426114282u, 3209056785u, 1083606355u, 1391928446u, 3657642479u, 0, EXP_TOLERANCE, 0}, +{ 61, 1082048697u, 3774123863u, 1106787580u, 2722107965u, 1817003400u, 2241806278u, 0, EXP_TOLERANCE, 0}, +{ 62, 1077519332u, 1377734762u, 1104232051u, 2377063483u, 1111477508u, 844049504u, 0, EXP_TOLERANCE, 0}, +{ 63, 1072526287u, 1029739074u, 1105467109u, 3062201018u, 1074009347u, 4070953358u, 0, EXP_TOLERANCE, 0}, +{ 64, 3225304413u, 773857656u, 3214251949u, 335833884u, 1026865589u, 4235967790u, 0, EXP_TOLERANCE, 0}, +{ 65, 3216856098u, 1473865960u, 1103073830u, 4000427507u, 1072466239u, 2409423530u, 0, EXP_TOLERANCE, 0}, +{ 66, 1081165135u, 4242092620u, 1067009473u, 14539161u, 1490638029u, 1225921132u, 0, EXP_TOLERANCE, 0}, +{ 67, 3214536170u, 1732245037u, 1101371955u, 1533536108u, 1072640811u, 1577960147u, 0, EXP_TOLERANCE, 0}, +{ 68, 3228182475u, 1833841275u, 1099430098u, 4144145552u, 756118454u, 4124162837u, 0, EXP_TOLERANCE, 0}, +{ 69, 3227493247u, 935007012u, 3188865420u, 604442938u, 881158424u, 3059390833u, 0, EXP_TOLERANCE, 0}, +{ 70, 3217389013u, 2211464602u, 1046255144u, 1635910526u, 1072369536u, 4272624615u, 0, EXP_TOLERANCE, 0}, +{ 71, 1074725689u, 2549219008u, 3231633258u, 3733639385u, 1078468890u, 3538652097u, 0, EXP_TOLERANCE, 0}, +{ 72, 1075803633u, 1819374372u, 3202219056u, 2617077637u, 1084512755u, 3226299243u, 0, EXP_TOLERANCE, 0}, +{ 73, 1078616640u, 546465680u, 1048653554u, 532401530u, 1152481934u, 1660202510u, 0, EXP_TOLERANCE, 0}, +{ 74, 1066591187u, 2759019783u, 3221570188u, 3554409630u, 1072712770u, 3539689839u, 0, EXP_TOLERANCE, 0}, +{ 75, 3219222738u, 2527221960u, 1099107978u, 2696971136u, 1071812085u, 1070446248u, 0, EXP_TOLERANCE, 0}, +{ 76, 1079332208u, 173134582u, 1087299442u, 2877794600u, 1201571530u, 2450291402u, 0, EXP_TOLERANCE, 0}, +{ 77, 1076963290u, 547642046u, 3197285510u, 3521286127u, 1098574476u, 1604458491u, 0, EXP_TOLERANCE, 0}, +{ 78, 1073812126u, 1231582831u, 1090971734u, 1653446832u, 1075897874u, 3499443040u, 0, EXP_TOLERANCE, 0}, +{ 79, 1070779719u, 3762182190u, 3252967851u, 2615360375u, 1073051323u, 4198562047u, 0, EXP_TOLERANCE, 0}, +{ 80, 3216563063u, 2588067350u, 3206610957u, 3551059728u, 1072499190u, 3656398129u, 0, EXP_TOLERANCE, 0}, +{ 81, 3217464616u, 845263327u, 1073415902u, 1749010288u, 1072353625u, 2543242068u, 0, EXP_TOLERANCE, 0}, +{ 82, 3217110706u, 3092685191u, 3190678390u, 2872219490u, 1072429360u, 3896037664u, 0, EXP_TOLERANCE, 0}, +{ 83, 3220412207u, 4107255722u, 3205337291u, 3069068345u, 1070780355u, 264836658u, 0, EXP_TOLERANCE, 0}, +{ 84, 3227213641u, 2294867524u, 3216653996u, 2860384670u, 907048437u, 551868093u, 0, EXP_TOLERANCE, 0}, +{ 85, 3214297870u, 2265437201u, 3240198679u, 1234948614u, 1072648084u, 4060123138u, 0, EXP_TOLERANCE, 0}, +{ 86, 3219505657u, 1186945904u, 3251167793u, 1896750851u, 1071658624u, 3764186265u, 0, EXP_TOLERANCE, 0}, +{ 87, 1075284022u, 3686084548u, 1079286273u, 3309277689u, 1081503302u, 60883681u, 0, EXP_TOLERANCE, 0}, +{ 88, 3221379088u, 3006860614u, 3231412671u, 2504194724u, 1069144247u, 54379178u, 0, EXP_TOLERANCE, 0}, +{ 89, 3224614924u, 1948717780u, 1048317852u, 3791803982u, 1042772858u, 2420958386u, 0, EXP_TOLERANCE, 0}, +{ 90, 1070636471u, 4272034420u, 3192982124u, 1526175922u, 1073004093u, 3308824510u, 0, EXP_TOLERANCE, 0}, +{ 91, 3226943458u, 4108948538u, 1104691287u, 640541190u, 931953430u, 3437532117u, 0, EXP_TOLERANCE, 0}, +{ 92, 3217743177u, 3259274853u, 1082507103u, 3677038020u, 1072296221u, 2033726093u, 0, EXP_TOLERANCE, 0}, +{ 93, 1076841042u, 3781708548u, 1096584871u, 1207386447u, 1096271275u, 77258u, 0, EXP_TOLERANCE, 0}, +{ 94, 3213861096u, 3011191657u, 1103798670u, 1096124830u, 1072661109u, 742458517u, 0, EXP_TOLERANCE, 0}, +{ 95, 1071623631u, 2540404725u, 3240157452u, 4122845725u, 1073364830u, 3560000573u, 0, EXP_TOLERANCE, 0}, +{ 96, 1076303678u, 311336721u, 3214382367u, 4212533768u, 1090074692u, 2663913965u, 0, EXP_TOLERANCE, 0}, +{ 97, 1067916643u, 1769686293u, 3240200923u, 3538602249u, 1072741671u, 4116363241u, 0, EXP_TOLERANCE, 0}, +{ 98, 1075081821u, 508056696u, 1103793878u, 776520138u, 1080344162u, 242331594u, 0, EXP_TOLERANCE, 0}, +{ 99, 1080890481u, 4064962760u, 1077424413u, 819766631u, 1424537001u, 3317334315u, 0, EXP_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1076952439u, 2142218601u, 0, EXP_TOLERANCE, 0}, +{ 101, 1076003603u, 2514398118u, 1076579751u, 870169764u, 1086615970u, 3988144815u, 0, EXP_TOLERANCE, 0}, +{ 102, 3227977024u, 1190259653u, 1069112254u, 3417249840u, 794021017u, 2254415465u, 0, EXP_TOLERANCE, 0}, +{ 103, 3214634603u, 3467757357u, 3215075200u, 2168175352u, 1072637814u, 1866384359u, 0, EXP_TOLERANCE, 0}, +{ 104, 3226011647u, 1508888184u, 1060430241u, 3524949092u, 996893071u, 1032082419u, 0, EXP_TOLERANCE, 0}, +{ 105, 3215238675u, 166402802u, 3237198975u, 3572369260u, 1072610353u, 2543405344u, 0, EXP_TOLERANCE, 0}, +{ 106, 1075575366u, 2441536203u, 3202753937u, 3658194573u, 1083247124u, 1565872384u, 0, EXP_TOLERANCE, 0}, +{ 107, 1070781516u, 2479742828u, 1062342831u, 4214154303u, 1073051926u, 2877262325u, 0, EXP_TOLERANCE, 0}, +{ 108, 1076105338u, 426896765u, 1066474375u, 2201754442u, 1087780533u, 3456888252u, 0, EXP_TOLERANCE, 0}, +{ 109, 3214503389u, 2055773734u, 3239267288u, 291396537u, 1072641810u, 1723790219u, 0, EXP_TOLERANCE, 0}, +{ 110, 3224385121u, 874125203u, 3210508124u, 4091098764u, 1048079713u, 3922271118u, 0, EXP_TOLERANCE, 0}, +{ 111, 1072007482u, 120488169u, 3241241441u, 1985269424u, 1073699997u, 3263405331u, 0, EXP_TOLERANCE, 0}, +{ 112, 3218073746u, 2243036871u, 3243941101u, 740033495u, 1072230527u, 3210238367u, 0, EXP_TOLERANCE, 0}, +{ 113, 3218862090u, 1176656356u, 1074261978u, 3588756231u, 1071951438u, 3060660754u, 0, EXP_TOLERANCE, 0}, +{ 114, 3228699543u, 3037249392u, 1061635587u, 1173102190u, 635829382u, 979909056u, 0, EXP_TOLERANCE, 0}, +{ 115, 3224626669u, 2882725208u, 1071440059u, 69225090u, 1042520691u, 1843293285u, 0, EXP_TOLERANCE, 0}, +{ 116, 3218954930u, 272319256u, 1072073912u, 2493997123u, 1071921768u, 657202412u, 0, EXP_TOLERANCE, 0}, +{ 117, 1070303098u, 188610379u, 3232757923u, 2209647371u, 1072944854u, 4022783570u, 0, EXP_TOLERANCE, 0}, +{ 118, 3225224181u, 1990439193u, 1078073146u, 622849962u, 1028759537u, 3564758723u, 0, EXP_TOLERANCE, 0}, +{ 119, 1069718653u, 756052458u, 1081649113u, 2247475162u, 1072857353u, 554847761u, 0, EXP_TOLERANCE, 0}, +{ 120, 1071060248u, 3878055211u, 3222407050u, 2979438623u, 1073148623u, 540184608u, 0, EXP_TOLERANCE, 0}, +{ 121, 3214165365u, 2676398686u, 1105124431u, 3631096636u, 1072652140u, 2373850172u, 0, EXP_TOLERANCE, 0}, +{ 122, 1071370846u, 1697791764u, 3198136112u, 2299842819u, 1073264221u, 1573541634u, 0, EXP_TOLERANCE, 0}, +{ 123, 1074939040u, 1931502677u, 3215264397u, 3016456382u, 1079513197u, 1530595558u, 0, EXP_TOLERANCE, 0}, +{ 124, 1073302002u, 343404215u, 1061072607u, 4266232536u, 1075015225u, 3004108006u, 0, EXP_TOLERANCE, 0}, +{ 125, 3225502196u, 4140316002u, 1082896196u, 868256971u, 1020424521u, 3460157795u, 0, EXP_TOLERANCE, 0}, +{ 126, 1074374234u, 1864139509u, 3187675097u, 3084482407u, 1077456782u, 4150857240u, 0, EXP_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 1071069433u, 783584364u, 0, EXP_TOLERANCE, 0}, +{ 128, 1070891968u, 3943389284u, 1046724025u, 3626825684u, 1073089477u, 1797152336u, 0, EXP_TOLERANCE, 0}, +{ 129, 1067443098u, 967350972u, 1093012318u, 448002663u, 1072726416u, 797307317u, 0, EXP_TOLERANCE, 0}, +{ 130, 3228777187u, 105058217u, 1069733884u, 171786224u, 607209346u, 771064197u, 0, EXP_TOLERANCE, 0}, +{ 131, 3213731756u, 2863482262u, 3204997271u, 877784425u, 1072663100u, 426007619u, 0, EXP_TOLERANCE, 0}, +{ 132, 3216260801u, 2801782962u, 3213604117u, 762347195u, 1072533788u, 600737923u, 0, EXP_TOLERANCE, 0}, +{ 133, 3224049543u, 2317950339u, 3246333414u, 2135700283u, 1052112831u, 3287040885u, 0, EXP_TOLERANCE, 0}, +{ 134, 1069099309u, 4171919805u, 1082858682u, 2180920863u, 1072801541u, 2165096902u, 0, EXP_TOLERANCE, 0}, +{ 135, 3221197660u, 1918836931u, 1083603224u, 3137821660u, 1069664732u, 2532148552u, 0, EXP_TOLERANCE, 0}, +{ 136, 1081882778u, 3456203663u, 3235600523u, 2335688936u, 1755681633u, 4057860990u, 0, EXP_TOLERANCE, 0}, +{ 137, 1066396570u, 4170235262u, 1051824459u, 521583737u, 1072709719u, 1024167559u, 0, EXP_TOLERANCE, 0}, +{ 138, 1075056847u, 1296623194u, 3250673860u, 2442872540u, 1080220627u, 2781106181u, 0, EXP_TOLERANCE, 0}, +{ 139, 1071121461u, 289979405u, 1049514449u, 3865737145u, 1073170732u, 3903607776u, 0, EXP_TOLERANCE, 0}, +{ 140, 1074250368u, 3699090239u, 1054539840u, 3259249360u, 1077116363u, 502955531u, 0, EXP_TOLERANCE, 0}, +{ 141, 1079640884u, 1619819023u, 1045993352u, 1022642459u, 1230064705u, 1444182022u, 0, EXP_TOLERANCE, 0}, +{ 142, 1075141548u, 19455098u, 3229182089u, 2096003654u, 1080692026u, 447080049u, 0, EXP_TOLERANCE, 0}, +{ 143, 1074200784u, 3803689997u, 1071630912u, 2263729518u, 1077001092u, 1334450617u, 0, EXP_TOLERANCE, 0}, +{ 144, 1080385741u, 2816837387u, 1063422305u, 2597606398u, 1331342121u, 1095829056u, 0, EXP_TOLERANCE, 0}, +{ 145, 1072245897u, 3680967506u, 1040201163u, 179224723u, 1073844641u, 930186774u, 0, EXP_TOLERANCE, 0}, +{ 146, 3213795591u, 978126928u, 1101553990u, 4047893399u, 1072662117u, 1101190271u, 0, EXP_TOLERANCE, 0}, +{ 147, 3221273469u, 4059818629u, 1042678728u, 3640293589u, 1069522282u, 1267895499u, 0, EXP_TOLERANCE, 0}, +{ 148, 3228541096u, 3383497159u, 1070002807u, 1527313008u, 689917614u, 1535716049u, 0, EXP_TOLERANCE, 0}, +{ 149, 3216339167u, 2599946514u, 1104170406u, 2738675352u, 1072524758u, 1435148139u, 0, EXP_TOLERANCE, 0}, +{ 150, 1081115375u, 3616571377u, 1060859316u, 1130603218u, 1472304603u, 3187069287u, 0, EXP_TOLERANCE, 0}, +{ 151, 1073931644u, 3859211180u, 1067940450u, 1744531824u, 1076181432u, 1345205949u, 0, EXP_TOLERANCE, 0}, +{ 152, 1065900012u, 1958025850u, 3236511256u, 2472176453u, 1072705786u, 932607201u, 0, EXP_TOLERANCE, 0}, +{ 153, 3223669905u, 182132862u, 3250520938u, 3924356991u, 1056496908u, 661218322u, 0, EXP_TOLERANCE, 0}, +{ 154, 3224210428u, 35632886u, 3209806504u, 1453402523u, 1050263526u, 3107753313u, 0, EXP_TOLERANCE, 0}, +{ 155, 1076182070u, 743225214u, 3202890678u, 142917400u, 1088680431u, 3782028986u, 0, EXP_TOLERANCE, 0}, +{ 156, 1075442096u, 1472665012u, 3203138231u, 256588219u, 1082425160u, 2507283120u, 0, EXP_TOLERANCE, 0}, +{ 157, 1079253522u, 1062927000u, 1061134072u, 931677439u, 1194330468u, 3538812810u, 0, EXP_TOLERANCE, 0}, +{ 158, 1069912068u, 2320910576u, 1055663370u, 288059864u, 1072885638u, 2756379436u, 0, EXP_TOLERANCE, 0}, +{ 159, 1075812365u, 1448349062u, 3199478070u, 3454027134u, 1084557930u, 2428474527u, 0, EXP_TOLERANCE, 0}, +{ 160, 3224875886u, 4215445172u, 3196654963u, 2231888973u, 1036778828u, 4095096416u, 0, EXP_TOLERANCE, 0}, +{ 161, 3227757863u, 40413554u, 3232578253u, 983832844u, 834531371u, 1749210300u, 0, EXP_TOLERANCE, 0}, +{ 162, 3221624382u, 3995725873u, 1050082319u, 777231627u, 1068511312u, 2187487459u, 0, EXP_TOLERANCE, 0}, +{ 163, 1066152450u, 672789828u, 3253385962u, 2982787335u, 1072707783u, 3636282767u, 0, EXP_TOLERANCE, 0}, +{ 164, 1072585179u, 2075971825u, 1070166500u, 4034633931u, 1074046830u, 2188206437u, 0, EXP_TOLERANCE, 0}, +{ 165, 3218434785u, 1018222907u, 3244621407u, 3090050495u, 1072096796u, 906290978u, 0, EXP_TOLERANCE, 0}, +{ 166, 1071875189u, 937732557u, 3200798890u, 2557898276u, 1073574348u, 956132579u, 0, EXP_TOLERANCE, 0}, +{ 167, 1075196588u, 130346162u, 3223590310u, 275568693u, 1081086381u, 3765310085u, 0, EXP_TOLERANCE, 0}, +{ 168, 1065967541u, 3807416441u, 1075961161u, 3706820266u, 1072706320u, 1003056074u, 0, EXP_TOLERANCE, 0}, +{ 169, 3219244733u, 1710131411u, 1078123323u, 1900790503u, 1071799398u, 2869753911u, 0, EXP_TOLERANCE, 0}, +{ 170, 3226236449u, 3420420033u, 3210844787u, 588423066u, 986539436u, 3295138570u, 0, EXP_TOLERANCE, 0}, +{ 171, 1067509906u, 1160162008u, 3246307879u, 4265764460u, 1072728454u, 3054362979u, 0, EXP_TOLERANCE, 0}, +{ 172, 1080523338u, 366653268u, 3188814424u, 466059202u, 1356813060u, 760636581u, 0, EXP_TOLERANCE, 0}, +{ 173, 3222433435u, 1325936170u, 3221436876u, 680097612u, 1065643005u, 1532992433u, 0, EXP_TOLERANCE, 0}, +{ 174, 3225711052u, 1827735934u, 3200554324u, 2875599271u, 1010834241u, 3777705215u, 0, EXP_TOLERANCE, 0}, +{ 175, 3213050498u, 3117037091u, 3239246636u, 15838845u, 1072673618u, 1728450485u, 0, EXP_TOLERANCE, 0}, +{ 176, 1067702644u, 749718883u, 3223587064u, 1523766569u, 1072734697u, 3920212286u, 0, EXP_TOLERANCE, 0}, +{ 177, 1066853747u, 1966536294u, 3250158026u, 699164258u, 1072716957u, 3817171147u, 0, EXP_TOLERANCE, 0}, +{ 178, 1079174067u, 3759049394u, 1106085272u, 1183789499u, 1186993088u, 3807740687u, 0, EXP_TOLERANCE, 0}, +{ 179, 1074910167u, 1970107747u, 1095245453u, 2308233883u, 1079348720u, 1531523305u, 0, EXP_TOLERANCE, 0}, +{ 180, 1076367836u, 1491017852u, 1041444355u, 1723375725u, 1090818724u, 2037541645u, 0, EXP_TOLERANCE, 0}, +{ 181, 3219775798u, 1141349287u, 1097465301u, 3403438584u, 1071415739u, 1183515418u, 0, EXP_TOLERANCE, 0}, +{ 182, 3224280452u, 1711085243u, 3250239076u, 1377484108u, 1049505584u, 2904152696u, 0, EXP_TOLERANCE, 0}, +{ 183, 1079510651u, 2880275004u, 1084039594u, 1611394950u, 1217987707u, 2867297031u, 0, EXP_TOLERANCE, 0}, +{ 184, 3224784251u, 2626629370u, 1063771493u, 1499080813u, 1038898033u, 1353327733u, 0, EXP_TOLERANCE, 0}, +{ 185, 1068862751u, 3936262414u, 1103919063u, 3175668759u, 1072785344u, 648861936u, 0, EXP_TOLERANCE, 0}, +{ 186, 3217418903u, 1270950554u, 3194616071u, 3680565379u, 1072363229u, 951093660u, 0, EXP_TOLERANCE, 0}, +{ 187, 3217585407u, 1066985223u, 3221613219u, 4089383168u, 1072328499u, 2267080590u, 0, EXP_TOLERANCE, 0}, +{ 188, 3220204567u, 4017329311u, 3208334452u, 1667591498u, 1071050331u, 296637723u, 0, EXP_TOLERANCE, 0}, +{ 189, 1077678397u, 3154656624u, 1061894279u, 3886344038u, 1115063060u, 1143078455u, 0, EXP_TOLERANCE, 0}, +{ 190, 1068478737u, 977586119u, 3209762784u, 953839852u, 1072760203u, 1532008227u, 0, EXP_TOLERANCE, 0}, +{ 191, 1081896575u, 143071571u, 3206165386u, 913097445u, 1760793137u, 1725664653u, 0, EXP_TOLERANCE, 0}, +{ 192, 3213634128u, 1371169579u, 1057079837u, 2594818628u, 1072664604u, 686553362u, 0, EXP_TOLERANCE, 0}, +{ 193, 3228724664u, 2259342224u, 3217432469u, 1824221478u, 626552221u, 555843157u, 0, EXP_TOLERANCE, 0}, +{ 194, 3227960407u, 1576604497u, 1079368611u, 185078728u, 797102216u, 2312754753u, 0, EXP_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 1068312202u, 3537952111u, 0, EXP_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1074196068u, 1478831994u, 0, EXP_TOLERANCE, 0}, +{ 197, 3225258784u, 1941318385u, 1045807374u, 792193370u, 1027918372u, 749451785u, 0, EXP_TOLERANCE, 0}, +{ 198, 3225716754u, 1299392207u, 3212131720u, 3205732280u, 1010504056u, 162887831u, 0, EXP_TOLERANCE, 0}, +{ 199, 1079824436u, 3035093505u, 1052187689u, 3287702190u, 1246977273u, 3659026689u, 0, EXP_TOLERANCE, 0}, +{ 200, 3227801892u, 2160225215u, 1102624859u, 836655570u, 826392674u, 2334422787u, 0, EXP_TOLERANCE, 0}, +{ 201, 1079946410u, 3360816360u, 3246176356u, 172860634u, 1258302663u, 595783054u, 0, EXP_TOLERANCE, 0}, +{ 202, 1073092940u, 146831910u, 1051558014u, 2340722078u, 1074779693u, 2145151815u, 0, EXP_TOLERANCE, 0}, +{ 203, 3224124895u, 1603798153u, 3207725532u, 1099413093u, 1051244985u, 2989707675u, 0, EXP_TOLERANCE, 0}, +{ 204, 3227804010u, 2429340443u, 3190303581u, 3223770005u, 825977359u, 2890255810u, 0, EXP_TOLERANCE, 0}, +{ 205, 1073785807u, 955542166u, 3230415151u, 275583938u, 1075843652u, 1493078710u, 0, EXP_TOLERANCE, 0}, +{ 206, 1078291818u, 513397822u, 1090646554u, 2089321329u, 1137467212u, 351397573u, 0, EXP_TOLERANCE, 0}, +{ 207, 3214141396u, 2782073372u, 1046063872u, 4023829068u, 1072652875u, 138208091u, 0, EXP_TOLERANCE, 0}, +{ 208, 1079690454u, 3242223094u, 3194111199u, 4264674108u, 1234585286u, 346227329u, 0, EXP_TOLERANCE, 0}, +{ 209, 3225927909u, 3506346169u, 1047020885u, 1742757458u, 1000737156u, 928258562u, 0, EXP_TOLERANCE, 0}, +{ 210, 3214684573u, 1265459564u, 3193450280u, 3650514880u, 1072636294u, 3135130836u, 0, EXP_TOLERANCE, 0}, +{ 211, 1075464434u, 1525260440u, 3235452527u, 2612331392u, 1082544645u, 3469250844u, 0, EXP_TOLERANCE, 0}, +{ 212, 3227697400u, 1263613754u, 3219096387u, 635677201u, 845641032u, 2821259135u, 0, EXP_TOLERANCE, 0}, +{ 213, 3217806423u, 4140947288u, 3200792376u, 2013265346u, 1072283451u, 2224455623u, 0, EXP_TOLERANCE, 0}, +{ 214, 3227954296u, 1912759945u, 3237045253u, 1351396825u, 798217665u, 2086155788u, 0, EXP_TOLERANCE, 0}, +{ 215, 3228282218u, 1001433078u, 3206926643u, 2741676659u, 737645798u, 2489257394u, 0, EXP_TOLERANCE, 0}, +{ 216, 1075680726u, 1088945233u, 1085095743u, 3986114865u, 1083799535u, 115784002u, 0, EXP_TOLERANCE, 0}, +{ 217, 3219928361u, 831239754u, 1099828675u, 3071308141u, 1071284656u, 1977716179u, 0, EXP_TOLERANCE, 0}, +{ 218, 3222688769u, 3473592372u, 1102759382u, 1309576357u, 1064228744u, 3715932954u, 0, EXP_TOLERANCE, 0}, +{ 219, 3229166610u, 2042340367u, 1091945628u, 2062772374u, 463396439u, 3913343620u, 0, EXP_TOLERANCE, 0}, +{ 220, 3214688631u, 1840632537u, 1096533424u, 807510337u, 1072636171u, 1550550553u, 0, EXP_TOLERANCE, 0}, +{ 221, 3224111690u, 144814872u, 3212698915u, 2282965697u, 1051416747u, 218973180u, 0, EXP_TOLERANCE, 0}, +{ 222, 1073333582u, 2552499583u, 3229111426u, 1470130815u, 1075054160u, 3344155594u, 0, EXP_TOLERANCE, 0}, +{ 223, 3227364425u, 2858583811u, 1089760910u, 6360994u, 893069846u, 2777198087u, 0, EXP_TOLERANCE, 0}, +{ 224, 3215042145u, 1614537194u, 1075198900u, 4088705365u, 1072622185u, 3424131072u, 0, EXP_TOLERANCE, 0}, +{ 225, 3228918974u, 3545570051u, 1065221325u, 1629217700u, 554828172u, 1332220829u, 0, EXP_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1074189549u, 528208211u, 0, EXP_TOLERANCE, 0}, +{ 227, 3215677054u, 2406734491u, 1042055360u, 89226663u, 1072584209u, 97402367u, 0, EXP_TOLERANCE, 0}, +{ 228, 3214625449u, 1618759139u, 3194723421u, 3888234802u, 1072638092u, 4156317286u, 0, EXP_TOLERANCE, 0}, +{ 229, 1068988736u, 3590035633u, 3212424262u, 2892456615u, 1072793942u, 113645931u, 0, EXP_TOLERANCE, 0}, +{ 230, 3213011732u, 2431246964u, 3241512456u, 183850734u, 1072674218u, 2322381535u, 0, EXP_TOLERANCE, 0}, +{ 231, 1076918189u, 3088319870u, 3211544311u, 862225364u, 1097534688u, 1720101583u, 0, EXP_TOLERANCE, 0}, +{ 232, 3224808904u, 3495352775u, 1058576726u, 596957268u, 1038316024u, 2704436146u, 0, EXP_TOLERANCE, 0}, +{ 233, 1066476292u, 1839214511u, 3205004060u, 1923240983u, 1072710943u, 3120088286u, 0, EXP_TOLERANCE, 0}, +{ 234, 1069608200u, 739619702u, 3223356436u, 2689885273u, 1072841490u, 1671733001u, 0, EXP_TOLERANCE, 0}, +{ 235, 3216053611u, 2143376228u, 1098306332u, 3760236188u, 1072557866u, 124949512u, 0, EXP_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1078184623u, 1598497576u, 0, EXP_TOLERANCE, 0}, +{ 237, 3219408869u, 2493598049u, 3194927008u, 1689107592u, 1071708811u, 3795731906u, 0, EXP_TOLERANCE, 0}, +{ 238, 3213058631u, 1578976988u, 1066368383u, 2117279163u, 1072673492u, 2246846524u, 0, EXP_TOLERANCE, 0}, +{ 239, 3221939535u, 3425290087u, 1098487295u, 1263412017u, 1067565021u, 2944648507u, 0, EXP_TOLERANCE, 0}, +{ 240, 3217869948u, 3635396812u, 1070999426u, 3965655689u, 1072270721u, 3634981027u, 0, EXP_TOLERANCE, 0}, +{ 241, 1069633530u, 2183973116u, 1101098363u, 1118613350u, 1072845109u, 3339325204u, 0, EXP_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 1067550572u, 2506509655u, 0, EXP_TOLERANCE, 0}, +{ 243, 3212871842u, 3570940805u, 3230316437u, 3596080877u, 1072676385u, 2634172860u, 0, EXP_TOLERANCE, 0}, +{ 244, 3217646749u, 980880313u, 1079833442u, 884465057u, 1072315877u, 2036884740u, 0, EXP_TOLERANCE, 0}, +{ 245, 1080054180u, 2558179220u, 1052873711u, 1233598120u, 1270109524u, 2524660391u, 0, EXP_TOLERANCE, 0}, +{ 246, 1067038165u, 1909994277u, 1085015978u, 2991527452u, 1072719908u, 2697640880u, 0, EXP_TOLERANCE, 0}, +{ 247, 1070292444u, 1680290941u, 1074309900u, 2943870846u, 1072943204u, 3151340758u, 0, EXP_TOLERANCE, 0}, +{ 248, 1069981892u, 1451927357u, 3228615456u, 1502585517u, 1072896011u, 500177266u, 0, EXP_TOLERANCE, 0}, +{ 249, 3224677615u, 751136990u, 3230392165u, 3493275472u, 1041368347u, 2625785490u, 0, EXP_TOLERANCE, 0}, +{ 250, 1079491599u, 1209623292u, 3238056647u, 979495322u, 1216301027u, 1345426533u, 0, EXP_TOLERANCE, 0}, +{ 251, 3228404200u, 1717672108u, 1048120593u, 531240316u, 715186535u, 1714377665u, 0, EXP_TOLERANCE, 0}, +{ 252, 1068854987u, 3548721654u, 1086112947u, 3391817224u, 1072784816u, 1708052498u, 0, EXP_TOLERANCE, 0}, +{ 253, 1074691123u, 2758195125u, 1100880260u, 2028440924u, 1078367996u, 3066779734u, 0, EXP_TOLERANCE, 0}, +{ 254, 1076883861u, 2750123373u, 3232200256u, 1086294931u, 1096841846u, 788833203u, 0, EXP_TOLERANCE, 0}, +{ 255, 1065978768u, 2986160931u, 1076097908u, 2540046258u, 1072706409u, 172413673u, 0, EXP_TOLERANCE, 0}, +{ 256, 3224990842u, 451471221u, 1064816262u, 4187644495u, 1034117199u, 2383134537u, 0, EXP_TOLERANCE, 0}, +{ 257, 1080585860u, 2439500162u, 1065280276u, 1979490284u, 1368362891u, 4075308906u, 0, EXP_TOLERANCE, 0}, +{ 258, 1065581656u, 2283342035u, 1078398157u, 1345997553u, 1072703272u, 1306641747u, 0, EXP_TOLERANCE, 0}, +{ 259, 3219540804u, 179066662u, 1103272172u, 1217337578u, 1071637260u, 357090176u, 0, EXP_TOLERANCE, 0}, +{ 260, 3218902409u, 3779303391u, 3210023352u, 3115946280u, 1071938472u, 1299997584u, 0, EXP_TOLERANCE, 0}, +{ 261, 3213961394u, 286247089u, 1085153597u, 713645369u, 1072658399u, 978675133u, 0, EXP_TOLERANCE, 0}, +{ 262, 1077941860u, 1468283899u, 1042831668u, 2022736418u, 1121280747u, 2888650454u, 0, EXP_TOLERANCE, 0}, +{ 263, 1076847649u, 3305564080u, 1065483445u, 482392433u, 1096351817u, 3604886221u, 0, EXP_TOLERANCE, 0}, +{ 264, 3216375871u, 2256346551u, 3222430705u, 2071674991u, 1072520543u, 2427121917u, 0, EXP_TOLERANCE, 0}, +{ 265, 3216607607u, 2295269094u, 1084451053u, 2773103941u, 1072494144u, 3385062574u, 0, EXP_TOLERANCE, 0}, +{ 266, 1075028218u, 1482721827u, 1092243422u, 3125409590u, 1080092760u, 3102857585u, 0, EXP_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 1069820730u, 3040152884u, 0, EXP_TOLERANCE, 0}, +{ 268, 3226133060u, 1105857967u, 3241990046u, 2703723225u, 991268023u, 2258767820u, 0, EXP_TOLERANCE, 0}, +{ 269, 1066084243u, 174689677u, 1079333374u, 3947057014u, 1072707243u, 3130733960u, 0, EXP_TOLERANCE, 0}, +{ 270, 1077878947u, 2023082423u, 3242081486u, 1169047927u, 1119748901u, 3426525989u, 0, EXP_TOLERANCE, 0}, +{ 271, 1070817355u, 3742487766u, 1043425732u, 194972788u, 1073064002u, 3585031582u, 0, EXP_TOLERANCE, 0}, +{ 272, 3220083283u, 2136071361u, 3211529757u, 993675115u, 1071160954u, 3515311890u, 0, EXP_TOLERANCE, 0}, +{ 273, 3219954837u, 210772141u, 3241441539u, 580731413u, 1071262863u, 2304851028u, 0, EXP_TOLERANCE, 0}, +{ 274, 1078111773u, 1751560711u, 1074522705u, 180987057u, 1129175206u, 2518765659u, 0, EXP_TOLERANCE, 0}, +{ 275, 1071997471u, 2552236599u, 1088658621u, 2112468655u, 1073690210u, 1525052105u, 0, EXP_TOLERANCE, 0}, +{ 276, 3213407865u, 1578223762u, 3224596567u, 2456166162u, 1072668094u, 738092801u, 0, EXP_TOLERANCE, 0}, +{ 277, 1070041301u, 2110924310u, 1086207177u, 3161208323u, 1072904904u, 3047488155u, 0, EXP_TOLERANCE, 0}, +{ 278, 3223474786u, 2352173188u, 1079361728u, 4070222179u, 1058769652u, 3906475321u, 0, EXP_TOLERANCE, 0}, +{ 279, 1080041384u, 2481562701u, 1090937016u, 3809489716u, 1267797634u, 404634930u, 0, EXP_TOLERANCE, 0}, +{ 280, 3215877019u, 330905705u, 1086260896u, 90264431u, 1072572396u, 1208844547u, 0, EXP_TOLERANCE, 0}, +{ 281, 1065895785u, 4162008079u, 3194387916u, 759522153u, 1072705752u, 3450625873u, 0, EXP_TOLERANCE, 0}, +{ 282, 1075772157u, 1839697482u, 3216442625u, 2211508949u, 1084361851u, 2955268254u, 0, EXP_TOLERANCE, 0}, +{ 283, 3227787115u, 3736863454u, 1063475914u, 3150741666u, 829092625u, 968779094u, 0, EXP_TOLERANCE, 0}, +{ 284, 1070223067u, 4200269406u, 3236646101u, 1061812176u, 1072932509u, 3212891973u, 0, EXP_TOLERANCE, 0}, +{ 285, 1074975099u, 106027290u, 3234978297u, 2245237549u, 1079745755u, 680984417u, 0, EXP_TOLERANCE, 0}, +{ 286, 3228109966u, 2132131375u, 3250483427u, 3449276437u, 769507420u, 1538427034u, 0, EXP_TOLERANCE, 0}, +{ 287, 1077854442u, 2334440944u, 1105423490u, 4004336184u, 1119135302u, 1452344798u, 0, EXP_TOLERANCE, 0}, +{ 288, 3220869856u, 4090088208u, 1042030013u, 3898658299u, 1070092575u, 3230411400u, 0, EXP_TOLERANCE, 0}, +{ 289, 3217345248u, 2272831437u, 3253082595u, 2639188641u, 1072378813u, 2389059511u, 0, EXP_TOLERANCE, 0}, +{ 290, 1069446748u, 1856594168u, 3189515294u, 4101853676u, 1072825748u, 3613517627u, 0, EXP_TOLERANCE, 0}, +{ 291, 1073915260u, 2211699255u, 3195060344u, 3865018604u, 1076138633u, 3271750546u, 0, EXP_TOLERANCE, 0}, +{ 292, 3227038370u, 996259334u, 3241496889u, 3782673116u, 923155228u, 4107521594u, 0, EXP_TOLERANCE, 0}, +{ 293, 1080256379u, 3840380763u, 1048674041u, 550040067u, 1307510065u, 928374556u, 0, EXP_TOLERANCE, 0}, +{ 294, 3229399497u, 95874100u, 3237232828u, 2645647822u, 377375137u, 719222175u, 0, EXP_TOLERANCE, 0}, +{ 295, 1065685736u, 3441419500u, 3252367038u, 876710419u, 1072704093u, 2246841165u, 0, EXP_TOLERANCE, 0}, +{ 296, 3226010640u, 2560836004u, 3199616543u, 1180840586u, 996949059u, 82980477u, 0, EXP_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 1068555547u, 3858061400u, 0, EXP_TOLERANCE, 0}, +{ 298, 1075345350u, 1447312532u, 1081476588u, 780366847u, 1081890764u, 2057809468u, 0, EXP_TOLERANCE, 0}, +{ 299, 1073618219u, 2842113832u, 3216156731u, 225159029u, 1075463434u, 3769540376u, 0, EXP_TOLERANCE, 0}, +{ 300, 1079242825u, 1601981129u, 3234628869u, 2236538344u, 1193325070u, 2364090570u, 0, EXP_TOLERANCE, 0}, +{ 301, 1076784916u, 2194185737u, 3242362684u, 87913366u, 1095695295u, 2239129155u, 0, EXP_TOLERANCE, 0}, +{ 302, 3215861096u, 1346862963u, 1077836259u, 3604666660u, 1072573334u, 1410091035u, 0, EXP_TOLERANCE, 0}, +{ 303, 3218547435u, 3115209742u, 1099332326u, 1325101950u, 1072057026u, 3877451405u, 0, EXP_TOLERANCE, 0}, +{ 304, 3221400314u, 3889223100u, 1053247613u, 3371396923u, 1069077038u, 2922304680u, 0, EXP_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 1070705523u, 1262184460u, 0, EXP_TOLERANCE, 0}, +{ 306, 3218064691u, 1532426189u, 1063168268u, 3397022615u, 1072232293u, 14882088u, 0, EXP_TOLERANCE, 0}, +{ 307, 3216761961u, 89324166u, 1079206060u, 3429424710u, 1072476762u, 2025275555u, 0, EXP_TOLERANCE, 0}, +{ 308, 3214345198u, 747591401u, 1072238381u, 2803213904u, 1072646638u, 1362298570u, 0, EXP_TOLERANCE, 0}, +{ 309, 1078530868u, 271904221u, 1044258318u, 1858545114u, 1148479724u, 2228394364u, 0, EXP_TOLERANCE, 0}, +{ 310, 3222826034u, 314958082u, 3249912496u, 2966213175u, 1063404822u, 2546095187u, 0, EXP_TOLERANCE, 0}, +{ 311, 3215005206u, 3119528953u, 3217179014u, 2908718240u, 1072624417u, 1982673129u, 0, EXP_TOLERANCE, 0}, +{ 312, 3226738936u, 2018361566u, 1100926600u, 3985805054u, 950839806u, 2828622982u, 0, EXP_TOLERANCE, 0}, +{ 313, 1073278308u, 409584884u, 3239758947u, 755795129u, 1074986774u, 588973461u, 0, EXP_TOLERANCE, 0}, +{ 314, 1074723870u, 1819156379u, 3251342302u, 2982669005u, 1078463413u, 1788076940u, 0, EXP_TOLERANCE, 0}, +{ 315, 1080591913u, 2080534280u, 3188254060u, 449171797u, 1369474257u, 3068381489u, 0, EXP_TOLERANCE, 0}, +{ 316, 1079179684u, 168744837u, 3214950009u, 1322217822u, 1187423881u, 280204842u, 0, EXP_TOLERANCE, 0}, +{ 317, 3229061076u, 3250487255u, 1062120700u, 1876195180u, 502358220u, 4092158339u, 0, EXP_TOLERANCE, 0}, +{ 318, 3223197752u, 1336400247u, 1098057903u, 3314079581u, 1061270312u, 2063251548u, 0, EXP_TOLERANCE, 0}, +{ 319, 3216261732u, 265025555u, 1063854282u, 3779482256u, 1072533680u, 2941193185u, 0, EXP_TOLERANCE, 0}, +{ 320, 1072543381u, 887044257u, 1054789618u, 2732056261u, 1074020119u, 1583710347u, 0, EXP_TOLERANCE, 0}, +{ 321, 1067932534u, 4027115185u, 3191764868u, 2940199511u, 1072742191u, 2686232784u, 0, EXP_TOLERANCE, 0}, +{ 322, 3216131643u, 2875684421u, 3227459837u, 2251967570u, 1072548762u, 3720766546u, 0, EXP_TOLERANCE, 0}, +{ 323, 1071633020u, 284173546u, 3238823679u, 3557800647u, 1073368685u, 2242917222u, 0, EXP_TOLERANCE, 0}, +{ 324, 1080487040u, 3147771266u, 3220110464u, 2933364246u, 1350032806u, 3038347863u, 0, EXP_TOLERANCE, 0}, +{ 325, 1071144616u, 3366183281u, 3234870843u, 537442654u, 1073179181u, 915714027u, 0, EXP_TOLERANCE, 0}, +{ 326, 3227341572u, 2529029548u, 3249882819u, 3781513577u, 895182279u, 740047972u, 0, EXP_TOLERANCE, 0}, +{ 327, 3219727810u, 1080845539u, 3206760016u, 911778687u, 1071458981u, 2588212980u, 0, EXP_TOLERANCE, 0}, +{ 328, 3213971132u, 469586759u, 1091830022u, 3080528840u, 1072658099u, 4263113631u, 0, EXP_TOLERANCE, 0}, +{ 329, 1075006224u, 2863108169u, 3225605506u, 2508274250u, 1079973897u, 1343663736u, 0, EXP_TOLERANCE, 0}, +{ 330, 3218167016u, 4080017377u, 3206492941u, 1470284690u, 1072195726u, 2669611838u, 0, EXP_TOLERANCE, 0}, +{ 331, 3217606150u, 3867917386u, 1102054928u, 3504746045u, 1072324220u, 3738189842u, 0, EXP_TOLERANCE, 0}, +{ 332, 1070813735u, 2962134101u, 3244741577u, 3390537350u, 1073062778u, 1341868663u, 0, EXP_TOLERANCE, 0}, +{ 333, 1077716053u, 1702237980u, 1071598971u, 1102587474u, 1115946680u, 2058865259u, 0, EXP_TOLERANCE, 0}, +{ 334, 3216601606u, 2180218657u, 3211592260u, 1206527853u, 1072494823u, 3525678913u, 0, EXP_TOLERANCE, 0}, +{ 335, 3215959112u, 394130786u, 3242511482u, 2437699868u, 1072567567u, 211465123u, 0, EXP_TOLERANCE, 0}, +{ 336, 1066257155u, 849581558u, 3252006507u, 2008614943u, 1072708613u, 2224607887u, 0, EXP_TOLERANCE, 0}, +{ 337, 3218528622u, 3128971673u, 3249137531u, 2773583059u, 1072063594u, 1861199787u, 0, EXP_TOLERANCE, 0}, +{ 338, 1076641258u, 590727700u, 3248651761u, 2183878539u, 1093973382u, 51932800u, 0, EXP_TOLERANCE, 0}, +{ 339, 1080127109u, 820687580u, 3208143496u, 1402434664u, 1283604000u, 2229435922u, 0, EXP_TOLERANCE, 0}, +{ 340, 3229222163u, 1873709254u, 3245167989u, 44275991u, 442816163u, 2556589127u, 0, EXP_TOLERANCE, 0}, +{ 341, 3213786001u, 1174874204u, 3208263730u, 2360372288u, 1072662264u, 3781223426u, 0, EXP_TOLERANCE, 0}, +{ 342, 1081834580u, 937573440u, 3208953761u, 211240241u, 1737879034u, 1339532059u, 0, EXP_TOLERANCE, 0}, +{ 343, 3226771718u, 2469774991u, 1043117070u, 3380071805u, 947847649u, 1283680172u, 0, EXP_TOLERANCE, 0}, +{ 344, 1069655378u, 442507560u, 3254252803u, 3257889649u, 1072848240u, 1357220231u, 0, EXP_TOLERANCE, 0}, +{ 345, 1071996248u, 1854921625u, 1049810168u, 2729627545u, 1073689017u, 2766820334u, 0, EXP_TOLERANCE, 0}, +{ 346, 3229546805u, 4001809575u, 3240128649u, 278261523u, 322987487u, 2511328647u, 0, EXP_TOLERANCE, 0}, +{ 347, 1077787510u, 1793907966u, 3238955714u, 398859249u, 1117634274u, 3075914843u, 0, EXP_TOLERANCE, 0}, +{ 348, 3216681187u, 2511916952u, 3219195283u, 1697158299u, 1072485838u, 3086667046u, 0, EXP_TOLERANCE, 0}, +{ 349, 1073131276u, 3230931724u, 3243897690u, 3508781585u, 1074823893u, 2387891840u, 0, EXP_TOLERANCE, 0}, +{ 350, 1081827510u, 1674254897u, 1046547577u, 217148561u, 1735342545u, 3735031445u, 0, EXP_TOLERANCE, 0}, +{ 351, 3218603986u, 3275604304u, 3194840159u, 2991205850u, 1072037461u, 2711189111u, 0, EXP_TOLERANCE, 0}, +{ 352, 3214123743u, 3509997278u, 3248888030u, 3897986511u, 1072653416u, 576737657u, 0, EXP_TOLERANCE, 0}, +{ 353, 1067105379u, 2156824613u, 1042295665u, 1239257646u, 1072720986u, 385023856u, 0, EXP_TOLERANCE, 0}, +{ 354, 3219555541u, 1073153314u, 3250031627u, 2567234990u, 1071622626u, 1879921992u, 0, EXP_TOLERANCE, 0}, +{ 355, 3213662084u, 4261696995u, 3197784432u, 323702024u, 1072664173u, 1494770321u, 0, EXP_TOLERANCE, 0}, +{ 356, 3226913781u, 4075177615u, 3202791065u, 1919006082u, 934660210u, 4071141554u, 0, EXP_TOLERANCE, 0}, +{ 357, 3225638525u, 386429966u, 1086504491u, 3698826164u, 1014131228u, 2849059877u, 0, EXP_TOLERANCE, 0}, +{ 358, 1075181462u, 1681986446u, 3194985869u, 3072950140u, 1080972819u, 4027497035u, 0, EXP_TOLERANCE, 0}, +{ 359, 3220457661u, 3719038997u, 1055433962u, 3331415058u, 1070728055u, 2502518029u, 0, EXP_TOLERANCE, 0}, +{ 360, 1070186897u, 2420250111u, 3238002206u, 1928661079u, 1072926968u, 3179169477u, 0, EXP_TOLERANCE, 0}, +{ 361, 1075622754u, 3679866727u, 3227386672u, 1273835792u, 1083468387u, 4108683448u, 0, EXP_TOLERANCE, 0}, +{ 362, 1065739986u, 2682092368u, 3234222284u, 1325425811u, 1072704521u, 3522344556u, 0, EXP_TOLERANCE, 0}, +{ 363, 1068895525u, 4175172697u, 3208346191u, 2130706153u, 1072787574u, 2645569776u, 0, EXP_TOLERANCE, 0}, +{ 364, 1078458136u, 1200784450u, 1083605096u, 1248595607u, 1145159070u, 3624009342u, 0, EXP_TOLERANCE, 0}, +{ 365, 3219133743u, 1897285171u, 3251296075u, 944966123u, 1071864797u, 3230578766u, 0, EXP_TOLERANCE, 0}, +{ 366, 3225642610u, 2270747330u, 3230692631u, 422503284u, 1013989767u, 3220011003u, 0, EXP_TOLERANCE, 0}, +{ 367, 1076780005u, 2857564741u, 1075647403u, 3308906709u, 1095620625u, 3220040566u, 0, EXP_TOLERANCE, 0}, +{ 368, 3216058010u, 1380066948u, 3232612906u, 2613634294u, 1072557351u, 3176396515u, 0, EXP_TOLERANCE, 0}, +{ 369, 1071230888u, 4022784584u, 1060483857u, 3264056381u, 1073211071u, 866665154u, 0, EXP_TOLERANCE, 0}, +{ 370, 1066657500u, 1778509100u, 3213146285u, 2665833973u, 1072713826u, 3324574262u, 0, EXP_TOLERANCE, 0}, +{ 371, 3219873028u, 1859175955u, 1079949560u, 4258450607u, 1071331100u, 1387314031u, 0, EXP_TOLERANCE, 0}, +{ 372, 1067151756u, 4128020197u, 1076266146u, 4122840980u, 1072721730u, 703093847u, 0, EXP_TOLERANCE, 0}, +{ 373, 3214154683u, 2454653987u, 3229487005u, 2977478685u, 1072652467u, 3648959943u, 0, EXP_TOLERANCE, 0}, +{ 374, 3229439235u, 1355181872u, 1095308770u, 436846481u, 362699701u, 144776434u, 0, EXP_TOLERANCE, 0}, +{ 375, 3227730934u, 2592856453u, 3247825559u, 3195234082u, 839453380u, 3215902683u, 0, EXP_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 1067008394u, 515558083u, 0, EXP_TOLERANCE, 0}, +{ 377, 1072158561u, 1936670355u, 1095715713u, 2958468553u, 1073797675u, 3840516752u, 0, EXP_TOLERANCE, 0}, +{ 378, 3214311205u, 2960339502u, 1098808013u, 1044068983u, 1072647677u, 1015104521u, 0, EXP_TOLERANCE, 0}, +{ 379, 3215565553u, 4093388677u, 1095478112u, 1735930261u, 1072590826u, 1998582813u, 0, EXP_TOLERANCE, 0}, +{ 380, 1078457390u, 1807398746u, 3195743135u, 4261616162u, 1145132905u, 2733988366u, 0, EXP_TOLERANCE, 0}, +{ 381, 3218731378u, 3250576797u, 1059002384u, 3043079652u, 1071994341u, 3135803100u, 0, EXP_TOLERANCE, 0}, +{ 382, 1072352837u, 666051428u, 3208765404u, 1912684117u, 1073904876u, 2200829650u, 0, EXP_TOLERANCE, 0}, +{ 383, 1081467324u, 1949030179u, 1096388934u, 896459246u, 1602299239u, 4124280137u, 0, EXP_TOLERANCE, 0}, +{ 384, 1068980717u, 622499767u, 1066707637u, 1490260486u, 1072793392u, 3411156525u, 0, EXP_TOLERANCE, 0}, +{ 385, 1081522669u, 1490616165u, 3251242436u, 795675736u, 1622680601u, 1772451300u, 0, EXP_TOLERANCE, 0}, +{ 386, 1075701016u, 3662877092u, 3234317146u, 3200513112u, 1083933859u, 948582088u, 0, EXP_TOLERANCE, 0}, +{ 387, 1076748754u, 1356101968u, 3236536816u, 3062844611u, 1095205719u, 1389519343u, 0, EXP_TOLERANCE, 0}, +{ 388, 3220971216u, 2284484846u, 3219498359u, 3240896015u, 1069945740u, 300004641u, 0, EXP_TOLERANCE, 0}, +{ 389, 3225273929u, 494503287u, 1092811254u, 142673998u, 1027637252u, 1197719694u, 0, EXP_TOLERANCE, 0}, +{ 390, 3229057244u, 3394882641u, 3225306538u, 364852125u, 503719187u, 1185927887u, 0, EXP_TOLERANCE, 0}, +{ 391, 3222116035u, 193885269u, 1088149839u, 1359805831u, 1067014684u, 2719415674u, 0, EXP_TOLERANCE, 0}, +{ 392, 3216213422u, 592580907u, 3199560872u, 3086438952u, 1072539267u, 4261894756u, 0, EXP_TOLERANCE, 0}, +{ 393, 1070004424u, 1778008540u, 1049064687u, 73581647u, 1072899376u, 3317554069u, 0, EXP_TOLERANCE, 0}, +{ 394, 3227859230u, 233240285u, 1081923320u, 2710903921u, 815830717u, 753681861u, 0, EXP_TOLERANCE, 0}, +{ 395, 1072659495u, 3719878805u, 1079866720u, 3615458228u, 1074095657u, 776338417u, 0, EXP_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 1069668000u, 3902990147u, 0, EXP_TOLERANCE, 0}, +{ 397, 1081381000u, 2232210456u, 3235434773u, 224271737u, 1570366929u, 1467736445u, 0, EXP_TOLERANCE, 0}, +{ 398, 3213975204u, 2134662911u, 3190390590u, 4239009051u, 1072657974u, 3724433639u, 0, EXP_TOLERANCE, 0}, +{ 399, 1075283265u, 2305279897u, 1077668039u, 1854523320u, 1081499061u, 1371511881u, 0, EXP_TOLERANCE, 0}, +{ 400, 3220912835u, 538224650u, 3206153057u, 1379649610u, 1070028577u, 3385463776u, 0, EXP_TOLERANCE, 0}, +{ 401, 3215284875u, 3683897920u, 3244167599u, 3647579469u, 1072607582u, 369746842u, 0, EXP_TOLERANCE, 0}, +{ 402, 1077698021u, 2694093608u, 1042775347u, 598406111u, 1115578102u, 2696598259u, 0, EXP_TOLERANCE, 0}, +{ 403, 3218975424u, 872706833u, 1084802480u, 2200602798u, 1071915306u, 2038804970u, 0, EXP_TOLERANCE, 0}, +{ 404, 1065408269u, 904146293u, 1060867322u, 1729685598u, 1072701905u, 2787254479u, 0, EXP_TOLERANCE, 0}, +{ 405, 3214569338u, 1894173462u, 3232800651u, 191960416u, 1072639801u, 138794756u, 0, EXP_TOLERANCE, 0}, +{ 406, 1078642431u, 3521028551u, 1054522089u, 3287274359u, 1153643349u, 3672113002u, 0, EXP_TOLERANCE, 0}, +{ 407, 1079658324u, 959640601u, 3201578263u, 4136915018u, 1231622977u, 2234964481u, 0, EXP_TOLERANCE, 0}, +{ 408, 1071345483u, 1553716379u, 1106027987u, 984725765u, 1073254457u, 2029348498u, 0, EXP_TOLERANCE, 0}, +{ 409, 3226249729u, 2287646644u, 3240329321u, 2276183378u, 985897502u, 1659813779u, 0, EXP_TOLERANCE, 0}, +{ 410, 1072403478u, 3940225170u, 3199544434u, 997572161u, 1073934490u, 3814688844u, 0, EXP_TOLERANCE, 0}, +{ 411, 3219059817u, 36116288u, 3206886566u, 4196602670u, 1071889028u, 622952862u, 0, EXP_TOLERANCE, 0}, +{ 412, 3225967213u, 3550227562u, 3207257983u, 2747744117u, 998936682u, 4215021001u, 0, EXP_TOLERANCE, 0}, +{ 413, 1081167454u, 507130047u, 1048359321u, 3229888373u, 1491488321u, 2514231187u, 0, EXP_TOLERANCE, 0}, +{ 414, 3221948202u, 2210969014u, 1081031001u, 1946786091u, 1067545951u, 134943692u, 0, EXP_TOLERANCE, 0}, +{ 415, 3224772654u, 4059150589u, 3189759234u, 1177045799u, 1039198095u, 3770974960u, 0, EXP_TOLERANCE, 0}, +{ 416, 1078423548u, 2664812822u, 1050343198u, 2034180320u, 1143517713u, 3731467255u, 0, EXP_TOLERANCE, 0}, +{ 417, 3220070573u, 1175750283u, 3235559706u, 1424491340u, 1071170763u, 285360716u, 0, EXP_TOLERANCE, 0}, +{ 418, 3219147073u, 1630036121u, 3231972785u, 3195479448u, 1071856759u, 825964156u, 0, EXP_TOLERANCE, 0}, +{ 419, 1077846963u, 2527029044u, 1046927050u, 4000723255u, 1118989351u, 3673409802u, 0, EXP_TOLERANCE, 0}, +{ 420, 1076820069u, 3335703647u, 3237349676u, 3869440059u, 1096040909u, 786910848u, 0, EXP_TOLERANCE, 0}, +{ 421, 1078850936u, 3888398377u, 3196041693u, 1290567220u, 1163247715u, 1366973945u, 0, EXP_TOLERANCE, 0}, +{ 422, 1071921950u, 3242451480u, 3248384948u, 707431021u, 1073617858u, 3148318263u, 0, EXP_TOLERANCE, 0}, +{ 423, 1075890477u, 2739665123u, 1060777905u, 1733073225u, 1085358008u, 2026080761u, 0, EXP_TOLERANCE, 0}, +{ 424, 1075371333u, 1297274853u, 3208848704u, 3341639139u, 1082084306u, 1161258137u, 0, EXP_TOLERANCE, 0}, +{ 425, 1066493885u, 2228057309u, 1084318902u, 1317851136u, 1072711223u, 1263590417u, 0, EXP_TOLERANCE, 0}, +{ 426, 1077769567u, 270039934u, 3241414679u, 3063626339u, 1117167369u, 251426608u, 0, EXP_TOLERANCE, 0}, +{ 427, 3220226926u, 83062251u, 3211262173u, 2659016437u, 1071018626u, 3607873799u, 0, EXP_TOLERANCE, 0}, +{ 428, 1080015246u, 3833539373u, 3206667189u, 1567476111u, 1264640185u, 3066665016u, 0, EXP_TOLERANCE, 0}, +{ 429, 3217777984u, 2382776852u, 3249232579u, 1546622468u, 1072289181u, 3303189231u, 0, EXP_TOLERANCE, 0}, +{ 430, 1076099255u, 1714300821u, 1104130938u, 4167591598u, 1087714517u, 3396587971u, 0, EXP_TOLERANCE, 0}, +{ 431, 1067869976u, 2798720100u, 1086978789u, 449990704u, 1072740147u, 1441545775u, 0, EXP_TOLERANCE, 0}, +{ 432, 3223858383u, 4039516226u, 3244344107u, 4272932619u, 1054317676u, 2225867290u, 0, EXP_TOLERANCE, 0}, +{ 433, 3221659865u, 1683007544u, 1091105663u, 3805494321u, 1068384828u, 2642772291u, 0, EXP_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 1070118481u, 2781076629u, 0, EXP_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 1070608094u, 3726035371u, 0, EXP_TOLERANCE, 0}, +{ 436, 1078985629u, 559918757u, 3205077053u, 908100198u, 1169510707u, 348797896u, 0, EXP_TOLERANCE, 0}, +{ 437, 1065746590u, 2026673913u, 3244833635u, 2844573214u, 1072704573u, 4160322489u, 0, EXP_TOLERANCE, 0}, +{ 438, 3229401435u, 3946837259u, 3234993796u, 3850406820u, 376626627u, 2645031468u, 0, EXP_TOLERANCE, 0}, +{ 439, 1070062721u, 3139330994u, 1046133568u, 1539650690u, 1072908126u, 3501052954u, 0, EXP_TOLERANCE, 0}, +{ 440, 3225171164u, 1554593884u, 3228899878u, 2813752562u, 1029949960u, 634658456u, 0, EXP_TOLERANCE, 0}, +{ 441, 1069087916u, 3804703138u, 1072931071u, 2053677923u, 1072800756u, 699656724u, 0, EXP_TOLERANCE, 0}, +{ 442, 3227038507u, 289355864u, 1078453818u, 2143066338u, 923143111u, 3108681133u, 0, EXP_TOLERANCE, 0}, +{ 443, 3216522792u, 2157691971u, 1106629150u, 110806409u, 1072503764u, 1811146510u, 0, EXP_TOLERANCE, 0}, +{ 444, 1075865563u, 3570399481u, 1085637605u, 180265334u, 1085048493u, 1043128358u, 0, EXP_TOLERANCE, 0}, +{ 445, 3216708822u, 558779875u, 3202046748u, 2338464653u, 1072482728u, 2560919037u, 0, EXP_TOLERANCE, 0}, +{ 446, 1066676984u, 1703969219u, 3229797258u, 1417521063u, 1072714137u, 992457887u, 0, EXP_TOLERANCE, 0}, +{ 447, 3225199349u, 3917440951u, 1051668894u, 3736066983u, 1029291645u, 1524244054u, 0, EXP_TOLERANCE, 0}, +{ 448, 1071043536u, 3106613409u, 1066627453u, 2735392257u, 1073142642u, 2422476262u, 0, EXP_TOLERANCE, 0}, +{ 449, 1071956828u, 2229777605u, 1065061963u, 2405869925u, 1073650949u, 990909907u, 0, EXP_TOLERANCE, 0}, +{ 450, 3225831741u, 3967957902u, 1057416138u, 3459188071u, 1005185820u, 1500159877u, 0, EXP_TOLERANCE, 0}, +{ 451, 1071784938u, 3699016825u, 3249713090u, 796144848u, 1073493066u, 2784789311u, 0, EXP_TOLERANCE, 0}, +{ 452, 3222524940u, 3285165564u, 3211948811u, 401510871u, 1065144087u, 2462551555u, 0, EXP_TOLERANCE, 0}, +{ 453, 1078529018u, 634857910u, 3199607513u, 914218057u, 1148406303u, 2060143941u, 0, EXP_TOLERANCE, 0}, +{ 454, 1076403304u, 2030735578u, 3233855943u, 965677531u, 1091237697u, 3806493702u, 0, EXP_TOLERANCE, 0}, +{ 455, 1075362511u, 3957229084u, 1051050470u, 3123776651u, 1082016435u, 3236122522u, 0, EXP_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 1067746995u, 3736551116u, 0, EXP_TOLERANCE, 0}, +{ 457, 3224688874u, 869031839u, 3225020876u, 1344301606u, 1041127895u, 2468905470u, 0, EXP_TOLERANCE, 0}, +{ 458, 3219676354u, 946696117u, 3231825228u, 1700703647u, 1071506461u, 2633364322u, 0, EXP_TOLERANCE, 0}, +{ 459, 1074444299u, 3394168074u, 1076939786u, 1666995668u, 1077688097u, 1414459791u, 0, EXP_TOLERANCE, 0}, +{ 460, 3218211979u, 2488789804u, 3238508333u, 1506943664u, 1072178670u, 1219639660u, 0, EXP_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1074254177u, 2710454031u, 0, EXP_TOLERANCE, 0}, +{ 462, 3220983118u, 1244307192u, 3191297711u, 2540916692u, 1069929411u, 857160910u, 0, EXP_TOLERANCE, 0}, +{ 463, 3215791332u, 2871645739u, 3239081581u, 1440249115u, 1072577449u, 2224257486u, 0, EXP_TOLERANCE, 0}, +{ 464, 1072544937u, 1231934926u, 3236746788u, 603977748u, 1074021104u, 1153376056u, 0, EXP_TOLERANCE, 0}, +{ 465, 3214324057u, 2386312545u, 1063169277u, 2715234268u, 1072647284u, 1633360252u, 0, EXP_TOLERANCE, 0}, +{ 466, 1077317658u, 915867083u, 1046790892u, 3347417612u, 1106735782u, 2072797994u, 0, EXP_TOLERANCE, 0}, +{ 467, 1081866940u, 3553288373u, 1065698616u, 2906680663u, 1749870023u, 2025279999u, 0, EXP_TOLERANCE, 0}, +{ 468, 1066477746u, 2342364630u, 1051356723u, 4019093203u, 1072710966u, 3567891728u, 0, EXP_TOLERANCE, 0}, +{ 469, 3216897802u, 2911548084u, 1105282515u, 2476735795u, 1072461596u, 2505953515u, 0, EXP_TOLERANCE, 0}, +{ 470, 1068298564u, 1836216409u, 1101062307u, 2519592554u, 1072754229u, 2097073093u, 0, EXP_TOLERANCE, 0}, +{ 471, 1073323889u, 1235369496u, 3222946447u, 668087854u, 1075042085u, 432513398u, 0, EXP_TOLERANCE, 0}, +{ 472, 3217991780u, 2981820811u, 1059838516u, 2845580478u, 1072246576u, 866819828u, 0, EXP_TOLERANCE, 0}, +{ 473, 3214902934u, 1565550570u, 3217165795u, 4162017137u, 1072629667u, 221223936u, 0, EXP_TOLERANCE, 0}, +{ 474, 3224668466u, 2808968027u, 1055630096u, 1782326814u, 1041545264u, 3106633046u, 0, EXP_TOLERANCE, 0}, +{ 475, 1069305614u, 1492622658u, 3216653077u, 3972512122u, 1072815855u, 18398701u, 0, EXP_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 1066847382u, 693197204u, 0, EXP_TOLERANCE, 0}, +{ 477, 3221052359u, 899763203u, 3207606001u, 2804747833u, 1069838003u, 3960237442u, 0, EXP_TOLERANCE, 0}, +{ 478, 3223330293u, 3789058912u, 3228095081u, 4135937628u, 1060420669u, 2863646027u, 0, EXP_TOLERANCE, 0}, +{ 479, 1069636566u, 1682808307u, 3206960335u, 232877759u, 1072845544u, 1293413822u, 0, EXP_TOLERANCE, 0}, +{ 480, 3226362846u, 2851963139u, 3246852961u, 2590862592u, 980672310u, 2121477897u, 0, EXP_TOLERANCE, 0}, +{ 481, 1074908950u, 2422232642u, 3234779662u, 290458310u, 1079342178u, 769697412u, 0, EXP_TOLERANCE, 0}, +{ 482, 3219059686u, 1082582386u, 1075605675u, 2602133689u, 1071889068u, 1943466506u, 0, EXP_TOLERANCE, 0}, +{ 483, 3226187123u, 1789635787u, 1059414278u, 1048286093u, 988843638u, 1761624532u, 0, EXP_TOLERANCE, 0}, +{ 484, 1079456174u, 231339448u, 1055573265u, 504907415u, 1212992503u, 57355760u, 0, EXP_TOLERANCE, 0}, +{ 485, 1071600069u, 1153251200u, 3204617090u, 1772013857u, 1073355194u, 2543994465u, 0, EXP_TOLERANCE, 0}, +{ 486, 1080676687u, 1082898276u, 3212089272u, 1449080862u, 1385133678u, 3383991944u, 0, EXP_TOLERANCE, 0}, +{ 487, 1076571101u, 3177299045u, 1058862813u, 809400815u, 1093156946u, 1324449489u, 0, EXP_TOLERANCE, 0}, +{ 488, 3223514518u, 1924429710u, 1056464743u, 3349283177u, 1058297638u, 3331281830u, 0, EXP_TOLERANCE, 0}, +{ 489, 3226599023u, 42238036u, 1042379500u, 2113559863u, 963765357u, 1028628530u, 0, EXP_TOLERANCE, 0}, +{ 490, 1071052699u, 3304403230u, 3217556703u, 58952646u, 1073145918u, 2870415022u, 0, EXP_TOLERANCE, 0}, +{ 491, 3218960986u, 1645486982u, 3224301095u, 3636267471u, 1071919855u, 1479310056u, 0, EXP_TOLERANCE, 0}, +{ 492, 1071150617u, 619402181u, 3235208235u, 557360557u, 1073181378u, 211059331u, 0, EXP_TOLERANCE, 0}, +{ 493, 3225655482u, 110029735u, 1046937383u, 984375729u, 1013314403u, 3677128438u, 0, EXP_TOLERANCE, 0}, +{ 494, 3213613986u, 4063688092u, 3203235744u, 1049950343u, 1072664914u, 2549757512u, 0, EXP_TOLERANCE, 0}, +{ 495, 1070739227u, 650996069u, 1054971928u, 3953359826u, 1073037809u, 838695363u, 0, EXP_TOLERANCE, 0}, +{ 496, 3222861501u, 66926332u, 1090561839u, 1379780888u, 1063250554u, 387700961u, 0, EXP_TOLERANCE, 0}, +{ 497, 3224016123u, 2803378256u, 1086057989u, 498534626u, 1052530954u, 1101873220u, 0, EXP_TOLERANCE, 0}, +{ 498, 1076327097u, 2846400785u, 1047142525u, 1375153550u, 1090398038u, 3404434636u, 0, EXP_TOLERANCE, 0}, +{ 499, 1066601297u, 2869128958u, 1070972315u, 4246440273u, 1072712931u, 3206431290u, 0, EXP_TOLERANCE, 0}, +{ 500, 1067561146u, 3112381207u, 1044430965u, 3981604561u, 1072730111u, 14195977u, 0, EXP_TOLERANCE, 0}, +{ 501, 3223914965u, 243303420u, 1093735824u, 1575581926u, 1053731509u, 904055362u, 0, EXP_TOLERANCE, 0}, +{ 502, 3225506509u, 3218865041u, 3204803496u, 3840388050u, 1020275468u, 1833594413u, 0, EXP_TOLERANCE, 0}, +{ 503, 1067289799u, 336846959u, 1052664471u, 3798336786u, 1072723947u, 4034846420u, 0, EXP_TOLERANCE, 0}, +{ 504, 1068537148u, 3639240976u, 1081202165u, 1844741676u, 1072763420u, 176306533u, 0, EXP_TOLERANCE, 0}, +{ 505, 3218196249u, 717293069u, 3211534283u, 582401011u, 1072184616u, 3222172175u, 0, EXP_TOLERANCE, 0}, +{ 506, 3228893840u, 3766248610u, 3196520332u, 1174437546u, 564150813u, 811276996u, 0, EXP_TOLERANCE, 0}, +{ 507, 1076091194u, 756959182u, 3204099341u, 1581804034u, 1087631618u, 1978209737u, 0, EXP_TOLERANCE, 0}, +{ 508, 3217340780u, 3560686300u, 3220980617u, 4277975772u, 1072379763u, 1155762898u, 0, EXP_TOLERANCE, 0}, +{ 509, 3218294684u, 2598148853u, 3217622194u, 3460421008u, 1072147770u, 346718411u, 0, EXP_TOLERANCE, 0}, +{ 510, 1071963704u, 136600515u, 3209934920u, 3340653128u, 1073657537u, 2596417839u, 0, EXP_TOLERANCE, 0}, +{ 511, 1078994518u, 1045480938u, 3251354609u, 4133432965u, 1170363966u, 1471292306u, 0, EXP_TOLERANCE, 0}, +{ 512, 1077967943u, 1630207738u, 3239996829u, 2393354808u, 1122481140u, 2643918337u, 0, EXP_TOLERANCE, 0}, +{ 513, 3213694690u, 3739770117u, 1059520750u, 3959551225u, 1072663671u, 23114429u, 0, EXP_TOLERANCE, 0}, +{ 514, 3223390473u, 1498861716u, 1091297147u, 847410798u, 1059730387u, 1062439242u, 0, EXP_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1075304551u, 788448980u, 0, EXP_TOLERANCE, 0}, +{ 516, 1069529329u, 2353103845u, 3235718771u, 2978889966u, 1072831576u, 2964825654u, 0, EXP_TOLERANCE, 0}, +{ 517, 3229337896u, 1546972125u, 3249076079u, 1987349196u, 400067810u, 350725282u, 0, EXP_TOLERANCE, 0}, +{ 518, 3225636601u, 2769161072u, 1075207126u, 292616282u, 1014204187u, 2505832380u, 0, EXP_TOLERANCE, 0}, +{ 519, 3215440938u, 36855311u, 1052128202u, 1479039342u, 1072598248u, 1535663252u, 0, EXP_TOLERANCE, 0}, +{ 520, 1076417021u, 2027463605u, 1066023013u, 3369686340u, 1091432667u, 1056725485u, 0, EXP_TOLERANCE, 0}, +{ 521, 3215678541u, 3808681655u, 1054161346u, 1821773119u, 1072584120u, 3865333882u, 0, EXP_TOLERANCE, 0}, +{ 522, 1065851752u, 3175490326u, 3226879970u, 845687760u, 1072705404u, 3214402448u, 0, EXP_TOLERANCE, 0}, +{ 523, 1065371665u, 3124482451u, 3242748377u, 3259417226u, 1072701617u, 1556794065u, 0, EXP_TOLERANCE, 0}, +{ 524, 1067265791u, 2751606436u, 3236210939u, 3923142740u, 1072723561u, 3907206090u, 0, EXP_TOLERANCE, 0}, +{ 525, 1079966097u, 2016872044u, 3228408064u, 4201274408u, 1260053709u, 2351383485u, 0, EXP_TOLERANCE, 0}, +{ 526, 3215077894u, 1019916843u, 3219974785u, 1977881787u, 1072620028u, 1513873245u, 0, EXP_TOLERANCE, 0}, +{ 527, 3215207392u, 2060433318u, 1075872515u, 366073725u, 1072612232u, 1485589014u, 0, EXP_TOLERANCE, 0}, +{ 528, 3213200653u, 1098469906u, 1082900695u, 2349346832u, 1072671295u, 2138435974u, 0, EXP_TOLERANCE, 0}, +{ 529, 3218363315u, 3011196295u, 3252479932u, 2459281672u, 1072122586u, 3209321029u, 0, EXP_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 1069295228u, 2479655835u, 0, EXP_TOLERANCE, 0}, +{ 531, 1080766178u, 914741728u, 3203468059u, 2833809843u, 1401595225u, 1543027566u, 0, EXP_TOLERANCE, 0}, +{ 532, 3225229542u, 1274901962u, 3241535845u, 3759113509u, 1028668815u, 1805280638u, 0, EXP_TOLERANCE, 0}, +{ 533, 3227042074u, 2134927252u, 3253802671u, 3013731444u, 922860414u, 1506262932u, 0, EXP_TOLERANCE, 0}, +{ 534, 1080326973u, 2230655177u, 3254510616u, 1249674366u, 1320480180u, 3545707614u, 0, EXP_TOLERANCE, 0}, +{ 535, 1071359861u, 717357389u, 1083533731u, 3746683362u, 1073259985u, 785194633u, 0, EXP_TOLERANCE, 0}, +{ 536, 3220064570u, 834976849u, 3217357661u, 2465861779u, 1071175416u, 1040443015u, 0, EXP_TOLERANCE, 0}, +{ 537, 1066627637u, 1385714428u, 1053358395u, 3007113740u, 1072713351u, 479550567u, 0, EXP_TOLERANCE, 0}, +{ 538, 1068353711u, 599268545u, 3201368210u, 2309854744u, 1072756054u, 2342579642u, 0, EXP_TOLERANCE, 0}, +{ 539, 1073100182u, 2840234388u, 3232496515u, 333365983u, 1074792277u, 1476863741u, 0, EXP_TOLERANCE, 0}, +{ 540, 1066894301u, 3136078996u, 3194520860u, 2650572904u, 1072717606u, 314014954u, 0, EXP_TOLERANCE, 0}, +{ 541, 3224250507u, 2405805086u, 3251640319u, 324233833u, 1049818942u, 619300132u, 0, EXP_TOLERANCE, 0}, +{ 542, 1081533322u, 2589598340u, 3254677807u, 952438812u, 1626625304u, 2555502454u, 0, EXP_TOLERANCE, 0}, +{ 543, 3213232021u, 1922837702u, 3216892718u, 3535907549u, 1072670810u, 2392774352u, 0, EXP_TOLERANCE, 0}, +{ 544, 3226838652u, 261447440u, 3209805849u, 1150571079u, 941666308u, 2929954307u, 0, EXP_TOLERANCE, 0}, +{ 545, 1079028016u, 4026487528u, 1073152064u, 27340691u, 1173468543u, 273403284u, 0, EXP_TOLERANCE, 0}, +{ 546, 3222832236u, 338765118u, 1086225786u, 3207238249u, 1063376827u, 2552266259u, 0, EXP_TOLERANCE, 0}, +{ 547, 3215057071u, 1085283176u, 3187775111u, 1601194210u, 1072621284u, 3181137750u, 0, EXP_TOLERANCE, 0}, +{ 548, 1078937261u, 3031712790u, 3252307859u, 170666844u, 1167258064u, 3602398320u, 0, EXP_TOLERANCE, 0}, +{ 549, 3220959383u, 3148395674u, 1041913758u, 3306391490u, 1069962159u, 449105735u, 0, EXP_TOLERANCE, 0}, +{ 550, 3217005710u, 2205233857u, 3208100078u, 3993195511u, 1072449636u, 2341049361u, 0, EXP_TOLERANCE, 0}, +{ 551, 1071893912u, 4282766727u, 1072820377u, 1874778218u, 1073591653u, 3798859726u, 0, EXP_TOLERANCE, 0}, +{ 552, 3218173124u, 2920860798u, 3218070226u, 3104066154u, 1072193398u, 4039462005u, 0, EXP_TOLERANCE, 0}, +{ 553, 3217533263u, 969991373u, 3250596895u, 1734386152u, 1072339301u, 3336979462u, 0, EXP_TOLERANCE, 0}, +{ 554, 3226332906u, 1218740205u, 3239802737u, 2610078504u, 982042268u, 3949815583u, 0, EXP_TOLERANCE, 0}, +{ 555, 3217565578u, 1485218325u, 3220870240u, 3591664613u, 1072332599u, 1755137557u, 0, EXP_TOLERANCE, 0}, +{ 556, 3216754207u, 690157417u, 3190850619u, 4192347699u, 1072477631u, 3662215240u, 0, EXP_TOLERANCE, 0}, +{ 557, 1079276594u, 4009839784u, 1079670252u, 394167192u, 1196450945u, 2525536651u, 0, EXP_TOLERANCE, 0}, +{ 558, 3225122053u, 961532417u, 1092588071u, 2923790239u, 1031073549u, 1672191880u, 0, EXP_TOLERANCE, 0}, +{ 559, 3216462003u, 4174125604u, 1050682630u, 2169701868u, 1072510688u, 4180692824u, 0, EXP_TOLERANCE, 0}, +{ 560, 3227363835u, 4146748230u, 1087373950u, 2481478351u, 893135089u, 582298895u, 0, EXP_TOLERANCE, 0}, +{ 561, 1073842138u, 3984715440u, 1050421618u, 2446142566u, 1075963121u, 1824117845u, 0, EXP_TOLERANCE, 0}, +{ 562, 1076832374u, 936290150u, 1100614426u, 3625806370u, 1096171572u, 79506205u, 0, EXP_TOLERANCE, 0}, +{ 563, 1080913584u, 1866615265u, 3215651428u, 2337013350u, 1428810148u, 2464900529u, 0, EXP_TOLERANCE, 0}, +{ 564, 3229081054u, 712227971u, 1106004723u, 973148499u, 494989773u, 881372988u, 0, EXP_TOLERANCE, 0}, +{ 565, 3223796743u, 3409813738u, 3244817008u, 1933503498u, 1055057116u, 1987951892u, 0, EXP_TOLERANCE, 0}, +{ 566, 1075749429u, 3180389060u, 3228735703u, 83422217u, 1084263619u, 3719345681u, 0, EXP_TOLERANCE, 0}, +{ 567, 1074732996u, 556972671u, 3204582372u, 841555801u, 1078491082u, 3497361082u, 0, EXP_TOLERANCE, 0}, +{ 568, 1072864873u, 4189151332u, 1080874032u, 706326922u, 1074371849u, 3237121563u, 0, EXP_TOLERANCE, 0}, +{ 569, 1079374091u, 198291836u, 1057281892u, 2188836928u, 1205376783u, 2535783908u, 0, EXP_TOLERANCE, 0}, +{ 570, 1074946267u, 1219449298u, 3228734687u, 3504562743u, 1079557279u, 563112082u, 0, EXP_TOLERANCE, 0}, +{ 571, 3217153376u, 1776099219u, 1094316777u, 4188083896u, 1072420059u, 1952839512u, 0, EXP_TOLERANCE, 0}, +{ 572, 3214817228u, 2614400266u, 1073750227u, 3003203347u, 1072632265u, 3501612041u, 0, EXP_TOLERANCE, 0}, +{ 573, 3219225558u, 2959351406u, 1105603716u, 311851587u, 1071810451u, 740693120u, 0, EXP_TOLERANCE, 0}, +{ 574, 1076155826u, 865443613u, 1097532516u, 3622237781u, 1088443249u, 3543760780u, 0, EXP_TOLERANCE, 0}, +{ 575, 3223398058u, 447506102u, 3195759295u, 3603669725u, 1059633838u, 605796371u, 0, EXP_TOLERANCE, 0}, +{ 576, 1079015805u, 3934398273u, 1040996422u, 2968621268u, 1172360989u, 1233059955u, 0, EXP_TOLERANCE, 0}, +{ 577, 3215614193u, 784208771u, 1088764788u, 2182296421u, 1072587937u, 320113544u, 0, EXP_TOLERANCE, 0}, +{ 578, 3228409347u, 1527590526u, 3206961556u, 2823164069u, 714212086u, 3700796565u, 0, EXP_TOLERANCE, 0}, +{ 579, 3225109795u, 3876699591u, 3207481130u, 4028148535u, 1031355705u, 3297444173u, 0, EXP_TOLERANCE, 0}, +{ 580, 1076236154u, 2164249756u, 1059857743u, 1785169952u, 1089348091u, 3028702007u, 0, EXP_TOLERANCE, 0}, +{ 581, 1078172521u, 2079273665u, 1080303860u, 625760474u, 1131925960u, 2820657748u, 0, EXP_TOLERANCE, 0}, +{ 582, 3222291804u, 3636214836u, 1068367620u, 2932621925u, 1066501856u, 2508581844u, 0, EXP_TOLERANCE, 0}, +{ 583, 1066015468u, 4274131512u, 1047707755u, 92550763u, 1072706699u, 1716559078u, 0, EXP_TOLERANCE, 0}, +{ 584, 3215599337u, 2648933384u, 1084603503u, 3534304873u, 1072588819u, 508060763u, 0, EXP_TOLERANCE, 0}, +{ 585, 1070854691u, 3216750767u, 3191088629u, 547482628u, 1073076693u, 2158989442u, 0, EXP_TOLERANCE, 0}, +{ 586, 1070521958u, 1420360746u, 1080063101u, 1690029499u, 1072979223u, 1425260532u, 0, EXP_TOLERANCE, 0}, +{ 587, 3223563908u, 1908572179u, 1080112083u, 1228319033u, 1057745063u, 1750491909u, 0, EXP_TOLERANCE, 0}, +{ 588, 1067032546u, 500312015u, 3212368508u, 3864619086u, 1072719818u, 2566005358u, 0, EXP_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 1069290704u, 1406122007u, 0, EXP_TOLERANCE, 0}, +{ 590, 1080518026u, 2382118000u, 1042665328u, 567154882u, 1355833620u, 2043686521u, 0, EXP_TOLERANCE, 0}, +{ 591, 1069547778u, 1435344339u, 3216303171u, 2275988178u, 1072832900u, 3711969349u, 0, EXP_TOLERANCE, 0}, +{ 592, 3219781499u, 3403659753u, 3218043030u, 1926480488u, 1071410667u, 198580343u, 0, EXP_TOLERANCE, 0}, +{ 593, 1074743231u, 1198845185u, 3225556149u, 1130089684u, 1078522694u, 2138026103u, 0, EXP_TOLERANCE, 0}, +{ 594, 3221614466u, 2183928090u, 1048403956u, 963834821u, 1068531570u, 1143881486u, 0, EXP_TOLERANCE, 0}, +{ 595, 1080701440u, 2120625396u, 1041006976u, 2137548527u, 1389637151u, 2814596158u, 0, EXP_TOLERANCE, 0}, +{ 596, 1080355870u, 586700956u, 1059670521u, 303891699u, 1325810327u, 2561465523u, 0, EXP_TOLERANCE, 0}, +{ 597, 3221091650u, 2509132460u, 1102827530u, 2205707903u, 1069788756u, 946327002u, 0, EXP_TOLERANCE, 0}, +{ 598, 3217443509u, 1229308263u, 3209170414u, 4206576047u, 1072358053u, 1505047828u, 0, EXP_TOLERANCE, 0}, +{ 599, 3221979137u, 4078010749u, 3199236456u, 733478972u, 1067480393u, 1883768308u, 0, EXP_TOLERANCE, 0}, +{ 600, 3215538376u, 4277541051u, 3199806921u, 397102023u, 1072592442u, 3112407863u, 0, EXP_TOLERANCE, 0}, +{ 601, 3214849381u, 900999594u, 3234720188u, 2530214248u, 1072631290u, 2136324251u, 0, EXP_TOLERANCE, 0}, +{ 602, 1074446396u, 4000609478u, 1096577064u, 4148592328u, 1077695508u, 2530213621u, 0, EXP_TOLERANCE, 0}, +{ 603, 1067542452u, 2154187873u, 3224392607u, 3957250362u, 1072729506u, 1888618017u, 0, EXP_TOLERANCE, 0}, +{ 604, 3221316336u, 2867079200u, 1101870326u, 921212001u, 1069359619u, 1291621322u, 0, EXP_TOLERANCE, 0}, +{ 605, 3223784706u, 674547716u, 1063216239u, 3929755226u, 1055176221u, 2342580293u, 0, EXP_TOLERANCE, 0}, +{ 606, 3225735787u, 3158182449u, 1043794244u, 3259056345u, 1009666296u, 2099303467u, 0, EXP_TOLERANCE, 0}, +{ 607, 3225242320u, 3002823940u, 1059511739u, 2832435794u, 1028307478u, 65827691u, 0, EXP_TOLERANCE, 0}, +{ 608, 3220450550u, 2196511929u, 1049973941u, 3672092877u, 1070736089u, 371341051u, 0, EXP_TOLERANCE, 0}, +{ 609, 1068263848u, 3655292191u, 1086438127u, 3567072906u, 1072753082u, 551440254u, 0, EXP_TOLERANCE, 0}, +{ 610, 3227458308u, 1617573614u, 3201863123u, 3090723732u, 884380609u, 990057858u, 0, EXP_TOLERANCE, 0}, +{ 611, 3223764196u, 679893506u, 3211547753u, 824081024u, 1055406136u, 1185397254u, 0, EXP_TOLERANCE, 0}, +{ 612, 1076947613u, 2285242807u, 1084999409u, 2221731406u, 1098199194u, 2093305428u, 0, EXP_TOLERANCE, 0}, +{ 613, 3217219424u, 1935990727u, 1088822246u, 1058156518u, 1072405754u, 3411302972u, 0, EXP_TOLERANCE, 0}, +{ 614, 1080819070u, 521023584u, 1059186903u, 4245163857u, 1411420761u, 1987577595u, 0, EXP_TOLERANCE, 0}, +{ 615, 1081871044u, 2312887617u, 3191771354u, 1885370807u, 1751362761u, 485435265u, 0, EXP_TOLERANCE, 0}, +{ 616, 3228836567u, 1796441468u, 1100030327u, 2772711004u, 585257982u, 1197588774u, 0, EXP_TOLERANCE, 0}, +{ 617, 3216859732u, 2095685003u, 1077984448u, 2100773742u, 1072465834u, 2188254173u, 0, EXP_TOLERANCE, 0}, +{ 618, 3213926140u, 2892538035u, 1042396334u, 4162200338u, 1072659482u, 3755395969u, 0, EXP_TOLERANCE, 0}, +{ 619, 3226997111u, 2177698116u, 3227557177u, 150832500u, 927022330u, 2114378896u, 0, EXP_TOLERANCE, 0}, +{ 620, 3213582312u, 607966734u, 3236250630u, 4164600559u, 1072665402u, 3794761595u, 0, EXP_TOLERANCE, 0}, +{ 621, 3219535540u, 2830122967u, 1046096700u, 3713346883u, 1071642511u, 1936011333u, 0, EXP_TOLERANCE, 0}, +{ 622, 3224615051u, 2314640506u, 3203696416u, 3276228872u, 1042769881u, 709365161u, 0, EXP_TOLERANCE, 0}, +{ 623, 3219203763u, 469331883u, 3249037349u, 2999233437u, 1071823137u, 3035360404u, 0, EXP_TOLERANCE, 0}, +{ 624, 1079556219u, 560886625u, 1091899487u, 748795120u, 1222196219u, 1766795176u, 0, EXP_TOLERANCE, 0}, +{ 625, 1067712650u, 2958421324u, 1092569414u, 3235243477u, 1072735023u, 111129972u, 0, EXP_TOLERANCE, 0}, +{ 626, 3213998017u, 3221475559u, 1043038304u, 915608434u, 1072657274u, 270655903u, 0, EXP_TOLERANCE, 0}, +{ 627, 1073294682u, 3007808652u, 3216682290u, 2531019474u, 1075006367u, 3946889810u, 0, EXP_TOLERANCE, 0}, +{ 628, 3226300359u, 1767658578u, 3237045269u, 2313128318u, 983611715u, 1963249883u, 0, EXP_TOLERANCE, 0}, +{ 629, 3219006500u, 1926845182u, 1066835624u, 1783256828u, 1071905568u, 1550065103u, 0, EXP_TOLERANCE, 0}, +{ 630, 1065741453u, 90378038u, 1057168870u, 164358218u, 1072704533u, 1716133177u, 0, EXP_TOLERANCE, 0}, +{ 631, 1081693348u, 1610524680u, 1085283851u, 2903496007u, 1685728394u, 520929572u, 0, EXP_TOLERANCE, 0}, +{ 632, 1075489858u, 4274321404u, 3202913591u, 720121831u, 1082693625u, 2845193504u, 0, EXP_TOLERANCE, 0}, +{ 633, 1067982472u, 2034778236u, 1071133763u, 1413236391u, 1072743826u, 988128607u, 0, EXP_TOLERANCE, 0}, +{ 634, 1067840244u, 1489112261u, 1076691395u, 348210906u, 1072739177u, 317516419u, 0, EXP_TOLERANCE, 0}, +{ 635, 3217229677u, 2797651324u, 3224410527u, 2374818327u, 1072403544u, 1037637956u, 0, EXP_TOLERANCE, 0}, +{ 636, 1077801496u, 1823161666u, 3197810695u, 3119680047u, 1117940019u, 2045262415u, 0, EXP_TOLERANCE, 0}, +{ 637, 1072218792u, 3420950657u, 1087084743u, 2136638961u, 1073829855u, 2407470294u, 0, EXP_TOLERANCE, 0}, +{ 638, 1073047952u, 3554566429u, 1062907717u, 2736702589u, 1074692071u, 2140620171u, 0, EXP_TOLERANCE, 0}, +{ 639, 3227062875u, 2928437580u, 3187765027u, 1393427873u, 920907098u, 4135143034u, 0, EXP_TOLERANCE, 0}, +{ 640, 3218738745u, 189447067u, 1051643315u, 828663513u, 1071991888u, 870021011u, 0, EXP_TOLERANCE, 0}, +{ 641, 1068042509u, 2852350928u, 1045683757u, 673354280u, 1072745794u, 2790514124u, 0, EXP_TOLERANCE, 0}, +{ 642, 1065966397u, 3589563265u, 3248741629u, 812657927u, 1072706311u, 791385654u, 0, EXP_TOLERANCE, 0}, +{ 643, 3213679498u, 1766416701u, 1100392103u, 2185373290u, 1072663905u, 227240416u, 0, EXP_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 1070952181u, 2061416280u, 0, EXP_TOLERANCE, 0}, +{ 645, 1075440832u, 1187403069u, 1075300235u, 336640304u, 1082418698u, 3092350278u, 0, EXP_TOLERANCE, 0}, +{ 646, 1081906155u, 1718795752u, 3243118752u, 683369237u, 1764318904u, 2150807698u, 0, EXP_TOLERANCE, 0}, +{ 647, 3218132129u, 1863545307u, 1069449477u, 3418627399u, 1072209087u, 2449778810u, 0, EXP_TOLERANCE, 0}, +{ 648, 1072747022u, 3295607249u, 1068878592u, 1633297809u, 1074193404u, 2476970617u, 0, EXP_TOLERANCE, 0}, +{ 649, 1070481463u, 2585980994u, 3236670483u, 1286750688u, 1072972796u, 2203733059u, 0, EXP_TOLERANCE, 0}, +{ 650, 1067128553u, 15816845u, 3233249283u, 2491924775u, 1072721357u, 3513632630u, 0, EXP_TOLERANCE, 0}, +{ 651, 1065481693u, 1051983351u, 1049180786u, 1474421917u, 1072702484u, 724278735u, 0, EXP_TOLERANCE, 0}, +{ 652, 3216978165u, 2003816032u, 1086050104u, 668090487u, 1072452682u, 906509909u, 0, EXP_TOLERANCE, 0}, +{ 653, 1068284677u, 3671484625u, 1067020039u, 430024694u, 1072753770u, 1677416970u, 0, EXP_TOLERANCE, 0}, +{ 654, 1072639990u, 3991830201u, 3207808714u, 1021245839u, 1074082674u, 1254795532u, 0, EXP_TOLERANCE, 0}, +{ 655, 1071534423u, 4255801807u, 3207681716u, 1926756877u, 1073328631u, 2248030752u, 0, EXP_TOLERANCE, 0}, +{ 656, 1067869425u, 4167786896u, 1077097744u, 1775517981u, 1072740129u, 1534603149u, 0, EXP_TOLERANCE, 0}, +{ 657, 1076164794u, 3187518564u, 1082437406u, 944672491u, 1088519022u, 2668154428u, 0, EXP_TOLERANCE, 0}, +{ 658, 1068240650u, 953085192u, 3227310828u, 3459155777u, 1072752316u, 293671938u, 0, EXP_TOLERANCE, 0}, +{ 659, 1072648234u, 1908555460u, 1073640207u, 260441967u, 1074088146u, 2650479583u, 0, EXP_TOLERANCE, 0}, +{ 660, 1072462486u, 250762477u, 1072582645u, 2886742039u, 1073969911u, 1983590134u, 0, EXP_TOLERANCE, 0}, +{ 661, 3228885910u, 786180031u, 3197734769u, 2788918312u, 567029081u, 1303524864u, 0, EXP_TOLERANCE, 0}, +{ 662, 3225074643u, 2055912467u, 3244244909u, 1394142937u, 1032164285u, 2520921127u, 0, EXP_TOLERANCE, 0}, +{ 663, 1072758713u, 91984146u, 3222252812u, 4126276047u, 1074210222u, 4046645726u, 0, EXP_TOLERANCE, 0}, +{ 664, 1075048683u, 3942715706u, 3239316352u, 410676547u, 1080182733u, 198592884u, 0, EXP_TOLERANCE, 0}, +{ 665, 3215335062u, 86296211u, 1085850694u, 649202596u, 1072604575u, 3552442703u, 0, EXP_TOLERANCE, 0}, +{ 666, 3226492024u, 3069064472u, 3237358008u, 23209276u, 973600692u, 3560381944u, 0, EXP_TOLERANCE, 0}, +{ 667, 1074943832u, 1867297860u, 1072956607u, 2513414118u, 1079542291u, 1065513243u, 0, EXP_TOLERANCE, 0}, +{ 668, 3228513251u, 3171788768u, 3235208783u, 162138697u, 695028140u, 3343634362u, 0, EXP_TOLERANCE, 0}, +{ 669, 1075436999u, 1245110700u, 1081653954u, 2584994077u, 1082399294u, 168782383u, 0, EXP_TOLERANCE, 0}, +{ 670, 3226635752u, 3347226587u, 1058962932u, 2291943376u, 960392171u, 946952000u, 0, EXP_TOLERANCE, 0}, +{ 671, 1070433398u, 966940828u, 1060726420u, 2798041096u, 1072965208u, 1430944161u, 0, EXP_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1074261781u, 2671510586u, 0, EXP_TOLERANCE, 0}, +{ 673, 3228193553u, 1671039260u, 1086395032u, 3745833360u, 754060863u, 1699618982u, 0, EXP_TOLERANCE, 0}, +{ 674, 1069661709u, 651714217u, 1047070645u, 2130549237u, 1072849149u, 67549253u, 0, EXP_TOLERANCE, 0}, +{ 675, 3217601491u, 1423000172u, 3247822717u, 1551488170u, 1072325181u, 206424647u, 0, EXP_TOLERANCE, 0}, +{ 676, 3216277371u, 921077236u, 3213332351u, 1431049019u, 1072531875u, 1612803421u, 0, EXP_TOLERANCE, 0}, +{ 677, 1071704599u, 655715547u, 3190985373u, 1527556471u, 1073423595u, 3219744316u, 0, EXP_TOLERANCE, 0}, +{ 678, 3222412099u, 4110878657u, 3251297180u, 879739345u, 1065756487u, 2212366251u, 0, EXP_TOLERANCE, 0}, +{ 679, 1076367578u, 2623955764u, 1093699897u, 1216444475u, 1090816075u, 3859513056u, 0, EXP_TOLERANCE, 0}, +{ 680, 1078274115u, 107442539u, 3239767031u, 1149813329u, 1136691095u, 2525054892u, 0, EXP_TOLERANCE, 0}, +{ 681, 3224008056u, 1761361082u, 3226030205u, 1121849716u, 1052648890u, 3257183639u, 0, EXP_TOLERANCE, 0}, +{ 682, 3226455627u, 2534144722u, 1044223733u, 3512285706u, 976403563u, 1539377918u, 0, EXP_TOLERANCE, 0}, +{ 683, 3218137533u, 4073670723u, 1050729852u, 3034818849u, 1072207010u, 2190601685u, 0, EXP_TOLERANCE, 0}, +{ 684, 1081013054u, 1421423503u, 1060278048u, 1397153092u, 1447201916u, 3645912721u, 0, EXP_TOLERANCE, 0}, +{ 685, 3220567557u, 1649206019u, 1104525577u, 1267104290u, 1070610592u, 3909007411u, 0, EXP_TOLERANCE, 0}, +{ 686, 3213419345u, 3775270392u, 1040251850u, 68667319u, 1072667916u, 4071660364u, 0, EXP_TOLERANCE, 0}, +{ 687, 3216913812u, 3099226694u, 3254103006u, 4020102648u, 1072459817u, 1012804737u, 0, EXP_TOLERANCE, 0}, +{ 688, 3216271776u, 3718441177u, 3215643451u, 4032951536u, 1072532520u, 4153916148u, 0, EXP_TOLERANCE, 0}, +{ 689, 1066151467u, 508048351u, 3210196713u, 1707937896u, 1072707776u, 258625177u, 0, EXP_TOLERANCE, 0}, +{ 690, 3215388843u, 2784738160u, 1073435430u, 1109346010u, 1072601359u, 769624204u, 0, EXP_TOLERANCE, 0}, +{ 691, 3222579562u, 3331916473u, 3238794568u, 2707019594u, 1064788968u, 937187646u, 0, EXP_TOLERANCE, 0}, +{ 692, 1078502606u, 3093165197u, 1072894805u, 2853215019u, 1147222804u, 2594603642u, 0, EXP_TOLERANCE, 0}, +{ 693, 3219727867u, 2135797997u, 1048399559u, 2941926126u, 1071458929u, 1831646623u, 0, EXP_TOLERANCE, 0}, +{ 694, 1067305348u, 2083412145u, 3249335391u, 507212448u, 1072724198u, 176926544u, 0, EXP_TOLERANCE, 0}, +{ 695, 1074315175u, 4270176401u, 3246546709u, 3288753319u, 1077284434u, 1533074967u, 0, EXP_TOLERANCE, 0}, +{ 696, 3228009919u, 3692175292u, 3197271515u, 3989064196u, 787929498u, 530433217u, 0, EXP_TOLERANCE, 0}, +{ 697, 3228623066u, 3111924274u, 1066772558u, 59281695u, 664079135u, 3761950200u, 0, EXP_TOLERANCE, 0}, +{ 698, 1071878215u, 2135245466u, 3208804313u, 3846547392u, 1073577134u, 3594627032u, 0, EXP_TOLERANCE, 0}, +{ 699, 1079149171u, 972051266u, 3222814246u, 3539700586u, 1184638055u, 2607924773u, 0, EXP_TOLERANCE, 0}, +{ 700, 3216597418u, 330951080u, 1079189813u, 583922384u, 1072495297u, 3853879766u, 0, EXP_TOLERANCE, 0}, +{ 701, 1077057180u, 1711944085u, 1104170032u, 643991456u, 1100755327u, 436337680u, 0, EXP_TOLERANCE, 0}, +{ 702, 3224992365u, 2072550721u, 3250147641u, 4280263530u, 1034088022u, 2955452855u, 0, EXP_TOLERANCE, 0}, +{ 703, 3213944226u, 1566376352u, 1067251433u, 72984588u, 1072658926u, 3741224203u, 0, EXP_TOLERANCE, 0}, +{ 704, 1079547929u, 3103043079u, 1045853123u, 410067497u, 1221488103u, 692790947u, 0, EXP_TOLERANCE, 0}, +{ 705, 3219818221u, 1910366299u, 1081770885u, 634683073u, 1071378326u, 3640151292u, 0, EXP_TOLERANCE, 0}, +{ 706, 1075239232u, 2226525875u, 3224149290u, 2126302825u, 1081272417u, 3298903549u, 0, EXP_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1074843648u, 1040872434u, 0, EXP_TOLERANCE, 0}, +{ 708, 1071725823u, 1953339096u, 1077176252u, 1476516558u, 1073441690u, 3533967691u, 0, EXP_TOLERANCE, 0}, +{ 709, 1072383456u, 1306277326u, 1079089150u, 4093716191u, 1073922696u, 2073217550u, 0, EXP_TOLERANCE, 0}, +{ 710, 3223711603u, 51750045u, 3242913901u, 4256866157u, 1056052895u, 2162728962u, 0, EXP_TOLERANCE, 0}, +{ 711, 3213959335u, 2163853087u, 3232053146u, 2962422808u, 1072658462u, 2104272775u, 0, EXP_TOLERANCE, 0}, +{ 712, 1074468369u, 1618388148u, 3233154824u, 3711953164u, 1077774967u, 2677827653u, 0, EXP_TOLERANCE, 0}, +{ 713, 3227993634u, 357108214u, 3202294604u, 2306775262u, 790944380u, 765011821u, 0, EXP_TOLERANCE, 0}, +{ 714, 3216584150u, 2571356437u, 3249064063u, 2394851808u, 1072496800u, 1660021973u, 0, EXP_TOLERANCE, 0}, +{ 715, 3224196635u, 4273880094u, 1103698617u, 3578832032u, 1050450775u, 303911533u, 0, EXP_TOLERANCE, 0}, +{ 716, 3223989517u, 2091068742u, 3228270226u, 3980489730u, 1052859686u, 2610368796u, 0, EXP_TOLERANCE, 0}, +{ 717, 3222725296u, 2772307714u, 1051008486u, 32546576u, 1063965846u, 2154006417u, 0, EXP_TOLERANCE, 0}, +{ 718, 3225500575u, 2143788498u, 3195498043u, 3630119231u, 1020485834u, 409157440u, 0, EXP_TOLERANCE, 0}, +{ 719, 3215410151u, 2527385594u, 3240503648u, 3482095012u, 1072600086u, 811621435u, 0, EXP_TOLERANCE, 0}, +{ 720, 3226440159u, 2690097362u, 1068598730u, 2360266862u, 977144307u, 2410462353u, 0, EXP_TOLERANCE, 0}, +{ 721, 1070392205u, 2673272949u, 1082639557u, 522449749u, 1072958739u, 2923917591u, 0, EXP_TOLERANCE, 0}, +{ 722, 1081355475u, 3596379400u, 3242016775u, 2002293002u, 1560941176u, 3057535830u, 0, EXP_TOLERANCE, 0}, +{ 723, 1080565288u, 4113224369u, 3222122439u, 2152316893u, 1364491948u, 2667631927u, 0, EXP_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 1070207704u, 1554554093u, 0, EXP_TOLERANCE, 0}, +{ 725, 3228443661u, 2489659568u, 1097051253u, 277506957u, 707885899u, 1135160826u, 0, EXP_TOLERANCE, 0}, +{ 726, 3213421930u, 3850162281u, 3213841942u, 438724093u, 1072667877u, 194850427u, 0, EXP_TOLERANCE, 0}, +{ 727, 1079663895u, 2431814052u, 1075518084u, 2672434118u, 1232182675u, 340027527u, 0, EXP_TOLERANCE, 0}, +{ 728, 3227434095u, 391606792u, 1048184750u, 4168944276u, 886619642u, 2173937429u, 0, EXP_TOLERANCE, 0}, +{ 729, 3227869472u, 457529672u, 3201090276u, 72407935u, 813892000u, 300809617u, 0, EXP_TOLERANCE, 0}, +{ 730, 3220817871u, 3954981400u, 1052053242u, 2411049585u, 1070173574u, 549649836u, 0, EXP_TOLERANCE, 0}, +{ 731, 1076742907u, 485456950u, 1088415093u, 1655397424u, 1095138487u, 1354370438u, 0, EXP_TOLERANCE, 0}, +{ 732, 3215011644u, 1551748070u, 3236871640u, 1329701152u, 1072624028u, 1513346128u, 0, EXP_TOLERANCE, 0}, +{ 733, 3221493394u, 3099222537u, 1104984570u, 4293792842u, 1068812430u, 62941796u, 0, EXP_TOLERANCE, 0}, +{ 734, 3216532617u, 3603065260u, 3197735968u, 2402359253u, 1072502647u, 2362417431u, 0, EXP_TOLERANCE, 0}, +{ 735, 3215601800u, 3961208159u, 3219057584u, 2340553876u, 1072588672u, 3579521348u, 0, EXP_TOLERANCE, 0}, +{ 736, 1073833333u, 4014841779u, 3197672877u, 3697233334u, 1075943590u, 4186803204u, 0, EXP_TOLERANCE, 0}, +{ 737, 3219567113u, 1403876392u, 3254028950u, 921363393u, 1071611207u, 2326666261u, 0, EXP_TOLERANCE, 0}, +{ 738, 1082085982u, 1862576361u, 3194031708u, 2476290925u, 1830816471u, 2702820797u, 0, EXP_TOLERANCE, 0}, +{ 739, 1067487560u, 1454212851u, 1088378861u, 3400401866u, 1072727733u, 836581379u, 0, EXP_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1077560487u, 3057135642u, 0, EXP_TOLERANCE, 0}, +{ 741, 3219555010u, 1199568671u, 3225679997u, 46947405u, 1071623151u, 3836040209u, 0, EXP_TOLERANCE, 0}, +{ 742, 1074539809u, 2596231448u, 3253943728u, 2219151748u, 1077996857u, 995998522u, 0, EXP_TOLERANCE, 0}, +{ 743, 1071769915u, 4119719558u, 3222036299u, 1275474618u, 1073479873u, 114508863u, 0, EXP_TOLERANCE, 0}, +{ 744, 3226277175u, 3347296825u, 1101507910u, 1254014794u, 984676144u, 3717441086u, 0, EXP_TOLERANCE, 0}, +{ 745, 1076779960u, 673775040u, 1070743626u, 244126093u, 1095619946u, 3392967245u, 0, EXP_TOLERANCE, 0}, +{ 746, 3216831338u, 1832066983u, 1051358028u, 3262483417u, 1072469001u, 2438383671u, 0, EXP_TOLERANCE, 0}, +{ 747, 1074413872u, 3962610501u, 3198598777u, 849269178u, 1077583838u, 3412069925u, 0, EXP_TOLERANCE, 0}, +{ 748, 3224988140u, 2497516122u, 3254374111u, 2821429629u, 1034170638u, 3098720309u, 0, EXP_TOLERANCE, 0}, +{ 749, 1074139136u, 2805941787u, 3217785843u, 779131141u, 1076856794u, 1761248984u, 0, EXP_TOLERANCE, 0}, +{ 750, 3222714382u, 723423605u, 1084533420u, 627282213u, 1064040601u, 4058248859u, 0, EXP_TOLERANCE, 0}, +{ 751, 3220141984u, 4292778869u, 1078101071u, 1676860147u, 1071116419u, 1193771065u, 0, EXP_TOLERANCE, 0}, +{ 752, 1074191350u, 3528118587u, 3194648564u, 2363260897u, 1076980368u, 633116683u, 0, EXP_TOLERANCE, 0}, +{ 753, 3214917975u, 1307010018u, 1061248120u, 1468743108u, 1072629211u, 1389200168u, 0, EXP_TOLERANCE, 0}, +{ 754, 3227708771u, 107905661u, 3226089788u, 1943427674u, 843541216u, 3065091785u, 0, EXP_TOLERANCE, 0}, +{ 755, 3213396365u, 760006940u, 1054265604u, 1749976597u, 1072668271u, 3069507900u, 0, EXP_TOLERANCE, 0}, +{ 756, 3225190472u, 2787503556u, 1081282610u, 1195841206u, 1029536384u, 461530301u, 0, EXP_TOLERANCE, 0}, +{ 757, 3213822252u, 545462045u, 3208381743u, 1981311808u, 1072661706u, 3884293482u, 0, EXP_TOLERANCE, 0}, +{ 758, 1070669320u, 3657978397u, 1104463616u, 3501253426u, 1073014782u, 1116550155u, 0, EXP_TOLERANCE, 0}, +{ 759, 1067709649u, 1804177501u, 3210693633u, 3606766729u, 1072734925u, 2164791361u, 0, EXP_TOLERANCE, 0}, +{ 760, 1074759727u, 1336278526u, 1043741618u, 3165279431u, 1078574960u, 112244839u, 0, EXP_TOLERANCE, 0}, +{ 761, 1069103403u, 1599382075u, 1058018527u, 4212580517u, 1072801823u, 3428114030u, 0, EXP_TOLERANCE, 0}, +{ 762, 3217988086u, 3007589929u, 3202026547u, 2792028313u, 1072247303u, 707355694u, 0, EXP_TOLERANCE, 0}, +{ 763, 3228965522u, 1866066996u, 1060329048u, 3727175322u, 537617132u, 2682837865u, 0, EXP_TOLERANCE, 0}, +{ 764, 3215193859u, 150890940u, 1056025306u, 3082724735u, 1072613045u, 2896088168u, 0, EXP_TOLERANCE, 0}, +{ 765, 1071446123u, 80400395u, 1093584426u, 3478941315u, 1073293550u, 1633279969u, 0, EXP_TOLERANCE, 0}, +{ 766, 3228571942u, 4050954182u, 3219263194u, 2537475930u, 682960060u, 281321075u, 0, EXP_TOLERANCE, 0}, +{ 767, 1071133327u, 2881752155u, 3212589299u, 2559651278u, 1073175056u, 2501448914u, 0, EXP_TOLERANCE, 0}, +{ 768, 3228044784u, 440309030u, 3214267461u, 3788040806u, 781499599u, 1484254395u, 0, EXP_TOLERANCE, 0}, +{ 769, 1080553671u, 918813144u, 3208535698u, 1607035904u, 1362352642u, 4120585298u, 0, EXP_TOLERANCE, 0}, +{ 770, 1066254699u, 2497054124u, 1089139147u, 2549609010u, 1072708594u, 225519014u, 0, EXP_TOLERANCE, 0}, +{ 771, 1066960585u, 790219083u, 1054657139u, 2797979479u, 1072718666u, 1434868292u, 0, EXP_TOLERANCE, 0}, +{ 772, 1070364312u, 1149462078u, 1095765205u, 3879963182u, 1072954377u, 2014673971u, 0, EXP_TOLERANCE, 0}, +{ 773, 3216361301u, 2684353926u, 3205212854u, 1732474928u, 1072522215u, 2345875229u, 0, EXP_TOLERANCE, 0}, +{ 774, 1079508325u, 2742237025u, 1051317716u, 3386396147u, 1217770709u, 1976234612u, 0, EXP_TOLERANCE, 0}, +{ 775, 1071619594u, 3408320912u, 1103071166u, 4233059513u, 1073363176u, 268602029u, 0, EXP_TOLERANCE, 0}, +{ 776, 1071155004u, 1077495917u, 1088399968u, 433115118u, 1073182986u, 1009302603u, 0, EXP_TOLERANCE, 0}, +{ 777, 3217130484u, 841366493u, 1051716814u, 4121125128u, 1072425043u, 3371760020u, 0, EXP_TOLERANCE, 0}, +{ 778, 1070923540u, 321857207u, 1089128010u, 1149988239u, 1073100393u, 3087266675u, 0, EXP_TOLERANCE, 0}, +{ 779, 3226668295u, 799866606u, 3197637091u, 3924438208u, 957395551u, 739998359u, 0, EXP_TOLERANCE, 0}, +{ 780, 3213082986u, 2002049816u, 1077053447u, 2240354761u, 1072673115u, 2550101486u, 0, EXP_TOLERANCE, 0}, +{ 781, 3222714827u, 478939968u, 1097035749u, 1066716440u, 1064037493u, 846934361u, 0, EXP_TOLERANCE, 0}, +{ 782, 3224085033u, 1653104725u, 1088548129u, 81977716u, 1051771332u, 1927581294u, 0, EXP_TOLERANCE, 0}, +{ 783, 3215735644u, 3899475018u, 3189694084u, 3330093036u, 1072580740u, 2366929092u, 0, EXP_TOLERANCE, 0}, +{ 784, 1077778247u, 2612450289u, 1079065127u, 603380842u, 1117377332u, 409577748u, 0, EXP_TOLERANCE, 0}, +{ 785, 1080713847u, 3962735564u, 1101570429u, 1372490825u, 1391915326u, 1157784041u, 0, EXP_TOLERANCE, 0}, +{ 786, 1069486080u, 1479841439u, 1059312257u, 541504905u, 1072828520u, 4141675227u, 0, EXP_TOLERANCE, 0}, +{ 787, 1075516450u, 2626148789u, 1057571099u, 4121656076u, 1082865702u, 21674613u, 0, EXP_TOLERANCE, 0}, +{ 788, 1075321933u, 1902560314u, 1043130231u, 3557671562u, 1081732033u, 2391450025u, 0, EXP_TOLERANCE, 0}, +{ 789, 3214801292u, 41779312u, 1081626342u, 831171823u, 1072632749u, 1759846185u, 0, EXP_TOLERANCE, 0}, +{ 790, 1069665436u, 1393168821u, 1066457405u, 1381616968u, 1072849684u, 1289163532u, 0, EXP_TOLERANCE, 0}, +{ 791, 1073386717u, 3756584649u, 3222267229u, 1423157432u, 1075122375u, 2406905526u, 0, EXP_TOLERANCE, 0}, +{ 792, 3229269850u, 1894912556u, 1042426694u, 155024547u, 425197429u, 3283544678u, 0, EXP_TOLERANCE, 0}, +{ 793, 3214327880u, 35164295u, 3203391785u, 1037041084u, 1072647167u, 2362324192u, 0, EXP_TOLERANCE, 0}, +{ 794, 1076388871u, 3957875950u, 3232195211u, 1590756436u, 1091053435u, 3120602682u, 0, EXP_TOLERANCE, 0}, +{ 795, 1071990050u, 1447585080u, 1071279485u, 1107922438u, 1073682984u, 2307905638u, 0, EXP_TOLERANCE, 0}, +{ 796, 1067224038u, 981897615u, 1051856116u, 430357614u, 1072722890u, 3697512449u, 0, EXP_TOLERANCE, 0}, +{ 797, 3222281335u, 395145384u, 3219821938u, 50586510u, 1066548660u, 2167568476u, 0, EXP_TOLERANCE, 0}, +{ 798, 1072921640u, 750827797u, 1082862669u, 230466783u, 1074465228u, 444665273u, 0, EXP_TOLERANCE, 0}, +{ 799, 1077231635u, 1365083575u, 3204848310u, 1700831722u, 1104756143u, 2384443675u, 0, EXP_TOLERANCE, 0}, +{ 800, 3220187542u, 344241827u, 1071538935u, 2715566077u, 1071074931u, 2466090340u, 0, EXP_TOLERANCE, 0}, +{ 801, 3227659912u, 4069301823u, 3193208760u, 2949125229u, 852610347u, 1078331087u, 0, EXP_TOLERANCE, 0}, +{ 802, 1081211291u, 3585711710u, 1065801594u, 2302229267u, 1507738998u, 4025253862u, 0, EXP_TOLERANCE, 0}, +{ 803, 3214041900u, 709803845u, 1048741487u, 2296910194u, 1072655926u, 3012611721u, 0, EXP_TOLERANCE, 0}, +{ 804, 3214252299u, 744421179u, 1069302001u, 2659232829u, 1072649478u, 3670751894u, 0, EXP_TOLERANCE, 0}, +{ 805, 1078155904u, 1799949903u, 3192522886u, 4212149209u, 1131196559u, 2298972399u, 0, EXP_TOLERANCE, 0}, +{ 806, 3217642838u, 145234164u, 3250614064u, 912384201u, 1072316679u, 2192878632u, 0, EXP_TOLERANCE, 0}, +{ 807, 3225830600u, 2784620507u, 1102812948u, 3531481022u, 1005246022u, 3138466984u, 0, EXP_TOLERANCE, 0}, +{ 808, 3229139567u, 383952592u, 3205659905u, 3633194728u, 473314917u, 2102131961u, 0, EXP_TOLERANCE, 0}, +{ 809, 3216059164u, 3792395543u, 1070072378u, 3864816376u, 1072557216u, 3332910443u, 0, EXP_TOLERANCE, 0}, +{ 810, 3217899185u, 2115553675u, 1066288499u, 3538377867u, 1072264895u, 2000840220u, 0, EXP_TOLERANCE, 0}, +{ 811, 3229006513u, 1230026762u, 1090719723u, 440819880u, 522467282u, 176843704u, 0, EXP_TOLERANCE, 0}, +{ 812, 3214518020u, 2991290482u, 1096886719u, 1097971167u, 1072641364u, 1885259123u, 0, EXP_TOLERANCE, 0}, +{ 813, 1077465688u, 1098035020u, 3230900504u, 1479059095u, 1110183315u, 1050435763u, 0, EXP_TOLERANCE, 0}, +{ 814, 3229036868u, 1719428427u, 3188631907u, 3707377409u, 511248635u, 1142506866u, 0, EXP_TOLERANCE, 0}, +{ 815, 1068964805u, 3748932896u, 1084908557u, 1325384361u, 1072792303u, 3780694184u, 0, EXP_TOLERANCE, 0}, +{ 816, 1076315468u, 3979168763u, 1057455255u, 2454615952u, 1090230266u, 2957407211u, 0, EXP_TOLERANCE, 0}, +{ 817, 1068835624u, 1449164578u, 1056960316u, 1654931641u, 1072783501u, 1093920167u, 0, EXP_TOLERANCE, 0}, +{ 818, 1073536162u, 2120487381u, 3226298974u, 2364226633u, 1075333845u, 2170325994u, 0, EXP_TOLERANCE, 0}, +{ 819, 1074022852u, 1074268944u, 1065730444u, 280016852u, 1076445746u, 2202470074u, 0, EXP_TOLERANCE, 0}, +{ 820, 3216036896u, 3315127889u, 3236295594u, 2900924954u, 1072559821u, 2002231287u, 0, EXP_TOLERANCE, 0}, +{ 821, 3215300259u, 2246037502u, 1049691002u, 1496066550u, 1072606660u, 401761059u, 0, EXP_TOLERANCE, 0}, +{ 822, 3213978379u, 4191285446u, 3217936236u, 2382392789u, 1072657877u, 1309200979u, 0, EXP_TOLERANCE, 0}, +{ 823, 1078153244u, 640099844u, 1042152237u, 2064279383u, 1131049946u, 3369789477u, 0, EXP_TOLERANCE, 0}, +{ 824, 1075719134u, 3468560824u, 1093251038u, 310958750u, 1084062910u, 2169865167u, 0, EXP_TOLERANCE, 0}, +{ 825, 1080011184u, 1413568905u, 1100941106u, 1627289946u, 1264211895u, 2702685927u, 0, EXP_TOLERANCE, 0}, +{ 826, 3213569646u, 3797143370u, 3195497539u, 3843275034u, 1072665598u, 686484879u, 0, EXP_TOLERANCE, 0}, +{ 827, 3229008721u, 2806642640u, 3201943068u, 2515980718u, 521639300u, 2160860697u, 0, EXP_TOLERANCE, 0}, +{ 828, 1077440132u, 632580632u, 1078673506u, 3259601317u, 1109589645u, 1728707154u, 0, EXP_TOLERANCE, 0}, +{ 829, 3216709215u, 3309678799u, 1049337078u, 3056787074u, 1072482684u, 1422033902u, 0, EXP_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 1068807516u, 1228216989u, 0, EXP_TOLERANCE, 0}, +{ 831, 1072262554u, 932124675u, 1093915797u, 662682630u, 1073853822u, 1808565180u, 0, EXP_TOLERANCE, 0}, +{ 832, 3228258571u, 1367996113u, 3251723684u, 2974064663u, 742026714u, 1183375229u, 0, EXP_TOLERANCE, 0}, +{ 833, 1074987851u, 323437999u, 1090499064u, 901457511u, 1079835961u, 484425891u, 0, EXP_TOLERANCE, 0}, +{ 834, 3225293116u, 4184941840u, 3196770014u, 2458988443u, 1027121096u, 3710678278u, 0, EXP_TOLERANCE, 0}, +{ 835, 1077132524u, 2023065054u, 3211994098u, 2734612965u, 1102463134u, 3575590741u, 0, EXP_TOLERANCE, 0}, +{ 836, 1071414726u, 3679267365u, 3237728785u, 1699558211u, 1073281253u, 3860891479u, 0, EXP_TOLERANCE, 0}, +{ 837, 1077593250u, 1826799031u, 1078709629u, 3986905229u, 1113100092u, 1053308024u, 0, EXP_TOLERANCE, 0}, +{ 838, 1068572425u, 351061688u, 3194386466u, 4105857588u, 1072765774u, 3548107827u, 0, EXP_TOLERANCE, 0}, +{ 839, 1068808070u, 1365244058u, 1064457319u, 1452191426u, 1072781632u, 1873938050u, 0, EXP_TOLERANCE, 0}, +{ 840, 1071462417u, 2463030625u, 3215975031u, 3773488326u, 1073299968u, 2609346878u, 0, EXP_TOLERANCE, 0}, +{ 841, 3229256575u, 752664055u, 1065110394u, 1835931663u, 430123802u, 2553348310u, 0, EXP_TOLERANCE, 0}, +{ 842, 1077559328u, 3496172149u, 1089617208u, 109068701u, 1112360377u, 1798297128u, 0, EXP_TOLERANCE, 0}, +{ 843, 3215960879u, 1636966254u, 1086098766u, 2016598298u, 1072567463u, 927350131u, 0, EXP_TOLERANCE, 0}, +{ 844, 1067708534u, 3551516956u, 1097969102u, 1317953425u, 1072734889u, 1241991990u, 0, EXP_TOLERANCE, 0}, +{ 845, 3223540761u, 2977627788u, 1045339018u, 516058480u, 1058055761u, 569636114u, 0, EXP_TOLERANCE, 0}, +{ 846, 3224825666u, 3901731263u, 3189566462u, 32272932u, 1037966615u, 1722002382u, 0, EXP_TOLERANCE, 0}, +{ 847, 1074136068u, 1956025297u, 3246628529u, 3840733905u, 1076844736u, 3998888857u, 0, EXP_TOLERANCE, 0}, +{ 848, 1080943668u, 561057891u, 3198494340u, 4271027193u, 1434442732u, 930486357u, 0, EXP_TOLERANCE, 0}, +{ 849, 3228909825u, 692989850u, 3242630588u, 2492225971u, 558170866u, 4102964135u, 0, EXP_TOLERANCE, 0}, +{ 850, 3218062309u, 3439913962u, 1067477011u, 2973333638u, 1072232757u, 2540923660u, 0, EXP_TOLERANCE, 0}, +{ 851, 3219236869u, 877613377u, 1044917899u, 809672798u, 1071803919u, 1940541557u, 0, EXP_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 1066848024u, 3143546584u, 0, EXP_TOLERANCE, 0}, +{ 853, 3227472261u, 2645567288u, 1051258339u, 557182478u, 883115166u, 3149220578u, 0, EXP_TOLERANCE, 0}, +{ 854, 3216640862u, 186287752u, 1061342054u, 4054003419u, 1072490386u, 1493344933u, 0, EXP_TOLERANCE, 0}, +{ 855, 1079440881u, 3506889716u, 3243866036u, 519056371u, 1211540924u, 931610429u, 0, EXP_TOLERANCE, 0}, +{ 856, 1065722725u, 2171898436u, 3246911982u, 1091500784u, 1072704385u, 2261342317u, 0, EXP_TOLERANCE, 0}, +{ 857, 3226870457u, 368493885u, 3222871893u, 1419055230u, 938682684u, 2071809339u, 0, EXP_TOLERANCE, 0}, +{ 858, 1078319084u, 2010971245u, 3188804530u, 1518695799u, 1138773255u, 3191526077u, 0, EXP_TOLERANCE, 0}, +{ 859, 3218009421u, 1239207795u, 1040192984u, 2199481342u, 1072243109u, 70493476u, 0, EXP_TOLERANCE, 0}, +{ 860, 3218318669u, 4264613432u, 3203460972u, 3558930895u, 1072138922u, 254209313u, 0, EXP_TOLERANCE, 0}, +{ 861, 1068125075u, 3772748958u, 3227667376u, 309688336u, 1072748507u, 2061269699u, 0, EXP_TOLERANCE, 0}, +{ 862, 3223403009u, 1077949160u, 1075769893u, 2405271377u, 1059573760u, 4171816038u, 0, EXP_TOLERANCE, 0}, +{ 863, 1078203664u, 3751608506u, 3232278094u, 930375071u, 1133432542u, 338172682u, 0, EXP_TOLERANCE, 0}, +{ 864, 3215394369u, 1518334131u, 3205247482u, 791756713u, 1072601028u, 4217463222u, 0, EXP_TOLERANCE, 0}, +{ 865, 1067240397u, 2825203170u, 3245054001u, 1822981827u, 1072723153u, 3157609123u, 0, EXP_TOLERANCE, 0}, +{ 866, 1080093419u, 514474738u, 1089072073u, 3300845441u, 1277369232u, 226623888u, 0, EXP_TOLERANCE, 0}, +{ 867, 3219536978u, 247369460u, 3197320093u, 687450958u, 1071641076u, 107110682u, 0, EXP_TOLERANCE, 0}, +{ 868, 1081092750u, 2722237629u, 1058272368u, 90602316u, 1463940977u, 1953188388u, 0, EXP_TOLERANCE, 0}, +{ 869, 3217535619u, 1845900544u, 3231520830u, 3389751458u, 1072338812u, 908962619u, 0, EXP_TOLERANCE, 0}, +{ 870, 3227612301u, 737689911u, 3195377751u, 3462616966u, 861355698u, 2672114716u, 0, EXP_TOLERANCE, 0}, +{ 871, 3221441232u, 3620285831u, 1055501023u, 2708056059u, 1068954913u, 645027974u, 0, EXP_TOLERANCE, 0}, +{ 872, 3220513572u, 4073430285u, 1056206159u, 172017902u, 1070666757u, 252709185u, 0, EXP_TOLERANCE, 0}, +{ 873, 3219161094u, 2799176222u, 1052706894u, 4083892667u, 1071848358u, 2936835175u, 0, EXP_TOLERANCE, 0}, +{ 874, 3216959621u, 1562351330u, 1069705601u, 1247765260u, 1072454735u, 1965167652u, 0, EXP_TOLERANCE, 0}, +{ 875, 3224328691u, 51853475u, 3189080201u, 2783553144u, 1048896499u, 4214951332u, 0, EXP_TOLERANCE, 0}, +{ 876, 3220502929u, 3851781549u, 3241598113u, 514064046u, 1070678175u, 727808314u, 0, EXP_TOLERANCE, 0}, +{ 877, 1080123021u, 934745487u, 3248182437u, 2798581921u, 1282811572u, 865963855u, 0, EXP_TOLERANCE, 0}, +{ 878, 3219373949u, 2948648757u, 3232177250u, 4278702895u, 1071727494u, 4061869059u, 0, EXP_TOLERANCE, 0}, +{ 879, 1073534300u, 4259101461u, 1061606772u, 84229920u, 1075331021u, 3220111151u, 0, EXP_TOLERANCE, 0}, +{ 880, 3215901351u, 3891230598u, 1095924595u, 3049217547u, 1072570963u, 2739288242u, 0, EXP_TOLERANCE, 0}, +{ 881, 1074207325u, 3806018919u, 3243191216u, 280177341u, 1077015681u, 2817451756u, 0, EXP_TOLERANCE, 0}, +{ 882, 1070061714u, 3900344258u, 1063647809u, 4206745890u, 1072907975u, 777731621u, 0, EXP_TOLERANCE, 0}, +{ 883, 3222464456u, 2126253040u, 3207248026u, 808507485u, 1065493639u, 3957926160u, 0, EXP_TOLERANCE, 0}, +{ 884, 1076653133u, 3465685634u, 3230391053u, 3754958214u, 1094102091u, 3736097686u, 0, EXP_TOLERANCE, 0}, +{ 885, 1080840988u, 461094531u, 1101110393u, 1316091396u, 1415451629u, 3462873770u, 0, EXP_TOLERANCE, 0}, +{ 886, 1071271770u, 4197635149u, 1091873113u, 1240127141u, 1073226413u, 2596063650u, 0, EXP_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1077336969u, 1088342233u, 0, EXP_TOLERANCE, 0}, +{ 888, 3219720621u, 3744663425u, 3212482771u, 953662066u, 1071465544u, 3159670354u, 0, EXP_TOLERANCE, 0}, +{ 889, 1076782697u, 3564196690u, 3228101916u, 904305212u, 1095661213u, 2831821769u, 0, EXP_TOLERANCE, 0}, +{ 890, 1067207479u, 3566257266u, 3235138829u, 2734275140u, 1072722624u, 3670818002u, 0, EXP_TOLERANCE, 0}, +{ 891, 3227171261u, 606044282u, 3241318094u, 2446416887u, 910906934u, 627559627u, 0, EXP_TOLERANCE, 0}, +{ 892, 1065744532u, 2336116589u, 3197594053u, 2296925138u, 1072704557u, 3081873910u, 0, EXP_TOLERANCE, 0}, +{ 893, 1070101995u, 907670625u, 3240769036u, 1827119006u, 1072914055u, 3781503906u, 0, EXP_TOLERANCE, 0}, +{ 894, 1066487279u, 2818710946u, 3246059905u, 553394170u, 1072711118u, 1345913310u, 0, EXP_TOLERANCE, 0}, +{ 895, 3213621342u, 4099522736u, 3232742168u, 3718083858u, 1072664801u, 910507915u, 0, EXP_TOLERANCE, 0}, +{ 896, 1078739788u, 1059279404u, 1080245336u, 175941677u, 1158113937u, 1087430260u, 0, EXP_TOLERANCE, 0}, +{ 897, 1082121019u, 1650862428u, 1061816101u, 1723201723u, 1843679461u, 3875297949u, 0, EXP_TOLERANCE, 0}, +{ 898, 3226429902u, 2462163405u, 3218946201u, 3876535372u, 977570353u, 3320675628u, 0, EXP_TOLERANCE, 0}, +{ 899, 1076004278u, 495844137u, 1073721460u, 772777946u, 1086622883u, 3050800095u, 0, EXP_TOLERANCE, 0}, +{ 900, 1068143970u, 458757721u, 3245680321u, 3609892707u, 1072749129u, 926681458u, 0, EXP_TOLERANCE, 0}, +{ 901, 3214254476u, 2533012202u, 1079980803u, 3592268374u, 1072649412u, 994782266u, 0, EXP_TOLERANCE, 0}, +{ 902, 3216996268u, 4108274117u, 1063045844u, 571992389u, 1072450679u, 4029990628u, 0, EXP_TOLERANCE, 0}, +{ 903, 1077984359u, 3541110973u, 1096296754u, 3118427427u, 1123258147u, 2499543662u, 0, EXP_TOLERANCE, 0}, +{ 904, 3213902987u, 1213941007u, 1105433735u, 2172963370u, 1072660194u, 3827965195u, 0, EXP_TOLERANCE, 0}, +{ 905, 1079027567u, 272190288u, 1095452370u, 4026581530u, 1173437109u, 1567535437u, 0, EXP_TOLERANCE, 0}, +{ 906, 1079855269u, 2843638672u, 1100510986u, 3190536898u, 1249888458u, 1134925313u, 0, EXP_TOLERANCE, 0}, +{ 907, 1076417062u, 2014317727u, 3247389683u, 2428462015u, 1091433281u, 358810388u, 0, EXP_TOLERANCE, 0}, +{ 908, 1078248077u, 688442200u, 1047852515u, 3035186380u, 1135468183u, 2761855333u, 0, EXP_TOLERANCE, 0}, +{ 909, 1074567060u, 1010095511u, 3221288076u, 405287991u, 1078056039u, 3040249862u, 0, EXP_TOLERANCE, 0}, +{ 910, 3229225943u, 2983070435u, 1089546472u, 2907918480u, 441487241u, 709716015u, 0, EXP_TOLERANCE, 0}, +{ 911, 1076696665u, 81928569u, 1056007286u, 2740556321u, 1094687411u, 274384680u, 0, EXP_TOLERANCE, 0}, +{ 912, 1066276691u, 2076689028u, 1081558619u, 3039159031u, 1072708768u, 1687981859u, 0, EXP_TOLERANCE, 0}, +{ 913, 1067230382u, 1376882094u, 3211003208u, 1296286481u, 1072722992u, 3411996678u, 0, EXP_TOLERANCE, 0}, +{ 914, 1074871434u, 744133164u, 3200943494u, 955832216u, 1079154689u, 809333459u, 0, EXP_TOLERANCE, 0}, +{ 915, 3223144598u, 176522478u, 1069999908u, 2891249491u, 1061531060u, 3521972652u, 0, EXP_TOLERANCE, 0}, +{ 916, 1065584698u, 3685851715u, 3187829932u, 2363997529u, 1072703296u, 1288044552u, 0, EXP_TOLERANCE, 0}, +{ 917, 1065409879u, 3974431579u, 1052505165u, 2589067816u, 1072701918u, 1445868855u, 0, EXP_TOLERANCE, 0}, +{ 918, 3213516885u, 3819109588u, 1048561488u, 969143351u, 1072666411u, 3612690260u, 0, EXP_TOLERANCE, 0}, +{ 919, 1073687973u, 4246896124u, 1104584799u, 1940097860u, 1075581856u, 2819180517u, 0, EXP_TOLERANCE, 0}, +{ 920, 1066912836u, 2228686199u, 3220231833u, 777624847u, 1072717902u, 1922278384u, 0, EXP_TOLERANCE, 0}, +{ 921, 3224127274u, 4189906558u, 3203004203u, 854242364u, 1051215832u, 3083344029u, 0, EXP_TOLERANCE, 0}, +{ 922, 1081890311u, 4089051094u, 3227282692u, 2693170723u, 1758525329u, 2188757040u, 0, EXP_TOLERANCE, 0}, +{ 923, 1066855127u, 1278581412u, 3239296746u, 1774588717u, 1072716979u, 4022161488u, 0, EXP_TOLERANCE, 0}, +{ 924, 3221324110u, 1794845306u, 1104879344u, 4135865182u, 1069331519u, 811293238u, 0, EXP_TOLERANCE, 0}, +{ 925, 1081283231u, 754938390u, 1061291430u, 2010786993u, 1534272358u, 1531468649u, 0, EXP_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1075404046u, 1548021515u, 0, EXP_TOLERANCE, 0}, +{ 927, 3224109162u, 567588900u, 3195452230u, 1421366017u, 1051451646u, 4159762582u, 0, EXP_TOLERANCE, 0}, +{ 928, 3221944027u, 2708717091u, 1071975971u, 1364590470u, 1067555098u, 1265958501u, 0, EXP_TOLERANCE, 0}, +{ 929, 3229068611u, 3461956134u, 3207820115u, 1605709634u, 499521170u, 1987606117u, 0, EXP_TOLERANCE, 0}, +{ 930, 1071594452u, 1497124553u, 1051715442u, 916736957u, 1073352905u, 1851626276u, 0, EXP_TOLERANCE, 0}, +{ 931, 1070002699u, 834914365u, 1064667143u, 2839166298u, 1072899118u, 3236760025u, 0, EXP_TOLERANCE, 0}, +{ 932, 1069862861u, 2139295776u, 1062816721u, 914592523u, 1072878380u, 2228412030u, 0, EXP_TOLERANCE, 0}, +{ 933, 3213754179u, 851569132u, 1058503154u, 1399378677u, 1072662754u, 3489701620u, 0, EXP_TOLERANCE, 0}, +{ 934, 3224100513u, 3897202342u, 3245382590u, 246600375u, 1051576264u, 1680693164u, 0, EXP_TOLERANCE, 0}, +{ 935, 3222314580u, 3620429520u, 1055627557u, 229305u, 1066406271u, 669062905u, 0, EXP_TOLERANCE, 0}, +{ 936, 1076618801u, 3641997865u, 3206673888u, 93720614u, 1093759686u, 70904860u, 0, EXP_TOLERANCE, 0}, +{ 937, 3222565555u, 32766320u, 1062084905u, 3668443038u, 1064873107u, 2362077810u, 0, EXP_TOLERANCE, 0}, +{ 938, 3222250420u, 2039713492u, 3248699388u, 1346210821u, 1066639017u, 1070391097u, 0, EXP_TOLERANCE, 0}, +{ 939, 1078369952u, 1335820726u, 3191756860u, 1808427032u, 1141063400u, 1082588104u, 0, EXP_TOLERANCE, 0}, +{ 940, 1070879947u, 650692001u, 1103515670u, 2253348763u, 1073085342u, 979466763u, 0, EXP_TOLERANCE, 0}, +{ 941, 3213415283u, 2372623300u, 3210185343u, 3200572848u, 1072667979u, 2818022293u, 0, EXP_TOLERANCE, 0}, +{ 942, 1080873125u, 762317532u, 3194595095u, 3192607437u, 1421328859u, 2571597720u, 0, EXP_TOLERANCE, 0}, +{ 943, 1070651309u, 217775356u, 3232827087u, 2969367386u, 1073008911u, 622956426u, 0, EXP_TOLERANCE, 0}, +{ 944, 1069755463u, 3621353969u, 1077994795u, 3873976266u, 1072862686u, 1190493624u, 0, EXP_TOLERANCE, 0}, +{ 945, 1078719075u, 268372152u, 3221764390u, 3216978962u, 1157161937u, 77208680u, 0, EXP_TOLERANCE, 0}, +{ 946, 3227563243u, 142942404u, 1075322987u, 1746449109u, 870456170u, 3164033211u, 0, EXP_TOLERANCE, 0}, +{ 947, 1081986200u, 496534875u, 3254522293u, 2532372502u, 1793917531u, 1796814503u, 0, EXP_TOLERANCE, 0}, +{ 948, 3228205445u, 2999955409u, 3222793392u, 1868977643u, 751888796u, 948939815u, 0, EXP_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1077295134u, 2019316289u, 0, EXP_TOLERANCE, 0}, +{ 950, 1072413103u, 73646871u, 3231442171u, 3711510104u, 1073940200u, 865419667u, 0, EXP_TOLERANCE, 0}, +{ 951, 1077900612u, 218135177u, 3198908856u, 3082199105u, 1120199316u, 3713509082u, 0, EXP_TOLERANCE, 0}, +{ 952, 1072262784u, 1061628117u, 3248859043u, 86776158u, 1073853949u, 3126348436u, 0, EXP_TOLERANCE, 0}, +{ 953, 3217921858u, 938869114u, 1087911145u, 2416710759u, 1072260391u, 538149649u, 0, EXP_TOLERANCE, 0}, +{ 954, 1079848192u, 2970853959u, 3239543429u, 1887505029u, 1249157830u, 3136433410u, 0, EXP_TOLERANCE, 0}, +{ 955, 3225145875u, 1337895935u, 1076463812u, 1172733328u, 1030560683u, 1841720567u, 0, EXP_TOLERANCE, 0}, +{ 956, 1068014296u, 1469010822u, 3229583535u, 551399515u, 1072744869u, 816575420u, 0, EXP_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1076775612u, 57353426u, 0, EXP_TOLERANCE, 0}, +{ 958, 3226410140u, 2976596113u, 3192137295u, 3033242648u, 978502995u, 3859738869u, 0, EXP_TOLERANCE, 0}, +{ 959, 1079824113u, 876810930u, 3197470945u, 2571587447u, 1246952463u, 1889039904u, 0, EXP_TOLERANCE, 0}, +{ 960, 3226042170u, 4007797282u, 3225853845u, 4069319648u, 995463929u, 75967049u, 0, EXP_TOLERANCE, 0}, +{ 961, 1067202926u, 3840538373u, 1043189552u, 3668774580u, 1072722551u, 3111652835u, 0, EXP_TOLERANCE, 0}, +{ 962, 3220757432u, 200857661u, 3229758439u, 3359367736u, 1070272935u, 3556446312u, 0, EXP_TOLERANCE, 0}, +{ 963, 3227826349u, 111868139u, 3227902082u, 2366064003u, 821867115u, 285439771u, 0, EXP_TOLERANCE, 0}, +{ 964, 1066215262u, 3510904416u, 3222131653u, 3822770497u, 1072708281u, 2102944929u, 0, EXP_TOLERANCE, 0}, +{ 965, 3226947075u, 789151814u, 1099269239u, 2958956055u, 931583754u, 3557693371u, 0, EXP_TOLERANCE, 0}, +{ 966, 1076290712u, 722163228u, 1105524559u, 1534462169u, 1089919020u, 2167990146u, 0, EXP_TOLERANCE, 0}, +{ 967, 1066509006u, 2207037106u, 3208952465u, 1231254630u, 1072711463u, 2736011721u, 0, EXP_TOLERANCE, 0}, +{ 968, 3215709852u, 3838689849u, 3198769679u, 1302617170u, 1072582266u, 2827125580u, 0, EXP_TOLERANCE, 0}, +{ 969, 1076501722u, 2527556476u, 3240373426u, 124352692u, 1092391286u, 1779746092u, 0, EXP_TOLERANCE, 0}, +{ 970, 3215269445u, 3502371499u, 1043411944u, 4190072016u, 1072608507u, 1214942277u, 0, EXP_TOLERANCE, 0}, +{ 971, 1070967598u, 1798470077u, 3200116917u, 3421833729u, 1073115765u, 2970386936u, 0, EXP_TOLERANCE, 0}, +{ 972, 3214486476u, 3653237931u, 3204255012u, 3683870669u, 1072642326u, 97744732u, 0, EXP_TOLERANCE, 0}, +{ 973, 1069317222u, 376530104u, 1073853547u, 565755892u, 1072816665u, 2564841654u, 0, EXP_TOLERANCE, 0}, +{ 974, 3226775211u, 558292492u, 1051772749u, 4267873474u, 947457526u, 4219624486u, 0, EXP_TOLERANCE, 0}, +{ 975, 3221626981u, 509637100u, 3212030069u, 215050379u, 1068506067u, 3628098739u, 0, EXP_TOLERANCE, 0}, +{ 976, 1078425613u, 3571665665u, 3188628584u, 757824767u, 1143623000u, 253046892u, 0, EXP_TOLERANCE, 0}, +{ 977, 3220042217u, 998858159u, 1063077962u, 436029885u, 1071192860u, 1450775748u, 0, EXP_TOLERANCE, 0}, +{ 978, 3217481301u, 996300405u, 3193842624u, 80548098u, 1072350133u, 1375924335u, 0, EXP_TOLERANCE, 0}, +{ 979, 3222557384u, 3876129407u, 3215332180u, 2226970413u, 1064924298u, 2928337857u, 0, EXP_TOLERANCE, 0}, +{ 980, 3225026041u, 200013509u, 3224552716u, 414878724u, 1033283085u, 3576891041u, 0, EXP_TOLERANCE, 0}, +{ 981, 3224325637u, 309319541u, 1048979765u, 1261662434u, 1048928773u, 2501187603u, 0, EXP_TOLERANCE, 0}, +{ 982, 1077718303u, 4062255924u, 3224274128u, 4289485681u, 1115992461u, 3449799183u, 0, EXP_TOLERANCE, 0}, +{ 983, 3224601748u, 1611969213u, 1053890378u, 3774617276u, 1043115104u, 1332410328u, 0, EXP_TOLERANCE, 0}, +{ 984, 1075169883u, 1752164782u, 3239587974u, 612223386u, 1080886915u, 1749786576u, 0, EXP_TOLERANCE, 0}, +{ 985, 1065663030u, 2024044989u, 1074932678u, 3259111307u, 1072703914u, 1332706132u, 0, EXP_TOLERANCE, 0}, +{ 986, 1068936158u, 2564965629u, 1093571065u, 169360454u, 1072790345u, 4117240763u, 0, EXP_TOLERANCE, 0}, +{ 987, 1077016178u, 1860101737u, 3191222372u, 1676437468u, 1099835788u, 2272979216u, 0, EXP_TOLERANCE, 0}, +{ 988, 1070288728u, 588387057u, 3192103292u, 2495288012u, 1072942629u, 2557725914u, 0, EXP_TOLERANCE, 0}, +{ 989, 3214127225u, 659070058u, 1073095700u, 1393632068u, 1072653309u, 1767849680u, 0, EXP_TOLERANCE, 0}, +{ 990, 3220828991u, 4276187829u, 3217553330u, 1868253275u, 1070155908u, 2703282856u, 0, EXP_TOLERANCE, 0}, +{ 991, 3222171696u, 2085481575u, 3215994784u, 800910002u, 1066847334u, 587373869u, 0, EXP_TOLERANCE, 0}, +{ 992, 1069517748u, 1950570756u, 3200582211u, 941022151u, 1072830757u, 2869741668u, 0, EXP_TOLERANCE, 0}, +{ 993, 1070113280u, 2075610870u, 3250142022u, 3605152103u, 1072915764u, 3193490161u, 0, EXP_TOLERANCE, 0}, +{ 994, 3216567890u, 3792931748u, 3204857863u, 804393211u, 1072498643u, 1528001685u, 0, EXP_TOLERANCE, 0}, +{ 995, 3229529122u, 3430071177u, 3226288311u, 3652522729u, 329463250u, 4001823001u, 0, EXP_TOLERANCE, 0}, +{ 996, 3215994766u, 236884699u, 3227874605u, 2193269825u, 1072564758u, 4053334377u, 0, EXP_TOLERANCE, 0}, +{ 997, 1071228049u, 2744231849u, 1046186036u, 771053722u, 1073210011u, 860122133u, 0, EXP_TOLERANCE, 0}, +{ 998, 1076656004u, 3000189819u, 1096500901u, 2057239777u, 1094134996u, 3545311159u, 0, EXP_TOLERANCE, 0}, +{ 999, 1078106941u, 205759408u, 3244643377u, 2702292618u, 1128907012u, 16441604u, 0, EXP_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_EXP_H multiple inclusion protection + +// EOF exp.h diff --git a/packages/language/c/libm/current/tests/vectors/fabs.c b/packages/language/c/libm/current/tests/vectors/fabs.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/fabs.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// fabs.c +// +// Test of fabs() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/fabs.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(fabs_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &fabs, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &fabs_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("fabs() is stable"); + } // if + else + { + CYG_TEST_FAIL("fabs() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library fabs() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "fabs() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF fabs.c diff --git a/packages/language/c/libm/current/tests/vectors/fabs.h b/packages/language/c/libm/current/tests/vectors/fabs.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/fabs.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_FABS_H +#define CYGONCE_LIBM_FABS_H +//=========================================================================== +// +// fabs.h +// +// Test vectors for testing of fabs() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/fabs.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define FABS_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t fabs_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1077999148u, 2506787616u, 0, FABS_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 1070670006u, 3176730980u, 0, FABS_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 1092176155u, 2725707538u, 0, FABS_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1092554362u, 2088062470u, 0, FABS_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 1073717029u, 2636405208u, 0, FABS_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1089363191u, 1746012320u, 0, FABS_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1047953160u, 183014794u, 0, FABS_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 1066002386u, 2688957927u, 0, FABS_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1058795730u, 624574473u, 0, FABS_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 1057436194u, 1605286142u, 0, FABS_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1060343410u, 1857607719u, 0, FABS_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1103599987u, 3981151660u, 0, FABS_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1085298022u, 3824988054u, 0, FABS_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 1060076142u, 1372884064u, 0, FABS_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1093826501u, 3217805330u, 0, FABS_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1102287487u, 265058758u, 0, FABS_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1071124229u, 1946677669u, 0, FABS_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1072130299u, 2271884183u, 0, FABS_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 1047365461u, 213658772u, 0, FABS_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 1106628640u, 1564829925u, 0, FABS_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 1068778986u, 2075329122u, 0, FABS_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 1049848642u, 541549344u, 0, FABS_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1085427055u, 567496114u, 0, FABS_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1060548195u, 1299369769u, 0, FABS_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 1061381997u, 3348930841u, 0, FABS_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 1071069297u, 2192461366u, 0, FABS_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1052861772u, 331696577u, 0, FABS_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 1105045286u, 2322696981u, 0, FABS_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1044902177u, 252085215u, 0, FABS_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 1075022077u, 105589263u, 0, FABS_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1107213408u, 428765703u, 0, FABS_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1098568019u, 3517376586u, 0, FABS_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 1086054264u, 237004814u, 0, FABS_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 1047763904u, 472004928u, 0, FABS_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 1054226850u, 4085763910u, 0, FABS_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 1057053639u, 2055490142u, 0, FABS_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 1041492999u, 3725731239u, 0, FABS_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 1077531333u, 1147041027u, 0, FABS_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 1058569126u, 705725219u, 0, FABS_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 1059883440u, 7287411u, 0, FABS_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 1092571574u, 3604989074u, 0, FABS_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 1071597288u, 1681476121u, 0, FABS_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1102831658u, 3410480388u, 0, FABS_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1089216869u, 1494984673u, 0, FABS_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 1054885127u, 644548665u, 0, FABS_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1087554095u, 2312530895u, 0, FABS_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1096085375u, 3018463866u, 0, FABS_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 1064733299u, 1710279345u, 0, FABS_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 1061536351u, 2164450219u, 0, FABS_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1057248676u, 2648986431u, 0, FABS_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 1046938380u, 1839068700u, 0, FABS_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1046493630u, 772102380u, 0, FABS_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 1081988573u, 3058618779u, 0, FABS_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 1051172137u, 506286854u, 0, FABS_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1082428310u, 1147428263u, 0, FABS_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1082016752u, 2844125311u, 0, FABS_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 1064053268u, 704542600u, 0, FABS_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 1052196966u, 184131949u, 0, FABS_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 1076125950u, 3904224140u, 0, FABS_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1100636863u, 426114282u, 0, FABS_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1106165945u, 3774123863u, 0, FABS_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1088005092u, 1377734762u, 0, FABS_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 1069380559u, 1029739074u, 0, FABS_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 1087257949u, 773857656u, 0, FABS_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 1055740962u, 1473865960u, 0, FABS_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1103185231u, 4242092620u, 0, FABS_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 1045032426u, 1732245037u, 0, FABS_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 1101670347u, 1833841275u, 0, FABS_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 1096786815u, 935007012u, 0, FABS_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 1059419605u, 2211464602u, 0, FABS_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1077871417u, 2549219008u, 0, FABS_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1082095089u, 1819374372u, 0, FABS_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1094345280u, 546465680u, 0, FABS_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1044571091u, 2759019783u, 0, FABS_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 1065447634u, 2527221960u, 0, FABS_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1097158000u, 173134582u, 0, FABS_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1086400474u, 547642046u, 0, FABS_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1074860702u, 1231582831u, 0, FABS_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 1061342535u, 3762182190u, 0, FABS_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 1053350775u, 2588067350u, 0, FABS_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 1059495208u, 845263327u, 0, FABS_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 1058092722u, 3092685191u, 0, FABS_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 1070831407u, 4107255722u, 0, FABS_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 1096507209u, 2294867524u, 0, FABS_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 1045842702u, 2265437201u, 0, FABS_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 1068876281u, 1186945904u, 0, FABS_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1081575478u, 3686084548u, 0, FABS_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 1075992592u, 3006860614u, 0, FABS_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 1088665612u, 1948717780u, 0, FABS_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1064345015u, 4272034420u, 0, FABS_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 1098334178u, 4108948538u, 0, FABS_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 1059773769u, 3259274853u, 0, FABS_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1083132498u, 3781708548u, 0, FABS_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 1041211624u, 3011191657u, 0, FABS_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 1063235023u, 2540404725u, 0, FABS_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1083643710u, 311336721u, 0, FABS_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 1051139427u, 1769686293u, 0, FABS_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1078227549u, 508056696u, 0, FABS_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1102910577u, 4064962760u, 0, FABS_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1074178362u, 2112385259u, 0, FABS_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1082295059u, 2514398118u, 0, FABS_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 1099367744u, 1190259653u, 0, FABS_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 1046179435u, 3467757357u, 0, FABS_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 1092159487u, 1508888184u, 0, FABS_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 1049929235u, 166402802u, 0, FABS_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1081866822u, 2441536203u, 0, FABS_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1062392908u, 2479742828u, 0, FABS_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1082396794u, 426896765u, 0, FABS_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 1048145373u, 2055773734u, 0, FABS_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 1089484385u, 874125203u, 0, FABS_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 1065716026u, 120488169u, 0, FABS_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 1059055762u, 2243036871u, 0, FABS_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 1061941258u, 1176656356u, 0, FABS_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 1105333143u, 3037249392u, 0, FABS_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 1089725933u, 2882725208u, 0, FABS_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 1065179826u, 272319256u, 0, FABS_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 1057720186u, 188610379u, 0, FABS_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 1089274869u, 1990439193u, 0, FABS_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 1057135741u, 756052458u, 0, FABS_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1061623064u, 3878055211u, 0, FABS_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 1047807349u, 2676398686u, 0, FABS_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1065079390u, 1697791764u, 0, FABS_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1078084768u, 1931502677u, 0, FABS_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1072253426u, 343404215u, 0, FABS_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 1093747188u, 4140316002u, 0, FABS_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1075422810u, 1864139509u, 0, FABS_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 1072707675u, 2427162817u, 0, FABS_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1064600512u, 3943389284u, 0, FABS_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 1045423002u, 967350972u, 0, FABS_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 1104362211u, 105058217u, 0, FABS_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 1042130860u, 2863482262u, 0, FABS_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 1055145665u, 2801782962u, 0, FABS_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 1086003079u, 2317950339u, 0, FABS_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 1056516397u, 4171919805u, 0, FABS_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 1072665436u, 1918836931u, 0, FABS_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1103902874u, 3456203663u, 0, FABS_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1042279322u, 4170235262u, 0, FABS_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1081348303u, 1296623194u, 0, FABS_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1061684277u, 289979405u, 0, FABS_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1075298944u, 3699090239u, 0, FABS_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1096418100u, 1619819023u, 0, FABS_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1081433004u, 19455098u, 0, FABS_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1076297936u, 3803689997u, 0, FABS_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1101357261u, 2816837387u, 0, FABS_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1069100169u, 3680967506u, 0, FABS_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 1041146119u, 978126928u, 0, FABS_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 1074838397u, 4059818629u, 0, FABS_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 1100980392u, 3383497159u, 0, FABS_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 1055224031u, 2599946514u, 0, FABS_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1105232623u, 3616571377u, 0, FABS_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1076028796u, 3859211180u, 0, FABS_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 1042831340u, 1958025850u, 0, FABS_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 1085623441u, 182132862u, 0, FABS_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 1083018236u, 35632886u, 0, FABS_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1083522102u, 743225214u, 0, FABS_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1080684976u, 1472665012u, 0, FABS_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1094982162u, 1062927000u, 0, FABS_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1058377732u, 2320910576u, 0, FABS_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1078958093u, 1448349062u, 0, FABS_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 1089975150u, 4215445172u, 0, FABS_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 1099148583u, 40413554u, 0, FABS_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 1076237886u, 3995725873u, 0, FABS_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 1040986626u, 672789828u, 0, FABS_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1068390875u, 2075971825u, 0, FABS_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 1062562529u, 1018222907u, 0, FABS_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1067680885u, 937732557u, 0, FABS_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1078342316u, 130346162u, 0, FABS_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 1042898869u, 3807416441u, 0, FABS_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 1068615357u, 1710131411u, 0, FABS_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 1091335713u, 3420420033u, 0, FABS_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 1049684114u, 1160162008u, 0, FABS_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1102543434u, 366653268u, 0, FABS_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 1079144091u, 1325936170u, 0, FABS_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 1092907468u, 1827735934u, 0, FABS_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 1043546754u, 3117037091u, 0, FABS_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1051974004u, 749718883u, 0, FABS_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 1044833651u, 1966536294u, 0, FABS_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1098048435u, 3759049394u, 0, FABS_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1081201623u, 1970107747u, 0, FABS_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1084756444u, 1491017852u, 0, FABS_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 1069146422u, 1141349287u, 0, FABS_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 1083088260u, 1711085243u, 0, FABS_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1098385019u, 2880275004u, 0, FABS_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 1086737787u, 2626629370u, 0, FABS_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 1055231263u, 3936262414u, 0, FABS_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 1060498071u, 1270950554u, 0, FABS_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 1060664575u, 1066985223u, 0, FABS_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 1069575191u, 4017329311u, 0, FABS_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1088164157u, 3154656624u, 0, FABS_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1050652945u, 977586119u, 0, FABS_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1104965247u, 143071571u, 0, FABS_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 1043081808u, 1371169579u, 0, FABS_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 1104309688u, 2259342224u, 0, FABS_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 1099351127u, 1576604497u, 0, FABS_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 1074195779u, 444800035u, 0, FABS_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1072748883u, 130452005u, 0, FABS_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 1087212320u, 1941318385u, 0, FABS_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 1090816018u, 1299392207u, 0, FABS_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1098698804u, 3035093505u, 0, FABS_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 1099192612u, 2160225215u, 0, FABS_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1096723626u, 3360816360u, 0, FABS_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1070995788u, 146831910u, 0, FABS_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 1082932703u, 1603798153u, 0, FABS_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 1099194730u, 2429340443u, 0, FABS_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1075882959u, 955542166u, 0, FABS_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1092971882u, 513397822u, 0, FABS_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 1045686228u, 2782073372u, 0, FABS_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1098564822u, 3242223094u, 0, FABS_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 1091027173u, 3506346169u, 0, FABS_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 1045180829u, 1265459564u, 0, FABS_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1081755890u, 1525260440u, 0, FABS_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 1101185272u, 1263613754u, 0, FABS_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 1058788439u, 4140947288u, 0, FABS_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 1102490744u, 1912759945u, 0, FABS_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 1100721514u, 1001433078u, 0, FABS_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1080923606u, 1088945233u, 0, FABS_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 1068250409u, 831239754u, 0, FABS_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 1078350849u, 3473592372u, 0, FABS_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 1103703058u, 2042340367u, 0, FABS_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 1047282039u, 1840632537u, 0, FABS_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 1083968074u, 144814872u, 0, FABS_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1071236430u, 2552499583u, 0, FABS_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 1095609417u, 2858583811u, 0, FABS_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 1050781281u, 1614537194u, 0, FABS_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 1103455422u, 3545570051u, 0, FABS_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1072744324u, 1813392963u, 0, FABS_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 1049319038u, 2406734491u, 0, FABS_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 1048267433u, 1618759139u, 0, FABS_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1055357248u, 3590035633u, 0, FABS_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 1042459412u, 2431246964u, 0, FABS_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1089501101u, 3088319870u, 0, FABS_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 1087811016u, 3495352775u, 0, FABS_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1046553348u, 1839214511u, 0, FABS_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1058073864u, 739619702u, 0, FABS_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 1052841323u, 2143376228u, 0, FABS_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1074621795u, 671680995u, 0, FABS_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 1066682341u, 2493598049u, 0, FABS_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 1042506311u, 1578976988u, 0, FABS_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 1075504463u, 3425290087u, 0, FABS_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 1060949116u, 3635396812u, 0, FABS_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 1060196346u, 2183973116u, 0, FABS_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 1074462441u, 199516350u, 0, FABS_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 1040222370u, 3570940805u, 0, FABS_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 1060725917u, 980880313u, 0, FABS_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1099977124u, 2558179220u, 0, FABS_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 1047115221u, 1909994277u, 0, FABS_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1060855260u, 1680290941u, 0, FABS_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 1059496132u, 1451927357u, 0, FABS_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 1088728303u, 751136990u, 0, FABS_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1098365967u, 1209623292u, 0, FABS_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 1102940648u, 1717672108u, 0, FABS_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 1054174923u, 3548721654u, 0, FABS_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1077836851u, 2758195125u, 0, FABS_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1084223893u, 2750123373u, 0, FABS_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 1043958672u, 2986160931u, 0, FABS_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 1087992954u, 451471221u, 0, FABS_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1099460228u, 2439500162u, 0, FABS_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 1040415832u, 2283342035u, 0, FABS_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 1065765700u, 179066662u, 0, FABS_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 1064078729u, 3779303391u, 0, FABS_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 1045506226u, 286247089u, 0, FABS_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1093670500u, 1468283899u, 0, FABS_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1083139105u, 3305564080u, 0, FABS_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 1054212159u, 2256346551u, 0, FABS_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 1056541047u, 2295269094u, 0, FABS_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1078173946u, 1482721827u, 0, FABS_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 1073582325u, 1381740563u, 0, FABS_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 1091232324u, 1105857967u, 0, FABS_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 1043015571u, 174689677u, 0, FABS_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1090461859u, 2023082423u, 0, FABS_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1064525899u, 3742487766u, 0, FABS_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 1066308179u, 2136071361u, 0, FABS_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 1066179733u, 210772141u, 0, FABS_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1093840413u, 1751560711u, 0, FABS_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 1066754591u, 2552236599u, 0, FABS_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 1041806969u, 1578223762u, 0, FABS_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 1058506965u, 2110924310u, 0, FABS_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 1084379746u, 2352173188u, 0, FABS_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1101012904u, 2481562701u, 0, FABS_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 1049519003u, 330905705u, 0, FABS_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1040729961u, 4162008079u, 0, FABS_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1081015037u, 1839697482u, 0, FABS_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 1102323563u, 3736863454u, 0, FABS_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 1060785883u, 4200269406u, 0, FABS_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1080217979u, 106027290u, 0, FABS_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 1099500686u, 2132131375u, 0, FABS_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1089388778u, 2334440944u, 0, FABS_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 1071289056u, 4090088208u, 0, FABS_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 1060424416u, 2272831437u, 0, FABS_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1054766684u, 1856594168u, 0, FABS_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1076012412u, 2211699255u, 0, FABS_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 1095283362u, 996259334u, 0, FABS_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1099130747u, 3840380763u, 0, FABS_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 1103935945u, 95874100u, 0, FABS_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 1043665640u, 3441419500u, 0, FABS_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 1091109904u, 2560836004u, 0, FABS_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 1074119318u, 2218230392u, 0, FABS_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1079539654u, 1447312532u, 0, FABS_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1072569643u, 2842113832u, 0, FABS_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1098117193u, 1601981129u, 0, FABS_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1085173524u, 2194185737u, 0, FABS_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 1051600232u, 1346862963u, 0, FABS_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 1064772331u, 3115209742u, 0, FABS_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 1077062394u, 3889223100u, 0, FABS_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 1072994220u, 4163120793u, 0, FABS_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 1057998131u, 1532426189u, 0, FABS_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 1053549673u, 89324166u, 0, FABS_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 1044841454u, 747591401u, 0, FABS_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1091113780u, 271904221u, 0, FABS_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 1080585266u, 314958082u, 0, FABS_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 1049695766u, 3119528953u, 0, FABS_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 1094983928u, 2018361566u, 0, FABS_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 1070132580u, 409584884u, 0, FABS_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1075772446u, 1819156379u, 0, FABS_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1101563433u, 2080534280u, 0, FABS_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1095956900u, 168744837u, 0, FABS_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 1106743252u, 3250487255u, 0, FABS_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 1078859832u, 1336400247u, 0, FABS_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 1056195172u, 265025555u, 0, FABS_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1067300501u, 887044257u, 0, FABS_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1050106742u, 4027115185u, 0, FABS_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 1055016507u, 2875684421u, 0, FABS_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 1063244412u, 284173546u, 0, FABS_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1101458560u, 3147771266u, 0, FABS_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 1064853160u, 3366183281u, 0, FABS_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 1096635140u, 2529029548u, 0, FABS_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 1065952706u, 1080845539u, 0, FABS_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 1044467388u, 469586759u, 0, FABS_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1080249104u, 2863108169u, 0, FABS_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 1063343336u, 4080017377u, 0, FABS_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 1059636742u, 3867917386u, 0, FABS_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 1064522279u, 2962134101u, 0, FABS_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1088201813u, 1702237980u, 0, FABS_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 1055486470u, 2180218657u, 0, FABS_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 1049601096u, 394130786u, 0, FABS_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 1044237059u, 849581558u, 0, FABS_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 1062656366u, 3128971673u, 0, FABS_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1085029866u, 590727700u, 0, FABS_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1101098629u, 820687580u, 0, FABS_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 1104807187u, 1873709254u, 0, FABS_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 1042185105u, 1174874204u, 0, FABS_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1103854676u, 937573440u, 0, FABS_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 1096065286u, 2469774991u, 0, FABS_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 1058121042u, 442507560u, 0, FABS_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1068850520u, 1854921625u, 0, FABS_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 1107228981u, 4001809575u, 0, FABS_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1087224694u, 1793907966u, 0, FABS_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 1053468899u, 2511916952u, 0, FABS_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 1069985548u, 3230931724u, 0, FABS_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1103847606u, 1674254897u, 0, FABS_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 1063780306u, 3275604304u, 0, FABS_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 1047765727u, 3509997278u, 0, FABS_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1047182435u, 2156824613u, 0, FABS_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 1065780437u, 1073153314u, 0, FABS_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 1043109764u, 4261696995u, 0, FABS_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 1096207349u, 4075177615u, 0, FABS_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 1091786365u, 386429966u, 0, FABS_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1078327190u, 1681986446u, 0, FABS_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 1069828285u, 3719038997u, 0, FABS_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 1060749713u, 2420250111u, 0, FABS_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1081914210u, 3679866727u, 0, FABS_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 1041622738u, 2682092368u, 0, FABS_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1056312613u, 4175172697u, 0, FABS_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1092089624u, 1200784450u, 0, FABS_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 1066407215u, 1897285171u, 0, FABS_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 1093887602u, 2270747330u, 0, FABS_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1084120037u, 2857564741u, 0, FABS_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 1055991450u, 1380066948u, 0, FABS_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1063890856u, 4022784584u, 0, FABS_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1044637404u, 1778509100u, 0, FABS_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 1069243652u, 1859175955u, 0, FABS_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 1048277388u, 4128020197u, 0, FABS_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 1045699515u, 2454653987u, 0, FABS_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 1106072835u, 1355181872u, 0, FABS_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 1099121654u, 2592856453u, 0, FABS_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 1074634375u, 3554670043u, 0, FABS_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 1069012833u, 1936670355u, 0, FABS_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 1044807461u, 2960339502u, 0, FABS_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 1049207537u, 4093388677u, 0, FABS_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1091040302u, 1807398746u, 0, FABS_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 1061810546u, 3250576797u, 0, FABS_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1069207109u, 666051428u, 0, FABS_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1103487420u, 1949030179u, 0, FABS_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1054300653u, 622499767u, 0, FABS_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1106688493u, 1490616165u, 0, FABS_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1080943896u, 3662877092u, 0, FABS_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1084088786u, 1356101968u, 0, FABS_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 1072438992u, 2284484846u, 0, FABS_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 1088276041u, 494503287u, 0, FABS_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 1104642268u, 3394882641u, 0, FABS_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 1077778115u, 193885269u, 0, FABS_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 1053001134u, 592580907u, 0, FABS_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1059518664u, 1778008540u, 0, FABS_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 1099249950u, 233240285u, 0, FABS_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 1069513767u, 3719878805u, 0, FABS_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 1073711076u, 3647632375u, 0, FABS_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1103401096u, 2232210456u, 0, FABS_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 1045520036u, 2134662911u, 0, FABS_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1080526145u, 2305279897u, 0, FABS_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 1072380611u, 538224650u, 0, FABS_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 1048926859u, 3683897920u, 0, FABS_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1090280933u, 2694093608u, 0, FABS_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 1064151744u, 872706833u, 0, FABS_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1042339597u, 904146293u, 0, FABS_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 1048211322u, 1894173462u, 0, FABS_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1091225343u, 3521028551u, 0, FABS_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1095386964u, 959640601u, 0, FABS_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 1064005451u, 1553716379u, 0, FABS_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 1091348993u, 2287646644u, 0, FABS_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1068209174u, 3940225170u, 0, FABS_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 1065284713u, 36116288u, 0, FABS_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 1094212205u, 3550227562u, 0, FABS_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1104236126u, 507130047u, 0, FABS_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 1075513130u, 2210969014u, 0, FABS_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 1088823342u, 4059150589u, 0, FABS_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1093103612u, 2664812822u, 0, FABS_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 1066295469u, 1175750283u, 0, FABS_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 1066420545u, 1630036121u, 0, FABS_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1090429875u, 2527029044u, 0, FABS_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1085208677u, 3335703647u, 0, FABS_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1091433848u, 3888398377u, 0, FABS_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 1066679070u, 3242451480u, 0, FABS_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1083230509u, 2739665123u, 0, FABS_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1078517061u, 1297274853u, 0, FABS_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 1046570941u, 2228057309u, 0, FABS_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1088255327u, 270039934u, 0, FABS_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 1071694702u, 83062251u, 0, FABS_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1095743886u, 3833539373u, 0, FABS_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 1057711424u, 2382776852u, 0, FABS_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1085536439u, 1714300821u, 0, FABS_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 1051092760u, 2798720100u, 0, FABS_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 1083714767u, 4039516226u, 0, FABS_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 1075224793u, 1683007544u, 0, FABS_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 1073369300u, 2072627412u, 0, FABS_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 1073086376u, 1120106427u, 0, FABS_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1097859997u, 559918757u, 0, FABS_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 1042677918u, 2026673913u, 0, FABS_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 1107083611u, 3946837259u, 0, FABS_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1057479809u, 3139330994u, 0, FABS_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 1089221852u, 1554593884u, 0, FABS_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1056505004u, 3804703138u, 0, FABS_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 1097380651u, 289355864u, 0, FABS_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 1056456232u, 2157691971u, 0, FABS_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1082157019u, 3570399481u, 0, FABS_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 1053496534u, 558779875u, 0, FABS_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 1045705464u, 1703969219u, 0, FABS_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 1090298613u, 3917440951u, 0, FABS_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1064752080u, 3106613409u, 0, FABS_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1065665372u, 2229777605u, 0, FABS_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 1091979581u, 3967957902u, 0, FABS_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 1068639210u, 3699016825u, 0, FABS_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 1081332748u, 3285165564u, 0, FABS_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1094257658u, 634857910u, 0, FABS_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1083743336u, 2030735578u, 0, FABS_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1079556815u, 3957229084u, 0, FABS_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 1074379685u, 162122081u, 0, FABS_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 1089788138u, 869031839u, 0, FABS_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 1066949826u, 946696117u, 0, FABS_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1075492875u, 3394168074u, 0, FABS_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 1061291147u, 2488789804u, 0, FABS_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1072788663u, 3844072288u, 0, FABS_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 1072450894u, 1244307192u, 0, FABS_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 1052579044u, 2871645739u, 0, FABS_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 1068350633u, 1231934926u, 0, FABS_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 1047966041u, 2386312545u, 0, FABS_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1087803418u, 915867083u, 0, FABS_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1105984188u, 3553288373u, 0, FABS_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1045506226u, 2342364630u, 0, FABS_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 1053685514u, 2911548084u, 0, FABS_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 1050472772u, 1836216409u, 0, FABS_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1070178161u, 1235369496u, 0, FABS_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 1061070948u, 2981820811u, 0, FABS_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 1046447766u, 1565550570u, 0, FABS_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 1089767730u, 2808968027u, 0, FABS_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1053576974u, 1492622658u, 0, FABS_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 1074688031u, 2722693603u, 0, FABS_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 1070422983u, 899763203u, 0, FABS_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 1083186677u, 3789058912u, 0, FABS_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1060199382u, 1682808307u, 0, FABS_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 1094607838u, 2851963139u, 0, FABS_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1081200406u, 2422232642u, 0, FABS_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 1063187430u, 1082582386u, 0, FABS_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 1092334963u, 1789635787u, 0, FABS_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1098330542u, 231339448u, 0, FABS_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1063211461u, 1153251200u, 0, FABS_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1099551055u, 1082898276u, 0, FABS_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1086008285u, 3177299045u, 0, FABS_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 1083370902u, 1924429710u, 0, FABS_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 1097989743u, 42238036u, 0, FABS_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1064761243u, 3304403230u, 0, FABS_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 1065185882u, 1645486982u, 0, FABS_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 1062762009u, 619402181u, 0, FABS_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 1090754746u, 110029735u, 0, FABS_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 1042013090u, 4063688092u, 0, FABS_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1062350619u, 650996069u, 0, FABS_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 1079572157u, 66926332u, 0, FABS_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 1085969659u, 2803378256u, 0, FABS_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1082618553u, 2846400785u, 0, FABS_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1044581201u, 2869128958u, 0, FABS_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1051832506u, 3112381207u, 0, FABS_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 1083771349u, 243303420u, 0, FABS_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 1091654349u, 3218865041u, 0, FABS_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1048415431u, 336846959u, 0, FABS_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 1055954236u, 3639240976u, 0, FABS_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 1064421145u, 717293069u, 0, FABS_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 1104478864u, 3766248610u, 0, FABS_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1083431226u, 756959182u, 0, FABS_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 1058322796u, 3560686300u, 0, FABS_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 1062422428u, 2598148853u, 0, FABS_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1066720824u, 136600515u, 0, FABS_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1096820310u, 1045480938u, 0, FABS_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1091599431u, 1630207738u, 0, FABS_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 1043142370u, 3739770117u, 0, FABS_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 1083246857u, 1498861716u, 0, FABS_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1073516688u, 983275314u, 0, FABS_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 1054849265u, 2353103845u, 0, FABS_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 1103874344u, 1546972125u, 0, FABS_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 1090735865u, 2769161072u, 0, FABS_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 1052228650u, 36855311u, 0, FABS_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1083757053u, 2027463605u, 0, FABS_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 1050369101u, 3808681655u, 0, FABS_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 1040685928u, 3175490326u, 0, FABS_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 1042302993u, 3124482451u, 0, FABS_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 1045245695u, 2751606436u, 0, FABS_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1095694737u, 2016872044u, 0, FABS_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 1051865606u, 1019916843u, 0, FABS_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 1051995104u, 2060433318u, 0, FABS_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 1043696909u, 1098469906u, 0, FABS_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 1062491059u, 3011196295u, 0, FABS_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 1073850675u, 2843222682u, 0, FABS_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1101737698u, 914741728u, 0, FABS_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 1089280230u, 1274901962u, 0, FABS_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 1098432794u, 2134927252u, 0, FABS_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1099201341u, 2230655177u, 0, FABS_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 1062971253u, 717357389u, 0, FABS_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 1066289466u, 834976849u, 0, FABS_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1045656117u, 1385714428u, 0, FABS_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1050527919u, 599268545u, 0, FABS_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 1069954454u, 2840234388u, 0, FABS_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1045922781u, 3136078996u, 0, FABS_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 1086204043u, 2405805086u, 0, FABS_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1106699146u, 2589598340u, 0, FABS_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 1041631125u, 1922837702u, 0, FABS_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 1096132220u, 261447440u, 0, FABS_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1095805232u, 4026487528u, 0, FABS_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 1081640044u, 338765118u, 0, FABS_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 1048699055u, 1085283176u, 0, FABS_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1091520173u, 3031712790u, 0, FABS_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 1071378583u, 3148395674u, 0, FABS_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 1053793422u, 2205233857u, 0, FABS_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1067699608u, 4282766727u, 0, FABS_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 1063349444u, 2920860798u, 0, FABS_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 1057466703u, 969991373u, 0, FABS_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 1091432170u, 1218740205u, 0, FABS_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 1058547594u, 1485218325u, 0, FABS_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 1054590495u, 690157417u, 0, FABS_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1096053810u, 4009839784u, 0, FABS_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 1087075589u, 961532417u, 0, FABS_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 1056395443u, 4174125604u, 0, FABS_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 1095608827u, 4146748230u, 0, FABS_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1076987866u, 3984715440u, 0, FABS_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1084172406u, 936290150u, 0, FABS_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1099787952u, 1866615265u, 0, FABS_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 1105714654u, 712227971u, 0, FABS_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 1082604551u, 3409813738u, 0, FABS_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1079943733u, 3180389060u, 0, FABS_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1077878724u, 556972671u, 0, FABS_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 1070767721u, 4189151332u, 0, FABS_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1096151307u, 198291836u, 0, FABS_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1078091995u, 1219449298u, 0, FABS_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 1057086816u, 1776099219u, 0, FABS_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 1046362060u, 2614400266u, 0, FABS_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 1066499030u, 2959351406u, 0, FABS_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1084544434u, 865443613u, 0, FABS_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 1084303018u, 447506102u, 0, FABS_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1097890173u, 3934398273u, 0, FABS_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 1049256177u, 784208771u, 0, FABS_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 1100848643u, 1527590526u, 0, FABS_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 1089160483u, 3876699591u, 0, FABS_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1083576186u, 2164249756u, 0, FABS_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1091804009u, 2079273665u, 0, FABS_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 1079002460u, 3636214836u, 0, FABS_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1043995372u, 4274131512u, 0, FABS_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 1051338473u, 2648933384u, 0, FABS_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1064563235u, 3216750767u, 0, FABS_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 1061084774u, 1420360746u, 0, FABS_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 1082371716u, 1908572179u, 0, FABS_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1048158178u, 500312015u, 0, FABS_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 1073851962u, 4211343447u, 0, FABS_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1099392394u, 2382118000u, 0, FABS_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1058013442u, 1435344339u, 0, FABS_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 1067054971u, 3403659753u, 0, FABS_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1076840383u, 1198845185u, 0, FABS_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 1075179394u, 2183928090u, 0, FABS_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1101672960u, 2120625396u, 0, FABS_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1099230238u, 586700956u, 0, FABS_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 1071510850u, 2509132460u, 0, FABS_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 1057376949u, 1229308263u, 0, FABS_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 1076592641u, 4078010749u, 0, FABS_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 1050228936u, 4277541051u, 0, FABS_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 1048491365u, 900999594u, 0, FABS_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1076543548u, 4000609478u, 0, FABS_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1048668084u, 2154187873u, 0, FABS_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 1075929840u, 2867079200u, 0, FABS_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 1085738242u, 674547716u, 0, FABS_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 1092932203u, 3158182449u, 0, FABS_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 1089293008u, 3002823940u, 0, FABS_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 1069821174u, 2196511929u, 0, FABS_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 1050438056u, 3655292191u, 0, FABS_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 1095703300u, 1617573614u, 0, FABS_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 1085717732u, 679893506u, 0, FABS_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1089530525u, 2285242807u, 0, FABS_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 1059250016u, 1935990727u, 0, FABS_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1102839166u, 521023584u, 0, FABS_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1103891140u, 2312887617u, 0, FABS_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 1105470167u, 1796441468u, 0, FABS_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 1056793172u, 2095685003u, 0, FABS_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 1045470972u, 2892538035u, 0, FABS_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 1095242103u, 2177698116u, 0, FABS_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 1044078568u, 607966734u, 0, FABS_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 1068906164u, 2830122967u, 0, FABS_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 1089714315u, 2314640506u, 0, FABS_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 1065428659u, 469331883u, 0, FABS_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1097382011u, 560886625u, 0, FABS_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 1049886858u, 2958421324u, 0, FABS_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 1045542849u, 3221475559u, 0, FABS_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1071197530u, 3007808652u, 0, FABS_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 1094545351u, 1767658578u, 0, FABS_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 1063134244u, 1926845182u, 0, FABS_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1040575629u, 90378038u, 0, FABS_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1106859172u, 1610524680u, 0, FABS_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1078635586u, 4274321404u, 0, FABS_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1051205256u, 2034778236u, 0, FABS_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 1051063028u, 1489112261u, 0, FABS_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 1059260269u, 2797651324u, 0, FABS_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1088287256u, 1823161666u, 0, FABS_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 1065927336u, 3420950657u, 0, FABS_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1069902224u, 3554566429u, 0, FABS_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 1097405019u, 2928437580u, 0, FABS_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 1061817913u, 189447067u, 0, FABS_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1052313869u, 2852350928u, 0, FABS_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 1043946301u, 3589563265u, 0, FABS_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 1043127178u, 1766416701u, 0, FABS_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 1072791741u, 3763582673u, 0, FABS_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1079635136u, 1187403069u, 0, FABS_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1103926251u, 1718795752u, 0, FABS_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 1063308449u, 1863545307u, 0, FABS_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1069601294u, 3295607249u, 0, FABS_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 1058947127u, 2585980994u, 0, FABS_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 1046157033u, 15816845u, 0, FABS_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1042413021u, 1051983351u, 0, FABS_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 1053765877u, 2003816032u, 0, FABS_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1052556037u, 3671484625u, 0, FABS_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1067397110u, 3991830201u, 0, FABS_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1064194391u, 4255801807u, 0, FABS_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 1052140785u, 4167786896u, 0, FABS_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1085601978u, 3187518564u, 0, FABS_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 1049366282u, 953085192u, 0, FABS_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1069502506u, 1908555460u, 0, FABS_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1067219606u, 250762477u, 0, FABS_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 1103422358u, 786180031u, 0, FABS_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 1087028179u, 2055912467u, 0, FABS_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1069612985u, 91984146u, 0, FABS_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1081340139u, 3942715706u, 0, FABS_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 1051074198u, 86296211u, 0, FABS_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 1097882744u, 3069064472u, 0, FABS_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1081235288u, 1867297860u, 0, FABS_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 1103049699u, 3171788768u, 0, FABS_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1081728455u, 1245110700u, 0, FABS_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 1098026472u, 3347226587u, 0, FABS_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1058899062u, 966940828u, 0, FABS_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1072793759u, 2487340727u, 0, FABS_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 1100632849u, 1671039260u, 0, FABS_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1057078797u, 651714217u, 0, FABS_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 1059632083u, 1423000172u, 0, FABS_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 1054113659u, 921077236u, 0, FABS_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1067510295u, 655715547u, 0, FABS_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 1080171331u, 4110878657u, 0, FABS_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1085804762u, 2623955764u, 0, FABS_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1091905603u, 107442539u, 0, FABS_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 1085961592u, 1761361082u, 0, FABS_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 1092603467u, 2534144722u, 0, FABS_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 1064362429u, 4073670723u, 0, FABS_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1101984574u, 1421423503u, 0, FABS_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 1069938181u, 1649206019u, 0, FABS_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 1041818449u, 3775270392u, 0, FABS_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 1056847252u, 3099226694u, 0, FABS_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 1054108064u, 3718441177u, 0, FABS_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1044131371u, 508048351u, 0, FABS_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 1051127979u, 2784738160u, 0, FABS_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 1078241642u, 3331916473u, 0, FABS_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1093182670u, 3093165197u, 0, FABS_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 1069098491u, 2135797997u, 0, FABS_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 1048430980u, 2083412145u, 0, FABS_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1075363751u, 4270176401u, 0, FABS_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 1100449215u, 3692175292u, 0, FABS_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 1104208090u, 3111924274u, 0, FABS_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1067683911u, 2135245466u, 0, FABS_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1094877811u, 972051266u, 0, FABS_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 1055482282u, 330951080u, 0, FABS_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1089640092u, 1711944085u, 0, FABS_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 1086945901u, 2072550721u, 0, FABS_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 1045489058u, 1566376352u, 0, FABS_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1095276569u, 3103043079u, 0, FABS_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 1069188845u, 1910366299u, 0, FABS_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1081530688u, 2226525875u, 0, FABS_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1073150247u, 1383818978u, 0, FABS_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 1066482943u, 1953339096u, 0, FABS_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 1066092000u, 1306277326u, 0, FABS_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 1085665139u, 51750045u, 0, FABS_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 1047601319u, 2163853087u, 0, FABS_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1075516945u, 1618388148u, 0, FABS_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 1099384354u, 357108214u, 0, FABS_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 1054420438u, 2571356437u, 0, FABS_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 1083004443u, 4273880094u, 0, FABS_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 1085943053u, 2091068742u, 0, FABS_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 1081533104u, 2772307714u, 0, FABS_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 1093745567u, 2143788498u, 0, FABS_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 1051149287u, 2527385594u, 0, FABS_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 1094685151u, 2690097362u, 0, FABS_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 1058857869u, 2673272949u, 0, FABS_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1104424147u, 3596379400u, 0, FABS_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1099439656u, 4113224369u, 0, FABS_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 1073313068u, 31662602u, 0, FABS_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 1102980109u, 2489659568u, 0, FABS_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 1043918186u, 3850162281u, 0, FABS_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1095392535u, 2431814052u, 0, FABS_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 1095679087u, 391606792u, 0, FABS_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 1100308768u, 457529672u, 0, FABS_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 1071237071u, 3954981400u, 0, FABS_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1086180091u, 485456950u, 0, FABS_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 1050750780u, 1551748070u, 0, FABS_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 1077155474u, 3099222537u, 0, FABS_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 1056466057u, 3603065260u, 0, FABS_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 1051340936u, 3961208159u, 0, FABS_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1074881909u, 4014841779u, 0, FABS_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 1065792009u, 1403876392u, 0, FABS_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1107251806u, 1862576361u, 0, FABS_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 1049661768u, 1454212851u, 0, FABS_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1074406809u, 552676385u, 0, FABS_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 1068925634u, 1199568671u, 0, FABS_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1077685537u, 2596231448u, 0, FABS_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1066527035u, 4119719558u, 0, FABS_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 1092425015u, 3347296825u, 0, FABS_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1084119992u, 673775040u, 0, FABS_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 1055716202u, 1832066983u, 0, FABS_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1077559600u, 3962610501u, 0, FABS_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 1087990252u, 2497516122u, 0, FABS_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1076236288u, 2805941787u, 0, FABS_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 1079425038u, 723423605u, 0, FABS_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 1068464032u, 4292778869u, 0, FABS_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1076288502u, 3528118587u, 0, FABS_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 1045414231u, 1307010018u, 0, FABS_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 1099099491u, 107905661u, 0, FABS_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 1040746893u, 760006940u, 0, FABS_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 1090289736u, 2787503556u, 0, FABS_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 1044318508u, 545462045u, 0, FABS_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 1061232136u, 3657978397u, 0, FABS_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1049883857u, 1804177501u, 0, FABS_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1076856879u, 1336278526u, 0, FABS_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1055471915u, 1599382075u, 0, FABS_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 1060018678u, 3007589929u, 0, FABS_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 1105599122u, 1866066996u, 0, FABS_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 1050932995u, 150890940u, 0, FABS_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 1062008939u, 80400395u, 0, FABS_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 1104156966u, 4050954182u, 0, FABS_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1064841871u, 2881752155u, 0, FABS_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 1101532656u, 440309030u, 0, FABS_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1100476615u, 918813144u, 0, FABS_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 1042137451u, 2497054124u, 0, FABS_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1047037641u, 790219083u, 0, FABS_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 1057781400u, 1149462078u, 0, FABS_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 1055246165u, 2684353926u, 0, FABS_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1095236965u, 2742237025u, 0, FABS_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 1063230986u, 3408320912u, 0, FABS_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 1064863548u, 1077495917u, 0, FABS_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 1057063924u, 841366493u, 0, FABS_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 1064632084u, 321857207u, 0, FABS_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 1098059015u, 799866606u, 0, FABS_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 1043579242u, 2002049816u, 0, FABS_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 1081522635u, 478939968u, 0, FABS_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 1084989993u, 1653104725u, 0, FABS_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 1049377628u, 3899475018u, 0, FABS_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1089312583u, 2612450289u, 0, FABS_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1100636791u, 3962735564u, 0, FABS_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1054806016u, 1479841439u, 0, FABS_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1078662178u, 2626148789u, 0, FABS_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1081613389u, 1902560314u, 0, FABS_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 1046346124u, 41779312u, 0, FABS_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1058131100u, 1393168821u, 0, FABS_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1072338141u, 3756584649u, 0, FABS_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 1106952026u, 1894912556u, 0, FABS_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 1047969864u, 35164295u, 0, FABS_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1084777479u, 3957875950u, 0, FABS_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1068844322u, 1447585080u, 0, FABS_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1046252518u, 981897615u, 0, FABS_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 1080040567u, 395145384u, 0, FABS_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 1069775912u, 750827797u, 0, FABS_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1086668819u, 1365083575u, 0, FABS_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 1070606742u, 344241827u, 0, FABS_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 1100099208u, 4069301823u, 0, FABS_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1103231387u, 3585711710u, 0, FABS_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 1046635308u, 709803845u, 0, FABS_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 1045797131u, 744421179u, 0, FABS_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1092835968u, 1799949903u, 0, FABS_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 1058624854u, 145234164u, 0, FABS_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 1093027016u, 2784620507u, 0, FABS_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 1103676015u, 383952592u, 0, FABS_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 1055992604u, 3792395543u, 0, FABS_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 1057832625u, 2115553675u, 0, FABS_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 1104591537u, 1230026762u, 0, FABS_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 1047111428u, 2991290482u, 0, FABS_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1090048600u, 1098035020u, 0, FABS_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 1103573316u, 1719428427u, 0, FABS_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 1053236165u, 3748932896u, 0, FABS_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1084704076u, 3979168763u, 0, FABS_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1053106984u, 1449164578u, 0, FABS_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1071439010u, 2120487381u, 0, FABS_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1075071428u, 1074268944u, 0, FABS_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 1052824608u, 3315127889u, 0, FABS_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 1048942243u, 2246037502u, 0, FABS_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 1045523211u, 4191285446u, 0, FABS_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1092833308u, 640099844u, 0, FABS_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1079913438u, 3468560824u, 0, FABS_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1096788400u, 1413568905u, 0, FABS_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 1044065902u, 3797143370u, 0, FABS_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 1104593745u, 2806642640u, 0, FABS_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1086877316u, 632580632u, 0, FABS_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 1053496927u, 3309678799u, 0, FABS_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 1074011641u, 2341164249u, 0, FABS_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 1067019674u, 932124675u, 0, FABS_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 1101746443u, 1367996113u, 0, FABS_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1080230731u, 323437999u, 0, FABS_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 1088295228u, 4184941840u, 0, FABS_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1087618284u, 2023065054u, 0, FABS_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 1064074694u, 3679267365u, 0, FABS_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1088079010u, 1826799031u, 0, FABS_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1052843785u, 351061688u, 0, FABS_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1054128006u, 1365244058u, 0, FABS_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1064122385u, 2463030625u, 0, FABS_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 1103793023u, 752664055u, 0, FABS_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1088045088u, 3496172149u, 0, FABS_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 1050651439u, 1636966254u, 0, FABS_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 1050931318u, 3551516956u, 0, FABS_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 1082348569u, 2977627788u, 0, FABS_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 1089924930u, 3901731263u, 0, FABS_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1077281796u, 1956025297u, 0, FABS_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1099818036u, 561057891u, 0, FABS_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 1103446273u, 692989850u, 0, FABS_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 1057995749u, 3439913962u, 0, FABS_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 1066510341u, 877613377u, 0, FABS_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 1074687806u, 905426932u, 0, FABS_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 1098862981u, 2645567288u, 0, FABS_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 1056574302u, 186287752u, 0, FABS_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1097266673u, 3506889716u, 0, FABS_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 1042654053u, 2171898436u, 0, FABS_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 1096164025u, 368493885u, 0, FABS_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1091950572u, 2010971245u, 0, FABS_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 1057942861u, 1239207795u, 0, FABS_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 1063494989u, 4264613432u, 0, FABS_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 1050299283u, 3772748958u, 0, FABS_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 1083259393u, 1077949160u, 0, FABS_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1091835152u, 3751608506u, 0, FABS_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 1051133505u, 1518334131u, 0, FABS_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 1047317453u, 2825203170u, 0, FABS_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1100016363u, 514474738u, 0, FABS_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 1068907602u, 247369460u, 0, FABS_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1104161422u, 2722237629u, 0, FABS_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 1060614787u, 1845900544u, 0, FABS_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 1100051597u, 737689911u, 0, FABS_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 1076054736u, 3620285831u, 0, FABS_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 1071981348u, 4073430285u, 0, FABS_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 1065385990u, 2799176222u, 0, FABS_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 1054795909u, 1562351330u, 0, FABS_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 1085233651u, 51853475u, 0, FABS_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 1071970705u, 3851781549u, 0, FABS_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1100045965u, 934745487u, 0, FABS_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 1065598845u, 2948648757u, 0, FABS_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1072485724u, 4259101461u, 0, FABS_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 1050591911u, 3891230598u, 0, FABS_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1077353053u, 3806018919u, 0, FABS_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1060624530u, 3900344258u, 0, FABS_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 1080223688u, 2126253040u, 0, FABS_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1086090317u, 3465685634u, 0, FABS_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1102861084u, 461094531u, 0, FABS_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 1064980314u, 4197635149u, 0, FABS_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1074333893u, 118603800u, 0, FABS_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 1065945517u, 3744663425u, 0, FABS_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1085171305u, 3564196690u, 0, FABS_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 1048333111u, 3566257266u, 0, FABS_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 1096464829u, 606044282u, 0, FABS_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1041627284u, 2336116589u, 0, FABS_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 1058567659u, 907670625u, 0, FABS_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 1044467183u, 2818710946u, 0, FABS_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 1042020446u, 4099522736u, 0, FABS_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1092371276u, 1059279404u, 0, FABS_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1105189691u, 1650862428u, 0, FABS_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 1091529166u, 2462163405u, 0, FABS_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1084392886u, 495844137u, 0, FABS_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 1052415330u, 458757721u, 0, FABS_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 1045799308u, 2533012202u, 0, FABS_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 1055881132u, 4108274117u, 0, FABS_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1090567271u, 3541110973u, 0, FABS_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 1046496395u, 1213941007u, 0, FABS_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1096853359u, 272190288u, 0, FABS_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1095583909u, 2843638672u, 0, FABS_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1083757094u, 2014317727u, 0, FABS_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1093976717u, 688442200u, 0, FABS_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1076664212u, 1010095511u, 0, FABS_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 1104810967u, 2983070435u, 0, FABS_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1082988121u, 81928569u, 0, FABS_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 1041110867u, 2076689028u, 0, FABS_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1047307438u, 1376882094u, 0, FABS_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1080114314u, 744133164u, 0, FABS_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 1078806678u, 176522478u, 0, FABS_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1043564602u, 3685851715u, 0, FABS_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1040244055u, 3974431579u, 0, FABS_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 1044013141u, 3819109588u, 0, FABS_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 1072639397u, 4246896124u, 0, FABS_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1048038468u, 2228686199u, 0, FABS_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 1083983658u, 4189906558u, 0, FABS_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1103910407u, 4089051094u, 0, FABS_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 1045883607u, 1278581412u, 0, FABS_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 1074889038u, 1794845306u, 0, FABS_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1106449055u, 754938390u, 0, FABS_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1073581409u, 2034303731u, 0, FABS_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 1083965546u, 567588900u, 0, FABS_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 1077606107u, 2708717091u, 0, FABS_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 1104653635u, 3461956134u, 0, FABS_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1065302996u, 1497124553u, 0, FABS_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1058468363u, 834914365u, 0, FABS_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1057279949u, 2139295776u, 0, FABS_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 1042153283u, 851569132u, 0, FABS_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 1086054049u, 3897202342u, 0, FABS_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 1077976660u, 3620429520u, 0, FABS_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1083958833u, 3641997865u, 0, FABS_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 1080324787u, 32766320u, 0, FABS_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 1075815348u, 2039713492u, 0, FABS_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1093050016u, 1335820726u, 0, FABS_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 1061442763u, 650692001u, 0, FABS_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 1043911539u, 2372623300u, 0, FABS_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1100796069u, 762317532u, 0, FABS_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 1062262701u, 217775356u, 0, FABS_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 1057172551u, 3621353969u, 0, FABS_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1091301987u, 268372152u, 0, FABS_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 1098953963u, 142942404u, 0, FABS_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1104006296u, 496534875u, 0, FABS_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 1102741893u, 2999955409u, 0, FABS_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1074319042u, 3353193428u, 0, FABS_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 1068218799u, 73646871u, 0, FABS_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1090483524u, 218135177u, 0, FABS_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 1068068480u, 1061628117u, 0, FABS_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 1061001026u, 938869114u, 0, FABS_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1095576832u, 2970853959u, 0, FABS_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 1090245139u, 1337895935u, 0, FABS_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 1049139928u, 1469010822u, 0, FABS_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1074118123u, 1849711538u, 0, FABS_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 1094655132u, 2976596113u, 0, FABS_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1098698481u, 876810930u, 0, FABS_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 1094287162u, 4007797282u, 0, FABS_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1047279982u, 3840538373u, 0, FABS_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 1070128056u, 200857661u, 0, FABS_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 1101314221u, 111868139u, 0, FABS_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1044195166u, 3510904416u, 0, FABS_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 1095192067u, 789151814u, 0, FABS_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1084679320u, 722163228u, 0, FABS_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1046586062u, 2207037106u, 0, FABS_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 1050400412u, 3838689849u, 0, FABS_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1085938906u, 2527556476u, 0, FABS_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 1052057157u, 3502371499u, 0, FABS_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1064676142u, 1798470077u, 0, FABS_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 1046031308u, 3653237931u, 0, FABS_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1053588582u, 376530104u, 0, FABS_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 1095020203u, 558292492u, 0, FABS_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 1077289061u, 509637100u, 0, FABS_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1092057101u, 3571665665u, 0, FABS_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 1067315689u, 998858159u, 0, FABS_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 1058463317u, 996300405u, 0, FABS_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 1081365192u, 3876129407u, 0, FABS_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 1090125305u, 200013509u, 0, FABS_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 1083133445u, 309319541u, 0, FABS_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1089252639u, 4062255924u, 0, FABS_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 1088652436u, 1611969213u, 0, FABS_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1080412763u, 1752164782u, 0, FABS_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 1041545782u, 2024044989u, 0, FABS_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 1053207518u, 2564965629u, 0, FABS_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1089599090u, 1860101737u, 0, FABS_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1059802968u, 588387057u, 0, FABS_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 1045672057u, 659070058u, 0, FABS_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 1070199615u, 4276187829u, 0, FABS_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 1075736624u, 2085481575u, 0, FABS_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1056934836u, 1950570756u, 0, FABS_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 1057530368u, 2075610870u, 0, FABS_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 1053355602u, 3792931748u, 0, FABS_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 1106162722u, 3430071177u, 0, FABS_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 1053831054u, 236884699u, 0, FABS_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1064936593u, 2744231849u, 0, FABS_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1083996036u, 3000189819u, 0, FABS_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1093835581u, 205759408u, 0, FABS_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_FABS_H multiple inclusion protection + +// EOF fabs.h diff --git a/packages/language/c/libm/current/tests/vectors/floor.c b/packages/language/c/libm/current/tests/vectors/floor.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/floor.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// floor.c +// +// Test of floor() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/floor.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(floor_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &floor, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &floor_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("floor() is stable"); + } // if + else + { + CYG_TEST_FAIL("floor() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library floor() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "floor() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF floor.c diff --git a/packages/language/c/libm/current/tests/vectors/floor.h b/packages/language/c/libm/current/tests/vectors/floor.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/floor.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_FLOOR_H +#define CYGONCE_LIBM_FLOOR_H +//=========================================================================== +// +// floor.h +// +// Test vectors for testing of floor() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/floor.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define FLOOR_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t floor_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1077968896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 3239659804u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1092554360u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 3221225472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1089363168u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1103599987u, 3976200192u, 0, FLOOR_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1085297920u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1093826501u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1102287487u, 251658240u, 0, FLOOR_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 3254112288u, 1565523968u, 0, FLOOR_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1085426944u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 3252528934u, 2323644416u, 0, FLOOR_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 3222536192u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1107213408u, 427819008u, 0, FLOOR_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1098568019u, 3489660928u, 0, FLOOR_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 3233538048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 3225026560u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 3240055224u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1102831658u, 3405774848u, 0, FLOOR_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1089216864u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1087554048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1096085375u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 3229474816u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1082427392u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1082015744u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 3223715840u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1100636863u, 402653184u, 0, FLOOR_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1106165945u, 3772776448u, 0, FLOOR_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1088005056u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 3234741632u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1103185231u, 4236247040u, 0, FLOOR_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 3249153995u, 1845493760u, 0, FLOOR_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 3244270463u, 1073741824u, 0, FLOOR_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1077870592u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1082093568u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1094345280u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1097158000u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1086400384u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1074790400u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 3243990857u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1081573376u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 3223584768u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 3236149280u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 3245817827u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1083131904u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1083642880u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1078198272u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1102910577u, 4060086272u, 0, FLOOR_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1073741824u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1082294272u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 3246851392u, 1207959552u, 0, FLOOR_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 3239643136u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1081864192u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1082396672u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 3236968048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 3252816791u, 3038773248u, 0, FLOOR_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 3237209584u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 3236758528u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1078067200u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 3241230837u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1075314688u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 3221225472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 3251845859u, 109051904u, 0, FLOOR_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 3233486848u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1103902874u, 3456106496u, 0, FLOOR_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1081348096u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1075052544u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1096418100u, 1073741824u, 0, FLOOR_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1081430016u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1076232192u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1101357261u, 2785017856u, 0, FLOOR_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 3222536192u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 3248464040u, 3422552064u, 0, FLOOR_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1105232623u, 3615490048u, 0, FLOOR_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1075970048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 3233107200u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 3230502912u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1083522048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1080680448u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1094982162u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1078951936u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 3237458800u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 3246632231u, 134217728u, 0, FLOOR_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 3223846912u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1078329344u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 3238819368u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1102543434u, 352321536u, 0, FLOOR_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 3226632192u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 3240391118u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1098048435u, 3758096384u, 0, FLOOR_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1081200640u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1084755968u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 3230572544u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1098385019u, 2684354560u, 0, FLOOR_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 3234221440u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1088164096u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1104965247u, 142606336u, 0, FLOOR_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 3251793336u, 2260729856u, 0, FLOOR_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 3246834775u, 1610612736u, 0, FLOOR_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 3221749760u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1072693248u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 3234696064u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 3238299672u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1098698804u, 2952790016u, 0, FLOOR_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 3246676260u, 2281701376u, 0, FLOOR_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1096723626u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 3230416896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 3246678378u, 2550136832u, 0, FLOOR_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1075838976u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1092971882u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1098564822u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 3238510824u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1081753600u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 3248668920u, 1275068416u, 0, FLOOR_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 3249974392u, 1929379840u, 0, FLOOR_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 3248205162u, 1006632960u, 0, FLOOR_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1080918016u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 3225845760u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 3251186706u, 2046820352u, 0, FLOOR_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 3231452160u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 3243093066u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 3250939070u, 3548381184u, 0, FLOOR_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1072693248u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1089501088u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 3235294720u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1074266112u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 3223060480u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 3222274048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1099977124u, 2550136832u, 0, FLOOR_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 3236211968u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1098365967u, 1073741824u, 0, FLOOR_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 3250424296u, 1728053248u, 0, FLOOR_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1077805056u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1084223488u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 3235476608u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1099460228u, 2415919104u, 0, FLOOR_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1093670500u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1083138048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1078165504u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 3221225472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 3238715976u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1090461856u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1093840413u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 3231863808u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1101012904u, 2449473536u, 0, FLOOR_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1081008128u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 3249807211u, 3741319168u, 0, FLOOR_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1080213504u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 3246984334u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1089388768u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1075970048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 3242767010u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1099130747u, 3758096384u, 0, FLOOR_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 3251419593u, 100663296u, 0, FLOOR_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 3238593560u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 3221749760u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1079525376u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1098117193u, 1342177280u, 0, FLOOR_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1085173248u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 3224567808u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 3221225472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1091113776u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 3228073984u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 3242467576u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1075576832u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1101563433u, 2080374784u, 0, FLOOR_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1095956900u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 3254226900u, 3250585600u, 0, FLOOR_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 3226370048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1101458560u, 3120562176u, 0, FLOOR_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 3244118788u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1080246272u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1088201792u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1085029376u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1101098629u, 805306368u, 0, FLOOR_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 3252290835u, 1874853888u, 0, FLOOR_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1103854676u, 931135488u, 0, FLOOR_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 3243548934u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 3254712629u, 4002414592u, 0, FLOOR_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1087224576u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1103847606u, 1669332992u, 0, FLOOR_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 3243690998u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 3239270016u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1078296576u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1081913344u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1092089624u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 3241371251u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1084119040u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 3253556483u, 1356857344u, 0, FLOOR_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 3246605302u, 2684354560u, 0, FLOOR_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 3222274048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1091040296u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1103487420u, 1946157056u, 0, FLOOR_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1106688493u, 1490026496u, 0, FLOOR_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1080942592u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1084088320u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 3235759744u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 3252125916u, 3397386240u, 0, FLOOR_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 3225288704u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 3246733598u, 268435456u, 0, FLOOR_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 3221225472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1103401096u, 2231369728u, 0, FLOOR_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1080524800u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1090280928u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1091225336u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1095386964u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 3238832648u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 3241695854u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1104236126u, 503316480u, 0, FLOOR_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 3223060480u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 3236307008u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1093103612u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1090429872u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1085208576u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1091433848u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1083230208u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1078493184u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1088255296u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1095743886u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1085536256u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 3231199232u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 3222798336u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 3221225472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 3221225472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1097859997u, 536870912u, 0, FLOOR_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 3254567259u, 3946840064u, 0, FLOOR_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 3236705504u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 3244864299u, 536870912u, 0, FLOOR_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1082155008u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 3237782272u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 3239463232u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 3228819456u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1094257658u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1083743232u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1079541760u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 3222274048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 3237271792u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1075314688u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1072693248u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1087803392u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1105984188u, 3552575488u, 0, FLOOR_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 3237251392u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 3222274048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 3230670848u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 3242091487u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1081196544u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 3239818612u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1098330542u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1099551055u, 1073741824u, 0, FLOOR_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1086008064u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 3230855168u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 3245473391u, 268435456u, 0, FLOOR_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 3238238400u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 3227058176u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 3233453312u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1082617856u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 3231255552u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 3239138000u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 3251962512u, 3766484992u, 0, FLOOR_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1083430912u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1096820310u, 536870912u, 0, FLOOR_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1091599428u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 3230731264u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1072693248u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 3251357992u, 1551892480u, 0, FLOOR_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 3238219520u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1083756544u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1095694737u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 3221749760u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1101737698u, 905969664u, 0, FLOOR_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 3236763904u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 3245916442u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1099201341u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 3233687808u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1106699146u, 2588934144u, 0, FLOOR_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 3243615868u, 1073741824u, 0, FLOOR_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1095805232u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 3229126656u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1091520168u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 3238915824u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1096053810u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 3234559360u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 3243092476u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1076953088u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1084172288u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1099787952u, 1744830464u, 0, FLOOR_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 3253198302u, 713031680u, 0, FLOOR_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 3230089216u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1079934976u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1077870592u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1096151307u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1078067200u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1084544000u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 3231787008u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1097890173u, 3758096384u, 0, FLOOR_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 3248332291u, 1543503872u, 0, FLOOR_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 3236644160u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1083575296u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1091804008u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 3226501120u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 3229855744u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 3221749760u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1099392394u, 2281701376u, 0, FLOOR_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1076756480u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 3222798336u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1101672960u, 2113929216u, 0, FLOOR_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1099230238u, 536870912u, 0, FLOOR_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 3224109056u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1076494336u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 3223453696u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 3233222144u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 3240415852u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 3236776672u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 3243186948u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 3233201408u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1089530512u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1102839166u, 520093696u, 0, FLOOR_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1103891140u, 2306867200u, 0, FLOOR_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 3252953815u, 1797259264u, 0, FLOOR_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 3242725752u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 3237197968u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1097382011u, 536870912u, 0, FLOOR_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 3242029000u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1106859172u, 1609564160u, 0, FLOOR_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1078624256u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1088287232u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 3244888667u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 3221225472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1079623680u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1103926251u, 1711276032u, 0, FLOOR_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1085601792u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 3250906006u, 788529152u, 0, FLOOR_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 3234511872u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1081339904u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 3245366392u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1081233408u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 3250533347u, 3187671040u, 0, FLOOR_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1081724928u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 3245510120u, 3489660928u, 0, FLOOR_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1072693248u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 3248116497u, 1677721600u, 0, FLOOR_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 3227656192u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1085804544u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1091905600u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 3233445376u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 3240087116u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1101984574u, 1409286144u, 0, FLOOR_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 3225747456u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1093182670u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1075314688u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 3247932863u, 3758096384u, 0, FLOOR_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 3251691738u, 3112173568u, 0, FLOOR_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1094877811u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1089640080u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 3234429568u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1095276569u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1081528320u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1072693248u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 3233148928u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1075314688u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 3246868002u, 402653184u, 0, FLOOR_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 3230488576u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 3233426944u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 3229020160u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 3241229216u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 3242168800u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1104424147u, 3594518528u, 0, FLOOR_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1099439656u, 4026531840u, 0, FLOOR_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 3221225472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 3250463757u, 2499805184u, 0, FLOOR_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1095392535u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 3243162735u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 3247792416u, 469762048u, 0, FLOOR_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1086179840u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 3224698880u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1074790400u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1107251806u, 1862270976u, 0, FLOOR_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1074266112u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1077673984u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 3239908664u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1084119040u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1077542912u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 3235473920u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1076232192u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 3226910720u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1076232192u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 3246583139u, 134217728u, 0, FLOOR_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 3237773392u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1076756480u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 3253082770u, 1866465280u, 0, FLOOR_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 3251640614u, 4051697664u, 0, FLOOR_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 3249016304u, 469762048u, 0, FLOOR_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1100476615u, 872415232u, 0, FLOOR_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1095236965u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 3245542663u, 805306368u, 0, FLOOR_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 3229007872u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 3232474112u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1089312576u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1100636791u, 3959422976u, 0, FLOOR_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1078657024u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1081610240u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 3254435674u, 1895825408u, 0, FLOOR_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1084777472u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 3227525120u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1086668800u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 3247582856u, 4093640704u, 0, FLOOR_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1103231387u, 3581935616u, 0, FLOOR_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1092835968u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 3240510666u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 3251159663u, 385875968u, 0, FLOOR_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 3252075185u, 1233125376u, 0, FLOOR_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1090048592u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 3251056964u, 1719664640u, 0, FLOOR_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1084703744u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1075052544u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1092833308u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1079902208u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1096788400u, 1073741824u, 0, FLOOR_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 3252077393u, 2810183680u, 0, FLOOR_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1086877312u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 3221749760u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 3249230091u, 1375731712u, 0, FLOOR_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1080229888u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 3235778880u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1087618240u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1088078976u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 3251276671u, 754974720u, 0, FLOOR_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1088045056u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 3229833216u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 3237408592u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1077280768u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1099818036u, 536870912u, 0, FLOOR_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 3250929921u, 696254464u, 0, FLOOR_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 3222274048u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 3246346629u, 2684354560u, 0, FLOOR_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1097266673u, 3221225472u, 0, FLOOR_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 3243647673u, 1073741824u, 0, FLOOR_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1091950572u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 3230743552u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1091835152u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1100016363u, 469762048u, 0, FLOOR_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1104161422u, 2722103296u, 0, FLOOR_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 3247535245u, 738197504u, 0, FLOOR_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 3223584768u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 3232717312u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1100045965u, 872415232u, 0, FLOOR_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1077346304u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 3227713536u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1086090240u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1102861084u, 452984832u, 0, FLOOR_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1074266112u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1085171200u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 3243948477u, 1073741824u, 0, FLOOR_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1092371276u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1105189691u, 1648361472u, 0, FLOOR_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 3239012816u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1084392448u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1090567264u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1096853359u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1095583909u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1083756544u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1093976717u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1076625408u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 3252294615u, 2986344448u, 0, FLOOR_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1082986496u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1080107008u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 3226304512u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 3231467520u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1103910407u, 4085252096u, 0, FLOOR_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 3222536192u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1106449055u, 753926144u, 0, FLOOR_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1072693248u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 3231450112u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 3225092096u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 3252137283u, 3464495104u, 0, FLOOR_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 3233537792u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 3225485312u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1083958272u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 3227811840u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 3223322624u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1093050016u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1100796069u, 738197504u, 0, FLOOR_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1091301984u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 3246437611u, 268435456u, 0, FLOOR_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1104006296u, 494927872u, 0, FLOOR_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 3250225541u, 3003121664u, 0, FLOOR_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1074266112u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1090483520u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1095576832u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 3237728800u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1073741824u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 3242138781u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1098698481u, 805306368u, 0, FLOOR_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 3241770811u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 3248797869u, 134217728u, 0, FLOOR_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 3242675715u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1084679168u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1085938688u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 3242503851u, 2147483648u, 0, FLOOR_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 3224829952u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1092057100u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 3228852224u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 3237608960u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 3230617600u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1089252608u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 3236136096u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1080410112u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1089599088u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 3223322624u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 3253646370u, 3430940672u, 0, FLOOR_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 3220176896u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 0u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1083995136u, 0u, 0, FLOOR_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1093835581u, 0u, 0, FLOOR_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_FLOOR_H multiple inclusion protection + +// EOF floor.h diff --git a/packages/language/c/libm/current/tests/vectors/fmod.c b/packages/language/c/libm/current/tests/vectors/fmod.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/fmod.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// fmod.c +// +// Test of fmod() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/fmod.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(fmod_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &fmod, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_DOUBLE, CYG_LIBM_TEST_VEC_DOUBLE, + &fmod_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("fmod() is stable"); + } // if + else + { + CYG_TEST_FAIL("fmod() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library fmod() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "fmod() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF fmod.c diff --git a/packages/language/c/libm/current/tests/vectors/fmod.h b/packages/language/c/libm/current/tests/vectors/fmod.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/fmod.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_FMOD_H +#define CYGONCE_LIBM_FMOD_H +//=========================================================================== +// +// fmod.h +// +// Test vectors for testing of fmod() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/fmod.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define FMOD_TOLERANCE 2.0E-04 + +static const Cyg_libm_test_double_vec_t fmod_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1077999148u, 2506787616u, 0, FMOD_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 3198414321u, 846480232u, 0, FMOD_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 3230861543u, 3523929528u, 0, FMOD_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1051890679u, 202128524u, 0, FMOD_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 3221200677u, 2636405208u, 0, FMOD_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1054158384u, 1456435203u, 0, FMOD_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1047953160u, 183014794u, 0, FMOD_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 3192981049u, 3507147948u, 0, FMOD_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1042678785u, 2651810544u, 0, FMOD_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 3204919842u, 1605286142u, 0, FMOD_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1060343410u, 1857607719u, 0, FMOD_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1087743907u, 1908470912u, 0, FMOD_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1066704269u, 2005084196u, 0, FMOD_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 3207559790u, 1372884064u, 0, FMOD_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1043643663u, 4276005052u, 0, FMOD_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1088853470u, 3578838744u, 0, FMOD_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1050234959u, 4012882244u, 0, FMOD_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1053757952u, 668308864u, 0, FMOD_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 3194849109u, 213658772u, 0, FMOD_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 3194370383u, 289567216u, 0, FMOD_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 3216262634u, 2075329122u, 0, FMOD_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 1049848642u, 541549344u, 0, FMOD_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1044823656u, 1336171868u, 0, FMOD_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1046610961u, 2503843096u, 0, FMOD_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 3208865645u, 3348930841u, 0, FMOD_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 1071069297u, 2192461366u, 0, FMOD_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1039222015u, 810181536u, 0, FMOD_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 3230733651u, 1514456654u, 0, FMOD_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1044902177u, 252085215u, 0, FMOD_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 3199769773u, 4036976400u, 0, FMOD_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1103250771u, 785295236u, 0, FMOD_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1091988141u, 2703648344u, 0, FMOD_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 3233537912u, 237004814u, 0, FMOD_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 3195247552u, 472004928u, 0, FMOD_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 1054226850u, 4085763910u, 0, FMOD_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 1057053639u, 2055490142u, 0, FMOD_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 3188976647u, 3725731239u, 0, FMOD_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 3214251651u, 512172094u, 0, FMOD_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 3206052774u, 705725219u, 0, FMOD_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 3192959568u, 1202236754u, 0, FMOD_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 3213065624u, 2721628400u, 0, FMOD_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 3207333937u, 3094263432u, 0, FMOD_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1049521884u, 3304083232u, 0, FMOD_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1046994322u, 61462516u, 0, FMOD_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 1054885127u, 644548665u, 0, FMOD_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1071380027u, 640657792u, 0, FMOD_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1085897001u, 2676282550u, 0, FMOD_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 1064733299u, 1710279345u, 0, FMOD_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 1061536351u, 2164450219u, 0, FMOD_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1048011450u, 2538903400u, 0, FMOD_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 3194422028u, 1839068700u, 0, FMOD_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1046493630u, 772102380u, 0, FMOD_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 3189222441u, 275821184u, 0, FMOD_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 1051172137u, 506286854u, 0, FMOD_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1060118125u, 3474068448u, 0, FMOD_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1082016752u, 2844125311u, 0, FMOD_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 3211536916u, 704542600u, 0, FMOD_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 3199680614u, 184131949u, 0, FMOD_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 3213199305u, 1930728556u, 0, FMOD_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1061172644u, 445625924u, 0, FMOD_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1106165945u, 3774123863u, 0, FMOD_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1088005092u, 1377734762u, 0, FMOD_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 1069380559u, 1029739074u, 0, FMOD_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 3213092186u, 1578673304u, 0, FMOD_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 3203224610u, 1473865960u, 0, FMOD_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1066461344u, 779766623u, 0, FMOD_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 3192516074u, 1732245037u, 0, FMOD_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 3245438915u, 2992402264u, 0, FMOD_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 3184940766u, 384929376u, 0, FMOD_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 3193436299u, 4040515210u, 0, FMOD_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1077871417u, 2549219008u, 0, FMOD_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1050449491u, 1455661568u, 0, FMOD_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1046597881u, 4071356792u, 0, FMOD_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1044571091u, 2759019783u, 0, FMOD_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 3212931282u, 2527221960u, 0, FMOD_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1086424556u, 992696240u, 0, FMOD_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1048144001u, 1315432332u, 0, FMOD_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1074860702u, 1231582831u, 0, FMOD_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 1061342535u, 3762182190u, 0, FMOD_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 3200834423u, 2588067350u, 0, FMOD_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 3206978856u, 845263327u, 0, FMOD_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 3185606893u, 1941698816u, 0, FMOD_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 3202283962u, 532003680u, 0, FMOD_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 3213941601u, 3194242032u, 0, FMOD_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 3193326350u, 2265437201u, 0, FMOD_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 3216359929u, 1186945904u, 0, FMOD_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1078423976u, 3014454872u, 0, FMOD_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 3223476240u, 3006860614u, 0, FMOD_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 3191804834u, 805429888u, 0, FMOD_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1045109678u, 2938596596u, 0, FMOD_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 3245817826u, 4108948538u, 0, FMOD_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 3207257417u, 3259274853u, 0, FMOD_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1083132498u, 3781708548u, 0, FMOD_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 3188695272u, 3011191657u, 0, FMOD_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 1063235023u, 2540404725u, 0, FMOD_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1065798268u, 1892082032u, 0, FMOD_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 1051139427u, 1769686293u, 0, FMOD_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1078227549u, 508056696u, 0, FMOD_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1072921212u, 1068650464u, 0, FMOD_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1074178362u, 2112385259u, 0, FMOD_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1075147679u, 2195223528u, 0, FMOD_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 3216432510u, 1181302496u, 0, FMOD_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 3193663083u, 3467757357u, 0, FMOD_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 3207163480u, 4006693368u, 0, FMOD_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 3197412883u, 166402802u, 0, FMOD_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1054870393u, 984614982u, 0, FMOD_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1057518483u, 333407648u, 0, FMOD_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1065525461u, 3035868180u, 0, FMOD_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 3195629021u, 2055773734u, 0, FMOD_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 3207268269u, 968254816u, 0, FMOD_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 1065716026u, 120488169u, 0, FMOD_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 3206539410u, 2243036871u, 0, FMOD_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 3209424906u, 1176656356u, 0, FMOD_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 3208114966u, 2221503008u, 0, FMOD_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 3216207957u, 93487448u, 0, FMOD_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 3212663474u, 272319256u, 0, FMOD_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 1057720186u, 188610379u, 0, FMOD_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 3224071073u, 3216289392u, 0, FMOD_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 1057135741u, 756052458u, 0, FMOD_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1061623064u, 3878055211u, 0, FMOD_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 3195290997u, 2676398686u, 0, FMOD_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1049936853u, 1006339434u, 0, FMOD_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1062958820u, 2137065024u, 0, FMOD_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1060973199u, 148095640u, 0, FMOD_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 3229749188u, 1307397164u, 0, FMOD_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1039920606u, 953688624u, 0, FMOD_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 3220191323u, 2427162817u, 0, FMOD_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1046708981u, 2468407956u, 0, FMOD_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 1045423002u, 967350972u, 0, FMOD_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 3216327783u, 3231806144u, 0, FMOD_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 3189614508u, 2863482262u, 0, FMOD_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 3202629313u, 2801782962u, 0, FMOD_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 3233486727u, 2317950339u, 0, FMOD_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 1056516397u, 4171919805u, 0, FMOD_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 3220149084u, 1918836931u, 0, FMOD_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1087710754u, 3975481920u, 0, FMOD_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1042279322u, 4170235262u, 0, FMOD_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1081348303u, 1296623194u, 0, FMOD_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1048380033u, 2100782952u, 0, FMOD_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1053559082u, 3331309056u, 0, FMOD_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1044995577u, 3049662866u, 0, FMOD_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1081433004u, 19455098u, 0, FMOD_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1068742976u, 3731297016u, 0, FMOD_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1062013985u, 1260267472u, 0, FMOD_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1038183958u, 240865380u, 0, FMOD_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 3188629767u, 978126928u, 0, FMOD_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 3186778307u, 183897584u, 0, FMOD_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 3215761312u, 2515226688u, 0, FMOD_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 3202707679u, 2599946514u, 0, FMOD_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1060113323u, 1918397064u, 0, FMOD_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1063263077u, 2833661440u, 0, FMOD_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 1042831340u, 1958025850u, 0, FMOD_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 3233107089u, 182132862u, 0, FMOD_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 3208824336u, 363458368u, 0, FMOD_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1055397496u, 2453240816u, 0, FMOD_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1052680467u, 2130019016u, 0, FMOD_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1058176236u, 2650129640u, 0, FMOD_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1052577599u, 1567417216u, 0, FMOD_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1048880104u, 1970092992u, 0, FMOD_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 3192950477u, 2687064832u, 0, FMOD_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 3229329238u, 1435201568u, 0, FMOD_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 3197314102u, 376406797u, 0, FMOD_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 1040986626u, 672789828u, 0, FMOD_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1068390875u, 2075971825u, 0, FMOD_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 3210046177u, 1018222907u, 0, FMOD_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1051035947u, 4198290064u, 0, FMOD_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1074849839u, 3133187048u, 0, FMOD_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 1042898869u, 3807416441u, 0, FMOD_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 3216099005u, 1710131411u, 0, FMOD_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 3210660138u, 1172168608u, 0, FMOD_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 1049684114u, 1160162008u, 0, FMOD_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1040561542u, 3805694048u, 0, FMOD_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 3220839162u, 1104385200u, 0, FMOD_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 3199335839u, 3934511604u, 0, FMOD_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 3191030402u, 3117037091u, 0, FMOD_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1051974004u, 749718883u, 0, FMOD_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 1044833651u, 1966536294u, 0, FMOD_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1098048435u, 3759049394u, 0, FMOD_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1081201623u, 1970107747u, 0, FMOD_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1040660169u, 3099529656u, 0, FMOD_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 3216630070u, 1141349287u, 0, FMOD_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 3230571908u, 1711085243u, 0, FMOD_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1081608503u, 2857540928u, 0, FMOD_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 3209784175u, 2197776356u, 0, FMOD_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 1055231263u, 3936262414u, 0, FMOD_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 3193842345u, 3594182144u, 0, FMOD_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 3208148223u, 1066985223u, 0, FMOD_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 3200904104u, 2430630912u, 0, FMOD_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1061331185u, 2742166490u, 0, FMOD_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1050652945u, 977586119u, 0, FMOD_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1054025618u, 2942744752u, 0, FMOD_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 3190565456u, 1371169579u, 0, FMOD_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 3217219935u, 590913702u, 0, FMOD_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 3225624822u, 3870722768u, 0, FMOD_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 3221679427u, 444800035u, 0, FMOD_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1040952781u, 2389993066u, 0, FMOD_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 3191459475u, 1748521624u, 0, FMOD_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 3211332510u, 286824400u, 0, FMOD_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1050430151u, 4110156112u, 0, FMOD_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 3246676260u, 2160225215u, 0, FMOD_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1096723626u, 3360816360u, 0, FMOD_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1051456540u, 1917553576u, 0, FMOD_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 3206546061u, 3198815378u, 0, FMOD_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 3190247209u, 2960836771u, 0, FMOD_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1075882959u, 955542166u, 0, FMOD_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1090247293u, 277513832u, 0, FMOD_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 3193169876u, 2782073372u, 0, FMOD_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1046254439u, 1452785496u, 0, FMOD_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 3192430539u, 2674342256u, 0, FMOD_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 3192664477u, 1265459564u, 0, FMOD_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1081755890u, 1525260440u, 0, FMOD_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 3218714241u, 3798047336u, 0, FMOD_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 3200435981u, 4198185912u, 0, FMOD_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 3235160335u, 3216561680u, 0, FMOD_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 3206681426u, 3088264993u, 0, FMOD_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1080923606u, 1088945233u, 0, FMOD_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 3215734057u, 831239754u, 0, FMOD_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 3225834497u, 3473592372u, 0, FMOD_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 3237458290u, 1180971520u, 0, FMOD_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 3194765687u, 1840632537u, 0, FMOD_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 3212527069u, 3139947274u, 0, FMOD_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1071236430u, 2552499583u, 0, FMOD_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 3236124514u, 1975526024u, 0, FMOD_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 3198264929u, 1614537194u, 0, FMOD_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 3212533984u, 497173268u, 0, FMOD_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1072744324u, 1813392963u, 0, FMOD_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 3189105605u, 823618538u, 0, FMOD_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 3194681588u, 3644250772u, 0, FMOD_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1055357248u, 3590035633u, 0, FMOD_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 3189943060u, 2431246964u, 0, FMOD_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1063756877u, 1061220220u, 0, FMOD_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 3201464249u, 3802196160u, 0, FMOD_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1046553348u, 1839214511u, 0, FMOD_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1058073864u, 739619702u, 0, FMOD_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 3200324971u, 2143376228u, 0, FMOD_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1074621795u, 671680995u, 0, FMOD_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 3194880451u, 1904040096u, 0, FMOD_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 3189989959u, 1578976988u, 0, FMOD_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 3222988111u, 3425290087u, 0, FMOD_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 3208432764u, 3635396812u, 0, FMOD_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 1060196346u, 2183973116u, 0, FMOD_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 3221946089u, 199516350u, 0, FMOD_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 3187706018u, 3570940805u, 0, FMOD_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 3208209565u, 980880313u, 0, FMOD_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1051013756u, 1136419808u, 0, FMOD_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 1047115221u, 1909994277u, 0, FMOD_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1060855260u, 1680290941u, 0, FMOD_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 1059496132u, 1451927357u, 0, FMOD_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 3229249587u, 4000841632u, 0, FMOD_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1089709853u, 4289887088u, 0, FMOD_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 3193171557u, 2988181760u, 0, FMOD_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 1054174923u, 3548721654u, 0, FMOD_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1077836851u, 2758195125u, 0, FMOD_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1084223893u, 2750123373u, 0, FMOD_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 1043958672u, 2986160931u, 0, FMOD_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 3210439834u, 655206164u, 0, FMOD_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1065168215u, 2730893784u, 0, FMOD_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 1040415832u, 2283342035u, 0, FMOD_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 3213249348u, 179066662u, 0, FMOD_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 3209555780u, 2653428444u, 0, FMOD_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 3192989874u, 286247089u, 0, FMOD_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1042387190u, 3729644322u, 0, FMOD_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1063982656u, 288995372u, 0, FMOD_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 3201695807u, 2256346551u, 0, FMOD_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 3204024695u, 2295269094u, 0, FMOD_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1078173946u, 1482721827u, 0, FMOD_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 3218789168u, 1067222589u, 0, FMOD_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 3238715972u, 1105857967u, 0, FMOD_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 1043015571u, 174689677u, 0, FMOD_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1090461859u, 2023082423u, 0, FMOD_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1042450932u, 3792806632u, 0, FMOD_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 3209961906u, 549235376u, 0, FMOD_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 3213663381u, 210772141u, 0, FMOD_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1074236959u, 2078989418u, 0, FMOD_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 1066754591u, 2552236599u, 0, FMOD_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 3189290617u, 1578223762u, 0, FMOD_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 1058506965u, 2110924310u, 0, FMOD_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 3226777784u, 3803503730u, 0, FMOD_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1090661897u, 4109224780u, 0, FMOD_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 3197002651u, 330905705u, 0, FMOD_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1040729961u, 4162008079u, 0, FMOD_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1066933368u, 2616216496u, 0, FMOD_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 3209732000u, 1713317356u, 0, FMOD_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 1060785883u, 4200269406u, 0, FMOD_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1080217979u, 106027290u, 0, FMOD_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 3246984334u, 2132131375u, 0, FMOD_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1089388778u, 2334440944u, 0, FMOD_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 3188978648u, 53730621u, 0, FMOD_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 3207908064u, 2272831437u, 0, FMOD_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1041779426u, 3891783764u, 0, FMOD_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1046732812u, 2649747376u, 0, FMOD_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 3239775042u, 3478493520u, 0, FMOD_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1047787690u, 948908124u, 0, FMOD_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 3234300013u, 2648947376u, 0, FMOD_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 1043665640u, 3441419500u, 0, FMOD_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 3198236941u, 3820642168u, 0, FMOD_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 3221602966u, 2218230392u, 0, FMOD_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1079539654u, 1447312532u, 0, FMOD_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1068566168u, 2855133124u, 0, FMOD_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1086765343u, 3061570600u, 0, FMOD_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1085173524u, 2194185737u, 0, FMOD_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 3199083880u, 1346862963u, 0, FMOD_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 3212255979u, 3115209742u, 0, FMOD_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 3198580902u, 304142856u, 0, FMOD_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 3220477868u, 4163120793u, 0, FMOD_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 3205481779u, 1532426189u, 0, FMOD_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 3201033321u, 89324166u, 0, FMOD_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 3192325102u, 747591401u, 0, FMOD_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1044111400u, 2575445184u, 0, FMOD_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 3228068914u, 314958082u, 0, FMOD_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 3197179414u, 3119528953u, 0, FMOD_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 3242467576u, 2018361566u, 0, FMOD_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 1070132580u, 409584884u, 0, FMOD_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1075772446u, 1819156379u, 0, FMOD_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1039403427u, 2442639174u, 0, FMOD_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1063385043u, 3585159232u, 0, FMOD_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 3206049888u, 4103432160u, 0, FMOD_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 3226343480u, 1336400247u, 0, FMOD_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 3203678820u, 265025555u, 0, FMOD_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1054577011u, 4153584415u, 0, FMOD_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1040176487u, 1878366608u, 0, FMOD_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 3202500155u, 2875684421u, 0, FMOD_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 1063244412u, 284173546u, 0, FMOD_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1071807923u, 312606150u, 0, FMOD_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 1064853160u, 3366183281u, 0, FMOD_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 3244118788u, 2529029548u, 0, FMOD_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 3205712156u, 4172836134u, 0, FMOD_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 3191951036u, 469586759u, 0, FMOD_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1074619269u, 1234534336u, 0, FMOD_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 3206035771u, 2486501230u, 0, FMOD_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 3207120390u, 3867917386u, 0, FMOD_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 1064522279u, 2962134101u, 0, FMOD_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1070238218u, 912774380u, 0, FMOD_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 3202970118u, 2180218657u, 0, FMOD_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 3197084744u, 394130786u, 0, FMOD_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 1044237059u, 849581558u, 0, FMOD_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 3210140014u, 3128971673u, 0, FMOD_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1085029866u, 590727700u, 0, FMOD_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1060519198u, 1076427008u, 0, FMOD_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 3244270115u, 1511759794u, 0, FMOD_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 3189668753u, 1174874204u, 0, FMOD_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1058113326u, 3918295192u, 0, FMOD_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 3189938496u, 1368214615u, 0, FMOD_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 1058121042u, 442507560u, 0, FMOD_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1049609548u, 1646883138u, 0, FMOD_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 3238549819u, 2765439496u, 0, FMOD_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1087224694u, 1793907966u, 0, FMOD_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 3200952547u, 2511916952u, 0, FMOD_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 1069985548u, 3230931724u, 0, FMOD_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1045477571u, 1500468300u, 0, FMOD_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 3194151953u, 1373226250u, 0, FMOD_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 3195249375u, 3509997278u, 0, FMOD_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1041068762u, 564045456u, 0, FMOD_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 3213264085u, 1073153314u, 0, FMOD_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 3190593412u, 4261696995u, 0, FMOD_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 3201320186u, 476898428u, 0, FMOD_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 3227713245u, 1759240960u, 0, FMOD_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1047429662u, 3437752484u, 0, FMOD_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 3201345754u, 2519515052u, 0, FMOD_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 1060749713u, 2420250111u, 0, FMOD_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1079559162u, 2308024940u, 0, FMOD_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 1041622738u, 2682092368u, 0, FMOD_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1056312613u, 4175172697u, 0, FMOD_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1083003632u, 4285104928u, 0, FMOD_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 3213890863u, 1897285171u, 0, FMOD_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 3227231066u, 1971978560u, 0, FMOD_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1073791751u, 1059642802u, 0, FMOD_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 3203475098u, 1380066948u, 0, FMOD_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1059349327u, 1316571190u, 0, FMOD_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1044637404u, 1778509100u, 0, FMOD_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 3216727300u, 1859175955u, 0, FMOD_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 1048277388u, 4128020197u, 0, FMOD_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 3193183163u, 2454653987u, 0, FMOD_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 3241244190u, 3025145350u, 0, FMOD_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 3246605302u, 2592856453u, 0, FMOD_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 3222118023u, 3554670043u, 0, FMOD_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 1069012833u, 1936670355u, 0, FMOD_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 3192291109u, 2960339502u, 0, FMOD_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 3196691185u, 4093388677u, 0, FMOD_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1045958323u, 3424358216u, 0, FMOD_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 3205823281u, 3451169168u, 0, FMOD_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1061231898u, 3399757973u, 0, FMOD_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1095501482u, 2875899476u, 0, FMOD_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1054300653u, 622499767u, 0, FMOD_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1103736017u, 2855907608u, 0, FMOD_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1080943896u, 3662877092u, 0, FMOD_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1084088786u, 1356101968u, 0, FMOD_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 3217679715u, 469322620u, 0, FMOD_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 3235759689u, 494503287u, 0, FMOD_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 3223911532u, 173791494u, 0, FMOD_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 3225261763u, 193885269u, 0, FMOD_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 3199311539u, 2393690158u, 0, FMOD_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1048801824u, 3195212490u, 0, FMOD_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 3228816181u, 1359670313u, 0, FMOD_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 1069513767u, 3719878805u, 0, FMOD_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 3221194724u, 3647632375u, 0, FMOD_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1086804271u, 489677294u, 0, FMOD_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 3189174738u, 354450658u, 0, FMOD_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1077196127u, 3020131960u, 0, FMOD_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 3201479185u, 1215665312u, 0, FMOD_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 3196410507u, 3683897920u, 0, FMOD_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1042429296u, 1703038013u, 0, FMOD_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 3211635392u, 872706833u, 0, FMOD_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1042339597u, 904146293u, 0, FMOD_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 3195694970u, 1894173462u, 0, FMOD_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1053758667u, 3875143628u, 0, FMOD_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1054021633u, 1928931314u, 0, FMOD_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 1064005451u, 1553716379u, 0, FMOD_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 3238832641u, 2287646644u, 0, FMOD_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1047989319u, 614577280u, 0, FMOD_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 3206426174u, 2771053432u, 0, FMOD_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 3207255028u, 3340483506u, 0, FMOD_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1045678438u, 3816317612u, 0, FMOD_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 3222996778u, 2210969014u, 0, FMOD_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 3185418975u, 3516238752u, 0, FMOD_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1047986576u, 2771970048u, 0, FMOD_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 3213779117u, 1175750283u, 0, FMOD_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 3213904193u, 1630036121u, 0, FMOD_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1045724540u, 750040168u, 0, FMOD_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1085208677u, 3335703647u, 0, FMOD_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1048513329u, 2169633852u, 0, FMOD_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 1066679070u, 3242451480u, 0, FMOD_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1059241906u, 897557388u, 0, FMOD_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1061024718u, 3625447158u, 0, FMOD_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 1046570941u, 2228057309u, 0, FMOD_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1088255327u, 270039934u, 0, FMOD_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 3205153736u, 1898015808u, 0, FMOD_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1059049552u, 2531004602u, 0, FMOD_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 3205195072u, 2382776852u, 0, FMOD_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1085536439u, 1714300821u, 0, FMOD_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 1051092760u, 2798720100u, 0, FMOD_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 3231198415u, 4039516226u, 0, FMOD_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 3222708441u, 1683007544u, 0, FMOD_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 3220852948u, 2072627412u, 0, FMOD_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 3220570024u, 1120106427u, 0, FMOD_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1056109503u, 2716202508u, 0, FMOD_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 1042677918u, 2026673913u, 0, FMOD_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 3234910977u, 2872262312u, 0, FMOD_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1042788941u, 932511168u, 0, FMOD_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 3225380292u, 3686860192u, 0, FMOD_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1056505004u, 3804703138u, 0, FMOD_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 3225823157u, 2240583912u, 0, FMOD_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 3203939880u, 2157691971u, 0, FMOD_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1082157019u, 3570399481u, 0, FMOD_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 3200980182u, 558779875u, 0, FMOD_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 1045705464u, 1703969219u, 0, FMOD_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 3196348449u, 216650340u, 0, FMOD_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1064752080u, 3106613409u, 0, FMOD_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1064038618u, 4107370570u, 0, FMOD_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 3204196577u, 4124519344u, 0, FMOD_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 1068639210u, 3699016825u, 0, FMOD_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 3209840260u, 3330978248u, 0, FMOD_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1052048505u, 3710809328u, 0, FMOD_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1083743336u, 2030735578u, 0, FMOD_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1049160814u, 783877892u, 0, FMOD_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 3221863333u, 162122081u, 0, FMOD_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 3222903301u, 3540960152u, 0, FMOD_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 3214433474u, 946696117u, 0, FMOD_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1075492875u, 3394168074u, 0, FMOD_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 3208774795u, 2488789804u, 0, FMOD_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1050791994u, 3020747664u, 0, FMOD_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 3190874175u, 3436568192u, 0, FMOD_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 3200062692u, 2871645739u, 0, FMOD_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 1068350633u, 1231934926u, 0, FMOD_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 3195449689u, 2386312545u, 0, FMOD_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1045638702u, 1901110664u, 0, FMOD_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1065654333u, 394374333u, 0, FMOD_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1045506226u, 2342364630u, 0, FMOD_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 3201169162u, 2911548084u, 0, FMOD_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 1050472772u, 1836216409u, 0, FMOD_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1070178161u, 1235369496u, 0, FMOD_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 3204870528u, 1089922664u, 0, FMOD_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 3193931414u, 1565550570u, 0, FMOD_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 3202912790u, 180991026u, 0, FMOD_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1053576974u, 1492622658u, 0, FMOD_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 3222171679u, 2722693603u, 0, FMOD_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 3207251162u, 2122903232u, 0, FMOD_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 3225636468u, 4171394256u, 0, FMOD_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1058588091u, 1970510414u, 0, FMOD_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 3242091486u, 2851963139u, 0, FMOD_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1081200406u, 2422232642u, 0, FMOD_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 3210671078u, 1082582386u, 0, FMOD_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 3206731454u, 161965426u, 0, FMOD_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1051746624u, 967485912u, 0, FMOD_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1057074856u, 3116846123u, 0, FMOD_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1062378436u, 616033392u, 0, FMOD_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1057989685u, 820293200u, 0, FMOD_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 3203738102u, 3383038049u, 0, FMOD_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 3188554021u, 400599972u, 0, FMOD_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1064761243u, 3304403230u, 0, FMOD_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 3212669530u, 1645486982u, 0, FMOD_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 1062762009u, 619402181u, 0, FMOD_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 3193133439u, 1179097756u, 0, FMOD_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 3189496738u, 4063688092u, 0, FMOD_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1053065959u, 2577623264u, 0, FMOD_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 3227055805u, 66926332u, 0, FMOD_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 3233453307u, 2803378256u, 0, FMOD_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1045619713u, 827121532u, 0, FMOD_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1044581201u, 2869128958u, 0, FMOD_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1041693028u, 3636927048u, 0, FMOD_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 3231254997u, 243303420u, 0, FMOD_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 3204798666u, 787476908u, 0, FMOD_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1048415431u, 336846959u, 0, FMOD_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 1055954236u, 3639240976u, 0, FMOD_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 3209542044u, 3408740508u, 0, FMOD_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 3196014770u, 4109085092u, 0, FMOD_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1055393679u, 3734226980u, 0, FMOD_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 3205806444u, 3560686300u, 0, FMOD_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 3209906076u, 2598148853u, 0, FMOD_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1062362868u, 274765744u, 0, FMOD_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1096820310u, 1045480938u, 0, FMOD_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1091599431u, 1630207738u, 0, FMOD_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 3190626018u, 3739770117u, 0, FMOD_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 3230730505u, 1498861716u, 0, FMOD_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1073516688u, 983275314u, 0, FMOD_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 1054849265u, 2353103845u, 0, FMOD_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 3247869383u, 771950728u, 0, FMOD_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 3222233842u, 1259919276u, 0, FMOD_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 3195569658u, 2694859280u, 0, FMOD_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1064734089u, 2507689016u, 0, FMOD_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 3197852749u, 3808681655u, 0, FMOD_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 1040685928u, 3175490326u, 0, FMOD_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 1042302993u, 3124482451u, 0, FMOD_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 1045245695u, 2751606436u, 0, FMOD_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1079338259u, 2482332128u, 0, FMOD_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 3199349254u, 1019916843u, 0, FMOD_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 3199478752u, 2060433318u, 0, FMOD_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 3191180557u, 1098469906u, 0, FMOD_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 3209974707u, 3011196295u, 0, FMOD_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 3221334323u, 2843222682u, 0, FMOD_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1055493013u, 3780280494u, 0, FMOD_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 3236763878u, 1274901962u, 0, FMOD_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 3245916442u, 2134927252u, 0, FMOD_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1099201341u, 2230655177u, 0, FMOD_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 1062971253u, 717357389u, 0, FMOD_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 3213773114u, 834976849u, 0, FMOD_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1045656117u, 1385714428u, 0, FMOD_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1050527919u, 599268545u, 0, FMOD_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 1069954454u, 2840234388u, 0, FMOD_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1045922781u, 3136078996u, 0, FMOD_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 3233687691u, 2405805086u, 0, FMOD_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1106699146u, 2589598340u, 0, FMOD_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 3189114773u, 1922837702u, 0, FMOD_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 3209751028u, 448279323u, 0, FMOD_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1072528272u, 4241782692u, 0, FMOD_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 3229123692u, 338765118u, 0, FMOD_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 3185471006u, 277550016u, 0, FMOD_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1091520173u, 3031712790u, 0, FMOD_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 3188988265u, 2020178358u, 0, FMOD_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 3201277070u, 2205233857u, 0, FMOD_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1067699608u, 4282766727u, 0, FMOD_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 3210833092u, 2920860798u, 0, FMOD_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 3204950351u, 969991373u, 0, FMOD_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 3238915818u, 1218740205u, 0, FMOD_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 3206031242u, 1485218325u, 0, FMOD_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 3190754019u, 1427484234u, 0, FMOD_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1079518848u, 867425232u, 0, FMOD_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 3234559237u, 961532417u, 0, FMOD_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 3195763358u, 3837894848u, 0, FMOD_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 3232069221u, 948734696u, 0, FMOD_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1049869649u, 4014532372u, 0, FMOD_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1084172406u, 936290150u, 0, FMOD_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1068112940u, 2065541092u, 0, FMOD_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 3253198302u, 712227971u, 0, FMOD_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 3230088199u, 3409813738u, 0, FMOD_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1079943733u, 3180389060u, 0, FMOD_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1055208115u, 591272876u, 0, FMOD_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 1070767721u, 4189151332u, 0, FMOD_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1055499771u, 875289856u, 0, FMOD_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1078091995u, 1219449298u, 0, FMOD_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 3204570464u, 1776099219u, 0, FMOD_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 3193845708u, 2614400266u, 0, FMOD_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 3213982678u, 2959351406u, 0, FMOD_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1084544434u, 865443613u, 0, FMOD_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 3195388962u, 48097524u, 0, FMOD_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1032218095u, 1642424320u, 0, FMOD_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 3196739825u, 784208771u, 0, FMOD_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 3202606342u, 467945328u, 0, FMOD_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 3207025197u, 2389472u, 0, FMOD_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1057168829u, 1285739008u, 0, FMOD_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1080204852u, 4108973564u, 0, FMOD_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 3215665271u, 4164533778u, 0, FMOD_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1043995372u, 4274131512u, 0, FMOD_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 3198822121u, 2648933384u, 0, FMOD_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1043331165u, 1682911544u, 0, FMOD_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 1061084774u, 1420360746u, 0, FMOD_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 3226719625u, 1147057872u, 0, FMOD_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1048158178u, 500312015u, 0, FMOD_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 3221335610u, 4211343447u, 0, FMOD_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1040869806u, 453051744u, 0, FMOD_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1058013442u, 1435344339u, 0, FMOD_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 3214538619u, 3403659753u, 0, FMOD_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1076840383u, 1198845185u, 0, FMOD_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 3195363473u, 3195485470u, 0, FMOD_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1040260673u, 1412589497u, 0, FMOD_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1058907437u, 671754624u, 0, FMOD_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 3218994498u, 2509132460u, 0, FMOD_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 3204860597u, 1229308263u, 0, FMOD_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 3194080982u, 4202642048u, 0, FMOD_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 3197712584u, 4277541051u, 0, FMOD_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 3195975013u, 900999594u, 0, FMOD_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1076543548u, 4000609478u, 0, FMOD_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1048668084u, 2154187873u, 0, FMOD_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 3223413488u, 2867079200u, 0, FMOD_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 3209670490u, 2459169696u, 0, FMOD_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 3187937981u, 192140832u, 0, FMOD_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 3204553045u, 1016263584u, 0, FMOD_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 3190009780u, 1471223680u, 0, FMOD_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 1050438056u, 3655292191u, 0, FMOD_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 3201825032u, 683072336u, 0, FMOD_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 3211397784u, 2944964096u, 0, FMOD_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1083907976u, 1700204076u, 0, FMOD_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 3206733664u, 1935990727u, 0, FMOD_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1055362223u, 1655370368u, 0, FMOD_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1041541300u, 2718621452u, 0, FMOD_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 3246721348u, 4280920168u, 0, FMOD_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 3204276820u, 2095685003u, 0, FMOD_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 3188854329u, 894705716u, 0, FMOD_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 3227202903u, 2218581776u, 0, FMOD_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 3191562216u, 607966734u, 0, FMOD_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 3190040120u, 1259669816u, 0, FMOD_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 3202693343u, 3819577136u, 0, FMOD_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 3212912307u, 469331883u, 0, FMOD_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1091003205u, 1960741600u, 0, FMOD_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 1049886858u, 2958421324u, 0, FMOD_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 3187732659u, 3170670584u, 0, FMOD_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1068805587u, 143208890u, 0, FMOD_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 3233211152u, 3004976480u, 0, FMOD_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 3210617892u, 1926845182u, 0, FMOD_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1040575629u, 90378038u, 0, FMOD_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1084994804u, 440348838u, 0, FMOD_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1055010561u, 2898139117u, 0, FMOD_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1051205256u, 2034778236u, 0, FMOD_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 1051063028u, 1489112261u, 0, FMOD_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 3206743917u, 2797651324u, 0, FMOD_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1050267207u, 2986447262u, 0, FMOD_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 1065927336u, 3420950657u, 0, FMOD_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1062400682u, 4042146994u, 0, FMOD_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 3186712505u, 567458542u, 0, FMOD_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 3196334080u, 1428817848u, 0, FMOD_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1045015195u, 3961163520u, 0, FMOD_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 1043946301u, 3589563265u, 0, FMOD_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 3190610826u, 1766416701u, 0, FMOD_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 3188237498u, 3752050608u, 0, FMOD_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1074075536u, 781324096u, 0, FMOD_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1093945023u, 2445129250u, 0, FMOD_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 3210792097u, 1863545307u, 0, FMOD_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1067954746u, 1325898786u, 0, FMOD_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 1058947127u, 2585980994u, 0, FMOD_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 1046157033u, 15816845u, 0, FMOD_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1042413021u, 1051983351u, 0, FMOD_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 3201249525u, 2003816032u, 0, FMOD_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1052556037u, 3671484625u, 0, FMOD_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1059390649u, 4224879470u, 0, FMOD_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1060184982u, 408640463u, 0, FMOD_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 1052140785u, 4167786896u, 0, FMOD_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1079142177u, 1808227904u, 0, FMOD_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 1049366282u, 953085192u, 0, FMOD_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1069502506u, 1908555460u, 0, FMOD_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1067219606u, 250762477u, 0, FMOD_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 3197718341u, 1660002464u, 0, FMOD_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 3234511827u, 2055912467u, 0, FMOD_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1069612985u, 91984146u, 0, FMOD_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1081340139u, 3942715706u, 0, FMOD_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 3198557846u, 86296211u, 0, FMOD_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 3237336469u, 3928080368u, 0, FMOD_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1072038560u, 3116996488u, 0, FMOD_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 3233674177u, 213600176u, 0, FMOD_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1077030987u, 36702448u, 0, FMOD_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 3204328645u, 501177472u, 0, FMOD_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1058899062u, 966940828u, 0, FMOD_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1072793759u, 2487340727u, 0, FMOD_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 3232128780u, 3325632576u, 0, FMOD_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1046831002u, 3175457063u, 0, FMOD_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 3207115731u, 1423000172u, 0, FMOD_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 3201597307u, 921077236u, 0, FMOD_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1041178029u, 1042162176u, 0, FMOD_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 3227654979u, 4110878657u, 0, FMOD_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1085804762u, 2623955764u, 0, FMOD_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1091905603u, 107442539u, 0, FMOD_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 3225676576u, 3233762236u, 0, FMOD_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 3190415678u, 3596436140u, 0, FMOD_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 3194207612u, 3429855104u, 0, FMOD_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1059882635u, 2568378152u, 0, FMOD_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 3217421829u, 1649206019u, 0, FMOD_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 3187645983u, 1941510404u, 0, FMOD_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 3204330900u, 3099226694u, 0, FMOD_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 3201591712u, 3718441177u, 0, FMOD_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1044131371u, 508048351u, 0, FMOD_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 3198611627u, 2784738160u, 0, FMOD_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 3225725290u, 3331916473u, 0, FMOD_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1072144665u, 522903412u, 0, FMOD_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 3195240398u, 1149654386u, 0, FMOD_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 1048430980u, 2083412145u, 0, FMOD_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1075363751u, 4270176401u, 0, FMOD_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 3195385746u, 1804687120u, 0, FMOD_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 3213394999u, 381330476u, 0, FMOD_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1060988849u, 2687204992u, 0, FMOD_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1073938217u, 1705671480u, 0, FMOD_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 3202965930u, 330951080u, 0, FMOD_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1089640092u, 1711944085u, 0, FMOD_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 3234429549u, 2072550721u, 0, FMOD_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 3192972706u, 1566376352u, 0, FMOD_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1045654090u, 2757379143u, 0, FMOD_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 3216672493u, 1910366299u, 0, FMOD_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1075813844u, 1822776382u, 0, FMOD_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1045096906u, 3892678396u, 0, FMOD_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 1066482943u, 1953339096u, 0, FMOD_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 1066092000u, 1306277326u, 0, FMOD_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 3233148787u, 51750045u, 0, FMOD_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 3195084967u, 2163853087u, 0, FMOD_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1075516945u, 1618388148u, 0, FMOD_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 3202248567u, 2697674194u, 0, FMOD_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 3201904086u, 2571356437u, 0, FMOD_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 3230488091u, 4273880094u, 0, FMOD_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 3227097327u, 2373198088u, 0, FMOD_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 3198396666u, 2143313456u, 0, FMOD_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 3190991165u, 3498199328u, 0, FMOD_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 3198632935u, 2527385594u, 0, FMOD_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 3209603524u, 1892561408u, 0, FMOD_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 1058857869u, 2673272949u, 0, FMOD_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1092711812u, 2661827800u, 0, FMOD_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1073445325u, 3816878350u, 0, FMOD_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 3195088561u, 1859026178u, 0, FMOD_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 3239039640u, 2313158848u, 0, FMOD_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 3191401834u, 3850162281u, 0, FMOD_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1074809013u, 4104449276u, 0, FMOD_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 3195430506u, 719698312u, 0, FMOD_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 3199420611u, 2859325692u, 0, FMOD_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 3197400969u, 3459903180u, 0, FMOD_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1086180091u, 485456950u, 0, FMOD_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 3198234428u, 1551748070u, 0, FMOD_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 3224639122u, 3099222537u, 0, FMOD_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 3192575602u, 1022863328u, 0, FMOD_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 3198824584u, 3961208159u, 0, FMOD_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1044445505u, 1497930304u, 0, FMOD_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 3213275657u, 1403876392u, 0, FMOD_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1046486580u, 3816855315u, 0, FMOD_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 1049661768u, 1454212851u, 0, FMOD_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1040987798u, 1349226184u, 0, FMOD_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 3216409282u, 1199568671u, 0, FMOD_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1077685537u, 2596231448u, 0, FMOD_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1066527035u, 4119719558u, 0, FMOD_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 3239908663u, 3347296825u, 0, FMOD_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1067744490u, 2088719416u, 0, FMOD_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 3197836571u, 3536282126u, 0, FMOD_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1050089150u, 3840253476u, 0, FMOD_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 3235473900u, 2497516122u, 0, FMOD_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1068592495u, 516298114u, 0, FMOD_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 3226908686u, 723423605u, 0, FMOD_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 3215947680u, 4292778869u, 0, FMOD_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1047069637u, 3428852854u, 0, FMOD_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 3192897879u, 1307010018u, 0, FMOD_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 3225566744u, 1395459164u, 0, FMOD_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 3188230541u, 760006940u, 0, FMOD_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 3228318527u, 2478031064u, 0, FMOD_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 3191802156u, 545462045u, 0, FMOD_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 1061232136u, 3657978397u, 0, FMOD_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1049883857u, 1804177501u, 0, FMOD_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1038757582u, 3406902432u, 0, FMOD_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1055471915u, 1599382075u, 0, FMOD_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 3199606348u, 99303024u, 0, FMOD_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 3203161499u, 2504659264u, 0, FMOD_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 3198416643u, 150890940u, 0, FMOD_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 1062008939u, 80400395u, 0, FMOD_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 3218559725u, 2540175624u, 0, FMOD_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1064841871u, 2881752155u, 0, FMOD_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 3214176671u, 1411815940u, 0, FMOD_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1060344586u, 1448022016u, 0, FMOD_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 1042137451u, 2497054124u, 0, FMOD_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1047037641u, 790219083u, 0, FMOD_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 1057781400u, 1149462078u, 0, FMOD_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 3202729813u, 2684353926u, 0, FMOD_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1049869952u, 1036183440u, 0, FMOD_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 1063230986u, 3408320912u, 0, FMOD_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 1064863548u, 1077495917u, 0, FMOD_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 3195856391u, 2714081600u, 0, FMOD_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 1064632084u, 321857207u, 0, FMOD_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 3192404734u, 1720608768u, 0, FMOD_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 3191062890u, 2002049816u, 0, FMOD_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 3229006283u, 478939968u, 0, FMOD_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 3232473641u, 1653104725u, 0, FMOD_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 3185556567u, 4138984000u, 0, FMOD_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1077906251u, 3290712104u, 0, FMOD_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1100636791u, 3962735564u, 0, FMOD_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1054806016u, 1479841439u, 0, FMOD_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1057471230u, 1851951976u, 0, FMOD_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1042983411u, 1223161218u, 0, FMOD_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 3193829772u, 41779312u, 0, FMOD_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1058131100u, 1393168821u, 0, FMOD_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1072338141u, 3756584649u, 0, FMOD_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 3188467821u, 4070759148u, 0, FMOD_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 3195453512u, 35164295u, 0, FMOD_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1080039368u, 3514173856u, 0, FMOD_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1068844322u, 1447585080u, 0, FMOD_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1046252518u, 981897615u, 0, FMOD_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 3217021053u, 3501131824u, 0, FMOD_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 1069775912u, 750827797u, 0, FMOD_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1055284199u, 3831394504u, 0, FMOD_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 3218090390u, 344241827u, 0, FMOD_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 3190824936u, 2390491228u, 0, FMOD_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1065055518u, 2933509260u, 0, FMOD_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 3194118956u, 709803845u, 0, FMOD_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 3193280779u, 744421179u, 0, FMOD_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1040654015u, 1507901104u, 0, FMOD_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 3206108502u, 145234164u, 0, FMOD_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 3240510664u, 2784620507u, 0, FMOD_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 3204710211u, 363221200u, 0, FMOD_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 3203476252u, 3792395543u, 0, FMOD_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 3205316273u, 2115553675u, 0, FMOD_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 3238123122u, 2750387816u, 0, FMOD_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 3194595076u, 2991290482u, 0, FMOD_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1083326068u, 3489121232u, 0, FMOD_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 3187008922u, 1860425162u, 0, FMOD_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 1053236165u, 3748932896u, 0, FMOD_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1055551388u, 1609430208u, 0, FMOD_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1053106984u, 1449164578u, 0, FMOD_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1071439010u, 2120487381u, 0, FMOD_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1064553737u, 3986633720u, 0, FMOD_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 3200308256u, 3315127889u, 0, FMOD_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 3196425891u, 2246037502u, 0, FMOD_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 3193006859u, 4191285446u, 0, FMOD_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1041890111u, 1071039699u, 0, FMOD_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1079913438u, 3468560824u, 0, FMOD_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1096788400u, 1413568905u, 0, FMOD_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 3191549550u, 3797143370u, 0, FMOD_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 3197416778u, 967813984u, 0, FMOD_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1077663643u, 3509952206u, 0, FMOD_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 3196269447u, 2808087378u, 0, FMOD_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 3221495289u, 2341164249u, 0, FMOD_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 1067019674u, 932124675u, 0, FMOD_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 3249230091u, 1367996113u, 0, FMOD_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1080230731u, 323437999u, 0, FMOD_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 3196438794u, 755364647u, 0, FMOD_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1064167956u, 768614710u, 0, FMOD_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 1064074694u, 3679267365u, 0, FMOD_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1078613717u, 260914948u, 0, FMOD_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1046559671u, 1480442944u, 0, FMOD_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1054128006u, 1365244058u, 0, FMOD_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1064122385u, 2463030625u, 0, FMOD_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 3212400136u, 742911191u, 0, FMOD_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1088045088u, 3496172149u, 0, FMOD_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 3198135087u, 1636966254u, 0, FMOD_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 1050931318u, 3551516956u, 0, FMOD_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 3192139324u, 2635921568u, 0, FMOD_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 3188585597u, 845876272u, 0, FMOD_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1077281796u, 1956025297u, 0, FMOD_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1049943530u, 1535558178u, 0, FMOD_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 3241820348u, 355927136u, 0, FMOD_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 3205479397u, 3439913962u, 0, FMOD_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 3192062120u, 1110251106u, 0, FMOD_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 3193217147u, 1062836691u, 0, FMOD_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 3197126611u, 2398767696u, 0, FMOD_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 3204057950u, 186287752u, 0, FMOD_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1096053807u, 2199755765u, 0, FMOD_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 1042654053u, 2171898436u, 0, FMOD_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 3222068912u, 1934515232u, 0, FMOD_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1041051937u, 1749583618u, 0, FMOD_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 3187243994u, 2776223952u, 0, FMOD_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 3202381864u, 3937755304u, 0, FMOD_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 1050299283u, 3772748958u, 0, FMOD_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 3222233301u, 1956885028u, 0, FMOD_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1082909349u, 484200864u, 0, FMOD_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 3198617153u, 1518334131u, 0, FMOD_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 1047317453u, 2825203170u, 0, FMOD_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1088476154u, 2379179720u, 0, FMOD_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 3196590451u, 2540481052u, 0, FMOD_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1058098611u, 4127624576u, 0, FMOD_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 3208098435u, 1845900544u, 0, FMOD_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 3193419705u, 1974083544u, 0, FMOD_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 3200659149u, 3599459556u, 0, FMOD_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 3202431797u, 2544044588u, 0, FMOD_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 3199630788u, 128225231u, 0, FMOD_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 3202279557u, 1562351330u, 0, FMOD_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 3188818396u, 807301880u, 0, FMOD_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 3219454353u, 3851781549u, 0, FMOD_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1100045965u, 934745487u, 0, FMOD_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 3213082493u, 2948648757u, 0, FMOD_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1057329057u, 1992816128u, 0, FMOD_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 3198075559u, 3891230598u, 0, FMOD_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1077353053u, 3806018919u, 0, FMOD_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1060624530u, 3900344258u, 0, FMOD_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 3205264840u, 1073047920u, 0, FMOD_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1080174589u, 3628179328u, 0, FMOD_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1098810978u, 1561122768u, 0, FMOD_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 1064980314u, 4197635149u, 0, FMOD_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1074333893u, 118603800u, 0, FMOD_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 3212278408u, 2240697488u, 0, FMOD_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1079614218u, 2381284696u, 0, FMOD_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 1048333111u, 3566257266u, 0, FMOD_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 3240880599u, 1859021866u, 0, FMOD_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1041627284u, 2336116589u, 0, FMOD_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 1058567659u, 907670625u, 0, FMOD_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 1044467183u, 2818710946u, 0, FMOD_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 3189504094u, 4099522736u, 0, FMOD_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1076943150u, 3135584408u, 0, FMOD_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1061353780u, 3104585775u, 0, FMOD_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 3218677731u, 188478288u, 0, FMOD_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1069161233u, 173480672u, 0, FMOD_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 1052415330u, 458757721u, 0, FMOD_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 3193282956u, 2533012202u, 0, FMOD_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 3203364780u, 4108274117u, 0, FMOD_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1090567271u, 3541110973u, 0, FMOD_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 3193980043u, 1213941007u, 0, FMOD_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1094197292u, 3251065368u, 0, FMOD_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1095583909u, 2843638672u, 0, FMOD_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1083757094u, 2014317727u, 0, FMOD_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1045500899u, 421513072u, 0, FMOD_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1073301008u, 3217308196u, 0, FMOD_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 3236064660u, 2205078976u, 0, FMOD_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1055991332u, 437977800u, 0, FMOD_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 1041110867u, 2076689028u, 0, FMOD_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1047307438u, 1376882094u, 0, FMOD_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1052083979u, 4015079392u, 0, FMOD_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 3215808713u, 2482244588u, 0, FMOD_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1039251684u, 3969797792u, 0, FMOD_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1040244055u, 3974431579u, 0, FMOD_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 3191496789u, 3819109588u, 0, FMOD_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 1072639397u, 4246896124u, 0, FMOD_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1048038468u, 2228686199u, 0, FMOD_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 3202788389u, 3454301200u, 0, FMOD_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1079132077u, 508475625u, 0, FMOD_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 1045883607u, 1278581412u, 0, FMOD_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 3222372686u, 1794845306u, 0, FMOD_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1061210897u, 1687650186u, 0, FMOD_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1073581409u, 2034303731u, 0, FMOD_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 3192961019u, 4075721988u, 0, FMOD_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 3219432943u, 2030557040u, 0, FMOD_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 3207648055u, 2266319054u, 0, FMOD_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1051438209u, 3983060665u, 0, FMOD_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1058468363u, 834914365u, 0, FMOD_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1057279949u, 2139295776u, 0, FMOD_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 3189636931u, 851569132u, 0, FMOD_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 3233537697u, 3897202342u, 0, FMOD_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 3202369936u, 3700438080u, 0, FMOD_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1056236607u, 2751419008u, 0, FMOD_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 3208488956u, 1745097620u, 0, FMOD_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 3223298996u, 2039713492u, 0, FMOD_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1043729435u, 812513712u, 0, FMOD_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 1061442763u, 650692001u, 0, FMOD_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 3191395187u, 2372623300u, 0, FMOD_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1046114830u, 3115332966u, 0, FMOD_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 1062262701u, 217775356u, 0, FMOD_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 1057172551u, 3621353969u, 0, FMOD_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1071287122u, 1408736608u, 0, FMOD_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 3220255228u, 3977195008u, 0, FMOD_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1104006296u, 496534875u, 0, FMOD_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 3221335855u, 3732438666u, 0, FMOD_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1066357256u, 3538375136u, 0, FMOD_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 1068218799u, 73646871u, 0, FMOD_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1050815447u, 1272533715u, 0, FMOD_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 1068068480u, 1061628117u, 0, FMOD_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 3208484674u, 938869114u, 0, FMOD_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1091948884u, 2484319115u, 0, FMOD_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 3222965885u, 3249583456u, 0, FMOD_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 1049139928u, 1469010822u, 0, FMOD_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1047839869u, 2663116324u, 0, FMOD_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 3190927649u, 800563616u, 0, FMOD_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1048300491u, 2603592096u, 0, FMOD_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 3223311050u, 1149370880u, 0, FMOD_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1040305221u, 4193144592u, 0, FMOD_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 3217611704u, 200857661u, 0, FMOD_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 3226509645u, 697667886u, 0, FMOD_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1044195166u, 3510904416u, 0, FMOD_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 3242675715u, 789151814u, 0, FMOD_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1084679320u, 722163228u, 0, FMOD_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1046586062u, 2207037106u, 0, FMOD_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 3197884060u, 3838689849u, 0, FMOD_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1085938906u, 2527556476u, 0, FMOD_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 3188877369u, 3030175616u, 0, FMOD_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1051567976u, 2773073106u, 0, FMOD_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 3193514956u, 3653237931u, 0, FMOD_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1053588582u, 376530104u, 0, FMOD_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 3198654037u, 980579176u, 0, FMOD_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 3206621457u, 3145766624u, 0, FMOD_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1040375936u, 413495854u, 0, FMOD_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 3208983524u, 830635584u, 0, FMOD_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 3193101179u, 4009301952u, 0, FMOD_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 3215045687u, 297125743u, 0, FMOD_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 3220949933u, 2749462016u, 0, FMOD_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 3194126693u, 2049616152u, 0, FMOD_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1076205982u, 4210345336u, 0, FMOD_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 3200305473u, 2749663976u, 0, FMOD_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1080412763u, 1752164782u, 0, FMOD_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 1041545782u, 2024044989u, 0, FMOD_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 1053207518u, 2564965629u, 0, FMOD_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1042893353u, 1428552520u, 0, FMOD_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1040235236u, 167423296u, 0, FMOD_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 3193155705u, 659070058u, 0, FMOD_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 3213867224u, 4167214496u, 0, FMOD_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 3214337058u, 3417594176u, 0, FMOD_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1046519616u, 1109308160u, 0, FMOD_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 1057530368u, 2075610870u, 0, FMOD_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 3200839250u, 3792931748u, 0, FMOD_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 3225596618u, 2476652436u, 0, FMOD_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 3201314702u, 236884699u, 0, FMOD_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1043407738u, 512136096u, 0, FMOD_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1083996036u, 3000189819u, 0, FMOD_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1093835581u, 205759408u, 0, FMOD_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_FMOD_H multiple inclusion protection + +// EOF fmod.h diff --git a/packages/language/c/libm/current/tests/vectors/frexp.c b/packages/language/c/libm/current/tests/vectors/frexp.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/frexp.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// frexp.c +// +// Test of frexp() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/frexp.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(frexp_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &frexp, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_INT_P, CYG_LIBM_TEST_VEC_DOUBLE, + &frexp_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("frexp() is stable"); + } // if + else + { + CYG_TEST_FAIL("frexp() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library frexp() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "frexp() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF frexp.c diff --git a/packages/language/c/libm/current/tests/vectors/frexp.h b/packages/language/c/libm/current/tests/vectors/frexp.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/frexp.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_FREXP_H +#define CYGONCE_LIBM_FREXP_H +//=========================================================================== +// +// frexp.h +// +// Test vectors for testing of frexp() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/frexp.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define FREXP_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t frexp_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 0u, 6u, 1071707692u, 2506787616u, 0, FREXP_TOLERANCE, 0}, +{ 2, 1090024059u, 3619148316u, 0u, 17u, 1072198267u, 3619148316u, 0, FREXP_TOLERANCE, 0}, +{ 3, 3218153654u, 3176730980u, 0u, 4294967295u, 3219202230u, 3176730980u, 0, FREXP_TOLERANCE, 0}, +{ 4, 1051524793u, 2993920299u, 0u, 4294967276u, 1072496313u, 2993920299u, 0, FREXP_TOLERANCE, 0}, +{ 5, 3239659803u, 2725707538u, 0u, 19u, 3219736859u, 2725707538u, 0, FREXP_TOLERANCE, 0}, +{ 6, 3232101343u, 2346810316u, 0u, 12u, 3219518431u, 2346810316u, 0, FREXP_TOLERANCE, 0}, +{ 7, 1092554362u, 2088062470u, 0u, 19u, 1072631418u, 2088062470u, 0, FREXP_TOLERANCE, 0}, +{ 8, 3201242716u, 420891118u, 0u, 4294967278u, 3220117084u, 420891118u, 0, FREXP_TOLERANCE, 0}, +{ 9, 3221200677u, 2636405208u, 0u, 1u, 3220152101u, 2636405208u, 0, FREXP_TOLERANCE, 0}, +{ 10, 1100049309u, 471635570u, 0u, 27u, 1071737757u, 471635570u, 0, FREXP_TOLERANCE, 0}, +{ 11, 1089363191u, 1746012320u, 0u, 16u, 1072585975u, 1746012320u, 0, FREXP_TOLERANCE, 0}, +{ 12, 1054478713u, 3333988501u, 0u, 4294967279u, 1072304505u, 3333988501u, 0, FREXP_TOLERANCE, 0}, +{ 13, 1047953160u, 183014794u, 0u, 4294967273u, 1072070408u, 183014794u, 0, FREXP_TOLERANCE, 0}, +{ 14, 3202039382u, 2016785810u, 0u, 4294967279u, 3219865174u, 2016785810u, 0, FREXP_TOLERANCE, 0}, +{ 15, 3213486034u, 2688957927u, 0u, 4294967290u, 3219777490u, 2688957927u, 0, FREXP_TOLERANCE, 0}, +{ 16, 1046089230u, 2709029994u, 0u, 4294967271u, 1072303630u, 2709029994u, 0, FREXP_TOLERANCE, 0}, +{ 17, 1058795730u, 624574473u, 0u, 4294967283u, 1072427218u, 624574473u, 0, FREXP_TOLERANCE, 0}, +{ 18, 1045840574u, 3473266330u, 0u, 4294967271u, 1072054974u, 3473266330u, 0, FREXP_TOLERANCE, 0}, +{ 19, 3204919842u, 1605286142u, 0u, 4294967282u, 3219599906u, 1605286142u, 0, FREXP_TOLERANCE, 0}, +{ 20, 1068931671u, 4233776869u, 0u, 4294967293u, 1072077399u, 4233776869u, 0, FREXP_TOLERANCE, 0}, +{ 21, 1060343410u, 1857607719u, 0u, 4294967285u, 1071877746u, 1857607719u, 0, FREXP_TOLERANCE, 0}, +{ 22, 3222889559u, 3417070006u, 0u, 3u, 3219743831u, 3417070006u, 0, FREXP_TOLERANCE, 0}, +{ 23, 1103599987u, 3981151660u, 0u, 30u, 1072142707u, 3981151660u, 0, FREXP_TOLERANCE, 0}, +{ 24, 1088899021u, 1332651746u, 0u, 16u, 1072121805u, 1332651746u, 0, FREXP_TOLERANCE, 0}, +{ 25, 1085298022u, 3824988054u, 0u, 13u, 1071666534u, 3824988054u, 0, FREXP_TOLERANCE, 0}, +{ 26, 1066856791u, 2070129652u, 0u, 4294967291u, 1072099671u, 2070129652u, 0, FREXP_TOLERANCE, 0}, +{ 27, 3207559790u, 1372884064u, 0u, 4294967284u, 3220142702u, 1372884064u, 0, FREXP_TOLERANCE, 0}, +{ 28, 1080833116u, 3229926662u, 0u, 8u, 1072444508u, 3229926662u, 0, FREXP_TOLERANCE, 0}, +{ 29, 1093826501u, 3217805330u, 0u, 21u, 1071806405u, 3217805330u, 0, FREXP_TOLERANCE, 0}, +{ 30, 3191644264u, 2014578707u, 0u, 4294967269u, 3219955816u, 2014578707u, 0, FREXP_TOLERANCE, 0}, +{ 31, 1102287487u, 265058758u, 0u, 29u, 1071878783u, 265058758u, 0, FREXP_TOLERANCE, 0}, +{ 32, 3239903247u, 1630600647u, 0u, 19u, 3219980303u, 1630600647u, 0, FREXP_TOLERANCE, 0}, +{ 33, 1071124229u, 1946677669u, 0u, 4294967295u, 1072172805u, 1946677669u, 0, FREXP_TOLERANCE, 0}, +{ 34, 3198462609u, 926009897u, 0u, 4294967276u, 3219434129u, 926009897u, 0, FREXP_TOLERANCE, 0}, +{ 35, 1072130299u, 2271884183u, 0u, 0u, 1072130299u, 2271884183u, 0, FREXP_TOLERANCE, 0}, +{ 36, 3203741999u, 2118617783u, 0u, 4294967281u, 3219470639u, 2118617783u, 0, FREXP_TOLERANCE, 0}, +{ 37, 3194849109u, 213658772u, 0u, 4294967272u, 3220014933u, 213658772u, 0, FREXP_TOLERANCE, 0}, +{ 38, 3249401130u, 314151656u, 0u, 28u, 3220041002u, 314151656u, 0, FREXP_TOLERANCE, 0}, +{ 39, 3254112288u, 1564829925u, 0u, 33u, 3219509280u, 1564829925u, 0, FREXP_TOLERANCE, 0}, +{ 40, 3197817016u, 497230814u, 0u, 4294967275u, 3219837112u, 497230814u, 0, FREXP_TOLERANCE, 0}, +{ 41, 3216262634u, 2075329122u, 0u, 4294967293u, 3219408362u, 2075329122u, 0, FREXP_TOLERANCE, 0}, +{ 42, 3231746400u, 169900577u, 0u, 12u, 3219163488u, 169900577u, 0, FREXP_TOLERANCE, 0}, +{ 43, 1049848642u, 541549344u, 0u, 4294967275u, 1071868738u, 541549344u, 0, FREXP_TOLERANCE, 0}, +{ 44, 1096608669u, 3119070100u, 0u, 23u, 1072491421u, 3119070100u, 0, FREXP_TOLERANCE, 0}, +{ 45, 1085427055u, 567496114u, 0u, 13u, 1071795567u, 567496114u, 0, FREXP_TOLERANCE, 0}, +{ 46, 1045286891u, 1969998540u, 0u, 4294967270u, 1072549867u, 1969998540u, 0, FREXP_TOLERANCE, 0}, +{ 47, 1060548195u, 1299369769u, 0u, 4294967285u, 1072082531u, 1299369769u, 0, FREXP_TOLERANCE, 0}, +{ 48, 1049342524u, 4167404066u, 0u, 4294967274u, 1072411196u, 4167404066u, 0, FREXP_TOLERANCE, 0}, +{ 49, 3208865645u, 3348930841u, 0u, 4294967286u, 3219351405u, 3348930841u, 0, FREXP_TOLERANCE, 0}, +{ 50, 1078472138u, 358457347u, 0u, 6u, 1072180682u, 358457347u, 0, FREXP_TOLERANCE, 0}, +{ 51, 1071069297u, 2192461366u, 0u, 4294967295u, 1072117873u, 2192461366u, 0, FREXP_TOLERANCE, 0}, +{ 52, 1099527247u, 3184735642u, 0u, 26u, 1072264271u, 3184735642u, 0, FREXP_TOLERANCE, 0}, +{ 53, 1052861772u, 331696577u, 0u, 4294967278u, 1071736140u, 331696577u, 0, FREXP_TOLERANCE, 0}, +{ 54, 3189610016u, 793242270u, 0u, 4294967267u, 3220018720u, 793242270u, 0, FREXP_TOLERANCE, 0}, +{ 55, 3252528934u, 2322696981u, 0u, 31u, 3220023078u, 2322696981u, 0, FREXP_TOLERANCE, 0}, +{ 56, 1083791358u, 3020766674u, 0u, 11u, 1072257022u, 3020766674u, 0, FREXP_TOLERANCE, 0}, +{ 57, 1044902177u, 252085215u, 0u, 4294967270u, 1072165153u, 252085215u, 0, FREXP_TOLERANCE, 0}, +{ 58, 3214426435u, 4139068910u, 0u, 4294967291u, 3219669315u, 4139068910u, 0, FREXP_TOLERANCE, 0}, +{ 59, 3222505725u, 105589263u, 0u, 3u, 3219359997u, 105589263u, 0, FREXP_TOLERANCE, 0}, +{ 60, 1056316170u, 261630827u, 0u, 4294967281u, 1072044810u, 261630827u, 0, FREXP_TOLERANCE, 0}, +{ 61, 1107213408u, 428765703u, 0u, 33u, 1072610400u, 428765703u, 0, FREXP_TOLERANCE, 0}, +{ 62, 3251828686u, 2009972239u, 0u, 31u, 3219322830u, 2009972239u, 0, FREXP_TOLERANCE, 0}, +{ 63, 1098568019u, 3517376586u, 0u, 25u, 1072353619u, 3517376586u, 0, FREXP_TOLERANCE, 0}, +{ 64, 3240257920u, 3304487302u, 0u, 20u, 3219286400u, 3304487302u, 0, FREXP_TOLERANCE, 0}, +{ 65, 3233537912u, 237004814u, 0u, 13u, 3219906424u, 237004814u, 0, FREXP_TOLERANCE, 0}, +{ 66, 3237899261u, 3364008659u, 0u, 17u, 3220073469u, 3364008659u, 0, FREXP_TOLERANCE, 0}, +{ 67, 3195247552u, 472004928u, 0u, 4294967273u, 3219364800u, 472004928u, 0, FREXP_TOLERANCE, 0}, +{ 68, 3226869477u, 1186387580u, 0u, 7u, 3219529445u, 1186387580u, 0, FREXP_TOLERANCE, 0}, +{ 69, 1054226850u, 4085763910u, 0u, 4294967279u, 1072052642u, 4085763910u, 0, FREXP_TOLERANCE, 0}, +{ 70, 1106394906u, 2684738273u, 0u, 33u, 1071791898u, 2684738273u, 0, FREXP_TOLERANCE, 0}, +{ 71, 1057053639u, 2055490142u, 0u, 4294967282u, 1071733703u, 2055490142u, 0, FREXP_TOLERANCE, 0}, +{ 72, 3231581370u, 3879040079u, 0u, 11u, 3220047034u, 3879040079u, 0, FREXP_TOLERANCE, 0}, +{ 73, 3188976647u, 3725731239u, 0u, 4294967267u, 3219385351u, 3725731239u, 0, FREXP_TOLERANCE, 0}, +{ 74, 1061652681u, 591292963u, 0u, 4294967286u, 1072138441u, 591292963u, 0, FREXP_TOLERANCE, 0}, +{ 75, 3225014981u, 1147041027u, 0u, 5u, 3219772101u, 1147041027u, 0, FREXP_TOLERANCE, 0}, +{ 76, 3215417793u, 624695933u, 0u, 4294967292u, 3219612097u, 624695933u, 0, FREXP_TOLERANCE, 0}, +{ 77, 3206052774u, 705725219u, 0u, 4294967283u, 3219684262u, 705725219u, 0, FREXP_TOLERANCE, 0}, +{ 78, 3238067573u, 1116238321u, 0u, 18u, 3219193205u, 1116238321u, 0, FREXP_TOLERANCE, 0}, +{ 79, 3207367088u, 7287411u, 0u, 4294967284u, 3219950000u, 7287411u, 0, FREXP_TOLERANCE, 0}, +{ 80, 1045917232u, 116067742u, 0u, 4294967271u, 1072131632u, 116067742u, 0, FREXP_TOLERANCE, 0}, +{ 81, 3240055222u, 3604989074u, 0u, 19u, 3220132278u, 3604989074u, 0, FREXP_TOLERANCE, 0}, +{ 82, 1066381836u, 545298780u, 0u, 4294967290u, 1072673292u, 545298780u, 0, FREXP_TOLERANCE, 0}, +{ 83, 3219080936u, 1681476121u, 0u, 4294967295u, 3220129512u, 1681476121u, 0, FREXP_TOLERANCE, 0}, +{ 84, 1060345752u, 3553822398u, 0u, 4294967285u, 1071880088u, 3553822398u, 0, FREXP_TOLERANCE, 0}, +{ 85, 1102831658u, 3410480388u, 0u, 29u, 1072422954u, 3410480388u, 0, FREXP_TOLERANCE, 0}, +{ 86, 1052460275u, 1660607230u, 0u, 4294967277u, 1072383219u, 1660607230u, 0, FREXP_TOLERANCE, 0}, +{ 87, 1089216869u, 1494984673u, 0u, 16u, 1072439653u, 1494984673u, 0, FREXP_TOLERANCE, 0}, +{ 88, 3196647153u, 287894723u, 0u, 4294967274u, 3219715825u, 287894723u, 0, FREXP_TOLERANCE, 0}, +{ 89, 1054885127u, 644548665u, 0u, 4294967280u, 1071662343u, 644548665u, 0, FREXP_TOLERANCE, 0}, +{ 90, 1081948134u, 2442134629u, 0u, 9u, 1072510950u, 2442134629u, 0, FREXP_TOLERANCE, 0}, +{ 91, 1087554095u, 2312530895u, 0u, 15u, 1071825455u, 2312530895u, 0, FREXP_TOLERANCE, 0}, +{ 92, 3221584595u, 3379665576u, 0u, 2u, 3219487443u, 3379665576u, 0, FREXP_TOLERANCE, 0}, +{ 93, 1096085375u, 3018463866u, 0u, 23u, 1071968127u, 3018463866u, 0, FREXP_TOLERANCE, 0}, +{ 94, 1086226574u, 404012923u, 0u, 13u, 1072595086u, 404012923u, 0, FREXP_TOLERANCE, 0}, +{ 95, 1064733299u, 1710279345u, 0u, 4294967289u, 1072073331u, 1710279345u, 0, FREXP_TOLERANCE, 0}, +{ 96, 3251401196u, 3528946000u, 0u, 30u, 3219943916u, 3528946000u, 0, FREXP_TOLERANCE, 0}, +{ 97, 1061536351u, 2164450219u, 0u, 4294967286u, 1072022111u, 2164450219u, 0, FREXP_TOLERANCE, 0}, +{ 98, 1083520023u, 3312018966u, 0u, 11u, 1071985687u, 3312018966u, 0, FREXP_TOLERANCE, 0}, +{ 99, 1057248676u, 2648986431u, 0u, 4294967282u, 1071928740u, 2648986431u, 0, FREXP_TOLERANCE, 0}, +{ 100, 1050330591u, 1474376550u, 0u, 4294967275u, 1072350687u, 1474376550u, 0, FREXP_TOLERANCE, 0}, +{ 101, 3194422028u, 1839068700u, 0u, 4294967272u, 3219587852u, 1839068700u, 0, FREXP_TOLERANCE, 0}, +{ 102, 1077406406u, 3013052171u, 0u, 5u, 1072163526u, 3013052171u, 0, FREXP_TOLERANCE, 0}, +{ 103, 1046493630u, 772102380u, 0u, 4294967272u, 1071659454u, 772102380u, 0, FREXP_TOLERANCE, 0}, +{ 104, 3220729740u, 4219039958u, 0u, 1u, 3219681164u, 4219039958u, 0, FREXP_TOLERANCE, 0}, +{ 105, 3229472221u, 3058618779u, 0u, 9u, 3220035037u, 3058618779u, 0, FREXP_TOLERANCE, 0}, +{ 106, 1046304788u, 3338676024u, 0u, 4294967271u, 1072519188u, 3338676024u, 0, FREXP_TOLERANCE, 0}, +{ 107, 1051172137u, 506286854u, 0u, 4294967276u, 1072143657u, 506286854u, 0, FREXP_TOLERANCE, 0}, +{ 108, 1094907481u, 2217000199u, 0u, 22u, 1071838809u, 2217000199u, 0, FREXP_TOLERANCE, 0}, +{ 109, 1082428310u, 1147428263u, 0u, 10u, 1071942550u, 1147428263u, 0, FREXP_TOLERANCE, 0}, +{ 110, 1065432625u, 3034786717u, 0u, 4294967290u, 1071724081u, 3034786717u, 0, FREXP_TOLERANCE, 0}, +{ 111, 1082016752u, 2844125311u, 0u, 9u, 1072579568u, 2844125311u, 0, FREXP_TOLERANCE, 0}, +{ 112, 1082985198u, 2561492677u, 0u, 10u, 1072499438u, 2561492677u, 0, FREXP_TOLERANCE, 0}, +{ 113, 3211536916u, 704542600u, 0u, 4294967288u, 3219925524u, 704542600u, 0, FREXP_TOLERANCE, 0}, +{ 114, 3222902057u, 2762779203u, 0u, 3u, 3219756329u, 2762779203u, 0, FREXP_TOLERANCE, 0}, +{ 115, 3199680614u, 184131949u, 0u, 4294967277u, 3219603558u, 184131949u, 0, FREXP_TOLERANCE, 0}, +{ 116, 3249723525u, 1667366082u, 0u, 29u, 3219314821u, 1667366082u, 0, FREXP_TOLERANCE, 0}, +{ 117, 3223609598u, 3904224140u, 0u, 4u, 3219415294u, 3904224140u, 0, FREXP_TOLERANCE, 0}, +{ 118, 1067056698u, 2942159914u, 0u, 4294967291u, 1072299578u, 2942159914u, 0, FREXP_TOLERANCE, 0}, +{ 119, 1100636863u, 426114282u, 0u, 27u, 1072325311u, 426114282u, 0, FREXP_TOLERANCE, 0}, +{ 120, 3209056785u, 1083606355u, 0u, 4294967286u, 3219542545u, 1083606355u, 0, FREXP_TOLERANCE, 0}, +{ 121, 1106165945u, 3774123863u, 0u, 32u, 1072611513u, 3774123863u, 0, FREXP_TOLERANCE, 0}, +{ 122, 1106787580u, 2722107965u, 0u, 33u, 1072184572u, 2722107965u, 0, FREXP_TOLERANCE, 0}, +{ 123, 1088005092u, 1377734762u, 0u, 15u, 1072276452u, 1377734762u, 0, FREXP_TOLERANCE, 0}, +{ 124, 1104232051u, 2377063483u, 0u, 31u, 1071726195u, 2377063483u, 0, FREXP_TOLERANCE, 0}, +{ 125, 1069380559u, 1029739074u, 0u, 4294967293u, 1072526287u, 1029739074u, 0, FREXP_TOLERANCE, 0}, +{ 126, 1105467109u, 3062201018u, 0u, 32u, 1071912677u, 3062201018u, 0, FREXP_TOLERANCE, 0}, +{ 127, 3234741597u, 773857656u, 0u, 14u, 3220061533u, 773857656u, 0, FREXP_TOLERANCE, 0}, +{ 128, 3214251949u, 335833884u, 0u, 4294967291u, 3219494829u, 335833884u, 0, FREXP_TOLERANCE, 0}, +{ 129, 3203224610u, 1473865960u, 0u, 4294967280u, 3220001826u, 1473865960u, 0, FREXP_TOLERANCE, 0}, +{ 130, 1103073830u, 4000427507u, 0u, 29u, 1072665126u, 4000427507u, 0, FREXP_TOLERANCE, 0}, +{ 131, 1103185231u, 4242092620u, 0u, 30u, 1071727951u, 4242092620u, 0, FREXP_TOLERANCE, 0}, +{ 132, 1067009473u, 14539161u, 0u, 4294967291u, 1072252353u, 14539161u, 0, FREXP_TOLERANCE, 0}, +{ 133, 3192516074u, 1732245037u, 0u, 4294967270u, 3219779050u, 1732245037u, 0, FREXP_TOLERANCE, 0}, +{ 134, 1101371955u, 1533536108u, 0u, 28u, 1072011827u, 1533536108u, 0, FREXP_TOLERANCE, 0}, +{ 135, 3249153995u, 1833841275u, 0u, 28u, 3219793867u, 1833841275u, 0, FREXP_TOLERANCE, 0}, +{ 136, 1099430098u, 4144145552u, 0u, 26u, 1072167122u, 4144145552u, 0, FREXP_TOLERANCE, 0}, +{ 137, 3244270463u, 935007012u, 0u, 23u, 3220153215u, 935007012u, 0, FREXP_TOLERANCE, 0}, +{ 138, 3188865420u, 604442938u, 0u, 4294967267u, 3219274124u, 604442938u, 0, FREXP_TOLERANCE, 0}, +{ 139, 3206903253u, 2211464602u, 0u, 4294967284u, 3219486165u, 2211464602u, 0, FREXP_TOLERANCE, 0}, +{ 140, 1046255144u, 1635910526u, 0u, 4294967271u, 1072469544u, 1635910526u, 0, FREXP_TOLERANCE, 0}, +{ 141, 1077871417u, 2549219008u, 0u, 5u, 1072628537u, 2549219008u, 0, FREXP_TOLERANCE, 0}, +{ 142, 3231633258u, 3733639385u, 0u, 11u, 3220098922u, 3733639385u, 0, FREXP_TOLERANCE, 0}, +{ 143, 1082095089u, 1819374372u, 0u, 9u, 1072657905u, 1819374372u, 0, FREXP_TOLERANCE, 0}, +{ 144, 3202219056u, 2617077637u, 0u, 4294967279u, 3220044848u, 2617077637u, 0, FREXP_TOLERANCE, 0}, +{ 145, 1094345280u, 546465680u, 0u, 21u, 1072325184u, 546465680u, 0, FREXP_TOLERANCE, 0}, +{ 146, 1048653554u, 532401530u, 0u, 4294967274u, 1071722226u, 532401530u, 0, FREXP_TOLERANCE, 0}, +{ 147, 1044571091u, 2759019783u, 0u, 4294967270u, 1071834067u, 2759019783u, 0, FREXP_TOLERANCE, 0}, +{ 148, 3221570188u, 3554409630u, 0u, 2u, 3219473036u, 3554409630u, 0, FREXP_TOLERANCE, 0}, +{ 149, 3212931282u, 2527221960u, 0u, 4294967290u, 3219222738u, 2527221960u, 0, FREXP_TOLERANCE, 0}, +{ 150, 1099107978u, 2696971136u, 0u, 26u, 1071845002u, 2696971136u, 0, FREXP_TOLERANCE, 0}, +{ 151, 1097158000u, 173134582u, 0u, 24u, 1071992176u, 173134582u, 0, FREXP_TOLERANCE, 0}, +{ 152, 1087299442u, 2877794600u, 0u, 14u, 1072619378u, 2877794600u, 0, FREXP_TOLERANCE, 0}, +{ 153, 1086400474u, 547642046u, 0u, 14u, 1071720410u, 547642046u, 0, FREXP_TOLERANCE, 0}, +{ 154, 3197285510u, 3521286127u, 0u, 4294967275u, 3219305606u, 3521286127u, 0, FREXP_TOLERANCE, 0}, +{ 155, 1074860702u, 1231582831u, 0u, 3u, 1071714974u, 1231582831u, 0, FREXP_TOLERANCE, 0}, +{ 156, 1090971734u, 1653446832u, 0u, 18u, 1072097366u, 1653446832u, 0, FREXP_TOLERANCE, 0}, +{ 157, 1061342535u, 3762182190u, 0u, 4294967286u, 1071828295u, 3762182190u, 0, FREXP_TOLERANCE, 0}, +{ 158, 3252967851u, 2615360375u, 0u, 32u, 3219413419u, 2615360375u, 0, FREXP_TOLERANCE, 0}, +{ 159, 3200834423u, 2588067350u, 0u, 4294967278u, 3219708791u, 2588067350u, 0, FREXP_TOLERANCE, 0}, +{ 160, 3206610957u, 3551059728u, 0u, 4294967284u, 3219193869u, 3551059728u, 0, FREXP_TOLERANCE, 0}, +{ 161, 3206978856u, 845263327u, 0u, 4294967284u, 3219561768u, 845263327u, 0, FREXP_TOLERANCE, 0}, +{ 162, 1073415902u, 1749010288u, 0u, 1u, 1072367326u, 1749010288u, 0, FREXP_TOLERANCE, 0}, +{ 163, 3205576370u, 3092685191u, 0u, 4294967283u, 3219207858u, 3092685191u, 0, FREXP_TOLERANCE, 0}, +{ 164, 3190678390u, 2872219490u, 0u, 4294967268u, 3220038518u, 2872219490u, 0, FREXP_TOLERANCE, 0}, +{ 165, 3218315055u, 4107255722u, 0u, 4294967295u, 3219363631u, 4107255722u, 0, FREXP_TOLERANCE, 0}, +{ 166, 3205337291u, 3069068345u, 0u, 4294967282u, 3220017355u, 3069068345u, 0, FREXP_TOLERANCE, 0}, +{ 167, 3243990857u, 2294867524u, 0u, 23u, 3219873609u, 2294867524u, 0, FREXP_TOLERANCE, 0}, +{ 168, 3216653996u, 2860384670u, 0u, 4294967293u, 3219799724u, 2860384670u, 0, FREXP_TOLERANCE, 0}, +{ 169, 3193326350u, 2265437201u, 0u, 4294967271u, 3219540750u, 2265437201u, 0, FREXP_TOLERANCE, 0}, +{ 170, 3240198679u, 1234948614u, 0u, 20u, 3219227159u, 1234948614u, 0, FREXP_TOLERANCE, 0}, +{ 171, 3216359929u, 1186945904u, 0u, 4294967293u, 3219505657u, 1186945904u, 0, FREXP_TOLERANCE, 0}, +{ 172, 3251167793u, 1896750851u, 0u, 30u, 3219710513u, 1896750851u, 0, FREXP_TOLERANCE, 0}, +{ 173, 1081575478u, 3686084548u, 0u, 9u, 1072138294u, 3686084548u, 0, FREXP_TOLERANCE, 0}, +{ 174, 1079286273u, 3309277689u, 0u, 7u, 1071946241u, 3309277689u, 0, FREXP_TOLERANCE, 0}, +{ 175, 3223476240u, 3006860614u, 0u, 4u, 3219281936u, 3006860614u, 0, FREXP_TOLERANCE, 0}, +{ 176, 3231412671u, 2504194724u, 0u, 11u, 3219878335u, 2504194724u, 0, FREXP_TOLERANCE, 0}, +{ 177, 3236149260u, 1948717780u, 0u, 16u, 3219372044u, 1948717780u, 0, FREXP_TOLERANCE, 0}, +{ 178, 1048317852u, 3791803982u, 0u, 4294967273u, 1072435100u, 3791803982u, 0, FREXP_TOLERANCE, 0}, +{ 179, 1064345015u, 4272034420u, 0u, 4294967289u, 1071685047u, 4272034420u, 0, FREXP_TOLERANCE, 0}, +{ 180, 3192982124u, 1526175922u, 0u, 4294967271u, 3219196524u, 1526175922u, 0, FREXP_TOLERANCE, 0}, +{ 181, 3245817826u, 4108948538u, 0u, 25u, 3219603426u, 4108948538u, 0, FREXP_TOLERANCE, 0}, +{ 182, 1104691287u, 640541190u, 0u, 31u, 1072185431u, 640541190u, 0, FREXP_TOLERANCE, 0}, +{ 183, 3207257417u, 3259274853u, 0u, 4294967284u, 3219840329u, 3259274853u, 0, FREXP_TOLERANCE, 0}, +{ 184, 1082507103u, 3677038020u, 0u, 10u, 1072021343u, 3677038020u, 0, FREXP_TOLERANCE, 0}, +{ 185, 1083132498u, 3781708548u, 0u, 10u, 1072646738u, 3781708548u, 0, FREXP_TOLERANCE, 0}, +{ 186, 1096584871u, 1207386447u, 0u, 23u, 1072467623u, 1207386447u, 0, FREXP_TOLERANCE, 0}, +{ 187, 3188695272u, 3011191657u, 0u, 4294967266u, 3220152552u, 3011191657u, 0, FREXP_TOLERANCE, 0}, +{ 188, 1103798670u, 1096124830u, 0u, 30u, 1072341390u, 1096124830u, 0, FREXP_TOLERANCE, 0}, +{ 189, 1063235023u, 2540404725u, 0u, 4294967287u, 1072672207u, 2540404725u, 0, FREXP_TOLERANCE, 0}, +{ 190, 3240157452u, 4122845725u, 0u, 20u, 3219185932u, 4122845725u, 0, FREXP_TOLERANCE, 0}, +{ 191, 1083643710u, 311336721u, 0u, 11u, 1072109374u, 311336721u, 0, FREXP_TOLERANCE, 0}, +{ 192, 3214382367u, 4212533768u, 0u, 4294967291u, 3219625247u, 4212533768u, 0, FREXP_TOLERANCE, 0}, +{ 193, 1051139427u, 1769686293u, 0u, 4294967276u, 1072110947u, 1769686293u, 0, FREXP_TOLERANCE, 0}, +{ 194, 3240200923u, 3538602249u, 0u, 20u, 3219229403u, 3538602249u, 0, FREXP_TOLERANCE, 0}, +{ 195, 1078227549u, 508056696u, 0u, 6u, 1071936093u, 508056696u, 0, FREXP_TOLERANCE, 0}, +{ 196, 1103793878u, 776520138u, 0u, 30u, 1072336598u, 776520138u, 0, FREXP_TOLERANCE, 0}, +{ 197, 1102910577u, 4064962760u, 0u, 29u, 1072501873u, 4064962760u, 0, FREXP_TOLERANCE, 0}, +{ 198, 1077424413u, 819766631u, 0u, 5u, 1072181533u, 819766631u, 0, FREXP_TOLERANCE, 0}, +{ 199, 1074178362u, 2112385259u, 0u, 2u, 1072081210u, 2112385259u, 0, FREXP_TOLERANCE, 0}, +{ 200, 3227593179u, 1187058516u, 0u, 8u, 3219204571u, 1187058516u, 0, FREXP_TOLERANCE, 0}, +{ 201, 1082295059u, 2514398118u, 0u, 10u, 1071809299u, 2514398118u, 0, FREXP_TOLERANCE, 0}, +{ 202, 1076579751u, 870169764u, 0u, 4u, 1072385447u, 870169764u, 0, FREXP_TOLERANCE, 0}, +{ 203, 3246851392u, 1190259653u, 0u, 26u, 3219588416u, 1190259653u, 0, FREXP_TOLERANCE, 0}, +{ 204, 1069112254u, 3417249840u, 0u, 4294967293u, 1072257982u, 3417249840u, 0, FREXP_TOLERANCE, 0}, +{ 205, 3193663083u, 3467757357u, 0u, 4294967271u, 3219877483u, 3467757357u, 0, FREXP_TOLERANCE, 0}, +{ 206, 3215075200u, 2168175352u, 0u, 4294967292u, 3219269504u, 2168175352u, 0, FREXP_TOLERANCE, 0}, +{ 207, 3239643135u, 1508888184u, 0u, 19u, 3219720191u, 1508888184u, 0, FREXP_TOLERANCE, 0}, +{ 208, 1060430241u, 3524949092u, 0u, 4294967285u, 1071964577u, 3524949092u, 0, FREXP_TOLERANCE, 0}, +{ 209, 3197412883u, 166402802u, 0u, 4294967275u, 3219432979u, 166402802u, 0, FREXP_TOLERANCE, 0}, +{ 210, 3237198975u, 3572369260u, 0u, 17u, 3219373183u, 3572369260u, 0, FREXP_TOLERANCE, 0}, +{ 211, 1081866822u, 2441536203u, 0u, 9u, 1072429638u, 2441536203u, 0, FREXP_TOLERANCE, 0}, +{ 212, 3202753937u, 3658194573u, 0u, 4294967280u, 3219531153u, 3658194573u, 0, FREXP_TOLERANCE, 0}, +{ 213, 1062392908u, 2479742828u, 0u, 4294967287u, 1071830092u, 2479742828u, 0, FREXP_TOLERANCE, 0}, +{ 214, 1062342831u, 4214154303u, 0u, 4294967287u, 1071780015u, 4214154303u, 0, FREXP_TOLERANCE, 0}, +{ 215, 1082396794u, 426896765u, 0u, 10u, 1071911034u, 426896765u, 0, FREXP_TOLERANCE, 0}, +{ 216, 1066474375u, 2201754442u, 0u, 4294967291u, 1071717255u, 2201754442u, 0, FREXP_TOLERANCE, 0}, +{ 217, 3195629021u, 2055773734u, 0u, 4294967273u, 3219746269u, 2055773734u, 0, FREXP_TOLERANCE, 0}, +{ 218, 3239267288u, 291396537u, 0u, 19u, 3219344344u, 291396537u, 0, FREXP_TOLERANCE, 0}, +{ 219, 3236968033u, 874125203u, 0u, 17u, 3219142241u, 874125203u, 0, FREXP_TOLERANCE, 0}, +{ 220, 3210508124u, 4091098764u, 0u, 4294967287u, 3219945308u, 4091098764u, 0, FREXP_TOLERANCE, 0}, +{ 221, 1065716026u, 120488169u, 0u, 4294967290u, 1072007482u, 120488169u, 0, FREXP_TOLERANCE, 0}, +{ 222, 3241241441u, 1985269424u, 0u, 21u, 3219221345u, 1985269424u, 0, FREXP_TOLERANCE, 0}, +{ 223, 3206539410u, 2243036871u, 0u, 4294967283u, 3220170898u, 2243036871u, 0, FREXP_TOLERANCE, 0}, +{ 224, 3243941101u, 740033495u, 0u, 23u, 3219823853u, 740033495u, 0, FREXP_TOLERANCE, 0}, +{ 225, 3209424906u, 1176656356u, 0u, 4294967286u, 3219910666u, 1176656356u, 0, FREXP_TOLERANCE, 0}, +{ 226, 1074261978u, 3588756231u, 0u, 2u, 1072164826u, 3588756231u, 0, FREXP_TOLERANCE, 0}, +{ 227, 3252816791u, 3037249392u, 0u, 32u, 3219262359u, 3037249392u, 0, FREXP_TOLERANCE, 0}, +{ 228, 1061635587u, 1173102190u, 0u, 4294967286u, 1072121347u, 1173102190u, 0, FREXP_TOLERANCE, 0}, +{ 229, 3237209581u, 2882725208u, 0u, 17u, 3219383789u, 2882725208u, 0, FREXP_TOLERANCE, 0}, +{ 230, 1071440059u, 69225090u, 0u, 4294967295u, 1072488635u, 69225090u, 0, FREXP_TOLERANCE, 0}, +{ 231, 3212663474u, 272319256u, 0u, 4294967289u, 3220003506u, 272319256u, 0, FREXP_TOLERANCE, 0}, +{ 232, 1072073912u, 2493997123u, 0u, 0u, 1072073912u, 2493997123u, 0, FREXP_TOLERANCE, 0}, +{ 233, 1057720186u, 188610379u, 0u, 4294967282u, 1072400250u, 188610379u, 0, FREXP_TOLERANCE, 0}, +{ 234, 3232757923u, 2209647371u, 0u, 12u, 3220175011u, 2209647371u, 0, FREXP_TOLERANCE, 0}, +{ 235, 3236758517u, 1990439193u, 0u, 16u, 3219981301u, 1990439193u, 0, FREXP_TOLERANCE, 0}, +{ 236, 1078073146u, 622849962u, 0u, 6u, 1071781690u, 622849962u, 0, FREXP_TOLERANCE, 0}, +{ 237, 1057135741u, 756052458u, 0u, 4294967282u, 1071815805u, 756052458u, 0, FREXP_TOLERANCE, 0}, +{ 238, 1081649113u, 2247475162u, 0u, 9u, 1072211929u, 2247475162u, 0, FREXP_TOLERANCE, 0}, +{ 239, 1061623064u, 3878055211u, 0u, 4294967286u, 1072108824u, 3878055211u, 0, FREXP_TOLERANCE, 0}, +{ 240, 3222407050u, 2979438623u, 0u, 3u, 3219261322u, 2979438623u, 0, FREXP_TOLERANCE, 0}, +{ 241, 3195290997u, 2676398686u, 0u, 4294967273u, 3219408245u, 2676398686u, 0, FREXP_TOLERANCE, 0}, +{ 242, 1105124431u, 3631096636u, 0u, 31u, 1072618575u, 3631096636u, 0, FREXP_TOLERANCE, 0}, +{ 243, 1065079390u, 1697791764u, 0u, 4294967289u, 1072419422u, 1697791764u, 0, FREXP_TOLERANCE, 0}, +{ 244, 3198136112u, 2299842819u, 0u, 4294967275u, 3220156208u, 2299842819u, 0, FREXP_TOLERANCE, 0}, +{ 245, 1078084768u, 1931502677u, 0u, 6u, 1071793312u, 1931502677u, 0, FREXP_TOLERANCE, 0}, +{ 246, 3215264397u, 3016456382u, 0u, 4294967292u, 3219458701u, 3016456382u, 0, FREXP_TOLERANCE, 0}, +{ 247, 1072253426u, 343404215u, 0u, 0u, 1072253426u, 343404215u, 0, FREXP_TOLERANCE, 0}, +{ 248, 1061072607u, 4266232536u, 0u, 4294967285u, 1072606943u, 4266232536u, 0, FREXP_TOLERANCE, 0}, +{ 249, 3241230836u, 4140316002u, 0u, 21u, 3219210740u, 4140316002u, 0, FREXP_TOLERANCE, 0}, +{ 250, 1082896196u, 868256971u, 0u, 10u, 1072410436u, 868256971u, 0, FREXP_TOLERANCE, 0}, +{ 251, 1075422810u, 1864139509u, 0u, 3u, 1072277082u, 1864139509u, 0, FREXP_TOLERANCE, 0}, +{ 252, 3187675097u, 3084482407u, 0u, 4294967266u, 3219132377u, 3084482407u, 0, FREXP_TOLERANCE, 0}, +{ 253, 3220191323u, 2427162817u, 0u, 1u, 3219142747u, 2427162817u, 0, FREXP_TOLERANCE, 0}, +{ 254, 3234748208u, 2715105792u, 0u, 14u, 3220068144u, 2715105792u, 0, FREXP_TOLERANCE, 0}, +{ 255, 1064600512u, 3943389284u, 0u, 4294967289u, 1071940544u, 3943389284u, 0, FREXP_TOLERANCE, 0}, +{ 256, 1046724025u, 3626825684u, 0u, 4294967272u, 1071889849u, 3626825684u, 0, FREXP_TOLERANCE, 0}, +{ 257, 1045423002u, 967350972u, 0u, 4294967270u, 1072685978u, 967350972u, 0, FREXP_TOLERANCE, 0}, +{ 258, 1093012318u, 448002663u, 0u, 20u, 1072040798u, 448002663u, 0, FREXP_TOLERANCE, 0}, +{ 259, 3251845859u, 105058217u, 0u, 31u, 3219340003u, 105058217u, 0, FREXP_TOLERANCE, 0}, +{ 260, 1069733884u, 171786224u, 0u, 4294967294u, 1071831036u, 171786224u, 0, FREXP_TOLERANCE, 0}, +{ 261, 3189614508u, 2863482262u, 0u, 4294967267u, 3220023212u, 2863482262u, 0, FREXP_TOLERANCE, 0}, +{ 262, 3204997271u, 877784425u, 0u, 4294967282u, 3219677335u, 877784425u, 0, FREXP_TOLERANCE, 0}, +{ 263, 3202629313u, 2801782962u, 0u, 4294967280u, 3219406529u, 2801782962u, 0, FREXP_TOLERANCE, 0}, +{ 264, 3213604117u, 762347195u, 0u, 4294967290u, 3219895573u, 762347195u, 0, FREXP_TOLERANCE, 0}, +{ 265, 3233486727u, 2317950339u, 0u, 13u, 3219855239u, 2317950339u, 0, FREXP_TOLERANCE, 0}, +{ 266, 3246333414u, 2135700283u, 0u, 25u, 3220119014u, 2135700283u, 0, FREXP_TOLERANCE, 0}, +{ 267, 1056516397u, 4171919805u, 0u, 4294967281u, 1072245037u, 4171919805u, 0, FREXP_TOLERANCE, 0}, +{ 268, 1082858682u, 2180920863u, 0u, 10u, 1072372922u, 2180920863u, 0, FREXP_TOLERANCE, 0}, +{ 269, 3220149084u, 1918836931u, 0u, 0u, 3220149084u, 1918836931u, 0, FREXP_TOLERANCE, 0}, +{ 270, 1083603224u, 3137821660u, 0u, 11u, 1072068888u, 3137821660u, 0, FREXP_TOLERANCE, 0}, +{ 271, 1103902874u, 3456203663u, 0u, 30u, 1072445594u, 3456203663u, 0, FREXP_TOLERANCE, 0}, +{ 272, 3235600523u, 2335688936u, 0u, 15u, 3219871883u, 2335688936u, 0, FREXP_TOLERANCE, 0}, +{ 273, 1042279322u, 4170235262u, 0u, 4294967267u, 1072688026u, 4170235262u, 0, FREXP_TOLERANCE, 0}, +{ 274, 1051824459u, 521583737u, 0u, 4294967277u, 1071747403u, 521583737u, 0, FREXP_TOLERANCE, 0}, +{ 275, 1081348303u, 1296623194u, 0u, 9u, 1071911119u, 1296623194u, 0, FREXP_TOLERANCE, 0}, +{ 276, 3250673860u, 2442872540u, 0u, 30u, 3219216580u, 2442872540u, 0, FREXP_TOLERANCE, 0}, +{ 277, 1061684277u, 289979405u, 0u, 4294967286u, 1072170037u, 289979405u, 0, FREXP_TOLERANCE, 0}, +{ 278, 1049514449u, 3865737145u, 0u, 4294967274u, 1072583121u, 3865737145u, 0, FREXP_TOLERANCE, 0}, +{ 279, 1075298944u, 3699090239u, 0u, 3u, 1072153216u, 3699090239u, 0, FREXP_TOLERANCE, 0}, +{ 280, 1054539840u, 3259249360u, 0u, 4294967279u, 1072365632u, 3259249360u, 0, FREXP_TOLERANCE, 0}, +{ 281, 1096418100u, 1619819023u, 0u, 23u, 1072300852u, 1619819023u, 0, FREXP_TOLERANCE, 0}, +{ 282, 1045993352u, 1022642459u, 0u, 4294967271u, 1072207752u, 1022642459u, 0, FREXP_TOLERANCE, 0}, +{ 283, 1081433004u, 19455098u, 0u, 9u, 1071995820u, 19455098u, 0, FREXP_TOLERANCE, 0}, +{ 284, 3229182089u, 2096003654u, 0u, 9u, 3219744905u, 2096003654u, 0, FREXP_TOLERANCE, 0}, +{ 285, 1076297936u, 3803689997u, 0u, 4u, 1072103632u, 3803689997u, 0, FREXP_TOLERANCE, 0}, +{ 286, 1071630912u, 2263729518u, 0u, 4294967295u, 1072679488u, 2263729518u, 0, FREXP_TOLERANCE, 0}, +{ 287, 1101357261u, 2816837387u, 0u, 28u, 1071997133u, 2816837387u, 0, FREXP_TOLERANCE, 0}, +{ 288, 1063422305u, 2597606398u, 0u, 4294967288u, 1071810913u, 2597606398u, 0, FREXP_TOLERANCE, 0}, +{ 289, 1069100169u, 3680967506u, 0u, 4294967293u, 1072245897u, 3680967506u, 0, FREXP_TOLERANCE, 0}, +{ 290, 1040201163u, 179224723u, 0u, 4294967266u, 1071658443u, 179224723u, 0, FREXP_TOLERANCE, 0}, +{ 291, 3188629767u, 978126928u, 0u, 4294967266u, 3220087047u, 978126928u, 0, FREXP_TOLERANCE, 0}, +{ 292, 1101553990u, 4047893399u, 0u, 28u, 1072193862u, 4047893399u, 0, FREXP_TOLERANCE, 0}, +{ 293, 3222322045u, 4059818629u, 0u, 3u, 3219176317u, 4059818629u, 0, FREXP_TOLERANCE, 0}, +{ 294, 1042678728u, 3640293589u, 0u, 4294967268u, 1072038856u, 3640293589u, 0, FREXP_TOLERANCE, 0}, +{ 295, 3248464040u, 3383497159u, 0u, 27u, 3220152488u, 3383497159u, 0, FREXP_TOLERANCE, 0}, +{ 296, 1070002807u, 1527313008u, 0u, 4294967294u, 1072099959u, 1527313008u, 0, FREXP_TOLERANCE, 0}, +{ 297, 3202707679u, 2599946514u, 0u, 4294967280u, 3219484895u, 2599946514u, 0, FREXP_TOLERANCE, 0}, +{ 298, 1104170406u, 2738675352u, 0u, 31u, 1071664550u, 2738675352u, 0, FREXP_TOLERANCE, 0}, +{ 299, 1105232623u, 3616571377u, 0u, 32u, 1071678191u, 3616571377u, 0, FREXP_TOLERANCE, 0}, +{ 300, 1060859316u, 1130603218u, 0u, 4294967285u, 1072393652u, 1130603218u, 0, FREXP_TOLERANCE, 0}, +{ 301, 1076028796u, 3859211180u, 0u, 4u, 1071834492u, 3859211180u, 0, FREXP_TOLERANCE, 0}, +{ 302, 1067940450u, 1744531824u, 0u, 4294967292u, 1072134754u, 1744531824u, 0, FREXP_TOLERANCE, 0}, +{ 303, 1042831340u, 1958025850u, 0u, 4294967268u, 1072191468u, 1958025850u, 0, FREXP_TOLERANCE, 0}, +{ 304, 3236511256u, 2472176453u, 0u, 16u, 3219734040u, 2472176453u, 0, FREXP_TOLERANCE, 0}, +{ 305, 3233107089u, 182132862u, 0u, 13u, 3219475601u, 182132862u, 0, FREXP_TOLERANCE, 0}, +{ 306, 3250520938u, 3924356991u, 0u, 29u, 3220112234u, 3924356991u, 0, FREXP_TOLERANCE, 0}, +{ 307, 3230501884u, 35632886u, 0u, 10u, 3220016124u, 35632886u, 0, FREXP_TOLERANCE, 0}, +{ 308, 3209806504u, 1453402523u, 0u, 4294967287u, 3219243688u, 1453402523u, 0, FREXP_TOLERANCE, 0}, +{ 309, 1083522102u, 743225214u, 0u, 11u, 1071987766u, 743225214u, 0, FREXP_TOLERANCE, 0}, +{ 310, 3202890678u, 142917400u, 0u, 4294967280u, 3219667894u, 142917400u, 0, FREXP_TOLERANCE, 0}, +{ 311, 1080684976u, 1472665012u, 0u, 8u, 1072296368u, 1472665012u, 0, FREXP_TOLERANCE, 0}, +{ 312, 3203138231u, 256588219u, 0u, 4294967280u, 3219915447u, 256588219u, 0, FREXP_TOLERANCE, 0}, +{ 313, 1094982162u, 1062927000u, 0u, 22u, 1071913490u, 1062927000u, 0, FREXP_TOLERANCE, 0}, +{ 314, 1061134072u, 931677439u, 0u, 4294967285u, 1072668408u, 931677439u, 0, FREXP_TOLERANCE, 0}, +{ 315, 1058377732u, 2320910576u, 0u, 4294967283u, 1072009220u, 2320910576u, 0, FREXP_TOLERANCE, 0}, +{ 316, 1055663370u, 288059864u, 0u, 4294967280u, 1072440586u, 288059864u, 0, FREXP_TOLERANCE, 0}, +{ 317, 1078958093u, 1448349062u, 0u, 6u, 1072666637u, 1448349062u, 0, FREXP_TOLERANCE, 0}, +{ 318, 3199478070u, 3454027134u, 0u, 4294967277u, 3219401014u, 3454027134u, 0, FREXP_TOLERANCE, 0}, +{ 319, 3237458798u, 4215445172u, 0u, 17u, 3219633006u, 4215445172u, 0, FREXP_TOLERANCE, 0}, +{ 320, 3196654963u, 2231888973u, 0u, 4294967274u, 3219723635u, 2231888973u, 0, FREXP_TOLERANCE, 0}, +{ 321, 3246632231u, 40413554u, 0u, 26u, 3219369255u, 40413554u, 0, FREXP_TOLERANCE, 0}, +{ 322, 3232578253u, 983832844u, 0u, 12u, 3219995341u, 983832844u, 0, FREXP_TOLERANCE, 0}, +{ 323, 3223721534u, 3995725873u, 0u, 4u, 3219527230u, 3995725873u, 0, FREXP_TOLERANCE, 0}, +{ 324, 1050082319u, 777231627u, 0u, 4294967275u, 1072102415u, 777231627u, 0, FREXP_TOLERANCE, 0}, +{ 325, 1040986626u, 672789828u, 0u, 4294967266u, 1072443906u, 672789828u, 0, FREXP_TOLERANCE, 0}, +{ 326, 3253385962u, 2982787335u, 0u, 32u, 3219831530u, 2982787335u, 0, FREXP_TOLERANCE, 0}, +{ 327, 1068390875u, 2075971825u, 0u, 4294967292u, 1072585179u, 2075971825u, 0, FREXP_TOLERANCE, 0}, +{ 328, 1070166500u, 4034633931u, 0u, 4294967294u, 1072263652u, 4034633931u, 0, FREXP_TOLERANCE, 0}, +{ 329, 3210046177u, 1018222907u, 0u, 4294967287u, 3219483361u, 1018222907u, 0, FREXP_TOLERANCE, 0}, +{ 330, 3244621407u, 3090050495u, 0u, 24u, 3219455583u, 3090050495u, 0, FREXP_TOLERANCE, 0}, +{ 331, 1067680885u, 937732557u, 0u, 4294967292u, 1071875189u, 937732557u, 0, FREXP_TOLERANCE, 0}, +{ 332, 3200798890u, 2557898276u, 0u, 4294967278u, 3219673258u, 2557898276u, 0, FREXP_TOLERANCE, 0}, +{ 333, 1078342316u, 130346162u, 0u, 6u, 1072050860u, 130346162u, 0, FREXP_TOLERANCE, 0}, +{ 334, 3223590310u, 275568693u, 0u, 4u, 3219396006u, 275568693u, 0, FREXP_TOLERANCE, 0}, +{ 335, 1042898869u, 3807416441u, 0u, 4294967268u, 1072258997u, 3807416441u, 0, FREXP_TOLERANCE, 0}, +{ 336, 1075961161u, 3706820266u, 0u, 4u, 1071766857u, 3706820266u, 0, FREXP_TOLERANCE, 0}, +{ 337, 3216099005u, 1710131411u, 0u, 4294967293u, 3219244733u, 1710131411u, 0, FREXP_TOLERANCE, 0}, +{ 338, 1078123323u, 1900790503u, 0u, 6u, 1071831867u, 1900790503u, 0, FREXP_TOLERANCE, 0}, +{ 339, 3238819361u, 3420420033u, 0u, 18u, 3219944993u, 3420420033u, 0, FREXP_TOLERANCE, 0}, +{ 340, 3210844787u, 588423066u, 0u, 4294967288u, 3219233395u, 588423066u, 0, FREXP_TOLERANCE, 0}, +{ 341, 1049684114u, 1160162008u, 0u, 4294967275u, 1071704210u, 1160162008u, 0, FREXP_TOLERANCE, 0}, +{ 342, 3246307879u, 4265764460u, 0u, 25u, 3220093479u, 4265764460u, 0, FREXP_TOLERANCE, 0}, +{ 343, 1102543434u, 366653268u, 0u, 29u, 1072134730u, 366653268u, 0, FREXP_TOLERANCE, 0}, +{ 344, 3188814424u, 466059202u, 0u, 4294967267u, 3219223128u, 466059202u, 0, FREXP_TOLERANCE, 0}, +{ 345, 3226627739u, 1325936170u, 0u, 7u, 3219287707u, 1325936170u, 0, FREXP_TOLERANCE, 0}, +{ 346, 3221436876u, 680097612u, 0u, 2u, 3219339724u, 680097612u, 0, FREXP_TOLERANCE, 0}, +{ 347, 3240391116u, 1827735934u, 0u, 20u, 3219419596u, 1827735934u, 0, FREXP_TOLERANCE, 0}, +{ 348, 3200554324u, 2875599271u, 0u, 4294967278u, 3219428692u, 2875599271u, 0, FREXP_TOLERANCE, 0}, +{ 349, 3191030402u, 3117037091u, 0u, 4294967269u, 3219341954u, 3117037091u, 0, FREXP_TOLERANCE, 0}, +{ 350, 3239246636u, 15838845u, 0u, 19u, 3219323692u, 15838845u, 0, FREXP_TOLERANCE, 0}, +{ 351, 1051974004u, 749718883u, 0u, 4294967277u, 1071896948u, 749718883u, 0, FREXP_TOLERANCE, 0}, +{ 352, 3223587064u, 1523766569u, 0u, 4u, 3219392760u, 1523766569u, 0, FREXP_TOLERANCE, 0}, +{ 353, 1044833651u, 1966536294u, 0u, 4294967270u, 1072096627u, 1966536294u, 0, FREXP_TOLERANCE, 0}, +{ 354, 3250158026u, 699164258u, 0u, 29u, 3219749322u, 699164258u, 0, FREXP_TOLERANCE, 0}, +{ 355, 1098048435u, 3759049394u, 0u, 25u, 1071834035u, 3759049394u, 0, FREXP_TOLERANCE, 0}, +{ 356, 1106085272u, 1183789499u, 0u, 32u, 1072530840u, 1183789499u, 0, FREXP_TOLERANCE, 0}, +{ 357, 1081201623u, 1970107747u, 0u, 9u, 1071764439u, 1970107747u, 0, FREXP_TOLERANCE, 0}, +{ 358, 1095245453u, 2308233883u, 0u, 22u, 1072176781u, 2308233883u, 0, FREXP_TOLERANCE, 0}, +{ 359, 1084756444u, 1491017852u, 0u, 12u, 1072173532u, 1491017852u, 0, FREXP_TOLERANCE, 0}, +{ 360, 1041444355u, 1723375725u, 0u, 4294967267u, 1071853059u, 1723375725u, 0, FREXP_TOLERANCE, 0}, +{ 361, 3216630070u, 1141349287u, 0u, 4294967293u, 3219775798u, 1141349287u, 0, FREXP_TOLERANCE, 0}, +{ 362, 1097465301u, 3403438584u, 0u, 24u, 1072299477u, 3403438584u, 0, FREXP_TOLERANCE, 0}, +{ 363, 3230571908u, 1711085243u, 0u, 10u, 3220086148u, 1711085243u, 0, FREXP_TOLERANCE, 0}, +{ 364, 3250239076u, 1377484108u, 0u, 29u, 3219830372u, 1377484108u, 0, FREXP_TOLERANCE, 0}, +{ 365, 1098385019u, 2880275004u, 0u, 25u, 1072170619u, 2880275004u, 0, FREXP_TOLERANCE, 0}, +{ 366, 1084039594u, 1611394950u, 0u, 11u, 1072505258u, 1611394950u, 0, FREXP_TOLERANCE, 0}, +{ 367, 3234221435u, 2626629370u, 0u, 14u, 3219541371u, 2626629370u, 0, FREXP_TOLERANCE, 0}, +{ 368, 1063771493u, 1499080813u, 0u, 4294967288u, 1072160101u, 1499080813u, 0, FREXP_TOLERANCE, 0}, +{ 369, 1055231263u, 3936262414u, 0u, 4294967280u, 1072008479u, 3936262414u, 0, FREXP_TOLERANCE, 0}, +{ 370, 1103919063u, 3175668759u, 0u, 30u, 1072461783u, 3175668759u, 0, FREXP_TOLERANCE, 0}, +{ 371, 3207981719u, 1270950554u, 0u, 4294967285u, 3219516055u, 1270950554u, 0, FREXP_TOLERANCE, 0}, +{ 372, 3194616071u, 3680565379u, 0u, 4294967272u, 3219781895u, 3680565379u, 0, FREXP_TOLERANCE, 0}, +{ 373, 3208148223u, 1066985223u, 0u, 4294967285u, 3219682559u, 1066985223u, 0, FREXP_TOLERANCE, 0}, +{ 374, 3221613219u, 4089383168u, 0u, 2u, 3219516067u, 4089383168u, 0, FREXP_TOLERANCE, 0}, +{ 375, 3217058839u, 4017329311u, 0u, 4294967294u, 3219155991u, 4017329311u, 0, FREXP_TOLERANCE, 0}, +{ 376, 3208334452u, 1667591498u, 0u, 4294967285u, 3219868788u, 1667591498u, 0, FREXP_TOLERANCE, 0}, +{ 377, 1088164157u, 3154656624u, 0u, 15u, 1072435517u, 3154656624u, 0, FREXP_TOLERANCE, 0}, +{ 378, 1061894279u, 3886344038u, 0u, 4294967286u, 1072380039u, 3886344038u, 0, FREXP_TOLERANCE, 0}, +{ 379, 1050652945u, 977586119u, 0u, 4294967275u, 1072673041u, 977586119u, 0, FREXP_TOLERANCE, 0}, +{ 380, 3209762784u, 953839852u, 0u, 4294967287u, 3219199968u, 953839852u, 0, FREXP_TOLERANCE, 0}, +{ 381, 1104965247u, 143071571u, 0u, 31u, 1072459391u, 143071571u, 0, FREXP_TOLERANCE, 0}, +{ 382, 3206165386u, 913097445u, 0u, 4294967283u, 3219796874u, 913097445u, 0, FREXP_TOLERANCE, 0}, +{ 383, 3190565456u, 1371169579u, 0u, 4294967268u, 3219925584u, 1371169579u, 0, FREXP_TOLERANCE, 0}, +{ 384, 1057079837u, 2594818628u, 0u, 4294967282u, 1071759901u, 2594818628u, 0, FREXP_TOLERANCE, 0}, +{ 385, 3251793336u, 2259342224u, 0u, 31u, 3219287480u, 2259342224u, 0, FREXP_TOLERANCE, 0}, +{ 386, 3217432469u, 1824221478u, 0u, 4294967294u, 3219529621u, 1824221478u, 0, FREXP_TOLERANCE, 0}, +{ 387, 3246834775u, 1576604497u, 0u, 26u, 3219571799u, 1576604497u, 0, FREXP_TOLERANCE, 0}, +{ 388, 1079368611u, 185078728u, 0u, 7u, 1072028579u, 185078728u, 0, FREXP_TOLERANCE, 0}, +{ 389, 3221679427u, 444800035u, 0u, 2u, 3219582275u, 444800035u, 0, FREXP_TOLERANCE, 0}, +{ 390, 3243343143u, 1734989302u, 0u, 23u, 3219225895u, 1734989302u, 0, FREXP_TOLERANCE, 0}, +{ 391, 1072748883u, 130452005u, 0u, 1u, 1071700307u, 130452005u, 0, FREXP_TOLERANCE, 0}, +{ 392, 1041548088u, 2158433515u, 0u, 4294967267u, 1071956792u, 2158433515u, 0, FREXP_TOLERANCE, 0}, +{ 393, 3234695968u, 1941318385u, 0u, 14u, 3220015904u, 1941318385u, 0, FREXP_TOLERANCE, 0}, +{ 394, 1045807374u, 792193370u, 0u, 4294967271u, 1072021774u, 792193370u, 0, FREXP_TOLERANCE, 0}, +{ 395, 3238299666u, 1299392207u, 0u, 18u, 3219425298u, 1299392207u, 0, FREXP_TOLERANCE, 0}, +{ 396, 3212131720u, 3205732280u, 0u, 4294967289u, 3219471752u, 3205732280u, 0, FREXP_TOLERANCE, 0}, +{ 397, 1098698804u, 3035093505u, 0u, 25u, 1072484404u, 3035093505u, 0, FREXP_TOLERANCE, 0}, +{ 398, 1052187689u, 3287702190u, 0u, 4294967277u, 1072110633u, 3287702190u, 0, FREXP_TOLERANCE, 0}, +{ 399, 3246676260u, 2160225215u, 0u, 26u, 3219413284u, 2160225215u, 0, FREXP_TOLERANCE, 0}, +{ 400, 1102624859u, 836655570u, 0u, 29u, 1072216155u, 836655570u, 0, FREXP_TOLERANCE, 0}, +{ 401, 1096723626u, 3360816360u, 0u, 23u, 1072606378u, 3360816360u, 0, FREXP_TOLERANCE, 0}, +{ 402, 3246176356u, 172860634u, 0u, 25u, 3219961956u, 172860634u, 0, FREXP_TOLERANCE, 0}, +{ 403, 1070995788u, 146831910u, 0u, 4294967295u, 1072044364u, 146831910u, 0, FREXP_TOLERANCE, 0}, +{ 404, 1051558014u, 2340722078u, 0u, 4294967276u, 1072529534u, 2340722078u, 0, FREXP_TOLERANCE, 0}, +{ 405, 3230416351u, 1603798153u, 0u, 10u, 3219930591u, 1603798153u, 0, FREXP_TOLERANCE, 0}, +{ 406, 3207725532u, 1099413093u, 0u, 4294967285u, 3219259868u, 1099413093u, 0, FREXP_TOLERANCE, 0}, +{ 407, 3246678378u, 2429340443u, 0u, 26u, 3219415402u, 2429340443u, 0, FREXP_TOLERANCE, 0}, +{ 408, 3190303581u, 3223770005u, 0u, 4294967268u, 3219663709u, 3223770005u, 0, FREXP_TOLERANCE, 0}, +{ 409, 1075882959u, 955542166u, 0u, 4u, 1071688655u, 955542166u, 0, FREXP_TOLERANCE, 0}, +{ 410, 3230415151u, 275583938u, 0u, 10u, 3219929391u, 275583938u, 0, FREXP_TOLERANCE, 0}, +{ 411, 1092971882u, 513397822u, 0u, 20u, 1072000362u, 513397822u, 0, FREXP_TOLERANCE, 0}, +{ 412, 1090646554u, 2089321329u, 0u, 18u, 1071772186u, 2089321329u, 0, FREXP_TOLERANCE, 0}, +{ 413, 3193169876u, 2782073372u, 0u, 4294967271u, 3219384276u, 2782073372u, 0, FREXP_TOLERANCE, 0}, +{ 414, 1046063872u, 4023829068u, 0u, 4294967271u, 1072278272u, 4023829068u, 0, FREXP_TOLERANCE, 0}, +{ 415, 1098564822u, 3242223094u, 0u, 25u, 1072350422u, 3242223094u, 0, FREXP_TOLERANCE, 0}, +{ 416, 3194111199u, 4264674108u, 0u, 4294967272u, 3219277023u, 4264674108u, 0, FREXP_TOLERANCE, 0}, +{ 417, 3238510821u, 3506346169u, 0u, 18u, 3219636453u, 3506346169u, 0, FREXP_TOLERANCE, 0}, +{ 418, 1047020885u, 1742757458u, 0u, 4294967272u, 1072186709u, 1742757458u, 0, FREXP_TOLERANCE, 0}, +{ 419, 3192664477u, 1265459564u, 0u, 4294967270u, 3219927453u, 1265459564u, 0, FREXP_TOLERANCE, 0}, +{ 420, 3193450280u, 3650514880u, 0u, 4294967271u, 3219664680u, 3650514880u, 0, FREXP_TOLERANCE, 0}, +{ 421, 1081755890u, 1525260440u, 0u, 9u, 1072318706u, 1525260440u, 0, FREXP_TOLERANCE, 0}, +{ 422, 3235452527u, 2612331392u, 0u, 15u, 3219723887u, 2612331392u, 0, FREXP_TOLERANCE, 0}, +{ 423, 3248668920u, 1263613754u, 0u, 28u, 3219308792u, 1263613754u, 0, FREXP_TOLERANCE, 0}, +{ 424, 3219096387u, 635677201u, 0u, 4294967295u, 3220144963u, 635677201u, 0, FREXP_TOLERANCE, 0}, +{ 425, 3206272087u, 4140947288u, 0u, 4294967283u, 3219903575u, 4140947288u, 0, FREXP_TOLERANCE, 0}, +{ 426, 3200792376u, 2013265346u, 0u, 4294967278u, 3219666744u, 2013265346u, 0, FREXP_TOLERANCE, 0}, +{ 427, 3249974392u, 1912759945u, 0u, 29u, 3219565688u, 1912759945u, 0, FREXP_TOLERANCE, 0}, +{ 428, 3237045253u, 1351396825u, 0u, 17u, 3219219461u, 1351396825u, 0, FREXP_TOLERANCE, 0}, +{ 429, 3248205162u, 1001433078u, 0u, 27u, 3219893610u, 1001433078u, 0, FREXP_TOLERANCE, 0}, +{ 430, 3206926643u, 2741676659u, 0u, 4294967284u, 3219509555u, 2741676659u, 0, FREXP_TOLERANCE, 0}, +{ 431, 1080923606u, 1088945233u, 0u, 8u, 1072534998u, 1088945233u, 0, FREXP_TOLERANCE, 0}, +{ 432, 1085095743u, 3986114865u, 0u, 12u, 1072512831u, 3986114865u, 0, FREXP_TOLERANCE, 0}, +{ 433, 3215734057u, 831239754u, 0u, 4294967292u, 3219928361u, 831239754u, 0, FREXP_TOLERANCE, 0}, +{ 434, 1099828675u, 3071308141u, 0u, 26u, 1072565699u, 3071308141u, 0, FREXP_TOLERANCE, 0}, +{ 435, 3225834497u, 3473592372u, 0u, 6u, 3219543041u, 3473592372u, 0, FREXP_TOLERANCE, 0}, +{ 436, 1102759382u, 1309576357u, 0u, 29u, 1072350678u, 1309576357u, 0, FREXP_TOLERANCE, 0}, +{ 437, 3251186706u, 2042340367u, 0u, 30u, 3219729426u, 2042340367u, 0, FREXP_TOLERANCE, 0}, +{ 438, 1091945628u, 2062772374u, 0u, 19u, 1072022684u, 2062772374u, 0, FREXP_TOLERANCE, 0}, +{ 439, 3194765687u, 1840632537u, 0u, 4294967272u, 3219931511u, 1840632537u, 0, FREXP_TOLERANCE, 0}, +{ 440, 1096533424u, 807510337u, 0u, 23u, 1072416176u, 807510337u, 0, FREXP_TOLERANCE, 0}, +{ 441, 3231451722u, 144814872u, 0u, 11u, 3219917386u, 144814872u, 0, FREXP_TOLERANCE, 0}, +{ 442, 3212698915u, 2282965697u, 0u, 4294967289u, 3220038947u, 2282965697u, 0, FREXP_TOLERANCE, 0}, +{ 443, 1071236430u, 2552499583u, 0u, 4294967295u, 1072285006u, 2552499583u, 0, FREXP_TOLERANCE, 0}, +{ 444, 3229111426u, 1470130815u, 0u, 9u, 3219674242u, 1470130815u, 0, FREXP_TOLERANCE, 0}, +{ 445, 3243093065u, 2858583811u, 0u, 22u, 3220024393u, 2858583811u, 0, FREXP_TOLERANCE, 0}, +{ 446, 1089760910u, 6360994u, 0u, 17u, 1071935118u, 6360994u, 0, FREXP_TOLERANCE, 0}, +{ 447, 3198264929u, 1614537194u, 0u, 4294967276u, 3219236449u, 1614537194u, 0, FREXP_TOLERANCE, 0}, +{ 448, 1075198900u, 4088705365u, 0u, 3u, 1072053172u, 4088705365u, 0, FREXP_TOLERANCE, 0}, +{ 449, 3250939070u, 3545570051u, 0u, 30u, 3219481790u, 3545570051u, 0, FREXP_TOLERANCE, 0}, +{ 450, 1065221325u, 1629217700u, 0u, 4294967289u, 1072561357u, 1629217700u, 0, FREXP_TOLERANCE, 0}, +{ 451, 1072744324u, 1813392963u, 0u, 1u, 1071695748u, 1813392963u, 0, FREXP_TOLERANCE, 0}, +{ 452, 3235313361u, 3772501596u, 0u, 15u, 3219584721u, 3772501596u, 0, FREXP_TOLERANCE, 0}, +{ 453, 3196802686u, 2406734491u, 0u, 4294967274u, 3219871358u, 2406734491u, 0, FREXP_TOLERANCE, 0}, +{ 454, 1042055360u, 89226663u, 0u, 4294967267u, 1072464064u, 89226663u, 0, FREXP_TOLERANCE, 0}, +{ 455, 3195751081u, 1618759139u, 0u, 4294967273u, 3219868329u, 1618759139u, 0, FREXP_TOLERANCE, 0}, +{ 456, 3194723421u, 3888234802u, 0u, 4294967272u, 3219889245u, 3888234802u, 0, FREXP_TOLERANCE, 0}, +{ 457, 1055357248u, 3590035633u, 0u, 4294967280u, 1072134464u, 3590035633u, 0, FREXP_TOLERANCE, 0}, +{ 458, 3212424262u, 2892456615u, 0u, 4294967289u, 3219764294u, 2892456615u, 0, FREXP_TOLERANCE, 0}, +{ 459, 3189943060u, 2431246964u, 0u, 4294967268u, 3219303188u, 2431246964u, 0, FREXP_TOLERANCE, 0}, +{ 460, 3241512456u, 183850734u, 0u, 21u, 3219492360u, 183850734u, 0, FREXP_TOLERANCE, 0}, +{ 461, 1089501101u, 3088319870u, 0u, 17u, 1071675309u, 3088319870u, 0, FREXP_TOLERANCE, 0}, +{ 462, 3211544311u, 862225364u, 0u, 4294967288u, 3219932919u, 862225364u, 0, FREXP_TOLERANCE, 0}, +{ 463, 3235294664u, 3495352775u, 0u, 15u, 3219566024u, 3495352775u, 0, FREXP_TOLERANCE, 0}, +{ 464, 1058576726u, 596957268u, 0u, 4294967283u, 1072208214u, 596957268u, 0, FREXP_TOLERANCE, 0}, +{ 465, 1046553348u, 1839214511u, 0u, 4294967272u, 1071719172u, 1839214511u, 0, FREXP_TOLERANCE, 0}, +{ 466, 3205004060u, 1923240983u, 0u, 4294967282u, 3219684124u, 1923240983u, 0, FREXP_TOLERANCE, 0}, +{ 467, 1058073864u, 739619702u, 0u, 4294967283u, 1071705352u, 739619702u, 0, FREXP_TOLERANCE, 0}, +{ 468, 3223356436u, 2689885273u, 0u, 4u, 3219162132u, 2689885273u, 0, FREXP_TOLERANCE, 0}, +{ 469, 3200324971u, 2143376228u, 0u, 4294967278u, 3219199339u, 2143376228u, 0, FREXP_TOLERANCE, 0}, +{ 470, 1098306332u, 3760236188u, 0u, 25u, 1072091932u, 3760236188u, 0, FREXP_TOLERANCE, 0}, +{ 471, 1074621795u, 671680995u, 0u, 2u, 1072524643u, 671680995u, 0, FREXP_TOLERANCE, 0}, +{ 472, 1091262633u, 2315535361u, 0u, 18u, 1072388265u, 2315535361u, 0, FREXP_TOLERANCE, 0}, +{ 473, 3214165989u, 2493598049u, 0u, 4294967291u, 3219408869u, 2493598049u, 0, FREXP_TOLERANCE, 0}, +{ 474, 3194927008u, 1689107592u, 0u, 4294967272u, 3220092832u, 1689107592u, 0, FREXP_TOLERANCE, 0}, +{ 475, 3189989959u, 1578976988u, 0u, 4294967268u, 3219350087u, 1578976988u, 0, FREXP_TOLERANCE, 0}, +{ 476, 1066368383u, 2117279163u, 0u, 4294967290u, 1072659839u, 2117279163u, 0, FREXP_TOLERANCE, 0}, +{ 477, 3222988111u, 3425290087u, 0u, 3u, 3219842383u, 3425290087u, 0, FREXP_TOLERANCE, 0}, +{ 478, 1098487295u, 1263412017u, 0u, 25u, 1072272895u, 1263412017u, 0, FREXP_TOLERANCE, 0}, +{ 479, 3208432764u, 3635396812u, 0u, 4294967285u, 3219967100u, 3635396812u, 0, FREXP_TOLERANCE, 0}, +{ 480, 1070999426u, 3965655689u, 0u, 4294967295u, 1072048002u, 3965655689u, 0, FREXP_TOLERANCE, 0}, +{ 481, 1060196346u, 2183973116u, 0u, 4294967285u, 1071730682u, 2183973116u, 0, FREXP_TOLERANCE, 0}, +{ 482, 1101098363u, 1118613350u, 0u, 28u, 1071738235u, 1118613350u, 0, FREXP_TOLERANCE, 0}, +{ 483, 3221946089u, 199516350u, 0u, 2u, 3219848937u, 199516350u, 0, FREXP_TOLERANCE, 0}, +{ 484, 1078368488u, 164621458u, 0u, 6u, 1072077032u, 164621458u, 0, FREXP_TOLERANCE, 0}, +{ 485, 3187706018u, 3570940805u, 0u, 4294967266u, 3219163298u, 3570940805u, 0, FREXP_TOLERANCE, 0}, +{ 486, 3230316437u, 3596080877u, 0u, 10u, 3219830677u, 3596080877u, 0, FREXP_TOLERANCE, 0}, +{ 487, 3208209565u, 980880313u, 0u, 4294967285u, 3219743901u, 980880313u, 0, FREXP_TOLERANCE, 0}, +{ 488, 1079833442u, 884465057u, 0u, 7u, 1072493410u, 884465057u, 0, FREXP_TOLERANCE, 0}, +{ 489, 1099977124u, 2558179220u, 0u, 27u, 1071665572u, 2558179220u, 0, FREXP_TOLERANCE, 0}, +{ 490, 1052873711u, 1233598120u, 0u, 4294967278u, 1071748079u, 1233598120u, 0, FREXP_TOLERANCE, 0}, +{ 491, 1047115221u, 1909994277u, 0u, 4294967272u, 1072281045u, 1909994277u, 0, FREXP_TOLERANCE, 0}, +{ 492, 1085015978u, 2991527452u, 0u, 12u, 1072433066u, 2991527452u, 0, FREXP_TOLERANCE, 0}, +{ 493, 1060855260u, 1680290941u, 0u, 4294967285u, 1072389596u, 1680290941u, 0, FREXP_TOLERANCE, 0}, +{ 494, 1074309900u, 2943870846u, 0u, 2u, 1072212748u, 2943870846u, 0, FREXP_TOLERANCE, 0}, +{ 495, 1059496132u, 1451927357u, 0u, 4294967284u, 1072079044u, 1451927357u, 0, FREXP_TOLERANCE, 0}, +{ 496, 3228615456u, 1502585517u, 0u, 9u, 3219178272u, 1502585517u, 0, FREXP_TOLERANCE, 0}, +{ 497, 3236211951u, 751136990u, 0u, 16u, 3219434735u, 751136990u, 0, FREXP_TOLERANCE, 0}, +{ 498, 3230392165u, 3493275472u, 0u, 10u, 3219906405u, 3493275472u, 0, FREXP_TOLERANCE, 0}, +{ 499, 1098365967u, 1209623292u, 0u, 25u, 1072151567u, 1209623292u, 0, FREXP_TOLERANCE, 0}, +{ 500, 3238056647u, 979495322u, 0u, 18u, 3219182279u, 979495322u, 0, FREXP_TOLERANCE, 0}, +{ 501, 3250424296u, 1717672108u, 0u, 29u, 3220015592u, 1717672108u, 0, FREXP_TOLERANCE, 0}, +{ 502, 1048120593u, 531240316u, 0u, 4294967273u, 1072237841u, 531240316u, 0, FREXP_TOLERANCE, 0}, +{ 503, 1054174923u, 3548721654u, 0u, 4294967279u, 1072000715u, 3548721654u, 0, FREXP_TOLERANCE, 0}, +{ 504, 1086112947u, 3391817224u, 0u, 13u, 1072481459u, 3391817224u, 0, FREXP_TOLERANCE, 0}, +{ 505, 1077836851u, 2758195125u, 0u, 5u, 1072593971u, 2758195125u, 0, FREXP_TOLERANCE, 0}, +{ 506, 1100880260u, 2028440924u, 0u, 27u, 1072568708u, 2028440924u, 0, FREXP_TOLERANCE, 0}, +{ 507, 1084223893u, 2750123373u, 0u, 11u, 1072689557u, 2750123373u, 0, FREXP_TOLERANCE, 0}, +{ 508, 3232200256u, 1086294931u, 0u, 12u, 3219617344u, 1086294931u, 0, FREXP_TOLERANCE, 0}, +{ 509, 1043958672u, 2986160931u, 0u, 4294967269u, 1072270224u, 2986160931u, 0, FREXP_TOLERANCE, 0}, +{ 510, 1076097908u, 2540046258u, 0u, 4u, 1071903604u, 2540046258u, 0, FREXP_TOLERANCE, 0}, +{ 511, 3235476602u, 451471221u, 0u, 15u, 3219747962u, 451471221u, 0, FREXP_TOLERANCE, 0}, +{ 512, 1064816262u, 4187644495u, 0u, 4294967289u, 1072156294u, 4187644495u, 0, FREXP_TOLERANCE, 0}, +{ 513, 1099460228u, 2439500162u, 0u, 26u, 1072197252u, 2439500162u, 0, FREXP_TOLERANCE, 0}, +{ 514, 1065280276u, 1979490284u, 0u, 4294967289u, 1072620308u, 1979490284u, 0, FREXP_TOLERANCE, 0}, +{ 515, 1040415832u, 2283342035u, 0u, 4294967266u, 1071873112u, 2283342035u, 0, FREXP_TOLERANCE, 0}, +{ 516, 1078398157u, 1345997553u, 0u, 6u, 1072106701u, 1345997553u, 0, FREXP_TOLERANCE, 0}, +{ 517, 3213249348u, 179066662u, 0u, 4294967290u, 3219540804u, 179066662u, 0, FREXP_TOLERANCE, 0}, +{ 518, 1103272172u, 1217337578u, 0u, 30u, 1071814892u, 1217337578u, 0, FREXP_TOLERANCE, 0}, +{ 519, 3211562377u, 3779303391u, 0u, 4294967288u, 3219950985u, 3779303391u, 0, FREXP_TOLERANCE, 0}, +{ 520, 3210023352u, 3115946280u, 0u, 4294967287u, 3219460536u, 3115946280u, 0, FREXP_TOLERANCE, 0}, +{ 521, 3192989874u, 286247089u, 0u, 4294967271u, 3219204274u, 286247089u, 0, FREXP_TOLERANCE, 0}, +{ 522, 1085153597u, 713645369u, 0u, 12u, 1072570685u, 713645369u, 0, FREXP_TOLERANCE, 0}, +{ 523, 1093670500u, 1468283899u, 0u, 21u, 1071650404u, 1468283899u, 0, FREXP_TOLERANCE, 0}, +{ 524, 1042831668u, 2022736418u, 0u, 4294967268u, 1072191796u, 2022736418u, 0, FREXP_TOLERANCE, 0}, +{ 525, 1083139105u, 3305564080u, 0u, 10u, 1072653345u, 3305564080u, 0, FREXP_TOLERANCE, 0}, +{ 526, 1065483445u, 482392433u, 0u, 4294967290u, 1071774901u, 482392433u, 0, FREXP_TOLERANCE, 0}, +{ 527, 3201695807u, 2256346551u, 0u, 4294967279u, 3219521599u, 2256346551u, 0, FREXP_TOLERANCE, 0}, +{ 528, 3222430705u, 2071674991u, 0u, 3u, 3219284977u, 2071674991u, 0, FREXP_TOLERANCE, 0}, +{ 529, 3204024695u, 2295269094u, 0u, 4294967281u, 3219753335u, 2295269094u, 0, FREXP_TOLERANCE, 0}, +{ 530, 1084451053u, 2773103941u, 0u, 12u, 1071868141u, 2773103941u, 0, FREXP_TOLERANCE, 0}, +{ 531, 1078173946u, 1482721827u, 0u, 6u, 1071882490u, 1482721827u, 0, FREXP_TOLERANCE, 0}, +{ 532, 1092243422u, 3125409590u, 0u, 19u, 1072320478u, 3125409590u, 0, FREXP_TOLERANCE, 0}, +{ 533, 3221065973u, 1381740563u, 0u, 1u, 3220017397u, 1381740563u, 0, FREXP_TOLERANCE, 0}, +{ 534, 1071545057u, 2918235653u, 0u, 4294967295u, 1072593633u, 2918235653u, 0, FREXP_TOLERANCE, 0}, +{ 535, 3238715972u, 1105857967u, 0u, 18u, 3219841604u, 1105857967u, 0, FREXP_TOLERANCE, 0}, +{ 536, 3241990046u, 2703723225u, 0u, 21u, 3219969950u, 2703723225u, 0, FREXP_TOLERANCE, 0}, +{ 537, 1043015571u, 174689677u, 0u, 4294967268u, 1072375699u, 174689677u, 0, FREXP_TOLERANCE, 0}, +{ 538, 1079333374u, 3947057014u, 0u, 7u, 1071993342u, 3947057014u, 0, FREXP_TOLERANCE, 0}, +{ 539, 1090461859u, 2023082423u, 0u, 17u, 1072636067u, 2023082423u, 0, FREXP_TOLERANCE, 0}, +{ 540, 3242081486u, 1169047927u, 0u, 21u, 3220061390u, 1169047927u, 0, FREXP_TOLERANCE, 0}, +{ 541, 1064525899u, 3742487766u, 0u, 4294967289u, 1071865931u, 3742487766u, 0, FREXP_TOLERANCE, 0}, +{ 542, 1043425732u, 194972788u, 0u, 4294967269u, 1071737284u, 194972788u, 0, FREXP_TOLERANCE, 0}, +{ 543, 3213791827u, 2136071361u, 0u, 4294967290u, 3220083283u, 2136071361u, 0, FREXP_TOLERANCE, 0}, +{ 544, 3211529757u, 993675115u, 0u, 4294967288u, 3219918365u, 993675115u, 0, FREXP_TOLERANCE, 0}, +{ 545, 3213663381u, 210772141u, 0u, 4294967290u, 3219954837u, 210772141u, 0, FREXP_TOLERANCE, 0}, +{ 546, 3241441539u, 580731413u, 0u, 21u, 3219421443u, 580731413u, 0, FREXP_TOLERANCE, 0}, +{ 547, 1093840413u, 1751560711u, 0u, 21u, 1071820317u, 1751560711u, 0, FREXP_TOLERANCE, 0}, +{ 548, 1074522705u, 180987057u, 0u, 2u, 1072425553u, 180987057u, 0, FREXP_TOLERANCE, 0}, +{ 549, 1066754591u, 2552236599u, 0u, 4294967291u, 1071997471u, 2552236599u, 0, FREXP_TOLERANCE, 0}, +{ 550, 1088658621u, 2112468655u, 0u, 16u, 1071881405u, 2112468655u, 0, FREXP_TOLERANCE, 0}, +{ 551, 3189290617u, 1578223762u, 0u, 4294967267u, 3219699321u, 1578223762u, 0, FREXP_TOLERANCE, 0}, +{ 552, 3224596567u, 2456166162u, 0u, 5u, 3219353687u, 2456166162u, 0, FREXP_TOLERANCE, 0}, +{ 553, 1058506965u, 2110924310u, 0u, 4294967283u, 1072138453u, 2110924310u, 0, FREXP_TOLERANCE, 0}, +{ 554, 1086207177u, 3161208323u, 0u, 13u, 1072575689u, 3161208323u, 0, FREXP_TOLERANCE, 0}, +{ 555, 3231863394u, 2352173188u, 0u, 12u, 3219280482u, 2352173188u, 0, FREXP_TOLERANCE, 0}, +{ 556, 1079361728u, 4070222179u, 0u, 7u, 1072021696u, 4070222179u, 0, FREXP_TOLERANCE, 0}, +{ 557, 1101012904u, 2481562701u, 0u, 28u, 1071652776u, 2481562701u, 0, FREXP_TOLERANCE, 0}, +{ 558, 1090937016u, 3809489716u, 0u, 18u, 1072062648u, 3809489716u, 0, FREXP_TOLERANCE, 0}, +{ 559, 3197002651u, 330905705u, 0u, 4294967274u, 3220071323u, 330905705u, 0, FREXP_TOLERANCE, 0}, +{ 560, 1086260896u, 90264431u, 0u, 13u, 1072629408u, 90264431u, 0, FREXP_TOLERANCE, 0}, +{ 561, 1040729961u, 4162008079u, 0u, 4294967266u, 1072187241u, 4162008079u, 0, FREXP_TOLERANCE, 0}, +{ 562, 3194387916u, 759522153u, 0u, 4294967272u, 3219553740u, 759522153u, 0, FREXP_TOLERANCE, 0}, +{ 563, 1081015037u, 1839697482u, 0u, 8u, 1072626429u, 1839697482u, 0, FREXP_TOLERANCE, 0}, +{ 564, 3216442625u, 2211508949u, 0u, 4294967293u, 3219588353u, 2211508949u, 0, FREXP_TOLERANCE, 0}, +{ 565, 3249807211u, 3736863454u, 0u, 29u, 3219398507u, 3736863454u, 0, FREXP_TOLERANCE, 0}, +{ 566, 1063475914u, 3150741666u, 0u, 4294967288u, 1071864522u, 3150741666u, 0, FREXP_TOLERANCE, 0}, +{ 567, 1060785883u, 4200269406u, 0u, 4294967285u, 1072320219u, 4200269406u, 0, FREXP_TOLERANCE, 0}, +{ 568, 3236646101u, 1061812176u, 0u, 16u, 3219868885u, 1061812176u, 0, FREXP_TOLERANCE, 0}, +{ 569, 1080217979u, 106027290u, 0u, 8u, 1071829371u, 106027290u, 0, FREXP_TOLERANCE, 0}, +{ 570, 3234978297u, 2245237549u, 0u, 15u, 3219249657u, 2245237549u, 0, FREXP_TOLERANCE, 0}, +{ 571, 3246984334u, 2132131375u, 0u, 26u, 3219721358u, 2132131375u, 0, FREXP_TOLERANCE, 0}, +{ 572, 3250483427u, 3449276437u, 0u, 29u, 3220074723u, 3449276437u, 0, FREXP_TOLERANCE, 0}, +{ 573, 1089388778u, 2334440944u, 0u, 16u, 1072611562u, 2334440944u, 0, FREXP_TOLERANCE, 0}, +{ 574, 1105423490u, 4004336184u, 0u, 32u, 1071869058u, 4004336184u, 0, FREXP_TOLERANCE, 0}, +{ 575, 3218772704u, 4090088208u, 0u, 4294967295u, 3219821280u, 4090088208u, 0, FREXP_TOLERANCE, 0}, +{ 576, 1042030013u, 3898658299u, 0u, 4294967267u, 1072438717u, 3898658299u, 0, FREXP_TOLERANCE, 0}, +{ 577, 3207908064u, 2272831437u, 0u, 4294967285u, 3219442400u, 2272831437u, 0, FREXP_TOLERANCE, 0}, +{ 578, 3253082595u, 2639188641u, 0u, 32u, 3219528163u, 2639188641u, 0, FREXP_TOLERANCE, 0}, +{ 579, 1054766684u, 1856594168u, 0u, 4294967279u, 1072592476u, 1856594168u, 0, FREXP_TOLERANCE, 0}, +{ 580, 3189515294u, 4101853676u, 0u, 4294967267u, 3219923998u, 4101853676u, 0, FREXP_TOLERANCE, 0}, +{ 581, 1076012412u, 2211699255u, 0u, 4u, 1071818108u, 2211699255u, 0, FREXP_TOLERANCE, 0}, +{ 582, 3195060344u, 3865018604u, 0u, 4294967273u, 3219177592u, 3865018604u, 0, FREXP_TOLERANCE, 0}, +{ 583, 3242767010u, 996259334u, 0u, 22u, 3219698338u, 996259334u, 0, FREXP_TOLERANCE, 0}, +{ 584, 3241496889u, 3782673116u, 0u, 21u, 3219476793u, 3782673116u, 0, FREXP_TOLERANCE, 0}, +{ 585, 1099130747u, 3840380763u, 0u, 26u, 1071867771u, 3840380763u, 0, FREXP_TOLERANCE, 0}, +{ 586, 1048674041u, 550040067u, 0u, 4294967274u, 1071742713u, 550040067u, 0, FREXP_TOLERANCE, 0}, +{ 587, 3251419593u, 95874100u, 0u, 30u, 3219962313u, 95874100u, 0, FREXP_TOLERANCE, 0}, +{ 588, 3237232828u, 2645647822u, 0u, 17u, 3219407036u, 2645647822u, 0, FREXP_TOLERANCE, 0}, +{ 589, 1043665640u, 3441419500u, 0u, 4294967269u, 1071977192u, 3441419500u, 0, FREXP_TOLERANCE, 0}, +{ 590, 3252367038u, 876710419u, 0u, 31u, 3219861182u, 876710419u, 0, FREXP_TOLERANCE, 0}, +{ 591, 3238593552u, 2560836004u, 0u, 18u, 3219719184u, 2560836004u, 0, FREXP_TOLERANCE, 0}, +{ 592, 3199616543u, 1180840586u, 0u, 4294967277u, 3219539487u, 1180840586u, 0, FREXP_TOLERANCE, 0}, +{ 593, 3221602966u, 2218230392u, 0u, 2u, 3219505814u, 2218230392u, 0, FREXP_TOLERANCE, 0}, +{ 594, 3227485787u, 3947214579u, 0u, 7u, 3220145755u, 3947214579u, 0, FREXP_TOLERANCE, 0}, +{ 595, 1079539654u, 1447312532u, 0u, 7u, 1072199622u, 1447312532u, 0, FREXP_TOLERANCE, 0}, +{ 596, 1081476588u, 780366847u, 0u, 9u, 1072039404u, 780366847u, 0, FREXP_TOLERANCE, 0}, +{ 597, 1072569643u, 2842113832u, 0u, 0u, 1072569643u, 2842113832u, 0, FREXP_TOLERANCE, 0}, +{ 598, 3216156731u, 225159029u, 0u, 4294967293u, 3219302459u, 225159029u, 0, FREXP_TOLERANCE, 0}, +{ 599, 1098117193u, 1601981129u, 0u, 25u, 1071902793u, 1601981129u, 0, FREXP_TOLERANCE, 0}, +{ 600, 3234628869u, 2236538344u, 0u, 14u, 3219948805u, 2236538344u, 0, FREXP_TOLERANCE, 0}, +{ 601, 1085173524u, 2194185737u, 0u, 12u, 1072590612u, 2194185737u, 0, FREXP_TOLERANCE, 0}, +{ 602, 3242362684u, 87913366u, 0u, 22u, 3219294012u, 87913366u, 0, FREXP_TOLERANCE, 0}, +{ 603, 3199083880u, 1346862963u, 0u, 4294967276u, 3220055400u, 1346862963u, 0, FREXP_TOLERANCE, 0}, +{ 604, 1077836259u, 3604666660u, 0u, 5u, 1072593379u, 3604666660u, 0, FREXP_TOLERANCE, 0}, +{ 605, 3212255979u, 3115209742u, 0u, 4294967289u, 3219596011u, 3115209742u, 0, FREXP_TOLERANCE, 0}, +{ 606, 1099332326u, 1325101950u, 0u, 26u, 1072069350u, 1325101950u, 0, FREXP_TOLERANCE, 0}, +{ 607, 3224546042u, 3889223100u, 0u, 5u, 3219303162u, 3889223100u, 0, FREXP_TOLERANCE, 0}, +{ 608, 1053247613u, 3371396923u, 0u, 4294967278u, 1072121981u, 3371396923u, 0, FREXP_TOLERANCE, 0}, +{ 609, 3220477868u, 4163120793u, 0u, 1u, 3219429292u, 4163120793u, 0, FREXP_TOLERANCE, 0}, +{ 610, 1075022670u, 1387631215u, 0u, 3u, 1071876942u, 1387631215u, 0, FREXP_TOLERANCE, 0}, +{ 611, 3205481779u, 1532426189u, 0u, 4294967282u, 3220161843u, 1532426189u, 0, FREXP_TOLERANCE, 0}, +{ 612, 1063168268u, 3397022615u, 0u, 4294967287u, 1072605452u, 3397022615u, 0, FREXP_TOLERANCE, 0}, +{ 613, 3201033321u, 89324166u, 0u, 4294967278u, 3219907689u, 89324166u, 0, FREXP_TOLERANCE, 0}, +{ 614, 1079206060u, 3429424710u, 0u, 7u, 1071866028u, 3429424710u, 0, FREXP_TOLERANCE, 0}, +{ 615, 3192325102u, 747591401u, 0u, 4294967270u, 3219588078u, 747591401u, 0, FREXP_TOLERANCE, 0}, +{ 616, 1072238381u, 2803213904u, 0u, 0u, 1072238381u, 2803213904u, 0, FREXP_TOLERANCE, 0}, +{ 617, 1091113780u, 271904221u, 0u, 18u, 1072239412u, 271904221u, 0, FREXP_TOLERANCE, 0}, +{ 618, 1044258318u, 1858545114u, 0u, 4294967269u, 1072569870u, 1858545114u, 0, FREXP_TOLERANCE, 0}, +{ 619, 3228068914u, 314958082u, 0u, 8u, 3219680306u, 314958082u, 0, FREXP_TOLERANCE, 0}, +{ 620, 3249912496u, 2966213175u, 0u, 29u, 3219503792u, 2966213175u, 0, FREXP_TOLERANCE, 0}, +{ 621, 3197179414u, 3119528953u, 0u, 4294967275u, 3219199510u, 3119528953u, 0, FREXP_TOLERANCE, 0}, +{ 622, 3217179014u, 2908718240u, 0u, 4294967294u, 3219276166u, 2908718240u, 0, FREXP_TOLERANCE, 0}, +{ 623, 3242467576u, 2018361566u, 0u, 22u, 3219398904u, 2018361566u, 0, FREXP_TOLERANCE, 0}, +{ 624, 1100926600u, 3985805054u, 0u, 27u, 1072615048u, 3985805054u, 0, FREXP_TOLERANCE, 0}, +{ 625, 1070132580u, 409584884u, 0u, 4294967294u, 1072229732u, 409584884u, 0, FREXP_TOLERANCE, 0}, +{ 626, 3239758947u, 755795129u, 0u, 19u, 3219836003u, 755795129u, 0, FREXP_TOLERANCE, 0}, +{ 627, 1075772446u, 1819156379u, 0u, 3u, 1072626718u, 1819156379u, 0, FREXP_TOLERANCE, 0}, +{ 628, 3251342302u, 2982669005u, 0u, 30u, 3219885022u, 2982669005u, 0, FREXP_TOLERANCE, 0}, +{ 629, 1101563433u, 2080534280u, 0u, 28u, 1072203305u, 2080534280u, 0, FREXP_TOLERANCE, 0}, +{ 630, 3188254060u, 449171797u, 0u, 4294967266u, 3219711340u, 449171797u, 0, FREXP_TOLERANCE, 0}, +{ 631, 1095956900u, 168744837u, 0u, 23u, 1071839652u, 168744837u, 0, FREXP_TOLERANCE, 0}, +{ 632, 3214950009u, 1322217822u, 0u, 4294967292u, 3219144313u, 1322217822u, 0, FREXP_TOLERANCE, 0}, +{ 633, 3254226900u, 3250487255u, 0u, 33u, 3219623892u, 3250487255u, 0, FREXP_TOLERANCE, 0}, +{ 634, 1062120700u, 1876195180u, 0u, 4294967286u, 1072606460u, 1876195180u, 0, FREXP_TOLERANCE, 0}, +{ 635, 3226343480u, 1336400247u, 0u, 6u, 3220052024u, 1336400247u, 0, FREXP_TOLERANCE, 0}, +{ 636, 1098057903u, 3314079581u, 0u, 25u, 1071843503u, 3314079581u, 0, FREXP_TOLERANCE, 0}, +{ 637, 3203678820u, 265025555u, 0u, 4294967281u, 3219407460u, 265025555u, 0, FREXP_TOLERANCE, 0}, +{ 638, 1063854282u, 3779482256u, 0u, 4294967288u, 1072242890u, 3779482256u, 0, FREXP_TOLERANCE, 0}, +{ 639, 1067300501u, 887044257u, 0u, 4294967291u, 1072543381u, 887044257u, 0, FREXP_TOLERANCE, 0}, +{ 640, 1054789618u, 2732056261u, 0u, 4294967279u, 1072615410u, 2732056261u, 0, FREXP_TOLERANCE, 0}, +{ 641, 1050106742u, 4027115185u, 0u, 4294967275u, 1072126838u, 4027115185u, 0, FREXP_TOLERANCE, 0}, +{ 642, 3191764868u, 2940199511u, 0u, 4294967269u, 3220076420u, 2940199511u, 0, FREXP_TOLERANCE, 0}, +{ 643, 3202500155u, 2875684421u, 0u, 4294967280u, 3219277371u, 2875684421u, 0, FREXP_TOLERANCE, 0}, +{ 644, 3227459837u, 2251967570u, 0u, 7u, 3220119805u, 2251967570u, 0, FREXP_TOLERANCE, 0}, +{ 645, 1063244412u, 284173546u, 0u, 4294967287u, 1072681596u, 284173546u, 0, FREXP_TOLERANCE, 0}, +{ 646, 3238823679u, 3557800647u, 0u, 18u, 3219949311u, 3557800647u, 0, FREXP_TOLERANCE, 0}, +{ 647, 1101458560u, 3147771266u, 0u, 28u, 1072098432u, 3147771266u, 0, FREXP_TOLERANCE, 0}, +{ 648, 3220110464u, 2933364246u, 0u, 0u, 3220110464u, 2933364246u, 0, FREXP_TOLERANCE, 0}, +{ 649, 1064853160u, 3366183281u, 0u, 4294967289u, 1072193192u, 3366183281u, 0, FREXP_TOLERANCE, 0}, +{ 650, 3234870843u, 537442654u, 0u, 15u, 3219142203u, 537442654u, 0, FREXP_TOLERANCE, 0}, +{ 651, 3244118788u, 2529029548u, 0u, 23u, 3220001540u, 2529029548u, 0, FREXP_TOLERANCE, 0}, +{ 652, 3249882819u, 3781513577u, 0u, 29u, 3219474115u, 3781513577u, 0, FREXP_TOLERANCE, 0}, +{ 653, 3213436354u, 1080845539u, 0u, 4294967290u, 3219727810u, 1080845539u, 0, FREXP_TOLERANCE, 0}, +{ 654, 3206760016u, 911778687u, 0u, 4294967284u, 3219342928u, 911778687u, 0, FREXP_TOLERANCE, 0}, +{ 655, 3191951036u, 469586759u, 0u, 4294967270u, 3219214012u, 469586759u, 0, FREXP_TOLERANCE, 0}, +{ 656, 1091830022u, 3080528840u, 0u, 19u, 1071907078u, 3080528840u, 0, FREXP_TOLERANCE, 0}, +{ 657, 1080249104u, 2863108169u, 0u, 8u, 1071860496u, 2863108169u, 0, FREXP_TOLERANCE, 0}, +{ 658, 3225605506u, 2508274250u, 0u, 6u, 3219314050u, 2508274250u, 0, FREXP_TOLERANCE, 0}, +{ 659, 3210826984u, 4080017377u, 0u, 4294967288u, 3219215592u, 4080017377u, 0, FREXP_TOLERANCE, 0}, +{ 660, 3206492941u, 1470284690u, 0u, 4294967283u, 3220124429u, 1470284690u, 0, FREXP_TOLERANCE, 0}, +{ 661, 3207120390u, 3867917386u, 0u, 4294967284u, 3219703302u, 3867917386u, 0, FREXP_TOLERANCE, 0}, +{ 662, 1102054928u, 3504746045u, 0u, 29u, 1071646224u, 3504746045u, 0, FREXP_TOLERANCE, 0}, +{ 663, 1064522279u, 2962134101u, 0u, 4294967289u, 1071862311u, 2962134101u, 0, FREXP_TOLERANCE, 0}, +{ 664, 3244741577u, 3390537350u, 0u, 24u, 3219575753u, 3390537350u, 0, FREXP_TOLERANCE, 0}, +{ 665, 1088201813u, 1702237980u, 0u, 15u, 1072473173u, 1702237980u, 0, FREXP_TOLERANCE, 0}, +{ 666, 1071598971u, 1102587474u, 0u, 4294967295u, 1072647547u, 1102587474u, 0, FREXP_TOLERANCE, 0}, +{ 667, 3202970118u, 2180218657u, 0u, 4294967280u, 3219747334u, 2180218657u, 0, FREXP_TOLERANCE, 0}, +{ 668, 3211592260u, 1206527853u, 0u, 4294967288u, 3219980868u, 1206527853u, 0, FREXP_TOLERANCE, 0}, +{ 669, 3197084744u, 394130786u, 0u, 4294967274u, 3220153416u, 394130786u, 0, FREXP_TOLERANCE, 0}, +{ 670, 3242511482u, 2437699868u, 0u, 22u, 3219442810u, 2437699868u, 0, FREXP_TOLERANCE, 0}, +{ 671, 1044237059u, 849581558u, 0u, 4294967269u, 1072548611u, 849581558u, 0, FREXP_TOLERANCE, 0}, +{ 672, 3252006507u, 2008614943u, 0u, 31u, 3219500651u, 2008614943u, 0, FREXP_TOLERANCE, 0}, +{ 673, 3210140014u, 3128971673u, 0u, 4294967287u, 3219577198u, 3128971673u, 0, FREXP_TOLERANCE, 0}, +{ 674, 3249137531u, 2773583059u, 0u, 28u, 3219777403u, 2773583059u, 0, FREXP_TOLERANCE, 0}, +{ 675, 1085029866u, 590727700u, 0u, 12u, 1072446954u, 590727700u, 0, FREXP_TOLERANCE, 0}, +{ 676, 3248651761u, 2183878539u, 0u, 28u, 3219291633u, 2183878539u, 0, FREXP_TOLERANCE, 0}, +{ 677, 1101098629u, 820687580u, 0u, 28u, 1071738501u, 820687580u, 0, FREXP_TOLERANCE, 0}, +{ 678, 3208143496u, 1402434664u, 0u, 4294967285u, 3219677832u, 1402434664u, 0, FREXP_TOLERANCE, 0}, +{ 679, 3252290835u, 1873709254u, 0u, 31u, 3219784979u, 1873709254u, 0, FREXP_TOLERANCE, 0}, +{ 680, 3245167989u, 44275991u, 0u, 24u, 3220002165u, 44275991u, 0, FREXP_TOLERANCE, 0}, +{ 681, 3189668753u, 1174874204u, 0u, 4294967267u, 3220077457u, 1174874204u, 0, FREXP_TOLERANCE, 0}, +{ 682, 3208263730u, 2360372288u, 0u, 4294967285u, 3219798066u, 2360372288u, 0, FREXP_TOLERANCE, 0}, +{ 683, 1103854676u, 937573440u, 0u, 30u, 1072397396u, 937573440u, 0, FREXP_TOLERANCE, 0}, +{ 684, 3208953761u, 211240241u, 0u, 4294967286u, 3219439521u, 211240241u, 0, FREXP_TOLERANCE, 0}, +{ 685, 3243548934u, 2469774991u, 0u, 23u, 3219431686u, 2469774991u, 0, FREXP_TOLERANCE, 0}, +{ 686, 1043117070u, 3380071805u, 0u, 4294967268u, 1072477198u, 3380071805u, 0, FREXP_TOLERANCE, 0}, +{ 687, 1058121042u, 442507560u, 0u, 4294967283u, 1071752530u, 442507560u, 0, FREXP_TOLERANCE, 0}, +{ 688, 3254252803u, 3257889649u, 0u, 33u, 3219649795u, 3257889649u, 0, FREXP_TOLERANCE, 0}, +{ 689, 1068850520u, 1854921625u, 0u, 4294967293u, 1071996248u, 1854921625u, 0, FREXP_TOLERANCE, 0}, +{ 690, 1049810168u, 2729627545u, 0u, 4294967275u, 1071830264u, 2729627545u, 0, FREXP_TOLERANCE, 0}, +{ 691, 3254712629u, 4001809575u, 0u, 33u, 3220109621u, 4001809575u, 0, FREXP_TOLERANCE, 0}, +{ 692, 3240128649u, 278261523u, 0u, 20u, 3219157129u, 278261523u, 0, FREXP_TOLERANCE, 0}, +{ 693, 1087224694u, 1793907966u, 0u, 14u, 1072544630u, 1793907966u, 0, FREXP_TOLERANCE, 0}, +{ 694, 3238955714u, 398859249u, 0u, 18u, 3220081346u, 398859249u, 0, FREXP_TOLERANCE, 0}, +{ 695, 3200952547u, 2511916952u, 0u, 4294967278u, 3219826915u, 2511916952u, 0, FREXP_TOLERANCE, 0}, +{ 696, 3219195283u, 1697158299u, 0u, 0u, 3219195283u, 1697158299u, 0, FREXP_TOLERANCE, 0}, +{ 697, 1069985548u, 3230931724u, 0u, 4294967294u, 1072082700u, 3230931724u, 0, FREXP_TOLERANCE, 0}, +{ 698, 3243897690u, 3508781585u, 0u, 23u, 3219780442u, 3508781585u, 0, FREXP_TOLERANCE, 0}, +{ 699, 1103847606u, 1674254897u, 0u, 30u, 1072390326u, 1674254897u, 0, FREXP_TOLERANCE, 0}, +{ 700, 1046547577u, 217148561u, 0u, 4294967272u, 1071713401u, 217148561u, 0, FREXP_TOLERANCE, 0}, +{ 701, 3211263954u, 3275604304u, 0u, 4294967288u, 3219652562u, 3275604304u, 0, FREXP_TOLERANCE, 0}, +{ 702, 3194840159u, 2991205850u, 0u, 4294967272u, 3220005983u, 2991205850u, 0, FREXP_TOLERANCE, 0}, +{ 703, 3195249375u, 3509997278u, 0u, 4294967273u, 3219366623u, 3509997278u, 0, FREXP_TOLERANCE, 0}, +{ 704, 3248888030u, 3897986511u, 0u, 28u, 3219527902u, 3897986511u, 0, FREXP_TOLERANCE, 0}, +{ 705, 1047182435u, 2156824613u, 0u, 4294967272u, 1072348259u, 2156824613u, 0, FREXP_TOLERANCE, 0}, +{ 706, 1042295665u, 1239257646u, 0u, 4294967268u, 1071655793u, 1239257646u, 0, FREXP_TOLERANCE, 0}, +{ 707, 3213264085u, 1073153314u, 0u, 4294967290u, 3219555541u, 1073153314u, 0, FREXP_TOLERANCE, 0}, +{ 708, 3250031627u, 2567234990u, 0u, 29u, 3219622923u, 2567234990u, 0, FREXP_TOLERANCE, 0}, +{ 709, 3190593412u, 4261696995u, 0u, 4294967268u, 3219953540u, 4261696995u, 0, FREXP_TOLERANCE, 0}, +{ 710, 3197784432u, 323702024u, 0u, 4294967275u, 3219804528u, 323702024u, 0, FREXP_TOLERANCE, 0}, +{ 711, 3243690997u, 4075177615u, 0u, 23u, 3219573749u, 4075177615u, 0, FREXP_TOLERANCE, 0}, +{ 712, 3202791065u, 1919006082u, 0u, 4294967280u, 3219568281u, 1919006082u, 0, FREXP_TOLERANCE, 0}, +{ 713, 3239270013u, 386429966u, 0u, 19u, 3219347069u, 386429966u, 0, FREXP_TOLERANCE, 0}, +{ 714, 1086504491u, 3698826164u, 0u, 14u, 1071824427u, 3698826164u, 0, FREXP_TOLERANCE, 0}, +{ 715, 1078327190u, 1681986446u, 0u, 6u, 1072035734u, 1681986446u, 0, FREXP_TOLERANCE, 0}, +{ 716, 3194985869u, 3072950140u, 0u, 4294967272u, 3220151693u, 3072950140u, 0, FREXP_TOLERANCE, 0}, +{ 717, 3217311933u, 3719038997u, 0u, 4294967294u, 3219409085u, 3719038997u, 0, FREXP_TOLERANCE, 0}, +{ 718, 1055433962u, 3331415058u, 0u, 4294967280u, 1072211178u, 3331415058u, 0, FREXP_TOLERANCE, 0}, +{ 719, 1060749713u, 2420250111u, 0u, 4294967285u, 1072284049u, 2420250111u, 0, FREXP_TOLERANCE, 0}, +{ 720, 3238002206u, 1928661079u, 0u, 17u, 3220176414u, 1928661079u, 0, FREXP_TOLERANCE, 0}, +{ 721, 1081914210u, 3679866727u, 0u, 9u, 1072477026u, 3679866727u, 0, FREXP_TOLERANCE, 0}, +{ 722, 3227386672u, 1273835792u, 0u, 7u, 3220046640u, 1273835792u, 0, FREXP_TOLERANCE, 0}, +{ 723, 1041622738u, 2682092368u, 0u, 4294967267u, 1072031442u, 2682092368u, 0, FREXP_TOLERANCE, 0}, +{ 724, 3234222284u, 1325425811u, 0u, 14u, 3219542220u, 1325425811u, 0, FREXP_TOLERANCE, 0}, +{ 725, 1056312613u, 4175172697u, 0u, 4294967281u, 1072041253u, 4175172697u, 0, FREXP_TOLERANCE, 0}, +{ 726, 3208346191u, 2130706153u, 0u, 4294967285u, 3219880527u, 2130706153u, 0, FREXP_TOLERANCE, 0}, +{ 727, 1092089624u, 1200784450u, 0u, 19u, 1072166680u, 1200784450u, 0, FREXP_TOLERANCE, 0}, +{ 728, 1083605096u, 1248595607u, 0u, 11u, 1072070760u, 1248595607u, 0, FREXP_TOLERANCE, 0}, +{ 729, 3213890863u, 1897285171u, 0u, 4294967291u, 3219133743u, 1897285171u, 0, FREXP_TOLERANCE, 0}, +{ 730, 3251296075u, 944966123u, 0u, 30u, 3219838795u, 944966123u, 0, FREXP_TOLERANCE, 0}, +{ 731, 3241371250u, 2270747330u, 0u, 21u, 3219351154u, 2270747330u, 0, FREXP_TOLERANCE, 0}, +{ 732, 3230692631u, 422503284u, 0u, 11u, 3219158295u, 422503284u, 0, FREXP_TOLERANCE, 0}, +{ 733, 1084120037u, 2857564741u, 0u, 11u, 1072585701u, 2857564741u, 0, FREXP_TOLERANCE, 0}, +{ 734, 1075647403u, 3308906709u, 0u, 3u, 1072501675u, 3308906709u, 0, FREXP_TOLERANCE, 0}, +{ 735, 3203475098u, 1380066948u, 0u, 4294967281u, 3219203738u, 1380066948u, 0, FREXP_TOLERANCE, 0}, +{ 736, 3232612906u, 2613634294u, 0u, 12u, 3220029994u, 2613634294u, 0, FREXP_TOLERANCE, 0}, +{ 737, 1063890856u, 4022784584u, 0u, 4294967288u, 1072279464u, 4022784584u, 0, FREXP_TOLERANCE, 0}, +{ 738, 1060483857u, 3264056381u, 0u, 4294967285u, 1072018193u, 3264056381u, 0, FREXP_TOLERANCE, 0}, +{ 739, 1044637404u, 1778509100u, 0u, 4294967270u, 1071900380u, 1778509100u, 0, FREXP_TOLERANCE, 0}, +{ 740, 3213146285u, 2665833973u, 0u, 4294967290u, 3219437741u, 2665833973u, 0, FREXP_TOLERANCE, 0}, +{ 741, 3216727300u, 1859175955u, 0u, 4294967293u, 3219873028u, 1859175955u, 0, FREXP_TOLERANCE, 0}, +{ 742, 1079949560u, 4258450607u, 0u, 7u, 1072609528u, 4258450607u, 0, FREXP_TOLERANCE, 0}, +{ 743, 1048277388u, 4128020197u, 0u, 4294967273u, 1072394636u, 4128020197u, 0, FREXP_TOLERANCE, 0}, +{ 744, 1076266146u, 4122840980u, 0u, 4u, 1072071842u, 4122840980u, 0, FREXP_TOLERANCE, 0}, +{ 745, 3193183163u, 2454653987u, 0u, 4294967271u, 3219397563u, 2454653987u, 0, FREXP_TOLERANCE, 0}, +{ 746, 3229487005u, 2977478685u, 0u, 9u, 3220049821u, 2977478685u, 0, FREXP_TOLERANCE, 0}, +{ 747, 3253556483u, 1355181872u, 0u, 32u, 3220002051u, 1355181872u, 0, FREXP_TOLERANCE, 0}, +{ 748, 1095308770u, 436846481u, 0u, 22u, 1072240098u, 436846481u, 0, FREXP_TOLERANCE, 0}, +{ 749, 3246605302u, 2592856453u, 0u, 26u, 3219342326u, 2592856453u, 0, FREXP_TOLERANCE, 0}, +{ 750, 3247825559u, 3195234082u, 0u, 27u, 3219514007u, 3195234082u, 0, FREXP_TOLERANCE, 0}, +{ 751, 3222118023u, 3554670043u, 0u, 2u, 3220020871u, 3554670043u, 0, FREXP_TOLERANCE, 0}, +{ 752, 1091621009u, 3321236467u, 0u, 19u, 1071698065u, 3321236467u, 0, FREXP_TOLERANCE, 0}, +{ 753, 1069012833u, 1936670355u, 0u, 4294967293u, 1072158561u, 1936670355u, 0, FREXP_TOLERANCE, 0}, +{ 754, 1095715713u, 2958468553u, 0u, 22u, 1072647041u, 2958468553u, 0, FREXP_TOLERANCE, 0}, +{ 755, 3192291109u, 2960339502u, 0u, 4294967270u, 3219554085u, 2960339502u, 0, FREXP_TOLERANCE, 0}, +{ 756, 1098808013u, 1044068983u, 0u, 25u, 1072593613u, 1044068983u, 0, FREXP_TOLERANCE, 0}, +{ 757, 3196691185u, 4093388677u, 0u, 4294967274u, 3219759857u, 4093388677u, 0, FREXP_TOLERANCE, 0}, +{ 758, 1095478112u, 1735930261u, 0u, 22u, 1072409440u, 1735930261u, 0, FREXP_TOLERANCE, 0}, +{ 759, 1091040302u, 1807398746u, 0u, 18u, 1072165934u, 1807398746u, 0, FREXP_TOLERANCE, 0}, +{ 760, 3195743135u, 4261616162u, 0u, 4294967273u, 3219860383u, 4261616162u, 0, FREXP_TOLERANCE, 0}, +{ 761, 3209294194u, 3250576797u, 0u, 4294967286u, 3219779954u, 3250576797u, 0, FREXP_TOLERANCE, 0}, +{ 762, 1059002384u, 3043079652u, 0u, 4294967283u, 1072633872u, 3043079652u, 0, FREXP_TOLERANCE, 0}, +{ 763, 1069207109u, 666051428u, 0u, 4294967293u, 1072352837u, 666051428u, 0, FREXP_TOLERANCE, 0}, +{ 764, 3208765404u, 1912684117u, 0u, 4294967286u, 3219251164u, 1912684117u, 0, FREXP_TOLERANCE, 0}, +{ 765, 1103487420u, 1949030179u, 0u, 30u, 1072030140u, 1949030179u, 0, FREXP_TOLERANCE, 0}, +{ 766, 1096388934u, 896459246u, 0u, 23u, 1072271686u, 896459246u, 0, FREXP_TOLERANCE, 0}, +{ 767, 1054300653u, 622499767u, 0u, 4294967279u, 1072126445u, 622499767u, 0, FREXP_TOLERANCE, 0}, +{ 768, 1066707637u, 1490260486u, 0u, 4294967291u, 1071950517u, 1490260486u, 0, FREXP_TOLERANCE, 0}, +{ 769, 1106688493u, 1490616165u, 0u, 33u, 1072085485u, 1490616165u, 0, FREXP_TOLERANCE, 0}, +{ 770, 3251242436u, 795675736u, 0u, 30u, 3219785156u, 795675736u, 0, FREXP_TOLERANCE, 0}, +{ 771, 1080943896u, 3662877092u, 0u, 8u, 1072555288u, 3662877092u, 0, FREXP_TOLERANCE, 0}, +{ 772, 3234317146u, 3200513112u, 0u, 14u, 3219637082u, 3200513112u, 0, FREXP_TOLERANCE, 0}, +{ 773, 1084088786u, 1356101968u, 0u, 11u, 1072554450u, 1356101968u, 0, FREXP_TOLERANCE, 0}, +{ 774, 3236536816u, 3062844611u, 0u, 16u, 3219759600u, 3062844611u, 0, FREXP_TOLERANCE, 0}, +{ 775, 3219922640u, 2284484846u, 0u, 0u, 3219922640u, 2284484846u, 0, FREXP_TOLERANCE, 0}, +{ 776, 3219498359u, 3240896015u, 0u, 0u, 3219498359u, 3240896015u, 0, FREXP_TOLERANCE, 0}, +{ 777, 3235759689u, 494503287u, 0u, 15u, 3220031049u, 494503287u, 0, FREXP_TOLERANCE, 0}, +{ 778, 1092811254u, 142673998u, 0u, 20u, 1071839734u, 142673998u, 0, FREXP_TOLERANCE, 0}, +{ 779, 3252125916u, 3394882641u, 0u, 31u, 3219620060u, 3394882641u, 0, FREXP_TOLERANCE, 0}, +{ 780, 3225306538u, 364852125u, 0u, 5u, 3220063658u, 364852125u, 0, FREXP_TOLERANCE, 0}, +{ 781, 3225261763u, 193885269u, 0u, 5u, 3220018883u, 193885269u, 0, FREXP_TOLERANCE, 0}, +{ 782, 1088149839u, 1359805831u, 0u, 15u, 1072421199u, 1359805831u, 0, FREXP_TOLERANCE, 0}, +{ 783, 3200484782u, 592580907u, 0u, 4294967278u, 3219359150u, 592580907u, 0, FREXP_TOLERANCE, 0}, +{ 784, 3199560872u, 3086438952u, 0u, 4294967277u, 3219483816u, 3086438952u, 0, FREXP_TOLERANCE, 0}, +{ 785, 1059518664u, 1778008540u, 0u, 4294967284u, 1072101576u, 1778008540u, 0, FREXP_TOLERANCE, 0}, +{ 786, 1049064687u, 73581647u, 0u, 4294967274u, 1072133359u, 73581647u, 0, FREXP_TOLERANCE, 0}, +{ 787, 3246733598u, 233240285u, 0u, 26u, 3219470622u, 233240285u, 0, FREXP_TOLERANCE, 0}, +{ 788, 1081923320u, 2710903921u, 0u, 9u, 1072486136u, 2710903921u, 0, FREXP_TOLERANCE, 0}, +{ 789, 1069513767u, 3719878805u, 0u, 4294967293u, 1072659495u, 3719878805u, 0, FREXP_TOLERANCE, 0}, +{ 790, 1079866720u, 3615458228u, 0u, 7u, 1072526688u, 3615458228u, 0, FREXP_TOLERANCE, 0}, +{ 791, 3221194724u, 3647632375u, 0u, 1u, 3220146148u, 3647632375u, 0, FREXP_TOLERANCE, 0}, +{ 792, 3247225271u, 3839959621u, 0u, 26u, 3219962295u, 3839959621u, 0, FREXP_TOLERANCE, 0}, +{ 793, 1103401096u, 2232210456u, 0u, 30u, 1071943816u, 2232210456u, 0, FREXP_TOLERANCE, 0}, +{ 794, 3235434773u, 224271737u, 0u, 15u, 3219706133u, 224271737u, 0, FREXP_TOLERANCE, 0}, +{ 795, 3193003684u, 2134662911u, 0u, 4294967271u, 3219218084u, 2134662911u, 0, FREXP_TOLERANCE, 0}, +{ 796, 3190390590u, 4239009051u, 0u, 4294967268u, 3219750718u, 4239009051u, 0, FREXP_TOLERANCE, 0}, +{ 797, 1080526145u, 2305279897u, 0u, 8u, 1072137537u, 2305279897u, 0, FREXP_TOLERANCE, 0}, +{ 798, 1077668039u, 1854523320u, 0u, 5u, 1072425159u, 1854523320u, 0, FREXP_TOLERANCE, 0}, +{ 799, 3219864259u, 538224650u, 0u, 0u, 3219864259u, 538224650u, 0, FREXP_TOLERANCE, 0}, +{ 800, 3206153057u, 1379649610u, 0u, 4294967283u, 3219784545u, 1379649610u, 0, FREXP_TOLERANCE, 0}, +{ 801, 3196410507u, 3683897920u, 0u, 4294967274u, 3219479179u, 3683897920u, 0, FREXP_TOLERANCE, 0}, +{ 802, 3244167599u, 3647579469u, 0u, 23u, 3220050351u, 3647579469u, 0, FREXP_TOLERANCE, 0}, +{ 803, 1090280933u, 2694093608u, 0u, 17u, 1072455141u, 2694093608u, 0, FREXP_TOLERANCE, 0}, +{ 804, 1042775347u, 598406111u, 0u, 4294967268u, 1072135475u, 598406111u, 0, FREXP_TOLERANCE, 0}, +{ 805, 3211635392u, 872706833u, 0u, 4294967288u, 3220024000u, 872706833u, 0, FREXP_TOLERANCE, 0}, +{ 806, 1084802480u, 2200602798u, 0u, 12u, 1072219568u, 2200602798u, 0, FREXP_TOLERANCE, 0}, +{ 807, 1042339597u, 904146293u, 0u, 4294967268u, 1071699725u, 904146293u, 0, FREXP_TOLERANCE, 0}, +{ 808, 1060867322u, 1729685598u, 0u, 4294967285u, 1072401658u, 1729685598u, 0, FREXP_TOLERANCE, 0}, +{ 809, 3195694970u, 1894173462u, 0u, 4294967273u, 3219812218u, 1894173462u, 0, FREXP_TOLERANCE, 0}, +{ 810, 3232800651u, 191960416u, 0u, 13u, 3219169163u, 191960416u, 0, FREXP_TOLERANCE, 0}, +{ 811, 1091225343u, 3521028551u, 0u, 18u, 1072350975u, 3521028551u, 0, FREXP_TOLERANCE, 0}, +{ 812, 1054522089u, 3287274359u, 0u, 4294967279u, 1072347881u, 3287274359u, 0, FREXP_TOLERANCE, 0}, +{ 813, 1095386964u, 959640601u, 0u, 22u, 1072318292u, 959640601u, 0, FREXP_TOLERANCE, 0}, +{ 814, 3201578263u, 4136915018u, 0u, 4294967279u, 3219404055u, 4136915018u, 0, FREXP_TOLERANCE, 0}, +{ 815, 1064005451u, 1553716379u, 0u, 4294967288u, 1072394059u, 1553716379u, 0, FREXP_TOLERANCE, 0}, +{ 816, 1106027987u, 984725765u, 0u, 32u, 1072473555u, 984725765u, 0, FREXP_TOLERANCE, 0}, +{ 817, 3238832641u, 2287646644u, 0u, 18u, 3219958273u, 2287646644u, 0, FREXP_TOLERANCE, 0}, +{ 818, 3240329321u, 2276183378u, 0u, 20u, 3219357801u, 2276183378u, 0, FREXP_TOLERANCE, 0}, +{ 819, 1068209174u, 3940225170u, 0u, 4294967292u, 1072403478u, 3940225170u, 0, FREXP_TOLERANCE, 0}, +{ 820, 3199544434u, 997572161u, 0u, 4294967277u, 3219467378u, 997572161u, 0, FREXP_TOLERANCE, 0}, +{ 821, 3212768361u, 36116288u, 0u, 4294967289u, 3220108393u, 36116288u, 0, FREXP_TOLERANCE, 0}, +{ 822, 3206886566u, 4196602670u, 0u, 4294967284u, 3219469478u, 4196602670u, 0, FREXP_TOLERANCE, 0}, +{ 823, 3241695853u, 3550227562u, 0u, 21u, 3219675757u, 3550227562u, 0, FREXP_TOLERANCE, 0}, +{ 824, 3207257983u, 2747744117u, 0u, 4294967284u, 3219840895u, 2747744117u, 0, FREXP_TOLERANCE, 0}, +{ 825, 1104236126u, 507130047u, 0u, 31u, 1071730270u, 507130047u, 0, FREXP_TOLERANCE, 0}, +{ 826, 1048359321u, 3229888373u, 0u, 4294967273u, 1072476569u, 3229888373u, 0, FREXP_TOLERANCE, 0}, +{ 827, 3222996778u, 2210969014u, 0u, 3u, 3219851050u, 2210969014u, 0, FREXP_TOLERANCE, 0}, +{ 828, 1081031001u, 1946786091u, 0u, 8u, 1072642393u, 1946786091u, 0, FREXP_TOLERANCE, 0}, +{ 829, 3236306990u, 4059150589u, 0u, 16u, 3219529774u, 4059150589u, 0, FREXP_TOLERANCE, 0}, +{ 830, 3189759234u, 1177045799u, 0u, 4294967267u, 3220167938u, 1177045799u, 0, FREXP_TOLERANCE, 0}, +{ 831, 1093103612u, 2664812822u, 0u, 20u, 1072132092u, 2664812822u, 0, FREXP_TOLERANCE, 0}, +{ 832, 1050343198u, 2034180320u, 0u, 4294967275u, 1072363294u, 2034180320u, 0, FREXP_TOLERANCE, 0}, +{ 833, 3213779117u, 1175750283u, 0u, 4294967290u, 3220070573u, 1175750283u, 0, FREXP_TOLERANCE, 0}, +{ 834, 3235559706u, 1424491340u, 0u, 15u, 3219831066u, 1424491340u, 0, FREXP_TOLERANCE, 0}, +{ 835, 3213904193u, 1630036121u, 0u, 4294967291u, 3219147073u, 1630036121u, 0, FREXP_TOLERANCE, 0}, +{ 836, 3231972785u, 3195479448u, 0u, 12u, 3219389873u, 3195479448u, 0, FREXP_TOLERANCE, 0}, +{ 837, 1090429875u, 2527029044u, 0u, 17u, 1072604083u, 2527029044u, 0, FREXP_TOLERANCE, 0}, +{ 838, 1046927050u, 4000723255u, 0u, 4294967272u, 1072092874u, 4000723255u, 0, FREXP_TOLERANCE, 0}, +{ 839, 1085208677u, 3335703647u, 0u, 12u, 1072625765u, 3335703647u, 0, FREXP_TOLERANCE, 0}, +{ 840, 3237349676u, 3869440059u, 0u, 17u, 3219523884u, 3869440059u, 0, FREXP_TOLERANCE, 0}, +{ 841, 1091433848u, 3888398377u, 0u, 18u, 1072559480u, 3888398377u, 0, FREXP_TOLERANCE, 0}, +{ 842, 3196041693u, 1290567220u, 0u, 4294967273u, 3220158941u, 1290567220u, 0, FREXP_TOLERANCE, 0}, +{ 843, 1066679070u, 3242451480u, 0u, 4294967291u, 1071921950u, 3242451480u, 0, FREXP_TOLERANCE, 0}, +{ 844, 3248384948u, 707431021u, 0u, 27u, 3220073396u, 707431021u, 0, FREXP_TOLERANCE, 0}, +{ 845, 1083230509u, 2739665123u, 0u, 11u, 1071696173u, 2739665123u, 0, FREXP_TOLERANCE, 0}, +{ 846, 1060777905u, 1733073225u, 0u, 4294967285u, 1072312241u, 1733073225u, 0, FREXP_TOLERANCE, 0}, +{ 847, 1078517061u, 1297274853u, 0u, 6u, 1072225605u, 1297274853u, 0, FREXP_TOLERANCE, 0}, +{ 848, 3208848704u, 3341639139u, 0u, 4294967286u, 3219334464u, 3341639139u, 0, FREXP_TOLERANCE, 0}, +{ 849, 1046570941u, 2228057309u, 0u, 4294967272u, 1071736765u, 2228057309u, 0, FREXP_TOLERANCE, 0}, +{ 850, 1084318902u, 1317851136u, 0u, 12u, 1071735990u, 1317851136u, 0, FREXP_TOLERANCE, 0}, +{ 851, 1088255327u, 270039934u, 0u, 15u, 1072526687u, 270039934u, 0, FREXP_TOLERANCE, 0}, +{ 852, 3241414679u, 3063626339u, 0u, 21u, 3219394583u, 3063626339u, 0, FREXP_TOLERANCE, 0}, +{ 853, 3219178350u, 83062251u, 0u, 0u, 3219178350u, 83062251u, 0, FREXP_TOLERANCE, 0}, +{ 854, 3211262173u, 2659016437u, 0u, 4294967288u, 3219650781u, 2659016437u, 0, FREXP_TOLERANCE, 0}, +{ 855, 1095743886u, 3833539373u, 0u, 22u, 1072675214u, 3833539373u, 0, FREXP_TOLERANCE, 0}, +{ 856, 3206667189u, 1567476111u, 0u, 4294967284u, 3219250101u, 1567476111u, 0, FREXP_TOLERANCE, 0}, +{ 857, 3205195072u, 2382776852u, 0u, 4294967282u, 3219875136u, 2382776852u, 0, FREXP_TOLERANCE, 0}, +{ 858, 3249232579u, 1546622468u, 0u, 28u, 3219872451u, 1546622468u, 0, FREXP_TOLERANCE, 0}, +{ 859, 1085536439u, 1714300821u, 0u, 13u, 1071904951u, 1714300821u, 0, FREXP_TOLERANCE, 0}, +{ 860, 1104130938u, 4167591598u, 0u, 30u, 1072673658u, 4167591598u, 0, FREXP_TOLERANCE, 0}, +{ 861, 1051092760u, 2798720100u, 0u, 4294967276u, 1072064280u, 2798720100u, 0, FREXP_TOLERANCE, 0}, +{ 862, 1086978789u, 449990704u, 0u, 14u, 1072298725u, 449990704u, 0, FREXP_TOLERANCE, 0}, +{ 863, 3231198415u, 4039516226u, 0u, 11u, 3219664079u, 4039516226u, 0, FREXP_TOLERANCE, 0}, +{ 864, 3244344107u, 4272932619u, 0u, 24u, 3219178283u, 4272932619u, 0, FREXP_TOLERANCE, 0}, +{ 865, 3222708441u, 1683007544u, 0u, 3u, 3219562713u, 1683007544u, 0, FREXP_TOLERANCE, 0}, +{ 866, 1091105663u, 3805494321u, 0u, 18u, 1072231295u, 3805494321u, 0, FREXP_TOLERANCE, 0}, +{ 867, 3220852948u, 2072627412u, 0u, 1u, 3219804372u, 2072627412u, 0, FREXP_TOLERANCE, 0}, +{ 868, 1094383324u, 3394151662u, 0u, 21u, 1072363228u, 3394151662u, 0, FREXP_TOLERANCE, 0}, +{ 869, 3220570024u, 1120106427u, 0u, 1u, 3219521448u, 1120106427u, 0, FREXP_TOLERANCE, 0}, +{ 870, 3223631624u, 3404608264u, 0u, 4u, 3219437320u, 3404608264u, 0, FREXP_TOLERANCE, 0}, +{ 871, 1097859997u, 559918757u, 0u, 25u, 1071645597u, 559918757u, 0, FREXP_TOLERANCE, 0}, +{ 872, 3205077053u, 908100198u, 0u, 4294967282u, 3219757117u, 908100198u, 0, FREXP_TOLERANCE, 0}, +{ 873, 1042677918u, 2026673913u, 0u, 4294967268u, 1072038046u, 2026673913u, 0, FREXP_TOLERANCE, 0}, +{ 874, 3244833635u, 2844573214u, 0u, 24u, 3219667811u, 2844573214u, 0, FREXP_TOLERANCE, 0}, +{ 875, 3254567259u, 3946837259u, 0u, 33u, 3219964251u, 3946837259u, 0, FREXP_TOLERANCE, 0}, +{ 876, 3234993796u, 3850406820u, 0u, 15u, 3219265156u, 3850406820u, 0, FREXP_TOLERANCE, 0}, +{ 877, 1057479809u, 3139330994u, 0u, 4294967282u, 1072159873u, 3139330994u, 0, FREXP_TOLERANCE, 0}, +{ 878, 1046133568u, 1539650690u, 0u, 4294967271u, 1072347968u, 1539650690u, 0, FREXP_TOLERANCE, 0}, +{ 879, 3236705500u, 1554593884u, 0u, 16u, 3219928284u, 1554593884u, 0, FREXP_TOLERANCE, 0}, +{ 880, 3228899878u, 2813752562u, 0u, 9u, 3219462694u, 2813752562u, 0, FREXP_TOLERANCE, 0}, +{ 881, 1056505004u, 3804703138u, 0u, 4294967281u, 1072233644u, 3804703138u, 0, FREXP_TOLERANCE, 0}, +{ 882, 1072931071u, 2053677923u, 0u, 1u, 1071882495u, 2053677923u, 0, FREXP_TOLERANCE, 0}, +{ 883, 3244864299u, 289355864u, 0u, 24u, 3219698475u, 289355864u, 0, FREXP_TOLERANCE, 0}, +{ 884, 1078453818u, 2143066338u, 0u, 6u, 1072162362u, 2143066338u, 0, FREXP_TOLERANCE, 0}, +{ 885, 3203939880u, 2157691971u, 0u, 4294967281u, 3219668520u, 2157691971u, 0, FREXP_TOLERANCE, 0}, +{ 886, 1106629150u, 110806409u, 0u, 33u, 1072026142u, 110806409u, 0, FREXP_TOLERANCE, 0}, +{ 887, 1082157019u, 3570399481u, 0u, 10u, 1071671259u, 3570399481u, 0, FREXP_TOLERANCE, 0}, +{ 888, 1085637605u, 180265334u, 0u, 13u, 1072006117u, 180265334u, 0, FREXP_TOLERANCE, 0}, +{ 889, 3200980182u, 558779875u, 0u, 4294967278u, 3219854550u, 558779875u, 0, FREXP_TOLERANCE, 0}, +{ 890, 3202046748u, 2338464653u, 0u, 4294967279u, 3219872540u, 2338464653u, 0, FREXP_TOLERANCE, 0}, +{ 891, 1045705464u, 1703969219u, 0u, 4294967271u, 1071919864u, 1703969219u, 0, FREXP_TOLERANCE, 0}, +{ 892, 3229797258u, 1417521063u, 0u, 10u, 3219311498u, 1417521063u, 0, FREXP_TOLERANCE, 0}, +{ 893, 3237782261u, 3917440951u, 0u, 17u, 3219956469u, 3917440951u, 0, FREXP_TOLERANCE, 0}, +{ 894, 1051668894u, 3736066983u, 0u, 4294967276u, 1072640414u, 3736066983u, 0, FREXP_TOLERANCE, 0}, +{ 895, 1064752080u, 3106613409u, 0u, 4294967289u, 1072092112u, 3106613409u, 0, FREXP_TOLERANCE, 0}, +{ 896, 1066627453u, 2735392257u, 0u, 4294967291u, 1071870333u, 2735392257u, 0, FREXP_TOLERANCE, 0}, +{ 897, 1065665372u, 2229777605u, 0u, 4294967290u, 1071956828u, 2229777605u, 0, FREXP_TOLERANCE, 0}, +{ 898, 1065061963u, 2405869925u, 0u, 4294967289u, 1072401995u, 2405869925u, 0, FREXP_TOLERANCE, 0}, +{ 899, 3239463229u, 3967957902u, 0u, 19u, 3219540285u, 3967957902u, 0, FREXP_TOLERANCE, 0}, +{ 900, 1057416138u, 3459188071u, 0u, 4294967282u, 1072096202u, 3459188071u, 0, FREXP_TOLERANCE, 0}, +{ 901, 1068639210u, 3699016825u, 0u, 4294967293u, 1071784938u, 3699016825u, 0, FREXP_TOLERANCE, 0}, +{ 902, 3249713090u, 796144848u, 0u, 29u, 3219304386u, 796144848u, 0, FREXP_TOLERANCE, 0}, +{ 903, 3228816396u, 3285165564u, 0u, 9u, 3219379212u, 3285165564u, 0, FREXP_TOLERANCE, 0}, +{ 904, 3211948811u, 401510871u, 0u, 4294967289u, 3219288843u, 401510871u, 0, FREXP_TOLERANCE, 0}, +{ 905, 1094257658u, 634857910u, 0u, 21u, 1072237562u, 634857910u, 0, FREXP_TOLERANCE, 0}, +{ 906, 3199607513u, 914218057u, 0u, 4294967277u, 3219530457u, 914218057u, 0, FREXP_TOLERANCE, 0}, +{ 907, 1083743336u, 2030735578u, 0u, 11u, 1072209000u, 2030735578u, 0, FREXP_TOLERANCE, 0}, +{ 908, 3233855943u, 965677531u, 0u, 14u, 3219175879u, 965677531u, 0, FREXP_TOLERANCE, 0}, +{ 909, 1079556815u, 3957229084u, 0u, 7u, 1072216783u, 3957229084u, 0, FREXP_TOLERANCE, 0}, +{ 910, 1051050470u, 3123776651u, 0u, 4294967276u, 1072021990u, 3123776651u, 0, FREXP_TOLERANCE, 0}, +{ 911, 3221863333u, 162122081u, 0u, 2u, 3219766181u, 162122081u, 0, FREXP_TOLERANCE, 0}, +{ 912, 3239376395u, 108064594u, 0u, 19u, 3219453451u, 108064594u, 0, FREXP_TOLERANCE, 0}, +{ 913, 3237271786u, 869031839u, 0u, 17u, 3219445994u, 869031839u, 0, FREXP_TOLERANCE, 0}, +{ 914, 3225020876u, 1344301606u, 0u, 5u, 3219777996u, 1344301606u, 0, FREXP_TOLERANCE, 0}, +{ 915, 3214433474u, 946696117u, 0u, 4294967291u, 3219676354u, 946696117u, 0, FREXP_TOLERANCE, 0}, +{ 916, 3231825228u, 1700703647u, 0u, 12u, 3219242316u, 1700703647u, 0, FREXP_TOLERANCE, 0}, +{ 917, 1075492875u, 3394168074u, 0u, 3u, 1072347147u, 3394168074u, 0, FREXP_TOLERANCE, 0}, +{ 918, 1076939786u, 1666995668u, 0u, 5u, 1071696906u, 1666995668u, 0, FREXP_TOLERANCE, 0}, +{ 919, 3208774795u, 2488789804u, 0u, 4294967286u, 3219260555u, 2488789804u, 0, FREXP_TOLERANCE, 0}, +{ 920, 3238508333u, 1506943664u, 0u, 18u, 3219633965u, 1506943664u, 0, FREXP_TOLERANCE, 0}, +{ 921, 1072788663u, 3844072288u, 0u, 1u, 1071740087u, 3844072288u, 0, FREXP_TOLERANCE, 0}, +{ 922, 3202592279u, 2630019853u, 0u, 4294967280u, 3219369495u, 2630019853u, 0, FREXP_TOLERANCE, 0}, +{ 923, 3219934542u, 1244307192u, 0u, 0u, 3219934542u, 1244307192u, 0, FREXP_TOLERANCE, 0}, +{ 924, 3191297711u, 2540916692u, 0u, 4294967269u, 3219609263u, 2540916692u, 0, FREXP_TOLERANCE, 0}, +{ 925, 3200062692u, 2871645739u, 0u, 4294967277u, 3219985636u, 2871645739u, 0, FREXP_TOLERANCE, 0}, +{ 926, 3239081581u, 1440249115u, 0u, 19u, 3219158637u, 1440249115u, 0, FREXP_TOLERANCE, 0}, +{ 927, 1068350633u, 1231934926u, 0u, 4294967292u, 1072544937u, 1231934926u, 0, FREXP_TOLERANCE, 0}, +{ 928, 3236746788u, 603977748u, 0u, 16u, 3219969572u, 603977748u, 0, FREXP_TOLERANCE, 0}, +{ 929, 3195449689u, 2386312545u, 0u, 4294967273u, 3219566937u, 2386312545u, 0, FREXP_TOLERANCE, 0}, +{ 930, 1063169277u, 2715234268u, 0u, 4294967287u, 1072606461u, 2715234268u, 0, FREXP_TOLERANCE, 0}, +{ 931, 1087803418u, 915867083u, 0u, 15u, 1072074778u, 915867083u, 0, FREXP_TOLERANCE, 0}, +{ 932, 1046790892u, 3347417612u, 0u, 4294967272u, 1071956716u, 3347417612u, 0, FREXP_TOLERANCE, 0}, +{ 933, 1105984188u, 3553288373u, 0u, 32u, 1072429756u, 3553288373u, 0, FREXP_TOLERANCE, 0}, +{ 934, 1065698616u, 2906680663u, 0u, 4294967290u, 1071990072u, 2906680663u, 0, FREXP_TOLERANCE, 0}, +{ 935, 1045506226u, 2342364630u, 0u, 4294967271u, 1071720626u, 2342364630u, 0, FREXP_TOLERANCE, 0}, +{ 936, 1051356723u, 4019093203u, 0u, 4294967276u, 1072328243u, 4019093203u, 0, FREXP_TOLERANCE, 0}, +{ 937, 3201169162u, 2911548084u, 0u, 4294967278u, 3220043530u, 2911548084u, 0, FREXP_TOLERANCE, 0}, +{ 938, 1105282515u, 2476735795u, 0u, 32u, 1071728083u, 2476735795u, 0, FREXP_TOLERANCE, 0}, +{ 939, 1050472772u, 1836216409u, 0u, 4294967275u, 1072492868u, 1836216409u, 0, FREXP_TOLERANCE, 0}, +{ 940, 1101062307u, 2519592554u, 0u, 28u, 1071702179u, 2519592554u, 0, FREXP_TOLERANCE, 0}, +{ 941, 1070178161u, 1235369496u, 0u, 4294967294u, 1072275313u, 1235369496u, 0, FREXP_TOLERANCE, 0}, +{ 942, 3222946447u, 668087854u, 0u, 3u, 3219800719u, 668087854u, 0, FREXP_TOLERANCE, 0}, +{ 943, 3208554596u, 2981820811u, 0u, 4294967285u, 3220088932u, 2981820811u, 0, FREXP_TOLERANCE, 0}, +{ 944, 1059838516u, 2845580478u, 0u, 4294967284u, 1072421428u, 2845580478u, 0, FREXP_TOLERANCE, 0}, +{ 945, 3193931414u, 1565550570u, 0u, 4294967271u, 3220145814u, 1565550570u, 0, FREXP_TOLERANCE, 0}, +{ 946, 3217165795u, 4162017137u, 0u, 4294967294u, 3219262947u, 4162017137u, 0, FREXP_TOLERANCE, 0}, +{ 947, 3237251378u, 2808968027u, 0u, 17u, 3219425586u, 2808968027u, 0, FREXP_TOLERANCE, 0}, +{ 948, 1055630096u, 1782326814u, 0u, 4294967280u, 1072407312u, 1782326814u, 0, FREXP_TOLERANCE, 0}, +{ 949, 1053576974u, 1492622658u, 0u, 4294967278u, 1072451342u, 1492622658u, 0, FREXP_TOLERANCE, 0}, +{ 950, 3216653077u, 3972512122u, 0u, 4294967293u, 3219798805u, 3972512122u, 0, FREXP_TOLERANCE, 0}, +{ 951, 3222171679u, 2722693603u, 0u, 2u, 3220074527u, 2722693603u, 0, FREXP_TOLERANCE, 0}, +{ 952, 3227814791u, 3169731970u, 0u, 8u, 3219426183u, 3169731970u, 0, FREXP_TOLERANCE, 0}, +{ 953, 3217906631u, 899763203u, 0u, 4294967294u, 3220003783u, 899763203u, 0, FREXP_TOLERANCE, 0}, +{ 954, 3207606001u, 2804747833u, 0u, 4294967285u, 3219140337u, 2804747833u, 0, FREXP_TOLERANCE, 0}, +{ 955, 3230670325u, 3789058912u, 0u, 11u, 3219135989u, 3789058912u, 0, FREXP_TOLERANCE, 0}, +{ 956, 3228095081u, 4135937628u, 0u, 8u, 3219706473u, 4135937628u, 0, FREXP_TOLERANCE, 0}, +{ 957, 1060199382u, 1682808307u, 0u, 4294967285u, 1071733718u, 1682808307u, 0, FREXP_TOLERANCE, 0}, +{ 958, 3206960335u, 232877759u, 0u, 4294967284u, 3219543247u, 232877759u, 0, FREXP_TOLERANCE, 0}, +{ 959, 3242091486u, 2851963139u, 0u, 21u, 3220071390u, 2851963139u, 0, FREXP_TOLERANCE, 0}, +{ 960, 3246852961u, 2590862592u, 0u, 26u, 3219589985u, 2590862592u, 0, FREXP_TOLERANCE, 0}, +{ 961, 1081200406u, 2422232642u, 0u, 9u, 1071763222u, 2422232642u, 0, FREXP_TOLERANCE, 0}, +{ 962, 3234779662u, 290458310u, 0u, 14u, 3220099598u, 290458310u, 0, FREXP_TOLERANCE, 0}, +{ 963, 3210671078u, 1082582386u, 0u, 4294967287u, 3220108262u, 1082582386u, 0, FREXP_TOLERANCE, 0}, +{ 964, 1075605675u, 2602133689u, 0u, 3u, 1072459947u, 2602133689u, 0, FREXP_TOLERANCE, 0}, +{ 965, 3239818611u, 1789635787u, 0u, 19u, 3219895667u, 1789635787u, 0, FREXP_TOLERANCE, 0}, +{ 966, 1059414278u, 1048286093u, 0u, 4294967284u, 1071997190u, 1048286093u, 0, FREXP_TOLERANCE, 0}, +{ 967, 1098330542u, 231339448u, 0u, 25u, 1072116142u, 231339448u, 0, FREXP_TOLERANCE, 0}, +{ 968, 1055573265u, 504907415u, 0u, 4294967280u, 1072350481u, 504907415u, 0, FREXP_TOLERANCE, 0}, +{ 969, 1063211461u, 1153251200u, 0u, 4294967287u, 1072648645u, 1153251200u, 0, FREXP_TOLERANCE, 0}, +{ 970, 3204617090u, 1772013857u, 0u, 4294967282u, 3219297154u, 1772013857u, 0, FREXP_TOLERANCE, 0}, +{ 971, 1099551055u, 1082898276u, 0u, 26u, 1072288079u, 1082898276u, 0, FREXP_TOLERANCE, 0}, +{ 972, 3212089272u, 1449080862u, 0u, 4294967289u, 3219429304u, 1449080862u, 0, FREXP_TOLERANCE, 0}, +{ 973, 1086008285u, 3177299045u, 0u, 13u, 1072376797u, 3177299045u, 0, FREXP_TOLERANCE, 0}, +{ 974, 1058862813u, 809400815u, 0u, 4294967283u, 1072494301u, 809400815u, 0, FREXP_TOLERANCE, 0}, +{ 975, 3230854550u, 1924429710u, 0u, 11u, 3219320214u, 1924429710u, 0, FREXP_TOLERANCE, 0}, +{ 976, 1056464743u, 3349283177u, 0u, 4294967281u, 1072193383u, 3349283177u, 0, FREXP_TOLERANCE, 0}, +{ 977, 3245473391u, 42238036u, 0u, 25u, 3219258991u, 42238036u, 0, FREXP_TOLERANCE, 0}, +{ 978, 1042379500u, 2113559863u, 0u, 4294967268u, 1071739628u, 2113559863u, 0, FREXP_TOLERANCE, 0}, +{ 979, 1064761243u, 3304403230u, 0u, 4294967289u, 1072101275u, 3304403230u, 0, FREXP_TOLERANCE, 0}, +{ 980, 3217556703u, 58952646u, 0u, 4294967294u, 3219653855u, 58952646u, 0, FREXP_TOLERANCE, 0}, +{ 981, 3212669530u, 1645486982u, 0u, 4294967289u, 3220009562u, 1645486982u, 0, FREXP_TOLERANCE, 0}, +{ 982, 3224301095u, 3636267471u, 0u, 4u, 3220106791u, 3636267471u, 0, FREXP_TOLERANCE, 0}, +{ 983, 1062762009u, 619402181u, 0u, 4294967287u, 1072199193u, 619402181u, 0, FREXP_TOLERANCE, 0}, +{ 984, 3235208235u, 557360557u, 0u, 15u, 3219479595u, 557360557u, 0, FREXP_TOLERANCE, 0}, +{ 985, 3238238394u, 110029735u, 0u, 18u, 3219364026u, 110029735u, 0, FREXP_TOLERANCE, 0}, +{ 986, 1046937383u, 984375729u, 0u, 4294967272u, 1072103207u, 984375729u, 0, FREXP_TOLERANCE, 0}, +{ 987, 3189496738u, 4063688092u, 0u, 4294967267u, 3219905442u, 4063688092u, 0, FREXP_TOLERANCE, 0}, +{ 988, 3203235744u, 1049950343u, 0u, 4294967280u, 3220012960u, 1049950343u, 0, FREXP_TOLERANCE, 0}, +{ 989, 1062350619u, 650996069u, 0u, 4294967287u, 1071787803u, 650996069u, 0, FREXP_TOLERANCE, 0}, +{ 990, 1054971928u, 3953359826u, 0u, 4294967280u, 1071749144u, 3953359826u, 0, FREXP_TOLERANCE, 0}, +{ 991, 3227055805u, 66926332u, 0u, 7u, 3219715773u, 66926332u, 0, FREXP_TOLERANCE, 0}, +{ 992, 1090561839u, 1379780888u, 0u, 18u, 1071687471u, 1379780888u, 0, FREXP_TOLERANCE, 0}, +{ 993, 3233453307u, 2803378256u, 0u, 13u, 3219821819u, 2803378256u, 0, FREXP_TOLERANCE, 0}, +{ 994, 1086057989u, 498534626u, 0u, 13u, 1072426501u, 498534626u, 0, FREXP_TOLERANCE, 0}, +{ 995, 1082618553u, 2846400785u, 0u, 10u, 1072132793u, 2846400785u, 0, FREXP_TOLERANCE, 0}, +{ 996, 1047142525u, 1375153550u, 0u, 4294967272u, 1072308349u, 1375153550u, 0, FREXP_TOLERANCE, 0}, +{ 997, 1044581201u, 2869128958u, 0u, 4294967270u, 1071844177u, 2869128958u, 0, FREXP_TOLERANCE, 0}, +{ 998, 1070972315u, 4246440273u, 0u, 4294967295u, 1072020891u, 4246440273u, 0, FREXP_TOLERANCE, 0}, +{ 999, 1051832506u, 3112381207u, 0u, 4294967277u, 1071755450u, 3112381207u, 0, FREXP_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_FREXP_H multiple inclusion protection + +// EOF frexp.h diff --git a/packages/language/c/libm/current/tests/vectors/ldexp.c b/packages/language/c/libm/current/tests/vectors/ldexp.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/ldexp.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// ldexp.c +// +// Test of ldexp() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/ldexp.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(ldexp_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &ldexp, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_INT, CYG_LIBM_TEST_VEC_DOUBLE, + &ldexp_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("ldexp() is stable"); + } // if + else + { + CYG_TEST_FAIL("ldexp() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library ldexp() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "ldexp() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF ldexp.c diff --git a/packages/language/c/libm/current/tests/vectors/ldexp.h b/packages/language/c/libm/current/tests/vectors/ldexp.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/ldexp.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_LDEXP_H +#define CYGONCE_LIBM_LDEXP_H +//=========================================================================== +// +// ldexp.h +// +// Test vectors for testing of ldexp() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/ldexp.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define LDEXP_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t ldexp_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 0u, 54u, 1134622252u, 2506787616u, 0, LDEXP_TOLERANCE, 0}, +{ 2, 3214772338u, 2077734866u, 0u, 34u, 3250423922u, 2077734866u, 0, LDEXP_TOLERANCE, 0}, +{ 3, 1080413105u, 548846937u, 0u, 225u, 1316342705u, 548846937u, 0, LDEXP_TOLERANCE, 0}, +{ 4, 3218221902u, 486455730u, 0u, 318u, 3551669070u, 486455730u, 0, LDEXP_TOLERANCE, 0}, +{ 5, 3224095940u, 4065937691u, 0u, 436u, 3681275076u, 4065937691u, 0, LDEXP_TOLERANCE, 0}, +{ 6, 1071992326u, 2845631987u, 0u, 28u, 1101352454u, 2845631987u, 0, LDEXP_TOLERANCE, 0}, +{ 7, 1046025801u, 4006030831u, 0u, 281u, 1340675657u, 4006030831u, 0, LDEXP_TOLERANCE, 0}, +{ 8, 3220544804u, 1507340799u, 0u, 346u, 3583352100u, 1507340799u, 0, LDEXP_TOLERANCE, 0}, +{ 9, 3194723612u, 479621759u, 0u, 449u, 3665534236u, 479621759u, 0, LDEXP_TOLERANCE, 0}, +{ 10, 1089363191u, 1746012320u, 0u, 291u, 1394498807u, 1746012320u, 0, LDEXP_TOLERANCE, 0}, +{ 11, 1076292113u, 2043066528u, 0u, 292u, 1382476305u, 2043066528u, 0, LDEXP_TOLERANCE, 0}, +{ 12, 3235652646u, 2131233512u, 0u, 104u, 3344704550u, 2131233512u, 0, LDEXP_TOLERANCE, 0}, +{ 13, 1058485694u, 2336118392u, 0u, 314u, 1387738558u, 2336118392u, 0, LDEXP_TOLERANCE, 0}, +{ 14, 1082419809u, 2572806098u, 0u, 29u, 1112828513u, 2572806098u, 0, LDEXP_TOLERANCE, 0}, +{ 15, 1095385097u, 370772494u, 0u, 470u, 1588215817u, 370772494u, 0, LDEXP_TOLERANCE, 0}, +{ 16, 3205432790u, 2588298075u, 0u, 44u, 3251570134u, 2588298075u, 0, LDEXP_TOLERANCE, 0}, +{ 17, 1095917486u, 3103659359u, 0u, 383u, 1497522094u, 3103659359u, 0, LDEXP_TOLERANCE, 0}, +{ 18, 1073371132u, 1515119937u, 0u, 213u, 1296717820u, 1515119937u, 0, LDEXP_TOLERANCE, 0}, +{ 19, 1060343410u, 1857607719u, 0u, 356u, 1433636466u, 1857607719u, 0, LDEXP_TOLERANCE, 0}, +{ 20, 3233184100u, 1472965721u, 0u, 277u, 3523639652u, 1472965721u, 0, LDEXP_TOLERANCE, 0}, +{ 21, 3230691143u, 2574511435u, 0u, 215u, 3456134983u, 2574511435u, 0, LDEXP_TOLERANCE, 0}, +{ 22, 3254171964u, 122146127u, 0u, 445u, 3720788284u, 122146127u, 0, LDEXP_TOLERANCE, 0}, +{ 23, 1072428204u, 831542630u, 0u, 171u, 1251734700u, 831542630u, 0, LDEXP_TOLERANCE, 0}, +{ 24, 1068797024u, 1682228977u, 0u, 239u, 1319406688u, 1682228977u, 0, LDEXP_TOLERANCE, 0}, +{ 25, 1053852869u, 105430463u, 0u, 369u, 1440777413u, 105430463u, 0, LDEXP_TOLERANCE, 0}, +{ 26, 1048952779u, 3490880064u, 0u, 127u, 1182121931u, 3490880064u, 0, LDEXP_TOLERANCE, 0}, +{ 27, 1088448632u, 336073679u, 0u, 29u, 1118857336u, 336073679u, 0, LDEXP_TOLERANCE, 0}, +{ 28, 1102287487u, 265058758u, 0u, 389u, 1510183551u, 265058758u, 0, LDEXP_TOLERANCE, 0}, +{ 29, 3231657216u, 258027773u, 0u, 472u, 3726585088u, 258027773u, 0, LDEXP_TOLERANCE, 0}, +{ 30, 1093107080u, 252015623u, 0u, 96u, 1193770376u, 252015623u, 0, LDEXP_TOLERANCE, 0}, +{ 31, 1067920032u, 78287159u, 0u, 263u, 1343695520u, 78287159u, 0, LDEXP_TOLERANCE, 0}, +{ 32, 1073395576u, 1555523835u, 0u, 92u, 1169864568u, 1555523835u, 0, LDEXP_TOLERANCE, 0}, +{ 33, 1063005332u, 1067681081u, 0u, 264u, 1339829396u, 1067681081u, 0, LDEXP_TOLERANCE, 0}, +{ 34, 1102231954u, 3893923133u, 0u, 244u, 1358084498u, 3893923133u, 0, LDEXP_TOLERANCE, 0}, +{ 35, 3230686533u, 1759897777u, 0u, 309u, 3554696517u, 1759897777u, 0, LDEXP_TOLERANCE, 0}, +{ 36, 3239098397u, 2737037055u, 0u, 73u, 3315644445u, 2737037055u, 0, LDEXP_TOLERANCE, 0}, +{ 37, 3216262634u, 2075329122u, 0u, 66u, 3285468650u, 2075329122u, 0, LDEXP_TOLERANCE, 0}, +{ 38, 3196997769u, 1611276410u, 0u, 194u, 3400421513u, 1611276410u, 0, LDEXP_TOLERANCE, 0}, +{ 39, 3202638019u, 1799495751u, 0u, 455u, 3679740099u, 1799495751u, 0, LDEXP_TOLERANCE, 0}, +{ 40, 1094899225u, 1827380665u, 0u, 66u, 1164105241u, 1827380665u, 0, LDEXP_TOLERANCE, 0}, +{ 41, 1071303853u, 2051165551u, 0u, 459u, 1552600237u, 2051165551u, 0, LDEXP_TOLERANCE, 0}, +{ 42, 1065537321u, 302759375u, 0u, 340u, 1422053161u, 302759375u, 0, LDEXP_TOLERANCE, 0}, +{ 43, 1086875018u, 575413558u, 0u, 398u, 1504208266u, 575413558u, 0, LDEXP_TOLERANCE, 0}, +{ 44, 1053673372u, 2702778974u, 0u, 443u, 1518192540u, 2702778974u, 0, LDEXP_TOLERANCE, 0}, +{ 45, 3193817621u, 1570767698u, 0u, 282u, 3489516053u, 1570767698u, 0, LDEXP_TOLERANCE, 0}, +{ 46, 1071069297u, 2192461366u, 0u, 302u, 1387739249u, 2192461366u, 0, LDEXP_TOLERANCE, 0}, +{ 47, 3238418804u, 1337840437u, 0u, 144u, 3389413748u, 1337840437u, 0, LDEXP_TOLERANCE, 0}, +{ 48, 3248513649u, 1699484613u, 0u, 140u, 3395314289u, 1699484613u, 0, LDEXP_TOLERANCE, 0}, +{ 49, 3217360803u, 3717603375u, 0u, 269u, 3499427747u, 3717603375u, 0, LDEXP_TOLERANCE, 0}, +{ 50, 1088279286u, 3814565670u, 0u, 496u, 1608372982u, 3814565670u, 0, LDEXP_TOLERANCE, 0}, +{ 51, 1049002975u, 2752608599u, 0u, 470u, 1541833695u, 2752608599u, 0, LDEXP_TOLERANCE, 0}, +{ 52, 1057404205u, 3994112087u, 0u, 203u, 1270265133u, 3994112087u, 0, LDEXP_TOLERANCE, 0}, +{ 53, 3192718923u, 705652685u, 0u, 346u, 3555526219u, 705652685u, 0, LDEXP_TOLERANCE, 0}, +{ 54, 1047202319u, 2552982406u, 0u, 120u, 1173031439u, 2552982406u, 0, LDEXP_TOLERANCE, 0}, +{ 55, 1107213408u, 428765703u, 0u, 30u, 1138670688u, 428765703u, 0, LDEXP_TOLERANCE, 0}, +{ 56, 3206857463u, 3463957950u, 0u, 454u, 3682910967u, 3463957950u, 0, LDEXP_TOLERANCE, 0}, +{ 57, 3219940202u, 3511931302u, 0u, 482u, 3725353834u, 3511931302u, 0, LDEXP_TOLERANCE, 0}, +{ 58, 1049545113u, 1382645956u, 0u, 27u, 1077856665u, 1382645956u, 0, LDEXP_TOLERANCE, 0}, +{ 59, 3240285101u, 4024164216u, 0u, 494u, 3758281645u, 4024164216u, 0, LDEXP_TOLERANCE, 0}, +{ 60, 1090664768u, 3201265259u, 0u, 304u, 1409431872u, 3201265259u, 0, LDEXP_TOLERANCE, 0}, +{ 61, 3195451094u, 2082243603u, 0u, 200u, 3405166294u, 2082243603u, 0, LDEXP_TOLERANCE, 0}, +{ 62, 1070789511u, 3477510131u, 0u, 209u, 1289941895u, 3477510131u, 0, LDEXP_TOLERANCE, 0}, +{ 63, 3202292384u, 98230582u, 0u, 499u, 3725531808u, 98230582u, 0, LDEXP_TOLERANCE, 0}, +{ 64, 1057053639u, 2055490142u, 0u, 155u, 1219582919u, 2055490142u, 0, LDEXP_TOLERANCE, 0}, +{ 65, 3231608324u, 3135714676u, 0u, 72u, 3307105796u, 3135714676u, 0, LDEXP_TOLERANCE, 0}, +{ 66, 1067886563u, 3959938578u, 0u, 121u, 1194764259u, 3959938578u, 0, LDEXP_TOLERANCE, 0}, +{ 67, 1064521796u, 2810759459u, 0u, 133u, 1203982404u, 2810759459u, 0, LDEXP_TOLERANCE, 0}, +{ 68, 1050312077u, 2893664965u, 0u, 378u, 1446673805u, 2893664965u, 0, LDEXP_TOLERANCE, 0}, +{ 69, 1083212579u, 1755264865u, 0u, 240u, 1334870819u, 1755264865u, 0, LDEXP_TOLERANCE, 0}, +{ 70, 1106413681u, 4047817320u, 0u, 313u, 1434617969u, 4047817320u, 0, LDEXP_TOLERANCE, 0}, +{ 71, 3203399791u, 846447545u, 0u, 417u, 3640655983u, 846447545u, 0, LDEXP_TOLERANCE, 0}, +{ 72, 1064185862u, 3943538251u, 0u, 42u, 1108226054u, 3943538251u, 0, LDEXP_TOLERANCE, 0}, +{ 73, 3240055222u, 3604989074u, 0u, 181u, 3429847478u, 3604989074u, 0, LDEXP_TOLERANCE, 0}, +{ 74, 1047367602u, 203456665u, 0u, 144u, 1198362546u, 203456665u, 0, LDEXP_TOLERANCE, 0}, +{ 75, 3189239631u, 1189635129u, 0u, 412u, 3621252943u, 1189635129u, 0, LDEXP_TOLERANCE, 0}, +{ 76, 3205779054u, 3013056723u, 0u, 397u, 3622063726u, 3013056723u, 0, LDEXP_TOLERANCE, 0}, +{ 77, 3213557485u, 1246486570u, 0u, 474u, 3710582509u, 1246486570u, 0, LDEXP_TOLERANCE, 0}, +{ 78, 1067165665u, 743938884u, 0u, 66u, 1136371681u, 743938884u, 0, LDEXP_TOLERANCE, 0}, +{ 79, 3251710188u, 3283695916u, 0u, 173u, 3433113836u, 3283695916u, 0, LDEXP_TOLERANCE, 0}, +{ 80, 1049044587u, 137961661u, 0u, 205u, 1264002667u, 137961661u, 0, LDEXP_TOLERANCE, 0}, +{ 81, 3203917457u, 2416207160u, 0u, 306u, 3524781713u, 2416207160u, 0, LDEXP_TOLERANCE, 0}, +{ 82, 1087554095u, 2312530895u, 0u, 328u, 1431487023u, 2312530895u, 0, LDEXP_TOLERANCE, 0}, +{ 83, 3219731834u, 3553194394u, 0u, 51u, 3273209210u, 3553194394u, 0, LDEXP_TOLERANCE, 0}, +{ 84, 1089802564u, 4018123754u, 0u, 40u, 1131745604u, 4018123754u, 0, LDEXP_TOLERANCE, 0}, +{ 85, 3250695960u, 4001402392u, 0u, 197u, 3457265432u, 4001402392u, 0, LDEXP_TOLERANCE, 0}, +{ 86, 1094799453u, 1020693107u, 0u, 461u, 1578192989u, 1020693107u, 0, LDEXP_TOLERANCE, 0}, +{ 87, 3211977643u, 4053777521u, 0u, 379u, 3609387947u, 4053777521u, 0, LDEXP_TOLERANCE, 0}, +{ 88, 1054173542u, 374437781u, 0u, 354u, 1425369446u, 374437781u, 0, LDEXP_TOLERANCE, 0}, +{ 89, 1104453092u, 1396680572u, 0u, 231u, 1346674148u, 1396680572u, 0, LDEXP_TOLERANCE, 0}, +{ 90, 1065738071u, 3778242113u, 0u, 72u, 1141235543u, 3778242113u, 0, LDEXP_TOLERANCE, 0}, +{ 91, 3194422028u, 1839068700u, 0u, 22u, 3217490700u, 1839068700u, 0, LDEXP_TOLERANCE, 0}, +{ 92, 3249772522u, 3333658503u, 0u, 172u, 3430127594u, 3333658503u, 0, LDEXP_TOLERANCE, 0}, +{ 93, 3217561104u, 968764933u, 0u, 236u, 3465025040u, 968764933u, 0, LDEXP_TOLERANCE, 0}, +{ 94, 3208346874u, 2557447419u, 0u, 356u, 3581639930u, 2557447419u, 0, LDEXP_TOLERANCE, 0}, +{ 95, 1092040860u, 2421020125u, 0u, 39u, 1132935324u, 2421020125u, 0, LDEXP_TOLERANCE, 0}, +{ 96, 1051546374u, 390319448u, 0u, 307u, 1373459206u, 390319448u, 0, LDEXP_TOLERANCE, 0}, +{ 97, 1104422077u, 120202647u, 0u, 410u, 1534338237u, 120202647u, 0, LDEXP_TOLERANCE, 0}, +{ 98, 3205907556u, 1571279631u, 0u, 183u, 3397796964u, 1571279631u, 0, LDEXP_TOLERANCE, 0}, +{ 99, 3209048500u, 3811286432u, 0u, 188u, 3406180788u, 3811286432u, 0, LDEXP_TOLERANCE, 0}, +{ 100, 1082016752u, 2844125311u, 0u, 384u, 1484669936u, 2844125311u, 0, LDEXP_TOLERANCE, 0}, +{ 101, 3223518474u, 4002983238u, 0u, 232u, 3466788106u, 4002983238u, 0, LDEXP_TOLERANCE, 0}, +{ 102, 1084999692u, 705964542u, 0u, 337u, 1438369804u, 705964542u, 0, LDEXP_TOLERANCE, 0}, +{ 103, 3253568979u, 697641380u, 0u, 20u, 3274540499u, 697641380u, 0, LDEXP_TOLERANCE, 0}, +{ 104, 1066189359u, 4290199654u, 0u, 261u, 1339867695u, 4290199654u, 0, LDEXP_TOLERANCE, 0}, +{ 105, 3254107020u, 3987628760u, 0u, 187u, 3450190732u, 3987628760u, 0, LDEXP_TOLERANCE, 0}, +{ 106, 1107254732u, 713663124u, 0u, 331u, 1454333388u, 713663124u, 0, LDEXP_TOLERANCE, 0}, +{ 107, 1072634213u, 4243219780u, 0u, 67u, 1142888805u, 4243219780u, 0, LDEXP_TOLERANCE, 0}, +{ 108, 3252818240u, 2525320167u, 0u, 158u, 3418493248u, 2525320167u, 0, LDEXP_TOLERANCE, 0}, +{ 109, 1106165945u, 3774123863u, 0u, 119u, 1230946489u, 3774123863u, 0, LDEXP_TOLERANCE, 0}, +{ 110, 3215263804u, 4238491666u, 0u, 282u, 3510962236u, 4238491666u, 0, LDEXP_TOLERANCE, 0}, +{ 111, 1047864809u, 2749649438u, 0u, 342u, 1406477801u, 2749649438u, 0, LDEXP_TOLERANCE, 0}, +{ 112, 3213031252u, 2168353677u, 0u, 119u, 3337811796u, 2168353677u, 0, LDEXP_TOLERANCE, 0}, +{ 113, 3235560047u, 1920824271u, 0u, 448u, 3705322095u, 1920824271u, 0, LDEXP_TOLERANCE, 0}, +{ 114, 1064313208u, 4197962774u, 0u, 119u, 1189093752u, 4197962774u, 0, LDEXP_TOLERANCE, 0}, +{ 115, 3226731627u, 481356510u, 0u, 228u, 3465806955u, 481356510u, 0, LDEXP_TOLERANCE, 0}, +{ 116, 1098012633u, 1760061418u, 0u, 422u, 1540511705u, 1760061418u, 0, LDEXP_TOLERANCE, 0}, +{ 117, 1062348526u, 1907225401u, 0u, 468u, 1553082094u, 1907225401u, 0, LDEXP_TOLERANCE, 0}, +{ 118, 1103185231u, 4242092620u, 0u, 299u, 1416709455u, 4242092620u, 0, LDEXP_TOLERANCE, 0}, +{ 119, 1052367173u, 3238059481u, 0u, 481u, 1556732229u, 3238059481u, 0, LDEXP_TOLERANCE, 0}, +{ 120, 1100208345u, 3991562047u, 0u, 203u, 1313069273u, 3991562047u, 0, LDEXP_TOLERANCE, 0}, +{ 121, 1060891184u, 899298139u, 0u, 214u, 1285286448u, 899298139u, 0, LDEXP_TOLERANCE, 0}, +{ 122, 1104449768u, 3410634699u, 0u, 411u, 1535414504u, 3410634699u, 0, LDEXP_TOLERANCE, 0}, +{ 123, 1073419044u, 3812243448u, 0u, 319u, 1407914788u, 3812243448u, 0, LDEXP_TOLERANCE, 0}, +{ 124, 3202615057u, 987224991u, 0u, 224u, 3437496081u, 987224991u, 0, LDEXP_TOLERANCE, 0}, +{ 125, 1075151824u, 1167721978u, 0u, 399u, 1493533648u, 1167721978u, 0, LDEXP_TOLERANCE, 0}, +{ 126, 1064708193u, 2181267016u, 0u, 42u, 1108748385u, 2181267016u, 0, LDEXP_TOLERANCE, 0}, +{ 127, 1077871417u, 2549219008u, 0u, 424u, 1522467641u, 2549219008u, 0, LDEXP_TOLERANCE, 0}, +{ 128, 3198004943u, 1792969424u, 0u, 225u, 3433934543u, 1792969424u, 0, LDEXP_TOLERANCE, 0}, +{ 129, 3216855791u, 1978756209u, 0u, 494u, 3734852335u, 1978756209u, 0, LDEXP_TOLERANCE, 0}, +{ 130, 1077949895u, 2382114971u, 0u, 63u, 1144010183u, 2382114971u, 0, LDEXP_TOLERANCE, 0}, +{ 131, 3195894477u, 514482752u, 0u, 472u, 3690822349u, 514482752u, 0, LDEXP_TOLERANCE, 0}, +{ 132, 3242413319u, 543068462u, 0u, 443u, 3706932487u, 543068462u, 0, LDEXP_TOLERANCE, 0}, +{ 133, 3204701180u, 2652073890u, 0u, 199u, 3413367804u, 2652073890u, 0, LDEXP_TOLERANCE, 0}, +{ 134, 1061328546u, 1489535917u, 0u, 473u, 1557304994u, 1489535917u, 0, LDEXP_TOLERANCE, 0}, +{ 135, 1052674720u, 3229843554u, 0u, 441u, 1515096736u, 3229843554u, 0, LDEXP_TOLERANCE, 0}, +{ 136, 1097158000u, 173134582u, 0u, 79u, 1179995504u, 173134582u, 0, LDEXP_TOLERANCE, 0}, +{ 137, 3237498591u, 1923844009u, 0u, 176u, 3422047967u, 1923844009u, 0, LDEXP_TOLERANCE, 0}, +{ 138, 3224533985u, 668606628u, 0u, 441u, 3686956001u, 668606628u, 0, LDEXP_TOLERANCE, 0}, +{ 139, 1068442768u, 582256337u, 0u, 144u, 1219437712u, 582256337u, 0, LDEXP_TOLERANCE, 0}, +{ 140, 3213406340u, 1255215774u, 0u, 169u, 3390615684u, 1255215774u, 0, LDEXP_TOLERANCE, 0}, +{ 141, 3206436910u, 3262514920u, 0u, 401u, 3626915886u, 3262514920u, 0, LDEXP_TOLERANCE, 0}, +{ 142, 3211518779u, 2001934786u, 0u, 8u, 3219907387u, 2001934786u, 0, LDEXP_TOLERANCE, 0}, +{ 143, 3198655042u, 3323394293u, 0u, 424u, 3643251266u, 3323394293u, 0, LDEXP_TOLERANCE, 0}, +{ 144, 1102056915u, 2833190961u, 0u, 141u, 1249906131u, 2833190961u, 0, LDEXP_TOLERANCE, 0}, +{ 145, 3206978856u, 845263327u, 0u, 219u, 3436617000u, 845263327u, 0, LDEXP_TOLERANCE, 0}, +{ 146, 1075424006u, 3731374023u, 0u, 315u, 1405725446u, 3731374023u, 0, LDEXP_TOLERANCE, 0}, +{ 147, 1079280993u, 917682262u, 0u, 98u, 1182041441u, 917682262u, 0, LDEXP_TOLERANCE, 0}, +{ 148, 3241806761u, 233010859u, 0u, 477u, 3741977513u, 233010859u, 0, LDEXP_TOLERANCE, 0}, +{ 149, 3235133813u, 2553517871u, 0u, 397u, 3651418485u, 2553517871u, 0, LDEXP_TOLERANCE, 0}, +{ 150, 3207128644u, 1115950480u, 0u, 186u, 3402163780u, 1115950480u, 0, LDEXP_TOLERANCE, 0}, +{ 151, 3204087297u, 2664821947u, 0u, 239u, 3454696961u, 2664821947u, 0, LDEXP_TOLERANCE, 0}, +{ 152, 1071548167u, 3557912224u, 0u, 384u, 1474201351u, 3557912224u, 0, LDEXP_TOLERANCE, 0}, +{ 153, 1081218889u, 2614232599u, 0u, 397u, 1497503561u, 2614232599u, 0, LDEXP_TOLERANCE, 0}, +{ 154, 3216359929u, 1186945904u, 0u, 6u, 3222651385u, 1186945904u, 0, LDEXP_TOLERANCE, 0}, +{ 155, 3239606498u, 829492767u, 0u, 92u, 3336075490u, 829492767u, 0, LDEXP_TOLERANCE, 0}, +{ 156, 3226435447u, 2285296565u, 0u, 124u, 3356458871u, 2285296565u, 0, LDEXP_TOLERANCE, 0}, +{ 157, 1055298632u, 2224685509u, 0u, 351u, 1423348808u, 2224685509u, 0, LDEXP_TOLERANCE, 0}, +{ 158, 1079682185u, 2193774608u, 0u, 373u, 1470801033u, 2193774608u, 0, LDEXP_TOLERANCE, 0}, +{ 159, 1043796692u, 2811972465u, 0u, 360u, 1421284052u, 2811972465u, 0, LDEXP_TOLERANCE, 0}, +{ 160, 3190948438u, 1320866227u, 0u, 55u, 3248620118u, 1320866227u, 0, LDEXP_TOLERANCE, 0}, +{ 161, 3204972194u, 309600080u, 0u, 150u, 3362258594u, 309600080u, 0, LDEXP_TOLERANCE, 0}, +{ 162, 3247074394u, 4153979484u, 0u, 45u, 3294260314u, 4153979484u, 0, LDEXP_TOLERANCE, 0}, +{ 163, 3245817826u, 4108948538u, 0u, 12u, 3258400738u, 4108948538u, 0, LDEXP_TOLERANCE, 0}, +{ 164, 3214264384u, 1462119906u, 0u, 294u, 3522545728u, 1462119906u, 0, LDEXP_TOLERANCE, 0}, +{ 165, 3197805498u, 3712598596u, 0u, 84u, 3285885882u, 3712598596u, 0, LDEXP_TOLERANCE, 0}, +{ 166, 1067754068u, 3317653467u, 0u, 441u, 1530176084u, 3317653467u, 0, LDEXP_TOLERANCE, 0}, +{ 167, 3205582754u, 2014267986u, 0u, 326u, 3547418530u, 2014267986u, 0, LDEXP_TOLERANCE, 0}, +{ 168, 3249218409u, 3614018702u, 0u, 313u, 3577422697u, 3614018702u, 0, LDEXP_TOLERANCE, 0}, +{ 169, 3229701513u, 2650850527u, 0u, 332u, 3577828745u, 2650850527u, 0, LDEXP_TOLERANCE, 0}, +{ 170, 3225393003u, 2146825072u, 0u, 43u, 3270481771u, 2146825072u, 0, LDEXP_TOLERANCE, 0}, +{ 171, 1090587893u, 3181518164u, 0u, 394u, 1503726837u, 3181518164u, 0, LDEXP_TOLERANCE, 0}, +{ 172, 1083643710u, 311336721u, 0u, 16u, 1100420926u, 311336721u, 0, LDEXP_TOLERANCE, 0}, +{ 173, 1045850005u, 536548906u, 0u, 136u, 1188456341u, 536548906u, 0, LDEXP_TOLERANCE, 0}, +{ 174, 1093294119u, 493054331u, 0u, 458u, 1573541927u, 493054331u, 0, LDEXP_TOLERANCE, 0}, +{ 175, 1059637485u, 1636490194u, 0u, 59u, 1121503469u, 1636490194u, 0, LDEXP_TOLERANCE, 0}, +{ 176, 1051839122u, 1496609373u, 0u, 419u, 1491192466u, 1496609373u, 0, LDEXP_TOLERANCE, 0}, +{ 177, 3217713352u, 4047547022u, 0u, 40u, 3259656392u, 4047547022u, 0, LDEXP_TOLERANCE, 0}, +{ 178, 1052826789u, 1743733981u, 0u, 236u, 1300290725u, 1743733981u, 0, LDEXP_TOLERANCE, 0}, +{ 179, 3239738856u, 1894485819u, 0u, 206u, 3455745512u, 1894485819u, 0, LDEXP_TOLERANCE, 0}, +{ 180, 3241794374u, 3239269504u, 0u, 301u, 3557415750u, 3239269504u, 0, LDEXP_TOLERANCE, 0}, +{ 181, 1082295059u, 2514398118u, 0u, 320u, 1417839379u, 2514398118u, 0, LDEXP_TOLERANCE, 0}, +{ 182, 3239385933u, 2805194172u, 0u, 460u, 3721730893u, 2805194172u, 0, LDEXP_TOLERANCE, 0}, +{ 183, 1046578695u, 88098545u, 0u, 342u, 1405191687u, 88098545u, 0, LDEXP_TOLERANCE, 0}, +{ 184, 3234688596u, 2841362123u, 0u, 402u, 3656216148u, 2841362123u, 0, LDEXP_TOLERANCE, 0}, +{ 185, 1074460694u, 2662035051u, 0u, 251u, 1337653270u, 2662035051u, 0, LDEXP_TOLERANCE, 0}, +{ 186, 1107283576u, 1757901351u, 0u, 14u, 1121963640u, 1757901351u, 0, LDEXP_TOLERANCE, 0}, +{ 187, 3246529140u, 1690749449u, 0u, 259u, 3518110324u, 1690749449u, 0, LDEXP_TOLERANCE, 0}, +{ 188, 3205695979u, 452086895u, 0u, 290u, 3509783019u, 452086895u, 0, LDEXP_TOLERANCE, 0}, +{ 189, 3245113300u, 3993463847u, 0u, 367u, 3629940692u, 3993463847u, 0, LDEXP_TOLERANCE, 0}, +{ 190, 1081866822u, 2441536203u, 0u, 276u, 1371273798u, 2441536203u, 0, LDEXP_TOLERANCE, 0}, +{ 191, 1069205029u, 2446986142u, 0u, 436u, 1526384165u, 2446986142u, 0, LDEXP_TOLERANCE, 0}, +{ 192, 1100226690u, 3561788365u, 0u, 90u, 1194598530u, 3561788365u, 0, LDEXP_TOLERANCE, 0}, +{ 193, 3217905473u, 2182131707u, 0u, 49u, 3269285697u, 2182131707u, 0, LDEXP_TOLERANCE, 0}, +{ 194, 1074481825u, 1411649658u, 0u, 265u, 1352354465u, 1411649658u, 0, LDEXP_TOLERANCE, 0}, +{ 195, 1098423846u, 1729843483u, 0u, 213u, 1321770534u, 1729843483u, 0, LDEXP_TOLERANCE, 0}, +{ 196, 3206635099u, 3105740969u, 0u, 255u, 3474021979u, 3105740969u, 0, LDEXP_TOLERANCE, 0}, +{ 197, 1069626394u, 395560434u, 0u, 447u, 1538339866u, 395560434u, 0, LDEXP_TOLERANCE, 0}, +{ 198, 1096244467u, 3644230845u, 0u, 166u, 1270308083u, 3644230845u, 0, LDEXP_TOLERANCE, 0}, +{ 199, 1065716026u, 120488169u, 0u, 345u, 1427474746u, 120488169u, 0, LDEXP_TOLERANCE, 0}, +{ 200, 3239481707u, 1635144910u, 0u, 12u, 3252064619u, 1635144910u, 0, LDEXP_TOLERANCE, 0}, +{ 201, 3188033119u, 3901916594u, 0u, 55u, 3245704799u, 3901916594u, 0, LDEXP_TOLERANCE, 0}, +{ 202, 1048893172u, 1520233772u, 0u, 138u, 1193596660u, 1520233772u, 0, LDEXP_TOLERANCE, 0}, +{ 203, 3243444050u, 2174480394u, 0u, 427u, 3691186002u, 2174480394u, 0, LDEXP_TOLERANCE, 0}, +{ 204, 3227041648u, 2170587119u, 0u, 22u, 3250110320u, 2170587119u, 0, LDEXP_TOLERANCE, 0}, +{ 205, 1058401310u, 1861796818u, 0u, 202u, 1270213662u, 1861796818u, 0, LDEXP_TOLERANCE, 0}, +{ 206, 3226315730u, 3847770185u, 0u, 380u, 3624774610u, 3847770185u, 0, LDEXP_TOLERANCE, 0}, +{ 207, 1069595396u, 541754047u, 0u, 233u, 1313913604u, 541754047u, 0, LDEXP_TOLERANCE, 0}, +{ 208, 3212663474u, 272319256u, 0u, 131u, 3350026930u, 272319256u, 0, LDEXP_TOLERANCE, 0}, +{ 209, 1059284620u, 3096749920u, 0u, 483u, 1565746828u, 3096749920u, 0, LDEXP_TOLERANCE, 0}, +{ 210, 1076067883u, 2272922429u, 0u, 352u, 1445166635u, 2272922429u, 0, LDEXP_TOLERANCE, 0}, +{ 211, 3230247604u, 3220743043u, 0u, 231u, 3472468660u, 3220743043u, 0, LDEXP_TOLERANCE, 0}, +{ 212, 1050651323u, 2300380149u, 0u, 114u, 1170188987u, 2300380149u, 0, LDEXP_TOLERANCE, 0}, +{ 213, 1072722410u, 2437243415u, 0u, 305u, 1392538090u, 2437243415u, 0, LDEXP_TOLERANCE, 0}, +{ 214, 3231053247u, 3661627618u, 0u, 79u, 3313890751u, 3661627618u, 0, LDEXP_TOLERANCE, 0}, +{ 215, 1041819430u, 1831574607u, 0u, 120u, 1167648550u, 1831574607u, 0, LDEXP_TOLERANCE, 0}, +{ 216, 3236399793u, 2527076176u, 0u, 260u, 3509029553u, 2527076176u, 0, LDEXP_TOLERANCE, 0}, +{ 217, 3195290997u, 2676398686u, 0u, 117u, 3317974389u, 2676398686u, 0, LDEXP_TOLERANCE, 0}, +{ 218, 3193437916u, 1339584035u, 0u, 123u, 3322412764u, 1339584035u, 0, LDEXP_TOLERANCE, 0}, +{ 219, 1095503867u, 3529401650u, 0u, 40u, 1137446907u, 3529401650u, 0, LDEXP_TOLERANCE, 0}, +{ 220, 1048913359u, 263139465u, 0u, 226u, 1285891535u, 263139465u, 0, LDEXP_TOLERANCE, 0}, +{ 221, 3234381459u, 2044871840u, 0u, 275u, 3522739859u, 2044871840u, 0, LDEXP_TOLERANCE, 0}, +{ 222, 1103621815u, 1760748810u, 0u, 143u, 1253568183u, 1760748810u, 0, LDEXP_TOLERANCE, 0}, +{ 223, 3233696138u, 3631905577u, 0u, 59u, 3295562122u, 3631905577u, 0, LDEXP_TOLERANCE, 0}, +{ 224, 1090844360u, 895635283u, 0u, 327u, 1433728712u, 895635283u, 0, LDEXP_TOLERANCE, 0}, +{ 225, 3211740211u, 3230452686u, 0u, 315u, 3542041651u, 3230452686u, 0, LDEXP_TOLERANCE, 0}, +{ 226, 1075422810u, 1864139509u, 0u, 202u, 1287235162u, 1864139509u, 0, LDEXP_TOLERANCE, 0}, +{ 227, 1091534863u, 3652704631u, 0u, 282u, 1387233295u, 3652704631u, 0, LDEXP_TOLERANCE, 0}, +{ 228, 1055756112u, 945524907u, 0u, 417u, 1493012304u, 945524907u, 0, LDEXP_TOLERANCE, 0}, +{ 229, 1042592415u, 3193385121u, 0u, 459u, 1523888799u, 3193385121u, 0, LDEXP_TOLERANCE, 0}, +{ 230, 1097323612u, 2009367488u, 0u, 361u, 1475859548u, 2009367488u, 0, LDEXP_TOLERANCE, 0}, +{ 231, 1080597180u, 424248253u, 0u, 445u, 1547213500u, 424248253u, 0, LDEXP_TOLERANCE, 0}, +{ 232, 1042985978u, 1729313551u, 0u, 74u, 1120580602u, 1729313551u, 0, LDEXP_TOLERANCE, 0}, +{ 233, 1052968515u, 262785866u, 0u, 366u, 1436747331u, 262785866u, 0, LDEXP_TOLERANCE, 0}, +{ 234, 3201825802u, 1027600628u, 0u, 222u, 3434609674u, 1027600628u, 0, LDEXP_TOLERANCE, 0}, +{ 235, 3189614508u, 2863482262u, 0u, 205u, 3404572588u, 2863482262u, 0, LDEXP_TOLERANCE, 0}, +{ 236, 1087207520u, 2536788461u, 0u, 408u, 1515026528u, 2536788461u, 0, LDEXP_TOLERANCE, 0}, +{ 237, 3220884452u, 1052878591u, 0u, 219u, 3450522596u, 1052878591u, 0, LDEXP_TOLERANCE, 0}, +{ 238, 1050895039u, 3686077741u, 0u, 270u, 1334010559u, 3686077741u, 0, LDEXP_TOLERANCE, 0}, +{ 239, 1072905134u, 3151697799u, 0u, 450u, 1544764334u, 3151697799u, 0, LDEXP_TOLERANCE, 0}, +{ 240, 3199889853u, 3750592285u, 0u, 80u, 3283775933u, 3750592285u, 0, LDEXP_TOLERANCE, 0}, +{ 241, 3195141686u, 524180329u, 0u, 335u, 3546414646u, 524180329u, 0, LDEXP_TOLERANCE, 0}, +{ 242, 3237769823u, 549692228u, 0u, 429u, 3687608927u, 549692228u, 0, LDEXP_TOLERANCE, 0}, +{ 243, 1044977851u, 123460729u, 0u, 325u, 1385765051u, 123460729u, 0, LDEXP_TOLERANCE, 0}, +{ 244, 1103902874u, 3456203663u, 0u, 454u, 1579956378u, 3456203663u, 0, LDEXP_TOLERANCE, 0}, +{ 245, 3221154648u, 2341156808u, 0u, 369u, 3608079192u, 2341156808u, 0, LDEXP_TOLERANCE, 0}, +{ 246, 1089754623u, 3952801936u, 0u, 43u, 1134843391u, 3952801936u, 0, LDEXP_TOLERANCE, 0}, +{ 247, 3207212058u, 563170079u, 0u, 150u, 3364498458u, 563170079u, 0, LDEXP_TOLERANCE, 0}, +{ 248, 3225869468u, 1535381711u, 0u, 384u, 3628522652u, 1535381711u, 0, LDEXP_TOLERANCE, 0}, +{ 249, 1054391309u, 4072415576u, 0u, 9u, 1063828493u, 4072415576u, 0, LDEXP_TOLERANCE, 0}, +{ 250, 3209063031u, 3109049640u, 0u, 91u, 3304483447u, 3109049640u, 0, LDEXP_TOLERANCE, 0}, +{ 251, 3218136187u, 2738823198u, 0u, 33u, 3252739195u, 2738823198u, 0, LDEXP_TOLERANCE, 0}, +{ 252, 1061175490u, 1144180871u, 0u, 106u, 1172324546u, 1144180871u, 0, LDEXP_TOLERANCE, 0}, +{ 253, 1096418100u, 1619819023u, 0u, 54u, 1153041204u, 1619819023u, 0, LDEXP_TOLERANCE, 0}, +{ 254, 1071954071u, 2285696073u, 0u, 430u, 1522841751u, 2285696073u, 0, LDEXP_TOLERANCE, 0}, +{ 255, 1072459589u, 1537999144u, 0u, 464u, 1558998853u, 1537999144u, 0, LDEXP_TOLERANCE, 0}, +{ 256, 3235749098u, 157845884u, 0u, 443u, 3700268266u, 157845884u, 0, LDEXP_TOLERANCE, 0}, +{ 257, 3222630024u, 232194256u, 0u, 125u, 3353702024u, 232194256u, 0, LDEXP_TOLERANCE, 0}, +{ 258, 3241510667u, 1984016330u, 0u, 187u, 3437594379u, 1984016330u, 0, LDEXP_TOLERANCE, 0}, +{ 259, 1076548691u, 4276701845u, 0u, 160u, 1244320851u, 4276701845u, 0, LDEXP_TOLERANCE, 0}, +{ 260, 1093262183u, 458381635u, 0u, 32u, 1126816615u, 458381635u, 0, LDEXP_TOLERANCE, 0}, +{ 261, 3217410826u, 2931856236u, 0u, 5u, 3222653706u, 2931856236u, 0, LDEXP_TOLERANCE, 0}, +{ 262, 3188629767u, 978126928u, 0u, 295u, 3497959687u, 978126928u, 0, LDEXP_TOLERANCE, 0}, +{ 263, 3222362209u, 1190217203u, 0u, 457u, 3701561441u, 1190217203u, 0, LDEXP_TOLERANCE, 0}, +{ 264, 3219622048u, 3145593339u, 0u, 490u, 3733424288u, 3145593339u, 0, LDEXP_TOLERANCE, 0}, +{ 265, 1085737474u, 637782232u, 0u, 393u, 1497827842u, 637782232u, 0, LDEXP_TOLERANCE, 0}, +{ 266, 1063416038u, 2567938216u, 0u, 233u, 1307734246u, 2567938216u, 0, LDEXP_TOLERANCE, 0}, +{ 267, 3245869330u, 1885951730u, 0u, 220u, 3476556050u, 1885951730u, 0, LDEXP_TOLERANCE, 0}, +{ 268, 3207806174u, 2553919637u, 0u, 157u, 3372432606u, 2553919637u, 0, LDEXP_TOLERANCE, 0}, +{ 269, 3247429520u, 2146563695u, 0u, 146u, 3400521616u, 2146563695u, 0, LDEXP_TOLERANCE, 0}, +{ 270, 1061008451u, 1671615226u, 0u, 151u, 1219343427u, 1671615226u, 0, LDEXP_TOLERANCE, 0}, +{ 271, 1076028796u, 3859211180u, 0u, 219u, 1305666940u, 3859211180u, 0, LDEXP_TOLERANCE, 0}, +{ 272, 1072363386u, 1650981745u, 0u, 51u, 1125840762u, 1650981745u, 0, LDEXP_TOLERANCE, 0}, +{ 273, 1068183512u, 1475114165u, 0u, 177u, 1253781464u, 1475114165u, 0, LDEXP_TOLERANCE, 0}, +{ 274, 1097775870u, 2570983571u, 0u, 19u, 1117698814u, 2570983571u, 0, LDEXP_TOLERANCE, 0}, +{ 275, 3249504174u, 4161096849u, 0u, 207u, 3466559406u, 4161096849u, 0, LDEXP_TOLERANCE, 0}, +{ 276, 1107277558u, 4024344323u, 0u, 272u, 1392490230u, 4024344323u, 0, LDEXP_TOLERANCE, 0}, +{ 277, 3238437161u, 2611187549u, 0u, 97u, 3340149033u, 2611187549u, 0, LDEXP_TOLERANCE, 0}, +{ 278, 1045834828u, 3078509746u, 0u, 63u, 1111895116u, 3078509746u, 0, LDEXP_TOLERANCE, 0}, +{ 279, 1089189384u, 2227116198u, 0u, 109u, 1203484168u, 2227116198u, 0, LDEXP_TOLERANCE, 0}, +{ 280, 1080684976u, 1472665012u, 0u, 366u, 1464463792u, 1472665012u, 0, LDEXP_TOLERANCE, 0}, +{ 281, 1080318978u, 3071232825u, 0u, 488u, 1592024066u, 3071232825u, 0, LDEXP_TOLERANCE, 0}, +{ 282, 3205503940u, 437403482u, 0u, 267u, 3485473732u, 437403482u, 0, LDEXP_TOLERANCE, 0}, +{ 283, 1062227791u, 4288608311u, 0u, 270u, 1345343311u, 4288608311u, 0, LDEXP_TOLERANCE, 0}, +{ 284, 1044502599u, 349540356u, 0u, 19u, 1064425543u, 349540356u, 0, LDEXP_TOLERANCE, 0}, +{ 285, 1043598726u, 944335909u, 0u, 297u, 1355025798u, 944335909u, 0, LDEXP_TOLERANCE, 0}, +{ 286, 1051582533u, 2123384287u, 0u, 71u, 1126031429u, 2123384287u, 0, LDEXP_TOLERANCE, 0}, +{ 287, 3198090050u, 2528390848u, 0u, 251u, 3461282626u, 2528390848u, 0, LDEXP_TOLERANCE, 0}, +{ 288, 3240457093u, 132926909u, 0u, 67u, 3310711685u, 132926909u, 0, LDEXP_TOLERANCE, 0}, +{ 289, 3246632231u, 40413554u, 0u, 24u, 3271798055u, 40413554u, 0, LDEXP_TOLERANCE, 0}, +{ 290, 3200875834u, 3443172377u, 0u, 470u, 3693706554u, 3443172377u, 0, LDEXP_TOLERANCE, 0}, +{ 291, 1081721846u, 373222953u, 0u, 163u, 1252639734u, 373222953u, 0, LDEXP_TOLERANCE, 0}, +{ 292, 3194233874u, 2533101358u, 0u, 78u, 3276022802u, 2533101358u, 0, LDEXP_TOLERANCE, 0}, +{ 293, 3234400000u, 1020015106u, 0u, 458u, 3714647808u, 1020015106u, 0, LDEXP_TOLERANCE, 0}, +{ 294, 1097650417u, 4175026874u, 0u, 175u, 1281151217u, 4175026874u, 0, LDEXP_TOLERANCE, 0}, +{ 295, 3217062816u, 3412658638u, 0u, 18u, 3235937184u, 3412658638u, 0, LDEXP_TOLERANCE, 0}, +{ 296, 1041317040u, 3644551949u, 0u, 286u, 1341209776u, 3644551949u, 0, LDEXP_TOLERANCE, 0}, +{ 297, 1097752504u, 778944340u, 0u, 426u, 1544445880u, 778944340u, 0, LDEXP_TOLERANCE, 0}, +{ 298, 1067680885u, 937732557u, 0u, 71u, 1142129781u, 937732557u, 0, LDEXP_TOLERANCE, 0}, +{ 299, 1086736464u, 2862118510u, 0u, 461u, 1570130000u, 2862118510u, 0, LDEXP_TOLERANCE, 0}, +{ 300, 1096901686u, 850134980u, 0u, 211u, 1318151222u, 850134980u, 0, LDEXP_TOLERANCE, 0}, +{ 301, 3251210973u, 4095059472u, 0u, 442u, 3714681565u, 4095059472u, 0, LDEXP_TOLERANCE, 0}, +{ 302, 3245779466u, 1314480053u, 0u, 144u, 3396774410u, 1314480053u, 0, LDEXP_TOLERANCE, 0}, +{ 303, 1090422995u, 2303828445u, 0u, 388u, 1497270483u, 2303828445u, 0, LDEXP_TOLERANCE, 0}, +{ 304, 1096895426u, 3882733009u, 0u, 191u, 1297173442u, 3882733009u, 0, LDEXP_TOLERANCE, 0}, +{ 305, 1089588191u, 2009174302u, 0u, 496u, 1609681887u, 2009174302u, 0, LDEXP_TOLERANCE, 0}, +{ 306, 1097495331u, 312449728u, 0u, 173u, 1278898979u, 312449728u, 0, LDEXP_TOLERANCE, 0}, +{ 307, 1049684114u, 1160162008u, 0u, 212u, 1271982226u, 1160162008u, 0, LDEXP_TOLERANCE, 0}, +{ 308, 3209944762u, 670974566u, 0u, 343u, 3569606330u, 670974566u, 0, LDEXP_TOLERANCE, 0}, +{ 309, 3221122343u, 2051675610u, 0u, 390u, 3630066983u, 2051675610u, 0, LDEXP_TOLERANCE, 0}, +{ 310, 1042941085u, 1098012699u, 0u, 155u, 1205470365u, 1098012699u, 0, LDEXP_TOLERANCE, 0}, +{ 311, 3198635158u, 2576510619u, 0u, 399u, 3617016982u, 2576510619u, 0, LDEXP_TOLERANCE, 0}, +{ 312, 1093732734u, 2212627257u, 0u, 220u, 1324419454u, 2212627257u, 0, LDEXP_TOLERANCE, 0}, +{ 313, 1079731753u, 2815026996u, 0u, 352u, 1448830505u, 2815026996u, 0, LDEXP_TOLERANCE, 0}, +{ 314, 1057143242u, 908275876u, 0u, 334u, 1407367626u, 908275876u, 0, LDEXP_TOLERANCE, 0}, +{ 315, 3228249088u, 4054744334u, 0u, 389u, 3636145152u, 4054744334u, 0, LDEXP_TOLERANCE, 0}, +{ 316, 1051974004u, 749718883u, 0u, 80u, 1135860084u, 749718883u, 0, LDEXP_TOLERANCE, 0}, +{ 317, 3214025736u, 4166701781u, 0u, 480u, 3717342216u, 4166701781u, 0, LDEXP_TOLERANCE, 0}, +{ 318, 1066562662u, 3849549110u, 0u, 336u, 1418884198u, 3849549110u, 0, LDEXP_TOLERANCE, 0}, +{ 319, 3191009014u, 3648637481u, 0u, 438u, 3650285302u, 3648637481u, 0, LDEXP_TOLERANCE, 0}, +{ 320, 3205610460u, 229827507u, 0u, 298u, 3518086108u, 229827507u, 0, LDEXP_TOLERANCE, 0}, +{ 321, 1096643939u, 4161699205u, 0u, 413u, 1529705827u, 4161699205u, 0, LDEXP_TOLERANCE, 0}, +{ 322, 3195639002u, 2610757921u, 0u, 297u, 3507066074u, 2610757921u, 0, LDEXP_TOLERANCE, 0}, +{ 323, 1101813983u, 545051245u, 0u, 68u, 1173117151u, 545051245u, 0, LDEXP_TOLERANCE, 0}, +{ 324, 3220046694u, 3097521578u, 0u, 11u, 3231581030u, 3097521578u, 0, LDEXP_TOLERANCE, 0}, +{ 325, 3216630070u, 1141349287u, 0u, 485u, 3725189430u, 1141349287u, 0, LDEXP_TOLERANCE, 0}, +{ 326, 3236866557u, 3586841689u, 0u, 44u, 3283003901u, 3586841689u, 0, LDEXP_TOLERANCE, 0}, +{ 327, 1089595934u, 2642699773u, 0u, 52u, 1144121886u, 2642699773u, 0, LDEXP_TOLERANCE, 0}, +{ 328, 3233606825u, 1521902674u, 0u, 334u, 3583831209u, 1521902674u, 0, LDEXP_TOLERANCE, 0}, +{ 329, 1066370780u, 1166542459u, 0u, 333u, 1415546588u, 1166542459u, 0, LDEXP_TOLERANCE, 0}, +{ 330, 3220123386u, 2769313057u, 0u, 150u, 3377409786u, 2769313057u, 0, LDEXP_TOLERANCE, 0}, +{ 331, 1098471976u, 1840369334u, 0u, 14u, 1113152040u, 1840369334u, 0, LDEXP_TOLERANCE, 0}, +{ 332, 3252677278u, 2567854096u, 0u, 248u, 3512724126u, 2567854096u, 0, LDEXP_TOLERANCE, 0}, +{ 333, 1070061501u, 1222383416u, 0u, 474u, 1567086525u, 1222383416u, 0, LDEXP_TOLERANCE, 0}, +{ 334, 3207981719u, 1270950554u, 0u, 256u, 3476417175u, 1270950554u, 0, LDEXP_TOLERANCE, 0}, +{ 335, 1041332729u, 131817720u, 0u, 452u, 1515289081u, 131817720u, 0, LDEXP_TOLERANCE, 0}, +{ 336, 1043119240u, 1962885016u, 0u, 374u, 1435286664u, 1962885016u, 0, LDEXP_TOLERANCE, 0}, +{ 337, 3218047470u, 3052053491u, 0u, 468u, 3708781038u, 3052053491u, 0, LDEXP_TOLERANCE, 0}, +{ 338, 1066224243u, 4082134039u, 0u, 227u, 1304250995u, 4082134039u, 0, LDEXP_TOLERANCE, 0}, +{ 339, 3203939696u, 1286929228u, 0u, 35u, 3240639856u, 1286929228u, 0, LDEXP_TOLERANCE, 0}, +{ 340, 3202852071u, 1723150716u, 0u, 177u, 3388450023u, 1723150716u, 0, LDEXP_TOLERANCE, 0}, +{ 341, 3228645956u, 3351728246u, 0u, 228u, 3467721284u, 3351728246u, 0, LDEXP_TOLERANCE, 0}, +{ 342, 1081598008u, 3664833573u, 0u, 167u, 1256710200u, 3664833573u, 0, LDEXP_TOLERANCE, 0}, +{ 343, 1104965247u, 143071571u, 0u, 448u, 1574727295u, 143071571u, 0, LDEXP_TOLERANCE, 0}, +{ 344, 1050966579u, 2318822594u, 0u, 195u, 1255438899u, 2318822594u, 0, LDEXP_TOLERANCE, 0}, +{ 345, 1093372204u, 709906874u, 0u, 330u, 1439402284u, 709906874u, 0, LDEXP_TOLERANCE, 0}, +{ 346, 3231728166u, 566369690u, 0u, 261u, 3505406502u, 566369690u, 0, LDEXP_TOLERANCE, 0}, +{ 347, 3216582391u, 4025642424u, 0u, 291u, 3521718007u, 4025642424u, 0, LDEXP_TOLERANCE, 0}, +{ 348, 1062802257u, 1894196767u, 0u, 383u, 1464406865u, 1894196767u, 0, LDEXP_TOLERANCE, 0}, +{ 349, 3245017107u, 3370316038u, 0u, 355u, 3617261587u, 3370316038u, 0, LDEXP_TOLERANCE, 0}, +{ 350, 3243448963u, 472093737u, 0u, 342u, 3602061955u, 472093737u, 0, LDEXP_TOLERANCE, 0}, +{ 351, 1075652455u, 1775629954u, 0u, 415u, 1510811495u, 1775629954u, 0, LDEXP_TOLERANCE, 0}, +{ 352, 1072748883u, 130452005u, 0u, 460u, 1555093843u, 130452005u, 0, LDEXP_TOLERANCE, 0}, +{ 353, 1103299779u, 947955476u, 0u, 82u, 1189283011u, 947955476u, 0, LDEXP_TOLERANCE, 0}, +{ 354, 1101236445u, 2334159798u, 0u, 108u, 1214482653u, 2334159798u, 0, LDEXP_TOLERANCE, 0}, +{ 355, 1070535958u, 4123069999u, 0u, 150u, 1227822358u, 4123069999u, 0, LDEXP_TOLERANCE, 0}, +{ 356, 1089976512u, 2465499154u, 0u, 266u, 1368897728u, 2465499154u, 0, LDEXP_TOLERANCE, 0}, +{ 357, 3201817089u, 1593603389u, 0u, 407u, 3628587521u, 1593603389u, 0, LDEXP_TOLERANCE, 0}, +{ 358, 1047787098u, 2933875948u, 0u, 108u, 1161033306u, 2933875948u, 0, LDEXP_TOLERANCE, 0}, +{ 359, 1079279810u, 1807691639u, 0u, 444u, 1544847554u, 1807691639u, 0, LDEXP_TOLERANCE, 0}, +{ 360, 1043880753u, 3730428641u, 0u, 463u, 1529371441u, 3730428641u, 0, LDEXP_TOLERANCE, 0}, +{ 361, 1096723626u, 3360816360u, 0u, 427u, 1544465578u, 3360816360u, 0, LDEXP_TOLERANCE, 0}, +{ 362, 3197488312u, 1678396836u, 0u, 238u, 3447049400u, 1678396836u, 0, LDEXP_TOLERANCE, 0}, +{ 363, 3226762726u, 424413376u, 0u, 258u, 3497295334u, 424413376u, 0, LDEXP_TOLERANCE, 0}, +{ 364, 1080633926u, 3716185739u, 0u, 187u, 1276717638u, 3716185739u, 0, LDEXP_TOLERANCE, 0}, +{ 365, 3204867490u, 3920379359u, 0u, 431u, 3656803746u, 3920379359u, 0, LDEXP_TOLERANCE, 0}, +{ 366, 3215772443u, 1323631105u, 0u, 191u, 3416050459u, 1323631105u, 0, LDEXP_TOLERANCE, 0}, +{ 367, 1050683091u, 2514548244u, 0u, 173u, 1232086739u, 2514548244u, 0, LDEXP_TOLERANCE, 0}, +{ 368, 3239000308u, 1788218301u, 0u, 34u, 3274651892u, 1788218301u, 0, LDEXP_TOLERANCE, 0}, +{ 369, 3237555984u, 1830011528u, 0u, 319u, 3572051728u, 1830011528u, 0, LDEXP_TOLERANCE, 0}, +{ 370, 1092971882u, 513397822u, 0u, 220u, 1323658602u, 513397822u, 0, LDEXP_TOLERANCE, 0}, +{ 371, 3195171314u, 444369027u, 0u, 36u, 3232920050u, 444369027u, 0, LDEXP_TOLERANCE, 0}, +{ 372, 1090970899u, 3889472979u, 0u, 419u, 1530324243u, 3889472979u, 0, LDEXP_TOLERANCE, 0}, +{ 373, 1057363231u, 2309685487u, 0u, 378u, 1453724959u, 2309685487u, 0, LDEXP_TOLERANCE, 0}, +{ 374, 1106459870u, 1380631766u, 0u, 437u, 1564687582u, 1380631766u, 0, LDEXP_TOLERANCE, 0}, +{ 375, 3248396473u, 428200516u, 0u, 376u, 3642661049u, 428200516u, 0, LDEXP_TOLERANCE, 0}, +{ 376, 1058529374u, 1388434855u, 0u, 328u, 1402462302u, 1388434855u, 0, LDEXP_TOLERANCE, 0}, +{ 377, 1073564525u, 1634474775u, 0u, 306u, 1394428781u, 1634474775u, 0, LDEXP_TOLERANCE, 0}, +{ 378, 3253676249u, 2523906064u, 0u, 39u, 3294570713u, 2523906064u, 0, LDEXP_TOLERANCE, 0}, +{ 379, 1081755890u, 1525260440u, 0u, 250u, 1343899890u, 1525260440u, 0, LDEXP_TOLERANCE, 0}, +{ 380, 3203074326u, 1872475395u, 0u, 108u, 3316320534u, 1872475395u, 0, LDEXP_TOLERANCE, 0}, +{ 381, 1084871394u, 3237497681u, 0u, 443u, 1549390562u, 3237497681u, 0, LDEXP_TOLERANCE, 0}, +{ 382, 3242751645u, 260260645u, 0u, 481u, 3747116701u, 260260645u, 0, LDEXP_TOLERANCE, 0}, +{ 383, 3218981444u, 4088124503u, 0u, 110u, 3334324804u, 4088124503u, 0, LDEXP_TOLERANCE, 0}, +{ 384, 1071801993u, 814008375u, 0u, 336u, 1424123529u, 814008375u, 0, LDEXP_TOLERANCE, 0}, +{ 385, 1066437805u, 3656359254u, 0u, 66u, 1135643821u, 3656359254u, 0, LDEXP_TOLERANCE, 0}, +{ 386, 3203021744u, 2817965308u, 0u, 440u, 3664395184u, 2817965308u, 0, LDEXP_TOLERANCE, 0}, +{ 387, 3230741411u, 1789555686u, 0u, 143u, 3380687779u, 1789555686u, 0, LDEXP_TOLERANCE, 0}, +{ 388, 1080923606u, 1088945233u, 0u, 95u, 1180538326u, 1088945233u, 0, LDEXP_TOLERANCE, 0}, +{ 389, 3207306559u, 1072535369u, 0u, 356u, 3580599615u, 1072535369u, 0, LDEXP_TOLERANCE, 0}, +{ 390, 1070189724u, 891892107u, 0u, 31u, 1102695580u, 891892107u, 0, LDEXP_TOLERANCE, 0}, +{ 391, 3190088451u, 2651702199u, 0u, 404u, 3613713155u, 2651702199u, 0, LDEXP_TOLERANCE, 0}, +{ 392, 1060939155u, 4016460801u, 0u, 419u, 1500292499u, 4016460801u, 0, LDEXP_TOLERANCE, 0}, +{ 393, 1045144591u, 3993557701u, 0u, 87u, 1136370703u, 3993557701u, 0, LDEXP_TOLERANCE, 0}, +{ 394, 3239768936u, 2532362633u, 0u, 260u, 3512398696u, 2532362633u, 0, LDEXP_TOLERANCE, 0}, +{ 395, 1073180085u, 3537487468u, 0u, 388u, 1480027573u, 3537487468u, 0, LDEXP_TOLERANCE, 0}, +{ 396, 3198529584u, 564216088u, 0u, 421u, 3639980080u, 564216088u, 0, LDEXP_TOLERANCE, 0}, +{ 397, 3231451722u, 144814872u, 0u, 377u, 3626764874u, 144814872u, 0, LDEXP_TOLERANCE, 0}, +{ 398, 1072709093u, 596120394u, 0u, 25u, 1098923493u, 596120394u, 0, LDEXP_TOLERANCE, 0}, +{ 399, 1067876025u, 3310262308u, 0u, 313u, 1396080313u, 3310262308u, 0, LDEXP_TOLERANCE, 0}, +{ 400, 3213074059u, 4166287959u, 0u, 332u, 3561201291u, 4166287959u, 0, LDEXP_TOLERANCE, 0}, +{ 401, 1041212112u, 3518868553u, 0u, 279u, 1333764816u, 3518868553u, 0, LDEXP_TOLERANCE, 0}, +{ 402, 1066131946u, 3173459054u, 0u, 324u, 1405870570u, 3173459054u, 0, LDEXP_TOLERANCE, 0}, +{ 403, 3202593969u, 1428731905u, 0u, 168u, 3378754737u, 1428731905u, 0, LDEXP_TOLERANCE, 0}, +{ 404, 1054790485u, 453215326u, 0u, 371u, 1443812181u, 453215326u, 0, LDEXP_TOLERANCE, 0}, +{ 405, 3200044385u, 467903731u, 0u, 183u, 3391933793u, 467903731u, 0, LDEXP_TOLERANCE, 0}, +{ 406, 1072744324u, 1813392963u, 0u, 180u, 1261488004u, 1813392963u, 0, LDEXP_TOLERANCE, 0}, +{ 407, 3227858678u, 3521174478u, 0u, 427u, 3675600630u, 3521174478u, 0, LDEXP_TOLERANCE, 0}, +{ 408, 3220431019u, 1451134835u, 0u, 159u, 3387154603u, 1451134835u, 0, LDEXP_TOLERANCE, 0}, +{ 409, 1072890925u, 478199813u, 0u, 188u, 1270023213u, 478199813u, 0, LDEXP_TOLERANCE, 0}, +{ 410, 3247518236u, 2319141545u, 0u, 182u, 3438359068u, 2319141545u, 0, LDEXP_TOLERANCE, 0}, +{ 411, 3205208241u, 468540316u, 0u, 236u, 3452672177u, 468540316u, 0, LDEXP_TOLERANCE, 0}, +{ 412, 1088186210u, 2805548583u, 0u, 80u, 1172072290u, 2805548583u, 0, LDEXP_TOLERANCE, 0}, +{ 413, 3208941801u, 3799277222u, 0u, 491u, 3723792617u, 3799277222u, 0, LDEXP_TOLERANCE, 0}, +{ 414, 1098778634u, 4116114952u, 0u, 403u, 1521354762u, 4116114952u, 0, LDEXP_TOLERANCE, 0}, +{ 415, 1089501101u, 3088319870u, 0u, 415u, 1524660141u, 3088319870u, 0, LDEXP_TOLERANCE, 0}, +{ 416, 1092033606u, 4147340419u, 0u, 424u, 1536629830u, 4147340419u, 0, LDEXP_TOLERANCE, 0}, +{ 417, 1097192134u, 2915618902u, 0u, 289u, 1400230598u, 2915618902u, 0, LDEXP_TOLERANCE, 0}, +{ 418, 1083131407u, 949573155u, 0u, 213u, 1306478095u, 949573155u, 0, LDEXP_TOLERANCE, 0}, +{ 419, 3217299226u, 953230084u, 0u, 56u, 3276019482u, 953230084u, 0, LDEXP_TOLERANCE, 0}, +{ 420, 1042658166u, 1139656827u, 0u, 464u, 1529197430u, 1139656827u, 0, LDEXP_TOLERANCE, 0}, +{ 421, 1074812004u, 1497640128u, 0u, 126u, 1206932580u, 1497640128u, 0, LDEXP_TOLERANCE, 0}, +{ 422, 1049329601u, 1399097473u, 0u, 433u, 1503363009u, 1399097473u, 0, LDEXP_TOLERANCE, 0}, +{ 423, 3206749408u, 547789874u, 0u, 431u, 3658685664u, 547789874u, 0, LDEXP_TOLERANCE, 0}, +{ 424, 1074621795u, 671680995u, 0u, 3u, 1077767523u, 671680995u, 0, LDEXP_TOLERANCE, 0}, +{ 425, 3213380440u, 2844394564u, 0u, 143u, 3363326808u, 2844394564u, 0, LDEXP_TOLERANCE, 0}, +{ 426, 3237267124u, 1206228129u, 0u, 339u, 3592734388u, 1206228129u, 0, LDEXP_TOLERANCE, 0}, +{ 427, 1048320712u, 1857527908u, 0u, 184u, 1241258696u, 1857527908u, 0, LDEXP_TOLERANCE, 0}, +{ 428, 1073593099u, 3529728583u, 0u, 248u, 1333639947u, 3529728583u, 0, LDEXP_TOLERANCE, 0}, +{ 429, 3208234855u, 1662197629u, 0u, 448u, 3677996903u, 1662197629u, 0, LDEXP_TOLERANCE, 0}, +{ 430, 3227209251u, 830911610u, 0u, 206u, 3443215907u, 830911610u, 0, LDEXP_TOLERANCE, 0}, +{ 431, 3191658671u, 3234651229u, 0u, 489u, 3704412335u, 3234651229u, 0, LDEXP_TOLERANCE, 0}, +{ 432, 1060602604u, 1595574604u, 0u, 233u, 1304920812u, 1595574604u, 0, LDEXP_TOLERANCE, 0}, +{ 433, 1060196346u, 2183973116u, 0u, 199u, 1268862970u, 2183973116u, 0, LDEXP_TOLERANCE, 0}, +{ 434, 3237212525u, 2067967151u, 0u, 187u, 3433296237u, 2067967151u, 0, LDEXP_TOLERANCE, 0}, +{ 435, 3249591914u, 4276685796u, 0u, 405u, 3674265194u, 4276685796u, 0, LDEXP_TOLERANCE, 0}, +{ 436, 1097175658u, 915990537u, 0u, 414u, 1531286122u, 915990537u, 0, LDEXP_TOLERANCE, 0}, +{ 437, 1096215811u, 3833628834u, 0u, 292u, 1402400003u, 3833628834u, 0, LDEXP_TOLERANCE, 0}, +{ 438, 1081543609u, 2711665335u, 0u, 195u, 1286015929u, 2711665335u, 0, LDEXP_TOLERANCE, 0}, +{ 439, 1103411165u, 2706155273u, 0u, 24u, 1128576989u, 2706155273u, 0, LDEXP_TOLERANCE, 0}, +{ 440, 1103403130u, 3079968054u, 0u, 241u, 1356109946u, 3079968054u, 0, LDEXP_TOLERANCE, 0}, +{ 441, 3198414665u, 2268506342u, 0u, 95u, 3298029385u, 2268506342u, 0, LDEXP_TOLERANCE, 0}, +{ 442, 1047115221u, 1909994277u, 0u, 56u, 1105835477u, 1909994277u, 0, LDEXP_TOLERANCE, 0}, +{ 443, 3220384775u, 2863812374u, 0u, 101u, 3326290951u, 2863812374u, 0, LDEXP_TOLERANCE, 0}, +{ 444, 1100817899u, 1574724647u, 0u, 234u, 1346184683u, 1574724647u, 0, LDEXP_TOLERANCE, 0}, +{ 445, 3224207486u, 2292911279u, 0u, 169u, 3401416830u, 2292911279u, 0, LDEXP_TOLERANCE, 0}, +{ 446, 3210915147u, 1990631620u, 0u, 63u, 3276975435u, 1990631620u, 0, LDEXP_TOLERANCE, 0}, +{ 447, 1102409950u, 2676261059u, 0u, 337u, 1455780062u, 2676261059u, 0, LDEXP_TOLERANCE, 0}, +{ 448, 1097873191u, 1354342308u, 0u, 178u, 1284519719u, 1354342308u, 0, LDEXP_TOLERANCE, 0}, +{ 449, 3244247065u, 1660724156u, 0u, 204u, 3458156569u, 1660724156u, 0, LDEXP_TOLERANCE, 0}, +{ 450, 1104332602u, 1642699485u, 0u, 379u, 1501742906u, 1642699485u, 0, LDEXP_TOLERANCE, 0}, +{ 451, 3250424296u, 1717672108u, 0u, 243u, 3505228264u, 1717672108u, 0, LDEXP_TOLERANCE, 0}, +{ 452, 1104754957u, 287287829u, 0u, 96u, 1205418253u, 287287829u, 0, LDEXP_TOLERANCE, 0}, +{ 453, 1041630773u, 1858851717u, 0u, 84u, 1129711157u, 1858851717u, 0, LDEXP_TOLERANCE, 0}, +{ 454, 3214257433u, 751088586u, 0u, 320u, 3549801753u, 751088586u, 0, LDEXP_TOLERANCE, 0}, +{ 455, 3220003982u, 1397652531u, 0u, 257u, 3489488014u, 1397652531u, 0, LDEXP_TOLERANCE, 0}, +{ 456, 3227225453u, 3847749145u, 0u, 472u, 3722153325u, 3847749145u, 0, LDEXP_TOLERANCE, 0}, +{ 457, 1070645131u, 2477088719u, 0u, 326u, 1412480907u, 2477088719u, 0, LDEXP_TOLERANCE, 0}, +{ 458, 3227562493u, 857975269u, 0u, 17u, 3245388285u, 857975269u, 0, LDEXP_TOLERANCE, 0}, +{ 459, 3194188951u, 1711780367u, 0u, 268u, 3475207319u, 1711780367u, 0, LDEXP_TOLERANCE, 0}, +{ 460, 3235476602u, 451471221u, 0u, 156u, 3399054458u, 451471221u, 0, LDEXP_TOLERANCE, 0}, +{ 461, 1074264014u, 2264504930u, 0u, 409u, 1503131598u, 2264504930u, 0, LDEXP_TOLERANCE, 0}, +{ 462, 3228769528u, 1854181735u, 0u, 492u, 3744668920u, 1854181735u, 0, LDEXP_TOLERANCE, 0}, +{ 463, 1046699567u, 1591940213u, 0u, 266u, 1325620783u, 1591940213u, 0, LDEXP_TOLERANCE, 0}, +{ 464, 1061875970u, 1378057304u, 0u, 400u, 1481306370u, 1378057304u, 0, LDEXP_TOLERANCE, 0}, +{ 465, 1058821926u, 2422126348u, 0u, 148u, 1214011174u, 2422126348u, 0, LDEXP_TOLERANCE, 0}, +{ 466, 3228077848u, 3932207622u, 0u, 192u, 3429404440u, 3932207622u, 0, LDEXP_TOLERANCE, 0}, +{ 467, 3195658563u, 2548035700u, 0u, 425u, 3641303363u, 2548035700u, 0, LDEXP_TOLERANCE, 0}, +{ 468, 1090631865u, 3113298011u, 0u, 167u, 1265744057u, 3113298011u, 0, LDEXP_TOLERANCE, 0}, +{ 469, 3192989874u, 286247089u, 0u, 112u, 3310430386u, 286247089u, 0, LDEXP_TOLERANCE, 0}, +{ 470, 3253628449u, 1026197853u, 0u, 116u, 3375263265u, 1026197853u, 0, LDEXP_TOLERANCE, 0}, +{ 471, 1074666768u, 375674756u, 0u, 282u, 1370365200u, 375674756u, 0, LDEXP_TOLERANCE, 0}, +{ 472, 3188722502u, 2287547512u, 0u, 386u, 3593472838u, 2287547512u, 0, LDEXP_TOLERANCE, 0}, +{ 473, 3195629985u, 1263494177u, 0u, 354u, 3566825889u, 1263494177u, 0, LDEXP_TOLERANCE, 0}, +{ 474, 3204259255u, 1611440636u, 0u, 0u, 3204259255u, 1611440636u, 0, LDEXP_TOLERANCE, 0}, +{ 475, 3213589312u, 1865725974u, 0u, 254u, 3479927616u, 1865725974u, 0, LDEXP_TOLERANCE, 0}, +{ 476, 3207039183u, 115770551u, 0u, 289u, 3510077647u, 115770551u, 0, LDEXP_TOLERANCE, 0}, +{ 477, 1070132645u, 1245005118u, 0u, 328u, 1414065573u, 1245005118u, 0, LDEXP_TOLERANCE, 0}, +{ 478, 1078173946u, 1482721827u, 0u, 107u, 1190371578u, 1482721827u, 0, LDEXP_TOLERANCE, 0}, +{ 479, 3192359503u, 3736750583u, 0u, 344u, 3553069647u, 3736750583u, 0, LDEXP_TOLERANCE, 0}, +{ 480, 1090362269u, 2431996507u, 0u, 470u, 1583192989u, 2431996507u, 0, LDEXP_TOLERANCE, 0}, +{ 481, 1102017594u, 242934189u, 0u, 127u, 1235186746u, 242934189u, 0, LDEXP_TOLERANCE, 0}, +{ 482, 1082841536u, 4287291972u, 0u, 308u, 1405802944u, 4287291972u, 0, LDEXP_TOLERANCE, 0}, +{ 483, 1078562189u, 3455122647u, 0u, 77u, 1159302541u, 3455122647u, 0, LDEXP_TOLERANCE, 0}, +{ 484, 3209380687u, 1980318203u, 0u, 417u, 3646636879u, 1980318203u, 0, LDEXP_TOLERANCE, 0}, +{ 485, 1081309333u, 3384251967u, 0u, 134u, 1221818517u, 3384251967u, 0, LDEXP_TOLERANCE, 0}, +{ 486, 3245133381u, 2923526078u, 0u, 405u, 3669806661u, 2923526078u, 0, LDEXP_TOLERANCE, 0}, +{ 487, 1064525899u, 3742487766u, 0u, 228u, 1303601227u, 3742487766u, 0, LDEXP_TOLERANCE, 0}, +{ 488, 1091346793u, 3289095948u, 0u, 430u, 1542234473u, 3289095948u, 0, LDEXP_TOLERANCE, 0}, +{ 489, 1058117934u, 2454945617u, 0u, 113u, 1176607022u, 2454945617u, 0, LDEXP_TOLERANCE, 0}, +{ 490, 1078811133u, 1275993403u, 0u, 24u, 1103976957u, 1275993403u, 0, LDEXP_TOLERANCE, 0}, +{ 491, 3196196192u, 2695666837u, 0u, 6u, 3202487648u, 2695666837u, 0, LDEXP_TOLERANCE, 0}, +{ 492, 1047966215u, 3447944313u, 0u, 340u, 1404482055u, 3447944313u, 0, LDEXP_TOLERANCE, 0}, +{ 493, 1101711780u, 2982959266u, 0u, 303u, 1419430308u, 2982959266u, 0, LDEXP_TOLERANCE, 0}, +{ 494, 1054840864u, 171409502u, 0u, 129u, 1190107168u, 171409502u, 0, LDEXP_TOLERANCE, 0}, +{ 495, 3197943165u, 3921063782u, 0u, 362u, 3577527677u, 3921063782u, 0, LDEXP_TOLERANCE, 0}, +{ 496, 3189290617u, 1578223762u, 0u, 36u, 3227039353u, 1578223762u, 0, LDEXP_TOLERANCE, 0}, +{ 497, 3192959856u, 1469212191u, 0u, 74u, 3270554480u, 1469212191u, 0, LDEXP_TOLERANCE, 0}, +{ 498, 1054233191u, 2295692754u, 0u, 211u, 1275482727u, 2295692754u, 0, LDEXP_TOLERANCE, 0}, +{ 499, 1053077031u, 3459566012u, 0u, 275u, 1341435431u, 3459566012u, 0, LDEXP_TOLERANCE, 0}, +{ 500, 3251200938u, 4126298722u, 0u, 375u, 3644416938u, 4126298722u, 0, LDEXP_TOLERANCE, 0}, +{ 501, 3232343117u, 2520630720u, 0u, 62u, 3297354829u, 2520630720u, 0, LDEXP_TOLERANCE, 0}, +{ 502, 3213037619u, 887645440u, 0u, 43u, 3258126387u, 887645440u, 0, LDEXP_TOLERANCE, 0}, +{ 503, 1086002105u, 946455365u, 0u, 277u, 1376457657u, 946455365u, 0, LDEXP_TOLERANCE, 0}, +{ 504, 3201736709u, 1632857891u, 0u, 340u, 3558252549u, 1632857891u, 0, LDEXP_TOLERANCE, 0}, +{ 505, 1040729961u, 4162008079u, 0u, 206u, 1256736617u, 4162008079u, 0, LDEXP_TOLERANCE, 0}, +{ 506, 1059120765u, 3425518947u, 0u, 278u, 1350624893u, 3425518947u, 0, LDEXP_TOLERANCE, 0}, +{ 507, 3251307470u, 4210912679u, 0u, 407u, 3678077902u, 4210912679u, 0, LDEXP_TOLERANCE, 0}, +{ 508, 1090416633u, 2533687683u, 0u, 435u, 1546547193u, 2533687683u, 0, LDEXP_TOLERANCE, 0}, +{ 509, 3235947244u, 2569281387u, 0u, 394u, 3649086188u, 2569281387u, 0, LDEXP_TOLERANCE, 0}, +{ 510, 3245016670u, 1480024922u, 0u, 152u, 3404400222u, 1480024922u, 0, LDEXP_TOLERANCE, 0}, +{ 511, 3208595959u, 3494862794u, 0u, 490u, 3722398199u, 3494862794u, 0, LDEXP_TOLERANCE, 0}, +{ 512, 3242919505u, 3642407092u, 0u, 109u, 3357214289u, 3642407092u, 0, LDEXP_TOLERANCE, 0}, +{ 513, 3252287877u, 3550162331u, 0u, 355u, 3624532357u, 3550162331u, 0, LDEXP_TOLERANCE, 0}, +{ 514, 3246984334u, 2132131375u, 0u, 42u, 3291024526u, 2132131375u, 0, LDEXP_TOLERANCE, 0}, +{ 515, 3251248752u, 3821901768u, 0u, 369u, 3638173296u, 3821901768u, 0, LDEXP_TOLERANCE, 0}, +{ 516, 1061777502u, 3236596516u, 0u, 339u, 1417244766u, 3236596516u, 0, LDEXP_TOLERANCE, 0}, +{ 517, 3240164097u, 57443054u, 0u, 474u, 3737189121u, 57443054u, 0, LDEXP_TOLERANCE, 0}, +{ 518, 1101921141u, 2928317152u, 0u, 370u, 1489894261u, 2928317152u, 0, LDEXP_TOLERANCE, 0}, +{ 519, 3246958541u, 122162205u, 0u, 395u, 3661146061u, 122162205u, 0, LDEXP_TOLERANCE, 0}, +{ 520, 3194834642u, 2706165300u, 0u, 200u, 3404549842u, 2706165300u, 0, LDEXP_TOLERANCE, 0}, +{ 521, 1094479529u, 1626929878u, 0u, 134u, 1234988713u, 1626929878u, 0, LDEXP_TOLERANCE, 0}, +{ 522, 1083449076u, 2102520884u, 0u, 9u, 1092886260u, 2102520884u, 0, LDEXP_TOLERANCE, 0}, +{ 523, 1076012412u, 2211699255u, 0u, 461u, 1559405948u, 2211699255u, 0, LDEXP_TOLERANCE, 0}, +{ 524, 1041731776u, 2028363648u, 0u, 355u, 1413976256u, 2028363648u, 0, LDEXP_TOLERANCE, 0}, +{ 525, 3187775160u, 2996976481u, 0u, 232u, 3431044792u, 2996976481u, 0, LDEXP_TOLERANCE, 0}, +{ 526, 3248213693u, 3041999329u, 0u, 446u, 3715878589u, 3041999329u, 0, LDEXP_TOLERANCE, 0}, +{ 527, 3196191712u, 1648584571u, 0u, 487u, 3706848224u, 1648584571u, 0, LDEXP_TOLERANCE, 0}, +{ 528, 1093069876u, 540311934u, 0u, 362u, 1472654388u, 540311934u, 0, LDEXP_TOLERANCE, 0}, +{ 529, 3205345633u, 3472075644u, 0u, 259u, 3476926817u, 3472075644u, 0, LDEXP_TOLERANCE, 0}, +{ 530, 1079561503u, 3840720032u, 0u, 17u, 1097387295u, 3840720032u, 0, LDEXP_TOLERANCE, 0}, +{ 531, 3240017460u, 1099567884u, 0u, 484u, 3747528244u, 1099567884u, 0, LDEXP_TOLERANCE, 0}, +{ 532, 3238593552u, 2560836004u, 0u, 269u, 3520660496u, 2560836004u, 0, LDEXP_TOLERANCE, 0}, +{ 533, 1072457286u, 524706354u, 0u, 254u, 1338795590u, 524706354u, 0, LDEXP_TOLERANCE, 0}, +{ 534, 3234908869u, 3264644151u, 0u, 135u, 3376466629u, 3264644151u, 0, LDEXP_TOLERANCE, 0}, +{ 535, 1058314227u, 2407947243u, 0u, 168u, 1234474995u, 2407947243u, 0, LDEXP_TOLERANCE, 0}, +{ 536, 3199467414u, 230193094u, 0u, 462u, 3683909526u, 230193094u, 0, LDEXP_TOLERANCE, 0}, +{ 537, 3198629672u, 2624677381u, 0u, 57u, 3258398504u, 2624677381u, 0, LDEXP_TOLERANCE, 0}, +{ 538, 1085107111u, 1970804718u, 0u, 160u, 1252879271u, 1970804718u, 0, LDEXP_TOLERANCE, 0}, +{ 539, 3247005564u, 1254715281u, 0u, 233u, 3491323772u, 1254715281u, 0, LDEXP_TOLERANCE, 0}, +{ 540, 3233088901u, 1323165917u, 0u, 346u, 3595896197u, 1323165917u, 0, LDEXP_TOLERANCE, 0}, +{ 541, 1085173524u, 2194185737u, 0u, 294u, 1393454868u, 2194185737u, 0, LDEXP_TOLERANCE, 0}, +{ 542, 3217851015u, 1006976371u, 0u, 248u, 3477897863u, 1006976371u, 0, LDEXP_TOLERANCE, 0}, +{ 543, 1097592222u, 627593287u, 0u, 427u, 1545334174u, 627593287u, 0, LDEXP_TOLERANCE, 0}, +{ 544, 1086229861u, 2658788310u, 0u, 363u, 1466862949u, 2658788310u, 0, LDEXP_TOLERANCE, 0}, +{ 545, 3207822943u, 4059505387u, 0u, 450u, 3679682143u, 4059505387u, 0, LDEXP_TOLERANCE, 0}, +{ 546, 3252737468u, 3812071034u, 0u, 332u, 3600864700u, 3812071034u, 0, LDEXP_TOLERANCE, 0}, +{ 547, 1059648367u, 999149762u, 0u, 233u, 1303966575u, 999149762u, 0, LDEXP_TOLERANCE, 0}, +{ 548, 3252484132u, 781792055u, 0u, 491u, 3767334948u, 781792055u, 0, LDEXP_TOLERANCE, 0}, +{ 549, 1054559826u, 3046272894u, 0u, 261u, 1328238162u, 3046272894u, 0, LDEXP_TOLERANCE, 0}, +{ 550, 3205481779u, 1532426189u, 0u, 295u, 3514811699u, 1532426189u, 0, LDEXP_TOLERANCE, 0}, +{ 551, 1075179177u, 214596211u, 0u, 488u, 1586884265u, 214596211u, 0, LDEXP_TOLERANCE, 0}, +{ 552, 1098103739u, 3832087890u, 0u, 204u, 1312013243u, 3832087890u, 0, LDEXP_TOLERANCE, 0}, +{ 553, 1077515271u, 593538252u, 0u, 86u, 1167692807u, 593538252u, 0, LDEXP_TOLERANCE, 0}, +{ 554, 1083592720u, 3097953262u, 0u, 88u, 1175867408u, 3097953262u, 0, LDEXP_TOLERANCE, 0}, +{ 555, 1054141917u, 2033383695u, 0u, 38u, 1093987805u, 2033383695u, 0, LDEXP_TOLERANCE, 0}, +{ 556, 1048495909u, 3670016377u, 0u, 497u, 1569638181u, 3670016377u, 0, LDEXP_TOLERANCE, 0}, +{ 557, 1050809029u, 3775007802u, 0u, 425u, 1496453829u, 3775007802u, 0, LDEXP_TOLERANCE, 0}, +{ 558, 3238703280u, 3436328857u, 0u, 466u, 3727339696u, 3436328857u, 0, LDEXP_TOLERANCE, 0}, +{ 559, 3197179414u, 3119528953u, 0u, 313u, 3525383702u, 3119528953u, 0, LDEXP_TOLERANCE, 0}, +{ 560, 1098412609u, 2259509124u, 0u, 375u, 1491628609u, 2259509124u, 0, LDEXP_TOLERANCE, 0}, +{ 561, 3224480068u, 553154637u, 0u, 286u, 3524372804u, 553154637u, 0, LDEXP_TOLERANCE, 0}, +{ 562, 3215254594u, 3738077421u, 0u, 48u, 3265586242u, 3738077421u, 0, LDEXP_TOLERANCE, 0}, +{ 563, 1052031347u, 293137764u, 0u, 193u, 1254406515u, 293137764u, 0, LDEXP_TOLERANCE, 0}, +{ 564, 1048453019u, 3302718156u, 0u, 494u, 1566449563u, 3302718156u, 0, LDEXP_TOLERANCE, 0}, +{ 565, 3223439338u, 3448048638u, 0u, 52u, 3277965290u, 3448048638u, 0, LDEXP_TOLERANCE, 0}, +{ 566, 3223944194u, 1862856951u, 0u, 168u, 3400104962u, 1862856951u, 0, LDEXP_TOLERANCE, 0}, +{ 567, 3244649498u, 3318830570u, 0u, 6u, 3250940954u, 3318830570u, 0, LDEXP_TOLERANCE, 0}, +{ 568, 1095956900u, 168744837u, 0u, 184u, 1288894884u, 168744837u, 0, LDEXP_TOLERANCE, 0}, +{ 569, 1096175678u, 2035208049u, 0u, 248u, 1356222526u, 2035208049u, 0, LDEXP_TOLERANCE, 0}, +{ 570, 1071443591u, 2413085118u, 0u, 415u, 1506602631u, 2413085118u, 0, LDEXP_TOLERANCE, 0}, +{ 571, 3231142151u, 2125266031u, 0u, 154u, 3392622855u, 2125266031u, 0, LDEXP_TOLERANCE, 0}, +{ 572, 3239533970u, 2250119224u, 0u, 342u, 3598146962u, 2250119224u, 0, LDEXP_TOLERANCE, 0}, +{ 573, 1067186195u, 3698426632u, 0u, 130u, 1203501075u, 3698426632u, 0, LDEXP_TOLERANCE, 0}, +{ 574, 3196143186u, 2420102372u, 0u, 268u, 3477161554u, 2420102372u, 0, LDEXP_TOLERANCE, 0}, +{ 575, 3237295327u, 950097945u, 0u, 177u, 3422893279u, 950097945u, 0, LDEXP_TOLERANCE, 0}, +{ 576, 1041232546u, 3621700966u, 0u, 102u, 1148187298u, 3621700966u, 0, LDEXP_TOLERANCE, 0}, +{ 577, 1050106742u, 4027115185u, 0u, 170u, 1228364662u, 4027115185u, 0, LDEXP_TOLERANCE, 0}, +{ 578, 1058573943u, 2226077666u, 0u, 230u, 1299746423u, 2226077666u, 0, LDEXP_TOLERANCE, 0}, +{ 579, 1060691586u, 1178315623u, 0u, 114u, 1180229250u, 1178315623u, 0, LDEXP_TOLERANCE, 0}, +{ 580, 1103796205u, 2401303942u, 0u, 32u, 1137350637u, 2401303942u, 0, LDEXP_TOLERANCE, 0}, +{ 581, 1096468311u, 726651516u, 0u, 499u, 1619707735u, 726651516u, 0, LDEXP_TOLERANCE, 0}, +{ 582, 3222220162u, 3249224838u, 0u, 461u, 3705613698u, 3249224838u, 0, LDEXP_TOLERANCE, 0}, +{ 583, 3254704022u, 384370422u, 0u, 310u, 3579762582u, 384370422u, 0, LDEXP_TOLERANCE, 0}, +{ 584, 1097386147u, 3782310033u, 0u, 243u, 1352190115u, 3782310033u, 0, LDEXP_TOLERANCE, 0}, +{ 585, 3252042528u, 146366045u, 0u, 356u, 3625335584u, 146366045u, 0, LDEXP_TOLERANCE, 0}, +{ 586, 3244118788u, 2529029548u, 0u, 205u, 3459076868u, 2529029548u, 0, LDEXP_TOLERANCE, 0}, +{ 587, 3247146310u, 3286328657u, 0u, 195u, 3451618630u, 3286328657u, 0, LDEXP_TOLERANCE, 0}, +{ 588, 1082254153u, 633487468u, 0u, 173u, 1263657801u, 633487468u, 0, LDEXP_TOLERANCE, 0}, +{ 589, 1106725606u, 4081471542u, 0u, 54u, 1163348710u, 4081471542u, 0, LDEXP_TOLERANCE, 0}, +{ 590, 3235104785u, 2659274428u, 0u, 13u, 3248736273u, 2659274428u, 0, LDEXP_TOLERANCE, 0}, +{ 591, 3192361033u, 3292996609u, 0u, 147u, 3346501705u, 3292996609u, 0, LDEXP_TOLERANCE, 0}, +{ 592, 3243606330u, 1251690243u, 0u, 286u, 3543499066u, 1251690243u, 0, LDEXP_TOLERANCE, 0}, +{ 593, 1078522672u, 534876830u, 0u, 312u, 1405678384u, 534876830u, 0, LDEXP_TOLERANCE, 0}, +{ 594, 3236105559u, 2730725979u, 0u, 133u, 3375566167u, 2730725979u, 0, LDEXP_TOLERANCE, 0}, +{ 595, 3207120390u, 3867917386u, 0u, 120u, 3332949510u, 3867917386u, 0, LDEXP_TOLERANCE, 0}, +{ 596, 3209887750u, 282125870u, 0u, 290u, 3513974790u, 282125870u, 0, LDEXP_TOLERANCE, 0}, +{ 597, 3221192531u, 1378332814u, 0u, 46u, 3269427027u, 1378332814u, 0, LDEXP_TOLERANCE, 0}, +{ 598, 1071438511u, 1456720330u, 0u, 197u, 1278007983u, 1456720330u, 0, LDEXP_TOLERANCE, 0}, +{ 599, 3204862644u, 625779797u, 0u, 242u, 3458618036u, 625779797u, 0, LDEXP_TOLERANCE, 0}, +{ 600, 3188948769u, 1949093709u, 0u, 222u, 3421732641u, 1949093709u, 0, LDEXP_TOLERANCE, 0}, +{ 601, 1040706087u, 1832636825u, 0u, 370u, 1428679207u, 1832636825u, 0, LDEXP_TOLERANCE, 0}, +{ 602, 3241678717u, 4116863145u, 0u, 268u, 3522697085u, 4116863145u, 0, LDEXP_TOLERANCE, 0}, +{ 603, 3254549137u, 1280908320u, 0u, 410u, 3684465297u, 1280908320u, 0, LDEXP_TOLERANCE, 0}, +{ 604, 1044237059u, 849581558u, 0u, 61u, 1108200195u, 849581558u, 0, LDEXP_TOLERANCE, 0}, +{ 605, 3227710894u, 1803008264u, 0u, 159u, 3394434478u, 1803008264u, 0, LDEXP_TOLERANCE, 0}, +{ 606, 3222601478u, 3647912576u, 0u, 158u, 3388276486u, 3647912576u, 0, LDEXP_TOLERANCE, 0}, +{ 607, 3201624749u, 1239907237u, 0u, 69u, 3273976493u, 1239907237u, 0, LDEXP_TOLERANCE, 0}, +{ 608, 1074236329u, 1658600938u, 0u, 471u, 1568115625u, 1658600938u, 0, LDEXP_TOLERANCE, 0}, +{ 609, 1075491548u, 3953853053u, 0u, 216u, 1301983964u, 3953853053u, 0, LDEXP_TOLERANCE, 0}, +{ 610, 3213072244u, 1760177025u, 0u, 266u, 3491993460u, 1760177025u, 0, LDEXP_TOLERANCE, 0}, +{ 611, 1080258478u, 2294697132u, 0u, 293u, 1387491246u, 2294697132u, 0, LDEXP_TOLERANCE, 0}, +{ 612, 3231020290u, 2744719351u, 0u, 429u, 3680859394u, 2744719351u, 0, LDEXP_TOLERANCE, 0}, +{ 613, 3189668753u, 1174874204u, 0u, 125u, 3320740753u, 1174874204u, 0, LDEXP_TOLERANCE, 0}, +{ 614, 1057110584u, 848081004u, 0u, 119u, 1181891128u, 848081004u, 0, LDEXP_TOLERANCE, 0}, +{ 615, 1058101211u, 2085894114u, 0u, 296u, 1368479707u, 2085894114u, 0, LDEXP_TOLERANCE, 0}, +{ 616, 3202306280u, 348102924u, 0u, 288u, 3504296168u, 348102924u, 0, LDEXP_TOLERANCE, 0}, +{ 617, 1093500372u, 2470748422u, 0u, 28u, 1122860500u, 2470748422u, 0, LDEXP_TOLERANCE, 0}, +{ 618, 1061167400u, 138849460u, 0u, 322u, 1398808872u, 138849460u, 0, LDEXP_TOLERANCE, 0}, +{ 619, 1104293747u, 1900437425u, 0u, 483u, 1610755955u, 1900437425u, 0, LDEXP_TOLERANCE, 0}, +{ 620, 1100508815u, 3684301975u, 0u, 67u, 1170763407u, 3684301975u, 0, LDEXP_TOLERANCE, 0}, +{ 621, 1044707490u, 2999949676u, 0u, 75u, 1123350690u, 2999949676u, 0, LDEXP_TOLERANCE, 0}, +{ 622, 3254712629u, 4001809575u, 0u, 38u, 3294558517u, 4001809575u, 0, LDEXP_TOLERANCE, 0}, +{ 623, 3254231152u, 2299565551u, 0u, 431u, 3706167408u, 2299565551u, 0, LDEXP_TOLERANCE, 0}, +{ 624, 3194165277u, 3145100012u, 0u, 387u, 3599964189u, 3145100012u, 0, LDEXP_TOLERANCE, 0}, +{ 625, 3236479153u, 2659893783u, 0u, 292u, 3542663345u, 2659893783u, 0, LDEXP_TOLERANCE, 0}, +{ 626, 1066703665u, 4096436451u, 0u, 287u, 1367644977u, 4096436451u, 0, LDEXP_TOLERANCE, 0}, +{ 627, 3191085836u, 2080198917u, 0u, 342u, 3549698828u, 2080198917u, 0, LDEXP_TOLERANCE, 0}, +{ 628, 1103176642u, 292693126u, 0u, 269u, 1385243586u, 292693126u, 0, LDEXP_TOLERANCE, 0}, +{ 629, 1076257739u, 439474159u, 0u, 53u, 1131832267u, 439474159u, 0, LDEXP_TOLERANCE, 0}, +{ 630, 3203168524u, 4050424307u, 0u, 48u, 3253500172u, 4050424307u, 0, LDEXP_TOLERANCE, 0}, +{ 631, 3211263954u, 3275604304u, 0u, 427u, 3659005906u, 3275604304u, 0, LDEXP_TOLERANCE, 0}, +{ 632, 1098022244u, 1605519917u, 0u, 152u, 1257405796u, 1605519917u, 0, LDEXP_TOLERANCE, 0}, +{ 633, 3225218243u, 2732577078u, 0u, 169u, 3402427587u, 2732577078u, 0, LDEXP_TOLERANCE, 0}, +{ 634, 3224758945u, 639164136u, 0u, 250u, 3486902945u, 639164136u, 0, LDEXP_TOLERANCE, 0}, +{ 635, 3206688283u, 365608035u, 0u, 220u, 3437375003u, 365608035u, 0, LDEXP_TOLERANCE, 0}, +{ 636, 1096221986u, 188907563u, 0u, 258u, 1366754594u, 188907563u, 0, LDEXP_TOLERANCE, 0}, +{ 637, 1077478629u, 2925706902u, 0u, 77u, 1158218981u, 2925706902u, 0, LDEXP_TOLERANCE, 0}, +{ 638, 3245669892u, 1441001355u, 0u, 401u, 3666148868u, 1441001355u, 0, LDEXP_TOLERANCE, 0}, +{ 639, 1086418963u, 1263339528u, 0u, 77u, 1167159315u, 1263339528u, 0, LDEXP_TOLERANCE, 0}, +{ 640, 3243690997u, 4075177615u, 0u, 254u, 3510029301u, 4075177615u, 0, LDEXP_TOLERANCE, 0}, +{ 641, 1043887798u, 2574410165u, 0u, 228u, 1282963126u, 2574410165u, 0, LDEXP_TOLERANCE, 0}, +{ 642, 3228012899u, 1451038472u, 0u, 233u, 3472331107u, 1451038472u, 0, LDEXP_TOLERANCE, 0}, +{ 643, 1057927965u, 3267242972u, 0u, 196u, 1263448861u, 3267242972u, 0, LDEXP_TOLERANCE, 0}, +{ 644, 1088388240u, 147191702u, 0u, 277u, 1378843792u, 147191702u, 0, LDEXP_TOLERANCE, 0}, +{ 645, 3237742613u, 463847325u, 0u, 141u, 3385591829u, 463847325u, 0, LDEXP_TOLERANCE, 0}, +{ 646, 3231093084u, 309566036u, 0u, 15u, 3246821724u, 309566036u, 0, LDEXP_TOLERANCE, 0}, +{ 647, 3236008002u, 369048143u, 0u, 142u, 3384905794u, 369048143u, 0, LDEXP_TOLERANCE, 0}, +{ 648, 1106124402u, 4110964559u, 0u, 367u, 1490951794u, 4110964559u, 0, LDEXP_TOLERANCE, 0}, +{ 649, 1081914210u, 3679866727u, 0u, 33u, 1116517218u, 3679866727u, 0, LDEXP_TOLERANCE, 0}, +{ 650, 3208744451u, 810282289u, 0u, 240u, 3460402691u, 810282289u, 0, LDEXP_TOLERANCE, 0}, +{ 651, 3214165397u, 3872563165u, 0u, 0u, 3214165397u, 3872563165u, 0, LDEXP_TOLERANCE, 0}, +{ 652, 1098494887u, 2790313039u, 0u, 484u, 1606005671u, 2790313039u, 0, LDEXP_TOLERANCE, 0}, +{ 653, 3221154109u, 1894124837u, 0u, 154u, 3382634813u, 1894124837u, 0, LDEXP_TOLERANCE, 0}, +{ 654, 1046643778u, 1307532154u, 0u, 483u, 1553105986u, 1307532154u, 0, LDEXP_TOLERANCE, 0}, +{ 655, 1074424846u, 2546231111u, 0u, 76u, 1154116622u, 2546231111u, 0, LDEXP_TOLERANCE, 0}, +{ 656, 1070559510u, 1177789792u, 0u, 338u, 1424978198u, 1177789792u, 0, LDEXP_TOLERANCE, 0}, +{ 657, 3225897784u, 1393159012u, 0u, 468u, 3716631352u, 1393159012u, 0, LDEXP_TOLERANCE, 0}, +{ 658, 3241371250u, 2270747330u, 0u, 226u, 3478349426u, 2270747330u, 0, LDEXP_TOLERANCE, 0}, +{ 659, 3206099061u, 387526371u, 0u, 489u, 3718852725u, 387526371u, 0, LDEXP_TOLERANCE, 0}, +{ 660, 3248889342u, 1541778002u, 0u, 112u, 3366329854u, 1541778002u, 0, LDEXP_TOLERANCE, 0}, +{ 661, 1057260850u, 487828421u, 0u, 161u, 1226081586u, 487828421u, 0, LDEXP_TOLERANCE, 0}, +{ 662, 3227842110u, 3028362906u, 0u, 82u, 3313825342u, 3028362906u, 0, LDEXP_TOLERANCE, 0}, +{ 663, 3232158280u, 2832526786u, 0u, 342u, 3590771272u, 2832526786u, 0, LDEXP_TOLERANCE, 0}, +{ 664, 1086492044u, 1029336617u, 0u, 11u, 1098026380u, 1029336617u, 0, LDEXP_TOLERANCE, 0}, +{ 665, 3201067521u, 3844885860u, 0u, 233u, 3445385729u, 3844885860u, 0, LDEXP_TOLERANCE, 0}, +{ 666, 1081650590u, 3848664336u, 0u, 190u, 1280880030u, 3848664336u, 0, LDEXP_TOLERANCE, 0}, +{ 667, 3216727300u, 1859175955u, 0u, 342u, 3575340292u, 1859175955u, 0, LDEXP_TOLERANCE, 0}, +{ 668, 3247701688u, 4177384140u, 0u, 294u, 3555983032u, 4177384140u, 0, LDEXP_TOLERANCE, 0}, +{ 669, 3225365211u, 1905063436u, 0u, 369u, 3612289755u, 1905063436u, 0, LDEXP_TOLERANCE, 0}, +{ 670, 1060341776u, 3330581237u, 0u, 285u, 1359185936u, 3330581237u, 0, LDEXP_TOLERANCE, 0}, +{ 671, 1086856468u, 3110345659u, 0u, 307u, 1408769300u, 3110345659u, 0, LDEXP_TOLERANCE, 0}, +{ 672, 1040609072u, 2626928143u, 0u, 167u, 1215721264u, 2626928143u, 0, LDEXP_TOLERANCE, 0}, +{ 673, 3193571775u, 2449013005u, 0u, 206u, 3409578431u, 2449013005u, 0, LDEXP_TOLERANCE, 0}, +{ 674, 1044814475u, 3649425780u, 0u, 329u, 1389795979u, 3649425780u, 0, LDEXP_TOLERANCE, 0}, +{ 675, 3247609790u, 1936138976u, 0u, 449u, 3718420414u, 1936138976u, 0, LDEXP_TOLERANCE, 0}, +{ 676, 3222118023u, 3554670043u, 0u, 474u, 3719143047u, 3554670043u, 0, LDEXP_TOLERANCE, 0}, +{ 677, 3226161360u, 2445669899u, 0u, 122u, 3354087632u, 2445669899u, 0, LDEXP_TOLERANCE, 0}, +{ 678, 3231588583u, 3613487983u, 0u, 168u, 3407749351u, 3613487983u, 0, LDEXP_TOLERANCE, 0}, +{ 679, 1070518869u, 2404090288u, 0u, 343u, 1430180437u, 2404090288u, 0, LDEXP_TOLERANCE, 0}, +{ 680, 1056601872u, 3936780069u, 0u, 401u, 1477080848u, 3936780069u, 0, LDEXP_TOLERANCE, 0}, +{ 681, 3251382149u, 3695226490u, 0u, 317u, 3583780741u, 3695226490u, 0, LDEXP_TOLERANCE, 0}, +{ 682, 1084717105u, 2502140489u, 0u, 428u, 1533507633u, 2502140489u, 0, LDEXP_TOLERANCE, 0}, +{ 683, 3231607738u, 3076182032u, 0u, 212u, 3453905850u, 3076182032u, 0, LDEXP_TOLERANCE, 0}, +{ 684, 3226181630u, 52044482u, 0u, 56u, 3284901886u, 52044482u, 0, LDEXP_TOLERANCE, 0}, +{ 685, 3209294194u, 3250576797u, 0u, 447u, 3678007666u, 3250576797u, 0, LDEXP_TOLERANCE, 0}, +{ 686, 1067216664u, 280322485u, 0u, 68u, 1138519832u, 280322485u, 0, LDEXP_TOLERANCE, 0}, +{ 687, 1056850730u, 3460638643u, 0u, 3u, 1059996458u, 3460638643u, 0, LDEXP_TOLERANCE, 0}, +{ 688, 3198374301u, 836754546u, 0u, 227u, 3436401053u, 836754546u, 0, LDEXP_TOLERANCE, 0}, +{ 689, 1053945586u, 1909842364u, 0u, 137u, 1197600498u, 1909842364u, 0, LDEXP_TOLERANCE, 0}, +{ 690, 1102747575u, 3614304657u, 0u, 175u, 1286248375u, 3614304657u, 0, LDEXP_TOLERANCE, 0}, +{ 691, 3232289682u, 104161319u, 0u, 258u, 3502822290u, 104161319u, 0, LDEXP_TOLERANCE, 0}, +{ 692, 3239925976u, 4284835369u, 0u, 69u, 3312277720u, 4284835369u, 0, LDEXP_TOLERANCE, 0}, +{ 693, 1101382703u, 1829525759u, 0u, 474u, 1598407727u, 1829525759u, 0, LDEXP_TOLERANCE, 0}, +{ 694, 1080943896u, 3662877092u, 0u, 172u, 1261298968u, 3662877092u, 0, LDEXP_TOLERANCE, 0}, +{ 695, 3208812483u, 1522451444u, 0u, 237u, 3457324995u, 1522451444u, 0, LDEXP_TOLERANCE, 0}, +{ 696, 3207922109u, 3788656852u, 0u, 281u, 3502571965u, 3788656852u, 0, LDEXP_TOLERANCE, 0}, +{ 697, 1051638218u, 161607862u, 0u, 267u, 1331608010u, 161607862u, 0, LDEXP_TOLERANCE, 0}, +{ 698, 1090916217u, 2404130512u, 0u, 233u, 1335234425u, 2404130512u, 0, LDEXP_TOLERANCE, 0}, +{ 699, 1059685751u, 2026411429u, 0u, 386u, 1464436087u, 2026411429u, 0, LDEXP_TOLERANCE, 0}, +{ 700, 3253240072u, 1320615853u, 0u, 98u, 3356000520u, 1320615853u, 0, LDEXP_TOLERANCE, 0}, +{ 701, 3252472409u, 3427912319u, 0u, 307u, 3574385241u, 3427912319u, 0, LDEXP_TOLERANCE, 0}, +{ 702, 3239422485u, 3207831031u, 0u, 279u, 3531975189u, 3207831031u, 0, LDEXP_TOLERANCE, 0}, +{ 703, 3225261763u, 193885269u, 0u, 263u, 3501037251u, 193885269u, 0, LDEXP_TOLERANCE, 0}, +{ 704, 3198856153u, 1330711805u, 0u, 34u, 3234507737u, 1330711805u, 0, LDEXP_TOLERANCE, 0}, +{ 705, 1061209059u, 2242782034u, 0u, 484u, 1568719843u, 2242782034u, 0, LDEXP_TOLERANCE, 0}, +{ 706, 1105997747u, 1164748983u, 0u, 205u, 1320955827u, 1164748983u, 0, LDEXP_TOLERANCE, 0}, +{ 707, 1041518408u, 427227336u, 0u, 468u, 1532251976u, 427227336u, 0, LDEXP_TOLERANCE, 0}, +{ 708, 1047983837u, 571692916u, 0u, 112u, 1165424349u, 571692916u, 0, LDEXP_TOLERANCE, 0}, +{ 709, 3243349276u, 1910625797u, 0u, 305u, 3563164956u, 1910625797u, 0, LDEXP_TOLERANCE, 0}, +{ 710, 1056431544u, 3633684065u, 0u, 85u, 1145560504u, 3633684065u, 0, LDEXP_TOLERANCE, 0}, +{ 711, 3216335063u, 2139337836u, 0u, 289u, 3519373527u, 2139337836u, 0, LDEXP_TOLERANCE, 0}, +{ 712, 3221194724u, 3647632375u, 0u, 136u, 3363801060u, 3647632375u, 0, LDEXP_TOLERANCE, 0}, +{ 713, 3194264761u, 3085230370u, 0u, 415u, 3629423801u, 3085230370u, 0, LDEXP_TOLERANCE, 0}, +{ 714, 1047551748u, 2424866060u, 0u, 183u, 1239441156u, 2424866060u, 0, LDEXP_TOLERANCE, 0}, +{ 715, 1056945903u, 2026968333u, 0u, 249u, 1318041327u, 2026968333u, 0, LDEXP_TOLERANCE, 0}, +{ 716, 3254065942u, 2288082596u, 0u, 121u, 3380943638u, 2288082596u, 0, LDEXP_TOLERANCE, 0}, +{ 717, 3204958105u, 146999679u, 0u, 260u, 3477587865u, 146999679u, 0, LDEXP_TOLERANCE, 0}, +{ 718, 3249441223u, 3097120487u, 0u, 334u, 3599665607u, 3097120487u, 0, LDEXP_TOLERANCE, 0}, +{ 719, 1092821012u, 2819263558u, 0u, 374u, 1484988436u, 2819263558u, 0, LDEXP_TOLERANCE, 0}, +{ 720, 3248709970u, 1002982008u, 0u, 133u, 3388170578u, 1002982008u, 0, LDEXP_TOLERANCE, 0}, +{ 721, 3196410507u, 3683897920u, 0u, 150u, 3353696907u, 3683897920u, 0, LDEXP_TOLERANCE, 0}, +{ 722, 3198217745u, 2950261157u, 0u, 303u, 3515936273u, 2950261157u, 0, LDEXP_TOLERANCE, 0}, +{ 723, 3251583196u, 1575329940u, 0u, 333u, 3600759004u, 1575329940u, 0, LDEXP_TOLERANCE, 0}, +{ 724, 1041303822u, 3078435619u, 0u, 101u, 1147209998u, 3078435619u, 0, LDEXP_TOLERANCE, 0}, +{ 725, 1074310746u, 2577246912u, 0u, 345u, 1436069466u, 2577246912u, 0, LDEXP_TOLERANCE, 0}, +{ 726, 1043606901u, 2874218693u, 0u, 420u, 1484008821u, 2874218693u, 0, LDEXP_TOLERANCE, 0}, +{ 727, 3224836328u, 1577726432u, 0u, 210u, 3445037288u, 1577726432u, 0, LDEXP_TOLERANCE, 0}, +{ 728, 1080717542u, 3407236142u, 0u, 495u, 1599762662u, 3407236142u, 0, LDEXP_TOLERANCE, 0}, +{ 729, 3239021323u, 1897226271u, 0u, 337u, 3592391435u, 1897226271u, 0, LDEXP_TOLERANCE, 0}, +{ 730, 1091225343u, 3521028551u, 0u, 232u, 1334494975u, 3521028551u, 0, LDEXP_TOLERANCE, 0}, +{ 731, 1047112378u, 3921932243u, 0u, 476u, 1546234554u, 3921932243u, 0, LDEXP_TOLERANCE, 0}, +{ 732, 1061380266u, 1196702002u, 0u, 289u, 1364418730u, 1196702002u, 0, LDEXP_TOLERANCE, 0}, +{ 733, 3228251369u, 3560249334u, 0u, 180u, 3416995049u, 3560249334u, 0, LDEXP_TOLERANCE, 0}, +{ 734, 3202942296u, 256601931u, 0u, 412u, 3634955608u, 256601931u, 0, LDEXP_TOLERANCE, 0}, +{ 735, 3188373428u, 4178341029u, 0u, 332u, 3536500660u, 4178341029u, 0, LDEXP_TOLERANCE, 0}, +{ 736, 1074244557u, 1388509212u, 0u, 68u, 1145547725u, 1388509212u, 0, LDEXP_TOLERANCE, 0}, +{ 737, 3227970267u, 278055877u, 0u, 158u, 3393645275u, 278055877u, 0, LDEXP_TOLERANCE, 0}, +{ 738, 3253498427u, 1975402856u, 0u, 91u, 3348918843u, 1975402856u, 0, LDEXP_TOLERANCE, 0}, +{ 739, 3212768361u, 36116288u, 0u, 91u, 3308188777u, 36116288u, 0, LDEXP_TOLERANCE, 0}, +{ 740, 1067504948u, 2801410835u, 0u, 86u, 1157682484u, 2801410835u, 0, LDEXP_TOLERANCE, 0}, +{ 741, 1056745800u, 1517147036u, 0u, 390u, 1465690440u, 1517147036u, 0, LDEXP_TOLERANCE, 0}, +{ 742, 1055869313u, 3403644835u, 0u, 58u, 1116686721u, 3403644835u, 0, LDEXP_TOLERANCE, 0}, +{ 743, 3239015924u, 1497452126u, 0u, 300u, 3553588724u, 1497452126u, 0, LDEXP_TOLERANCE, 0}, +{ 744, 3198727606u, 527260849u, 0u, 15u, 3214456246u, 527260849u, 0, LDEXP_TOLERANCE, 0}, +{ 745, 1055132057u, 730320459u, 0u, 341u, 1412696473u, 730320459u, 0, LDEXP_TOLERANCE, 0}, +{ 746, 1071575537u, 3103627383u, 0u, 466u, 1560211953u, 3103627383u, 0, LDEXP_TOLERANCE, 0}, +{ 747, 1075642950u, 676014010u, 0u, 15u, 1091371590u, 676014010u, 0, LDEXP_TOLERANCE, 0}, +{ 748, 1093103612u, 2664812822u, 0u, 439u, 1553428476u, 2664812822u, 0, LDEXP_TOLERANCE, 0}, +{ 749, 1076849399u, 511262496u, 0u, 262u, 1351576311u, 511262496u, 0, LDEXP_TOLERANCE, 0}, +{ 750, 1040381038u, 1621968404u, 0u, 453u, 1515385966u, 1621968404u, 0, LDEXP_TOLERANCE, 0}, +{ 751, 1051309752u, 716773972u, 0u, 190u, 1250539192u, 716773972u, 0, LDEXP_TOLERANCE, 0}, +{ 752, 1089837159u, 3131066689u, 0u, 346u, 1452644455u, 3131066689u, 0, LDEXP_TOLERANCE, 0}, +{ 753, 3234817844u, 2885211133u, 0u, 318u, 3568265012u, 2885211133u, 0, LDEXP_TOLERANCE, 0}, +{ 754, 3244193329u, 935135102u, 0u, 44u, 3290330673u, 935135102u, 0, LDEXP_TOLERANCE, 0}, +{ 755, 3203778258u, 3428784172u, 0u, 71u, 3278227154u, 3428784172u, 0, LDEXP_TOLERANCE, 0}, +{ 756, 3238604006u, 2734177193u, 0u, 368u, 3624479974u, 2734177193u, 0, LDEXP_TOLERANCE, 0}, +{ 757, 1091433848u, 3888398377u, 0u, 102u, 1198388600u, 3888398377u, 0, LDEXP_TOLERANCE, 0}, +{ 758, 1046749113u, 3712806014u, 0u, 443u, 1511268281u, 3712806014u, 0, LDEXP_TOLERANCE, 0}, +{ 759, 1076298852u, 991871299u, 0u, 82u, 1162282084u, 991871299u, 0, LDEXP_TOLERANCE, 0}, +{ 760, 3206800539u, 4000035882u, 0u, 319u, 3541296283u, 4000035882u, 0, LDEXP_TOLERANCE, 0}, +{ 761, 1067010471u, 2056309037u, 0u, 347u, 1430866343u, 2056309037u, 0, LDEXP_TOLERANCE, 0}, +{ 762, 1058199525u, 1299425839u, 0u, 432u, 1511184357u, 1299425839u, 0, LDEXP_TOLERANCE, 0}, +{ 763, 1050094941u, 3817959288u, 0u, 37u, 1088892253u, 3817959288u, 0, LDEXP_TOLERANCE, 0}, +{ 764, 1095599309u, 1960661988u, 0u, 73u, 1172145357u, 1960661988u, 0, LDEXP_TOLERANCE, 0}, +{ 765, 3187979854u, 2362441752u, 0u, 331u, 3535058510u, 2362441752u, 0, LDEXP_TOLERANCE, 0}, +{ 766, 1088255327u, 270039934u, 0u, 194u, 1291679071u, 270039934u, 0, LDEXP_TOLERANCE, 0}, +{ 767, 3249308688u, 397843258u, 0u, 214u, 3473703952u, 397843258u, 0, LDEXP_TOLERANCE, 0}, +{ 768, 3212426640u, 3278767347u, 0u, 244u, 3468279184u, 3278767347u, 0, LDEXP_TOLERANCE, 0}, +{ 769, 1073567981u, 3086540190u, 0u, 445u, 1540184301u, 3086540190u, 0, LDEXP_TOLERANCE, 0}, +{ 770, 1064931281u, 1165998478u, 0u, 354u, 1436127185u, 1165998478u, 0, LDEXP_TOLERANCE, 0}, +{ 771, 3204860436u, 1236881883u, 0u, 197u, 3411429908u, 1236881883u, 0, LDEXP_TOLERANCE, 0}, +{ 772, 3211538326u, 71491083u, 0u, 429u, 3661377430u, 71491083u, 0, LDEXP_TOLERANCE, 0}, +{ 773, 3242681902u, 664136103u, 0u, 40u, 3284624942u, 664136103u, 0, LDEXP_TOLERANCE, 0}, +{ 774, 3189996280u, 1751559854u, 0u, 474u, 3687021304u, 1751559854u, 0, LDEXP_TOLERANCE, 0}, +{ 775, 1051092760u, 2798720100u, 0u, 95u, 1150707480u, 2798720100u, 0, LDEXP_TOLERANCE, 0}, +{ 776, 3205253626u, 3843740240u, 0u, 62u, 3270265338u, 3843740240u, 0, LDEXP_TOLERANCE, 0}, +{ 777, 1092011864u, 751825094u, 0u, 342u, 1450624856u, 751825094u, 0, LDEXP_TOLERANCE, 0}, +{ 778, 3209223122u, 3502451710u, 0u, 195u, 3413695442u, 3502451710u, 0, LDEXP_TOLERANCE, 0}, +{ 779, 3247190406u, 4080443609u, 0u, 248u, 3507237254u, 4080443609u, 0, LDEXP_TOLERANCE, 0}, +{ 780, 1096403156u, 3262097651u, 0u, 157u, 1261029588u, 3262097651u, 0, LDEXP_TOLERANCE, 0}, +{ 781, 3252309668u, 4001157930u, 0u, 52u, 3306835620u, 4001157930u, 0, LDEXP_TOLERANCE, 0}, +{ 782, 3193455299u, 2008796992u, 0u, 272u, 3478667971u, 2008796992u, 0, LDEXP_TOLERANCE, 0}, +{ 783, 1074202826u, 3996321918u, 0u, 272u, 1359415498u, 3996321918u, 0, LDEXP_TOLERANCE, 0}, +{ 784, 1097859997u, 559918757u, 0u, 200u, 1307575197u, 559918757u, 0, LDEXP_TOLERANCE, 0}, +{ 785, 1105263000u, 1026957442u, 0u, 292u, 1411447192u, 1026957442u, 0, LDEXP_TOLERANCE, 0}, +{ 786, 1090021734u, 10385612u, 0u, 274u, 1377331558u, 10385612u, 0, LDEXP_TOLERANCE, 0}, +{ 787, 3204176005u, 138109865u, 0u, 460u, 3686520965u, 138109865u, 0, LDEXP_TOLERANCE, 0}, +{ 788, 3248203007u, 2450309467u, 0u, 259u, 3519784191u, 2450309467u, 0, LDEXP_TOLERANCE, 0}, +{ 789, 3222168498u, 3036525078u, 0u, 430u, 3673056178u, 3036525078u, 0, LDEXP_TOLERANCE, 0}, +{ 790, 1089193268u, 2185243463u, 0u, 302u, 1405863220u, 2185243463u, 0, LDEXP_TOLERANCE, 0}, +{ 791, 1098669225u, 945559339u, 0u, 379u, 1496079529u, 945559339u, 0, LDEXP_TOLERANCE, 0}, +{ 792, 3247056551u, 3061117625u, 0u, 305u, 3566872231u, 3061117625u, 0, LDEXP_TOLERANCE, 0}, +{ 793, 1056505004u, 3804703138u, 0u, 193u, 1258880172u, 3804703138u, 0, LDEXP_TOLERANCE, 0}, +{ 794, 1064051616u, 4286212259u, 0u, 110u, 1179394976u, 4286212259u, 0, LDEXP_TOLERANCE, 0}, +{ 795, 3228226248u, 3005944127u, 0u, 368u, 3614102216u, 3005944127u, 0, LDEXP_TOLERANCE, 0}, +{ 796, 3227751196u, 1206270591u, 0u, 250u, 3489895196u, 1206270591u, 0, LDEXP_TOLERANCE, 0}, +{ 797, 3189082429u, 2733129256u, 0u, 59u, 3250948413u, 2733129256u, 0, LDEXP_TOLERANCE, 0}, +{ 798, 3245340921u, 4247799250u, 0u, 202u, 3457153273u, 4247799250u, 0, LDEXP_TOLERANCE, 0}, +{ 799, 3221929633u, 1990351504u, 0u, 322u, 3559571105u, 1990351504u, 0, LDEXP_TOLERANCE, 0}, +{ 800, 1088823630u, 1306766437u, 0u, 432u, 1541808462u, 1306766437u, 0, LDEXP_TOLERANCE, 0}, +{ 801, 1103830155u, 1646497074u, 0u, 106u, 1214979211u, 1646497074u, 0, LDEXP_TOLERANCE, 0}, +{ 802, 1045705464u, 1703969219u, 0u, 328u, 1389638392u, 1703969219u, 0, LDEXP_TOLERANCE, 0}, +{ 803, 3235685067u, 2320792999u, 0u, 202u, 3447497419u, 2320792999u, 0, LDEXP_TOLERANCE, 0}, +{ 804, 3245310028u, 2734025087u, 0u, 343u, 3604971596u, 2734025087u, 0, LDEXP_TOLERANCE, 0}, +{ 805, 1050749188u, 1865522910u, 0u, 362u, 1430333700u, 1865522910u, 0, LDEXP_TOLERANCE, 0}, +{ 806, 1082523997u, 607572944u, 0u, 246u, 1340473693u, 607572944u, 0, LDEXP_TOLERANCE, 0}, +{ 807, 3212293317u, 1718035313u, 0u, 381u, 3611800773u, 1718035313u, 0, LDEXP_TOLERANCE, 0}, +{ 808, 1077896873u, 1700936244u, 0u, 365u, 1460627113u, 1700936244u, 0, LDEXP_TOLERANCE, 0}, +{ 809, 1105063042u, 999185924u, 0u, 440u, 1566436482u, 999185924u, 0, LDEXP_TOLERANCE, 0}, +{ 810, 3207842510u, 788883399u, 0u, 125u, 3338914510u, 788883399u, 0, LDEXP_TOLERANCE, 0}, +{ 811, 1068639210u, 3699016825u, 0u, 408u, 1496458218u, 3699016825u, 0, LDEXP_TOLERANCE, 0}, +{ 812, 3254694575u, 3257889844u, 0u, 322u, 3592336047u, 3257889844u, 0, LDEXP_TOLERANCE, 0}, +{ 813, 3226459123u, 3557606351u, 0u, 466u, 3715095539u, 3557606351u, 0, LDEXP_TOLERANCE, 0}, +{ 814, 1096179175u, 2457013015u, 0u, 72u, 1171676647u, 2457013015u, 0, LDEXP_TOLERANCE, 0}, +{ 815, 1054624206u, 714673146u, 0u, 423u, 1498171854u, 714673146u, 0, LDEXP_TOLERANCE, 0}, +{ 816, 1068142810u, 798819874u, 0u, 305u, 1387958490u, 798819874u, 0, LDEXP_TOLERANCE, 0}, +{ 817, 3236531985u, 3685187432u, 0u, 32u, 3270086417u, 3685187432u, 0, LDEXP_TOLERANCE, 0}, +{ 818, 3215977438u, 2250028013u, 0u, 12u, 3228560350u, 2250028013u, 0, LDEXP_TOLERANCE, 0}, +{ 819, 3212961466u, 822905748u, 0u, 81u, 3297896122u, 822905748u, 0, LDEXP_TOLERANCE, 0}, +{ 820, 3221863333u, 162122081u, 0u, 161u, 3390684069u, 162122081u, 0, LDEXP_TOLERANCE, 0}, +{ 821, 3229017334u, 184971503u, 0u, 186u, 3424052470u, 184971503u, 0, LDEXP_TOLERANCE, 0}, +{ 822, 1068475748u, 3639227340u, 0u, 63u, 1134536036u, 3639227340u, 0, LDEXP_TOLERANCE, 0}, +{ 823, 1068863190u, 4192848976u, 0u, 110u, 1184206550u, 4192848976u, 0, LDEXP_TOLERANCE, 0}, +{ 824, 1067294567u, 3366476994u, 0u, 150u, 1224580967u, 3366476994u, 0, LDEXP_TOLERANCE, 0}, +{ 825, 3190744330u, 2826973629u, 0u, 361u, 3569280266u, 2826973629u, 0, LDEXP_TOLERANCE, 0}, +{ 826, 1093885013u, 3565509610u, 0u, 406u, 1519606869u, 3565509610u, 0, LDEXP_TOLERANCE, 0}, +{ 827, 1103860823u, 3945565763u, 0u, 470u, 1596691543u, 3945565763u, 0, LDEXP_TOLERANCE, 0}, +{ 828, 3253153113u, 3525488721u, 0u, 381u, 3652660569u, 3525488721u, 0, LDEXP_TOLERANCE, 0}, +{ 829, 1072788663u, 3844072288u, 0u, 27u, 1101100215u, 3844072288u, 0, LDEXP_TOLERANCE, 0}, +{ 830, 1105982382u, 396149483u, 0u, 309u, 1429992366u, 396149483u, 0, LDEXP_TOLERANCE, 0}, +{ 831, 3208357660u, 1296976426u, 0u, 226u, 3445335836u, 1296976426u, 0, LDEXP_TOLERANCE, 0}, +{ 832, 3198881428u, 3075911575u, 0u, 334u, 3549105812u, 3075911575u, 0, LDEXP_TOLERANCE, 0}, +{ 833, 3210025772u, 2171409636u, 0u, 214u, 3434421036u, 2171409636u, 0, LDEXP_TOLERANCE, 0}, +{ 834, 1085134286u, 3317203062u, 0u, 367u, 1469961678u, 3317203062u, 0, LDEXP_TOLERANCE, 0}, +{ 835, 1096024056u, 342573501u, 0u, 150u, 1253310456u, 342573501u, 0, LDEXP_TOLERANCE, 0}, +{ 836, 3214511676u, 1029815247u, 0u, 341u, 3572076092u, 1029815247u, 0, LDEXP_TOLERANCE, 0}, +{ 837, 1058864545u, 3610237982u, 0u, 168u, 1235025313u, 3610237982u, 0, LDEXP_TOLERANCE, 0}, +{ 838, 1087803418u, 915867083u, 0u, 25u, 1114017818u, 915867083u, 0, LDEXP_TOLERANCE, 0}, +{ 839, 1088029890u, 3972498826u, 0u, 437u, 1546257602u, 3972498826u, 0, LDEXP_TOLERANCE, 0}, +{ 840, 1069047467u, 4206678986u, 0u, 125u, 1200119467u, 4206678986u, 0, LDEXP_TOLERANCE, 0}, +{ 841, 3228983407u, 1162164397u, 0u, 273u, 3515244655u, 1162164397u, 0, LDEXP_TOLERANCE, 0}, +{ 842, 3250508564u, 2047944882u, 0u, 101u, 3356414740u, 2047944882u, 0, LDEXP_TOLERANCE, 0}, +{ 843, 3190469300u, 721926766u, 0u, 484u, 3697980084u, 721926766u, 0, LDEXP_TOLERANCE, 0}, +{ 844, 3205734397u, 858830829u, 0u, 96u, 3306397693u, 858830829u, 0, LDEXP_TOLERANCE, 0}, +{ 845, 3254021490u, 1884944479u, 0u, 101u, 3359927666u, 1884944479u, 0, LDEXP_TOLERANCE, 0}, +{ 846, 1061200790u, 770599461u, 0u, 457u, 1540400022u, 770599461u, 0, LDEXP_TOLERANCE, 0}, +{ 847, 1070178161u, 1235369496u, 0u, 91u, 1165598577u, 1235369496u, 0, LDEXP_TOLERANCE, 0}, +{ 848, 3224214082u, 2401751606u, 0u, 487u, 3734870594u, 2401751606u, 0, LDEXP_TOLERANCE, 0}, +{ 849, 3195861982u, 2825171386u, 0u, 305u, 3515677662u, 2825171386u, 0, LDEXP_TOLERANCE, 0}, +{ 850, 1061833598u, 1272591529u, 0u, 181u, 1251625854u, 1272591529u, 0, LDEXP_TOLERANCE, 0}, +{ 851, 1105686806u, 3174008470u, 0u, 444u, 1571254550u, 3174008470u, 0, LDEXP_TOLERANCE, 0}, +{ 852, 3201135451u, 1922413069u, 0u, 268u, 3482153819u, 1922413069u, 0, LDEXP_TOLERANCE, 0}, +{ 853, 1082801190u, 515824452u, 0u, 365u, 1465531430u, 515824452u, 0, LDEXP_TOLERANCE, 0}, +{ 854, 1069439223u, 2638362989u, 0u, 13u, 1083070711u, 2638362989u, 0, LDEXP_TOLERANCE, 0}, +{ 855, 1090196972u, 3350821426u, 0u, 214u, 1314592236u, 3350821426u, 0, LDEXP_TOLERANCE, 0}, +{ 856, 3222171679u, 2722693603u, 0u, 255u, 3489558559u, 2722693603u, 0, LDEXP_TOLERANCE, 0}, +{ 857, 3187717259u, 2277305925u, 0u, 150u, 3345003659u, 2277305925u, 0, LDEXP_TOLERANCE, 0}, +{ 858, 1043379197u, 1539782049u, 0u, 88u, 1135653885u, 1539782049u, 0, LDEXP_TOLERANCE, 0}, +{ 859, 1096830612u, 4029608359u, 0u, 440u, 1558204052u, 4029608359u, 0, LDEXP_TOLERANCE, 0}, +{ 860, 3252051109u, 2999983605u, 0u, 206u, 3468057765u, 2999983605u, 0, LDEXP_TOLERANCE, 0}, +{ 861, 1096654323u, 2577373394u, 0u, 178u, 1283300851u, 2577373394u, 0, LDEXP_TOLERANCE, 0}, +{ 862, 3210600814u, 3209526929u, 0u, 449u, 3681411438u, 3209526929u, 0, LDEXP_TOLERANCE, 0}, +{ 863, 1052682749u, 2164476593u, 0u, 416u, 1488890365u, 2164476593u, 0, LDEXP_TOLERANCE, 0}, +{ 864, 3239797146u, 1835860173u, 0u, 441u, 3702219162u, 1835860173u, 0, LDEXP_TOLERANCE, 0}, +{ 865, 1081200406u, 2422232642u, 0u, 387u, 1486999318u, 2422232642u, 0, LDEXP_TOLERANCE, 0}, +{ 866, 3217493714u, 236015626u, 0u, 448u, 3687255762u, 236015626u, 0, LDEXP_TOLERANCE, 0}, +{ 867, 3215229102u, 4091953286u, 0u, 50u, 3267657902u, 4091953286u, 0, LDEXP_TOLERANCE, 0}, +{ 868, 3232466491u, 4235242395u, 0u, 208u, 3450570299u, 4235242395u, 0, LDEXP_TOLERANCE, 0}, +{ 869, 1056148932u, 2226894195u, 0u, 12u, 1068731844u, 2226894195u, 0, LDEXP_TOLERANCE, 0}, +{ 870, 1085928888u, 1212597601u, 0u, 96u, 1186592184u, 1212597601u, 0, LDEXP_TOLERANCE, 0}, +{ 871, 1092491334u, 2547796519u, 0u, 394u, 1505630278u, 2547796519u, 0, LDEXP_TOLERANCE, 0}, +{ 872, 1089815741u, 931149948u, 0u, 9u, 1099252925u, 931149948u, 0, LDEXP_TOLERANCE, 0}, +{ 873, 1078166121u, 2663981399u, 0u, 128u, 1212383849u, 2663981399u, 0, LDEXP_TOLERANCE, 0}, +{ 874, 1099551055u, 1082898276u, 0u, 59u, 1161417039u, 1082898276u, 0, LDEXP_TOLERANCE, 0}, +{ 875, 1067193495u, 3092668216u, 0u, 368u, 1453069463u, 3092668216u, 0, LDEXP_TOLERANCE, 0}, +{ 876, 3220064091u, 735952225u, 0u, 121u, 3346941787u, 735952225u, 0, LDEXP_TOLERANCE, 0}, +{ 877, 1088308510u, 3170295088u, 0u, 223u, 1322140958u, 3170295088u, 0, LDEXP_TOLERANCE, 0}, +{ 878, 3239143845u, 3990023574u, 0u, 202u, 3450956197u, 3990023574u, 0, LDEXP_TOLERANCE, 0}, +{ 879, 1068793940u, 1025779807u, 0u, 496u, 1588887636u, 1025779807u, 0, LDEXP_TOLERANCE, 0}, +{ 880, 3217947229u, 937205825u, 0u, 96u, 3318610525u, 937205825u, 0, LDEXP_TOLERANCE, 0}, +{ 881, 3214656757u, 824051806u, 0u, 191u, 3414934773u, 824051806u, 0, LDEXP_TOLERANCE, 0}, +{ 882, 3246710531u, 2206975583u, 0u, 226u, 3483688707u, 2206975583u, 0, LDEXP_TOLERANCE, 0}, +{ 883, 3212669530u, 1645486982u, 0u, 405u, 3637342810u, 1645486982u, 0, LDEXP_TOLERANCE, 0}, +{ 884, 3239890670u, 668515593u, 0u, 162u, 3409759982u, 668515593u, 0, LDEXP_TOLERANCE, 0}, +{ 885, 3231063208u, 1981359339u, 0u, 110u, 3346406568u, 1981359339u, 0, LDEXP_TOLERANCE, 0}, +{ 886, 3224876941u, 895232801u, 0u, 11u, 3236411277u, 895232801u, 0, LDEXP_TOLERANCE, 0}, +{ 887, 3202462144u, 2479069370u, 0u, 76u, 3282153920u, 2479069370u, 0, LDEXP_TOLERANCE, 0}, +{ 888, 3230070172u, 424421119u, 0u, 428u, 3678860700u, 424421119u, 0, LDEXP_TOLERANCE, 0}, +{ 889, 3221132536u, 2265367339u, 0u, 401u, 3641611512u, 2265367339u, 0, LDEXP_TOLERANCE, 0}, +{ 890, 1095444173u, 1768241830u, 0u, 167u, 1270556365u, 1768241830u, 0, LDEXP_TOLERANCE, 0}, +{ 891, 1042815211u, 2742800982u, 0u, 114u, 1162352875u, 2742800982u, 0, LDEXP_TOLERANCE, 0}, +{ 892, 3227055805u, 66926332u, 0u, 47u, 3276338877u, 66926332u, 0, LDEXP_TOLERANCE, 0}, +{ 893, 3208978599u, 793918921u, 0u, 79u, 3291816103u, 793918921u, 0, LDEXP_TOLERANCE, 0}, +{ 894, 3190613834u, 2499520280u, 0u, 359u, 3567052618u, 2499520280u, 0, LDEXP_TOLERANCE, 0}, +{ 895, 3231820809u, 468583709u, 0u, 330u, 3577850889u, 468583709u, 0, LDEXP_TOLERANCE, 0}, +{ 896, 3209531041u, 216494777u, 0u, 244u, 3465383585u, 216494777u, 0, LDEXP_TOLERANCE, 0}, +{ 897, 3208867582u, 455371296u, 0u, 23u, 3232984830u, 455371296u, 0, LDEXP_TOLERANCE, 0}, +{ 898, 3237813129u, 1360096867u, 0u, 323u, 3576503177u, 1360096867u, 0, LDEXP_TOLERANCE, 0}, +{ 899, 3234511235u, 722957892u, 0u, 23u, 3258628483u, 722957892u, 0, LDEXP_TOLERANCE, 0}, +{ 900, 3196089837u, 1383518509u, 0u, 35u, 3232789997u, 1383518509u, 0, LDEXP_TOLERANCE, 0}, +{ 901, 3231254997u, 243303420u, 0u, 450u, 3703114197u, 243303420u, 0, LDEXP_TOLERANCE, 0}, +{ 902, 3226132757u, 2422073720u, 0u, 490u, 3739934997u, 2422073720u, 0, LDEXP_TOLERANCE, 0}, +{ 903, 3232217617u, 1389215707u, 0u, 453u, 3707222545u, 1389215707u, 0, LDEXP_TOLERANCE, 0}, +{ 904, 3192865206u, 1701554404u, 0u, 39u, 3233759670u, 1701554404u, 0, LDEXP_TOLERANCE, 0}, +{ 905, 1099239964u, 620596423u, 0u, 296u, 1409618460u, 620596423u, 0, LDEXP_TOLERANCE, 0}, +{ 906, 3204081936u, 794279522u, 0u, 292u, 3510266128u, 794279522u, 0, LDEXP_TOLERANCE, 0}, +{ 907, 3244160134u, 742203584u, 0u, 252u, 3508401286u, 742203584u, 0, LDEXP_TOLERANCE, 0}, +{ 908, 3226020545u, 101555209u, 0u, 493u, 3742968513u, 101555209u, 0, LDEXP_TOLERANCE, 0}, +{ 909, 1084214050u, 3065770846u, 0u, 178u, 1270860578u, 3065770846u, 0, LDEXP_TOLERANCE, 0}, +{ 910, 3251962512u, 3766248610u, 0u, 332u, 3600089744u, 3766248610u, 0, LDEXP_TOLERANCE, 0}, +{ 911, 1094059783u, 2353397886u, 0u, 139u, 1239811847u, 2353397886u, 0, LDEXP_TOLERANCE, 0}, +{ 912, 1067736547u, 3644468510u, 0u, 142u, 1216634339u, 3644468510u, 0, LDEXP_TOLERANCE, 0}, +{ 913, 3203153389u, 3668774238u, 0u, 414u, 3637263853u, 3668774238u, 0, LDEXP_TOLERANCE, 0}, +{ 914, 3254443077u, 3017062764u, 0u, 267u, 3534412869u, 3017062764u, 0, LDEXP_TOLERANCE, 0}, +{ 915, 3229391605u, 2125864003u, 0u, 138u, 3374095093u, 2125864003u, 0, LDEXP_TOLERANCE, 0}, +{ 916, 3189653973u, 2421488611u, 0u, 18u, 3208528341u, 2421488611u, 0, LDEXP_TOLERANCE, 0}, +{ 917, 3189245988u, 1539535238u, 0u, 106u, 3300395044u, 1539535238u, 0, LDEXP_TOLERANCE, 0}, +{ 918, 3246934215u, 508708967u, 0u, 166u, 3420997831u, 508708967u, 0, LDEXP_TOLERANCE, 0}, +{ 919, 1096820310u, 1045480938u, 0u, 260u, 1369450070u, 1045480938u, 0, LDEXP_TOLERANCE, 0}, +{ 920, 3253279675u, 4059455278u, 0u, 497u, 3774421947u, 4059455278u, 0, LDEXP_TOLERANCE, 0}, +{ 921, 1086656128u, 2085052714u, 0u, 327u, 1429540480u, 2085052714u, 0, LDEXP_TOLERANCE, 0}, +{ 922, 1101382876u, 3731725710u, 0u, 433u, 1555416284u, 3731725710u, 0, LDEXP_TOLERANCE, 0}, +{ 923, 1102379272u, 3644659426u, 0u, 465u, 1589967112u, 3644659426u, 0, LDEXP_TOLERANCE, 0}, +{ 924, 1042731156u, 1213208320u, 0u, 18u, 1061605524u, 1213208320u, 0, LDEXP_TOLERANCE, 0}, +{ 925, 1098023542u, 1856411393u, 0u, 54u, 1154646646u, 1856411393u, 0, LDEXP_TOLERANCE, 0}, +{ 926, 3203414683u, 2536686169u, 0u, 245u, 3460315803u, 2536686169u, 0, LDEXP_TOLERANCE, 0}, +{ 927, 3221235845u, 3482598782u, 0u, 332u, 3569363077u, 3482598782u, 0, LDEXP_TOLERANCE, 0}, +{ 928, 1054849265u, 2353103845u, 0u, 466u, 1543485681u, 2353103845u, 0, LDEXP_TOLERANCE, 0}, +{ 929, 3246279974u, 1941016128u, 0u, 459u, 3727576358u, 1941016128u, 0, LDEXP_TOLERANCE, 0}, +{ 930, 3223498027u, 3374865460u, 0u, 227u, 3461524779u, 3374865460u, 0, LDEXP_TOLERANCE, 0}, +{ 931, 1043393020u, 3103223670u, 0u, 323u, 1382083068u, 3103223670u, 0, LDEXP_TOLERANCE, 0}, +{ 932, 1044929218u, 2872266489u, 0u, 418u, 1483233986u, 2872266489u, 0, LDEXP_TOLERANCE, 0}, +{ 933, 1050828303u, 2217887323u, 0u, 367u, 1435655695u, 2217887323u, 0, LDEXP_TOLERANCE, 0}, +{ 934, 3200788569u, 1848418423u, 0u, 200u, 3410503769u, 1848418423u, 0, LDEXP_TOLERANCE, 0}, +{ 935, 3249371352u, 2746559855u, 0u, 29u, 3279780056u, 2746559855u, 0, LDEXP_TOLERANCE, 0}, +{ 936, 3214435784u, 3646244007u, 0u, 192u, 3415762376u, 3646244007u, 0, LDEXP_TOLERANCE, 0}, +{ 937, 3197852749u, 3808681655u, 0u, 123u, 3326827597u, 3808681655u, 0, LDEXP_TOLERANCE, 0}, +{ 938, 1046103353u, 3261896205u, 0u, 69u, 1118455097u, 3261896205u, 0, LDEXP_TOLERANCE, 0}, +{ 939, 3198169239u, 2607332678u, 0u, 203u, 3411030167u, 2607332678u, 0, LDEXP_TOLERANCE, 0}, +{ 940, 3202585798u, 910680626u, 0u, 363u, 3583218886u, 910680626u, 0, LDEXP_TOLERANCE, 0}, +{ 941, 1090685451u, 2102413329u, 0u, 424u, 1535281675u, 2102413329u, 0, LDEXP_TOLERANCE, 0}, +{ 942, 3253874340u, 3516336233u, 0u, 90u, 3348246180u, 3516336233u, 0, LDEXP_TOLERANCE, 0}, +{ 943, 3232355944u, 1410347277u, 0u, 71u, 3306804840u, 1410347277u, 0, LDEXP_TOLERANCE, 0}, +{ 944, 3237050423u, 107788725u, 0u, 162u, 3406919735u, 107788725u, 0, LDEXP_TOLERANCE, 0}, +{ 945, 3231252730u, 1784424659u, 0u, 297u, 3542679802u, 1784424659u, 0, LDEXP_TOLERANCE, 0}, +{ 946, 3199349254u, 1019916843u, 0u, 366u, 3583128070u, 1019916843u, 0, LDEXP_TOLERANCE, 0}, +{ 947, 1083813098u, 2171986964u, 0u, 359u, 1460251882u, 2171986964u, 0, LDEXP_TOLERANCE, 0}, +{ 948, 1096604388u, 736131791u, 0u, 408u, 1524423396u, 736131791u, 0, LDEXP_TOLERANCE, 0}, +{ 949, 1071811135u, 3766682389u, 0u, 127u, 1204980287u, 3766682389u, 0, LDEXP_TOLERANCE, 0}, +{ 950, 1076891662u, 2200276237u, 0u, 420u, 1517293582u, 2200276237u, 0, LDEXP_TOLERANCE, 0}, +{ 951, 3234542983u, 2689686464u, 0u, 162u, 3404412295u, 2689686464u, 0, LDEXP_TOLERANCE, 0}, +{ 952, 3247609257u, 139905412u, 0u, 24u, 3272775081u, 139905412u, 0, LDEXP_TOLERANCE, 0}, +{ 953, 3234048376u, 580580861u, 0u, 373u, 3625167224u, 580580861u, 0, LDEXP_TOLERANCE, 0}, +{ 954, 3210191121u, 3524948352u, 0u, 366u, 3593969937u, 3524948352u, 0, LDEXP_TOLERANCE, 0}, +{ 955, 1101737698u, 914741728u, 0u, 349u, 1467690722u, 914741728u, 0, LDEXP_TOLERANCE, 0}, +{ 956, 1092886795u, 464054401u, 0u, 229u, 1333010699u, 464054401u, 0, LDEXP_TOLERANCE, 0}, +{ 957, 1075509277u, 417745917u, 0u, 31u, 1108015133u, 417745917u, 0, LDEXP_TOLERANCE, 0}, +{ 958, 1057279131u, 1709794784u, 0u, 249u, 1318374555u, 1709794784u, 0, LDEXP_TOLERANCE, 0}, +{ 959, 3234100445u, 3278422298u, 0u, 342u, 3592713437u, 3278422298u, 0, LDEXP_TOLERANCE, 0}, +{ 960, 3203733705u, 4261064982u, 0u, 240u, 3455391945u, 4261064982u, 0, LDEXP_TOLERANCE, 0}, +{ 961, 1100643460u, 2128617108u, 0u, 271u, 1384807556u, 2128617108u, 0, LDEXP_TOLERANCE, 0}, +{ 962, 3240438466u, 21888920u, 0u, 78u, 3322227394u, 21888920u, 0, LDEXP_TOLERANCE, 0}, +{ 963, 3197739999u, 1373233750u, 0u, 325u, 3538527199u, 1373233750u, 0, LDEXP_TOLERANCE, 0}, +{ 964, 3213773114u, 834976849u, 0u, 287u, 3514714426u, 834976849u, 0, LDEXP_TOLERANCE, 0}, +{ 965, 1106728187u, 1569913360u, 0u, 162u, 1276597499u, 1569913360u, 0, LDEXP_TOLERANCE, 0}, +{ 966, 1101338019u, 1916097176u, 0u, 119u, 1226118563u, 1916097176u, 0, LDEXP_TOLERANCE, 0}, +{ 967, 1088500589u, 2029599667u, 0u, 68u, 1159803757u, 2029599667u, 0, LDEXP_TOLERANCE, 0}, +{ 968, 3223722021u, 1092470959u, 0u, 287u, 3524663333u, 1092470959u, 0, LDEXP_TOLERANCE, 0}, +{ 969, 3227158932u, 904208640u, 0u, 104u, 3336210836u, 904208640u, 0, LDEXP_TOLERANCE, 0}, +{ 970, 3252936386u, 3748743654u, 0u, 398u, 3670269634u, 3748743654u, 0, LDEXP_TOLERANCE, 0}, +{ 971, 3214785260u, 3298077351u, 0u, 199u, 3423451884u, 3298077351u, 0, LDEXP_TOLERANCE, 0}, +{ 972, 3239386269u, 4236797974u, 0u, 54u, 3296009373u, 4236797974u, 0, LDEXP_TOLERANCE, 0}, +{ 973, 3233687691u, 2405805086u, 0u, 205u, 3448645771u, 2405805086u, 0, LDEXP_TOLERANCE, 0}, +{ 974, 3222929431u, 4279456618u, 0u, 66u, 3292135447u, 4279456618u, 0, LDEXP_TOLERANCE, 0}, +{ 975, 1045375126u, 3817511514u, 0u, 385u, 1449076886u, 3817511514u, 0, LDEXP_TOLERANCE, 0}, +{ 976, 1081540030u, 2658217784u, 0u, 224u, 1316421054u, 2658217784u, 0, LDEXP_TOLERANCE, 0}, +{ 977, 3242908935u, 2848327573u, 0u, 90u, 3337280775u, 2848327573u, 0, LDEXP_TOLERANCE, 0}, +{ 978, 1073045264u, 1841901027u, 0u, 326u, 1414881040u, 1841901027u, 0, LDEXP_TOLERANCE, 0}, +{ 979, 1090819154u, 1205187797u, 0u, 439u, 1551144018u, 1205187797u, 0, LDEXP_TOLERANCE, 0}, +{ 980, 3233869823u, 1390957964u, 0u, 5u, 3239112703u, 1390957964u, 0, LDEXP_TOLERANCE, 0}, +{ 981, 3208658945u, 2704249815u, 0u, 244u, 3464511489u, 2704249815u, 0, LDEXP_TOLERANCE, 0}, +{ 982, 3229123692u, 338765118u, 0u, 205u, 3444081772u, 338765118u, 0, LDEXP_TOLERANCE, 0}, +{ 983, 3215638141u, 2059348626u, 0u, 53u, 3271212669u, 2059348626u, 0, LDEXP_TOLERANCE, 0}, +{ 984, 3206590689u, 3769581744u, 0u, 220u, 3437277409u, 3769581744u, 0, LDEXP_TOLERANCE, 0}, +{ 985, 1087767451u, 2442561375u, 0u, 352u, 1456866203u, 2442561375u, 0, LDEXP_TOLERANCE, 0}, +{ 986, 1043029185u, 1826571949u, 0u, 287u, 1343970497u, 1826571949u, 0, LDEXP_TOLERANCE, 0}, +{ 987, 3227038874u, 4157848135u, 0u, 470u, 3719869594u, 4157848135u, 0, LDEXP_TOLERANCE, 0}, +{ 988, 3210023815u, 3262641707u, 0u, 239u, 3460633479u, 3262641707u, 0, LDEXP_TOLERANCE, 0}, +{ 989, 3233710961u, 851510610u, 0u, 299u, 3547235185u, 851510610u, 0, LDEXP_TOLERANCE, 0}, +{ 990, 3232296686u, 55834416u, 0u, 155u, 3394825966u, 55834416u, 0, LDEXP_TOLERANCE, 0}, +{ 991, 1067699608u, 4282766727u, 0u, 208u, 1285803416u, 4282766727u, 0, LDEXP_TOLERANCE, 0}, +{ 992, 1073603056u, 2574237400u, 0u, 399u, 1491984880u, 2574237400u, 0, LDEXP_TOLERANCE, 0}, +{ 993, 1059828657u, 1824828952u, 0u, 9u, 1069265841u, 1824828952u, 0, LDEXP_TOLERANCE, 0}, +{ 994, 3243078353u, 4292530873u, 0u, 111u, 3359470289u, 4292530873u, 0, LDEXP_TOLERANCE, 0}, +{ 995, 1066526787u, 3220678991u, 0u, 61u, 1130489923u, 3220678991u, 0, LDEXP_TOLERANCE, 0}, +{ 996, 1101299693u, 4056776748u, 0u, 465u, 1588887533u, 4056776748u, 0, LDEXP_TOLERANCE, 0}, +{ 997, 1071354531u, 683713613u, 0u, 210u, 1291555491u, 683713613u, 0, LDEXP_TOLERANCE, 0}, +{ 998, 1089099910u, 2719336106u, 0u, 473u, 1585076358u, 2719336106u, 0, LDEXP_TOLERANCE, 0}, +{ 999, 1084514518u, 343139655u, 0u, 247u, 1343512790u, 343139655u, 0, LDEXP_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_LDEXP_H multiple inclusion protection + +// EOF ldexp.h diff --git a/packages/language/c/libm/current/tests/vectors/log.c b/packages/language/c/libm/current/tests/vectors/log.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/log.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// log.c +// +// Test of log() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/log.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(log_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &log, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &log_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("log() is stable"); + } // if + else + { + CYG_TEST_FAIL("log() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library log() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "log() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF log.c diff --git a/packages/language/c/libm/current/tests/vectors/log.h b/packages/language/c/libm/current/tests/vectors/log.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/log.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_LOG_H +#define CYGONCE_LIBM_LOG_H +//=========================================================================== +// +// log.h +// +// Test vectors for testing of log() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/log.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define LOG_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t log_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1074540891u, 1903028788u, 0, LOG_TOLERANCE, 0}, +{ 2, 1070670006u, 3176730980u, 1051524793u, 2993920299u, 3220510532u, 3615487687u, 0, LOG_TOLERANCE, 0}, +{ 3, 1092176155u, 2725707538u, 3232101343u, 2346810316u, 1076485723u, 3768096846u, 0, LOG_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1076512669u, 440847476u, 0, LOG_TOLERANCE, 0}, +{ 5, 1073717029u, 2636405208u, 1100049309u, 471635570u, 1072024788u, 3752333164u, 0, LOG_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1076237152u, 3881795292u, 0, LOG_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 3224390518u, 1303331829u, 0, LOG_TOLERANCE, 0}, +{ 8, 1066002386u, 2688957927u, 1046089230u, 2709029994u, 3222371083u, 2601131004u, 0, LOG_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 3223472906u, 2217450498u, 0, LOG_TOLERANCE, 0}, +{ 10, 1057436194u, 1605286142u, 1068931671u, 4233776869u, 3223588152u, 3229387891u, 0, LOG_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 3223337966u, 225906160u, 0, LOG_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1077181802u, 896846388u, 0, LOG_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1075883331u, 34639343u, 0, LOG_TOLERANCE, 0}, +{ 14, 1060076142u, 1372884064u, 1080833116u, 3229926662u, 3223366428u, 4150257867u, 0, LOG_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1076626245u, 603858158u, 0, LOG_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1077124113u, 3025164482u, 0, LOG_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 3220131571u, 69509414u, 0, LOG_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 3218342176u, 3539920578u, 0, LOG_TOLERANCE, 0}, +{ 19, 1047365461u, 213658772u, 3249401130u, 314151656u, 3224418117u, 3079041052u, 0, LOG_TOLERANCE, 0}, +{ 20, 1106628640u, 1564829925u, 3197817016u, 497230814u, 1077312921u, 3110556593u, 0, LOG_TOLERANCE, 0}, +{ 21, 1068778986u, 2075329122u, 3231746400u, 169900577u, 3221506428u, 2398289983u, 0, LOG_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 3224247412u, 1892715843u, 0, LOG_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1075898248u, 2464173132u, 0, LOG_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 3223314449u, 3975492231u, 0, LOG_TOLERANCE, 0}, +{ 25, 1061381997u, 3348930841u, 1078472138u, 358457347u, 3223173654u, 3330331685u, 0, LOG_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 3220191417u, 194538985u, 0, LOG_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 3223989277u, 2142326960u, 0, LOG_TOLERANCE, 0}, +{ 28, 1105045286u, 2322696981u, 1083791358u, 3020766674u, 1077242192u, 3024017455u, 0, LOG_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 3224522714u, 3356017132u, 0, LOG_TOLERANCE, 0}, +{ 30, 1075022077u, 105589263u, 1056316170u, 261630827u, 1073307628u, 2770724689u, 0, LOG_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1077335395u, 2429249706u, 0, LOG_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1076963049u, 3484578711u, 0, LOG_TOLERANCE, 0}, +{ 33, 1086054264u, 237004814u, 3237899261u, 3364008659u, 1075953380u, 1844071u, 0, LOG_TOLERANCE, 0}, +{ 34, 1047763904u, 472004928u, 3226869477u, 1186387580u, 3224399522u, 1007725918u, 0, LOG_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 3223866312u, 1979790125u, 0, LOG_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 3223626149u, 806421346u, 0, LOG_TOLERANCE, 0}, +{ 37, 1041492999u, 3725731239u, 1061652681u, 591292963u, 3224671038u, 4206351851u, 0, LOG_TOLERANCE, 0}, +{ 38, 1077531333u, 1147041027u, 3215417793u, 624695933u, 1074397854u, 304138034u, 0, LOG_TOLERANCE, 0}, +{ 39, 1058569126u, 705725219u, 3238067573u, 1116238321u, 3223490221u, 3627345304u, 0, LOG_TOLERANCE, 0}, +{ 40, 1059883440u, 7287411u, 1045917232u, 116067742u, 3223379282u, 2727133729u, 0, LOG_TOLERANCE, 0}, +{ 41, 1092571574u, 3604989074u, 1066381836u, 545298780u, 1076513772u, 3839904761u, 0, LOG_TOLERANCE, 0}, +{ 42, 1071597288u, 1681476121u, 1060345752u, 3553822398u, 3219581306u, 453941245u, 0, LOG_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1077147289u, 3910731824u, 0, LOG_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1076227142u, 81073844u, 0, LOG_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 3223816344u, 2988035667u, 0, LOG_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1076083178u, 4168414754u, 0, LOG_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1076824388u, 355380855u, 0, LOG_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 3222589259u, 4043295995u, 0, LOG_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 3223143623u, 2781389049u, 0, LOG_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 3223605408u, 2621621078u, 0, LOG_TOLERANCE, 0}, +{ 51, 1046938380u, 1839068700u, 1077406406u, 3013052171u, 3224434459u, 186039155u, 0, LOG_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 3224457358u, 3891328709u, 0, LOG_TOLERANCE, 0}, +{ 53, 1081988573u, 3058618779u, 1046304788u, 3338676024u, 1075358802u, 3664366177u, 0, LOG_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 3224130924u, 2266434652u, 0, LOG_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1075442710u, 1201247296u, 0, LOG_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1075362553u, 3473284473u, 0, LOG_TOLERANCE, 0}, +{ 57, 1064053268u, 704542600u, 3222902057u, 2762779203u, 3222712577u, 292535648u, 0, LOG_TOLERANCE, 0}, +{ 58, 1052196966u, 184131949u, 3249723525u, 1667366082u, 3224042099u, 902609229u, 0, LOG_TOLERANCE, 0}, +{ 59, 1076125950u, 3904224140u, 1067056698u, 2942159914u, 1073910305u, 801875395u, 0, LOG_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1077052837u, 3461243802u, 0, LOG_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1077290005u, 3002616544u, 0, LOG_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1076124140u, 2634112070u, 0, LOG_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 3221310617u, 3355564135u, 0, LOG_TOLERANCE, 0}, +{ 64, 1087257949u, 773857656u, 3214251949u, 335833884u, 1076054914u, 2342316503u, 0, LOG_TOLERANCE, 0}, +{ 65, 1055740962u, 1473865960u, 1103073830u, 4000427507u, 3223739108u, 2937886411u, 0, LOG_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1077161341u, 1502148359u, 0, LOG_TOLERANCE, 0}, +{ 67, 1045032426u, 1732245037u, 1101371955u, 1533536108u, 3224517488u, 2540091285u, 0, LOG_TOLERANCE, 0}, +{ 68, 1101670347u, 1833841275u, 1099430098u, 4144145552u, 1077097689u, 1827704426u, 0, LOG_TOLERANCE, 0}, +{ 69, 1096786815u, 935007012u, 3188865420u, 604442938u, 1076878511u, 3599854352u, 0, LOG_TOLERANCE, 0}, +{ 70, 1059419605u, 2211464602u, 1046255144u, 1635910526u, 3223416641u, 2853698743u, 0, LOG_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1074493859u, 1273814856u, 0, LOG_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1075372707u, 3860522421u, 0, LOG_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1076673000u, 3709218343u, 0, LOG_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 3224538246u, 3654279494u, 0, LOG_TOLERANCE, 0}, +{ 75, 1065447634u, 2527221960u, 1099107978u, 2696971136u, 3222474800u, 4009812961u, 0, LOG_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1076902534u, 3732378643u, 0, LOG_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1075980619u, 1773153190u, 0, LOG_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1073166352u, 3728304610u, 0, LOG_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 3223181918u, 1963485299u, 0, LOG_TOLERANCE, 0}, +{ 80, 1053350775u, 2588067350u, 3206610957u, 3551059728u, 3223942494u, 644369098u, 0, LOG_TOLERANCE, 0}, +{ 81, 1059495208u, 845263327u, 1073415902u, 1749010288u, 3223409778u, 2981196663u, 0, LOG_TOLERANCE, 0}, +{ 82, 1058092722u, 3092685191u, 3190678390u, 2872219490u, 3223536395u, 1369453498u, 0, LOG_TOLERANCE, 0}, +{ 83, 1070831407u, 4107255722u, 3205337291u, 3069068345u, 3220369660u, 1794319742u, 0, LOG_TOLERANCE, 0}, +{ 84, 1096507209u, 2294867524u, 3216653996u, 2860384670u, 1076859525u, 3809728678u, 0, LOG_TOLERANCE, 0}, +{ 85, 1045842702u, 2265437201u, 3240198679u, 1234948614u, 3224481964u, 2712155181u, 0, LOG_TOLERANCE, 0}, +{ 86, 1068876281u, 1186945904u, 3251167793u, 1896750851u, 3221469375u, 2742155072u, 0, LOG_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1075296587u, 3889440640u, 0, LOG_TOLERANCE, 0}, +{ 88, 1075992592u, 3006860614u, 3231412671u, 2504194724u, 1073855151u, 3443930242u, 0, LOG_TOLERANCE, 0}, +{ 89, 1088665612u, 1948717780u, 1048317852u, 3791803982u, 1076180575u, 2837452927u, 0, LOG_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 3222669202u, 2086824310u, 0, LOG_TOLERANCE, 0}, +{ 91, 1098334178u, 4108948538u, 1104691287u, 640541190u, 1076953692u, 3764323674u, 0, LOG_TOLERANCE, 0}, +{ 92, 1059773769u, 3259274853u, 1082507103u, 3677038020u, 3223387203u, 652947737u, 0, LOG_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1075552988u, 2879643514u, 0, LOG_TOLERANCE, 0}, +{ 94, 1041211624u, 3011191657u, 1103798670u, 1096124830u, 3224686171u, 4236981062u, 0, LOG_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 3222863454u, 3023388900u, 0, LOG_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1075655034u, 3985941u, 0, LOG_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 3224133724u, 2580792529u, 0, LOG_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1074638865u, 873855649u, 0, LOG_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1077150061u, 2488377505u, 0, LOG_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1072736455u, 2653940335u, 0, LOG_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1075415392u, 845037314u, 0, LOG_TOLERANCE, 0}, +{ 102, 1099367744u, 1190259653u, 1069112254u, 3417249840u, 1076998470u, 583465987u, 0, LOG_TOLERANCE, 0}, +{ 103, 1046179435u, 3467757357u, 3215075200u, 2168175352u, 3224468372u, 699090977u, 0, LOG_TOLERANCE, 0}, +{ 104, 1092159487u, 1508888184u, 1060430241u, 3524949092u, 1076484398u, 3433728995u, 0, LOG_TOLERANCE, 0}, +{ 105, 1049929235u, 166402802u, 3237198975u, 3572369260u, 3224239364u, 1031401866u, 0, LOG_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1075341949u, 2087866809u, 0, LOG_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 3222999832u, 525496360u, 0, LOG_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1075436501u, 1627606965u, 0, LOG_TOLERANCE, 0}, +{ 109, 1048145373u, 2055773734u, 3239267288u, 291396537u, 3224382486u, 3880399396u, 0, LOG_TOLERANCE, 0}, +{ 110, 1089484385u, 874125203u, 3210508124u, 4091098764u, 1076245763u, 2990601621u, 0, LOG_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 3222419509u, 1596544603u, 0, LOG_TOLERANCE, 0}, +{ 112, 1059055762u, 2243036871u, 3243941101u, 740033495u, 3223455501u, 3494510298u, 0, LOG_TOLERANCE, 0}, +{ 113, 1061941258u, 1176656356u, 1074261978u, 3588756231u, 3223078104u, 2251846605u, 0, LOG_TOLERANCE, 0}, +{ 114, 1105333143u, 3037249392u, 1061635587u, 1173102190u, 1077255068u, 2564022463u, 0, LOG_TOLERANCE, 0}, +{ 115, 1089725933u, 2882725208u, 1071440059u, 69225090u, 1076272613u, 3133483140u, 0, LOG_TOLERANCE, 0}, +{ 116, 1065179826u, 272319256u, 1072073912u, 2493997123u, 3222520025u, 35444247u, 0, LOG_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 3223565703u, 1891613632u, 0, LOG_TOLERANCE, 0}, +{ 118, 1089274869u, 1990439193u, 1078073146u, 622849962u, 1076231202u, 576311790u, 0, LOG_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 3223617015u, 1816165507u, 0, LOG_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 3223128149u, 56153389u, 0, LOG_TOLERANCE, 0}, +{ 121, 1047807349u, 2676398686u, 1105124431u, 3631096636u, 3224397343u, 888392923u, 0, LOG_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 3222534081u, 901870173u, 0, LOG_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1074579794u, 2595838239u, 0, LOG_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 3217957038u, 249307172u, 0, LOG_TOLERANCE, 0}, +{ 125, 1093747188u, 4140316002u, 1082896196u, 868256971u, 1076617361u, 2144012240u, 0, LOG_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1073593180u, 257551340u, 0, LOG_TOLERANCE, 0}, +{ 127, 1072707675u, 2427162817u, 3234748208u, 2715105792u, 1066138778u, 4007247913u, 0, LOG_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 3222613950u, 3450803557u, 0, LOG_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 3224503930u, 40325151u, 0, LOG_TOLERANCE, 0}, +{ 130, 1104362211u, 105058217u, 1069733884u, 171786224u, 1077213809u, 3629677324u, 0, LOG_TOLERANCE, 0}, +{ 131, 1042130860u, 2863482262u, 3204997271u, 877784425u, 3224644968u, 1676714437u, 0, LOG_TOLERANCE, 0}, +{ 132, 1055145665u, 2801782962u, 3213604117u, 762347195u, 3223787690u, 2201912701u, 0, LOG_TOLERANCE, 0}, +{ 133, 1086003079u, 2317950339u, 3246333414u, 2135700283u, 1075949654u, 3685526240u, 0, LOG_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 3223668346u, 2563284746u, 0, LOG_TOLERANCE, 0}, +{ 135, 1072665436u, 1918836931u, 1083603224u, 3137821660u, 3213580135u, 893380042u, 0, LOG_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1077193523u, 822124921u, 0, LOG_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 3224640144u, 325222787u, 0, LOG_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1075254813u, 4250911823u, 0, LOG_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 3223117750u, 1822741563u, 0, LOG_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1073512919u, 2889360534u, 0, LOG_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1076852847u, 2966471226u, 0, LOG_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1075271177u, 857411703u, 0, LOG_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1073973813u, 3836746166u, 0, LOG_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1077084471u, 2387840489u, 0, LOG_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 3221392912u, 284483311u, 0, LOG_TOLERANCE, 0}, +{ 146, 1041146119u, 978126928u, 1101553990u, 4047893399u, 3224688276u, 2169141442u, 0, LOG_TOLERANCE, 0}, +{ 147, 1074838397u, 4059818629u, 1042678728u, 3640293589u, 1073145238u, 3502645173u, 0, LOG_TOLERANCE, 0}, +{ 148, 1100980392u, 3383497159u, 1070002807u, 1527313008u, 1077064713u, 1414579044u, 0, LOG_TOLERANCE, 0}, +{ 149, 1055224031u, 2599946514u, 1104170406u, 2738675352u, 3223780168u, 3507302766u, 0, LOG_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1077249247u, 447338991u, 0, LOG_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1073870707u, 3139112125u, 0, LOG_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 3224612476u, 4074628725u, 0, LOG_TOLERANCE, 0}, +{ 153, 1085623441u, 182132862u, 3250520938u, 3924356991u, 1075918122u, 3179461172u, 0, LOG_TOLERANCE, 0}, +{ 154, 1083018236u, 35632886u, 3209806504u, 1453402523u, 1075537959u, 623164823u, 0, LOG_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1075633073u, 1072570609u, 0, LOG_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1075140463u, 1443082546u, 0, LOG_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1076728209u, 2297940933u, 0, LOG_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 3223506870u, 2768289813u, 0, LOG_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1074828702u, 2706157180u, 0, LOG_TOLERANCE, 0}, +{ 160, 1089975150u, 4215445172u, 3196654963u, 2231888973u, 1076295536u, 1878052368u, 0, LOG_TOLERANCE, 0}, +{ 161, 1099148583u, 40413554u, 3232578253u, 983832844u, 1076988183u, 659398356u, 0, LOG_TOLERANCE, 0}, +{ 162, 1076237886u, 3995725873u, 1050082319u, 777231627u, 1073952502u, 2239349650u, 0, LOG_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 3224693702u, 1244542645u, 0, LOG_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 3221658269u, 491532286u, 0, LOG_TOLERANCE, 0}, +{ 165, 1062562529u, 1018222907u, 3244621407u, 3090050495u, 3222966069u, 1798186974u, 0, LOG_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 3221889754u, 422952393u, 0, LOG_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1074681949u, 957372433u, 0, LOG_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 3224609760u, 104190259u, 0, LOG_TOLERANCE, 0}, +{ 169, 1068615357u, 1710131411u, 1078123323u, 1900790503u, 3221575334u, 2209933262u, 0, LOG_TOLERANCE, 0}, +{ 170, 1091335713u, 3420420033u, 3210844787u, 588423066u, 1076410379u, 2857617467u, 0, LOG_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 3224265557u, 1934933585u, 0, LOG_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1077136037u, 807141120u, 0, LOG_TOLERANCE, 0}, +{ 173, 1079144091u, 1325936170u, 3221436876u, 680097612u, 1074869144u, 1389489581u, 0, LOG_TOLERANCE, 0}, +{ 174, 1092907468u, 1827735934u, 3200554324u, 2875599271u, 1076548720u, 3300536450u, 0, LOG_TOLERANCE, 0}, +{ 175, 1043546754u, 3117037091u, 3239246636u, 15838845u, 3224582402u, 735648025u, 0, LOG_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 3224062834u, 1671881275u, 0, LOG_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 3224525641u, 1389402172u, 0, LOG_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1076940082u, 1040831789u, 0, LOG_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1075223810u, 3769104780u, 0, LOG_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1075843299u, 2828558175u, 0, LOG_TOLERANCE, 0}, +{ 181, 1069146422u, 1141349287u, 1097465301u, 3403438584u, 3221378415u, 3648723478u, 0, LOG_TOLERANCE, 0}, +{ 182, 1083088260u, 1711085243u, 3250239076u, 1377484108u, 1075547271u, 2365864324u, 0, LOG_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1076955843u, 3972039239u, 0, LOG_TOLERANCE, 0}, +{ 184, 1086737787u, 2626629370u, 1063771493u, 1499080813u, 1076015009u, 3210927368u, 0, LOG_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 3223779495u, 3949784643u, 0, LOG_TOLERANCE, 0}, +{ 186, 1060498071u, 1270950554u, 3194616071u, 3680565379u, 3223323033u, 321203519u, 0, LOG_TOLERANCE, 0}, +{ 187, 1060664575u, 1066985223u, 3221613219u, 4089383168u, 3223294689u, 1322613376u, 0, LOG_TOLERANCE, 0}, +{ 188, 1069575191u, 4017329311u, 3208334452u, 1667591498u, 3221253465u, 2986438966u, 0, LOG_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1076135995u, 2019766276u, 0, LOG_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 3224183212u, 4205833787u, 0, LOG_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1077239436u, 1428994741u, 0, LOG_TOLERANCE, 0}, +{ 192, 1043081808u, 1371169579u, 1057079837u, 2594818628u, 3224602920u, 15908725u, 0, LOG_TOLERANCE, 0}, +{ 193, 1104309688u, 2259342224u, 3217432469u, 1824221478u, 1077211020u, 98865074u, 0, LOG_TOLERANCE, 0}, +{ 194, 1099351127u, 1576604497u, 1079368611u, 185078728u, 1076997744u, 1291065544u, 0, LOG_TOLERANCE, 0}, +{ 195, 1074195779u, 444800035u, 3243343143u, 1734989302u, 1072748681u, 843810783u, 0, LOG_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1068136489u, 4008523687u, 0, LOG_TOLERANCE, 0}, +{ 197, 1087212320u, 1941318385u, 1045807374u, 792193370u, 1076051861u, 1971888733u, 0, LOG_TOLERANCE, 0}, +{ 198, 1090816018u, 1299392207u, 3212131720u, 3205732280u, 1076367573u, 2393072u, 0, LOG_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1076967753u, 3012582896u, 0, LOG_TOLERANCE, 0}, +{ 200, 1099192612u, 2160225215u, 1102624859u, 836655570u, 1076990383u, 2071736056u, 0, LOG_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1076874455u, 1406950864u, 0, LOG_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 3220243332u, 3261297932u, 0, LOG_TOLERANCE, 0}, +{ 203, 1082932703u, 1603798153u, 3207725532u, 1099413093u, 1075526116u, 1499961334u, 0, LOG_TOLERANCE, 0}, +{ 204, 1099194730u, 2429340443u, 3190303581u, 3223770005u, 1076990487u, 2107238709u, 0, LOG_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1073805017u, 587786177u, 0, LOG_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1076554875u, 1291039930u, 0, LOG_TOLERANCE, 0}, +{ 207, 1045686228u, 2782073372u, 1046063872u, 4023829068u, 3224489388u, 2570927601u, 0, LOG_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1076962930u, 2095896905u, 0, LOG_TOLERANCE, 0}, +{ 209, 1091027173u, 3506346169u, 1047020885u, 1742757458u, 1076386679u, 701024000u, 0, LOG_TOLERANCE, 0}, +{ 210, 1045180829u, 1265459564u, 3193450280u, 3650514880u, 3224512001u, 2115795402u, 0, LOG_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1075325589u, 1311722038u, 0, LOG_TOLERANCE, 0}, +{ 212, 1101185272u, 1263613754u, 3219096387u, 635677201u, 1077075888u, 464532810u, 0, LOG_TOLERANCE, 0}, +{ 213, 1058788439u, 4140947288u, 3200792376u, 2013265346u, 3223473429u, 1675510139u, 0, LOG_TOLERANCE, 0}, +{ 214, 1102490744u, 1912759945u, 3237045253u, 1351396825u, 1077133753u, 2656194917u, 0, LOG_TOLERANCE, 0}, +{ 215, 1100721514u, 1001433078u, 3206926643u, 2741676659u, 1077055969u, 4157777791u, 0, LOG_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1075174891u, 2711796576u, 0, LOG_TOLERANCE, 0}, +{ 217, 1068250409u, 831239754u, 1099828675u, 3071308141u, 3221696665u, 3906974917u, 0, LOG_TOLERANCE, 0}, +{ 218, 1078350849u, 3473592372u, 1102759382u, 1309576357u, 1074685015u, 3258092383u, 0, LOG_TOLERANCE, 0}, +{ 219, 1103703058u, 2042340367u, 1091945628u, 2062772374u, 1077186030u, 1455653889u, 0, LOG_TOLERANCE, 0}, +{ 220, 1047282039u, 1840632537u, 1096533424u, 807510337u, 3224421005u, 2259729181u, 0, LOG_TOLERANCE, 0}, +{ 221, 1083968074u, 144814872u, 3212698915u, 2282965697u, 1075705943u, 2949949432u, 0, LOG_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 3219987405u, 558247611u, 0, LOG_TOLERANCE, 0}, +{ 223, 1095609417u, 2858583811u, 1089760910u, 6360994u, 1076779252u, 1692550517u, 0, LOG_TOLERANCE, 0}, +{ 224, 1050781281u, 1614537194u, 1075198900u, 4088705365u, 3224169080u, 729983519u, 0, LOG_TOLERANCE, 0}, +{ 225, 1103455422u, 3545570051u, 1065221325u, 1629217700u, 1077175370u, 4002504631u, 0, LOG_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1067997677u, 2531803269u, 0, LOG_TOLERANCE, 0}, +{ 227, 1049319038u, 2406734491u, 1042055360u, 89226663u, 3224293435u, 489486239u, 0, LOG_TOLERANCE, 0}, +{ 228, 1048267433u, 1618759139u, 3194723421u, 3888234802u, 3224377854u, 2361316317u, 0, LOG_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 3223768296u, 2784142069u, 0, LOG_TOLERANCE, 0}, +{ 230, 1042459412u, 2431246964u, 3241512456u, 183850734u, 3224629872u, 2676796459u, 0, LOG_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1076247809u, 3557509436u, 0, LOG_TOLERANCE, 0}, +{ 232, 1087811016u, 3495352775u, 1058576726u, 596957268u, 1076108054u, 1212781005u, 0, LOG_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 3224453778u, 155767862u, 0, LOG_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 3223538604u, 4095262392u, 0, LOG_TOLERANCE, 0}, +{ 235, 1052841323u, 2143376228u, 1098306332u, 3760236188u, 3223991649u, 3574225414u, 0, LOG_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1073010422u, 1713289607u, 0, LOG_TOLERANCE, 0}, +{ 237, 1066682341u, 2493598049u, 3194927008u, 1689107592u, 3222233045u, 4244143336u, 0, LOG_TOLERANCE, 0}, +{ 238, 1042506311u, 1578976988u, 1066368383u, 2117279163u, 3224627407u, 1544732865u, 0, LOG_TOLERANCE, 0}, +{ 239, 1075504463u, 3425290087u, 1098487295u, 1263412017u, 1073642915u, 3833207621u, 0, LOG_TOLERANCE, 0}, +{ 240, 1060949116u, 3635396812u, 1070999426u, 3965655689u, 3223251850u, 3656828940u, 0, LOG_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 3223353941u, 673602059u, 0, LOG_TOLERANCE, 0}, +{ 242, 1074462441u, 199516350u, 1078368488u, 164621458u, 1072919989u, 2683332925u, 0, LOG_TOLERANCE, 0}, +{ 243, 1040222370u, 3570940805u, 3230316437u, 3596080877u, 3224728682u, 1709229047u, 0, LOG_TOLERANCE, 0}, +{ 244, 1060725917u, 980880313u, 1079833442u, 884465057u, 3223284843u, 3908226837u, 0, LOG_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1077021347u, 3750522257u, 0, LOG_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 3224427192u, 1939315825u, 0, LOG_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 3223265222u, 1391917703u, 0, LOG_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 3223409696u, 4240953644u, 0, LOG_TOLERANCE, 0}, +{ 249, 1088728303u, 751136990u, 3230392165u, 3493275472u, 1076186784u, 2895449770u, 0, LOG_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1076955046u, 322553682u, 0, LOG_TOLERANCE, 0}, +{ 251, 1102940648u, 1717672108u, 1048120593u, 531240316u, 1077151087u, 2450752868u, 0, LOG_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 3223871070u, 2651694237u, 0, LOG_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1074484865u, 4212387521u, 0, LOG_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1075740110u, 1796153641u, 0, LOG_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 3224563892u, 4131735963u, 0, LOG_TOLERANCE, 0}, +{ 256, 1087992954u, 451471221u, 1064816262u, 4187644495u, 1076123190u, 1571278527u, 0, LOG_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1077002369u, 1210365152u, 0, LOG_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 3224717916u, 793577502u, 0, LOG_TOLERANCE, 0}, +{ 259, 1065765700u, 179066662u, 1103272172u, 1217337578u, 3222410441u, 3473154820u, 0, LOG_TOLERANCE, 0}, +{ 260, 1064078729u, 3779303391u, 3210023352u, 3115946280u, 3222708985u, 2675466261u, 0, LOG_TOLERANCE, 0}, +{ 261, 1045506226u, 286247089u, 1085153597u, 713645369u, 3224499119u, 1542442198u, 0, LOG_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1076608158u, 1444206071u, 0, LOG_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1075553831u, 3885636882u, 0, LOG_TOLERANCE, 0}, +{ 264, 1054212159u, 2256346551u, 3222430705u, 2071674991u, 3223867641u, 979926413u, 0, LOG_TOLERANCE, 0}, +{ 265, 1056541047u, 2295269094u, 1084451053u, 2773103941u, 3223666401u, 3176085154u, 0, LOG_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1074617461u, 2338252184u, 0, LOG_TOLERANCE, 0}, +{ 267, 1073582325u, 1381740563u, 1071545057u, 2918235653u, 1071883840u, 3334584948u, 0, LOG_TOLERANCE, 0}, +{ 268, 1091232324u, 1105857967u, 3241990046u, 2703723225u, 1076402905u, 1352770697u, 0, LOG_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 3224605314u, 4170986094u, 0, LOG_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1076331263u, 3328774237u, 0, LOG_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 3222628918u, 1375948702u, 0, LOG_TOLERANCE, 0}, +{ 272, 1066308179u, 2136071361u, 3211529757u, 993675115u, 3222327669u, 78816142u, 0, LOG_TOLERANCE, 0}, +{ 273, 1066179733u, 210772141u, 3241441539u, 580731413u, 3222345037u, 3927815368u, 0, LOG_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1076627743u, 550680420u, 0, LOG_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 3222205293u, 3536028076u, 0, LOG_TOLERANCE, 0}, +{ 276, 1041806969u, 1578223762u, 3224596567u, 2456166162u, 3224656916u, 862250271u, 0, LOG_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 3223495400u, 2942554941u, 0, LOG_TOLERANCE, 0}, +{ 278, 1084379746u, 2352173188u, 1079361728u, 4070222179u, 1075776093u, 2662684686u, 0, LOG_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1077065985u, 500272335u, 0, LOG_TOLERANCE, 0}, +{ 280, 1049519003u, 330905705u, 1086260896u, 90264431u, 3224279566u, 1302925296u, 0, LOG_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 3224703502u, 4232165330u, 0, LOG_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1075186970u, 3091760478u, 0, LOG_TOLERANCE, 0}, +{ 283, 1102323563u, 3736863454u, 1063475914u, 3150741666u, 1077125931u, 2240619440u, 0, LOG_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 3223275563u, 4059264129u, 0, LOG_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1075056284u, 3935577174u, 0, LOG_TOLERANCE, 0}, +{ 286, 1099500686u, 2132131375u, 3250483427u, 3449276437u, 1077004004u, 2860765758u, 0, LOG_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1076238827u, 2435489549u, 0, LOG_TOLERANCE, 0}, +{ 288, 1071289056u, 4090088208u, 1042030013u, 3898658299u, 3219923055u, 1857017027u, 0, LOG_TOLERANCE, 0}, +{ 289, 1060424416u, 2272831437u, 3253082595u, 2639188641u, 3223329932u, 4210841791u, 0, LOG_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 3223824989u, 3244034946u, 0, LOG_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1073863724u, 4035608178u, 0, LOG_TOLERANCE, 0}, +{ 292, 1095283362u, 996259334u, 3241496889u, 3782673116u, 1076755197u, 2401647281u, 0, LOG_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1076987270u, 1735374993u, 0, LOG_TOLERANCE, 0}, +{ 294, 1103935945u, 95874100u, 3237232828u, 2645647822u, 1077194684u, 2850194252u, 0, LOG_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 3224576503u, 273309740u, 0, LOG_TOLERANCE, 0}, +{ 296, 1091109904u, 2560836004u, 3199616543u, 1180840586u, 1076393466u, 634133261u, 0, LOG_TOLERANCE, 0}, +{ 297, 1074119318u, 2218230392u, 3227485787u, 3947214579u, 1072693915u, 3593274056u, 0, LOG_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1074943401u, 3038225178u, 0, LOG_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 3215923786u, 3238443975u, 0, LOG_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1076943624u, 3187559764u, 0, LOG_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1075874049u, 1040928910u, 0, LOG_TOLERANCE, 0}, +{ 302, 1051600232u, 1346862963u, 1077836259u, 3604666660u, 3224098914u, 287386136u, 0, LOG_TOLERANCE, 0}, +{ 303, 1064772331u, 3115209742u, 1099332326u, 1325101950u, 3222582423u, 1527830367u, 0, LOG_TOLERANCE, 0}, +{ 304, 1077062394u, 3889223100u, 1053247613u, 3371396923u, 1074227736u, 3155029876u, 0, LOG_TOLERANCE, 0}, +{ 305, 1072994220u, 4163120793u, 1075022670u, 1387631215u, 1070605899u, 3048914167u, 0, LOG_TOLERANCE, 0}, +{ 306, 1057998131u, 1532426189u, 1063168268u, 3397022615u, 3223546922u, 3454376569u, 0, LOG_TOLERANCE, 0}, +{ 307, 1053549673u, 89324166u, 1079206060u, 3429424710u, 3223927395u, 296891673u, 0, LOG_TOLERANCE, 0}, +{ 308, 1044841454u, 747591401u, 1072238381u, 2803213904u, 3224525301u, 1809647640u, 0, LOG_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1076393775u, 2673972484u, 0, LOG_TOLERANCE, 0}, +{ 310, 1080585266u, 314958082u, 3249912496u, 2966213175u, 1075124621u, 156791433u, 0, LOG_TOLERANCE, 0}, +{ 311, 1049695766u, 3119528953u, 3217179014u, 2908718240u, 3224264186u, 1502162494u, 0, LOG_TOLERANCE, 0}, +{ 312, 1094983928u, 2018361566u, 1100926600u, 3985805054u, 1076728385u, 621786893u, 0, LOG_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 3220843859u, 3819242064u, 0, LOG_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1073766572u, 1356860078u, 0, LOG_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1077093468u, 3222605176u, 0, LOG_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1076811501u, 1717897709u, 0, LOG_TOLERANCE, 0}, +{ 317, 1106743252u, 3250487255u, 1062120700u, 1876195180u, 1077317976u, 138849911u, 0, LOG_TOLERANCE, 0}, +{ 318, 1078859832u, 1336400247u, 1098057903u, 3314079581u, 1074815957u, 1152068432u, 0, LOG_TOLERANCE, 0}, +{ 319, 1056195172u, 265025555u, 1063854282u, 3779482256u, 3223696746u, 1903973229u, 0, LOG_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 3222032812u, 2455803958u, 0, LOG_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 3224223208u, 4043849432u, 0, LOG_TOLERANCE, 0}, +{ 322, 1055016507u, 2875684421u, 3227459837u, 2251967570u, 3223801114u, 1956518469u, 0, LOG_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 3222862271u, 3966292736u, 0, LOG_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1077089046u, 2278939221u, 0, LOG_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 3222568808u, 3221004128u, 0, LOG_TOLERANCE, 0}, +{ 326, 1096635140u, 2529029548u, 3249882819u, 3781513577u, 1076868555u, 562313644u, 0, LOG_TOLERANCE, 0}, +{ 327, 1065952706u, 1080845539u, 3206760016u, 911778687u, 3222378869u, 341314984u, 0, LOG_TOLERANCE, 0}, +{ 328, 1044467388u, 469586759u, 1091830022u, 3080528840u, 3224543980u, 1618140319u, 0, LOG_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1075062818u, 3647419175u, 0, LOG_TOLERANCE, 0}, +{ 330, 1063343336u, 4080017377u, 3206492941u, 1470284690u, 3222839853u, 2867700472u, 0, LOG_TOLERANCE, 0}, +{ 331, 1059636742u, 3867917386u, 1102054928u, 3504746045u, 3223397823u, 1671545983u, 0, LOG_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 3222629666u, 3158492516u, 0, LOG_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1076138651u, 2622934639u, 0, LOG_TOLERANCE, 0}, +{ 334, 1055486470u, 2180218657u, 3211592260u, 1206527853u, 3223757724u, 3258037863u, 0, LOG_TOLERANCE, 0}, +{ 335, 1049601096u, 394130786u, 3242511482u, 2437699868u, 3224274271u, 3825574203u, 0, LOG_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 3224553811u, 3657190491u, 0, LOG_TOLERANCE, 0}, +{ 337, 1062656366u, 3128971673u, 3249137531u, 2773583059u, 3222949104u, 4235986512u, 0, LOG_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1075864251u, 1337466743u, 0, LOG_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1077071097u, 630507849u, 0, LOG_TOLERANCE, 0}, +{ 340, 1104807187u, 1873709254u, 3245167989u, 44275991u, 1077233627u, 35393437u, 0, LOG_TOLERANCE, 0}, +{ 341, 1042185105u, 1174874204u, 3208263730u, 2360372288u, 3224643164u, 1125405730u, 0, LOG_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1077191792u, 2799624452u, 0, LOG_TOLERANCE, 0}, +{ 343, 1096065286u, 2469774991u, 1043117070u, 3380071805u, 1076822454u, 3235225443u, 0, LOG_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 3223533145u, 2585938391u, 0, LOG_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 3221478934u, 598289984u, 0, LOG_TOLERANCE, 0}, +{ 346, 1107228981u, 4001809575u, 3240128649u, 278261523u, 1077335900u, 1358170156u, 0, LOG_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1076052696u, 2028953044u, 0, LOG_TOLERANCE, 0}, +{ 348, 1053468899u, 2511916952u, 3219195283u, 1697158299u, 3223933318u, 3252060136u, 0, LOG_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 3220942754u, 2973571582u, 0, LOG_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1077191534u, 3981186583u, 0, LOG_TOLERANCE, 0}, +{ 351, 1063780306u, 3275604304u, 3194840159u, 2991205850u, 3222754528u, 2855600771u, 0, LOG_TOLERANCE, 0}, +{ 352, 1047765727u, 3509997278u, 3248888030u, 3897986511u, 3224399429u, 1263281156u, 0, LOG_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 3224424628u, 4130330871u, 0, LOG_TOLERANCE, 0}, +{ 354, 1065780437u, 1073153314u, 3250031627u, 2567234990u, 3222407810u, 3861114186u, 0, LOG_TOLERANCE, 0}, +{ 355, 1043109764u, 4261696995u, 3197784432u, 323702024u, 3224601934u, 3660455745u, 0, LOG_TOLERANCE, 0}, +{ 356, 1096207349u, 4075177615u, 3202791065u, 1919006082u, 1076835551u, 1200557086u, 0, LOG_TOLERANCE, 0}, +{ 357, 1091786365u, 386429966u, 1086504491u, 3698826164u, 1076450574u, 1244797795u, 0, LOG_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1074676469u, 2143197479u, 0, LOG_TOLERANCE, 0}, +{ 359, 1069828285u, 3719038997u, 1055433962u, 3331415058u, 3221059996u, 3710963779u, 0, LOG_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 3223281121u, 4182204469u, 0, LOG_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1075348638u, 2488201983u, 0, LOG_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 3224664830u, 1088579835u, 0, LOG_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 3223685636u, 4242260445u, 0, LOG_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1076478694u, 1626266244u, 0, LOG_TOLERANCE, 0}, +{ 365, 1066407215u, 1897285171u, 3251296075u, 944966123u, 3222314345u, 3783490951u, 0, LOG_TOLERANCE, 0}, +{ 366, 1093887602u, 2270747330u, 3230692631u, 422503284u, 1076632700u, 2223491330u, 0, LOG_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1075726771u, 3738019719u, 0, LOG_TOLERANCE, 0}, +{ 368, 1055991450u, 1380066948u, 3232612906u, 2613634294u, 3223718579u, 1312415733u, 0, LOG_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 3222736721u, 3541437472u, 0, LOG_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 3224534827u, 704175941u, 0, LOG_TOLERANCE, 0}, +{ 371, 1069243652u, 1859175955u, 1079949560u, 4258450607u, 3221349189u, 3394474619u, 0, LOG_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 3224377490u, 3333906039u, 0, LOG_TOLERANCE, 0}, +{ 373, 1045699515u, 2454653987u, 3229487005u, 2977478685u, 3224488724u, 2052223869u, 0, LOG_TOLERANCE, 0}, +{ 374, 1106072835u, 1355181872u, 1095308770u, 436846481u, 1077286905u, 3531674556u, 0, LOG_TOLERANCE, 0}, +{ 375, 1099121654u, 2592856453u, 3247825559u, 3195234082u, 1076986800u, 414496240u, 0, LOG_TOLERANCE, 0}, +{ 376, 1074634375u, 3554670043u, 1091621009u, 3321236467u, 1073017240u, 1967217478u, 0, LOG_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 3221421428u, 846254916u, 0, LOG_TOLERANCE, 0}, +{ 378, 1044807461u, 2960339502u, 1098808013u, 1044068983u, 3224526795u, 1144583180u, 0, LOG_TOLERANCE, 0}, +{ 379, 1049207537u, 4093388677u, 1095478112u, 1735930261u, 3224301857u, 951820485u, 0, LOG_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1076387779u, 4000737953u, 0, LOG_TOLERANCE, 0}, +{ 381, 1061810546u, 3250576797u, 1059002384u, 3043079652u, 3223097520u, 3867116202u, 0, LOG_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 3221359984u, 44859516u, 0, LOG_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1077176849u, 3384776839u, 0, LOG_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 3223859833u, 3933837574u, 0, LOG_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1077315609u, 3224780635u, 0, LOG_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1075177620u, 3055843857u, 0, LOG_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1075722621u, 2632841302u, 0, LOG_TOLERANCE, 0}, +{ 388, 1072438992u, 2284484846u, 3219498359u, 3240896015u, 3217066749u, 4038143420u, 0, LOG_TOLERANCE, 0}, +{ 389, 1088276041u, 494503287u, 1092811254u, 142673998u, 1076143734u, 3881294548u, 0, LOG_TOLERANCE, 0}, +{ 390, 1104642268u, 3394882641u, 3225306538u, 364852125u, 1077226961u, 36589885u, 0, LOG_TOLERANCE, 0}, +{ 391, 1077778115u, 193885269u, 1088149839u, 1359805831u, 1074469221u, 177780347u, 0, LOG_TOLERANCE, 0}, +{ 392, 1053001134u, 592580907u, 3199560872u, 3086438952u, 3223974161u, 362317677u, 0, LOG_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 3223407720u, 1905177841u, 0, LOG_TOLERANCE, 0}, +{ 394, 1099249950u, 233240285u, 1081923320u, 2710903921u, 1076993142u, 1735323538u, 0, LOG_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 3221275628u, 3951131729u, 0, LOG_TOLERANCE, 0}, +{ 396, 1073711076u, 3647632375u, 3247225271u, 3839959621u, 1072018756u, 943970224u, 0, LOG_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1077172781u, 196725945u, 0, LOG_TOLERANCE, 0}, +{ 398, 1045520036u, 2134662911u, 3190390590u, 4239009051u, 3224498319u, 1757386403u, 0, LOG_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1075114754u, 3304741914u, 0, LOG_TOLERANCE, 0}, +{ 400, 1072380611u, 538224650u, 3206153057u, 1379649610u, 3217336794u, 1283130523u, 0, LOG_TOLERANCE, 0}, +{ 401, 1048926859u, 3683897920u, 3244167599u, 3647579469u, 3224325816u, 816770831u, 0, LOG_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1076319090u, 3356403737u, 0, LOG_TOLERANCE, 0}, +{ 403, 1064151744u, 872706833u, 1084802480u, 2200602798u, 3222698951u, 2113199186u, 0, LOG_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 3224636627u, 746916981u, 0, LOG_TOLERANCE, 0}, +{ 405, 1048211322u, 1894173462u, 3232800651u, 191960416u, 3224379943u, 1996947825u, 0, LOG_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1076402384u, 4209768157u, 0, LOG_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1076763329u, 2457717894u, 0, LOG_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 3222719457u, 2955792047u, 0, LOG_TOLERANCE, 0}, +{ 409, 1091348993u, 2287646644u, 3240329321u, 2276183378u, 1076411309u, 2287451717u, 0, LOG_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 3221708492u, 3428245006u, 0, LOG_TOLERANCE, 0}, +{ 411, 1065284713u, 36116288u, 3206886566u, 4196602670u, 3222506108u, 2017444572u, 0, LOG_TOLERANCE, 0}, +{ 412, 1094212205u, 3550227562u, 3207257983u, 2747744117u, 1076662503u, 4126480558u, 0, LOG_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1077206901u, 2272076931u, 0, LOG_TOLERANCE, 0}, +{ 414, 1075513130u, 2210969014u, 1081031001u, 1946786091u, 1073648058u, 4287756280u, 0, LOG_TOLERANCE, 0}, +{ 415, 1088823342u, 4059150589u, 3189759234u, 1177045799u, 1076195670u, 168819796u, 0, LOG_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1076566627u, 3519473592u, 0, LOG_TOLERANCE, 0}, +{ 417, 1066295469u, 1175750283u, 3235559706u, 1424491340u, 3222329337u, 1404700686u, 0, LOG_TOLERANCE, 0}, +{ 418, 1066420545u, 1630036121u, 3231972785u, 3195479448u, 3222311051u, 1432321875u, 0, LOG_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1076329192u, 2019252442u, 0, LOG_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1075876339u, 1110855580u, 0, LOG_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1076417100u, 1637354096u, 0, LOG_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 3222234337u, 3397134035u, 0, LOG_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1075571436u, 4071268588u, 0, LOG_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1074741421u, 4066881444u, 0, LOG_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 3224452759u, 1577079524u, 0, LOG_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1076142336u, 312904438u, 0, LOG_TOLERANCE, 0}, +{ 427, 1071694702u, 83062251u, 3211262173u, 2659016437u, 3219435632u, 2990582226u, 0, LOG_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1076788016u, 758411032u, 0, LOG_TOLERANCE, 0}, +{ 429, 1057711424u, 2382776852u, 3249232579u, 1546622468u, 3223566341u, 2208541704u, 0, LOG_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1075909687u, 2257964757u, 0, LOG_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 3224137825u, 3989600554u, 0, LOG_TOLERANCE, 0}, +{ 432, 1083714767u, 4039516226u, 3244344107u, 4272932619u, 1075667063u, 177846584u, 0, LOG_TOLERANCE, 0}, +{ 433, 1075224793u, 1683007544u, 1091105663u, 3805494321u, 1073461757u, 1964735653u, 0, LOG_TOLERANCE, 0}, +{ 434, 1073369300u, 2072627412u, 1094383324u, 3394151662u, 1071634515u, 3947641912u, 0, LOG_TOLERANCE, 0}, +{ 435, 1073086376u, 1120106427u, 3223631624u, 3404608264u, 1070882956u, 2186806101u, 0, LOG_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1076929260u, 181077198u, 0, LOG_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 3224619103u, 1411053414u, 0, LOG_TOLERANCE, 0}, +{ 438, 1107083611u, 3946837259u, 3234993796u, 3850406820u, 1077331030u, 1746464057u, 0, LOG_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 3223584445u, 303889266u, 0, LOG_TOLERANCE, 0}, +{ 440, 1089221852u, 1554593884u, 3228899878u, 2813752562u, 1076227495u, 3521483973u, 0, LOG_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 3223669255u, 1544957199u, 0, LOG_TOLERANCE, 0}, +{ 442, 1097380651u, 289355864u, 1078453818u, 2143066338u, 1076912232u, 2177531595u, 0, LOG_TOLERANCE, 0}, +{ 443, 1056456232u, 2157691971u, 1106629150u, 110806409u, 3223673218u, 2123023082u, 0, LOG_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1075383727u, 1957330776u, 0, LOG_TOLERANCE, 0}, +{ 445, 1053496534u, 558779875u, 3202046748u, 2338464653u, 3223931261u, 3653586452u, 0, LOG_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 3224488429u, 1308720282u, 0, LOG_TOLERANCE, 0}, +{ 447, 1090298613u, 3917440951u, 1051668894u, 3736066983u, 1076320331u, 1887921718u, 0, LOG_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 3222585948u, 408014405u, 0, LOG_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 3222429090u, 2085078273u, 0, LOG_TOLERANCE, 0}, +{ 450, 1091979581u, 3967957902u, 1057416138u, 3459188071u, 1076469173u, 1237933408u, 0, LOG_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 3221564708u, 13809233u, 0, LOG_TOLERANCE, 0}, +{ 452, 1081332748u, 3285165564u, 3211948811u, 401510871u, 1075251694u, 3343192796u, 0, LOG_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1076666184u, 2365285189u, 0, LOG_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1075671747u, 3755425130u, 0, LOG_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1074946192u, 1593874845u, 0, LOG_TOLERANCE, 0}, +{ 456, 1074379685u, 162122081u, 3239376395u, 108064594u, 1072869757u, 311403082u, 0, LOG_TOLERANCE, 0}, +{ 457, 1089788138u, 869031839u, 3225020876u, 1344301606u, 1076278721u, 2052619875u, 0, LOG_TOLERANCE, 0}, +{ 458, 1066949826u, 946696117u, 3231825228u, 1700703647u, 3222136911u, 3234660715u, 0, LOG_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1073635999u, 2354579684u, 0, LOG_TOLERANCE, 0}, +{ 460, 1061291147u, 2488789804u, 3238508333u, 1506943664u, 3223193085u, 2395026729u, 0, LOG_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1068911508u, 1747838674u, 0, LOG_TOLERANCE, 0}, +{ 462, 1072450894u, 1244307192u, 3191297711u, 2540916692u, 3216994329u, 4168950885u, 0, LOG_TOLERANCE, 0}, +{ 463, 1052579044u, 2871645739u, 3239081581u, 1440249115u, 3224012773u, 4034559683u, 0, LOG_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 3221668985u, 130084003u, 0, LOG_TOLERANCE, 0}, +{ 465, 1047966041u, 2386312545u, 1063169277u, 2715234268u, 3224389948u, 783950888u, 0, LOG_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1076107382u, 1970735447u, 0, LOG_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1077283811u, 3228434780u, 0, LOG_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 3224499119u, 1422614641u, 0, LOG_TOLERANCE, 0}, +{ 469, 1053685514u, 2911548084u, 1105282515u, 2476735795u, 3223917999u, 2323260261u, 0, LOG_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 3224195107u, 156157416u, 0, LOG_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 3220815003u, 2491682284u, 0, LOG_TOLERANCE, 0}, +{ 472, 1061070948u, 2981820811u, 1059838516u, 2845580478u, 3223235452u, 3382317431u, 0, LOG_TOLERANCE, 0}, +{ 473, 1046447766u, 1565550570u, 3217165795u, 4162017137u, 3224459254u, 3914539253u, 0, LOG_TOLERANCE, 0}, +{ 474, 1089767730u, 2808968027u, 1055630096u, 1782326814u, 1076276748u, 3860952757u, 0, LOG_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 3223925451u, 3928061943u, 0, LOG_TOLERANCE, 0}, +{ 476, 1074688031u, 2722693603u, 3227814791u, 3169731970u, 1073045831u, 1648821496u, 0, LOG_TOLERANCE, 0}, +{ 477, 1070422983u, 899763203u, 3207606001u, 2804747833u, 3220672293u, 2109485257u, 0, LOG_TOLERANCE, 0}, +{ 478, 1083186677u, 3789058912u, 3228095081u, 4135937628u, 1075560778u, 1017192561u, 0, LOG_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 3223353590u, 3898794040u, 0, LOG_TOLERANCE, 0}, +{ 480, 1094607838u, 2851963139u, 3246852961u, 2590862592u, 1076691530u, 843693284u, 0, LOG_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1075223537u, 2996632407u, 0, LOG_TOLERANCE, 0}, +{ 482, 1063187430u, 1082582386u, 1075605675u, 2602133689u, 3222869534u, 497064377u, 0, LOG_TOLERANCE, 0}, +{ 483, 1092334963u, 1789635787u, 1059414278u, 1048286093u, 1076497719u, 35468346u, 0, LOG_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1076953536u, 1119059296u, 0, LOG_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 3222866446u, 3672537745u, 0, LOG_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1077005985u, 1029802319u, 0, LOG_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1075950038u, 2713697878u, 0, LOG_TOLERANCE, 0}, +{ 488, 1083370902u, 1924429710u, 1056464743u, 3349283177u, 1075602923u, 210852422u, 0, LOG_TOLERANCE, 0}, +{ 489, 1097989743u, 42238036u, 1042379500u, 2113559863u, 1076936898u, 4273537346u, 0, LOG_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 3222584347u, 1589474103u, 0, LOG_TOLERANCE, 0}, +{ 491, 1065185882u, 1645486982u, 3224301095u, 3636267471u, 3222519201u, 137895691u, 0, LOG_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 3222931234u, 1968443211u, 0, LOG_TOLERANCE, 0}, +{ 493, 1090754746u, 110029735u, 1046937383u, 984375729u, 1076361464u, 987250933u, 0, LOG_TOLERANCE, 0}, +{ 494, 1042013090u, 4063688092u, 3203235744u, 1049950343u, 3224649065u, 604966936u, 0, LOG_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 3223008973u, 1813427148u, 0, LOG_TOLERANCE, 0}, +{ 496, 1079572157u, 66926332u, 1090561839u, 1379780888u, 1074948662u, 433676492u, 0, LOG_TOLERANCE, 0}, +{ 497, 1085969659u, 2803378256u, 1086057989u, 498534626u, 1075947164u, 835461350u, 0, LOG_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1075477355u, 2196414547u, 0, LOG_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 3224537713u, 3512318899u, 0, LOG_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 3224077928u, 494780876u, 0, LOG_TOLERANCE, 0}, +{ 501, 1083771349u, 243303420u, 1093735824u, 1575581926u, 1075676261u, 2797159781u, 0, LOG_TOLERANCE, 0}, +{ 502, 1091654349u, 3218865041u, 3204803496u, 3840388050u, 1076436155u, 4233818719u, 0, LOG_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 3224372644u, 1850665100u, 0, LOG_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 3223722992u, 1428253868u, 0, LOG_TOLERANCE, 0}, +{ 505, 1064421145u, 717293069u, 3211534283u, 582401011u, 3222651488u, 457041754u, 0, LOG_TOLERANCE, 0}, +{ 506, 1104478864u, 3766248610u, 3196520332u, 1174437546u, 1077219611u, 2272566305u, 0, LOG_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1075615370u, 3301009964u, 0, LOG_TOLERANCE, 0}, +{ 508, 1058322796u, 3560686300u, 3220980617u, 4277975772u, 3223512067u, 3447536936u, 0, LOG_TOLERANCE, 0}, +{ 509, 1062422428u, 2598148853u, 3217622194u, 3460421008u, 3222993634u, 3740783369u, 0, LOG_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 3222218081u, 3300781843u, 0, LOG_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1076881221u, 1639289155u, 0, LOG_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1076429657u, 658484818u, 0, LOG_TOLERANCE, 0}, +{ 513, 1043142370u, 3739770117u, 1059520750u, 3959551225u, 3224600804u, 1163315162u, 0, LOG_TOLERANCE, 0}, +{ 514, 1083246857u, 1498861716u, 1091297147u, 847410798u, 1075575303u, 3775039354u, 0, LOG_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1071811569u, 2728229451u, 0, LOG_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 3223819677u, 197121532u, 0, LOG_TOLERANCE, 0}, +{ 517, 1103874344u, 1546972125u, 3249076079u, 1987349196u, 1077192504u, 1510519247u, 0, LOG_TOLERANCE, 0}, +{ 518, 1090735865u, 2769161072u, 1075207126u, 292616282u, 1076359523u, 89361979u, 0, LOG_TOLERANCE, 0}, +{ 519, 1052228650u, 36855311u, 1052128202u, 1479039342u, 3224039401u, 3593532843u, 0, LOG_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1075673967u, 3693747671u, 0, LOG_TOLERANCE, 0}, +{ 521, 1050369101u, 3808681655u, 1054161346u, 1821773119u, 3224202474u, 692132331u, 0, LOG_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 3224705342u, 819266546u, 0, LOG_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 3224638837u, 2723875780u, 0, LOG_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 3224509740u, 972503631u, 0, LOG_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1076784880u, 2075690093u, 0, LOG_TOLERANCE, 0}, +{ 526, 1051865606u, 1019916843u, 3219974785u, 1977881787u, 3224074238u, 1888960312u, 0, LOG_TOLERANCE, 0}, +{ 527, 1051995104u, 2060433318u, 1075872515u, 366073725u, 3224060725u, 1765681116u, 0, LOG_TOLERANCE, 0}, +{ 528, 1043696909u, 1098469906u, 1082900695u, 2349346832u, 3224575035u, 3674662655u, 0, LOG_TOLERANCE, 0}, +{ 529, 1062491059u, 3011196295u, 3252479932u, 2459281672u, 3222979769u, 492196641u, 0, LOG_TOLERANCE, 0}, +{ 530, 1073850675u, 2843222682u, 1089275809u, 298982001u, 1072256860u, 1361015105u, 0, LOG_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1077100215u, 617711599u, 0, LOG_TOLERANCE, 0}, +{ 532, 1089280230u, 1274901962u, 3241535845u, 3759113509u, 1076231571u, 557911230u, 0, LOG_TOLERANCE, 0}, +{ 533, 1098432794u, 2134927252u, 3253802671u, 3013731444u, 1076957802u, 3748566065u, 0, LOG_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1076990811u, 285259783u, 0, LOG_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 3222899074u, 465863828u, 0, LOG_TOLERANCE, 0}, +{ 536, 1066289466u, 834976849u, 3217357661u, 2465861779u, 3222330128u, 4215014023u, 0, LOG_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 3224490919u, 160169310u, 0, LOG_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 3224191350u, 2572280436u, 0, LOG_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 3220964919u, 2207069711u, 0, LOG_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 3224478467u, 2261318089u, 0, LOG_TOLERANCE, 0}, +{ 541, 1086204043u, 2405805086u, 3251640319u, 324233833u, 1075963709u, 1682447551u, 0, LOG_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1077316076u, 3633878054u, 0, LOG_TOLERANCE, 0}, +{ 543, 1041631125u, 1922837702u, 3216892718u, 3535907549u, 3224664448u, 1875921049u, 0, LOG_TOLERANCE, 0}, +{ 544, 1096132220u, 261447440u, 3209805849u, 1150571079u, 1076828788u, 2089162237u, 0, LOG_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1076794453u, 1737884956u, 0, LOG_TOLERANCE, 0}, +{ 546, 1081640044u, 338765118u, 1086225786u, 3207238249u, 1075307339u, 978420089u, 0, LOG_TOLERANCE, 0}, +{ 547, 1048699055u, 1085283176u, 3187775111u, 1601194210u, 3224349104u, 167106457u, 0, LOG_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1076422740u, 744995018u, 0, LOG_TOLERANCE, 0}, +{ 549, 1071378583u, 3148395674u, 1041913758u, 3306391490u, 3219817927u, 894704365u, 0, LOG_TOLERANCE, 0}, +{ 550, 1053793422u, 2205233857u, 3208100078u, 3993195511u, 3223910988u, 856785751u, 0, LOG_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 3221882135u, 136784904u, 0, LOG_TOLERANCE, 0}, +{ 552, 1063349444u, 2920860798u, 3218070226u, 3104066154u, 3222838447u, 3579382968u, 0, LOG_TOLERANCE, 0}, +{ 553, 1057466703u, 969991373u, 3250596895u, 1734386152u, 3223585548u, 1096500115u, 0, LOG_TOLERANCE, 0}, +{ 554, 1091432170u, 1218740205u, 3239802737u, 2610078504u, 1076416988u, 1166408302u, 0, LOG_TOLERANCE, 0}, +{ 555, 1058547594u, 1485218325u, 3220870240u, 3591664613u, 3223491992u, 2889488052u, 0, LOG_TOLERANCE, 0}, +{ 556, 1054590495u, 690157417u, 3190850619u, 4192347699u, 3223837100u, 221540590u, 0, LOG_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1076821337u, 1851630736u, 0, LOG_TOLERANCE, 0}, +{ 558, 1087075589u, 961532417u, 1092588071u, 2923790239u, 1076042262u, 402021294u, 0, LOG_TOLERANCE, 0}, +{ 559, 1056395443u, 4174125604u, 1050682630u, 2169701868u, 3223678331u, 3987244812u, 0, LOG_TOLERANCE, 0}, +{ 560, 1095608827u, 4146748230u, 1087373950u, 2481478351u, 1076779212u, 2755104011u, 0, LOG_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1074194784u, 222203740u, 0, LOG_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1075733582u, 2307849831u, 0, LOG_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1077014572u, 4172289639u, 0, LOG_TOLERANCE, 0}, +{ 564, 1105714654u, 712227971u, 1106004723u, 973148499u, 1077273392u, 1598723415u, 0, LOG_TOLERANCE, 0}, +{ 565, 1082604551u, 3409813738u, 3244817008u, 1933503498u, 1075474955u, 4275872054u, 0, LOG_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1075002315u, 1460579331u, 0, LOG_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1074495740u, 3043398158u, 0, LOG_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 3220423008u, 1451854222u, 0, LOG_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1076830539u, 4025310681u, 0, LOG_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1074582949u, 3796387511u, 0, LOG_TOLERANCE, 0}, +{ 571, 1057086816u, 1776099219u, 1094316777u, 4188083896u, 3223622381u, 1340974487u, 0, LOG_TOLERANCE, 0}, +{ 572, 1046362060u, 2614400266u, 1073750227u, 3003203347u, 3224462031u, 2168733507u, 0, LOG_TOLERANCE, 0}, +{ 573, 1066499030u, 2959351406u, 1105603716u, 311851587u, 3222292450u, 2448510388u, 0, LOG_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1075809786u, 4009940215u, 0, LOG_TOLERANCE, 0}, +{ 575, 1084303018u, 447506102u, 3195759295u, 3603669725u, 1075758783u, 778755463u, 0, LOG_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1076931117u, 3632567756u, 0, LOG_TOLERANCE, 0}, +{ 577, 1049256177u, 784208771u, 1088764788u, 2182296421u, 3224298116u, 2494467149u, 0, LOG_TOLERANCE, 0}, +{ 578, 1100848643u, 1527590526u, 3206961556u, 2823164069u, 1077060409u, 1703424684u, 0, LOG_TOLERANCE, 0}, +{ 579, 1089160483u, 3876699591u, 3207481130u, 4028148535u, 1076223070u, 2488144317u, 0, LOG_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1075643067u, 4067087010u, 0, LOG_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1076452386u, 2402517231u, 0, LOG_TOLERANCE, 0}, +{ 582, 1079002460u, 3636214836u, 1068367620u, 2932621925u, 1074836452u, 1246949188u, 0, LOG_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 3224562471u, 3439797135u, 0, LOG_TOLERANCE, 0}, +{ 584, 1051338473u, 2648933384u, 1084603503u, 3534304873u, 3224117543u, 1738801372u, 0, LOG_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 3222621321u, 3716790217u, 0, LOG_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 3223233655u, 426639274u, 0, LOG_TOLERANCE, 0}, +{ 587, 1082371716u, 1908572179u, 1080112083u, 1228319033u, 1075431453u, 2787108747u, 0, LOG_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 3224381985u, 1230868351u, 0, LOG_TOLERANCE, 0}, +{ 589, 1073851962u, 4211343447u, 1087492676u, 4272583781u, 1072259191u, 2246212895u, 0, LOG_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1076999532u, 1195356221u, 0, LOG_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 3223545946u, 1433265295u, 0, LOG_TOLERANCE, 0}, +{ 592, 1067054971u, 3403659753u, 3218043030u, 1926480488u, 3222103473u, 3585903650u, 0, LOG_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1074134956u, 770846098u, 0, LOG_TOLERANCE, 0}, +{ 594, 1075179394u, 2183928090u, 1048403956u, 963834821u, 1073429155u, 1101532312u, 0, LOG_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1077097789u, 1094065157u, 0, LOG_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1076992206u, 4144042493u, 0, LOG_TOLERANCE, 0}, +{ 597, 1071510850u, 2509132460u, 1102827530u, 2205707903u, 3219671660u, 3639433009u, 0, LOG_TOLERANCE, 0}, +{ 598, 1057376949u, 1229308263u, 3209170414u, 4206576047u, 3223593363u, 900139131u, 0, LOG_TOLERANCE, 0}, +{ 599, 1076592641u, 4078010749u, 3199236456u, 733478972u, 1074067427u, 3307722640u, 0, LOG_TOLERANCE, 0}, +{ 600, 1050228936u, 4277541051u, 3199806921u, 397102023u, 3224213142u, 2343694908u, 0, LOG_TOLERANCE, 0}, +{ 601, 1048491365u, 900999594u, 3234720188u, 2530214248u, 3224369047u, 2922487944u, 0, LOG_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1074052948u, 253985069u, 0, LOG_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 3224352615u, 1700962361u, 0, LOG_TOLERANCE, 0}, +{ 604, 1075929840u, 2867079200u, 1101870326u, 921212001u, 1073827044u, 3912397586u, 0, LOG_TOLERANCE, 0}, +{ 605, 1085738242u, 674547716u, 1063216239u, 3929755226u, 1075928482u, 1096646355u, 0, LOG_TOLERANCE, 0}, +{ 606, 1092932203u, 3158182449u, 1043794244u, 3259056345u, 1076551118u, 1944847734u, 0, LOG_TOLERANCE, 0}, +{ 607, 1089293008u, 3002823940u, 1059511739u, 2832435794u, 1076232446u, 2248040348u, 0, LOG_TOLERANCE, 0}, +{ 608, 1069821174u, 2196511929u, 1049973941u, 3672092877u, 3221065621u, 1333818035u, 0, LOG_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 3224197528u, 856774981u, 0, LOG_TOLERANCE, 0}, +{ 610, 1095703300u, 1617573614u, 3201863123u, 3090723732u, 1076785432u, 919734899u, 0, LOG_TOLERANCE, 0}, +{ 611, 1085717732u, 679893506u, 3211547753u, 824081024u, 1075926690u, 2224601098u, 0, LOG_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1076251335u, 2335692597u, 0, LOG_TOLERANCE, 0}, +{ 613, 1059250016u, 1935990727u, 1088822246u, 1058156518u, 3223433483u, 3217816881u, 0, LOG_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1077147558u, 2892805731u, 0, LOG_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1077193106u, 297823039u, 0, LOG_TOLERANCE, 0}, +{ 616, 1105470167u, 1796441468u, 1100030327u, 2772711004u, 1077262253u, 1282095196u, 0, LOG_TOLERANCE, 0}, +{ 617, 1056793172u, 2095685003u, 1077984448u, 2100773742u, 3223648008u, 3902380592u, 0, LOG_TOLERANCE, 0}, +{ 618, 1045470972u, 2892538035u, 1042396334u, 4162200338u, 3224501206u, 3305443403u, 0, LOG_TOLERANCE, 0}, +{ 619, 1095242103u, 2177698116u, 3227557177u, 150832500u, 1076751813u, 652084626u, 0, LOG_TOLERANCE, 0}, +{ 620, 1044078568u, 607966734u, 3236250630u, 4164600559u, 3224559359u, 4052486987u, 0, LOG_TOLERANCE, 0}, +{ 621, 1068906164u, 2830122967u, 1046096700u, 3713346883u, 3221458501u, 2135199639u, 0, LOG_TOLERANCE, 0}, +{ 622, 1089714315u, 2314640506u, 3203696416u, 3276228872u, 1076271440u, 3165050519u, 0, LOG_TOLERANCE, 0}, +{ 623, 1065428659u, 469331883u, 3249037349u, 2999233437u, 3222479189u, 1973618642u, 0, LOG_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1076912287u, 2351244050u, 0, LOG_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 3224243534u, 1631239268u, 0, LOG_TOLERANCE, 0}, +{ 626, 1045542849u, 3221475559u, 1043038304u, 915608434u, 3224497019u, 12328601u, 0, LOG_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 3220036272u, 3512463986u, 0, LOG_TOLERANCE, 0}, +{ 628, 1094545351u, 1767658578u, 3237045269u, 2313128318u, 1076687351u, 4133464776u, 0, LOG_TOLERANCE, 0}, +{ 629, 1063134244u, 1926845182u, 1066835624u, 1783256828u, 3222876498u, 4254270569u, 0, LOG_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 3224710189u, 1836351366u, 0, LOG_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1077322719u, 3956409329u, 0, LOG_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1074778233u, 4182823459u, 0, LOG_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 3224128149u, 214647840u, 0, LOG_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 3224140507u, 2241216118u, 0, LOG_TOLERANCE, 0}, +{ 635, 1059260269u, 2797651324u, 3224410527u, 2374818327u, 3223432401u, 2818559991u, 0, LOG_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1076144486u, 410596024u, 0, LOG_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 3222382935u, 3289438458u, 0, LOG_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 3221003238u, 2295141582u, 0, LOG_TOLERANCE, 0}, +{ 639, 1097405019u, 2928437580u, 3187765027u, 1393427873u, 1076913211u, 3191623646u, 0, LOG_TOLERANCE, 0}, +{ 640, 1061817913u, 189447067u, 1051643315u, 828663513u, 3223096387u, 2558305145u, 0, LOG_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 3224032410u, 3091433288u, 0, LOG_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 3224564379u, 145610791u, 0, LOG_TOLERANCE, 0}, +{ 643, 1043127178u, 1766416701u, 1100392103u, 2185373290u, 3224601328u, 2709694091u, 0, LOG_TOLERANCE, 0}, +{ 644, 1072791741u, 3763582673u, 3191965790u, 388374829u, 1068956587u, 4000095759u, 0, LOG_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1074958563u, 4287311234u, 0, LOG_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1077194346u, 1449151468u, 0, LOG_TOLERANCE, 0}, +{ 647, 1063308449u, 1863545307u, 1069449477u, 3418627399u, 3222848031u, 2779607712u, 0, LOG_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 3221240901u, 2594350627u, 0, LOG_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 3223462494u, 904067198u, 0, LOG_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 3224469193u, 4212288781u, 0, LOG_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 3224632405u, 4286106996u, 0, LOG_TOLERANCE, 0}, +{ 652, 1053765877u, 2003816032u, 1086050104u, 668090487u, 3223912742u, 2616410283u, 0, LOG_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 3224014365u, 3396241137u, 0, LOG_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 3222007425u, 4243502376u, 0, LOG_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 3222693263u, 1936878201u, 0, LOG_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 3224047022u, 3920752385u, 0, LOG_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1075916091u, 3265610257u, 0, LOG_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 3224290023u, 2656300300u, 0, LOG_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 3221278498u, 706663362u, 0, LOG_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 3222055058u, 672407782u, 0, LOG_TOLERANCE, 0}, +{ 661, 1103422358u, 786180031u, 3197734769u, 2788918312u, 1077173806u, 3746531445u, 0, LOG_TOLERANCE, 0}, +{ 662, 1087028179u, 2055912467u, 3244244909u, 1394142937u, 1076038762u, 1795047243u, 0, LOG_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 3221235370u, 3814066775u, 0, LOG_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1075253181u, 2506903412u, 0, LOG_TOLERANCE, 0}, +{ 665, 1051074198u, 86296211u, 1085850694u, 649202596u, 3224139493u, 2880611269u, 0, LOG_TOLERANCE, 0}, +{ 666, 1097882744u, 3069064472u, 3237358008u, 23209276u, 1076930665u, 1450427370u, 0, LOG_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1075231257u, 2535725157u, 0, LOG_TOLERANCE, 0}, +{ 668, 1103049699u, 3171788768u, 3235208783u, 162138697u, 1077154679u, 624087679u, 0, LOG_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1075321380u, 2914390661u, 0, LOG_TOLERANCE, 0}, +{ 670, 1098026472u, 3347226587u, 1058962932u, 2291943376u, 1076938909u, 376541139u, 0, LOG_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 3223465711u, 660497085u, 0, LOG_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1068986073u, 992013529u, 0, LOG_TOLERANCE, 0}, +{ 673, 1100632849u, 1671039260u, 1086395032u, 3745833360u, 1077052685u, 2200577415u, 0, LOG_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 3223623282u, 754729227u, 0, LOG_TOLERANCE, 0}, +{ 675, 1059632083u, 1423000172u, 3247822717u, 1551488170u, 3223398200u, 442592399u, 0, LOG_TOLERANCE, 0}, +{ 676, 1054113659u, 921077236u, 3213332351u, 1431049019u, 3223876915u, 4055130359u, 0, LOG_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 3221964801u, 460556857u, 0, LOG_TOLERANCE, 0}, +{ 678, 1080171331u, 4110878657u, 3251297180u, 879739345u, 1075046177u, 1152302381u, 0, LOG_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1075934130u, 1839592766u, 0, LOG_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1076462360u, 989447787u, 0, LOG_TOLERANCE, 0}, +{ 681, 1085961592u, 1761361082u, 3226030205u, 1121849716u, 1075946555u, 3494606763u, 0, LOG_TOLERANCE, 0}, +{ 682, 1092603467u, 2534144722u, 1044223733u, 3512285706u, 1076515793u, 3692269602u, 0, LOG_TOLERANCE, 0}, +{ 683, 1064362429u, 4073670723u, 1050729852u, 3034818849u, 3222665043u, 2495345955u, 0, LOG_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1077108720u, 2189969898u, 0, LOG_TOLERANCE, 0}, +{ 685, 1069938181u, 1649206019u, 1104525577u, 1267104290u, 3220976709u, 450530095u, 0, LOG_TOLERANCE, 0}, +{ 686, 1041818449u, 3775270392u, 1040251850u, 68667319u, 3224656453u, 1211401134u, 0, LOG_TOLERANCE, 0}, +{ 687, 1056847252u, 3099226694u, 3254103006u, 4020102648u, 3223644378u, 3130345782u, 0, LOG_TOLERANCE, 0}, +{ 688, 1054108064u, 3718441177u, 3215643451u, 4032951536u, 3223877462u, 3985566266u, 0, LOG_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 3224557458u, 3794348307u, 0, LOG_TOLERANCE, 0}, +{ 690, 1051127979u, 2784738160u, 1073435430u, 1109346010u, 3224134718u, 3763898383u, 0, LOG_TOLERANCE, 0}, +{ 691, 1078241642u, 3331916473u, 3238794568u, 2707019594u, 1074644350u, 3000068445u, 0, LOG_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1076573206u, 1052317797u, 0, LOG_TOLERANCE, 0}, +{ 693, 1069098491u, 2135797997u, 1048399559u, 2941926126u, 3221393445u, 3011165202u, 0, LOG_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 3224372120u, 1391497455u, 0, LOG_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1073555677u, 2172392844u, 0, LOG_TOLERANCE, 0}, +{ 696, 1100449215u, 3692175292u, 3197271515u, 3989064196u, 1077045309u, 3615376251u, 0, LOG_TOLERANCE, 0}, +{ 697, 1104208090u, 3111924274u, 1066772558u, 59281695u, 1077205261u, 865144419u, 0, LOG_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 3221888515u, 519778435u, 0, LOG_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1076717393u, 83189865u, 0, LOG_TOLERANCE, 0}, +{ 700, 1055482282u, 330951080u, 1079189813u, 583922384u, 3223758054u, 1639805153u, 0, LOG_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1076263688u, 2474566662u, 0, LOG_TOLERANCE, 0}, +{ 702, 1086945901u, 2072550721u, 3250147641u, 4280263530u, 1076032457u, 3503982552u, 0, LOG_TOLERANCE, 0}, +{ 703, 1045489058u, 1566376352u, 1067251433u, 72984588u, 3224500127u, 2508162584u, 0, LOG_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1076754646u, 1510773583u, 0, LOG_TOLERANCE, 0}, +{ 705, 1069188845u, 1910366299u, 1081770885u, 634683073u, 3221365463u, 978597306u, 0, LOG_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1075288861u, 2856541718u, 0, LOG_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1071064776u, 471056163u, 0, LOG_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 3222296157u, 654778802u, 0, LOG_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 3222357599u, 1919559441u, 0, LOG_TOLERANCE, 0}, +{ 710, 1085665139u, 51750045u, 3242913901u, 4256866157u, 1075921980u, 3722237157u, 0, LOG_TOLERANCE, 0}, +{ 711, 1047601319u, 2163853087u, 3232053146u, 2962422808u, 3224408387u, 1081948641u, 0, LOG_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1073650314u, 3812165070u, 0, LOG_TOLERANCE, 0}, +{ 713, 1099384354u, 357108214u, 3202294604u, 2306775262u, 1076999187u, 3070689462u, 0, LOG_TOLERANCE, 0}, +{ 714, 1054420438u, 2571356437u, 3249064063u, 2394851808u, 3223849956u, 882036239u, 0, LOG_TOLERANCE, 0}, +{ 715, 1083004443u, 4273880094u, 1103698617u, 3578832032u, 1075536085u, 1389153068u, 0, LOG_TOLERANCE, 0}, +{ 716, 1085943053u, 2091068742u, 3228270226u, 3980489730u, 1075945146u, 3992739543u, 0, LOG_TOLERANCE, 0}, +{ 717, 1081533104u, 2772307714u, 1051008486u, 32546576u, 1075289284u, 1304738751u, 0, LOG_TOLERANCE, 0}, +{ 718, 1093745567u, 2143788498u, 3195498043u, 3630119231u, 1076617173u, 1940068716u, 0, LOG_TOLERANCE, 0}, +{ 719, 1051149287u, 2527385594u, 3240503648u, 3482095012u, 3224132874u, 932358108u, 0, LOG_TOLERANCE, 0}, +{ 720, 1094685151u, 2690097362u, 1068598730u, 2360266862u, 1076696521u, 4114952864u, 0, LOG_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 3223468532u, 1585235010u, 0, LOG_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1077216954u, 167880927u, 0, LOG_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1077001521u, 3528290140u, 0, LOG_TOLERANCE, 0}, +{ 724, 1073313068u, 31662602u, 1047721249u, 1747087514u, 1071495479u, 361856717u, 0, LOG_TOLERANCE, 0}, +{ 725, 1102980109u, 2489659568u, 1097051253u, 277506957u, 1077152410u, 220731815u, 0, LOG_TOLERANCE, 0}, +{ 726, 1043918186u, 3850162281u, 3213841942u, 438724093u, 3224565497u, 1335181127u, 0, LOG_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1076763752u, 3902665789u, 0, LOG_TOLERANCE, 0}, +{ 728, 1095679087u, 391606792u, 1048184750u, 4168944276u, 1076783866u, 201632535u, 0, LOG_TOLERANCE, 0}, +{ 729, 1100308768u, 457529672u, 3201090276u, 72407935u, 1077039049u, 1370091833u, 0, LOG_TOLERANCE, 0}, +{ 730, 1071237071u, 3954981400u, 1052053242u, 2411049585u, 3219986608u, 4011189326u, 0, LOG_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1075962111u, 1049136648u, 0, LOG_TOLERANCE, 0}, +{ 732, 1050750780u, 1551748070u, 3236871640u, 1329701152u, 3224172582u, 3333561594u, 0, LOG_TOLERANCE, 0}, +{ 733, 1077155474u, 3099222537u, 1104984570u, 4293792842u, 1074266180u, 3823978682u, 0, LOG_TOLERANCE, 0}, +{ 734, 1056466057u, 3603065260u, 3197735968u, 2402359253u, 3223672410u, 1773379774u, 0, LOG_TOLERANCE, 0}, +{ 735, 1051340936u, 3961208159u, 3219057584u, 2340553876u, 3224117355u, 671685669u, 0, LOG_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1073186041u, 4149752821u, 0, LOG_TOLERANCE, 0}, +{ 737, 1065792009u, 1403876392u, 3254028950u, 921363393u, 3222405763u, 1643497528u, 0, LOG_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1077336633u, 466978083u, 0, LOG_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 3224268227u, 2694325211u, 0, LOG_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1072886487u, 3569287692u, 0, LOG_TOLERANCE, 0}, +{ 741, 1068925634u, 1199568671u, 3225679997u, 46947405u, 3221451536u, 928442461u, 0, LOG_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1074443573u, 2231242182u, 0, LOG_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 3222286120u, 1979658371u, 0, LOG_TOLERANCE, 0}, +{ 744, 1092425015u, 3347296825u, 1101507910u, 1254014794u, 1076504062u, 3829864000u, 0, LOG_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1075726765u, 3754705647u, 0, LOG_TOLERANCE, 0}, +{ 746, 1055716202u, 1832066983u, 1051358028u, 3262483417u, 3223740808u, 426169343u, 0, LOG_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1074406538u, 4237515409u, 0, LOG_TOLERANCE, 0}, +{ 748, 1087990252u, 2497516122u, 3254374111u, 2821429629u, 1076122977u, 4015412349u, 0, LOG_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1073951923u, 1273545107u, 0, LOG_TOLERANCE, 0}, +{ 750, 1079425038u, 723423605u, 1084533420u, 627282213u, 1074923960u, 3923850419u, 0, LOG_TOLERANCE, 0}, +{ 751, 1068464032u, 4292778869u, 1078101071u, 1676860147u, 3221639332u, 890635976u, 0, LOG_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1073970522u, 2685750176u, 0, LOG_TOLERANCE, 0}, +{ 753, 1045414231u, 1307010018u, 1061248120u, 1468743108u, 3224504205u, 2718243292u, 0, LOG_TOLERANCE, 0}, +{ 754, 1099099491u, 107905661u, 3226089788u, 1943427674u, 1076985639u, 1932047369u, 0, LOG_TOLERANCE, 0}, +{ 755, 1040746893u, 760006940u, 1054265604u, 1749976597u, 3224702809u, 1323817312u, 0, LOG_TOLERANCE, 0}, +{ 756, 1090289736u, 2787503556u, 1081282610u, 1195841206u, 1076319709u, 4181618500u, 0, LOG_TOLERANCE, 0}, +{ 757, 1044318508u, 545462045u, 3208381743u, 1981311808u, 3224551133u, 2183045557u, 0, LOG_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 3223206524u, 3484237357u, 0, LOG_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 3224243834u, 3517531742u, 0, LOG_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1074139158u, 833486214u, 0, LOG_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 3223758873u, 3473614230u, 0, LOG_TOLERANCE, 0}, +{ 762, 1060018678u, 3007589929u, 3202026547u, 2792028313u, 3223370131u, 3372574984u, 0, LOG_TOLERANCE, 0}, +{ 763, 1105599122u, 1866066996u, 1060329048u, 3727175322u, 1077268363u, 2407515951u, 0, LOG_TOLERANCE, 0}, +{ 764, 1050932995u, 150890940u, 1056025306u, 3082724735u, 3224152926u, 1543567732u, 0, LOG_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 3223068589u, 334202438u, 0, LOG_TOLERANCE, 0}, +{ 766, 1104156966u, 4050954182u, 3219263194u, 2537475930u, 1077202160u, 52121861u, 0, LOG_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 3222570668u, 1289897413u, 0, LOG_TOLERANCE, 0}, +{ 768, 1101532656u, 440309030u, 3214267461u, 3788040806u, 1077092201u, 2541610027u, 0, LOG_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1077046464u, 1838368906u, 0, LOG_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 3224644746u, 2204082529u, 0, LOG_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 3224430281u, 2605152109u, 0, LOG_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 3223561330u, 8173155u, 0, LOG_TOLERANCE, 0}, +{ 773, 1055246165u, 2684353926u, 3205212854u, 1732474928u, 3223778120u, 1100684416u, 0, LOG_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1076751385u, 2203378921u, 0, LOG_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 3222863964u, 3924505576u, 0, LOG_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 3222567109u, 1263879149u, 0, LOG_TOLERANCE, 0}, +{ 777, 1057063924u, 841366493u, 1051716814u, 4121125128u, 3223624969u, 2299430516u, 0, LOG_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 3222607866u, 627293357u, 0, LOG_TOLERANCE, 0}, +{ 779, 1098059015u, 799866606u, 3197637091u, 3924438208u, 1076940639u, 3980982339u, 0, LOG_TOLERANCE, 0}, +{ 780, 1043579242u, 2002049816u, 1077053447u, 2240354761u, 3224580736u, 3000679411u, 0, LOG_TOLERANCE, 0}, +{ 781, 1081522635u, 478939968u, 1097035749u, 1066716440u, 1075287447u, 4249888900u, 0, LOG_TOLERANCE, 0}, +{ 782, 1084989993u, 1653104725u, 1088548129u, 81977716u, 1075861396u, 3386829085u, 0, LOG_TOLERANCE, 0}, +{ 783, 1049377628u, 3899475018u, 3189694084u, 3330093036u, 3224289217u, 1387095058u, 0, LOG_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1076233776u, 1203102347u, 0, LOG_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1077052835u, 465092515u, 0, LOG_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 3223822432u, 2295334392u, 0, LOG_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1074786149u, 2318575113u, 0, LOG_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1075302954u, 181613322u, 0, LOG_TOLERANCE, 0}, +{ 789, 1046346124u, 41779312u, 1081626342u, 831171823u, 3224462561u, 114420931u, 0, LOG_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 3223532010u, 2221031919u, 0, LOG_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 3217538846u, 3153950627u, 0, LOG_TOLERANCE, 0}, +{ 792, 1106952026u, 1894912556u, 1042426694u, 155024547u, 1077326286u, 3244175068u, 0, LOG_TOLERANCE, 0}, +{ 793, 1047969864u, 35164295u, 3203391785u, 1037041084u, 3224389779u, 4101769333u, 0, LOG_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1075845035u, 4253257181u, 0, LOG_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 3221481260u, 739417708u, 0, LOG_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 3224465760u, 2990774932u, 0, LOG_TOLERANCE, 0}, +{ 797, 1080040567u, 395145384u, 3219821938u, 50586510u, 1075015570u, 401425942u, 0, LOG_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 3221102144u, 3089938357u, 0, LOG_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1076008674u, 1350249998u, 0, LOG_TOLERANCE, 0}, +{ 800, 1070606742u, 344241827u, 1071538935u, 2715566077u, 3220571362u, 2564406257u, 0, LOG_TOLERANCE, 0}, +{ 801, 1100099208u, 4069301823u, 3193208760u, 2949125229u, 1077028431u, 4184156688u, 0, LOG_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1077163960u, 3362941620u, 0, LOG_TOLERANCE, 0}, +{ 803, 1046635308u, 709803845u, 1048741487u, 2296910194u, 3224449161u, 3527999523u, 0, LOG_TOLERANCE, 0}, +{ 804, 1045797131u, 744421179u, 1069302001u, 2659232829u, 3224484041u, 1605643857u, 0, LOG_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1076541532u, 2940590139u, 0, LOG_TOLERANCE, 0}, +{ 806, 1058624854u, 145234164u, 3250614064u, 912384201u, 3223485746u, 3198580186u, 0, LOG_TOLERANCE, 0}, +{ 807, 1093027016u, 2784620507u, 1102812948u, 3531481022u, 1076559923u, 64675630u, 0, LOG_TOLERANCE, 0}, +{ 808, 1103676015u, 383952592u, 3205659905u, 3633194728u, 1077184947u, 422506066u, 0, LOG_TOLERANCE, 0}, +{ 809, 1055992604u, 3792395543u, 1070072378u, 3864816376u, 3223718444u, 3170253965u, 0, LOG_TOLERANCE, 0}, +{ 810, 1057832625u, 2115553675u, 1066288499u, 3538377867u, 3223557779u, 620943456u, 0, LOG_TOLERANCE, 0}, +{ 811, 1104591537u, 1230026762u, 1090719723u, 440819880u, 1077224766u, 793358222u, 0, LOG_TOLERANCE, 0}, +{ 812, 1047111428u, 2991290482u, 1096886719u, 1097971167u, 3224427340u, 586302082u, 0, LOG_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1076301592u, 1583059249u, 0, LOG_TOLERANCE, 0}, +{ 814, 1103573316u, 1719428427u, 3188631907u, 3707377409u, 1077180662u, 744410774u, 0, LOG_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 3223952056u, 54146495u, 0, LOG_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1075838772u, 4208492007u, 0, LOG_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 3223963742u, 1191827742u, 0, LOG_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 3219749836u, 3169186900u, 0, LOG_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1073347289u, 2458807329u, 0, LOG_TOLERANCE, 0}, +{ 820, 1052824608u, 3315127889u, 3236295594u, 2900924954u, 3223993621u, 1689734749u, 0, LOG_TOLERANCE, 0}, +{ 821, 1048942243u, 2246037502u, 1049691002u, 1496066550u, 3224324383u, 896522170u, 0, LOG_TOLERANCE, 0}, +{ 822, 1045523211u, 4191285446u, 3217936236u, 2382392789u, 3224498136u, 3635803563u, 0, LOG_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1076541257u, 2073083715u, 0, LOG_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1074998329u, 1785611289u, 0, LOG_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1076878612u, 3418590u, 0, LOG_TOLERANCE, 0}, +{ 826, 1044065902u, 3797143370u, 3195497539u, 3843275034u, 3224559824u, 1066708699u, 0, LOG_TOLERANCE, 0}, +{ 827, 1104593745u, 2806642640u, 3201943068u, 2515980718u, 1077224863u, 1169910650u, 0, LOG_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1076026960u, 1211939235u, 0, LOG_TOLERANCE, 0}, +{ 829, 1053496927u, 3309678799u, 1049337078u, 3056787074u, 3223931232u, 3362832351u, 0, LOG_TOLERANCE, 0}, +{ 830, 1074011641u, 2341164249u, 1080834967u, 2810890005u, 1072529938u, 3492796186u, 0, LOG_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 3222114462u, 3894149768u, 0, LOG_TOLERANCE, 0}, +{ 832, 1101746443u, 1367996113u, 3251723684u, 2974064663u, 1077100536u, 289595985u, 0, LOG_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1075058981u, 2425521271u, 0, LOG_TOLERANCE, 0}, +{ 834, 1088295228u, 4184941840u, 3196770014u, 2458988443u, 1076145017u, 2080164599u, 0, LOG_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1076089849u, 4264391451u, 0, LOG_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 3222709551u, 2162071350u, 0, LOG_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1076129783u, 831887257u, 0, LOG_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 3223991361u, 4161570046u, 0, LOG_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 3223875523u, 2194127603u, 0, LOG_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 3222702940u, 454708982u, 0, LOG_TOLERANCE, 0}, +{ 841, 1103793023u, 752664055u, 1065110394u, 1835931663u, 1077189510u, 1147034722u, 0, LOG_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1076127223u, 3818699807u, 0, LOG_TOLERANCE, 0}, +{ 843, 1050651439u, 1636966254u, 1086098766u, 2016598298u, 3224183308u, 192307776u, 0, LOG_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 3224153094u, 1643417671u, 0, LOG_TOLERANCE, 0}, +{ 845, 1082348569u, 2977627788u, 1045339018u, 516058480u, 1075426706u, 3059244798u, 0, LOG_TOLERANCE, 0}, +{ 846, 1089924930u, 3901731263u, 3189566462u, 32272932u, 1076291228u, 2566529534u, 0, LOG_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1074314218u, 1358305666u, 0, LOG_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1077015587u, 909699399u, 0, LOG_TOLERANCE, 0}, +{ 849, 1103446273u, 692989850u, 3242630588u, 2492225971u, 1077174941u, 3636625117u, 0, LOG_TOLERANCE, 0}, +{ 850, 1057995749u, 3439913962u, 1067477011u, 2973333638u, 3223547072u, 3493673504u, 0, LOG_TOLERANCE, 0}, +{ 851, 1066510341u, 877613377u, 1044917899u, 809672798u, 3222289875u, 2551263584u, 0, LOG_TOLERANCE, 0}, +{ 852, 1074687806u, 905426932u, 1046417457u, 1086320855u, 1073045712u, 3786045969u, 0, LOG_TOLERANCE, 0}, +{ 853, 1098862981u, 2645567288u, 1051258339u, 557182478u, 1076973217u, 1877277898u, 0, LOG_TOLERANCE, 0}, +{ 854, 1056574302u, 186287752u, 1061342054u, 4054003419u, 3223663822u, 3680860005u, 0, LOG_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1076907447u, 2195222634u, 0, LOG_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 3224620197u, 242852427u, 0, LOG_TOLERANCE, 0}, +{ 857, 1096164025u, 368493885u, 3222871893u, 1419055230u, 1076831694u, 449968426u, 0, LOG_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1076466543u, 3088120894u, 0, LOG_TOLERANCE, 0}, +{ 859, 1057942861u, 1239207795u, 1040192984u, 2199481342u, 3223550449u, 736007617u, 0, LOG_TOLERANCE, 0}, +{ 860, 1063494989u, 4264613432u, 3203460972u, 3558930895u, 3222807000u, 3647579418u, 0, LOG_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 3224207679u, 3122404269u, 0, LOG_TOLERANCE, 0}, +{ 862, 1083259393u, 1077949160u, 1075769893u, 2405271377u, 1075578230u, 4243093929u, 0, LOG_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1076455525u, 1816836840u, 0, LOG_TOLERANCE, 0}, +{ 864, 1051133505u, 1518334131u, 3205247482u, 791756713u, 3224134238u, 39391912u, 0, LOG_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 3224419764u, 57817157u, 0, LOG_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1077023709u, 1264961045u, 0, LOG_TOLERANCE, 0}, +{ 867, 1068907602u, 247369460u, 3197320093u, 687450958u, 3221457984u, 388074873u, 0, LOG_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1077202436u, 903459361u, 0, LOG_TOLERANCE, 0}, +{ 869, 1060614787u, 1845900544u, 3231520830u, 3389751458u, 3223302961u, 1582822839u, 0, LOG_TOLERANCE, 0}, +{ 870, 1100051597u, 737689911u, 3195377751u, 3462616966u, 1077025759u, 2432802595u, 0, LOG_TOLERANCE, 0}, +{ 871, 1076054736u, 3620285831u, 1055501023u, 2708056059u, 1073881576u, 1018222756u, 0, LOG_TOLERANCE, 0}, +{ 872, 1071981348u, 4073430285u, 1056206159u, 172017902u, 3218770535u, 1223482098u, 0, LOG_TOLERANCE, 0}, +{ 873, 1065385990u, 2799176222u, 1052706894u, 4083892667u, 3222489334u, 1732069215u, 0, LOG_TOLERANCE, 0}, +{ 874, 1054795909u, 1562351330u, 1069705601u, 1247765260u, 3223823084u, 3892941165u, 0, LOG_TOLERANCE, 0}, +{ 875, 1085233651u, 51853475u, 3189080201u, 2783553144u, 1075877942u, 597698047u, 0, LOG_TOLERANCE, 0}, +{ 876, 1071970705u, 3851781549u, 3241598113u, 514064046u, 3218802885u, 83380447u, 0, LOG_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1077025436u, 511499556u, 0, LOG_TOLERANCE, 0}, +{ 878, 1065598845u, 2948648757u, 3232177250u, 4278702895u, 3222442230u, 3112138043u, 0, LOG_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 3216682197u, 1239324620u, 0, LOG_TOLERANCE, 0}, +{ 880, 1050591911u, 3891230598u, 1095924595u, 3049217547u, 3224187122u, 1722764368u, 0, LOG_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1074339492u, 2305804754u, 0, LOG_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 3223301321u, 3655805288u, 0, LOG_TOLERANCE, 0}, +{ 883, 1080223688u, 2126253040u, 3207248026u, 808507485u, 1075057495u, 3077099285u, 0, LOG_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1075955941u, 3478718566u, 0, LOG_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1077148337u, 392520667u, 0, LOG_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 3222548727u, 593733443u, 0, LOG_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1072840891u, 1190118690u, 0, LOG_TOLERANCE, 0}, +{ 888, 1065945517u, 3744663425u, 3212482771u, 953662066u, 3222380014u, 4188749851u, 0, LOG_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1075873903u, 1537471083u, 0, LOG_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 3224375491u, 608683477u, 0, LOG_TOLERANCE, 0}, +{ 891, 1096464829u, 606044282u, 3241318094u, 2446416887u, 1076856392u, 525104051u, 0, LOG_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 3224664623u, 89627721u, 0, LOG_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 3223490341u, 3151493257u, 0, LOG_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 3224543992u, 819274532u, 0, LOG_TOLERANCE, 0}, +{ 895, 1042020446u, 4099522736u, 3232742168u, 3718083858u, 3224648801u, 2651059661u, 0, LOG_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1076500314u, 769778733u, 0, LOG_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1077246890u, 412568919u, 0, LOG_TOLERANCE, 0}, +{ 898, 1091529166u, 2462163405u, 3218946201u, 3876535372u, 1076423313u, 4205043249u, 0, LOG_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1075778946u, 2812768446u, 0, LOG_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 3224024546u, 383002261u, 0, LOG_TOLERANCE, 0}, +{ 901, 1045799308u, 2533012202u, 1079980803u, 3592268374u, 3224483940u, 2726652976u, 0, LOG_TOLERANCE, 0}, +{ 902, 1055881132u, 4108274117u, 1063045844u, 571992389u, 3223729882u, 2314481097u, 0, LOG_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1076340781u, 2632740799u, 0, LOG_TOLERANCE, 0}, +{ 904, 1046496395u, 1213941007u, 1105433735u, 2172963370u, 3224457188u, 3052458673u, 0, LOG_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1076885251u, 2478993271u, 0, LOG_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1076777521u, 3199401103u, 0, LOG_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1075673974u, 2005503768u, 0, LOG_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1076641579u, 3598085678u, 0, LOG_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1074087845u, 1781834194u, 0, LOG_TOLERANCE, 0}, +{ 910, 1104810967u, 2983070435u, 1089546472u, 2907918480u, 1077233772u, 563486515u, 0, LOG_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1075533850u, 821769330u, 0, LOG_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 3224689437u, 2823928781u, 0, LOG_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 3224420112u, 3184365003u, 0, LOG_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1075033268u, 2149302111u, 0, LOG_TOLERANCE, 0}, +{ 915, 1078806678u, 176522478u, 1069999908u, 2891249491u, 1074808795u, 1563703192u, 0, LOG_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 3224581481u, 4116919064u, 0, LOG_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 3224727383u, 3362925734u, 0, LOG_TOLERANCE, 0}, +{ 918, 1044013141u, 3819109588u, 1048561488u, 969143351u, 3224561794u, 2773963981u, 0, LOG_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 3214582574u, 1851284834u, 0, LOG_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 3224386831u, 3580440236u, 0, LOG_TOLERANCE, 0}, +{ 921, 1083983658u, 4189906558u, 3203004203u, 854242364u, 1075708157u, 2324538567u, 0, LOG_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1077193789u, 2501009459u, 0, LOG_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 3224480154u, 4264010772u, 0, LOG_TOLERANCE, 0}, +{ 924, 1074889038u, 1794845306u, 1104879344u, 4135865182u, 1073192577u, 3710212999u, 0, LOG_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1077304123u, 3433234321u, 0, LOG_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1071882849u, 1312596997u, 0, LOG_TOLERANCE, 0}, +{ 927, 1083965546u, 567588900u, 3195452230u, 1421366017u, 1075705582u, 3553729720u, 0, LOG_TOLERANCE, 0}, +{ 928, 1077606107u, 2708717091u, 1071975971u, 1364590470u, 1074420521u, 3509197008u, 0, LOG_TOLERANCE, 0}, +{ 929, 1104653635u, 3461956134u, 3207820115u, 1605709634u, 1077227442u, 3720226522u, 0, LOG_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 3222503756u, 1982876219u, 0, LOG_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 3223498722u, 3952086370u, 0, LOG_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 3223602368u, 1320433153u, 0, LOG_TOLERANCE, 0}, +{ 933, 1042153283u, 851569132u, 1058503154u, 1399378677u, 3224644216u, 2599935008u, 0, LOG_TOLERANCE, 0}, +{ 934, 1086054049u, 3897202342u, 3245382590u, 246600375u, 1075953364u, 2720951838u, 0, LOG_TOLERANCE, 0}, +{ 935, 1077976660u, 3620429520u, 1055627557u, 229305u, 1074530176u, 1186149429u, 0, LOG_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1075704622u, 976119397u, 0, LOG_TOLERANCE, 0}, +{ 937, 1080324787u, 32766320u, 1062084905u, 3668443038u, 1075078058u, 656045965u, 0, LOG_TOLERANCE, 0}, +{ 938, 1075815348u, 2039713492u, 3248699388u, 1346210821u, 1073777533u, 3602564129u, 0, LOG_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1076561972u, 2395175349u, 0, LOG_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 3223161418u, 2163727770u, 0, LOG_TOLERANCE, 0}, +{ 941, 1043911539u, 2372623300u, 3210185343u, 3200572848u, 3224565764u, 2245925970u, 0, LOG_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1077058609u, 3401569473u, 0, LOG_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 3223029063u, 2646417681u, 0, LOG_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 3223613118u, 876167905u, 0, LOG_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1076407987u, 4222096695u, 0, LOG_TOLERANCE, 0}, +{ 946, 1098953963u, 142942404u, 1075322987u, 1746449109u, 1076977460u, 3968533829u, 0, LOG_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1077197089u, 321049357u, 0, LOG_TOLERANCE, 0}, +{ 948, 1102741893u, 2999955409u, 3222793392u, 1868977643u, 1077143987u, 3900599294u, 0, LOG_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1072831356u, 3904079980u, 0, LOG_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 3221705708u, 1861471009u, 0, LOG_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1076332648u, 1827165077u, 0, LOG_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 3221750981u, 3403288718u, 0, LOG_TOLERANCE, 0}, +{ 953, 1061001026u, 938869114u, 1087911145u, 2416710759u, 3223244738u, 1201893107u, 0, LOG_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1076777037u, 2208889702u, 0, LOG_TOLERANCE, 0}, +{ 955, 1090245139u, 1337895935u, 1076463812u, 1172733328u, 1076316542u, 2110621613u, 0, LOG_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 3224307240u, 3275195384u, 0, LOG_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1072692825u, 2002018797u, 0, LOG_TOLERANCE, 0}, +{ 958, 1094655132u, 2976596113u, 3192137295u, 3033242648u, 1076694606u, 1193490101u, 0, LOG_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1076967742u, 2031176632u, 0, LOG_TOLERANCE, 0}, +{ 960, 1094287162u, 4007797282u, 3225853845u, 4069319648u, 1076668519u, 2581068705u, 0, LOG_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 3224421078u, 1501078949u, 0, LOG_TOLERANCE, 0}, +{ 962, 1070128056u, 200857661u, 3229758439u, 3359367736u, 3220846767u, 3229574488u, 0, LOG_TOLERANCE, 0}, +{ 963, 1101314221u, 111868139u, 3227902082u, 2366064003u, 1077082426u, 2927706018u, 0, LOG_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 3224555233u, 1156872369u, 0, LOG_TOLERANCE, 0}, +{ 965, 1095192067u, 789151814u, 1099269239u, 2958956055u, 1076747587u, 3873229381u, 0, LOG_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1075834482u, 2680752836u, 0, LOG_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 3224451896u, 1347588545u, 0, LOG_TOLERANCE, 0}, +{ 968, 1050400412u, 3838689849u, 3198769679u, 1302617170u, 3224200205u, 624983689u, 0, LOG_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1075944829u, 3000124945u, 0, LOG_TOLERANCE, 0}, +{ 970, 1052057157u, 3502371499u, 1043411944u, 4190072016u, 3224054712u, 3615113505u, 0, LOG_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 3222599604u, 923411291u, 0, LOG_TOLERANCE, 0}, +{ 972, 1046031308u, 3653237931u, 3204255012u, 3683870669u, 3224474007u, 2475930530u, 0, LOG_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 3223924634u, 1674199212u, 0, LOG_TOLERANCE, 0}, +{ 974, 1095020203u, 558292492u, 1051772749u, 4267873474u, 1076731940u, 3159412483u, 0, LOG_TOLERANCE, 0}, +{ 975, 1077289061u, 509637100u, 3212030069u, 215050379u, 1074316851u, 2170640386u, 0, LOG_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1076475951u, 3202156800u, 0, LOG_TOLERANCE, 0}, +{ 977, 1067315689u, 998858159u, 1063077962u, 436029885u, 3222028739u, 880987246u, 0, LOG_TOLERANCE, 0}, +{ 978, 1058463317u, 996300405u, 3193842624u, 80548098u, 3223499163u, 2068439612u, 0, LOG_TOLERANCE, 0}, +{ 979, 1081365192u, 3876129407u, 3215332180u, 2226970413u, 1075258159u, 1795164616u, 0, LOG_TOLERANCE, 0}, +{ 980, 1090125305u, 200013509u, 3224552716u, 414878724u, 1076307631u, 2365929600u, 0, LOG_TOLERANCE, 0}, +{ 981, 1083133445u, 309319541u, 1048979765u, 1261662434u, 1075553109u, 2572671155u, 0, LOG_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1076229660u, 3670107739u, 0, LOG_TOLERANCE, 0}, +{ 983, 1088652436u, 1611969213u, 1053890378u, 3774617276u, 1076179232u, 1774190741u, 0, LOG_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1075094726u, 2382279992u, 0, LOG_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 3224668441u, 2879048600u, 0, LOG_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 3223954559u, 580679173u, 0, LOG_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1076259201u, 181860389u, 0, LOG_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 3223385047u, 949677917u, 0, LOG_TOLERANCE, 0}, +{ 989, 1045672057u, 659070058u, 1073095700u, 1393632068u, 3224490104u, 1843660721u, 0, LOG_TOLERANCE, 0}, +{ 990, 1070199615u, 4276187829u, 3217553330u, 1868253275u, 3220801691u, 837195521u, 0, LOG_TOLERANCE, 0}, +{ 991, 1075736624u, 2085481575u, 3215994784u, 800910002u, 1073757240u, 3736786376u, 0, LOG_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 3223638704u, 3712070612u, 0, LOG_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 3223580274u, 1820961897u, 0, LOG_TOLERANCE, 0}, +{ 994, 1053355602u, 3792931748u, 3204857863u, 804393211u, 3223942106u, 1395149486u, 0, LOG_TOLERANCE, 0}, +{ 995, 1106162722u, 3430071177u, 3226288311u, 3652522729u, 1077289900u, 3475753848u, 0, LOG_TOLERANCE, 0}, +{ 996, 1053831054u, 236884699u, 3227874605u, 2193269825u, 3223907874u, 1630755670u, 0, LOG_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 3222555459u, 4188901663u, 0, LOG_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1075709902u, 2502775335u, 0, LOG_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1076627224u, 3113340835u, 0, LOG_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_LOG_H multiple inclusion protection + +// EOF log.h diff --git a/packages/language/c/libm/current/tests/vectors/log10.c b/packages/language/c/libm/current/tests/vectors/log10.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/log10.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// log10.c +// +// Test of log10() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/log10.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(log10_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &log10, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &log10_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("log10() is stable"); + } // if + else + { + CYG_TEST_FAIL("log10() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library log10() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "log10() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF log10.c diff --git a/packages/language/c/libm/current/tests/vectors/log10.h b/packages/language/c/libm/current/tests/vectors/log10.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/log10.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_LOG10_H +#define CYGONCE_LIBM_LOG10_H +//=========================================================================== +// +// log10.h +// +// Test vectors for testing of log10() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/log10.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define LOG10_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t log10_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1073249514u, 3022418765u, 0, LOG10_TOLERANCE, 0}, +{ 2, 1070670006u, 3176730980u, 1051524793u, 2993920299u, 3219280318u, 3521941528u, 0, LOG10_TOLERANCE, 0}, +{ 3, 1092176155u, 2725707538u, 3232101343u, 2346810316u, 1075214363u, 2619608406u, 0, LOG10_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1075237767u, 4016913123u, 0, LOG10_TOLERANCE, 0}, +{ 5, 1073717029u, 2636405208u, 1100049309u, 471635570u, 1070788466u, 3705390542u, 0, LOG10_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1074998457u, 2601017037u, 0, LOG10_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 3223080594u, 1773764437u, 0, LOG10_TOLERANCE, 0}, +{ 8, 1066002386u, 2688957927u, 1046089230u, 2709029994u, 3221118451u, 837113105u, 0, LOG10_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 3222259526u, 2374389383u, 0, LOG10_TOLERANCE, 0}, +{ 10, 1057436194u, 1605286142u, 1068931671u, 4233776869u, 3222366888u, 3800128756u, 0, LOG10_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 3222025110u, 4113556665u, 0, LOG10_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1075956764u, 108599875u, 0, LOG10_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1074591863u, 2678403996u, 0, LOG10_TOLERANCE, 0}, +{ 14, 1060076142u, 1372884064u, 1080833116u, 3229926662u, 3222074556u, 443298410u, 0, LOG10_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1075336418u, 3557865346u, 0, LOG10_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1075906656u, 1833826044u, 0, LOG10_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 3218813362u, 1296639386u, 0, LOG10_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 3217121319u, 3419458770u, 0, LOG10_TOLERANCE, 0}, +{ 19, 1047365461u, 213658772u, 3249401130u, 314151656u, 3223128539u, 2168223691u, 0, LOG10_TOLERANCE, 0}, +{ 20, 1106628640u, 1564829925u, 3197817016u, 497230814u, 1076070652u, 4249090498u, 0, LOG10_TOLERANCE, 0}, +{ 21, 1068778986u, 2075329122u, 3231746400u, 169900577u, 3220283137u, 1319601517u, 0, LOG10_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 3222939514u, 2468510095u, 0, LOG10_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1074617778u, 384099018u, 0, LOG10_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 3221991359u, 737986283u, 0, LOG10_TOLERANCE, 0}, +{ 25, 1061381997u, 3348930841u, 1078472138u, 358457347u, 3221869066u, 249937911u, 0, LOG10_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 3218877956u, 3100951136u, 0, LOG10_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 3222715301u, 1774046932u, 0, LOG10_TOLERANCE, 0}, +{ 28, 1105045286u, 2322696981u, 1083791358u, 3020766674u, 1076009218u, 2332151086u, 0, LOG10_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 3223310243u, 930081556u, 0, LOG10_TOLERANCE, 0}, +{ 30, 1075022077u, 105589263u, 1056316170u, 261630827u, 1072040521u, 3389720896u, 0, LOG10_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1076090173u, 2232985963u, 0, LOG10_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1075694540u, 919239854u, 0, LOG10_TOLERANCE, 0}, +{ 33, 1086054264u, 237004814u, 3237899261u, 3364008659u, 1074713551u, 803164225u, 0, LOG10_TOLERANCE, 0}, +{ 34, 1047763904u, 472004928u, 3226869477u, 1186387580u, 3223096235u, 3622735061u, 0, LOG10_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 3222608495u, 1452762068u, 0, LOG10_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 3222399892u, 728588179u, 0, LOG10_TOLERANCE, 0}, +{ 37, 1041492999u, 3725731239u, 1061652681u, 591292963u, 3223445266u, 1587892700u, 0, LOG10_TOLERANCE, 0}, +{ 38, 1077531333u, 1147041027u, 3215417793u, 624695933u, 1073125274u, 89100982u, 0, LOG10_TOLERANCE, 0}, +{ 39, 1058569126u, 705725219u, 3238067573u, 1116238321u, 3222281827u, 770742446u, 0, LOG10_TOLERANCE, 0}, +{ 40, 1059883440u, 7287411u, 1045917232u, 116067742u, 3222096885u, 913481370u, 0, LOG10_TOLERANCE, 0}, +{ 41, 1092571574u, 3604989074u, 1066381836u, 545298780u, 1075238726u, 2904656021u, 0, LOG10_TOLERANCE, 0}, +{ 42, 1071597288u, 1681476121u, 1060345752u, 3553822398u, 3218335408u, 1174560309u, 0, LOG10_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1075926787u, 102598250u, 0, LOG10_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1074989762u, 1122846966u, 0, LOG10_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 3222565093u, 3817391420u, 0, LOG10_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1074864717u, 2346974421u, 0, LOG10_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1075508523u, 2582069913u, 0, LOG10_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 3221361467u, 665183996u, 0, LOG10_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 3221842981u, 1511855102u, 0, LOG10_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 3222381877u, 571379592u, 0, LOG10_TOLERANCE, 0}, +{ 51, 1046938380u, 1839068700u, 1077406406u, 3013052171u, 3223156927u, 1273004858u, 0, LOG10_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 3223196708u, 1857276792u, 0, LOG10_TOLERANCE, 0}, +{ 53, 1081988573u, 3058618779u, 1046304788u, 3338676024u, 1074097737u, 4237319426u, 0, LOG10_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 3222838334u, 1971852126u, 0, LOG10_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1074170619u, 220014801u, 0, LOG10_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1074100996u, 107966054u, 0, LOG10_TOLERANCE, 0}, +{ 57, 1064053268u, 704542600u, 3222902057u, 2762779203u, 3221468579u, 215530745u, 0, LOG10_TOLERANCE, 0}, +{ 58, 1052196966u, 184131949u, 3249723525u, 1667366082u, 3222761181u, 3301049340u, 0, LOG10_TOLERANCE, 0}, +{ 59, 1076125950u, 3904224140u, 1067056698u, 2942159914u, 1072701794u, 1892749236u, 0, LOG10_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1075844746u, 4158287464u, 0, LOG10_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1076050748u, 1644090822u, 0, LOG10_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1074900296u, 1620468150u, 0, LOG10_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 3220049220u, 1952021905u, 0, LOG10_TOLERANCE, 0}, +{ 64, 1087257949u, 773857656u, 3214251949u, 335833884u, 1074840167u, 1626397392u, 0, LOG10_TOLERANCE, 0}, +{ 65, 1055740962u, 1473865960u, 1103073830u, 4000427507u, 3222498007u, 2325532597u, 0, LOG10_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1075938991u, 4075535913u, 0, LOG10_TOLERANCE, 0}, +{ 67, 1045032426u, 1732245037u, 1101371955u, 1533536108u, 3223301164u, 1695162079u, 0, LOG10_TOLERANCE, 0}, +{ 68, 1101670347u, 1833841275u, 1099430098u, 4144145552u, 1075883704u, 2534133722u, 0, LOG10_TOLERANCE, 0}, +{ 69, 1096786815u, 935007012u, 3188865420u, 604442938u, 1075555534u, 3856091931u, 0, LOG10_TOLERANCE, 0}, +{ 70, 1059419605u, 2211464602u, 1046255144u, 1635910526u, 3222161784u, 2122038886u, 0, LOG10_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1073208663u, 430860074u, 0, LOG10_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1074109815u, 3246089147u, 0, LOG10_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1075377030u, 1431910568u, 0, LOG10_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 3223329924u, 2544254508u, 0, LOG10_TOLERANCE, 0}, +{ 75, 1065447634u, 2527221960u, 1099107978u, 2696971136u, 3221262049u, 1391120482u, 0, LOG10_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1075589414u, 4260456854u, 0, LOG10_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1074760870u, 3835447898u, 0, LOG10_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1071917811u, 895223700u, 0, LOG10_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 3221876243u, 3440127565u, 0, LOG10_TOLERANCE, 0}, +{ 80, 1053350775u, 2588067350u, 3206610957u, 3551059728u, 3222674665u, 3919675322u, 0, LOG10_TOLERANCE, 0}, +{ 81, 1059495208u, 845263327u, 1073415902u, 1749010288u, 3222149862u, 1260690295u, 0, LOG10_TOLERANCE, 0}, +{ 82, 1058092722u, 3092685191u, 3190678390u, 2872219490u, 3222321932u, 4078691992u, 0, LOG10_TOLERANCE, 0}, +{ 83, 1070831407u, 4107255722u, 3205337291u, 3069068345u, 3219157958u, 2522023062u, 0, LOG10_TOLERANCE, 0}, +{ 84, 1096507209u, 2294867524u, 3216653996u, 2860384670u, 1075539043u, 3909250401u, 0, LOG10_TOLERANCE, 0}, +{ 85, 1045842702u, 2265437201u, 3240198679u, 1234948614u, 3223239452u, 4104182862u, 0, LOG10_TOLERANCE, 0}, +{ 86, 1068876281u, 1186945904u, 3251167793u, 1896750851u, 3220250953u, 2361841191u, 0, LOG10_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1074043698u, 3305889265u, 0, LOG10_TOLERANCE, 0}, +{ 88, 1075992592u, 3006860614u, 3231412671u, 2504194724u, 1072614529u, 2742713680u, 0, LOG10_TOLERANCE, 0}, +{ 89, 1088665612u, 1948717780u, 1048317852u, 3791803982u, 1074949315u, 1016144265u, 0, LOG10_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 3221430904u, 1575151155u, 0, LOG10_TOLERANCE, 0}, +{ 91, 1098334178u, 4108948538u, 1104691287u, 640541190u, 1075678285u, 2376433274u, 0, LOG10_TOLERANCE, 0}, +{ 92, 1059773769u, 3259274853u, 1082507103u, 3677038020u, 3222110644u, 2405648502u, 0, LOG10_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1074266405u, 2767701991u, 0, LOG10_TOLERANCE, 0}, +{ 94, 1041211624u, 3011191657u, 1103798670u, 1096124830u, 3223458410u, 3146895201u, 0, LOG10_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 3221599629u, 3004527711u, 0, LOG10_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1074355041u, 396212168u, 0, LOG10_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 3222840766u, 2455777040u, 0, LOG10_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1073334613u, 2708912122u, 0, LOG10_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1075929194u, 1996503108u, 0, LOG10_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1071444142u, 1729917169u, 0, LOG10_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1074146890u, 3718905266u, 0, LOG10_TOLERANCE, 0}, +{ 102, 1099367744u, 1190259653u, 1069112254u, 3417249840u, 1075756071u, 2662850456u, 0, LOG10_TOLERANCE, 0}, +{ 103, 1046179435u, 3467757357u, 3215075200u, 2168175352u, 3223215840u, 1799448942u, 0, LOG10_TOLERANCE, 0}, +{ 104, 1092159487u, 1508888184u, 1060430241u, 3524949092u, 1075213212u, 2842956866u, 0, LOG10_TOLERANCE, 0}, +{ 105, 1049929235u, 166402802u, 3237198975u, 3572369260u, 3222932523u, 4280265619u, 0, LOG10_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1074083099u, 1451479062u, 0, LOG10_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 3221718085u, 2663279180u, 0, LOG10_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1074165226u, 294524756u, 0, LOG10_TOLERANCE, 0}, +{ 109, 1048145373u, 2055773734u, 3239267288u, 291396537u, 3223066642u, 1899295311u, 0, LOG10_TOLERANCE, 0}, +{ 110, 1089484385u, 874125203u, 3210508124u, 4091098764u, 1075005936u, 3628964044u, 0, LOG10_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 3221202575u, 1575844383u, 0, LOG10_TOLERANCE, 0}, +{ 112, 1059055762u, 2243036871u, 3243941101u, 740033495u, 3222229291u, 2093928209u, 0, LOG10_TOLERANCE, 0}, +{ 113, 1061941258u, 1176656356u, 1074261978u, 3588756231u, 3221786072u, 706930159u, 0, LOG10_TOLERANCE, 0}, +{ 114, 1105333143u, 3037249392u, 1061635587u, 1173102190u, 1076020402u, 1724289891u, 0, LOG10_TOLERANCE, 0}, +{ 115, 1089725933u, 2882725208u, 1071440059u, 69225090u, 1075029258u, 2093829877u, 0, LOG10_TOLERANCE, 0}, +{ 116, 1065179826u, 272319256u, 1072073912u, 2493997123u, 3221301330u, 1958636672u, 0, LOG10_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 3222347389u, 2837231009u, 0, LOG10_TOLERANCE, 0}, +{ 118, 1089274869u, 1990439193u, 1078073146u, 622849962u, 1074993288u, 3576763939u, 0, LOG10_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 3222391958u, 2930228447u, 0, LOG10_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 3221829540u, 1096267203u, 0, LOG10_TOLERANCE, 0}, +{ 121, 1047807349u, 2676398686u, 1105124431u, 3631096636u, 3223092450u, 2080967742u, 0, LOG10_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 3221313539u, 2223619642u, 0, LOG10_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1073283305u, 2406385933u, 0, LOG10_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 3216648998u, 239016280u, 0, LOG10_TOLERANCE, 0}, +{ 125, 1093747188u, 4140316002u, 1082896196u, 868256971u, 1075328702u, 2557641593u, 0, LOG10_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1072288548u, 2563126331u, 0, LOG10_TOLERANCE, 0}, +{ 127, 1072707675u, 2427162817u, 3234748208u, 2715105792u, 1064849176u, 3587587979u, 0, LOG10_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 3221382913u, 1568343271u, 0, LOG10_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 3223277610u, 3114998281u, 0, LOG10_TOLERANCE, 0}, +{ 130, 1104362211u, 105058217u, 1069733884u, 171786224u, 1075984565u, 2168621818u, 0, LOG10_TOLERANCE, 0}, +{ 131, 1042130860u, 2863482262u, 3204997271u, 877784425u, 3223422621u, 3194788353u, 0, LOG10_TOLERANCE, 0}, +{ 132, 1055145665u, 2801782962u, 3213604117u, 762347195u, 3222540205u, 780206140u, 0, LOG10_TOLERANCE, 0}, +{ 133, 1086003079u, 2317950339u, 3246333414u, 2135700283u, 1074707079u, 4088703451u, 0, LOG10_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 3222436544u, 1603917460u, 0, LOG10_TOLERANCE, 0}, +{ 135, 1072665436u, 1918836931u, 1083603224u, 3137821660u, 3212296090u, 3048145701u, 0, LOG10_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1075966944u, 3184370032u, 0, LOG10_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 3223418431u, 1706671790u, 0, LOG10_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1074007414u, 1749941826u, 0, LOG10_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 3221820508u, 669475419u, 0, LOG10_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1072218835u, 1332264134u, 0, LOG10_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1075533243u, 1299474792u, 0, LOG10_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1074021627u, 1335572803u, 0, LOG10_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1072756957u, 1728113973u, 0, LOG10_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1075872223u, 2982335179u, 0, LOG10_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 3220184538u, 579581628u, 0, LOG10_TOLERANCE, 0}, +{ 146, 1041146119u, 978126928u, 1101553990u, 4047893399u, 3223460238u, 2981887158u, 0, LOG10_TOLERANCE, 0}, +{ 147, 1074838397u, 4059818629u, 1042678728u, 3640293589u, 1071899471u, 3330393492u, 0, LOG10_TOLERANCE, 0}, +{ 148, 1100980392u, 3383497159u, 1070002807u, 1527313008u, 1075855061u, 3937649430u, 0, LOG10_TOLERANCE, 0}, +{ 149, 1055224031u, 2599946514u, 1104170406u, 2738675352u, 3222533671u, 3949070241u, 0, LOG10_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1076015345u, 3938672152u, 0, LOG10_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1072641553u, 236826591u, 0, LOG10_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 3223394400u, 155360699u, 0, LOG10_TOLERANCE, 0}, +{ 153, 1085623441u, 182132862u, 3250520938u, 3924356991u, 1074652303u, 227095142u, 0, LOG10_TOLERANCE, 0}, +{ 154, 1083018236u, 35632886u, 3209806504u, 1453402523u, 1074253351u, 706658652u, 0, LOG10_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1074335966u, 971180013u, 0, LOG10_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1073908090u, 2970356020u, 0, LOG10_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1075424983u, 4192261729u, 0, LOG10_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 3222296288u, 615814715u, 0, LOG10_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1073532773u, 2431650893u, 0, LOG10_TOLERANCE, 0}, +{ 160, 1089975150u, 4215445172u, 3196654963u, 2231888973u, 1075049168u, 3858745282u, 0, LOG10_TOLERANCE, 0}, +{ 161, 1099148583u, 40413554u, 3232578253u, 983832844u, 1075738201u, 1294348798u, 0, LOG10_TOLERANCE, 0}, +{ 162, 1076237886u, 3995725873u, 1050082319u, 777231627u, 1072738446u, 2490660630u, 0, LOG10_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 3223464951u, 2022959186u, 0, LOG10_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 3220415024u, 1453784302u, 0, LOG10_TOLERANCE, 0}, +{ 165, 1062562529u, 1018222907u, 3244621407u, 3090050495u, 3221688759u, 3042080164u, 0, LOG10_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 3220616089u, 2752657805u, 0, LOG10_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1073372035u, 4013751462u, 0, LOG10_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 3223392040u, 625299453u, 0, LOG10_TOLERANCE, 0}, +{ 169, 1068615357u, 1710131411u, 1078123323u, 1900790503u, 3220342988u, 1117943757u, 0, LOG10_TOLERANCE, 0}, +{ 170, 1091335713u, 3420420033u, 3210844787u, 588423066u, 1075148920u, 1970986568u, 0, LOG10_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 3222955275u, 558478599u, 0, LOG10_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1075917013u, 142658660u, 0, LOG10_TOLERANCE, 0}, +{ 173, 1079144091u, 1325936170u, 3221436876u, 680097612u, 1073603027u, 4223503858u, 0, LOG10_TOLERANCE, 0}, +{ 174, 1092907468u, 1827735934u, 3200554324u, 2875599271u, 1075269082u, 61509776u, 0, LOG10_TOLERANCE, 0}, +{ 175, 1043546754u, 3117037091u, 3239246636u, 15838845u, 3223368277u, 1788507559u, 0, LOG10_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 3222779192u, 499603616u, 0, LOG10_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 3223315327u, 605213675u, 0, LOG10_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1075654641u, 1976310585u, 0, LOG10_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1073980485u, 1917090271u, 0, LOG10_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1074522322u, 201295655u, 0, LOG10_TOLERANCE, 0}, +{ 181, 1069146422u, 1141349287u, 1097465301u, 3403438584u, 3220166997u, 3273626097u, 0, LOG10_TOLERANCE, 0}, +{ 182, 1083088260u, 1711085243u, 3250239076u, 1377484108u, 1074261439u, 3510689380u, 0, LOG10_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1075682022u, 1318740231u, 0, LOG10_TOLERANCE, 0}, +{ 184, 1086737787u, 2626629370u, 1063771493u, 1499080813u, 1074805506u, 2197894595u, 0, LOG10_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 3222533087u, 1926622946u, 0, LOG10_TOLERANCE, 0}, +{ 186, 1060498071u, 1270950554u, 3194616071u, 3680565379u, 3221999169u, 3085134097u, 0, LOG10_TOLERANCE, 0}, +{ 187, 1060664575u, 1066985223u, 3221613219u, 4089383168u, 3221974195u, 1363215594u, 0, LOG10_TOLERANCE, 0}, +{ 188, 1069575191u, 4017329311u, 3208334452u, 1667591498u, 3219949937u, 482205278u, 0, LOG10_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1074910593u, 1611552831u, 0, LOG10_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 3222883751u, 2710381229u, 0, LOG10_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1076006824u, 1671790082u, 0, LOG10_TOLERANCE, 0}, +{ 192, 1043081808u, 1371169579u, 1057079837u, 2594818628u, 3223386098u, 4205730324u, 0, LOG10_TOLERANCE, 0}, +{ 193, 1104309688u, 2259342224u, 3217432469u, 1824221478u, 1075982142u, 1272387594u, 0, LOG10_TOLERANCE, 0}, +{ 194, 1099351127u, 1576604497u, 1079368611u, 185078728u, 1075754810u, 3070984497u, 0, LOG10_TOLERANCE, 0}, +{ 195, 1074195779u, 444800035u, 3243343143u, 1734989302u, 1071465380u, 1752264123u, 0, LOG10_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1066859955u, 2063338972u, 0, LOG10_TOLERANCE, 0}, +{ 197, 1087212320u, 1941318385u, 1045807374u, 792193370u, 1074837515u, 2154594024u, 0, LOG10_TOLERANCE, 0}, +{ 198, 1090816018u, 1299392207u, 3212131720u, 3205732280u, 1075111739u, 267565964u, 0, LOG10_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1075702711u, 3041229296u, 0, LOG10_TOLERANCE, 0}, +{ 200, 1099192612u, 2160225215u, 1102624859u, 836655570u, 1075742023u, 2852075512u, 0, LOG10_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1075552011u, 1964944288u, 0, LOG10_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 3218968143u, 2381624297u, 0, LOG10_TOLERANCE, 0}, +{ 203, 1082932703u, 1603798153u, 3207725532u, 1099413093u, 1074243064u, 2760597126u, 0, LOG10_TOLERANCE, 0}, +{ 204, 1099194730u, 2429340443u, 3190303581u, 3223770005u, 1075742204u, 1481397550u, 0, LOG10_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1072527436u, 3458072453u, 0, LOG10_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1075274427u, 3320030397u, 0, LOG10_TOLERANCE, 0}, +{ 207, 1045686228u, 2782073372u, 1046063872u, 4023829068u, 3223252349u, 3038225778u, 0, LOG10_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1075694332u, 3986486054u, 0, LOG10_TOLERANCE, 0}, +{ 209, 1091027173u, 3506346169u, 1047020885u, 1742757458u, 1075128334u, 1994269532u, 0, LOG10_TOLERANCE, 0}, +{ 210, 1045180829u, 1265459564u, 3193450280u, 3650514880u, 3223291632u, 1407815761u, 0, LOG10_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1074068889u, 281483434u, 0, LOG10_TOLERANCE, 0}, +{ 212, 1101185272u, 1263613754u, 3219096387u, 635677201u, 1075864768u, 886241666u, 0, LOG10_TOLERANCE, 0}, +{ 213, 1058788439u, 4140947288u, 3200792376u, 2013265346u, 3222260434u, 3769645888u, 0, LOG10_TOLERANCE, 0}, +{ 214, 1102490744u, 1912759945u, 3237045253u, 1351396825u, 1075915029u, 2362076341u, 0, LOG10_TOLERANCE, 0}, +{ 215, 1100721514u, 1001433078u, 3206926643u, 2741676659u, 1075847467u, 2274933934u, 0, LOG10_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1073937994u, 3131087463u, 0, LOG10_TOLERANCE, 0}, +{ 217, 1068250409u, 831239754u, 1099828675u, 3071308141u, 3220448375u, 1593685882u, 0, LOG10_TOLERANCE, 0}, +{ 218, 1078350849u, 3473592372u, 1102759382u, 1309576357u, 1073374699u, 2119873274u, 0, LOG10_TOLERANCE, 0}, +{ 219, 1103703058u, 2042340367u, 1091945628u, 2062772374u, 1075960436u, 2286787906u, 0, LOG10_TOLERANCE, 0}, +{ 220, 1047282039u, 1840632537u, 1096533424u, 807510337u, 3223133556u, 615461173u, 0, LOG10_TOLERANCE, 0}, +{ 221, 1083968074u, 144814872u, 3212698915u, 2282965697u, 1074399260u, 2935967126u, 0, LOG10_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 3218688141u, 1735943305u, 0, LOG10_TOLERANCE, 0}, +{ 223, 1095609417u, 2858583811u, 1089760910u, 6360994u, 1075469319u, 1031376135u, 0, LOG10_TOLERANCE, 0}, +{ 224, 1050781281u, 1614537194u, 1075198900u, 4088705365u, 3222871476u, 124071926u, 0, LOG10_TOLERANCE, 0}, +{ 225, 1103455422u, 3545570051u, 1065221325u, 1629217700u, 1075951177u, 3818828341u, 0, LOG10_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1066739384u, 2622169306u, 0, LOG10_TOLERANCE, 0}, +{ 227, 1049319038u, 2406734491u, 1042055360u, 89226663u, 3222979489u, 1549818103u, 0, LOG10_TOLERANCE, 0}, +{ 228, 1048267433u, 1618759139u, 3194723421u, 3888234802u, 3223058595u, 943314679u, 0, LOG10_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 3222523359u, 3801211338u, 0, LOG10_TOLERANCE, 0}, +{ 230, 1042459412u, 2431246964u, 3241512456u, 183850734u, 3223409509u, 3122860931u, 0, LOG10_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1075007714u, 397722947u, 0, LOG10_TOLERANCE, 0}, +{ 232, 1087811016u, 3495352775u, 1058576726u, 596957268u, 1074886323u, 4156588618u, 0, LOG10_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 3223190487u, 3541347935u, 0, LOG10_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 3222323852u, 918767008u, 0, LOG10_TOLERANCE, 0}, +{ 235, 1052841323u, 2143376228u, 1098306332u, 3760236188u, 3222717361u, 4276298674u, 0, LOG10_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1071782371u, 3108716060u, 0, LOG10_TOLERANCE, 0}, +{ 237, 1066682341u, 2493598049u, 3194927008u, 1689107592u, 3220914269u, 805960935u, 0, LOG10_TOLERANCE, 0}, +{ 238, 1042506311u, 1578976988u, 1066368383u, 2117279163u, 3223407368u, 1831202447u, 0, LOG10_TOLERANCE, 0}, +{ 239, 1075504463u, 3425290087u, 1098487295u, 1263412017u, 1072331748u, 2542659286u, 0, LOG10_TOLERANCE, 0}, +{ 240, 1060949116u, 3635396812u, 1070999426u, 3965655689u, 3221936986u, 1317850179u, 0, LOG10_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 3222052862u, 2389008740u, 0, LOG10_TOLERANCE, 0}, +{ 242, 1074462441u, 199516350u, 1078368488u, 164621458u, 1071703822u, 3497032431u, 0, LOG10_TOLERANCE, 0}, +{ 243, 1040222370u, 3570940805u, 3230316437u, 3596080877u, 3223495334u, 3465764975u, 0, LOG10_TOLERANCE, 0}, +{ 244, 1060725917u, 980880313u, 1079833442u, 884465057u, 3221965643u, 3063857904u, 0, LOG10_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1075795814u, 1376180157u, 0, LOG10_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 3223144303u, 4009520900u, 0, LOG10_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 3221948600u, 2664673208u, 0, LOG10_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 3222149720u, 1522432661u, 0, LOG10_TOLERANCE, 0}, +{ 249, 1088728303u, 751136990u, 3230392165u, 3493275472u, 1074954708u, 1362341029u, 0, LOG10_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1075680636u, 1289064744u, 0, LOG10_TOLERANCE, 0}, +{ 251, 1102940648u, 1717672108u, 1048120593u, 531240316u, 1075930085u, 2703746266u, 0, LOG10_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 3222612628u, 946693516u, 0, LOG10_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1073200851u, 2600416432u, 0, LOG10_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1074428937u, 2273638036u, 0, LOG10_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 3223352200u, 2239843435u, 0, LOG10_TOLERANCE, 0}, +{ 256, 1087992954u, 451471221u, 1064816262u, 4187644495u, 1074899471u, 12188310u, 0, LOG10_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1075762845u, 559607440u, 0, LOG10_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 3223485983u, 1687818887u, 0, LOG10_TOLERANCE, 0}, +{ 259, 1065765700u, 179066662u, 1103272172u, 1217337578u, 3221186823u, 1702896667u, 0, LOG10_TOLERANCE, 0}, +{ 260, 1064078729u, 3779303391u, 3210023352u, 3115946280u, 3221465459u, 2407475467u, 0, LOG10_TOLERANCE, 0}, +{ 261, 1045506226u, 286247089u, 1085153597u, 713645369u, 3223269253u, 3306334413u, 0, LOG10_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1075320708u, 3563700741u, 0, LOG10_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1074267138u, 293554640u, 0, LOG10_TOLERANCE, 0}, +{ 264, 1054212159u, 2256346551u, 3222430705u, 2071674991u, 3222609649u, 2107857682u, 0, LOG10_TOLERANCE, 0}, +{ 265, 1056541047u, 2295269094u, 1084451053u, 2773103941u, 3222434855u, 394431272u, 0, LOG10_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1073316022u, 2786091143u, 0, LOG10_TOLERANCE, 0}, +{ 267, 1073582325u, 1381740563u, 1071545057u, 2918235653u, 1070666040u, 3869657815u, 0, LOG10_TOLERANCE, 0}, +{ 268, 1091232324u, 1105857967u, 3241990046u, 2703723225u, 1075142428u, 1377220811u, 0, LOG10_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 3223388179u, 951338253u, 0, LOG10_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1075080201u, 1158479528u, 0, LOG10_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 3221395913u, 4231239291u, 0, LOG10_TOLERANCE, 0}, +{ 272, 1066308179u, 2136071361u, 3211529757u, 993675115u, 3221043032u, 1426615912u, 0, LOG10_TOLERANCE, 0}, +{ 273, 1066179733u, 210772141u, 3241441539u, 580731413u, 3221073205u, 838397735u, 0, LOG10_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1075337719u, 4139891090u, 0, LOG10_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 3220890163u, 4138303096u, 0, LOG10_TOLERANCE, 0}, +{ 276, 1041806969u, 1578223762u, 3224596567u, 2456166162u, 3223432999u, 2061892417u, 0, LOG10_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 3222286325u, 1989463349u, 0, LOG10_TOLERANCE, 0}, +{ 278, 1084379746u, 2352173188u, 1079361728u, 4070222179u, 1074460192u, 606876331u, 0, LOG10_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1075856166u, 2478468402u, 0, LOG10_TOLERANCE, 0}, +{ 280, 1049519003u, 330905705u, 1086260896u, 90264431u, 3222967443u, 279221201u, 0, LOG10_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 3223473464u, 1061077941u, 0, LOG10_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1073948486u, 2112903132u, 0, LOG10_TOLERANCE, 0}, +{ 283, 1102323563u, 3736863454u, 1063475914u, 3150741666u, 1075908235u, 1559267761u, 0, LOG10_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 3221957583u, 1023579949u, 0, LOG10_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1073834974u, 1053439998u, 0, LOG10_TOLERANCE, 0}, +{ 286, 1099500686u, 2132131375u, 3250483427u, 3449276437u, 1075765686u, 359660823u, 0, LOG10_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1074999912u, 857354786u, 0, LOG10_TOLERANCE, 0}, +{ 288, 1071289056u, 4090088208u, 1042030013u, 3898658299u, 3218632247u, 4153299296u, 0, LOG10_TOLERANCE, 0}, +{ 289, 1060424416u, 2272831437u, 3253082595u, 2639188641u, 3222011156u, 352494683u, 0, LOG10_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 3222572602u, 3831839253u, 0, LOG10_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1072629422u, 3024843075u, 0, LOG10_TOLERANCE, 0}, +{ 292, 1095283362u, 996259334u, 3241496889u, 3782673116u, 1075448425u, 2044469585u, 0, LOG10_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1075736615u, 2976904307u, 0, LOG10_TOLERANCE, 0}, +{ 294, 1103935945u, 95874100u, 3237232828u, 2645647822u, 1075967953u, 2505472330u, 0, LOG10_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 3223363153u, 2218871553u, 0, LOG10_TOLERANCE, 0}, +{ 296, 1091109904u, 2560836004u, 3199616543u, 1180840586u, 1075134229u, 2422777408u, 0, LOG10_TOLERANCE, 0}, +{ 297, 1074119318u, 2218230392u, 3227485787u, 3947214579u, 1071370243u, 1003595310u, 0, LOG10_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1073732026u, 1166483442u, 0, LOG10_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 3214607349u, 2125764098u, 0, LOG10_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1075660795u, 1772312193u, 0, LOG10_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1074575739u, 2341197873u, 0, LOG10_TOLERANCE, 0}, +{ 302, 1051600232u, 1346862963u, 1077836259u, 3604666660u, 3222810530u, 2259775583u, 0, LOG10_TOLERANCE, 0}, +{ 303, 1064772331u, 3115209742u, 1099332326u, 1325101950u, 3221355528u, 4174732436u, 0, LOG10_TOLERANCE, 0}, +{ 304, 1077062394u, 3889223100u, 1053247613u, 3371396923u, 1072977511u, 4208845593u, 0, LOG10_TOLERANCE, 0}, +{ 305, 1072994220u, 4163120793u, 1075022670u, 1387631215u, 1069288961u, 3741080239u, 0, LOG10_TOLERANCE, 0}, +{ 306, 1057998131u, 1532426189u, 1063168268u, 3397022615u, 3222331077u, 31392221u, 0, LOG10_TOLERANCE, 0}, +{ 307, 1053549673u, 89324166u, 1079206060u, 3429424710u, 3222661551u, 75523650u, 0, LOG10_TOLERANCE, 0}, +{ 308, 1044841454u, 747591401u, 1072238381u, 2803213904u, 3223314736u, 2879315374u, 0, LOG10_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1075134498u, 1591765325u, 0, LOG10_TOLERANCE, 0}, +{ 310, 1080585266u, 314958082u, 3249912496u, 2966213175u, 1073894330u, 1052667796u, 0, LOG10_TOLERANCE, 0}, +{ 311, 1049695766u, 3119528953u, 3217179014u, 2908718240u, 3222954084u, 889232043u, 0, LOG10_TOLERANCE, 0}, +{ 312, 1094983928u, 2018361566u, 1100926600u, 3985805054u, 1075425136u, 2185146546u, 0, LOG10_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 3219569843u, 63396861u, 0, LOG10_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1072460651u, 1334807680u, 0, LOG10_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1075880038u, 2397039693u, 0, LOG10_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1075497330u, 1592384176u, 0, LOG10_TOLERANCE, 0}, +{ 317, 1106743252u, 3250487255u, 1062120700u, 1876195180u, 1076075043u, 453333839u, 0, LOG10_TOLERANCE, 0}, +{ 318, 1078859832u, 1336400247u, 1098057903u, 3314079581u, 1073510632u, 2598007896u, 0, LOG10_TOLERANCE, 0}, +{ 319, 1056195172u, 265025555u, 1063854282u, 3779482256u, 3222461212u, 715876344u, 0, LOG10_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 3220740348u, 2800315593u, 0, LOG10_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 3222918491u, 2931304212u, 0, LOG10_TOLERANCE, 0}, +{ 322, 1055016507u, 2875684421u, 3227459837u, 2251967570u, 3222551865u, 301845783u, 0, LOG10_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 3221598602u, 1501044995u, 0, LOG10_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1075876197u, 2005169396u, 0, LOG10_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 3221343703u, 2043034050u, 0, LOG10_TOLERANCE, 0}, +{ 326, 1096635140u, 2529029548u, 3249882819u, 3781513577u, 1075546886u, 2627653749u, 0, LOG10_TOLERANCE, 0}, +{ 327, 1065952706u, 1080845539u, 3206760016u, 911778687u, 3221131975u, 4072600242u, 0, LOG10_TOLERANCE, 0}, +{ 328, 1044467388u, 469586759u, 1091830022u, 3080528840u, 3223334904u, 2876434309u, 0, LOG10_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1073840649u, 2350580810u, 0, LOG10_TOLERANCE, 0}, +{ 330, 1063343336u, 4080017377u, 3206492941u, 1470284690u, 3221579130u, 429178087u, 0, LOG10_TOLERANCE, 0}, +{ 331, 1059636742u, 3867917386u, 1102054928u, 3504746045u, 3222129093u, 3443234884u, 0, LOG10_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 3221396564u, 215600004u, 0, LOG10_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1074912900u, 2016435523u, 0, LOG10_TOLERANCE, 0}, +{ 334, 1055486470u, 2180218657u, 3211592260u, 1206527853u, 3222514177u, 1109609194u, 0, LOG10_TOLERANCE, 0}, +{ 335, 1049601096u, 394130786u, 3242511482u, 2437699868u, 3222962844u, 1703442430u, 0, LOG10_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 3223343444u, 773913446u, 0, LOG10_TOLERANCE, 0}, +{ 337, 1062656366u, 3128971673u, 3249137531u, 2773583059u, 3221674024u, 2531989598u, 0, LOG10_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1074558718u, 3417539816u, 0, LOG10_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1075860606u, 3565615010u, 0, LOG10_TOLERANCE, 0}, +{ 340, 1104807187u, 1873709254u, 3245167989u, 44275991u, 1076001778u, 2036327596u, 0, LOG10_TOLERANCE, 0}, +{ 341, 1042185105u, 1174874204u, 3208263730u, 2360372288u, 3223421054u, 2997287966u, 0, LOG10_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1075965441u, 2636424733u, 0, LOG10_TOLERANCE, 0}, +{ 343, 1096065286u, 2469774991u, 1043117070u, 3380071805u, 1075506844u, 1428213445u, 0, LOG10_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 3222319110u, 1209148707u, 0, LOG10_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 3220259255u, 4115658190u, 0, LOG10_TOLERANCE, 0}, +{ 346, 1107228981u, 4001809575u, 3240128649u, 278261523u, 1076090611u, 4040385013u, 0, LOG10_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1074838240u, 3371466190u, 0, LOG10_TOLERANCE, 0}, +{ 348, 1053468899u, 2511916952u, 3219195283u, 1697158299u, 3222666696u, 1149559858u, 0, LOG10_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 3219655741u, 4077268049u, 0, LOG10_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1075965217u, 3250603014u, 0, LOG10_TOLERANCE, 0}, +{ 351, 1063780306u, 3275604304u, 3194840159u, 2991205850u, 3221505017u, 3196065758u, 0, LOG10_TOLERANCE, 0}, +{ 352, 1047765727u, 3509997278u, 3248888030u, 3897986511u, 3223096074u, 1672032697u, 0, LOG10_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 3223139850u, 2987274156u, 0, LOG10_TOLERANCE, 0}, +{ 354, 1065780437u, 1073153314u, 3250031627u, 2567234990u, 3221182253u, 164395135u, 0, LOG10_TOLERANCE, 0}, +{ 355, 1043109764u, 4261696995u, 3197784432u, 323702024u, 3223385243u, 1235045213u, 0, LOG10_TOLERANCE, 0}, +{ 356, 1096207349u, 4075177615u, 3202791065u, 1919006082u, 1075518219u, 3567878508u, 0, LOG10_TOLERANCE, 0}, +{ 357, 1091786365u, 386429966u, 1086504491u, 3698826164u, 1075183833u, 284065248u, 0, LOG10_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1073367276u, 1317768853u, 0, LOG10_TOLERANCE, 0}, +{ 359, 1069828285u, 3719038997u, 1055433962u, 3331415058u, 3219757577u, 883618285u, 0, LOG10_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 3221962410u, 3782338671u, 0, LOG10_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1074088909u, 1763037434u, 0, LOG10_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 3223439873u, 2314570182u, 0, LOG10_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 3222451562u, 2646436590u, 0, LOG10_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1075208257u, 3714920247u, 0, LOG10_TOLERANCE, 0}, +{ 365, 1066407215u, 1897285171u, 3251296075u, 944966123u, 3221019887u, 2885684334u, 0, LOG10_TOLERANCE, 0}, +{ 366, 1093887602u, 2270747330u, 3230692631u, 422503284u, 1075342025u, 3855534378u, 0, LOG10_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1074417351u, 3495656636u, 0, LOG10_TOLERANCE, 0}, +{ 368, 1055991450u, 1380066948u, 3232612906u, 2613634294u, 3222480175u, 4079753456u, 0, LOG10_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 3221489550u, 3947775592u, 0, LOG10_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 3223326954u, 1245976636u, 0, LOG10_TOLERANCE, 0}, +{ 371, 1069243652u, 1859175955u, 1079949560u, 4258450607u, 3220116226u, 3853669976u, 0, LOG10_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 3223057963u, 1203658489u, 0, LOG10_TOLERANCE, 0}, +{ 373, 1045699515u, 2454653987u, 3229487005u, 2977478685u, 3223251196u, 49172802u, 0, LOG10_TOLERANCE, 0}, +{ 374, 1106072835u, 1355181872u, 1095308770u, 436846481u, 1076048055u, 3710853932u, 0, LOG10_TOLERANCE, 0}, +{ 375, 1099121654u, 2592856453u, 3247825559u, 3195234082u, 1075735798u, 2943062101u, 0, LOG10_TOLERANCE, 0}, +{ 376, 1074634375u, 3554670043u, 1091621009u, 3321236467u, 1071788293u, 3499163438u, 0, LOG10_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 3220209306u, 4000528649u, 0, LOG10_TOLERANCE, 0}, +{ 378, 1044807461u, 2960339502u, 1098808013u, 1044068983u, 3223317331u, 3200692282u, 0, LOG10_TOLERANCE, 0}, +{ 379, 1049207537u, 4093388677u, 1095478112u, 1735930261u, 3222986804u, 3051995548u, 0, LOG10_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1075129290u, 2488942216u, 0, LOG10_TOLERANCE, 0}, +{ 381, 1061810546u, 3250576797u, 1059002384u, 3043079652u, 3221802937u, 62615936u, 0, LOG10_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 3220134978u, 1624219483u, 0, LOG10_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1075952462u, 1749306203u, 0, LOG10_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 3222602868u, 625029866u, 0, LOG10_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1076072987u, 3348155444u, 0, LOG10_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1073940365u, 763960603u, 0, LOG10_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1074413746u, 4063861095u, 0, LOG10_TOLERANCE, 0}, +{ 388, 1072438992u, 2284484846u, 3219498359u, 3240896015u, 3215768815u, 1046975407u, 0, LOG10_TOLERANCE, 0}, +{ 389, 1088276041u, 494503287u, 1092811254u, 142673998u, 1074917315u, 3271366326u, 0, LOG10_TOLERANCE, 0}, +{ 390, 1104642268u, 3394882641u, 3225306538u, 364852125u, 1075995988u, 1977096684u, 0, LOG10_TOLERANCE, 0}, +{ 391, 1077778115u, 193885269u, 1088149839u, 1359805831u, 1073187262u, 2507279849u, 0, LOG10_TOLERANCE, 0}, +{ 392, 1053001134u, 592580907u, 3199560872u, 3086438952u, 3222702171u, 1985550349u, 0, LOG10_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 3222146286u, 3204633369u, 0, LOG10_TOLERANCE, 0}, +{ 394, 1099249950u, 233240285u, 1081923320u, 2710903921u, 1075746816u, 1726081546u, 0, LOG10_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 3219988438u, 2477635424u, 0, LOG10_TOLERANCE, 0}, +{ 396, 1073711076u, 3647632375u, 3247225271u, 3839959621u, 1070783226u, 4149591050u, 0, LOG10_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1075948928u, 1471690445u, 0, LOG10_TOLERANCE, 0}, +{ 398, 1045520036u, 2134662911u, 3190390590u, 4239009051u, 3223267864u, 491395740u, 0, LOG10_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1073885760u, 2209376105u, 0, LOG10_TOLERANCE, 0}, +{ 400, 1072380611u, 538224650u, 3206153057u, 1379649610u, 3216110261u, 736404255u, 0, LOG10_TOLERANCE, 0}, +{ 401, 1048926859u, 3683897920u, 3244167599u, 3647579469u, 3223007615u, 885924102u, 0, LOG10_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1075069627u, 4045261099u, 0, LOG10_TOLERANCE, 0}, +{ 403, 1064151744u, 872706833u, 1084802480u, 2200602798u, 3221456744u, 108068407u, 0, LOG10_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 3223415376u, 2814323454u, 0, LOG10_TOLERANCE, 0}, +{ 405, 1048211322u, 1894173462u, 3232800651u, 191960416u, 3223062224u, 158689847u, 0, LOG10_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1075141976u, 1561613401u, 0, LOG10_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1075455488u, 3662783481u, 0, LOG10_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 3221474555u, 2065254288u, 0, LOG10_TOLERANCE, 0}, +{ 409, 1091348993u, 2287646644u, 3240329321u, 2276183378u, 1075149728u, 564081412u, 0, LOG10_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 3220458648u, 326066716u, 0, LOG10_TOLERANCE, 0}, +{ 411, 1065284713u, 36116288u, 3206886566u, 4196602670u, 3221289242u, 3024728349u, 0, LOG10_TOLERANCE, 0}, +{ 412, 1094212205u, 3550227562u, 3207257983u, 2747744117u, 1075367912u, 3605299668u, 0, LOG10_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1075978565u, 76478367u, 0, LOG10_TOLERANCE, 0}, +{ 414, 1075513130u, 2210969014u, 1081031001u, 1946786091u, 1072336215u, 3594780710u, 0, LOG10_TOLERANCE, 0}, +{ 415, 1088823342u, 4059150589u, 3189759234u, 1177045799u, 1074962426u, 203192711u, 0, LOG10_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1075284635u, 3784608382u, 0, LOG10_TOLERANCE, 0}, +{ 417, 1066295469u, 1175750283u, 3235559706u, 1424491340u, 3221045930u, 2066830035u, 0, LOG10_TOLERANCE, 0}, +{ 418, 1066420545u, 1630036121u, 3231972785u, 3195479448u, 3221014164u, 1961979416u, 0, LOG10_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1075078402u, 674977703u, 0, LOG10_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1074579717u, 3053034379u, 0, LOG10_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1075154757u, 4288752120u, 0, LOG10_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 3220915391u, 1002013526u, 0, LOG10_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1074282429u, 2639675714u, 0, LOG10_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1073423693u, 1229342814u, 0, LOG10_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 3223188718u, 923854032u, 0, LOG10_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1074916100u, 3232618583u, 0, LOG10_TOLERANCE, 0}, +{ 427, 1071694702u, 83062251u, 3211262173u, 2659016437u, 3218208877u, 4113528378u, 0, LOG10_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1075476931u, 1567233076u, 0, LOG10_TOLERANCE, 0}, +{ 429, 1057711424u, 2382776852u, 3249232579u, 1546622468u, 3222347943u, 3798670522u, 0, LOG10_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1074637649u, 2509717948u, 0, LOG10_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 3222844328u, 4037397167u, 0, LOG10_TOLERANCE, 0}, +{ 432, 1083714767u, 4039516226u, 3244344107u, 4272932619u, 1074365489u, 1649510185u, 0, LOG10_TOLERANCE, 0}, +{ 433, 1075224793u, 1683007544u, 1091105663u, 3805494321u, 1072174396u, 1609044821u, 0, LOG10_TOLERANCE, 0}, +{ 434, 1073369300u, 2072627412u, 1094383324u, 3394151662u, 1070311685u, 2675194563u, 0, LOG10_TOLERANCE, 0}, +{ 435, 1073086376u, 1120106427u, 3223631624u, 3404608264u, 1069658889u, 1776899808u, 0, LOG10_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1075635841u, 1601462731u, 0, LOG10_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 3223400155u, 2734047538u, 0, LOG10_TOLERANCE, 0}, +{ 438, 1107083611u, 3946837259u, 3234993796u, 3850406820u, 1076086381u, 4256303931u, 0, LOG10_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 3222363668u, 1863422807u, 0, LOG10_TOLERANCE, 0}, +{ 440, 1089221852u, 1554593884u, 3228899878u, 2813752562u, 1074990069u, 2444290568u, 0, LOG10_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 3222437333u, 3070337480u, 0, LOG10_TOLERANCE, 0}, +{ 442, 1097380651u, 289355864u, 1078453818u, 2143066338u, 1075606261u, 2210278777u, 0, LOG10_TOLERANCE, 0}, +{ 443, 1056456232u, 2157691971u, 1106629150u, 110806409u, 3222440776u, 214047711u, 0, LOG10_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1074119387u, 950389812u, 0, LOG10_TOLERANCE, 0}, +{ 445, 1053496534u, 558779875u, 3202046748u, 2338464653u, 3222664909u, 2840504692u, 0, LOG10_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 3223250683u, 1044693633u, 0, LOG10_TOLERANCE, 0}, +{ 447, 1090298613u, 3917440951u, 1051668894u, 3736066983u, 1075070705u, 2421449516u, 0, LOG10_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 3221358590u, 2240418382u, 0, LOG10_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 3221219219u, 2002424062u, 0, LOG10_TOLERANCE, 0}, +{ 450, 1091979581u, 3967957902u, 1057416138u, 3459188071u, 1075199987u, 4084035947u, 0, LOG10_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 3220333758u, 815317634u, 0, LOG10_TOLERANCE, 0}, +{ 452, 1081332748u, 3285165564u, 3211948811u, 401510871u, 1074004705u, 407550323u, 0, LOG10_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1075371109u, 3260851721u, 0, LOG10_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1074369558u, 2483657024u, 0, LOG10_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1073736874u, 648519445u, 0, LOG10_TOLERANCE, 0}, +{ 456, 1074379685u, 162122081u, 3239376395u, 108064594u, 1071660191u, 1605034523u, 0, LOG10_TOLERANCE, 0}, +{ 457, 1089788138u, 869031839u, 3225020876u, 1344301606u, 1075034563u, 2621266855u, 0, LOG10_TOLERANCE, 0}, +{ 458, 1066949826u, 946696117u, 3231825228u, 1700703647u, 3220830768u, 223570193u, 0, LOG10_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1072325741u, 565674172u, 0, LOG10_TOLERANCE, 0}, +{ 460, 1061291147u, 2488789804u, 3238508333u, 1506943664u, 3221885943u, 1809033126u, 0, LOG10_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1067670922u, 1855635741u, 0, LOG10_TOLERANCE, 0}, +{ 462, 1072450894u, 1244307192u, 3191297711u, 2540916692u, 3215675005u, 4195715816u, 0, LOG10_TOLERANCE, 0}, +{ 463, 1052579044u, 2871645739u, 3239081581u, 1440249115u, 3222735710u, 695871118u, 0, LOG10_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 3220424332u, 277989641u, 0, LOG10_TOLERANCE, 0}, +{ 465, 1047966041u, 2386312545u, 1063169277u, 2715234268u, 3223079604u, 49370105u, 0, LOG10_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1074885740u, 1843751208u, 0, LOG10_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1076045368u, 1668255753u, 0, LOG10_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 3223269253u, 3098172626u, 0, LOG10_TOLERANCE, 0}, +{ 469, 1053685514u, 2911548084u, 1105282515u, 2476735795u, 3222653390u, 710736245u, 0, LOG10_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 3222894082u, 2911135348u, 0, LOG10_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 3219544778u, 3191775902u, 0, LOG10_TOLERANCE, 0}, +{ 472, 1061070948u, 2981820811u, 1059838516u, 2845580478u, 3221922743u, 556163093u, 0, LOG10_TOLERANCE, 0}, +{ 473, 1046447766u, 1565550570u, 3217165795u, 4162017137u, 3223200002u, 563369286u, 0, LOG10_TOLERANCE, 0}, +{ 474, 1089767730u, 2808968027u, 1055630096u, 1782326814u, 1075032850u, 1073708672u, 0, LOG10_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 3222659863u, 923354108u, 0, LOG10_TOLERANCE, 0}, +{ 476, 1074688031u, 2722693603u, 3227814791u, 3169731970u, 1071813127u, 2479854561u, 0, LOG10_TOLERANCE, 0}, +{ 477, 1070422983u, 899763203u, 3207606001u, 2804747833u, 3219420822u, 1438062981u, 0, LOG10_TOLERANCE, 0}, +{ 478, 1083186677u, 3789058912u, 3228095081u, 4135937628u, 1074273171u, 2472968060u, 0, LOG10_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 3222052254u, 477899392u, 0, LOG10_TOLERANCE, 0}, +{ 480, 1094607838u, 2851963139u, 3246852961u, 2590862592u, 1075393124u, 3038195584u, 0, LOG10_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1073980248u, 710172697u, 0, LOG10_TOLERANCE, 0}, +{ 482, 1063187430u, 1082582386u, 1075605675u, 2602133689u, 3221604910u, 899954685u, 0, LOG10_TOLERANCE, 0}, +{ 483, 1092334963u, 1789635787u, 1059414278u, 1048286093u, 1075224782u, 1925305273u, 0, LOG10_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1075678013u, 2077150613u, 0, LOG10_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 3221602228u, 2787459030u, 0, LOG10_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1075769126u, 2974900830u, 0, LOG10_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1074707746u, 2728274629u, 0, LOG10_TOLERANCE, 0}, +{ 488, 1083370902u, 1924429710u, 1056464743u, 3349283177u, 1074309778u, 406273308u, 0, LOG10_TOLERANCE, 0}, +{ 489, 1097989743u, 42238036u, 1042379500u, 2113559863u, 1075649111u, 2547563809u, 0, LOG10_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 3221357200u, 642692340u, 0, LOG10_TOLERANCE, 0}, +{ 491, 1065185882u, 1645486982u, 3224301095u, 3636267471u, 3221300614u, 3261785592u, 0, LOG10_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 3221658502u, 1916272264u, 0, LOG10_TOLERANCE, 0}, +{ 493, 1090754746u, 110029735u, 1046937383u, 984375729u, 1075106433u, 221145856u, 0, LOG10_TOLERANCE, 0}, +{ 494, 1042013090u, 4063688092u, 3203235744u, 1049950343u, 3223426180u, 584482441u, 0, LOG10_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 3221726025u, 2801498591u, 0, LOG10_TOLERANCE, 0}, +{ 496, 1079572157u, 66926332u, 1090561839u, 1379780888u, 1073741164u, 2195643118u, 0, LOG10_TOLERANCE, 0}, +{ 497, 1085969659u, 2803378256u, 1086057989u, 498534626u, 1074702753u, 971413916u, 0, LOG10_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1074200711u, 2221073810u, 0, LOG10_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 3223329461u, 2601691166u, 0, LOG10_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 3222792302u, 1546587034u, 0, LOG10_TOLERANCE, 0}, +{ 501, 1083771349u, 243303420u, 1093735824u, 1575581926u, 1074373479u, 837776877u, 0, LOG10_TOLERANCE, 0}, +{ 502, 1091654349u, 3218865041u, 3204803496u, 3840388050u, 1075171309u, 2088865965u, 0, LOG10_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 3223049544u, 1357585448u, 0, LOG10_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 3222484009u, 242301978u, 0, LOG10_TOLERANCE, 0}, +{ 505, 1064421145u, 717293069u, 3211534283u, 582401011u, 3221415517u, 3660346947u, 0, LOG10_TOLERANCE, 0}, +{ 506, 1104478864u, 3766248610u, 3196520332u, 1174437546u, 1075989604u, 3365688656u, 0, LOG10_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1074320590u, 199117646u, 0, LOG10_TOLERANCE, 0}, +{ 508, 1058322796u, 3560686300u, 3220980617u, 4277975772u, 3222300802u, 1449948266u, 0, LOG10_TOLERANCE, 0}, +{ 509, 1062422428u, 2598148853u, 3217622194u, 3460421008u, 3221712702u, 3246720810u, 0, LOG10_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 3220901271u, 1853785686u, 0, LOG10_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1075557888u, 1620985468u, 0, LOG10_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1075165664u, 2887122802u, 0, LOG10_TOLERANCE, 0}, +{ 513, 1043142370u, 3739770117u, 1059520750u, 3959551225u, 3223384261u, 1189792801u, 0, LOG10_TOLERANCE, 0}, +{ 514, 1083246857u, 1498861716u, 1091297147u, 847410798u, 1074285788u, 1667361171u, 0, LOG10_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1070603266u, 4232028352u, 0, LOG10_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 3222567988u, 1423369271u, 0, LOG10_TOLERANCE, 0}, +{ 517, 1103874344u, 1546972125u, 3249076079u, 1987349196u, 1075966059u, 3386502820u, 0, LOG10_TOLERANCE, 0}, +{ 518, 1090735865u, 2769161072u, 1075207126u, 292616282u, 1075104746u, 4031801740u, 0, LOG10_TOLERANCE, 0}, +{ 519, 1052228650u, 36855311u, 1052128202u, 1479039342u, 3222758838u, 3692631126u, 0, LOG10_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1074371486u, 3578986915u, 0, LOG10_TOLERANCE, 0}, +{ 521, 1050369101u, 3808681655u, 1054161346u, 1821773119u, 3222900481u, 2925260558u, 0, LOG10_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 3223475061u, 3266495528u, 0, LOG10_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 3223417296u, 2734516734u, 0, LOG10_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 3223287704u, 455537501u, 0, LOG10_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1075474207u, 3162419511u, 0, LOG10_TOLERANCE, 0}, +{ 526, 1051865606u, 1019916843u, 3219974785u, 1977881787u, 3222789097u, 2356936620u, 0, LOG10_TOLERANCE, 0}, +{ 527, 1051995104u, 2060433318u, 1075872515u, 366073725u, 3222777360u, 1207606903u, 0, LOG10_TOLERANCE, 0}, +{ 528, 1043696909u, 1098469906u, 1082900695u, 2349346832u, 3223361879u, 497752621u, 0, LOG10_TOLERANCE, 0}, +{ 529, 1062491059u, 3011196295u, 3252479932u, 2459281672u, 3221700659u, 485236026u, 0, LOG10_TOLERANCE, 0}, +{ 530, 1073850675u, 2843222682u, 1089275809u, 298982001u, 1070990041u, 2392858765u, 0, LOG10_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1075885898u, 1722473944u, 0, LOG10_TOLERANCE, 0}, +{ 532, 1089280230u, 1274901962u, 3241535845u, 3759113509u, 1074993609u, 1453359696u, 0, LOG10_TOLERANCE, 0}, +{ 533, 1098432794u, 2134927252u, 3253802671u, 3013731444u, 1075685425u, 1495574294u, 0, LOG10_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1075742766u, 1948328827u, 0, LOG10_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 3221630568u, 1379621049u, 0, LOG10_TOLERANCE, 0}, +{ 536, 1066289466u, 834976849u, 3217357661u, 2465861779u, 3221047305u, 3116620001u, 0, LOG10_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 3223255008u, 1510643247u, 0, LOG10_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 3222890819u, 3769637076u, 0, LOG10_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 3219674994u, 294990716u, 0, LOG10_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 3223233377u, 3702336467u, 0, LOG10_TOLERANCE, 0}, +{ 541, 1086204043u, 2405805086u, 3251640319u, 324233833u, 1074731495u, 762641516u, 0, LOG10_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1076073393u, 2118848003u, 0, LOG10_TOLERANCE, 0}, +{ 543, 1041631125u, 1922837702u, 3216892718u, 3535907549u, 3223439541u, 3853212535u, 0, LOG10_TOLERANCE, 0}, +{ 544, 1096132220u, 261447440u, 3209805849u, 1150571079u, 1075512345u, 3192258124u, 0, LOG10_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1075482522u, 2878242110u, 0, LOG10_TOLERANCE, 0}, +{ 546, 1081640044u, 338765118u, 1086225786u, 3207238249u, 1074053037u, 1071781049u, 0, LOG10_TOLERANCE, 0}, +{ 547, 1048699055u, 1085283176u, 3187775111u, 1601194210u, 3223027842u, 3327204206u, 0, LOG10_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1075159656u, 2834005504u, 0, LOG10_TOLERANCE, 0}, +{ 549, 1071378583u, 3148395674u, 1041913758u, 3306391490u, 3218540934u, 3229024431u, 0, LOG10_TOLERANCE, 0}, +{ 550, 1053793422u, 2205233857u, 3208100078u, 3993195511u, 3222647300u, 823279676u, 0, LOG10_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 3220609471u, 3451929701u, 0, LOG10_TOLERANCE, 0}, +{ 552, 1063349444u, 2920860798u, 3218070226u, 3104066154u, 3221577909u, 33368404u, 0, LOG10_TOLERANCE, 0}, +{ 553, 1057466703u, 969991373u, 3250596895u, 1734386152u, 3222364626u, 2782202392u, 0, LOG10_TOLERANCE, 0}, +{ 554, 1091432170u, 1218740205u, 3239802737u, 2610078504u, 1075154660u, 2668667873u, 0, LOG10_TOLERANCE, 0}, +{ 555, 1058547594u, 1485218325u, 3220870240u, 3591664613u, 3222283365u, 1294019716u, 0, LOG10_TOLERANCE, 0}, +{ 556, 1054590495u, 690157417u, 3190850619u, 4192347699u, 3222583121u, 3272158420u, 0, LOG10_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1075505873u, 3602829947u, 0, LOG10_TOLERANCE, 0}, +{ 558, 1087075589u, 961532417u, 1092588071u, 2923790239u, 1074829177u, 2571444864u, 0, LOG10_TOLERANCE, 0}, +{ 559, 1056395443u, 4174125604u, 1050682630u, 2169701868u, 3222445217u, 2242909506u, 0, LOG10_TOLERANCE, 0}, +{ 560, 1095608827u, 4146748230u, 1087373950u, 2481478351u, 1075469284u, 3055706006u, 0, LOG10_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1072948889u, 2762932455u, 0, LOG10_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1074423267u, 2079190709u, 0, LOG10_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1075784045u, 474803698u, 0, LOG10_TOLERANCE, 0}, +{ 564, 1105714654u, 712227971u, 1106004723u, 973148499u, 1076036318u, 989663135u, 0, LOG10_TOLERANCE, 0}, +{ 565, 1082604551u, 3409813738u, 3244817008u, 1933503498u, 1074198627u, 1392248798u, 0, LOG10_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1073788096u, 3723549429u, 0, LOG10_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1073210297u, 1176943375u, 0, LOG10_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 3219204296u, 8534901u, 0, LOG10_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1075513867u, 146400103u, 0, LOG10_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1073286046u, 864376040u, 0, LOG10_TOLERANCE, 0}, +{ 571, 1057086816u, 1776099219u, 1094316777u, 4188083896u, 3222396619u, 1866278910u, 0, LOG10_TOLERANCE, 0}, +{ 572, 1046362060u, 2614400266u, 1073750227u, 3003203347u, 3223204825u, 2440192588u, 0, LOG10_TOLERANCE, 0}, +{ 573, 1066499030u, 2959351406u, 1105603716u, 311851587u, 3220981851u, 2668005317u, 0, LOG10_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1074489457u, 3357453183u, 0, LOG10_TOLERANCE, 0}, +{ 575, 1084303018u, 447506102u, 3195759295u, 3603669725u, 1074445156u, 2084524296u, 0, LOG10_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1075639068u, 3042123355u, 0, LOG10_TOLERANCE, 0}, +{ 577, 1049256177u, 784208771u, 1088764788u, 2182296421u, 3222983555u, 2711242300u, 0, LOG10_TOLERANCE, 0}, +{ 578, 1100848643u, 1527590526u, 3206961556u, 2823164069u, 1075851323u, 2440914413u, 0, LOG10_TOLERANCE, 0}, +{ 579, 1089160483u, 3876699591u, 3207481130u, 4028148535u, 1074986225u, 3667748993u, 0, LOG10_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1074344647u, 2189652330u, 0, LOG10_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1075185407u, 788005775u, 0, LOG10_TOLERANCE, 0}, +{ 582, 1079002460u, 3636214836u, 1068367620u, 2932621925u, 1073546236u, 450535769u, 0, LOG10_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 3223350966u, 501020710u, 0, LOG10_TOLERANCE, 0}, +{ 584, 1051338473u, 2648933384u, 1084603503u, 3534304873u, 3222826711u, 3279110674u, 0, LOG10_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 3221389315u, 3385302547u, 0, LOG10_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 3221921181u, 2909345809u, 0, LOG10_TOLERANCE, 0}, +{ 587, 1082371716u, 1908572179u, 1080112083u, 1228319033u, 1074160841u, 2860344817u, 0, LOG10_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 3223065771u, 190787676u, 0, LOG10_TOLERANCE, 0}, +{ 589, 1073851962u, 4211343447u, 1087492676u, 4272583781u, 1070992066u, 1791098782u, 0, LOG10_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1075757916u, 3223125935u, 0, LOG10_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 3222330228u, 3675387000u, 0, LOG10_TOLERANCE, 0}, +{ 592, 1067054971u, 3403659753u, 3218043030u, 1926480488u, 3220801724u, 1053622215u, 0, LOG10_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1072896923u, 3494913394u, 0, LOG10_TOLERANCE, 0}, +{ 594, 1075179394u, 2183928090u, 1048403956u, 963834821u, 1072146078u, 1987142843u, 0, LOG10_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1075883791u, 1290867319u, 0, LOG10_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1075745191u, 1621757249u, 0, LOG10_TOLERANCE, 0}, +{ 597, 1071510850u, 2509132460u, 1102827530u, 2205707903u, 3218413889u, 1739137714u, 0, LOG10_TOLERANCE, 0}, +{ 598, 1057376949u, 1229308263u, 3209170414u, 4206576047u, 3222371414u, 2709365139u, 0, LOG10_TOLERANCE, 0}, +{ 599, 1076592641u, 4078010749u, 3199236456u, 733478972u, 1072838269u, 1643379297u, 0, LOG10_TOLERANCE, 0}, +{ 600, 1050228936u, 4277541051u, 3199806921u, 397102023u, 3222909748u, 524666777u, 0, LOG10_TOLERANCE, 0}, +{ 601, 1048491365u, 900999594u, 3234720188u, 2530214248u, 3223045165u, 2583905845u, 0, LOG10_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1072825692u, 1999101770u, 0, LOG10_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 3223030892u, 3009591096u, 0, LOG10_TOLERANCE, 0}, +{ 604, 1075929840u, 2867079200u, 1101870326u, 921212001u, 1072565702u, 4157771188u, 0, LOG10_TOLERANCE, 0}, +{ 605, 1085738242u, 674547716u, 1063216239u, 3929755226u, 1074670299u, 1605339823u, 0, LOG10_TOLERANCE, 0}, +{ 606, 1092932203u, 3158182449u, 1043794244u, 3259056345u, 1075271164u, 2647804578u, 0, LOG10_TOLERANCE, 0}, +{ 607, 1089293008u, 3002823940u, 1059511739u, 2832435794u, 1074994369u, 2987286299u, 0, LOG10_TOLERANCE, 0}, +{ 608, 1069821174u, 2196511929u, 1049973941u, 3672092877u, 3219762462u, 2310326603u, 0, LOG10_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 3222896185u, 2892109320u, 0, LOG10_TOLERANCE, 0}, +{ 610, 1095703300u, 1617573614u, 3201863123u, 3090723732u, 1075474686u, 4138813458u, 0, LOG10_TOLERANCE, 0}, +{ 611, 1085717732u, 679893506u, 3211547753u, 824081024u, 1074667186u, 3466673869u, 0, LOG10_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1075010776u, 2105373250u, 0, LOG10_TOLERANCE, 0}, +{ 613, 1059250016u, 1935990727u, 1088822246u, 1058156518u, 3222191042u, 824662780u, 0, LOG10_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1075927020u, 2012019887u, 0, LOG10_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1075966582u, 1863110785u, 0, LOG10_TOLERANCE, 0}, +{ 616, 1105470167u, 1796441468u, 1100030327u, 2772711004u, 1076026642u, 4097068227u, 0, LOG10_TOLERANCE, 0}, +{ 617, 1056793172u, 2095685003u, 1077984448u, 2100773742u, 3222418879u, 1210777557u, 0, LOG10_TOLERANCE, 0}, +{ 618, 1045470972u, 2892538035u, 1042396334u, 4162200338u, 3223272879u, 4179986377u, 0, LOG10_TOLERANCE, 0}, +{ 619, 1095242103u, 2177698116u, 3227557177u, 150832500u, 1075445485u, 3509591170u, 0, LOG10_TOLERANCE, 0}, +{ 620, 1044078568u, 607966734u, 3236250630u, 4164600559u, 3223348263u, 823364156u, 0, LOG10_TOLERANCE, 0}, +{ 621, 1068906164u, 2830122967u, 1046096700u, 3713346883u, 3220241508u, 1678342095u, 0, LOG10_TOLERANCE, 0}, +{ 622, 1089714315u, 2314640506u, 3203696416u, 3276228872u, 1075028239u, 2744643937u, 0, LOG10_TOLERANCE, 0}, +{ 623, 1065428659u, 469331883u, 3249037349u, 2999233437u, 3221265861u, 640249239u, 0, LOG10_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1075606357u, 556919058u, 0, LOG10_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 3222936146u, 574940066u, 0, LOG10_TOLERANCE, 0}, +{ 626, 1045542849u, 3221475559u, 1043038304u, 915608434u, 3223265605u, 331939149u, 0, LOG10_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 3218730587u, 1453925889u, 0, LOG10_TOLERANCE, 0}, +{ 628, 1094545351u, 1767658578u, 3237045269u, 2313128318u, 1075389495u, 2316745533u, 0, LOG10_TOLERANCE, 0}, +{ 629, 1063134244u, 1926845182u, 1066835624u, 1783256828u, 3221610959u, 3534398567u, 0, LOG10_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 3223479272u, 72744237u, 0, LOG10_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1076079163u, 2555703719u, 0, LOG10_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1073455667u, 3464371112u, 0, LOG10_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 3222835923u, 3048532228u, 0, LOG10_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 3222846658u, 610090266u, 0, LOG10_TOLERANCE, 0}, +{ 635, 1059260269u, 2797651324u, 3224410527u, 2374818327u, 3222189162u, 1735176885u, 0, LOG10_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1074917968u, 1025128902u, 0, LOG10_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 3221139040u, 2173692258u, 0, LOG10_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 3219708277u, 2349339026u, 0, LOG10_TOLERANCE, 0}, +{ 639, 1097405019u, 2928437580u, 3187765027u, 1393427873u, 1075607962u, 2671382925u, 0, LOG10_TOLERANCE, 0}, +{ 640, 1061817913u, 189447067u, 1051643315u, 828663513u, 3221801952u, 2742751743u, 0, LOG10_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 3222752766u, 1944632537u, 0, LOG10_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 3223352622u, 3084641287u, 0, LOG10_TOLERANCE, 0}, +{ 643, 1043127178u, 1766416701u, 1100392103u, 2185373290u, 3223384716u, 3136906037u, 0, LOG10_TOLERANCE, 0}, +{ 644, 1072791741u, 3763582673u, 3191965790u, 388374829u, 1067710078u, 40508173u, 0, LOG10_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1073750094u, 4012674593u, 0, LOG10_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1075967659u, 3079243747u, 0, LOG10_TOLERANCE, 0}, +{ 647, 1063308449u, 1863545307u, 1069449477u, 3418627399u, 3221586233u, 1729396316u, 0, LOG10_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 3219928111u, 215617447u, 0, LOG10_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 3222241438u, 2254971432u, 0, LOG10_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 3223217268u, 270679194u, 0, LOG10_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 3223411710u, 809174222u, 0, LOG10_TOLERANCE, 0}, +{ 652, 1053765877u, 2003816032u, 1086050104u, 668090487u, 3222648824u, 225843921u, 0, LOG10_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 3222737092u, 3550051201u, 0, LOG10_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 3220718298u, 624955348u, 0, LOG10_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 3221451803u, 1956260472u, 0, LOG10_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 3222765458u, 1900204384u, 0, LOG10_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1074648774u, 3776772173u, 0, LOG10_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 3222976526u, 745195680u, 0, LOG10_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 3219993422u, 4145662383u, 0, LOG10_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 3220759670u, 3957488315u, 0, LOG10_TOLERANCE, 0}, +{ 661, 1103422358u, 786180031u, 3197734769u, 2788918312u, 1075949819u, 1564374635u, 0, LOG10_TOLERANCE, 0}, +{ 662, 1087028179u, 2055912467u, 3244244909u, 1394142937u, 1074826137u, 3517815416u, 0, LOG10_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 3219918503u, 912342035u, 0, LOG10_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1074005996u, 2222873768u, 0, LOG10_TOLERANCE, 0}, +{ 665, 1051074198u, 86296211u, 1085850694u, 649202596u, 3222845777u, 2242599693u, 0, LOG10_TOLERANCE, 0}, +{ 666, 1097882744u, 3069064472u, 3237358008u, 23209276u, 1075638282u, 2668333231u, 0, LOG10_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1073986953u, 2486525690u, 0, LOG10_TOLERANCE, 0}, +{ 668, 1103049699u, 3171788768u, 3235208783u, 162138697u, 1075933205u, 994967552u, 0, LOG10_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1074065233u, 2141915645u, 0, LOG10_TOLERANCE, 0}, +{ 670, 1098026472u, 3347226587u, 1058962932u, 2291943376u, 1075652603u, 2069109495u, 0, LOG10_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 3222247026u, 3985313909u, 0, LOG10_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1067735688u, 2642613737u, 0, LOG10_TOLERANCE, 0}, +{ 673, 1100632849u, 1671039260u, 1086395032u, 3745833360u, 1075844614u, 2953668257u, 0, LOG10_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 3222397401u, 3928282362u, 0, LOG10_TOLERANCE, 0}, +{ 675, 1059632083u, 1423000172u, 3247822717u, 1551488170u, 3222129748u, 947884649u, 0, LOG10_TOLERANCE, 0}, +{ 676, 1054113659u, 921077236u, 3213332351u, 1431049019u, 3222617705u, 1746915195u, 0, LOG10_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 3220681274u, 2767998108u, 0, LOG10_TOLERANCE, 0}, +{ 678, 1080171331u, 4110878657u, 3251297180u, 879739345u, 1073826194u, 3666797281u, 0, LOG10_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1074680111u, 1096100139u, 0, LOG10_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1075194070u, 876285134u, 0, LOG10_TOLERANCE, 0}, +{ 681, 1085961592u, 1761361082u, 3226030205u, 1121849716u, 1074701696u, 1547721169u, 0, LOG10_TOLERANCE, 0}, +{ 682, 1092603467u, 2534144722u, 1044223733u, 3512285706u, 1075240482u, 278021464u, 0, LOG10_TOLERANCE, 0}, +{ 683, 1064362429u, 4073670723u, 1050729852u, 3034818849u, 3221427291u, 4242826412u, 0, LOG10_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1075893286u, 292685601u, 0, LOG10_TOLERANCE, 0}, +{ 685, 1069938181u, 1649206019u, 1104525577u, 1267104290u, 3219685234u, 1620636761u, 0, LOG10_TOLERANCE, 0}, +{ 686, 1041818449u, 3775270392u, 1040251850u, 68667319u, 3223432597u, 1692181536u, 0, LOG10_TOLERANCE, 0}, +{ 687, 1056847252u, 3099226694u, 3254103006u, 4020102648u, 3222415726u, 634949558u, 0, LOG10_TOLERANCE, 0}, +{ 688, 1054108064u, 3718441177u, 3215643451u, 4032951536u, 3222618180u, 2193999680u, 0, LOG10_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 3223346611u, 4088292437u, 0, LOG10_TOLERANCE, 0}, +{ 690, 1051127979u, 2784738160u, 1073435430u, 1109346010u, 3222841630u, 809492040u, 0, LOG10_TOLERANCE, 0}, +{ 691, 1078241642u, 3331916473u, 3238794568u, 2707019594u, 1073339378u, 1164696438u, 0, LOG10_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1075290349u, 3560624908u, 0, LOG10_TOLERANCE, 0}, +{ 693, 1069098491u, 2135797997u, 1048399559u, 2941926126u, 3220185001u, 2767205362u, 0, LOG10_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 3223048633u, 3647005715u, 0, LOG10_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1072255974u, 1254607273u, 0, LOG10_TOLERANCE, 0}, +{ 696, 1100449215u, 3692175292u, 3197271515u, 3989064196u, 1075837440u, 2247367861u, 0, LOG10_TOLERANCE, 0}, +{ 697, 1104208090u, 3111924274u, 1066772558u, 59281695u, 1075977140u, 1062472240u, 0, LOG10_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 3220615013u, 2056251939u, 0, LOG10_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1075415588u, 3736433495u, 0, LOG10_TOLERANCE, 0}, +{ 700, 1055482282u, 330951080u, 1079189813u, 583922384u, 3222514463u, 2428577226u, 0, LOG10_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1075021506u, 849331440u, 0, LOG10_TOLERANCE, 0}, +{ 702, 1086945901u, 2072550721u, 3250147641u, 4280263530u, 1074820661u, 3054767438u, 0, LOG10_TOLERANCE, 0}, +{ 703, 1045489058u, 1566376352u, 1067251433u, 72984588u, 3223271005u, 1012625481u, 0, LOG10_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1075447946u, 3020783845u, 0, LOG10_TOLERANCE, 0}, +{ 705, 1069188845u, 1910366299u, 1081770885u, 634683073u, 3220144496u, 3237120090u, 0, LOG10_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1074036987u, 3618469334u, 0, LOG10_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1069816815u, 3917580686u, 0, LOG10_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 3220988290u, 2638241953u, 0, LOG10_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 3221095026u, 3487752196u, 0, LOG10_TOLERANCE, 0}, +{ 710, 1085665139u, 51750045u, 3242913901u, 4256866157u, 1074659005u, 1309342661u, 0, LOG10_TOLERANCE, 0}, +{ 711, 1047601319u, 2163853087u, 3232053146u, 2962422808u, 3223111635u, 4105270447u, 0, LOG10_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1072338175u, 1191839168u, 0, LOG10_TOLERANCE, 0}, +{ 713, 1099384354u, 357108214u, 3202294604u, 2306775262u, 1075757318u, 784133138u, 0, LOG10_TOLERANCE, 0}, +{ 714, 1054420438u, 2571356437u, 3249064063u, 2394851808u, 3222594288u, 2040763197u, 0, LOG10_TOLERANCE, 0}, +{ 715, 1083004443u, 4273880094u, 1103698617u, 3578832032u, 1074251723u, 2507069390u, 0, LOG10_TOLERANCE, 0}, +{ 716, 1085943053u, 2091068742u, 3228270226u, 3980489730u, 1074699248u, 3771564566u, 0, LOG10_TOLERANCE, 0}, +{ 717, 1081533104u, 2772307714u, 1051008486u, 32546576u, 1074037354u, 4044977501u, 0, LOG10_TOLERANCE, 0}, +{ 718, 1093745567u, 2143788498u, 3195498043u, 3630119231u, 1075328539u, 1114663423u, 0, LOG10_TOLERANCE, 0}, +{ 719, 1051149287u, 2527385594u, 3240503648u, 3482095012u, 3222840027u, 4027782605u, 0, LOG10_TOLERANCE, 0}, +{ 720, 1094685151u, 2690097362u, 1068598730u, 2360266862u, 1075397460u, 2132295436u, 0, LOG10_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 3222251927u, 3783282647u, 0, LOG10_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1075987296u, 2221010959u, 0, LOG10_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1075761372u, 4041298882u, 0, LOG10_TOLERANCE, 0}, +{ 724, 1073313068u, 31662602u, 1047721249u, 1747087514u, 1070190919u, 3275029946u, 0, LOG10_TOLERANCE, 0}, +{ 725, 1102980109u, 2489659568u, 1097051253u, 277506957u, 1075931234u, 1381810110u, 0, LOG10_TOLERANCE, 0}, +{ 726, 1043918186u, 3850162281u, 3213841942u, 438724093u, 3223353594u, 177091255u, 0, LOG10_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1075455856u, 2397269078u, 0, LOG10_TOLERANCE, 0}, +{ 728, 1095679087u, 391606792u, 1048184750u, 4168944276u, 1075473326u, 2611771655u, 0, LOG10_TOLERANCE, 0}, +{ 729, 1100308768u, 457529672u, 3201090276u, 72407935u, 1075826564u, 3785081567u, 0, LOG10_TOLERANCE, 0}, +{ 730, 1071237071u, 3954981400u, 1052053242u, 2411049585u, 3218687449u, 3595228211u, 0, LOG10_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1074728718u, 3913075270u, 0, LOG10_TOLERANCE, 0}, +{ 732, 1050750780u, 1551748070u, 3236871640u, 1329701152u, 3222874518u, 1520295316u, 0, LOG10_TOLERANCE, 0}, +{ 733, 1077155474u, 3099222537u, 1104984570u, 4293792842u, 1073010904u, 641483791u, 0, LOG10_TOLERANCE, 0}, +{ 734, 1056466057u, 3603065260u, 3197735968u, 2402359253u, 3222440074u, 683949067u, 0, LOG10_TOLERANCE, 0}, +{ 735, 1051340936u, 3961208159u, 3219057584u, 2340553876u, 3222826548u, 1086390675u, 0, LOG10_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1071934912u, 4044893289u, 0, LOG10_TOLERANCE, 0}, +{ 737, 1065792009u, 1403876392u, 3254028950u, 921363393u, 3221178696u, 593147272u, 0, LOG10_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1076091248u, 1873492489u, 0, LOG10_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 3222957594u, 1787304246u, 0, LOG10_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1071674723u, 2258814163u, 0, LOG10_TOLERANCE, 0}, +{ 741, 1068925634u, 1199568671u, 3225679997u, 46947405u, 3220235458u, 1823596182u, 0, LOG10_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1073164985u, 1843863539u, 0, LOG10_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 3220970855u, 409206651u, 0, LOG10_TOLERANCE, 0}, +{ 744, 1092425015u, 3347296825u, 1101507910u, 1254014794u, 1075230292u, 2900923068u, 0, LOG10_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1074417346u, 2601619170u, 0, LOG10_TOLERANCE, 0}, +{ 746, 1055716202u, 1832066983u, 1051358028u, 3262483417u, 3222499483u, 2726182442u, 0, LOG10_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1073132817u, 2760677315u, 0, LOG10_TOLERANCE, 0}, +{ 748, 1087990252u, 2497516122u, 3254374111u, 2821429629u, 1074899286u, 2094551578u, 0, LOG10_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1072737943u, 2025392479u, 0, LOG10_TOLERANCE, 0}, +{ 750, 1079425038u, 723423605u, 1084533420u, 627282213u, 1073698254u, 660177971u, 0, LOG10_TOLERANCE, 0}, +{ 751, 1068464032u, 4292778869u, 1078101071u, 1676860147u, 3220398575u, 4080177346u, 0, LOG10_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1072754098u, 2762983951u, 0, LOG10_TOLERANCE, 0}, +{ 753, 1045414231u, 1307010018u, 1061248120u, 1468743108u, 3223278089u, 2286340052u, 0, LOG10_TOLERANCE, 0}, +{ 754, 1099099491u, 107905661u, 3226089788u, 1943427674u, 1075733782u, 1870296517u, 0, LOG10_TOLERANCE, 0}, +{ 755, 1040746893u, 760006940u, 1054265604u, 1749976597u, 3223472861u, 3121291541u, 0, LOG10_TOLERANCE, 0}, +{ 756, 1090289736u, 2787503556u, 1081282610u, 1195841206u, 1075070165u, 3287006887u, 0, LOG10_TOLERANCE, 0}, +{ 757, 1044318508u, 545462045u, 3208381743u, 1981311808u, 3223341117u, 3439509787u, 0, LOG10_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 3221897616u, 2613738871u, 0, LOG10_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 3222936407u, 395246601u, 0, LOG10_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1072900573u, 2736825398u, 0, LOG10_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 3222515175u, 1334306044u, 0, LOG10_TOLERANCE, 0}, +{ 762, 1060018678u, 3007589929u, 3202026547u, 2792028313u, 3222080988u, 2398873954u, 0, LOG10_TOLERANCE, 0}, +{ 763, 1105599122u, 1866066996u, 1060329048u, 3727175322u, 1076031950u, 1117079653u, 0, LOG10_TOLERANCE, 0}, +{ 764, 1050932995u, 150890940u, 1056025306u, 3082724735u, 3222857445u, 31357167u, 0, LOG10_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 3221777807u, 656233594u, 0, LOG10_TOLERANCE, 0}, +{ 766, 1104156966u, 4050954182u, 3219263194u, 2537475930u, 1075974446u, 2527925082u, 0, LOG10_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 3221345318u, 2837332410u, 0, LOG10_TOLERANCE, 0}, +{ 768, 1101532656u, 440309030u, 3214267461u, 3788040806u, 1075878937u, 3943495913u, 0, LOG10_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1075839211u, 526175238u, 0, LOG10_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 3223422429u, 101990395u, 0, LOG10_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 3223149670u, 1483771049u, 0, LOG10_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 3222343590u, 4037954969u, 0, LOG10_TOLERANCE, 0}, +{ 773, 1055246165u, 2684353926u, 3205212854u, 1732474928u, 3222531892u, 2416203981u, 0, LOG10_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1075445114u, 1609704394u, 0, LOG10_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 3221600072u, 3702924123u, 0, LOG10_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 3221342227u, 1491358516u, 0, LOG10_TOLERANCE, 0}, +{ 777, 1057063924u, 841366493u, 1051716814u, 4121125128u, 3222398867u, 2304669873u, 0, LOG10_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 3221377628u, 1283733309u, 0, LOG10_TOLERANCE, 0}, +{ 779, 1098059015u, 799866606u, 3197637091u, 3924438208u, 1075655610u, 1105734641u, 0, LOG10_TOLERANCE, 0}, +{ 780, 1043579242u, 2002049816u, 1077053447u, 2240354761u, 3223366830u, 3458618238u, 0, LOG10_TOLERANCE, 0}, +{ 781, 1081522635u, 478939968u, 1097035749u, 1066716440u, 1074035759u, 4035027600u, 0, LOG10_TOLERANCE, 0}, +{ 782, 1084989993u, 1653104725u, 1088548129u, 81977716u, 1074553759u, 4216054447u, 0, LOG10_TOLERANCE, 0}, +{ 783, 1049377628u, 3899475018u, 3189694084u, 3330093036u, 3222975825u, 3582530778u, 0, LOG10_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1074995524u, 3038824780u, 0, LOG10_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1075844744u, 2684675728u, 0, LOG10_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 3222570381u, 3085201785u, 0, LOG10_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1073462543u, 772383770u, 0, LOG10_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1074049228u, 1399281699u, 0, LOG10_TOLERANCE, 0}, +{ 789, 1046346124u, 41779312u, 1081626342u, 831171823u, 3223205745u, 1896438613u, 0, LOG10_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 3222318124u, 1542994528u, 0, LOG10_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 3216285761u, 2951141520u, 0, LOG10_TOLERANCE, 0}, +{ 792, 1106952026u, 1894912556u, 1042426694u, 155024547u, 1076082261u, 3040158092u, 0, LOG10_TOLERANCE, 0}, +{ 793, 1047969864u, 35164295u, 3203391785u, 1037041084u, 3223079311u, 3308745497u, 0, LOG10_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1074525338u, 1563349431u, 0, LOG10_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 3220261276u, 1394670376u, 0, LOG10_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 3223211303u, 3595460321u, 0, LOG10_TOLERANCE, 0}, +{ 797, 1080040567u, 395145384u, 3219821938u, 50586510u, 1073799609u, 3433717707u, 0, LOG10_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 3219794186u, 1579634838u, 0, LOG10_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1074800003u, 2681601635u, 0, LOG10_TOLERANCE, 0}, +{ 800, 1070606742u, 344241827u, 1071538935u, 2715566077u, 3219333154u, 3754315639u, 0, LOG10_TOLERANCE, 0}, +{ 801, 1100099208u, 4069301823u, 3193208760u, 2949125229u, 1075808120u, 2852921220u, 0, LOG10_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1075941267u, 685999740u, 0, LOG10_TOLERANCE, 0}, +{ 803, 1046635308u, 709803845u, 1048741487u, 2296910194u, 3223182468u, 2740202815u, 0, LOG10_TOLERANCE, 0}, +{ 804, 1045797131u, 744421179u, 1069302001u, 2659232829u, 3223243060u, 2691168462u, 0, LOG10_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1075262838u, 2250803774u, 0, LOG10_TOLERANCE, 0}, +{ 806, 1058624854u, 145234164u, 3250614064u, 912384201u, 3222277940u, 674861709u, 0, LOG10_TOLERANCE, 0}, +{ 807, 1093027016u, 2784620507u, 1102812948u, 3531481022u, 1075278812u, 696134292u, 0, LOG10_TOLERANCE, 0}, +{ 808, 1103676015u, 383952592u, 3205659905u, 3633194728u, 1075959495u, 2755860393u, 0, LOG10_TOLERANCE, 0}, +{ 809, 1055992604u, 3792395543u, 1070072378u, 3864816376u, 3222480059u, 283896494u, 0, LOG10_TOLERANCE, 0}, +{ 810, 1057832625u, 2115553675u, 1066288499u, 3538377867u, 3222340506u, 3026544246u, 0, LOG10_TOLERANCE, 0}, +{ 811, 1104591537u, 1230026762u, 1090719723u, 440819880u, 1075994082u, 260264377u, 0, LOG10_TOLERANCE, 0}, +{ 812, 1047111428u, 2991290482u, 1096886719u, 1097971167u, 3223144560u, 2098613411u, 0, LOG10_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1075054429u, 58159371u, 0, LOG10_TOLERANCE, 0}, +{ 814, 1103573316u, 1719428427u, 3188631907u, 3707377409u, 1075955773u, 3449026054u, 0, LOG10_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 3222682971u, 1034783433u, 0, LOG10_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1074514634u, 3185048229u, 0, LOG10_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 3222693121u, 3443010324u, 0, LOG10_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 3218481792u, 518227657u, 0, LOG10_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1072074970u, 3577897135u, 0, LOG10_TOLERANCE, 0}, +{ 820, 1052824608u, 3315127889u, 3236295594u, 2900924954u, 3222719074u, 2027145852u, 0, LOG10_TOLERANCE, 0}, +{ 821, 1048942243u, 2246037502u, 1049691002u, 1496066550u, 3223006370u, 2295288876u, 0, LOG10_TOLERANCE, 0}, +{ 822, 1045523211u, 4191285446u, 3217936236u, 2382392789u, 3223267546u, 4168743981u, 0, LOG10_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1075262599u, 2090152878u, 0, LOG10_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1073784634u, 3165731196u, 0, LOG10_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1075555621u, 3856793281u, 0, LOG10_TOLERANCE, 0}, +{ 826, 1044065902u, 3797143370u, 3195497539u, 3843275034u, 3223348666u, 2069084644u, 0, LOG10_TOLERANCE, 0}, +{ 827, 1104593745u, 2806642640u, 3201943068u, 2515980718u, 1075994166u, 1674516539u, 0, LOG10_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1074815886u, 2637883203u, 0, LOG10_TOLERANCE, 0}, +{ 829, 1053496927u, 3309678799u, 1049337078u, 3056787074u, 3222664884u, 1775866686u, 0, LOG10_TOLERANCE, 0}, +{ 830, 1074011641u, 2341164249u, 1080834967u, 2810890005u, 1071227234u, 2256181049u, 0, LOG10_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 3220811269u, 995473316u, 0, LOG10_TOLERANCE, 0}, +{ 832, 1101746443u, 1367996113u, 3251723684u, 2974064663u, 1075886177u, 651743782u, 0, LOG10_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1073837316u, 2251952976u, 0, LOG10_TOLERANCE, 0}, +{ 834, 1088295228u, 4184941840u, 3196770014u, 2458988443u, 1074918429u, 3423367882u, 0, LOG10_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1074870511u, 3963545637u, 0, LOG10_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 3221465951u, 335272041u, 0, LOG10_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1074905197u, 1977171186u, 0, LOG10_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 3222717111u, 4126660092u, 0, LOG10_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 3222616495u, 4099715943u, 0, LOG10_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 3221460208u, 2109408512u, 0, LOG10_TOLERANCE, 0}, +{ 841, 1103793023u, 752664055u, 1065110394u, 1835931663u, 1075963459u, 685541286u, 0, LOG10_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1074902974u, 2047127981u, 0, LOG10_TOLERANCE, 0}, +{ 843, 1050651439u, 1636966254u, 1086098766u, 2016598298u, 3222883834u, 875865810u, 0, LOG10_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 3222857590u, 4082108263u, 0, LOG10_TOLERANCE, 0}, +{ 845, 1082348569u, 2977627788u, 1045339018u, 516058480u, 1074156718u, 2272896401u, 0, LOG10_TOLERANCE, 0}, +{ 846, 1089924930u, 3901731263u, 3189566462u, 32272932u, 1075045427u, 671782915u, 0, LOG10_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1073052628u, 3982968800u, 0, LOG10_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1075785807u, 113950622u, 0, LOG10_TOLERANCE, 0}, +{ 849, 1103446273u, 692989850u, 3242630588u, 2492225971u, 1075950805u, 818111655u, 0, LOG10_TOLERANCE, 0}, +{ 850, 1057995749u, 3439913962u, 1067477011u, 2973333638u, 3222331207u, 1303955608u, 0, LOG10_TOLERANCE, 0}, +{ 851, 1066510341u, 877613377u, 1044917899u, 809672798u, 3220977378u, 1845075850u, 0, LOG10_TOLERANCE, 0}, +{ 852, 1074687806u, 905426932u, 1046417457u, 1086320855u, 1071813024u, 2781073646u, 0, LOG10_TOLERANCE, 0}, +{ 853, 1098862981u, 2645567288u, 1051258339u, 557182478u, 1075712203u, 812148340u, 0, LOG10_TOLERANCE, 0}, +{ 854, 1056574302u, 186287752u, 1061342054u, 4054003419u, 3222432615u, 442298873u, 0, LOG10_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1075597949u, 538556539u, 0, LOG10_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 3223401105u, 2734375231u, 0, LOG10_TOLERANCE, 0}, +{ 857, 1096164025u, 368493885u, 3222871893u, 1419055230u, 1075514869u, 2281844850u, 0, LOG10_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1075197703u, 4020454285u, 0, LOG10_TOLERANCE, 0}, +{ 859, 1057942861u, 1239207795u, 1040192984u, 2199481342u, 3222334139u, 4169715069u, 0, LOG10_TOLERANCE, 0}, +{ 860, 1063494989u, 4264613432u, 3203460972u, 3558930895u, 3221550594u, 2166450280u, 0, LOG10_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 3222905003u, 765066117u, 0, LOG10_TOLERANCE, 0}, +{ 862, 1083259393u, 1077949160u, 1075769893u, 2405271377u, 1074288330u, 3619654319u, 0, LOG10_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1075188133u, 2430026858u, 0, LOG10_TOLERANCE, 0}, +{ 864, 1051133505u, 1518334131u, 3205247482u, 791756713u, 3222841212u, 2201383808u, 0, LOG10_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 3223131399u, 1781924118u, 0, LOG10_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1075799916u, 2273546640u, 0, LOG10_TOLERANCE, 0}, +{ 867, 1068907602u, 247369460u, 3197320093u, 687450958u, 3220241058u, 4195955112u, 0, LOG10_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1075974686u, 2110125726u, 0, LOG10_TOLERANCE, 0}, +{ 869, 1060614787u, 1845900544u, 3231520830u, 3389751458u, 3221981380u, 1451399181u, 0, LOG10_TOLERANCE, 0}, +{ 870, 1100051597u, 737689911u, 3195377751u, 3462616966u, 1075803478u, 929679035u, 0, LOG10_TOLERANCE, 0}, +{ 871, 1076054736u, 3620285831u, 1055501023u, 2708056059u, 1072660433u, 2509134029u, 0, LOG10_TOLERANCE, 0}, +{ 872, 1071981348u, 4073430285u, 1056206159u, 172017902u, 3217493387u, 977702324u, 0, LOG10_TOLERANCE, 0}, +{ 873, 1065385990u, 2799176222u, 1052706894u, 4083892667u, 3221274672u, 4016902187u, 0, LOG10_TOLERANCE, 0}, +{ 874, 1054795909u, 1562351330u, 1069705601u, 1247765260u, 3222570948u, 1552306542u, 0, LOG10_TOLERANCE, 0}, +{ 875, 1085233651u, 51853475u, 3189080201u, 2783553144u, 1074582502u, 856854528u, 0, LOG10_TOLERANCE, 0}, +{ 876, 1071970705u, 3851781549u, 3241598113u, 514064046u, 3217521485u, 3650940125u, 0, LOG10_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1075802916u, 1421123339u, 0, LOG10_TOLERANCE, 0}, +{ 878, 1065598845u, 2948648757u, 3232177250u, 4278702895u, 3221233759u, 858150767u, 0, LOG10_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 3215403890u, 4183169085u, 0, LOG10_TOLERANCE, 0}, +{ 880, 1050591911u, 3891230598u, 1095924595u, 3049217547u, 3222887147u, 1338942792u, 0, LOG10_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1073074581u, 3592504291u, 0, LOG10_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 3221979956u, 1165041488u, 0, LOG10_TOLERANCE, 0}, +{ 883, 1080223688u, 2126253040u, 3207248026u, 808507485u, 1073836025u, 4006752466u, 0, LOG10_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1074718001u, 2173078304u, 0, LOG10_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1075927696u, 2549577293u, 0, LOG10_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 3221326260u, 3476238897u, 0, LOG10_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1071625565u, 3112805610u, 0, LOG10_TOLERANCE, 0}, +{ 888, 1065945517u, 3744663425u, 3212482771u, 953662066u, 3221133966u, 2461525298u, 0, LOG10_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1074575486u, 506637444u, 0, LOG10_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 3223054489u, 2402197835u, 0, LOG10_TOLERANCE, 0}, +{ 891, 1096464829u, 606044282u, 3241318094u, 2446416887u, 1075536321u, 4109023068u, 0, LOG10_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 3223439693u, 2314837685u, 0, LOG10_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 3222281931u, 1348167011u, 0, LOG10_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 3223334914u, 3999609662u, 0, LOG10_TOLERANCE, 0}, +{ 895, 1042020446u, 4099522736u, 3232742168u, 3718083858u, 3223425951u, 1041051776u, 0, LOG10_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1075227036u, 2513130381u, 0, LOG10_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1076013298u, 2773793754u, 0, LOG10_TOLERANCE, 0}, +{ 898, 1091529166u, 2462163405u, 3218946201u, 3876535372u, 1075160155u, 262248220u, 0, LOG10_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1074462670u, 1099362184u, 0, LOG10_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 3222745935u, 1380494767u, 0, LOG10_TOLERANCE, 0}, +{ 901, 1045799308u, 2533012202u, 1079980803u, 3592268374u, 3223242885u, 2684476530u, 0, LOG10_TOLERANCE, 0}, +{ 902, 1055881132u, 4108274117u, 1063045844u, 571992389u, 3222489993u, 3494391159u, 0, LOG10_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1075088468u, 1540713558u, 0, LOG10_TOLERANCE, 0}, +{ 904, 1046496395u, 1213941007u, 1105433735u, 2172963370u, 3223196412u, 3319524204u, 0, LOG10_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1075561388u, 4126415854u, 0, LOG10_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1075467816u, 74630356u, 0, LOG10_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1074371492u, 2456721468u, 0, LOG10_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1075349738u, 1619572370u, 0, LOG10_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1072856003u, 3966425243u, 0, LOG10_TOLERANCE, 0}, +{ 910, 1104810967u, 2983070435u, 1089546472u, 2907918480u, 1076001904u, 2260517137u, 0, LOG10_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1074249782u, 741500836u, 0, LOG10_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 3223461247u, 1110171873u, 0, LOG10_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 3223132005u, 933703128u, 0, LOG10_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1073814982u, 1891659777u, 0, LOG10_TOLERANCE, 0}, +{ 915, 1078806678u, 176522478u, 1069999908u, 2891249491u, 1073498191u, 442688633u, 0, LOG10_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 3223367478u, 557452820u, 0, LOG10_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 3223494206u, 3626267569u, 0, LOG10_TOLERANCE, 0}, +{ 918, 1044013141u, 3819109588u, 1048561488u, 969143351u, 3223350377u, 4068494919u, 0, LOG10_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 3213304592u, 3497819754u, 0, LOG10_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 3223074190u, 1541831713u, 0, LOG10_TOLERANCE, 0}, +{ 921, 1083983658u, 4189906558u, 3203004203u, 854242364u, 1074401183u, 2633113722u, 0, LOG10_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1075967176u, 539495337u, 0, LOG10_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 3223236309u, 1250724029u, 0, LOG10_TOLERANCE, 0}, +{ 924, 1074889038u, 1794845306u, 1104879344u, 4135865182u, 1071940589u, 4081733314u, 0, LOG10_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1076063011u, 897095638u, 0, LOG10_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1070665179u, 3094080775u, 0, LOG10_TOLERANCE, 0}, +{ 927, 1083965546u, 567588900u, 3195452230u, 1421366017u, 1074398947u, 1052576918u, 0, LOG10_TOLERANCE, 0}, +{ 928, 1077606107u, 2708717091u, 1071975971u, 1364590470u, 1073144962u, 4187422802u, 0, LOG10_TOLERANCE, 0}, +{ 929, 1104653635u, 3461956134u, 3207820115u, 1605709634u, 1075996406u, 4280267022u, 0, LOG10_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 3221287199u, 3332961944u, 0, LOG10_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 3222289211u, 514998812u, 0, LOG10_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 3222379236u, 1543783481u, 0, LOG10_TOLERANCE, 0}, +{ 933, 1042153283u, 851569132u, 1058503154u, 1399378677u, 3223421968u, 3228314542u, 0, LOG10_TOLERANCE, 0}, +{ 934, 1086054049u, 3897202342u, 3245382590u, 246600375u, 1074713524u, 2112897030u, 0, LOG10_TOLERANCE, 0}, +{ 935, 1077976660u, 3620429520u, 1055627557u, 229305u, 1073240207u, 2697183834u, 0, LOG10_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1074398112u, 3772639712u, 0, LOG10_TOLERANCE, 0}, +{ 937, 1080324787u, 32766320u, 1062084905u, 3668443038u, 1073853886u, 1022794505u, 0, LOG10_TOLERANCE, 0}, +{ 938, 1075815348u, 2039713492u, 3248699388u, 1346210821u, 1072479693u, 1831222428u, 0, LOG10_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1075280592u, 1598478647u, 0, LOG10_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 3221858437u, 3297267625u, 0, LOG10_TOLERANCE, 0}, +{ 941, 1043911539u, 2372623300u, 3210185343u, 3200572848u, 3223353826u, 595580091u, 0, LOG10_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1075849760u, 1939640096u, 0, LOG10_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 3221743475u, 3320081474u, 0, LOG10_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 3222388573u, 2581083904u, 0, LOG10_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1075146843u, 300857787u, 0, LOG10_TOLERANCE, 0}, +{ 946, 1098953963u, 142942404u, 1075322987u, 1746449109u, 1075719574u, 3783378795u, 0, LOG10_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1075970042u, 121673326u, 0, LOG10_TOLERANCE, 0}, +{ 948, 1102741893u, 2999955409u, 3222793392u, 1868977643u, 1075923918u, 4041909473u, 0, LOG10_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1071609002u, 3568808289u, 0, LOG10_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 3220456229u, 2608711226u, 0, LOG10_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1075081403u, 4130761195u, 0, LOG10_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 3220495553u, 2350869612u, 0, LOG10_TOLERANCE, 0}, +{ 953, 1061001026u, 938869114u, 1087911145u, 2416710759u, 3221930808u, 1742268548u, 0, LOG10_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1075467395u, 1803897185u, 0, LOG10_TOLERANCE, 0}, +{ 955, 1090245139u, 1337895935u, 1076463812u, 1172733328u, 1075067414u, 2255894230u, 0, LOG10_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 3222991480u, 3413880326u, 0, LOG10_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1071368716u, 319414877u, 0, LOG10_TOLERANCE, 0}, +{ 958, 1094655132u, 2976596113u, 3192137295u, 3033242648u, 1075395796u, 2395640658u, 0, LOG10_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1075702692u, 868384370u, 0, LOG10_TOLERANCE, 0}, +{ 960, 1094287162u, 4007797282u, 3225853845u, 4069319648u, 1075373137u, 4114988772u, 0, LOG10_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 3223133682u, 2793605649u, 0, LOG10_TOLERANCE, 0}, +{ 962, 1070128056u, 200857661u, 3229758439u, 3359367736u, 3219572368u, 3230745583u, 0, LOG10_TOLERANCE, 0}, +{ 963, 1101314221u, 111868139u, 3227902082u, 2366064003u, 1075870447u, 2315533989u, 0, LOG10_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 3223344678u, 3470538208u, 0, LOG10_TOLERANCE, 0}, +{ 965, 1095192067u, 789151814u, 1099269239u, 2958956055u, 1075441815u, 3485815747u, 0, LOG10_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1074510908u, 798696848u, 0, LOG10_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 3223187218u, 4027511879u, 0, LOG10_TOLERANCE, 0}, +{ 968, 1050400412u, 3838689849u, 3198769679u, 1302617170u, 3222898510u, 3604128999u, 0, LOG10_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1074698697u, 3398399993u, 0, LOG10_TOLERANCE, 0}, +{ 970, 1052057157u, 3502371499u, 1043411944u, 4190072016u, 3222772137u, 3563735668u, 0, LOG10_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 3221370452u, 329675828u, 0, LOG10_TOLERANCE, 0}, +{ 972, 1046031308u, 3653237931u, 3204255012u, 3683870669u, 3223225630u, 580955093u, 0, LOG10_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 3222659153u, 523959117u, 0, LOG10_TOLERANCE, 0}, +{ 974, 1095020203u, 558292492u, 1051772749u, 4267873474u, 1075428224u, 3675331960u, 0, LOG10_TOLERANCE, 0}, +{ 975, 1077289061u, 509637100u, 3212030069u, 215050379u, 1073054916u, 371002261u, 0, LOG10_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1075205875u, 2766467475u, 0, LOG10_TOLERANCE, 0}, +{ 977, 1067315689u, 998858159u, 1063077962u, 436029885u, 3220736810u, 2451000458u, 0, LOG10_TOLERANCE, 0}, +{ 978, 1058463317u, 996300405u, 3193842624u, 80548098u, 3222289593u, 3378863163u, 0, LOG10_TOLERANCE, 0}, +{ 979, 1081365192u, 3876129407u, 3215332180u, 2226970413u, 1074010320u, 899697228u, 0, LOG10_TOLERANCE, 0}, +{ 980, 1090125305u, 200013509u, 3224552716u, 414878724u, 1075059674u, 2493730227u, 0, LOG10_TOLERANCE, 0}, +{ 981, 1083133445u, 309319541u, 1048979765u, 1261662434u, 1074266510u, 2927407487u, 0, LOG10_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1074991950u, 404883066u, 0, LOG10_TOLERANCE, 0}, +{ 983, 1088652436u, 1611969213u, 1053890378u, 3774617276u, 1074948148u, 2175758408u, 0, LOG10_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1073868364u, 979639357u, 0, LOG10_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 3223443010u, 1613812740u, 0, LOG10_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 3222685145u, 1827889021u, 0, LOG10_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1075017608u, 1612357925u, 0, LOG10_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 3222106899u, 1393779995u, 0, LOG10_TOLERANCE, 0}, +{ 989, 1045672057u, 659070058u, 1073095700u, 1393632068u, 3223253593u, 999146267u, 0, LOG10_TOLERANCE, 0}, +{ 990, 1070199615u, 4276187829u, 3217553330u, 1868253275u, 3219533215u, 3230946523u, 0, LOG10_TOLERANCE, 0}, +{ 991, 1075736624u, 2085481575u, 3215994784u, 800910002u, 1072444440u, 3989888399u, 0, LOG10_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 3222410797u, 3829821005u, 0, LOG10_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 3222360045u, 3676911858u, 0, LOG10_TOLERANCE, 0}, +{ 994, 1053355602u, 3792931748u, 3204857863u, 804393211u, 3222674329u, 223063370u, 0, LOG10_TOLERANCE, 0}, +{ 995, 1106162722u, 3430071177u, 3226288311u, 3652522729u, 1076050657u, 1188151311u, 0, LOG10_TOLERANCE, 0}, +{ 996, 1053831054u, 236884699u, 3227874605u, 2193269825u, 3222644595u, 2414521413u, 0, LOG10_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 3221332108u, 3768168054u, 0, LOG10_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1074402699u, 1446789637u, 0, LOG10_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1075337269u, 2939813565u, 0, LOG10_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_LOG10_H multiple inclusion protection + +// EOF log10.h diff --git a/packages/language/c/libm/current/tests/vectors/modf.c b/packages/language/c/libm/current/tests/vectors/modf.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/modf.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// modf.c +// +// Test of modf() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/modf.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(modf_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &modf, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_DOUBLE_P, CYG_LIBM_TEST_VEC_DOUBLE, + &modf_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("modf() is stable"); + } // if + else + { + CYG_TEST_FAIL("modf() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library modf() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "modf() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF modf.c diff --git a/packages/language/c/libm/current/tests/vectors/modf.h b/packages/language/c/libm/current/tests/vectors/modf.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/modf.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_MODF_H +#define CYGONCE_LIBM_MODF_H +//=========================================================================== +// +// modf.h +// +// Test vectors for testing of modf() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/modf.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define MODF_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t modf_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1077968896u, 0u, 1072532261u, 1520617472u, 0, MODF_TOLERANCE, 0}, +{ 2, 1090024059u, 3619148316u, 1090024048u, 0u, 1072148335u, 2755133440u, 0, MODF_TOLERANCE, 0}, +{ 3, 3218153654u, 3176730980u, 2147483648u, 0u, 3218153654u, 3176730980u, 0, MODF_TOLERANCE, 0}, +{ 4, 1051524793u, 2993920299u, 0u, 0u, 1051524793u, 2993920299u, 0, MODF_TOLERANCE, 0}, +{ 5, 3239659803u, 2725707538u, 3239659800u, 0u, 3219985335u, 4170186752u, 0, MODF_TOLERANCE, 0}, +{ 6, 3232101343u, 2346810316u, 3232100864u, 0u, 3220043966u, 398245888u, 0, MODF_TOLERANCE, 0}, +{ 7, 1092554362u, 2088062470u, 1092554360u, 0u, 1071899562u, 1882193920u, 0, MODF_TOLERANCE, 0}, +{ 8, 3201242716u, 420891118u, 2147483648u, 0u, 3201242716u, 420891118u, 0, MODF_TOLERANCE, 0}, +{ 9, 3221200677u, 2636405208u, 3220176896u, 0u, 3220127307u, 977843120u, 0, MODF_TOLERANCE, 0}, +{ 10, 1100049309u, 471635570u, 1100049309u, 469762048u, 1067226738u, 0u, 0, MODF_TOLERANCE, 0}, +{ 11, 1089363191u, 1746012320u, 1089363168u, 0u, 1072130066u, 144703488u, 0, MODF_TOLERANCE, 0}, +{ 12, 1054478713u, 3333988501u, 0u, 0u, 1054478713u, 3333988501u, 0, MODF_TOLERANCE, 0}, +{ 13, 1047953160u, 183014794u, 0u, 0u, 1047953160u, 183014794u, 0, MODF_TOLERANCE, 0}, +{ 14, 3202039382u, 2016785810u, 2147483648u, 0u, 3202039382u, 2016785810u, 0, MODF_TOLERANCE, 0}, +{ 15, 3213486034u, 2688957927u, 2147483648u, 0u, 3213486034u, 2688957927u, 0, MODF_TOLERANCE, 0}, +{ 16, 1046089230u, 2709029994u, 0u, 0u, 1046089230u, 2709029994u, 0, MODF_TOLERANCE, 0}, +{ 17, 1058795730u, 624574473u, 0u, 0u, 1058795730u, 624574473u, 0, MODF_TOLERANCE, 0}, +{ 18, 1045840574u, 3473266330u, 0u, 0u, 1045840574u, 3473266330u, 0, MODF_TOLERANCE, 0}, +{ 19, 3204919842u, 1605286142u, 2147483648u, 0u, 3204919842u, 1605286142u, 0, MODF_TOLERANCE, 0}, +{ 20, 1068931671u, 4233776869u, 0u, 0u, 1068931671u, 4233776869u, 0, MODF_TOLERANCE, 0}, +{ 21, 1060343410u, 1857607719u, 0u, 0u, 1060343410u, 1857607719u, 0, MODF_TOLERANCE, 0}, +{ 22, 3222889559u, 3417070006u, 3222798336u, 0u, 3218490748u, 3133512544u, 0, MODF_TOLERANCE, 0}, +{ 23, 1103599987u, 3981151660u, 1103599987u, 3976200192u, 1071833963u, 0u, 0, MODF_TOLERANCE, 0}, +{ 24, 1088899021u, 1332651746u, 1088899008u, 0u, 1071292125u, 1304690688u, 0, MODF_TOLERANCE, 0}, +{ 25, 1085298022u, 3824988054u, 1085297920u, 0u, 1071233279u, 736460800u, 0, MODF_TOLERANCE, 0}, +{ 26, 1066856791u, 2070129652u, 0u, 0u, 1066856791u, 2070129652u, 0, MODF_TOLERANCE, 0}, +{ 27, 3207559790u, 1372884064u, 2147483648u, 0u, 3207559790u, 1372884064u, 0, MODF_TOLERANCE, 0}, +{ 28, 1080833116u, 3229926662u, 1080827904u, 0u, 1071930560u, 2227504640u, 0, MODF_TOLERANCE, 0}, +{ 29, 1093826501u, 3217805330u, 1093826501u, 0u, 1072167290u, 37748736u, 0, MODF_TOLERANCE, 0}, +{ 30, 3191644264u, 2014578707u, 2147483648u, 0u, 3191644264u, 2014578707u, 0, MODF_TOLERANCE, 0}, +{ 31, 1102287487u, 265058758u, 1102287487u, 251658240u, 1072271160u, 3221225472u, 0, MODF_TOLERANCE, 0}, +{ 32, 3239903247u, 1630600647u, 3239903244u, 0u, 3219851655u, 3996647424u, 0, MODF_TOLERANCE, 0}, +{ 33, 1071124229u, 1946677669u, 0u, 0u, 1071124229u, 1946677669u, 0, MODF_TOLERANCE, 0}, +{ 34, 3198462609u, 926009897u, 2147483648u, 0u, 3198462609u, 926009897u, 0, MODF_TOLERANCE, 0}, +{ 35, 1072130299u, 2271884183u, 0u, 0u, 1072130299u, 2271884183u, 0, MODF_TOLERANCE, 0}, +{ 36, 3203741999u, 2118617783u, 2147483648u, 0u, 3203741999u, 2118617783u, 0, MODF_TOLERANCE, 0}, +{ 37, 3194849109u, 213658772u, 2147483648u, 0u, 3194849109u, 213658772u, 0, MODF_TOLERANCE, 0}, +{ 38, 3249401130u, 314151656u, 3249401130u, 301989888u, 3218551389u, 0u, 0, MODF_TOLERANCE, 0}, +{ 39, 3254112288u, 1564829925u, 3254112288u, 1564475392u, 3218449300u, 0u, 0, MODF_TOLERANCE, 0}, +{ 40, 3197817016u, 497230814u, 2147483648u, 0u, 3197817016u, 497230814u, 0, MODF_TOLERANCE, 0}, +{ 41, 3216262634u, 2075329122u, 2147483648u, 0u, 3216262634u, 2075329122u, 0, MODF_TOLERANCE, 0}, +{ 42, 3231746400u, 169900577u, 3231746048u, 0u, 3219521698u, 128061440u, 0, MODF_TOLERANCE, 0}, +{ 43, 1049848642u, 541549344u, 0u, 0u, 1049848642u, 541549344u, 0, MODF_TOLERANCE, 0}, +{ 44, 1096608669u, 3119070100u, 1096608669u, 2147483648u, 1072493725u, 3388997632u, 0, MODF_TOLERANCE, 0}, +{ 45, 1085427055u, 567496114u, 1085426944u, 0u, 1071368308u, 3547103232u, 0, MODF_TOLERANCE, 0}, +{ 46, 1045286891u, 1969998540u, 0u, 0u, 1045286891u, 1969998540u, 0, MODF_TOLERANCE, 0}, +{ 47, 1060548195u, 1299369769u, 0u, 0u, 1060548195u, 1299369769u, 0, MODF_TOLERANCE, 0}, +{ 48, 1049342524u, 4167404066u, 0u, 0u, 1049342524u, 4167404066u, 0, MODF_TOLERANCE, 0}, +{ 49, 3208865645u, 3348930841u, 2147483648u, 0u, 3208865645u, 3348930841u, 0, MODF_TOLERANCE, 0}, +{ 50, 1078472138u, 358457347u, 1078460416u, 0u, 1071047946u, 2932867456u, 0, MODF_TOLERANCE, 0}, +{ 51, 1071069297u, 2192461366u, 0u, 0u, 1071069297u, 2192461366u, 0, MODF_TOLERANCE, 0}, +{ 52, 1099527247u, 3184735642u, 1099527247u, 3087007744u, 1072123094u, 1744830464u, 0, MODF_TOLERANCE, 0}, +{ 53, 1052861772u, 331696577u, 0u, 0u, 1052861772u, 331696577u, 0, MODF_TOLERANCE, 0}, +{ 54, 3189610016u, 793242270u, 2147483648u, 0u, 3189610016u, 793242270u, 0, MODF_TOLERANCE, 0}, +{ 55, 3252528934u, 2322696981u, 3252528934u, 2319450112u, 3219703178u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 56, 1083791358u, 3020766674u, 1083790336u, 0u, 1072690592u, 1777242112u, 0, MODF_TOLERANCE, 0}, +{ 57, 1044902177u, 252085215u, 0u, 0u, 1044902177u, 252085215u, 0, MODF_TOLERANCE, 0}, +{ 58, 3214426435u, 4139068910u, 2147483648u, 0u, 3214426435u, 4139068910u, 0, MODF_TOLERANCE, 0}, +{ 59, 3222505725u, 105589263u, 3222274048u, 0u, 3219933160u, 844714104u, 0, MODF_TOLERANCE, 0}, +{ 60, 1056316170u, 261630827u, 0u, 0u, 1056316170u, 261630827u, 0, MODF_TOLERANCE, 0}, +{ 61, 1107213408u, 428765703u, 1107213408u, 427819008u, 1072489486u, 0u, 0, MODF_TOLERANCE, 0}, +{ 62, 3251828686u, 2009972239u, 3251828686u, 2009071616u, 3217783838u, 0u, 0, MODF_TOLERANCE, 0}, +{ 63, 1098568019u, 3517376586u, 1098568019u, 3489660928u, 1069182596u, 2684354560u, 0, MODF_TOLERANCE, 0}, +{ 64, 3240257920u, 3304487302u, 3240257920u, 0u, 3218644687u, 817889280u, 0, MODF_TOLERANCE, 0}, +{ 65, 3233537912u, 237004814u, 3233537792u, 0u, 3218998152u, 436436992u, 0, MODF_TOLERANCE, 0}, +{ 66, 3237899261u, 3364008659u, 3237899248u, 0u, 3219886341u, 1705377792u, 0, MODF_TOLERANCE, 0}, +{ 67, 3195247552u, 472004928u, 2147483648u, 0u, 3195247552u, 472004928u, 0, MODF_TOLERANCE, 0}, +{ 68, 3226869477u, 1186387580u, 3226861568u, 0u, 3219055942u, 3067509760u, 0, MODF_TOLERANCE, 0}, +{ 69, 1054226850u, 4085763910u, 0u, 0u, 1054226850u, 4085763910u, 0, MODF_TOLERANCE, 0}, +{ 70, 1106394906u, 2684738273u, 1106394906u, 2684354560u, 1071082372u, 0u, 0, MODF_TOLERANCE, 0}, +{ 71, 1057053639u, 2055490142u, 0u, 0u, 1057053639u, 2055490142u, 0, MODF_TOLERANCE, 0}, +{ 72, 3231581370u, 3879040079u, 3231581184u, 0u, 3217513702u, 2928271360u, 0, MODF_TOLERANCE, 0}, +{ 73, 3188976647u, 3725731239u, 2147483648u, 0u, 3188976647u, 3725731239u, 0, MODF_TOLERANCE, 0}, +{ 74, 1061652681u, 591292963u, 0u, 0u, 1061652681u, 591292963u, 0, MODF_TOLERANCE, 0}, +{ 75, 3225014981u, 1147041027u, 3224961024u, 0u, 3219806376u, 2345574496u, 0, MODF_TOLERANCE, 0}, +{ 76, 3215417793u, 624695933u, 2147483648u, 0u, 3215417793u, 624695933u, 0, MODF_TOLERANCE, 0}, +{ 77, 3206052774u, 705725219u, 2147483648u, 0u, 3206052774u, 705725219u, 0, MODF_TOLERANCE, 0}, +{ 78, 3238067573u, 1116238321u, 3238067568u, 0u, 3219458593u, 3351511040u, 0, MODF_TOLERANCE, 0}, +{ 79, 3207367088u, 7287411u, 2147483648u, 0u, 3207367088u, 7287411u, 0, MODF_TOLERANCE, 0}, +{ 80, 1045917232u, 116067742u, 0u, 0u, 1045917232u, 116067742u, 0, MODF_TOLERANCE, 0}, +{ 81, 3240055222u, 3604989074u, 3240055220u, 0u, 3219568382u, 613416960u, 0, MODF_TOLERANCE, 0}, +{ 82, 1066381836u, 545298780u, 0u, 0u, 1066381836u, 545298780u, 0, MODF_TOLERANCE, 0}, +{ 83, 3219080936u, 1681476121u, 2147483648u, 0u, 3219080936u, 1681476121u, 0, MODF_TOLERANCE, 0}, +{ 84, 1060345752u, 3553822398u, 0u, 0u, 1060345752u, 3553822398u, 0, MODF_TOLERANCE, 0}, +{ 85, 1102831658u, 3410480388u, 1102831658u, 3405774848u, 1070723905u, 0u, 0, MODF_TOLERANCE, 0}, +{ 86, 1052460275u, 1660607230u, 0u, 0u, 1052460275u, 1660607230u, 0, MODF_TOLERANCE, 0}, +{ 87, 1089216869u, 1494984673u, 1089216864u, 0u, 1069900910u, 2676228096u, 0, MODF_TOLERANCE, 0}, +{ 88, 3196647153u, 287894723u, 2147483648u, 0u, 3196647153u, 287894723u, 0, MODF_TOLERANCE, 0}, +{ 89, 1054885127u, 644548665u, 0u, 0u, 1054885127u, 644548665u, 0, MODF_TOLERANCE, 0}, +{ 90, 1081948134u, 2442134629u, 1081946112u, 0u, 1071618630u, 1074893824u, 0, MODF_TOLERANCE, 0}, +{ 91, 1087554095u, 2312530895u, 1087554048u, 0u, 1072153835u, 904364032u, 0, MODF_TOLERANCE, 0}, +{ 92, 3221584595u, 3379665576u, 3221225472u, 0u, 3219516239u, 633760416u, 0, MODF_TOLERANCE, 0}, +{ 93, 1096085375u, 3018463866u, 1096085375u, 2147483648u, 1072297229u, 1023410176u, 0, MODF_TOLERANCE, 0}, +{ 94, 1086226574u, 404012923u, 1086226432u, 0u, 1071760130u, 2549047296u, 0, MODF_TOLERANCE, 0}, +{ 95, 1064733299u, 1710279345u, 0u, 0u, 1064733299u, 1710279345u, 0, MODF_TOLERANCE, 0}, +{ 96, 3251401196u, 3528946000u, 3251401196u, 3523215360u, 3219512404u, 0u, 0, MODF_TOLERANCE, 0}, +{ 97, 1061536351u, 2164450219u, 0u, 0u, 1061536351u, 2164450219u, 0, MODF_TOLERANCE, 0}, +{ 98, 1083520023u, 3312018966u, 1083520000u, 0u, 1066911081u, 1712717824u, 0, MODF_TOLERANCE, 0}, +{ 99, 1057248676u, 2648986431u, 0u, 0u, 1057248676u, 2648986431u, 0, MODF_TOLERANCE, 0}, +{ 100, 1050330591u, 1474376550u, 0u, 0u, 1050330591u, 1474376550u, 0, MODF_TOLERANCE, 0}, +{ 101, 3194422028u, 1839068700u, 2147483648u, 0u, 3194422028u, 1839068700u, 0, MODF_TOLERANCE, 0}, +{ 102, 1077406406u, 3013052171u, 1077346304u, 0u, 1072519382u, 1928388960u, 0, MODF_TOLERANCE, 0}, +{ 103, 1046493630u, 772102380u, 0u, 0u, 1046493630u, 772102380u, 0, MODF_TOLERANCE, 0}, +{ 104, 3220729740u, 4219039958u, 3220176896u, 0u, 3219185433u, 4143112620u, 0, MODF_TOLERANCE, 0}, +{ 105, 3229472221u, 3058618779u, 3229470720u, 0u, 3218568921u, 994470912u, 0, MODF_TOLERANCE, 0}, +{ 106, 1046304788u, 3338676024u, 0u, 0u, 1046304788u, 3338676024u, 0, MODF_TOLERANCE, 0}, +{ 107, 1051172137u, 506286854u, 0u, 0u, 1051172137u, 506286854u, 0, MODF_TOLERANCE, 0}, +{ 108, 1094907481u, 2217000199u, 1094907481u, 2147483648u, 1067487988u, 469762048u, 0, MODF_TOLERANCE, 0}, +{ 109, 1082428310u, 1147428263u, 1082427392u, 0u, 1071428131u, 585971712u, 0, MODF_TOLERANCE, 0}, +{ 110, 1065432625u, 3034786717u, 0u, 0u, 1065432625u, 3034786717u, 0, MODF_TOLERANCE, 0}, +{ 111, 1082016752u, 2844125311u, 1082015744u, 0u, 1070564684u, 792983552u, 0, MODF_TOLERANCE, 0}, +{ 112, 1082985198u, 2561492677u, 1082984448u, 0u, 1071084741u, 1781934080u, 0, MODF_TOLERANCE, 0}, +{ 113, 3211536916u, 704542600u, 2147483648u, 0u, 3211536916u, 704542600u, 0, MODF_TOLERANCE, 0}, +{ 114, 3222902057u, 2762779203u, 3222798336u, 0u, 3218690714u, 1254794288u, 0, MODF_TOLERANCE, 0}, +{ 115, 3199680614u, 184131949u, 2147483648u, 0u, 3199680614u, 184131949u, 0, MODF_TOLERANCE, 0}, +{ 116, 3249723525u, 1667366082u, 3249723525u, 1660944384u, 3218636592u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 117, 3223609598u, 3904224140u, 3223584768u, 0u, 3217571770u, 762241792u, 0, MODF_TOLERANCE, 0}, +{ 118, 1067056698u, 2942159914u, 0u, 0u, 1067056698u, 2942159914u, 0, MODF_TOLERANCE, 0}, +{ 119, 1100636863u, 426114282u, 1100636863u, 402653184u, 1071013838u, 2684354560u, 0, MODF_TOLERANCE, 0}, +{ 120, 3209056785u, 1083606355u, 2147483648u, 0u, 3209056785u, 1083606355u, 0, MODF_TOLERANCE, 0}, +{ 121, 1106165945u, 3774123863u, 1106165945u, 3772776448u, 1071943511u, 0u, 0, MODF_TOLERANCE, 0}, +{ 122, 1106787580u, 2722107965u, 1106787580u, 2722103296u, 1064451328u, 0u, 0, MODF_TOLERANCE, 0}, +{ 123, 1088005092u, 1377734762u, 1088005056u, 0u, 1071786255u, 1211432960u, 0, MODF_TOLERANCE, 0}, +{ 124, 1104232051u, 2377063483u, 1104232051u, 2373976064u, 1072139805u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 125, 1069380559u, 1029739074u, 0u, 0u, 1069380559u, 1029739074u, 0, MODF_TOLERANCE, 0}, +{ 126, 1105467109u, 3062201018u, 1105467109u, 3061841920u, 1069935336u, 0u, 0, MODF_TOLERANCE, 0}, +{ 127, 3234741597u, 773857656u, 3234741504u, 0u, 3219606408u, 140378112u, 0, MODF_TOLERANCE, 0}, +{ 128, 3214251949u, 335833884u, 2147483648u, 0u, 3214251949u, 335833884u, 0, MODF_TOLERANCE, 0}, +{ 129, 3203224610u, 1473865960u, 2147483648u, 0u, 3203224610u, 1473865960u, 0, MODF_TOLERANCE, 0}, +{ 130, 1103073830u, 4000427507u, 1103073830u, 3992977408u, 1071410044u, 3221225472u, 0, MODF_TOLERANCE, 0}, +{ 131, 1103185231u, 4242092620u, 1103185231u, 4236247040u, 1072057491u, 0u, 0, MODF_TOLERANCE, 0}, +{ 132, 1067009473u, 14539161u, 0u, 0u, 1067009473u, 14539161u, 0, MODF_TOLERANCE, 0}, +{ 133, 3192516074u, 1732245037u, 2147483648u, 0u, 3192516074u, 1732245037u, 0, MODF_TOLERANCE, 0}, +{ 134, 1101371955u, 1533536108u, 1101371955u, 1509949440u, 1072070262u, 3221225472u, 0, MODF_TOLERANCE, 0}, +{ 135, 3249153995u, 1833841275u, 3249153995u, 1811939328u, 3219448615u, 2952790016u, 0, MODF_TOLERANCE, 0}, +{ 136, 1099430098u, 4144145552u, 1099430098u, 4026531840u, 1072433810u, 1073741824u, 0, MODF_TOLERANCE, 0}, +{ 137, 3244270463u, 935007012u, 3244270463u, 0u, 3219905929u, 2449473536u, 0, MODF_TOLERANCE, 0}, +{ 138, 3188865420u, 604442938u, 2147483648u, 0u, 3188865420u, 604442938u, 0, MODF_TOLERANCE, 0}, +{ 139, 3206903253u, 2211464602u, 2147483648u, 0u, 3206903253u, 2211464602u, 0, MODF_TOLERANCE, 0}, +{ 140, 1046255144u, 1635910526u, 0u, 0u, 1046255144u, 1635910526u, 0, MODF_TOLERANCE, 0}, +{ 141, 1077871417u, 2549219008u, 1077870592u, 0u, 1065995455u, 2415263744u, 0, MODF_TOLERANCE, 0}, +{ 142, 3231633258u, 3733639385u, 3231632384u, 0u, 3219871476u, 1451673600u, 0, MODF_TOLERANCE, 0}, +{ 143, 1082095089u, 1819374372u, 1082093568u, 0u, 1071105457u, 3318517760u, 0, MODF_TOLERANCE, 0}, +{ 144, 3202219056u, 2617077637u, 2147483648u, 0u, 3202219056u, 2617077637u, 0, MODF_TOLERANCE, 0}, +{ 145, 1094345280u, 546465680u, 1094345280u, 0u, 1069566259u, 3355443200u, 0, MODF_TOLERANCE, 0}, +{ 146, 1048653554u, 532401530u, 0u, 0u, 1048653554u, 532401530u, 0, MODF_TOLERANCE, 0}, +{ 147, 1044571091u, 2759019783u, 0u, 0u, 1044571091u, 2759019783u, 0, MODF_TOLERANCE, 0}, +{ 148, 3221570188u, 3554409630u, 3221225472u, 0u, 3219458611u, 1332736632u, 0, MODF_TOLERANCE, 0}, +{ 149, 3212931282u, 2527221960u, 2147483648u, 0u, 3212931282u, 2527221960u, 0, MODF_TOLERANCE, 0}, +{ 150, 1099107978u, 2696971136u, 1099107978u, 2684354560u, 1069027440u, 0u, 0, MODF_TOLERANCE, 0}, +{ 151, 1097158000u, 173134582u, 1097158000u, 0u, 1070900133u, 3959422976u, 0, MODF_TOLERANCE, 0}, +{ 152, 1087299442u, 2877794600u, 1087299328u, 0u, 1072474849u, 3930718208u, 0, MODF_TOLERANCE, 0}, +{ 153, 1086400474u, 547642046u, 1086400384u, 0u, 1072072745u, 380600320u, 0, MODF_TOLERANCE, 0}, +{ 154, 3197285510u, 3521286127u, 2147483648u, 0u, 3197285510u, 3521286127u, 0, MODF_TOLERANCE, 0}, +{ 155, 1074860702u, 1231582831u, 1074790400u, 0u, 1070672356u, 2525456112u, 0, MODF_TOLERANCE, 0}, +{ 156, 1090971734u, 1653446832u, 1090971728u, 0u, 1072269878u, 1656750080u, 0, MODF_TOLERANCE, 0}, +{ 157, 1061342535u, 3762182190u, 0u, 0u, 1061342535u, 3762182190u, 0, MODF_TOLERANCE, 0}, +{ 158, 3252967851u, 2615360375u, 3252967851u, 2615148544u, 3216628664u, 0u, 0, MODF_TOLERANCE, 0}, +{ 159, 3200834423u, 2588067350u, 2147483648u, 0u, 3200834423u, 2588067350u, 0, MODF_TOLERANCE, 0}, +{ 160, 3206610957u, 3551059728u, 2147483648u, 0u, 3206610957u, 3551059728u, 0, MODF_TOLERANCE, 0}, +{ 161, 3206978856u, 845263327u, 2147483648u, 0u, 3206978856u, 845263327u, 0, MODF_TOLERANCE, 0}, +{ 162, 1073415902u, 1749010288u, 1072693248u, 0u, 1072041404u, 3498020576u, 0, MODF_TOLERANCE, 0}, +{ 163, 3205576370u, 3092685191u, 2147483648u, 0u, 3205576370u, 3092685191u, 0, MODF_TOLERANCE, 0}, +{ 164, 3190678390u, 2872219490u, 2147483648u, 0u, 3190678390u, 2872219490u, 0, MODF_TOLERANCE, 0}, +{ 165, 3218315055u, 4107255722u, 2147483648u, 0u, 3218315055u, 4107255722u, 0, MODF_TOLERANCE, 0}, +{ 166, 3205337291u, 3069068345u, 2147483648u, 0u, 3205337291u, 3069068345u, 0, MODF_TOLERANCE, 0}, +{ 167, 3243990857u, 2294867524u, 3243990857u, 2147483648u, 3217134028u, 2281701376u, 0, MODF_TOLERANCE, 0}, +{ 168, 3216653996u, 2860384670u, 2147483648u, 0u, 3216653996u, 2860384670u, 0, MODF_TOLERANCE, 0}, +{ 169, 3193326350u, 2265437201u, 2147483648u, 0u, 3193326350u, 2265437201u, 0, MODF_TOLERANCE, 0}, +{ 170, 3240198679u, 1234948614u, 3240198678u, 0u, 3219429821u, 543162368u, 0, MODF_TOLERANCE, 0}, +{ 171, 3216359929u, 1186945904u, 2147483648u, 0u, 3216359929u, 1186945904u, 0, MODF_TOLERANCE, 0}, +{ 172, 3251167793u, 1896750851u, 3251167793u, 1895825408u, 3216784902u, 0u, 0, MODF_TOLERANCE, 0}, +{ 173, 1081575478u, 3686084548u, 1081573376u, 0u, 1071672759u, 1784645632u, 0, MODF_TOLERANCE, 0}, +{ 174, 1079286273u, 3309277689u, 1079279616u, 0u, 1071251909u, 1066531072u, 0, MODF_TOLERANCE, 0}, +{ 175, 3223476240u, 3006860614u, 3223453696u, 0u, 3217425452u, 3460518272u, 0, MODF_TOLERANCE, 0}, +{ 176, 3231412671u, 2504194724u, 3231412224u, 0u, 3218864468u, 799686656u, 0, MODF_TOLERANCE, 0}, +{ 177, 3236149260u, 1948717780u, 3236149248u, 0u, 3218663502u, 631767040u, 0, MODF_TOLERANCE, 0}, +{ 178, 1048317852u, 3791803982u, 0u, 0u, 1048317852u, 3791803982u, 0, MODF_TOLERANCE, 0}, +{ 179, 1064345015u, 4272034420u, 0u, 0u, 1064345015u, 4272034420u, 0, MODF_TOLERANCE, 0}, +{ 180, 3192982124u, 1526175922u, 2147483648u, 0u, 3192982124u, 1526175922u, 0, MODF_TOLERANCE, 0}, +{ 181, 3245817826u, 4108948538u, 3245817826u, 4026531840u, 3218318928u, 3892314112u, 0, MODF_TOLERANCE, 0}, +{ 182, 1104691287u, 640541190u, 1104691287u, 637534208u, 1072099587u, 0u, 0, MODF_TOLERANCE, 0}, +{ 183, 3207257417u, 3259274853u, 2147483648u, 0u, 3207257417u, 3259274853u, 0, MODF_TOLERANCE, 0}, +{ 184, 1082507103u, 3677038020u, 1082505216u, 0u, 1072529260u, 2895581184u, 0, MODF_TOLERANCE, 0}, +{ 185, 1083132498u, 3781708548u, 1083131904u, 0u, 1070765835u, 1113071616u, 0, MODF_TOLERANCE, 0}, +{ 186, 1096584871u, 1207386447u, 1096584871u, 1073741824u, 1069538565u, 1006632960u, 0, MODF_TOLERANCE, 0}, +{ 187, 3188695272u, 3011191657u, 2147483648u, 0u, 3188695272u, 3011191657u, 0, MODF_TOLERANCE, 0}, +{ 188, 1103798670u, 1096124830u, 1103798670u, 1090519040u, 1071997543u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 189, 1063235023u, 2540404725u, 0u, 0u, 1063235023u, 2540404725u, 0, MODF_TOLERANCE, 0}, +{ 190, 3240157452u, 4122845725u, 3240157452u, 0u, 3219044276u, 1134559232u, 0, MODF_TOLERANCE, 0}, +{ 191, 1083643710u, 311336721u, 1083642880u, 0u, 1072296084u, 1962444800u, 0, MODF_TOLERANCE, 0}, +{ 192, 3214382367u, 4212533768u, 2147483648u, 0u, 3214382367u, 4212533768u, 0, MODF_TOLERANCE, 0}, +{ 193, 1051139427u, 1769686293u, 0u, 0u, 1051139427u, 1769686293u, 0, MODF_TOLERANCE, 0}, +{ 194, 3240200923u, 3538602249u, 3240200922u, 0u, 3219992236u, 2425356288u, 0, MODF_TOLERANCE, 0}, +{ 195, 1078227549u, 508056696u, 1078198272u, 0u, 1072469831u, 2450857472u, 0, MODF_TOLERANCE, 0}, +{ 196, 1103793878u, 776520138u, 1103793878u, 771751936u, 1071788146u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 197, 1102910577u, 4064962760u, 1102910577u, 4060086272u, 1070766642u, 0u, 0, MODF_TOLERANCE, 0}, +{ 198, 1077424413u, 819766631u, 1077411840u, 0u, 1070108312u, 1850913664u, 0, MODF_TOLERANCE, 0}, +{ 199, 1074178362u, 2112385259u, 1073741824u, 0u, 1072342249u, 4154573740u, 0, MODF_TOLERANCE, 0}, +{ 200, 3227593179u, 1187058516u, 3227590656u, 0u, 3218323085u, 2183571456u, 0, MODF_TOLERANCE, 0}, +{ 201, 1082295059u, 2514398118u, 1082294272u, 0u, 1071160494u, 4116525056u, 0, MODF_TOLERANCE, 0}, +{ 202, 1076579751u, 870169764u, 1076494336u, 0u, 1071962739u, 1037814336u, 0, MODF_TOLERANCE, 0}, +{ 203, 3246851392u, 1190259653u, 3246851392u, 1073741824u, 3219900335u, 335544320u, 0, MODF_TOLERANCE, 0}, +{ 204, 1069112254u, 3417249840u, 0u, 0u, 1069112254u, 3417249840u, 0, MODF_TOLERANCE, 0}, +{ 205, 3193663083u, 3467757357u, 2147483648u, 0u, 3193663083u, 3467757357u, 0, MODF_TOLERANCE, 0}, +{ 206, 3215075200u, 2168175352u, 2147483648u, 0u, 3215075200u, 2168175352u, 0, MODF_TOLERANCE, 0}, +{ 207, 3239643135u, 1508888184u, 3239643132u, 0u, 3219836798u, 1941962752u, 0, MODF_TOLERANCE, 0}, +{ 208, 1060430241u, 3524949092u, 0u, 0u, 1060430241u, 3524949092u, 0, MODF_TOLERANCE, 0}, +{ 209, 3197412883u, 166402802u, 2147483648u, 0u, 3197412883u, 166402802u, 0, MODF_TOLERANCE, 0}, +{ 210, 3237198975u, 3572369260u, 3237198960u, 0u, 3220154844u, 249036800u, 0, MODF_TOLERANCE, 0}, +{ 211, 1081866822u, 2441536203u, 1081864192u, 0u, 1071942947u, 231052800u, 0, MODF_TOLERANCE, 0}, +{ 212, 3202753937u, 3658194573u, 2147483648u, 0u, 3202753937u, 3658194573u, 0, MODF_TOLERANCE, 0}, +{ 213, 1062392908u, 2479742828u, 0u, 0u, 1062392908u, 2479742828u, 0, MODF_TOLERANCE, 0}, +{ 214, 1062342831u, 4214154303u, 0u, 0u, 1062342831u, 4214154303u, 0, MODF_TOLERANCE, 0}, +{ 215, 1082396794u, 426896765u, 1082396672u, 0u, 1068402268u, 2069839872u, 0, MODF_TOLERANCE, 0}, +{ 216, 1066474375u, 2201754442u, 0u, 0u, 1066474375u, 2201754442u, 0, MODF_TOLERANCE, 0}, +{ 217, 3195629021u, 2055773734u, 2147483648u, 0u, 3195629021u, 2055773734u, 0, MODF_TOLERANCE, 0}, +{ 218, 3239267288u, 291396537u, 3239267288u, 0u, 3213975131u, 3103784960u, 0, MODF_TOLERANCE, 0}, +{ 219, 3236968033u, 874125203u, 3236968032u, 0u, 3216196001u, 2033188864u, 0, MODF_TOLERANCE, 0}, +{ 220, 3210508124u, 4091098764u, 2147483648u, 0u, 3210508124u, 4091098764u, 0, MODF_TOLERANCE, 0}, +{ 221, 1065716026u, 120488169u, 0u, 0u, 1065716026u, 120488169u, 0, MODF_TOLERANCE, 0}, +{ 222, 3241241441u, 1985269424u, 3241241441u, 0u, 3218969907u, 2885681152u, 0, MODF_TOLERANCE, 0}, +{ 223, 3206539410u, 2243036871u, 2147483648u, 0u, 3206539410u, 2243036871u, 0, MODF_TOLERANCE, 0}, +{ 224, 3243941101u, 740033495u, 3243941101u, 0u, 3219525121u, 3951034368u, 0, MODF_TOLERANCE, 0}, +{ 225, 3209424906u, 1176656356u, 2147483648u, 0u, 3209424906u, 1176656356u, 0, MODF_TOLERANCE, 0}, +{ 226, 1074261978u, 3588756231u, 1073741824u, 0u, 1072676715u, 1470123036u, 0, MODF_TOLERANCE, 0}, +{ 227, 3252816791u, 3037249392u, 3252816791u, 3036676096u, 3218177760u, 0u, 0, MODF_TOLERANCE, 0}, +{ 228, 1061635587u, 1173102190u, 0u, 0u, 1061635587u, 1173102190u, 0, MODF_TOLERANCE, 0}, +{ 229, 3237209581u, 2882725208u, 3237209568u, 0u, 3219871653u, 3400531968u, 0, MODF_TOLERANCE, 0}, +{ 230, 1071440059u, 69225090u, 0u, 0u, 1071440059u, 69225090u, 0, MODF_TOLERANCE, 0}, +{ 231, 3212663474u, 272319256u, 2147483648u, 0u, 3212663474u, 272319256u, 0, MODF_TOLERANCE, 0}, +{ 232, 1072073912u, 2493997123u, 0u, 0u, 1072073912u, 2493997123u, 0, MODF_TOLERANCE, 0}, +{ 233, 1057720186u, 188610379u, 0u, 0u, 1057720186u, 188610379u, 0, MODF_TOLERANCE, 0}, +{ 234, 3232757923u, 2209647371u, 3232757760u, 0u, 3218370678u, 2439077888u, 0, MODF_TOLERANCE, 0}, +{ 235, 3236758517u, 1990439193u, 3236758496u, 0u, 3219486371u, 2971205632u, 0, MODF_TOLERANCE, 0}, +{ 236, 1078073146u, 622849962u, 1078067200u, 0u, 1070021157u, 535800320u, 0, MODF_TOLERANCE, 0}, +{ 237, 1057135741u, 756052458u, 0u, 0u, 1057135741u, 756052458u, 0, MODF_TOLERANCE, 0}, +{ 238, 1081649113u, 2247475162u, 1081647104u, 0u, 1071605271u, 3607062528u, 0, MODF_TOLERANCE, 0}, +{ 239, 1061623064u, 3878055211u, 0u, 0u, 1061623064u, 3878055211u, 0, MODF_TOLERANCE, 0}, +{ 240, 3222407050u, 2979438623u, 3222274048u, 0u, 3219143765u, 2360672504u, 0, MODF_TOLERANCE, 0}, +{ 241, 3195290997u, 2676398686u, 2147483648u, 0u, 3195290997u, 2676398686u, 0, MODF_TOLERANCE, 0}, +{ 242, 1105124431u, 3631096636u, 1105124431u, 3628072960u, 1072107934u, 0u, 0, MODF_TOLERANCE, 0}, +{ 243, 1065079390u, 1697791764u, 0u, 0u, 1065079390u, 1697791764u, 0, MODF_TOLERANCE, 0}, +{ 244, 3198136112u, 2299842819u, 2147483648u, 0u, 3198136112u, 2299842819u, 0, MODF_TOLERANCE, 0}, +{ 245, 1078084768u, 1931502677u, 1078067200u, 0u, 1071720476u, 3357087040u, 0, MODF_TOLERANCE, 0}, +{ 246, 3215264397u, 3016456382u, 2147483648u, 0u, 3215264397u, 3016456382u, 0, MODF_TOLERANCE, 0}, +{ 247, 1072253426u, 343404215u, 0u, 0u, 1072253426u, 343404215u, 0, MODF_TOLERANCE, 0}, +{ 248, 1061072607u, 4266232536u, 0u, 0u, 1061072607u, 4266232536u, 0, MODF_TOLERANCE, 0}, +{ 249, 3241230836u, 4140316002u, 3241230836u, 0u, 3220101382u, 2889875456u, 0, MODF_TOLERANCE, 0}, +{ 250, 1082896196u, 868256971u, 1082894336u, 0u, 1072500943u, 36908032u, 0, MODF_TOLERANCE, 0}, +{ 251, 1075422810u, 1864139509u, 1075314688u, 0u, 1071277478u, 4056428368u, 0, MODF_TOLERANCE, 0}, +{ 252, 3187675097u, 3084482407u, 2147483648u, 0u, 3187675097u, 3084482407u, 0, MODF_TOLERANCE, 0}, +{ 253, 3220191323u, 2427162817u, 3220176896u, 0u, 3213635016u, 1439195264u, 0, MODF_TOLERANCE, 0}, +{ 254, 3234748208u, 2715105792u, 3234748160u, 0u, 3218624746u, 2634022912u, 0, MODF_TOLERANCE, 0}, +{ 255, 1064600512u, 3943389284u, 0u, 0u, 1064600512u, 3943389284u, 0, MODF_TOLERANCE, 0}, +{ 256, 1046724025u, 3626825684u, 0u, 0u, 1046724025u, 3626825684u, 0, MODF_TOLERANCE, 0}, +{ 257, 1045423002u, 967350972u, 0u, 0u, 1045423002u, 967350972u, 0, MODF_TOLERANCE, 0}, +{ 258, 1093012318u, 448002663u, 1093012318u, 0u, 1068151802u, 1728053248u, 0, MODF_TOLERANCE, 0}, +{ 259, 3251845859u, 105058217u, 3251845859u, 104857600u, 3215490376u, 0u, 0, MODF_TOLERANCE, 0}, +{ 260, 1069733884u, 171786224u, 0u, 0u, 1069733884u, 171786224u, 0, MODF_TOLERANCE, 0}, +{ 261, 3189614508u, 2863482262u, 2147483648u, 0u, 3189614508u, 2863482262u, 0, MODF_TOLERANCE, 0}, +{ 262, 3204997271u, 877784425u, 2147483648u, 0u, 3204997271u, 877784425u, 0, MODF_TOLERANCE, 0}, +{ 263, 3202629313u, 2801782962u, 2147483648u, 0u, 3202629313u, 2801782962u, 0, MODF_TOLERANCE, 0}, +{ 264, 3213604117u, 762347195u, 2147483648u, 0u, 3213604117u, 762347195u, 0, MODF_TOLERANCE, 0}, +{ 265, 3233486727u, 2317950339u, 3233486592u, 0u, 3219190085u, 598761472u, 0, MODF_TOLERANCE, 0}, +{ 266, 3246333414u, 2135700283u, 3246333414u, 1879048192u, 3220084838u, 1979711488u, 0, MODF_TOLERANCE, 0}, +{ 267, 1056516397u, 4171919805u, 0u, 0u, 1056516397u, 4171919805u, 0, MODF_TOLERANCE, 0}, +{ 268, 1082858682u, 2180920863u, 1082857472u, 0u, 1071835655u, 4174937088u, 0, MODF_TOLERANCE, 0}, +{ 269, 3220149084u, 1918836931u, 2147483648u, 0u, 3220149084u, 1918836931u, 0, MODF_TOLERANCE, 0}, +{ 270, 1083603224u, 3137821660u, 1083602944u, 0u, 1070697392u, 1975369728u, 0, MODF_TOLERANCE, 0}, +{ 271, 1103902874u, 3456203663u, 1103902874u, 3456106496u, 1065859312u, 0u, 0, MODF_TOLERANCE, 0}, +{ 272, 3235600523u, 2335688936u, 3235600512u, 0u, 3217495663u, 2446327808u, 0, MODF_TOLERANCE, 0}, +{ 273, 1042279322u, 4170235262u, 0u, 0u, 1042279322u, 4170235262u, 0, MODF_TOLERANCE, 0}, +{ 274, 1051824459u, 521583737u, 0u, 0u, 1051824459u, 521583737u, 0, MODF_TOLERANCE, 0}, +{ 275, 1081348303u, 1296623194u, 1081348096u, 0u, 1068100009u, 483082240u, 0, MODF_TOLERANCE, 0}, +{ 276, 3250673860u, 2442872540u, 3250673860u, 2441084928u, 3217770204u, 0u, 0, MODF_TOLERANCE, 0}, +{ 277, 1061684277u, 289979405u, 0u, 0u, 1061684277u, 289979405u, 0, MODF_TOLERANCE, 0}, +{ 278, 1049514449u, 3865737145u, 0u, 0u, 1049514449u, 3865737145u, 0, MODF_TOLERANCE, 0}, +{ 279, 1075298944u, 3699090239u, 1075052544u, 0u, 1072567302u, 3822918136u, 0, MODF_TOLERANCE, 0}, +{ 280, 1054539840u, 3259249360u, 0u, 0u, 1054539840u, 3259249360u, 0, MODF_TOLERANCE, 0}, +{ 281, 1096418100u, 1619819023u, 1096418100u, 1073741824u, 1071662653u, 125829120u, 0, MODF_TOLERANCE, 0}, +{ 282, 1045993352u, 1022642459u, 0u, 0u, 1045993352u, 1022642459u, 0, MODF_TOLERANCE, 0}, +{ 283, 1081433004u, 19455098u, 1081430016u, 0u, 1072125954u, 1371075584u, 0, MODF_TOLERANCE, 0}, +{ 284, 3229182089u, 2096003654u, 3229179904u, 0u, 3219198713u, 3707014144u, 0, MODF_TOLERANCE, 0}, +{ 285, 1076297936u, 3803689997u, 1076232192u, 0u, 1071648014u, 729497808u, 0, MODF_TOLERANCE, 0}, +{ 286, 1071630912u, 2263729518u, 0u, 0u, 1071630912u, 2263729518u, 0, MODF_TOLERANCE, 0}, +{ 287, 1101357261u, 2816837387u, 1101357261u, 2785017856u, 1072584816u, 2952790016u, 0, MODF_TOLERANCE, 0}, +{ 288, 1063422305u, 2597606398u, 0u, 0u, 1063422305u, 2597606398u, 0, MODF_TOLERANCE, 0}, +{ 289, 1069100169u, 3680967506u, 0u, 0u, 1069100169u, 3680967506u, 0, MODF_TOLERANCE, 0}, +{ 290, 1040201163u, 179224723u, 0u, 0u, 1040201163u, 179224723u, 0, MODF_TOLERANCE, 0}, +{ 291, 3188629767u, 978126928u, 2147483648u, 0u, 3188629767u, 978126928u, 0, MODF_TOLERANCE, 0}, +{ 292, 1101553990u, 4047893399u, 1101553990u, 4026531840u, 1071931193u, 1879048192u, 0, MODF_TOLERANCE, 0}, +{ 293, 3222322045u, 4059818629u, 3222274048u, 0u, 3217518526u, 1065177248u, 0, MODF_TOLERANCE, 0}, +{ 294, 1042678728u, 3640293589u, 0u, 0u, 1042678728u, 3640293589u, 0, MODF_TOLERANCE, 0}, +{ 295, 3248464040u, 3383497159u, 3248464040u, 3355443200u, 3218784540u, 1879048192u, 0, MODF_TOLERANCE, 0}, +{ 296, 1070002807u, 1527313008u, 0u, 0u, 1070002807u, 1527313008u, 0, MODF_TOLERANCE, 0}, +{ 297, 3202707679u, 2599946514u, 2147483648u, 0u, 3202707679u, 2599946514u, 0, MODF_TOLERANCE, 0}, +{ 298, 1104170406u, 2738675352u, 1104170406u, 2734686208u, 1072590668u, 0u, 0, MODF_TOLERANCE, 0}, +{ 299, 1105232623u, 3616571377u, 1105232623u, 3615490048u, 1071677425u, 0u, 0, MODF_TOLERANCE, 0}, +{ 300, 1060859316u, 1130603218u, 0u, 0u, 1060859316u, 1130603218u, 0, MODF_TOLERANCE, 0}, +{ 301, 1076028796u, 3859211180u, 1075970048u, 0u, 1071427484u, 3235673472u, 0, MODF_TOLERANCE, 0}, +{ 302, 1067940450u, 1744531824u, 0u, 0u, 1067940450u, 1744531824u, 0, MODF_TOLERANCE, 0}, +{ 303, 1042831340u, 1958025850u, 0u, 0u, 1042831340u, 1958025850u, 0, MODF_TOLERANCE, 0}, +{ 304, 3236511256u, 2472176453u, 3236511232u, 0u, 3219690330u, 1799684096u, 0, MODF_TOLERANCE, 0}, +{ 305, 3233107089u, 182132862u, 3233106944u, 0u, 3219267931u, 1678753792u, 0, MODF_TOLERANCE, 0}, +{ 306, 3250520938u, 3924356991u, 3250520938u, 3909091328u, 3219987951u, 3758096384u, 0, MODF_TOLERANCE, 0}, +{ 307, 3230501884u, 35632886u, 3230500864u, 0u, 3219120144u, 4256673792u, 0, MODF_TOLERANCE, 0}, +{ 308, 3209806504u, 1453402523u, 2147483648u, 0u, 3209806504u, 1453402523u, 0, MODF_TOLERANCE, 0}, +{ 309, 1083522102u, 743225214u, 1083522048u, 0u, 1068176934u, 1539244032u, 0, MODF_TOLERANCE, 0}, +{ 310, 3202890678u, 142917400u, 2147483648u, 0u, 3202890678u, 142917400u, 0, MODF_TOLERANCE, 0}, +{ 311, 1080684976u, 1472665012u, 1080680448u, 0u, 1071755351u, 3340088320u, 0, MODF_TOLERANCE, 0}, +{ 312, 3203138231u, 256588219u, 2147483648u, 0u, 3203138231u, 256588219u, 0, MODF_TOLERANCE, 0}, +{ 313, 1094982162u, 1062927000u, 1094982162u, 0u, 1071623549u, 1275068416u, 0, MODF_TOLERANCE, 0}, +{ 314, 1061134072u, 931677439u, 0u, 0u, 1061134072u, 931677439u, 0, MODF_TOLERANCE, 0}, +{ 315, 1058377732u, 2320910576u, 0u, 0u, 1058377732u, 2320910576u, 0, MODF_TOLERANCE, 0}, +{ 316, 1055663370u, 288059864u, 0u, 0u, 1055663370u, 288059864u, 0, MODF_TOLERANCE, 0}, +{ 317, 1078958093u, 1448349062u, 1078951936u, 0u, 1070075222u, 1410172416u, 0, MODF_TOLERANCE, 0}, +{ 318, 3199478070u, 3454027134u, 2147483648u, 0u, 3199478070u, 3454027134u, 0, MODF_TOLERANCE, 0}, +{ 319, 3237458798u, 4215445172u, 3237458784u, 0u, 3220043397u, 761790464u, 0, MODF_TOLERANCE, 0}, +{ 320, 3196654963u, 2231888973u, 2147483648u, 0u, 3196654963u, 2231888973u, 0, MODF_TOLERANCE, 0}, +{ 321, 3246632231u, 40413554u, 3246632231u, 0u, 3218294091u, 2415919104u, 0, MODF_TOLERANCE, 0}, +{ 322, 3232578253u, 983832844u, 3232578048u, 0u, 3218712404u, 2200010752u, 0, MODF_TOLERANCE, 0}, +{ 323, 3223721534u, 3995725873u, 3223715840u, 0u, 3215343342u, 703607040u, 0, MODF_TOLERANCE, 0}, +{ 324, 1050082319u, 777231627u, 0u, 0u, 1050082319u, 777231627u, 0, MODF_TOLERANCE, 0}, +{ 325, 1040986626u, 672789828u, 0u, 0u, 1040986626u, 672789828u, 0, MODF_TOLERANCE, 0}, +{ 326, 3253385962u, 2982787335u, 3253385962u, 2982150144u, 3218305550u, 0u, 0, MODF_TOLERANCE, 0}, +{ 327, 1068390875u, 2075971825u, 0u, 0u, 1068390875u, 2075971825u, 0, MODF_TOLERANCE, 0}, +{ 328, 1070166500u, 4034633931u, 0u, 0u, 1070166500u, 4034633931u, 0, MODF_TOLERANCE, 0}, +{ 329, 3210046177u, 1018222907u, 2147483648u, 0u, 3210046177u, 1018222907u, 0, MODF_TOLERANCE, 0}, +{ 330, 3244621407u, 3090050495u, 3244621407u, 2684354560u, 3219664493u, 3204448256u, 0, MODF_TOLERANCE, 0}, +{ 331, 1067680885u, 937732557u, 0u, 0u, 1067680885u, 937732557u, 0, MODF_TOLERANCE, 0}, +{ 332, 3200798890u, 2557898276u, 2147483648u, 0u, 3200798890u, 2557898276u, 0, MODF_TOLERANCE, 0}, +{ 333, 1078342316u, 130346162u, 1078329344u, 0u, 1071207939u, 3799406848u, 0, MODF_TOLERANCE, 0}, +{ 334, 3223590310u, 275568693u, 3223584768u, 0u, 3215304208u, 1826108672u, 0, MODF_TOLERANCE, 0}, +{ 335, 1042898869u, 3807416441u, 0u, 0u, 1042898869u, 3807416441u, 0, MODF_TOLERANCE, 0}, +{ 336, 1075961161u, 3706820266u, 1075838976u, 0u, 1072551069u, 3474549408u, 0, MODF_TOLERANCE, 0}, +{ 337, 3216099005u, 1710131411u, 2147483648u, 0u, 3216099005u, 1710131411u, 0, MODF_TOLERANCE, 0}, +{ 338, 1078123323u, 1900790503u, 1078099968u, 0u, 1072090844u, 1391507904u, 0, MODF_TOLERANCE, 0}, +{ 339, 3238819361u, 3420420033u, 3238819360u, 0u, 3217866231u, 2081423360u, 0, MODF_TOLERANCE, 0}, +{ 340, 3210844787u, 588423066u, 2147483648u, 0u, 3210844787u, 588423066u, 0, MODF_TOLERANCE, 0}, +{ 341, 1049684114u, 1160162008u, 0u, 0u, 1049684114u, 1160162008u, 0, MODF_TOLERANCE, 0}, +{ 342, 3246307879u, 4265764460u, 3246307879u, 4026531840u, 3219948748u, 3623878656u, 0, MODF_TOLERANCE, 0}, +{ 343, 1102543434u, 366653268u, 1102543434u, 352321536u, 1072387562u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 344, 3188814424u, 466059202u, 2147483648u, 0u, 3188814424u, 466059202u, 0, MODF_TOLERANCE, 0}, +{ 345, 3226627739u, 1325936170u, 3226615808u, 0u, 3219606951u, 2216105216u, 0, MODF_TOLERANCE, 0}, +{ 346, 3221436876u, 680097612u, 3221225472u, 0u, 3218722401u, 1145813600u, 0, MODF_TOLERANCE, 0}, +{ 347, 3240391116u, 1827735934u, 3240391116u, 0u, 3217767490u, 1602224128u, 0, MODF_TOLERANCE, 0}, +{ 348, 3200554324u, 2875599271u, 2147483648u, 0u, 3200554324u, 2875599271u, 0, MODF_TOLERANCE, 0}, +{ 349, 3191030402u, 3117037091u, 2147483648u, 0u, 3191030402u, 3117037091u, 0, MODF_TOLERANCE, 0}, +{ 350, 3239246636u, 15838845u, 3239246636u, 0u, 3209573839u, 2684354560u, 0, MODF_TOLERANCE, 0}, +{ 351, 1051974004u, 749718883u, 0u, 0u, 1051974004u, 749718883u, 0, MODF_TOLERANCE, 0}, +{ 352, 3223587064u, 1523766569u, 3223584768u, 0u, 3214012597u, 2779402752u, 0, MODF_TOLERANCE, 0}, +{ 353, 1044833651u, 1966536294u, 0u, 0u, 1044833651u, 1966536294u, 0, MODF_TOLERANCE, 0}, +{ 354, 3250158026u, 699164258u, 3250158026u, 687865856u, 3219492044u, 1073741824u, 0, MODF_TOLERANCE, 0}, +{ 355, 1098048435u, 3759049394u, 1098048435u, 3758096384u, 1064113508u, 0u, 0, MODF_TOLERANCE, 0}, +{ 356, 1106085272u, 1183789499u, 1106085272u, 1182793728u, 1071539062u, 0u, 0, MODF_TOLERANCE, 0}, +{ 357, 1081201623u, 1970107747u, 1081200640u, 0u, 1070513067u, 1806374912u, 0, MODF_TOLERANCE, 0}, +{ 358, 1095245453u, 2308233883u, 1095245453u, 2147483648u, 1068706229u, 905969664u, 0, MODF_TOLERANCE, 0}, +{ 359, 1084756444u, 1491017852u, 1084755968u, 0u, 1072547213u, 4060594176u, 0, MODF_TOLERANCE, 0}, +{ 360, 1041444355u, 1723375725u, 0u, 0u, 1041444355u, 1723375725u, 0, MODF_TOLERANCE, 0}, +{ 361, 3216630070u, 1141349287u, 2147483648u, 0u, 3216630070u, 1141349287u, 0, MODF_TOLERANCE, 0}, +{ 362, 1097465301u, 3403438584u, 1097465301u, 3221225472u, 1070971059u, 4026531840u, 0, MODF_TOLERANCE, 0}, +{ 363, 3230571908u, 1711085243u, 3230570496u, 0u, 3219526039u, 4099599360u, 0, MODF_TOLERANCE, 0}, +{ 364, 3250239076u, 1377484108u, 3250239076u, 1375731712u, 3216686412u, 0u, 0, MODF_TOLERANCE, 0}, +{ 365, 1098385019u, 2880275004u, 1098385019u, 2684354560u, 1072126724u, 2013265920u, 0, MODF_TOLERANCE, 0}, +{ 366, 1084039594u, 1611394950u, 1084039168u, 0u, 1071293952u, 3203948544u, 0, MODF_TOLERANCE, 0}, +{ 367, 3234221435u, 2626629370u, 3234221312u, 0u, 3220104995u, 3418259456u, 0, MODF_TOLERANCE, 0}, +{ 368, 1063771493u, 1499080813u, 0u, 0u, 1063771493u, 1499080813u, 0, MODF_TOLERANCE, 0}, +{ 369, 1055231263u, 3936262414u, 0u, 0u, 1055231263u, 3936262414u, 0, MODF_TOLERANCE, 0}, +{ 370, 1103919063u, 3175668759u, 1103919063u, 3170893824u, 1071789829u, 3221225472u, 0, MODF_TOLERANCE, 0}, +{ 371, 3207981719u, 1270950554u, 2147483648u, 0u, 3207981719u, 1270950554u, 0, MODF_TOLERANCE, 0}, +{ 372, 3194616071u, 3680565379u, 2147483648u, 0u, 3194616071u, 3680565379u, 0, MODF_TOLERANCE, 0}, +{ 373, 3208148223u, 1066985223u, 2147483648u, 0u, 3208148223u, 1066985223u, 0, MODF_TOLERANCE, 0}, +{ 374, 3221613219u, 4089383168u, 3221225472u, 0u, 3219630735u, 3472630784u, 0, MODF_TOLERANCE, 0}, +{ 375, 3217058839u, 4017329311u, 2147483648u, 0u, 3217058839u, 4017329311u, 0, MODF_TOLERANCE, 0}, +{ 376, 3208334452u, 1667591498u, 2147483648u, 0u, 3208334452u, 1667591498u, 0, MODF_TOLERANCE, 0}, +{ 377, 1088164157u, 3154656624u, 1088164096u, 0u, 1072619012u, 515375104u, 0, MODF_TOLERANCE, 0}, +{ 378, 1061894279u, 3886344038u, 0u, 0u, 1061894279u, 3886344038u, 0, MODF_TOLERANCE, 0}, +{ 379, 1050652945u, 977586119u, 0u, 0u, 1050652945u, 977586119u, 0, MODF_TOLERANCE, 0}, +{ 380, 3209762784u, 953839852u, 2147483648u, 0u, 3209762784u, 953839852u, 0, MODF_TOLERANCE, 0}, +{ 381, 1104965247u, 143071571u, 1104965247u, 142606336u, 1069311308u, 0u, 0, MODF_TOLERANCE, 0}, +{ 382, 3206165386u, 913097445u, 2147483648u, 0u, 3206165386u, 913097445u, 0, MODF_TOLERANCE, 0}, +{ 383, 3190565456u, 1371169579u, 2147483648u, 0u, 3190565456u, 1371169579u, 0, MODF_TOLERANCE, 0}, +{ 384, 1057079837u, 2594818628u, 0u, 0u, 1057079837u, 2594818628u, 0, MODF_TOLERANCE, 0}, +{ 385, 3251793336u, 2259342224u, 3251793336u, 2256535552u, 3219483080u, 0u, 0, MODF_TOLERANCE, 0}, +{ 386, 3217432469u, 1824221478u, 2147483648u, 0u, 3217432469u, 1824221478u, 0, MODF_TOLERANCE, 0}, +{ 387, 3246834775u, 1576604497u, 3246834775u, 1476395008u, 3219645517u, 1140850688u, 0, MODF_TOLERANCE, 0}, +{ 388, 1079368611u, 185078728u, 1079361536u, 0u, 1071358731u, 135514112u, 0, MODF_TOLERANCE, 0}, +{ 389, 3221679427u, 444800035u, 3221225472u, 0u, 3219895564u, 1779200140u, 0, MODF_TOLERANCE, 0}, +{ 390, 3243343143u, 1734989302u, 3243343143u, 1073741824u, 3219371242u, 4211081216u, 0, MODF_TOLERANCE, 0}, +{ 391, 1072748883u, 130452005u, 1072693248u, 0u, 1068182112u, 4174464160u, 0, MODF_TOLERANCE, 0}, +{ 392, 1041548088u, 2158433515u, 0u, 0u, 1041548088u, 2158433515u, 0, MODF_TOLERANCE, 0}, +{ 393, 3234695968u, 1941318385u, 3234695936u, 0u, 3218094555u, 360218624u, 0, MODF_TOLERANCE, 0}, +{ 394, 1045807374u, 792193370u, 0u, 0u, 1045807374u, 792193370u, 0, MODF_TOLERANCE, 0}, +{ 395, 3238299666u, 1299392207u, 3238299664u, 0u, 3218238361u, 913833984u, 0, MODF_TOLERANCE, 0}, +{ 396, 3212131720u, 3205732280u, 2147483648u, 0u, 3212131720u, 3205732280u, 0, MODF_TOLERANCE, 0}, +{ 397, 1098698804u, 3035093505u, 1098698804u, 2952790016u, 1070833512u, 67108864u, 0, MODF_TOLERANCE, 0}, +{ 398, 1052187689u, 3287702190u, 0u, 0u, 1052187689u, 3287702190u, 0, MODF_TOLERANCE, 0}, +{ 399, 3246676260u, 2160225215u, 3246676260u, 2147483648u, 3216526711u, 3758096384u, 0, MODF_TOLERANCE, 0}, +{ 400, 1102624859u, 836655570u, 1102624859u, 822083584u, 1072417594u, 1073741824u, 0, MODF_TOLERANCE, 0}, +{ 401, 1096723626u, 3360816360u, 1096723626u, 3221225472u, 1069589497u, 3489660928u, 0, MODF_TOLERANCE, 0}, +{ 402, 3246176356u, 172860634u, 3246176356u, 0u, 3219430217u, 3019898880u, 0, MODF_TOLERANCE, 0}, +{ 403, 1070995788u, 146831910u, 0u, 0u, 1070995788u, 146831910u, 0, MODF_TOLERANCE, 0}, +{ 404, 1051558014u, 2340722078u, 0u, 0u, 1051558014u, 2340722078u, 0, MODF_TOLERANCE, 0}, +{ 405, 3230416351u, 1603798153u, 3230414848u, 0u, 3219619198u, 1611801600u, 0, MODF_TOLERANCE, 0}, +{ 406, 3207725532u, 1099413093u, 2147483648u, 0u, 3207725532u, 1099413093u, 0, MODF_TOLERANCE, 0}, +{ 407, 3246678378u, 2429340443u, 3246678378u, 2415919104u, 3216611683u, 1610612736u, 0, MODF_TOLERANCE, 0}, +{ 408, 3190303581u, 3223770005u, 2147483648u, 0u, 3190303581u, 3223770005u, 0, MODF_TOLERANCE, 0}, +{ 409, 1075882959u, 955542166u, 1075838976u, 0u, 1070954983u, 512578240u, 0, MODF_TOLERANCE, 0}, +{ 410, 3230415151u, 275583938u, 3230414848u, 0u, 3217223942u, 3510378496u, 0, MODF_TOLERANCE, 0}, +{ 411, 1092971882u, 513397822u, 1092971882u, 0u, 1068407252u, 1040187392u, 0, MODF_TOLERANCE, 0}, +{ 412, 1090646554u, 2089321329u, 1090646552u, 0u, 1070851140u, 461897728u, 0, MODF_TOLERANCE, 0}, +{ 413, 3193169876u, 2782073372u, 2147483648u, 0u, 3193169876u, 2782073372u, 0, MODF_TOLERANCE, 0}, +{ 414, 1046063872u, 4023829068u, 0u, 0u, 1046063872u, 4023829068u, 0, MODF_TOLERANCE, 0}, +{ 415, 1098564822u, 3242223094u, 1098564822u, 3221225472u, 1068762719u, 1610612736u, 0, MODF_TOLERANCE, 0}, +{ 416, 3194111199u, 4264674108u, 2147483648u, 0u, 3194111199u, 4264674108u, 0, MODF_TOLERANCE, 0}, +{ 417, 3238510821u, 3506346169u, 3238510816u, 0u, 3219604474u, 1659109376u, 0, MODF_TOLERANCE, 0}, +{ 418, 1047020885u, 1742757458u, 0u, 0u, 1047020885u, 1742757458u, 0, MODF_TOLERANCE, 0}, +{ 419, 3192664477u, 1265459564u, 2147483648u, 0u, 3192664477u, 1265459564u, 0, MODF_TOLERANCE, 0}, +{ 420, 3193450280u, 3650514880u, 2147483648u, 0u, 3193450280u, 3650514880u, 0, MODF_TOLERANCE, 0}, +{ 421, 1081755890u, 1525260440u, 1081753600u, 0u, 1071768757u, 3544264704u, 0, MODF_TOLERANCE, 0}, +{ 422, 3235452527u, 2612331392u, 3235452480u, 0u, 3219639770u, 2176843776u, 0, MODF_TOLERANCE, 0}, +{ 423, 3248668920u, 1263613754u, 3248668920u, 1241513984u, 3219460979u, 2684354560u, 0, MODF_TOLERANCE, 0}, +{ 424, 3219096387u, 635677201u, 2147483648u, 0u, 3219096387u, 635677201u, 0, MODF_TOLERANCE, 0}, +{ 425, 3206272087u, 4140947288u, 2147483648u, 0u, 3206272087u, 4140947288u, 0, MODF_TOLERANCE, 0}, +{ 426, 3200792376u, 2013265346u, 2147483648u, 0u, 3200792376u, 2013265346u, 0, MODF_TOLERANCE, 0}, +{ 427, 3249974392u, 1912759945u, 3249974392u, 1912602624u, 3213046856u, 0u, 0, MODF_TOLERANCE, 0}, +{ 428, 3237045253u, 1351396825u, 3237045248u, 0u, 3218424370u, 3076784128u, 0, MODF_TOLERANCE, 0}, +{ 429, 3248205162u, 1001433078u, 3248205162u, 939524096u, 3220014399u, 2952790016u, 0, MODF_TOLERANCE, 0}, +{ 430, 3206926643u, 2741676659u, 2147483648u, 0u, 3206926643u, 2741676659u, 0, MODF_TOLERANCE, 0}, +{ 431, 1080923606u, 1088945233u, 1080918016u, 0u, 1072027200u, 3892072704u, 0, MODF_TOLERANCE, 0}, +{ 432, 1085095743u, 3986114865u, 1085095424u, 0u, 1071906521u, 1955794944u, 0, MODF_TOLERANCE, 0}, +{ 433, 3215734057u, 831239754u, 2147483648u, 0u, 3215734057u, 831239754u, 0, MODF_TOLERANCE, 0}, +{ 434, 1099828675u, 3071308141u, 1099828675u, 2952790016u, 1072447941u, 3019898880u, 0, MODF_TOLERANCE, 0}, +{ 435, 3225834497u, 3473592372u, 3225812992u, 0u, 3219456115u, 3266579712u, 0, MODF_TOLERANCE, 0}, +{ 436, 1102759382u, 1309576357u, 1102759382u, 1308622848u, 1068308810u, 0u, 0, MODF_TOLERANCE, 0}, +{ 437, 3251186706u, 2042340367u, 3251186706u, 2038431744u, 3218985479u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 438, 1091945628u, 2062772374u, 1091945628u, 0u, 1069464794u, 629145600u, 0, MODF_TOLERANCE, 0}, +{ 439, 3194765687u, 1840632537u, 2147483648u, 0u, 3194765687u, 1840632537u, 0, MODF_TOLERANCE, 0}, +{ 440, 1096533424u, 807510337u, 1096533424u, 0u, 1072173264u, 2692743168u, 0, MODF_TOLERANCE, 0}, +{ 441, 3231451722u, 144814872u, 3231451136u, 0u, 3219279941u, 228114432u, 0, MODF_TOLERANCE, 0}, +{ 442, 3212698915u, 2282965697u, 2147483648u, 0u, 3212698915u, 2282965697u, 0, MODF_TOLERANCE, 0}, +{ 443, 1071236430u, 2552499583u, 0u, 0u, 1071236430u, 2552499583u, 0, MODF_TOLERANCE, 0}, +{ 444, 3229111426u, 1470130815u, 3229110272u, 0u, 3218213214u, 2175400960u, 0, MODF_TOLERANCE, 0}, +{ 445, 3243093065u, 2858583811u, 3243093065u, 2147483648u, 3218420035u, 2172649472u, 0, MODF_TOLERANCE, 0}, +{ 446, 1089760910u, 6360994u, 1089760896u, 0u, 1072431298u, 524550144u, 0, MODF_TOLERANCE, 0}, +{ 447, 3198264929u, 1614537194u, 2147483648u, 0u, 3198264929u, 1614537194u, 0, MODF_TOLERANCE, 0}, +{ 448, 1075198900u, 4088705365u, 1075052544u, 0u, 1071766951u, 2644871848u, 0, MODF_TOLERANCE, 0}, +{ 449, 3250939070u, 3545570051u, 3250939070u, 3539992576u, 3219474112u, 3221225472u, 0, MODF_TOLERANCE, 0}, +{ 450, 1065221325u, 1629217700u, 0u, 0u, 1065221325u, 1629217700u, 0, MODF_TOLERANCE, 0}, +{ 451, 1072744324u, 1813392963u, 1072693248u, 0u, 1068036237u, 2193999968u, 0, MODF_TOLERANCE, 0}, +{ 452, 3235313361u, 3772501596u, 3235313344u, 0u, 3218202843u, 3462135808u, 0, MODF_TOLERANCE, 0}, +{ 453, 3196802686u, 2406734491u, 2147483648u, 0u, 3196802686u, 2406734491u, 0, MODF_TOLERANCE, 0}, +{ 454, 1042055360u, 89226663u, 0u, 0u, 1042055360u, 89226663u, 0, MODF_TOLERANCE, 0}, +{ 455, 3195751081u, 1618759139u, 2147483648u, 0u, 3195751081u, 1618759139u, 0, MODF_TOLERANCE, 0}, +{ 456, 3194723421u, 3888234802u, 2147483648u, 0u, 3194723421u, 3888234802u, 0, MODF_TOLERANCE, 0}, +{ 457, 1055357248u, 3590035633u, 0u, 0u, 1055357248u, 3590035633u, 0, MODF_TOLERANCE, 0}, +{ 458, 3212424262u, 2892456615u, 2147483648u, 0u, 3212424262u, 2892456615u, 0, MODF_TOLERANCE, 0}, +{ 459, 3189943060u, 2431246964u, 2147483648u, 0u, 3189943060u, 2431246964u, 0, MODF_TOLERANCE, 0}, +{ 460, 3241512456u, 183850734u, 3241512456u, 0u, 3215321773u, 3690987520u, 0, MODF_TOLERANCE, 0}, +{ 461, 1089501101u, 3088319870u, 1089501088u, 0u, 1072394280u, 184287232u, 0, MODF_TOLERANCE, 0}, +{ 462, 3211544311u, 862225364u, 2147483648u, 0u, 3211544311u, 862225364u, 0, MODF_TOLERANCE, 0}, +{ 463, 3235294664u, 3495352775u, 3235294656u, 0u, 3217137837u, 3012427776u, 0, MODF_TOLERANCE, 0}, +{ 464, 1058576726u, 596957268u, 0u, 0u, 1058576726u, 596957268u, 0, MODF_TOLERANCE, 0}, +{ 465, 1046553348u, 1839214511u, 0u, 0u, 1046553348u, 1839214511u, 0, MODF_TOLERANCE, 0}, +{ 466, 3205004060u, 1923240983u, 2147483648u, 0u, 3205004060u, 1923240983u, 0, MODF_TOLERANCE, 0}, +{ 467, 1058073864u, 739619702u, 0u, 0u, 1058073864u, 739619702u, 0, MODF_TOLERANCE, 0}, +{ 468, 3223356436u, 2689885273u, 3223322624u, 0u, 3218113172u, 176982816u, 0, MODF_TOLERANCE, 0}, +{ 469, 3200324971u, 2143376228u, 2147483648u, 0u, 3200324971u, 2143376228u, 0, MODF_TOLERANCE, 0}, +{ 470, 1098306332u, 3760236188u, 1098306332u, 3758096384u, 1065374542u, 0u, 0, MODF_TOLERANCE, 0}, +{ 471, 1074621795u, 671680995u, 1074266112u, 0u, 1072018828u, 2686723980u, 0, MODF_TOLERANCE, 0}, +{ 472, 1091262633u, 2315535361u, 1091262632u, 0u, 1070112836u, 1074790400u, 0, MODF_TOLERANCE, 0}, +{ 473, 3214165989u, 2493598049u, 2147483648u, 0u, 3214165989u, 2493598049u, 0, MODF_TOLERANCE, 0}, +{ 474, 3194927008u, 1689107592u, 2147483648u, 0u, 3194927008u, 1689107592u, 0, MODF_TOLERANCE, 0}, +{ 475, 3189989959u, 1578976988u, 2147483648u, 0u, 3189989959u, 1578976988u, 0, MODF_TOLERANCE, 0}, +{ 476, 1066368383u, 2117279163u, 0u, 0u, 1066368383u, 2117279163u, 0, MODF_TOLERANCE, 0}, +{ 477, 3222988111u, 3425290087u, 3222798336u, 0u, 3219597950u, 1632516920u, 0, MODF_TOLERANCE, 0}, +{ 478, 1098487295u, 1263412017u, 1098487295u, 1073741824u, 1072077894u, 1644167168u, 0, MODF_TOLERANCE, 0}, +{ 479, 3208432764u, 3635396812u, 2147483648u, 0u, 3208432764u, 3635396812u, 0, MODF_TOLERANCE, 0}, +{ 480, 1070999426u, 3965655689u, 0u, 0u, 1070999426u, 3965655689u, 0, MODF_TOLERANCE, 0}, +{ 481, 1060196346u, 2183973116u, 0u, 0u, 1060196346u, 2183973116u, 0, MODF_TOLERANCE, 0}, +{ 482, 1101098363u, 1118613350u, 1101098363u, 1107296256u, 1070962156u, 3221225472u, 0, MODF_TOLERANCE, 0}, +{ 483, 3221946089u, 199516350u, 3221749760u, 0u, 3218601800u, 1596130800u, 0, MODF_TOLERANCE, 0}, +{ 484, 1078368488u, 164621458u, 1078362112u, 0u, 1070131209u, 3488387584u, 0, MODF_TOLERANCE, 0}, +{ 485, 3187706018u, 3570940805u, 2147483648u, 0u, 3187706018u, 3570940805u, 0, MODF_TOLERANCE, 0}, +{ 486, 3230316437u, 3596080877u, 3230314496u, 0u, 3220068185u, 1599845376u, 0, MODF_TOLERANCE, 0}, +{ 487, 3208209565u, 980880313u, 2147483648u, 0u, 3208209565u, 980880313u, 0, MODF_TOLERANCE, 0}, +{ 488, 1079833442u, 884465057u, 1079820288u, 0u, 1072279834u, 1542377600u, 0, MODF_TOLERANCE, 0}, +{ 489, 1099977124u, 2558179220u, 1099977124u, 2550136832u, 1069460965u, 0u, 0, MODF_TOLERANCE, 0}, +{ 490, 1052873711u, 1233598120u, 0u, 0u, 1052873711u, 1233598120u, 0, MODF_TOLERANCE, 0}, +{ 491, 1047115221u, 1909994277u, 0u, 0u, 1047115221u, 1909994277u, 0, MODF_TOLERANCE, 0}, +{ 492, 1085015978u, 2991527452u, 1085015552u, 0u, 1072343844u, 4049715200u, 0, MODF_TOLERANCE, 0}, +{ 493, 1060855260u, 1680290941u, 0u, 0u, 1060855260u, 1680290941u, 0, MODF_TOLERANCE, 0}, +{ 494, 1074309900u, 2943870846u, 1074266112u, 0u, 1068851605u, 4009553856u, 0, MODF_TOLERANCE, 0}, +{ 495, 1059496132u, 1451927357u, 0u, 0u, 1059496132u, 1451927357u, 0, MODF_TOLERANCE, 0}, +{ 496, 3228615456u, 1502585517u, 3228614656u, 0u, 3217621708u, 2098554880u, 0, MODF_TOLERANCE, 0}, +{ 497, 3236211951u, 751136990u, 3236211936u, 0u, 3219020170u, 3787194368u, 0, MODF_TOLERANCE, 0}, +{ 498, 3230392165u, 3493275472u, 3230390272u, 0u, 3220019008u, 3701293056u, 0, MODF_TOLERANCE, 0}, +{ 499, 1098365967u, 1209623292u, 1098365967u, 1073741824u, 1071657669u, 4160749568u, 0, MODF_TOLERANCE, 0}, +{ 500, 3238056647u, 979495322u, 3238056640u, 0u, 3219974535u, 2791833600u, 0, MODF_TOLERANCE, 0}, +{ 501, 3250424296u, 1717672108u, 3250424296u, 1711276032u, 3218630187u, 0u, 0, MODF_TOLERANCE, 0}, +{ 502, 1048120593u, 531240316u, 0u, 0u, 1048120593u, 531240316u, 0, MODF_TOLERANCE, 0}, +{ 503, 1054174923u, 3548721654u, 0u, 0u, 1054174923u, 3548721654u, 0, MODF_TOLERANCE, 0}, +{ 504, 1086112947u, 3391817224u, 1086112768u, 0u, 1072068933u, 1623261184u, 0, MODF_TOLERANCE, 0}, +{ 505, 1077836851u, 2758195125u, 1077805056u, 0u, 1071582441u, 430828864u, 0, MODF_TOLERANCE, 0}, +{ 506, 1100880260u, 2028440924u, 1100880260u, 2013265920u, 1070395819u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 507, 1084223893u, 2750123373u, 1084223488u, 0u, 1071209022u, 3101085696u, 0, MODF_TOLERANCE, 0}, +{ 508, 3232200256u, 1086294931u, 3232200192u, 0u, 3217035311u, 3806642176u, 0, MODF_TOLERANCE, 0}, +{ 509, 1043958672u, 2986160931u, 0u, 0u, 1043958672u, 2986160931u, 0, MODF_TOLERANCE, 0}, +{ 510, 1076097908u, 2540046258u, 1075970048u, 0u, 1072641865u, 1986034464u, 0, MODF_TOLERANCE, 0}, +{ 511, 3235476602u, 451471221u, 3235476544u, 0u, 3219983732u, 1941602304u, 0, MODF_TOLERANCE, 0}, +{ 512, 1064816262u, 4187644495u, 0u, 0u, 1064816262u, 4187644495u, 0, MODF_TOLERANCE, 0}, +{ 513, 1099460228u, 2439500162u, 1099460228u, 2415919104u, 1069972760u, 536870912u, 0, MODF_TOLERANCE, 0}, +{ 514, 1065280276u, 1979490284u, 0u, 0u, 1065280276u, 1979490284u, 0, MODF_TOLERANCE, 0}, +{ 515, 1040415832u, 2283342035u, 0u, 0u, 1040415832u, 2283342035u, 0, MODF_TOLERANCE, 0}, +{ 516, 1078398157u, 1345997553u, 1078394880u, 0u, 1069128352u, 1955979776u, 0, MODF_TOLERANCE, 0}, +{ 517, 3213249348u, 179066662u, 2147483648u, 0u, 3213249348u, 179066662u, 0, MODF_TOLERANCE, 0}, +{ 518, 1103272172u, 1217337578u, 1103272172u, 1216348160u, 1069429204u, 0u, 0, MODF_TOLERANCE, 0}, +{ 519, 3211562377u, 3779303391u, 2147483648u, 0u, 3211562377u, 3779303391u, 0, MODF_TOLERANCE, 0}, +{ 520, 3210023352u, 3115946280u, 2147483648u, 0u, 3210023352u, 3115946280u, 0, MODF_TOLERANCE, 0}, +{ 521, 3192989874u, 286247089u, 2147483648u, 0u, 3192989874u, 286247089u, 0, MODF_TOLERANCE, 0}, +{ 522, 1085153597u, 713645369u, 1085153280u, 0u, 1071895208u, 2513670144u, 0, MODF_TOLERANCE, 0}, +{ 523, 1093670500u, 1468283899u, 1093670500u, 0u, 1070981390u, 4273995776u, 0, MODF_TOLERANCE, 0}, +{ 524, 1042831668u, 2022736418u, 0u, 0u, 1042831668u, 2022736418u, 0, MODF_TOLERANCE, 0}, +{ 525, 1083139105u, 3305564080u, 1083138048u, 0u, 1071679252u, 463388672u, 0, MODF_TOLERANCE, 0}, +{ 526, 1065483445u, 482392433u, 0u, 0u, 1065483445u, 482392433u, 0, MODF_TOLERANCE, 0}, +{ 527, 3201695807u, 2256346551u, 2147483648u, 0u, 3201695807u, 2256346551u, 0, MODF_TOLERANCE, 0}, +{ 528, 3222430705u, 2071674991u, 3222274048u, 0u, 3219333003u, 3688498040u, 0, MODF_TOLERANCE, 0}, +{ 529, 3204024695u, 2295269094u, 2147483648u, 0u, 3204024695u, 2295269094u, 0, MODF_TOLERANCE, 0}, +{ 530, 1084451053u, 2773103941u, 1084450816u, 0u, 1071494313u, 1185456128u, 0, MODF_TOLERANCE, 0}, +{ 531, 1078173946u, 1482721827u, 1078165504u, 0u, 1070628140u, 809832832u, 0, MODF_TOLERANCE, 0}, +{ 532, 1092243422u, 3125409590u, 1092243420u, 0u, 1072026191u, 3115319296u, 0, MODF_TOLERANCE, 0}, +{ 533, 3221065973u, 1381740563u, 3220176896u, 0u, 3219857898u, 2763481126u, 0, MODF_TOLERANCE, 0}, +{ 534, 1071545057u, 2918235653u, 0u, 0u, 1071545057u, 2918235653u, 0, MODF_TOLERANCE, 0}, +{ 535, 3238715972u, 1105857967u, 3238715968u, 0u, 3219195816u, 918290432u, 0, MODF_TOLERANCE, 0}, +{ 536, 3241990046u, 2703723225u, 3241990046u, 0u, 3219399921u, 1528823808u, 0, MODF_TOLERANCE, 0}, +{ 537, 1043015571u, 174689677u, 0u, 0u, 1043015571u, 174689677u, 0, MODF_TOLERANCE, 0}, +{ 538, 1079333374u, 3947057014u, 1079328768u, 0u, 1070726891u, 1129281024u, 0, MODF_TOLERANCE, 0}, +{ 539, 1090461859u, 2023082423u, 1090461856u, 0u, 1070318766u, 1303904256u, 0, MODF_TOLERANCE, 0}, +{ 540, 3242081486u, 1169047927u, 3242081486u, 0u, 3218172816u, 1572864000u, 0, MODF_TOLERANCE, 0}, +{ 541, 1064525899u, 3742487766u, 0u, 0u, 1064525899u, 3742487766u, 0, MODF_TOLERANCE, 0}, +{ 542, 1043425732u, 194972788u, 0u, 0u, 1043425732u, 194972788u, 0, MODF_TOLERANCE, 0}, +{ 543, 3213791827u, 2136071361u, 2147483648u, 0u, 3213791827u, 2136071361u, 0, MODF_TOLERANCE, 0}, +{ 544, 3211529757u, 993675115u, 2147483648u, 0u, 3211529757u, 993675115u, 0, MODF_TOLERANCE, 0}, +{ 545, 3213663381u, 210772141u, 2147483648u, 0u, 3213663381u, 210772141u, 0, MODF_TOLERANCE, 0}, +{ 546, 3241441539u, 580731413u, 3241441539u, 0u, 3217116833u, 176160768u, 0, MODF_TOLERANCE, 0}, +{ 547, 1093840413u, 1751560711u, 1093840413u, 0u, 1071258028u, 2176843776u, 0, MODF_TOLERANCE, 0}, +{ 548, 1074522705u, 180987057u, 1074266112u, 0u, 1071600264u, 1447896456u, 0, MODF_TOLERANCE, 0}, +{ 549, 1066754591u, 2552236599u, 0u, 0u, 1066754591u, 2552236599u, 0, MODF_TOLERANCE, 0}, +{ 550, 1088658621u, 2112468655u, 1088658592u, 0u, 1072528873u, 3064922112u, 0, MODF_TOLERANCE, 0}, +{ 551, 3189290617u, 1578223762u, 2147483648u, 0u, 3189290617u, 1578223762u, 0, MODF_TOLERANCE, 0}, +{ 552, 3224596567u, 2456166162u, 3224567808u, 0u, 3218871780u, 2575811712u, 0, MODF_TOLERANCE, 0}, +{ 553, 1058506965u, 2110924310u, 0u, 0u, 1058506965u, 2110924310u, 0, MODF_TOLERANCE, 0}, +{ 554, 1086207177u, 3161208323u, 1086206976u, 0u, 1072248717u, 2260754432u, 0, MODF_TOLERANCE, 0}, +{ 555, 3231863394u, 2352173188u, 3231863296u, 0u, 3217597196u, 3558932480u, 0, MODF_TOLERANCE, 0}, +{ 556, 1079361728u, 4070222179u, 1079361536u, 0u, 1065885267u, 1428971520u, 0, MODF_TOLERANCE, 0}, +{ 557, 1101012904u, 2481562701u, 1101012904u, 2449473536u, 1072601668u, 3489660928u, 0, MODF_TOLERANCE, 0}, +{ 558, 1090937016u, 3809489716u, 1090937016u, 0u, 1069310470u, 1719664640u, 0, MODF_TOLERANCE, 0}, +{ 559, 3197002651u, 330905705u, 2147483648u, 0u, 3197002651u, 330905705u, 0, MODF_TOLERANCE, 0}, +{ 560, 1086260896u, 90264431u, 1086260736u, 0u, 1071906988u, 711843840u, 0, MODF_TOLERANCE, 0}, +{ 561, 1040729961u, 4162008079u, 0u, 0u, 1040729961u, 4162008079u, 0, MODF_TOLERANCE, 0}, +{ 562, 3194387916u, 759522153u, 2147483648u, 0u, 3194387916u, 759522153u, 0, MODF_TOLERANCE, 0}, +{ 563, 1081015037u, 1839697482u, 1081008128u, 0u, 1072364909u, 2811120128u, 0, MODF_TOLERANCE, 0}, +{ 564, 3216442625u, 2211508949u, 2147483648u, 0u, 3216442625u, 2211508949u, 0, MODF_TOLERANCE, 0}, +{ 565, 3249807211u, 3736863454u, 3249807211u, 3724541952u, 3219619931u, 3221225472u, 0, MODF_TOLERANCE, 0}, +{ 566, 1063475914u, 3150741666u, 0u, 0u, 1063475914u, 3150741666u, 0, MODF_TOLERANCE, 0}, +{ 567, 1060785883u, 4200269406u, 0u, 0u, 1060785883u, 4200269406u, 0, MODF_TOLERANCE, 0}, +{ 568, 3236646101u, 1061812176u, 3236646080u, 0u, 3219472201u, 4157603840u, 0, MODF_TOLERANCE, 0}, +{ 569, 1080217979u, 106027290u, 1080213504u, 0u, 1071741702u, 1373182464u, 0, MODF_TOLERANCE, 0}, +{ 570, 3234978297u, 2245237549u, 3234978240u, 0u, 3219964649u, 3449192448u, 0, MODF_TOLERANCE, 0}, +{ 571, 3246984334u, 2132131375u, 3246984334u, 2013265920u, 3219937016u, 3154116608u, 0, MODF_TOLERANCE, 0}, +{ 572, 3250483427u, 3449276437u, 3250483427u, 3439329280u, 3219323138u, 2684354560u, 0, MODF_TOLERANCE, 0}, +{ 573, 1089388778u, 2334440944u, 1089388768u, 0u, 1070929481u, 2078277632u, 0, MODF_TOLERANCE, 0}, +{ 574, 1105423490u, 4004336184u, 1105423490u, 4003463168u, 1071293552u, 0u, 0, MODF_TOLERANCE, 0}, +{ 575, 3218772704u, 4090088208u, 2147483648u, 0u, 3218772704u, 4090088208u, 0, MODF_TOLERANCE, 0}, +{ 576, 1042030013u, 3898658299u, 0u, 0u, 1042030013u, 3898658299u, 0, MODF_TOLERANCE, 0}, +{ 577, 3207908064u, 2272831437u, 2147483648u, 0u, 3207908064u, 2272831437u, 0, MODF_TOLERANCE, 0}, +{ 578, 3253082595u, 2639188641u, 3253082595u, 2638217216u, 3218974018u, 0u, 0, MODF_TOLERANCE, 0}, +{ 579, 1054766684u, 1856594168u, 0u, 0u, 1054766684u, 1856594168u, 0, MODF_TOLERANCE, 0}, +{ 580, 3189515294u, 4101853676u, 2147483648u, 0u, 3189515294u, 4101853676u, 0, MODF_TOLERANCE, 0}, +{ 581, 1076012412u, 2211699255u, 1075970048u, 0u, 1070903184u, 2054899424u, 0, MODF_TOLERANCE, 0}, +{ 582, 3195060344u, 3865018604u, 2147483648u, 0u, 3195060344u, 3865018604u, 0, MODF_TOLERANCE, 0}, +{ 583, 3242767010u, 996259334u, 3242767010u, 0u, 3218976987u, 50331648u, 0, MODF_TOLERANCE, 0}, +{ 584, 3241496889u, 3782673116u, 3241496889u, 0u, 3219926752u, 1535115264u, 0, MODF_TOLERANCE, 0}, +{ 585, 1099130747u, 3840380763u, 1099130747u, 3758096384u, 1071881789u, 1811939328u, 0, MODF_TOLERANCE, 0}, +{ 586, 1048674041u, 550040067u, 0u, 0u, 1048674041u, 550040067u, 0, MODF_TOLERANCE, 0}, +{ 587, 3251419593u, 95874100u, 3251419593u, 92274688u, 3218830874u, 0u, 0, MODF_TOLERANCE, 0}, +{ 588, 3237232828u, 2645647822u, 3237232816u, 0u, 3219733346u, 3281780736u, 0, MODF_TOLERANCE, 0}, +{ 589, 1043665640u, 3441419500u, 0u, 0u, 1043665640u, 3441419500u, 0, MODF_TOLERANCE, 0}, +{ 590, 3252367038u, 876710419u, 3252367038u, 876609536u, 3214450992u, 0u, 0, MODF_TOLERANCE, 0}, +{ 591, 3238593552u, 2560836004u, 3238593552u, 0u, 3216184424u, 880803840u, 0, MODF_TOLERANCE, 0}, +{ 592, 3199616543u, 1180840586u, 2147483648u, 0u, 3199616543u, 1180840586u, 0, MODF_TOLERANCE, 0}, +{ 593, 3221602966u, 2218230392u, 3221225472u, 0u, 3219589722u, 282986976u, 0, MODF_TOLERANCE, 0}, +{ 594, 3227485787u, 3947214579u, 3227484160u, 0u, 3216601005u, 383503360u, 0, MODF_TOLERANCE, 0}, +{ 595, 1079539654u, 1447312532u, 1079525376u, 0u, 1072423723u, 572410368u, 0, MODF_TOLERANCE, 0}, +{ 596, 1081476588u, 780366847u, 1081475072u, 0u, 1071100090u, 231734272u, 0, MODF_TOLERANCE, 0}, +{ 597, 1072569643u, 2842113832u, 0u, 0u, 1072569643u, 2842113832u, 0, MODF_TOLERANCE, 0}, +{ 598, 3216156731u, 225159029u, 2147483648u, 0u, 3216156731u, 225159029u, 0, MODF_TOLERANCE, 0}, +{ 599, 1098117193u, 1601981129u, 1098117193u, 1342177280u, 1072625813u, 2449473536u, 0, MODF_TOLERANCE, 0}, +{ 600, 3234628869u, 2236538344u, 3234628864u, 0u, 3215332667u, 2006974464u, 0, MODF_TOLERANCE, 0}, +{ 601, 1085173524u, 2194185737u, 1085173248u, 0u, 1071728684u, 2313195520u, 0, MODF_TOLERANCE, 0}, +{ 602, 3242362684u, 87913366u, 3242362684u, 0u, 3215259086u, 1476395008u, 0, MODF_TOLERANCE, 0}, +{ 603, 3199083880u, 1346862963u, 2147483648u, 0u, 3199083880u, 1346862963u, 0, MODF_TOLERANCE, 0}, +{ 604, 1077836259u, 3604666660u, 1077805056u, 0u, 1071544565u, 3065399552u, 0, MODF_TOLERANCE, 0}, +{ 605, 3212255979u, 3115209742u, 2147483648u, 0u, 3212255979u, 3115209742u, 0, MODF_TOLERANCE, 0}, +{ 606, 1099332326u, 1325101950u, 1099332326u, 1207959552u, 1072426445u, 4160749568u, 0, MODF_TOLERANCE, 0}, +{ 607, 3224546042u, 3889223100u, 3224502272u, 0u, 3219480412u, 4196054912u, 0, MODF_TOLERANCE, 0}, +{ 608, 1053247613u, 3371396923u, 0u, 0u, 1053247613u, 3371396923u, 0, MODF_TOLERANCE, 0}, +{ 609, 3220477868u, 4163120793u, 3220176896u, 0u, 3218235059u, 3767581284u, 0, MODF_TOLERANCE, 0}, +{ 610, 1075022670u, 1387631215u, 1074790400u, 0u, 1072454258u, 2511115128u, 0, MODF_TOLERANCE, 0}, +{ 611, 3205481779u, 1532426189u, 2147483648u, 0u, 3205481779u, 1532426189u, 0, MODF_TOLERANCE, 0}, +{ 612, 1063168268u, 3397022615u, 0u, 0u, 1063168268u, 3397022615u, 0, MODF_TOLERANCE, 0}, +{ 613, 3201033321u, 89324166u, 2147483648u, 0u, 3201033321u, 89324166u, 0, MODF_TOLERANCE, 0}, +{ 614, 1079206060u, 3429424710u, 1079197696u, 0u, 1071666790u, 879698688u, 0, MODF_TOLERANCE, 0}, +{ 615, 3192325102u, 747591401u, 2147483648u, 0u, 3192325102u, 747591401u, 0, MODF_TOLERANCE, 0}, +{ 616, 1072238381u, 2803213904u, 0u, 0u, 1072238381u, 2803213904u, 0, MODF_TOLERANCE, 0}, +{ 617, 1091113780u, 271904221u, 1091113776u, 0u, 1071661267u, 3077832704u, 0, MODF_TOLERANCE, 0}, +{ 618, 1044258318u, 1858545114u, 0u, 0u, 1044258318u, 1858545114u, 0, MODF_TOLERANCE, 0}, +{ 619, 3228068914u, 314958082u, 3228065792u, 0u, 3218629669u, 2344748032u, 0, MODF_TOLERANCE, 0}, +{ 620, 3249912496u, 2966213175u, 3249912496u, 2952790016u, 3219757638u, 3758096384u, 0, MODF_TOLERANCE, 0}, +{ 621, 3197179414u, 3119528953u, 2147483648u, 0u, 3197179414u, 3119528953u, 0, MODF_TOLERANCE, 0}, +{ 622, 3217179014u, 2908718240u, 2147483648u, 0u, 3217179014u, 2908718240u, 0, MODF_TOLERANCE, 0}, +{ 623, 3242467576u, 2018361566u, 3242467576u, 0u, 3220050800u, 931135488u, 0, MODF_TOLERANCE, 0}, +{ 624, 1100926600u, 3985805054u, 1100926600u, 3959422976u, 1071196399u, 3758096384u, 0, MODF_TOLERANCE, 0}, +{ 625, 1070132580u, 409584884u, 0u, 0u, 1070132580u, 409584884u, 0, MODF_TOLERANCE, 0}, +{ 626, 3239758947u, 755795129u, 3239758944u, 0u, 3219744868u, 633864192u, 0, MODF_TOLERANCE, 0}, +{ 627, 1075772446u, 1819156379u, 1075576832u, 0u, 1072161011u, 1668349144u, 0, MODF_TOLERANCE, 0}, +{ 628, 3251342302u, 2982669005u, 3251342302u, 2977955840u, 3219258035u, 1073741824u, 0, MODF_TOLERANCE, 0}, +{ 629, 1101563433u, 2080534280u, 1101563433u, 2080374784u, 1064532032u, 0u, 0, MODF_TOLERANCE, 0}, +{ 630, 3188254060u, 449171797u, 2147483648u, 0u, 3188254060u, 449171797u, 0, MODF_TOLERANCE, 0}, +{ 631, 1095956900u, 168744837u, 1095956900u, 0u, 1069817263u, 167772160u, 0, MODF_TOLERANCE, 0}, +{ 632, 3214950009u, 1322217822u, 2147483648u, 0u, 3214950009u, 1322217822u, 0, MODF_TOLERANCE, 0}, +{ 633, 3254226900u, 3250487255u, 3254226900u, 3249537024u, 3219980206u, 0u, 0, MODF_TOLERANCE, 0}, +{ 634, 1062120700u, 1876195180u, 0u, 0u, 1062120700u, 1876195180u, 0, MODF_TOLERANCE, 0}, +{ 635, 3226343480u, 1336400247u, 3226337280u, 0u, 3217569871u, 2816046848u, 0, MODF_TOLERANCE, 0}, +{ 636, 1098057903u, 3314079581u, 1098057903u, 3221225472u, 1070998365u, 1946157056u, 0, MODF_TOLERANCE, 0}, +{ 637, 3203678820u, 265025555u, 2147483648u, 0u, 3203678820u, 265025555u, 0, MODF_TOLERANCE, 0}, +{ 638, 1063854282u, 3779482256u, 0u, 0u, 1063854282u, 3779482256u, 0, MODF_TOLERANCE, 0}, +{ 639, 1067300501u, 887044257u, 0u, 0u, 1067300501u, 887044257u, 0, MODF_TOLERANCE, 0}, +{ 640, 1054789618u, 2732056261u, 0u, 0u, 1054789618u, 2732056261u, 0, MODF_TOLERANCE, 0}, +{ 641, 1050106742u, 4027115185u, 0u, 0u, 1050106742u, 4027115185u, 0, MODF_TOLERANCE, 0}, +{ 642, 3191764868u, 2940199511u, 2147483648u, 0u, 3191764868u, 2940199511u, 0, MODF_TOLERANCE, 0}, +{ 643, 3202500155u, 2875684421u, 2147483648u, 0u, 3202500155u, 2875684421u, 0, MODF_TOLERANCE, 0}, +{ 644, 3227459837u, 2251967570u, 3227451392u, 0u, 3219160771u, 489040128u, 0, MODF_TOLERANCE, 0}, +{ 645, 1063244412u, 284173546u, 0u, 0u, 1063244412u, 284173546u, 0, MODF_TOLERANCE, 0}, +{ 646, 3238823679u, 3557800647u, 3238823672u, 0u, 3220131902u, 3944480768u, 0, MODF_TOLERANCE, 0}, +{ 647, 1101458560u, 3147771266u, 1101458560u, 3120562176u, 1072296664u, 536870912u, 0, MODF_TOLERANCE, 0}, +{ 648, 3220110464u, 2933364246u, 2147483648u, 0u, 3220110464u, 2933364246u, 0, MODF_TOLERANCE, 0}, +{ 649, 1064853160u, 3366183281u, 0u, 0u, 1064853160u, 3366183281u, 0, MODF_TOLERANCE, 0}, +{ 650, 3234870843u, 537442654u, 3234870784u, 0u, 3220017156u, 1554972672u, 0, MODF_TOLERANCE, 0}, +{ 651, 3244118788u, 2529029548u, 3244118788u, 2147483648u, 3218521581u, 2885681152u, 0, MODF_TOLERANCE, 0}, +{ 652, 3249882819u, 3781513577u, 3249882819u, 3774873600u, 3218691162u, 1073741824u, 0, MODF_TOLERANCE, 0}, +{ 653, 3213436354u, 1080845539u, 2147483648u, 0u, 3213436354u, 1080845539u, 0, MODF_TOLERANCE, 0}, +{ 654, 3206760016u, 911778687u, 2147483648u, 0u, 3206760016u, 911778687u, 0, MODF_TOLERANCE, 0}, +{ 655, 3191951036u, 469586759u, 2147483648u, 0u, 3191951036u, 469586759u, 0, MODF_TOLERANCE, 0}, +{ 656, 1091830022u, 3080528840u, 1091830020u, 0u, 1072020713u, 507510784u, 0, MODF_TOLERANCE, 0}, +{ 657, 1080249104u, 2863108169u, 1080246272u, 0u, 1070997845u, 1327534592u, 0, MODF_TOLERANCE, 0}, +{ 658, 3225605506u, 2508274250u, 3225583616u, 0u, 3219480741u, 1615762048u, 0, MODF_TOLERANCE, 0}, +{ 659, 3210826984u, 4080017377u, 2147483648u, 0u, 3210826984u, 4080017377u, 0, MODF_TOLERANCE, 0}, +{ 660, 3206492941u, 1470284690u, 2147483648u, 0u, 3206492941u, 1470284690u, 0, MODF_TOLERANCE, 0}, +{ 661, 3207120390u, 3867917386u, 2147483648u, 0u, 3207120390u, 3867917386u, 0, MODF_TOLERANCE, 0}, +{ 662, 1102054928u, 3504746045u, 1102054928u, 3489660928u, 1072481735u, 2684354560u, 0, MODF_TOLERANCE, 0}, +{ 663, 1064522279u, 2962134101u, 0u, 0u, 1064522279u, 2962134101u, 0, MODF_TOLERANCE, 0}, +{ 664, 3244741577u, 3390537350u, 3244741577u, 3221225472u, 3218353917u, 201326592u, 0, MODF_TOLERANCE, 0}, +{ 665, 1088201813u, 1702237980u, 1088201792u, 0u, 1070949750u, 387710976u, 0, MODF_TOLERANCE, 0}, +{ 666, 1071598971u, 1102587474u, 0u, 0u, 1071598971u, 1102587474u, 0, MODF_TOLERANCE, 0}, +{ 667, 3202970118u, 2180218657u, 2147483648u, 0u, 3202970118u, 2180218657u, 0, MODF_TOLERANCE, 0}, +{ 668, 3211592260u, 1206527853u, 2147483648u, 0u, 3211592260u, 1206527853u, 0, MODF_TOLERANCE, 0}, +{ 669, 3197084744u, 394130786u, 2147483648u, 0u, 3197084744u, 394130786u, 0, MODF_TOLERANCE, 0}, +{ 670, 3242511482u, 2437699868u, 3242511482u, 2147483648u, 3217116249u, 469762048u, 0, MODF_TOLERANCE, 0}, +{ 671, 1044237059u, 849581558u, 0u, 0u, 1044237059u, 849581558u, 0, MODF_TOLERANCE, 0}, +{ 672, 3252006507u, 2008614943u, 3252006507u, 2004877312u, 3219948559u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 673, 3210140014u, 3128971673u, 2147483648u, 0u, 3210140014u, 3128971673u, 0, MODF_TOLERANCE, 0}, +{ 674, 3249137531u, 2773583059u, 3249137531u, 2751463424u, 3219462221u, 805306368u, 0, MODF_TOLERANCE, 0}, +{ 675, 1085029866u, 590727700u, 1085029376u, 0u, 1072603699u, 1554071552u, 0, MODF_TOLERANCE, 0}, +{ 676, 3248651761u, 2183878539u, 3248651761u, 2181038080u, 3216354245u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 677, 1101098629u, 820687580u, 1101098629u, 805306368u, 1071470171u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 678, 3208143496u, 1402434664u, 2147483648u, 0u, 3208143496u, 1402434664u, 0, MODF_TOLERANCE, 0}, +{ 679, 3252290835u, 1873709254u, 3252290835u, 1870659584u, 3219604579u, 0u, 0, MODF_TOLERANCE, 0}, +{ 680, 3245167989u, 44275991u, 3245167989u, 0u, 3216317640u, 3087007744u, 0, MODF_TOLERANCE, 0}, +{ 681, 3189668753u, 1174874204u, 2147483648u, 0u, 3189668753u, 1174874204u, 0, MODF_TOLERANCE, 0}, +{ 682, 3208263730u, 2360372288u, 2147483648u, 0u, 3208263730u, 2360372288u, 0, MODF_TOLERANCE, 0}, +{ 683, 1103854676u, 937573440u, 1103854676u, 931135488u, 1072205584u, 0u, 0, MODF_TOLERANCE, 0}, +{ 684, 3208953761u, 211240241u, 2147483648u, 0u, 3208953761u, 211240241u, 0, MODF_TOLERANCE, 0}, +{ 685, 3243548934u, 2469774991u, 3243548934u, 2147483648u, 3218290118u, 2399141888u, 0, MODF_TOLERANCE, 0}, +{ 686, 1043117070u, 3380071805u, 0u, 0u, 1043117070u, 3380071805u, 0, MODF_TOLERANCE, 0}, +{ 687, 1058121042u, 442507560u, 0u, 0u, 1058121042u, 442507560u, 0, MODF_TOLERANCE, 0}, +{ 688, 3254252803u, 3257889649u, 3254252803u, 3256877056u, 3220104930u, 0u, 0, MODF_TOLERANCE, 0}, +{ 689, 1068850520u, 1854921625u, 0u, 0u, 1068850520u, 1854921625u, 0, MODF_TOLERANCE, 0}, +{ 690, 1049810168u, 2729627545u, 0u, 0u, 1049810168u, 2729627545u, 0, MODF_TOLERANCE, 0}, +{ 691, 3254712629u, 4001809575u, 3254712629u, 4001366016u, 3218805404u, 0u, 0, MODF_TOLERANCE, 0}, +{ 692, 3240128649u, 278261523u, 3240128648u, 0u, 3219196254u, 4046454784u, 0, MODF_TOLERANCE, 0}, +{ 693, 1087224694u, 1793907966u, 1087224576u, 0u, 1072536251u, 926908416u, 0, MODF_TOLERANCE, 0}, +{ 694, 3238955714u, 398859249u, 3238955712u, 0u, 3218128432u, 3750232064u, 0, MODF_TOLERANCE, 0}, +{ 695, 3200952547u, 2511916952u, 2147483648u, 0u, 3200952547u, 2511916952u, 0, MODF_TOLERANCE, 0}, +{ 696, 3219195283u, 1697158299u, 2147483648u, 0u, 3219195283u, 1697158299u, 0, MODF_TOLERANCE, 0}, +{ 697, 1069985548u, 3230931724u, 0u, 0u, 1069985548u, 3230931724u, 0, MODF_TOLERANCE, 0}, +{ 698, 3243897690u, 3508781585u, 3243897690u, 3221225472u, 3218154434u, 285212672u, 0, MODF_TOLERANCE, 0}, +{ 699, 1103847606u, 1674254897u, 1103847606u, 1669332992u, 1071826572u, 1073741824u, 0, MODF_TOLERANCE, 0}, +{ 700, 1046547577u, 217148561u, 0u, 0u, 1046547577u, 217148561u, 0, MODF_TOLERANCE, 0}, +{ 701, 3211263954u, 3275604304u, 2147483648u, 0u, 3211263954u, 3275604304u, 0, MODF_TOLERANCE, 0}, +{ 702, 3194840159u, 2991205850u, 2147483648u, 0u, 3194840159u, 2991205850u, 0, MODF_TOLERANCE, 0}, +{ 703, 3195249375u, 3509997278u, 2147483648u, 0u, 3195249375u, 3509997278u, 0, MODF_TOLERANCE, 0}, +{ 704, 3248888030u, 3897986511u, 3248888030u, 3892314112u, 3217400691u, 3221225472u, 0, MODF_TOLERANCE, 0}, +{ 705, 1047182435u, 2156824613u, 0u, 0u, 1047182435u, 2156824613u, 0, MODF_TOLERANCE, 0}, +{ 706, 1042295665u, 1239257646u, 0u, 0u, 1042295665u, 1239257646u, 0, MODF_TOLERANCE, 0}, +{ 707, 3213264085u, 1073153314u, 2147483648u, 0u, 3213264085u, 1073153314u, 0, MODF_TOLERANCE, 0}, +{ 708, 3250031627u, 2567234990u, 3250031627u, 2566914048u, 3214120632u, 0u, 0, MODF_TOLERANCE, 0}, +{ 709, 3190593412u, 4261696995u, 2147483648u, 0u, 3190593412u, 4261696995u, 0, MODF_TOLERANCE, 0}, +{ 710, 3197784432u, 323702024u, 2147483648u, 0u, 3197784432u, 323702024u, 0, MODF_TOLERANCE, 0}, +{ 711, 3243690997u, 4075177615u, 3243690997u, 3221225472u, 3219747619u, 1199570944u, 0, MODF_TOLERANCE, 0}, +{ 712, 3202791065u, 1919006082u, 2147483648u, 0u, 3202791065u, 1919006082u, 0, MODF_TOLERANCE, 0}, +{ 713, 3239270013u, 386429966u, 3239270012u, 0u, 3218174087u, 1088421888u, 0, MODF_TOLERANCE, 0}, +{ 714, 1086504491u, 3698826164u, 1086504448u, 0u, 1070984763u, 3453616128u, 0, MODF_TOLERANCE, 0}, +{ 715, 1078327190u, 1681986446u, 1078296576u, 0u, 1072555417u, 272950144u, 0, MODF_TOLERANCE, 0}, +{ 716, 3194985869u, 3072950140u, 2147483648u, 0u, 3194985869u, 3072950140u, 0, MODF_TOLERANCE, 0}, +{ 717, 3217311933u, 3719038997u, 2147483648u, 0u, 3217311933u, 3719038997u, 0, MODF_TOLERANCE, 0}, +{ 718, 1055433962u, 3331415058u, 0u, 0u, 1055433962u, 3331415058u, 0, MODF_TOLERANCE, 0}, +{ 719, 1060749713u, 2420250111u, 0u, 0u, 1060749713u, 2420250111u, 0, MODF_TOLERANCE, 0}, +{ 720, 3238002206u, 1928661079u, 3238002192u, 0u, 3219973610u, 279838720u, 0, MODF_TOLERANCE, 0}, +{ 721, 1081914210u, 3679866727u, 1081913344u, 0u, 1070274266u, 2994419712u, 0, MODF_TOLERANCE, 0}, +{ 722, 3227386672u, 1273835792u, 3227385856u, 0u, 3215557215u, 1770553344u, 0, MODF_TOLERANCE, 0}, +{ 723, 1041622738u, 2682092368u, 0u, 0u, 1041622738u, 2682092368u, 0, MODF_TOLERANCE, 0}, +{ 724, 3234222284u, 1325425811u, 3234222208u, 0u, 3219329984u, 421838848u, 0, MODF_TOLERANCE, 0}, +{ 725, 1056312613u, 4175172697u, 0u, 0u, 1056312613u, 4175172697u, 0, MODF_TOLERANCE, 0}, +{ 726, 3208346191u, 2130706153u, 2147483648u, 0u, 3208346191u, 2130706153u, 0, MODF_TOLERANCE, 0}, +{ 727, 1092089624u, 1200784450u, 1092089624u, 0u, 1068623009u, 276824064u, 0, MODF_TOLERANCE, 0}, +{ 728, 1083605096u, 1248595607u, 1083604992u, 0u, 1069159067u, 61194240u, 0, MODF_TOLERANCE, 0}, +{ 729, 3213890863u, 1897285171u, 2147483648u, 0u, 3213890863u, 1897285171u, 0, MODF_TOLERANCE, 0}, +{ 730, 3251296075u, 944966123u, 3251296075u, 939524096u, 3219440250u, 3221225472u, 0, MODF_TOLERANCE, 0}, +{ 731, 3241371250u, 2270747330u, 3241371250u, 0u, 3219188507u, 1480589312u, 0, MODF_TOLERANCE, 0}, +{ 732, 3230692631u, 422503284u, 3230692352u, 0u, 3218174354u, 3996598272u, 0, MODF_TOLERANCE, 0}, +{ 733, 1084120037u, 2857564741u, 1084119040u, 0u, 1072639314u, 2547132416u, 0, MODF_TOLERANCE, 0}, +{ 734, 1075647403u, 3308906709u, 1075576832u, 0u, 1070676668u, 1402899792u, 0, MODF_TOLERANCE, 0}, +{ 735, 3203475098u, 1380066948u, 2147483648u, 0u, 3203475098u, 1380066948u, 0, MODF_TOLERANCE, 0}, +{ 736, 3232612906u, 2613634294u, 3232612864u, 0u, 3216330212u, 1920663552u, 0, MODF_TOLERANCE, 0}, +{ 737, 1063890856u, 4022784584u, 0u, 0u, 1063890856u, 4022784584u, 0, MODF_TOLERANCE, 0}, +{ 738, 1060483857u, 3264056381u, 0u, 0u, 1060483857u, 3264056381u, 0, MODF_TOLERANCE, 0}, +{ 739, 1044637404u, 1778509100u, 0u, 0u, 1044637404u, 1778509100u, 0, MODF_TOLERANCE, 0}, +{ 740, 3213146285u, 2665833973u, 2147483648u, 0u, 3213146285u, 2665833973u, 0, MODF_TOLERANCE, 0}, +{ 741, 3216727300u, 1859175955u, 2147483648u, 0u, 3216727300u, 1859175955u, 0, MODF_TOLERANCE, 0}, +{ 742, 1079949560u, 4258450607u, 1079934976u, 0u, 1072462974u, 3915798400u, 0, MODF_TOLERANCE, 0}, +{ 743, 1048277388u, 4128020197u, 0u, 0u, 1048277388u, 4128020197u, 0, MODF_TOLERANCE, 0}, +{ 744, 1076266146u, 4122840980u, 1076232192u, 0u, 1070634078u, 3081892480u, 0, MODF_TOLERANCE, 0}, +{ 745, 3193183163u, 2454653987u, 2147483648u, 0u, 3193183163u, 2454653987u, 0, MODF_TOLERANCE, 0}, +{ 746, 3229487005u, 2977478685u, 3229483008u, 0u, 3220126562u, 4050663936u, 0, MODF_TOLERANCE, 0}, +{ 747, 3253556483u, 1355181872u, 3253556483u, 1354760192u, 3217669312u, 0u, 0, MODF_TOLERANCE, 0}, +{ 748, 1095308770u, 436846481u, 1095308770u, 0u, 1070205375u, 2432696320u, 0, MODF_TOLERANCE, 0}, +{ 749, 3246605302u, 2592856453u, 3246605302u, 2550136832u, 3218366156u, 671088640u, 0, MODF_TOLERANCE, 0}, +{ 750, 3247825559u, 3195234082u, 3247825559u, 3154116608u, 3219364665u, 268435456u, 0, MODF_TOLERANCE, 0}, +{ 751, 3222118023u, 3554670043u, 3221749760u, 0u, 3219552799u, 1333778284u, 0, MODF_TOLERANCE, 0}, +{ 752, 1091621009u, 3321236467u, 1091621008u, 0u, 1071406944u, 3207593984u, 0, MODF_TOLERANCE, 0}, +{ 753, 1069012833u, 1936670355u, 0u, 0u, 1069012833u, 1936670355u, 0, MODF_TOLERANCE, 0}, +{ 754, 1095715713u, 2958468553u, 1095715713u, 2147483648u, 1071131474u, 3833593856u, 0, MODF_TOLERANCE, 0}, +{ 755, 3192291109u, 2960339502u, 2147483648u, 0u, 3192291109u, 2960339502u, 0, MODF_TOLERANCE, 0}, +{ 756, 1098808013u, 1044068983u, 1098808013u, 805306368u, 1072461428u, 3992977408u, 0, MODF_TOLERANCE, 0}, +{ 757, 3196691185u, 4093388677u, 2147483648u, 0u, 3196691185u, 4093388677u, 0, MODF_TOLERANCE, 0}, +{ 758, 1095478112u, 1735930261u, 1095478112u, 0u, 1072291340u, 1698693120u, 0, MODF_TOLERANCE, 0}, +{ 759, 1091040302u, 1807398746u, 1091040296u, 0u, 1072279274u, 3714580480u, 0, MODF_TOLERANCE, 0}, +{ 760, 3195743135u, 4261616162u, 2147483648u, 0u, 3195743135u, 4261616162u, 0, MODF_TOLERANCE, 0}, +{ 761, 3209294194u, 3250576797u, 2147483648u, 0u, 3209294194u, 3250576797u, 0, MODF_TOLERANCE, 0}, +{ 762, 1059002384u, 3043079652u, 0u, 0u, 1059002384u, 3043079652u, 0, MODF_TOLERANCE, 0}, +{ 763, 1069207109u, 666051428u, 0u, 0u, 1069207109u, 666051428u, 0, MODF_TOLERANCE, 0}, +{ 764, 3208765404u, 1912684117u, 2147483648u, 0u, 3208765404u, 1912684117u, 0, MODF_TOLERANCE, 0}, +{ 765, 1103487420u, 1949030179u, 1103487420u, 1946157056u, 1070984081u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 766, 1096388934u, 896459246u, 1096388934u, 0u, 1072346992u, 4143972352u, 0, MODF_TOLERANCE, 0}, +{ 767, 1054300653u, 622499767u, 0u, 0u, 1054300653u, 622499767u, 0, MODF_TOLERANCE, 0}, +{ 768, 1066707637u, 1490260486u, 0u, 0u, 1066707637u, 1490260486u, 0, MODF_TOLERANCE, 0}, +{ 769, 1106688493u, 1490616165u, 1106688493u, 1490026496u, 1071775434u, 0u, 0, MODF_TOLERANCE, 0}, +{ 770, 3251242436u, 795675736u, 3251242436u, 788529152u, 3219866390u, 0u, 0, MODF_TOLERANCE, 0}, +{ 771, 1080943896u, 3662877092u, 1080942592u, 0u, 1069835113u, 1279692800u, 0, MODF_TOLERANCE, 0}, +{ 772, 3234317146u, 3200513112u, 3234317056u, 0u, 3219566512u, 4246077440u, 0, MODF_TOLERANCE, 0}, +{ 773, 1084088786u, 1356101968u, 1084088320u, 0u, 1071457549u, 1200947200u, 0, MODF_TOLERANCE, 0}, +{ 774, 3236536816u, 3062844611u, 3236536800u, 0u, 3219175055u, 1287847936u, 0, MODF_TOLERANCE, 0}, +{ 775, 3219922640u, 2284484846u, 2147483648u, 0u, 3219922640u, 2284484846u, 0, MODF_TOLERANCE, 0}, +{ 776, 3219498359u, 3240896015u, 2147483648u, 0u, 3219498359u, 3240896015u, 0, MODF_TOLERANCE, 0}, +{ 777, 3235759689u, 494503287u, 3235759680u, 0u, 3217177331u, 183369728u, 0, MODF_TOLERANCE, 0}, +{ 778, 1092811254u, 142673998u, 1092811254u, 0u, 1066467856u, 2617245696u, 0, MODF_TOLERANCE, 0}, +{ 779, 3252125916u, 3394882641u, 3252125916u, 3393191936u, 3218721873u, 0u, 0, MODF_TOLERANCE, 0}, +{ 780, 3225306538u, 364852125u, 3225288704u, 0u, 3218172549u, 1875699520u, 0, MODF_TOLERANCE, 0}, +{ 781, 3225261763u, 193885269u, 3225223168u, 0u, 3219314785u, 1909361312u, 0, MODF_TOLERANCE, 0}, +{ 782, 1088149839u, 1359805831u, 1088149824u, 0u, 1070506521u, 4211998720u, 0, MODF_TOLERANCE, 0}, +{ 783, 3200484782u, 592580907u, 2147483648u, 0u, 3200484782u, 592580907u, 0, MODF_TOLERANCE, 0}, +{ 784, 3199560872u, 3086438952u, 2147483648u, 0u, 3199560872u, 3086438952u, 0, MODF_TOLERANCE, 0}, +{ 785, 1059518664u, 1778008540u, 0u, 0u, 1059518664u, 1778008540u, 0, MODF_TOLERANCE, 0}, +{ 786, 1049064687u, 73581647u, 0u, 0u, 1049064687u, 73581647u, 0, MODF_TOLERANCE, 0}, +{ 787, 3246733598u, 233240285u, 3246733598u, 134217728u, 3219626971u, 1946157056u, 0, MODF_TOLERANCE, 0}, +{ 788, 1081923320u, 2710903921u, 1081921536u, 0u, 1071374982u, 1416741888u, 0, MODF_TOLERANCE, 0}, +{ 789, 1069513767u, 3719878805u, 0u, 0u, 1069513767u, 3719878805u, 0, MODF_TOLERANCE, 0}, +{ 790, 1079866720u, 3615458228u, 1079853056u, 0u, 1072345195u, 3217152512u, 0, MODF_TOLERANCE, 0}, +{ 791, 3221194724u, 3647632375u, 3220176896u, 0u, 3220115401u, 3000297454u, 0, MODF_TOLERANCE, 0}, +{ 792, 3247225271u, 3839959621u, 3247225271u, 3758096384u, 3219358857u, 335544320u, 0, MODF_TOLERANCE, 0}, +{ 793, 1103401096u, 2232210456u, 1103401096u, 2231369728u, 1069131824u, 0u, 0, MODF_TOLERANCE, 0}, +{ 794, 3235434773u, 224271737u, 3235434752u, 0u, 3218410846u, 494469120u, 0, MODF_TOLERANCE, 0}, +{ 795, 3193003684u, 2134662911u, 2147483648u, 0u, 3193003684u, 2134662911u, 0, MODF_TOLERANCE, 0}, +{ 796, 3190390590u, 4239009051u, 2147483648u, 0u, 3190390590u, 4239009051u, 0, MODF_TOLERANCE, 0}, +{ 797, 1080526145u, 2305279897u, 1080524800u, 0u, 1069876773u, 2669569024u, 0, MODF_TOLERANCE, 0}, +{ 798, 1077668039u, 1854523320u, 1077608448u, 0u, 1072503021u, 3510171392u, 0, MODF_TOLERANCE, 0}, +{ 799, 3219864259u, 538224650u, 2147483648u, 0u, 3219864259u, 538224650u, 0, MODF_TOLERANCE, 0}, +{ 800, 3206153057u, 1379649610u, 2147483648u, 0u, 3206153057u, 1379649610u, 0, MODF_TOLERANCE, 0}, +{ 801, 3196410507u, 3683897920u, 2147483648u, 0u, 3196410507u, 3683897920u, 0, MODF_TOLERANCE, 0}, +{ 802, 3244167599u, 3647579469u, 3244167599u, 3221225472u, 3218696613u, 1291845632u, 0, MODF_TOLERANCE, 0}, +{ 803, 1090280933u, 2694093608u, 1090280928u, 0u, 1071022674u, 1822425088u, 0, MODF_TOLERANCE, 0}, +{ 804, 1042775347u, 598406111u, 0u, 0u, 1042775347u, 598406111u, 0, MODF_TOLERANCE, 0}, +{ 805, 3211635392u, 872706833u, 2147483648u, 0u, 3211635392u, 872706833u, 0, MODF_TOLERANCE, 0}, +{ 806, 1084802480u, 2200602798u, 1084802048u, 0u, 1072367666u, 2827673600u, 0, MODF_TOLERANCE, 0}, +{ 807, 1042339597u, 904146293u, 0u, 0u, 1042339597u, 904146293u, 0, MODF_TOLERANCE, 0}, +{ 808, 1060867322u, 1729685598u, 0u, 0u, 1060867322u, 1729685598u, 0, MODF_TOLERANCE, 0}, +{ 809, 3195694970u, 1894173462u, 2147483648u, 0u, 3195694970u, 1894173462u, 0, MODF_TOLERANCE, 0}, +{ 810, 3232800651u, 191960416u, 3232800512u, 0u, 3219218798u, 581697536u, 0, MODF_TOLERANCE, 0}, +{ 811, 1091225343u, 3521028551u, 1091225336u, 0u, 1072646010u, 2266759168u, 0, MODF_TOLERANCE, 0}, +{ 812, 1054522089u, 3287274359u, 0u, 0u, 1054522089u, 3287274359u, 0, MODF_TOLERANCE, 0}, +{ 813, 1095386964u, 959640601u, 1095386964u, 0u, 1071421818u, 209715200u, 0, MODF_TOLERANCE, 0}, +{ 814, 3201578263u, 4136915018u, 2147483648u, 0u, 3201578263u, 4136915018u, 0, MODF_TOLERANCE, 0}, +{ 815, 1064005451u, 1553716379u, 0u, 0u, 1064005451u, 1553716379u, 0, MODF_TOLERANCE, 0}, +{ 816, 1106027987u, 984725765u, 1106027987u, 983564288u, 1071757573u, 0u, 0, MODF_TOLERANCE, 0}, +{ 817, 3238832641u, 2287646644u, 3238832640u, 0u, 3217589675u, 2067791872u, 0, MODF_TOLERANCE, 0}, +{ 818, 3240329321u, 2276183378u, 3240329320u, 0u, 3219684028u, 3575644160u, 0, MODF_TOLERANCE, 0}, +{ 819, 1068209174u, 3940225170u, 0u, 0u, 1068209174u, 3940225170u, 0, MODF_TOLERANCE, 0}, +{ 820, 3199544434u, 997572161u, 2147483648u, 0u, 3199544434u, 997572161u, 0, MODF_TOLERANCE, 0}, +{ 821, 3212768361u, 36116288u, 2147483648u, 0u, 3212768361u, 36116288u, 0, MODF_TOLERANCE, 0}, +{ 822, 3206886566u, 4196602670u, 2147483648u, 0u, 3206886566u, 4196602670u, 0, MODF_TOLERANCE, 0}, +{ 823, 3241695853u, 3550227562u, 3241695853u, 0u, 3219813253u, 2369781760u, 0, MODF_TOLERANCE, 0}, +{ 824, 3207257983u, 2747744117u, 2147483648u, 0u, 3207257983u, 2747744117u, 0, MODF_TOLERANCE, 0}, +{ 825, 1104236126u, 507130047u, 1104236126u, 503316480u, 1072502879u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 826, 1048359321u, 3229888373u, 0u, 0u, 1048359321u, 3229888373u, 0, MODF_TOLERANCE, 0}, +{ 827, 3222996778u, 2210969014u, 3222798336u, 0u, 3219667284u, 507882928u, 0, MODF_TOLERANCE, 0}, +{ 828, 1081031001u, 1946786091u, 1081024512u, 0u, 1072257396u, 161032960u, 0, MODF_TOLERANCE, 0}, +{ 829, 3236306990u, 4059150589u, 3236306976u, 0u, 3218990051u, 1912209408u, 0, MODF_TOLERANCE, 0}, +{ 830, 3189759234u, 1177045799u, 2147483648u, 0u, 3189759234u, 1177045799u, 0, MODF_TOLERANCE, 0}, +{ 831, 1093103612u, 2664812822u, 1093103612u, 0u, 1070848698u, 583008256u, 0, MODF_TOLERANCE, 0}, +{ 832, 1050343198u, 2034180320u, 0u, 0u, 1050343198u, 2034180320u, 0, MODF_TOLERANCE, 0}, +{ 833, 3213779117u, 1175750283u, 2147483648u, 0u, 3213779117u, 1175750283u, 0, MODF_TOLERANCE, 0}, +{ 834, 3235559706u, 1424491340u, 3235559680u, 0u, 3218756840u, 55312384u, 0, MODF_TOLERANCE, 0}, +{ 835, 3213904193u, 1630036121u, 2147483648u, 0u, 3213904193u, 1630036121u, 0, MODF_TOLERANCE, 0}, +{ 836, 3231972785u, 3195479448u, 3231972352u, 0u, 3219856359u, 1918468096u, 0, MODF_TOLERANCE, 0}, +{ 837, 1090429875u, 2527029044u, 1090429872u, 0u, 1070380283u, 966787072u, 0, MODF_TOLERANCE, 0}, +{ 838, 1046927050u, 4000723255u, 0u, 0u, 1046927050u, 4000723255u, 0, MODF_TOLERANCE, 0}, +{ 839, 1085208677u, 3335703647u, 1085208576u, 0u, 1070166452u, 3004678144u, 0, MODF_TOLERANCE, 0}, +{ 840, 3237349676u, 3869440059u, 3237349664u, 0u, 3219770693u, 4034265088u, 0, MODF_TOLERANCE, 0}, +{ 841, 1091433848u, 3888398377u, 1091433848u, 0u, 1069349000u, 85983232u, 0, MODF_TOLERANCE, 0}, +{ 842, 3196041693u, 1290567220u, 2147483648u, 0u, 3196041693u, 1290567220u, 0, MODF_TOLERANCE, 0}, +{ 843, 1066679070u, 3242451480u, 0u, 0u, 1066679070u, 3242451480u, 0, MODF_TOLERANCE, 0}, +{ 844, 3248384948u, 707431021u, 3248384948u, 671088640u, 3219215443u, 1744830464u, 0, MODF_TOLERANCE, 0}, +{ 845, 1083230509u, 2739665123u, 1083230208u, 0u, 1070783028u, 3213766656u, 0, MODF_TOLERANCE, 0}, +{ 846, 1060777905u, 1733073225u, 0u, 0u, 1060777905u, 1733073225u, 0, MODF_TOLERANCE, 0}, +{ 847, 1078517061u, 1297274853u, 1078493184u, 0u, 1072124243u, 1421211968u, 0, MODF_TOLERANCE, 0}, +{ 848, 3208848704u, 3341639139u, 2147483648u, 0u, 3208848704u, 3341639139u, 0, MODF_TOLERANCE, 0}, +{ 849, 1046570941u, 2228057309u, 0u, 0u, 1046570941u, 2228057309u, 0, MODF_TOLERANCE, 0}, +{ 850, 1084318902u, 1317851136u, 1084318720u, 0u, 1071040977u, 2583691264u, 0, MODF_TOLERANCE, 0}, +{ 851, 1088255327u, 270039934u, 1088255296u, 0u, 1071583256u, 2071855104u, 0, MODF_TOLERANCE, 0}, +{ 852, 3241414679u, 3063626339u, 3241414679u, 0u, 3219575655u, 1281359872u, 0, MODF_TOLERANCE, 0}, +{ 853, 3219178350u, 83062251u, 2147483648u, 0u, 3219178350u, 83062251u, 0, MODF_TOLERANCE, 0}, +{ 854, 3211262173u, 2659016437u, 2147483648u, 0u, 3211262173u, 2659016437u, 0, MODF_TOLERANCE, 0}, +{ 855, 1095743886u, 3833539373u, 1095743886u, 2147483648u, 1072242634u, 3409969152u, 0, MODF_TOLERANCE, 0}, +{ 856, 3206667189u, 1567476111u, 2147483648u, 0u, 3206667189u, 1567476111u, 0, MODF_TOLERANCE, 0}, +{ 857, 3205195072u, 2382776852u, 2147483648u, 0u, 3205195072u, 2382776852u, 0, MODF_TOLERANCE, 0}, +{ 858, 3249232579u, 1546622468u, 3249232579u, 1543503872u, 3216493314u, 0u, 0, MODF_TOLERANCE, 0}, +{ 859, 1085536439u, 1714300821u, 1085536256u, 0u, 1072098501u, 3304235008u, 0, MODF_TOLERANCE, 0}, +{ 860, 1104130938u, 4167591598u, 1104130938u, 4160749568u, 1072306603u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 861, 1051092760u, 2798720100u, 0u, 0u, 1051092760u, 2798720100u, 0, MODF_TOLERANCE, 0}, +{ 862, 1086978789u, 449990704u, 1086978688u, 0u, 1072252596u, 2483814400u, 0, MODF_TOLERANCE, 0}, +{ 863, 3231198415u, 4039516226u, 3231198208u, 0u, 3217686040u, 3288875008u, 0, MODF_TOLERANCE, 0}, +{ 864, 3244344107u, 4272932619u, 3244344107u, 3758096384u, 3220090823u, 184549376u, 0, MODF_TOLERANCE, 0}, +{ 865, 3222708441u, 1683007544u, 3222536192u, 0u, 3219457739u, 579158464u, 0, MODF_TOLERANCE, 0}, +{ 866, 1091105663u, 3805494321u, 1091105656u, 0u, 1072663372u, 4039376896u, 0, MODF_TOLERANCE, 0}, +{ 867, 3220852948u, 2072627412u, 3220176896u, 0u, 3219431848u, 4145254824u, 0, MODF_TOLERANCE, 0}, +{ 868, 1094383324u, 3394151662u, 1094383324u, 0u, 1072253396u, 2646605824u, 0, MODF_TOLERANCE, 0}, +{ 869, 3220570024u, 1120106427u, 3220176896u, 0u, 3218603681u, 185458412u, 0, MODF_TOLERANCE, 0}, +{ 870, 3223631624u, 3404608264u, 3223584768u, 0u, 3218530585u, 1573282048u, 0, MODF_TOLERANCE, 0}, +{ 871, 1097859997u, 559918757u, 1097859997u, 536870912u, 1068890858u, 1342177280u, 0, MODF_TOLERANCE, 0}, +{ 872, 3205077053u, 908100198u, 2147483648u, 0u, 3205077053u, 908100198u, 0, MODF_TOLERANCE, 0}, +{ 873, 1042677918u, 2026673913u, 0u, 0u, 1042677918u, 2026673913u, 0, MODF_TOLERANCE, 0}, +{ 874, 3244833635u, 2844573214u, 3244833635u, 2684354560u, 3218282876u, 1006632960u, 0, MODF_TOLERANCE, 0}, +{ 875, 3254567259u, 3946837259u, 3254567259u, 3945791488u, 3220171286u, 0u, 0, MODF_TOLERANCE, 0}, +{ 876, 3234993796u, 3850406820u, 3234993792u, 0u, 3216217602u, 781189120u, 0, MODF_TOLERANCE, 0}, +{ 877, 1057479809u, 3139330994u, 0u, 0u, 1057479809u, 3139330994u, 0, MODF_TOLERANCE, 0}, +{ 878, 1046133568u, 1539650690u, 0u, 0u, 1046133568u, 1539650690u, 0, MODF_TOLERANCE, 0}, +{ 879, 3236705500u, 1554593884u, 3236705472u, 0u, 3219938473u, 945553408u, 0, MODF_TOLERANCE, 0}, +{ 880, 3228899878u, 2813752562u, 3228897280u, 0u, 3219410255u, 1827267584u, 0, MODF_TOLERANCE, 0}, +{ 881, 1056505004u, 3804703138u, 0u, 0u, 1056505004u, 3804703138u, 0, MODF_TOLERANCE, 0}, +{ 882, 1072931071u, 2053677923u, 1072693248u, 0u, 1070401531u, 3544521496u, 0, MODF_TOLERANCE, 0}, +{ 883, 3244864299u, 289355864u, 3244864299u, 0u, 3219210040u, 1476395008u, 0, MODF_TOLERANCE, 0}, +{ 884, 1078453818u, 2143066338u, 1078427648u, 0u, 1072271007u, 4012259456u, 0, MODF_TOLERANCE, 0}, +{ 885, 3203939880u, 2157691971u, 2147483648u, 0u, 3203939880u, 2157691971u, 0, MODF_TOLERANCE, 0}, +{ 886, 1106629150u, 110806409u, 1106629150u, 110100480u, 1072007954u, 0u, 0, MODF_TOLERANCE, 0}, +{ 887, 1082157019u, 3570399481u, 1082155008u, 0u, 1072656211u, 1071899648u, 0, MODF_TOLERANCE, 0}, +{ 888, 1085637605u, 180265334u, 1085637376u, 0u, 1072472407u, 3559833600u, 0, MODF_TOLERANCE, 0}, +{ 889, 3200980182u, 558779875u, 2147483648u, 0u, 3200980182u, 558779875u, 0, MODF_TOLERANCE, 0}, +{ 890, 3202046748u, 2338464653u, 2147483648u, 0u, 3202046748u, 2338464653u, 0, MODF_TOLERANCE, 0}, +{ 891, 1045705464u, 1703969219u, 0u, 0u, 1045705464u, 1703969219u, 0, MODF_TOLERANCE, 0}, +{ 892, 3229797258u, 1417521063u, 3229796352u, 0u, 3218887331u, 3980212224u, 0, MODF_TOLERANCE, 0}, +{ 893, 3237782261u, 3917440951u, 3237782256u, 0u, 3218580989u, 2665218048u, 0, MODF_TOLERANCE, 0}, +{ 894, 1051668894u, 3736066983u, 0u, 0u, 1051668894u, 3736066983u, 0, MODF_TOLERANCE, 0}, +{ 895, 1064752080u, 3106613409u, 0u, 0u, 1064752080u, 3106613409u, 0, MODF_TOLERANCE, 0}, +{ 896, 1066627453u, 2735392257u, 0u, 0u, 1066627453u, 2735392257u, 0, MODF_TOLERANCE, 0}, +{ 897, 1065665372u, 2229777605u, 0u, 0u, 1065665372u, 2229777605u, 0, MODF_TOLERANCE, 0}, +{ 898, 1065061963u, 2405869925u, 0u, 0u, 1065061963u, 2405869925u, 0, MODF_TOLERANCE, 0}, +{ 899, 3239463229u, 3967957902u, 3239463228u, 0u, 3219048483u, 3101687808u, 0, MODF_TOLERANCE, 0}, +{ 900, 1057416138u, 3459188071u, 0u, 0u, 1057416138u, 3459188071u, 0, MODF_TOLERANCE, 0}, +{ 901, 1068639210u, 3699016825u, 0u, 0u, 1068639210u, 3699016825u, 0, MODF_TOLERANCE, 0}, +{ 902, 3249713090u, 796144848u, 3249713090u, 788529152u, 3218935092u, 0u, 0, MODF_TOLERANCE, 0}, +{ 903, 3228816396u, 3285165564u, 3228815360u, 0u, 3218092815u, 1050144768u, 0, MODF_TOLERANCE, 0}, +{ 904, 3211948811u, 401510871u, 2147483648u, 0u, 3211948811u, 401510871u, 0, MODF_TOLERANCE, 0}, +{ 905, 1094257658u, 634857910u, 1094257658u, 0u, 1069738900u, 3674210304u, 0, MODF_TOLERANCE, 0}, +{ 906, 3199607513u, 914218057u, 2147483648u, 0u, 3199607513u, 914218057u, 0, MODF_TOLERANCE, 0}, +{ 907, 1083743336u, 2030735578u, 1083743232u, 0u, 1069162050u, 2755035136u, 0, MODF_TOLERANCE, 0}, +{ 908, 3233855943u, 965677531u, 3233855872u, 0u, 3219246691u, 3296116736u, 0, MODF_TOLERANCE, 0}, +{ 909, 1079556815u, 3957229084u, 1079541760u, 0u, 1072523253u, 4014149120u, 0, MODF_TOLERANCE, 0}, +{ 910, 1051050470u, 3123776651u, 0u, 0u, 1051050470u, 3123776651u, 0, MODF_TOLERANCE, 0}, +{ 911, 3221863333u, 162122081u, 3221749760u, 0u, 3217799760u, 2593953296u, 0, MODF_TOLERANCE, 0}, +{ 912, 3239376395u, 108064594u, 3239376392u, 0u, 3219665799u, 2056257536u, 0, MODF_TOLERANCE, 0}, +{ 913, 3237271786u, 869031839u, 3237271776u, 0u, 3219416984u, 3208511488u, 0, MODF_TOLERANCE, 0}, +{ 914, 3225020876u, 1344301606u, 3224961024u, 0u, 3219995018u, 67978432u, 0, MODF_TOLERANCE, 0}, +{ 915, 3214433474u, 946696117u, 2147483648u, 0u, 3214433474u, 946696117u, 0, MODF_TOLERANCE, 0}, +{ 916, 3231825228u, 1700703647u, 3231824896u, 0u, 3219441237u, 3940151296u, 0, MODF_TOLERANCE, 0}, +{ 917, 1075492875u, 3394168074u, 1075314688u, 0u, 1072021598u, 1383540816u, 0, MODF_TOLERANCE, 0}, +{ 918, 1076939786u, 1666995668u, 1076887552u, 0u, 1072267596u, 1804253824u, 0, MODF_TOLERANCE, 0}, +{ 919, 3208774795u, 2488789804u, 2147483648u, 0u, 3208774795u, 2488789804u, 0, MODF_TOLERANCE, 0}, +{ 920, 3238508333u, 1506943664u, 3238508328u, 0u, 3219482440u, 2327838720u, 0, MODF_TOLERANCE, 0}, +{ 921, 1072788663u, 3844072288u, 1072693248u, 0u, 1068977022u, 1375614464u, 0, MODF_TOLERANCE, 0}, +{ 922, 3202592279u, 2630019853u, 2147483648u, 0u, 3202592279u, 2630019853u, 0, MODF_TOLERANCE, 0}, +{ 923, 3219934542u, 1244307192u, 2147483648u, 0u, 3219934542u, 1244307192u, 0, MODF_TOLERANCE, 0}, +{ 924, 3191297711u, 2540916692u, 2147483648u, 0u, 3191297711u, 2540916692u, 0, MODF_TOLERANCE, 0}, +{ 925, 3200062692u, 2871645739u, 2147483648u, 0u, 3200062692u, 2871645739u, 0, MODF_TOLERANCE, 0}, +{ 926, 3239081581u, 1440249115u, 3239081580u, 0u, 3218431367u, 1370488832u, 0, MODF_TOLERANCE, 0}, +{ 927, 1068350633u, 1231934926u, 0u, 0u, 1068350633u, 1231934926u, 0, MODF_TOLERANCE, 0}, +{ 928, 3236746788u, 603977748u, 3236746784u, 0u, 3217068031u, 3763339264u, 0, MODF_TOLERANCE, 0}, +{ 929, 3195449689u, 2386312545u, 2147483648u, 0u, 3195449689u, 2386312545u, 0, MODF_TOLERANCE, 0}, +{ 930, 1063169277u, 2715234268u, 0u, 0u, 1063169277u, 2715234268u, 0, MODF_TOLERANCE, 0}, +{ 931, 1087803418u, 915867083u, 1087803392u, 0u, 1071265431u, 97189888u, 0, MODF_TOLERANCE, 0}, +{ 932, 1046790892u, 3347417612u, 0u, 0u, 1046790892u, 3347417612u, 0, MODF_TOLERANCE, 0}, +{ 933, 1105984188u, 3553288373u, 1105984188u, 3552575488u, 1070973290u, 0u, 0, MODF_TOLERANCE, 0}, +{ 934, 1065698616u, 2906680663u, 0u, 0u, 1065698616u, 2906680663u, 0, MODF_TOLERANCE, 0}, +{ 935, 1045506226u, 2342364630u, 0u, 0u, 1045506226u, 2342364630u, 0, MODF_TOLERANCE, 0}, +{ 936, 1051356723u, 4019093203u, 0u, 0u, 1051356723u, 4019093203u, 0, MODF_TOLERANCE, 0}, +{ 937, 3201169162u, 2911548084u, 2147483648u, 0u, 3201169162u, 2911548084u, 0, MODF_TOLERANCE, 0}, +{ 938, 1105282515u, 2476735795u, 1105282515u, 2474639360u, 1072692531u, 0u, 0, MODF_TOLERANCE, 0}, +{ 939, 1050472772u, 1836216409u, 0u, 0u, 1050472772u, 1836216409u, 0, MODF_TOLERANCE, 0}, +{ 940, 1101062307u, 2519592554u, 1101062307u, 2516582400u, 1068955445u, 0u, 0, MODF_TOLERANCE, 0}, +{ 941, 1070178161u, 1235369496u, 0u, 0u, 1070178161u, 1235369496u, 0, MODF_TOLERANCE, 0}, +{ 942, 3222946447u, 668087854u, 3222798336u, 0u, 3219264633u, 1049735536u, 0, MODF_TOLERANCE, 0}, +{ 943, 3208554596u, 2981820811u, 2147483648u, 0u, 3208554596u, 2981820811u, 0, MODF_TOLERANCE, 0}, +{ 944, 1059838516u, 2845580478u, 0u, 0u, 1059838516u, 2845580478u, 0, MODF_TOLERANCE, 0}, +{ 945, 3193931414u, 1565550570u, 2147483648u, 0u, 3193931414u, 1565550570u, 0, MODF_TOLERANCE, 0}, +{ 946, 3217165795u, 4162017137u, 2147483648u, 0u, 3217165795u, 4162017137u, 0, MODF_TOLERANCE, 0}, +{ 947, 3237251378u, 2808968027u, 3237251376u, 0u, 3217374059u, 2597847040u, 0, MODF_TOLERANCE, 0}, +{ 948, 1055630096u, 1782326814u, 0u, 0u, 1055630096u, 1782326814u, 0, MODF_TOLERANCE, 0}, +{ 949, 1053576974u, 1492622658u, 0u, 0u, 1053576974u, 1492622658u, 0, MODF_TOLERANCE, 0}, +{ 950, 3216653077u, 3972512122u, 2147483648u, 0u, 3216653077u, 3972512122u, 0, MODF_TOLERANCE, 0}, +{ 951, 3222171679u, 2722693603u, 3221749760u, 0u, 3219767422u, 2300839820u, 0, MODF_TOLERANCE, 0}, +{ 952, 3227814791u, 3169731970u, 3227811840u, 0u, 3218542457u, 3700098048u, 0, MODF_TOLERANCE, 0}, +{ 953, 3217906631u, 899763203u, 2147483648u, 0u, 3217906631u, 899763203u, 0, MODF_TOLERANCE, 0}, +{ 954, 3207606001u, 2804747833u, 2147483648u, 0u, 3207606001u, 2804747833u, 0, MODF_TOLERANCE, 0}, +{ 955, 3230670325u, 3789058912u, 3230669824u, 0u, 3219086877u, 2268463104u, 0, MODF_TOLERANCE, 0}, +{ 956, 3228095081u, 4135937628u, 3228090368u, 0u, 3219286518u, 2238077952u, 0, MODF_TOLERANCE, 0}, +{ 957, 1060199382u, 1682808307u, 0u, 0u, 1060199382u, 1682808307u, 0, MODF_TOLERANCE, 0}, +{ 958, 3206960335u, 232877759u, 2147483648u, 0u, 3206960335u, 232877759u, 0, MODF_TOLERANCE, 0}, +{ 959, 3242091486u, 2851963139u, 3242091486u, 0u, 3219472304u, 543162368u, 0, MODF_TOLERANCE, 0}, +{ 960, 3246852961u, 2590862592u, 3246852961u, 2550136832u, 3218303848u, 0u, 0, MODF_TOLERANCE, 0}, +{ 961, 1081200406u, 2422232642u, 1081196544u, 0u, 1072573728u, 3232531456u, 0, MODF_TOLERANCE, 0}, +{ 962, 3234779662u, 290458310u, 3234779648u, 0u, 3216777888u, 361496576u, 0, MODF_TOLERANCE, 0}, +{ 963, 3210671078u, 1082582386u, 2147483648u, 0u, 3210671078u, 1082582386u, 0, MODF_TOLERANCE, 0}, +{ 964, 1075605675u, 2602133689u, 1075576832u, 0u, 1069296358u, 3327798848u, 0, MODF_TOLERANCE, 0}, +{ 965, 3239818611u, 1789635787u, 3239818608u, 0u, 3219871069u, 1717043200u, 0, MODF_TOLERANCE, 0}, +{ 966, 1059414278u, 1048286093u, 0u, 0u, 1059414278u, 1048286093u, 0, MODF_TOLERANCE, 0}, +{ 967, 1098330542u, 231339448u, 1098330542u, 0u, 1072403435u, 1879048192u, 0, MODF_TOLERANCE, 0}, +{ 968, 1055573265u, 504907415u, 0u, 0u, 1055573265u, 504907415u, 0, MODF_TOLERANCE, 0}, +{ 969, 1063211461u, 1153251200u, 0u, 0u, 1063211461u, 1153251200u, 0, MODF_TOLERANCE, 0}, +{ 970, 3204617090u, 1772013857u, 2147483648u, 0u, 3204617090u, 1772013857u, 0, MODF_TOLERANCE, 0}, +{ 971, 1099551055u, 1082898276u, 1099551055u, 1073741824u, 1068594924u, 2147483648u, 0, MODF_TOLERANCE, 0}, +{ 972, 3212089272u, 1449080862u, 2147483648u, 0u, 3212089272u, 1449080862u, 0, MODF_TOLERANCE, 0}, +{ 973, 1086008285u, 3177299045u, 1086008064u, 0u, 1072412588u, 931962880u, 0, MODF_TOLERANCE, 0}, +{ 974, 1058862813u, 809400815u, 0u, 0u, 1058862813u, 809400815u, 0, MODF_TOLERANCE, 0}, +{ 975, 3230854550u, 1924429710u, 3230854144u, 0u, 3218695979u, 1199104000u, 0, MODF_TOLERANCE, 0}, +{ 976, 1056464743u, 3349283177u, 0u, 0u, 1056464743u, 3349283177u, 0, MODF_TOLERANCE, 0}, +{ 977, 3245473391u, 42238036u, 3245473391u, 0u, 3217302530u, 2684354560u, 0, MODF_TOLERANCE, 0}, +{ 978, 1042379500u, 2113559863u, 0u, 0u, 1042379500u, 2113559863u, 0, MODF_TOLERANCE, 0}, +{ 979, 1064761243u, 3304403230u, 0u, 0u, 1064761243u, 3304403230u, 0, MODF_TOLERANCE, 0}, +{ 980, 3217556703u, 58952646u, 2147483648u, 0u, 3217556703u, 58952646u, 0, MODF_TOLERANCE, 0}, +{ 981, 3212669530u, 1645486982u, 2147483648u, 0u, 3212669530u, 1645486982u, 0, MODF_TOLERANCE, 0}, +{ 982, 3224301095u, 3636267471u, 3224240128u, 0u, 3218982139u, 396442080u, 0, MODF_TOLERANCE, 0}, +{ 983, 1062762009u, 619402181u, 0u, 0u, 1062762009u, 619402181u, 0, MODF_TOLERANCE, 0}, +{ 984, 3235208235u, 557360557u, 3235208192u, 0u, 3219493020u, 1389789184u, 0, MODF_TOLERANCE, 0}, +{ 985, 3238238394u, 110029735u, 3238238392u, 0u, 3218093175u, 1563951104u, 0, MODF_TOLERANCE, 0}, +{ 986, 1046937383u, 984375729u, 0u, 0u, 1046937383u, 984375729u, 0, MODF_TOLERANCE, 0}, +{ 987, 3189496738u, 4063688092u, 2147483648u, 0u, 3189496738u, 4063688092u, 0, MODF_TOLERANCE, 0}, +{ 988, 3203235744u, 1049950343u, 2147483648u, 0u, 3203235744u, 1049950343u, 0, MODF_TOLERANCE, 0}, +{ 989, 1062350619u, 650996069u, 0u, 0u, 1062350619u, 650996069u, 0, MODF_TOLERANCE, 0}, +{ 990, 1054971928u, 3953359826u, 0u, 0u, 1054971928u, 3953359826u, 0, MODF_TOLERANCE, 0}, +{ 991, 3227055805u, 66926332u, 3227041792u, 0u, 3219873409u, 4271603200u, 0, MODF_TOLERANCE, 0}, +{ 992, 1090561839u, 1379780888u, 1090561832u, 0u, 1072515319u, 610271232u, 0, MODF_TOLERANCE, 0}, +{ 993, 3233453307u, 2803378256u, 3233453056u, 0u, 3220141283u, 84541440u, 0, MODF_TOLERANCE, 0}, +{ 994, 1086057989u, 498534626u, 1086057984u, 0u, 1066694364u, 596115456u, 0, MODF_TOLERANCE, 0}, +{ 995, 1082618553u, 2846400785u, 1082617856u, 0u, 1070976333u, 1158187008u, 0, MODF_TOLERANCE, 0}, +{ 996, 1047142525u, 1375153550u, 0u, 0u, 1047142525u, 1375153550u, 0, MODF_TOLERANCE, 0}, +{ 997, 1044581201u, 2869128958u, 0u, 0u, 1044581201u, 2869128958u, 0, MODF_TOLERANCE, 0}, +{ 998, 1070972315u, 4246440273u, 0u, 0u, 1070972315u, 4246440273u, 0, MODF_TOLERANCE, 0}, +{ 999, 1051832506u, 3112381207u, 0u, 0u, 1051832506u, 3112381207u, 0, MODF_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_MODF_H multiple inclusion protection + +// EOF modf.h diff --git a/packages/language/c/libm/current/tests/vectors/pow.c b/packages/language/c/libm/current/tests/vectors/pow.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/pow.c @@ -0,0 +1,104 @@ +//=========================================================================== +// +// pow.c +// +// Test of pow() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/pow.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(pow_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &pow, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_DOUBLE, + &pow_vec[0], vec_size ); + + if (ret==true) { + CYG_TEST_PASS("pow() is stable"); + } // if + else { + CYG_TEST_FAIL("pow() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library pow() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "pow() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF pow.c diff --git a/packages/language/c/libm/current/tests/vectors/pow.h b/packages/language/c/libm/current/tests/vectors/pow.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/pow.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_POW_H +#define CYGONCE_LIBM_POW_H +//=========================================================================== +// +// pow.h +// +// Test vectors for testing of pow() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/pow.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define POW_TOLERANCE 2.0E-04 + +static const Cyg_libm_test_double_vec_t pow_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1072693145u, 3786322490u, 0, POW_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1072693319u, 4023770303u, 0, POW_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1072693358u, 4241580334u, 0, POW_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1072693247u, 2586970110u, 0, POW_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1150564421u, 1162045912u, 0, POW_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1072908638u, 3920397298u, 0, POW_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1072693247u, 3454103437u, 0, POW_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1072693248u, 2713833020u, 0, POW_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1072693254u, 2722102995u, 0, POW_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1072693248u, 528438245u, 0, POW_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1072693244u, 2368530347u, 0, POW_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1072693248u, 101495031u, 0, POW_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1073262651u, 1446941025u, 0, POW_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1072693282u, 105881969u, 0, POW_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1072693243u, 3110586331u, 0, POW_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1032568590u, 3663273235u, 0, POW_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1072693239u, 2154876465u, 0, POW_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1112654033u, 3065397925u, 0, POW_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1072752013u, 2853960467u, 0, POW_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1072666955u, 585952463u, 0, POW_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1073370007u, 2844524197u, 0, POW_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1072693154u, 3128651096u, 0, POW_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1072693249u, 3986499474u, 0, POW_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1147229759u, 3625827792u, 0, POW_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1072693242u, 2972243163u, 0, POW_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1812026121u, 3205070032u, 0, POW_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1072693248u, 393635233u, 0, POW_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1072368791u, 3331967454u, 0, POW_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1804775405u, 367049631u, 0, POW_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 856345317u, 2349026083u, 0, POW_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1204464550u, 3895468816u, 0, POW_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1072693112u, 3524791428u, 0, POW_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1072677654u, 3530973200u, 0, POW_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1072812838u, 3811918015u, 0, POW_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1122130466u, 549133024u, 0, POW_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1072693250u, 2024455320u, 0, POW_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1072404968u, 3524704578u, 0, POW_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1072693016u, 3909377404u, 0, POW_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1072693247u, 4287143103u, 0, POW_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1072693247u, 2540719625u, 0, POW_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1072693203u, 3666743287u, 0, POW_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1072693244u, 2492356786u, 0, POW_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1072693260u, 115890741u, 0, POW_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1072693248u, 1623026018u, 0, POW_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1074457128u, 1055623878u, 0, POW_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1072739324u, 66323243u, 0, POW_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1072693247u, 4285111407u, 0, POW_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1072702734u, 1806600566u, 0, POW_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1072806990u, 2299535735u, 0, POW_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1072693073u, 753685957u, 0, POW_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1072693098u, 2396337266u, 0, POW_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1072700754u, 2803085140u, 0, POW_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1072692983u, 1273527884u, 0, POW_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1072693237u, 2367845751u, 0, POW_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1071792003u, 297563882u, 0, POW_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1072693257u, 3993377207u, 0, POW_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1015054848u, 1104031833u, 0, POW_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 807274535u, 1215766468u, 0, POW_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1072693247u, 4113932245u, 0, POW_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1279447955u, 3223881881u, 0, POW_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1072693248u, 40388682u, 0, POW_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1072702228u, 2902378676u, 0, POW_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1072709304u, 824909217u, 0, POW_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1072688773u, 2327140958u, 0, POW_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1072693248u, 281381u, 0, POW_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1072693272u, 3770581006u, 0, POW_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1072693246u, 168811001u, 0, POW_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1072693246u, 3333341511u, 0, POW_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1608334226u, 2161970735u, 0, POW_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1072771013u, 386828558u, 0, POW_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1072614281u, 3958437556u, 0, POW_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1072694093u, 1818476007u, 0, POW_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1193195944u, 2224143502u, 0, POW_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1072693287u, 2758573484u, 0, POW_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1036314251u, 1973715692u, 0, POW_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 786785645u, 3762814253u, 0, POW_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1072843442u, 3736351208u, 0, POW_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1072693248u, 177038445u, 0, POW_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1072758877u, 3815495041u, 0, POW_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1072693247u, 4099459954u, 0, POW_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1146599361u, 1320817502u, 0, POW_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1072693248u, 3975412585u, 0, POW_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1071873549u, 2820448966u, 0, POW_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1072693248u, 87290407u, 0, POW_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1072693247u, 3040077910u, 0, POW_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1072693250u, 1696436778u, 0, POW_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1072697900u, 2551805421u, 0, POW_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1072693248u, 386316155u, 0, POW_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1072693247u, 4170038984u, 0, POW_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1071881872u, 187466493u, 0, POW_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1072693193u, 1996278249u, 0, POW_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1072693248u, 475078664u, 0, POW_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1044672313u, 3419723780u, 0, POW_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 785500297u, 1983771784u, 0, POW_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1080238900u, 4082329047u, 0, POW_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1072678628u, 3067689733u, 0, POW_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1072666015u, 1047161720u, 0, POW_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1072693246u, 2312848366u, 0, POW_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1072693248u, 2951604327u, 0, POW_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1072693247u, 4009861912u, 0, POW_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1072693247u, 2288553838u, 0, POW_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 0u, 5396u, 0, POW_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1072697993u, 2090954347u, 0, POW_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1155874651u, 3188353547u, 0, POW_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1072689248u, 3108185928u, 0, POW_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1072909050u, 2720463137u, 0, POW_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 798449415u, 2426252462u, 0, POW_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1072693245u, 1774133003u, 0, POW_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1072694539u, 2184407358u, 0, POW_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1072238894u, 1575406057u, 0, POW_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1072693244u, 3564623841u, 0, POW_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 699053901u, 1047947444u, 0, POW_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1293773262u, 1900362721u, 0, POW_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1072693248u, 143630050u, 0, POW_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1072675645u, 2902661197u, 0, POW_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1072693330u, 808057802u, 0, POW_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1072693095u, 3960121440u, 0, POW_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1072693251u, 3719004870u, 0, POW_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1072693250u, 1458311196u, 0, POW_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1072693253u, 3048254437u, 0, POW_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1072693248u, 2249250707u, 0, POW_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1072693244u, 3968038868u, 0, POW_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1072696176u, 1392301465u, 0, POW_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1072688466u, 2887746621u, 0, POW_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1072688897u, 3409584618u, 0, POW_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1072691545u, 2046084509u, 0, POW_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1072693247u, 2053123428u, 0, POW_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1052893344u, 1407379810u, 0, POW_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1072496446u, 957191870u, 0, POW_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1072629459u, 2158296239u, 0, POW_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1072693208u, 1723708036u, 0, POW_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1072693251u, 531543956u, 0, POW_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1120942639u, 1957855996u, 0, POW_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1072693246u, 1228577461u, 0, POW_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1072693248u, 1749916062u, 0, POW_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1072963055u, 81307323u, 0, POW_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1072693218u, 1483421926u, 0, POW_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1088607402u, 230317747u, 0, POW_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1074599716u, 1349128967u, 0, POW_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1072694720u, 1901602099u, 0, POW_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1072693475u, 2832520792u, 0, POW_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1072693480u, 2548304715u, 0, POW_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1072513658u, 1143197041u, 0, POW_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1072694273u, 2275158180u, 0, POW_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1074080049u, 1235076998u, 0, POW_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1072693128u, 1294650307u, 0, POW_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1072693248u, 1451010777u, 0, POW_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1063134044u, 2290995554u, 0, POW_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1072693247u, 3327983736u, 0, POW_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1072693187u, 630976724u, 0, POW_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1072692866u, 3124146731u, 0, POW_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1072698173u, 395857824u, 0, POW_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1072797014u, 4289163029u, 0, POW_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1072692592u, 442763524u, 0, POW_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1072693136u, 3021333862u, 0, POW_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1072693310u, 766294020u, 0, POW_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1072693248u, 3627680972u, 0, POW_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1105866136u, 1622177461u, 0, POW_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1067103012u, 101891501u, 0, POW_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1072693249u, 1117658652u, 0, POW_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1071179233u, 1730069180u, 0, POW_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1072692999u, 3612892612u, 0, POW_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 641863389u, 2038944281u, 0, POW_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1072693896u, 4270014993u, 0, POW_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1072693248u, 61913147u, 0, POW_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1072694882u, 1402864683u, 0, POW_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1072693245u, 981334221u, 0, POW_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1072693248u, 112495850u, 0, POW_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1072801307u, 2767779869u, 0, POW_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1072693248u, 202496693u, 0, POW_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1073850669u, 3820511026u, 0, POW_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 922173987u, 2098764000u, 0, POW_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1072693248u, 71767127u, 0, POW_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1072696814u, 471857713u, 0, POW_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1464278091u, 4074807235u, 0, POW_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1072696112u, 3267875854u, 0, POW_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1072693247u, 2970483755u, 0, POW_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1072800308u, 390736839u, 0, POW_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1072691629u, 2656458388u, 0, POW_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1072693150u, 1036067998u, 0, POW_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1064530956u, 2085643682u, 0, POW_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 760248983u, 1522623444u, 0, POW_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1072693239u, 1606822809u, 0, POW_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1072687149u, 2218809813u, 0, POW_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1072693247u, 2059131834u, 0, POW_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1114375448u, 2508341866u, 0, POW_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1072360507u, 2931321086u, 0, POW_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1072693240u, 523173278u, 0, POW_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1072104115u, 2399684722u, 0, POW_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1072694325u, 1735817410u, 0, POW_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1072694802u, 2019984739u, 0, POW_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 679609252u, 1942553467u, 0, POW_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1066584007u, 3242786919u, 0, POW_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1067529049u, 1008600260u, 0, POW_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1084695753u, 238746516u, 0, POW_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1083382405u, 154259724u, 0, POW_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1072685871u, 393403851u, 0, POW_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1071006277u, 309120623u, 0, POW_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1072693246u, 4267185665u, 0, POW_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1072693248u, 66412499u, 0, POW_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1072699017u, 253084263u, 0, POW_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1072722238u, 2938514689u, 0, POW_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1097140853u, 432263137u, 0, POW_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1072695179u, 541455052u, 0, POW_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 937812205u, 2732262850u, 0, POW_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1072693248u, 1411252811u, 0, POW_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 944914560u, 4069413743u, 0, POW_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1072693247u, 4201417711u, 0, POW_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 946546597u, 3640510442u, 0, POW_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 612825355u, 2217080555u, 0, POW_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 973102302u, 593041218u, 0, POW_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1226969731u, 2279514813u, 0, POW_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1072693246u, 3733326417u, 0, POW_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1072693246u, 2050624436u, 0, POW_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1072693247u, 4285430075u, 0, POW_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1094321828u, 2344281964u, 0, POW_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1075926174u, 1870920115u, 0, POW_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1072693243u, 1523676086u, 0, POW_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1071847803u, 1229064437u, 0, POW_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1072693247u, 3213122894u, 0, POW_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1072723785u, 3886972153u, 0, POW_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1072693248u, 64294410u, 0, POW_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1072691791u, 391531247u, 0, POW_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1072730986u, 818344641u, 0, POW_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1072675418u, 2557624176u, 0, POW_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1072693004u, 3048704750u, 0, POW_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1072693260u, 339199966u, 0, POW_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1072689504u, 3005345343u, 0, POW_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1072693449u, 2768405920u, 0, POW_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1072693248u, 90246344u, 0, POW_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1072386902u, 1127776707u, 0, POW_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1073791756u, 1259701110u, 0, POW_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1071048925u, 1485581625u, 0, POW_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1072693208u, 2764068789u, 0, POW_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1072692426u, 1496207054u, 0, POW_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1072958472u, 3376559785u, 0, POW_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1072693247u, 2836158473u, 0, POW_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1072693623u, 3513101689u, 0, POW_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1072692424u, 3452932260u, 0, POW_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1143479176u, 908596309u, 0, POW_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1072711491u, 3933800051u, 0, POW_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1072693248u, 104985487u, 0, POW_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1850494788u, 2499984423u, 0, POW_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1072598307u, 3580358468u, 0, POW_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1932203582u, 19627262u, 0, POW_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1072693248u, 2469556788u, 0, POW_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1072581660u, 718583915u, 0, POW_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1073134140u, 172036208u, 0, POW_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1072693224u, 1147242094u, 0, POW_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1072693247u, 4179007047u, 0, POW_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1072694909u, 4025013104u, 0, POW_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1072693095u, 3143377223u, 0, POW_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1072649165u, 223733263u, 0, POW_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1072693255u, 2109886442u, 0, POW_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1072711294u, 2736502671u, 0, POW_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1095921736u, 2692187065u, 0, POW_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1072693249u, 671648650u, 0, POW_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1064119522u, 2232525786u, 0, POW_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1072693366u, 3874400185u, 0, POW_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1072737053u, 745790878u, 0, POW_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1072693215u, 1442312111u, 0, POW_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1072693248u, 46387677u, 0, POW_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1072693173u, 435912867u, 0, POW_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1098461188u, 4021617747u, 0, POW_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1072706220u, 2819987205u, 0, POW_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1072693238u, 1188491770u, 0, POW_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1072592733u, 156344305u, 0, POW_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1072660689u, 2198900733u, 0, POW_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1072691097u, 1919876975u, 0, POW_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1072693247u, 3434842727u, 0, POW_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1072693246u, 580489923u, 0, POW_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 550449765u, 3209472673u, 0, POW_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1016137106u, 101377175u, 0, POW_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1072018817u, 709267635u, 0, POW_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1072693227u, 3412763353u, 0, POW_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1072693248u, 781302795u, 0, POW_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1072693236u, 1757700973u, 0, POW_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1072693247u, 3771060138u, 0, POW_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1178728909u, 3380778923u, 0, POW_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1072704740u, 1816538639u, 0, POW_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1072693257u, 3430819252u, 0, POW_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1030469750u, 395871138u, 0, POW_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1072693247u, 4191774567u, 0, POW_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 819148193u, 4205109975u, 0, POW_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 931484061u, 1205710889u, 0, POW_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 0u, 0u, 0, POW_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1072693247u, 3773506942u, 0, POW_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1072693248u, 348956998u, 0, POW_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1072693275u, 1469141088u, 0, POW_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 2146959360u, 0u, 33, POW_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1072693247u, 3123214080u, 0, POW_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 2146435072u, 0u, 34, POW_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 0u, 0u, 0, POW_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_POW_H multiple inclusion protection + +// EOF pow.h diff --git a/packages/language/c/libm/current/tests/vectors/sin.c b/packages/language/c/libm/current/tests/vectors/sin.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/sin.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// sin.c +// +// Test of sin() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/sin.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(sin_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &sin, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &sin_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("sin() is stable"); + } // if + else + { + CYG_TEST_FAIL("sin() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library sin() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "sin() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF sin.c diff --git a/packages/language/c/libm/current/tests/vectors/sin.h b/packages/language/c/libm/current/tests/vectors/sin.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/sin.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_SIN_H +#define CYGONCE_LIBM_SIN_H +//=========================================================================== +// +// sin.h +// +// Test vectors for testing of sin() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/sin.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define SIN_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t sin_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1071838869u, 2401661594u, 0, SIN_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 3218140303u, 2723656211u, 0, SIN_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 1070387016u, 2680769772u, 0, SIN_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 3219218822u, 2049472052u, 0, SIN_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 3220006780u, 536189369u, 0, SIN_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 3219789896u, 4274610101u, 0, SIN_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1047953160u, 183014787u, 0, SIN_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 3213485989u, 1514254211u, 0, SIN_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1058795730u, 609683576u, 0, SIN_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 3204919842u, 1603156146u, 0, SIN_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1060343410u, 1775912310u, 0, SIN_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 3220044665u, 516737212u, 0, SIN_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1068343696u, 2570408587u, 0, SIN_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 3207559790u, 1287711395u, 0, SIN_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 3220141559u, 642968502u, 0, SIN_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1067118390u, 524782221u, 0, SIN_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1071087355u, 3913666151u, 0, SIN_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1071997067u, 1550277781u, 0, SIN_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 3194849109u, 213658768u, 0, SIN_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 1071974247u, 929901645u, 0, SIN_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 3216261246u, 919710895u, 0, SIN_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 1049848642u, 541549268u, 0, SIN_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 3220111007u, 980283378u, 0, SIN_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1060548195u, 1171923561u, 0, SIN_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 3208865645u, 3029730220u, 0, SIN_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 1071036129u, 813860861u, 0, SIN_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1052861772u, 331693068u, 0, SIN_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 3219239726u, 3132111534u, 0, SIN_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1044902177u, 252085215u, 0, SIN_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 1072662522u, 1497100154u, 0, SIN_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1072151952u, 1213650637u, 0, SIN_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 3219808385u, 472344056u, 0, SIN_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 1072254439u, 2138833907u, 0, SIN_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 3195247552u, 472004923u, 0, SIN_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 1054226850u, 4085734635u, 0, SIN_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 1057053639u, 2054597482u, 0, SIN_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 3188976647u, 3725731239u, 0, SIN_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 3219415599u, 1075867927u, 0, SIN_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 3206052774u, 695706716u, 0, SIN_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 3207367087u, 4238790031u, 0, SIN_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 1072682140u, 2066217144u, 0, SIN_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 3219000313u, 4267532368u, 0, SIN_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1067040834u, 487727068u, 0, SIN_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1071850264u, 1206127023u, 0, SIN_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 1054885127u, 644502728u, 0, SIN_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1072410294u, 22046932u, 0, SIN_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 3216020271u, 1764000566u, 0, SIN_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 1064733291u, 4045889661u, 0, SIN_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 1061536351u, 1714337161u, 0, SIN_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1057248676u, 2647551431u, 0, SIN_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 3194422028u, 1839068698u, 0, SIN_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1046493630u, 772102379u, 0, SIN_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 1069797744u, 562818333u, 0, SIN_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 1051172137u, 506286305u, 0, SIN_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 3219662892u, 3667710140u, 0, SIN_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1071337783u, 1367962921u, 0, SIN_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 3211536912u, 2267019146u, 0, SIN_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 3199680614u, 184129854u, 0, SIN_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 1072047947u, 1080365783u, 0, SIN_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1072166020u, 3340708234u, 0, SIN_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1070744623u, 2373837450u, 0, SIN_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 3220087464u, 1358458230u, 0, SIN_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 1069376304u, 62267843u, 0, SIN_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 3219796959u, 290221919u, 0, SIN_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 3203224610u, 1473596865u, 0, SIN_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1072227400u, 4090466752u, 0, SIN_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 3192516074u, 1732245037u, 0, SIN_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 1072622333u, 484555410u, 0, SIN_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 1072668202u, 1236651337u, 0, SIN_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 3206903253u, 2184476310u, 0, SIN_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 3218677358u, 1624364943u, 0, SIN_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1071973583u, 3233577778u, 0, SIN_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 3218994022u, 1472558371u, 0, SIN_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1044571091u, 2759019783u, 0, SIN_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 3212931268u, 3320555499u, 0, SIN_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1072521083u, 2425421985u, 0, SIN_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 3217558108u, 1228670264u, 0, SIN_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 3219973371u, 3322500u, 0, SIN_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 1061342535u, 3471785037u, 0, SIN_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 3200834423u, 2588057111u, 0, SIN_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 3206978856u, 813684588u, 0, SIN_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 3205576370u, 3089203192u, 0, SIN_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 3218295099u, 3722832670u, 0, SIN_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 3220163327u, 3978375316u, 0, SIN_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 3193326350u, 2265437201u, 0, SIN_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 3216358213u, 946725939u, 0, SIN_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 3218959542u, 2751578340u, 0, SIN_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 3218080130u, 4276033061u, 0, SIN_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 3219561148u, 1725305302u, 0, SIN_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1064345013u, 34094566u, 0, SIN_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 1072633158u, 589399637u, 0, SIN_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 3207257417u, 3206332840u, 0, SIN_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1072209224u, 1264489112u, 0, SIN_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 3188695272u, 3011191657u, 0, SIN_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 1063235022u, 1279389516u, 0, SIN_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1072594097u, 3319282857u, 0, SIN_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 1051139427u, 1769685778u, 0, SIN_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 3215655025u, 4092391317u, 0, SIN_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1070424010u, 2933370624u, 0, SIN_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1070822880u, 179235259u, 0, SIN_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1072653766u, 2542208304u, 0, SIN_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 1072530344u, 3077286602u, 0, SIN_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 3193663083u, 3467757356u, 0, SIN_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 3219941021u, 4051870273u, 0, SIN_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 3197412883u, 166402710u, 0, SIN_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1072691983u, 3277464136u, 0, SIN_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1062392908u, 1313065636u, 0, SIN_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1072530888u, 1547899382u, 0, SIN_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 3195629021u, 2055773723u, 0, SIN_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 1072252180u, 1389729742u, 0, SIN_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 1065716000u, 71449286u, 0, SIN_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 3206539410u, 2220858621u, 0, SIN_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 3209424906u, 223951041u, 0, SIN_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 1072325341u, 2929676563u, 0, SIN_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 1071617875u, 134033807u, 0, SIN_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 3212663457u, 2560321906u, 0, SIN_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 1057720186u, 185049725u, 0, SIN_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 1071355601u, 3706690183u, 0, SIN_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 1057135741u, 754952242u, 0, SIN_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1061623064u, 3340736229u, 0, SIN_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 3195290997u, 2676398681u, 0, SIN_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1065079376u, 1610057462u, 0, SIN_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 3220004894u, 1668609696u, 0, SIN_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1072086222u, 4119862242u, 0, SIN_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 1072690956u, 765035729u, 0, SIN_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1069580313u, 3312804465u, 0, SIN_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 3219859859u, 2237649499u, 0, SIN_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1064600507u, 1276893856u, 0, SIN_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 1045423002u, 967350972u, 0, SIN_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 3220069145u, 1168790563u, 0, SIN_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 3189614508u, 2863482262u, 0, SIN_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 3202629313u, 2801694452u, 0, SIN_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 1072471825u, 2589645930u, 0, SIN_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 1056516397u, 4171240187u, 0, SIN_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 3219829255u, 761344608u, 0, SIN_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1070082723u, 1334614737u, 0, SIN_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1042279322u, 4170235262u, 0, SIN_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1071794321u, 2307534527u, 0, SIN_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1061684276u, 3979725310u, 0, SIN_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 3218442720u, 3943632230u, 0, SIN_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 3219483919u, 1110725871u, 0, SIN_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1071953692u, 3887415361u, 0, SIN_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 3219914082u, 2841872974u, 0, SIN_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 3220176423u, 214584624u, 0, SIN_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1069097512u, 979815490u, 0, SIN_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 3188629767u, 978126928u, 0, SIN_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 1072406284u, 1786742831u, 0, SIN_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 3218047308u, 1285854118u, 0, SIN_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 3202707679u, 2599841376u, 0, SIN_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 3219573748u, 1215925215u, 0, SIN_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 3214409789u, 2584792611u, 0, SIN_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 1042831340u, 1958025850u, 0, SIN_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 1072578370u, 2980431846u, 0, SIN_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 3216964734u, 4225175528u, 0, SIN_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1072590656u, 4260949149u, 0, SIN_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1070228438u, 2092679689u, 0, SIN_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 3219446490u, 1081234903u, 0, SIN_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1058377732u, 2314066573u, 0, SIN_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1071009563u, 3384255603u, 0, SIN_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 1071748460u, 4139037911u, 0, SIN_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 1072230353u, 3672194469u, 0, SIN_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 1072690845u, 636988494u, 0, SIN_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 1040986626u, 672789828u, 0, SIN_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1068389710u, 3161529855u, 0, SIN_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 3210046176u, 3596251017u, 0, SIN_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1067680575u, 1972612994u, 0, SIN_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1071233160u, 2708659300u, 0, SIN_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 1042898869u, 3807416441u, 0, SIN_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 3216098069u, 1762662362u, 0, SIN_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 1070295445u, 3527565762u, 0, SIN_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 1049684114u, 1160161958u, 0, SIN_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1071873325u, 3249019602u, 0, SIN_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 1072682938u, 865545992u, 0, SIN_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 3218775663u, 1968078348u, 0, SIN_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 3191030402u, 3117037091u, 0, SIN_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1051974004u, 749717580u, 0, SIN_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 1044833651u, 1966536294u, 0, SIN_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1067724198u, 2503264895u, 0, SIN_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1071856614u, 1496877905u, 0, SIN_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1072328406u, 4148346279u, 0, SIN_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 3216627182u, 3737898172u, 0, SIN_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 1071511321u, 2243253033u, 0, SIN_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 3219345234u, 1584777341u, 0, SIN_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 3219468210u, 803658459u, 0, SIN_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 1055231263u, 3936155644u, 0, SIN_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 3207981719u, 1155967295u, 0, SIN_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 3208148223u, 907199018u, 0, SIN_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 3217055889u, 3244678034u, 0, SIN_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1072681871u, 43356682u, 0, SIN_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1050652945u, 977585787u, 0, SIN_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 3220176895u, 642550610u, 0, SIN_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 3190565456u, 1371169579u, 0, SIN_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 1072638954u, 2287566710u, 0, SIN_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 1071666033u, 3954975003u, 0, SIN_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 3218173113u, 1522075355u, 0, SIN_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1072418396u, 2140187299u, 0, SIN_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 3219097358u, 2422945605u, 0, SIN_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 1070785701u, 2665619523u, 0, SIN_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 3219661363u, 3456576138u, 0, SIN_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 3216148644u, 3912792675u, 0, SIN_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 3220164389u, 1558063129u, 0, SIN_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1070967180u, 455169693u, 0, SIN_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 1072409569u, 201880887u, 0, SIN_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 3220129423u, 1040776768u, 0, SIN_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1072454723u, 572297329u, 0, SIN_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 3218397995u, 2821464852u, 0, SIN_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 3193169876u, 2782073372u, 0, SIN_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1071856080u, 3645770997u, 0, SIN_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 1072690743u, 315036582u, 0, SIN_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 3192664477u, 1265459564u, 0, SIN_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 3218719377u, 3676821394u, 0, SIN_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 3220176869u, 1842532013u, 0, SIN_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 3206272087u, 4126233538u, 0, SIN_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 3219910220u, 246004999u, 0, SIN_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 1072684426u, 1737390075u, 0, SIN_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 3219912227u, 2624070465u, 0, SIN_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 3215733122u, 716489315u, 0, SIN_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 3219388623u, 3993183379u, 0, SIN_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 1072597127u, 2200262097u, 0, SIN_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 3194765687u, 1840632533u, 0, SIN_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 1071983481u, 3846419649u, 0, SIN_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1071191158u, 3577871213u, 0, SIN_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 3220122625u, 1732563055u, 0, SIN_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 3198264929u, 1614536965u, 0, SIN_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 1071003501u, 2410682589u, 0, SIN_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1072413867u, 136366712u, 0, SIN_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 3196802686u, 2406734438u, 0, SIN_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 3195751081u, 1618759126u, 0, SIN_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1055357248u, 3589897668u, 0, SIN_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 3189943060u, 2431246964u, 0, SIN_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1072189734u, 1087579715u, 0, SIN_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 3218985922u, 793083747u, 0, SIN_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1046553348u, 1839214510u, 0, SIN_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1058073864u, 736309424u, 0, SIN_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 3200324971u, 2143372904u, 0, SIN_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 3219152238u, 1287790148u, 0, SIN_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 3214165902u, 2958559986u, 0, SIN_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 3189989959u, 1578976988u, 0, SIN_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 3218820540u, 1900418251u, 0, SIN_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 3208432764u, 3374510708u, 0, SIN_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 1060196346u, 2127296784u, 0, SIN_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 1070434834u, 2662056578u, 0, SIN_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 3187706018u, 3570940805u, 0, SIN_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 3208209565u, 802037311u, 0, SIN_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1072290576u, 1462410304u, 0, SIN_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 1047115221u, 1909994274u, 0, SIN_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1060855260u, 1456422275u, 0, SIN_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 1059496132u, 1420289507u, 0, SIN_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 3219937610u, 2246171886u, 0, SIN_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1071752554u, 1874333801u, 0, SIN_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 1070213823u, 2671633378u, 0, SIN_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 1054174923u, 3548695399u, 0, SIN_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 3219761819u, 2824613343u, 0, SIN_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1072071999u, 3505664549u, 0, SIN_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 1043958672u, 2986160931u, 0, SIN_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 1069352923u, 1649353225u, 0, SIN_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1071123074u, 1626723231u, 0, SIN_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 1040415832u, 2283342035u, 0, SIN_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 3213249319u, 799119578u, 0, SIN_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 3211562374u, 391551481u, 0, SIN_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 3192989874u, 286247089u, 0, SIN_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1071991346u, 1826432782u, 0, SIN_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 3219574119u, 3539231989u, 0, SIN_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 3201695807u, 2256318153u, 0, SIN_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 3204024695u, 2294558540u, 0, SIN_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1072693090u, 777851873u, 0, SIN_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 3220096899u, 393002564u, 0, SIN_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 3219270769u, 1048619579u, 0, SIN_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 1043015571u, 174689677u, 0, SIN_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 3217478735u, 1503114855u, 0, SIN_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1064525895u, 581411206u, 0, SIN_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 3213791753u, 385020554u, 0, SIN_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 3213663320u, 232861266u, 0, SIN_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 3219431759u, 1266961775u, 0, SIN_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 1066754489u, 3214488945u, 0, SIN_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 3189290617u, 1578223762u, 0, SIN_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 1058506965u, 2102025662u, 0, SIN_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 3220176852u, 2198122228u, 0, SIN_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 3217832679u, 1979402010u, 0, SIN_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 3197002651u, 330905632u, 0, SIN_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1040729961u, 4162008079u, 0, SIN_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1070955687u, 1388259226u, 0, SIN_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 1071777503u, 4068277341u, 0, SIN_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 1060785883u, 4001387918u, 0, SIN_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 3218059427u, 1946602808u, 0, SIN_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 1069746729u, 3706777593u, 0, SIN_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1071914715u, 1322385081u, 0, SIN_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 3218723093u, 1840404530u, 0, SIN_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 3207908064u, 2174645771u, 0, SIN_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1054766684u, 1856518788u, 0, SIN_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1069151373u, 3758558462u, 0, SIN_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 1070736732u, 1844588698u, 0, SIN_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1072262137u, 3368858202u, 0, SIN_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 1072611743u, 4016179233u, 0, SIN_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 1043665640u, 3441419500u, 0, SIN_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 1072163512u, 3370547255u, 0, SIN_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 3218747484u, 1674330182u, 0, SIN_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 3218975849u, 1610107879u, 0, SIN_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1072290979u, 1210181575u, 0, SIN_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 3217893977u, 3064451299u, 0, SIN_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 3215053909u, 2806861459u, 0, SIN_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 3199083880u, 1346861821u, 0, SIN_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 3212255971u, 2844681635u, 0, SIN_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 1070014491u, 1859783173u, 0, SIN_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 3220093026u, 1482317646u, 0, SIN_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 3205481779u, 1526953343u, 0, SIN_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 3201033321u, 89309700u, 0, SIN_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 3192325102u, 747591401u, 0, SIN_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 3220166722u, 3739614867u, 0, SIN_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 3219267980u, 1442348823u, 0, SIN_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 3197179414u, 3119528901u, 0, SIN_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 1072498987u, 1114330108u, 0, SIN_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 1070122273u, 2544291857u, 0, SIN_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1072681080u, 3512208687u, 0, SIN_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 3220175583u, 2151064167u, 0, SIN_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1072189425u, 4007310009u, 0, SIN_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 3220007214u, 3581504613u, 0, SIN_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 1071554540u, 633418165u, 0, SIN_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 3203678820u, 264670771u, 0, SIN_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1067300227u, 4110391556u, 0, SIN_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1050106742u, 4027115052u, 0, SIN_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 3202500155u, 2875619325u, 0, SIN_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 1063244410u, 3242409421u, 0, SIN_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 3219368592u, 3568645980u, 0, SIN_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 1064853151u, 1551952560u, 0, SIN_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 1072616894u, 43106596u, 0, SIN_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 3213436312u, 3596660530u, 0, SIN_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 3191951036u, 469586759u, 0, SIN_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 3218694376u, 673605614u, 0, SIN_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 3210826984u, 440611368u, 0, SIN_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 3207120390u, 3826399709u, 0, SIN_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 1064522274u, 4269499531u, 0, SIN_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 3219219713u, 2231984255u, 0, SIN_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 3202970118u, 2180042922u, 0, SIN_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 3197084744u, 394130704u, 0, SIN_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 1044237059u, 849581558u, 0, SIN_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 3210140014u, 1044145102u, 0, SIN_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1072378519u, 2279746955u, 0, SIN_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1070935377u, 2141380414u, 0, SIN_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 3219443403u, 3646165606u, 0, SIN_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 3189668753u, 1174874204u, 0, SIN_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 3219590734u, 928440172u, 0, SIN_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 3219568461u, 498405354u, 0, SIN_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 1058121042u, 438756694u, 0, SIN_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1068848895u, 2974802106u, 0, SIN_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 3219146788u, 1661912448u, 0, SIN_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 3220058283u, 3138944076u, 0, SIN_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 3200952547u, 2511904320u, 0, SIN_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 1069977779u, 2586916475u, 0, SIN_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1071576757u, 1023587413u, 0, SIN_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 3211263952u, 2202700417u, 0, SIN_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 3195249375u, 3509997273u, 0, SIN_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1047182435u, 2156824610u, 0, SIN_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 3213264055u, 2199995967u, 0, SIN_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 3190593412u, 4261696995u, 0, SIN_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 1072671496u, 2731841203u, 0, SIN_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 3220169748u, 4045379867u, 0, SIN_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 3215496106u, 3159177907u, 0, SIN_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 3217306376u, 4089001786u, 0, SIN_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 1060749713u, 2233624875u, 0, SIN_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1071672711u, 2463694361u, 0, SIN_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 1041622738u, 2682092368u, 0, SIN_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1056312613u, 4174715193u, 0, SIN_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 3218646220u, 2271896913u, 0, SIN_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 3213890820u, 473058695u, 0, SIN_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 3220159790u, 1559521389u, 0, SIN_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1072682608u, 1566770115u, 0, SIN_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 3203475098u, 1379851699u, 0, SIN_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1063890854u, 765768635u, 0, SIN_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1044637404u, 1778509100u, 0, SIN_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 3216723887u, 2800533765u, 0, SIN_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 1048277388u, 4128020184u, 0, SIN_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 3193183163u, 2454653987u, 0, SIN_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 1070404584u, 1346890185u, 0, SIN_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 3219332754u, 3289059462u, 0, SIN_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 1071711521u, 2918342783u, 0, SIN_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 1069010575u, 3545442834u, 0, SIN_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 3192291109u, 2960339502u, 0, SIN_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 3196691185u, 4093388633u, 0, SIN_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 3218499784u, 630768479u, 0, SIN_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 3209294194u, 2487695189u, 0, SIN_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1069203900u, 3062493543u, 0, SIN_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 3219528448u, 2251950666u, 0, SIN_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1054300653u, 622465812u, 0, SIN_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1071164231u, 1572663486u, 0, SIN_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1071174065u, 1421883672u, 0, SIN_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1072062816u, 4171501946u, 0, SIN_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 3219694444u, 2213484574u, 0, SIN_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 3213704730u, 3260565064u, 0, SIN_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 1072108480u, 4038780813u, 0, SIN_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 1072624787u, 4121749569u, 0, SIN_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 3200484782u, 592575947u, 0, SIN_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1059518664u, 1744906541u, 0, SIN_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 1072686695u, 3681926353u, 0, SIN_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 1069508569u, 4007151816u, 0, SIN_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 3220011446u, 657266419u, 0, SIN_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 3219291904u, 1056060008u, 0, SIN_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 3193003684u, 2134662911u, 0, SIN_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 3218395496u, 1710236719u, 0, SIN_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 3219656570u, 905357172u, 0, SIN_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 3196410507u, 3683897895u, 0, SIN_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1072678613u, 1199374585u, 0, SIN_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 3211635387u, 4094761714u, 0, SIN_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1042339597u, 904146293u, 0, SIN_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 3195694970u, 1894173450u, 0, SIN_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1072666872u, 2878943607u, 0, SIN_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1071650759u, 4107877457u, 0, SIN_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 1064005448u, 3806280u, 0, SIN_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 3219833338u, 4061144814u, 0, SIN_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1068208301u, 293018899u, 0, SIN_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 3212768341u, 2998456369u, 0, SIN_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 3216014115u, 1571426293u, 0, SIN_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1072679610u, 1134166995u, 0, SIN_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 3218944954u, 4108691652u, 0, SIN_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 1072192774u, 164380330u, 0, SIN_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 3220155710u, 2715854652u, 0, SIN_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 3213779044u, 1173295357u, 0, SIN_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 3213904148u, 1645005977u, 0, SIN_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 3219966524u, 3715598854u, 0, SIN_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 3219009356u, 4095114083u, 0, SIN_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1072583950u, 1011503215u, 0, SIN_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 1066678984u, 2160822261u, 0, SIN_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 3217071034u, 903609947u, 0, SIN_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 3219152212u, 3806596794u, 0, SIN_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 1046570941u, 2228057308u, 0, SIN_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 3216396846u, 3644353080u, 0, SIN_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 3219128787u, 1914189566u, 0, SIN_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1071807946u, 404285730u, 0, SIN_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 3205195072u, 2379267821u, 0, SIN_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 3220123735u, 685495821u, 0, SIN_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 1051092760u, 2798719632u, 0, SIN_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 3220175867u, 3527643160u, 0, SIN_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 1071825014u, 828793735u, 0, SIN_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 3220171166u, 1264193719u, 0, SIN_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 3220136791u, 2964380269u, 0, SIN_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 3219993005u, 970396619u, 0, SIN_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 1042677918u, 2026673913u, 0, SIN_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 3218559097u, 3013700769u, 0, SIN_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1057479809u, 3137012350u, 0, SIN_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 1071977984u, 1955826869u, 0, SIN_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1056505004u, 3804037510u, 0, SIN_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 3219233682u, 468401044u, 0, SIN_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 3203939880u, 2157084064u, 0, SIN_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 3218415536u, 3741238523u, 0, SIN_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 3200980182u, 558766634u, 0, SIN_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 1045705464u, 1703969219u, 0, SIN_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 3219677496u, 2476988526u, 0, SIN_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1064752072u, 4205181601u, 0, SIN_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1065665349u, 897699253u, 0, SIN_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 3219483279u, 1204805702u, 0, SIN_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 1068638216u, 877792013u, 0, SIN_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 3215486773u, 1278566204u, 0, SIN_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1070809933u, 656420698u, 0, SIN_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 3220005840u, 3974123114u, 0, SIN_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 3220175113u, 3998644826u, 0, SIN_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 1068707993u, 3902663790u, 0, SIN_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 3219835626u, 1742181520u, 0, SIN_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 3214433323u, 2592553516u, 0, SIN_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1071167510u, 819576280u, 0, SIN_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 3208774795u, 2233231096u, 0, SIN_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1072456452u, 882065402u, 0, SIN_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 3219702013u, 192990048u, 0, SIN_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 3200062692u, 2871641640u, 0, SIN_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 1068349537u, 3457970651u, 0, SIN_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 3195449689u, 2386312537u, 0, SIN_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1072499185u, 2089737020u, 0, SIN_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1071870382u, 1073334537u, 0, SIN_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1045506226u, 2342364630u, 0, SIN_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 3201169162u, 2911530147u, 0, SIN_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 1050472772u, 1836216156u, 0, SIN_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1070166968u, 4228921710u, 0, SIN_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 3208554596u, 2667081449u, 0, SIN_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 3193931414u, 1565550569u, 0, SIN_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 3219818408u, 1142564445u, 0, SIN_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1053576974u, 1492607534u, 0, SIN_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 1071887116u, 525452416u, 0, SIN_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 3217889805u, 2998184084u, 0, SIN_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 3219896487u, 3785128251u, 0, SIN_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1060199382u, 1625675800u, 0, SIN_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 3219187029u, 4160198778u, 0, SIN_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1072292043u, 374164345u, 0, SIN_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 3210671077u, 194975196u, 0, SIN_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 3220086075u, 82631293u, 0, SIN_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1068257446u, 2455089238u, 0, SIN_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1063211460u, 79265977u, 0, SIN_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 3218511880u, 3277707552u, 0, SIN_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1071103413u, 828912693u, 0, SIN_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 1072591385u, 3082809316u, 0, SIN_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 1072278178u, 3405273341u, 0, SIN_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1064761235u, 3788050789u, 0, SIN_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 3212669513u, 3263410238u, 0, SIN_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 1062762008u, 2356441311u, 0, SIN_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 1069598005u, 3806390758u, 0, SIN_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 3189496738u, 4063688092u, 0, SIN_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1062350618u, 3895169615u, 0, SIN_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 1071907710u, 4044840027u, 0, SIN_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 3218243918u, 2791615725u, 0, SIN_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1071558334u, 1773771057u, 0, SIN_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1044581201u, 2869128958u, 0, SIN_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1051832506u, 3112380284u, 0, SIN_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 3218023891u, 2206751039u, 0, SIN_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 1070566791u, 3693771798u, 0, SIN_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1048415431u, 336846942u, 0, SIN_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 1055954236u, 3639046406u, 0, SIN_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 3211904789u, 2186409606u, 0, SIN_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 3219859002u, 933735856u, 0, SIN_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1072468298u, 2249202001u, 0, SIN_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 3205806444u, 3554609858u, 0, SIN_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 3209906076u, 1345723928u, 0, SIN_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1066720729u, 1598401379u, 0, SIN_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1072537699u, 4085430850u, 0, SIN_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1071751521u, 1124141059u, 0, SIN_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 3190626018u, 3739770117u, 0, SIN_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 1069557100u, 3597060909u, 0, SIN_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1072645188u, 2504109125u, 0, SIN_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 1054849265u, 2353018718u, 0, SIN_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 3220174666u, 3270764328u, 0, SIN_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 3219645457u, 3531409241u, 0, SIN_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 3199712298u, 36853082u, 0, SIN_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 3219992533u, 3618466663u, 0, SIN_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 3197852749u, 3808681442u, 0, SIN_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 1040685928u, 3175490326u, 0, SIN_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 1042302993u, 3124482451u, 0, SIN_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 1045245695u, 2751606436u, 0, SIN_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1072286341u, 1362265118u, 0, SIN_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 3199349254u, 1019915839u, 0, SIN_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 3199478752u, 2060431950u, 0, SIN_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 3191180557u, 1098469906u, 0, SIN_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 3209974707u, 1543399360u, 0, SIN_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 3219765832u, 3012348119u, 0, SIN_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 3219808843u, 3014971771u, 0, SIN_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 3220165679u, 685102012u, 0, SIN_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 3220072965u, 474412391u, 0, SIN_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 3217398459u, 1862039103u, 0, SIN_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 1062971252u, 1316352658u, 0, SIN_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 3213773041u, 3660226702u, 0, SIN_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1045656117u, 1385714428u, 0, SIN_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1050527919u, 599268270u, 0, SIN_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 1069947162u, 1780277781u, 0, SIN_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1045922781u, 3136078995u, 0, SIN_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 1072686336u, 1152698935u, 0, SIN_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1072324232u, 3449767578u, 0, SIN_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 3189114773u, 1922837702u, 0, SIN_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 1070965580u, 3935697264u, 0, SIN_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1071684378u, 548705734u, 0, SIN_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 3218751755u, 1233472933u, 0, SIN_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 3196182703u, 1085283161u, 0, SIN_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 3219971367u, 394023925u, 0, SIN_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 3218804621u, 1993316150u, 0, SIN_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 3201277070u, 2205212798u, 0, SIN_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1067699285u, 1871096311u, 0, SIN_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 3210833091u, 3517395975u, 0, SIN_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 3204950351u, 967730542u, 0, SIN_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 1071758532u, 2855666981u, 0, SIN_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 3206031242u, 1475597764u, 0, SIN_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 3202074143u, 690100285u, 0, SIN_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 3220176185u, 1631825320u, 0, SIN_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 3219240085u, 1012830439u, 0, SIN_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 3203879091u, 4173584839u, 0, SIN_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 1067740115u, 3998469072u, 0, SIN_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 3220110698u, 974706513u, 0, SIN_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1072094479u, 2895643002u, 0, SIN_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1071976815u, 3306026822u, 0, SIN_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 1070735011u, 1291506150u, 0, SIN_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 3219902662u, 1451815939u, 0, SIN_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 3213454768u, 3879155175u, 0, SIN_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 3218237932u, 567370693u, 0, SIN_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 1070750582u, 4079109003u, 0, SIN_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 3220101257u, 368328880u, 0, SIN_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 3219776304u, 644559464u, 0, SIN_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 3204570464u, 1775126159u, 0, SIN_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 3193845708u, 2614400265u, 0, SIN_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 3213982623u, 79201814u, 0, SIN_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1071041198u, 1507254391u, 0, SIN_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 3219333885u, 3048377941u, 0, SIN_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1072685797u, 2235914534u, 0, SIN_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 3196739825u, 784208723u, 0, SIN_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 3219822440u, 478287683u, 0, SIN_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 1072393284u, 1209093961u, 0, SIN_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 3220097373u, 3809888698u, 0, SIN_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1072539707u, 298442240u, 0, SIN_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 3219708924u, 2233835753u, 0, SIN_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1043995372u, 4274131512u, 0, SIN_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 3198822121u, 2648932639u, 0, SIN_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1064563230u, 2503171318u, 0, SIN_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 1061084774u, 1099079215u, 0, SIN_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 3220171054u, 1328376247u, 0, SIN_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1048158178u, 500312004u, 0, SIN_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 3219762765u, 2753996887u, 0, SIN_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 3219741310u, 1829458081u, 0, SIN_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1058013442u, 1432546069u, 0, SIN_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 3214538437u, 1790486854u, 0, SIN_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1068587528u, 1811589707u, 0, SIN_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 1072099461u, 2434446950u, 0, SIN_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 3219902375u, 1240074469u, 0, SIN_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 3220110703u, 2829078942u, 0, SIN_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 3218923581u, 2733939463u, 0, SIN_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 3204860597u, 1227417723u, 0, SIN_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 3220021681u, 3043659987u, 0, SIN_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 3197712584u, 4277540884u, 0, SIN_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 3195975013u, 900999575u, 0, SIN_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1072113725u, 4220821840u, 0, SIN_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1048668084u, 2154187859u, 0, SIN_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 3219480669u, 133389711u, 0, SIN_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 3219946283u, 1171404582u, 0, SIN_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 3218533956u, 783944099u, 0, SIN_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 1072633472u, 88715692u, 0, SIN_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 3217299354u, 982247005u, 0, SIN_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 1050438056u, 3655291952u, 0, SIN_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 3215736442u, 1512978851u, 0, SIN_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 3218967800u, 4050972393u, 0, SIN_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 3219969044u, 3383509535u, 0, SIN_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 3206733664u, 1917635426u, 0, SIN_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 3217325547u, 1587065816u, 0, SIN_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 3213444364u, 1567572359u, 0, SIN_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 1071662076u, 3674672329u, 0, SIN_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 3204276820u, 2094602508u, 0, SIN_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 3192954620u, 2892538035u, 0, SIN_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 3216437532u, 3818749185u, 0, SIN_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 3191562216u, 607966734u, 0, SIN_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 3216387986u, 1984249858u, 0, SIN_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 3216456520u, 1563473680u, 0, SIN_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 3212912293u, 4169087664u, 0, SIN_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1071758952u, 1596727108u, 0, SIN_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 1049886858u, 2958421241u, 0, SIN_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 3193026497u, 3221475559u, 0, SIN_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1071155300u, 87724169u, 0, SIN_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 3220175220u, 1174141716u, 0, SIN_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 3210617891u, 1436289661u, 0, SIN_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1040575629u, 90378038u, 0, SIN_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1071615859u, 1847810491u, 0, SIN_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1068456740u, 1414423441u, 0, SIN_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1051205256u, 2034777651u, 0, SIN_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 1051063028u, 1489111820u, 0, SIN_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 3206743917u, 2778835738u, 0, SIN_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1071953937u, 2742148483u, 0, SIN_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 1065927297u, 1140266162u, 0, SIN_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1069895689u, 358674981u, 0, SIN_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 3215813938u, 1606543595u, 0, SIN_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 3209301560u, 3711574012u, 0, SIN_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1052313869u, 2852348313u, 0, SIN_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 1043946301u, 3589563265u, 0, SIN_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 3190610826u, 1766416701u, 0, SIN_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 3219942933u, 3406162011u, 0, SIN_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 3214626985u, 2749575794u, 0, SIN_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1071824356u, 3919108797u, 0, SIN_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 3210792096u, 2844263943u, 0, SIN_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1069598124u, 3479937974u, 0, SIN_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 1058947127u, 2567082753u, 0, SIN_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 1046157033u, 15816844u, 0, SIN_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1042413021u, 1051983351u, 0, SIN_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 3201249525u, 2003795801u, 0, SIN_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1052556037u, 3671480672u, 0, SIN_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1067396794u, 4124800169u, 0, SIN_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1064194387u, 1955210840u, 0, SIN_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 1052140785u, 4167785024u, 0, SIN_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1070593685u, 930980615u, 0, SIN_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 1049366282u, 953085134u, 0, SIN_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1069497393u, 480300537u, 0, SIN_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1067219365u, 2007310307u, 0, SIN_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 3219264568u, 3771674599u, 0, SIN_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 3218137847u, 1567210213u, 0, SIN_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1069609713u, 861651410u, 0, SIN_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 3220140746u, 429356827u, 0, SIN_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 3198557846u, 86295760u, 0, SIN_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 1071324547u, 2757010564u, 0, SIN_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 3220095326u, 521246131u, 0, SIN_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 1072639725u, 165429234u, 0, SIN_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 3219625989u, 633989636u, 0, SIN_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 3218529442u, 71696266u, 0, SIN_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1058899062u, 949384072u, 0, SIN_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1072461134u, 2487756616u, 0, SIN_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 3218316220u, 868579447u, 0, SIN_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1057078797u, 650761015u, 0, SIN_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 3207115731u, 1381838934u, 0, SIN_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 3201597307u, 921054269u, 0, SIN_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1067510093u, 2282908158u, 0, SIN_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 3218425102u, 3708938007u, 0, SIN_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 3217573076u, 2367761568u, 0, SIN_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 3219201617u, 765596820u, 0, SIN_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 3217621113u, 873360802u, 0, SIN_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 1072687886u, 3930762827u, 0, SIN_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 3211846074u, 3505394660u, 0, SIN_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 3219618337u, 3705914211u, 0, SIN_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 3217414778u, 3301659344u, 0, SIN_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 3189302097u, 3775270392u, 0, SIN_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 3204330900u, 3098050414u, 0, SIN_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 3201591712u, 3718418496u, 0, SIN_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1044131371u, 508048351u, 0, SIN_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 3198611627u, 2784737657u, 0, SIN_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 1071495018u, 3178588094u, 0, SIN_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 3217500553u, 2290438925u, 0, SIN_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 3216579489u, 4159294474u, 0, SIN_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 1048430980u, 2083412128u, 0, SIN_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 3216542507u, 215621546u, 0, SIN_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 3220143575u, 2114052675u, 0, SIN_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 3218178701u, 29998399u, 0, SIN_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1067683599u, 2295121613u, 0, SIN_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 3219786441u, 533914340u, 0, SIN_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 3202965930u, 330776666u, 0, SIN_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 3220087007u, 95099636u, 0, SIN_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 3219800876u, 983380726u, 0, SIN_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 3192972706u, 1566376352u, 0, SIN_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1071502363u, 1641513533u, 0, SIN_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 3216669383u, 4291074098u, 0, SIN_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1072513290u, 2095198212u, 0, SIN_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1072674175u, 3406438775u, 0, SIN_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 1066482890u, 413456908u, 0, SIN_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 1066091947u, 2046428131u, 0, SIN_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 1072670444u, 2809926129u, 0, SIN_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 3195084967u, 2163853084u, 0, SIN_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1071515415u, 4132615641u, 0, SIN_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 1072207361u, 414524426u, 0, SIN_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 3201904086u, 2571313869u, 0, SIN_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 3219215904u, 3059520098u, 0, SIN_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 1067594500u, 166622290u, 0, SIN_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 3220145742u, 42617798u, 0, SIN_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 1072561542u, 1965238809u, 0, SIN_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 3198632935u, 2527385069u, 0, SIN_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 3219788598u, 2965776922u, 0, SIN_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 1058857869u, 2656814049u, 0, SIN_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1072450473u, 2447589729u, 0, SIN_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1071694670u, 2689772186u, 0, SIN_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 3220176463u, 2050031094u, 0, SIN_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 1072192681u, 1960692440u, 0, SIN_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 3191401834u, 3850162281u, 0, SIN_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1066470796u, 966739062u, 0, SIN_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 1072497290u, 3546882296u, 0, SIN_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 3220118733u, 25015996u, 0, SIN_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 3218675396u, 3635036859u, 0, SIN_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 3219592964u, 2876754847u, 0, SIN_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 3198234428u, 1551747859u, 0, SIN_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 3220062255u, 812536194u, 0, SIN_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 3203949705u, 3602446005u, 0, SIN_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 3198824584u, 3961207411u, 0, SIN_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 3220040008u, 2497124737u, 0, SIN_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 3213275626u, 3797578388u, 0, SIN_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1066826084u, 228279643u, 0, SIN_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 1049661768u, 1454212804u, 0, SIN_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 3217043135u, 195821175u, 0, SIN_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 3216407381u, 3639731911u, 0, SIN_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1069092570u, 1466027195u, 0, SIN_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1066526976u, 455592928u, 0, SIN_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 3219638163u, 2955619445u, 0, SIN_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1072671174u, 3976384735u, 0, SIN_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 3203199850u, 1831808154u, 0, SIN_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1072485486u, 2297831715u, 0, SIN_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 1072590812u, 4038425279u, 0, SIN_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 3220175561u, 802321461u, 0, SIN_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 3217897637u, 1983010531u, 0, SIN_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 3215946382u, 4157973483u, 0, SIN_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 3219982433u, 206443956u, 0, SIN_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 3192897879u, 1307010018u, 0, SIN_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 3220138045u, 3201333477u, 0, SIN_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 3188230541u, 760006940u, 0, SIN_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 1072407277u, 3529099003u, 0, SIN_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 3191802156u, 545462045u, 0, SIN_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 1061232136u, 3438851257u, 0, SIN_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1049883857u, 1804177418u, 0, SIN_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 3215831266u, 313798122u, 0, SIN_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1055471915u, 1599210902u, 0, SIN_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 3207502326u, 2929338288u, 0, SIN_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 1072082805u, 370540720u, 0, SIN_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 3198416643u, 150890608u, 0, SIN_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 1062008938u, 3313057461u, 0, SIN_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 3216852172u, 4074570681u, 0, SIN_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1064841862u, 1919635398u, 0, SIN_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 3219057401u, 995701688u, 0, SIN_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 3220032872u, 3228685377u, 0, SIN_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 1042137451u, 2497054124u, 0, SIN_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1047037641u, 790219081u, 0, SIN_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 1057781400u, 1145526553u, 0, SIN_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 3202729813u, 2684243741u, 0, SIN_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1070877719u, 2705967942u, 0, SIN_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 1063230985u, 2179651933u, 0, SIN_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 1064863538u, 2763460549u, 0, SIN_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 3204547572u, 840449402u, 0, SIN_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 1064632078u, 209377307u, 0, SIN_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 3211532947u, 61380288u, 0, SIN_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 3191062890u, 2002049816u, 0, SIN_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 1072118877u, 1278678307u, 0, SIN_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 1070995575u, 2527929909u, 0, SIN_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 3196861276u, 3899474959u, 0, SIN_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1072258821u, 2147418766u, 0, SIN_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1072153286u, 2509034605u, 0, SIN_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1054806016u, 1479761515u, 0, SIN_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 3219509598u, 3162938688u, 0, SIN_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1071860231u, 4036566694u, 0, SIN_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 3193829772u, 41779311u, 0, SIN_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1058131100u, 1389319230u, 0, SIN_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1072144601u, 1216854602u, 0, SIN_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 1070655378u, 1125014315u, 0, SIN_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 3195453512u, 35164287u, 0, SIN_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 3219474557u, 145576704u, 0, SIN_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1068842719u, 319192824u, 0, SIN_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1046252518u, 981897614u, 0, SIN_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 1068861989u, 2803598491u, 0, SIN_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 1069770986u, 187872487u, 0, SIN_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 3219606702u, 664833781u, 0, SIN_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 3218078590u, 1558660632u, 0, SIN_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 3219745876u, 2119491553u, 0, SIN_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1072278020u, 3712833510u, 0, SIN_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 3194118956u, 709803844u, 0, SIN_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 3193280779u, 744421179u, 0, SIN_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1072659620u, 690167108u, 0, SIN_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 3206108502u, 134135102u, 0, SIN_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 3219163481u, 1790069326u, 0, SIN_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 3219784663u, 2266824838u, 0, SIN_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 3203476252u, 3792179630u, 0, SIN_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 3205316273u, 2111284942u, 0, SIN_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 3219859189u, 4204717066u, 0, SIN_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 3194595076u, 2991290479u, 0, SIN_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1072613721u, 801682150u, 0, SIN_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 3220096300u, 2928589051u, 0, SIN_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 1053236165u, 3748924669u, 0, SIN_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1071259366u, 3324387602u, 0, SIN_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1053106984u, 1449158282u, 0, SIN_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1071375546u, 4139155718u, 0, SIN_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 3220042721u, 1257491179u, 0, SIN_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 3200308256u, 3315124712u, 0, SIN_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 3196425891u, 2246037476u, 0, SIN_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 3193006859u, 4191285446u, 0, SIN_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 3219074285u, 286563280u, 0, SIN_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1072619577u, 3792685792u, 0, SIN_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 3219437766u, 2995392509u, 0, SIN_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 3191549550u, 3797143370u, 0, SIN_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 3218059077u, 1307279186u, 0, SIN_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 3219568792u, 1732990341u, 0, SIN_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 3200980575u, 3309665549u, 0, SIN_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 3219310107u, 247678568u, 0, SIN_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 1067019502u, 4105433546u, 0, SIN_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 3216906899u, 1904351782u, 0, SIN_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1072620409u, 2752740672u, 0, SIN_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 3220123530u, 1783233073u, 0, SIN_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 3220107204u, 3311454131u, 0, SIN_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 1064074691u, 396556434u, 0, SIN_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 3217169719u, 1900478768u, 0, SIN_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1052843785u, 351058342u, 0, SIN_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1054128006u, 1365220347u, 0, SIN_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1064122381u, 2204556131u, 0, SIN_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 1070742515u, 3481964645u, 0, SIN_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1072410999u, 2117102088u, 0, SIN_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 3198135087u, 1636965923u, 0, SIN_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 1050931318u, 3551516626u, 0, SIN_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 3218591622u, 1181654978u, 0, SIN_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 3218183231u, 3162146735u, 0, SIN_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 3214483846u, 190538678u, 0, SIN_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1071919107u, 1715483804u, 0, SIN_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 1072330076u, 3935618552u, 0, SIN_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 3205479397u, 3434459874u, 0, SIN_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 3213993931u, 3731633135u, 0, SIN_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 1071886405u, 1807554190u, 0, SIN_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 1072600554u, 3493319746u, 0, SIN_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 3204057950u, 185533994u, 0, SIN_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1071195689u, 2201933024u, 0, SIN_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 1042654053u, 2171898436u, 0, SIN_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 3220170308u, 3389552159u, 0, SIN_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 3219634155u, 704817172u, 0, SIN_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 3205426509u, 1234159317u, 0, SIN_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 3210978636u, 3259134081u, 0, SIN_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 1050299283u, 3772748769u, 0, SIN_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 3217631057u, 4284143378u, 0, SIN_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1070206721u, 167553464u, 0, SIN_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 3198617153u, 1518333622u, 0, SIN_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 1047317453u, 2825203166u, 0, SIN_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1069818848u, 883839804u, 0, SIN_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 3216389418u, 1921207098u, 0, SIN_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1072335096u, 22009225u, 0, SIN_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 3208098435u, 1700546786u, 0, SIN_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 1071595394u, 1733207567u, 0, SIN_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 1070340609u, 917475295u, 0, SIN_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 3219366437u, 3489378266u, 0, SIN_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 3212869626u, 4094452023u, 0, SIN_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 3202279557u, 1562272590u, 0, SIN_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 1072519452u, 3477669547u, 0, SIN_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 3219358016u, 3762898794u, 0, SIN_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 3217679015u, 4147249967u, 0, SIN_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 3213082473u, 2709607265u, 0, SIN_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1072240213u, 1656142705u, 0, SIN_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 3198075559u, 3891230295u, 0, SIN_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 3219959879u, 13294155u, 0, SIN_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1060624530u, 3752237512u, 0, SIN_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 3218843364u, 965003397u, 0, SIN_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1071085134u, 3025458875u, 0, SIN_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 3219476555u, 130294181u, 0, SIN_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 1064980303u, 517467410u, 0, SIN_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1065956899u, 1987089718u, 0, SIN_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 3213429124u, 4282849056u, 0, SIN_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1072570242u, 3569860264u, 0, SIN_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 1048333111u, 3566257251u, 0, SIN_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 3218860673u, 3554048078u, 0, SIN_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1041627284u, 2336116589u, 0, SIN_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 1058567659u, 897679576u, 0, SIN_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 1044467183u, 2818710946u, 0, SIN_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 3189504094u, 4099522736u, 0, SIN_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1072200212u, 1737419341u, 0, SIN_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 3218570766u, 2805783757u, 0, SIN_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 1071679035u, 447938331u, 0, SIN_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1072411823u, 499804451u, 0, SIN_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 1052415330u, 458754590u, 0, SIN_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 3193282956u, 2533012202u, 0, SIN_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 3203364780u, 4107941752u, 0, SIN_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1072597174u, 435564055u, 0, SIN_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 3193980043u, 1213941006u, 0, SIN_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1072068189u, 225919417u, 0, SIN_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 3220168753u, 3056278709u, 0, SIN_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 3219956586u, 2749317985u, 0, SIN_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1072571659u, 4146519538u, 0, SIN_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1072666832u, 2709716788u, 0, SIN_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 1072605952u, 1232286993u, 0, SIN_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1072215176u, 1059317954u, 0, SIN_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 1041110867u, 2076689028u, 0, SIN_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1047307438u, 1376882090u, 0, SIN_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 3218422833u, 2642660829u, 0, SIN_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 3219970288u, 3526549197u, 0, SIN_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1043564602u, 3685851715u, 0, SIN_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1040244055u, 3974431579u, 0, SIN_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 3191496789u, 3819109588u, 0, SIN_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 1072331114u, 3149593052u, 0, SIN_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1048038468u, 2228686190u, 0, SIN_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 3217932555u, 3373042203u, 0, SIN_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1071833840u, 2957860682u, 0, SIN_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 1045883607u, 1278581412u, 0, SIN_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 1072575899u, 692380978u, 0, SIN_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1072509343u, 2661354649u, 0, SIN_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1072613751u, 1733668973u, 0, SIN_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 3220144878u, 1302979618u, 0, SIN_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 3220106005u, 347473173u, 0, SIN_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 3219346471u, 1082368428u, 0, SIN_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1065302976u, 2196771713u, 0, SIN_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1058468363u, 826667283u, 0, SIN_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1057279949u, 2137757362u, 0, SIN_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 3189636931u, 851569132u, 0, SIN_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 1068716420u, 3379072270u, 0, SIN_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 3220111575u, 1489682636u, 0, SIN_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1072487430u, 2559630632u, 0, SIN_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 3217825786u, 3141296516u, 0, SIN_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 3220173621u, 3576513478u, 0, SIN_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 3219908339u, 4273266576u, 0, SIN_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 1061442763u, 283511768u, 0, SIN_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 3191395187u, 2372623300u, 0, SIN_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1072383342u, 3738669031u, 0, SIN_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 1062262700u, 3677779917u, 0, SIN_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 1057172551u, 3620151104u, 0, SIN_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 3215234871u, 2712477825u, 0, SIN_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 3220174867u, 1806978771u, 0, SIN_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 3219413463u, 3398089452u, 0, SIN_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 3217339456u, 3133783484u, 0, SIN_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1067764907u, 3839181841u, 0, SIN_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 1068217911u, 581741099u, 0, SIN_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1069914119u, 1727818807u, 0, SIN_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 1068067794u, 4218705145u, 0, SIN_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 3208484674u, 655859505u, 0, SIN_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1071768245u, 3065994952u, 0, SIN_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 3220129698u, 1382726161u, 0, SIN_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 1049139928u, 1469010783u, 0, SIN_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1071272555u, 2206999416u, 0, SIN_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 3215990730u, 631966881u, 0, SIN_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 3219824607u, 3141768906u, 0, SIN_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 3220129859u, 885379396u, 0, SIN_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1047279982u, 3840538369u, 0, SIN_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 3217601482u, 3545288024u, 0, SIN_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 3220174936u, 1087612617u, 0, SIN_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1044195166u, 3510904416u, 0, SIN_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 3218832631u, 4285275856u, 0, SIN_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1072113216u, 2678860791u, 0, SIN_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1046586062u, 2207037105u, 0, SIN_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 3197884060u, 3838689624u, 0, SIN_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 3218875557u, 2578651385u, 0, SIN_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 3199540805u, 3502369929u, 0, SIN_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1064676135u, 3414357561u, 0, SIN_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 3193514956u, 3653237930u, 0, SIN_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1053588582u, 376514694u, 0, SIN_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 3219291476u, 1962122958u, 0, SIN_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 1069631247u, 1773886841u, 0, SIN_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 3217854652u, 1187254372u, 0, SIN_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 3214799057u, 2317319704u, 0, SIN_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 3205946965u, 988136066u, 0, SIN_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 1072692861u, 472379830u, 0, SIN_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 3220084938u, 2073324112u, 0, SIN_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 3218724494u, 3260403043u, 0, SIN_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1068544147u, 1040823283u, 0, SIN_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 1072347290u, 2008822234u, 0, SIN_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 3220175631u, 284831033u, 0, SIN_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 1041545782u, 2024044989u, 0, SIN_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 1053207518u, 2564957860u, 0, SIN_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 3219783008u, 3408493261u, 0, SIN_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1059802968u, 532767073u, 0, SIN_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 3193155705u, 659070058u, 0, SIN_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 3217671637u, 3384799844u, 0, SIN_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 3220114563u, 1165540335u, 0, SIN_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1056934836u, 1949231356u, 0, SIN_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 1057530368u, 2073059984u, 0, SIN_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 3200839250u, 3792921417u, 0, SIN_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 3220166202u, 497140450u, 0, SIN_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 3201314702u, 236873391u, 0, SIN_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1064936582u, 2840518528u, 0, SIN_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 3218010389u, 1041275114u, 0, SIN_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 3220095357u, 2012768440u, 0, SIN_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_SIN_H multiple inclusion protection + +// EOF sin.h diff --git a/packages/language/c/libm/current/tests/vectors/sinh.c b/packages/language/c/libm/current/tests/vectors/sinh.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/sinh.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// sinh.c +// +// Test of sinh() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/sinh.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(sinh_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &sinh, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &sinh_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("sinh() is stable"); + } // if + else + { + CYG_TEST_FAIL("sinh() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library sinh() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "sinh() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF sinh.c diff --git a/packages/language/c/libm/current/tests/vectors/sinh.h b/packages/language/c/libm/current/tests/vectors/sinh.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/sinh.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_SINH_H +#define CYGONCE_LIBM_SINH_H +//=========================================================================== +// +// sinh.h +// +// Test vectors for testing of sinh() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/sinh.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define SINH_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t sinh_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1074853420u, 2506787616u, 1090024059u, 3619148316u, 1078024954u, 1325672821u, 0, SINH_TOLERANCE, 0}, +{ 2, 3220250806u, 3176730980u, 1051524793u, 2993920299u, 3220477814u, 4166713187u, 0, SINH_TOLERANCE, 0}, +{ 3, 3226028315u, 2725707538u, 3232101343u, 2346810316u, 3295615262u, 3406370818u, 0, SINH_TOLERANCE, 0}, +{ 4, 1078922874u, 2088062470u, 3201242716u, 420891118u, 1165520069u, 2120331304u, 0, SINH_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 3222032301u, 4262763718u, 0, SINH_TOLERANCE, 0}, +{ 6, 1077828855u, 1746012320u, 1054478713u, 3333988501u, 1117516582u, 699114409u, 0, SINH_TOLERANCE, 0}, +{ 7, 1066827528u, 183014794u, 3202039382u, 2016785810u, 1066827646u, 2740062550u, 0, SINH_TOLERANCE, 0}, +{ 8, 3219777490u, 2688957927u, 1046089230u, 2709029994u, 3219969104u, 3103290362u, 0, SINH_TOLERANCE, 0}, +{ 9, 1070330066u, 624574473u, 1045840574u, 3473266330u, 1070344642u, 3098664718u, 0, SINH_TOLERANCE, 0}, +{ 10, 3217502754u, 1605286142u, 1068931671u, 4233776869u, 3217511088u, 1479052898u, 0, SINH_TOLERANCE, 0}, +{ 11, 1069780594u, 1857607719u, 3222889559u, 3417070006u, 1069785586u, 2351965982u, 0, SINH_TOLERANCE, 0}, +{ 12, 1081579891u, 3981151660u, 1088899021u, 1332651746u, 1642782946u, 1345086100u, 0, SINH_TOLERANCE, 0}, +{ 13, 1075860838u, 3824988054u, 1066856791u, 2070129652u, 1083933725u, 1287980412u, 0, SINH_TOLERANCE, 0}, +{ 14, 3218045550u, 1372884064u, 1080833116u, 3229926662u, 3218066407u, 1712809869u, 0, SINH_TOLERANCE, 0}, +{ 15, 1078097861u, 3217805330u, 3191644264u, 2014578707u, 1127449977u, 1807458751u, 0, SINH_TOLERANCE, 0}, +{ 16, 1080267391u, 265058758u, 3239903247u, 1630600647u, 1308474718u, 1523986687u, 0, SINH_TOLERANCE, 0}, +{ 17, 1073221381u, 1946677669u, 3198462609u, 926009897u, 1073814134u, 965164266u, 0, SINH_TOLERANCE, 0}, +{ 18, 1073178875u, 2271884183u, 3203741999u, 2118617783u, 1073764879u, 2502245462u, 0, SINH_TOLERANCE, 0}, +{ 19, 3214772053u, 213658772u, 3249401130u, 314151656u, 3214772321u, 1121595103u, 0, SINH_TOLERANCE, 0}, +{ 20, 3228946464u, 1564829925u, 3197817016u, 497230814u, 3747008735u, 3665494831u, 0, SINH_TOLERANCE, 0}, +{ 21, 3219408362u, 2075329122u, 3231746400u, 169900577u, 3219499040u, 1378507091u, 0, SINH_TOLERANCE, 0}, +{ 22, 1067674434u, 541549344u, 1096608669u, 3119070100u, 1067674739u, 1142681329u, 0, SINH_TOLERANCE, 0}, +{ 23, 1075989871u, 567496114u, 1045286891u, 1969998540u, 1085434125u, 3122029707u, 0, SINH_TOLERANCE, 0}, +{ 24, 1069985379u, 1299369769u, 1049342524u, 4167404066u, 1069993170u, 957868079u, 0, SINH_TOLERANCE, 0}, +{ 25, 3218302829u, 3348930841u, 1078472138u, 358457347u, 3218322401u, 4210136577u, 0, SINH_TOLERANCE, 0}, +{ 26, 1073166449u, 2192461366u, 1099527247u, 3184735642u, 1073750816u, 3805009043u, 0, SINH_TOLERANCE, 0}, +{ 27, 1068590412u, 331696577u, 3189610016u, 793242270u, 1068591289u, 2713729777u, 0, SINH_TOLERANCE, 0}, +{ 28, 3229460262u, 2322696981u, 1083791358u, 3020766674u, 3936770457u, 4287903039u, 0, SINH_TOLERANCE, 0}, +{ 29, 1066922273u, 252085215u, 3214426435u, 4139068910u, 1066922416u, 83845212u, 0, SINH_TOLERANCE, 0}, +{ 30, 3221457149u, 105589263u, 1056316170u, 261630827u, 3222720706u, 3192021150u, 0, SINH_TOLERANCE, 0}, +{ 31, 1082047584u, 428765703u, 3251828686u, 2009972239u, 1815498097u, 3462966019u, 0, SINH_TOLERANCE, 0}, +{ 32, 1079693651u, 3517376586u, 3240257920u, 3304487302u, 1233851281u, 1250614638u, 0, SINH_TOLERANCE, 0}, +{ 33, 3224100728u, 237004814u, 3237899261u, 3364008659u, 3240179835u, 168260289u, 0, SINH_TOLERANCE, 0}, +{ 34, 3214121920u, 472004928u, 3226869477u, 1186387580u, 3214121998u, 2769782808u, 0, SINH_TOLERANCE, 0}, +{ 35, 1068906914u, 4085763910u, 1106394906u, 2684738273u, 1068908745u, 1510279260u, 0, SINH_TOLERANCE, 0}, +{ 36, 1069636551u, 2055490142u, 3231581370u, 3879040079u, 1069640041u, 2752142379u, 0, SINH_TOLERANCE, 0}, +{ 37, 3213093895u, 3725731239u, 1061652681u, 591292963u, 3213093916u, 1967435138u, 0, SINH_TOLERANCE, 0}, +{ 38, 3221869253u, 1147041027u, 3215417793u, 624695933u, 3223924727u, 2571982132u, 0, SINH_TOLERANCE, 0}, +{ 39, 3217587110u, 705725219u, 3238067573u, 1116238321u, 3217596911u, 3311611344u, 0, SINH_TOLERANCE, 0}, +{ 40, 3217852848u, 7287411u, 1045917232u, 116067742u, 3217868380u, 3703123310u, 0, SINH_TOLERANCE, 0}, +{ 41, 3226423734u, 3604989074u, 1066381836u, 545298780u, 3313804928u, 3198996771u, 0, SINH_TOLERANCE, 0}, +{ 42, 3221178088u, 1681476121u, 1060345752u, 3553822398u, 3221991193u, 2715753141u, 0, SINH_TOLERANCE, 0}, +{ 43, 1080811562u, 3410480388u, 1052460275u, 1660607230u, 1408926430u, 2715754844u, 0, SINH_TOLERANCE, 0}, +{ 44, 1077682533u, 1494984673u, 3196647153u, 287894723u, 1114110585u, 2741076212u, 0, SINH_TOLERANCE, 0}, +{ 45, 1068516615u, 644548665u, 1081948134u, 2442134629u, 1068517333u, 260208407u, 0, SINH_TOLERANCE, 0}, +{ 46, 1077068335u, 2312530895u, 3221584595u, 3379665576u, 1100002913u, 3357999193u, 0, SINH_TOLERANCE, 0}, +{ 47, 1079308159u, 3018463866u, 1086226574u, 404012923u, 1198269222u, 2905917257u, 0, SINH_TOLERANCE, 0}, +{ 48, 1071024755u, 1710279345u, 3251401196u, 3528946000u, 1071055486u, 60512890u, 0, SINH_TOLERANCE, 0}, +{ 49, 1070973535u, 2164450219u, 1083520023u, 3312018966u, 1071001167u, 1910140323u, 0, SINH_TOLERANCE, 0}, +{ 50, 1069831588u, 2648986431u, 1050330591u, 1474376550u, 1069837201u, 704378001u, 0, SINH_TOLERANCE, 0}, +{ 51, 3214344972u, 1839068700u, 1077406406u, 3013052171u, 3214345099u, 1580301750u, 0, SINH_TOLERANCE, 0}, +{ 52, 1066416574u, 772102380u, 3220729740u, 4219039958u, 1066416618u, 2907767777u, 0, SINH_TOLERANCE, 0}, +{ 53, 3223180765u, 3058618779u, 1046304788u, 3338676024u, 3230342304u, 3808714856u, 0, SINH_TOLERANCE, 0}, +{ 54, 1067949353u, 506286854u, 1094907481u, 2217000199u, 1067949901u, 3532436019u, 0, SINH_TOLERANCE, 0}, +{ 55, 1076136854u, 1147428263u, 1065432625u, 3034786717u, 1087127673u, 1621780183u, 0, SINH_TOLERANCE, 0}, +{ 56, 1075725296u, 2844125311u, 1082985198u, 2561492677u, 1083060296u, 554895537u, 0, SINH_TOLERANCE, 0}, +{ 57, 3218876948u, 704542600u, 3222902057u, 2762779203u, 3218937103u, 1557942213u, 0, SINH_TOLERANCE, 0}, +{ 58, 3215409254u, 184131949u, 3249723525u, 1667366082u, 3215409777u, 3745315154u, 0, SINH_TOLERANCE, 0}, +{ 59, 3221512446u, 3904224140u, 1067056698u, 2942159914u, 3222889439u, 2388317524u, 0, SINH_TOLERANCE, 0}, +{ 60, 1080713919u, 426114282u, 3209056785u, 1083606355u, 1390879870u, 3657642479u, 0, SINH_TOLERANCE, 0}, +{ 61, 1082048697u, 3774123863u, 1106787580u, 2722107965u, 1815954824u, 2241806278u, 0, SINH_TOLERANCE, 0}, +{ 62, 1077519332u, 1377734762u, 1104232051u, 2377063483u, 1110428932u, 844049504u, 0, SINH_TOLERANCE, 0}, +{ 63, 1072526287u, 1029739074u, 1105467109u, 3062201018u, 1072751914u, 89150669u, 0, SINH_TOLERANCE, 0}, +{ 64, 3225304413u, 773857656u, 3214251949u, 335833884u, 3264787509u, 3714139170u, 0, SINH_TOLERANCE, 0}, +{ 65, 3216856098u, 1473865960u, 1103073830u, 4000427507u, 3216860305u, 3030706697u, 0, SINH_TOLERANCE, 0}, +{ 66, 1081165135u, 4242092620u, 1067009473u, 14539161u, 1489589453u, 1225921132u, 0, SINH_TOLERANCE, 0}, +{ 67, 3214536170u, 1732245037u, 1101371955u, 1533536108u, 3214536352u, 18093930u, 0, SINH_TOLERANCE, 0}, +{ 68, 3228182475u, 1833841275u, 1099430098u, 4144145552u, 3535623788u, 2429748539u, 0, SINH_TOLERANCE, 0}, +{ 69, 3227493247u, 935007012u, 3188865420u, 604442938u, 3410487768u, 3099153891u, 0, SINH_TOLERANCE, 0}, +{ 70, 3217389013u, 2211464602u, 1046255144u, 1635910526u, 3217395611u, 3092963229u, 0, SINH_TOLERANCE, 0}, +{ 71, 1074725689u, 2549219008u, 3231633258u, 3733639385u, 1077419635u, 3503988551u, 0, SINH_TOLERANCE, 0}, +{ 72, 1075803633u, 1819374372u, 3202219056u, 2617077637u, 1083464179u, 2382136690u, 0, SINH_TOLERANCE, 0}, +{ 73, 1078616640u, 546465680u, 1048653554u, 532401530u, 1151433358u, 1660202510u, 0, SINH_TOLERANCE, 0}, +{ 74, 1066591187u, 2759019783u, 3221570188u, 3554409630u, 1066591257u, 3681433865u, 0, SINH_TOLERANCE, 0}, +{ 75, 3219222738u, 2527221960u, 1099107978u, 2696971136u, 3219280172u, 2776033431u, 0, SINH_TOLERANCE, 0}, +{ 76, 1079332208u, 173134582u, 1087299442u, 2877794600u, 1200522954u, 2450291402u, 0, SINH_TOLERANCE, 0}, +{ 77, 1076963290u, 547642046u, 3197285510u, 3521286127u, 1097525900u, 1604458481u, 0, SINH_TOLERANCE, 0}, +{ 78, 1073812126u, 1231582831u, 1090971734u, 1653446832u, 1074833786u, 707719957u, 0, SINH_TOLERANCE, 0}, +{ 79, 1070779719u, 3762182190u, 3252967851u, 2615360375u, 1070797520u, 4104947389u, 0, SINH_TOLERANCE, 0}, +{ 80, 3216563063u, 2588067350u, 3206610957u, 3551059728u, 3216565624u, 2725656040u, 0, SINH_TOLERANCE, 0}, +{ 81, 3217464616u, 845263327u, 1073415902u, 1749010288u, 3217472337u, 3825523119u, 0, SINH_TOLERANCE, 0}, +{ 82, 3217110706u, 3092685191u, 3190678390u, 2872219490u, 3217114110u, 800542468u, 0, SINH_TOLERANCE, 0}, +{ 83, 3220412207u, 4107255722u, 3205337291u, 3069068345u, 3220757928u, 314341153u, 0, SINH_TOLERANCE, 0}, +{ 84, 3227213641u, 2294867524u, 3216653996u, 2860384670u, 3384744624u, 1311152806u, 0, SINH_TOLERANCE, 0}, +{ 85, 3214297870u, 2265437201u, 3240198679u, 1234948614u, 3214297985u, 4040406728u, 0, SINH_TOLERANCE, 0}, +{ 86, 3219505657u, 1186945904u, 3251167793u, 1896750851u, 3219618092u, 1119536396u, 0, SINH_TOLERANCE, 0}, +{ 87, 1075284022u, 3686084548u, 1079286273u, 3309277689u, 1080454714u, 2582453855u, 0, SINH_TOLERANCE, 0}, +{ 88, 3221379088u, 3006860614u, 3231412671u, 2504194724u, 3222510455u, 4288288336u, 0, SINH_TOLERANCE, 0}, +{ 89, 3224614924u, 1948717780u, 1048317852u, 3791803982u, 3248870698u, 776596525u, 0, SINH_TOLERANCE, 0}, +{ 90, 1070636471u, 4272034420u, 3192982124u, 1526175922u, 1070648746u, 3935275670u, 0, SINH_TOLERANCE, 0}, +{ 91, 3226943458u, 4108948538u, 1104691287u, 640541190u, 3359767069u, 2139002760u, 0, SINH_TOLERANCE, 0}, +{ 92, 3217743177u, 3259274853u, 1082507103u, 3677038020u, 3217756131u, 2371296595u, 0, SINH_TOLERANCE, 0}, +{ 93, 1076841042u, 3781708548u, 1096584871u, 1207386447u, 1095222699u, 77086u, 0, SINH_TOLERANCE, 0}, +{ 94, 3213861096u, 3011191657u, 1103798670u, 1096124830u, 3213861179u, 421678587u, 0, SINH_TOLERANCE, 0}, +{ 95, 1071623631u, 2540404725u, 3240157452u, 4122845725u, 1071677062u, 3895505649u, 0, SINH_TOLERANCE, 0}, +{ 96, 1076303678u, 311336721u, 3214382367u, 4212533768u, 1089026116u, 2663248725u, 0, SINH_TOLERANCE, 0}, +{ 97, 1067916643u, 1769686293u, 3240200923u, 3538602249u, 1067917158u, 222451802u, 0, SINH_TOLERANCE, 0}, +{ 98, 1075081821u, 508056696u, 1103793878u, 776520138u, 1079295536u, 2972109436u, 0, SINH_TOLERANCE, 0}, +{ 99, 1080890481u, 4064962760u, 1077424413u, 819766631u, 1423488425u, 3317334315u, 0, SINH_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1075900006u, 836207848u, 0, SINH_TOLERANCE, 0}, +{ 101, 1076003603u, 2514398118u, 1076579751u, 870169764u, 1085567394u, 3935623416u, 0, SINH_TOLERANCE, 0}, +{ 102, 3227977024u, 1190259653u, 1069112254u, 3417249840u, 3497647119u, 1074619959u, 0, SINH_TOLERANCE, 0}, +{ 103, 3214634603u, 3467757357u, 3215075200u, 2168175352u, 3214634818u, 3566853144u, 0, SINH_TOLERANCE, 0}, +{ 104, 3226011647u, 1508888184u, 1060430241u, 3524949092u, 3294802675u, 4152444040u, 0, SINH_TOLERANCE, 0}, +{ 105, 3215238675u, 166402802u, 3237198975u, 3572369260u, 3215239041u, 3873229460u, 0, SINH_TOLERANCE, 0}, +{ 106, 1075575366u, 2441536203u, 3202753937u, 3658194573u, 1082198547u, 1827858198u, 0, SINH_TOLERANCE, 0}, +{ 107, 1070781516u, 2479742828u, 1062342831u, 4214154303u, 1070799395u, 3712910548u, 0, SINH_TOLERANCE, 0}, +{ 108, 1076105338u, 426896765u, 1066474375u, 2201754442u, 1086731957u, 3444804028u, 0, SINH_TOLERANCE, 0}, +{ 109, 3214503389u, 2055773734u, 3239267288u, 291396537u, 3214503560u, 3311868033u, 0, SINH_TOLERANCE, 0}, +{ 110, 3224385121u, 874125203u, 3210508124u, 4091098764u, 3243570638u, 529374880u, 0, SINH_TOLERANCE, 0}, +{ 111, 1072007482u, 120488169u, 3241241441u, 1985269424u, 1072116464u, 1747805192u, 0, SINH_TOLERANCE, 0}, +{ 112, 3218073746u, 2243036871u, 3243941101u, 740033495u, 3218087608u, 785163442u, 0, SINH_TOLERANCE, 0}, +{ 113, 3218862090u, 1176656356u, 1074261978u, 3588756231u, 3218920795u, 1452796058u, 0, SINH_TOLERANCE, 0}, +{ 114, 3228699543u, 3037249392u, 1061635587u, 1173102190u, 3655813503u, 1211293113u, 0, SINH_TOLERANCE, 0}, +{ 115, 3224626669u, 2882725208u, 1071440059u, 69225090u, 3249151542u, 2351994968u, 0, SINH_TOLERANCE, 0}, +{ 116, 3218954930u, 272319256u, 1072073912u, 2493997123u, 3219023093u, 1135310123u, 0, SINH_TOLERANCE, 0}, +{ 117, 1070303098u, 188610379u, 3232757923u, 2209647371u, 1070317039u, 223028218u, 0, SINH_TOLERANCE, 0}, +{ 118, 3225224181u, 1990439193u, 1078073146u, 622849962u, 3262975180u, 3932839728u, 0, SINH_TOLERANCE, 0}, +{ 119, 1069718653u, 756052458u, 1081649113u, 2247475162u, 1069722955u, 1882814908u, 0, SINH_TOLERANCE, 0}, +{ 120, 1071060248u, 3878055211u, 3222407050u, 2979438623u, 1071093258u, 904197307u, 0, SINH_TOLERANCE, 0}, +{ 121, 3214165365u, 2676398686u, 1105124431u, 3631096636u, 3214165452u, 1700703451u, 0, SINH_TOLERANCE, 0}, +{ 122, 1071370846u, 1697791764u, 3198136112u, 2299842819u, 1071428819u, 1170196391u, 0, SINH_TOLERANCE, 0}, +{ 123, 1074939040u, 1931502677u, 3215264397u, 3016456382u, 1078464451u, 621896109u, 0, SINH_TOLERANCE, 0}, +{ 124, 1073302002u, 343404215u, 1061072607u, 4266232536u, 1073912684u, 1810041008u, 0, SINH_TOLERANCE, 0}, +{ 125, 3225502196u, 4140316002u, 1082896196u, 868256971u, 3271279372u, 3427688141u, 0, SINH_TOLERANCE, 0}, +{ 126, 1074374234u, 1864139509u, 3187675097u, 3084482407u, 1076405552u, 679411243u, 0, SINH_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 3220382988u, 56164501u, 0, SINH_TOLERANCE, 0}, +{ 128, 1070891968u, 3943389284u, 1046724025u, 3626825684u, 1070915110u, 2070530661u, 0, SINH_TOLERANCE, 0}, +{ 129, 1067443098u, 967350972u, 1093012318u, 448002663u, 1067443436u, 161226759u, 0, SINH_TOLERANCE, 0}, +{ 130, 3228777187u, 105058217u, 1069733884u, 171786224u, 3684540794u, 2944133190u, 0, SINH_TOLERANCE, 0}, +{ 131, 3213731756u, 2863482262u, 3204997271u, 877784425u, 3213731824u, 2498719785u, 0, SINH_TOLERANCE, 0}, +{ 132, 3216260801u, 2801782962u, 3213604117u, 762347195u, 3216262185u, 215087844u, 0, SINH_TOLERANCE, 0}, +{ 133, 3224049543u, 2317950339u, 3246333414u, 2135700283u, 3239530127u, 699524600u, 0, SINH_TOLERANCE, 0}, +{ 134, 1069099309u, 4171919805u, 1082858682u, 2180920863u, 1069101966u, 54602163u, 0, SINH_TOLERANCE, 0}, +{ 135, 3221197660u, 1918836931u, 1083603224u, 3137821660u, 3222026761u, 3781661365u, 0, SINH_TOLERANCE, 0}, +{ 136, 1081882778u, 3456203663u, 3235600523u, 2335688936u, 1754633057u, 4057860990u, 0, SINH_TOLERANCE, 0}, +{ 137, 1066396570u, 4170235262u, 1051824459u, 521583737u, 1066396655u, 2875795819u, 0, SINH_TOLERANCE, 0}, +{ 138, 1075056847u, 1296623194u, 3250673860u, 2442872540u, 1079171997u, 1498836646u, 0, SINH_TOLERANCE, 0}, +{ 139, 1071121461u, 289979405u, 1049514449u, 3865737145u, 1071158661u, 3492336834u, 0, SINH_TOLERANCE, 0}, +{ 140, 1074250368u, 3699090239u, 1054539840u, 3259249360u, 1076064424u, 3480543151u, 0, SINH_TOLERANCE, 0}, +{ 141, 1079640884u, 1619819023u, 1045993352u, 1022642459u, 1229016129u, 1444182022u, 0, SINH_TOLERANCE, 0}, +{ 142, 1075141548u, 19455098u, 3229182089u, 2096003654u, 1079643410u, 3425620460u, 0, SINH_TOLERANCE, 0}, +{ 143, 1074200784u, 3803689997u, 1071630912u, 2263729518u, 1075948820u, 2127529538u, 0, SINH_TOLERANCE, 0}, +{ 144, 1080385741u, 2816837387u, 1063422305u, 2597606398u, 1330293545u, 1095829056u, 0, SINH_TOLERANCE, 0}, +{ 145, 1072245897u, 3680967506u, 1040201163u, 179224723u, 1072421412u, 1506861173u, 0, SINH_TOLERANCE, 0}, +{ 146, 3213795591u, 978126928u, 1101553990u, 4047893399u, 3213795666u, 245795167u, 0, SINH_TOLERANCE, 0}, +{ 147, 3221273469u, 4059818629u, 1042678728u, 3640293589u, 3222267219u, 1979827719u, 0, SINH_TOLERANCE, 0}, +{ 148, 3228541096u, 3383497159u, 1070002807u, 1527313008u, 3601881758u, 4173296238u, 0, SINH_TOLERANCE, 0}, +{ 149, 3216339167u, 2599946514u, 1104170406u, 2738675352u, 3216340810u, 4115543106u, 0, SINH_TOLERANCE, 0}, +{ 150, 1081115375u, 3616571377u, 1060859316u, 1130603218u, 1471256027u, 3187069287u, 0, SINH_TOLERANCE, 0}, +{ 151, 1073931644u, 3859211180u, 1067940450u, 1744531824u, 1075120505u, 3725496242u, 0, SINH_TOLERANCE, 0}, +{ 152, 1065900012u, 1958025850u, 3236511256u, 2472176453u, 1065900050u, 102691228u, 0, SINH_TOLERANCE, 0}, +{ 153, 3223669905u, 182132862u, 3250520938u, 3924356991u, 3235157931u, 2605012526u, 0, SINH_TOLERANCE, 0}, +{ 154, 3224210428u, 35632886u, 3209806504u, 1453402523u, 3241402944u, 1099360388u, 0, SINH_TOLERANCE, 0}, +{ 155, 1076182070u, 743225214u, 3202890678u, 142917400u, 1087631855u, 3778664301u, 0, SINH_TOLERANCE, 0}, +{ 156, 1075442096u, 1472665012u, 3203138231u, 256588219u, 1081376581u, 1981675785u, 0, SINH_TOLERANCE, 0}, +{ 157, 1079253522u, 1062927000u, 1061134072u, 931677439u, 1193281892u, 3538812810u, 0, SINH_TOLERANCE, 0}, +{ 158, 1069912068u, 2320910576u, 1055663370u, 288059864u, 1069918761u, 2694094192u, 0, SINH_TOLERANCE, 0}, +{ 159, 1075812365u, 1448349062u, 3199478070u, 3454027134u, 1083509354u, 1611967541u, 0, SINH_TOLERANCE, 0}, +{ 160, 3224875886u, 4215445172u, 3196654963u, 2231888973u, 3254930152u, 159529183u, 0, SINH_TOLERANCE, 0}, +{ 161, 3227757863u, 40413554u, 3232578253u, 983832844u, 3457227287u, 1304081657u, 0, SINH_TOLERANCE, 0}, +{ 162, 3221624382u, 3995725873u, 1050082319u, 777231627u, 3223289886u, 3165308644u, 0, SINH_TOLERANCE, 0}, +{ 163, 1066152450u, 672789828u, 3253385962u, 2982787335u, 1066152508u, 2270849861u, 0, SINH_TOLERANCE, 0}, +{ 164, 1072585179u, 2075971825u, 1070166500u, 4034633931u, 1072795180u, 625760053u, 0, SINH_TOLERANCE, 0}, +{ 165, 3218434785u, 1018222907u, 3244621407u, 3090050495u, 3218461130u, 3184325614u, 0, SINH_TOLERANCE, 0}, +{ 166, 1071875189u, 937732557u, 3200798890u, 2557898276u, 1071955981u, 2106364550u, 0, SINH_TOLERANCE, 0}, +{ 167, 1075196588u, 130346162u, 3223590310u, 275568693u, 1080037789u, 4060643218u, 0, SINH_TOLERANCE, 0}, +{ 168, 1065967541u, 3807416441u, 1075961161u, 3706820266u, 1065967584u, 1846334347u, 0, SINH_TOLERANCE, 0}, +{ 169, 3219244733u, 1710131411u, 1078123323u, 1900790503u, 3219305582u, 1655460974u, 0, SINH_TOLERANCE, 0}, +{ 170, 3226236449u, 3420420033u, 3210844787u, 588423066u, 3305204393u, 774296256u, 0, SINH_TOLERANCE, 0}, +{ 171, 1067509906u, 1160162008u, 3246307879u, 4265764460u, 1067510107u, 3011258957u, 0, SINH_TOLERANCE, 0}, +{ 172, 1080523338u, 366653268u, 3188814424u, 466059202u, 1355764484u, 760636581u, 0, SINH_TOLERANCE, 0}, +{ 173, 3222433435u, 1325936170u, 3221436876u, 680097612u, 3226014103u, 451044771u, 0, SINH_TOLERANCE, 0}, +{ 174, 3225711052u, 1827735934u, 3200554324u, 2875599271u, 3280980440u, 2135776268u, 0, SINH_TOLERANCE, 0}, +{ 175, 3213050498u, 3117037091u, 3239246636u, 15838845u, 3213050517u, 1419941520u, 0, SINH_TOLERANCE, 0}, +{ 176, 1067702644u, 749718883u, 3223587064u, 1523766569u, 1067702970u, 259259635u, 0, SINH_TOLERANCE, 0}, +{ 177, 1066853747u, 1966536294u, 3250158026u, 699164258u, 1066853872u, 2121245996u, 0, SINH_TOLERANCE, 0}, +{ 178, 1079174067u, 3759049394u, 1106085272u, 1183789499u, 1185944512u, 3807740687u, 0, SINH_TOLERANCE, 0}, +{ 179, 1074910167u, 1970107747u, 1095245453u, 2308233883u, 1078299954u, 1401061375u, 0, SINH_TOLERANCE, 0}, +{ 180, 1076367836u, 1491017852u, 1041444355u, 1723375725u, 1089770148u, 2037337769u, 0, SINH_TOLERANCE, 0}, +{ 181, 3219775798u, 1141349287u, 1097465301u, 3403438584u, 3219966827u, 1978333015u, 0, SINH_TOLERANCE, 0}, +{ 182, 3224280452u, 1711085243u, 3250239076u, 1377484108u, 3242260066u, 2040662695u, 0, SINH_TOLERANCE, 0}, +{ 183, 1079510651u, 2880275004u, 1084039594u, 1611394950u, 1216939131u, 2867297031u, 0, SINH_TOLERANCE, 0}, +{ 184, 3224784251u, 2626629370u, 1063771493u, 1499080813u, 3252818758u, 3654476853u, 0, SINH_TOLERANCE, 0}, +{ 185, 1068862751u, 3936262414u, 1103919063u, 3175668759u, 1068864420u, 3355343590u, 0, SINH_TOLERANCE, 0}, +{ 186, 3217418903u, 1270950554u, 3194616071u, 3680565379u, 3217425931u, 2626956574u, 0, SINH_TOLERANCE, 0}, +{ 187, 3217585407u, 1066985223u, 3221613219u, 4089383168u, 3217595177u, 2758529977u, 0, SINH_TOLERANCE, 0}, +{ 188, 3220204567u, 4017329311u, 3208334452u, 1667591498u, 3220403741u, 3773555337u, 0, SINH_TOLERANCE, 0}, +{ 189, 1077678397u, 3154656624u, 1061894279u, 3886344038u, 1114014484u, 1143078455u, 0, SINH_TOLERANCE, 0}, +{ 190, 1068478737u, 977586119u, 3209762784u, 953839852u, 1068480063u, 3125582187u, 0, SINH_TOLERANCE, 0}, +{ 191, 1081896575u, 143071571u, 3206165386u, 913097445u, 1759744561u, 1725664653u, 0, SINH_TOLERANCE, 0}, +{ 192, 3213634128u, 1371169579u, 1057079837u, 2594818628u, 3213634186u, 2168291476u, 0, SINH_TOLERANCE, 0}, +{ 193, 3228724664u, 2259342224u, 3217432469u, 1824221478u, 3665098139u, 1347867273u, 0, SINH_TOLERANCE, 0}, +{ 194, 3227960407u, 1576604497u, 1079368611u, 185078728u, 3494590082u, 3370329867u, 0, SINH_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 3223421390u, 942989703u, 0, SINH_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1072964584u, 1354781505u, 0, SINH_TOLERANCE, 0}, +{ 197, 3225258784u, 1941318385u, 1045807374u, 792193370u, 3263733935u, 3103118402u, 0, SINH_TOLERANCE, 0}, +{ 198, 3225716754u, 1299392207u, 3212131720u, 3205732280u, 3281185351u, 3451158556u, 0, SINH_TOLERANCE, 0}, +{ 199, 1079824436u, 3035093505u, 1052187689u, 3287702190u, 1245928697u, 3659026689u, 0, SINH_TOLERANCE, 0}, +{ 200, 3227801892u, 2160225215u, 1102624859u, 836655570u, 3465336758u, 1753278920u, 0, SINH_TOLERANCE, 0}, +{ 201, 1079946410u, 3360816360u, 3246176356u, 172860634u, 1257254087u, 595783054u, 0, SINH_TOLERANCE, 0}, +{ 202, 1073092940u, 146831910u, 1051558014u, 2340722078u, 1073599372u, 3905963492u, 0, SINH_TOLERANCE, 0}, +{ 203, 3224124895u, 1603798153u, 3207725532u, 1099413093u, 3240408342u, 2401373921u, 0, SINH_TOLERANCE, 0}, +{ 204, 3227804010u, 2429340443u, 3190303581u, 3223770005u, 3465719079u, 1901620640u, 0, SINH_TOLERANCE, 0}, +{ 205, 1073785807u, 955542166u, 3230415151u, 275583938u, 1074767130u, 782981864u, 0, SINH_TOLERANCE, 0}, +{ 206, 1078291818u, 513397822u, 1090646554u, 2089321329u, 1136418636u, 351397573u, 0, SINH_TOLERANCE, 0}, +{ 207, 3214141396u, 2782073372u, 1046063872u, 4023829068u, 3214141478u, 3470574014u, 0, SINH_TOLERANCE, 0}, +{ 208, 1079690454u, 3242223094u, 3194111199u, 4264674108u, 1233536710u, 346227329u, 0, SINH_TOLERANCE, 0}, +{ 209, 3225927909u, 3506346169u, 1047020885u, 1742757458u, 3290905540u, 2781434878u, 0, SINH_TOLERANCE, 0}, +{ 210, 3214684573u, 1265459564u, 3193450280u, 3650514880u, 3214684806u, 3227027441u, 0, SINH_TOLERANCE, 0}, +{ 211, 1075464434u, 1525260440u, 3235452527u, 2612331392u, 1081496066u, 4039055639u, 0, SINH_TOLERANCE, 0}, +{ 212, 3227697400u, 1263613754u, 3219096387u, 635677201u, 3446002556u, 459760033u, 0, SINH_TOLERANCE, 0}, +{ 213, 3217806423u, 4140947288u, 3200792376u, 2013265346u, 3217820826u, 3694261486u, 0, SINH_TOLERANCE, 0}, +{ 214, 3227954296u, 1912759945u, 3237045253u, 1351396825u, 3493449759u, 1464931509u, 0, SINH_TOLERANCE, 0}, +{ 215, 3228282218u, 1001433078u, 3206926643u, 2741676659u, 3553998392u, 3156202362u, 0, SINH_TOLERANCE, 0}, +{ 216, 1075680726u, 1088945233u, 1085095743u, 3986114865u, 1082750958u, 1712535816u, 0, SINH_TOLERANCE, 0}, +{ 217, 3219928361u, 831239754u, 1099828675u, 3071308141u, 3220177067u, 3013293181u, 0, SINH_TOLERANCE, 0}, +{ 218, 3222688769u, 3473592372u, 1102759382u, 1309576357u, 3227556285u, 86503062u, 0, SINH_TOLERANCE, 0}, +{ 219, 3229166610u, 2042340367u, 1091945628u, 2062772374u, 3828389411u, 210474498u, 0, SINH_TOLERANCE, 0}, +{ 220, 3214688631u, 1840632537u, 1096533424u, 807510337u, 3214688866u, 1833588338u, 0, SINH_TOLERANCE, 0}, +{ 221, 3224111690u, 144814872u, 3212698915u, 2282965697u, 3240278280u, 1680573330u, 0, SINH_TOLERANCE, 0}, +{ 222, 1073333582u, 2552499583u, 3229111426u, 1470130815u, 1073953220u, 2448530468u, 0, SINH_TOLERANCE, 0}, +{ 223, 3227364425u, 2858583811u, 1089760910u, 6360994u, 3398621475u, 697276436u, 0, SINH_TOLERANCE, 0}, +{ 224, 3215042145u, 1614537194u, 1075198900u, 4088705365u, 3215042374u, 2084690356u, 0, SINH_TOLERANCE, 0}, +{ 225, 3228918974u, 3545570051u, 1065221325u, 1629217700u, 3736891221u, 229769802u, 0, SINH_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1072957268u, 788993454u, 0, SINH_TOLERANCE, 0}, +{ 227, 3215677054u, 2406734491u, 1042055360u, 89226663u, 3215677905u, 4217154675u, 0, SINH_TOLERANCE, 0}, +{ 228, 3214625449u, 1618759139u, 3194723421u, 3888234802u, 3214625661u, 565975092u, 0, SINH_TOLERANCE, 0}, +{ 229, 1068988736u, 3590035633u, 3212424262u, 2892456615u, 1068990893u, 1943451309u, 0, SINH_TOLERANCE, 0}, +{ 230, 3213011732u, 2431246964u, 3241512456u, 183850734u, 3213011749u, 2185322308u, 0, SINH_TOLERANCE, 0}, +{ 231, 1076918189u, 3088319870u, 3211544311u, 862225364u, 1096486112u, 1720101545u, 0, SINH_TOLERANCE, 0}, +{ 232, 3224808904u, 3495352775u, 1058576726u, 596957268u, 3253359765u, 1924270502u, 0, SINH_TOLERANCE, 0}, +{ 233, 1066476292u, 1839214511u, 3205004060u, 1923240983u, 1066476344u, 3656567561u, 0, SINH_TOLERANCE, 0}, +{ 234, 1069608200u, 739619702u, 3223356436u, 2689885273u, 1069611435u, 2976591864u, 0, SINH_TOLERANCE, 0}, +{ 235, 3216053611u, 2143376228u, 1098306332u, 3760236188u, 3216054442u, 2867204403u, 0, SINH_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1077135219u, 2370927173u, 0, SINH_TOLERANCE, 0}, +{ 237, 3219408869u, 2493598049u, 3194927008u, 1689107592u, 3219499652u, 2900639705u, 0, SINH_TOLERANCE, 0}, +{ 238, 3213058631u, 1578976988u, 1066368383u, 2117279163u, 3213058650u, 1436428687u, 0, SINH_TOLERANCE, 0}, +{ 239, 3221939535u, 3425290087u, 1098487295u, 1263412017u, 3224162222u, 1577636136u, 0, SINH_TOLERANCE, 0}, +{ 240, 3217869948u, 3635396812u, 1070999426u, 3965655689u, 3217885912u, 1810535642u, 0, SINH_TOLERANCE, 0}, +{ 241, 1069633530u, 2183973116u, 1101098363u, 1118613350u, 1069636992u, 3963026814u, 0, SINH_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 3224186028u, 831736535u, 0, SINH_TOLERANCE, 0}, +{ 243, 3212871842u, 3570940805u, 3230316437u, 3596080877u, 3212871854u, 2583868315u, 0, SINH_TOLERANCE, 0}, +{ 244, 3217646749u, 980880313u, 1079833442u, 884465057u, 3217657686u, 1885631914u, 0, SINH_TOLERANCE, 0}, +{ 245, 1080054180u, 2558179220u, 1052873711u, 1233598120u, 1269060948u, 2524660391u, 0, SINH_TOLERANCE, 0}, +{ 246, 1067038165u, 1909994277u, 1085015978u, 2991527452u, 1067038342u, 2067589378u, 0, SINH_TOLERANCE, 0}, +{ 247, 1070292444u, 1680290941u, 1074309900u, 2943870846u, 1070306139u, 2207543847u, 0, SINH_TOLERANCE, 0}, +{ 248, 1069981892u, 1451927357u, 3228615456u, 1502585517u, 1069989628u, 2151766963u, 0, SINH_TOLERANCE, 0}, +{ 249, 3224677615u, 751136990u, 3230392165u, 3493275472u, 3250350519u, 215829603u, 0, SINH_TOLERANCE, 0}, +{ 250, 1079491599u, 1209623292u, 3238056647u, 979495322u, 1215252451u, 1345426533u, 0, SINH_TOLERANCE, 0}, +{ 251, 3228404200u, 1717672108u, 1048120593u, 531240316u, 3576583348u, 3462906838u, 0, SINH_TOLERANCE, 0}, +{ 252, 1068854987u, 3548721654u, 1086112947u, 3391817224u, 1068856629u, 1346987568u, 0, SINH_TOLERANCE, 0}, +{ 253, 1074691123u, 2758195125u, 1100880260u, 2028440924u, 1077318695u, 1850026137u, 0, SINH_TOLERANCE, 0}, +{ 254, 1076883861u, 2750123373u, 3232200256u, 1086294931u, 1095793270u, 788833141u, 0, SINH_TOLERANCE, 0}, +{ 255, 1065978768u, 2986160931u, 1076097908u, 2540046258u, 1065978812u, 456035946u, 0, SINH_TOLERANCE, 0}, +{ 256, 3224990842u, 451471221u, 1064816262u, 4187644495u, 3257560213u, 655095513u, 0, SINH_TOLERANCE, 0}, +{ 257, 1080585860u, 2439500162u, 1065280276u, 1979490284u, 1367314315u, 4075308906u, 0, SINH_TOLERANCE, 0}, +{ 258, 1065581656u, 2283342035u, 1078398157u, 1345997553u, 1065581675u, 3431319782u, 0, SINH_TOLERANCE, 0}, +{ 259, 3219540804u, 179066662u, 1103272172u, 1217337578u, 3219661899u, 793514991u, 0, SINH_TOLERANCE, 0}, +{ 260, 3218902409u, 3779303391u, 3210023352u, 3115946280u, 3218965105u, 3754433598u, 0, SINH_TOLERANCE, 0}, +{ 261, 3213961394u, 286247089u, 1085153597u, 713645369u, 3213961446u, 2979021742u, 0, SINH_TOLERANCE, 0}, +{ 262, 1077941860u, 1468283899u, 1042831668u, 2022736418u, 1120232171u, 2888650454u, 0, SINH_TOLERANCE, 0}, +{ 263, 1076847649u, 3305564080u, 1065483445u, 482392433u, 1095303241u, 3604886057u, 0, SINH_TOLERANCE, 0}, +{ 264, 3216375871u, 2256346551u, 3222430705u, 2071674991u, 3216377647u, 352947026u, 0, SINH_TOLERANCE, 0}, +{ 265, 3216607607u, 2295269094u, 1084451053u, 2773103941u, 3216610384u, 2228424851u, 0, SINH_TOLERANCE, 0}, +{ 266, 1075028218u, 1482721827u, 1092243422u, 3125409590u, 1079044124u, 678493382u, 0, SINH_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 3221799264u, 4207176249u, 0, SINH_TOLERANCE, 0}, +{ 268, 3226133060u, 1105857967u, 3241990046u, 2703723225u, 3300377169u, 2850491479u, 0, SINH_TOLERANCE, 0}, +{ 269, 1066084243u, 174689677u, 1079333374u, 3947057014u, 1066084295u, 792069421u, 0, SINH_TOLERANCE, 0}, +{ 270, 1077878947u, 2023082423u, 3242081486u, 1169047927u, 1118700325u, 3426525989u, 0, SINH_TOLERANCE, 0}, +{ 271, 1070817355u, 3742487766u, 1043425732u, 194972788u, 1070836843u, 2697250326u, 0, SINH_TOLERANCE, 0}, +{ 272, 3220083283u, 2136071361u, 3211529757u, 993675115u, 3220289585u, 3678611411u, 0, SINH_TOLERANCE, 0}, +{ 273, 3219954837u, 210772141u, 3241441539u, 580731413u, 3220195874u, 2430117404u, 0, SINH_TOLERANCE, 0}, +{ 274, 1078111773u, 1751560711u, 1074522705u, 180987057u, 1128126630u, 2518765659u, 0, SINH_TOLERANCE, 0}, +{ 275, 1071997471u, 2552236599u, 1088658621u, 2112468655u, 1072104117u, 1550733082u, 0, SINH_TOLERANCE, 0}, +{ 276, 3213407865u, 1578223762u, 3224596567u, 2456166162u, 3213407904u, 2884085031u, 0, SINH_TOLERANCE, 0}, +{ 277, 1070041301u, 2110924310u, 1086207177u, 3161208323u, 1070050006u, 1195631688u, 0, SINH_TOLERANCE, 0}, +{ 278, 3223474786u, 2352173188u, 1079361728u, 4070222179u, 3232929497u, 462910145u, 0, SINH_TOLERANCE, 0}, +{ 279, 1080041384u, 2481562701u, 1090937016u, 3809489716u, 1266749058u, 404634930u, 0, SINH_TOLERANCE, 0}, +{ 280, 3215877019u, 330905705u, 1086260896u, 90264431u, 3215878188u, 2685456633u, 0, SINH_TOLERANCE, 0}, +{ 281, 1065895785u, 4162008079u, 3194387916u, 759522153u, 1065895823u, 1027681385u, 0, SINH_TOLERANCE, 0}, +{ 282, 1075772157u, 1839697482u, 3216442625u, 2211508949u, 1083313275u, 2003409679u, 0, SINH_TOLERANCE, 0}, +{ 283, 3227787115u, 3736863454u, 1063475914u, 3150741666u, 3462594462u, 1556023783u, 0, SINH_TOLERANCE, 0}, +{ 284, 1070223067u, 4200269406u, 3236646101u, 1061812176u, 1070235232u, 1741891654u, 0, SINH_TOLERANCE, 0}, +{ 285, 1074975099u, 106027290u, 3234978297u, 2245237549u, 1078697030u, 3526667572u, 0, SINH_TOLERANCE, 0}, +{ 286, 3228109966u, 2132131375u, 3250483427u, 3449276437u, 3522246034u, 2754991195u, 0, SINH_TOLERANCE, 0}, +{ 287, 1077854442u, 2334440944u, 1105423490u, 4004336184u, 1118086726u, 1452344798u, 0, SINH_TOLERANCE, 0}, +{ 288, 3220869856u, 4090088208u, 1042030013u, 3898658299u, 3221506976u, 2943359694u, 0, SINH_TOLERANCE, 0}, +{ 289, 3217345248u, 2272831437u, 3253082595u, 2639188641u, 3217351249u, 937504904u, 0, SINH_TOLERANCE, 0}, +{ 290, 1069446748u, 1856594168u, 3189515294u, 4101853676u, 1069451463u, 207745592u, 0, SINH_TOLERANCE, 0}, +{ 291, 1073915260u, 2211699255u, 3195060344u, 3865018604u, 1075077315u, 1122754602u, 0, SINH_TOLERANCE, 0}, +{ 292, 3227038370u, 996259334u, 3241496889u, 3782673116u, 3368486895u, 1357097126u, 0, SINH_TOLERANCE, 0}, +{ 293, 1080256379u, 3840380763u, 1048674041u, 550040067u, 1306461489u, 928374556u, 0, SINH_TOLERANCE, 0}, +{ 294, 3229399497u, 95874100u, 3237232828u, 2645647822u, 3914393491u, 3490239415u, 0, SINH_TOLERANCE, 0}, +{ 295, 1065685736u, 3441419500u, 3252367038u, 876710419u, 1065685761u, 747186119u, 0, SINH_TOLERANCE, 0}, +{ 296, 3226010640u, 2560836004u, 3199616543u, 1180840586u, 3294765597u, 3335028675u, 0, SINH_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 3223206580u, 596607458u, 0, SINH_TOLERANCE, 0}, +{ 298, 1075345350u, 1447312532u, 1081476588u, 780366847u, 1080842179u, 1919408192u, 0, SINH_TOLERANCE, 0}, +{ 299, 1073618219u, 2842113832u, 3216156731u, 225159029u, 1074374943u, 330409901u, 0, SINH_TOLERANCE, 0}, +{ 300, 1079242825u, 1601981129u, 3234628869u, 2236538344u, 1192276494u, 2364090570u, 0, SINH_TOLERANCE, 0}, +{ 301, 1076784916u, 2194185737u, 3242362684u, 87913366u, 1094646719u, 2239128626u, 0, SINH_TOLERANCE, 0}, +{ 302, 3215861096u, 1346862963u, 1077836259u, 3604666660u, 3215862238u, 131026731u, 0, SINH_TOLERANCE, 0}, +{ 303, 3218547435u, 3115209742u, 1099332326u, 1325101950u, 3218580678u, 1073637587u, 0, SINH_TOLERANCE, 0}, +{ 304, 3221400314u, 3889223100u, 1053247613u, 3371396923u, 3222564618u, 3686805317u, 0, SINH_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 3220882547u, 4294098022u, 0, SINH_TOLERANCE, 0}, +{ 306, 3218064691u, 1532426189u, 1063168268u, 3397022615u, 3218082939u, 3460824787u, 0, SINH_TOLERANCE, 0}, +{ 307, 3216761961u, 89324166u, 1079206060u, 3429424710u, 3216765579u, 3222365633u, 0, SINH_TOLERANCE, 0}, +{ 308, 3214345198u, 747591401u, 1072238381u, 2803213904u, 3214345325u, 733695999u, 0, SINH_TOLERANCE, 0}, +{ 309, 1078530868u, 271904221u, 1044258318u, 1858545114u, 1147431148u, 2228394364u, 0, SINH_TOLERANCE, 0}, +{ 310, 3222826034u, 314958082u, 3249912496u, 2966213175u, 3228304941u, 2781809662u, 0, SINH_TOLERANCE, 0}, +{ 311, 3215005206u, 3119528953u, 3217179014u, 2908718240u, 3215005414u, 2487197027u, 0, SINH_TOLERANCE, 0}, +{ 312, 3226738936u, 2018361566u, 1100926600u, 3985805054u, 3340885170u, 2660715245u, 0, SINH_TOLERANCE, 0}, +{ 313, 1073278308u, 409584884u, 3239758947u, 755795129u, 1073882999u, 2403224777u, 0, SINH_TOLERANCE, 0}, +{ 314, 1074723870u, 1819156379u, 3251342302u, 2982669005u, 1077414156u, 206759069u, 0, SINH_TOLERANCE, 0}, +{ 315, 1080591913u, 2080534280u, 3188254060u, 449171797u, 1368425681u, 3068381489u, 0, SINH_TOLERANCE, 0}, +{ 316, 1079179684u, 168744837u, 3214950009u, 1322217822u, 1186375305u, 280204842u, 0, SINH_TOLERANCE, 0}, +{ 317, 3229061076u, 3250487255u, 1062120700u, 1876195180u, 3789387354u, 3427323764u, 0, SINH_TOLERANCE, 0}, +{ 318, 3223197752u, 1336400247u, 1098057903u, 3314079581u, 3230461251u, 2522157667u, 0, SINH_TOLERANCE, 0}, +{ 319, 3216261732u, 265025555u, 1063854282u, 3779482256u, 3216263118u, 1599530040u, 0, SINH_TOLERANCE, 0}, +{ 320, 1072543381u, 887044257u, 1054789618u, 2732056261u, 1072764380u, 3999798978u, 0, SINH_TOLERANCE, 0}, +{ 321, 1067932534u, 4027115185u, 3191764868u, 2940199511u, 1067933065u, 4060882640u, 0, SINH_TOLERANCE, 0}, +{ 322, 3216131643u, 2875684421u, 3227459837u, 2251967570u, 3216132661u, 231686101u, 0, SINH_TOLERANCE, 0}, +{ 323, 1071633020u, 284173546u, 3238823679u, 3557800647u, 1071682346u, 3259838679u, 0, SINH_TOLERANCE, 0}, +{ 324, 1080487040u, 3147771266u, 3220110464u, 2933364246u, 1348984230u, 3038347863u, 0, SINH_TOLERANCE, 0}, +{ 325, 1071144616u, 3366183281u, 3234870843u, 537442654u, 1071183491u, 3423748941u, 0, SINH_TOLERANCE, 0}, +{ 326, 3227341572u, 2529029548u, 3249882819u, 3781513577u, 3396513810u, 3889526767u, 0, SINH_TOLERANCE, 0}, +{ 327, 3219727810u, 1080845539u, 3206760016u, 911778687u, 3219902760u, 138373121u, 0, SINH_TOLERANCE, 0}, +{ 328, 3213971132u, 469586759u, 1091830022u, 3080528840u, 3213971186u, 495533731u, 0, SINH_TOLERANCE, 0}, +{ 329, 1075006224u, 2863108169u, 3225605506u, 2508274250u, 1078925189u, 2503084824u, 0, SINH_TOLERANCE, 0}, +{ 330, 3218167016u, 4080017377u, 3206492941u, 1470284690u, 3218180951u, 780495425u, 0, SINH_TOLERANCE, 0}, +{ 331, 3217606150u, 3867917386u, 1102054928u, 3504746045u, 3217616306u, 230129894u, 0, SINH_TOLERANCE, 0}, +{ 332, 1070813735u, 2962134101u, 3244741577u, 3390537350u, 1070833056u, 3194305917u, 0, SINH_TOLERANCE, 0}, +{ 333, 1077716053u, 1702237980u, 1071598971u, 1102587474u, 1114898104u, 2058865259u, 0, SINH_TOLERANCE, 0}, +{ 334, 3216601606u, 2180218657u, 3211592260u, 1206527853u, 3216604353u, 3078689379u, 0, SINH_TOLERANCE, 0}, +{ 335, 3215959112u, 394130786u, 3242511482u, 2437699868u, 3215960432u, 1415290187u, 0, SINH_TOLERANCE, 0}, +{ 336, 1066257155u, 849581558u, 3252006507u, 2008614943u, 1066257224u, 282221784u, 0, SINH_TOLERANCE, 0}, +{ 337, 3218528622u, 3128971673u, 3249137531u, 2773583059u, 3218560638u, 88939490u, 0, SINH_TOLERANCE, 0}, +{ 338, 1076641258u, 590727700u, 3248651761u, 2183878539u, 1092924806u, 51929635u, 0, SINH_TOLERANCE, 0}, +{ 339, 1080127109u, 820687580u, 3208143496u, 1402434664u, 1282555424u, 2229435922u, 0, SINH_TOLERANCE, 0}, +{ 340, 3229222163u, 1873709254u, 3245167989u, 44275991u, 3848835562u, 2238140986u, 0, SINH_TOLERANCE, 0}, +{ 341, 3213786001u, 1174874204u, 3208263730u, 2360372288u, 3213786075u, 153092394u, 0, SINH_TOLERANCE, 0}, +{ 342, 1081834580u, 937573440u, 3208953761u, 211240241u, 1736830458u, 1339532059u, 0, SINH_TOLERANCE, 0}, +{ 343, 3226771718u, 2469774991u, 1043117070u, 3380071805u, 3343942432u, 2866315288u, 0, SINH_TOLERANCE, 0}, +{ 344, 1069655378u, 442507560u, 3254252803u, 3257889649u, 1069659044u, 2321832567u, 0, SINH_TOLERANCE, 0}, +{ 345, 1071996248u, 1854921625u, 1049810168u, 2729627545u, 1072102611u, 224823680u, 0, SINH_TOLERANCE, 0}, +{ 346, 3229546805u, 4001809575u, 3240128649u, 278261523u, 3968809266u, 2670070781u, 0, SINH_TOLERANCE, 0}, +{ 347, 1077787510u, 1793907966u, 3238955714u, 398859249u, 1116585698u, 3075914843u, 0, SINH_TOLERANCE, 0}, +{ 348, 3216681187u, 2511916952u, 3219195283u, 1697158299u, 3216684347u, 1388274922u, 0, SINH_TOLERANCE, 0}, +{ 349, 1073131276u, 3230931724u, 3243897690u, 3508781585u, 1073681796u, 922114116u, 0, SINH_TOLERANCE, 0}, +{ 350, 1081827510u, 1674254897u, 1046547577u, 217148561u, 1734293969u, 3735031445u, 0, SINH_TOLERANCE, 0}, +{ 351, 3218603986u, 3275604304u, 3194840159u, 2991205850u, 3218641107u, 2637578362u, 0, SINH_TOLERANCE, 0}, +{ 352, 3214123743u, 3509997278u, 3248888030u, 3897986511u, 3214123822u, 2950940351u, 0, SINH_TOLERANCE, 0}, +{ 353, 1067105379u, 2156824613u, 1042295665u, 1239257646u, 1067105578u, 2500490561u, 0, SINH_TOLERANCE, 0}, +{ 354, 3219555541u, 1073153314u, 3250031627u, 2567234990u, 3219680399u, 691531294u, 0, SINH_TOLERANCE, 0}, +{ 355, 3213662084u, 4261696995u, 3197784432u, 323702024u, 3213662145u, 3701862471u, 0, SINH_TOLERANCE, 0}, +{ 356, 3226913781u, 4075177615u, 3202791065u, 1919006082u, 3356983595u, 316750843u, 0, SINH_TOLERANCE, 0}, +{ 357, 3225638525u, 386429966u, 1086504491u, 3698826164u, 3277573598u, 2126562020u, 0, SINH_TOLERANCE, 0}, +{ 358, 1075181462u, 1681986446u, 3194985869u, 3072950140u, 1079924210u, 784773996u, 0, SINH_TOLERANCE, 0}, +{ 359, 3220457661u, 3719038997u, 1055433962u, 3331415058u, 3220843486u, 2654529157u, 0, SINH_TOLERANCE, 0}, +{ 360, 1070186897u, 2420250111u, 3238002206u, 1928661079u, 1070198311u, 1487723955u, 0, SINH_TOLERANCE, 0}, +{ 361, 1075622754u, 3679866727u, 3227386672u, 1273835792u, 1082419811u, 742653643u, 0, SINH_TOLERANCE, 0}, +{ 362, 1065739986u, 2682092368u, 3234222284u, 1325425811u, 1065740013u, 4224425207u, 0, SINH_TOLERANCE, 0}, +{ 363, 1068895525u, 4175172697u, 3208346191u, 2130706153u, 1068897313u, 3265095977u, 0, SINH_TOLERANCE, 0}, +{ 364, 1078458136u, 1200784450u, 1083605096u, 1248595607u, 1144110494u, 3624009342u, 0, SINH_TOLERANCE, 0}, +{ 365, 3219133743u, 1897285171u, 3251296075u, 944966123u, 3219178679u, 1447338460u, 0, SINH_TOLERANCE, 0}, +{ 366, 3225642610u, 2270747330u, 3230692631u, 422503284u, 3277815552u, 3544140092u, 0, SINH_TOLERANCE, 0}, +{ 367, 1076780005u, 2857564741u, 1075647403u, 3308906709u, 1094572049u, 3220040017u, 0, SINH_TOLERANCE, 0}, +{ 368, 3216058010u, 1380066948u, 3232612906u, 2613634294u, 3216058851u, 1403158136u, 0, SINH_TOLERANCE, 0}, +{ 369, 1071230888u, 4022784584u, 1060483857u, 3264056381u, 1071276446u, 3720296609u, 0, SINH_TOLERANCE, 0}, +{ 370, 1066657500u, 1778509100u, 3213146285u, 2665833973u, 1066657582u, 2265604069u, 0, SINH_TOLERANCE, 0}, +{ 371, 3219873028u, 1859175955u, 1079949560u, 4258450607u, 3220099701u, 3035173045u, 0, SINH_TOLERANCE, 0}, +{ 372, 1067151756u, 4128020197u, 1076266146u, 4122840980u, 1067151972u, 1167410825u, 0, SINH_TOLERANCE, 0}, +{ 373, 3214154683u, 2454653987u, 3229487005u, 2977478685u, 3214154768u, 1150917103u, 0, SINH_TOLERANCE, 0}, +{ 374, 3229439235u, 1355181872u, 1095308770u, 436846481u, 3929070978u, 3622868306u, 0, SINH_TOLERANCE, 0}, +{ 375, 3227730934u, 2592856453u, 3247825559u, 3195234082u, 3452203538u, 3199167818u, 0, SINH_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 3224650387u, 3339361833u, 0, SINH_TOLERANCE, 0}, +{ 377, 1072158561u, 1936670355u, 1095715713u, 2958468553u, 1072307177u, 2128853725u, 0, SINH_TOLERANCE, 0}, +{ 378, 3214311205u, 2960339502u, 1098808013u, 1044068983u, 3214311324u, 1253149122u, 0, SINH_TOLERANCE, 0}, +{ 379, 3215565553u, 4093388677u, 1095478112u, 1735930261u, 3215566256u, 371308307u, 0, SINH_TOLERANCE, 0}, +{ 380, 1078457390u, 1807398746u, 3195743135u, 4261616162u, 1144084329u, 2733988366u, 0, SINH_TOLERANCE, 0}, +{ 381, 3218731378u, 3250576797u, 1059002384u, 3043079652u, 3218778325u, 1763903275u, 0, SINH_TOLERANCE, 0}, +{ 382, 1072352837u, 666051428u, 3208765404u, 1912684117u, 1072565620u, 198637196u, 0, SINH_TOLERANCE, 0}, +{ 383, 1081467324u, 1949030179u, 1096388934u, 896459246u, 1601250663u, 4124280137u, 0, SINH_TOLERANCE, 0}, +{ 384, 1068980717u, 622499767u, 1066707637u, 1490260486u, 1068982840u, 857891073u, 0, SINH_TOLERANCE, 0}, +{ 385, 1081522669u, 1490616165u, 3251242436u, 795675736u, 1621632025u, 1772451300u, 0, SINH_TOLERANCE, 0}, +{ 386, 1075701016u, 3662877092u, 3234317146u, 3200513112u, 1082885282u, 2746304375u, 0, SINH_TOLERANCE, 0}, +{ 387, 1076748754u, 1356101968u, 3236536816u, 3062844611u, 1094157143u, 1389518646u, 0, SINH_TOLERANCE, 0}, +{ 388, 3220971216u, 2284484846u, 3219498359u, 3240896015u, 3221651609u, 3542669521u, 0, SINH_TOLERANCE, 0}, +{ 389, 3225273929u, 494503287u, 1092811254u, 142673998u, 3264153529u, 3833198838u, 0, SINH_TOLERANCE, 0}, +{ 390, 3229057244u, 3394882641u, 3225306538u, 364852125u, 3787923162u, 3261908140u, 0, SINH_TOLERANCE, 0}, +{ 391, 3222116035u, 193885269u, 1088149839u, 1359805831u, 3224645354u, 2483580248u, 0, SINH_TOLERANCE, 0}, +{ 392, 3216213422u, 592580907u, 3199560872u, 3086438952u, 3216214662u, 2295456676u, 0, SINH_TOLERANCE, 0}, +{ 393, 1070004424u, 1778008540u, 1049064687u, 73581647u, 1070012518u, 4215499617u, 0, SINH_TOLERANCE, 0}, +{ 394, 3227859230u, 233240285u, 1081923320u, 2710903921u, 3475955001u, 481819950u, 0, SINH_TOLERANCE, 0}, +{ 395, 1072659495u, 3719878805u, 1079866720u, 3615458228u, 1072851077u, 476577070u, 0, SINH_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 3222021386u, 1060692731u, 0, SINH_TOLERANCE, 0}, +{ 397, 1081381000u, 2232210456u, 3235434773u, 224271737u, 1569318353u, 1467736445u, 0, SINH_TOLERANCE, 0}, +{ 398, 3213975204u, 2134662911u, 3190390590u, 4239009051u, 3213975259u, 373017924u, 0, SINH_TOLERANCE, 0}, +{ 399, 1075283265u, 2305279897u, 1077668039u, 1854523320u, 1080450473u, 3751266535u, 0, SINH_TOLERANCE, 0}, +{ 400, 3220912835u, 538224650u, 3206153057u, 1379649610u, 3221566709u, 621166734u, 0, SINH_TOLERANCE, 0}, +{ 401, 3215284875u, 3683897920u, 3244167599u, 3647579469u, 3215285281u, 2558802378u, 0, SINH_TOLERANCE, 0}, +{ 402, 1077698021u, 2694093608u, 1042775347u, 598406111u, 1114529526u, 2696598259u, 0, SINH_TOLERANCE, 0}, +{ 403, 3218975424u, 872706833u, 1084802480u, 2200602798u, 3219045805u, 4704362u, 0, SINH_TOLERANCE, 0}, +{ 404, 1065408269u, 904146293u, 1060867322u, 1729685598u, 1065408281u, 2779125568u, 0, SINH_TOLERANCE, 0}, +{ 405, 3214569338u, 1894173462u, 3232800651u, 191960416u, 3214569530u, 3800340619u, 0, SINH_TOLERANCE, 0}, +{ 406, 1078642431u, 3521028551u, 1054522089u, 3287274359u, 1152594773u, 3672113002u, 0, SINH_TOLERANCE, 0}, +{ 407, 1079658324u, 959640601u, 3201578263u, 4136915018u, 1230574401u, 2234964481u, 0, SINH_TOLERANCE, 0}, +{ 408, 1071345483u, 1553716379u, 1106027987u, 984725765u, 1071401055u, 4171733850u, 0, SINH_TOLERANCE, 0}, +{ 409, 3226249729u, 2287646644u, 3240329321u, 2276183378u, 3305774759u, 3692605402u, 0, SINH_TOLERANCE, 0}, +{ 410, 1072403478u, 3940225170u, 3199544434u, 997572161u, 1072635674u, 1085220696u, 0, SINH_TOLERANCE, 0}, +{ 411, 3219059817u, 36116288u, 3206886566u, 4196602670u, 3219134081u, 965678204u, 0, SINH_TOLERANCE, 0}, +{ 412, 3225967213u, 3550227562u, 3207257983u, 2747744117u, 3292743212u, 206811308u, 0, SINH_TOLERANCE, 0}, +{ 413, 1081167454u, 507130047u, 1048359321u, 3229888373u, 1490439745u, 2514231187u, 0, SINH_TOLERANCE, 0}, +{ 414, 3221948202u, 2210969014u, 1081031001u, 1946786091u, 3224193769u, 1125681282u, 0, SINH_TOLERANCE, 0}, +{ 415, 3224772654u, 4059150589u, 3189759234u, 1177045799u, 3252570536u, 932381590u, 0, SINH_TOLERANCE, 0}, +{ 416, 1078423548u, 2664812822u, 1050343198u, 2034180320u, 1142469137u, 3731467255u, 0, SINH_TOLERANCE, 0}, +{ 417, 3220070573u, 1175750283u, 3235559706u, 1424491340u, 3220280124u, 1698837364u, 0, SINH_TOLERANCE, 0}, +{ 418, 3219147073u, 1630036121u, 3231972785u, 3195479448u, 3219193750u, 3587877395u, 0, SINH_TOLERANCE, 0}, +{ 419, 1077846963u, 2527029044u, 1046927050u, 4000723255u, 1117940775u, 3673409802u, 0, SINH_TOLERANCE, 0}, +{ 420, 1076820069u, 3335703647u, 3237349676u, 3869440059u, 1094992333u, 786910646u, 0, SINH_TOLERANCE, 0}, +{ 421, 1078850936u, 3888398377u, 3196041693u, 1290567220u, 1162199139u, 1366973945u, 0, SINH_TOLERANCE, 0}, +{ 422, 1071921950u, 3242451480u, 3248384948u, 707431021u, 1072012056u, 1674107560u, 0, SINH_TOLERANCE, 0}, +{ 423, 1075890477u, 2739665123u, 1060777905u, 1733073225u, 1084309432u, 1777081396u, 0, SINH_TOLERANCE, 0}, +{ 424, 1075371333u, 1297274853u, 3208848704u, 3341639139u, 1081035722u, 388538633u, 0, SINH_TOLERANCE, 0}, +{ 425, 1066493885u, 2228057309u, 1084318902u, 1317851136u, 1066493940u, 1908483498u, 0, SINH_TOLERANCE, 0}, +{ 426, 1077769567u, 270039934u, 3241414679u, 3063626339u, 1116118793u, 251426608u, 0, SINH_TOLERANCE, 0}, +{ 427, 3220226926u, 83062251u, 3211262173u, 2659016437u, 3220439240u, 1342941858u, 0, SINH_TOLERANCE, 0}, +{ 428, 1080015246u, 3833539373u, 3206667189u, 1567476111u, 1263591609u, 3066665016u, 0, SINH_TOLERANCE, 0}, +{ 429, 3217777984u, 2382776852u, 3249232579u, 1546622468u, 3217791723u, 580292390u, 0, SINH_TOLERANCE, 0}, +{ 430, 1076099255u, 1714300821u, 1104130938u, 4167591598u, 1086665941u, 3383929735u, 0, SINH_TOLERANCE, 0}, +{ 431, 1067869976u, 2798720100u, 1086978789u, 449990704u, 1067870445u, 757727393u, 0, SINH_TOLERANCE, 0}, +{ 432, 3223858383u, 4039516226u, 3244344107u, 4272932619u, 3237326669u, 3071269738u, 0, SINH_TOLERANCE, 0}, +{ 433, 3221659865u, 1683007544u, 1091105663u, 3805494321u, 3223379092u, 13932268u, 0, SINH_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 3221484094u, 3151331188u, 0, SINH_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 3221069173u, 3891584311u, 0, SINH_TOLERANCE, 0}, +{ 436, 1078985629u, 559918757u, 3205077053u, 908100198u, 1168462131u, 348797896u, 0, SINH_TOLERANCE, 0}, +{ 437, 1065746590u, 2026673913u, 3244833635u, 2844573214u, 1065746618u, 903416048u, 0, SINH_TOLERANCE, 0}, +{ 438, 3229401435u, 3946837259u, 3234993796u, 3850406820u, 3915064173u, 957246048u, 0, SINH_TOLERANCE, 0}, +{ 439, 1070062721u, 3139330994u, 1046133568u, 1539650690u, 1070071794u, 2932344804u, 0, SINH_TOLERANCE, 0}, +{ 440, 3225171164u, 1554593884u, 3228899878u, 2813752562u, 3261718378u, 1205533002u, 0, SINH_TOLERANCE, 0}, +{ 441, 1069087916u, 3804703138u, 1072931071u, 2053677923u, 1069090518u, 1009402951u, 0, SINH_TOLERANCE, 0}, +{ 442, 3227038507u, 289355864u, 1078453818u, 2143066338u, 3368499553u, 3978063874u, 0, SINH_TOLERANCE, 0}, +{ 443, 3216522792u, 2157691971u, 1106629150u, 110806409u, 3216525168u, 881313374u, 0, SINH_TOLERANCE, 0}, +{ 444, 1075865563u, 3570399481u, 1085637605u, 180265334u, 1083999917u, 440877064u, 0, SINH_TOLERANCE, 0}, +{ 445, 3216708822u, 558779875u, 3202046748u, 2338464653u, 3216712134u, 1030194175u, 0, SINH_TOLERANCE, 0}, +{ 446, 1066676984u, 1703969219u, 3229797258u, 1417521063u, 1066677070u, 1053909100u, 0, SINH_TOLERANCE, 0}, +{ 447, 3225199349u, 3917440951u, 1051668894u, 3736066983u, 3262374743u, 1562528722u, 0, SINH_TOLERANCE, 0}, +{ 448, 1071043536u, 3106613409u, 1066627453u, 2735392257u, 1071075459u, 2064952418u, 0, SINH_TOLERANCE, 0}, +{ 449, 1071956828u, 2229777605u, 1065061963u, 2405869925u, 1072054337u, 2105468352u, 0, SINH_TOLERANCE, 0}, +{ 450, 3225831741u, 3967957902u, 1057416138u, 3459188071u, 3286483226u, 515773066u, 0, SINH_TOLERANCE, 0}, +{ 451, 1071784938u, 3699016825u, 3249713090u, 796144848u, 1071849643u, 3676203125u, 0, SINH_TOLERANCE, 0}, +{ 452, 3222524940u, 3285165564u, 3211948811u, 401510871u, 3226584440u, 3149629272u, 0, SINH_TOLERANCE, 0}, +{ 453, 1078529018u, 634857910u, 3199607513u, 914218057u, 1147357727u, 2060143941u, 0, SINH_TOLERANCE, 0}, +{ 454, 1076403304u, 2030735578u, 3233855943u, 965677531u, 1090189121u, 3806338161u, 0, SINH_TOLERANCE, 0}, +{ 455, 1075362511u, 3957229084u, 1051050470u, 3123776651u, 1080967851u, 1261047595u, 0, SINH_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 3223906134u, 1689176085u, 0, SINH_TOLERANCE, 0}, +{ 457, 3224688874u, 869031839u, 3225020876u, 1344301606u, 3250642572u, 668835625u, 0, SINH_TOLERANCE, 0}, +{ 458, 3219676354u, 946696117u, 3231825228u, 1700703647u, 3219835122u, 962995253u, 0, SINH_TOLERANCE, 0}, +{ 459, 1074444299u, 3394168074u, 1076939786u, 1666995668u, 1076637198u, 2672326558u, 0, SINH_TOLERANCE, 0}, +{ 460, 3218211979u, 2488789804u, 3238508333u, 1506943664u, 3218227639u, 2471579197u, 0, SINH_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1073029502u, 3371262161u, 0, SINH_TOLERANCE, 0}, +{ 462, 3220983118u, 1244307192u, 3191297711u, 2540916692u, 3221669470u, 654042193u, 0, SINH_TOLERANCE, 0}, +{ 463, 3215791332u, 2871645739u, 3239081581u, 1440249115u, 3215792357u, 2775105375u, 0, SINH_TOLERANCE, 0}, +{ 464, 1072544937u, 1231934926u, 3236746788u, 603977748u, 1072765519u, 2095752684u, 0, SINH_TOLERANCE, 0}, +{ 465, 3214324057u, 2386312545u, 1063169277u, 2715234268u, 3214324179u, 1232090990u, 0, SINH_TOLERANCE, 0}, +{ 466, 1077317658u, 915867083u, 1046790892u, 3347417612u, 1105687206u, 2072797994u, 0, SINH_TOLERANCE, 0}, +{ 467, 1081866940u, 3553288373u, 1065698616u, 2906680663u, 1748821447u, 2025279999u, 0, SINH_TOLERANCE, 0}, +{ 468, 1066477746u, 2342364630u, 1051356723u, 4019093203u, 1066477799u, 740460663u, 0, SINH_TOLERANCE, 0}, +{ 469, 3216897802u, 2911548084u, 1105282515u, 2476735795u, 3216902290u, 95319602u, 0, SINH_TOLERANCE, 0}, +{ 470, 1068298564u, 1836216409u, 1101062307u, 2519592554u, 1068299574u, 3261440104u, 0, SINH_TOLERANCE, 0}, +{ 471, 1073323889u, 1235369496u, 3222946447u, 668087854u, 1073940658u, 2489380437u, 0, SINH_TOLERANCE, 0}, +{ 472, 3217991780u, 2981820811u, 1059838516u, 2845580478u, 3218011046u, 160524385u, 0, SINH_TOLERANCE, 0}, +{ 473, 3214902934u, 1565550570u, 3217165795u, 4162017137u, 3214903260u, 3266531759u, 0, SINH_TOLERANCE, 0}, +{ 474, 3224668466u, 2808968027u, 1055630096u, 1782326814u, 3250107909u, 4229492206u, 0, SINH_TOLERANCE, 0}, +{ 475, 1069305614u, 1492622658u, 3216653077u, 3972512122u, 1069309397u, 3097712363u, 0, SINH_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 3224793633u, 3681855882u, 0, SINH_TOLERANCE, 0}, +{ 477, 3221052359u, 899763203u, 3207606001u, 2804747833u, 3221777264u, 2598378310u, 0, SINH_TOLERANCE, 0}, +{ 478, 3223330293u, 3789058912u, 3228095081u, 4135937628u, 3231232306u, 256130235u, 0, SINH_TOLERANCE, 0}, +{ 479, 1069636566u, 1682808307u, 3206960335u, 232877759u, 1069640056u, 2969359733u, 0, SINH_TOLERANCE, 0}, +{ 480, 3226362846u, 2851963139u, 3246852961u, 2590862592u, 3310994390u, 2280263532u, 0, SINH_TOLERANCE, 0}, +{ 481, 1074908950u, 2422232642u, 3234779662u, 290458310u, 1078293411u, 1136645066u, 0, SINH_TOLERANCE, 0}, +{ 482, 3219059686u, 1082582386u, 1075605675u, 2602133689u, 3219134008u, 214025449u, 0, SINH_TOLERANCE, 0}, +{ 483, 3226187123u, 1789635787u, 1059414278u, 1048286093u, 3302943910u, 3672708776u, 0, SINH_TOLERANCE, 0}, +{ 484, 1079456174u, 231339448u, 1055573265u, 504907415u, 1211943927u, 57355760u, 0, SINH_TOLERANCE, 0}, +{ 485, 1071600069u, 1153251200u, 3204617090u, 1772013857u, 1071663825u, 3349768061u, 0, SINH_TOLERANCE, 0}, +{ 486, 1080676687u, 1082898276u, 3212089272u, 1449080862u, 1384085102u, 3383991944u, 0, SINH_TOLERANCE, 0}, +{ 487, 1076571101u, 3177299045u, 1058862813u, 809400815u, 1092108370u, 1324438680u, 0, SINH_TOLERANCE, 0}, +{ 488, 3223514518u, 1924429710u, 1056464743u, 3349283177u, 3233360873u, 3288266297u, 0, SINH_TOLERANCE, 0}, +{ 489, 3226599023u, 42238036u, 1042379500u, 2113559863u, 3327958428u, 3625179367u, 0, SINH_TOLERANCE, 0}, +{ 490, 1071052699u, 3304403230u, 3217556703u, 58952646u, 1071085215u, 1050226061u, 0, SINH_TOLERANCE, 0}, +{ 491, 3218960986u, 1645486982u, 3224301095u, 3636267471u, 3219029799u, 4045357788u, 0, SINH_TOLERANCE, 0}, +{ 492, 1071150617u, 619402181u, 3235208235u, 557360557u, 1071189934u, 498578636u, 0, SINH_TOLERANCE, 0}, +{ 493, 3225655482u, 110029735u, 1046937383u, 984375729u, 3278328624u, 58252944u, 0, SINH_TOLERANCE, 0}, +{ 494, 3213613986u, 4063688092u, 3203235744u, 1049950343u, 3213614043u, 1063948882u, 0, SINH_TOLERANCE, 0}, +{ 495, 1070739227u, 650996069u, 1054971928u, 3953359826u, 1070755325u, 3588616872u, 0, SINH_TOLERANCE, 0}, +{ 496, 3222861501u, 66926332u, 1090561839u, 1379780888u, 3228568262u, 956132261u, 0, SINH_TOLERANCE, 0}, +{ 497, 3224016123u, 2803378256u, 1086057989u, 498534626u, 3239186357u, 731326335u, 0, SINH_TOLERANCE, 0}, +{ 498, 1076327097u, 2846400785u, 1047142525u, 1375153550u, 1089349462u, 3403878245u, 0, SINH_TOLERANCE, 0}, +{ 499, 1066601297u, 2869128958u, 1070972315u, 4246440273u, 1066601369u, 2650609615u, 0, SINH_TOLERANCE, 0}, +{ 500, 1067561146u, 3112381207u, 1044430965u, 3981604561u, 1067561377u, 1769828869u, 0, SINH_TOLERANCE, 0}, +{ 501, 3223914965u, 243303420u, 1093735824u, 1575581926u, 3238048272u, 2235871958u, 0, SINH_TOLERANCE, 0}, +{ 502, 3225506509u, 3218865041u, 3204803496u, 3840388050u, 3271535308u, 1649385448u, 0, SINH_TOLERANCE, 0}, +{ 503, 1067289799u, 336846959u, 1052664471u, 3798336786u, 1067290067u, 3736114808u, 0, SINH_TOLERANCE, 0}, +{ 504, 1068537148u, 3639240976u, 1081202165u, 1844741676u, 1068537909u, 189262233u, 0, SINH_TOLERANCE, 0}, +{ 505, 3218196249u, 717293069u, 3211534283u, 582401011u, 3218211290u, 141761877u, 0, SINH_TOLERANCE, 0}, +{ 506, 3228893840u, 3766248610u, 3196520332u, 1174437546u, 3727654367u, 1400243038u, 0, SINH_TOLERANCE, 0}, +{ 507, 1076091194u, 756959182u, 3204099341u, 1581804034u, 1086583042u, 1964748553u, 0, SINH_TOLERANCE, 0}, +{ 508, 3217340780u, 3560686300u, 3220980617u, 4277975772u, 3217346722u, 2737152545u, 0, SINH_TOLERANCE, 0}, +{ 509, 3218294684u, 2598148853u, 3217622194u, 3460421008u, 3218313881u, 4271494494u, 0, SINH_TOLERANCE, 0}, +{ 510, 1071963704u, 136600515u, 3209934920u, 3340653128u, 1072062719u, 2822108139u, 0, SINH_TOLERANCE, 0}, +{ 511, 1078994518u, 1045480938u, 3251354609u, 4133432965u, 1169315390u, 1471292306u, 0, SINH_TOLERANCE, 0}, +{ 512, 1077967943u, 1630207738u, 3239996829u, 2393354808u, 1121432564u, 2643918337u, 0, SINH_TOLERANCE, 0}, +{ 513, 3213694690u, 3739770117u, 1059520750u, 3959551225u, 3213694754u, 4181555695u, 0, SINH_TOLERANCE, 0}, +{ 514, 3223390473u, 1498861716u, 1091297147u, 847410798u, 3231943240u, 411045671u, 0, SINH_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1074212001u, 481824735u, 0, SINH_TOLERANCE, 0}, +{ 516, 1069529329u, 2353103845u, 3235718771u, 2978889966u, 1069534654u, 359520824u, 0, SINH_TOLERANCE, 0}, +{ 517, 3229337896u, 1546972125u, 3249076079u, 1987349196u, 3891583721u, 982927834u, 0, SINH_TOLERANCE, 0}, +{ 518, 3225636601u, 2769161072u, 1075207126u, 292616282u, 3277469717u, 2356402899u, 0, SINH_TOLERANCE, 0}, +{ 519, 3215440938u, 36855311u, 1052128202u, 1479039342u, 3215441495u, 856736532u, 0, SINH_TOLERANCE, 0}, +{ 520, 1076417021u, 2027463605u, 1066023013u, 3369686340u, 1090384091u, 1056585399u, 0, SINH_TOLERANCE, 0}, +{ 521, 3215678541u, 3808681655u, 1054161346u, 1821773119u, 3215679395u, 1849884479u, 0, SINH_TOLERANCE, 0}, +{ 522, 1065851752u, 3175490326u, 3226879970u, 845687760u, 1065851787u, 737255u, 0, SINH_TOLERANCE, 0}, +{ 523, 1065371665u, 3124482451u, 3242748377u, 3259417226u, 1065371676u, 4154020522u, 0, SINH_TOLERANCE, 0}, +{ 524, 1067265791u, 2751606436u, 3236210939u, 3923142740u, 1067266050u, 2400005644u, 0, SINH_TOLERANCE, 0}, +{ 525, 1079966097u, 2016872044u, 3228408064u, 4201274408u, 1259005133u, 2351383485u, 0, SINH_TOLERANCE, 0}, +{ 526, 3215077894u, 1019916843u, 3219974785u, 1977881787u, 3215078145u, 1089008109u, 0, SINH_TOLERANCE, 0}, +{ 527, 3215207392u, 2060433318u, 1075872515u, 366073725u, 3215207734u, 2074287516u, 0, SINH_TOLERANCE, 0}, +{ 528, 3213200653u, 1098469906u, 1082900695u, 2349346832u, 3213200679u, 1381441120u, 0, SINH_TOLERANCE, 0}, +{ 529, 3218363315u, 3011196295u, 3252479932u, 2459281672u, 3218385825u, 3189415687u, 0, SINH_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 3222403031u, 2683776955u, 0, SINH_TOLERANCE, 0}, +{ 531, 1080766178u, 914741728u, 3203468059u, 2833809843u, 1400546649u, 1543027566u, 0, SINH_TOLERANCE, 0}, +{ 532, 3225229542u, 1274901962u, 3241535845u, 3759113509u, 3263137459u, 3663915975u, 0, SINH_TOLERANCE, 0}, +{ 533, 3227042074u, 2134927252u, 3253802671u, 3013731444u, 3368869803u, 696872014u, 0, SINH_TOLERANCE, 0}, +{ 534, 1080326973u, 2230655177u, 3254510616u, 1249674366u, 1319431604u, 3545707614u, 0, SINH_TOLERANCE, 0}, +{ 535, 1071359861u, 717357389u, 1083533731u, 3746683362u, 1071416786u, 238298886u, 0, SINH_TOLERANCE, 0}, +{ 536, 3220064570u, 834976849u, 3217357661u, 2465861779u, 3220275670u, 1926182485u, 0, SINH_TOLERANCE, 0}, +{ 537, 1066627637u, 1385714428u, 1053358395u, 3007113740u, 1066627713u, 3968091488u, 0, SINH_TOLERANCE, 0}, +{ 538, 1068353711u, 599268545u, 3201368210u, 2309854744u, 1068354812u, 823534625u, 0, SINH_TOLERANCE, 0}, +{ 539, 1073100182u, 2840234388u, 3232496515u, 333365983u, 1073614740u, 4021411949u, 0, SINH_TOLERANCE, 0}, +{ 540, 1066894301u, 3136078996u, 3194520860u, 2650572904u, 1066894437u, 776276983u, 0, SINH_TOLERANCE, 0}, +{ 541, 3224250507u, 2405805086u, 3251640319u, 324233833u, 3241869048u, 243646553u, 0, SINH_TOLERANCE, 0}, +{ 542, 1081533322u, 2589598340u, 3254677807u, 952438812u, 1625576728u, 2555502454u, 0, SINH_TOLERANCE, 0}, +{ 543, 3213232021u, 1922837702u, 3216892718u, 3535907549u, 3213232049u, 1242063580u, 0, SINH_TOLERANCE, 0}, +{ 544, 3226838652u, 261447440u, 3209805849u, 1150571079u, 3350113911u, 3739940447u, 0, SINH_TOLERANCE, 0}, +{ 545, 1079028016u, 4026487528u, 1073152064u, 27340691u, 1172419967u, 273403284u, 0, SINH_TOLERANCE, 0}, +{ 546, 3222832236u, 338765118u, 1086225786u, 3207238249u, 3228348911u, 2664550019u, 0, SINH_TOLERANCE, 0}, +{ 547, 3215057071u, 1085283176u, 3187775111u, 1601194210u, 3215057309u, 1488617841u, 0, SINH_TOLERANCE, 0}, +{ 548, 1078937261u, 3031712790u, 3252307859u, 170666844u, 1166209488u, 3602398320u, 0, SINH_TOLERANCE, 0}, +{ 549, 3220959383u, 3148395674u, 1041913758u, 3306391490u, 3221634041u, 1410967140u, 0, SINH_TOLERANCE, 0}, +{ 550, 3217005710u, 2205233857u, 3208100078u, 3993195511u, 3217010979u, 1632365894u, 0, SINH_TOLERANCE, 0}, +{ 551, 1071893912u, 4282766727u, 1072820377u, 1874778218u, 1071978351u, 3057491263u, 0, SINH_TOLERANCE, 0}, +{ 552, 3218173124u, 2920860798u, 3218070226u, 3104066154u, 3218187285u, 1999634368u, 0, SINH_TOLERANCE, 0}, +{ 553, 3217533263u, 969991373u, 3250596895u, 1734386152u, 3217542109u, 2998394098u, 0, SINH_TOLERANCE, 0}, +{ 554, 3226332906u, 1218740205u, 3239802737u, 2610078504u, 3309611601u, 443854413u, 0, SINH_TOLERANCE, 0}, +{ 555, 3217565578u, 1485218325u, 3220870240u, 3591664613u, 3217574990u, 719188738u, 0, SINH_TOLERANCE, 0}, +{ 556, 3216754207u, 690157417u, 3190850619u, 4192347699u, 3216757780u, 72992630u, 0, SINH_TOLERANCE, 0}, +{ 557, 1079276594u, 4009839784u, 1079670252u, 394167192u, 1195402369u, 2525536651u, 0, SINH_TOLERANCE, 0}, +{ 558, 3225122053u, 961532417u, 1092588071u, 2923790239u, 3260577091u, 609779704u, 0, SINH_TOLERANCE, 0}, +{ 559, 3216462003u, 4174125604u, 1050682630u, 2169701868u, 3216464117u, 911139952u, 0, SINH_TOLERANCE, 0}, +{ 560, 3227363835u, 4146748230u, 1087373950u, 2481478351u, 3398577806u, 2672248790u, 0, SINH_TOLERANCE, 0}, +{ 561, 1073842138u, 3984715440u, 1050421618u, 2446142566u, 1074899895u, 3654171950u, 0, SINH_TOLERANCE, 0}, +{ 562, 1076832374u, 936290150u, 1100614426u, 3625806370u, 1095122996u, 79506021u, 0, SINH_TOLERANCE, 0}, +{ 563, 1080913584u, 1866615265u, 3215651428u, 2337013350u, 1427761572u, 2464900529u, 0, SINH_TOLERANCE, 0}, +{ 564, 3229081054u, 712227971u, 1106004723u, 973148499u, 3796776794u, 2977854696u, 0, SINH_TOLERANCE, 0}, +{ 565, 3223796743u, 3409813738u, 3244817008u, 1933503498u, 3236632891u, 2551711858u, 0, SINH_TOLERANCE, 0}, +{ 566, 1075749429u, 3180389060u, 3228735703u, 83422217u, 1083215043u, 2681278570u, 0, SINH_TOLERANCE, 0}, +{ 567, 1074732996u, 556972671u, 3204582372u, 841555801u, 1077441837u, 873264869u, 0, SINH_TOLERANCE, 0}, +{ 568, 1072864873u, 4189151332u, 1080874032u, 706326922u, 1073159519u, 2839586932u, 0, SINH_TOLERANCE, 0}, +{ 569, 1079374091u, 198291836u, 1057281892u, 2188836928u, 1204328207u, 2535783908u, 0, SINH_TOLERANCE, 0}, +{ 570, 1074946267u, 1219449298u, 3228734687u, 3504562743u, 1078508537u, 2353084821u, 0, SINH_TOLERANCE, 0}, +{ 571, 3217153376u, 1776099219u, 1094316777u, 4188083896u, 3217157181u, 574357456u, 0, SINH_TOLERANCE, 0}, +{ 572, 3214817228u, 2614400266u, 1073750227u, 3003203347u, 3214817516u, 198273910u, 0, SINH_TOLERANCE, 0}, +{ 573, 3219225558u, 2959351406u, 1105603716u, 311851587u, 3219283423u, 684340727u, 0, SINH_TOLERANCE, 0}, +{ 574, 1076155826u, 865443613u, 1097532516u, 3622237781u, 1087394673u, 3539650218u, 0, SINH_TOLERANCE, 0}, +{ 575, 3223398058u, 447506102u, 3195759295u, 3603669725u, 3232019529u, 3527208045u, 0, SINH_TOLERANCE, 0}, +{ 576, 1079015805u, 3934398273u, 1040996422u, 2968621268u, 1171312413u, 1233059955u, 0, SINH_TOLERANCE, 0}, +{ 577, 3215614193u, 784208771u, 1088764788u, 2182296421u, 3215614958u, 361692432u, 0, SINH_TOLERANCE, 0}, +{ 578, 3228409347u, 1527590526u, 3206961556u, 2823164069u, 3577507096u, 2977499390u, 0, SINH_TOLERANCE, 0}, +{ 579, 3225109795u, 3876699591u, 3207481130u, 4028148535u, 3260303666u, 4290703953u, 0, SINH_TOLERANCE, 0}, +{ 580, 1076236154u, 2164249756u, 1059857743u, 1785169952u, 1088299515u, 3026474899u, 0, SINH_TOLERANCE, 0}, +{ 581, 1078172521u, 2079273665u, 1080303860u, 625760474u, 1130877384u, 2820657748u, 0, SINH_TOLERANCE, 0}, +{ 582, 3222291804u, 3636214836u, 1068367620u, 2932621925u, 3225236520u, 1533383205u, 0, SINH_TOLERANCE, 0}, +{ 583, 1066015468u, 4274131512u, 1047707755u, 92550763u, 1066015515u, 1391929877u, 0, SINH_TOLERANCE, 0}, +{ 584, 3215599337u, 2648933384u, 1084603503u, 3534304873u, 3215600082u, 4152085298u, 0, SINH_TOLERANCE, 0}, +{ 585, 1070854691u, 3216750767u, 3191088629u, 547482628u, 1070875955u, 1283090909u, 0, SINH_TOLERANCE, 0}, +{ 586, 1070521958u, 1420360746u, 1080063101u, 1690029499u, 1070541624u, 3873766986u, 0, SINH_TOLERANCE, 0}, +{ 587, 3223563908u, 1908572179u, 1080112083u, 1228319033u, 3233962096u, 1729178347u, 0, SINH_TOLERANCE, 0}, +{ 588, 1067032546u, 500312015u, 3212368508u, 3864619086u, 1067032721u, 1665527175u, 0, SINH_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 3222405997u, 1265770476u, 0, SINH_TOLERANCE, 0}, +{ 590, 1080518026u, 2382118000u, 1042665328u, 567154882u, 1354785044u, 2043686521u, 0, SINH_TOLERANCE, 0}, +{ 591, 1069547778u, 1435344339u, 3216303171u, 2275988178u, 1069550513u, 671516801u, 0, SINH_TOLERANCE, 0}, +{ 592, 3219781499u, 3403659753u, 3218043030u, 1926480488u, 3219974504u, 1809148616u, 0, SINH_TOLERANCE, 0}, +{ 593, 1074743231u, 1198845185u, 3225556149u, 1130089684u, 1077473461u, 3574277356u, 0, SINH_TOLERANCE, 0}, +{ 594, 3221614466u, 2183928090u, 1048403956u, 963834821u, 3223250893u, 2703382364u, 0, SINH_TOLERANCE, 0}, +{ 595, 1080701440u, 2120625396u, 1041006976u, 2137548527u, 1388588575u, 2814596158u, 0, SINH_TOLERANCE, 0}, +{ 596, 1080355870u, 586700956u, 1059670521u, 303891699u, 1324761751u, 2561465523u, 0, SINH_TOLERANCE, 0}, +{ 597, 3221091650u, 2509132460u, 1102827530u, 2205707903u, 3221841506u, 3160409354u, 0, SINH_TOLERANCE, 0}, +{ 598, 3217443509u, 1229308263u, 3209170414u, 4206576047u, 3217450905u, 1778802890u, 0, SINH_TOLERANCE, 0}, +{ 599, 3221979137u, 4078010749u, 3199236456u, 733478972u, 3224310714u, 594776133u, 0, SINH_TOLERANCE, 0}, +{ 600, 3215538376u, 4277541051u, 3199806921u, 397102023u, 3215539045u, 2587253356u, 0, SINH_TOLERANCE, 0}, +{ 601, 3214849381u, 900999594u, 3234720188u, 2530214248u, 3214849682u, 3764275050u, 0, SINH_TOLERANCE, 0}, +{ 602, 1074446396u, 4000609478u, 1096577064u, 4148592328u, 1076644619u, 662306058u, 0, SINH_TOLERANCE, 0}, +{ 603, 1067542452u, 2154187873u, 3224392607u, 3957250362u, 1067542672u, 894406159u, 0, SINH_TOLERANCE, 0}, +{ 604, 3221316336u, 2867079200u, 1101870326u, 921212001u, 3222362328u, 2288191835u, 0, SINH_TOLERANCE, 0}, +{ 605, 3223784706u, 674547716u, 1063216239u, 3929755226u, 3236477055u, 3177865417u, 0, SINH_TOLERANCE, 0}, +{ 606, 3225735787u, 3158182449u, 1043794244u, 3259056345u, 3282102257u, 4149902865u, 0, SINH_TOLERANCE, 0}, +{ 607, 3225242320u, 3002823940u, 1059511739u, 2832435794u, 3263375391u, 2207198717u, 0, SINH_TOLERANCE, 0}, +{ 608, 3220450550u, 2196511929u, 1049973941u, 3672092877u, 3220829892u, 1152024630u, 0, SINH_TOLERANCE, 0}, +{ 609, 1068263848u, 3655292191u, 1086438127u, 3567072906u, 1068264804u, 3057389114u, 0, SINH_TOLERANCE, 0}, +{ 610, 3227458308u, 1617573614u, 3201863123u, 3090723732u, 3407261058u, 3864691446u, 0, SINH_TOLERANCE, 0}, +{ 611, 3223764196u, 679893506u, 3211547753u, 824081024u, 3236242384u, 855992207u, 0, SINH_TOLERANCE, 0}, +{ 612, 1076947613u, 2285242807u, 1084999409u, 2221731406u, 1097150618u, 2093305415u, 0, SINH_TOLERANCE, 0}, +{ 613, 3217219424u, 1935990727u, 1088822246u, 1058156518u, 3217223910u, 2572208563u, 0, SINH_TOLERANCE, 0}, +{ 614, 1080819070u, 521023584u, 1059186903u, 4245163857u, 1410372185u, 1987577595u, 0, SINH_TOLERANCE, 0}, +{ 615, 1081871044u, 2312887617u, 3191771354u, 1885370807u, 1750314185u, 485435265u, 0, SINH_TOLERANCE, 0}, +{ 616, 3228836567u, 1796441468u, 1100030327u, 2772711004u, 3706449772u, 2025534396u, 0, SINH_TOLERANCE, 0}, +{ 617, 3216859732u, 2095685003u, 1077984448u, 2100773742u, 3216863963u, 3311762035u, 0, SINH_TOLERANCE, 0}, +{ 618, 3213926140u, 2892538035u, 1042396334u, 4162200338u, 3213926188u, 2166615565u, 0, SINH_TOLERANCE, 0}, +{ 619, 3226997111u, 2177698116u, 3227557177u, 150832500u, 3364729748u, 1325856495u, 0, SINH_TOLERANCE, 0}, +{ 620, 3213582312u, 607966734u, 3236250630u, 4164600559u, 3213582365u, 2419158638u, 0, SINH_TOLERANCE, 0}, +{ 621, 3219535540u, 2830122967u, 1046096700u, 3713346883u, 3219655310u, 3928628246u, 0, SINH_TOLERANCE, 0}, +{ 622, 3224615051u, 2314640506u, 3203696416u, 3276228872u, 3248873475u, 2072666780u, 0, SINH_TOLERANCE, 0}, +{ 623, 3219203763u, 469331883u, 3249037349u, 2999233437u, 3219258357u, 957120804u, 0, SINH_TOLERANCE, 0}, +{ 624, 1079556219u, 560886625u, 1091899487u, 748795120u, 1221147643u, 1766795176u, 0, SINH_TOLERANCE, 0}, +{ 625, 1067712650u, 2958421324u, 1092569414u, 3235243477u, 1067712984u, 658901815u, 0, SINH_TOLERANCE, 0}, +{ 626, 3213998017u, 3221475559u, 1043038304u, 915608434u, 3213998075u, 2955854477u, 0, SINH_TOLERANCE, 0}, +{ 627, 1073294682u, 3007808652u, 3216682290u, 2531019474u, 1073903448u, 2701925371u, 0, SINH_TOLERANCE, 0}, +{ 628, 3226300359u, 1767658578u, 3237045269u, 2313128318u, 3308166529u, 3225971130u, 0, SINH_TOLERANCE, 0}, +{ 629, 3219006500u, 1926845182u, 1066835624u, 1783256828u, 3219080335u, 3600574508u, 0, SINH_TOLERANCE, 0}, +{ 630, 1065741453u, 90378038u, 1057168870u, 164358218u, 1065741480u, 1993225493u, 0, SINH_TOLERANCE, 0}, +{ 631, 1081693348u, 1610524680u, 1085283851u, 2903496007u, 1684679818u, 520929572u, 0, SINH_TOLERANCE, 0}, +{ 632, 1075489858u, 4274321404u, 3202913591u, 720121831u, 1081645047u, 258345874u, 0, SINH_TOLERANCE, 0}, +{ 633, 1067982472u, 2034778236u, 1071133763u, 1413236391u, 1067983057u, 725045044u, 0, SINH_TOLERANCE, 0}, +{ 634, 1067840244u, 1489112261u, 1076691395u, 348210906u, 1067840684u, 4200379030u, 0, SINH_TOLERANCE, 0}, +{ 635, 3217229677u, 2797651324u, 3224410527u, 2374818327u, 3217234276u, 1628439001u, 0, SINH_TOLERANCE, 0}, +{ 636, 1077801496u, 1823161666u, 3197810695u, 3119680047u, 1116891443u, 2045262415u, 0, SINH_TOLERANCE, 0}, +{ 637, 1072218792u, 3420950657u, 1087084743u, 2136638961u, 1072385629u, 3558873528u, 0, SINH_TOLERANCE, 0}, +{ 638, 1073047952u, 3554566429u, 1062907717u, 2736702589u, 1073505975u, 2786439684u, 0, SINH_TOLERANCE, 0}, +{ 639, 3227062875u, 2928437580u, 3187765027u, 1393427873u, 3370758541u, 1790477232u, 0, SINH_TOLERANCE, 0}, +{ 640, 3218738745u, 189447067u, 1051643315u, 828663513u, 3218786307u, 4024003158u, 0, SINH_TOLERANCE, 0}, +{ 641, 1068042509u, 2852350928u, 1045683757u, 673354280u, 1068043163u, 2365357114u, 0, SINH_TOLERANCE, 0}, +{ 642, 1065966397u, 3589563265u, 3248741629u, 812657927u, 1065966440u, 1251607880u, 0, SINH_TOLERANCE, 0}, +{ 643, 3213679498u, 1766416701u, 1100392103u, 2185373290u, 3213679560u, 4268196279u, 0, SINH_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 3220518255u, 2651724555u, 0, SINH_TOLERANCE, 0}, +{ 645, 1075440832u, 1187403069u, 1075300235u, 336640304u, 1081370119u, 2501920895u, 0, SINH_TOLERANCE, 0}, +{ 646, 1081906155u, 1718795752u, 3243118752u, 683369237u, 1763270328u, 2150807698u, 0, SINH_TOLERANCE, 0}, +{ 647, 3218132129u, 1863545307u, 1069449477u, 3418627399u, 3218144815u, 3945086706u, 0, SINH_TOLERANCE, 0}, +{ 648, 1072747022u, 3295607249u, 1068878592u, 1633297809u, 1072961595u, 3287424108u, 0, SINH_TOLERANCE, 0}, +{ 649, 1070481463u, 2585980994u, 3236670483u, 1286750688u, 1070499970u, 2251103968u, 0, SINH_TOLERANCE, 0}, +{ 650, 1067128553u, 15816845u, 3233249283u, 2491924775u, 1067128760u, 376681367u, 0, SINH_TOLERANCE, 0}, +{ 651, 1065481693u, 1051983351u, 1049180786u, 1474421917u, 1065481708u, 1428046274u, 0, SINH_TOLERANCE, 0}, +{ 652, 3216978165u, 2003816032u, 1086050104u, 668090487u, 3216983226u, 3651424116u, 0, SINH_TOLERANCE, 0}, +{ 653, 1068284677u, 3671484625u, 1067020039u, 430024694u, 1068285666u, 670139366u, 0, SINH_TOLERANCE, 0}, +{ 654, 1072639990u, 3991830201u, 3207808714u, 1021245839u, 1072836262u, 3211484111u, 0, SINH_TOLERANCE, 0}, +{ 655, 1071534423u, 4255801807u, 3207681716u, 1926756877u, 1071609574u, 1597467505u, 0, SINH_TOLERANCE, 0}, +{ 656, 1067869425u, 4167786896u, 1077097744u, 1775517981u, 1067869893u, 4158169847u, 0, SINH_TOLERANCE, 0}, +{ 657, 1076164794u, 3187518564u, 1082437406u, 944672491u, 1087470446u, 2664315721u, 0, SINH_TOLERANCE, 0}, +{ 658, 1068240650u, 953085192u, 3227310828u, 3459155777u, 1068241570u, 3420350489u, 0, SINH_TOLERANCE, 0}, +{ 659, 1072648234u, 1908555460u, 1073640207u, 260441967u, 1072842511u, 863537546u, 0, SINH_TOLERANCE, 0}, +{ 660, 1072462486u, 250762477u, 1072582645u, 2886742039u, 1072706025u, 3675872813u, 0, SINH_TOLERANCE, 0}, +{ 661, 3228885910u, 786180031u, 3197734769u, 2788918312u, 3724684214u, 2788902326u, 0, SINH_TOLERANCE, 0}, +{ 662, 3225074643u, 2055912467u, 3244244909u, 1394142937u, 3259480725u, 3336869072u, 0, SINH_TOLERANCE, 0}, +{ 663, 1072758713u, 91984146u, 3222252812u, 4126276047u, 1072980445u, 2544810789u, 0, SINH_TOLERANCE, 0}, +{ 664, 1075048683u, 3942715706u, 3239316352u, 410676547u, 1079134101u, 129626234u, 0, SINH_TOLERANCE, 0}, +{ 665, 3215335062u, 86296211u, 1085850694u, 649202596u, 3215335512u, 4279955597u, 0, SINH_TOLERANCE, 0}, +{ 666, 3226492024u, 3069064472u, 3237358008u, 23209276u, 3318045879u, 633460538u, 0, SINH_TOLERANCE, 0}, +{ 667, 1074943832u, 1867297860u, 1072956607u, 2513414118u, 1078493548u, 514140498u, 0, SINH_TOLERANCE, 0}, +{ 668, 3228513251u, 3171788768u, 3235208783u, 162138697u, 3596712783u, 3375110619u, 0, SINH_TOLERANCE, 0}, +{ 669, 1075436999u, 1245110700u, 1081653954u, 2584994077u, 1081350714u, 3674840752u, 0, SINH_TOLERANCE, 0}, +{ 670, 3226635752u, 3347226587u, 1058962932u, 2291943376u, 3331380358u, 168233073u, 0, SINH_TOLERANCE, 0}, +{ 671, 1070433398u, 966940828u, 1060726420u, 2798041096u, 1070450589u, 604350724u, 0, SINH_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1073037960u, 2035275026u, 0, SINH_TOLERANCE, 0}, +{ 673, 3228193553u, 1671039260u, 1086395032u, 3745833360u, 3537656661u, 393415964u, 0, SINH_TOLERANCE, 0}, +{ 674, 1069661709u, 651714217u, 1047070645u, 2130549237u, 1069665436u, 754279826u, 0, SINH_TOLERANCE, 0}, +{ 675, 3217601491u, 1423000172u, 3247822717u, 1551488170u, 3217611559u, 824321398u, 0, SINH_TOLERANCE, 0}, +{ 676, 3216277371u, 921077236u, 3213332351u, 1431049019u, 3216278807u, 442955679u, 0, SINH_TOLERANCE, 0}, +{ 677, 1071704599u, 655715547u, 3190985373u, 1527556471u, 1071756942u, 3766934534u, 0, SINH_TOLERANCE, 0}, +{ 678, 3222412099u, 4110878657u, 3251297180u, 879739345u, 3225885660u, 2841565138u, 0, SINH_TOLERANCE, 0}, +{ 679, 1076367578u, 2623955764u, 1093699897u, 1216444475u, 1089767499u, 3859308779u, 0, SINH_TOLERANCE, 0}, +{ 680, 1078274115u, 107442539u, 3239767031u, 1149813329u, 1135642519u, 2525054892u, 0, SINH_TOLERANCE, 0}, +{ 681, 3224008056u, 1761361082u, 3226030205u, 1121849716u, 3239115701u, 723616866u, 0, SINH_TOLERANCE, 0}, +{ 682, 3226455627u, 2534144722u, 1044223733u, 3512285706u, 3315291065u, 2831697989u, 0, SINH_TOLERANCE, 0}, +{ 683, 3218137533u, 4073670723u, 1050729852u, 3034818849u, 3218150408u, 2656123370u, 0, SINH_TOLERANCE, 0}, +{ 684, 1081013054u, 1421423503u, 1060278048u, 1397153092u, 1446153340u, 3645912721u, 0, SINH_TOLERANCE, 0}, +{ 685, 3220567557u, 1649206019u, 1104525577u, 1267104290u, 3221063989u, 1927662701u, 0, SINH_TOLERANCE, 0}, +{ 686, 3213419345u, 3775270392u, 1040251850u, 68667319u, 3213419386u, 106585308u, 0, SINH_TOLERANCE, 0}, +{ 687, 3216913812u, 3099226694u, 3254103006u, 4020102648u, 3216918410u, 3288842332u, 0, SINH_TOLERANCE, 0}, +{ 688, 3216271776u, 3718441177u, 3215643451u, 4032951536u, 3216273194u, 3806066275u, 0, SINH_TOLERANCE, 0}, +{ 689, 1066151467u, 508048351u, 3210196713u, 1707937896u, 1066151525u, 1706190291u, 0, SINH_TOLERANCE, 0}, +{ 690, 3215388843u, 2784738160u, 1073435430u, 1109346010u, 3215389346u, 3040303032u, 0, SINH_TOLERANCE, 0}, +{ 691, 3222579562u, 3331916473u, 3238794568u, 2707019594u, 3226854276u, 1245345318u, 0, SINH_TOLERANCE, 0}, +{ 692, 1078502606u, 3093165197u, 1072894805u, 2853215019u, 1146174228u, 2594603642u, 0, SINH_TOLERANCE, 0}, +{ 693, 3219727867u, 2135797997u, 1048399559u, 2941926126u, 3219902835u, 3796355665u, 0, SINH_TOLERANCE, 0}, +{ 694, 1067305348u, 2083412145u, 3249335391u, 507212448u, 1067305623u, 3450869966u, 0, SINH_TOLERANCE, 0}, +{ 695, 1074315175u, 4270176401u, 3246546709u, 3288753319u, 1076232887u, 16147134u, 0, SINH_TOLERANCE, 0}, +{ 696, 3228009919u, 3692175292u, 3197271515u, 3989064196u, 3503712304u, 3358892546u, 0, SINH_TOLERANCE, 0}, +{ 697, 3228623066u, 3111924274u, 1066772558u, 59281695u, 3627570338u, 2342955533u, 0, SINH_TOLERANCE, 0}, +{ 698, 1071878215u, 2135245466u, 3208804313u, 3846547392u, 1071959589u, 3194780737u, 0, SINH_TOLERANCE, 0}, +{ 699, 1079149171u, 972051266u, 3222814246u, 3539700586u, 1183589479u, 2607924773u, 0, SINH_TOLERANCE, 0}, +{ 700, 3216597418u, 330951080u, 1079189813u, 583922384u, 3216600144u, 2711076987u, 0, SINH_TOLERANCE, 0}, +{ 701, 1077057180u, 1711944085u, 1104170032u, 643991456u, 1099706751u, 436337679u, 0, SINH_TOLERANCE, 0}, +{ 702, 3224992365u, 2072550721u, 3250147641u, 4280263530u, 3257600938u, 2591847584u, 0, SINH_TOLERANCE, 0}, +{ 703, 3213944226u, 1566376352u, 1067251433u, 72984588u, 3213944276u, 2654082615u, 0, SINH_TOLERANCE, 0}, +{ 704, 1079547929u, 3103043079u, 1045853123u, 410067497u, 1220439527u, 692790947u, 0, SINH_TOLERANCE, 0}, +{ 705, 3219818221u, 1910366299u, 1081770885u, 634683073u, 3220024287u, 1039537981u, 0, SINH_TOLERANCE, 0}, +{ 706, 1075239232u, 2226525875u, 3224149290u, 2126302825u, 1080223828u, 982079986u, 0, SINH_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1073723582u, 3636560076u, 0, SINH_TOLERANCE, 0}, +{ 708, 1071725823u, 1953339096u, 1077176252u, 1476516558u, 1071781261u, 2888702628u, 0, SINH_TOLERANCE, 0}, +{ 709, 1072383456u, 1306277326u, 1079089150u, 4093716191u, 1072607836u, 2231508708u, 0, SINH_TOLERANCE, 0}, +{ 710, 3223711603u, 51750045u, 3242913901u, 4256866157u, 3235663411u, 3510591457u, 0, SINH_TOLERANCE, 0}, +{ 711, 3213959335u, 2163853087u, 3232053146u, 2962422808u, 3213959387u, 3617570856u, 0, SINH_TOLERANCE, 0}, +{ 712, 1074468369u, 1618388148u, 3233154824u, 3711953164u, 1076724173u, 597166289u, 0, SINH_TOLERANCE, 0}, +{ 713, 3227993634u, 357108214u, 3202294604u, 2306775262u, 3500707170u, 1996029149u, 0, SINH_TOLERANCE, 0}, +{ 714, 3216584150u, 2571356437u, 3249064063u, 2394851808u, 3216586812u, 1757386675u, 0, SINH_TOLERANCE, 0}, +{ 715, 3224196635u, 4273880094u, 1103698617u, 3578832032u, 3241272793u, 485626741u, 0, SINH_TOLERANCE, 0}, +{ 716, 3223989517u, 2091068742u, 3228270226u, 3980489730u, 3238886540u, 675743625u, 0, SINH_TOLERANCE, 0}, +{ 717, 3222725296u, 2772307714u, 1051008486u, 32546576u, 3227718950u, 101416453u, 0, SINH_TOLERANCE, 0}, +{ 718, 3225500575u, 2143788498u, 3195498043u, 3630119231u, 3271191534u, 237087314u, 0, SINH_TOLERANCE, 0}, +{ 719, 3215410151u, 2527385594u, 3240503648u, 3482095012u, 3215410676u, 1476782795u, 0, SINH_TOLERANCE, 0}, +{ 720, 3226440159u, 2690097362u, 1068598730u, 2360266862u, 3314617193u, 2847015826u, 0, SINH_TOLERANCE, 0}, +{ 721, 1070392205u, 2673272949u, 1082639557u, 522449749u, 1070408319u, 3234356539u, 0, SINH_TOLERANCE, 0}, +{ 722, 1081355475u, 3596379400u, 3242016775u, 2002293002u, 1559892600u, 3057535830u, 0, SINH_TOLERANCE, 0}, +{ 723, 1080565288u, 4113224369u, 3222122439u, 2152316893u, 1363443372u, 2667631927u, 0, SINH_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 3221410408u, 2908771441u, 0, SINH_TOLERANCE, 0}, +{ 725, 3228443661u, 2489659568u, 1097051253u, 277506957u, 3583855028u, 1518851146u, 0, SINH_TOLERANCE, 0}, +{ 726, 3213421930u, 3850162281u, 3213841942u, 438724093u, 3213421971u, 1002595616u, 0, SINH_TOLERANCE, 0}, +{ 727, 1079663895u, 2431814052u, 1075518084u, 2672434118u, 1231134099u, 340027527u, 0, SINH_TOLERANCE, 0}, +{ 728, 3227434095u, 391606792u, 1048184750u, 4168944276u, 3405033863u, 1300409563u, 0, SINH_TOLERANCE, 0}, +{ 729, 3227869472u, 457529672u, 3201090276u, 72407935u, 3477794872u, 3560882185u, 0, SINH_TOLERANCE, 0}, +{ 730, 3220817871u, 3954981400u, 1052053242u, 2411049585u, 3221437703u, 2060096171u, 0, SINH_TOLERANCE, 0}, +{ 731, 1076742907u, 485456950u, 1088415093u, 1655397424u, 1094089911u, 1354369709u, 0, SINH_TOLERANCE, 0}, +{ 732, 3215011644u, 1551748070u, 3236871640u, 1329701152u, 3215011855u, 3520772167u, 0, SINH_TOLERANCE, 0}, +{ 733, 3221493394u, 3099222537u, 1104984570u, 4293792842u, 3222829311u, 3862774079u, 0, SINH_TOLERANCE, 0}, +{ 734, 3216532617u, 3603065260u, 3197735968u, 2402359253u, 3216535037u, 3882208129u, 0, SINH_TOLERANCE, 0}, +{ 735, 3215601800u, 3961208159u, 3219057584u, 2340553876u, 3215602549u, 2108585992u, 0, SINH_TOLERANCE, 0}, +{ 736, 1073833333u, 4014841779u, 3197672877u, 3697233334u, 1074880117u, 1269717825u, 0, SINH_TOLERANCE, 0}, +{ 737, 3219567113u, 1403876392u, 3254028950u, 921363393u, 3219694981u, 977790656u, 0, SINH_TOLERANCE, 0}, +{ 738, 1082085982u, 1862576361u, 3194031708u, 2476290925u, 1829767895u, 2702820797u, 0, SINH_TOLERANCE, 0}, +{ 739, 1067487560u, 1454212851u, 1088378861u, 3400401866u, 1067487749u, 3552988746u, 0, SINH_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1076509416u, 3567151563u, 0, SINH_TOLERANCE, 0}, +{ 741, 3219555010u, 1199568671u, 3225679997u, 46947405u, 3219679731u, 1089077561u, 0, SINH_TOLERANCE, 0}, +{ 742, 1074539809u, 2596231448u, 3253943728u, 2219151748u, 1076947313u, 1250142917u, 0, SINH_TOLERANCE, 0}, +{ 743, 1071769915u, 4119719558u, 3222036299u, 1275474618u, 1071832173u, 3278912590u, 0, SINH_TOLERANCE, 0}, +{ 744, 3226277175u, 3347296825u, 1101507910u, 1254014794u, 3307089345u, 2046925534u, 0, SINH_TOLERANCE, 0}, +{ 745, 1076779960u, 673775040u, 1070743626u, 244126093u, 1094571370u, 3392966696u, 0, SINH_TOLERANCE, 0}, +{ 746, 3216831338u, 1832066983u, 1051358028u, 3262483417u, 3216835385u, 906880532u, 0, SINH_TOLERANCE, 0}, +{ 747, 1074413872u, 3962610501u, 3198598777u, 849269178u, 1076532801u, 1295287247u, 0, SINH_TOLERANCE, 0}, +{ 748, 3224988140u, 2497516122u, 3254374111u, 2821429629u, 3257490278u, 4293280082u, 0, SINH_TOLERANCE, 0}, +{ 749, 1074139136u, 2805941787u, 3217785843u, 779131141u, 1075799904u, 2039643898u, 0, SINH_TOLERANCE, 0}, +{ 750, 3222714382u, 723423605u, 1084533420u, 627282213u, 3227667948u, 3426899714u, 0, SINH_TOLERANCE, 0}, +{ 751, 3220141984u, 4292778869u, 1078101071u, 1676860147u, 3220333842u, 115417948u, 0, SINH_TOLERANCE, 0}, +{ 752, 1074191350u, 3528118587u, 3194648564u, 2363260897u, 1075928029u, 976877107u, 0, SINH_TOLERANCE, 0}, +{ 753, 3214917975u, 1307010018u, 1061248120u, 1468743108u, 3214918308u, 3784163317u, 0, SINH_TOLERANCE, 0}, +{ 754, 3227708771u, 107905661u, 3226089788u, 1943427674u, 3448102191u, 73406449u, 0, SINH_TOLERANCE, 0}, +{ 755, 3213396365u, 760006940u, 1054265604u, 1749976597u, 3213396403u, 2790275751u, 0, SINH_TOLERANCE, 0}, +{ 756, 3225190472u, 2787503556u, 1081282610u, 1195841206u, 3262209627u, 1251355153u, 0, SINH_TOLERANCE, 0}, +{ 757, 3213822252u, 545462045u, 3208381743u, 1981311808u, 3213822329u, 4200203663u, 0, SINH_TOLERANCE, 0}, +{ 758, 1070669320u, 3657978397u, 1104463616u, 3501253426u, 1070682743u, 983473248u, 0, SINH_TOLERANCE, 0}, +{ 759, 1067709649u, 1804177501u, 3210693633u, 3606766729u, 1067709980u, 2574179964u, 0, SINH_TOLERANCE, 0}, +{ 760, 1074759727u, 1336278526u, 1043741618u, 3165279431u, 1077525747u, 3006481726u, 0, SINH_TOLERANCE, 0}, +{ 761, 1069103403u, 1599382075u, 1058018527u, 4212580517u, 1069106079u, 1072511966u, 0, SINH_TOLERANCE, 0}, +{ 762, 3217988086u, 3007589929u, 3202026547u, 2792028313u, 3218007245u, 3332316496u, 0, SINH_TOLERANCE, 0}, +{ 763, 3228965522u, 1866066996u, 1060329048u, 3727175322u, 3754078725u, 1771558986u, 0, SINH_TOLERANCE, 0}, +{ 764, 3215193859u, 150890940u, 1056025306u, 3082724735u, 3215194190u, 2754183182u, 0, SINH_TOLERANCE, 0}, +{ 765, 1071446123u, 80400395u, 1093584426u, 3478941315u, 1071511628u, 3523257202u, 0, SINH_TOLERANCE, 0}, +{ 766, 3228571942u, 4050954182u, 3219263194u, 2537475930u, 3608688426u, 405562207u, 0, SINH_TOLERANCE, 0}, +{ 767, 1071133327u, 2881752155u, 3212589299u, 2559651278u, 1071171380u, 1056997979u, 0, SINH_TOLERANCE, 0}, +{ 768, 3228044784u, 440309030u, 3214267461u, 3788040806u, 3510153348u, 3272529857u, 0, SINH_TOLERANCE, 0}, +{ 769, 1080553671u, 918813144u, 3208535698u, 1607035904u, 1361304066u, 4120585298u, 0, SINH_TOLERANCE, 0}, +{ 770, 1066254699u, 2497054124u, 1089139147u, 2549609010u, 1066254768u, 815089803u, 0, SINH_TOLERANCE, 0}, +{ 771, 1066960585u, 790219083u, 1054657139u, 2797979479u, 1066960738u, 3757904356u, 0, SINH_TOLERANCE, 0}, +{ 772, 1070364312u, 1149462078u, 1095765205u, 3879963182u, 1070379723u, 1998424973u, 0, SINH_TOLERANCE, 0}, +{ 773, 3216361301u, 2684353926u, 3205212854u, 1732474928u, 3216363023u, 3802316127u, 0, SINH_TOLERANCE, 0}, +{ 774, 1079508325u, 2742237025u, 1051317716u, 3386396147u, 1216722133u, 1976234612u, 0, SINH_TOLERANCE, 0}, +{ 775, 1071619594u, 3408320912u, 1103071166u, 4233059513u, 1071674792u, 2816507100u, 0, SINH_TOLERANCE, 0}, +{ 776, 1071155004u, 1077495917u, 1088399968u, 433115118u, 1071194646u, 2074456499u, 0, SINH_TOLERANCE, 0}, +{ 777, 3217130484u, 841366493u, 1051716814u, 4121125128u, 3217134069u, 4021865308u, 0, SINH_TOLERANCE, 0}, +{ 778, 1070923540u, 321857207u, 1089128010u, 1149988239u, 1070948356u, 2360289704u, 0, SINH_TOLERANCE, 0}, +{ 779, 3226668295u, 799866606u, 3197637091u, 3924438208u, 3334384164u, 3227583322u, 0, SINH_TOLERANCE, 0}, +{ 780, 3213082986u, 2002049816u, 1077053447u, 2240354761u, 3213083006u, 2340324638u, 0, SINH_TOLERANCE, 0}, +{ 781, 3222714827u, 478939968u, 1097035749u, 1066716440u, 3227669986u, 2910722967u, 0, SINH_TOLERANCE, 0}, +{ 782, 3224085033u, 1653104725u, 1088548129u, 81977716u, 3240005112u, 1441361965u, 0, SINH_TOLERANCE, 0}, +{ 783, 3215735644u, 3899475018u, 3189694084u, 3330093036u, 3215736582u, 2708903464u, 0, SINH_TOLERANCE, 0}, +{ 784, 1077778247u, 2612450289u, 1079065127u, 603380842u, 1116328756u, 409577748u, 0, SINH_TOLERANCE, 0}, +{ 785, 1080713847u, 3962735564u, 1101570429u, 1372490825u, 1390866750u, 1157784041u, 0, SINH_TOLERANCE, 0}, +{ 786, 1069486080u, 1479841439u, 1059312257u, 541504905u, 1069491079u, 1220268850u, 0, SINH_TOLERANCE, 0}, +{ 787, 1075516450u, 2626148789u, 1057571099u, 4121656076u, 1081817123u, 2807947775u, 0, SINH_TOLERANCE, 0}, +{ 788, 1075321933u, 1902560314u, 1043130231u, 3557671562u, 1080683447u, 2923202064u, 0, SINH_TOLERANCE, 0}, +{ 789, 3214801292u, 41779312u, 1081626342u, 831171823u, 3214801572u, 2419721377u, 0, SINH_TOLERANCE, 0}, +{ 790, 1069665436u, 1393168821u, 1066457405u, 1381616968u, 1069669199u, 1403219285u, 0, SINH_TOLERANCE, 0}, +{ 791, 1073386717u, 3756584649u, 3222267229u, 1423157432u, 1074024022u, 3148225902u, 0, SINH_TOLERANCE, 0}, +{ 792, 3229269850u, 1894912556u, 1042426694u, 155024547u, 3866449360u, 945429025u, 0, SINH_TOLERANCE, 0}, +{ 793, 3214327880u, 35164295u, 3203391785u, 1037041084u, 3214328002u, 2922798137u, 0, SINH_TOLERANCE, 0}, +{ 794, 1076388871u, 3957875950u, 3232195211u, 1590756436u, 1090004859u, 3120429035u, 0, SINH_TOLERANCE, 0}, +{ 795, 1071990050u, 1447585080u, 1071279485u, 1107922438u, 1072094986u, 196039264u, 0, SINH_TOLERANCE, 0}, +{ 796, 1067224038u, 981897615u, 1051856116u, 430357614u, 1067224280u, 2390208411u, 0, SINH_TOLERANCE, 0}, +{ 797, 3222281335u, 395145384u, 3219821938u, 50586510u, 3225161542u, 3740943084u, 0, SINH_TOLERANCE, 0}, +{ 798, 1072921640u, 750827797u, 1082862669u, 230466783u, 1073261527u, 1672613981u, 0, SINH_TOLERANCE, 0}, +{ 799, 1077231635u, 1365083575u, 3204848310u, 1700831722u, 1103707567u, 2384443675u, 0, SINH_TOLERANCE, 0}, +{ 800, 3220187542u, 344241827u, 1071538935u, 2715566077u, 3220377099u, 1385546430u, 0, SINH_TOLERANCE, 0}, +{ 801, 3227659912u, 4069301823u, 3193208760u, 2949125229u, 3439117055u, 3577170264u, 0, SINH_TOLERANCE, 0}, +{ 802, 1081211291u, 3585711710u, 1065801594u, 2302229267u, 1506690422u, 4025253862u, 0, SINH_TOLERANCE, 0}, +{ 803, 3214041900u, 709803845u, 1048741487u, 2296910194u, 3214041964u, 3967177357u, 0, SINH_TOLERANCE, 0}, +{ 804, 3214252299u, 744421179u, 1069302001u, 2659232829u, 3214252404u, 515290522u, 0, SINH_TOLERANCE, 0}, +{ 805, 1078155904u, 1799949903u, 3192522886u, 4212149209u, 1130147983u, 2298972399u, 0, SINH_TOLERANCE, 0}, +{ 806, 3217642838u, 145234164u, 3250614064u, 912384201u, 3217653698u, 899910502u, 0, SINH_TOLERANCE, 0}, +{ 807, 3225830600u, 2784620507u, 1102812948u, 3531481022u, 3286438912u, 414543568u, 0, SINH_TOLERANCE, 0}, +{ 808, 3229139567u, 383952592u, 3205659905u, 3633194728u, 3818327251u, 1189342136u, 0, SINH_TOLERANCE, 0}, +{ 809, 3216059164u, 3792395543u, 1070072378u, 3864816376u, 3216060008u, 2074660971u, 0, SINH_TOLERANCE, 0}, +{ 810, 3217899185u, 2115553675u, 1066288499u, 3538377867u, 3217915903u, 3457964625u, 0, SINH_TOLERANCE, 0}, +{ 811, 3229006513u, 1230026762u, 1090719723u, 440819880u, 3769193195u, 2644861228u, 0, SINH_TOLERANCE, 0}, +{ 812, 3214518020u, 2991290482u, 1096886719u, 1097971167u, 3214518196u, 2320636781u, 0, SINH_TOLERANCE, 0}, +{ 813, 1077465688u, 1098035020u, 3230900504u, 1479059095u, 1109134739u, 1050435763u, 0, SINH_TOLERANCE, 0}, +{ 814, 3229036868u, 1719428427u, 3188631907u, 3707377409u, 3780408200u, 1550018828u, 0, SINH_TOLERANCE, 0}, +{ 815, 1068964805u, 3748932896u, 1084908557u, 1325384361u, 1068966863u, 1610285566u, 0, SINH_TOLERANCE, 0}, +{ 816, 1076315468u, 3979168763u, 1057455255u, 2454615952u, 1089181690u, 2956799202u, 0, SINH_TOLERANCE, 0}, +{ 817, 1068835624u, 1449164578u, 1056960316u, 1654931641u, 1068837198u, 3670878842u, 0, SINH_TOLERANCE, 0}, +{ 818, 1073536162u, 2120487381u, 3226298974u, 2364226633u, 1074242104u, 2525198454u, 0, SINH_TOLERANCE, 0}, +{ 819, 1074022852u, 1074268944u, 1065730444u, 280016852u, 1075386792u, 430163762u, 0, SINH_TOLERANCE, 0}, +{ 820, 3216036896u, 3315127889u, 3236295594u, 2900924954u, 3216037691u, 1125117057u, 0, SINH_TOLERANCE, 0}, +{ 821, 3215300259u, 2246037502u, 1049691002u, 1496066550u, 3215300678u, 3392890991u, 0, SINH_TOLERANCE, 0}, +{ 822, 3213978379u, 4191285446u, 3217936236u, 2382392789u, 3213978435u, 102310527u, 0, SINH_TOLERANCE, 0}, +{ 823, 1078153244u, 640099844u, 1042152237u, 2064279383u, 1130001370u, 3369789477u, 0, SINH_TOLERANCE, 0}, +{ 824, 1075719134u, 3468560824u, 1093251038u, 310958750u, 1083014333u, 4134353953u, 0, SINH_TOLERANCE, 0}, +{ 825, 1080011184u, 1413568905u, 1100941106u, 1627289946u, 1263163319u, 2702685927u, 0, SINH_TOLERANCE, 0}, +{ 826, 3213569646u, 3797143370u, 3195497539u, 3843275034u, 3213569699u, 783110865u, 0, SINH_TOLERANCE, 0}, +{ 827, 3229008721u, 2806642640u, 3201943068u, 2515980718u, 3770004903u, 1495856927u, 0, SINH_TOLERANCE, 0}, +{ 828, 1077440132u, 632580632u, 1078673506u, 3259601317u, 1108541069u, 1728707154u, 0, SINH_TOLERANCE, 0}, +{ 829, 3216709215u, 3309678799u, 1049337078u, 3056787074u, 3216712530u, 367130729u, 0, SINH_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 3222835195u, 3103339375u, 0, SINH_TOLERANCE, 0}, +{ 831, 1072262554u, 932124675u, 1093915797u, 662682630u, 1072443551u, 4229086386u, 0, SINH_TOLERANCE, 0}, +{ 832, 3228258571u, 1367996113u, 3251723684u, 2974064663u, 3549650785u, 835372527u, 0, SINH_TOLERANCE, 0}, +{ 833, 1074987851u, 323437999u, 1090499064u, 901457511u, 1078787243u, 3515686768u, 0, SINH_TOLERANCE, 0}, +{ 834, 3225293116u, 4184941840u, 3196770014u, 2458988443u, 3264531175u, 356853259u, 0, SINH_TOLERANCE, 0}, +{ 835, 1077132524u, 2023065054u, 3211994098u, 2734612965u, 1101414558u, 3575590741u, 0, SINH_TOLERANCE, 0}, +{ 836, 1071414726u, 3679267365u, 3237728785u, 1699558211u, 1071477015u, 2039647773u, 0, SINH_TOLERANCE, 0}, +{ 837, 1077593250u, 1826799031u, 1078709629u, 3986905229u, 1112051516u, 1053308024u, 0, SINH_TOLERANCE, 0}, +{ 838, 1068572425u, 351061688u, 3194386466u, 4105857588u, 1068573261u, 3201727870u, 0, SINH_TOLERANCE, 0}, +{ 839, 1068808070u, 1365244058u, 1064457319u, 1452191426u, 1068809552u, 3074969805u, 0, SINH_TOLERANCE, 0}, +{ 840, 1071462417u, 2463030625u, 3215975031u, 3773488326u, 1071529636u, 1483496502u, 0, SINH_TOLERANCE, 0}, +{ 841, 3229256575u, 752664055u, 1065110394u, 1835931663u, 3861558766u, 149401169u, 0, SINH_TOLERANCE, 0}, +{ 842, 1077559328u, 3496172149u, 1089617208u, 109068701u, 1111311801u, 1798297128u, 0, SINH_TOLERANCE, 0}, +{ 843, 3215960879u, 1636966254u, 1086098766u, 2016598298u, 3215962202u, 4285192238u, 0, SINH_TOLERANCE, 0}, +{ 844, 1067708534u, 3551516956u, 1097969102u, 1317953425u, 1067708865u, 687794695u, 0, SINH_TOLERANCE, 0}, +{ 845, 3223540761u, 2977627788u, 1045339018u, 516058480u, 3233726552u, 2028828902u, 0, SINH_TOLERANCE, 0}, +{ 846, 3224825666u, 3901731263u, 3189566462u, 32272932u, 3253797012u, 1335776681u, 0, SINH_TOLERANCE, 0}, +{ 847, 1074136068u, 1956025297u, 3246628529u, 3840733905u, 1075787798u, 854989918u, 0, SINH_TOLERANCE, 0}, +{ 848, 1080943668u, 561057891u, 3198494340u, 4271027193u, 1433394156u, 930486357u, 0, SINH_TOLERANCE, 0}, +{ 849, 3228909825u, 692989850u, 3242630588u, 2492225971u, 3733478938u, 319542345u, 0, SINH_TOLERANCE, 0}, +{ 850, 3218062309u, 3439913962u, 1067477011u, 2973333638u, 3218081712u, 867511843u, 0, SINH_TOLERANCE, 0}, +{ 851, 3219236869u, 877613377u, 1044917899u, 809672798u, 3219296481u, 3651531999u, 0, SINH_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 3224793000u, 3821373822u, 0, SINH_TOLERANCE, 0}, +{ 853, 3227472261u, 2645567288u, 1051258339u, 557182478u, 3408564878u, 3197735669u, 0, SINH_TOLERANCE, 0}, +{ 854, 3216640862u, 186287752u, 1061342054u, 4054003419u, 3216643807u, 4015504910u, 0, SINH_TOLERANCE, 0}, +{ 855, 1079440881u, 3506889716u, 3243866036u, 519056371u, 1210492348u, 931610429u, 0, SINH_TOLERANCE, 0}, +{ 856, 1065722725u, 2171898436u, 3246911982u, 1091500784u, 1065722751u, 3820650239u, 0, SINH_TOLERANCE, 0}, +{ 857, 3226870457u, 368493885u, 3222871893u, 1419055230u, 3353000072u, 2259354588u, 0, SINH_TOLERANCE, 0}, +{ 858, 1078319084u, 2010971245u, 3188804530u, 1518695799u, 1137724679u, 3191526077u, 0, SINH_TOLERANCE, 0}, +{ 859, 3218009421u, 1239207795u, 1040192984u, 2199481342u, 3218029199u, 2350238601u, 0, SINH_TOLERANCE, 0}, +{ 860, 3218318669u, 4264613432u, 3203460972u, 3558930895u, 3218338985u, 317208076u, 0, SINH_TOLERANCE, 0}, +{ 861, 1068125075u, 3772748958u, 3227667376u, 309688336u, 1068125833u, 2330123942u, 0, SINH_TOLERANCE, 0}, +{ 862, 3223403009u, 1077949160u, 1075769893u, 2405271377u, 3232071765u, 350852587u, 0, SINH_TOLERANCE, 0}, +{ 863, 1078203664u, 3751608506u, 3232278094u, 930375071u, 1132383966u, 338172682u, 0, SINH_TOLERANCE, 0}, +{ 864, 3215394369u, 1518334131u, 3205247482u, 791756713u, 3215394877u, 4212233229u, 0, SINH_TOLERANCE, 0}, +{ 865, 1067240397u, 2825203170u, 3245054001u, 1822981827u, 1067240646u, 1712540094u, 0, SINH_TOLERANCE, 0}, +{ 866, 1080093419u, 514474738u, 1089072073u, 3300845441u, 1276320656u, 226623888u, 0, SINH_TOLERANCE, 0}, +{ 867, 3219536978u, 247369460u, 3197320093u, 687450958u, 3219657109u, 624558761u, 0, SINH_TOLERANCE, 0}, +{ 868, 1081092750u, 2722237629u, 1058272368u, 90602316u, 1462892401u, 1953188388u, 0, SINH_TOLERANCE, 0}, +{ 869, 3217535619u, 1845900544u, 3231520830u, 3389751458u, 3217544506u, 1440867092u, 0, SINH_TOLERANCE, 0}, +{ 870, 3227612301u, 737689911u, 3195377751u, 3462616966u, 3430287037u, 893857503u, 0, SINH_TOLERANCE, 0}, +{ 871, 3221441232u, 3620285831u, 1055501023u, 2708056059u, 3222675304u, 2106802669u, 0, SINH_TOLERANCE, 0}, +{ 872, 3220513572u, 4073430285u, 1056206159u, 172017902u, 3220953167u, 1600993442u, 0, SINH_TOLERANCE, 0}, +{ 873, 3219161094u, 2799176222u, 1052706894u, 4083892667u, 3219209652u, 2457225002u, 0, SINH_TOLERANCE, 0}, +{ 874, 3216959621u, 1562351330u, 1069705601u, 1247765260u, 3216964546u, 771831832u, 0, SINH_TOLERANCE, 0}, +{ 875, 3224328691u, 51853475u, 3189080201u, 2783553144u, 3242754625u, 3427601173u, 0, SINH_TOLERANCE, 0}, +{ 876, 3220502929u, 3851781549u, 3241598113u, 514064046u, 3220931898u, 3142654688u, 0, SINH_TOLERANCE, 0}, +{ 877, 1080123021u, 934745487u, 3248182437u, 2798581921u, 1281762996u, 865963855u, 0, SINH_TOLERANCE, 0}, +{ 878, 3219373949u, 2948648757u, 3232177250u, 4278702895u, 3219457676u, 2491307120u, 0, SINH_TOLERANCE, 0}, +{ 879, 1073534300u, 4259101461u, 1061606772u, 84229920u, 1074239204u, 580103907u, 0, SINH_TOLERANCE, 0}, +{ 880, 3215901351u, 3891230598u, 1095924595u, 3049217547u, 3215902564u, 3665629963u, 0, SINH_TOLERANCE, 0}, +{ 881, 1074207325u, 3806018919u, 3243191216u, 280177341u, 1075963455u, 2847923212u, 0, SINH_TOLERANCE, 0}, +{ 882, 1070061714u, 3900344258u, 1063647809u, 4206745890u, 1070070770u, 1401723920u, 0, SINH_TOLERANCE, 0}, +{ 883, 3222464456u, 2126253040u, 3207248026u, 808507485u, 3226220527u, 3700151387u, 0, SINH_TOLERANCE, 0}, +{ 884, 1076653133u, 3465685634u, 3230391053u, 3754958214u, 1093053515u, 3736094795u, 0, SINH_TOLERANCE, 0}, +{ 885, 1080840988u, 461094531u, 1101110393u, 1316091396u, 1414403053u, 3462873770u, 0, SINH_TOLERANCE, 0}, +{ 886, 1071271770u, 4197635149u, 1091873113u, 1240127141u, 1071320748u, 3391833457u, 0, SINH_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1076285526u, 455739145u, 0, SINH_TOLERANCE, 0}, +{ 888, 3219720621u, 3744663425u, 3212482771u, 953662066u, 3219893246u, 213316512u, 0, SINH_TOLERANCE, 0}, +{ 889, 1076782697u, 3564196690u, 3228101916u, 904305212u, 1094612637u, 2831821231u, 0, SINH_TOLERANCE, 0}, +{ 890, 1067207479u, 3566257266u, 3235138829u, 2734275140u, 1067207715u, 3351864665u, 0, SINH_TOLERANCE, 0}, +{ 891, 3227171261u, 606044282u, 3241318094u, 2446416887u, 3380787895u, 534441612u, 0, SINH_TOLERANCE, 0}, +{ 892, 1065744532u, 2336116589u, 3197594053u, 2296925138u, 1065744560u, 703498347u, 0, SINH_TOLERANCE, 0}, +{ 893, 1070101995u, 907670625u, 3240769036u, 1827119006u, 1070111769u, 3977968189u, 0, SINH_TOLERANCE, 0}, +{ 894, 1066487279u, 2818710946u, 3246059905u, 553394170u, 1066487333u, 2719249357u, 0, SINH_TOLERANCE, 0}, +{ 895, 3213621342u, 4099522736u, 3232742168u, 3718083858u, 3213621399u, 4034499170u, 0, SINH_TOLERANCE, 0}, +{ 896, 1078739788u, 1059279404u, 1080245336u, 175941677u, 1157065361u, 1087430260u, 0, SINH_TOLERANCE, 0}, +{ 897, 1082121019u, 1650862428u, 1061816101u, 1723201723u, 1842630885u, 3875297949u, 0, SINH_TOLERANCE, 0}, +{ 898, 3226429902u, 2462163405u, 3218946201u, 3876535372u, 3314085212u, 774021558u, 0, SINH_TOLERANCE, 0}, +{ 899, 1076004278u, 495844137u, 1073721460u, 772777946u, 1085574307u, 2998548290u, 0, SINH_TOLERANCE, 0}, +{ 900, 1068143970u, 458757721u, 3245680321u, 3609892707u, 1068144752u, 4160609393u, 0, SINH_TOLERANCE, 0}, +{ 901, 3214254476u, 2533012202u, 1079980803u, 3592268374u, 3214254582u, 92328355u, 0, SINH_TOLERANCE, 0}, +{ 902, 3216996268u, 4108274117u, 1063045844u, 571992389u, 3217001466u, 334148198u, 0, SINH_TOLERANCE, 0}, +{ 903, 1077984359u, 3541110973u, 1096296754u, 3118427427u, 1122209571u, 2499543662u, 0, SINH_TOLERANCE, 0}, +{ 904, 3213902987u, 1213941007u, 1105433735u, 2172963370u, 3213903032u, 549423227u, 0, SINH_TOLERANCE, 0}, +{ 905, 1079027567u, 272190288u, 1095452370u, 4026581530u, 1172388533u, 1567535437u, 0, SINH_TOLERANCE, 0}, +{ 906, 1079855269u, 2843638672u, 1100510986u, 3190536898u, 1248839882u, 1134925313u, 0, SINH_TOLERANCE, 0}, +{ 907, 1076417062u, 2014317727u, 3247389683u, 2428462015u, 1090384705u, 358670345u, 0, SINH_TOLERANCE, 0}, +{ 908, 1078248077u, 688442200u, 1047852515u, 3035186380u, 1134419607u, 2761855333u, 0, SINH_TOLERANCE, 0}, +{ 909, 1074567060u, 1010095511u, 3221288076u, 405287991u, 1077006544u, 3401859869u, 0, SINH_TOLERANCE, 0}, +{ 910, 3229225943u, 2983070435u, 1089546472u, 2907918480u, 3850300069u, 3410875852u, 0, SINH_TOLERANCE, 0}, +{ 911, 1076696665u, 81928569u, 1056007286u, 2740556321u, 1093638835u, 274382606u, 0, SINH_TOLERANCE, 0}, +{ 912, 1066276691u, 2076689028u, 1081558619u, 3039159031u, 1066276762u, 1887214086u, 0, SINH_TOLERANCE, 0}, +{ 913, 1067230382u, 1376882094u, 3211003208u, 1296286481u, 1067230627u, 524698425u, 0, SINH_TOLERANCE, 0}, +{ 914, 1074871434u, 744133164u, 3200943494u, 955832216u, 1078105892u, 3863653122u, 0, SINH_TOLERANCE, 0}, +{ 915, 3223144598u, 176522478u, 1069999908u, 2891249491u, 3230113321u, 799066876u, 0, SINH_TOLERANCE, 0}, +{ 916, 1065584698u, 3685851715u, 3187829932u, 2363997529u, 1065584718u, 1131714439u, 0, SINH_TOLERANCE, 0}, +{ 917, 1065409879u, 3974431579u, 1052505165u, 2589067816u, 1065409892u, 1788656707u, 0, SINH_TOLERANCE, 0}, +{ 918, 3213516885u, 3819109588u, 1048561488u, 969143351u, 3213516933u, 2906528092u, 0, SINH_TOLERANCE, 0}, +{ 919, 1073687973u, 4246896124u, 1104584799u, 1940097860u, 1074495933u, 3339427809u, 0, SINH_TOLERANCE, 0}, +{ 920, 1066912836u, 2228686199u, 3220231833u, 777624847u, 1066912976u, 3933366482u, 0, SINH_TOLERANCE, 0}, +{ 921, 3224127274u, 4189906558u, 3203004203u, 854242364u, 3240433205u, 959703078u, 0, SINH_TOLERANCE, 0}, +{ 922, 1081890311u, 4089051094u, 3227282692u, 2693170723u, 1757476753u, 2188757040u, 0, SINH_TOLERANCE, 0}, +{ 923, 1066855127u, 1278581412u, 3239296746u, 1774588717u, 1066855252u, 2916172410u, 0, SINH_TOLERANCE, 0}, +{ 924, 3221324110u, 1794845306u, 1104879344u, 4135865182u, 3222379752u, 3960615017u, 0, SINH_TOLERANCE, 0}, +{ 925, 1081283231u, 754938390u, 1061291430u, 2010786993u, 1533223782u, 1531468649u, 0, SINH_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1074314128u, 1858315335u, 0, SINH_TOLERANCE, 0}, +{ 927, 3224109162u, 567588900u, 3195452230u, 1421366017u, 3240254842u, 1959108089u, 0, SINH_TOLERANCE, 0}, +{ 928, 3221944027u, 2708717091u, 1071975971u, 1364590470u, 3224178507u, 3057785531u, 0, SINH_TOLERANCE, 0}, +{ 929, 3229068611u, 3461956134u, 3207820115u, 1605709634u, 3792121353u, 436547866u, 0, SINH_TOLERANCE, 0}, +{ 930, 1071594452u, 1497124553u, 1051715442u, 916736957u, 1071660675u, 979412255u, 0, SINH_TOLERANCE, 0}, +{ 931, 1070002699u, 834914365u, 1064667143u, 2839166298u, 1070010765u, 4019658237u, 0, SINH_TOLERANCE, 0}, +{ 932, 1069862861u, 2139295776u, 1062816721u, 914592523u, 1069868878u, 3762302537u, 0, SINH_TOLERANCE, 0}, +{ 933, 3213754179u, 851569132u, 1058503154u, 1399378677u, 3213754249u, 2109993391u, 0, SINH_TOLERANCE, 0}, +{ 934, 3224100513u, 3897202342u, 3245382590u, 246600375u, 3240177992u, 2855945978u, 0, SINH_TOLERANCE, 0}, +{ 935, 3222314580u, 3620429520u, 1055627557u, 229305u, 3225410341u, 2600224110u, 0, SINH_TOLERANCE, 0}, +{ 936, 1076618801u, 3641997865u, 3206673888u, 93720614u, 1092711110u, 70901104u, 0, SINH_TOLERANCE, 0}, +{ 937, 3222565555u, 32766320u, 1062084905u, 3668443038u, 3226779630u, 843791256u, 0, SINH_TOLERANCE, 0}, +{ 938, 3222250420u, 2039713492u, 3248699388u, 1346210821u, 3225032231u, 3912440241u, 0, SINH_TOLERANCE, 0}, +{ 939, 1078369952u, 1335820726u, 3191756860u, 1808427032u, 1140014824u, 1082588104u, 0, SINH_TOLERANCE, 0}, +{ 940, 1070879947u, 650692001u, 1103515670u, 2253348763u, 1070902471u, 1759700474u, 0, SINH_TOLERANCE, 0}, +{ 941, 3213415283u, 2372623300u, 3210185343u, 3200572848u, 3213415323u, 1713775980u, 0, SINH_TOLERANCE, 0}, +{ 942, 1080873125u, 762317532u, 3194595095u, 3192607437u, 1420280283u, 2571597720u, 0, SINH_TOLERANCE, 0}, +{ 943, 1070651309u, 217775356u, 3232827087u, 2969367386u, 1070664093u, 3271935470u, 0, SINH_TOLERANCE, 0}, +{ 944, 1069755463u, 3621353969u, 1077994795u, 3873976266u, 1069760167u, 3476394269u, 0, SINH_TOLERANCE, 0}, +{ 945, 1078719075u, 268372152u, 3221764390u, 3216978962u, 1156113361u, 77208680u, 0, SINH_TOLERANCE, 0}, +{ 946, 3227563243u, 142942404u, 1075322987u, 1746449109u, 3421259445u, 1613517009u, 0, SINH_TOLERANCE, 0}, +{ 947, 1081986200u, 496534875u, 3254522293u, 2532372502u, 1792868955u, 1796814503u, 0, SINH_TOLERANCE, 0}, +{ 948, 3228205445u, 2999955409u, 3222793392u, 1868977643u, 3539879421u, 861578698u, 0, SINH_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1076243608u, 4084542960u, 0, SINH_TOLERANCE, 0}, +{ 950, 1072413103u, 73646871u, 3231442171u, 3711510104u, 1072649120u, 3359020356u, 0, SINH_TOLERANCE, 0}, +{ 951, 1077900612u, 218135177u, 3198908856u, 3082199105u, 1119150740u, 3713509082u, 0, SINH_TOLERANCE, 0}, +{ 952, 1072262784u, 1061628117u, 3248859043u, 86776158u, 1072443858u, 2376683037u, 0, SINH_TOLERANCE, 0}, +{ 953, 3217921858u, 938869114u, 1087911145u, 2416710759u, 3217939177u, 4171102818u, 0, SINH_TOLERANCE, 0}, +{ 954, 1079848192u, 2970853959u, 3239543429u, 1887505029u, 1248109254u, 3136433410u, 0, SINH_TOLERANCE, 0}, +{ 955, 3225145875u, 1337895935u, 1076463812u, 1172733328u, 3261175537u, 31768603u, 0, SINH_TOLERANCE, 0}, +{ 956, 1068014296u, 1469010822u, 3229583535u, 551399515u, 1068014917u, 303583273u, 0, SINH_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1075718382u, 393946761u, 0, SINH_TOLERANCE, 0}, +{ 958, 3226410140u, 2976596113u, 3192137295u, 3033242648u, 3313190593u, 2523414676u, 0, SINH_TOLERANCE, 0}, +{ 959, 1079824113u, 876810930u, 3197470945u, 2571587447u, 1245903887u, 1889039904u, 0, SINH_TOLERANCE, 0}, +{ 960, 3226042170u, 4007797282u, 3225853845u, 4069319648u, 3296181101u, 4203630871u, 0, SINH_TOLERANCE, 0}, +{ 961, 1067202926u, 3840538373u, 1043189552u, 3668774580u, 1067203161u, 474385453u, 0, SINH_TOLERANCE, 0}, +{ 962, 3220757432u, 200857661u, 3229758439u, 3359367736u, 3221361049u, 705632935u, 0, SINH_TOLERANCE, 0}, +{ 963, 3227826349u, 111868139u, 3227902082u, 2366064003u, 3469858676u, 1662095535u, 0, SINH_TOLERANCE, 0}, +{ 964, 1066215262u, 3510904416u, 3222131653u, 3822770497u, 1066215327u, 1490099292u, 0, SINH_TOLERANCE, 0}, +{ 965, 3226947075u, 789151814u, 1099269239u, 2958956055u, 3360058035u, 2807768454u, 0, SINH_TOLERANCE, 0}, +{ 966, 1076290712u, 722163228u, 1105524559u, 1534462169u, 1088870444u, 2167255734u, 0, SINH_TOLERANCE, 0}, +{ 967, 1066509006u, 2207037106u, 3208952465u, 1231254630u, 1066509063u, 2804126656u, 0, SINH_TOLERANCE, 0}, +{ 968, 3215709852u, 3838689849u, 3198769679u, 1302617170u, 3215710751u, 4042008026u, 0, SINH_TOLERANCE, 0}, +{ 969, 1076501722u, 2527556476u, 3240373426u, 124352692u, 1091342710u, 1779709388u, 0, SINH_TOLERANCE, 0}, +{ 970, 3215269445u, 3502371499u, 1043411944u, 4190072016u, 3215269838u, 1199602531u, 0, SINH_TOLERANCE, 0}, +{ 971, 1070967598u, 1798470077u, 3200116917u, 3421833729u, 1070994885u, 1525253159u, 0, SINH_TOLERANCE, 0}, +{ 972, 3214486476u, 3653237931u, 3204255012u, 3683870669u, 3214486642u, 4211787665u, 0, SINH_TOLERANCE, 0}, +{ 973, 1069317222u, 376530104u, 1073853547u, 565755892u, 1069321076u, 4082953569u, 0, SINH_TOLERANCE, 0}, +{ 974, 3226775211u, 558292492u, 1051772749u, 4267873474u, 3344199543u, 131886187u, 0, SINH_TOLERANCE, 0}, +{ 975, 3221626981u, 509637100u, 3212030069u, 215050379u, 3223300224u, 3430243983u, 0, SINH_TOLERANCE, 0}, +{ 976, 1078425613u, 3571665665u, 3188628584u, 757824767u, 1142574424u, 253046892u, 0, SINH_TOLERANCE, 0}, +{ 977, 3220042217u, 998858159u, 1063077962u, 436029885u, 3220259168u, 840166219u, 0, SINH_TOLERANCE, 0}, +{ 978, 3217481301u, 996300405u, 3193842624u, 80548098u, 3217489286u, 4097607243u, 0, SINH_TOLERANCE, 0}, +{ 979, 3222557384u, 3876129407u, 3215332180u, 2226970413u, 3226737898u, 3835235292u, 0, SINH_TOLERANCE, 0}, +{ 980, 3225026041u, 200013509u, 3224552716u, 414878724u, 3258358576u, 1169612687u, 0, SINH_TOLERANCE, 0}, +{ 981, 3224325637u, 309319541u, 1048979765u, 1261662434u, 3242717634u, 817191663u, 0, SINH_TOLERANCE, 0}, +{ 982, 1077718303u, 4062255924u, 3224274128u, 4289485681u, 1114943885u, 3449799183u, 0, SINH_TOLERANCE, 0}, +{ 983, 3224601748u, 1611969213u, 1053890378u, 3774617276u, 3248610102u, 3591228803u, 0, SINH_TOLERANCE, 0}, +{ 984, 1075169883u, 1752164782u, 3239587974u, 612223386u, 1079838304u, 549802351u, 0, SINH_TOLERANCE, 0}, +{ 985, 1065663030u, 2024044989u, 1074932678u, 3259111307u, 1065663053u, 2841083817u, 0, SINH_TOLERANCE, 0}, +{ 986, 1068936158u, 2564965629u, 1093571065u, 169360454u, 1068938101u, 2166799640u, 0, SINH_TOLERANCE, 0}, +{ 987, 1077016178u, 1860101737u, 3191222372u, 1676437468u, 1098787212u, 2272979214u, 0, SINH_TOLERANCE, 0}, +{ 988, 1070288728u, 588387057u, 3192103292u, 2495288012u, 1070302338u, 754215119u, 0, SINH_TOLERANCE, 0}, +{ 989, 3214127225u, 659070058u, 1073095700u, 1393632068u, 3214127304u, 2856651075u, 0, SINH_TOLERANCE, 0}, +{ 990, 3220828991u, 4276187829u, 3217553330u, 1868253275u, 3221452255u, 1644756000u, 0, SINH_TOLERANCE, 0}, +{ 991, 3222171696u, 2085481575u, 3215994784u, 800910002u, 3224793681u, 798995151u, 0, SINH_TOLERANCE, 0}, +{ 992, 1069517748u, 1950570756u, 3200582211u, 941022151u, 1069522984u, 1964003731u, 0, SINH_TOLERANCE, 0}, +{ 993, 1070113280u, 2075610870u, 3250142022u, 3605152103u, 1070123263u, 1505468039u, 0, SINH_TOLERANCE, 0}, +{ 994, 3216567890u, 3792931748u, 3204857863u, 804393211u, 3216570474u, 3250710556u, 0, SINH_TOLERANCE, 0}, +{ 995, 3229529122u, 3430071177u, 3226288311u, 3652522729u, 3962218246u, 874872258u, 0, SINH_TOLERANCE, 0}, +{ 996, 3215994766u, 236884699u, 3227874605u, 2193269825u, 3215995472u, 3941351343u, 0, SINH_TOLERANCE, 0}, +{ 997, 1071228049u, 2744231849u, 1046186036u, 771053722u, 1071273376u, 870874424u, 0, SINH_TOLERANCE, 0}, +{ 998, 1076656004u, 3000189819u, 1096500901u, 2057239777u, 1093086420u, 3545308331u, 0, SINH_TOLERANCE, 0}, +{ 999, 1078106941u, 205759408u, 3244643377u, 2702292618u, 1127858436u, 16441604u, 0, SINH_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_SINH_H multiple inclusion protection + +// EOF sinh.h diff --git a/packages/language/c/libm/current/tests/vectors/sqrt.c b/packages/language/c/libm/current/tests/vectors/sqrt.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/sqrt.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// sqrt.c +// +// Test of sqrt() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/sqrt.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(sqrt_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &sqrt, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &sqrt_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("sqrt() is stable"); + } // if + else + { + CYG_TEST_FAIL("sqrt() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library sqrt() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "sqrt() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF sqrt.c diff --git a/packages/language/c/libm/current/tests/vectors/sqrt.h b/packages/language/c/libm/current/tests/vectors/sqrt.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/sqrt.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_SQRT_H +#define CYGONCE_LIBM_SQRT_H +//=========================================================================== +// +// sqrt.h +// +// Test vectors for testing of sqrt() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/sqrt.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define SQRT_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t sqrt_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 1075268646u, 2220766981u, 0, SQRT_TOLERANCE, 0}, +{ 2, 1070670006u, 3176730980u, 1051524793u, 2993920299u, 1071680998u, 605508644u, 0, SQRT_TOLERANCE, 0}, +{ 3, 1092176155u, 2725707538u, 3232101343u, 2346810316u, 1082400040u, 4277814180u, 0, SQRT_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 1082542742u, 3537165692u, 0, SQRT_TOLERANCE, 0}, +{ 5, 1073717029u, 2636405208u, 1100049309u, 471635570u, 1073118790u, 844009443u, 0, SQRT_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 1081027515u, 2938668174u, 0, SQRT_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1060305113u, 2662925048u, 0, SQRT_TOLERANCE, 0}, +{ 8, 1066002386u, 2688957927u, 1046089230u, 2709029994u, 1069337278u, 3851609627u, 0, SQRT_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1065690306u, 730258401u, 0, SQRT_TOLERANCE, 0}, +{ 10, 1057436194u, 1605286142u, 1068931671u, 4233776869u, 1065041564u, 1578535776u, 0, SQRT_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1066512486u, 1761707100u, 0, SQRT_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 1088125702u, 2101780457u, 0, SQRT_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 1078995579u, 220377022u, 0, SQRT_TOLERANCE, 0}, +{ 14, 1060076142u, 1372884064u, 1080833116u, 3229926662u, 1066384624u, 3846619588u, 0, SQRT_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 1083256976u, 708451256u, 0, SQRT_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 1087484475u, 593102912u, 0, SQRT_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1071881903u, 84172120u, 0, SQRT_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1072389823u, 1734345339u, 0, SQRT_TOLERANCE, 0}, +{ 19, 1047365461u, 213658772u, 3249401130u, 314151656u, 1060027727u, 2224939906u, 0, SQRT_TOLERANCE, 0}, +{ 20, 1106628640u, 1564829925u, 3197817016u, 497230814u, 1089646215u, 1613419443u, 0, SQRT_TOLERANCE, 0}, +{ 21, 1068778986u, 2075329122u, 3231746400u, 169900577u, 1070727840u, 3915801428u, 0, SQRT_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 1061265525u, 677202126u, 0, SQRT_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1079057616u, 2504053075u, 0, SQRT_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1066601671u, 854490045u, 0, SQRT_TOLERANCE, 0}, +{ 25, 1061381997u, 3348930841u, 1078472138u, 358457347u, 1066986270u, 3521303658u, 0, SQRT_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 1071859305u, 4075190074u, 0, SQRT_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1062705147u, 4224071180u, 0, SQRT_TOLERANCE, 0}, +{ 28, 1105045286u, 2322696981u, 1083791358u, 3020766674u, 1088800804u, 826480684u, 0, SQRT_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1058778595u, 2737745278u, 0, SQRT_TOLERANCE, 0}, +{ 30, 1075022077u, 105589263u, 1056316170u, 261630827u, 1073851886u, 1075861372u, 0, SQRT_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1089875212u, 423796479u, 0, SQRT_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1085585117u, 2293588450u, 0, SQRT_TOLERANCE, 0}, +{ 33, 1086054264u, 237004814u, 3237899261u, 3364008659u, 1079320112u, 1789517462u, 0, SQRT_TOLERANCE, 0}, +{ 34, 1047763904u, 472004928u, 3226869477u, 1186387580u, 1060222569u, 2702852472u, 0, SQRT_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 1063443327u, 3722225526u, 0, SQRT_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 1064800646u, 3120181293u, 0, SQRT_TOLERANCE, 0}, +{ 37, 1041492999u, 3725731239u, 1061652681u, 591292963u, 1057086087u, 683141772u, 0, SQRT_TOLERANCE, 0}, +{ 38, 1077531333u, 1147041027u, 3215417793u, 624695933u, 1075073952u, 330937519u, 0, SQRT_TOLERANCE, 0}, +{ 39, 1058569126u, 705725219u, 3238067573u, 1116238321u, 1065601736u, 1995750373u, 0, SQRT_TOLERANCE, 0}, +{ 40, 1059883440u, 7287411u, 1045917232u, 116067742u, 1066285097u, 1285613460u, 0, SQRT_TOLERANCE, 0}, +{ 41, 1092571574u, 3604989074u, 1066381836u, 545298780u, 1082548907u, 197771367u, 0, SQRT_TOLERANCE, 0}, +{ 42, 1071597288u, 1681476121u, 1060345752u, 3553822398u, 1072062158u, 224173498u, 0, SQRT_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 1087708788u, 540172385u, 0, SQRT_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1080950974u, 2475641644u, 0, SQRT_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 1063702841u, 2511252856u, 0, SQRT_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1080120079u, 977381325u, 0, SQRT_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1084378457u, 2884650978u, 0, SQRT_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 1068694953u, 3041442149u, 0, SQRT_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 1067082542u, 3541455359u, 0, SQRT_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1064927817u, 295874224u, 0, SQRT_TOLERANCE, 0}, +{ 51, 1046938380u, 1839068700u, 1077406406u, 3013052171u, 1059791591u, 1387152159u, 0, SQRT_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1059506510u, 1712928068u, 0, SQRT_TOLERANCE, 0}, +{ 53, 1081988573u, 3058618779u, 1046304788u, 3338676024u, 1077270853u, 3474020327u, 0, SQRT_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 1061911855u, 221864221u, 0, SQRT_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1077519368u, 2537543574u, 0, SQRT_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1077281134u, 3176608248u, 0, SQRT_TOLERANCE, 0}, +{ 57, 1064053268u, 704542600u, 3222902057u, 2762779203u, 1068369247u, 2603835260u, 0, SQRT_TOLERANCE, 0}, +{ 58, 1052196966u, 184131949u, 3249723525u, 1667366082u, 1062422966u, 3939548873u, 0, SQRT_TOLERANCE, 0}, +{ 59, 1076125950u, 3904224140u, 1067056698u, 2942159914u, 1074366822u, 4268449844u, 0, SQRT_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 1086622716u, 623144311u, 0, SQRT_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1089429190u, 3430676340u, 0, SQRT_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1080312100u, 1890582146u, 0, SQRT_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 1070970176u, 3192690979u, 0, SQRT_TOLERANCE, 0}, +{ 64, 1087257949u, 773857656u, 3214251949u, 335833884u, 1079974782u, 3171811944u, 0, SQRT_TOLERANCE, 0}, +{ 65, 1055740962u, 1473865960u, 1103073830u, 4000427507u, 1064215197u, 3638248407u, 0, SQRT_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 1087865409u, 1052873954u, 0, SQRT_TOLERANCE, 0}, +{ 67, 1045032426u, 1732245037u, 1101371955u, 1533536108u, 1058852385u, 2071071226u, 0, SQRT_TOLERANCE, 0}, +{ 68, 1101670347u, 1833841275u, 1099430098u, 4144145552u, 1087172149u, 3494217021u, 0, SQRT_TOLERANCE, 0}, +{ 69, 1096786815u, 935007012u, 3188865420u, 604442938u, 1084653522u, 902055671u, 0, SQRT_TOLERANCE, 0}, +{ 70, 1059419605u, 2211464602u, 1046255144u, 1635910526u, 1066022044u, 3993344749u, 0, SQRT_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 1075201676u, 2374945252u, 0, SQRT_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1077309337u, 3516693447u, 0, SQRT_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 1083476938u, 3036711713u, 0, SQRT_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1058575885u, 1512763431u, 0, SQRT_TOLERANCE, 0}, +{ 75, 1065447634u, 2527221960u, 1099107978u, 2696971136u, 1068998603u, 2457660231u, 0, SQRT_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 1084890087u, 884126678u, 0, SQRT_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 1079471659u, 3033645540u, 0, SQRT_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1073776404u, 3961408917u, 0, SQRT_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 1066960732u, 3665707139u, 0, SQRT_TOLERANCE, 0}, +{ 80, 1053350775u, 2588067350u, 3206610957u, 3551059728u, 1063007251u, 3925789760u, 0, SQRT_TOLERANCE, 0}, +{ 81, 1059495208u, 845263327u, 1073415902u, 1749010288u, 1066067600u, 2493200909u, 0, SQRT_TOLERANCE, 0}, +{ 82, 1058092722u, 3092685191u, 3190678390u, 2872219490u, 1065392258u, 2185338120u, 0, SQRT_TOLERANCE, 0}, +{ 83, 1070831407u, 4107255722u, 3205337291u, 3069068345u, 1071756377u, 3884334901u, 0, SQRT_TOLERANCE, 0}, +{ 84, 1096507209u, 2294867524u, 3216653996u, 2860384670u, 1084550505u, 509668549u, 0, SQRT_TOLERANCE, 0}, +{ 85, 1045842702u, 2265437201u, 3240198679u, 1234948614u, 1059250914u, 1435972158u, 0, SQRT_TOLERANCE, 0}, +{ 86, 1068876281u, 1186945904u, 3251167793u, 1896750851u, 1070770294u, 3836667746u, 0, SQRT_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 1077110633u, 1999998138u, 0, SQRT_TOLERANCE, 0}, +{ 88, 1075992592u, 3006860614u, 3231412671u, 2504194724u, 1074281070u, 2869529129u, 0, SQRT_TOLERANCE, 0}, +{ 89, 1088665612u, 1948717780u, 1048317852u, 3791803982u, 1080630957u, 2010332103u, 0, SQRT_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1068518941u, 1347333963u, 0, SQRT_TOLERANCE, 0}, +{ 91, 1098334178u, 4108948538u, 1104691287u, 640541190u, 1085491584u, 2344550893u, 0, SQRT_TOLERANCE, 0}, +{ 92, 1059773769u, 3259274853u, 1082507103u, 3677038020u, 1066226153u, 4175570532u, 0, SQRT_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 1077912743u, 256642125u, 0, SQRT_TOLERANCE, 0}, +{ 94, 1041211624u, 3011191657u, 1103798670u, 1096124830u, 1056952400u, 3532873116u, 0, SQRT_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 1067877244u, 3178535586u, 0, SQRT_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1078147229u, 1574899206u, 0, SQRT_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 1061892714u, 2811585508u, 0, SQRT_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1075418182u, 1911895511u, 0, SQRT_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1087738367u, 625596649u, 0, SQRT_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1073409469u, 2890683226u, 0, SQRT_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 1077434053u, 2274822844u, 0, SQRT_TOLERANCE, 0}, +{ 102, 1099367744u, 1190259653u, 1069112254u, 3417249840u, 1086006323u, 3203231065u, 0, SQRT_TOLERANCE, 0}, +{ 103, 1046179435u, 3467757357u, 3215075200u, 2168175352u, 1059386161u, 1523058021u, 0, SQRT_TOLERANCE, 0}, +{ 104, 1092159487u, 1508888184u, 1060430241u, 3524949092u, 1082393394u, 2941399898u, 0, SQRT_TOLERANCE, 0}, +{ 105, 1049929235u, 166402802u, 3237198975u, 3572369260u, 1061301541u, 778731146u, 0, SQRT_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1077225557u, 2884892065u, 0, SQRT_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1067539306u, 2067044587u, 0, SQRT_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1077499585u, 3639218844u, 0, SQRT_TOLERANCE, 0}, +{ 109, 1048145373u, 2055773734u, 3239267288u, 291396537u, 1060383682u, 1374687961u, 0, SQRT_TOLERANCE, 0}, +{ 110, 1089484385u, 874125203u, 3210508124u, 4091098764u, 1081088793u, 2796500043u, 0, SQRT_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 1069170801u, 1652665630u, 0, SQRT_TOLERANCE, 0}, +{ 112, 1059055762u, 2243036871u, 3243941101u, 740033495u, 1065785428u, 1948204916u, 0, SQRT_TOLERANCE, 0}, +{ 113, 1061941258u, 1176656356u, 1074261978u, 3588756231u, 1067312736u, 4031115381u, 0, SQRT_TOLERANCE, 0}, +{ 114, 1105333143u, 3037249392u, 1061635587u, 1173102190u, 1088948153u, 982120755u, 0, SQRT_TOLERANCE, 0}, +{ 115, 1089725933u, 2882725208u, 1071440059u, 69225090u, 1081202634u, 4070340257u, 0, SQRT_TOLERANCE, 0}, +{ 116, 1065179826u, 272319256u, 1072073912u, 2493997123u, 1068870653u, 1887245738u, 0, SQRT_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 1065201208u, 89168525u, 0, SQRT_TOLERANCE, 0}, +{ 118, 1089274869u, 1990439193u, 1078073146u, 622849962u, 1080981665u, 1937867013u, 0, SQRT_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 1064855412u, 2031313836u, 0, SQRT_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1067134345u, 2326488769u, 0, SQRT_TOLERANCE, 0}, +{ 121, 1047807349u, 2676398686u, 1105124431u, 3631096636u, 1060242029u, 10248528u, 0, SQRT_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1068833081u, 1643028991u, 0, SQRT_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 1075326357u, 59441897u, 0, SQRT_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1072460411u, 3078552319u, 0, SQRT_TOLERANCE, 0}, +{ 125, 1093747188u, 4140316002u, 1082896196u, 868256971u, 1083219439u, 52190688u, 0, SQRT_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1074020893u, 1269785421u, 0, SQRT_TOLERANCE, 0}, +{ 127, 1072707675u, 2427162817u, 3234748208u, 2715105792u, 1072700437u, 592056396u, 0, SQRT_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1068637699u, 3554438189u, 0, SQRT_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 1059058121u, 4110539679u, 0, SQRT_TOLERANCE, 0}, +{ 130, 1104362211u, 105058217u, 1069733884u, 171786224u, 1088522867u, 1249399999u, 0, SQRT_TOLERANCE, 0}, +{ 131, 1042130860u, 2863482262u, 3204997271u, 877784425u, 1057343573u, 1946563393u, 0, SQRT_TOLERANCE, 0}, +{ 132, 1055145665u, 2801782962u, 3213604117u, 762347195u, 1063875562u, 405405913u, 0, SQRT_TOLERANCE, 0}, +{ 133, 1086003079u, 2317950339u, 3246333414u, 2135700283u, 1079300584u, 2888201937u, 0, SQRT_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 1064570994u, 117017318u, 0, SQRT_TOLERANCE, 0}, +{ 135, 1072665436u, 1918836931u, 1083603224u, 3137821660u, 1072679295u, 3487405472u, 0, SQRT_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1088294172u, 2136321383u, 0, SQRT_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1057397095u, 1449721404u, 0, SQRT_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1077013242u, 2258644922u, 0, SQRT_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1067170024u, 2776254693u, 0, SQRT_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 1073971042u, 3458344803u, 0, SQRT_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1084516007u, 476909761u, 0, SQRT_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 1077050469u, 3028872190u, 0, SQRT_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 1074471318u, 1292113974u, 0, SQRT_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 1086990274u, 2652274740u, 0, SQRT_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1070862792u, 3588846007u, 0, SQRT_TOLERANCE, 0}, +{ 146, 1041146119u, 978126928u, 1101553990u, 4047893399u, 1056919191u, 3630293168u, 0, SQRT_TOLERANCE, 0}, +{ 147, 1074838397u, 4059818629u, 1042678728u, 3640293589u, 1073765554u, 1929737386u, 0, SQRT_TOLERANCE, 0}, +{ 148, 1100980392u, 3383497159u, 1070002807u, 1527313008u, 1086750415u, 3836203873u, 0, SQRT_TOLERANCE, 0}, +{ 149, 1055224031u, 2599946514u, 1104170406u, 2738675352u, 1063924117u, 1721130370u, 0, SQRT_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1088879738u, 236452899u, 0, SQRT_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1074304802u, 316690193u, 0, SQRT_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 1057745168u, 35356657u, 0, SQRT_TOLERANCE, 0}, +{ 153, 1085623441u, 182132862u, 3250520938u, 3924356991u, 1079145947u, 321881452u, 0, SQRT_TOLERANCE, 0}, +{ 154, 1083018236u, 35632886u, 3209806504u, 1453402523u, 1077854139u, 1375333123u, 0, SQRT_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 1078095555u, 1236155334u, 0, SQRT_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1076678713u, 4046845340u, 0, SQRT_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1083792592u, 148959679u, 0, SQRT_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1065521919u, 554321687u, 0, SQRT_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1075825628u, 820343418u, 0, SQRT_TOLERANCE, 0}, +{ 160, 1089975150u, 4215445172u, 3196654963u, 2231888973u, 1081309490u, 3903827118u, 0, SQRT_TOLERANCE, 0}, +{ 161, 1099148583u, 40413554u, 3232578253u, 983832844u, 1085872059u, 3351900855u, 0, SQRT_TOLERANCE, 0}, +{ 162, 1076237886u, 3995725873u, 1050082319u, 777231627u, 1074435545u, 1571143908u, 0, SQRT_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 1056835993u, 922098741u, 0, SQRT_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1070541347u, 410974930u, 0, SQRT_TOLERANCE, 0}, +{ 165, 1062562529u, 1018222907u, 3244621407u, 3090050495u, 1067614969u, 1619055709u, 0, SQRT_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1070136763u, 2391931683u, 0, SQRT_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1075488495u, 2106740591u, 0, SQRT_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 1057783478u, 3972097396u, 0, SQRT_TOLERANCE, 0}, +{ 169, 1068615357u, 1710131411u, 1078123323u, 1900790503u, 1070652771u, 291788500u, 0, SQRT_TOLERANCE, 0}, +{ 170, 1091335713u, 3420420033u, 3210844787u, 588423066u, 1082011084u, 3994148752u, 0, SQRT_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 1061188270u, 638608014u, 0, SQRT_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 1087594922u, 3888746790u, 0, SQRT_TOLERANCE, 0}, +{ 173, 1079144091u, 1325936170u, 3221436876u, 680097612u, 1075915851u, 2635101980u, 0, SQRT_TOLERANCE, 0}, +{ 174, 1092907468u, 1827735934u, 3200554324u, 2875599271u, 1082758123u, 4020975259u, 0, SQRT_TOLERANCE, 0}, +{ 175, 1043546754u, 3117037091u, 3239246636u, 15838845u, 1058115053u, 328401279u, 0, SQRT_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1062326834u, 1051206039u, 0, SQRT_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 1058738542u, 861420859u, 0, SQRT_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1085366914u, 2249964520u, 0, SQRT_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 1076945816u, 4122814742u, 0, SQRT_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 1078706376u, 3597981038u, 0, SQRT_TOLERANCE, 0}, +{ 181, 1069146422u, 1141349287u, 1097465301u, 3403438584u, 1070881102u, 1363982323u, 0, SQRT_TOLERANCE, 0}, +{ 182, 1083088260u, 1711085243u, 3250239076u, 1377484108u, 1077890252u, 1851678165u, 0, SQRT_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1085512499u, 1964141477u, 0, SQRT_TOLERANCE, 0}, +{ 184, 1086737787u, 2626629370u, 1063771493u, 1499080813u, 1079686915u, 183335811u, 0, SQRT_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 1063928529u, 2035803317u, 0, SQRT_TOLERANCE, 0}, +{ 186, 1060498071u, 1270950554u, 3194616071u, 3680565379u, 1066580441u, 617356847u, 0, SQRT_TOLERANCE, 0}, +{ 187, 1060664575u, 1066985223u, 3221613219u, 4089383168u, 1066649623u, 4128441333u, 0, SQRT_TOLERANCE, 0}, +{ 188, 1069575191u, 4017329311u, 3208334452u, 1667591498u, 1071049869u, 4277286241u, 0, SQRT_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 1080373506u, 3849431628u, 0, SQRT_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1061586084u, 4015554101u, 0, SQRT_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1088771098u, 1153878443u, 0, SQRT_TOLERANCE, 0}, +{ 192, 1043081808u, 1371169579u, 1057079837u, 2594818628u, 1057883519u, 2861904553u, 0, SQRT_TOLERANCE, 0}, +{ 193, 1104309688u, 2259342224u, 3217432469u, 1824221478u, 1088498657u, 4134322356u, 0, SQRT_TOLERANCE, 0}, +{ 194, 1099351127u, 1576604497u, 1079368611u, 185078728u, 1085996500u, 3741739594u, 0, SQRT_TOLERANCE, 0}, +{ 195, 1074195779u, 444800035u, 3243343143u, 1734989302u, 1073419787u, 3442615331u, 0, SQRT_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1072720706u, 32388127u, 0, SQRT_TOLERANCE, 0}, +{ 197, 1087212320u, 1941318385u, 1045807374u, 792193370u, 1079951177u, 311008137u, 0, SQRT_TOLERANCE, 0}, +{ 198, 1090816018u, 1299392207u, 3212131720u, 3205732280u, 1081713110u, 3921824728u, 0, SQRT_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1085634721u, 997526658u, 0, SQRT_TOLERANCE, 0}, +{ 200, 1099192612u, 2160225215u, 1102624859u, 836655570u, 1085899898u, 3875891937u, 0, SQRT_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 1084630880u, 2920597617u, 0, SQRT_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1071828418u, 2771710464u, 0, SQRT_TOLERANCE, 0}, +{ 203, 1082932703u, 1603798153u, 3207725532u, 1099413093u, 1077809130u, 1620986260u, 0, SQRT_TOLERANCE, 0}, +{ 204, 1099194730u, 2429340443u, 3190303581u, 3223770005u, 1085901226u, 1909350921u, 0, SQRT_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 1074206939u, 3284390891u, 0, SQRT_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 1082797944u, 1848756391u, 0, SQRT_TOLERANCE, 0}, +{ 207, 1045686228u, 2782073372u, 1046063872u, 4023829068u, 1059182757u, 1144494305u, 0, SQRT_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 1085583882u, 1055345467u, 0, SQRT_TOLERANCE, 0}, +{ 209, 1091027173u, 3506346169u, 1047020885u, 1742757458u, 1081840116u, 919870869u, 0, SQRT_TOLERANCE, 0}, +{ 210, 1045180829u, 1265459564u, 3193450280u, 3650514880u, 1058933091u, 2096096260u, 0, SQRT_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 1077182958u, 414505092u, 0, SQRT_TOLERANCE, 0}, +{ 212, 1101185272u, 1263613754u, 3219096387u, 635677201u, 1086881619u, 3327465162u, 0, SQRT_TOLERANCE, 0}, +{ 213, 1058788439u, 4140947288u, 3200792376u, 2013265346u, 1065687545u, 289774073u, 0, SQRT_TOLERANCE, 0}, +{ 214, 1102490744u, 1912759945u, 3237045253u, 1351396825u, 1087572985u, 200814021u, 0, SQRT_TOLERANCE, 0}, +{ 215, 1100721514u, 1001433078u, 3206926643u, 2741676659u, 1086655281u, 2906657682u, 0, SQRT_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1076806875u, 1398507288u, 0, SQRT_TOLERANCE, 0}, +{ 217, 1068250409u, 831239754u, 1099828675u, 3071308141u, 1070467911u, 215486836u, 0, SQRT_TOLERANCE, 0}, +{ 218, 1078350849u, 3473592372u, 1102759382u, 1309576357u, 1075493611u, 285464971u, 0, SQRT_TOLERANCE, 0}, +{ 219, 1103703058u, 2042340367u, 1091945628u, 2062772374u, 1088184745u, 1642723939u, 0, SQRT_TOLERANCE, 0}, +{ 220, 1047282039u, 1840632537u, 1096533424u, 807510337u, 1059983827u, 4285807355u, 0, SQRT_TOLERANCE, 0}, +{ 221, 1083968074u, 144814872u, 3212698915u, 2282965697u, 1078275682u, 3768954894u, 0, SQRT_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1071926866u, 3747737272u, 0, SQRT_TOLERANCE, 0}, +{ 223, 1095609417u, 2858583811u, 1089760910u, 6360994u, 1084149893u, 3408093385u, 0, SQRT_TOLERANCE, 0}, +{ 224, 1050781281u, 1614537194u, 1075198900u, 4088705365u, 1061667829u, 3512455994u, 0, SQRT_TOLERANCE, 0}, +{ 225, 1103455422u, 3545570051u, 1065221325u, 1629217700u, 1088039467u, 3634219627u, 0, SQRT_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1072718482u, 2444193944u, 0, SQRT_TOLERANCE, 0}, +{ 227, 1049319038u, 2406734491u, 1042055360u, 89226663u, 1061000132u, 2269056916u, 0, SQRT_TOLERANCE, 0}, +{ 228, 1048267433u, 1618759139u, 3194723421u, 3888234802u, 1060431237u, 700371869u, 0, SQRT_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1064003648u, 3031176455u, 0, SQRT_TOLERANCE, 0}, +{ 230, 1042459412u, 2431246964u, 3241512456u, 183850734u, 1057517827u, 2676781323u, 0, SQRT_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1081097064u, 2434610491u, 0, SQRT_TOLERANCE, 0}, +{ 232, 1087811016u, 3495352775u, 1058576726u, 596957268u, 1080233094u, 1373646250u, 0, SQRT_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1059547870u, 1202011145u, 0, SQRT_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1065383129u, 1746092362u, 0, SQRT_TOLERANCE, 0}, +{ 235, 1052841323u, 2143376228u, 1098306332u, 3760236188u, 1062691218u, 367710346u, 0, SQRT_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1073655755u, 1808066091u, 0, SQRT_TOLERANCE, 0}, +{ 237, 1066682341u, 2493598049u, 3194927008u, 1689107592u, 1069679490u, 594236901u, 0, SQRT_TOLERANCE, 0}, +{ 238, 1042506311u, 1578976988u, 1066368383u, 2117279163u, 1057548240u, 235320603u, 0, SQRT_TOLERANCE, 0}, +{ 239, 1075504463u, 3425290087u, 1098487295u, 1263412017u, 1074052755u, 3957330920u, 0, SQRT_TOLERANCE, 0}, +{ 240, 1060949116u, 3635396812u, 1070999426u, 3965655689u, 1066759998u, 2285325174u, 0, SQRT_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 1066443949u, 3357751942u, 0, SQRT_TOLERANCE, 0}, +{ 242, 1074462441u, 199516350u, 1078368488u, 164621458u, 1073570877u, 1152484011u, 0, SQRT_TOLERANCE, 0}, +{ 243, 1040222370u, 3570940805u, 3230316437u, 3596080877u, 1056374897u, 1158689868u, 0, SQRT_TOLERANCE, 0}, +{ 244, 1060725917u, 980880313u, 1079833442u, 884465057u, 1066674198u, 3065335256u, 0, SQRT_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1086335134u, 3159565287u, 0, SQRT_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 1059892969u, 3943181295u, 0, SQRT_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1066724573u, 2262457651u, 0, SQRT_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 1066068150u, 673339016u, 0, SQRT_TOLERANCE, 0}, +{ 249, 1088728303u, 751136990u, 3230392165u, 3493275472u, 1080670415u, 1117083003u, 0, SQRT_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1085504701u, 3401565724u, 0, SQRT_TOLERANCE, 0}, +{ 251, 1102940648u, 1717672108u, 1048120593u, 531240316u, 1087749476u, 157061011u, 0, SQRT_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 1063421098u, 2489387950u, 0, SQRT_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 1075189209u, 1648630422u, 0, SQRT_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 1078369157u, 372399065u, 0, SQRT_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 1058289542u, 1728470133u, 0, SQRT_TOLERANCE, 0}, +{ 256, 1087992954u, 451471221u, 1064816262u, 4187644495u, 1080307297u, 1987628334u, 0, SQRT_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 1086060032u, 3546430530u, 0, SQRT_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 1056503945u, 2002788187u, 0, SQRT_TOLERANCE, 0}, +{ 259, 1065765700u, 179066662u, 1103272172u, 1217337578u, 1069200815u, 354239272u, 0, SQRT_TOLERANCE, 0}, +{ 260, 1064078729u, 3779303391u, 3210023352u, 3115946280u, 1068382771u, 924212543u, 0, SQRT_TOLERANCE, 0}, +{ 261, 1045506226u, 286247089u, 1085153597u, 713645369u, 1059099073u, 630553628u, 0, SQRT_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 1083181870u, 1135653208u, 0, SQRT_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 1077916081u, 297621800u, 0, SQRT_TOLERANCE, 0}, +{ 264, 1054212159u, 2256346551u, 3222430705u, 2071674991u, 1063437079u, 1872363528u, 0, SQRT_TOLERANCE, 0}, +{ 265, 1056541047u, 2295269094u, 1084451053u, 2773103941u, 1064580785u, 3548459456u, 0, SQRT_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1075384311u, 1214242217u, 0, SQRT_TOLERANCE, 0}, +{ 267, 1073582325u, 1381740563u, 1071545057u, 2918235653u, 1073070076u, 310733412u, 0, SQRT_TOLERANCE, 0}, +{ 268, 1091232324u, 1105857967u, 3241990046u, 2703723225u, 1081955489u, 1478059523u, 0, SQRT_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 1057847895u, 3807478291u, 0, SQRT_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 1081495834u, 1354217806u, 0, SQRT_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1068604282u, 3534598372u, 0, SQRT_TOLERANCE, 0}, +{ 272, 1066308179u, 2136071361u, 3211529757u, 993675115u, 1069500179u, 1810558929u, 0, SQRT_TOLERANCE, 0}, +{ 273, 1066179733u, 210772141u, 3241441539u, 580731413u, 1069433384u, 2904218754u, 0, SQRT_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 1083263432u, 354293330u, 0, SQRT_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 1069711152u, 1027214939u, 0, SQRT_TOLERANCE, 0}, +{ 276, 1041806969u, 1578223762u, 3224596567u, 2456166162u, 1057219201u, 848829082u, 0, SQRT_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 1065576362u, 3721277445u, 0, SQRT_TOLERANCE, 0}, +{ 278, 1084379746u, 2352173188u, 1079361728u, 4070222179u, 1078474414u, 324321316u, 0, SQRT_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 1086764790u, 735952755u, 0, SQRT_TOLERANCE, 0}, +{ 280, 1049519003u, 330905705u, 1086260896u, 90264431u, 1061105443u, 4035135237u, 0, SQRT_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1056694167u, 2202781865u, 0, SQRT_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 1076853872u, 1160522481u, 0, SQRT_TOLERANCE, 0}, +{ 283, 1102323563u, 3736863454u, 1063475914u, 3150741666u, 1087500671u, 1861954786u, 0, SQRT_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 1066697788u, 1854483559u, 0, SQRT_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 1076398618u, 65493562u, 0, SQRT_TOLERANCE, 0}, +{ 286, 1099500686u, 2132131375u, 3250483427u, 3449276437u, 1086083039u, 2161288431u, 0, SQRT_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1081040607u, 2660755785u, 0, SQRT_TOLERANCE, 0}, +{ 288, 1071289056u, 4090088208u, 1042030013u, 3898658299u, 1071947441u, 861742126u, 0, SQRT_TOLERANCE, 0}, +{ 289, 1060424416u, 2272831437u, 3253082595u, 2639188641u, 1066548560u, 2972214225u, 0, SQRT_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1063654331u, 2881681574u, 0, SQRT_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 1074294105u, 3830274554u, 0, SQRT_TOLERANCE, 0}, +{ 292, 1095283362u, 996259334u, 3241496889u, 3782673116u, 1083972832u, 432134161u, 0, SQRT_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1085860647u, 3790913469u, 0, SQRT_TOLERANCE, 0}, +{ 294, 1103935945u, 95874100u, 3237232828u, 2645647822u, 1088311701u, 3760135837u, 0, SQRT_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 1058168013u, 2436673555u, 0, SQRT_TOLERANCE, 0}, +{ 296, 1091109904u, 2560836004u, 3199616543u, 1180840586u, 1081887506u, 2392996462u, 0, SQRT_TOLERANCE, 0}, +{ 297, 1074119318u, 2218230392u, 3227485787u, 3947214579u, 1073374032u, 777552941u, 0, SQRT_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1076087095u, 2168356619u, 0, SQRT_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1072630507u, 1381726609u, 0, SQRT_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1085398127u, 1081924364u, 0, SQRT_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 1078932742u, 2261433011u, 0, SQRT_TOLERANCE, 0}, +{ 302, 1051600232u, 1346862963u, 1077836259u, 3604666660u, 1062145833u, 3747789312u, 0, SQRT_TOLERANCE, 0}, +{ 303, 1064772331u, 3115209742u, 1099332326u, 1325101950u, 1068711289u, 303323817u, 0, SQRT_TOLERANCE, 0}, +{ 304, 1077062394u, 3889223100u, 1053247613u, 3371396923u, 1074874452u, 2874176179u, 0, SQRT_TOLERANCE, 0}, +{ 305, 1072994220u, 4163120793u, 1075022670u, 1387631215u, 1072834253u, 3076989926u, 0, SQRT_TOLERANCE, 0}, +{ 306, 1057998131u, 1532426189u, 1063168268u, 3397022615u, 1065345676u, 534153645u, 0, SQRT_TOLERANCE, 0}, +{ 307, 1053549673u, 89324166u, 1079206060u, 3429424710u, 1063116839u, 459484642u, 0, SQRT_TOLERANCE, 0}, +{ 308, 1044841454u, 747591401u, 1072238381u, 2803213904u, 1058743148u, 1808992640u, 0, SQRT_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1081889696u, 3706055854u, 0, SQRT_TOLERANCE, 0}, +{ 310, 1080585266u, 314958082u, 3249912496u, 2966213175u, 1076622508u, 2613337941u, 0, SQRT_TOLERANCE, 0}, +{ 311, 1049695766u, 3119528953u, 3217179014u, 2908718240u, 1061193922u, 3756406841u, 0, SQRT_TOLERANCE, 0}, +{ 312, 1094983928u, 2018361566u, 1100926600u, 3985805054u, 1083793705u, 3802756938u, 0, SQRT_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 1071398461u, 718384128u, 0, SQRT_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1074152447u, 319063087u, 0, SQRT_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 1087112069u, 851985999u, 0, SQRT_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 1084320920u, 3214835u, 0, SQRT_TOLERANCE, 0}, +{ 317, 1106743252u, 3250487255u, 1062120700u, 1876195180u, 1089694349u, 557439665u, 0, SQRT_TOLERANCE, 0}, +{ 318, 1078859832u, 1336400247u, 1098057903u, 3314079581u, 1075775581u, 4291308730u, 0, SQRT_TOLERANCE, 0}, +{ 319, 1056195172u, 265025555u, 1063854282u, 3779482256u, 1064435983u, 4278076564u, 0, SQRT_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1069927886u, 1943723413u, 0, SQRT_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1061377261u, 2289907591u, 0, SQRT_TOLERANCE, 0}, +{ 322, 1055016507u, 2875684421u, 3227459837u, 2251967570u, 1063792293u, 507358715u, 0, SQRT_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 1067880577u, 350201530u, 0, SQRT_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1087051160u, 4215200347u, 0, SQRT_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 1068744461u, 1102653645u, 0, SQRT_TOLERANCE, 0}, +{ 326, 1096635140u, 2529029548u, 3249882819u, 3781513577u, 1084598567u, 3064069855u, 0, SQRT_TOLERANCE, 0}, +{ 327, 1065952706u, 1080845539u, 3206760016u, 911778687u, 1069309466u, 71830766u, 0, SQRT_TOLERANCE, 0}, +{ 328, 1044467388u, 469586759u, 1091830022u, 3080528840u, 1058506922u, 221987346u, 0, SQRT_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1076418785u, 3532456349u, 0, SQRT_TOLERANCE, 0}, +{ 330, 1063343336u, 4080017377u, 3206492941u, 1470284690u, 1067945180u, 1918123523u, 0, SQRT_TOLERANCE, 0}, +{ 331, 1059636742u, 3867917386u, 1102054928u, 3504746045u, 1066149863u, 2182974269u, 0, SQRT_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 1068602636u, 3427706147u, 0, SQRT_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 1080387650u, 1268979567u, 0, SQRT_TOLERANCE, 0}, +{ 334, 1055486470u, 2180218657u, 3211592260u, 1206527853u, 1064077565u, 3195037399u, 0, SQRT_TOLERANCE, 0}, +{ 335, 1049601096u, 394130786u, 3242511482u, 2437699868u, 1061147139u, 977955u, 0, SQRT_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 1058395468u, 354883305u, 0, SQRT_TOLERANCE, 0}, +{ 337, 1062656366u, 3128971673u, 3249137531u, 2773583059u, 1067654866u, 1096706434u, 0, SQRT_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 1078857712u, 456992369u, 0, SQRT_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 1086823996u, 1454547448u, 0, SQRT_TOLERANCE, 0}, +{ 340, 1104807187u, 1873709254u, 3245167989u, 44275991u, 1088710498u, 4101993083u, 0, SQRT_TOLERANCE, 0}, +{ 341, 1042185105u, 1174874204u, 3208263730u, 2360372288u, 1057363358u, 2438182099u, 0, SQRT_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 1088268340u, 4250080331u, 0, SQRT_TOLERANCE, 0}, +{ 343, 1096065286u, 2469774991u, 1043117070u, 3380071805u, 1084369644u, 817174119u, 0, SQRT_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 1065405825u, 1251597094u, 0, SQRT_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1070759199u, 420700552u, 0, SQRT_TOLERANCE, 0}, +{ 346, 1107228981u, 4001809575u, 3240128649u, 278261523u, 1089880819u, 2383679725u, 0, SQRT_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 1079957605u, 3813321906u, 0, SQRT_TOLERANCE, 0}, +{ 348, 1053468899u, 2511916952u, 3219195283u, 1697158299u, 1063073091u, 3522118557u, 0, SQRT_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 1071313202u, 3897164374u, 0, SQRT_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 1088264523u, 271341403u, 0, SQRT_TOLERANCE, 0}, +{ 351, 1063780306u, 3275604304u, 3194840159u, 2991205850u, 1068217952u, 3391390920u, 0, SQRT_TOLERANCE, 0}, +{ 352, 1047765727u, 3509997278u, 3248888030u, 3897986511u, 1060223393u, 119328239u, 0, SQRT_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1059930096u, 1766875221u, 0, SQRT_TOLERANCE, 0}, +{ 354, 1065780437u, 1073153314u, 3250031627u, 2567234990u, 1069209621u, 44110028u, 0, SQRT_TOLERANCE, 0}, +{ 355, 1043109764u, 4261696995u, 3197784432u, 323702024u, 1057898363u, 992679925u, 0, SQRT_TOLERANCE, 0}, +{ 356, 1096207349u, 4075177615u, 3202791065u, 1919006082u, 1084430638u, 1930040197u, 0, SQRT_TOLERANCE, 0}, +{ 357, 1091786365u, 386429966u, 1086504491u, 3698826164u, 1082234629u, 2019393592u, 0, SQRT_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 1075479391u, 1795498102u, 0, SQRT_TOLERANCE, 0}, +{ 359, 1069828285u, 3719038997u, 1055433962u, 3331415058u, 1071217200u, 836481681u, 0, SQRT_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 1066683609u, 3327390033u, 0, SQRT_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1077243361u, 2639059259u, 0, SQRT_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 1057142844u, 4093900513u, 0, SQRT_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1064487062u, 3296692257u, 0, SQRT_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1082365163u, 209668871u, 0, SQRT_TOLERANCE, 0}, +{ 365, 1066407215u, 1897285171u, 3251296075u, 944966123u, 1069550228u, 960024037u, 0, SQRT_TOLERANCE, 0}, +{ 366, 1093887602u, 2270747330u, 3230692631u, 422503284u, 1083285062u, 241119116u, 0, SQRT_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1078331938u, 2725462142u, 0, SQRT_TOLERANCE, 0}, +{ 368, 1055991450u, 1380066948u, 3232612906u, 2613634294u, 1064341694u, 1923848093u, 0, SQRT_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1068280696u, 332562982u, 0, SQRT_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1058618476u, 4292915269u, 0, SQRT_TOLERANCE, 0}, +{ 371, 1069243652u, 1859175955u, 1079949560u, 4258450607u, 1070918794u, 4125613799u, 0, SQRT_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 1060435043u, 1077067733u, 0, SQRT_TOLERANCE, 0}, +{ 373, 1045699515u, 2454653987u, 3229487005u, 2977478685u, 1059188698u, 1481259470u, 0, SQRT_TOLERANCE, 0}, +{ 374, 1106072835u, 1355181872u, 1095308770u, 436846481u, 1089381139u, 1464698042u, 0, SQRT_TOLERANCE, 0}, +{ 375, 1099121654u, 2592856453u, 3247825559u, 3195234082u, 1085854798u, 2943936566u, 0, SQRT_TOLERANCE, 0}, +{ 376, 1074634375u, 3554670043u, 1091621009u, 3321236467u, 1073662304u, 1296983174u, 0, SQRT_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 1070827505u, 3644782479u, 0, SQRT_TOLERANCE, 0}, +{ 378, 1044807461u, 2960339502u, 1098808013u, 1044068983u, 1058722993u, 994227485u, 0, SQRT_TOLERANCE, 0}, +{ 379, 1049207537u, 4093388677u, 1095478112u, 1735930261u, 1060938846u, 2843545940u, 0, SQRT_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 1081847719u, 1064219385u, 0, SQRT_TOLERANCE, 0}, +{ 381, 1061810546u, 3250576797u, 1059002384u, 3043079652u, 1067241495u, 3192629548u, 0, SQRT_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1070904751u, 990593857u, 0, SQRT_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 1088058924u, 1455051938u, 0, SQRT_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1063474250u, 2407866507u, 0, SQRT_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1089671583u, 568721906u, 0, SQRT_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1076817399u, 279371340u, 0, SQRT_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 1078320550u, 100375266u, 0, SQRT_TOLERANCE, 0}, +{ 388, 1072438992u, 2284484846u, 3219498359u, 3240896015u, 1072562014u, 617114991u, 0, SQRT_TOLERANCE, 0}, +{ 389, 1088276041u, 494503287u, 1092811254u, 142673998u, 1080415120u, 2671341223u, 0, SQRT_TOLERANCE, 0}, +{ 390, 1104642268u, 3394882641u, 3225306538u, 364852125u, 1088644193u, 1187366670u, 0, SQRT_TOLERANCE, 0}, +{ 391, 1077778115u, 193885269u, 1088149839u, 1359805831u, 1075167774u, 1898916614u, 0, SQRT_TOLERANCE, 0}, +{ 392, 1053001134u, 592580907u, 3199560872u, 3086438952u, 1062796931u, 3797640977u, 0, SQRT_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1066081497u, 559187402u, 0, SQRT_TOLERANCE, 0}, +{ 394, 1099249950u, 233240285u, 1081923320u, 2710903921u, 1085935472u, 1600406137u, 0, SQRT_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 1071018448u, 3499230725u, 0, SQRT_TOLERANCE, 0}, +{ 396, 1073711076u, 3647632375u, 3247225271u, 3839959621u, 1073116671u, 2152208986u, 0, SQRT_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 1088005918u, 2383898689u, 0, SQRT_TOLERANCE, 0}, +{ 398, 1045520036u, 2134662911u, 3190390590u, 4239009051u, 1059105720u, 3171883903u, 0, SQRT_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 1076588353u, 2641363539u, 0, SQRT_TOLERANCE, 0}, +{ 400, 1072380611u, 538224650u, 3206153057u, 1379649610u, 1072530624u, 978315840u, 0, SQRT_TOLERANCE, 0}, +{ 401, 1048926859u, 3683897920u, 3244167599u, 3647579469u, 1060774894u, 2013114162u, 0, SQRT_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 1081429471u, 2029027480u, 0, SQRT_TOLERANCE, 0}, +{ 403, 1064151744u, 872706833u, 1084802480u, 2200602798u, 1068421049u, 2077007663u, 0, SQRT_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1057437372u, 3967206682u, 0, SQRT_TOLERANCE, 0}, +{ 405, 1048211322u, 1894173462u, 3232800651u, 191960416u, 1060409584u, 2524566565u, 0, SQRT_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1081951677u, 2993598159u, 0, SQRT_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1084030881u, 963614327u, 0, SQRT_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 1068343595u, 3947277126u, 0, SQRT_TOLERANCE, 0}, +{ 409, 1091348993u, 2287646644u, 3240329321u, 2276183378u, 1082018112u, 4217644848u, 0, SQRT_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1070445827u, 3622717486u, 0, SQRT_TOLERANCE, 0}, +{ 411, 1065284713u, 36116288u, 3206886566u, 4196602670u, 1068908857u, 3680300451u, 0, SQRT_TOLERANCE, 0}, +{ 412, 1094212205u, 3550227562u, 3207257983u, 2747744117u, 1083424086u, 1863409761u, 0, SQRT_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1088463847u, 2311468462u, 0, SQRT_TOLERANCE, 0}, +{ 414, 1075513130u, 2210969014u, 1081031001u, 1946786091u, 1074056094u, 441721510u, 0, SQRT_TOLERANCE, 0}, +{ 415, 1088823342u, 4059150589u, 3189759234u, 1177045799u, 1080728531u, 3313459474u, 0, SQRT_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1082876631u, 1296961602u, 0, SQRT_TOLERANCE, 0}, +{ 417, 1066295469u, 1175750283u, 3235559706u, 1424491340u, 1069493667u, 829969552u, 0, SQRT_TOLERANCE, 0}, +{ 418, 1066420545u, 1630036121u, 3231972785u, 3195479448u, 1069556855u, 583687698u, 0, SQRT_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 1081484323u, 2672232682u, 0, SQRT_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 1078950687u, 3356378u, 0, SQRT_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 1082062446u, 2037713556u, 0, SQRT_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 1069678036u, 2788512521u, 0, SQRT_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 1077961570u, 689605687u, 0, SQRT_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 1075590425u, 3525237030u, 0, SQRT_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 1059559844u, 287421473u, 0, SQRT_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 1080407508u, 350055924u, 0, SQRT_TOLERANCE, 0}, +{ 427, 1071694702u, 83062251u, 3211262173u, 2659016437u, 1072113970u, 3297599259u, 0, SQRT_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1084218547u, 4206856861u, 0, SQRT_TOLERANCE, 0}, +{ 429, 1057711424u, 2382776852u, 3249232579u, 1546622468u, 1065196479u, 791105684u, 0, SQRT_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1079107637u, 1873290283u, 0, SQRT_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 1061865045u, 3309079407u, 0, SQRT_TOLERANCE, 0}, +{ 432, 1083714767u, 4039516226u, 3244344107u, 4272932619u, 1078176464u, 4164345184u, 0, SQRT_TOLERANCE, 0}, +{ 433, 1075224793u, 1683007544u, 1091105663u, 3805494321u, 1073940246u, 3618231263u, 0, SQRT_TOLERANCE, 0}, +{ 434, 1073369300u, 2072627412u, 1094383324u, 3394151662u, 1072989441u, 594658976u, 0, SQRT_TOLERANCE, 0}, +{ 435, 1073086376u, 1120106427u, 3223631624u, 3404608264u, 1072874198u, 4021168670u, 0, SQRT_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1085276622u, 1989432736u, 0, SQRT_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 1057654994u, 590963432u, 0, SQRT_TOLERANCE, 0}, +{ 438, 1107083611u, 3946837259u, 3234993796u, 3850406820u, 1089827608u, 1615081452u, 0, SQRT_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1065066997u, 1500675044u, 0, SQRT_TOLERANCE, 0}, +{ 440, 1089221852u, 1554593884u, 3228899878u, 2813752562u, 1080953630u, 571174710u, 0, SQRT_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1064566443u, 2190929495u, 0, SQRT_TOLERANCE, 0}, +{ 442, 1097380651u, 289355864u, 1078453818u, 2143066338u, 1085021485u, 4195797290u, 0, SQRT_TOLERANCE, 0}, +{ 443, 1056456232u, 2157691971u, 1106629150u, 110806409u, 1064546781u, 4218819400u, 0, SQRT_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1077340569u, 631385589u, 0, SQRT_TOLERANCE, 0}, +{ 445, 1053496534u, 558779875u, 3202046748u, 2338464653u, 1063088170u, 1997804931u, 0, SQRT_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 1059191348u, 2477974706u, 0, SQRT_TOLERANCE, 0}, +{ 447, 1090298613u, 3917440951u, 1051668894u, 3736066983u, 1081436094u, 4028266821u, 0, SQRT_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1068702840u, 1921860524u, 0, SQRT_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1069139646u, 3512112585u, 0, SQRT_TOLERANCE, 0}, +{ 450, 1091979581u, 3967957902u, 1057416138u, 3459188071u, 1082319389u, 2225109344u, 0, SQRT_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 1070664028u, 3804485728u, 0, SQRT_TOLERANCE, 0}, +{ 452, 1081332748u, 3285165564u, 3211948811u, 401510871u, 1077006277u, 248376739u, 0, SQRT_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 1083442377u, 3804716202u, 0, SQRT_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1078188033u, 3449775081u, 0, SQRT_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1076094015u, 3936469720u, 0, SQRT_TOLERANCE, 0}, +{ 456, 1074379685u, 162122081u, 3239376395u, 108064594u, 1073525287u, 2316194265u, 0, SQRT_TOLERANCE, 0}, +{ 457, 1089788138u, 869031839u, 3225020876u, 1344301606u, 1081230199u, 3731176513u, 0, SQRT_TOLERANCE, 0}, +{ 458, 1066949826u, 946696117u, 3231825228u, 1700703647u, 1069792840u, 497364938u, 0, SQRT_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1074048279u, 2965312037u, 0, SQRT_TOLERANCE, 0}, +{ 460, 1061291147u, 2488789804u, 3238508333u, 1506943664u, 1066926855u, 2269676912u, 0, SQRT_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1072739917u, 1637771475u, 0, SQRT_TOLERANCE, 0}, +{ 462, 1072450894u, 1244307192u, 3191297711u, 2540916692u, 1072568352u, 232285615u, 0, SQRT_TOLERANCE, 0}, +{ 463, 1052579044u, 2871645739u, 3239081581u, 1440249115u, 1062572585u, 2977319420u, 0, SQRT_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 1070520581u, 257695151u, 0, SQRT_TOLERANCE, 0}, +{ 465, 1047966041u, 2386312545u, 1063169277u, 2715234268u, 1060310533u, 2518007380u, 0, SQRT_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1080229899u, 159367245u, 0, SQRT_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1089334297u, 3615047943u, 0, SQRT_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1059099073u, 1623286304u, 0, SQRT_TOLERANCE, 0}, +{ 469, 1053685514u, 2911548084u, 1105282515u, 2476735795u, 1063188286u, 346296314u, 0, SQRT_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 1061520623u, 948047430u, 0, SQRT_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1071424105u, 3010765323u, 0, SQRT_TOLERANCE, 0}, +{ 472, 1061070948u, 2981820811u, 1059838516u, 2845580478u, 1066804693u, 2312102465u, 0, SQRT_TOLERANCE, 0}, +{ 473, 1046447766u, 1565550570u, 3217165795u, 4162017137u, 1059485064u, 1552579793u, 0, SQRT_TOLERANCE, 0}, +{ 474, 1089767730u, 2808968027u, 1055630096u, 1782326814u, 1081221227u, 419331521u, 0, SQRT_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1063131406u, 1097615809u, 0, SQRT_TOLERANCE, 0}, +{ 476, 1074688031u, 2722693603u, 3227814791u, 3169731970u, 1073689999u, 2047948742u, 0, SQRT_TOLERANCE, 0}, +{ 477, 1070422983u, 899763203u, 3207606001u, 2804747833u, 1071556251u, 2614854416u, 0, SQRT_TOLERANCE, 0}, +{ 478, 1083186677u, 3789058912u, 3228095081u, 4135937628u, 1077939955u, 4096966973u, 0, SQRT_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1066445408u, 338680168u, 0, SQRT_TOLERANCE, 0}, +{ 480, 1094607838u, 2851963139u, 3246852961u, 2590862592u, 1083575559u, 1257537605u, 0, SQRT_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 1076945240u, 1681558365u, 0, SQRT_TOLERANCE, 0}, +{ 482, 1063187430u, 1082582386u, 1075605675u, 2602133689u, 1067860234u, 3662434387u, 0, SQRT_TOLERANCE, 0}, +{ 483, 1092334963u, 1789635787u, 1059414278u, 1048286093u, 1082461759u, 2214805042u, 0, SQRT_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 1085490075u, 486303213u, 0, SQRT_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1067868848u, 870441917u, 0, SQRT_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 1086111289u, 1748979548u, 0, SQRT_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1079302583u, 2892414422u, 0, SQRT_TOLERANCE, 0}, +{ 488, 1083370902u, 1924429710u, 1056464743u, 3349283177u, 1078028046u, 1838721304u, 0, SQRT_TOLERANCE, 0}, +{ 489, 1097989743u, 42238036u, 1042379500u, 2113559863u, 1085339577u, 3245452310u, 0, SQRT_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1068706670u, 1139532016u, 0, SQRT_TOLERANCE, 0}, +{ 491, 1065185882u, 1645486982u, 3224301095u, 3636267471u, 1068872887u, 1412319027u, 0, SQRT_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 1067698313u, 4120404160u, 0, SQRT_TOLERANCE, 0}, +{ 493, 1090754746u, 110029735u, 1046937383u, 984375729u, 1081674418u, 894441904u, 0, SQRT_TOLERANCE, 0}, +{ 494, 1042013090u, 4063688092u, 3203235744u, 1049950343u, 1057299644u, 2998030758u, 0, SQRT_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1067519645u, 362233961u, 0, SQRT_TOLERANCE, 0}, +{ 496, 1079572157u, 66926332u, 1090561839u, 1379780888u, 1076100171u, 1129023565u, 0, SQRT_TOLERANCE, 0}, +{ 497, 1085969659u, 2803378256u, 1086057989u, 498534626u, 1079287682u, 801921590u, 0, SQRT_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 1077634160u, 3568323078u, 0, SQRT_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1058582451u, 1318885712u, 0, SQRT_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1062261486u, 4117994916u, 0, SQRT_TOLERANCE, 0}, +{ 501, 1083771349u, 243303420u, 1093735824u, 1575581926u, 1078199278u, 1873736985u, 0, SQRT_TOLERANCE, 0}, +{ 502, 1091654349u, 3218865041u, 3204803496u, 3840388050u, 1082172937u, 1588899049u, 0, SQRT_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1060486770u, 1564179785u, 0, SQRT_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 1064323571u, 2250502424u, 0, SQRT_TOLERANCE, 0}, +{ 505, 1064421145u, 717293069u, 3211534283u, 582401011u, 1068555662u, 2571126825u, 0, SQRT_TOLERANCE, 0}, +{ 506, 1104478864u, 3766248610u, 3196520332u, 1174437546u, 1088574893u, 1603570037u, 0, SQRT_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1078055448u, 896088740u, 0, SQRT_TOLERANCE, 0}, +{ 508, 1058322796u, 3560686300u, 3220980617u, 4277975772u, 1065498023u, 2204210694u, 0, SQRT_TOLERANCE, 0}, +{ 509, 1062422428u, 2598148853u, 3217622194u, 3460421008u, 1067552832u, 197631934u, 0, SQRT_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1069696458u, 2114931033u, 0, SQRT_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 1084668841u, 4105005870u, 0, SQRT_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 1082146220u, 3524218270u, 0, SQRT_TOLERANCE, 0}, +{ 513, 1043142370u, 3739770117u, 1059520750u, 3959551225u, 1057915536u, 372839383u, 0, SQRT_TOLERANCE, 0}, +{ 514, 1083246857u, 1498861716u, 1091297147u, 847410798u, 1077969520u, 4115883532u, 0, SQRT_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1073045725u, 2729031253u, 0, SQRT_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 1063683953u, 418597223u, 0, SQRT_TOLERANCE, 0}, +{ 517, 1103874344u, 1546972125u, 3249076079u, 1987349196u, 1088278923u, 667617194u, 0, SQRT_TOLERANCE, 0}, +{ 518, 1090735865u, 2769161072u, 1075207126u, 292616282u, 1081662310u, 1119441071u, 0, SQRT_TOLERANCE, 0}, +{ 519, 1052228650u, 36855311u, 1052128202u, 1479039342u, 1062436040u, 3281371343u, 0, SQRT_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 1078193552u, 389181627u, 0, SQRT_TOLERANCE, 0}, +{ 521, 1050369101u, 3808681655u, 1054161346u, 1821773119u, 1061481541u, 707897882u, 0, SQRT_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 1056668714u, 230088075u, 0, SQRT_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 1057411931u, 1895289457u, 0, SQRT_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 1058967346u, 2501951112u, 0, SQRT_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 1084193719u, 1341308550u, 0, SQRT_TOLERANCE, 0}, +{ 526, 1051865606u, 1019916843u, 3219974785u, 1977881787u, 1062277115u, 1815423411u, 0, SQRT_TOLERANCE, 0}, +{ 527, 1051995104u, 2060433318u, 1075872515u, 366073725u, 1062336268u, 898590485u, 0, SQRT_TOLERANCE, 0}, +{ 528, 1043696909u, 1098469906u, 1082900695u, 2349346832u, 1058181560u, 247256455u, 0, SQRT_TOLERANCE, 0}, +{ 529, 1062491059u, 3011196295u, 3252479932u, 2459281672u, 1067583679u, 2229559301u, 0, SQRT_TOLERANCE, 0}, +{ 530, 1073850675u, 2843222682u, 1089275809u, 298982001u, 1073202652u, 76908366u, 0, SQRT_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1087209039u, 1088872555u, 0, SQRT_TOLERANCE, 0}, +{ 532, 1089280230u, 1274901962u, 3241535845u, 3759113509u, 1080984478u, 1577473414u, 0, SQRT_TOLERANCE, 0}, +{ 533, 1098432794u, 2134927252u, 3253802671u, 3013731444u, 1085531847u, 2133386593u, 0, SQRT_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1085905363u, 1067783034u, 0, SQRT_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 1067780333u, 3369307810u, 0, SQRT_TOLERANCE, 0}, +{ 536, 1066289466u, 834976849u, 3217357661u, 2465861779u, 1069490584u, 943739656u, 0, SQRT_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1059169180u, 1599080278u, 0, SQRT_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1061540977u, 2841166373u, 0, SQRT_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 1071294639u, 2819921999u, 0, SQRT_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1059284382u, 1951861770u, 0, SQRT_TOLERANCE, 0}, +{ 541, 1086204043u, 2405805086u, 3251640319u, 324233833u, 1079375734u, 3915012143u, 0, SQRT_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1089676044u, 2397351581u, 0, SQRT_TOLERANCE, 0}, +{ 543, 1041631125u, 1922837702u, 3216892718u, 3535907549u, 1057146423u, 3893510193u, 0, SQRT_TOLERANCE, 0}, +{ 544, 1096132220u, 261447440u, 3209805849u, 1150571079u, 1084398761u, 3527157321u, 0, SQRT_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1084249021u, 1433674918u, 0, SQRT_TOLERANCE, 0}, +{ 546, 1081640044u, 338765118u, 1086225786u, 3207238249u, 1077136979u, 4074518894u, 0, SQRT_TOLERANCE, 0}, +{ 547, 1048699055u, 1085283176u, 3187775111u, 1601194210u, 1060629270u, 1677883377u, 0, SQRT_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1082106575u, 675404539u, 0, SQRT_TOLERANCE, 0}, +{ 549, 1071378583u, 3148395674u, 1041913758u, 3306391490u, 1071981740u, 294778774u, 0, SQRT_TOLERANCE, 0}, +{ 550, 1053793422u, 2205233857u, 3208100078u, 3993195511u, 1063243296u, 1682235421u, 0, SQRT_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1070148707u, 2024206196u, 0, SQRT_TOLERANCE, 0}, +{ 552, 1063349444u, 2920860798u, 3218070226u, 3104066154u, 1067949324u, 2004493119u, 0, SQRT_TOLERANCE, 0}, +{ 553, 1057466703u, 969991373u, 3250596895u, 1734386152u, 1065059392u, 1651745052u, 0, SQRT_TOLERANCE, 0}, +{ 554, 1091432170u, 1218740205u, 3239802737u, 2610078504u, 1082061578u, 3684061174u, 0, SQRT_TOLERANCE, 0}, +{ 555, 1058547594u, 1485218325u, 3220870240u, 3591664613u, 1065593003u, 3784987544u, 0, SQRT_TOLERANCE, 0}, +{ 556, 1054590495u, 690157417u, 3190850619u, 4192347699u, 1063589012u, 317003585u, 0, SQRT_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 1084364580u, 884294277u, 0, SQRT_TOLERANCE, 0}, +{ 558, 1087075589u, 961532417u, 1092588071u, 2923790239u, 1079878723u, 1394752703u, 0, SQRT_TOLERANCE, 0}, +{ 559, 1056395443u, 4174125604u, 1050682630u, 2169701868u, 1064521848u, 4039398156u, 0, SQRT_TOLERANCE, 0}, +{ 560, 1095608827u, 4146748230u, 1087373950u, 2481478351u, 1084149587u, 2478852563u, 0, SQRT_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 1074839412u, 69901431u, 0, SQRT_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 1078350824u, 310580915u, 0, SQRT_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 1086238841u, 791343450u, 0, SQRT_TOLERANCE, 0}, +{ 564, 1105714654u, 712227971u, 1106004723u, 973148499u, 1089184447u, 389736924u, 0, SQRT_TOLERANCE, 0}, +{ 565, 1082604551u, 3409813738u, 3244817008u, 1933503498u, 1077625963u, 2393156367u, 0, SQRT_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1076241305u, 2779503497u, 0, SQRT_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 1075204298u, 1078021586u, 0, SQRT_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 1071727234u, 2527824148u, 0, SQRT_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1084406938u, 2543197104u, 0, SQRT_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 1075331132u, 976795682u, 0, SQRT_TOLERANCE, 0}, +{ 571, 1057086816u, 1776099219u, 1094316777u, 4188083896u, 1064823007u, 3438777187u, 0, SQRT_TOLERANCE, 0}, +{ 572, 1046362060u, 2614400266u, 1073750227u, 3003203347u, 1059454212u, 1643979555u, 0, SQRT_TOLERANCE, 0}, +{ 573, 1066499030u, 2959351406u, 1105603716u, 311851587u, 1069595061u, 2558039374u, 0, SQRT_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 1078579741u, 3398039023u, 0, SQRT_TOLERANCE, 0}, +{ 575, 1084303018u, 447506102u, 3195759295u, 3603669725u, 1078422876u, 353949276u, 0, SQRT_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1085291597u, 1385209631u, 0, SQRT_TOLERANCE, 0}, +{ 577, 1049256177u, 784208771u, 1088764788u, 2182296421u, 1060965823u, 2578700877u, 0, SQRT_TOLERANCE, 0}, +{ 578, 1100848643u, 1527590526u, 3206961556u, 2823164069u, 1086702792u, 3436020600u, 0, SQRT_TOLERANCE, 0}, +{ 579, 1089160483u, 3876699591u, 3207481130u, 4028148535u, 1080920671u, 3222192366u, 0, SQRT_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1078118804u, 3465933800u, 0, SQRT_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 1082242626u, 2162485561u, 0, SQRT_TOLERANCE, 0}, +{ 582, 1079002460u, 3636214836u, 1068367620u, 2932621925u, 1075847817u, 648033979u, 0, SQRT_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1058303986u, 1278719811u, 0, SQRT_TOLERANCE, 0}, +{ 584, 1051338473u, 2648933384u, 1084603503u, 3534304873u, 1062006200u, 3973890530u, 0, SQRT_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1068621123u, 3033538209u, 0, SQRT_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 1066809678u, 4006657168u, 0, SQRT_TOLERANCE, 0}, +{ 587, 1082371716u, 1908572179u, 1080112083u, 1228319033u, 1077483674u, 2480094859u, 0, SQRT_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1060388751u, 230035550u, 0, SQRT_TOLERANCE, 0}, +{ 589, 1073851962u, 4211343447u, 1087492676u, 4272583781u, 1073203518u, 808839606u, 0, SQRT_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1086020796u, 1419283481u, 0, SQRT_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1065353345u, 683507262u, 0, SQRT_TOLERANCE, 0}, +{ 592, 1067054971u, 3403659753u, 3218043030u, 1926480488u, 1069834765u, 4079816734u, 0, SQRT_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 1074766681u, 2204310545u, 0, SQRT_TOLERANCE, 0}, +{ 594, 1075179394u, 2183928090u, 1048403956u, 963834821u, 1073921010u, 4206351748u, 0, SQRT_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1087173594u, 1796114179u, 0, SQRT_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 1085923326u, 3641073464u, 0, SQRT_TOLERANCE, 0}, +{ 597, 1071510850u, 2509132460u, 1102827530u, 2205707903u, 1072030913u, 2255776863u, 0, SQRT_TOLERANCE, 0}, +{ 598, 1057376949u, 1229308263u, 3209170414u, 4206576047u, 1065006425u, 2427150864u, 0, SQRT_TOLERANCE, 0}, +{ 599, 1076592641u, 4078010749u, 3199236456u, 733478972u, 1074637360u, 4242033560u, 0, SQRT_TOLERANCE, 0}, +{ 600, 1050228936u, 4277541051u, 3199806921u, 397102023u, 1061426857u, 4110600862u, 0, SQRT_TOLERANCE, 0}, +{ 601, 1048491365u, 900999594u, 3234720188u, 2530214248u, 1060514439u, 1432053169u, 0, SQRT_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1074610699u, 1624533046u, 0, SQRT_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1060608413u, 4095657260u, 0, SQRT_TOLERANCE, 0}, +{ 604, 1075929840u, 2867079200u, 1101870326u, 921212001u, 1074239074u, 3129267102u, 0, SQRT_TOLERANCE, 0}, +{ 605, 1085738242u, 674547716u, 1063216239u, 3929755226u, 1079194714u, 1993425296u, 0, SQRT_TOLERANCE, 0}, +{ 606, 1092932203u, 3158182449u, 1043794244u, 3259056345u, 1082773526u, 646662438u, 0, SQRT_TOLERANCE, 0}, +{ 607, 1089293008u, 3002823940u, 1059511739u, 2832435794u, 1080991167u, 2142327428u, 0, SQRT_TOLERANCE, 0}, +{ 608, 1069821174u, 2196511929u, 1049973941u, 3672092877u, 1071212728u, 874634407u, 0, SQRT_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 1061507657u, 3300586087u, 0, SQRT_TOLERANCE, 0}, +{ 610, 1095703300u, 1617573614u, 3201863123u, 3090723732u, 1084198066u, 1965834048u, 0, SQRT_TOLERANCE, 0}, +{ 611, 1085717732u, 679893506u, 3211547753u, 824081024u, 1079186141u, 1881293678u, 0, SQRT_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 1081111468u, 2679879526u, 0, SQRT_TOLERANCE, 0}, +{ 613, 1059250016u, 1935990727u, 1088822246u, 1058156518u, 1065915175u, 3548899673u, 0, SQRT_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1087711629u, 149530312u, 0, SQRT_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 1088287914u, 4066812935u, 0, SQRT_TOLERANCE, 0}, +{ 616, 1105470167u, 1796441468u, 1100030327u, 2772711004u, 1089036887u, 3439783295u, 0, SQRT_TOLERANCE, 0}, +{ 617, 1056793172u, 2095685003u, 1077984448u, 2100773742u, 1064677070u, 3082965484u, 0, SQRT_TOLERANCE, 0}, +{ 618, 1045470972u, 2892538035u, 1042396334u, 4162200338u, 1059081916u, 2590763245u, 0, SQRT_TOLERANCE, 0}, +{ 619, 1095242103u, 2177698116u, 3227557177u, 150832500u, 1083949198u, 3011460131u, 0, SQRT_TOLERANCE, 0}, +{ 620, 1044078568u, 607966734u, 3236250630u, 4164600559u, 1058336165u, 3216008968u, 0, SQRT_TOLERANCE, 0}, +{ 621, 1068906164u, 2830122967u, 1046096700u, 3713346883u, 1070783041u, 2252608121u, 0, SQRT_TOLERANCE, 0}, +{ 622, 1089714315u, 2314640506u, 3203696416u, 3276228872u, 1081197414u, 976021772u, 0, SQRT_TOLERANCE, 0}, +{ 623, 1065428659u, 469331883u, 3249037349u, 2999233437u, 1068985698u, 998895242u, 0, SQRT_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1085022259u, 3618303474u, 0, SQRT_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 1061282741u, 2704406419u, 0, SQRT_TOLERANCE, 0}, +{ 626, 1045542849u, 3221475559u, 1043038304u, 915608434u, 1059116614u, 369233074u, 0, SQRT_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1071911452u, 348324353u, 0, SQRT_TOLERANCE, 0}, +{ 628, 1094545351u, 1767658578u, 3237045269u, 2313128318u, 1083552708u, 1870703893u, 0, SQRT_TOLERANCE, 0}, +{ 629, 1063134244u, 1926845182u, 1066835624u, 1783256828u, 1067840988u, 1598436936u, 0, SQRT_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1056603317u, 2337412123u, 0, SQRT_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 1089741246u, 3783034333u, 0, SQRT_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 1075656476u, 3146253411u, 0, SQRT_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1061931030u, 678520773u, 0, SQRT_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 1061847187u, 2249806758u, 0, SQRT_TOLERANCE, 0}, +{ 635, 1059260269u, 2797651324u, 3224410527u, 2374818327u, 1065921837u, 2697175535u, 0, SQRT_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 1080419225u, 1971833611u, 0, SQRT_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 1069295101u, 2317625956u, 0, SQRT_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1071263006u, 1224272277u, 0, SQRT_TOLERANCE, 0}, +{ 639, 1097405019u, 2928437580u, 3187765027u, 1393427873u, 1085035302u, 2741209040u, 0, SQRT_TOLERANCE, 0}, +{ 640, 1061817913u, 189447067u, 1051643315u, 828663513u, 1067245581u, 3767564065u, 0, SQRT_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1062470558u, 3169785241u, 0, SQRT_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 1058284638u, 298510060u, 0, SQRT_TOLERANCE, 0}, +{ 643, 1043127178u, 1766416701u, 1100392103u, 2185373290u, 1057907552u, 4082525716u, 0, SQRT_TOLERANCE, 0}, +{ 644, 1072791741u, 3763582673u, 3191965790u, 388374829u, 1072741389u, 3455066464u, 0, SQRT_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1076125143u, 686124104u, 0, SQRT_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 1088306579u, 2941490609u, 0, SQRT_TOLERANCE, 0}, +{ 647, 1063308449u, 1863545307u, 1069449477u, 3418627399u, 1067921293u, 260051306u, 0, SQRT_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1071067979u, 2183136607u, 0, SQRT_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 1065746452u, 939747836u, 0, SQRT_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 1059377579u, 3239098358u, 0, SQRT_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1057487165u, 906255288u, 0, SQRT_TOLERANCE, 0}, +{ 652, 1053765877u, 2003816032u, 1086050104u, 668090487u, 1063229393u, 591937988u, 0, SQRT_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1062564027u, 1153728629u, 0, SQRT_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1069962904u, 422338124u, 0, SQRT_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1068443075u, 3568678275u, 0, SQRT_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 1062399446u, 1995915588u, 0, SQRT_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 1079136610u, 552437956u, 0, SQRT_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 1061025523u, 84882458u, 0, SQRT_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1071014429u, 1620832626u, 0, SQRT_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1069897890u, 2933439031u, 0, SQRT_TOLERANCE, 0}, +{ 661, 1103422358u, 786180031u, 3197734769u, 2788918312u, 1088019127u, 3627648486u, 0, SQRT_TOLERANCE, 0}, +{ 662, 1087028179u, 2055912467u, 3244244909u, 1394142937u, 1079852961u, 2693116503u, 0, SQRT_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1071076020u, 1554092544u, 0, SQRT_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 1077009592u, 230971631u, 0, SQRT_TOLERANCE, 0}, +{ 665, 1051074198u, 86296211u, 1085850694u, 649202596u, 1061853917u, 3713575055u, 0, SQRT_TOLERANCE, 0}, +{ 666, 1097882744u, 3069064472u, 3237358008u, 23209276u, 1085287930u, 1272708561u, 0, SQRT_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1076961650u, 547480898u, 0, SQRT_TOLERANCE, 0}, +{ 668, 1103049699u, 3171788768u, 3235208783u, 162138697u, 1087789055u, 3892822244u, 0, SQRT_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 1077172212u, 3049250374u, 0, SQRT_TOLERANCE, 0}, +{ 670, 1098026472u, 3347226587u, 1058962932u, 2291943376u, 1085356762u, 2114216684u, 0, SQRT_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1065728866u, 3881890662u, 0, SQRT_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1072742353u, 4068514135u, 0, SQRT_TOLERANCE, 0}, +{ 673, 1100632849u, 1671039260u, 1086395032u, 3745833360u, 1086621152u, 2062363498u, 0, SQRT_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1064817632u, 886839519u, 0, SQRT_TOLERANCE, 0}, +{ 675, 1059632083u, 1423000172u, 3247822717u, 1551488170u, 1066147213u, 3158619639u, 0, SQRT_TOLERANCE, 0}, +{ 676, 1054113659u, 921077236u, 3213332351u, 1431049019u, 1063394336u, 3369552467u, 0, SQRT_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1070023640u, 2410187056u, 0, SQRT_TOLERANCE, 0}, +{ 678, 1080171331u, 4110878657u, 3251297180u, 879739345u, 1076367910u, 1896946077u, 0, SQRT_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1079222126u, 1307759639u, 0, SQRT_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1082287640u, 2949067075u, 0, SQRT_TOLERANCE, 0}, +{ 681, 1085961592u, 1761361082u, 3226030205u, 1121849716u, 1079284549u, 651985841u, 0, SQRT_TOLERANCE, 0}, +{ 682, 1092603467u, 2534144722u, 1044223733u, 3512285706u, 1082560260u, 3424319355u, 0, SQRT_TOLERANCE, 0}, +{ 683, 1064362429u, 4073670723u, 1050729852u, 3034818849u, 1068527451u, 1977644747u, 0, SQRT_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1087338624u, 1251505929u, 0, SQRT_TOLERANCE, 0}, +{ 685, 1069938181u, 1649206019u, 1104525577u, 1267104290u, 1071284845u, 1733827628u, 0, SQRT_TOLERANCE, 0}, +{ 686, 1041818449u, 3775270392u, 1040251850u, 68667319u, 1057223811u, 3667903075u, 0, SQRT_TOLERANCE, 0}, +{ 687, 1056847252u, 3099226694u, 3254103006u, 4020102648u, 1064696885u, 3238917322u, 0, SQRT_TOLERANCE, 0}, +{ 688, 1054108064u, 3718441177u, 3215643451u, 4032951536u, 1063391862u, 3926815021u, 0, SQRT_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1058356203u, 3006675795u, 0, SQRT_TOLERANCE, 0}, +{ 690, 1051127979u, 2784738160u, 1073435430u, 1109346010u, 1061885967u, 628693294u, 0, SQRT_TOLERANCE, 0}, +{ 691, 1078241642u, 3331916473u, 3238794568u, 2707019594u, 1075426975u, 364200131u, 0, SQRT_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 1082922240u, 2297662115u, 0, SQRT_TOLERANCE, 0}, +{ 693, 1069098491u, 2135797997u, 1048399559u, 2941926126u, 1070862123u, 2771619189u, 0, SQRT_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 1060492479u, 3625946286u, 0, SQRT_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 1073997362u, 2376976277u, 0, SQRT_TOLERANCE, 0}, +{ 696, 1100449215u, 3692175292u, 3197271515u, 3989064196u, 1086547557u, 1230309530u, 0, SQRT_TOLERANCE, 0}, +{ 697, 1104208090u, 3111924274u, 1066772558u, 59281695u, 1088450284u, 3649920643u, 0, SQRT_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1070138699u, 3938945759u, 0, SQRT_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1083725404u, 467723950u, 0, SQRT_TOLERANCE, 0}, +{ 700, 1055482282u, 330951080u, 1079189813u, 583922384u, 1064075215u, 3272484162u, 0, SQRT_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1081163492u, 1388030746u, 0, SQRT_TOLERANCE, 0}, +{ 702, 1086945901u, 2072550721u, 3250147641u, 4280263530u, 1079807411u, 1863162939u, 0, SQRT_TOLERANCE, 0}, +{ 703, 1045489058u, 1566376352u, 1067251433u, 72984588u, 1059090752u, 1602896158u, 0, SQRT_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 1083968962u, 753399636u, 0, SQRT_TOLERANCE, 0}, +{ 705, 1069188845u, 1910366299u, 1081770885u, 634683073u, 1070897677u, 2863774767u, 0, SQRT_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1077092030u, 3954895560u, 0, SQRT_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1072901139u, 1413389549u, 0, SQRT_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 1069587339u, 2801007127u, 0, SQRT_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 1069386437u, 3398348402u, 0, SQRT_TOLERANCE, 0}, +{ 710, 1085665139u, 51750045u, 3242913901u, 4256866157u, 1079163884u, 1554573188u, 0, SQRT_TOLERANCE, 0}, +{ 711, 1047601319u, 2163853087u, 3232053146u, 2962422808u, 1060146654u, 3341976993u, 0, SQRT_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1074057560u, 3839819821u, 0, SQRT_TOLERANCE, 0}, +{ 713, 1099384354u, 357108214u, 3202294604u, 2306775262u, 1086016088u, 2177156905u, 0, SQRT_TOLERANCE, 0}, +{ 714, 1054420438u, 2571356437u, 3249064063u, 2394851808u, 1063522893u, 1996514442u, 0, SQRT_TOLERANCE, 0}, +{ 715, 1083004443u, 4273880094u, 1103698617u, 3578832032u, 1077846949u, 3946749071u, 0, SQRT_TOLERANCE, 0}, +{ 716, 1085943053u, 2091068742u, 3228270226u, 3980489730u, 1079277321u, 2352780649u, 0, SQRT_TOLERANCE, 0}, +{ 717, 1081533104u, 2772307714u, 1051008486u, 32546576u, 1077093041u, 1889194046u, 0, SQRT_TOLERANCE, 0}, +{ 718, 1093745567u, 2143788498u, 3195498043u, 3630119231u, 1083218658u, 426861584u, 0, SQRT_TOLERANCE, 0}, +{ 719, 1051149287u, 2527385594u, 3240503648u, 3482095012u, 1061898506u, 9904143u, 0, SQRT_TOLERANCE, 0}, +{ 720, 1094685151u, 2690097362u, 1068598730u, 2360266862u, 1083603341u, 709843363u, 0, SQRT_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 1065713621u, 1890892219u, 0, SQRT_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 1088550776u, 2464066130u, 0, SQRT_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1086048223u, 633234982u, 0, SQRT_TOLERANCE, 0}, +{ 724, 1073313068u, 31662602u, 1047721249u, 1747087514u, 1072967335u, 4221791633u, 0, SQRT_TOLERANCE, 0}, +{ 725, 1102980109u, 2489659568u, 1097051253u, 277506957u, 1087763924u, 176770536u, 0, SQRT_TOLERANCE, 0}, +{ 726, 1043918186u, 3850162281u, 3213841942u, 438724093u, 1058273423u, 3330050394u, 0, SQRT_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 1084033952u, 3177579787u, 0, SQRT_TOLERANCE, 0}, +{ 728, 1095679087u, 391606792u, 1048184750u, 4168944276u, 1084185750u, 1284715554u, 0, SQRT_TOLERANCE, 0}, +{ 729, 1100308768u, 457529672u, 3201090276u, 72407935u, 1086488257u, 3152601039u, 0, SQRT_TOLERANCE, 0}, +{ 730, 1071237071u, 3954981400u, 1052053242u, 2411049585u, 1071927119u, 2207817645u, 0, SQRT_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 1079366985u, 516442262u, 0, SQRT_TOLERANCE, 0}, +{ 732, 1050750780u, 1551748070u, 3236871640u, 1329701152u, 1061647157u, 4111932827u, 0, SQRT_TOLERANCE, 0}, +{ 733, 1077155474u, 3099222537u, 1104984570u, 4293792842u, 1074916749u, 379935345u, 0, SQRT_TOLERANCE, 0}, +{ 734, 1056466057u, 3603065260u, 3197735968u, 2402359253u, 1064550766u, 3737026872u, 0, SQRT_TOLERANCE, 0}, +{ 735, 1051340936u, 3961208159u, 3219057584u, 2340553876u, 1062007562u, 3673974675u, 0, SQRT_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1073786622u, 88914263u, 0, SQRT_TOLERANCE, 0}, +{ 737, 1065792009u, 1403876392u, 3254028950u, 921363393u, 1069216504u, 3876453874u, 0, SQRT_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1089888998u, 4032607029u, 0, SQRT_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 1061177346u, 566150313u, 0, SQRT_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1073540350u, 3476035357u, 0, SQRT_TOLERANCE, 0}, +{ 741, 1068925634u, 1199568671u, 3225679997u, 46947405u, 1070791275u, 3995475172u, 0, SQRT_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 1075133319u, 2848850050u, 0, SQRT_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1069608376u, 145002079u, 0, SQRT_TOLERANCE, 0}, +{ 744, 1092425015u, 3347296825u, 1101507910u, 1254014794u, 1082495560u, 2216586448u, 0, SQRT_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1078331922u, 496821601u, 0, SQRT_TOLERANCE, 0}, +{ 746, 1055716202u, 1832066983u, 1051358028u, 3262483417u, 1064202224u, 1950551906u, 0, SQRT_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1075085031u, 1525244356u, 0, SQRT_TOLERANCE, 0}, +{ 748, 1087990252u, 2497516122u, 3254374111u, 2821429629u, 1080306226u, 517527846u, 0, SQRT_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 1074434583u, 861836968u, 0, SQRT_TOLERANCE, 0}, +{ 750, 1079425038u, 723423605u, 1084533420u, 627282213u, 1076039894u, 365634408u, 0, SQRT_TOLERANCE, 0}, +{ 751, 1068464032u, 4292778869u, 1078101071u, 1676860147u, 1070578567u, 1047536610u, 0, SQRT_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 1074465746u, 203801155u, 0, SQRT_TOLERANCE, 0}, +{ 753, 1045414231u, 1307010018u, 1061248120u, 1468743108u, 1059053724u, 1102571830u, 0, SQRT_TOLERANCE, 0}, +{ 754, 1099099491u, 107905661u, 3226089788u, 1943427674u, 1085840453u, 1102742192u, 0, SQRT_TOLERANCE, 0}, +{ 755, 1040746893u, 760006940u, 1054265604u, 1749976597u, 1056703860u, 3059823824u, 0, SQRT_TOLERANCE, 0}, +{ 756, 1090289736u, 2787503556u, 1081282610u, 1195841206u, 1081432773u, 932870048u, 0, SQRT_TOLERANCE, 0}, +{ 757, 1044318508u, 545462045u, 3208381743u, 1981311808u, 1058425007u, 1072319699u, 0, SQRT_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 1066887030u, 2118518534u, 0, SQRT_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1061281398u, 3106920657u, 0, SQRT_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1074775007u, 707871427u, 0, SQRT_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1064069386u, 2623791979u, 0, SQRT_TOLERANCE, 0}, +{ 762, 1060018678u, 3007589929u, 3202026547u, 2792028313u, 1066355451u, 1532923830u, 0, SQRT_TOLERANCE, 0}, +{ 763, 1105599122u, 1866066996u, 1060329048u, 3727175322u, 1089116275u, 3321812424u, 0, SQRT_TOLERANCE, 0}, +{ 764, 1050932995u, 150890940u, 1056025306u, 3082724735u, 1061766824u, 1428927829u, 0, SQRT_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 1067348625u, 2196153996u, 0, SQRT_TOLERANCE, 0}, +{ 766, 1104156966u, 4050954182u, 3219263194u, 2537475930u, 1088425102u, 2337725373u, 0, SQRT_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1068739879u, 2073796259u, 0, SQRT_TOLERANCE, 0}, +{ 768, 1101532656u, 440309030u, 3214267461u, 3788040806u, 1087094405u, 3373897749u, 0, SQRT_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 1086558806u, 1011245962u, 0, SQRT_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 1057345992u, 111156193u, 0, SQRT_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1059849184u, 1753236757u, 0, SQRT_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 1065233931u, 3174219490u, 0, SQRT_TOLERANCE, 0}, +{ 773, 1055246165u, 2684353926u, 3205212854u, 1732474928u, 1063937584u, 3393361022u, 0, SQRT_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1083946234u, 613474900u, 0, SQRT_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 1067875809u, 2596828830u, 0, SQRT_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 1068748662u, 3465974693u, 0, SQRT_TOLERANCE, 0}, +{ 777, 1057063924u, 841366493u, 1051716814u, 4121125128u, 1064807613u, 159179335u, 0, SQRT_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 1068651559u, 3231648951u, 0, SQRT_TOLERANCE, 0}, +{ 779, 1098059015u, 799866606u, 3197637091u, 3924438208u, 1085371772u, 2017401516u, 0, SQRT_TOLERANCE, 0}, +{ 780, 1043579242u, 2002049816u, 1077053447u, 2240354761u, 1058129764u, 2275278518u, 0, SQRT_TOLERANCE, 0}, +{ 781, 1081522635u, 478939968u, 1097035749u, 1066716440u, 1077088656u, 3304548743u, 0, SQRT_TOLERANCE, 0}, +{ 782, 1084989993u, 1653104725u, 1088548129u, 81977716u, 1078836375u, 591268420u, 0, SQRT_TOLERANCE, 0}, +{ 783, 1049377628u, 3899475018u, 3189694084u, 3330093036u, 1061031572u, 1752714901u, 0, SQRT_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1081001371u, 1642998661u, 0, SQRT_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 1086622688u, 1854865064u, 0, SQRT_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1063668514u, 3137717449u, 0, SQRT_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1075670984u, 3831365719u, 0, SQRT_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 1077126168u, 2660033190u, 0, SQRT_TOLERANCE, 0}, +{ 789, 1046346124u, 41779312u, 1081626342u, 831171823u, 1059448402u, 2030752802u, 0, SQRT_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1065410603u, 3297354989u, 0, SQRT_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1072507465u, 3972749633u, 0, SQRT_TOLERANCE, 0}, +{ 792, 1106952026u, 1894912556u, 1042426694u, 155024547u, 1089777643u, 1238149925u, 0, SQRT_TOLERANCE, 0}, +{ 793, 1047969864u, 35164295u, 3203391785u, 1037041084u, 1060312137u, 1648206646u, 0, SQRT_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 1078718463u, 4101912742u, 0, SQRT_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1070756514u, 1014033437u, 0, SQRT_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1059413790u, 3253496655u, 0, SQRT_TOLERANCE, 0}, +{ 797, 1080040567u, 395145384u, 3219821938u, 50586510u, 1076278454u, 993178072u, 0, SQRT_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 1071183978u, 2068128913u, 0, SQRT_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1079645109u, 2783782078u, 0, SQRT_TOLERANCE, 0}, +{ 800, 1070606742u, 344241827u, 1071538935u, 2715566077u, 1071649981u, 2564811453u, 0, SQRT_TOLERANCE, 0}, +{ 801, 1100099208u, 4069301823u, 3193208760u, 2949125229u, 1086393944u, 2192827036u, 0, SQRT_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1087896508u, 3628193145u, 0, SQRT_TOLERANCE, 0}, +{ 803, 1046635308u, 709803845u, 1048741487u, 2296910194u, 1059602883u, 1477120060u, 0, SQRT_TOLERANCE, 0}, +{ 804, 1045797131u, 744421179u, 1069302001u, 2659232829u, 1059231457u, 3965738399u, 0, SQRT_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 1082712784u, 2200512806u, 0, SQRT_TOLERANCE, 0}, +{ 806, 1058624854u, 145234164u, 3250614064u, 912384201u, 1065624069u, 2049313107u, 0, SQRT_TOLERANCE, 0}, +{ 807, 1093027016u, 2784620507u, 1102812948u, 3531481022u, 1082831308u, 3299780961u, 0, SQRT_TOLERANCE, 0}, +{ 808, 1103676015u, 383952592u, 3205659905u, 3633194728u, 1088169436u, 3168320457u, 0, SQRT_TOLERANCE, 0}, +{ 809, 1055992604u, 3792395543u, 1070072378u, 3864816376u, 1064342251u, 3788402700u, 0, SQRT_TOLERANCE, 0}, +{ 810, 1057832625u, 2115553675u, 1066288499u, 3538377867u, 1065260905u, 472205566u, 0, SQRT_TOLERANCE, 0}, +{ 811, 1104591537u, 1230026762u, 1090719723u, 440819880u, 1088623089u, 1428813236u, 0, SQRT_TOLERANCE, 0}, +{ 812, 1047111428u, 2991290482u, 1096886719u, 1097971167u, 1059890853u, 291347617u, 0, SQRT_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1081339316u, 2296873801u, 0, SQRT_TOLERANCE, 0}, +{ 814, 1103573316u, 1719428427u, 3188631907u, 3707377409u, 1088110106u, 16291827u, 0, SQRT_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 1062941047u, 1513165414u, 0, SQRT_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1078675931u, 2283497204u, 0, SQRT_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1062863345u, 1571174098u, 0, SQRT_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1072004418u, 1037285731u, 0, SQRT_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 1073874006u, 3003841767u, 0, SQRT_TOLERANCE, 0}, +{ 820, 1052824608u, 3315127889u, 3236295594u, 2900924954u, 1062679736u, 4204383877u, 0, SQRT_TOLERANCE, 0}, +{ 821, 1048942243u, 2246037502u, 1049691002u, 1496066550u, 1060784284u, 3318248494u, 0, SQRT_TOLERANCE, 0}, +{ 822, 1045523211u, 4191285446u, 3217936236u, 2382392789u, 1059107243u, 2277744408u, 0, SQRT_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1082711073u, 1039517410u, 0, SQRT_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1076230316u, 3833362338u, 0, SQRT_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 1084654085u, 3071012224u, 0, SQRT_TOLERANCE, 0}, +{ 826, 1044065902u, 3797143370u, 3195497539u, 3843275034u, 1058331315u, 3377308626u, 0, SQRT_TOLERANCE, 0}, +{ 827, 1104593745u, 2806642640u, 3201943068u, 2515980718u, 1088624015u, 1764710363u, 0, SQRT_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 1079768576u, 2512463005u, 0, SQRT_TOLERANCE, 0}, +{ 829, 1053496927u, 3309678799u, 1049337078u, 3056787074u, 1063088384u, 1725711449u, 0, SQRT_TOLERANCE, 0}, +{ 830, 1074011641u, 2341164249u, 1080834967u, 2810890005u, 1073307462u, 1389366866u, 0, SQRT_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 1069820839u, 2762305859u, 0, SQRT_TOLERANCE, 0}, +{ 832, 1101746443u, 1367996113u, 3251723684u, 2974064663u, 1087213777u, 2643950195u, 0, SQRT_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1076406911u, 478131288u, 0, SQRT_TOLERANCE, 0}, +{ 834, 1088295228u, 4184941840u, 3196770014u, 2458988443u, 1080422136u, 1324379918u, 0, SQRT_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 1080149342u, 4075983968u, 0, SQRT_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 1068380634u, 1012366217u, 0, SQRT_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1080340982u, 73683265u, 0, SQRT_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1062692901u, 2801211497u, 0, SQRT_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1063400657u, 3245250245u, 0, SQRT_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1068405745u, 3911197227u, 0, SQRT_TOLERANCE, 0}, +{ 841, 1103793023u, 752664055u, 1065110394u, 1835931663u, 1088234789u, 2349851322u, 0, SQRT_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1080327805u, 601359943u, 0, SQRT_TOLERANCE, 0}, +{ 843, 1050651439u, 1636966254u, 1086098766u, 2016598298u, 1061585549u, 3681702830u, 0, SQRT_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 1061765762u, 4010345559u, 0, SQRT_TOLERANCE, 0}, +{ 845, 1082348569u, 2977627788u, 1045339018u, 516058480u, 1077468850u, 2502630431u, 0, SQRT_TOLERANCE, 0}, +{ 846, 1089924930u, 3901731263u, 3189566462u, 32272932u, 1081288690u, 774317996u, 0, SQRT_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1074971826u, 3460167714u, 0, SQRT_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 1086254464u, 3189187714u, 0, SQRT_TOLERANCE, 0}, +{ 849, 1103446273u, 692989850u, 3242630588u, 2492225971u, 1088033863u, 2469722507u, 0, SQRT_TOLERANCE, 0}, +{ 850, 1057995749u, 3439913962u, 1067477011u, 2973333638u, 1065344480u, 3040195127u, 0, SQRT_TOLERANCE, 0}, +{ 851, 1066510341u, 877613377u, 1044917899u, 809672798u, 1069600458u, 1220560379u, 0, SQRT_TOLERANCE, 0}, +{ 852, 1074687806u, 905426932u, 1046417457u, 1086320855u, 1073689883u, 3891738956u, 0, SQRT_TOLERANCE, 0}, +{ 853, 1098862981u, 2645567288u, 1051258339u, 557182478u, 1085694617u, 1952982282u, 0, SQRT_TOLERANCE, 0}, +{ 854, 1056574302u, 186287752u, 1061342054u, 4054003419u, 1064593882u, 1277191925u, 0, SQRT_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1084955436u, 1253146977u, 0, SQRT_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 1057640543u, 3319015595u, 0, SQRT_TOLERANCE, 0}, +{ 857, 1096164025u, 368493885u, 3222871893u, 1419055230u, 1084412356u, 3623601574u, 0, SQRT_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 1082307037u, 3692477730u, 0, SQRT_TOLERANCE, 0}, +{ 859, 1057942861u, 1239207795u, 1040192984u, 2199481342u, 1065317754u, 3583138412u, 0, SQRT_TOLERANCE, 0}, +{ 860, 1063494989u, 4264613432u, 3203460972u, 3558930895u, 1068044986u, 1121116424u, 0, SQRT_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 1061454580u, 3489910349u, 0, SQRT_TOLERANCE, 0}, +{ 862, 1083259393u, 1077949160u, 1075769893u, 2405271377u, 1077975578u, 2163283318u, 0, SQRT_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 1082256608u, 3858841463u, 0, SQRT_TOLERANCE, 0}, +{ 864, 1051133505u, 1518334131u, 3205247482u, 791756713u, 1061889227u, 1233401148u, 0, SQRT_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 1060002582u, 2575170954u, 0, SQRT_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 1086354386u, 1510428249u, 0, SQRT_TOLERANCE, 0}, +{ 867, 1068907602u, 247369460u, 3197320093u, 687450958u, 1070783651u, 1407209870u, 0, SQRT_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1088427321u, 1033488541u, 0, SQRT_TOLERANCE, 0}, +{ 869, 1060614787u, 1845900544u, 3231520830u, 3389751458u, 1066629330u, 587670171u, 0, SQRT_TOLERANCE, 0}, +{ 870, 1100051597u, 737689911u, 3195377751u, 3462616966u, 1086371384u, 3993203066u, 0, SQRT_TOLERANCE, 0}, +{ 871, 1076054736u, 3620285831u, 1055501023u, 2708056059u, 1074321592u, 3107724562u, 0, SQRT_TOLERANCE, 0}, +{ 872, 1071981348u, 4073430285u, 1056206159u, 172017902u, 1072300527u, 1206422568u, 0, SQRT_TOLERANCE, 0}, +{ 873, 1065385990u, 2799176222u, 1052706894u, 4083892667u, 1068956275u, 1125625004u, 0, SQRT_TOLERANCE, 0}, +{ 874, 1054795909u, 1562351330u, 1069705601u, 1247765260u, 1063664883u, 1449767613u, 0, SQRT_TOLERANCE, 0}, +{ 875, 1085233651u, 51853475u, 3189080201u, 2783553144u, 1078963340u, 2980621286u, 0, SQRT_TOLERANCE, 0}, +{ 876, 1071970705u, 3851781549u, 3241598113u, 514064046u, 1072293966u, 4246499422u, 0, SQRT_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 1086368685u, 2435743120u, 0, SQRT_TOLERANCE, 0}, +{ 878, 1065598845u, 2948648757u, 3232177250u, 4278702895u, 1069097834u, 2375998345u, 0, SQRT_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1072586784u, 545586649u, 0, SQRT_TOLERANCE, 0}, +{ 880, 1050591911u, 3891230598u, 1095924595u, 3049217547u, 1061564240u, 2256144u, 0, SQRT_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1075001834u, 909189286u, 0, SQRT_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1066633326u, 4119545649u, 0, SQRT_TOLERANCE, 0}, +{ 883, 1080223688u, 2126253040u, 3207248026u, 808507485u, 1076402336u, 1523656667u, 0, SQRT_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1079333703u, 3201764093u, 0, SQRT_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1087719890u, 431665675u, 0, SQRT_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 1068794989u, 4087232503u, 0, SQRT_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1073499579u, 2341282884u, 0, SQRT_TOLERANCE, 0}, +{ 888, 1065945517u, 3744663425u, 3212482771u, 953662066u, 1069305407u, 716853070u, 0, SQRT_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 1078931604u, 2941441890u, 0, SQRT_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 1060456154u, 2961457688u, 0, SQRT_TOLERANCE, 0}, +{ 891, 1096464829u, 606044282u, 3241318094u, 2446416887u, 1084534207u, 1511287830u, 0, SQRT_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1057144786u, 649471989u, 0, SQRT_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 1065601143u, 1652997283u, 0, SQRT_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 1058506783u, 186977955u, 0, SQRT_TOLERANCE, 0}, +{ 895, 1042020446u, 4099522736u, 3232742168u, 3718083858u, 1057302429u, 1224234008u, 0, SQRT_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1082475488u, 497911871u, 0, SQRT_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 1088852890u, 3417536716u, 0, SQRT_TOLERANCE, 0}, +{ 898, 1091529166u, 2462163405u, 3218946201u, 3876535372u, 1082111118u, 1513781992u, 0, SQRT_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 1078483072u, 3832132292u, 0, SQRT_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 1062510505u, 3992598146u, 0, SQRT_TOLERANCE, 0}, +{ 901, 1045799308u, 2533012202u, 1079980803u, 3592268374u, 1059232394u, 2668168063u, 0, SQRT_TOLERANCE, 0}, +{ 902, 1055881132u, 4108274117u, 1063045844u, 571992389u, 1064287117u, 1171677987u, 0, SQRT_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 1081549912u, 140601693u, 0, SQRT_TOLERANCE, 0}, +{ 904, 1046496395u, 1213941007u, 1105433735u, 2172963370u, 1059508450u, 3107457966u, 0, SQRT_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 1084691923u, 2579691573u, 0, SQRT_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 1084136605u, 1786559035u, 0, SQRT_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 1078193568u, 2356008149u, 0, SQRT_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 1083324841u, 2105746957u, 0, SQRT_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 1074675587u, 1262826853u, 0, SQRT_TOLERANCE, 0}, +{ 910, 1104810967u, 2983070435u, 1089546472u, 2907918480u, 1088711980u, 1326194828u, 0, SQRT_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1077838407u, 3408513618u, 0, SQRT_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 1056901096u, 66696044u, 0, SQRT_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1059997296u, 2895252019u, 0, SQRT_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 1076329543u, 4268918442u, 0, SQRT_TOLERANCE, 0}, +{ 915, 1078806678u, 176522478u, 1069999908u, 2891249491u, 1075747989u, 1079133698u, 0, SQRT_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1058123158u, 1658549495u, 0, SQRT_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1056389906u, 2986782993u, 0, SQRT_TOLERANCE, 0}, +{ 918, 1044013141u, 3819109588u, 1048561488u, 969143351u, 1058310923u, 3478948785u, 0, SQRT_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 1072666147u, 3848600418u, 0, SQRT_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1060340580u, 88720588u, 0, SQRT_TOLERANCE, 0}, +{ 921, 1083983658u, 4189906558u, 3203004203u, 854242364u, 1078281556u, 3353832663u, 0, SQRT_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1088298179u, 1086091072u, 0, SQRT_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 1059268121u, 2167989998u, 0, SQRT_TOLERANCE, 0}, +{ 924, 1074889038u, 1794845306u, 1104879344u, 4135865182u, 1073790034u, 3868303847u, 0, SQRT_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1089566732u, 1912835680u, 0, SQRT_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1073069739u, 721338478u, 0, SQRT_TOLERANCE, 0}, +{ 927, 1083965546u, 567588900u, 3195452230u, 1421366017u, 1078274727u, 3337096634u, 0, SQRT_TOLERANCE, 0}, +{ 928, 1077606107u, 2708717091u, 1071975971u, 1364590470u, 1075103063u, 318110768u, 0, SQRT_TOLERANCE, 0}, +{ 929, 1104653635u, 3461956134u, 3207820115u, 1605709634u, 1088648873u, 4265956437u, 0, SQRT_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1068915415u, 2084577864u, 0, SQRT_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1065560347u, 2628317795u, 0, SQRT_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1064947318u, 2814349975u, 0, SQRT_TOLERANCE, 0}, +{ 933, 1042153283u, 851569132u, 1058503154u, 1399378677u, 1057351784u, 3774620876u, 0, SQRT_TOLERANCE, 0}, +{ 934, 1086054049u, 3897202342u, 3245382590u, 246600375u, 1079320031u, 1244349683u, 0, SQRT_TOLERANCE, 0}, +{ 935, 1077976660u, 3620429520u, 1055627557u, 229305u, 1075253123u, 3013558791u, 0, SQRT_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1078272188u, 2238994166u, 0, SQRT_TOLERANCE, 0}, +{ 937, 1080324787u, 32766320u, 1062084905u, 3668443038u, 1076466812u, 724880903u, 0, SQRT_TOLERANCE, 0}, +{ 938, 1075815348u, 2039713492u, 3248699388u, 1346210821u, 1074167781u, 628737544u, 0, SQRT_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1082845040u, 1168265261u, 0, SQRT_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 1067024832u, 2844487097u, 0, SQRT_TOLERANCE, 0}, +{ 941, 1043911539u, 2372623300u, 3210185343u, 3200572848u, 1058270758u, 1094784534u, 0, SQRT_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1086683339u, 589937548u, 0, SQRT_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 1067477620u, 1640907208u, 0, SQRT_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 1064879367u, 624834462u, 0, SQRT_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 1081993122u, 1740668065u, 0, SQRT_TOLERANCE, 0}, +{ 946, 1098953963u, 142942404u, 1075322987u, 1746449109u, 1085742890u, 916346833u, 0, SQRT_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1088348487u, 2351791740u, 0, SQRT_TOLERANCE, 0}, +{ 948, 1102741893u, 2999955409u, 3222793392u, 1868977643u, 1087674356u, 982677099u, 0, SQRT_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1073491165u, 2764397114u, 0, SQRT_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 1070451004u, 1822251312u, 0, SQRT_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 1081503579u, 4285607432u, 0, SQRT_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 1070368515u, 3293074727u, 0, SQRT_TOLERANCE, 0}, +{ 953, 1061001026u, 938869114u, 1087911145u, 2416710759u, 1066779213u, 859029982u, 0, SQRT_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1084132903u, 200004974u, 0, SQRT_TOLERANCE, 0}, +{ 955, 1090245139u, 1337895935u, 1076463812u, 1172733328u, 1081415964u, 3919088725u, 0, SQRT_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 1060900690u, 3691380790u, 0, SQRT_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1073373307u, 1734194338u, 0, SQRT_TOLERANCE, 0}, +{ 958, 1094655132u, 2976596113u, 3192137295u, 3033242648u, 1083592616u, 3269714685u, 0, SQRT_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 1085634600u, 2974954006u, 0, SQRT_TOLERANCE, 0}, +{ 960, 1094287162u, 4007797282u, 3225853845u, 4069319648u, 1083454116u, 1111847775u, 0, SQRT_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1059982733u, 1785743553u, 0, SQRT_TOLERANCE, 0}, +{ 962, 1070128056u, 200857661u, 3229758439u, 3359367736u, 1071395896u, 2032866210u, 0, SQRT_TOLERANCE, 0}, +{ 963, 1101314221u, 111868139u, 3227902082u, 2366064003u, 1086963739u, 4196686705u, 0, SQRT_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1058380034u, 3747406404u, 0, SQRT_TOLERANCE, 0}, +{ 965, 1095192067u, 789151814u, 1099269239u, 2958956055u, 1083920118u, 3070815874u, 0, SQRT_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 1078661356u, 2462041756u, 0, SQRT_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1059570061u, 3303006986u, 0, SQRT_TOLERANCE, 0}, +{ 968, 1050400412u, 3838689849u, 3198769679u, 1302617170u, 1061493461u, 1255872586u, 0, SQRT_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 1079275699u, 2132957795u, 0, SQRT_TOLERANCE, 0}, +{ 970, 1052057157u, 3502371499u, 1043411944u, 4190072016u, 1062363584u, 1166493977u, 0, SQRT_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1068670638u, 2243988751u, 0, SQRT_TOLERANCE, 0}, +{ 972, 1046031308u, 3653237931u, 3204255012u, 3683870669u, 1059328381u, 2115495913u, 0, SQRT_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1063137567u, 1274861223u, 0, SQRT_TOLERANCE, 0}, +{ 974, 1095020203u, 558292492u, 1051772749u, 4267873474u, 1083816419u, 1693486820u, 0, SQRT_TOLERANCE, 0}, +{ 975, 1077289061u, 509637100u, 3212030069u, 215050379u, 1074974919u, 2045190657u, 0, SQRT_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1082351806u, 2909573129u, 0, SQRT_TOLERANCE, 0}, +{ 977, 1067315689u, 998858159u, 1063077962u, 436029885u, 1069933448u, 907635004u, 0, SQRT_TOLERANCE, 0}, +{ 978, 1058463317u, 996300405u, 3193842624u, 80548098u, 1065558239u, 135023660u, 0, SQRT_TOLERANCE, 0}, +{ 979, 1081365192u, 3876129407u, 3215332180u, 2226970413u, 1077020759u, 1534667039u, 0, SQRT_TOLERANCE, 0}, +{ 980, 1090125305u, 200013509u, 3224552716u, 414878724u, 1081369753u, 3459975001u, 0, SQRT_TOLERANCE, 0}, +{ 981, 1083133445u, 309319541u, 1048979765u, 1261662434u, 1077913221u, 1869288719u, 0, SQRT_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1080969958u, 3153974956u, 0, SQRT_TOLERANCE, 0}, +{ 983, 1088652436u, 1611969213u, 1053890378u, 3774617276u, 1080622543u, 2166078761u, 0, SQRT_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1076520965u, 3008339372u, 0, SQRT_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 1057109504u, 417464780u, 0, SQRT_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 1062924111u, 1475578926u, 0, SQRT_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 1081144309u, 1506943838u, 0, SQRT_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1066242022u, 408509364u, 0, SQRT_TOLERANCE, 0}, +{ 989, 1045672057u, 659070058u, 1073095700u, 1393632068u, 1059176387u, 955643869u, 0, SQRT_TOLERANCE, 0}, +{ 990, 1070199615u, 4276187829u, 3217553330u, 1868253275u, 1071436055u, 3673736417u, 0, SQRT_TOLERANCE, 0}, +{ 991, 1075736624u, 2085481575u, 3215994784u, 800910002u, 1074139519u, 161119849u, 0, SQRT_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1064728410u, 4059681546u, 0, SQRT_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 1065096039u, 1148369410u, 0, SQRT_TOLERANCE, 0}, +{ 994, 1053355602u, 3792931748u, 3204857863u, 804393211u, 1063009988u, 1880669775u, 0, SQRT_TOLERANCE, 0}, +{ 995, 1106162722u, 3430071177u, 3226288311u, 3652522729u, 1089427546u, 1065853679u, 0, SQRT_TOLERANCE, 0}, +{ 996, 1053831054u, 236884699u, 3227874605u, 2193269825u, 1063262133u, 1982882090u, 0, SQRT_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1068777832u, 3842742177u, 0, SQRT_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 1078286204u, 1374590418u, 0, SQRT_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 1083261193u, 3135830611u, 0, SQRT_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_SQRT_H multiple inclusion protection + +// EOF sqrt.h diff --git a/packages/language/c/libm/current/tests/vectors/tan.c b/packages/language/c/libm/current/tests/vectors/tan.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/tan.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// tan.c +// +// Test of tan() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/tan.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(tan_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &tan, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &tan_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("tan() is stable"); + } // if + else + { + CYG_TEST_FAIL("tan() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library tan() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "tan() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF tan.c diff --git a/packages/language/c/libm/current/tests/vectors/tan.h b/packages/language/c/libm/current/tests/vectors/tan.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/tan.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_TAN_H +#define CYGONCE_LIBM_TAN_H +//=========================================================================== +// +// tan.h +// +// Test vectors for testing of tan() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/tan.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define TAN_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t tan_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1077999148u, 2506787616u, 1090024059u, 3619148316u, 3219622610u, 2608738099u, 0, TAN_TOLERANCE, 0}, +{ 2, 3218153654u, 3176730980u, 1051524793u, 2993920299u, 3218181243u, 1709798879u, 0, TAN_TOLERANCE, 0}, +{ 3, 3239659803u, 2725707538u, 3232101343u, 2346810316u, 3217920385u, 4213448196u, 0, TAN_TOLERANCE, 0}, +{ 4, 1092554362u, 2088062470u, 3201242716u, 420891118u, 3219436383u, 1559440912u, 0, TAN_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 1073914339u, 2222366620u, 0, TAN_TOLERANCE, 0}, +{ 6, 1089363191u, 1746012320u, 1054478713u, 3333988501u, 3220605628u, 1031861671u, 0, TAN_TOLERANCE, 0}, +{ 7, 1047953160u, 183014794u, 3202039382u, 2016785810u, 1047953160u, 183014809u, 0, TAN_TOLERANCE, 0}, +{ 8, 3213486034u, 2688957927u, 1046089230u, 2709029994u, 3213486125u, 771400820u, 0, TAN_TOLERANCE, 0}, +{ 9, 1058795730u, 624574473u, 1045840574u, 3473266330u, 1058795730u, 654356267u, 0, TAN_TOLERANCE, 0}, +{ 10, 3204919842u, 1605286142u, 1068931671u, 4233776869u, 3204919842u, 1609546135u, 0, TAN_TOLERANCE, 0}, +{ 11, 1060343410u, 1857607719u, 3222889559u, 3417070006u, 1060343410u, 2020998544u, 0, TAN_TOLERANCE, 0}, +{ 12, 1103599987u, 3981151660u, 1088899021u, 1332651746u, 3221582538u, 16706636u, 0, TAN_TOLERANCE, 0}, +{ 13, 1085298022u, 3824988054u, 1066856791u, 2070129652u, 3215830604u, 3502545545u, 0, TAN_TOLERANCE, 0}, +{ 14, 3207559790u, 1372884064u, 1080833116u, 3229926662u, 3207559790u, 1543229406u, 0, TAN_TOLERANCE, 0}, +{ 15, 1093826501u, 3217805330u, 3191644264u, 2014578707u, 3222635354u, 3054668406u, 0, TAN_TOLERANCE, 0}, +{ 16, 1102287487u, 265058758u, 3239903247u, 1630600647u, 3214602649u, 265563968u, 0, TAN_TOLERANCE, 0}, +{ 17, 1071124229u, 1946677669u, 3198462609u, 926009897u, 1071202952u, 1724614277u, 0, TAN_TOLERANCE, 0}, +{ 18, 1072130299u, 2271884183u, 3203741999u, 2118617783u, 1072478793u, 3812297738u, 0, TAN_TOLERANCE, 0}, +{ 19, 3194849109u, 213658772u, 3249401130u, 314151656u, 3194849109u, 213658780u, 0, TAN_TOLERANCE, 0}, +{ 20, 3254112288u, 1564829925u, 3197817016u, 497230814u, 3219908120u, 4282371679u, 0, TAN_TOLERANCE, 0}, +{ 21, 3216262634u, 2075329122u, 3231746400u, 169900577u, 3216265418u, 3766984913u, 0, TAN_TOLERANCE, 0}, +{ 22, 1049848642u, 541549344u, 1096608669u, 3119070100u, 1049848642u, 541549497u, 0, TAN_TOLERANCE, 0}, +{ 23, 1085427055u, 567496114u, 1045286891u, 1969998540u, 1074735168u, 195000017u, 0, TAN_TOLERANCE, 0}, +{ 24, 1060548195u, 1299369769u, 1049342524u, 4167404066u, 1060548195u, 1554262199u, 0, TAN_TOLERANCE, 0}, +{ 25, 3208865645u, 3348930841u, 1078472138u, 358457347u, 3208865645u, 3987332184u, 0, TAN_TOLERANCE, 0}, +{ 26, 1071069297u, 2192461366u, 1099527247u, 3184735642u, 1071139786u, 997312598u, 0, TAN_TOLERANCE, 0}, +{ 27, 1052861772u, 331696577u, 3189610016u, 793242270u, 1052861772u, 331703596u, 0, TAN_TOLERANCE, 0}, +{ 28, 3252528934u, 2322696981u, 1083791358u, 3020766674u, 1071988465u, 2823307452u, 0, TAN_TOLERANCE, 0}, +{ 29, 1044902177u, 252085215u, 3214426435u, 4139068910u, 1044902177u, 252085215u, 0, TAN_TOLERANCE, 0}, +{ 30, 3222505725u, 105589263u, 1056316170u, 261630827u, 1075256347u, 888317792u, 0, TAN_TOLERANCE, 0}, +{ 31, 1107213408u, 428765703u, 3251828686u, 2009972239u, 1072804855u, 3093920736u, 0, TAN_TOLERANCE, 0}, +{ 32, 1098568019u, 3517376586u, 3240257920u, 3304487302u, 1073171249u, 1991641065u, 0, TAN_TOLERANCE, 0}, +{ 33, 3233537912u, 237004814u, 3237899261u, 3364008659u, 3220482895u, 2812950573u, 0, TAN_TOLERANCE, 0}, +{ 34, 3195247552u, 472004928u, 3226869477u, 1186387580u, 3195247552u, 472004938u, 0, TAN_TOLERANCE, 0}, +{ 35, 1054226850u, 4085763910u, 1106394906u, 2684738273u, 1054226850u, 4085822461u, 0, TAN_TOLERANCE, 0}, +{ 36, 1057053639u, 2055490142u, 3231581370u, 3879040079u, 1057053639u, 2057275463u, 0, TAN_TOLERANCE, 0}, +{ 37, 3188976647u, 3725731239u, 1061652681u, 591292963u, 3188976647u, 3725731239u, 0, TAN_TOLERANCE, 0}, +{ 38, 3225014981u, 1147041027u, 3215417793u, 624695933u, 3219812649u, 3561661677u, 0, TAN_TOLERANCE, 0}, +{ 39, 3206052774u, 705725219u, 3238067573u, 1116238321u, 3206052774u, 725762224u, 0, TAN_TOLERANCE, 0}, +{ 40, 3207367088u, 7287411u, 1045917232u, 116067742u, 3207367088u, 134216766u, 0, TAN_TOLERANCE, 0}, +{ 41, 3240055222u, 3604989074u, 1066381836u, 545298780u, 1076058842u, 2692959828u, 0, TAN_TOLERANCE, 0}, +{ 42, 3219080936u, 1681476121u, 1060345752u, 3553822398u, 3219194848u, 942221257u, 0, TAN_TOLERANCE, 0}, +{ 43, 1102831658u, 3410480388u, 1052460275u, 1660607230u, 3214525015u, 4241725003u, 0, TAN_TOLERANCE, 0}, +{ 44, 1089216869u, 1494984673u, 3196647153u, 287894723u, 1072160929u, 2549431126u, 0, TAN_TOLERANCE, 0}, +{ 45, 1054885127u, 644548665u, 1081948134u, 2442134629u, 1054885127u, 644640539u, 0, TAN_TOLERANCE, 0}, +{ 46, 1087554095u, 2312530895u, 3221584595u, 3379665576u, 1073452942u, 1180851169u, 0, TAN_TOLERANCE, 0}, +{ 47, 1096085375u, 3018463866u, 1086226574u, 404012923u, 1068538907u, 1719554741u, 0, TAN_TOLERANCE, 0}, +{ 48, 1064733299u, 1710279345u, 3251401196u, 3528946000u, 1064733314u, 1334898870u, 0, TAN_TOLERANCE, 0}, +{ 49, 1061536351u, 2164450219u, 1083520023u, 3312018966u, 1061536351u, 3064676513u, 0, TAN_TOLERANCE, 0}, +{ 50, 1057248676u, 2648986431u, 1050330591u, 1474376550u, 1057248676u, 2651856431u, 0, TAN_TOLERANCE, 0}, +{ 51, 3194422028u, 1839068700u, 1077406406u, 3013052171u, 3194422028u, 1839068704u, 0, TAN_TOLERANCE, 0}, +{ 52, 1046493630u, 772102380u, 3220729740u, 4219039958u, 1046493630u, 772102381u, 0, TAN_TOLERANCE, 0}, +{ 53, 3229472221u, 3058618779u, 1046304788u, 3338676024u, 1069813597u, 724043670u, 0, TAN_TOLERANCE, 0}, +{ 54, 1051172137u, 506286854u, 1094907481u, 2217000199u, 1051172137u, 506287951u, 0, TAN_TOLERANCE, 0}, +{ 55, 1082428310u, 1147428263u, 1065432625u, 3034786717u, 1072851643u, 3329730330u, 0, TAN_TOLERANCE, 0}, +{ 56, 1082016752u, 2844125311u, 1082985198u, 2561492677u, 1071527175u, 434342087u, 0, TAN_TOLERANCE, 0}, +{ 57, 3211536916u, 704542600u, 3222902057u, 2762779203u, 3211536923u, 1874722944u, 0, TAN_TOLERANCE, 0}, +{ 58, 3199680614u, 184131949u, 3249723525u, 1667366082u, 3199680614u, 184136139u, 0, TAN_TOLERANCE, 0}, +{ 59, 3223609598u, 3904224140u, 1067056698u, 2942159914u, 3220091696u, 2663063840u, 0, TAN_TOLERANCE, 0}, +{ 60, 1100636863u, 426114282u, 3209056785u, 1083606355u, 3220312233u, 624814402u, 0, TAN_TOLERANCE, 0}, +{ 61, 1106165945u, 3774123863u, 1106787580u, 2722107965u, 1070796578u, 534470147u, 0, TAN_TOLERANCE, 0}, +{ 62, 1088005092u, 1377734762u, 1104232051u, 2377063483u, 1074430559u, 547495352u, 0, TAN_TOLERANCE, 0}, +{ 63, 1069380559u, 1029739074u, 1105467109u, 3062201018u, 1069389120u, 2814662813u, 0, TAN_TOLERANCE, 0}, +{ 64, 3234741597u, 773857656u, 3214251949u, 335833884u, 3220624065u, 680339648u, 0, TAN_TOLERANCE, 0}, +{ 65, 3203224610u, 1473865960u, 1103073830u, 4000427507u, 3203224610u, 1474404149u, 0, TAN_TOLERANCE, 0}, +{ 66, 1103185231u, 4242092620u, 1067009473u, 14539161u, 3220426242u, 3000196541u, 0, TAN_TOLERANCE, 0}, +{ 67, 3192516074u, 1732245037u, 1101371955u, 1533536108u, 3192516074u, 1732245037u, 0, TAN_TOLERANCE, 0}, +{ 68, 3249153995u, 1833841275u, 1099430098u, 4144145552u, 3222141451u, 2395515507u, 0, TAN_TOLERANCE, 0}, +{ 69, 3244270463u, 935007012u, 3188865420u, 604442938u, 1075422778u, 489932060u, 0, TAN_TOLERANCE, 0}, +{ 70, 3206903253u, 2211464602u, 1046255144u, 1635910526u, 3206903253u, 2265441187u, 0, TAN_TOLERANCE, 0}, +{ 71, 1077871417u, 2549219008u, 3231633258u, 3733639385u, 3218820973u, 826451768u, 0, TAN_TOLERANCE, 0}, +{ 72, 1082095089u, 1819374372u, 3202219056u, 2617077637u, 1072422924u, 2528742585u, 0, TAN_TOLERANCE, 0}, +{ 73, 1094345280u, 546465680u, 1048653554u, 532401530u, 3219190284u, 751670473u, 0, TAN_TOLERANCE, 0}, +{ 74, 1044571091u, 2759019783u, 3221570188u, 3554409630u, 1044571091u, 2759019783u, 0, TAN_TOLERANCE, 0}, +{ 75, 3212931282u, 2527221960u, 1099107978u, 2696971136u, 3212931310u, 944427847u, 0, TAN_TOLERANCE, 0}, +{ 76, 1097158000u, 173134582u, 1087299442u, 2877794600u, 3221389719u, 1587380563u, 0, TAN_TOLERANCE, 0}, +{ 77, 1086400474u, 547642046u, 3197285510u, 3521286127u, 3217586653u, 3675080684u, 0, TAN_TOLERANCE, 0}, +{ 78, 1074860702u, 1231582831u, 1090971734u, 1653446832u, 1073794854u, 3729772102u, 0, TAN_TOLERANCE, 0}, +{ 79, 1061342535u, 3762182190u, 3252967851u, 2615360375u, 1061342536u, 48009287u, 0, TAN_TOLERANCE, 0}, +{ 80, 3200834423u, 2588067350u, 3206610957u, 3551059728u, 3200834423u, 2588087829u, 0, TAN_TOLERANCE, 0}, +{ 81, 3206978856u, 845263327u, 1073415902u, 1749010288u, 3206978856u, 908420805u, 0, TAN_TOLERANCE, 0}, +{ 82, 3205576370u, 3092685191u, 3190678390u, 2872219490u, 3205576370u, 3099649190u, 0, TAN_TOLERANCE, 0}, +{ 83, 3218315055u, 4107255722u, 3205337291u, 3069068345u, 3218356717u, 3205080738u, 0, TAN_TOLERANCE, 0}, +{ 84, 3243990857u, 2294867524u, 3216653996u, 2860384670u, 1075937062u, 441605080u, 0, TAN_TOLERANCE, 0}, +{ 85, 3193326350u, 2265437201u, 3240198679u, 1234948614u, 3193326350u, 2265437202u, 0, TAN_TOLERANCE, 0}, +{ 86, 3216359929u, 1186945904u, 3251167793u, 1896750851u, 3216363372u, 2480044998u, 0, TAN_TOLERANCE, 0}, +{ 87, 1081575478u, 3686084548u, 1079286273u, 3309277689u, 3219165487u, 3935712921u, 0, TAN_TOLERANCE, 0}, +{ 88, 3223476240u, 3006860614u, 3231412671u, 2504194724u, 1070630910u, 4230325485u, 0, TAN_TOLERANCE, 0}, +{ 89, 3236149260u, 1948717780u, 1048317852u, 3791803982u, 1072688994u, 3729051438u, 0, TAN_TOLERANCE, 0}, +{ 90, 1064345015u, 4272034420u, 3192982124u, 1526175922u, 1064345021u, 4158169529u, 0, TAN_TOLERANCE, 0}, +{ 91, 3245817826u, 4108948538u, 1104691287u, 640541190u, 1074813212u, 3505437405u, 0, TAN_TOLERANCE, 0}, +{ 92, 3207257417u, 3259274853u, 1082507103u, 3677038020u, 3207257417u, 3365158881u, 0, TAN_TOLERANCE, 0}, +{ 93, 1083132498u, 3781708548u, 1096584871u, 1207386447u, 3220390531u, 2314747582u, 0, TAN_TOLERANCE, 0}, +{ 94, 3188695272u, 3011191657u, 1103798670u, 1096124830u, 3188695272u, 3011191657u, 0, TAN_TOLERANCE, 0}, +{ 95, 1063235023u, 2540404725u, 3240157452u, 4122845725u, 1063235026u, 767486541u, 0, TAN_TOLERANCE, 0}, +{ 96, 1083643710u, 311336721u, 3214382367u, 4212533768u, 1074337179u, 3867090367u, 0, TAN_TOLERANCE, 0}, +{ 97, 1051139427u, 1769686293u, 3240200923u, 3538602249u, 1051139427u, 1769687322u, 0, TAN_TOLERANCE, 0}, +{ 98, 1078227549u, 508056696u, 1103793878u, 776520138u, 1068173843u, 4073142280u, 0, TAN_TOLERANCE, 0}, +{ 99, 1102910577u, 4064962760u, 1077424413u, 819766631u, 1070476795u, 2500532800u, 0, TAN_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 3218369918u, 296208356u, 0, TAN_TOLERANCE, 0}, +{ 101, 1082295059u, 2514398118u, 1076579751u, 870169764u, 3222557284u, 3821041880u, 0, TAN_TOLERANCE, 0}, +{ 102, 3246851392u, 1190259653u, 1069112254u, 3417249840u, 1073944628u, 1508796918u, 0, TAN_TOLERANCE, 0}, +{ 103, 3193663083u, 3467757357u, 3215075200u, 2168175352u, 3193663083u, 3467757359u, 0, TAN_TOLERANCE, 0}, +{ 104, 3239643135u, 1508888184u, 1060430241u, 3524949092u, 1073664477u, 2627356099u, 0, TAN_TOLERANCE, 0}, +{ 105, 3197412883u, 166402802u, 3237198975u, 3572369260u, 3197412883u, 166402985u, 0, TAN_TOLERANCE, 0}, +{ 106, 1081866822u, 2441536203u, 3202753937u, 3658194573u, 1077725529u, 4095469556u, 0, TAN_TOLERANCE, 0}, +{ 107, 1062392908u, 2479742828u, 1062342831u, 4214154303u, 1062392909u, 518131303u, 0, TAN_TOLERANCE, 0}, +{ 108, 1082396794u, 426896765u, 1066474375u, 2201754442u, 1073946989u, 1842153396u, 0, TAN_TOLERANCE, 0}, +{ 109, 3195629021u, 2055773734u, 3239267288u, 291396537u, 3195629021u, 2055773755u, 0, TAN_TOLERANCE, 0}, +{ 110, 3236968033u, 874125203u, 3210508124u, 4091098764u, 1072994339u, 2120920512u, 0, TAN_TOLERANCE, 0}, +{ 111, 1065716026u, 120488169u, 3241241441u, 1985269424u, 1065716078u, 229684732u, 0, TAN_TOLERANCE, 0}, +{ 112, 3206539410u, 2243036871u, 3243941101u, 740033495u, 3206539410u, 2287393372u, 0, TAN_TOLERANCE, 0}, +{ 113, 3209424906u, 1176656356u, 1074261978u, 3588756231u, 3209424906u, 3082067610u, 0, TAN_TOLERANCE, 0}, +{ 114, 3252816791u, 3037249392u, 1061635587u, 1173102190u, 3220656564u, 3604743680u, 0, TAN_TOLERANCE, 0}, +{ 115, 3237209581u, 2882725208u, 1071440059u, 69225090u, 3219270037u, 1144805256u, 0, TAN_TOLERANCE, 0}, +{ 116, 3212663474u, 272319256u, 1072073912u, 2493997123u, 3212663506u, 4289517860u, 0, TAN_TOLERANCE, 0}, +{ 117, 1057720186u, 188610379u, 3232757923u, 2209647371u, 1057720186u, 195731687u, 0, TAN_TOLERANCE, 0}, +{ 118, 3236758517u, 1990439193u, 1078073146u, 622849962u, 3219034996u, 3232269414u, 0, TAN_TOLERANCE, 0}, +{ 119, 1057135741u, 756052458u, 1081649113u, 2247475162u, 1057135741u, 758252889u, 0, TAN_TOLERANCE, 0}, +{ 120, 1061623064u, 3878055211u, 3222407050u, 2979438623u, 1061623065u, 657726119u, 0, TAN_TOLERANCE, 0}, +{ 121, 3195290997u, 2676398686u, 1105124431u, 3631096636u, 3195290997u, 2676398697u, 0, TAN_TOLERANCE, 0}, +{ 122, 1065079390u, 1697791764u, 3198136112u, 2299842819u, 1065079418u, 1875760833u, 0, TAN_TOLERANCE, 0}, +{ 123, 1078084768u, 1931502677u, 3215264397u, 3016456382u, 3221390371u, 1549517714u, 0, TAN_TOLERANCE, 0}, +{ 124, 1072253426u, 343404215u, 1061072607u, 4266232536u, 1072703528u, 4239724827u, 0, TAN_TOLERANCE, 0}, +{ 125, 3241230836u, 4140316002u, 1082896196u, 868256971u, 1077239637u, 3288074299u, 0, TAN_TOLERANCE, 0}, +{ 126, 1075422810u, 1864139509u, 3187675097u, 3084482407u, 1069589412u, 935845071u, 0, TAN_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 3220811887u, 3230843823u, 0, TAN_TOLERANCE, 0}, +{ 128, 1064600512u, 3943389284u, 1046724025u, 3626825684u, 1064600524u, 686990573u, 0, TAN_TOLERANCE, 0}, +{ 129, 1045423002u, 967350972u, 1093012318u, 448002663u, 1045423002u, 967350973u, 0, TAN_TOLERANCE, 0}, +{ 130, 3251845859u, 105058217u, 1069733884u, 171786224u, 3221748718u, 3998156706u, 0, TAN_TOLERANCE, 0}, +{ 131, 3189614508u, 2863482262u, 3204997271u, 877784425u, 3189614508u, 2863482262u, 0, TAN_TOLERANCE, 0}, +{ 132, 3202629313u, 2801782962u, 3213604117u, 762347195u, 3202629313u, 2801959982u, 0, TAN_TOLERANCE, 0}, +{ 133, 3233486727u, 2317950339u, 3246333414u, 2135700283u, 1073741711u, 1100714238u, 0, TAN_TOLERANCE, 0}, +{ 134, 1056516397u, 4171919805u, 1082858682u, 2180920863u, 1056516397u, 4173279042u, 0, TAN_TOLERANCE, 0}, +{ 135, 3220149084u, 1918836931u, 1083603224u, 3137821660u, 3220714707u, 436652046u, 0, TAN_TOLERANCE, 0}, +{ 136, 1103902874u, 3456203663u, 3235600523u, 2335688936u, 1070111728u, 3070150721u, 0, TAN_TOLERANCE, 0}, +{ 137, 1042279322u, 4170235262u, 1051824459u, 521583737u, 1042279322u, 4170235262u, 0, TAN_TOLERANCE, 0}, +{ 138, 1081348303u, 1296623194u, 3250673860u, 2442872540u, 1072056099u, 878147212u, 0, TAN_TOLERANCE, 0}, +{ 139, 1061684277u, 289979405u, 1049514449u, 3865737145u, 1061684277u, 1500422480u, 0, TAN_TOLERANCE, 0}, +{ 140, 1075298944u, 3699090239u, 1054539840u, 3259249360u, 3218530158u, 2204023492u, 0, TAN_TOLERANCE, 0}, +{ 141, 1096418100u, 1619819023u, 1045993352u, 1022642459u, 1072486591u, 200878280u, 0, TAN_TOLERANCE, 0}, +{ 142, 1081433004u, 19455098u, 3229182089u, 2096003654u, 3219860921u, 2802078233u, 0, TAN_TOLERANCE, 0}, +{ 143, 1076297936u, 3803689997u, 1071630912u, 2263729518u, 3221020563u, 3741955633u, 0, TAN_TOLERANCE, 0}, +{ 144, 1101357261u, 2816837387u, 1063422305u, 2597606398u, 3225913854u, 4017082295u, 0, TAN_TOLERANCE, 0}, +{ 145, 1069100169u, 3680967506u, 1040201163u, 179224723u, 1069105508u, 1440893395u, 0, TAN_TOLERANCE, 0}, +{ 146, 3188629767u, 978126928u, 1101553990u, 4047893399u, 3188629767u, 978126928u, 0, TAN_TOLERANCE, 0}, +{ 147, 3222322045u, 4059818629u, 1042678728u, 3640293589u, 3220920863u, 1658556398u, 0, TAN_TOLERANCE, 0}, +{ 148, 3248464040u, 3383497159u, 1070002807u, 1527313008u, 3218096293u, 3040100589u, 0, TAN_TOLERANCE, 0}, +{ 149, 3202707679u, 2599946514u, 1104170406u, 2738675352u, 3202707679u, 2600156789u, 0, TAN_TOLERANCE, 0}, +{ 150, 1105232623u, 3616571377u, 1060859316u, 1130603218u, 1072709115u, 3670033279u, 0, TAN_TOLERANCE, 0}, +{ 151, 1076028796u, 3859211180u, 1067940450u, 1744531824u, 1066926573u, 3567718329u, 0, TAN_TOLERANCE, 0}, +{ 152, 1042831340u, 1958025850u, 3236511256u, 2472176453u, 1042831340u, 1958025850u, 0, TAN_TOLERANCE, 0}, +{ 153, 3233107089u, 182132862u, 3250520938u, 3924356991u, 1074211406u, 1409850566u, 0, TAN_TOLERANCE, 0}, +{ 154, 3230501884u, 35632886u, 3209806504u, 1453402523u, 1069496128u, 1029233379u, 0, TAN_TOLERANCE, 0}, +{ 155, 1083522102u, 743225214u, 3202890678u, 142917400u, 3221790920u, 331029792u, 0, TAN_TOLERANCE, 0}, +{ 156, 1080684976u, 1472665012u, 3203138231u, 256588219u, 1070266411u, 390048846u, 0, TAN_TOLERANCE, 0}, +{ 157, 1094982162u, 1062927000u, 1061134072u, 931677439u, 1072398089u, 826365235u, 0, TAN_TOLERANCE, 0}, +{ 158, 1058377732u, 2320910576u, 1055663370u, 288059864u, 1058377732u, 2334598583u, 0, TAN_TOLERANCE, 0}, +{ 159, 1078958093u, 1448349062u, 3199478070u, 3454027134u, 1071107400u, 206034543u, 0, TAN_TOLERANCE, 0}, +{ 160, 3237458798u, 4215445172u, 3196654963u, 2231888973u, 3219458995u, 3819290632u, 0, TAN_TOLERANCE, 0}, +{ 161, 3246632231u, 40413554u, 3232578253u, 983832844u, 3220432216u, 2842337330u, 0, TAN_TOLERANCE, 0}, +{ 162, 3223721534u, 3995725873u, 1050082319u, 777231627u, 1077206840u, 461276196u, 0, TAN_TOLERANCE, 0}, +{ 163, 1040986626u, 672789828u, 3253385962u, 2982787335u, 1040986626u, 672789828u, 0, TAN_TOLERANCE, 0}, +{ 164, 1068390875u, 2075971825u, 1070166500u, 4034633931u, 1068393208u, 2863853979u, 0, TAN_TOLERANCE, 0}, +{ 165, 3210046177u, 1018222907u, 3244621407u, 3090050495u, 3210046178u, 157136623u, 0, TAN_TOLERANCE, 0}, +{ 166, 1067680885u, 937732557u, 3200798890u, 2557898276u, 1067681505u, 608928501u, 0, TAN_TOLERANCE, 0}, +{ 167, 1078342316u, 130346162u, 3223590310u, 275568693u, 1071388364u, 1761655737u, 0, TAN_TOLERANCE, 0}, +{ 168, 1042898869u, 3807416441u, 1075961161u, 3706820266u, 1042898869u, 3807416441u, 0, TAN_TOLERANCE, 0}, +{ 169, 3216099005u, 1710131411u, 1078123323u, 1900790503u, 3216100881u, 1904744752u, 0, TAN_TOLERANCE, 0}, +{ 170, 3238819361u, 3420420033u, 3210844787u, 588423066u, 1070338117u, 444441192u, 0, TAN_TOLERANCE, 0}, +{ 171, 1049684114u, 1160162008u, 3246307879u, 4265764460u, 1049684114u, 1160162109u, 0, TAN_TOLERANCE, 0}, +{ 172, 1102543434u, 366653268u, 3188814424u, 466059202u, 3219690076u, 1152439596u, 0, TAN_TOLERANCE, 0}, +{ 173, 3226627739u, 1325936170u, 3221436876u, 680097612u, 3223591027u, 807326226u, 0, TAN_TOLERANCE, 0}, +{ 174, 3240391116u, 1827735934u, 3200554324u, 2875599271u, 3218949458u, 1564630365u, 0, TAN_TOLERANCE, 0}, +{ 175, 3191030402u, 3117037091u, 3239246636u, 15838845u, 3191030402u, 3117037091u, 0, TAN_TOLERANCE, 0}, +{ 176, 1051974004u, 749718883u, 3223587064u, 1523766569u, 1051974004u, 749721490u, 0, TAN_TOLERANCE, 0}, +{ 177, 1044833651u, 1966536294u, 3250158026u, 699164258u, 1044833651u, 1966536294u, 0, TAN_TOLERANCE, 0}, +{ 178, 1098048435u, 3759049394u, 1106085272u, 1183789499u, 1067725226u, 3300256125u, 0, TAN_TOLERANCE, 0}, +{ 179, 1081201623u, 1970107747u, 1095245453u, 2308233883u, 3219656964u, 1762316068u, 0, TAN_TOLERANCE, 0}, +{ 180, 1084756444u, 1491017852u, 1041444355u, 1723375725u, 3220665076u, 1131376736u, 0, TAN_TOLERANCE, 0}, +{ 181, 3216630070u, 1141349287u, 1097465301u, 3403438584u, 3216635871u, 3114581228u, 0, TAN_TOLERANCE, 0}, +{ 182, 3230571908u, 1711085243u, 3250239076u, 1377484108u, 1071707322u, 2074334604u, 0, TAN_TOLERANCE, 0}, +{ 183, 1098385019u, 2880275004u, 1084039594u, 1611394950u, 1072183089u, 1081655096u, 0, TAN_TOLERANCE, 0}, +{ 184, 3234221435u, 2626629370u, 1063771493u, 1499080813u, 1072448767u, 2519934791u, 0, TAN_TOLERANCE, 0}, +{ 185, 1055231263u, 3936262414u, 1103919063u, 3175668759u, 1055231263u, 3936475953u, 0, TAN_TOLERANCE, 0}, +{ 186, 3207981719u, 1270950554u, 3194616071u, 3680565379u, 3207981719u, 1500917084u, 0, TAN_TOLERANCE, 0}, +{ 187, 3208148223u, 1066985223u, 3221613219u, 4089383168u, 3208148223u, 1386557653u, 0, TAN_TOLERANCE, 0}, +{ 188, 3217058839u, 4017329311u, 3208334452u, 1667591498u, 3217064784u, 1269168733u, 0, TAN_TOLERANCE, 0}, +{ 189, 1088164157u, 3154656624u, 1061894279u, 3886344038u, 3223527257u, 636902076u, 0, TAN_TOLERANCE, 0}, +{ 190, 1050652945u, 977586119u, 3209762784u, 953839852u, 1050652945u, 977586782u, 0, TAN_TOLERANCE, 0}, +{ 191, 1104965247u, 143071571u, 3206165386u, 913097445u, 1083267508u, 670608201u, 0, TAN_TOLERANCE, 0}, +{ 192, 3190565456u, 1371169579u, 1057079837u, 2594818628u, 3190565456u, 1371169579u, 0, TAN_TOLERANCE, 0}, +{ 193, 3251793336u, 2259342224u, 3217432469u, 1824221478u, 1074871369u, 1846053325u, 0, TAN_TOLERANCE, 0}, +{ 194, 3246834775u, 1576604497u, 1079368611u, 185078728u, 3219323765u, 1214264042u, 0, TAN_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 1070734297u, 3140344392u, 0, TAN_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1073485690u, 2052392104u, 0, TAN_TOLERANCE, 0}, +{ 197, 3234695968u, 1941318385u, 1045807374u, 792193370u, 1071783226u, 3456402802u, 0, TAN_TOLERANCE, 0}, +{ 198, 3238299666u, 1299392207u, 3212131720u, 3205732280u, 1070843456u, 2640216013u, 0, TAN_TOLERANCE, 0}, +{ 199, 1098698804u, 3035093505u, 1052187689u, 3287702190u, 1072848938u, 3118895016u, 0, TAN_TOLERANCE, 0}, +{ 200, 3246676260u, 2160225215u, 1102624859u, 836655570u, 3216151840u, 2826603821u, 0, TAN_TOLERANCE, 0}, +{ 201, 1096723626u, 3360816360u, 3246176356u, 172860634u, 3223468834u, 2557955513u, 0, TAN_TOLERANCE, 0}, +{ 202, 1070995788u, 146831910u, 1051558014u, 2340722078u, 1071056230u, 1074959791u, 0, TAN_TOLERANCE, 0}, +{ 203, 3230416351u, 1603798153u, 3207725532u, 1099413093u, 1073450075u, 3789585571u, 0, TAN_TOLERANCE, 0}, +{ 204, 3246678378u, 2429340443u, 3190303581u, 3223770005u, 3222436475u, 2331667549u, 0, TAN_TOLERANCE, 0}, +{ 205, 1075882959u, 955542166u, 3230415151u, 275583938u, 3221134682u, 869863979u, 0, TAN_TOLERANCE, 0}, +{ 206, 1092971882u, 513397822u, 1090646554u, 2089321329u, 3218476915u, 4064660800u, 0, TAN_TOLERANCE, 0}, +{ 207, 3193169876u, 2782073372u, 1046063872u, 4023829068u, 3193169876u, 2782073373u, 0, TAN_TOLERANCE, 0}, +{ 208, 1098564822u, 3242223094u, 3194111199u, 4264674108u, 3219655919u, 2882209966u, 0, TAN_TOLERANCE, 0}, +{ 209, 3238510821u, 3506346169u, 1047020885u, 1742757458u, 1077178631u, 1129955170u, 0, TAN_TOLERANCE, 0}, +{ 210, 3192664477u, 1265459564u, 3193450280u, 3650514880u, 3192664477u, 1265459564u, 0, TAN_TOLERANCE, 0}, +{ 211, 1081755890u, 1525260440u, 3235452527u, 2612331392u, 3218875360u, 584541142u, 0, TAN_TOLERANCE, 0}, +{ 212, 3248668920u, 1263613754u, 3219096387u, 635677201u, 3228095705u, 607239893u, 0, TAN_TOLERANCE, 0}, +{ 213, 3206272087u, 4140947288u, 3200792376u, 2013265346u, 3206272087u, 4170374788u, 0, TAN_TOLERANCE, 0}, +{ 214, 3249974392u, 1912759945u, 3237045253u, 1351396825u, 1073520127u, 4107509282u, 0, TAN_TOLERANCE, 0}, +{ 215, 3248205162u, 1001433078u, 3206926643u, 2741676659u, 3223698549u, 697659170u, 0, TAN_TOLERANCE, 0}, +{ 216, 1080923606u, 1088945233u, 1085095743u, 3986114865u, 1073528810u, 2355327902u, 0, TAN_TOLERANCE, 0}, +{ 217, 3215734057u, 831239754u, 1099828675u, 3071308141u, 3215735929u, 3454732211u, 0, TAN_TOLERANCE, 0}, +{ 218, 3225834497u, 3473592372u, 1102759382u, 1309576357u, 3219754946u, 1779658178u, 0, TAN_TOLERANCE, 0}, +{ 219, 3251186706u, 2042340367u, 1091945628u, 2062772374u, 3221848449u, 173695336u, 0, TAN_TOLERANCE, 0}, +{ 220, 3194765687u, 1840632537u, 1096533424u, 807510337u, 3194765687u, 1840632544u, 0, TAN_TOLERANCE, 0}, +{ 221, 3231451722u, 144814872u, 3212698915u, 2282965697u, 3219929851u, 2085937887u, 0, TAN_TOLERANCE, 0}, +{ 222, 1071236430u, 2552499583u, 3229111426u, 1470130815u, 1071334047u, 1224989201u, 0, TAN_TOLERANCE, 0}, +{ 223, 3243093065u, 2858583811u, 1089760910u, 6360994u, 3222355264u, 4036068405u, 0, TAN_TOLERANCE, 0}, +{ 224, 3198264929u, 1614537194u, 1075198900u, 4088705365u, 3198264929u, 1614537652u, 0, TAN_TOLERANCE, 0}, +{ 225, 3250939070u, 3545570051u, 1065221325u, 1629217700u, 3218583691u, 3771335620u, 0, TAN_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1073467220u, 1680674110u, 0, TAN_TOLERANCE, 0}, +{ 227, 3196802686u, 2406734491u, 1042055360u, 89226663u, 3196802686u, 2406734597u, 0, TAN_TOLERANCE, 0}, +{ 228, 3195751081u, 1618759139u, 3194723421u, 3888234802u, 3195751081u, 1618759165u, 0, TAN_TOLERANCE, 0}, +{ 229, 1055357248u, 3590035633u, 3212424262u, 2892456615u, 1055357248u, 3590311564u, 0, TAN_TOLERANCE, 0}, +{ 230, 3189943060u, 2431246964u, 3241512456u, 183850734u, 3189943060u, 2431246964u, 0, TAN_TOLERANCE, 0}, +{ 231, 1089501101u, 3088319870u, 3211544311u, 862225364u, 1072870485u, 1064431288u, 0, TAN_TOLERANCE, 0}, +{ 232, 3235294664u, 3495352775u, 1058576726u, 596957268u, 3219184426u, 1290282712u, 0, TAN_TOLERANCE, 0}, +{ 233, 1046553348u, 1839214511u, 3205004060u, 1923240983u, 1046553348u, 1839214513u, 0, TAN_TOLERANCE, 0}, +{ 234, 1058073864u, 739619702u, 3223356436u, 2689885273u, 1058073864u, 746240258u, 0, TAN_TOLERANCE, 0}, +{ 235, 3200324971u, 2143376228u, 1098306332u, 3760236188u, 3200324971u, 2143382876u, 0, TAN_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1071844140u, 2465670249u, 0, TAN_TOLERANCE, 0}, +{ 237, 3214165989u, 2493598049u, 3194927008u, 1689107592u, 3214166163u, 1695445981u, 0, TAN_TOLERANCE, 0}, +{ 238, 3189989959u, 1578976988u, 1066368383u, 2117279163u, 3189989959u, 1578976988u, 0, TAN_TOLERANCE, 0}, +{ 239, 3222988111u, 3425290087u, 1098487295u, 1263412017u, 3219009618u, 3104355163u, 0, TAN_TOLERANCE, 0}, +{ 240, 3208432764u, 3635396812u, 1070999426u, 3965655689u, 3208432764u, 4157169065u, 0, TAN_TOLERANCE, 0}, +{ 241, 1060196346u, 2183973116u, 1101098363u, 1118613350u, 1060196346u, 2297325783u, 0, TAN_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 3217972188u, 183700192u, 0, TAN_TOLERANCE, 0}, +{ 243, 3187706018u, 3570940805u, 3230316437u, 3596080877u, 3187706018u, 3570940805u, 0, TAN_TOLERANCE, 0}, +{ 244, 3208209565u, 980880313u, 1079833442u, 884465057u, 3208209565u, 1338566342u, 0, TAN_TOLERANCE, 0}, +{ 245, 1099977124u, 2558179220u, 1052873711u, 1233598120u, 1073082635u, 1345485298u, 0, TAN_TOLERANCE, 0}, +{ 246, 1047115221u, 1909994277u, 1085015978u, 2991527452u, 1047115221u, 1909994283u, 0, TAN_TOLERANCE, 0}, +{ 247, 1060855260u, 1680290941u, 1074309900u, 2943870846u, 1060855260u, 2128028309u, 0, TAN_TOLERANCE, 0}, +{ 248, 1059496132u, 1451927357u, 3228615456u, 1502585517u, 1059496132u, 1515203058u, 0, TAN_TOLERANCE, 0}, +{ 249, 3236211951u, 751136990u, 3230392165u, 3493275472u, 3221130863u, 2790236806u, 0, TAN_TOLERANCE, 0}, +{ 250, 1098365967u, 1209623292u, 3238056647u, 979495322u, 1071982382u, 3259751257u, 0, TAN_TOLERANCE, 0}, +{ 251, 3250424296u, 1717672108u, 1048120593u, 531240316u, 3217734469u, 151298977u, 0, TAN_TOLERANCE, 0}, +{ 252, 1054174923u, 3548721654u, 1086112947u, 3391817224u, 1054174923u, 3548774163u, 0, TAN_TOLERANCE, 0}, +{ 253, 1077836851u, 2758195125u, 1100880260u, 2028440924u, 3220536570u, 2251016583u, 0, TAN_TOLERANCE, 0}, +{ 254, 1084223893u, 2750123373u, 3232200256u, 1086294931u, 3220157217u, 2263350424u, 0, TAN_TOLERANCE, 0}, +{ 255, 1043958672u, 2986160931u, 1076097908u, 2540046258u, 1043958672u, 2986160931u, 0, TAN_TOLERANCE, 0}, +{ 256, 3235476602u, 451471221u, 1064816262u, 4187644495u, 3216848923u, 3904061022u, 0, TAN_TOLERANCE, 0}, +{ 257, 1099460228u, 2439500162u, 1065280276u, 1979490284u, 3218731225u, 4259537411u, 0, TAN_TOLERANCE, 0}, +{ 258, 1040415832u, 2283342035u, 1078398157u, 1345997553u, 1040415832u, 2283342035u, 0, TAN_TOLERANCE, 0}, +{ 259, 3213249348u, 179066662u, 1103272172u, 1217337578u, 3213249405u, 3247146264u, 0, TAN_TOLERANCE, 0}, +{ 260, 3211562377u, 3779303391u, 3210023352u, 3115946280u, 3211562385u, 1965050538u, 0, TAN_TOLERANCE, 0}, +{ 261, 3192989874u, 286247089u, 1085153597u, 713645369u, 3192989874u, 286247089u, 0, TAN_TOLERANCE, 0}, +{ 262, 1093670500u, 1468283899u, 1042831668u, 2022736418u, 3219948625u, 3229834879u, 0, TAN_TOLERANCE, 0}, +{ 263, 1083139105u, 3305564080u, 1065483445u, 482392433u, 3220193301u, 2415443999u, 0, TAN_TOLERANCE, 0}, +{ 264, 3201695807u, 2256346551u, 3222430705u, 2071674991u, 3201695807u, 2256403348u, 0, TAN_TOLERANCE, 0}, +{ 265, 3204024695u, 2295269094u, 1084451053u, 2773103941u, 3204024695u, 2296690203u, 0, TAN_TOLERANCE, 0}, +{ 266, 1078173946u, 1482721827u, 1092243422u, 3125409590u, 1079271541u, 3804204308u, 0, TAN_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 1074536667u, 3552963698u, 0, TAN_TOLERANCE, 0}, +{ 268, 3238715972u, 1105857967u, 3241990046u, 2703723225u, 3219526778u, 759389017u, 0, TAN_TOLERANCE, 0}, +{ 269, 1043015571u, 174689677u, 1079333374u, 3947057014u, 1043015571u, 174689677u, 0, TAN_TOLERANCE, 0}, +{ 270, 1090461859u, 2023082423u, 3242081486u, 1169047927u, 3217503114u, 3764937440u, 0, TAN_TOLERANCE, 0}, +{ 271, 1064525899u, 3742487766u, 1043425732u, 194972788u, 1064525909u, 1475115964u, 0, TAN_TOLERANCE, 0}, +{ 272, 3213791827u, 2136071361u, 3211529757u, 993675115u, 3213791976u, 1407302382u, 0, TAN_TOLERANCE, 0}, +{ 273, 3213663381u, 210772141u, 3241441539u, 580731413u, 3213663503u, 212614883u, 0, TAN_TOLERANCE, 0}, +{ 274, 1093840413u, 1751560711u, 1074522705u, 180987057u, 3219848371u, 2705574052u, 0, TAN_TOLERANCE, 0}, +{ 275, 1066754591u, 2552236599u, 1088658621u, 2112468655u, 1066754795u, 1399432567u, 0, TAN_TOLERANCE, 0}, +{ 276, 3189290617u, 1578223762u, 3224596567u, 2456166162u, 3189290617u, 1578223762u, 0, TAN_TOLERANCE, 0}, +{ 277, 1058506965u, 2110924310u, 1086207177u, 3161208323u, 1058506965u, 2128721607u, 0, TAN_TOLERANCE, 0}, +{ 278, 3231863394u, 2352173188u, 1079361728u, 4070222179u, 3227740382u, 336535156u, 0, TAN_TOLERANCE, 0}, +{ 279, 1101012904u, 2481562701u, 1090937016u, 3809489716u, 3217879385u, 3053665789u, 0, TAN_TOLERANCE, 0}, +{ 280, 3197002651u, 330905705u, 1086260896u, 90264431u, 3197002651u, 330905851u, 0, TAN_TOLERANCE, 0}, +{ 281, 1040729961u, 4162008079u, 3194387916u, 759522153u, 1040729961u, 4162008079u, 0, TAN_TOLERANCE, 0}, +{ 282, 1081015037u, 1839697482u, 3216442625u, 2211508949u, 3218526105u, 3638731460u, 0, TAN_TOLERANCE, 0}, +{ 283, 3249807211u, 3736863454u, 1063475914u, 3150741666u, 1072025981u, 971921172u, 0, TAN_TOLERANCE, 0}, +{ 284, 1060785883u, 4200269406u, 3236646101u, 1061812176u, 1060785884u, 303065114u, 0, TAN_TOLERANCE, 0}, +{ 285, 1080217979u, 106027290u, 3234978297u, 2245237549u, 3218102952u, 2504847414u, 0, TAN_TOLERANCE, 0}, +{ 286, 3246984334u, 2132131375u, 3250483427u, 3449276437u, 1069760767u, 1782102314u, 0, TAN_TOLERANCE, 0}, +{ 287, 1089388778u, 2334440944u, 1105423490u, 4004336184u, 1072291864u, 1404277520u, 0, TAN_TOLERANCE, 0}, +{ 288, 3218772704u, 4090088208u, 1042030013u, 3898658299u, 3218880206u, 3413233725u, 0, TAN_TOLERANCE, 0}, +{ 289, 3207908064u, 2272831437u, 3253082595u, 2639188641u, 3207908064u, 2469202778u, 0, TAN_TOLERANCE, 0}, +{ 290, 1054766684u, 1856594168u, 3189515294u, 4101853676u, 1054766684u, 1856744929u, 0, TAN_TOLERANCE, 0}, +{ 291, 1076012412u, 2211699255u, 3195060344u, 3865018604u, 3216643832u, 2588986406u, 0, TAN_TOLERANCE, 0}, +{ 292, 3242767010u, 996259334u, 3241496889u, 3782673116u, 3218271270u, 734706536u, 0, TAN_TOLERANCE, 0}, +{ 293, 1099130747u, 3840380763u, 1048674041u, 550040067u, 1073016227u, 1715888406u, 0, TAN_TOLERANCE, 0}, +{ 294, 3251419593u, 95874100u, 3237232828u, 2645647822u, 1074518514u, 88770385u, 0, TAN_TOLERANCE, 0}, +{ 295, 1043665640u, 3441419500u, 3252367038u, 876710419u, 1043665640u, 3441419500u, 0, TAN_TOLERANCE, 0}, +{ 296, 3238593552u, 2560836004u, 3199616543u, 1180840586u, 3220307943u, 3656831580u, 0, TAN_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 1071428530u, 946243539u, 0, TAN_TOLERANCE, 0}, +{ 298, 1079539654u, 1447312532u, 1081476588u, 780366847u, 1071693521u, 4116479669u, 0, TAN_TOLERANCE, 0}, +{ 299, 1072569643u, 2842113832u, 3216156731u, 225159029u, 1073083620u, 4179140584u, 0, TAN_TOLERANCE, 0}, +{ 300, 1098117193u, 1601981129u, 3234628869u, 2236538344u, 1070461966u, 3658006630u, 0, TAN_TOLERANCE, 0}, +{ 301, 1085173524u, 2194185737u, 3242362684u, 87913366u, 3215054618u, 3308265431u, 0, TAN_TOLERANCE, 0}, +{ 302, 3199083880u, 1346862963u, 1077836259u, 3604666660u, 3199083880u, 1346865246u, 0, TAN_TOLERANCE, 0}, +{ 303, 3212255979u, 3115209742u, 1099332326u, 1325101950u, 3212255995u, 3657260390u, 0, TAN_TOLERANCE, 0}, +{ 304, 3224546042u, 3889223100u, 1053247613u, 3371396923u, 1070039848u, 636984675u, 0, TAN_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 3221974641u, 4043171840u, 0, TAN_TOLERANCE, 0}, +{ 306, 3205481779u, 1532426189u, 1063168268u, 3397022615u, 3205481779u, 1543371882u, 0, TAN_TOLERANCE, 0}, +{ 307, 3201033321u, 89324166u, 1079206060u, 3429424710u, 3201033321u, 89353099u, 0, TAN_TOLERANCE, 0}, +{ 308, 3192325102u, 747591401u, 1072238381u, 2803213904u, 3192325102u, 747591401u, 0, TAN_TOLERANCE, 0}, +{ 309, 1091113780u, 271904221u, 1044258318u, 1858545114u, 1076116261u, 919587220u, 0, TAN_TOLERANCE, 0}, +{ 310, 3228068914u, 314958082u, 3249912496u, 2966213175u, 3219521784u, 4007754846u, 0, TAN_TOLERANCE, 0}, +{ 311, 3197179414u, 3119528953u, 3217179014u, 2908718240u, 3197179414u, 3119529057u, 0, TAN_TOLERANCE, 0}, +{ 312, 3242467576u, 2018361566u, 1100926600u, 3985805054u, 1073825020u, 890088773u, 0, TAN_TOLERANCE, 0}, +{ 313, 1070132580u, 409584884u, 3239758947u, 755795129u, 1070153550u, 1757091400u, 0, TAN_TOLERANCE, 0}, +{ 314, 1075772446u, 1819156379u, 3251342302u, 2982669005u, 1076001886u, 3576153658u, 0, TAN_TOLERANCE, 0}, +{ 315, 1101563433u, 2080534280u, 3188254060u, 449171797u, 3225174135u, 2677838542u, 0, TAN_TOLERANCE, 0}, +{ 316, 1095956900u, 168744837u, 3214950009u, 1322217822u, 3220353572u, 894592656u, 0, TAN_TOLERANCE, 0}, +{ 317, 3254226900u, 3250487255u, 1062120700u, 1876195180u, 3221399760u, 1926104126u, 0, TAN_TOLERANCE, 0}, +{ 318, 3226343480u, 1336400247u, 1098057903u, 3314079581u, 3219222587u, 3150545361u, 0, TAN_TOLERANCE, 0}, +{ 319, 3203678820u, 265025555u, 1063854282u, 3779482256u, 3203678820u, 265735124u, 0, TAN_TOLERANCE, 0}, +{ 320, 1067300501u, 887044257u, 1054789618u, 2732056261u, 1067301047u, 3919915468u, 0, TAN_TOLERANCE, 0}, +{ 321, 1050106742u, 4027115185u, 3191764868u, 2940199511u, 1050106742u, 4027115450u, 0, TAN_TOLERANCE, 0}, +{ 322, 3202500155u, 2875684421u, 3227459837u, 2251967570u, 3202500155u, 2875814613u, 0, TAN_TOLERANCE, 0}, +{ 323, 1063244412u, 284173546u, 3238823679u, 3557800647u, 1063244414u, 2957655509u, 0, TAN_TOLERANCE, 0}, +{ 324, 1101458560u, 3147771266u, 3220110464u, 2933364246u, 1072229904u, 3258427445u, 0, TAN_TOLERANCE, 0}, +{ 325, 1064853160u, 3366183281u, 3234870843u, 537442654u, 1064853179u, 2700966725u, 0, TAN_TOLERANCE, 0}, +{ 326, 3244118788u, 2529029548u, 3249882819u, 3781513577u, 3222066350u, 1805132578u, 0, TAN_TOLERANCE, 0}, +{ 327, 3213436354u, 1080845539u, 3206760016u, 911778687u, 3213436437u, 368321244u, 0, TAN_TOLERANCE, 0}, +{ 328, 3191951036u, 469586759u, 1091830022u, 3080528840u, 3191951036u, 469586759u, 0, TAN_TOLERANCE, 0}, +{ 329, 1080249104u, 2863108169u, 3225605506u, 2508274250u, 1071359258u, 3991537001u, 0, TAN_TOLERANCE, 0}, +{ 330, 3210826984u, 4080017377u, 3206492941u, 1470284690u, 3210826986u, 2768909464u, 0, TAN_TOLERANCE, 0}, +{ 331, 3207120390u, 3867917386u, 1102054928u, 3504746045u, 3207120390u, 3950952741u, 0, TAN_TOLERANCE, 0}, +{ 332, 1064522279u, 2962134101u, 3244741577u, 3390537350u, 1064522289u, 347807104u, 0, TAN_TOLERANCE, 0}, +{ 333, 1088201813u, 1702237980u, 1071598971u, 1102587474u, 3219437889u, 1844190515u, 0, TAN_TOLERANCE, 0}, +{ 334, 3202970118u, 2180218657u, 3211592260u, 1206527853u, 3202970118u, 2180570126u, 0, TAN_TOLERANCE, 0}, +{ 335, 3197084744u, 394130786u, 3242511482u, 2437699868u, 3197084744u, 394130951u, 0, TAN_TOLERANCE, 0}, +{ 336, 1044237059u, 849581558u, 3252006507u, 2008614943u, 1044237059u, 849581558u, 0, TAN_TOLERANCE, 0}, +{ 337, 3210140014u, 3128971673u, 3249137531u, 2773583059u, 3210140015u, 3003661168u, 0, TAN_TOLERANCE, 0}, +{ 338, 1085029866u, 590727700u, 3248651761u, 2183878539u, 3220819737u, 141721044u, 0, TAN_TOLERANCE, 0}, +{ 339, 1101098629u, 820687580u, 3208143496u, 1402434664u, 3218501871u, 3201848623u, 0, TAN_TOLERANCE, 0}, +{ 340, 3252290835u, 1873709254u, 3245167989u, 44275991u, 1072391033u, 398964073u, 0, TAN_TOLERANCE, 0}, +{ 341, 3189668753u, 1174874204u, 3208263730u, 2360372288u, 3189668753u, 1174874204u, 0, TAN_TOLERANCE, 0}, +{ 342, 1103854676u, 937573440u, 3208953761u, 211240241u, 3220217779u, 1087740507u, 0, TAN_TOLERANCE, 0}, +{ 343, 3243548934u, 2469774991u, 1043117070u, 3380071805u, 1072701508u, 2365704893u, 0, TAN_TOLERANCE, 0}, +{ 344, 1058121042u, 442507560u, 3254252803u, 3257889649u, 1058121042u, 450009292u, 0, TAN_TOLERANCE, 0}, +{ 345, 1068850520u, 1854921625u, 1049810168u, 2729627545u, 1068853780u, 531700973u, 0, TAN_TOLERANCE, 0}, +{ 346, 3254712629u, 4001809575u, 3240128649u, 278261523u, 3219319223u, 2548086449u, 0, TAN_TOLERANCE, 0}, +{ 347, 1087224694u, 1793907966u, 3238955714u, 398859249u, 3221668828u, 2845828017u, 0, TAN_TOLERANCE, 0}, +{ 348, 3200952547u, 2511916952u, 3219195283u, 1697158299u, 3200952547u, 2511942216u, 0, TAN_TOLERANCE, 0}, +{ 349, 1069985548u, 3230931724u, 3243897690u, 3508781585u, 1070001309u, 2120433746u, 0, TAN_TOLERANCE, 0}, +{ 350, 1103847606u, 1674254897u, 1046547577u, 217148561u, 3219239077u, 1170656967u, 0, TAN_TOLERANCE, 0}, +{ 351, 3211263954u, 3275604304u, 3194840159u, 2991205850u, 3211263959u, 1126519421u, 0, TAN_TOLERANCE, 0}, +{ 352, 3195249375u, 3509997278u, 3248888030u, 3897986511u, 3195249375u, 3509997288u, 0, TAN_TOLERANCE, 0}, +{ 353, 1047182435u, 2156824613u, 1042295665u, 1239257646u, 1047182435u, 2156824619u, 0, TAN_TOLERANCE, 0}, +{ 354, 3213264085u, 1073153314u, 3250031627u, 2567234990u, 3213264144u, 3128333673u, 0, TAN_TOLERANCE, 0}, +{ 355, 3190593412u, 4261696995u, 3197784432u, 323702024u, 3190593412u, 4261696995u, 0, TAN_TOLERANCE, 0}, +{ 356, 3243690997u, 4075177615u, 3202791065u, 1919006082u, 3223031388u, 2896528219u, 0, TAN_TOLERANCE, 0}, +{ 357, 3239270013u, 386429966u, 1086504491u, 3698826164u, 1076373957u, 4112820482u, 0, TAN_TOLERANCE, 0}, +{ 358, 1078327190u, 1681986446u, 3194985869u, 3072950140u, 3215497965u, 2409206796u, 0, TAN_TOLERANCE, 0}, +{ 359, 3217311933u, 3719038997u, 1055433962u, 3331415058u, 3217323174u, 2513459184u, 0, TAN_TOLERANCE, 0}, +{ 360, 1060749713u, 2420250111u, 3238002206u, 1928661079u, 1060749713u, 2793500608u, 0, TAN_TOLERANCE, 0}, +{ 361, 1081914210u, 3679866727u, 3227386672u, 1273835792u, 1071850648u, 1052972091u, 0, TAN_TOLERANCE, 0}, +{ 362, 1041622738u, 2682092368u, 3234222284u, 1325425811u, 1041622738u, 2682092368u, 0, TAN_TOLERANCE, 0}, +{ 363, 1056312613u, 4175172697u, 3208346191u, 2130706153u, 1056312613u, 4176087705u, 0, TAN_TOLERANCE, 0}, +{ 364, 1092089624u, 1200784450u, 1083605096u, 1248595607u, 1071297510u, 2267447579u, 0, TAN_TOLERANCE, 0}, +{ 365, 3213890863u, 1897285171u, 3251296075u, 944966123u, 3213890950u, 492091915u, 0, TAN_TOLERANCE, 0}, +{ 366, 3241371250u, 2270747330u, 3230692631u, 422503284u, 1075781685u, 3800245394u, 0, TAN_TOLERANCE, 0}, +{ 367, 1084120037u, 2857564741u, 1075647403u, 3308906709u, 1076086650u, 4264754170u, 0, TAN_TOLERANCE, 0}, +{ 368, 3203475098u, 1380066948u, 3232612906u, 2613634294u, 3203475098u, 1380497446u, 0, TAN_TOLERANCE, 0}, +{ 369, 1063890856u, 4022784584u, 1060483857u, 3264056381u, 1063890862u, 1946986717u, 0, TAN_TOLERANCE, 0}, +{ 370, 1044637404u, 1778509100u, 3213146285u, 2665833973u, 1044637404u, 1778509100u, 0, TAN_TOLERANCE, 0}, +{ 371, 3216727300u, 1859175955u, 1079949560u, 4258450607u, 3216734161u, 1076419177u, 0, TAN_TOLERANCE, 0}, +{ 372, 1048277388u, 4128020197u, 1076266146u, 4122840980u, 1048277388u, 4128020224u, 0, TAN_TOLERANCE, 0}, +{ 373, 3193183163u, 2454653987u, 3229487005u, 2977478685u, 3193183163u, 2454653988u, 0, TAN_TOLERANCE, 0}, +{ 374, 3253556483u, 1355181872u, 1095308770u, 436846481u, 1070455744u, 2783739970u, 0, TAN_TOLERANCE, 0}, +{ 375, 3246605302u, 2592856453u, 3247825559u, 3195234082u, 1072158682u, 4191053951u, 0, TAN_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 3219396934u, 1126482929u, 0, TAN_TOLERANCE, 0}, +{ 377, 1069012833u, 1936670355u, 1095715713u, 2958468553u, 1069017366u, 1662345773u, 0, TAN_TOLERANCE, 0}, +{ 378, 3192291109u, 2960339502u, 1098808013u, 1044068983u, 3192291109u, 2960339502u, 0, TAN_TOLERANCE, 0}, +{ 379, 3196691185u, 4093388677u, 1095478112u, 1735930261u, 3196691185u, 4093388765u, 0, TAN_TOLERANCE, 0}, +{ 380, 1091040302u, 1807398746u, 3195743135u, 4261616162u, 3218599037u, 2355104691u, 0, TAN_TOLERANCE, 0}, +{ 381, 3209294194u, 3250576797u, 1059002384u, 3043079652u, 3209294195u, 481373147u, 0, TAN_TOLERANCE, 0}, +{ 382, 1069207109u, 666051428u, 3208765404u, 1912684117u, 1069213557u, 3613017928u, 0, TAN_TOLERANCE, 0}, +{ 383, 1103487420u, 1949030179u, 1096388934u, 896459246u, 3220083347u, 1401180812u, 0, TAN_TOLERANCE, 0}, +{ 384, 1054300653u, 622499767u, 1066707637u, 1490260486u, 1054300653u, 622567676u, 0, TAN_TOLERANCE, 0}, +{ 385, 1106688493u, 1490616165u, 3251242436u, 795675736u, 1071299621u, 1833357839u, 0, TAN_TOLERANCE, 0}, +{ 386, 1080943896u, 3662877092u, 3234317146u, 3200513112u, 1071312158u, 2927807819u, 0, TAN_TOLERANCE, 0}, +{ 387, 1084088786u, 1356101968u, 3236536816u, 3062844611u, 3220131839u, 1020215585u, 0, TAN_TOLERANCE, 0}, +{ 388, 3219922640u, 2284484846u, 3219498359u, 3240896015u, 3220393550u, 2961364171u, 0, TAN_TOLERANCE, 0}, +{ 389, 3235759689u, 494503287u, 1092811254u, 142673998u, 1066221278u, 644259700u, 0, TAN_TOLERANCE, 0}, +{ 390, 3252125916u, 3394882641u, 3225306538u, 364852125u, 1072736225u, 2528701453u, 0, TAN_TOLERANCE, 0}, +{ 391, 3225261763u, 193885269u, 1088149839u, 1359805831u, 3222178190u, 3117314156u, 0, TAN_TOLERANCE, 0}, +{ 392, 3200484782u, 592580907u, 3199560872u, 3086438952u, 3200484782u, 592590827u, 0, TAN_TOLERANCE, 0}, +{ 393, 1059518664u, 1778008540u, 1049064687u, 73581647u, 1059518664u, 1844212540u, 0, TAN_TOLERANCE, 0}, +{ 394, 3246733598u, 233240285u, 1081923320u, 2710903921u, 1076444640u, 2943138915u, 0, TAN_TOLERANCE, 0}, +{ 395, 1069513767u, 3719878805u, 1079866720u, 3615458228u, 1069524234u, 4006435562u, 0, TAN_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 1073933717u, 2553172396u, 0, TAN_TOLERANCE, 0}, +{ 397, 1103401096u, 2232210456u, 3235434773u, 224271737u, 3219565171u, 2155865246u, 0, TAN_TOLERANCE, 0}, +{ 398, 3193003684u, 2134662911u, 3190390590u, 4239009051u, 3193003684u, 2134662911u, 0, TAN_TOLERANCE, 0}, +{ 399, 1080526145u, 2305279897u, 1077668039u, 1854523320u, 3218473959u, 1086770027u, 0, TAN_TOLERANCE, 0}, +{ 400, 3219864259u, 538224650u, 3206153057u, 1379649610u, 3220324172u, 4086099737u, 0, TAN_TOLERANCE, 0}, +{ 401, 3196410507u, 3683897920u, 3244167599u, 3647579469u, 3196410507u, 3683897971u, 0, TAN_TOLERANCE, 0}, +{ 402, 1090280933u, 2694093608u, 1042775347u, 598406111u, 3223377708u, 629310991u, 0, TAN_TOLERANCE, 0}, +{ 403, 3211635392u, 872706833u, 1084802480u, 2200602798u, 3211635400u, 3018747109u, 0, TAN_TOLERANCE, 0}, +{ 404, 1042339597u, 904146293u, 1060867322u, 1729685598u, 1042339597u, 904146293u, 0, TAN_TOLERANCE, 0}, +{ 405, 3195694970u, 1894173462u, 3232800651u, 191960416u, 3195694970u, 1894173486u, 0, TAN_TOLERANCE, 0}, +{ 406, 1091225343u, 3521028551u, 1054522089u, 3287274359u, 1075379070u, 2589593036u, 0, TAN_TOLERANCE, 0}, +{ 407, 1095386964u, 959640601u, 3201578263u, 4136915018u, 1071816287u, 2768052123u, 0, TAN_TOLERANCE, 0}, +{ 408, 1064005451u, 1553716379u, 1106027987u, 984725765u, 1064005458u, 358714987u, 0, TAN_TOLERANCE, 0}, +{ 409, 3238832641u, 2287646644u, 3240329321u, 2276183378u, 3220726984u, 1232223276u, 0, TAN_TOLERANCE, 0}, +{ 410, 1068209174u, 3940225170u, 3199544434u, 997572161u, 1068210924u, 3866659980u, 0, TAN_TOLERANCE, 0}, +{ 411, 3212768361u, 36116288u, 3206886566u, 4196602670u, 3212768399u, 2705633912u, 0, TAN_TOLERANCE, 0}, +{ 412, 3241695853u, 3550227562u, 3207257983u, 2747744117u, 1068532712u, 2849678857u, 0, TAN_TOLERANCE, 0}, +{ 413, 1104236126u, 507130047u, 1048359321u, 3229888373u, 1075934101u, 170837419u, 0, TAN_TOLERANCE, 0}, +{ 414, 3222996778u, 2210969014u, 1081031001u, 1946786091u, 3219155104u, 2257647455u, 0, TAN_TOLERANCE, 0}, +{ 415, 3236306990u, 4059150589u, 3189759234u, 1177045799u, 1072876040u, 2482392566u, 0, TAN_TOLERANCE, 0}, +{ 416, 1093103612u, 2664812822u, 1050343198u, 2034180320u, 1075572080u, 1506141174u, 0, TAN_TOLERANCE, 0}, +{ 417, 3213779117u, 1175750283u, 3235559706u, 1424491340u, 3213779263u, 1242749298u, 0, TAN_TOLERANCE, 0}, +{ 418, 3213904193u, 1630036121u, 3231972785u, 3195479448u, 3213904283u, 1644097468u, 0, TAN_TOLERANCE, 0}, +{ 419, 1090429875u, 2527029044u, 1046927050u, 4000723255u, 3221257439u, 2628398620u, 0, TAN_TOLERANCE, 0}, +{ 420, 1085208677u, 3335703647u, 3237349676u, 3869440059u, 3219201429u, 3510636886u, 0, TAN_TOLERANCE, 0}, +{ 421, 1091433848u, 3888398377u, 3196041693u, 1290567220u, 3221736636u, 3727668451u, 0, TAN_TOLERANCE, 0}, +{ 422, 1066679070u, 3242451480u, 3248384948u, 707431021u, 1066679243u, 1240900922u, 0, TAN_TOLERANCE, 0}, +{ 423, 1083230509u, 2739665123u, 1060777905u, 1733073225u, 3217080313u, 3809469110u, 0, TAN_TOLERANCE, 0}, +{ 424, 1078517061u, 1297274853u, 3208848704u, 3341639139u, 3219327748u, 2265747130u, 0, TAN_TOLERANCE, 0}, +{ 425, 1046570941u, 2228057309u, 1084318902u, 1317851136u, 1046570941u, 2228057311u, 0, TAN_TOLERANCE, 0}, +{ 426, 1088255327u, 270039934u, 3241414679u, 3063626339u, 3216402439u, 1024991753u, 0, TAN_TOLERANCE, 0}, +{ 427, 3219178350u, 83062251u, 3211262173u, 2659016437u, 3219291255u, 480675725u, 0, TAN_TOLERANCE, 0}, +{ 428, 1095743886u, 3833539373u, 3206667189u, 1567476111u, 1072080952u, 3686857265u, 0, TAN_TOLERANCE, 0}, +{ 429, 3205195072u, 2382776852u, 3249232579u, 1546622468u, 3205195072u, 2389794914u, 0, TAN_TOLERANCE, 0}, +{ 430, 1085536439u, 1714300821u, 1104130938u, 4167591598u, 1074883815u, 2402017247u, 0, TAN_TOLERANCE, 0}, +{ 431, 1051092760u, 2798720100u, 1086978789u, 449990704u, 1051092760u, 2798721037u, 0, TAN_TOLERANCE, 0}, +{ 432, 3231198415u, 4039516226u, 3244344107u, 4272932619u, 3225414740u, 1989232767u, 0, TAN_TOLERANCE, 0}, +{ 433, 3222708441u, 1683007544u, 1091105663u, 3805494321u, 1072112688u, 1057460259u, 0, TAN_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 1076559907u, 1870123512u, 0, TAN_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 3222546600u, 2319235113u, 0, TAN_TOLERANCE, 0}, +{ 436, 1097859997u, 559918757u, 3205077053u, 908100198u, 1073861320u, 484074424u, 0, TAN_TOLERANCE, 0}, +{ 437, 1042677918u, 2026673913u, 3244833635u, 2844573214u, 1042677918u, 2026673913u, 0, TAN_TOLERANCE, 0}, +{ 438, 3254567259u, 3946837259u, 3234993796u, 3850406820u, 1071188185u, 191486672u, 0, TAN_TOLERANCE, 0}, +{ 439, 1057479809u, 3139330994u, 1046133568u, 1539650690u, 1057479809u, 3143968281u, 0, TAN_TOLERANCE, 0}, +{ 440, 3236705500u, 1554593884u, 3228899878u, 2813752562u, 1072433226u, 4063726012u, 0, TAN_TOLERANCE, 0}, +{ 441, 1056505004u, 3804703138u, 1072931071u, 2053677923u, 1056505004u, 3806034394u, 0, TAN_TOLERANCE, 0}, +{ 442, 3244864299u, 289355864u, 1078453818u, 2143066338u, 1071978047u, 2504678044u, 0, TAN_TOLERANCE, 0}, +{ 443, 3203939880u, 2157691971u, 1106629150u, 110806409u, 3203939880u, 2158907786u, 0, TAN_TOLERANCE, 0}, +{ 444, 1082157019u, 3570399481u, 1085637605u, 180265334u, 1071014074u, 1108110341u, 0, TAN_TOLERANCE, 0}, +{ 445, 3200980182u, 558779875u, 3202046748u, 2338464653u, 3200980182u, 558806357u, 0, TAN_TOLERANCE, 0}, +{ 446, 1045705464u, 1703969219u, 3229797258u, 1417521063u, 1045705464u, 1703969220u, 0, TAN_TOLERANCE, 0}, +{ 447, 3237782261u, 3917440951u, 1051668894u, 3736066983u, 3220361662u, 3501153891u, 0, TAN_TOLERANCE, 0}, +{ 448, 1064752080u, 3106613409u, 1066627453u, 2735392257u, 1064752096u, 910406802u, 0, TAN_TOLERANCE, 0}, +{ 449, 1065665372u, 2229777605u, 1065061963u, 2405869925u, 1065665419u, 608228727u, 0, TAN_TOLERANCE, 0}, +{ 450, 3239463229u, 3967957902u, 1057416138u, 3459188071u, 3219968678u, 452000557u, 0, TAN_TOLERANCE, 0}, +{ 451, 1068639210u, 3699016825u, 3249713090u, 796144848u, 1068641204u, 2916876063u, 0, TAN_TOLERANCE, 0}, +{ 452, 3228816396u, 3285165564u, 3211948811u, 401510871u, 1068004951u, 4119011697u, 0, TAN_TOLERANCE, 0}, +{ 453, 1094257658u, 634857910u, 3199607513u, 914218057u, 3218354966u, 974404261u, 0, TAN_TOLERANCE, 0}, +{ 454, 1083743336u, 2030735578u, 3233855943u, 965677531u, 1073910531u, 785127245u, 0, TAN_TOLERANCE, 0}, +{ 455, 1079556815u, 3957229084u, 1051050470u, 3123776651u, 1077427671u, 2842011737u, 0, TAN_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 3216195190u, 870993357u, 0, TAN_TOLERANCE, 0}, +{ 457, 3237271786u, 869031839u, 3225020876u, 1344301606u, 1073250300u, 2630856992u, 0, TAN_TOLERANCE, 0}, +{ 458, 3214433474u, 946696117u, 3231825228u, 1700703647u, 3214433775u, 2279568879u, 0, TAN_TOLERANCE, 0}, +{ 459, 1075492875u, 3394168074u, 1076939786u, 1666995668u, 1071303797u, 542229427u, 0, TAN_TOLERANCE, 0}, +{ 460, 3208774795u, 2488789804u, 3238508333u, 1506943664u, 3208774795u, 2999907289u, 0, TAN_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1073659779u, 84316650u, 0, TAN_TOLERANCE, 0}, +{ 462, 3219934542u, 1244307192u, 3191297711u, 2540916692u, 3220408266u, 2332373750u, 0, TAN_TOLERANCE, 0}, +{ 463, 3200062692u, 2871645739u, 3239081581u, 1440249115u, 3200062692u, 2871653937u, 0, TAN_TOLERANCE, 0}, +{ 464, 1068350633u, 1231934926u, 3236746788u, 603977748u, 1068352827u, 2493929906u, 0, TAN_TOLERANCE, 0}, +{ 465, 3195449689u, 2386312545u, 1063169277u, 2715234268u, 3195449689u, 2386312560u, 0, TAN_TOLERANCE, 0}, +{ 466, 1087803418u, 915867083u, 1046790892u, 3347417612u, 1073825687u, 4247788838u, 0, TAN_TOLERANCE, 0}, +{ 467, 1105984188u, 3553288373u, 1065698616u, 2906680663u, 1072200540u, 3878244721u, 0, TAN_TOLERANCE, 0}, +{ 468, 1045506226u, 2342364630u, 1051356723u, 4019093203u, 1045506226u, 2342364630u, 0, TAN_TOLERANCE, 0}, +{ 469, 3201169162u, 2911548084u, 1105282515u, 2476735795u, 3201169162u, 2911583958u, 0, TAN_TOLERANCE, 0}, +{ 470, 1050472772u, 1836216409u, 1101062307u, 2519592554u, 1050472772u, 1836216914u, 0, TAN_TOLERANCE, 0}, +{ 471, 1070178161u, 1235369496u, 3222946447u, 668087854u, 1070200956u, 984903311u, 0, TAN_TOLERANCE, 0}, +{ 472, 3208554596u, 2981820811u, 1059838516u, 2845580478u, 3208554596u, 3611299598u, 0, TAN_TOLERANCE, 0}, +{ 473, 3193931414u, 1565550570u, 3217165795u, 4162017137u, 3193931414u, 1565550573u, 0, TAN_TOLERANCE, 0}, +{ 474, 3237251378u, 2808968027u, 1055630096u, 1782326814u, 1073199382u, 3093545191u, 0, TAN_TOLERANCE, 0}, +{ 475, 1053576974u, 1492622658u, 3216653077u, 3972512122u, 1053576974u, 1492652906u, 0, TAN_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 3219717982u, 2347297495u, 0, TAN_TOLERANCE, 0}, +{ 477, 3217906631u, 899763203u, 3207606001u, 2804747833u, 3217941096u, 1292535038u, 0, TAN_TOLERANCE, 0}, +{ 478, 3230670325u, 3789058912u, 3228095081u, 4135937628u, 3220946737u, 3788028633u, 0, TAN_TOLERANCE, 0}, +{ 479, 1060199382u, 1682808307u, 3206960335u, 232877759u, 1060199382u, 1797073325u, 0, TAN_TOLERANCE, 0}, +{ 480, 3242091486u, 2851963139u, 3246852961u, 2590862592u, 1071899939u, 3363220171u, 0, TAN_TOLERANCE, 0}, +{ 481, 1081200406u, 2422232642u, 3234779662u, 290458310u, 3220569877u, 2524572923u, 0, TAN_TOLERANCE, 0}, +{ 482, 3210671078u, 1082582386u, 1075605675u, 2602133689u, 3210671080u, 2857813414u, 0, TAN_TOLERANCE, 0}, +{ 483, 3239818611u, 1789635787u, 1059414278u, 1048286093u, 1074416318u, 2900047215u, 0, TAN_TOLERANCE, 0}, +{ 484, 1098330542u, 231339448u, 1055573265u, 504907415u, 3215743938u, 3288233724u, 0, TAN_TOLERANCE, 0}, +{ 485, 1063211461u, 1153251200u, 3204617090u, 1772013857u, 1063211463u, 3301239304u, 0, TAN_TOLERANCE, 0}, +{ 486, 1099551055u, 1082898276u, 3212089272u, 1449080862u, 3218613781u, 3243588953u, 0, TAN_TOLERANCE, 0}, +{ 487, 1086008285u, 3177299045u, 1058862813u, 809400815u, 1071222953u, 702551442u, 0, TAN_TOLERANCE, 0}, +{ 488, 3230854550u, 1924429710u, 1056464743u, 3349283177u, 1074313482u, 3011874043u, 0, TAN_TOLERANCE, 0}, +{ 489, 3245473391u, 42238036u, 1042379500u, 2113559863u, 1073052939u, 1170520627u, 0, TAN_TOLERANCE, 0}, +{ 490, 1064761243u, 3304403230u, 3217556703u, 58952646u, 1064761259u, 2338066714u, 0, TAN_TOLERANCE, 0}, +{ 491, 3212669530u, 1645486982u, 3224301095u, 3636267471u, 3212669563u, 2707928865u, 0, TAN_TOLERANCE, 0}, +{ 492, 1062762009u, 619402181u, 3235208235u, 557360557u, 1062762010u, 1440296348u, 0, TAN_TOLERANCE, 0}, +{ 493, 3238238394u, 110029735u, 1046937383u, 984375729u, 1069607562u, 1046851138u, 0, TAN_TOLERANCE, 0}, +{ 494, 3189496738u, 4063688092u, 3203235744u, 1049950343u, 3189496738u, 4063688092u, 0, TAN_TOLERANCE, 0}, +{ 495, 1062350619u, 650996069u, 1054971928u, 3953359826u, 1062350619u, 2752584734u, 0, TAN_TOLERANCE, 0}, +{ 496, 3227055805u, 66926332u, 1090561839u, 1379780888u, 1072277043u, 4160526258u, 0, TAN_TOLERANCE, 0}, +{ 497, 3233453307u, 2803378256u, 1086057989u, 498534626u, 3218298031u, 1208122603u, 0, TAN_TOLERANCE, 0}, +{ 498, 1082618553u, 2846400785u, 1047142525u, 1375153550u, 3219225392u, 1107778179u, 0, TAN_TOLERANCE, 0}, +{ 499, 1044581201u, 2869128958u, 1070972315u, 4246440273u, 1044581201u, 2869128958u, 0, TAN_TOLERANCE, 0}, +{ 500, 1051832506u, 3112381207u, 1044430965u, 3981604561u, 1051832506u, 3112383052u, 0, TAN_TOLERANCE, 0}, +{ 501, 3231254997u, 243303420u, 1093735824u, 1575581926u, 3218083448u, 3006576476u, 0, TAN_TOLERANCE, 0}, +{ 502, 3239137997u, 3218865041u, 3204803496u, 3840388050u, 3218098013u, 2658530377u, 0, TAN_TOLERANCE, 0}, +{ 503, 1048415431u, 336846959u, 1052664471u, 3798336786u, 1048415431u, 336846993u, 0, TAN_TOLERANCE, 0}, +{ 504, 1055954236u, 3639240976u, 1081202165u, 1844741676u, 1055954236u, 3639630115u, 0, TAN_TOLERANCE, 0}, +{ 505, 3211904793u, 717293069u, 3211534283u, 582401011u, 3211904800u, 2074293655u, 0, TAN_TOLERANCE, 0}, +{ 506, 3251962512u, 3766248610u, 3196520332u, 1174437546u, 1073325344u, 780358362u, 0, TAN_TOLERANCE, 0}, +{ 507, 1083431226u, 756959182u, 3204099341u, 1581804034u, 1073722216u, 1460652646u, 0, TAN_TOLERANCE, 0}, +{ 508, 3205806444u, 3560686300u, 3220980617u, 4277975772u, 3205806444u, 3572839184u, 0, TAN_TOLERANCE, 0}, +{ 509, 3209906076u, 2598148853u, 3217622194u, 3460421008u, 3209906077u, 808032968u, 0, TAN_TOLERANCE, 0}, +{ 510, 1066720824u, 136600515u, 3209934920u, 3340653128u, 1066721013u, 1659952300u, 0, TAN_TOLERANCE, 0}, +{ 511, 1096820310u, 1045480938u, 3251354609u, 4133432965u, 3221461219u, 2735258820u, 0, TAN_TOLERANCE, 0}, +{ 512, 1091599431u, 1630207738u, 3239996829u, 2393354808u, 3219464252u, 498852281u, 0, TAN_TOLERANCE, 0}, +{ 513, 3190626018u, 3739770117u, 1059520750u, 3959551225u, 3190626018u, 3739770117u, 0, TAN_TOLERANCE, 0}, +{ 514, 3230730505u, 1498861716u, 1091297147u, 847410798u, 3217049269u, 1133813157u, 0, TAN_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 3222428802u, 614562084u, 0, TAN_TOLERANCE, 0}, +{ 516, 1054849265u, 2353103845u, 3235718771u, 2978889966u, 1054849265u, 2353274099u, 0, TAN_TOLERANCE, 0}, +{ 517, 3251357992u, 1546972125u, 3249076079u, 1987349196u, 1077259194u, 2242398903u, 0, TAN_TOLERANCE, 0}, +{ 518, 3238219513u, 2769161072u, 1075207126u, 292616282u, 1072821398u, 807086196u, 0, TAN_TOLERANCE, 0}, +{ 519, 3199712298u, 36855311u, 1052128202u, 1479039342u, 3199712298u, 36859768u, 0, TAN_TOLERANCE, 0}, +{ 520, 1083757053u, 2027463605u, 1066023013u, 3369686340u, 3221343255u, 19927100u, 0, TAN_TOLERANCE, 0}, +{ 521, 3197852749u, 3808681655u, 1054161346u, 1821773119u, 3197852749u, 3808682082u, 0, TAN_TOLERANCE, 0}, +{ 522, 1040685928u, 3175490326u, 3226879970u, 845687760u, 1040685928u, 3175490326u, 0, TAN_TOLERANCE, 0}, +{ 523, 1042302993u, 3124482451u, 3242748377u, 3259417226u, 1042302993u, 3124482451u, 0, TAN_TOLERANCE, 0}, +{ 524, 1045245695u, 2751606436u, 3236210939u, 3923142740u, 1045245695u, 2751606437u, 0, TAN_TOLERANCE, 0}, +{ 525, 1095694737u, 2016872044u, 3228408064u, 4201274408u, 3220556003u, 304657644u, 0, TAN_TOLERANCE, 0}, +{ 526, 3199349254u, 1019916843u, 3219974785u, 1977881787u, 3199349254u, 1019918851u, 0, TAN_TOLERANCE, 0}, +{ 527, 3199478752u, 2060433318u, 1075872515u, 366073725u, 3199478752u, 2060436054u, 0, TAN_TOLERANCE, 0}, +{ 528, 3191180557u, 1098469906u, 1082900695u, 2349346832u, 3191180557u, 1098469906u, 0, TAN_TOLERANCE, 0}, +{ 529, 3209974707u, 3011196295u, 3252479932u, 2459281672u, 3209974708u, 1651824903u, 0, TAN_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 1073062403u, 2209304510u, 0, TAN_TOLERANCE, 0}, +{ 531, 1101737698u, 914741728u, 3203468059u, 2833809843u, 1073172513u, 3841288246u, 0, TAN_TOLERANCE, 0}, +{ 532, 3236763878u, 1274901962u, 3241535845u, 3759113509u, 3223536244u, 2526279170u, 0, TAN_TOLERANCE, 0}, +{ 533, 3245916442u, 2134927252u, 3253802671u, 3013731444u, 3221779667u, 2145793921u, 0, TAN_TOLERANCE, 0}, +{ 534, 1099201341u, 2230655177u, 3254510616u, 1249674366u, 1069935420u, 2610885886u, 0, TAN_TOLERANCE, 0}, +{ 535, 1062971253u, 717357389u, 1083533731u, 3746683362u, 1062971254u, 3814343624u, 0, TAN_TOLERANCE, 0}, +{ 536, 3213773114u, 834976849u, 3217357661u, 2465861779u, 3213773258u, 3835570390u, 0, TAN_TOLERANCE, 0}, +{ 537, 1045656117u, 1385714428u, 1053358395u, 3007113740u, 1045656117u, 1385714429u, 0, TAN_TOLERANCE, 0}, +{ 538, 1050527919u, 599268545u, 3201368210u, 2309854744u, 1050527919u, 599269095u, 0, TAN_TOLERANCE, 0}, +{ 539, 1069954454u, 2840234388u, 3232496515u, 333365983u, 1069969239u, 824923776u, 0, TAN_TOLERANCE, 0}, +{ 540, 1045922781u, 3136078996u, 3194520860u, 2650572904u, 1045922781u, 3136078997u, 0, TAN_TOLERANCE, 0}, +{ 541, 3233687691u, 2405805086u, 3251640319u, 324233833u, 1076400826u, 1695372281u, 0, TAN_TOLERANCE, 0}, +{ 542, 1106699146u, 2589598340u, 3254677807u, 952438812u, 1073169861u, 1925719938u, 0, TAN_TOLERANCE, 0}, +{ 543, 3189114773u, 1922837702u, 3216892718u, 3535907549u, 3189114773u, 1922837702u, 0, TAN_TOLERANCE, 0}, +{ 544, 3243615868u, 261447440u, 3209805849u, 1150571079u, 3218537959u, 1179754495u, 0, TAN_TOLERANCE, 0}, +{ 545, 1095805232u, 4026487528u, 1073152064u, 27340691u, 1071869216u, 2196895529u, 0, TAN_TOLERANCE, 0}, +{ 546, 3229123692u, 338765118u, 1086225786u, 3207238249u, 1071434156u, 2463812124u, 0, TAN_TOLERANCE, 0}, +{ 547, 3196182703u, 1085283176u, 3187775111u, 1601194210u, 3196182703u, 1085283206u, 0, TAN_TOLERANCE, 0}, +{ 548, 1091520173u, 3031712790u, 3252307859u, 170666844u, 1073788586u, 1490989523u, 0, TAN_TOLERANCE, 0}, +{ 549, 3218862231u, 3148395674u, 1041913758u, 3306391490u, 3218988164u, 3732649501u, 0, TAN_TOLERANCE, 0}, +{ 550, 3201277070u, 2205233857u, 3208100078u, 3993195511u, 3201277070u, 2205275976u, 0, TAN_TOLERANCE, 0}, +{ 551, 1067699608u, 4282766727u, 1072820377u, 1874778218u, 1067700256u, 2388367432u, 0, TAN_TOLERANCE, 0}, +{ 552, 3210833092u, 2920860798u, 3218070226u, 3104066154u, 3210833094u, 1727805504u, 0, TAN_TOLERANCE, 0}, +{ 553, 3204950351u, 969991373u, 3250596895u, 1734386152u, 3204950351u, 974513035u, 0, TAN_TOLERANCE, 0}, +{ 554, 3238915818u, 1218740205u, 3239802737u, 2610078504u, 1071992715u, 2476766203u, 0, TAN_TOLERANCE, 0}, +{ 555, 3206031242u, 1485218325u, 3220870240u, 3591664613u, 3206031242u, 1504459448u, 0, TAN_TOLERANCE, 0}, +{ 556, 3202074143u, 690157417u, 3190850619u, 4192347699u, 3202074143u, 690271681u, 0, TAN_TOLERANCE, 0}, +{ 557, 1096053810u, 4009839784u, 1079670252u, 394167192u, 3225629605u, 4134812175u, 0, TAN_TOLERANCE, 0}, +{ 558, 3234559237u, 961532417u, 1092588071u, 2923790239u, 1071989085u, 3456632070u, 0, TAN_TOLERANCE, 0}, +{ 559, 3203879091u, 4174125604u, 1050682630u, 2169701868u, 3203879091u, 4175207134u, 0, TAN_TOLERANCE, 0}, +{ 560, 3243092475u, 4146748230u, 1087373950u, 2481478351u, 3215224829u, 3105536152u, 0, TAN_TOLERANCE, 0}, +{ 561, 1076987866u, 3984715440u, 1050421618u, 2446142566u, 3222213811u, 498812384u, 0, TAN_TOLERANCE, 0}, +{ 562, 1084172406u, 936290150u, 1100614426u, 3625806370u, 3220199128u, 1358638649u, 0, TAN_TOLERANCE, 0}, +{ 563, 1099787952u, 1866615265u, 3215651428u, 2337013350u, 3219914131u, 2684128678u, 0, TAN_TOLERANCE, 0}, +{ 564, 3253198302u, 712227971u, 1106004723u, 973148499u, 3218269318u, 3721193253u, 0, TAN_TOLERANCE, 0}, +{ 565, 3230088199u, 3409813738u, 3244817008u, 1933503498u, 1073488242u, 3344297858u, 0, TAN_TOLERANCE, 0}, +{ 566, 1079943733u, 3180389060u, 3228735703u, 83422217u, 1065971249u, 1602512451u, 0, TAN_TOLERANCE, 0}, +{ 567, 1077878724u, 556972671u, 3204582372u, 841555801u, 3218291211u, 3107455312u, 0, TAN_TOLERANCE, 0}, +{ 568, 1070767721u, 4189151332u, 1080874032u, 706326922u, 1070803352u, 407939685u, 0, TAN_TOLERANCE, 0}, +{ 569, 1096151307u, 198291836u, 1057281892u, 2188836928u, 1074592119u, 2450977568u, 0, TAN_TOLERANCE, 0}, +{ 570, 1078091995u, 1219449298u, 3228734687u, 3504562743u, 3220571385u, 559673929u, 0, TAN_TOLERANCE, 0}, +{ 571, 3204570464u, 1776099219u, 1094316777u, 4188083896u, 3204570464u, 1778045339u, 0, TAN_TOLERANCE, 0}, +{ 572, 3193845708u, 2614400266u, 1073750227u, 3003203347u, 3193845708u, 2614400268u, 0, TAN_TOLERANCE, 0}, +{ 573, 3213982678u, 2959351406u, 1105603716u, 311851587u, 3213982790u, 192456605u, 0, TAN_TOLERANCE, 0}, +{ 574, 1084544434u, 865443613u, 1097532516u, 3622237781u, 3218629642u, 1586071075u, 0, TAN_TOLERANCE, 0}, +{ 575, 3231786666u, 447506102u, 3195759295u, 3603669725u, 1072160877u, 4222169442u, 0, TAN_TOLERANCE, 0}, +{ 576, 1097890173u, 3934398273u, 1040996422u, 2968621268u, 1076341208u, 2443582384u, 0, TAN_TOLERANCE, 0}, +{ 577, 3196739825u, 784208771u, 1088764788u, 2182296421u, 3196739825u, 784208867u, 0, TAN_TOLERANCE, 0}, +{ 578, 3248332291u, 1527590526u, 3206961556u, 2823164069u, 1073211002u, 2920535413u, 0, TAN_TOLERANCE, 0}, +{ 579, 3236644131u, 3876699591u, 3207481130u, 4028148535u, 3220871901u, 876731950u, 0, TAN_TOLERANCE, 0}, +{ 580, 1083576186u, 2164249756u, 1059857743u, 1785169952u, 1074542491u, 1306706713u, 0, TAN_TOLERANCE, 0}, +{ 581, 1091804009u, 2079273665u, 1080303860u, 625760474u, 3221470601u, 3167060593u, 0, TAN_TOLERANCE, 0}, +{ 582, 3226486108u, 3636214836u, 1068367620u, 2932621925u, 1072938327u, 1971428109u, 0, TAN_TOLERANCE, 0}, +{ 583, 1043995372u, 4274131512u, 1047707755u, 92550763u, 1043995372u, 4274131512u, 0, TAN_TOLERANCE, 0}, +{ 584, 3198822121u, 2648933384u, 1084603503u, 3534304873u, 3198822121u, 2648934875u, 0, TAN_TOLERANCE, 0}, +{ 585, 1064563235u, 3216750767u, 3191088629u, 547482628u, 1064563246u, 349415911u, 0, TAN_TOLERANCE, 0}, +{ 586, 1061084774u, 1420360746u, 1080063101u, 1690029499u, 1061084774u, 2062923873u, 0, TAN_TOLERANCE, 0}, +{ 587, 3229855364u, 1908572179u, 1080112083u, 1228319033u, 3224026442u, 1064578383u, 0, TAN_TOLERANCE, 0}, +{ 588, 1048158178u, 500312015u, 3212368508u, 3864619086u, 1048158178u, 500312037u, 0, TAN_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 1073055146u, 1668809125u, 0, TAN_TOLERANCE, 0}, +{ 590, 1099392394u, 2382118000u, 1042665328u, 567154882u, 1073006307u, 3699440123u, 0, TAN_TOLERANCE, 0}, +{ 591, 1058013442u, 1435344339u, 3216303171u, 2275988178u, 1058013442u, 1440940879u, 0, TAN_TOLERANCE, 0}, +{ 592, 3214538619u, 3403659753u, 3218043030u, 1926480488u, 3214538984u, 2788475836u, 0, TAN_TOLERANCE, 0}, +{ 593, 1076840383u, 1198845185u, 3225556149u, 1130089684u, 3216073797u, 2536472320u, 0, TAN_TOLERANCE, 0}, +{ 594, 3222663042u, 2183928090u, 1048403956u, 963834821u, 1072722791u, 2238943892u, 0, TAN_TOLERANCE, 0}, +{ 595, 1101672960u, 2120625396u, 1041006976u, 2137548527u, 1073487055u, 4205428157u, 0, TAN_TOLERANCE, 0}, +{ 596, 1099230238u, 586700956u, 1059670521u, 303891699u, 3222213898u, 3423099859u, 0, TAN_TOLERANCE, 0}, +{ 597, 3218994498u, 2509132460u, 1102827530u, 2205707903u, 3219140003u, 1207181537u, 0, TAN_TOLERANCE, 0}, +{ 598, 3204860597u, 1229308263u, 3209170414u, 4206576047u, 3204860597u, 1233089342u, 0, TAN_TOLERANCE, 0}, +{ 599, 3224076289u, 4078010749u, 3199236456u, 733478972u, 3221462767u, 2645312571u, 0, TAN_TOLERANCE, 0}, +{ 600, 3197712584u, 4277541051u, 3199806921u, 397102023u, 3197712584u, 4277541385u, 0, TAN_TOLERANCE, 0}, +{ 601, 3195975013u, 900999594u, 3234720188u, 2530214248u, 3195975013u, 900999632u, 0, TAN_TOLERANCE, 0}, +{ 602, 1076543548u, 4000609478u, 1096577064u, 4148592328u, 1072744158u, 901044576u, 0, TAN_TOLERANCE, 0}, +{ 603, 1048668084u, 2154187873u, 3224392607u, 3957250362u, 1048668084u, 2154187900u, 0, TAN_TOLERANCE, 0}, +{ 604, 3223413488u, 2867079200u, 1101870326u, 921212001u, 1072478681u, 1947808256u, 0, TAN_TOLERANCE, 0}, +{ 605, 3233221890u, 674547716u, 1063216239u, 3929755226u, 3221175450u, 1547677557u, 0, TAN_TOLERANCE, 0}, +{ 606, 3240415851u, 3158182449u, 1043794244u, 3259056345u, 1071157174u, 814361401u, 0, TAN_TOLERANCE, 0}, +{ 607, 3236776656u, 3002823940u, 1059511739u, 2832435794u, 1074816146u, 3432733072u, 0, TAN_TOLERANCE, 0}, +{ 608, 3217304822u, 2196511929u, 1049973941u, 3672092877u, 3217315882u, 2570717061u, 0, TAN_TOLERANCE, 0}, +{ 609, 1050438056u, 3655292191u, 1086438127u, 3567072906u, 1050438056u, 3655292669u, 0, TAN_TOLERANCE, 0}, +{ 610, 3243186948u, 1617573614u, 3201863123u, 3090723732u, 3215739265u, 754649775u, 0, TAN_TOLERANCE, 0}, +{ 611, 3233201380u, 679893506u, 3211547753u, 824081024u, 1071687746u, 513845462u, 0, TAN_TOLERANCE, 0}, +{ 612, 1089530525u, 2285242807u, 1084999409u, 2221731406u, 3221265077u, 3133657547u, 0, TAN_TOLERANCE, 0}, +{ 613, 3206733664u, 1935990727u, 1088822246u, 1058156518u, 3206733664u, 1972701329u, 0, TAN_TOLERANCE, 0}, +{ 614, 1102839166u, 521023584u, 1059186903u, 4245163857u, 1069859447u, 743248191u, 0, TAN_TOLERANCE, 0}, +{ 615, 1103891140u, 2312887617u, 3191771354u, 1885370807u, 3213444490u, 1904571603u, 0, TAN_TOLERANCE, 0}, +{ 616, 3252953815u, 1796441468u, 1100030327u, 2772711004u, 3219317557u, 2229597079u, 0, TAN_TOLERANCE, 0}, +{ 617, 3204276820u, 2095685003u, 1077984448u, 2100773742u, 3204276820u, 2097849993u, 0, TAN_TOLERANCE, 0}, +{ 618, 3192954620u, 2892538035u, 1042396334u, 4162200338u, 3192954620u, 2892538035u, 0, TAN_TOLERANCE, 0}, +{ 619, 3242725751u, 2177698116u, 3227557177u, 150832500u, 1068959958u, 4175788793u, 0, TAN_TOLERANCE, 0}, +{ 620, 3191562216u, 607966734u, 3236250630u, 4164600559u, 3191562216u, 607966734u, 0, TAN_TOLERANCE, 0}, +{ 621, 3216389812u, 2830122967u, 1046096700u, 3713346883u, 3216393477u, 2001753140u, 0, TAN_TOLERANCE, 0}, +{ 622, 3237197963u, 2314640506u, 3203696416u, 3276228872u, 3216462828u, 1983951841u, 0, TAN_TOLERANCE, 0}, +{ 623, 3212912307u, 469331883u, 3249037349u, 2999233437u, 3212912333u, 1663316888u, 0, TAN_TOLERANCE, 0}, +{ 624, 1097382011u, 560886625u, 1091899487u, 748795120u, 1071993443u, 2804575561u, 0, TAN_TOLERANCE, 0}, +{ 625, 1049886858u, 2958421324u, 1092569414u, 3235243477u, 1049886858u, 2958421491u, 0, TAN_TOLERANCE, 0}, +{ 626, 3193026497u, 3221475559u, 1043038304u, 915608434u, 3193026497u, 3221475559u, 0, TAN_TOLERANCE, 0}, +{ 627, 1071197530u, 3007808652u, 3216682290u, 2531019474u, 1071288269u, 2003569361u, 0, TAN_TOLERANCE, 0}, +{ 628, 3242028999u, 1767658578u, 3237045269u, 2313128318u, 1077477368u, 1546619350u, 0, TAN_TOLERANCE, 0}, +{ 629, 3210617892u, 1926845182u, 1066835624u, 1783256828u, 3210617894u, 2907970801u, 0, TAN_TOLERANCE, 0}, +{ 630, 1040575629u, 90378038u, 1057168870u, 164358218u, 1040575629u, 90378038u, 0, TAN_TOLERANCE, 0}, +{ 631, 1106859172u, 1610524680u, 1085283851u, 2903496007u, 3219268505u, 3734210885u, 0, TAN_TOLERANCE, 0}, +{ 632, 1078635586u, 4274321404u, 3202913591u, 720121831u, 3215944252u, 3691295869u, 0, TAN_TOLERANCE, 0}, +{ 633, 1051205256u, 2034778236u, 1071133763u, 1413236391u, 1051205256u, 2034779405u, 0, TAN_TOLERANCE, 0}, +{ 634, 1051063028u, 1489112261u, 1076691395u, 348210906u, 1051063028u, 1489113142u, 0, TAN_TOLERANCE, 0}, +{ 635, 3206743917u, 2797651324u, 3224410527u, 2374818327u, 3206743917u, 2835282496u, 0, TAN_TOLERANCE, 0}, +{ 636, 1088287256u, 1823161666u, 3197810695u, 3119680047u, 3219861474u, 2047170095u, 0, TAN_TOLERANCE, 0}, +{ 637, 1065927336u, 3420950657u, 1087084743u, 2136638961u, 1065927415u, 3709689162u, 0, TAN_TOLERANCE, 0}, +{ 638, 1069902224u, 3554566429u, 1062907717u, 2736702589u, 1069915462u, 3518649188u, 0, TAN_TOLERANCE, 0}, +{ 639, 3244888667u, 2928437580u, 3187765027u, 1393427873u, 1068333483u, 1818015207u, 0, TAN_TOLERANCE, 0}, +{ 640, 3209301561u, 189447067u, 1051643315u, 828663513u, 3209301561u, 1735128209u, 0, TAN_TOLERANCE, 0}, +{ 641, 1052313869u, 2852350928u, 1045683757u, 673354280u, 1052313869u, 2852356158u, 0, TAN_TOLERANCE, 0}, +{ 642, 1043946301u, 3589563265u, 3248741629u, 812657927u, 1043946301u, 3589563265u, 0, TAN_TOLERANCE, 0}, +{ 643, 3190610826u, 1766416701u, 1100392103u, 2185373290u, 3190610826u, 1766416701u, 0, TAN_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 3221157954u, 1827747543u, 0, TAN_TOLERANCE, 0}, +{ 645, 1079635136u, 1187403069u, 1075300235u, 336640304u, 1067143974u, 3696369881u, 0, TAN_TOLERANCE, 0}, +{ 646, 1103926251u, 1718795752u, 3243118752u, 683369237u, 3219595101u, 1799803345u, 0, TAN_TOLERANCE, 0}, +{ 647, 3210792097u, 1863545307u, 1069449477u, 3418627399u, 3210792098u, 4197087876u, 0, TAN_TOLERANCE, 0}, +{ 648, 1069601294u, 3295607249u, 1068878592u, 1633297809u, 1069607684u, 1276743969u, 0, TAN_TOLERANCE, 0}, +{ 649, 1058947127u, 2585980994u, 3236670483u, 1286750688u, 1058947127u, 2623777476u, 0, TAN_TOLERANCE, 0}, +{ 650, 1046157033u, 15816845u, 3233249283u, 2491924775u, 1046157033u, 15816847u, 0, TAN_TOLERANCE, 0}, +{ 651, 1042413021u, 1051983351u, 1049180786u, 1474421917u, 1042413021u, 1051983351u, 0, TAN_TOLERANCE, 0}, +{ 652, 3201249525u, 2003816032u, 1086050104u, 668090487u, 3201249525u, 2003856493u, 0, TAN_TOLERANCE, 0}, +{ 653, 1052556037u, 3671484625u, 1067020039u, 430024694u, 1052556037u, 3671492530u, 0, TAN_TOLERANCE, 0}, +{ 654, 1067397110u, 3991830201u, 3207808714u, 1021245839u, 1067397743u, 564284082u, 0, TAN_TOLERANCE, 0}, +{ 655, 1064194391u, 4255801807u, 3207681716u, 1926756877u, 1064194401u, 267289285u, 0, TAN_TOLERANCE, 0}, +{ 656, 1052140785u, 4167786896u, 1077097744u, 1775517981u, 1052140785u, 4167790640u, 0, TAN_TOLERANCE, 0}, +{ 657, 1085601978u, 3187518564u, 1082437406u, 944672491u, 3218112804u, 3739410670u, 0, TAN_TOLERANCE, 0}, +{ 658, 1049366282u, 953085192u, 3227310828u, 3459155777u, 1049366282u, 953085307u, 0, TAN_TOLERANCE, 0}, +{ 659, 1069502506u, 1908555460u, 1073640207u, 260441967u, 1069512802u, 1649179346u, 0, TAN_TOLERANCE, 0}, +{ 660, 1067219606u, 250762477u, 1072582645u, 2886742039u, 1067220087u, 1752188499u, 0, TAN_TOLERANCE, 0}, +{ 661, 3250906006u, 786180031u, 3197734769u, 2788918312u, 3219515699u, 2725543956u, 0, TAN_TOLERANCE, 0}, +{ 662, 3234511827u, 2055912467u, 3244244909u, 1394142937u, 1070694857u, 2816615981u, 0, TAN_TOLERANCE, 0}, +{ 663, 1069612985u, 91984146u, 3222252812u, 4126276047u, 1069619580u, 4178832687u, 0, TAN_TOLERANCE, 0}, +{ 664, 1081340139u, 3942715706u, 3239316352u, 410676547u, 3222618996u, 869458806u, 0, TAN_TOLERANCE, 0}, +{ 665, 3198557846u, 86296211u, 1085850694u, 649202596u, 3198557846u, 86297113u, 0, TAN_TOLERANCE, 0}, +{ 666, 3245366392u, 3069064472u, 3237358008u, 23209276u, 1071509322u, 3234392254u, 0, TAN_TOLERANCE, 0}, +{ 667, 1081235288u, 1867297860u, 1072956607u, 2513414118u, 1074517732u, 2357944421u, 0, TAN_TOLERANCE, 0}, +{ 668, 3250533347u, 3171788768u, 3235208783u, 162138697u, 1074879793u, 3994846525u, 0, TAN_TOLERANCE, 0}, +{ 669, 1081728455u, 1245110700u, 1081653954u, 2584994077u, 3220272741u, 1136402195u, 0, TAN_TOLERANCE, 0}, +{ 670, 3245510120u, 3347226587u, 1058962932u, 2291943376u, 1071151630u, 2408276492u, 0, TAN_TOLERANCE, 0}, +{ 671, 1058899062u, 966940828u, 1060726420u, 2798041096u, 1058899062u, 1002054341u, 0, TAN_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1073683919u, 1905677821u, 0, TAN_TOLERANCE, 0}, +{ 673, 3248116497u, 1671039260u, 1086395032u, 3745833360u, 3218381141u, 2264716022u, 0, TAN_TOLERANCE, 0}, +{ 674, 1057078797u, 651714217u, 1047070645u, 2130549237u, 1057078797u, 653620621u, 0, TAN_TOLERANCE, 0}, +{ 675, 3207115731u, 1423000172u, 3247822717u, 1551488170u, 3207115731u, 1505322649u, 0, TAN_TOLERANCE, 0}, +{ 676, 3201597307u, 921077236u, 3213332351u, 1431049019u, 3201597307u, 921123170u, 0, TAN_TOLERANCE, 0}, +{ 677, 1067510295u, 655715547u, 3190985373u, 1527556471u, 1067510698u, 2547250551u, 0, TAN_TOLERANCE, 0}, +{ 678, 3227654979u, 4110878657u, 3251297180u, 879739345u, 3218509109u, 2423441325u, 0, TAN_TOLERANCE, 0}, +{ 679, 1085804762u, 2623955764u, 1093699897u, 1216444475u, 1070118810u, 3472479979u, 0, TAN_TOLERANCE, 0}, +{ 680, 1091905603u, 107442539u, 3239767031u, 1149813329u, 1071923940u, 457790337u, 0, TAN_TOLERANCE, 0}, +{ 681, 3233445240u, 1761361082u, 3226030205u, 1121849716u, 3217653293u, 4119342134u, 0, TAN_TOLERANCE, 0}, +{ 682, 3240087115u, 2534144722u, 1044223733u, 3512285706u, 3224103620u, 2429523598u, 0, TAN_TOLERANCE, 0}, +{ 683, 3211846077u, 4073670723u, 1050729852u, 3034818849u, 3211846084u, 915461231u, 0, TAN_TOLERANCE, 0}, +{ 684, 1101984574u, 1421423503u, 1060278048u, 1397153092u, 1072776793u, 1253204266u, 0, TAN_TOLERANCE, 0}, +{ 685, 3217421829u, 1649206019u, 1104525577u, 1267104290u, 3217436119u, 2880193675u, 0, TAN_TOLERANCE, 0}, +{ 686, 3189302097u, 3775270392u, 1040251850u, 68667319u, 3189302097u, 3775270392u, 0, TAN_TOLERANCE, 0}, +{ 687, 3204330900u, 3099226694u, 3254103006u, 4020102648u, 3204330900u, 3101579254u, 0, TAN_TOLERANCE, 0}, +{ 688, 3201591712u, 3718441177u, 3215643451u, 4032951536u, 3201591712u, 3718486539u, 0, TAN_TOLERANCE, 0}, +{ 689, 1044131371u, 508048351u, 3210196713u, 1707937896u, 1044131371u, 508048351u, 0, TAN_TOLERANCE, 0}, +{ 690, 3198611627u, 2784738160u, 1073435430u, 1109346010u, 3198611627u, 2784739166u, 0, TAN_TOLERANCE, 0}, +{ 691, 3225725290u, 3331916473u, 3238794568u, 2707019594u, 3219179196u, 1878996346u, 0, TAN_TOLERANCE, 0}, +{ 692, 1093182670u, 3093165197u, 1072894805u, 2853215019u, 3217526033u, 2848721056u, 0, TAN_TOLERANCE, 0}, +{ 693, 3216582139u, 2135797997u, 1048399559u, 2941926126u, 3216587461u, 2824369149u, 0, TAN_TOLERANCE, 0}, +{ 694, 1048430980u, 2083412145u, 3249335391u, 507212448u, 1048430980u, 2083412179u, 0, TAN_TOLERANCE, 0}, +{ 695, 1075363751u, 4270176401u, 3246546709u, 3288753319u, 3216549950u, 3510999752u, 0, TAN_TOLERANCE, 0}, +{ 696, 3247932863u, 3692175292u, 3197271515u, 3989064196u, 1075194806u, 1737451979u, 0, TAN_TOLERANCE, 0}, +{ 697, 3251691738u, 3111924274u, 1066772558u, 59281695u, 1070740573u, 1549531850u, 0, TAN_TOLERANCE, 0}, +{ 698, 1067683911u, 2135245466u, 3208804313u, 3846547392u, 1067684535u, 3577147149u, 0, TAN_TOLERANCE, 0}, +{ 699, 1094877811u, 972051266u, 3222814246u, 3539700586u, 1073113122u, 2031122011u, 0, TAN_TOLERANCE, 0}, +{ 700, 3202965930u, 330951080u, 1079189813u, 583922384u, 3202965930u, 331299907u, 0, TAN_TOLERANCE, 0}, +{ 701, 1089640092u, 1711944085u, 1104170032u, 643991456u, 1074425836u, 759692993u, 0, TAN_TOLERANCE, 0}, +{ 702, 3234429549u, 2072550721u, 3250147641u, 4280263530u, 3220634492u, 1689537566u, 0, TAN_TOLERANCE, 0}, +{ 703, 3192972706u, 1566376352u, 1067251433u, 72984588u, 3192972706u, 1566376352u, 0, TAN_TOLERANCE, 0}, +{ 704, 1095276569u, 3103043079u, 1045853123u, 410067497u, 3219184490u, 2989790297u, 0, TAN_TOLERANCE, 0}, +{ 705, 3216672493u, 1910366299u, 1081770885u, 634683073u, 3216678742u, 2219186766u, 0, TAN_TOLERANCE, 0}, +{ 706, 1081530688u, 2226525875u, 3224149290u, 2126302825u, 1073875863u, 3373110948u, 0, TAN_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1075672286u, 2180760441u, 0, TAN_TOLERANCE, 0}, +{ 708, 1066482943u, 1953339096u, 1077176252u, 1476516558u, 1066483050u, 796594176u, 0, TAN_TOLERANCE, 0}, +{ 709, 1066092000u, 1306277326u, 1079089150u, 4093716191u, 1066092105u, 4157158941u, 0, TAN_TOLERANCE, 0}, +{ 710, 3233148787u, 51750045u, 3242913901u, 4256866157u, 3222988569u, 439136879u, 0, TAN_TOLERANCE, 0}, +{ 711, 3195084967u, 2163853087u, 3232053146u, 2962422808u, 3195084967u, 2163853094u, 0, TAN_TOLERANCE, 0}, +{ 712, 1075516945u, 1618388148u, 3233154824u, 3711953164u, 1071710292u, 1922481399u, 0, TAN_TOLERANCE, 0}, +{ 713, 3246868002u, 357108214u, 3202294604u, 2306775262u, 1072903322u, 605160679u, 0, TAN_TOLERANCE, 0}, +{ 714, 3201904086u, 2571356437u, 3249064063u, 2394851808u, 3201904086u, 2571441574u, 0, TAN_TOLERANCE, 0}, +{ 715, 3230488091u, 4273880094u, 1103698617u, 3578832032u, 1071947813u, 4287022097u, 0, TAN_TOLERANCE, 0}, +{ 716, 3233426701u, 2091068742u, 3228270226u, 3980489730u, 3215078902u, 1010047045u, 0, TAN_TOLERANCE, 0}, +{ 717, 3229016752u, 2772307714u, 1051008486u, 32546576u, 1075245665u, 462916900u, 0, TAN_TOLERANCE, 0}, +{ 718, 3241229215u, 2143788498u, 3195498043u, 3630119231u, 3221585624u, 179270373u, 0, TAN_TOLERANCE, 0}, +{ 719, 3198632935u, 2527385594u, 3240503648u, 3482095012u, 3198632935u, 2527386643u, 0, TAN_TOLERANCE, 0}, +{ 720, 3242168799u, 2690097362u, 1068598730u, 2360266862u, 3220602288u, 418300175u, 0, TAN_TOLERANCE, 0}, +{ 721, 1058857869u, 2673272949u, 1082639557u, 522449749u, 1058857869u, 2706190749u, 0, TAN_TOLERANCE, 0}, +{ 722, 1104424147u, 3596379400u, 3242016775u, 2002293002u, 3221113564u, 1902628924u, 0, TAN_TOLERANCE, 0}, +{ 723, 1099439656u, 4113224369u, 3222122439u, 2152316893u, 1071885781u, 1950205565u, 0, TAN_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 1078500715u, 94481049u, 0, TAN_TOLERANCE, 0}, +{ 725, 3250463757u, 2489659568u, 1097051253u, 277506957u, 3220359518u, 3160316980u, 0, TAN_TOLERANCE, 0}, +{ 726, 3191401834u, 3850162281u, 3213841942u, 438724093u, 3191401834u, 3850162281u, 0, TAN_TOLERANCE, 0}, +{ 727, 1095392535u, 2431814052u, 1075518084u, 2672434118u, 3213954599u, 974405380u, 0, TAN_TOLERANCE, 0}, +{ 728, 3243162735u, 391606792u, 1048184750u, 4168944276u, 3221302992u, 3451129745u, 0, TAN_TOLERANCE, 0}, +{ 729, 3247792416u, 457529672u, 3201090276u, 72407935u, 3222315239u, 1160982851u, 0, TAN_TOLERANCE, 0}, +{ 730, 3218720719u, 3954981400u, 1052053242u, 2411049585u, 3218818453u, 61902234u, 0, TAN_TOLERANCE, 0}, +{ 731, 1086180091u, 485456950u, 1088415093u, 1655397424u, 3220221131u, 2324510511u, 0, TAN_TOLERANCE, 0}, +{ 732, 3198234428u, 1551748070u, 3236871640u, 1329701152u, 3198234428u, 1551748493u, 0, TAN_TOLERANCE, 0}, +{ 733, 3224639122u, 3099222537u, 1104984570u, 4293792842u, 3221696756u, 3006182604u, 0, TAN_TOLERANCE, 0}, +{ 734, 3203949705u, 3603065260u, 3197735968u, 2402359253u, 3203949705u, 3604303771u, 0, TAN_TOLERANCE, 0}, +{ 735, 3198824584u, 3961208159u, 3219057584u, 2340553876u, 3198824584u, 3961209656u, 0, TAN_TOLERANCE, 0}, +{ 736, 1074881909u, 4014841779u, 3197672877u, 3697233334u, 1074072291u, 3216031119u, 0, TAN_TOLERANCE, 0}, +{ 737, 3213275657u, 1403876392u, 3254028950u, 921363393u, 3213275718u, 925891589u, 0, TAN_TOLERANCE, 0}, +{ 738, 1107251806u, 1862576361u, 3194031708u, 2476290925u, 1066826438u, 3927706251u, 0, TAN_TOLERANCE, 0}, +{ 739, 1049661768u, 1454212851u, 1088378861u, 3400401866u, 1049661768u, 1454212946u, 0, TAN_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1069568065u, 3064462875u, 0, TAN_TOLERANCE, 0}, +{ 741, 3216409282u, 1199568671u, 3225679997u, 46947405u, 3216413096u, 1759976264u, 0, TAN_TOLERANCE, 0}, +{ 742, 1077685537u, 2596231448u, 3253943728u, 2219151748u, 3216584142u, 1488430398u, 0, TAN_TOLERANCE, 0}, +{ 743, 1066527035u, 4119719558u, 3222036299u, 1275474618u, 1066527155u, 2928830600u, 0, TAN_TOLERANCE, 0}, +{ 744, 3239908663u, 3347296825u, 1101507910u, 1254014794u, 1072809120u, 869332103u, 0, TAN_TOLERANCE, 0}, +{ 745, 1084119992u, 673775040u, 1070743626u, 244126093u, 1075534323u, 698300927u, 0, TAN_TOLERANCE, 0}, +{ 746, 3203199850u, 1832066983u, 1051358028u, 3262483417u, 3203199850u, 1832584640u, 0, TAN_TOLERANCE, 0}, +{ 747, 1077559600u, 3962610501u, 3198598777u, 849269178u, 1073781704u, 804173689u, 0, TAN_TOLERANCE, 0}, +{ 748, 3235473900u, 2497516122u, 3254374111u, 2821429629u, 1074308595u, 3100151219u, 0, TAN_TOLERANCE, 0}, +{ 749, 1076236288u, 2805941787u, 3217785843u, 779131141u, 3225158579u, 3900803877u, 0, TAN_TOLERANCE, 0}, +{ 750, 3226908686u, 723423605u, 1084533420u, 627282213u, 1070465931u, 3949309375u, 0, TAN_TOLERANCE, 0}, +{ 751, 3215947680u, 4292778869u, 1078101071u, 1676860147u, 3215950281u, 2069249548u, 0, TAN_TOLERANCE, 0}, +{ 752, 1076288502u, 3528118587u, 3194648564u, 2363260897u, 3221307988u, 19736518u, 0, TAN_TOLERANCE, 0}, +{ 753, 3192897879u, 1307010018u, 1061248120u, 1468743108u, 3192897879u, 1307010019u, 0, TAN_TOLERANCE, 0}, +{ 754, 3246583139u, 107905661u, 3226089788u, 1943427674u, 3222568369u, 1322611276u, 0, TAN_TOLERANCE, 0}, +{ 755, 3188230541u, 760006940u, 1054265604u, 1749976597u, 3188230541u, 760006940u, 0, TAN_TOLERANCE, 0}, +{ 756, 3237773384u, 2787503556u, 1081282610u, 1195841206u, 1073441083u, 1059539068u, 0, TAN_TOLERANCE, 0}, +{ 757, 3191802156u, 545462045u, 3208381743u, 1981311808u, 3191802156u, 545462045u, 0, TAN_TOLERANCE, 0}, +{ 758, 1061232136u, 3657978397u, 1104463616u, 3501253426u, 1061232136u, 4096232730u, 0, TAN_TOLERANCE, 0}, +{ 759, 1049883857u, 1804177501u, 3210693633u, 3606766729u, 1049883857u, 1804177667u, 0, TAN_TOLERANCE, 0}, +{ 760, 1076856879u, 1336278526u, 1043741618u, 3165279431u, 1068350898u, 491456471u, 0, TAN_TOLERANCE, 0}, +{ 761, 1055471915u, 1599382075u, 1058018527u, 4212580517u, 1055471915u, 1599724421u, 0, TAN_TOLERANCE, 0}, +{ 762, 3207502326u, 3007589929u, 3202026547u, 2792028313u, 3207502326u, 3164093214u, 0, TAN_TOLERANCE, 0}, +{ 763, 3253082770u, 1866066996u, 1060329048u, 3727175322u, 1072698640u, 3872927457u, 0, TAN_TOLERANCE, 0}, +{ 764, 3198416643u, 150890940u, 1056025306u, 3082724735u, 3198416643u, 150891603u, 0, TAN_TOLERANCE, 0}, +{ 765, 1062008939u, 80400395u, 1093584426u, 3478941315u, 1062008939u, 2205021603u, 0, TAN_TOLERANCE, 0}, +{ 766, 3251640614u, 4050954182u, 3219263194u, 2537475930u, 1069381185u, 3828509291u, 0, TAN_TOLERANCE, 0}, +{ 767, 1064841871u, 2881752155u, 3212589299u, 2559651278u, 1064841890u, 512262744u, 0, TAN_TOLERANCE, 0}, +{ 768, 3249016304u, 440309030u, 3214267461u, 3788040806u, 3219236838u, 312619054u, 0, TAN_TOLERANCE, 0}, +{ 769, 1100476615u, 918813144u, 3208535698u, 1607035904u, 3221517627u, 3644569098u, 0, TAN_TOLERANCE, 0}, +{ 770, 1042137451u, 2497054124u, 1089139147u, 2549609010u, 1042137451u, 2497054124u, 0, TAN_TOLERANCE, 0}, +{ 771, 1047037641u, 790219083u, 1054657139u, 2797979479u, 1047037641u, 790219088u, 0, TAN_TOLERANCE, 0}, +{ 772, 1057781400u, 1149462078u, 1095765205u, 3879963182u, 1057781400u, 1157333128u, 0, TAN_TOLERANCE, 0}, +{ 773, 3202729813u, 2684353926u, 3205212854u, 1732474928u, 3202729813u, 2684574296u, 0, TAN_TOLERANCE, 0}, +{ 774, 1095236965u, 2742237025u, 1051317716u, 3386396147u, 1070950125u, 4063976668u, 0, TAN_TOLERANCE, 0}, +{ 775, 1063230986u, 3408320912u, 1103071166u, 4233059513u, 1063230989u, 1570710087u, 0, TAN_TOLERANCE, 0}, +{ 776, 1064863548u, 1077495917u, 1088399968u, 433115118u, 1064863567u, 2001865724u, 0, TAN_TOLERANCE, 0}, +{ 777, 3204547572u, 841366493u, 1051716814u, 4121125128u, 3204547572u, 843200674u, 0, TAN_TOLERANCE, 0}, +{ 778, 1064632084u, 321857207u, 1089128010u, 1149988239u, 1064632096u, 547429103u, 0, TAN_TOLERANCE, 0}, +{ 779, 3245542663u, 799866606u, 3197637091u, 3924438208u, 3211532957u, 3662721595u, 0, TAN_TOLERANCE, 0}, +{ 780, 3191062890u, 2002049816u, 1077053447u, 2240354761u, 3191062890u, 2002049816u, 0, TAN_TOLERANCE, 0}, +{ 781, 3229006283u, 478939968u, 1097035749u, 1066716440u, 1072752037u, 2531096848u, 0, TAN_TOLERANCE, 0}, +{ 782, 3232473641u, 1653104725u, 1088548129u, 81977716u, 1071090445u, 506086843u, 0, TAN_TOLERANCE, 0}, +{ 783, 3196861276u, 3899475018u, 3189694084u, 3330093036u, 3196861276u, 3899475135u, 0, TAN_TOLERANCE, 0}, +{ 784, 1089312583u, 2612450289u, 1079065127u, 603380842u, 1073008863u, 3887211481u, 0, TAN_TOLERANCE, 0}, +{ 785, 1100636791u, 3962735564u, 1101570429u, 1372490825u, 3220290720u, 1010454053u, 0, TAN_TOLERANCE, 0}, +{ 786, 1054806016u, 1479841439u, 1059312257u, 541504905u, 1054806016u, 1480001287u, 0, TAN_TOLERANCE, 0}, +{ 787, 1078662178u, 2626148789u, 1057571099u, 4121656076u, 1072550701u, 103347377u, 0, TAN_TOLERANCE, 0}, +{ 788, 1081613389u, 1902560314u, 1043130231u, 3557671562u, 3219664068u, 2202748350u, 0, TAN_TOLERANCE, 0}, +{ 789, 3193829772u, 41779312u, 1081626342u, 831171823u, 3193829772u, 41779314u, 0, TAN_TOLERANCE, 0}, +{ 790, 1058131100u, 1393168821u, 1066457405u, 1381616968u, 1058131100u, 1400868003u, 0, TAN_TOLERANCE, 0}, +{ 791, 1072338141u, 3756584649u, 3222267229u, 1423157432u, 1072792768u, 1008405082u, 0, TAN_TOLERANCE, 0}, +{ 792, 3254435674u, 1894912556u, 1042426694u, 155024547u, 3218179819u, 2046959496u, 0, TAN_TOLERANCE, 0}, +{ 793, 3195453512u, 35164295u, 3203391785u, 1037041084u, 3195453512u, 35164310u, 0, TAN_TOLERANCE, 0}, +{ 794, 1084777479u, 3957875950u, 3232195211u, 1590756436u, 3219947575u, 33029473u, 0, TAN_TOLERANCE, 0}, +{ 795, 1068844322u, 1447585080u, 1071279485u, 1107922438u, 1068847538u, 3657603058u, 0, TAN_TOLERANCE, 0}, +{ 796, 1046252518u, 981897615u, 1051856116u, 430357614u, 1046252518u, 981897617u, 0, TAN_TOLERANCE, 0}, +{ 797, 3227524215u, 395145384u, 3219821938u, 50586510u, 3216350661u, 266931658u, 0, TAN_TOLERANCE, 0}, +{ 798, 1069775912u, 750827797u, 1082862669u, 230466783u, 1069785868u, 656722732u, 0, TAN_TOLERANCE, 0}, +{ 799, 1086668819u, 1365083575u, 3204848310u, 1700831722u, 1072758492u, 877880103u, 0, TAN_TOLERANCE, 0}, +{ 800, 3218090390u, 344241827u, 1071538935u, 2715566077u, 3218113497u, 943457430u, 0, TAN_TOLERANCE, 0}, +{ 801, 3247582856u, 4069301823u, 3193208760u, 2949125229u, 3220500077u, 3721096040u, 0, TAN_TOLERANCE, 0}, +{ 802, 1103231387u, 3585711710u, 1065801594u, 2302229267u, 1073052568u, 2823852135u, 0, TAN_TOLERANCE, 0}, +{ 803, 3194118956u, 709803845u, 1048741487u, 2296910194u, 3194118956u, 709803847u, 0, TAN_TOLERANCE, 0}, +{ 804, 3193280779u, 744421179u, 1069302001u, 2659232829u, 3193280779u, 744421180u, 0, TAN_TOLERANCE, 0}, +{ 805, 1092835968u, 1799949903u, 3192522886u, 4212149209u, 3222671637u, 2782741478u, 0, TAN_TOLERANCE, 0}, +{ 806, 3206108502u, 145234164u, 3250614064u, 912384201u, 3206108502u, 167432287u, 0, TAN_TOLERANCE, 0}, +{ 807, 3240510664u, 2784620507u, 1102812948u, 3531481022u, 1071861957u, 1209927963u, 0, TAN_TOLERANCE, 0}, +{ 808, 3251159663u, 383952592u, 3205659905u, 3633194728u, 1073108607u, 1305867219u, 0, TAN_TOLERANCE, 0}, +{ 809, 3203476252u, 3792395543u, 1070072378u, 3864816376u, 3203476252u, 3792827369u, 0, TAN_TOLERANCE, 0}, +{ 810, 3205316273u, 2115553675u, 1066288499u, 3538377867u, 3205316273u, 2124091140u, 0, TAN_TOLERANCE, 0}, +{ 811, 3252075185u, 1230026762u, 1090719723u, 440819880u, 3220809625u, 1855897437u, 0, TAN_TOLERANCE, 0}, +{ 812, 3194595076u, 2991290482u, 1096886719u, 1097971167u, 3194595076u, 2991290487u, 0, TAN_TOLERANCE, 0}, +{ 813, 1090048600u, 1098035020u, 3230900504u, 1479059095u, 1074542433u, 1727465346u, 0, TAN_TOLERANCE, 0}, +{ 814, 3251056964u, 1719428427u, 3188631907u, 3707377409u, 1074529400u, 867101846u, 0, TAN_TOLERANCE, 0}, +{ 815, 1053236165u, 3748932896u, 1084908557u, 1325384361u, 1053236165u, 3748949349u, 0, TAN_TOLERANCE, 0}, +{ 816, 1084704076u, 3979168763u, 1057455255u, 2454615952u, 1071422651u, 515448681u, 0, TAN_TOLERANCE, 0}, +{ 817, 1053106984u, 1449164578u, 1056960316u, 1654931641u, 1053106984u, 1449177170u, 0, TAN_TOLERANCE, 0}, +{ 818, 1071439010u, 2120487381u, 3226298974u, 2364226633u, 1071578601u, 3101860884u, 0, TAN_TOLERANCE, 0}, +{ 819, 1075071428u, 1074268944u, 1065730444u, 280016852u, 3221571272u, 473828447u, 0, TAN_TOLERANCE, 0}, +{ 820, 3200308256u, 3315127889u, 3236295594u, 2900924954u, 3200308256u, 3315134244u, 0, TAN_TOLERANCE, 0}, +{ 821, 3196425891u, 2246037502u, 1049691002u, 1496066550u, 3196425891u, 2246037554u, 0, TAN_TOLERANCE, 0}, +{ 822, 3193006859u, 4191285446u, 3217936236u, 2382392789u, 3193006859u, 4191285446u, 0, TAN_TOLERANCE, 0}, +{ 823, 1092833308u, 640099844u, 1042152237u, 2064279383u, 1071765815u, 106826017u, 0, TAN_TOLERANCE, 0}, +{ 824, 1079913438u, 3468560824u, 1093251038u, 310958750u, 1074618739u, 964701519u, 0, TAN_TOLERANCE, 0}, +{ 825, 1096788400u, 1413568905u, 1100941106u, 1627289946u, 3219861883u, 2605802298u, 0, TAN_TOLERANCE, 0}, +{ 826, 3191549550u, 3797143370u, 3195497539u, 3843275034u, 3191549550u, 3797143370u, 0, TAN_TOLERANCE, 0}, +{ 827, 3252077393u, 2806642640u, 3201943068u, 2515980718u, 3218102760u, 374409247u, 0, TAN_TOLERANCE, 0}, +{ 828, 1086877316u, 632580632u, 1078673506u, 3259601317u, 3220185630u, 3401299183u, 0, TAN_TOLERANCE, 0}, +{ 829, 3200980575u, 3309678799u, 1049337078u, 3056787074u, 3200980575u, 3309705299u, 0, TAN_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 1072115406u, 1493859610u, 0, TAN_TOLERANCE, 0}, +{ 831, 1067019674u, 932124675u, 1093915797u, 662682630u, 1067020016u, 3583760323u, 0, TAN_TOLERANCE, 0}, +{ 832, 3249230091u, 1367996113u, 3251723684u, 2974064663u, 1069437035u, 832804725u, 0, TAN_TOLERANCE, 0}, +{ 833, 1080230731u, 323437999u, 1090499064u, 901457511u, 1074630302u, 1396044198u, 0, TAN_TOLERANCE, 0}, +{ 834, 3235778876u, 4184941840u, 3196770014u, 2458988443u, 3222365184u, 3232213730u, 0, TAN_TOLERANCE, 0}, +{ 835, 1087618284u, 2023065054u, 3211994098u, 2734612965u, 3222159526u, 1007620686u, 0, TAN_TOLERANCE, 0}, +{ 836, 1064074694u, 3679267365u, 3237728785u, 1699558211u, 1064074702u, 1654930644u, 0, TAN_TOLERANCE, 0}, +{ 837, 1088079010u, 1826799031u, 1078709629u, 3986905229u, 1069698140u, 1279549780u, 0, TAN_TOLERANCE, 0}, +{ 838, 1052843785u, 351061688u, 3194386466u, 4105857588u, 1052843785u, 351068380u, 0, TAN_TOLERANCE, 0}, +{ 839, 1054128006u, 1365244058u, 1064457319u, 1452191426u, 1054128006u, 1365291479u, 0, TAN_TOLERANCE, 0}, +{ 840, 1064122385u, 2463030625u, 3215975031u, 3773488326u, 1064122393u, 2980179277u, 0, TAN_TOLERANCE, 0}, +{ 841, 3251276671u, 752664055u, 1065110394u, 1835931663u, 1070794184u, 1849724958u, 0, TAN_TOLERANCE, 0}, +{ 842, 1088045088u, 3496172149u, 1089617208u, 109068701u, 1073455741u, 2200569132u, 0, TAN_TOLERANCE, 0}, +{ 843, 3198135087u, 1636966254u, 1086098766u, 2016598298u, 3198135087u, 1636966916u, 0, TAN_TOLERANCE, 0}, +{ 844, 1050931318u, 3551516956u, 1097969102u, 1317953425u, 1050931318u, 3551517617u, 0, TAN_TOLERANCE, 0}, +{ 845, 3229832217u, 2977627788u, 1045339018u, 516058480u, 1071228652u, 1624784694u, 0, TAN_TOLERANCE, 0}, +{ 846, 3237408578u, 3901731263u, 3189566462u, 32272932u, 3218229315u, 1632924751u, 0, TAN_TOLERANCE, 0}, +{ 847, 1077281796u, 1956025297u, 3246628529u, 3840733905u, 1067000694u, 1129527548u, 0, TAN_TOLERANCE, 0}, +{ 848, 1099818036u, 561057891u, 3198494340u, 4271027193u, 3219784884u, 1730936066u, 0, TAN_TOLERANCE, 0}, +{ 849, 3250929921u, 692989850u, 3242630588u, 2492225971u, 1073186106u, 790327840u, 0, TAN_TOLERANCE, 0}, +{ 850, 3205479397u, 3439913962u, 1067477011u, 2973333638u, 3205479397u, 3450822138u, 0, TAN_TOLERANCE, 0}, +{ 851, 3213993989u, 877613377u, 1044917899u, 809672798u, 3213994103u, 3825407549u, 0, TAN_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 3219716531u, 431784327u, 0, TAN_TOLERANCE, 0}, +{ 853, 3246346629u, 2645567288u, 1051258339u, 557182478u, 3221881274u, 64244743u, 0, TAN_TOLERANCE, 0}, +{ 854, 3204057950u, 186287752u, 1061342054u, 4054003419u, 3204057950u, 187795268u, 0, TAN_TOLERANCE, 0}, +{ 855, 1097266673u, 3506889716u, 3243866036u, 519056371u, 1071339869u, 2789308492u, 0, TAN_TOLERANCE, 0}, +{ 856, 1042654053u, 2171898436u, 3246911982u, 1091500784u, 1042654053u, 2171898436u, 0, TAN_TOLERANCE, 0}, +{ 857, 3243647673u, 368493885u, 3222871893u, 1419055230u, 1076440210u, 3154672031u, 0, TAN_TOLERANCE, 0}, +{ 858, 1091950572u, 2010971245u, 3188804530u, 1518695799u, 3220286110u, 4209056249u, 0, TAN_TOLERANCE, 0}, +{ 859, 3205426509u, 1239207795u, 1040192984u, 2199481342u, 3205426509u, 1249304750u, 0, TAN_TOLERANCE, 0}, +{ 860, 3210978637u, 4264613432u, 3203460972u, 3558930895u, 3210978640u, 1980632273u, 0, TAN_TOLERANCE, 0}, +{ 861, 1050299283u, 3772748958u, 3227667376u, 309688336u, 1050299283u, 3772749337u, 0, TAN_TOLERANCE, 0}, +{ 862, 3230743041u, 1077949160u, 1075769893u, 2405271377u, 1070180192u, 446368177u, 0, TAN_TOLERANCE, 0}, +{ 863, 1091835152u, 3751608506u, 3232278094u, 930375071u, 3217726898u, 3481548138u, 0, TAN_TOLERANCE, 0}, +{ 864, 3198617153u, 1518334131u, 3205247482u, 791756713u, 3198617153u, 1518335148u, 0, TAN_TOLERANCE, 0}, +{ 865, 1047317453u, 2825203170u, 3245054001u, 1822981827u, 1047317453u, 2825203178u, 0, TAN_TOLERANCE, 0}, +{ 866, 1100016363u, 514474738u, 1089072073u, 3300845441u, 3217319144u, 2916802364u, 0, TAN_TOLERANCE, 0}, +{ 867, 3216391250u, 247369460u, 3197320093u, 687450958u, 3216394925u, 3233522059u, 0, TAN_TOLERANCE, 0}, +{ 868, 1104161422u, 2722237629u, 1058272368u, 90602316u, 1073200343u, 2302788437u, 0, TAN_TOLERANCE, 0}, +{ 869, 3208098435u, 1845900544u, 3231520830u, 3389751458u, 3208098435u, 2136608077u, 0, TAN_TOLERANCE, 0}, +{ 870, 3247535245u, 737689911u, 3195377751u, 3462616966u, 3219253037u, 3883211308u, 0, TAN_TOLERANCE, 0}, +{ 871, 3223538384u, 3620285831u, 1055501023u, 2708056059u, 3217870312u, 2224856412u, 0, TAN_TOLERANCE, 0}, +{ 872, 3219464996u, 4073430285u, 1056206159u, 172017902u, 3219709169u, 2516376400u, 0, TAN_TOLERANCE, 0}, +{ 873, 3212869638u, 2799176222u, 1052706894u, 4083892667u, 3212869662u, 211559933u, 0, TAN_TOLERANCE, 0}, +{ 874, 3202279557u, 1562351330u, 1069705601u, 1247765260u, 3202279557u, 1562508809u, 0, TAN_TOLERANCE, 0}, +{ 875, 3232717299u, 51853475u, 3189080201u, 2783553144u, 3221383237u, 3613213752u, 0, TAN_TOLERANCE, 0}, +{ 876, 3219454353u, 3851781549u, 3241598113u, 514064046u, 3219692168u, 1685602423u, 0, TAN_TOLERANCE, 0}, +{ 877, 1100045965u, 934745487u, 3248182437u, 2798581921u, 3217714806u, 3046333778u, 0, TAN_TOLERANCE, 0}, +{ 878, 3213082493u, 2948648757u, 3232177250u, 4278702895u, 3213082533u, 3433940202u, 0, TAN_TOLERANCE, 0}, +{ 879, 1072485724u, 4259101461u, 1061606772u, 84229920u, 1072968884u, 431127016u, 0, TAN_TOLERANCE, 0}, +{ 880, 3198075559u, 3891230598u, 1095924595u, 3049217547u, 3198075559u, 3891231204u, 0, TAN_TOLERANCE, 0}, +{ 881, 1077353053u, 3806018919u, 3243191216u, 280177341u, 1073754255u, 3810288957u, 0, TAN_TOLERANCE, 0}, +{ 882, 1060624530u, 3900344258u, 1063647809u, 4206745890u, 1060624530u, 4196557767u, 0, TAN_TOLERANCE, 0}, +{ 883, 3227707336u, 2126253040u, 3207248026u, 808507485u, 3219040601u, 2852753536u, 0, TAN_TOLERANCE, 0}, +{ 884, 1086090317u, 3465685634u, 3230391053u, 3754958214u, 1071200193u, 1669130251u, 0, TAN_TOLERANCE, 0}, +{ 885, 1102861084u, 461094531u, 1101110393u, 1316091396u, 1072468733u, 843744847u, 0, TAN_TOLERANCE, 0}, +{ 886, 1064980314u, 4197635149u, 1091873113u, 1240127141u, 1064980338u, 2969927074u, 0, TAN_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 3213440672u, 2883250875u, 0, TAN_TOLERANCE, 0}, +{ 888, 3213429165u, 3744663425u, 3212482771u, 953662066u, 3213429247u, 2691908692u, 0, TAN_TOLERANCE, 0}, +{ 889, 1085171305u, 3564196690u, 3228101916u, 904305212u, 3221639481u, 1195407422u, 0, TAN_TOLERANCE, 0}, +{ 890, 1048333111u, 3566257266u, 3235138829u, 2734275140u, 1048333111u, 3566257295u, 0, TAN_TOLERANCE, 0}, +{ 891, 3243948477u, 606044282u, 3241318094u, 2446416887u, 3219064278u, 3185355282u, 0, TAN_TOLERANCE, 0}, +{ 892, 1041627284u, 2336116589u, 3197594053u, 2296925138u, 1041627284u, 2336116589u, 0, TAN_TOLERANCE, 0}, +{ 893, 1058567659u, 907670625u, 3240769036u, 1827119006u, 1058567659u, 927652723u, 0, TAN_TOLERANCE, 0}, +{ 894, 1044467183u, 2818710946u, 3246059905u, 553394170u, 1044467183u, 2818710946u, 0, TAN_TOLERANCE, 0}, +{ 895, 3189504094u, 4099522736u, 3232742168u, 3718083858u, 3189504094u, 4099522736u, 0, TAN_TOLERANCE, 0}, +{ 896, 1092371276u, 1059279404u, 1080245336u, 175941677u, 1072889821u, 515486077u, 0, TAN_TOLERANCE, 0}, +{ 897, 1105189691u, 1650862428u, 1061816101u, 1723201723u, 3218686305u, 2616609059u, 0, TAN_TOLERANCE, 0}, +{ 898, 3239012814u, 2462163405u, 3218946201u, 3876535372u, 3219344333u, 2502875662u, 0, TAN_TOLERANCE, 0}, +{ 899, 1084392886u, 495844137u, 1073721460u, 772777946u, 3220942669u, 3586727170u, 0, TAN_TOLERANCE, 0}, +{ 900, 1052415330u, 458757721u, 3245680321u, 3609892707u, 1052415330u, 458763983u, 0, TAN_TOLERANCE, 0}, +{ 901, 3193282956u, 2533012202u, 1079980803u, 3592268374u, 3193282956u, 2533012203u, 0, TAN_TOLERANCE, 0}, +{ 902, 3203364780u, 4108274117u, 1063045844u, 571992389u, 3203364780u, 4108938846u, 0, TAN_TOLERANCE, 0}, +{ 903, 1090567271u, 3541110973u, 1096296754u, 3118427427u, 3221848883u, 3041741205u, 0, TAN_TOLERANCE, 0}, +{ 904, 3193980043u, 1213941007u, 1105433735u, 2172963370u, 3193980043u, 1213941008u, 0, TAN_TOLERANCE, 0}, +{ 905, 1096853359u, 272190288u, 1095452370u, 4026581530u, 3220146629u, 3829308268u, 0, TAN_TOLERANCE, 0}, +{ 906, 1095583909u, 2843638672u, 1100510986u, 3190536898u, 3223757143u, 2541776483u, 0, TAN_TOLERANCE, 0}, +{ 907, 1083757094u, 2014317727u, 3247389683u, 2428462015u, 3221228537u, 1632670009u, 0, TAN_TOLERANCE, 0}, +{ 908, 1093976717u, 688442200u, 1047852515u, 3035186380u, 3221648779u, 3546017257u, 0, TAN_TOLERANCE, 0}, +{ 909, 1076664212u, 1010095511u, 3221288076u, 405287991u, 3222861453u, 2232630897u, 0, TAN_TOLERANCE, 0}, +{ 910, 3252294615u, 2983070435u, 1089546472u, 2907918480u, 3221936746u, 378512360u, 0, TAN_TOLERANCE, 0}, +{ 911, 1082988121u, 81928569u, 1056007286u, 2740556321u, 1072918381u, 1311078634u, 0, TAN_TOLERANCE, 0}, +{ 912, 1041110867u, 2076689028u, 1081558619u, 3039159031u, 1041110867u, 2076689028u, 0, TAN_TOLERANCE, 0}, +{ 913, 1047307438u, 1376882094u, 3211003208u, 1296286481u, 1047307438u, 1376882102u, 0, TAN_TOLERANCE, 0}, +{ 914, 1080114314u, 744133164u, 3200943494u, 955832216u, 3218506405u, 2741895831u, 0, TAN_TOLERANCE, 0}, +{ 915, 3226290326u, 176522478u, 1069999908u, 2891249491u, 1073785249u, 968808067u, 0, TAN_TOLERANCE, 0}, +{ 916, 1043564602u, 3685851715u, 3187829932u, 2363997529u, 1043564602u, 3685851715u, 0, TAN_TOLERANCE, 0}, +{ 917, 1040244055u, 3974431579u, 1052505165u, 2589067816u, 1040244055u, 3974431579u, 0, TAN_TOLERANCE, 0}, +{ 918, 3191496789u, 3819109588u, 1048561488u, 969143351u, 3191496789u, 3819109588u, 0, TAN_TOLERANCE, 0}, +{ 919, 1072639397u, 4246896124u, 1104584799u, 1940097860u, 1073189028u, 394587297u, 0, TAN_TOLERANCE, 0}, +{ 920, 1048038468u, 2228686199u, 3220231833u, 777624847u, 1048038468u, 2228686217u, 0, TAN_TOLERANCE, 0}, +{ 921, 3231467306u, 4189906558u, 3203004203u, 854242364u, 3217987474u, 2809199807u, 0, TAN_TOLERANCE, 0}, +{ 922, 1103910407u, 4089051094u, 3227282692u, 2693170723u, 1072129371u, 3206579039u, 0, TAN_TOLERANCE, 0}, +{ 923, 1045883607u, 1278581412u, 3239296746u, 1774588717u, 1045883607u, 1278581413u, 0, TAN_TOLERANCE, 0}, +{ 924, 3222372686u, 1794845306u, 1104879344u, 4135865182u, 3221677563u, 3455106662u, 0, TAN_TOLERANCE, 0}, +{ 925, 1106449055u, 754938390u, 1061291430u, 2010786993u, 1073861270u, 2475943364u, 0, TAN_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 3222026453u, 3087782240u, 0, TAN_TOLERANCE, 0}, +{ 927, 3231449194u, 567588900u, 3195452230u, 1421366017u, 3222708424u, 1627728438u, 0, TAN_TOLERANCE, 0}, +{ 928, 3225089755u, 2708717091u, 1071975971u, 1364590470u, 1074658153u, 719778775u, 0, TAN_TOLERANCE, 0}, +{ 929, 3252137283u, 3461956134u, 3207820115u, 1605709634u, 1072185530u, 2879754131u, 0, TAN_TOLERANCE, 0}, +{ 930, 1065302996u, 1497124553u, 1051715442u, 916736957u, 1065303036u, 102289035u, 0, TAN_TOLERANCE, 0}, +{ 931, 1058468363u, 834914365u, 1064667143u, 2839166298u, 1058468363u, 851408530u, 0, TAN_TOLERANCE, 0}, +{ 932, 1057279949u, 2139295776u, 1062816721u, 914592523u, 1057279949u, 2142372604u, 0, TAN_TOLERANCE, 0}, +{ 933, 3189636931u, 851569132u, 1058503154u, 1399378677u, 3189636931u, 851569132u, 0, TAN_TOLERANCE, 0}, +{ 934, 3233537697u, 3897202342u, 3245382590u, 246600375u, 3216203689u, 401387137u, 0, TAN_TOLERANCE, 0}, +{ 935, 3225460308u, 3620429520u, 1055627557u, 229305u, 1074744460u, 4064404770u, 0, TAN_TOLERANCE, 0}, +{ 936, 1083958833u, 3641997865u, 3206673888u, 93720614u, 1073787691u, 215264583u, 0, TAN_TOLERANCE, 0}, +{ 937, 3227808435u, 32766320u, 1062084905u, 3668443038u, 3217871959u, 3354835440u, 0, TAN_TOLERANCE, 0}, +{ 938, 3223298996u, 2039713492u, 3248699388u, 1346210821u, 1077010417u, 482375156u, 0, TAN_TOLERANCE, 0}, +{ 939, 1093050016u, 1335820726u, 3191756860u, 1808427032u, 1073512079u, 967050696u, 0, TAN_TOLERANCE, 0}, +{ 940, 1061442763u, 650692001u, 1103515670u, 2253348763u, 1061442763u, 1385052594u, 0, TAN_TOLERANCE, 0}, +{ 941, 3191395187u, 2372623300u, 3210185343u, 3200572848u, 3191395187u, 2372623300u, 0, TAN_TOLERANCE, 0}, +{ 942, 1100796069u, 762317532u, 3194595095u, 3192607437u, 1073352751u, 3603794870u, 0, TAN_TOLERANCE, 0}, +{ 943, 1062262701u, 217775356u, 3232827087u, 2969367386u, 1062262701u, 1887701620u, 0, TAN_TOLERANCE, 0}, +{ 944, 1057172551u, 3621353969u, 1077994795u, 3873976266u, 1057172551u, 3623759699u, 0, TAN_TOLERANCE, 0}, +{ 945, 1091301987u, 268372152u, 3221764390u, 3216978962u, 3215235964u, 874297491u, 0, TAN_TOLERANCE, 0}, +{ 946, 3246437611u, 142942404u, 1075322987u, 1746449109u, 3224811534u, 2937642332u, 0, TAN_TOLERANCE, 0}, +{ 947, 1104006296u, 496534875u, 3254522293u, 2532372502u, 1072324347u, 3485810959u, 0, TAN_TOLERANCE, 0}, +{ 948, 3250225541u, 2999955409u, 3222793392u, 1868977643u, 1069873914u, 3710748236u, 0, TAN_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 3215249682u, 302869483u, 0, TAN_TOLERANCE, 0}, +{ 950, 1068218799u, 73646871u, 3231442171u, 3711510104u, 1068220577u, 543559658u, 0, TAN_TOLERANCE, 0}, +{ 951, 1090483524u, 218135177u, 3198908856u, 3082199105u, 3217418345u, 3997909065u, 0, TAN_TOLERANCE, 0}, +{ 952, 1068068480u, 1061628117u, 3248859043u, 86776158u, 1068069852u, 1289410425u, 0, TAN_TOLERANCE, 0}, +{ 953, 3208484674u, 938869114u, 1087911145u, 2416710759u, 3208484674u, 1504888383u, 0, TAN_TOLERANCE, 0}, +{ 954, 1095576832u, 2970853959u, 3239543429u, 1887505029u, 1072009655u, 2105862278u, 0, TAN_TOLERANCE, 0}, +{ 955, 3237728787u, 1337895935u, 1076463812u, 1172733328u, 3222440122u, 597922583u, 0, TAN_TOLERANCE, 0}, +{ 956, 1049139928u, 1469010822u, 3229583535u, 551399515u, 1049139928u, 1469010900u, 0, TAN_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 3218923673u, 2384358106u, 0, TAN_TOLERANCE, 0}, +{ 958, 3242138780u, 2976596113u, 3192137295u, 3033242648u, 1068509184u, 1974852383u, 0, TAN_TOLERANCE, 0}, +{ 959, 1098698481u, 876810930u, 3197470945u, 2571587447u, 3220700972u, 2135854542u, 0, TAN_TOLERANCE, 0}, +{ 960, 3241770810u, 4007797282u, 3225853845u, 4069319648u, 1074958621u, 2334482095u, 0, TAN_TOLERANCE, 0}, +{ 961, 1047279982u, 3840538373u, 1043189552u, 3668774580u, 1047279982u, 3840538380u, 0, TAN_TOLERANCE, 0}, +{ 962, 3217611704u, 200857661u, 3229758439u, 3359367736u, 3217632498u, 3651422596u, 0, TAN_TOLERANCE, 0}, +{ 963, 3248797869u, 111868139u, 3227902082u, 2366064003u, 3224837493u, 4262218833u, 0, TAN_TOLERANCE, 0}, +{ 964, 1044195166u, 3510904416u, 3222131653u, 3822770497u, 1044195166u, 3510904416u, 0, TAN_TOLERANCE, 0}, +{ 965, 3242675715u, 789151814u, 1099269239u, 2958956055u, 1071542351u, 2822923563u, 0, TAN_TOLERANCE, 0}, +{ 966, 1084679320u, 722163228u, 1105524559u, 1534462169u, 3220227031u, 3860692921u, 0, TAN_TOLERANCE, 0}, +{ 967, 1046586062u, 2207037106u, 3208952465u, 1231254630u, 1046586062u, 2207037108u, 0, TAN_TOLERANCE, 0}, +{ 968, 3197884060u, 3838689849u, 3198769679u, 1302617170u, 3197884060u, 3838690298u, 0, TAN_TOLERANCE, 0}, +{ 969, 1085938906u, 2527556476u, 3240373426u, 124352692u, 3219084764u, 837253910u, 0, TAN_TOLERANCE, 0}, +{ 970, 3199540805u, 3502371499u, 1043411944u, 4190072016u, 3199540805u, 3502374638u, 0, TAN_TOLERANCE, 0}, +{ 971, 1064676142u, 1798470077u, 3200116917u, 3421833729u, 1064676155u, 2862378974u, 0, TAN_TOLERANCE, 0}, +{ 972, 3193514956u, 3653237931u, 3204255012u, 3683870669u, 3193514956u, 3653237932u, 0, TAN_TOLERANCE, 0}, +{ 973, 1053588582u, 376530104u, 1073853547u, 565755892u, 1053588582u, 376560924u, 0, TAN_TOLERANCE, 0}, +{ 974, 3242503851u, 558292492u, 1051772749u, 4267873474u, 1072080736u, 2047810030u, 0, TAN_TOLERANCE, 0}, +{ 975, 3224772709u, 509637100u, 3212030069u, 215050379u, 3217125353u, 3300016857u, 0, TAN_TOLERANCE, 0}, +{ 976, 1092057101u, 3571665665u, 3188628584u, 757824767u, 1070419438u, 3036822347u, 0, TAN_TOLERANCE, 0}, +{ 977, 3214799337u, 998858159u, 1063077962u, 436029885u, 3214799896u, 3581777165u, 0, TAN_TOLERANCE, 0}, +{ 978, 3205946965u, 996300405u, 3193842624u, 80548098u, 3205946965u, 1012629084u, 0, TAN_TOLERANCE, 0}, +{ 979, 3228848840u, 3876129407u, 3215332180u, 2226970413u, 1078593226u, 76695377u, 0, TAN_TOLERANCE, 0}, +{ 980, 3237608953u, 200013509u, 3224552716u, 414878724u, 3221888552u, 2440171309u, 0, TAN_TOLERANCE, 0}, +{ 981, 3230617093u, 309319541u, 1048979765u, 1261662434u, 1071398388u, 1401776306u, 0, TAN_TOLERANCE, 0}, +{ 982, 1089252639u, 4062255924u, 3224274128u, 4289485681u, 1068546479u, 529156651u, 0, TAN_TOLERANCE, 0}, +{ 983, 3236136084u, 1611969213u, 1053890378u, 3774617276u, 1073236095u, 2860272602u, 0, TAN_TOLERANCE, 0}, +{ 984, 1080412763u, 1752164782u, 3239587974u, 612223386u, 1077725009u, 3506920398u, 0, TAN_TOLERANCE, 0}, +{ 985, 1041545782u, 2024044989u, 1074932678u, 3259111307u, 1041545782u, 2024044989u, 0, TAN_TOLERANCE, 0}, +{ 986, 1053207518u, 2564965629u, 1093571065u, 169360454u, 1053207518u, 2564981166u, 0, TAN_TOLERANCE, 0}, +{ 987, 1089599090u, 1860101737u, 3191222372u, 1676437468u, 3220588076u, 3785071853u, 0, TAN_TOLERANCE, 0}, +{ 988, 1059802968u, 588387057u, 3192103292u, 2495288012u, 1059802968u, 699627027u, 0, TAN_TOLERANCE, 0}, +{ 989, 3193155705u, 659070058u, 1073095700u, 1393632068u, 3193155705u, 659070059u, 0, TAN_TOLERANCE, 0}, +{ 990, 3217683263u, 4276187829u, 3217553330u, 1868253275u, 3217706953u, 3445958854u, 0, TAN_TOLERANCE, 0}, +{ 991, 3223220272u, 2085481575u, 3215994784u, 800910002u, 3222276535u, 3117891452u, 0, TAN_TOLERANCE, 0}, +{ 992, 1056934836u, 1950570756u, 3200582211u, 941022151u, 1056934836u, 1953249555u, 0, TAN_TOLERANCE, 0}, +{ 993, 1057530368u, 2075610870u, 3250142022u, 3605152103u, 1057530368u, 2080712643u, 0, TAN_TOLERANCE, 0}, +{ 994, 3200839250u, 3792931748u, 3204857863u, 804393211u, 3200839250u, 3792952409u, 0, TAN_TOLERANCE, 0}, +{ 995, 3253646370u, 3430071177u, 3226288311u, 3652522729u, 1076083333u, 3008288258u, 0, TAN_TOLERANCE, 0}, +{ 996, 3201314702u, 236884699u, 3227874605u, 2193269825u, 3201314702u, 236907314u, 0, TAN_TOLERANCE, 0}, +{ 997, 1064936593u, 2744231849u, 1046186036u, 771053722u, 1064936615u, 2553321629u, 0, TAN_TOLERANCE, 0}, +{ 998, 1083996036u, 3000189819u, 1096500901u, 2057239777u, 3218072365u, 2964452311u, 0, TAN_TOLERANCE, 0}, +{ 999, 1093835581u, 205759408u, 3244643377u, 2702292618u, 3222001752u, 2794274903u, 0, TAN_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_TAN_H multiple inclusion protection + +// EOF tan.h diff --git a/packages/language/c/libm/current/tests/vectors/tanh.c b/packages/language/c/libm/current/tests/vectors/tanh.c new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/tanh.c @@ -0,0 +1,105 @@ +//=========================================================================== +// +// tanh.c +// +// Test of tanh() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// Declarations for test system: +// +// TESTCASE_TYPE=CYG_TEST_MODULE + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type +#include "vectors/vector_support.h"// extra support for math tests + +#include "vectors/tanh.h" + +// FUNCTIONS + +static void +test( CYG_ADDRWORD data ) +{ + cyg_ucount32 vec_size; + cyg_bool ret; + + vec_size = sizeof(tanh_vec) / sizeof(Cyg_libm_test_double_vec_t); + ret = doTestVec( (CYG_ADDRWORD) &tanh, CYG_LIBM_TEST_VEC_DOUBLE, + CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, + &tanh_vec[0], vec_size ); + + if (ret==true) + { + CYG_TEST_PASS("tanh() is stable"); + } // if + else + { + CYG_TEST_FAIL("tanh() failed tests"); + } // else + + CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " + "library tanh() function"); +} // test() + + +int +main(int argc, char *argv[]) +{ + CYG_TEST_INIT(); + + CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " + "tanh() function"); + + START_TEST( test ); + + CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); + +} // main() + + +// EOF tanh.c diff --git a/packages/language/c/libm/current/tests/vectors/tanh.h b/packages/language/c/libm/current/tests/vectors/tanh.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/tanh.h @@ -0,0 +1,1069 @@ +#ifndef CYGONCE_LIBM_TANH_H +#define CYGONCE_LIBM_TANH_H +//=========================================================================== +// +// tanh.h +// +// Test vectors for testing of tanh() math library function +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/tanh.h" +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + + +// CONFIGURATION + +#include // Configuration header + + +// INCLUDES + +#include // Common type definitions and support +#include "vectors/vector_support.h"// extra support for math tests + +#define TANH_TOLERANCE 1.0E-04 + +static const Cyg_libm_test_double_vec_t tanh_vec[] = { + +// AUTOMATICALLY GENERATED VECTORS START + +{ 1, 1074853420u, 2506787616u, 1090024059u, 3619148316u, 1072692378u, 1014448409u, 0, TANH_TOLERANCE, 0}, +{ 2, 3220250806u, 3176730980u, 1051524793u, 2993920299u, 3219735748u, 2718182253u, 0, TANH_TOLERANCE, 0}, +{ 3, 3226028315u, 2725707538u, 3232101343u, 2346810316u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 4, 1078922874u, 2088062470u, 3201242716u, 420891118u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 5, 3221200677u, 2636405208u, 1100049309u, 471635570u, 3220097871u, 3599209765u, 0, TANH_TOLERANCE, 0}, +{ 6, 1077828855u, 1746012320u, 1054478713u, 3333988501u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 7, 1066827528u, 183014794u, 3202039382u, 2016785810u, 1066827290u, 3880063380u, 0, TANH_TOLERANCE, 0}, +{ 8, 3219777490u, 2688957927u, 1046089230u, 2709029994u, 3219483454u, 1125363282u, 0, TANH_TOLERANCE, 0}, +{ 9, 1070330066u, 624574473u, 1045840574u, 3473266330u, 1070301526u, 862781689u, 0, TANH_TOLERANCE, 0}, +{ 10, 3217502754u, 1605286142u, 1068931671u, 4233776869u, 3217486329u, 2145582745u, 0, TANH_TOLERANCE, 0}, +{ 11, 1069780594u, 1857607719u, 3222889559u, 3417070006u, 1069770714u, 401076752u, 0, TANH_TOLERANCE, 0}, +{ 12, 1081579891u, 3981151660u, 1088899021u, 1332651746u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 13, 1075860838u, 3824988054u, 1066856791u, 2070129652u, 1072693247u, 2842765918u, 0, TANH_TOLERANCE, 0}, +{ 14, 3218045550u, 1372884064u, 1080833116u, 3229926662u, 3218004944u, 604169930u, 0, TANH_TOLERANCE, 0}, +{ 15, 1078097861u, 3217805330u, 3191644264u, 2014578707u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 16, 1080267391u, 265058758u, 3239903247u, 1630600647u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 17, 1073221381u, 1946677669u, 3198462609u, 926009897u, 1072495714u, 2851802077u, 0, TANH_TOLERANCE, 0}, +{ 18, 1073178875u, 2271884183u, 3203741999u, 2118617783u, 1072479881u, 1907835069u, 0, TANH_TOLERANCE, 0}, +{ 19, 3214772053u, 213658772u, 3249401130u, 314151656u, 3214771516u, 3554579438u, 0, TANH_TOLERANCE, 0}, +{ 20, 3228946464u, 1564829925u, 3197817016u, 497230814u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 21, 3219408362u, 2075329122u, 3231746400u, 169900577u, 3219255158u, 2089286575u, 0, TANH_TOLERANCE, 0}, +{ 22, 1067674434u, 541549344u, 1096608669u, 3119070100u, 1067673824u, 1035028173u, 0, TANH_TOLERANCE, 0}, +{ 23, 1075989871u, 567496114u, 1045286891u, 1969998540u, 1072693247u, 4092220034u, 0, TANH_TOLERANCE, 0}, +{ 24, 1069985379u, 1299369769u, 1049342524u, 4167404066u, 1069970014u, 3629210634u, 0, TANH_TOLERANCE, 0}, +{ 25, 3218302829u, 3348930841u, 1078472138u, 358457347u, 3218265246u, 746156169u, 0, TANH_TOLERANCE, 0}, +{ 26, 1073166449u, 2192461366u, 1099527247u, 3184735642u, 1072475030u, 1439194248u, 0, TANH_TOLERANCE, 0}, +{ 27, 1068590412u, 331696577u, 3189610016u, 793242270u, 1068588660u, 2611487107u, 0, TANH_TOLERANCE, 0}, +{ 28, 3229460262u, 2322696981u, 1083791358u, 3020766674u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 29, 1066922273u, 252085215u, 3214426435u, 4139068910u, 1066921987u, 890588541u, 0, TANH_TOLERANCE, 0}, +{ 30, 3221457149u, 105589263u, 1056316170u, 261630827u, 3220145390u, 1744926257u, 0, TANH_TOLERANCE, 0}, +{ 31, 1082047584u, 428765703u, 3251828686u, 2009972239u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 32, 1079693651u, 3517376586u, 3240257920u, 3304487302u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 33, 3224100728u, 237004814u, 3237899261u, 3364008659u, 3220176895u, 4294953152u, 0, TANH_TOLERANCE, 0}, +{ 34, 3214121920u, 472004928u, 3226869477u, 1186387580u, 3214121763u, 282713899u, 0, TANH_TOLERANCE, 0}, +{ 35, 1068906914u, 4085763910u, 1106394906u, 2684738273u, 1068903266u, 2272328782u, 0, TANH_TOLERANCE, 0}, +{ 36, 1069636551u, 2055490142u, 3231581370u, 3879040079u, 1069629628u, 2119989659u, 0, TANH_TOLERANCE, 0}, +{ 37, 3213093895u, 3725731239u, 1061652681u, 591292963u, 3213093854u, 2954887285u, 0, TANH_TOLERANCE, 0}, +{ 38, 3221869253u, 1147041027u, 3215417793u, 624695933u, 3220170315u, 2960779403u, 0, TANH_TOLERANCE, 0}, +{ 39, 3217587110u, 705725219u, 3238067573u, 1116238321u, 3217567824u, 4085004597u, 0, TANH_TOLERANCE, 0}, +{ 40, 3217852848u, 7287411u, 1045917232u, 116067742u, 3217822463u, 1655616480u, 0, TANH_TOLERANCE, 0}, +{ 41, 3226423734u, 3604989074u, 1066381836u, 545298780u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 42, 3221178088u, 1681476121u, 1060345752u, 3553822398u, 3220094461u, 32790421u, 0, TANH_TOLERANCE, 0}, +{ 43, 1080811562u, 3410480388u, 1052460275u, 1660607230u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 44, 1077682533u, 1494984673u, 3196647153u, 287894723u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 45, 1068516615u, 644548665u, 1081948134u, 2442134629u, 1068515181u, 4013422768u, 0, TANH_TOLERANCE, 0}, +{ 46, 1077068335u, 2312530895u, 3221584595u, 3379665576u, 1072693247u, 4294967295u, 0, TANH_TOLERANCE, 0}, +{ 47, 1079308159u, 3018463866u, 1086226574u, 404012923u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 48, 1071024755u, 1710279345u, 3251401196u, 3528946000u, 1070966559u, 4188915943u, 0, TANH_TOLERANCE, 0}, +{ 49, 1070973535u, 2164450219u, 1083520023u, 3312018966u, 1070921017u, 98347496u, 0, TANH_TOLERANCE, 0}, +{ 50, 1069831588u, 2648986431u, 1050330591u, 1474376550u, 1069820489u, 3042456577u, 0, TANH_TOLERANCE, 0}, +{ 51, 3214344972u, 1839068700u, 1077406406u, 3013052171u, 3214344718u, 2604353982u, 0, TANH_TOLERANCE, 0}, +{ 52, 1066416574u, 772102380u, 3220729740u, 4219039958u, 1066416485u, 838919666u, 0, TANH_TOLERANCE, 0}, +{ 53, 3223180765u, 3058618779u, 1046304788u, 3338676024u, 3220176894u, 2606621599u, 0, TANH_TOLERANCE, 0}, +{ 54, 1067949353u, 506286854u, 1094907481u, 2217000199u, 1067948256u, 3256716313u, 0, TANH_TOLERANCE, 0}, +{ 55, 1076136854u, 1147428263u, 1065432625u, 3034786717u, 1072693247u, 4273443146u, 0, TANH_TOLERANCE, 0}, +{ 56, 1075725296u, 2844125311u, 1082985198u, 2561492677u, 1072693246u, 3764088074u, 0, TANH_TOLERANCE, 0}, +{ 57, 3218876948u, 704542600u, 3222902057u, 2762779203u, 3218766355u, 4000984321u, 0, TANH_TOLERANCE, 0}, +{ 58, 3215409254u, 184131949u, 3249723525u, 1667366082u, 3215408207u, 1529188018u, 0, TANH_TOLERANCE, 0}, +{ 59, 3221512446u, 3904224140u, 1067056698u, 2942159914u, 3220151345u, 2904148002u, 0, TANH_TOLERANCE, 0}, +{ 60, 1080713919u, 426114282u, 3209056785u, 1083606355u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 61, 1082048697u, 3774123863u, 1106787580u, 2722107965u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 62, 1077519332u, 1377734762u, 1104232051u, 2377063483u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 63, 1072526287u, 1029739074u, 1105467109u, 3062201018u, 1072118796u, 4118103516u, 0, TANH_TOLERANCE, 0}, +{ 64, 3225304413u, 773857656u, 3214251949u, 335833884u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 65, 3216856098u, 1473865960u, 1103073830u, 4000427507u, 3216847733u, 232123791u, 0, TANH_TOLERANCE, 0}, +{ 66, 1081165135u, 4242092620u, 1067009473u, 14539161u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 67, 3214536170u, 1732245037u, 1101371955u, 1533536108u, 3214535807u, 1315557254u, 0, TANH_TOLERANCE, 0}, +{ 68, 3228182475u, 1833841275u, 1099430098u, 4144145552u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 69, 3227493247u, 935007012u, 3188865420u, 604442938u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 70, 3217389013u, 2211464602u, 1046255144u, 1635910526u, 3217375982u, 600658720u, 0, TANH_TOLERANCE, 0}, +{ 71, 1074725689u, 2549219008u, 3231633258u, 3733639385u, 1072691447u, 3387741538u, 0, TANH_TOLERANCE, 0}, +{ 72, 1075803633u, 1819374372u, 3202219056u, 2617077637u, 1072693247u, 1640287018u, 0, TANH_TOLERANCE, 0}, +{ 73, 1078616640u, 546465680u, 1048653554u, 532401530u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 74, 1066591187u, 2759019783u, 3221570188u, 3554409630u, 1066591047u, 1006540637u, 0, TANH_TOLERANCE, 0}, +{ 75, 3219222738u, 2527221960u, 1099107978u, 2696971136u, 3219114815u, 1376096383u, 0, TANH_TOLERANCE, 0}, +{ 76, 1079332208u, 173134582u, 1087299442u, 2877794600u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 77, 1076963290u, 547642046u, 3197285510u, 3521286127u, 1072693247u, 4294967273u, 0, TANH_TOLERANCE, 0}, +{ 78, 1073812126u, 1231582831u, 1090971734u, 1653446832u, 1072635309u, 2989295u, 0, TANH_TOLERANCE, 0}, +{ 79, 1070779719u, 3762182190u, 3252967851u, 2615360375u, 1070745453u, 2070604370u, 0, TANH_TOLERANCE, 0}, +{ 80, 3216563063u, 2588067350u, 3206610957u, 3551059728u, 3216557963u, 801826211u, 0, TANH_TOLERANCE, 0}, +{ 81, 3217464616u, 845263327u, 1073415902u, 1749010288u, 3217449387u, 250805u, 0, TANH_TOLERANCE, 0}, +{ 82, 3217110706u, 3092685191u, 3190678390u, 2872219490u, 3217103954u, 3350331893u, 0, TANH_TOLERANCE, 0}, +{ 83, 3220412207u, 4107255722u, 3205337291u, 3069068345u, 3219843345u, 256047763u, 0, TANH_TOLERANCE, 0}, +{ 84, 3227213641u, 2294867524u, 3216653996u, 2860384670u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 85, 3214297870u, 2265437201u, 3240198679u, 1234948614u, 3214297639u, 3221872192u, 0, TANH_TOLERANCE, 0}, +{ 86, 3219505657u, 1186945904u, 3251167793u, 1896750851u, 3219320152u, 2185885166u, 0, TANH_TOLERANCE, 0}, +{ 87, 1075284022u, 3686084548u, 1079286273u, 3309277689u, 1072693215u, 1875502271u, 0, TANH_TOLERANCE, 0}, +{ 88, 3221379088u, 3006860614u, 3231412671u, 2504194724u, 3220134572u, 2680984865u, 0, TANH_TOLERANCE, 0}, +{ 89, 3224614924u, 1948717780u, 1048317852u, 3791803982u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 90, 1070636471u, 4272034420u, 3192982124u, 1526175922u, 1070612646u, 3951514323u, 0, TANH_TOLERANCE, 0}, +{ 91, 3226943458u, 4108948538u, 1104691287u, 640541190u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 92, 3217743177u, 3259274853u, 1082507103u, 3677038020u, 3217717774u, 2850529195u, 0, TANH_TOLERANCE, 0}, +{ 93, 1076841042u, 3781708548u, 1096584871u, 1207386447u, 1072693247u, 4294966832u, 0, TANH_TOLERANCE, 0}, +{ 94, 3213861096u, 3011191657u, 1103798670u, 1096124830u, 3213860931u, 3971208009u, 0, TANH_TOLERANCE, 0}, +{ 95, 1071623631u, 2540404725u, 3240157452u, 4122845725u, 1071469194u, 1505927985u, 0, TANH_TOLERANCE, 0}, +{ 96, 1076303678u, 311336721u, 3214382367u, 4212533768u, 1072693247u, 4293279124u, 0, TANH_TOLERANCE, 0}, +{ 97, 1067916643u, 1769686293u, 3240200923u, 3538602249u, 1067915615u, 325439970u, 0, TANH_TOLERANCE, 0}, +{ 98, 1075081821u, 508056696u, 1103793878u, 776520138u, 1072693095u, 3017783498u, 0, TANH_TOLERANCE, 0}, +{ 99, 1080890481u, 4064962760u, 1077424413u, 819766631u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 100, 1074178362u, 2112385259u, 3227593179u, 1187058516u, 1072678768u, 381693332u, 0, TANH_TOLERANCE, 0}, +{ 101, 1076003603u, 2514398118u, 1076579751u, 870169764u, 1072693247u, 4130548044u, 0, TANH_TOLERANCE, 0}, +{ 102, 3227977024u, 1190259653u, 1069112254u, 3417249840u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 103, 3214634603u, 3467757357u, 3215075200u, 2168175352u, 3214634173u, 3865851572u, 0, TANH_TOLERANCE, 0}, +{ 104, 3226011647u, 1508888184u, 1060430241u, 3524949092u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 105, 3215238675u, 166402802u, 3237198975u, 3572369260u, 3215237941u, 3647655500u, 0, TANH_TOLERANCE, 0}, +{ 106, 1075575366u, 2441536203u, 3202753937u, 3658194573u, 1072693244u, 2031976466u, 0, TANH_TOLERANCE, 0}, +{ 107, 1070781516u, 2479742828u, 1062342831u, 4214154303u, 1070747103u, 1801754207u, 0, TANH_TOLERANCE, 0}, +{ 108, 1076105338u, 426896765u, 1066474375u, 2201754442u, 1072693247u, 4260151399u, 0, TANH_TOLERANCE, 0}, +{ 109, 3214503389u, 2055773734u, 3239267288u, 291396537u, 3214503046u, 4246773790u, 0, TANH_TOLERANCE, 0}, +{ 110, 3224385121u, 874125203u, 3210508124u, 4091098764u, 3220176895u, 4294967147u, 0, TANH_TOLERANCE, 0}, +{ 111, 1072007482u, 120488169u, 3241241441u, 1985269424u, 1071827020u, 3308157325u, 0, TANH_TOLERANCE, 0}, +{ 112, 3218073746u, 2243036871u, 3243941101u, 740033495u, 3218031479u, 4064057836u, 0, TANH_TOLERANCE, 0}, +{ 113, 3218862090u, 1176656356u, 1074261978u, 3588756231u, 3218754022u, 3974936801u, 0, TANH_TOLERANCE, 0}, +{ 114, 3228699543u, 3037249392u, 1061635587u, 1173102190u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 115, 3224626669u, 2882725208u, 1071440059u, 69225090u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 116, 3218954930u, 272319256u, 1072073912u, 2493997123u, 3218830490u, 2787918817u, 0, TANH_TOLERANCE, 0}, +{ 117, 1070303098u, 188610379u, 3232757923u, 2209647371u, 1070275785u, 2868756030u, 0, TANH_TOLERANCE, 0}, +{ 118, 3225224181u, 1990439193u, 1078073146u, 622849962u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 119, 1069718653u, 756052458u, 1081649113u, 2247475162u, 1069710129u, 3490933881u, 0, TANH_TOLERANCE, 0}, +{ 120, 1071060248u, 3878055211u, 3222407050u, 2979438623u, 1070997900u, 1162556570u, 0, TANH_TOLERANCE, 0}, +{ 121, 3214165365u, 2676398686u, 1105124431u, 3631096636u, 3214165192u, 464247846u, 0, TANH_TOLERANCE, 0}, +{ 122, 1071370846u, 1697791764u, 3198136112u, 2299842819u, 1071264055u, 4133345906u, 0, TANH_TOLERANCE, 0}, +{ 123, 1074939040u, 1931502677u, 3215264397u, 3016456382u, 1072692795u, 1553366917u, 0, TANH_TOLERANCE, 0}, +{ 124, 1073302002u, 343404215u, 1061072607u, 4266232536u, 1072522724u, 3704959248u, 0, TANH_TOLERANCE, 0}, +{ 125, 3225502196u, 4140316002u, 1082896196u, 868256971u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 126, 1074374234u, 1864139509u, 3187675097u, 3084482407u, 1072686376u, 1962441622u, 0, TANH_TOLERANCE, 0}, +{ 127, 3220191323u, 2427162817u, 3234748208u, 2715105792u, 3219688914u, 3013850408u, 0, TANH_TOLERANCE, 0}, +{ 128, 1070891968u, 3943389284u, 1046724025u, 3626825684u, 1070847739u, 3439563777u, 0, TANH_TOLERANCE, 0}, +{ 129, 1067443098u, 967350972u, 1093012318u, 448002663u, 1067442422u, 3845472712u, 0, TANH_TOLERANCE, 0}, +{ 130, 3228777187u, 105058217u, 1069733884u, 171786224u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 131, 3213731756u, 2863482262u, 3204997271u, 877784425u, 3213731620u, 3648045742u, 0, TANH_TOLERANCE, 0}, +{ 132, 3216260801u, 2801782962u, 3213604117u, 762347195u, 3216258042u, 2678983680u, 0, TANH_TOLERANCE, 0}, +{ 133, 3224049543u, 2317950339u, 3246333414u, 2135700283u, 3220176895u, 4294936411u, 0, TANH_TOLERANCE, 0}, +{ 134, 1069099309u, 4171919805u, 1082858682u, 2180920863u, 1069094020u, 3820197062u, 0, TANH_TOLERANCE, 0}, +{ 135, 3221197660u, 1918836931u, 1083603224u, 3137821660u, 3220097424u, 1722624890u, 0, TANH_TOLERANCE, 0}, +{ 136, 1081882778u, 3456203663u, 3235600523u, 2335688936u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 137, 1066396570u, 4170235262u, 1051824459u, 521583737u, 1066396401u, 2543673130u, 0, TANH_TOLERANCE, 0}, +{ 138, 1075056847u, 1296623194u, 3250673860u, 2442872540u, 1072693063u, 3166683353u, 0, TANH_TOLERANCE, 0}, +{ 139, 1071121461u, 289979405u, 1049514449u, 3865737145u, 1071051518u, 2290983565u, 0, TANH_TOLERANCE, 0}, +{ 140, 1074250368u, 3699090239u, 1054539840u, 3259249360u, 1072682236u, 3608691743u, 0, TANH_TOLERANCE, 0}, +{ 141, 1079640884u, 1619819023u, 1045993352u, 1022642459u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 142, 1075141548u, 19455098u, 3229182089u, 2096003654u, 1072693151u, 1888247792u, 0, TANH_TOLERANCE, 0}, +{ 143, 1074200784u, 3803689997u, 1071630912u, 2263729518u, 1072679951u, 1586915304u, 0, TANH_TOLERANCE, 0}, +{ 144, 1080385741u, 2816837387u, 1063422305u, 2597606398u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 145, 1072245897u, 3680967506u, 1040201163u, 179224723u, 1071972935u, 363515293u, 0, TANH_TOLERANCE, 0}, +{ 146, 3213795591u, 978126928u, 1101553990u, 4047893399u, 3213795441u, 2507481145u, 0, TANH_TOLERANCE, 0}, +{ 147, 3221273469u, 4059818629u, 1042678728u, 3640293589u, 3220113888u, 3437106909u, 0, TANH_TOLERANCE, 0}, +{ 148, 3228541096u, 3383497159u, 1070002807u, 1527313008u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 149, 3216339167u, 2599946514u, 1104170406u, 2738675352u, 3216335891u, 1051626081u, 0, TANH_TOLERANCE, 0}, +{ 150, 1081115375u, 3616571377u, 1060859316u, 1130603218u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 151, 1073931644u, 3859211180u, 1067940450u, 1744531824u, 1072656336u, 429068867u, 0, TANH_TOLERANCE, 0}, +{ 152, 1065900012u, 1958025850u, 3236511256u, 2472176453u, 1065899937u, 1394244149u, 0, TANH_TOLERANCE, 0}, +{ 153, 3223669905u, 182132862u, 3250520938u, 3924356991u, 3220176895u, 4284838839u, 0, TANH_TOLERANCE, 0}, +{ 154, 3224210428u, 35632886u, 3209806504u, 1453402523u, 3220176895u, 4294964644u, 0, TANH_TOLERANCE, 0}, +{ 155, 1076182070u, 743225214u, 3202890678u, 142917400u, 1072693247u, 4284170650u, 0, TANH_TOLERANCE, 0}, +{ 156, 1075442096u, 1472665012u, 3203138231u, 256588219u, 1072693238u, 1077098108u, 0, TANH_TOLERANCE, 0}, +{ 157, 1079253522u, 1062927000u, 1061134072u, 931677439u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 158, 1069912068u, 2320910576u, 1055663370u, 288059864u, 1069898851u, 1531188271u, 0, TANH_TOLERANCE, 0}, +{ 159, 1075812365u, 1448349062u, 3199478070u, 3454027134u, 1072693247u, 1811377479u, 0, TANH_TOLERANCE, 0}, +{ 160, 3224875886u, 4215445172u, 3196654963u, 2231888973u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 161, 3227757863u, 40413554u, 3232578253u, 983832844u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 162, 3221624382u, 3995725873u, 1050082319u, 777231627u, 3220160190u, 46615835u, 0, TANH_TOLERANCE, 0}, +{ 163, 1066152450u, 672789828u, 3253385962u, 2982787335u, 1066152333u, 1814400134u, 0, TANH_TOLERANCE, 0}, +{ 164, 1072585179u, 2075971825u, 1070166500u, 4034633931u, 1072146078u, 896769727u, 0, TANH_TOLERANCE, 0}, +{ 165, 3218434785u, 1018222907u, 3244621407u, 3090050495u, 3218384633u, 3394350018u, 0, TANH_TOLERANCE, 0}, +{ 166, 1071875189u, 937732557u, 3200798890u, 2557898276u, 1071737093u, 3916098959u, 0, TANH_TOLERANCE, 0}, +{ 167, 1075196588u, 130346162u, 3223590310u, 275568693u, 1072693184u, 2361710702u, 0, TANH_TOLERANCE, 0}, +{ 168, 1065967541u, 3807416441u, 1075961161u, 3706820266u, 1065967456u, 3459855166u, 0, TANH_TOLERANCE, 0}, +{ 169, 3219244733u, 1710131411u, 1078123323u, 1900790503u, 3219138047u, 3814235172u, 0, TANH_TOLERANCE, 0}, +{ 170, 3226236449u, 3420420033u, 3210844787u, 588423066u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 171, 1067509906u, 1160162008u, 3246307879u, 4265764460u, 1067509503u, 2601735024u, 0, TANH_TOLERANCE, 0}, +{ 172, 1080523338u, 366653268u, 3188814424u, 466059202u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 173, 3222433435u, 1325936170u, 3221436876u, 680097612u, 3220176478u, 4252589573u, 0, TANH_TOLERANCE, 0}, +{ 174, 3225711052u, 1827735934u, 3200554324u, 2875599271u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 175, 3213050498u, 3117037091u, 3239246636u, 15838845u, 3213050461u, 2222620939u, 0, TANH_TOLERANCE, 0}, +{ 176, 1067702644u, 749718883u, 3223587064u, 1523766569u, 1067701992u, 3622799087u, 0, TANH_TOLERANCE, 0}, +{ 177, 1066853747u, 1966536294u, 3250158026u, 699164258u, 1066853497u, 1898707226u, 0, TANH_TOLERANCE, 0}, +{ 178, 1079174067u, 3759049394u, 1106085272u, 1183789499u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 179, 1074910167u, 1970107747u, 1095245453u, 2308233883u, 1072692683u, 3577819256u, 0, TANH_TOLERANCE, 0}, +{ 180, 1076367836u, 1491017852u, 1041444355u, 1723375725u, 1072693247u, 4294333058u, 0, TANH_TOLERANCE, 0}, +{ 181, 3219775798u, 1141349287u, 1097465301u, 3403438584u, 3219482519u, 2595676565u, 0, TANH_TOLERANCE, 0}, +{ 182, 3224280452u, 1711085243u, 3250239076u, 1377484108u, 3220176895u, 4294966385u, 0, TANH_TOLERANCE, 0}, +{ 183, 1079510651u, 2880275004u, 1084039594u, 1611394950u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 184, 3224784251u, 2626629370u, 1063771493u, 1499080813u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 185, 1068862751u, 3936262414u, 1103919063u, 3175668759u, 1068859424u, 3440133182u, 0, TANH_TOLERANCE, 0}, +{ 186, 3217418903u, 1270950554u, 3194616071u, 3680565379u, 3217405029u, 3952562788u, 0, TANH_TOLERANCE, 0}, +{ 187, 3217585407u, 1066985223u, 3221613219u, 4089383168u, 3217566182u, 3374525206u, 0, TANH_TOLERANCE, 0}, +{ 188, 3220204567u, 4017329311u, 3208334452u, 1667591498u, 3219699702u, 2508843272u, 0, TANH_TOLERANCE, 0}, +{ 189, 1077678397u, 3154656624u, 1061894279u, 3886344038u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 190, 1068478737u, 977586119u, 3209762784u, 953839852u, 1068476088u, 3411453719u, 0, TANH_TOLERANCE, 0}, +{ 191, 1081896575u, 143071571u, 3206165386u, 913097445u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 192, 3213634128u, 1371169579u, 1057079837u, 2594818628u, 3213634011u, 4114428713u, 0, TANH_TOLERANCE, 0}, +{ 193, 3228724664u, 2259342224u, 3217432469u, 1824221478u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 194, 3227960407u, 1576604497u, 1079368611u, 185078728u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 195, 3221679427u, 444800035u, 3243343143u, 1734989302u, 3220163343u, 3657733008u, 0, TANH_TOLERANCE, 0}, +{ 196, 1072748883u, 130452005u, 1041548088u, 2158433515u, 1072238149u, 3617271211u, 0, TANH_TOLERANCE, 0}, +{ 197, 3225258784u, 1941318385u, 1045807374u, 792193370u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 198, 3225716754u, 1299392207u, 3212131720u, 3205732280u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 199, 1079824436u, 3035093505u, 1052187689u, 3287702190u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 200, 3227801892u, 2160225215u, 1102624859u, 836655570u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 201, 1079946410u, 3360816360u, 3246176356u, 172860634u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 202, 1073092940u, 146831910u, 1051558014u, 2340722078u, 1072444136u, 1759342658u, 0, TANH_TOLERANCE, 0}, +{ 203, 3224124895u, 1603798153u, 3207725532u, 1099413093u, 3220176895u, 4294957514u, 0, TANH_TOLERANCE, 0}, +{ 204, 3227804010u, 2429340443u, 3190303581u, 3223770005u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 205, 1073785807u, 955542166u, 3230415151u, 275583938u, 1072629283u, 1074678205u, 0, TANH_TOLERANCE, 0}, +{ 206, 1078291818u, 513397822u, 1090646554u, 2089321329u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 207, 3214141396u, 2782073372u, 1046063872u, 4023829068u, 3214141232u, 1525062828u, 0, TANH_TOLERANCE, 0}, +{ 208, 1079690454u, 3242223094u, 3194111199u, 4264674108u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 209, 3225927909u, 3506346169u, 1047020885u, 1742757458u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 210, 3214684573u, 1265459564u, 3193450280u, 3650514880u, 3214684106u, 2321174768u, 0, TANH_TOLERANCE, 0}, +{ 211, 1075464434u, 1525260440u, 3235452527u, 2612331392u, 1072693239u, 3343303113u, 0, TANH_TOLERANCE, 0}, +{ 212, 3227697400u, 1263613754u, 3219096387u, 635677201u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 213, 3217806423u, 4140947288u, 3200792376u, 2013265346u, 3217778219u, 1500451800u, 0, TANH_TOLERANCE, 0}, +{ 214, 3227954296u, 1912759945u, 3237045253u, 1351396825u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 215, 3228282218u, 1001433078u, 3206926643u, 2741676659u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 216, 1075680726u, 1088945233u, 1085095743u, 3986114865u, 1072693246u, 1809567207u, 0, TANH_TOLERANCE, 0}, +{ 217, 3219928361u, 831239754u, 1099828675u, 3071308141u, 3219562775u, 3422341860u, 0, TANH_TOLERANCE, 0}, +{ 218, 3222688769u, 3473592372u, 1102759382u, 1309576357u, 3220176836u, 2359199832u, 0, TANH_TOLERANCE, 0}, +{ 219, 3229166610u, 2042340367u, 1091945628u, 2062772374u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 220, 3214688631u, 1840632537u, 1096533424u, 807510337u, 3214688161u, 2546146924u, 0, TANH_TOLERANCE, 0}, +{ 221, 3224111690u, 144814872u, 3212698915u, 2282965697u, 3220176895u, 4294955331u, 0, TANH_TOLERANCE, 0}, +{ 222, 1073333582u, 2552499583u, 3229111426u, 1470130815u, 1072532310u, 2637908577u, 0, TANH_TOLERANCE, 0}, +{ 223, 3227364425u, 2858583811u, 1089760910u, 6360994u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 224, 3215042145u, 1614537194u, 1075198900u, 4088705365u, 3215041687u, 1726146854u, 0, TANH_TOLERANCE, 0}, +{ 225, 3228918974u, 3545570051u, 1065221325u, 1629217700u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 226, 1072744324u, 1813392963u, 3235313361u, 3772501596u, 1072234610u, 661468199u, 0, TANH_TOLERANCE, 0}, +{ 227, 3215677054u, 2406734491u, 1042055360u, 89226663u, 3215675353u, 3862932932u, 0, TANH_TOLERANCE, 0}, +{ 228, 3214625449u, 1618759139u, 3194723421u, 3888234802u, 3214625026u, 10619074u, 0, TANH_TOLERANCE, 0}, +{ 229, 1068988736u, 3590035633u, 3212424262u, 2892456615u, 1068984439u, 3719711940u, 0, TANH_TOLERANCE, 0}, +{ 230, 3213011732u, 2431246964u, 3241512456u, 183850734u, 3213011698u, 2928537796u, 0, TANH_TOLERANCE, 0}, +{ 231, 1076918189u, 3088319870u, 3211544311u, 862225364u, 1072693247u, 4294967206u, 0, TANH_TOLERANCE, 0}, +{ 232, 3224808904u, 3495352775u, 1058576726u, 596957268u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 233, 1066476292u, 1839214511u, 3205004060u, 1923240983u, 1066476187u, 2556221634u, 0, TANH_TOLERANCE, 0}, +{ 234, 1069608200u, 739619702u, 3223356436u, 2689885273u, 1069601779u, 2957113876u, 0, TANH_TOLERANCE, 0}, +{ 235, 3216053611u, 2143376228u, 1098306332u, 3760236188u, 3216051952u, 2092758873u, 0, TANH_TOLERANCE, 0}, +{ 236, 1074621795u, 671680995u, 1091262633u, 2315535361u, 1072690572u, 3470829674u, 0, TANH_TOLERANCE, 0}, +{ 237, 3219408869u, 2493598049u, 3194927008u, 1689107592u, 3219255506u, 1019995372u, 0, TANH_TOLERANCE, 0}, +{ 238, 3213058631u, 1578976988u, 1066368383u, 2117279163u, 3213058593u, 1870641139u, 0, TANH_TOLERANCE, 0}, +{ 239, 3221939535u, 3425290087u, 1098487295u, 1263412017u, 3220171861u, 1494771509u, 0, TANH_TOLERANCE, 0}, +{ 240, 3217869948u, 3635396812u, 1070999426u, 3965655689u, 3217838734u, 1233391676u, 0, TANH_TOLERANCE, 0}, +{ 241, 1069633530u, 2183973116u, 1101098363u, 1118613350u, 1069626662u, 1134433172u, 0, TANH_TOLERANCE, 0}, +{ 242, 3221946089u, 199516350u, 1078368488u, 164621458u, 3220171985u, 2155767731u, 0, TANH_TOLERANCE, 0}, +{ 243, 3212871842u, 3570940805u, 3230316437u, 3596080877u, 3212871819u, 1253083702u, 0, TANH_TOLERANCE, 0}, +{ 244, 3217646749u, 980880313u, 1079833442u, 884465057u, 3217625256u, 410689042u, 0, TANH_TOLERANCE, 0}, +{ 245, 1080054180u, 2558179220u, 1052873711u, 1233598120u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 246, 1067038165u, 1909994277u, 1085015978u, 2991527452u, 1067037811u, 2026092876u, 0, TANH_TOLERANCE, 0}, +{ 247, 1070292444u, 1680290941u, 1074309900u, 2943870846u, 1070265607u, 1158571911u, 0, TANH_TOLERANCE, 0}, +{ 248, 1069981892u, 1451927357u, 3228615456u, 1502585517u, 1069966634u, 3731947704u, 0, TANH_TOLERANCE, 0}, +{ 249, 3224677615u, 751136990u, 3230392165u, 3493275472u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 250, 1079491599u, 1209623292u, 3238056647u, 979495322u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 251, 3228404200u, 1717672108u, 1048120593u, 531240316u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 252, 1068854987u, 3548721654u, 1086112947u, 3391817224u, 1068851715u, 761198005u, 0, TANH_TOLERANCE, 0}, +{ 253, 1074691123u, 2758195125u, 1100880260u, 2028440924u, 1072691194u, 767085901u, 0, TANH_TOLERANCE, 0}, +{ 254, 1076883861u, 2750123373u, 3232200256u, 1086294931u, 1072693247u, 4294967055u, 0, TANH_TOLERANCE, 0}, +{ 255, 1065978768u, 2986160931u, 1076097908u, 2540046258u, 1065978681u, 3777549083u, 0, TANH_TOLERANCE, 0}, +{ 256, 3224990842u, 451471221u, 1064816262u, 4187644495u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 257, 1080585860u, 2439500162u, 1065280276u, 1979490284u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 258, 1065581656u, 2283342035u, 1078398157u, 1345997553u, 1065581617u, 4289095703u, 0, TANH_TOLERANCE, 0}, +{ 259, 3219540804u, 179066662u, 1103272172u, 1217337578u, 3219342777u, 584216337u, 0, TANH_TOLERANCE, 0}, +{ 260, 3218902409u, 3779303391u, 3210023352u, 3115946280u, 3218787406u, 3376448869u, 0, TANH_TOLERANCE, 0}, +{ 261, 3213961394u, 286247089u, 1085153597u, 713645369u, 3213961288u, 3547746481u, 0, TANH_TOLERANCE, 0}, +{ 262, 1077941860u, 1468283899u, 1042831668u, 2022736418u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 263, 1076847649u, 3305564080u, 1065483445u, 482392433u, 1072693247u, 4294966877u, 0, TANH_TOLERANCE, 0}, +{ 264, 3216375871u, 2256346551u, 3222430705u, 2071674991u, 3216372332u, 768731038u, 0, TANH_TOLERANCE, 0}, +{ 265, 3216607607u, 2295269094u, 1084451053u, 2773103941u, 3216602078u, 1439428617u, 0, TANH_TOLERANCE, 0}, +{ 266, 1075028218u, 1482721827u, 1092243422u, 3125409590u, 1072693018u, 3260391029u, 0, TANH_TOLERANCE, 0}, +{ 267, 3221065973u, 1381740563u, 1071545057u, 2918235653u, 3220075282u, 1703589823u, 0, TANH_TOLERANCE, 0}, +{ 268, 3226133060u, 1105857967u, 3241990046u, 2703723225u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 269, 1066084243u, 174689677u, 1079333374u, 3947057014u, 1066084138u, 3270329839u, 0, TANH_TOLERANCE, 0}, +{ 270, 1077878947u, 2023082423u, 3242081486u, 1169047927u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 271, 1070817355u, 3742487766u, 1043425732u, 194972788u, 1070779930u, 515450847u, 0, TANH_TOLERANCE, 0}, +{ 272, 3220083283u, 2136071361u, 3211529757u, 993675115u, 3219636252u, 1007735063u, 0, TANH_TOLERANCE, 0}, +{ 273, 3219954837u, 210772141u, 3241441539u, 580731413u, 3219575893u, 3207362503u, 0, TANH_TOLERANCE, 0}, +{ 274, 1078111773u, 1751560711u, 1074522705u, 180987057u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 275, 1071997471u, 2552236599u, 1088658621u, 2112468655u, 1071820440u, 2818435747u, 0, TANH_TOLERANCE, 0}, +{ 276, 3213407865u, 1578223762u, 3224596567u, 2456166162u, 3213407786u, 3283589150u, 0, TANH_TOLERANCE, 0}, +{ 277, 1070041301u, 2110924310u, 1086207177u, 3161208323u, 1070024153u, 713852193u, 0, TANH_TOLERANCE, 0}, +{ 278, 3223474786u, 2352173188u, 1079361728u, 4070222179u, 3220176895u, 4096103338u, 0, TANH_TOLERANCE, 0}, +{ 279, 1080041384u, 2481562701u, 1090937016u, 3809489716u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 280, 3215877019u, 330905705u, 1086260896u, 90264431u, 3215874683u, 2935392842u, 0, TANH_TOLERANCE, 0}, +{ 281, 1065895785u, 4162008079u, 3194387916u, 759522153u, 1065895711u, 1860972907u, 0, TANH_TOLERANCE, 0}, +{ 282, 1075772157u, 1839697482u, 3216442625u, 2211508949u, 1072693247u, 919725479u, 0, TANH_TOLERANCE, 0}, +{ 283, 3227787115u, 3736863454u, 1063475914u, 3150741666u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 284, 1070223067u, 4200269406u, 3236646101u, 1061812176u, 1070199193u, 3353234231u, 0, TANH_TOLERANCE, 0}, +{ 285, 1074975099u, 106027290u, 3234978297u, 2245237549u, 1072692904u, 926646345u, 0, TANH_TOLERANCE, 0}, +{ 286, 3228109966u, 2132131375u, 3250483427u, 3449276437u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 287, 1077854442u, 2334440944u, 1105423490u, 4004336184u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 288, 3220869856u, 4090088208u, 1042030013u, 3898658299u, 3220030793u, 1280038209u, 0, TANH_TOLERANCE, 0}, +{ 289, 3217345248u, 2272831437u, 3253082595u, 2639188641u, 3217333388u, 615613079u, 0, TANH_TOLERANCE, 0}, +{ 290, 1069446748u, 1856594168u, 3189515294u, 4101853676u, 1069437378u, 4022174950u, 0, TANH_TOLERANCE, 0}, +{ 291, 1073915260u, 2211699255u, 3195060344u, 3865018604u, 1072653977u, 3088241704u, 0, TANH_TOLERANCE, 0}, +{ 292, 3227038370u, 996259334u, 3241496889u, 3782673116u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 293, 1080256379u, 3840380763u, 1048674041u, 550040067u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 294, 3229399497u, 95874100u, 3237232828u, 2645647822u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 295, 1065685736u, 3441419500u, 3252367038u, 876710419u, 1065685688u, 249926735u, 0, TANH_TOLERANCE, 0}, +{ 296, 3226010640u, 2560836004u, 3199616543u, 1180840586u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 297, 3221602966u, 2218230392u, 3227485787u, 3947214579u, 3220158774u, 97536700u, 0, TANH_TOLERANCE, 0}, +{ 298, 1075345350u, 1447312532u, 1081476588u, 780366847u, 1072693227u, 2597730715u, 0, TANH_TOLERANCE, 0}, +{ 299, 1073618219u, 2842113832u, 3216156731u, 225159029u, 1072598206u, 38725043u, 0, TANH_TOLERANCE, 0}, +{ 300, 1079242825u, 1601981129u, 3234628869u, 2236538344u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 301, 1076784916u, 2194185737u, 3242362684u, 87913366u, 1072693247u, 4294966204u, 0, TANH_TOLERANCE, 0}, +{ 302, 3215861096u, 1346862963u, 1077836259u, 3604666660u, 3215858816u, 1876833276u, 0, TANH_TOLERANCE, 0}, +{ 303, 3218547435u, 3115209742u, 1099332326u, 1325101950u, 3218484663u, 109142900u, 0, TANH_TOLERANCE, 0}, +{ 304, 3221400314u, 3889223100u, 1053247613u, 3371396923u, 3220137833u, 3785105086u, 0, TANH_TOLERANCE, 0}, +{ 305, 3220477868u, 4163120793u, 1075022670u, 1387631215u, 3219879827u, 2620319036u, 0, TANH_TOLERANCE, 0}, +{ 306, 3218064691u, 1532426189u, 1063168268u, 3397022615u, 3218022962u, 3163394182u, 0, TANH_TOLERANCE, 0}, +{ 307, 3216761961u, 89324166u, 1079206060u, 3429424710u, 3216754762u, 163055010u, 0, TANH_TOLERANCE, 0}, +{ 308, 3214345198u, 747591401u, 1072238381u, 2803213904u, 3214344944u, 1023319056u, 0, TANH_TOLERANCE, 0}, +{ 309, 1078530868u, 271904221u, 1044258318u, 1858545114u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 310, 3222826034u, 314958082u, 3249912496u, 2966213175u, 3220176875u, 594125926u, 0, TANH_TOLERANCE, 0}, +{ 311, 3215005206u, 3119528953u, 3217179014u, 2908718240u, 3215004791u, 983594337u, 0, TANH_TOLERANCE, 0}, +{ 312, 3226738936u, 2018361566u, 1100926600u, 3985805054u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 313, 1073278308u, 409584884u, 3239758947u, 755795129u, 1072515176u, 1543239858u, 0, TANH_TOLERANCE, 0}, +{ 314, 1074723870u, 1819156379u, 3251342302u, 2982669005u, 1072691435u, 1108211960u, 0, TANH_TOLERANCE, 0}, +{ 315, 1080591913u, 2080534280u, 3188254060u, 449171797u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 316, 1079179684u, 168744837u, 3214950009u, 1322217822u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 317, 3229061076u, 3250487255u, 1062120700u, 1876195180u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 318, 3223197752u, 1336400247u, 1098057903u, 3314079581u, 3220176894u, 3333899270u, 0, TANH_TOLERANCE, 0}, +{ 319, 3216261732u, 265025555u, 1063854282u, 3779482256u, 3216258967u, 1006784628u, 0, TANH_TOLERANCE, 0}, +{ 320, 1072543381u, 887044257u, 1054789618u, 2732056261u, 1072126831u, 1641554481u, 0, TANH_TOLERANCE, 0}, +{ 321, 1067932534u, 4027115185u, 3191764868u, 2940199511u, 1067931473u, 3932768465u, 0, TANH_TOLERANCE, 0}, +{ 322, 3216131643u, 2875684421u, 3227459837u, 2251967570u, 3216129613u, 2392090637u, 0, TANH_TOLERANCE, 0}, +{ 323, 1071633020u, 284173546u, 3238823679u, 3557800647u, 1071476604u, 1926910603u, 0, TANH_TOLERANCE, 0}, +{ 324, 1080487040u, 3147771266u, 3220110464u, 2933364246u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 325, 1071144616u, 3366183281u, 3234870843u, 537442654u, 1071071656u, 3460153791u, 0, TANH_TOLERANCE, 0}, +{ 326, 3227341572u, 2529029548u, 3249882819u, 3781513577u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 327, 3219727810u, 1080845539u, 3206760016u, 911778687u, 3219455595u, 167462708u, 0, TANH_TOLERANCE, 0}, +{ 328, 3213971132u, 469586759u, 1091830022u, 3080528840u, 3213971024u, 477322961u, 0, TANH_TOLERANCE, 0}, +{ 329, 1075006224u, 2863108169u, 3225605506u, 2508274250u, 1072692976u, 3779254893u, 0, TANH_TOLERANCE, 0}, +{ 330, 3218167016u, 4080017377u, 3206492941u, 1470284690u, 3218140041u, 2231611050u, 0, TANH_TOLERANCE, 0}, +{ 331, 3217606150u, 3867917386u, 1102054928u, 3504746045u, 3217586177u, 3491769570u, 0, TANH_TOLERANCE, 0}, +{ 332, 1070813735u, 2962134101u, 3244741577u, 3390537350u, 1070776621u, 2796934313u, 0, TANH_TOLERANCE, 0}, +{ 333, 1077716053u, 1702237980u, 1071598971u, 1102587474u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 334, 3216601606u, 2180218657u, 3211592260u, 1206527853u, 3216596136u, 1797664468u, 0, TANH_TOLERANCE, 0}, +{ 335, 3215959112u, 394130786u, 3242511482u, 2437699868u, 3215956476u, 632716331u, 0, TANH_TOLERANCE, 0}, +{ 336, 1066257155u, 849581558u, 3252006507u, 2008614943u, 1066257017u, 2040632549u, 0, TANH_TOLERANCE, 0}, +{ 337, 3218528622u, 3128971673u, 3249137531u, 2773583059u, 3218468083u, 2682372564u, 0, TANH_TOLERANCE, 0}, +{ 338, 1076641258u, 590727700u, 3248651761u, 2183878539u, 1072693247u, 4294957516u, 0, TANH_TOLERANCE, 0}, +{ 339, 1080127109u, 820687580u, 3208143496u, 1402434664u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 340, 3229222163u, 1873709254u, 3245167989u, 44275991u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 341, 3213786001u, 1174874204u, 3208263730u, 2360372288u, 3213785853u, 3281597952u, 0, TANH_TOLERANCE, 0}, +{ 342, 1081834580u, 937573440u, 3208953761u, 211240241u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 343, 3226771718u, 2469774991u, 1043117070u, 3380071805u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 344, 1069655378u, 442507560u, 3254252803u, 3257889649u, 1069648107u, 1967517320u, 0, TANH_TOLERANCE, 0}, +{ 345, 1071996248u, 1854921625u, 1049810168u, 2729627545u, 1071819634u, 511546235u, 0, TANH_TOLERANCE, 0}, +{ 346, 3229546805u, 4001809575u, 3240128649u, 278261523u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 347, 1077787510u, 1793907966u, 3238955714u, 398859249u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 348, 3216681187u, 2511916952u, 3219195283u, 1697158299u, 3216674898u, 3492920521u, 0, TANH_TOLERANCE, 0}, +{ 349, 1073131276u, 3230931724u, 3243897690u, 3508781585u, 1072460728u, 72385801u, 0, TANH_TOLERANCE, 0}, +{ 350, 1081827510u, 1674254897u, 1046547577u, 217148561u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 351, 3218603986u, 3275604304u, 3194840159u, 2991205850u, 3218534188u, 1895030450u, 0, TANH_TOLERANCE, 0}, +{ 352, 3214123743u, 3509997278u, 3248888030u, 3897986511u, 3214123586u, 445233222u, 0, TANH_TOLERANCE, 0}, +{ 353, 1067105379u, 2156824613u, 1042295665u, 1239257646u, 1067104981u, 1993936574u, 0, TANH_TOLERANCE, 0}, +{ 354, 3219555541u, 1073153314u, 3250031627u, 2567234990u, 3219352129u, 655772150u, 0, TANH_TOLERANCE, 0}, +{ 355, 3213662084u, 4261696995u, 3197784432u, 323702024u, 3213661963u, 1132254523u, 0, TANH_TOLERANCE, 0}, +{ 356, 3226913781u, 4075177615u, 3202791065u, 1919006082u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 357, 3225638525u, 386429966u, 1086504491u, 3698826164u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 358, 1075181462u, 1681986446u, 3194985869u, 3072950140u, 1072693176u, 3387376968u, 0, TANH_TOLERANCE, 0}, +{ 359, 3220457661u, 3719038997u, 1055433962u, 3331415058u, 3219869011u, 1568398620u, 0, TANH_TOLERANCE, 0}, +{ 360, 1070186897u, 2420250111u, 3238002206u, 1928661079u, 1070164479u, 752957556u, 0, TANH_TOLERANCE, 0}, +{ 361, 1075622754u, 3679866727u, 3227386672u, 1273835792u, 1072693245u, 2332877410u, 0, TANH_TOLERANCE, 0}, +{ 362, 1065739986u, 2682092368u, 3234222284u, 1325425811u, 1065739931u, 3904488205u, 0, TANH_TOLERANCE, 0}, +{ 363, 1068895525u, 4175172697u, 3208346191u, 2130706153u, 1068891962u, 1281742233u, 0, TANH_TOLERANCE, 0}, +{ 364, 1078458136u, 1200784450u, 1083605096u, 1248595607u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 365, 3219133743u, 1897285171u, 3251296075u, 944966123u, 3218977948u, 629861953u, 0, TANH_TOLERANCE, 0}, +{ 366, 3225642610u, 2270747330u, 3230692631u, 422503284u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 367, 1076780005u, 2857564741u, 1075647403u, 3308906709u, 1072693247u, 4294966119u, 0, TANH_TOLERANCE, 0}, +{ 368, 3216058010u, 1380066948u, 3232612906u, 2613634294u, 3216056331u, 3013519241u, 0, TANH_TOLERANCE, 0}, +{ 369, 1071230888u, 4022784584u, 1060483857u, 3264056381u, 1071145971u, 252615328u, 0, TANH_TOLERANCE, 0}, +{ 370, 1066657500u, 1778509100u, 3213146285u, 2665833973u, 1066657336u, 924195788u, 0, TANH_TOLERANCE, 0}, +{ 371, 3219873028u, 1859175955u, 1079949560u, 4258450607u, 3219534594u, 2888810065u, 0, TANH_TOLERANCE, 0}, +{ 372, 1067151756u, 4128020197u, 1076266146u, 4122840980u, 1067151326u, 2056919845u, 0, TANH_TOLERANCE, 0}, +{ 373, 3214154683u, 2454653987u, 3229487005u, 2977478685u, 3214154514u, 893387246u, 0, TANH_TOLERANCE, 0}, +{ 374, 3229439235u, 1355181872u, 1095308770u, 436846481u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 375, 3227730934u, 2592856453u, 3247825559u, 3195234082u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 376, 3222118023u, 3554670043u, 1091621009u, 3321236467u, 3220174346u, 370328545u, 0, TANH_TOLERANCE, 0}, +{ 377, 1072158561u, 1936670355u, 1095715713u, 2958468553u, 1071921876u, 3097295899u, 0, TANH_TOLERANCE, 0}, +{ 378, 3214311205u, 2960339502u, 1098808013u, 1044068983u, 3214310968u, 2300984713u, 0, TANH_TOLERANCE, 0}, +{ 379, 3215565553u, 4093388677u, 1095478112u, 1735930261u, 3215564151u, 1155295820u, 0, TANH_TOLERANCE, 0}, +{ 380, 1078457390u, 1807398746u, 3195743135u, 4261616162u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 381, 3218731378u, 3250576797u, 1059002384u, 3043079652u, 3218643992u, 3185278812u, 0, TANH_TOLERANCE, 0}, +{ 382, 1072352837u, 666051428u, 3208765404u, 1912684117u, 1072031760u, 472268081u, 0, TANH_TOLERANCE, 0}, +{ 383, 1081467324u, 1949030179u, 1096388934u, 896459246u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 384, 1068980717u, 622499767u, 1066707637u, 1490260486u, 1068976486u, 3778455976u, 0, TANH_TOLERANCE, 0}, +{ 385, 1081522669u, 1490616165u, 3251242436u, 795675736u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 386, 1075701016u, 3662877092u, 3234317146u, 3200513112u, 1072693246u, 2781992228u, 0, TANH_TOLERANCE, 0}, +{ 387, 1076748754u, 1356101968u, 3236536816u, 3062844611u, 1072693247u, 4294965399u, 0, TANH_TOLERANCE, 0}, +{ 388, 3220971216u, 2284484846u, 3219498359u, 3240896015u, 3220055734u, 2376612227u, 0, TANH_TOLERANCE, 0}, +{ 389, 3225273929u, 494503287u, 1092811254u, 142673998u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 390, 3229057244u, 3394882641u, 3225306538u, 364852125u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 391, 3222116035u, 193885269u, 1088149839u, 1359805831u, 3220174326u, 2917860536u, 0, TANH_TOLERANCE, 0}, +{ 392, 3216213422u, 592580907u, 3199560872u, 3086438952u, 3216210947u, 3529159780u, 0, TANH_TOLERANCE, 0}, +{ 393, 1070004424u, 1778008540u, 1049064687u, 73581647u, 1069988466u, 3796959165u, 0, TANH_TOLERANCE, 0}, +{ 394, 3227859230u, 233240285u, 1081923320u, 2710903921u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 395, 1072659495u, 3719878805u, 1079866720u, 3615458228u, 1072178925u, 119062963u, 0, TANH_TOLERANCE, 0}, +{ 396, 3221194724u, 3647632375u, 3247225271u, 3839959621u, 3220096986u, 2905242185u, 0, TANH_TOLERANCE, 0}, +{ 397, 1081381000u, 2232210456u, 3235434773u, 224271737u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 398, 3213975204u, 2134662911u, 3190390590u, 4239009051u, 3213975095u, 1423693863u, 0, TANH_TOLERANCE, 0}, +{ 399, 1075283265u, 2305279897u, 1077668039u, 1854523320u, 1072693215u, 1065080987u, 0, TANH_TOLERANCE, 0}, +{ 400, 3220912835u, 538224650u, 3206153057u, 1379649610u, 3220041922u, 806488060u, 0, TANH_TOLERANCE, 0}, +{ 401, 3215284875u, 3683897920u, 3244167599u, 3647579469u, 3215284065u, 70286255u, 0, TANH_TOLERANCE, 0}, +{ 402, 1077698021u, 2694093608u, 1042775347u, 598406111u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 403, 3218975424u, 872706833u, 1084802480u, 2200602798u, 3218847178u, 243292267u, 0, TANH_TOLERANCE, 0}, +{ 404, 1065408269u, 904146293u, 1060867322u, 1729685598u, 1065408244u, 1452405291u, 0, TANH_TOLERANCE, 0}, +{ 405, 3214569338u, 1894173462u, 3232800651u, 191960416u, 3214568953u, 2872441934u, 0, TANH_TOLERANCE, 0}, +{ 406, 1078642431u, 3521028551u, 1054522089u, 3287274359u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 407, 1079658324u, 959640601u, 3201578263u, 4136915018u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 408, 1071345483u, 1553716379u, 1106027987u, 984725765u, 1071242888u, 3562407504u, 0, TANH_TOLERANCE, 0}, +{ 409, 3226249729u, 2287646644u, 3240329321u, 2276183378u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 410, 1072403478u, 3940225170u, 3199544434u, 997572161u, 1072058226u, 449217216u, 0, TANH_TOLERANCE, 0}, +{ 411, 3219059817u, 36116288u, 3206886566u, 4196602670u, 3218915148u, 4193878759u, 0, TANH_TOLERANCE, 0}, +{ 412, 3225967213u, 3550227562u, 3207257983u, 2747744117u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 413, 1081167454u, 507130047u, 1048359321u, 3229888373u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 414, 3221948202u, 2210969014u, 1081031001u, 1946786091u, 3220172024u, 3807901675u, 0, TANH_TOLERANCE, 0}, +{ 415, 3224772654u, 4059150589u, 3189759234u, 1177045799u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 416, 1078423548u, 2664812822u, 1050343198u, 2034180320u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 417, 3220070573u, 1175750283u, 3235559706u, 1424491340u, 3219630517u, 3733141581u, 0, TANH_TOLERANCE, 0}, +{ 418, 3219147073u, 1630036121u, 3231972785u, 3195479448u, 3218998802u, 3328603128u, 0, TANH_TOLERANCE, 0}, +{ 419, 1077846963u, 2527029044u, 1046927050u, 4000723255u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 420, 1076820069u, 3335703647u, 3237349676u, 3869440059u, 1072693247u, 4294966657u, 0, TANH_TOLERANCE, 0}, +{ 421, 1078850936u, 3888398377u, 3196041693u, 1290567220u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 422, 1071921950u, 3242451480u, 3248384948u, 707431021u, 1071769613u, 2378538733u, 0, TANH_TOLERANCE, 0}, +{ 423, 1075890477u, 2739665123u, 1060777905u, 1733073225u, 1072693247u, 3371085153u, 0, TANH_TOLERANCE, 0}, +{ 424, 1075371333u, 1297274853u, 3208848704u, 3341639139u, 1072693231u, 1169620284u, 0, TANH_TOLERANCE, 0}, +{ 425, 1066493885u, 2228057309u, 1084318902u, 1317851136u, 1066493775u, 2928536763u, 0, TANH_TOLERANCE, 0}, +{ 426, 1077769567u, 270039934u, 3241414679u, 3063626339u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 427, 3220226926u, 83062251u, 3211262173u, 2659016437u, 3219717442u, 1020636511u, 0, TANH_TOLERANCE, 0}, +{ 428, 1080015246u, 3833539373u, 3206667189u, 1567476111u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 429, 3217777984u, 2382776852u, 3249232579u, 1546622468u, 3217751063u, 1818212801u, 0, TANH_TOLERANCE, 0}, +{ 430, 1076099255u, 1714300821u, 1104130938u, 4167591598u, 1072693247u, 4256765263u, 0, TANH_TOLERANCE, 0}, +{ 431, 1067869976u, 2798720100u, 1086978789u, 449990704u, 1067869040u, 1755411038u, 0, TANH_TOLERANCE, 0}, +{ 432, 3223858383u, 4039516226u, 3244344107u, 4272932619u, 3220176895u, 4294396436u, 0, TANH_TOLERANCE, 0}, +{ 433, 3221659865u, 1683007544u, 1091105663u, 3805494321u, 3220162297u, 2272405765u, 0, TANH_TOLERANCE, 0}, +{ 434, 3220852948u, 2072627412u, 1094383324u, 3394151662u, 3220026176u, 3047210052u, 0, TANH_TOLERANCE, 0}, +{ 435, 3220570024u, 1120106427u, 3223631624u, 3404608264u, 3219924834u, 2913979229u, 0, TANH_TOLERANCE, 0}, +{ 436, 1078985629u, 559918757u, 3205077053u, 908100198u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 437, 1065746590u, 2026673913u, 3244833635u, 2844573214u, 1065746534u, 4285564648u, 0, TANH_TOLERANCE, 0}, +{ 438, 3229401435u, 3946837259u, 3234993796u, 3850406820u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 439, 1070062721u, 3139330994u, 1046133568u, 1539650690u, 1070044855u, 2726435592u, 0, TANH_TOLERANCE, 0}, +{ 440, 3225171164u, 1554593884u, 3228899878u, 2813752562u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 441, 1069087916u, 3804703138u, 1072931071u, 2053677923u, 1069082736u, 1742473058u, 0, TANH_TOLERANCE, 0}, +{ 442, 3227038507u, 289355864u, 1078453818u, 2143066338u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 443, 3216522792u, 2157691971u, 1106629150u, 110806409u, 3216518060u, 864673819u, 0, TANH_TOLERANCE, 0}, +{ 444, 1075865563u, 3570399481u, 1085637605u, 180265334u, 1072693247u, 2943779940u, 0, TANH_TOLERANCE, 0}, +{ 445, 3216708822u, 558779875u, 3202046748u, 2338464653u, 3216702231u, 506759401u, 0, TANH_TOLERANCE, 0}, +{ 446, 1066676984u, 1703969219u, 3229797258u, 1417521063u, 1066676812u, 3133190950u, 0, TANH_TOLERANCE, 0}, +{ 447, 3225199349u, 3917440951u, 1051668894u, 3736066983u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 448, 1071043536u, 3106613409u, 1066627453u, 2735392257u, 1070983166u, 1045266683u, 0, TANH_TOLERANCE, 0}, +{ 449, 1071956828u, 2229777605u, 1065061963u, 2405869925u, 1071793347u, 502078975u, 0, TANH_TOLERANCE, 0}, +{ 450, 3225831741u, 3967957902u, 1057416138u, 3459188071u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 451, 1071784938u, 3699016825u, 3249713090u, 796144848u, 1071672076u, 2579985767u, 0, TANH_TOLERANCE, 0}, +{ 452, 3222524940u, 3285165564u, 3211948811u, 401510871u, 3220176688u, 2239026903u, 0, TANH_TOLERANCE, 0}, +{ 453, 1078529018u, 634857910u, 3199607513u, 914218057u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 454, 1076403304u, 2030735578u, 3233855943u, 965677531u, 1072693247u, 4294598139u, 0, TANH_TOLERANCE, 0}, +{ 455, 1075362511u, 3957229084u, 1051050470u, 3123776651u, 1072693230u, 462899214u, 0, TANH_TOLERANCE, 0}, +{ 456, 3221863333u, 162122081u, 3239376395u, 108064594u, 3220170165u, 2709210009u, 0, TANH_TOLERANCE, 0}, +{ 457, 3224688874u, 869031839u, 3225020876u, 1344301606u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 458, 3219676354u, 946696117u, 3231825228u, 1700703647u, 3219425812u, 3436958511u, 0, TANH_TOLERANCE, 0}, +{ 459, 1074444299u, 3394168074u, 1076939786u, 1666995668u, 1072687986u, 368182188u, 0, TANH_TOLERANCE, 0}, +{ 460, 3218211979u, 2488789804u, 3238508333u, 1506943664u, 3218181741u, 3093576615u, 0, TANH_TOLERANCE, 0}, +{ 461, 1072788663u, 3844072288u, 3202592279u, 2630019853u, 1072268032u, 509834618u, 0, TANH_TOLERANCE, 0}, +{ 462, 3220983118u, 1244307192u, 3191297711u, 2540916692u, 3220058377u, 802394392u, 0, TANH_TOLERANCE, 0}, +{ 463, 3215791332u, 2871645739u, 3239081581u, 1440249115u, 3215789285u, 2945497557u, 0, TANH_TOLERANCE, 0}, +{ 464, 1072544937u, 1231934926u, 3236746788u, 603977748u, 1072127558u, 148852321u, 0, TANH_TOLERANCE, 0}, +{ 465, 3214324057u, 2386312545u, 1063169277u, 2715234268u, 3214323814u, 630831394u, 0, TANH_TOLERANCE, 0}, +{ 466, 1077317658u, 915867083u, 1046790892u, 3347417612u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 467, 1081866940u, 3553288373u, 1065698616u, 2906680663u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 468, 1066477746u, 2342364630u, 1051356723u, 4019093203u, 1066477641u, 1308319496u, 0, TANH_TOLERANCE, 0}, +{ 469, 3216897802u, 2911548084u, 1105282515u, 2476735795u, 3216888883u, 64033488u, 0, TANH_TOLERANCE, 0}, +{ 470, 1068298564u, 1836216409u, 1101062307u, 2519592554u, 1068296546u, 2859116598u, 0, TANH_TOLERANCE, 0}, +{ 471, 1073323889u, 1235369496u, 3222946447u, 668087854u, 1072529424u, 3194090941u, 0, TANH_TOLERANCE, 0}, +{ 472, 3217991780u, 2981820811u, 1059838516u, 2845580478u, 3217954221u, 4200696890u, 0, TANH_TOLERANCE, 0}, +{ 473, 3214902934u, 1565550570u, 3217165795u, 4162017137u, 3214902281u, 3653946900u, 0, TANH_TOLERANCE, 0}, +{ 474, 3224668466u, 2808968027u, 1055630096u, 1782326814u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 475, 1069305614u, 1492622658u, 3216653077u, 3972512122u, 1069298089u, 134736289u, 0, TANH_TOLERANCE, 0}, +{ 476, 3222171679u, 2722693603u, 3227814791u, 3169731970u, 3220174817u, 3531603680u, 0, TANH_TOLERANCE, 0}, +{ 477, 3221052359u, 899763203u, 3207606001u, 2804747833u, 3220072675u, 2906226549u, 0, TANH_TOLERANCE, 0}, +{ 478, 3223330293u, 3789058912u, 3228095081u, 4135937628u, 3220176895u, 2491612513u, 0, TANH_TOLERANCE, 0}, +{ 479, 1069636566u, 1682808307u, 3206960335u, 232877759u, 1069629643u, 583610000u, 0, TANH_TOLERANCE, 0}, +{ 480, 3226362846u, 2851963139u, 3246852961u, 2590862592u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 481, 1074908950u, 2422232642u, 3234779662u, 290458310u, 1072692678u, 2454695928u, 0, TANH_TOLERANCE, 0}, +{ 482, 3219059686u, 1082582386u, 1075605675u, 2602133689u, 3218915044u, 2576723185u, 0, TANH_TOLERANCE, 0}, +{ 483, 3226187123u, 1789635787u, 1059414278u, 1048286093u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 484, 1079456174u, 231339448u, 1055573265u, 504907415u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 485, 1071600069u, 1153251200u, 3204617090u, 1772013857u, 1071450530u, 982900350u, 0, TANH_TOLERANCE, 0}, +{ 486, 1080676687u, 1082898276u, 3212089272u, 1449080862u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 487, 1076571101u, 3177299045u, 1058862813u, 809400815u, 1072693247u, 4294938769u, 0, TANH_TOLERANCE, 0}, +{ 488, 3223514518u, 1924429710u, 1056464743u, 3349283177u, 3220176895u, 4186509591u, 0, TANH_TOLERANCE, 0}, +{ 489, 3226599023u, 42238036u, 1042379500u, 2113559863u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 490, 1071052699u, 3304403230u, 3217556703u, 58952646u, 1070991249u, 3007091220u, 0, TANH_TOLERANCE, 0}, +{ 491, 3218960986u, 1645486982u, 3224301095u, 3636267471u, 3218835429u, 1446891056u, 0, TANH_TOLERANCE, 0}, +{ 492, 1071150617u, 619402181u, 3235208235u, 557360557u, 1071076862u, 548691099u, 0, TANH_TOLERANCE, 0}, +{ 493, 3225655482u, 110029735u, 1046937383u, 984375729u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 494, 3213613986u, 4063688092u, 3203235744u, 1049950343u, 3213613874u, 1513497013u, 0, TANH_TOLERANCE, 0}, +{ 495, 1070739227u, 650996069u, 1054971928u, 3953359826u, 1070708162u, 851578057u, 0, TANH_TOLERANCE, 0}, +{ 496, 3222861501u, 66926332u, 1090561839u, 1379780888u, 3220176880u, 360882482u, 0, TANH_TOLERANCE, 0}, +{ 497, 3224016123u, 2803378256u, 1086057989u, 498534626u, 3220176895u, 4294915866u, 0, TANH_TOLERANCE, 0}, +{ 498, 1076327097u, 2846400785u, 1047142525u, 1375153550u, 1072693247u, 4293786378u, 0, TANH_TOLERANCE, 0}, +{ 499, 1066601297u, 2869128958u, 1070972315u, 4246440273u, 1066601153u, 3402349456u, 0, TANH_TOLERANCE, 0}, +{ 500, 1067561146u, 3112381207u, 1044430965u, 3981604561u, 1067560685u, 2566534493u, 0, TANH_TOLERANCE, 0}, +{ 501, 3223914965u, 243303420u, 1093735824u, 1575581926u, 3220176895u, 4294726540u, 0, TANH_TOLERANCE, 0}, +{ 502, 3225506509u, 3218865041u, 3204803496u, 3840388050u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 503, 1067289799u, 336846959u, 1052664471u, 3798336786u, 1067289261u, 2993180106u, 0, TANH_TOLERANCE, 0}, +{ 504, 1068537148u, 3639240976u, 1081202165u, 1844741676u, 1068535631u, 1373601135u, 0, TANH_TOLERANCE, 0}, +{ 505, 3218196249u, 717293069u, 3211534283u, 582401011u, 3218167180u, 496380559u, 0, TANH_TOLERANCE, 0}, +{ 506, 3228893840u, 3766248610u, 3196520332u, 1174437546u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 507, 1076091194u, 756959182u, 3204099341u, 1581804034u, 1072693247u, 4251765017u, 0, TANH_TOLERANCE, 0}, +{ 508, 3217340780u, 3560686300u, 3220980617u, 4277975772u, 3217329035u, 3938865978u, 0, TANH_TOLERANCE, 0}, +{ 509, 3218294684u, 2598148853u, 3217622194u, 3460421008u, 3218257801u, 3777429081u, 0, TANH_TOLERANCE, 0}, +{ 510, 1071963704u, 136600515u, 3209934920u, 3340653128u, 1071797973u, 383375267u, 0, TANH_TOLERANCE, 0}, +{ 511, 1078994518u, 1045480938u, 3251354609u, 4133432965u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 512, 1077967943u, 1630207738u, 3239996829u, 2393354808u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 513, 3213694690u, 3739770117u, 1059520750u, 3959551225u, 3213694562u, 2906185574u, 0, TANH_TOLERANCE, 0}, +{ 514, 3223390473u, 1498861716u, 1091297147u, 847410798u, 3220176895u, 3575048625u, 0, TANH_TOLERANCE, 0}, +{ 515, 1073516688u, 983275314u, 3232538664u, 2244973629u, 1072578453u, 1729614224u, 0, TANH_TOLERANCE, 0}, +{ 516, 1069529329u, 2353103845u, 3235718771u, 2978889966u, 1069518753u, 2585637409u, 0, TANH_TOLERANCE, 0}, +{ 517, 3229337896u, 1546972125u, 3249076079u, 1987349196u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 518, 3225636601u, 2769161072u, 1075207126u, 292616282u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 519, 3215440938u, 36855311u, 1052128202u, 1479039342u, 3215439824u, 3021602545u, 0, TANH_TOLERANCE, 0}, +{ 520, 1076417021u, 2027463605u, 1066023013u, 3369686340u, 1072693247u, 4294667855u, 0, TANH_TOLERANCE, 0}, +{ 521, 3215678541u, 3808681655u, 1054161346u, 1821773119u, 3215676836u, 4252330285u, 0, TANH_TOLERANCE, 0}, +{ 522, 1065851752u, 3175490326u, 3226879970u, 845687760u, 1065851684u, 952657342u, 0, TANH_TOLERANCE, 0}, +{ 523, 1065371665u, 3124482451u, 3242748377u, 3259417226u, 1065371643u, 1068152155u, 0, TANH_TOLERANCE, 0}, +{ 524, 1067265791u, 2751606436u, 3236210939u, 3923142740u, 1067265273u, 4267448991u, 0, TANH_TOLERANCE, 0}, +{ 525, 1079966097u, 2016872044u, 3228408064u, 4201274408u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 526, 3215077894u, 1019916843u, 3219974785u, 1977881787u, 3215077392u, 2106531914u, 0, TANH_TOLERANCE, 0}, +{ 527, 3215207392u, 2060433318u, 1075872515u, 366073725u, 3215206708u, 4083368175u, 0, TANH_TOLERANCE, 0}, +{ 528, 3213200653u, 1098469906u, 1082900695u, 2349346832u, 3213200601u, 543684019u, 0, TANH_TOLERANCE, 0}, +{ 529, 3218363315u, 3011196295u, 3252479932u, 2459281672u, 3218320258u, 2654661612u, 0, TANH_TOLERANCE, 0}, +{ 530, 3221334323u, 2843222682u, 1089275809u, 298982001u, 3220126785u, 2833806156u, 0, TANH_TOLERANCE, 0}, +{ 531, 1080766178u, 914741728u, 3203468059u, 2833809843u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 532, 3225229542u, 1274901962u, 3241535845u, 3759113509u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 533, 3227042074u, 2134927252u, 3253802671u, 3013731444u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 534, 1080326973u, 2230655177u, 3254510616u, 1249674366u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 535, 1071359861u, 717357389u, 1083533731u, 3746683362u, 1071254900u, 3631908499u, 0, TANH_TOLERANCE, 0}, +{ 536, 3220064570u, 834976849u, 3217357661u, 2465861779u, 3219627791u, 2471657761u, 0, TANH_TOLERANCE, 0}, +{ 537, 1066627637u, 1385714428u, 1053358395u, 3007113740u, 1066627484u, 622695525u, 0, TANH_TOLERANCE, 0}, +{ 538, 1068353711u, 599268545u, 3201368210u, 2309854744u, 1068351512u, 1648394891u, 0, TANH_TOLERANCE, 0}, +{ 539, 1073100182u, 2840234388u, 3232496515u, 333365983u, 1072447353u, 2876664628u, 0, TANH_TOLERANCE, 0}, +{ 540, 1066894301u, 3136078996u, 3194520860u, 2650572904u, 1066894030u, 3836763203u, 0, TANH_TOLERANCE, 0}, +{ 541, 3224250507u, 2405805086u, 3251640319u, 324233833u, 3220176895u, 4294965857u, 0, TANH_TOLERANCE, 0}, +{ 542, 1081533322u, 2589598340u, 3254677807u, 952438812u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 543, 3213232021u, 1922837702u, 3216892718u, 3535907549u, 3213231965u, 3296837648u, 0, TANH_TOLERANCE, 0}, +{ 544, 3226838652u, 261447440u, 3209805849u, 1150571079u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 545, 1079028016u, 4026487528u, 1073152064u, 27340691u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 546, 3222832236u, 338765118u, 1086225786u, 3207238249u, 3220176876u, 440058419u, 0, TANH_TOLERANCE, 0}, +{ 547, 3215057071u, 1085283176u, 3187775111u, 1601194210u, 3215056595u, 1400160228u, 0, TANH_TOLERANCE, 0}, +{ 548, 1078937261u, 3031712790u, 3252307859u, 170666844u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 549, 3220959383u, 3148395674u, 1041913758u, 3306391490u, 3220053050u, 2562078751u, 0, TANH_TOLERANCE, 0}, +{ 550, 3217005710u, 2205233857u, 3208100078u, 3993195511u, 3216995244u, 2747014119u, 0, TANH_TOLERANCE, 0}, +{ 551, 1071893912u, 4282766727u, 1072820377u, 1874778218u, 1071750211u, 660651612u, 0, TANH_TOLERANCE, 0}, +{ 552, 3218173124u, 2920860798u, 3218070226u, 3104066154u, 3218145720u, 693930883u, 0, TANH_TOLERANCE, 0}, +{ 553, 3217533263u, 969991373u, 3250596895u, 1734386152u, 3217515838u, 2631270782u, 0, TANH_TOLERANCE, 0}, +{ 554, 3226332906u, 1218740205u, 3239802737u, 2610078504u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 555, 3217565578u, 1485218325u, 3220870240u, 3591664613u, 3217547052u, 140249651u, 0, TANH_TOLERANCE, 0}, +{ 556, 3216754207u, 690157417u, 3190850619u, 4192347699u, 3216747099u, 499816119u, 0, TANH_TOLERANCE, 0}, +{ 557, 1079276594u, 4009839784u, 1079670252u, 394167192u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 558, 3225122053u, 961532417u, 1092588071u, 2923790239u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 559, 3216462003u, 4174125604u, 1050682630u, 2169701868u, 3216457793u, 919186931u, 0, TANH_TOLERANCE, 0}, +{ 560, 3227363835u, 4146748230u, 1087373950u, 2481478351u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 561, 1073842138u, 3984715440u, 1050421618u, 2446142566u, 1072641499u, 1791854957u, 0, TANH_TOLERANCE, 0}, +{ 562, 1076832374u, 936290150u, 1100614426u, 3625806370u, 1072693247u, 4294966767u, 0, TANH_TOLERANCE, 0}, +{ 563, 1080913584u, 1866615265u, 3215651428u, 2337013350u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 564, 3229081054u, 712227971u, 1106004723u, 973148499u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 565, 3223796743u, 3409813738u, 3244817008u, 1933503498u, 3220176895u, 4293505094u, 0, TANH_TOLERANCE, 0}, +{ 566, 1075749429u, 3180389060u, 3228735703u, 83422217u, 1072693247u, 280657473u, 0, TANH_TOLERANCE, 0}, +{ 567, 1074732996u, 556972671u, 3204582372u, 841555801u, 1072691497u, 1078894527u, 0, TANH_TOLERANCE, 0}, +{ 568, 1072864873u, 4189151332u, 1080874032u, 706326922u, 1072320445u, 3126467056u, 0, TANH_TOLERANCE, 0}, +{ 569, 1079374091u, 198291836u, 1057281892u, 2188836928u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 570, 1074946267u, 1219449298u, 3228734687u, 3504562743u, 1072692819u, 2750855966u, 0, TANH_TOLERANCE, 0}, +{ 571, 3217153376u, 1776099219u, 1094316777u, 4188083896u, 3217145833u, 645707833u, 0, TANH_TOLERANCE, 0}, +{ 572, 3214817228u, 2614400266u, 1073750227u, 3003203347u, 3214816653u, 4118899096u, 0, TANH_TOLERANCE, 0}, +{ 573, 3219225558u, 2959351406u, 1105603716u, 311851587u, 3219119060u, 3153940070u, 0, TANH_TOLERANCE, 0}, +{ 574, 1076155826u, 865443613u, 1097532516u, 3622237781u, 1072693247u, 4278853323u, 0, TANH_TOLERANCE, 0}, +{ 575, 3223398058u, 447506102u, 3195759295u, 3603669725u, 3220176895u, 3653727122u, 0, TANH_TOLERANCE, 0}, +{ 576, 1079015805u, 3934398273u, 1040996422u, 2968621268u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 577, 3215614193u, 784208771u, 1088764788u, 2182296421u, 3215612665u, 879108182u, 0, TANH_TOLERANCE, 0}, +{ 578, 3228409347u, 1527590526u, 3206961556u, 2823164069u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 579, 3225109795u, 3876699591u, 3207481130u, 4028148535u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 580, 1076236154u, 2164249756u, 1059857743u, 1785169952u, 1072693247u, 4290237064u, 0, TANH_TOLERANCE, 0}, +{ 581, 1078172521u, 2079273665u, 1080303860u, 625760474u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 582, 3222291804u, 3636214836u, 1068367620u, 2932621925u, 3220175667u, 2559685817u, 0, TANH_TOLERANCE, 0}, +{ 583, 1066015468u, 4274131512u, 1047707755u, 92550763u, 1066015376u, 1477695260u, 0, TANH_TOLERANCE, 0}, +{ 584, 3215599337u, 2648933384u, 1084603503u, 3534304873u, 3215597848u, 2856479001u, 0, TANH_TOLERANCE, 0}, +{ 585, 1070854691u, 3216750767u, 3191088629u, 547482628u, 1070813952u, 2964537256u, 0, TANH_TOLERANCE, 0}, +{ 586, 1070521958u, 1420360746u, 1080063101u, 1690029499u, 1070483630u, 3376375773u, 0, TANH_TOLERANCE, 0}, +{ 587, 3223563908u, 1908572179u, 1080112083u, 1228319033u, 3220176895u, 4243921216u, 0, TANH_TOLERANCE, 0}, +{ 588, 1067032546u, 500312015u, 3212368508u, 3864619086u, 1067032195u, 2888994469u, 0, TANH_TOLERANCE, 0}, +{ 589, 3221335610u, 4211343447u, 1087492676u, 4272583781u, 3220127028u, 929411503u, 0, TANH_TOLERANCE, 0}, +{ 590, 1080518026u, 2382118000u, 1042665328u, 567154882u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 591, 1069547778u, 1435344339u, 3216303171u, 2275988178u, 1069537173u, 3641349188u, 0, TANH_TOLERANCE, 0}, +{ 592, 3219781499u, 3403659753u, 3218043030u, 1926480488u, 3219485664u, 1805105515u, 0, TANH_TOLERANCE, 0}, +{ 593, 1074743231u, 1198845185u, 3225556149u, 1130089684u, 1072691564u, 1130724028u, 0, TANH_TOLERANCE, 0}, +{ 594, 3221614466u, 2183928090u, 1048403956u, 963834821u, 3220159548u, 2632844817u, 0, TANH_TOLERANCE, 0}, +{ 595, 1080701440u, 2120625396u, 1041006976u, 2137548527u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 596, 1080355870u, 586700956u, 1059670521u, 303891699u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 597, 3221091650u, 2509132460u, 1102827530u, 2205707903u, 3220080026u, 3892042078u, 0, TANH_TOLERANCE, 0}, +{ 598, 3217443509u, 1229308263u, 3209170414u, 4206576047u, 3217428916u, 1972214507u, 0, TANH_TOLERANCE, 0}, +{ 599, 3221979137u, 4078010749u, 3199236456u, 733478972u, 3220172566u, 2325284033u, 0, TANH_TOLERANCE, 0}, +{ 600, 3215538376u, 4277541051u, 3199806921u, 397102023u, 3215537041u, 1038730987u, 0, TANH_TOLERANCE, 0}, +{ 601, 3214849381u, 900999594u, 3234720188u, 2530214248u, 3214848778u, 517726932u, 0, TANH_TOLERANCE, 0}, +{ 602, 1074446396u, 4000609478u, 1096577064u, 4148592328u, 1072688027u, 4126215607u, 0, TANH_TOLERANCE, 0}, +{ 603, 1067542452u, 2154187873u, 3224392607u, 3957250362u, 1067542013u, 1359750955u, 0, TANH_TOLERANCE, 0}, +{ 604, 3221316336u, 2867079200u, 1101870326u, 921212001u, 3220123272u, 596464385u, 0, TANH_TOLERANCE, 0}, +{ 605, 3223784706u, 674547716u, 1063216239u, 3929755226u, 3220176895u, 4293210269u, 0, TANH_TOLERANCE, 0}, +{ 606, 3225735787u, 3158182449u, 1043794244u, 3259056345u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 607, 3225242320u, 3002823940u, 1059511739u, 2832435794u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 608, 3220450550u, 2196511929u, 1049973941u, 3672092877u, 3219865119u, 1534045465u, 0, TANH_TOLERANCE, 0}, +{ 609, 1068263848u, 3655292191u, 1086438127u, 3567072906u, 1068261939u, 3330397833u, 0, TANH_TOLERANCE, 0}, +{ 610, 3227458308u, 1617573614u, 3201863123u, 3090723732u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 611, 3223764196u, 679893506u, 3211547753u, 824081024u, 3220176895u, 4292564626u, 0, TANH_TOLERANCE, 0}, +{ 612, 1076947613u, 2285242807u, 1084999409u, 2221731406u, 1072693247u, 4294967260u, 0, TANH_TOLERANCE, 0}, +{ 613, 3217219424u, 1935990727u, 1088822246u, 1058156518u, 3217210539u, 673583441u, 0, TANH_TOLERANCE, 0}, +{ 614, 1080819070u, 521023584u, 1059186903u, 4245163857u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 615, 1081871044u, 2312887617u, 3191771354u, 1885370807u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 616, 3228836567u, 1796441468u, 1100030327u, 2772711004u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 617, 3216859732u, 2095685003u, 1077984448u, 2100773742u, 3216851319u, 3546547663u, 0, TANH_TOLERANCE, 0}, +{ 618, 3213926140u, 2892538035u, 1042396334u, 4162200338u, 3213926045u, 98121596u, 0, TANH_TOLERANCE, 0}, +{ 619, 3226997111u, 2177698116u, 3227557177u, 150832500u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 620, 3213582312u, 607966734u, 3236250630u, 4164600559u, 3213582205u, 1317441634u, 0, TANH_TOLERANCE, 0}, +{ 621, 3219535540u, 2830122967u, 1046096700u, 3713346883u, 3219339417u, 3473358335u, 0, TANH_TOLERANCE, 0}, +{ 622, 3224615051u, 2314640506u, 3203696416u, 3276228872u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 623, 3219203763u, 469331883u, 3249037349u, 2999233437u, 3219086102u, 85688925u, 0, TANH_TOLERANCE, 0}, +{ 624, 1079556219u, 560886625u, 1091899487u, 748795120u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 625, 1067712650u, 2958421324u, 1092569414u, 3235243477u, 1067711984u, 933574582u, 0, TANH_TOLERANCE, 0}, +{ 626, 3213998017u, 3221475559u, 1043038304u, 915608434u, 3213997901u, 3819757689u, 0, TANH_TOLERANCE, 0}, +{ 627, 1073294682u, 3007808652u, 3216682290u, 2531019474u, 1072520426u, 1456133354u, 0, TANH_TOLERANCE, 0}, +{ 628, 3226300359u, 1767658578u, 3237045269u, 2313128318u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 629, 3219006500u, 1926845182u, 1066835624u, 1783256828u, 3218872347u, 1882092066u, 0, TANH_TOLERANCE, 0}, +{ 630, 1065741453u, 90378038u, 1057168870u, 164358218u, 1065741398u, 591806547u, 0, TANH_TOLERANCE, 0}, +{ 631, 1081693348u, 1610524680u, 1085283851u, 2903496007u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 632, 1075489858u, 4274321404u, 3202913591u, 720121831u, 1072693241u, 979506729u, 0, TANH_TOLERANCE, 0}, +{ 633, 1067982472u, 2034778236u, 1071133763u, 1413236391u, 1067981304u, 1075351172u, 0, TANH_TOLERANCE, 0}, +{ 634, 1067840244u, 1489112261u, 1076691395u, 348210906u, 1067839363u, 3489382366u, 0, TANH_TOLERANCE, 0}, +{ 635, 3217229677u, 2797651324u, 3224410527u, 2374818327u, 3217220570u, 3663838511u, 0, TANH_TOLERANCE, 0}, +{ 636, 1077801496u, 1823161666u, 3197810695u, 3119680047u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 637, 1072218792u, 3420950657u, 1087084743u, 2136638961u, 1071957381u, 4227318367u, 0, TANH_TOLERANCE, 0}, +{ 638, 1073047952u, 3554566429u, 1062907717u, 2736702589u, 1072423253u, 3954224834u, 0, TANH_TOLERANCE, 0}, +{ 639, 3227062875u, 2928437580u, 3187765027u, 1393427873u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 640, 3218738745u, 189447067u, 1051643315u, 828663513u, 3218650265u, 2565529360u, 0, TANH_TOLERANCE, 0}, +{ 641, 1068042509u, 2852350928u, 1045683757u, 673354280u, 1068041203u, 1273807154u, 0, TANH_TOLERANCE, 0}, +{ 642, 1065966397u, 3589563265u, 3248741629u, 812657927u, 1065966312u, 3995661865u, 0, TANH_TOLERANCE, 0}, +{ 643, 3213679498u, 1766416701u, 1100392103u, 2185373290u, 3213679373u, 1105851242u, 0, TANH_TOLERANCE, 0}, +{ 644, 3220275389u, 3763582673u, 3191965790u, 388374829u, 3219753918u, 630121662u, 0, TANH_TOLERANCE, 0}, +{ 645, 1075440832u, 1187403069u, 1075300235u, 336640304u, 1072693238u, 671323862u, 0, TANH_TOLERANCE, 0}, +{ 646, 1081906155u, 1718795752u, 3243118752u, 683369237u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 647, 3218132129u, 1863545307u, 1069449477u, 3418627399u, 3218107521u, 2978760047u, 0, TANH_TOLERANCE, 0}, +{ 648, 1072747022u, 3295607249u, 1068878592u, 1633297809u, 1072236708u, 1219129914u, 0, TANH_TOLERANCE, 0}, +{ 649, 1070481463u, 2585980994u, 3236670483u, 1286750688u, 1070445359u, 1671965836u, 0, TANH_TOLERANCE, 0}, +{ 650, 1067128553u, 15816845u, 3233249283u, 2491924775u, 1067128138u, 4149105436u, 0, TANH_TOLERANCE, 0}, +{ 651, 1065481693u, 1051983351u, 1049180786u, 1474421917u, 1065481663u, 304342688u, 0, TANH_TOLERANCE, 0}, +{ 652, 3216978165u, 2003816032u, 1086050104u, 668090487u, 3216968109u, 3936271285u, 0, TANH_TOLERANCE, 0}, +{ 653, 1068284677u, 3671484625u, 1067020039u, 430024694u, 1068282704u, 213223715u, 0, TANH_TOLERANCE, 0}, +{ 654, 1072639990u, 3991830201u, 3207808714u, 1021245839u, 1072170471u, 4236962281u, 0, TANH_TOLERANCE, 0}, +{ 655, 1071534423u, 4255801807u, 3207681716u, 1926756877u, 1071398029u, 3730360966u, 0, TANH_TOLERANCE, 0}, +{ 656, 1067869425u, 4167786896u, 1077097744u, 1775517981u, 1067868490u, 3350202937u, 0, TANH_TOLERANCE, 0}, +{ 657, 1076164794u, 3187518564u, 1082437406u, 944672491u, 1072693247u, 4280914270u, 0, TANH_TOLERANCE, 0}, +{ 658, 1068240650u, 953085192u, 3227310828u, 3459155777u, 1068238811u, 2397589293u, 0, TANH_TOLERANCE, 0}, +{ 659, 1072648234u, 1908555460u, 1073640207u, 260441967u, 1072174059u, 6166727u, 0, TANH_TOLERANCE, 0}, +{ 660, 1072462486u, 250762477u, 1072582645u, 2886742039u, 1072087959u, 2719323898u, 0, TANH_TOLERANCE, 0}, +{ 661, 3228885910u, 786180031u, 3197734769u, 2788918312u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 662, 3225074643u, 2055912467u, 3244244909u, 1394142937u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 663, 1072758713u, 91984146u, 3222252812u, 4126276047u, 1072245701u, 402520945u, 0, TANH_TOLERANCE, 0}, +{ 664, 1075048683u, 3942715706u, 3239316352u, 410676547u, 1072693051u, 3851512815u, 0, TANH_TOLERANCE, 0}, +{ 665, 3215335062u, 86296211u, 1085850694u, 649202596u, 3215334160u, 3540055039u, 0, TANH_TOLERANCE, 0}, +{ 666, 3226492024u, 3069064472u, 3237358008u, 23209276u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 667, 1074943832u, 1867297860u, 1072956607u, 2513414118u, 1072692811u, 2618045138u, 0, TANH_TOLERANCE, 0}, +{ 668, 3228513251u, 3171788768u, 3235208783u, 162138697u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 669, 1075436999u, 1245110700u, 1081653954u, 2584994077u, 1072693237u, 3711677726u, 0, TANH_TOLERANCE, 0}, +{ 670, 3226635752u, 3347226587u, 1058962932u, 2291943376u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 671, 1070433398u, 966940828u, 1060726420u, 2798041096u, 1070399821u, 3118560199u, 0, TANH_TOLERANCE, 0}, +{ 672, 1072793759u, 2487340727u, 3223786370u, 4105954991u, 1072271731u, 2389258654u, 0, TANH_TOLERANCE, 0}, +{ 673, 3228193553u, 1671039260u, 1086395032u, 3745833360u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 674, 1069661709u, 651714217u, 1047070645u, 2130549237u, 1069654319u, 221802056u, 0, TANH_TOLERANCE, 0}, +{ 675, 3217601491u, 1423000172u, 3247822717u, 1551488170u, 3217581688u, 181509837u, 0, TANH_TOLERANCE, 0}, +{ 676, 3216277371u, 921077236u, 3213332351u, 1431049019u, 3216274507u, 3009781141u, 0, TANH_TOLERANCE, 0}, +{ 677, 1071704599u, 655715547u, 3190985373u, 1527556471u, 1071578785u, 2205486276u, 0, TANH_TOLERANCE, 0}, +{ 678, 3222412099u, 4110878657u, 3251297180u, 879739345u, 3220176405u, 1214346782u, 0, TANH_TOLERANCE, 0}, +{ 679, 1076367578u, 2623955764u, 1093699897u, 1216444475u, 1072693247u, 4294330559u, 0, TANH_TOLERANCE, 0}, +{ 680, 1078274115u, 107442539u, 3239767031u, 1149813329u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 681, 3224008056u, 1761361082u, 3226030205u, 1121849716u, 3220176895u, 4294909129u, 0, TANH_TOLERANCE, 0}, +{ 682, 3226455627u, 2534144722u, 1044223733u, 3512285706u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 683, 3218137533u, 4073670723u, 1050729852u, 3034818849u, 3218112568u, 2667121844u, 0, TANH_TOLERANCE, 0}, +{ 684, 1081013054u, 1421423503u, 1060278048u, 1397153092u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 685, 3220567557u, 1649206019u, 1104525577u, 1267104290u, 3219923717u, 2769521020u, 0, TANH_TOLERANCE, 0}, +{ 686, 3213419345u, 3775270392u, 1040251850u, 68667319u, 3213419265u, 2545621795u, 0, TANH_TOLERANCE, 0}, +{ 687, 3216913812u, 3099226694u, 3254103006u, 4020102648u, 3216904673u, 4012492726u, 0, TANH_TOLERANCE, 0}, +{ 688, 3216271776u, 3718441177u, 3215643451u, 4032951536u, 3216268948u, 3943411919u, 0, TANH_TOLERANCE, 0}, +{ 689, 1066151467u, 508048351u, 3210196713u, 1707937896u, 1066151350u, 2449381217u, 0, TANH_TOLERANCE, 0}, +{ 690, 3215388843u, 2784738160u, 1073435430u, 1109346010u, 3215387838u, 1879123550u, 0, TANH_TOLERANCE, 0}, +{ 691, 3222579562u, 3331916473u, 3238794568u, 2707019594u, 3220176759u, 980840063u, 0, TANH_TOLERANCE, 0}, +{ 692, 1078502606u, 3093165197u, 1072894805u, 2853215019u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 693, 3219727867u, 2135797997u, 1048399559u, 2941926126u, 3219455627u, 2769844582u, 0, TANH_TOLERANCE, 0}, +{ 694, 1067305348u, 2083412145u, 3249335391u, 507212448u, 1067304798u, 248712640u, 0, TANH_TOLERANCE, 0}, +{ 695, 1074315175u, 4270176401u, 3246546709u, 3288753319u, 1072684643u, 2903274486u, 0, TANH_TOLERANCE, 0}, +{ 696, 3228009919u, 3692175292u, 3197271515u, 3989064196u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 697, 3228623066u, 3111924274u, 1066772558u, 59281695u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 698, 1071878215u, 2135245466u, 3208804313u, 3846547392u, 1071739222u, 3014085290u, 0, TANH_TOLERANCE, 0}, +{ 699, 1079149171u, 972051266u, 3222814246u, 3539700586u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 700, 3216597418u, 330951080u, 1079189813u, 583922384u, 3216591988u, 4271149752u, 0, TANH_TOLERANCE, 0}, +{ 701, 1077057180u, 1711944085u, 1104170032u, 643991456u, 1072693247u, 4294967295u, 0, TANH_TOLERANCE, 0}, +{ 702, 3224992365u, 2072550721u, 3250147641u, 4280263530u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 703, 3213944226u, 1566376352u, 1067251433u, 72984588u, 3213944125u, 3738816808u, 0, TANH_TOLERANCE, 0}, +{ 704, 1079547929u, 3103043079u, 1045853123u, 410067497u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 705, 3219818221u, 1910366299u, 1081770885u, 634683073u, 3219505645u, 2911026815u, 0, TANH_TOLERANCE, 0}, +{ 706, 1075239232u, 2226525875u, 3224149290u, 2126302825u, 1072693202u, 736485286u, 0, TANH_TOLERANCE, 0}, +{ 707, 1073150247u, 1383818978u, 3193885723u, 1220372650u, 1072468548u, 1453165635u, 0, TANH_TOLERANCE, 0}, +{ 708, 1071725823u, 1953339096u, 1077176252u, 1476516558u, 1071611118u, 3094019794u, 0, TANH_TOLERANCE, 0}, +{ 709, 1072383456u, 1306277326u, 1079089150u, 4093716191u, 1072047867u, 2345709570u, 0, TANH_TOLERANCE, 0}, +{ 710, 3223711603u, 51750045u, 3242913901u, 4256866157u, 3220176895u, 4289606629u, 0, TANH_TOLERANCE, 0}, +{ 711, 3213959335u, 2163853087u, 3232053146u, 2962422808u, 3213959230u, 3607978116u, 0, TANH_TOLERANCE, 0}, +{ 712, 1074468369u, 1618388148u, 3233154824u, 3711953164u, 1072688447u, 772390444u, 0, TANH_TOLERANCE, 0}, +{ 713, 3227993634u, 357108214u, 3202294604u, 2306775262u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 714, 3216584150u, 2571356437u, 3249064063u, 2394851808u, 3216578850u, 265180082u, 0, TANH_TOLERANCE, 0}, +{ 715, 3224196635u, 4273880094u, 1103698617u, 3578832032u, 3220176895u, 4294964023u, 0, TANH_TOLERANCE, 0}, +{ 716, 3223989517u, 2091068742u, 3228270226u, 3980489730u, 3220176895u, 4294890111u, 0, TANH_TOLERANCE, 0}, +{ 717, 3222725296u, 2772307714u, 1051008486u, 32546576u, 3220176851u, 36562416u, 0, TANH_TOLERANCE, 0}, +{ 718, 3225500575u, 2143788498u, 3195498043u, 3630119231u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 719, 3215410151u, 2527385594u, 3240503648u, 3482095012u, 3215409103u, 223410783u, 0, TANH_TOLERANCE, 0}, +{ 720, 3226440159u, 2690097362u, 1068598730u, 2360266862u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 721, 1070392205u, 2673272949u, 1082639557u, 522449749u, 1070360701u, 382258917u, 0, TANH_TOLERANCE, 0}, +{ 722, 1081355475u, 3596379400u, 3242016775u, 2002293002u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 723, 1080565288u, 4113224369u, 3222122439u, 2152316893u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 724, 3220796716u, 31662602u, 1047721249u, 1747087514u, 3220009792u, 1786415707u, 0, TANH_TOLERANCE, 0}, +{ 725, 3228443661u, 2489659568u, 1097051253u, 277506957u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 726, 3213421930u, 3850162281u, 3213841942u, 438724093u, 3213421850u, 978459012u, 0, TANH_TOLERANCE, 0}, +{ 727, 1079663895u, 2431814052u, 1075518084u, 2672434118u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 728, 3227434095u, 391606792u, 1048184750u, 4168944276u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 729, 3227869472u, 457529672u, 3201090276u, 72407935u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 730, 3220817871u, 3954981400u, 1052053242u, 2411049585u, 3220016147u, 3511268541u, 0, TANH_TOLERANCE, 0}, +{ 731, 1076742907u, 485456950u, 1088415093u, 1655397424u, 1072693247u, 4294965222u, 0, TANH_TOLERANCE, 0}, +{ 732, 3215011644u, 1551748070u, 3236871640u, 1329701152u, 3215011221u, 2829038109u, 0, TANH_TOLERANCE, 0}, +{ 733, 3221493394u, 3099222537u, 1104984570u, 4293792842u, 3220149432u, 808086103u, 0, TANH_TOLERANCE, 0}, +{ 734, 3216532617u, 3603065260u, 3197735968u, 2402359253u, 3216527797u, 1764416133u, 0, TANH_TOLERANCE, 0}, +{ 735, 3215601800u, 3961208159u, 3219057584u, 2340553876u, 3215600305u, 2344462802u, 0, TANH_TOLERANCE, 0}, +{ 736, 1073833333u, 4014841779u, 3197672877u, 3697233334u, 1072639754u, 1246670554u, 0, TANH_TOLERANCE, 0}, +{ 737, 3219567113u, 1403876392u, 3254028950u, 921363393u, 3219359416u, 4132459186u, 0, TANH_TOLERANCE, 0}, +{ 738, 1082085982u, 1862576361u, 3194031708u, 2476290925u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 739, 1067487560u, 1454212851u, 1088378861u, 3400401866u, 1067487181u, 2318239370u, 0, TANH_TOLERANCE, 0}, +{ 740, 1074406809u, 552676385u, 3188635745u, 3778112968u, 1072687178u, 1070255472u, 0, TANH_TOLERANCE, 0}, +{ 741, 3219555010u, 1199568671u, 3225679997u, 46947405u, 3219351793u, 2517024871u, 0, TANH_TOLERANCE, 0}, +{ 742, 1074539809u, 2596231448u, 3253943728u, 2219151748u, 1072689591u, 1666921402u, 0, TANH_TOLERANCE, 0}, +{ 743, 1071769915u, 4119719558u, 3222036299u, 1275474618u, 1071660967u, 2845583729u, 0, TANH_TOLERANCE, 0}, +{ 744, 3226277175u, 3347296825u, 1101507910u, 1254014794u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 745, 1076779960u, 673775040u, 1070743626u, 244126093u, 1072693247u, 4294966118u, 0, TANH_TOLERANCE, 0}, +{ 746, 3216831338u, 1832066983u, 1051358028u, 3262483417u, 3216823291u, 840194706u, 0, TANH_TOLERANCE, 0}, +{ 747, 1074413872u, 3962610501u, 3198598777u, 849269178u, 1072687339u, 1695789171u, 0, TANH_TOLERANCE, 0}, +{ 748, 3224988140u, 2497516122u, 3254374111u, 2821429629u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 749, 1074139136u, 2805941787u, 3217785843u, 779131141u, 1072676440u, 1089483228u, 0, TANH_TOLERANCE, 0}, +{ 750, 3222714382u, 723423605u, 1084533420u, 627282213u, 3220176847u, 436675031u, 0, TANH_TOLERANCE, 0}, +{ 751, 3220141984u, 4292778869u, 1078101071u, 1676860147u, 3219662074u, 436286370u, 0, TANH_TOLERANCE, 0}, +{ 752, 1074191350u, 3528118587u, 3194648564u, 2363260897u, 1072679465u, 3158136682u, 0, TANH_TOLERANCE, 0}, +{ 753, 3214917975u, 1307010018u, 1061248120u, 1468743108u, 3214917308u, 1887206257u, 0, TANH_TOLERANCE, 0}, +{ 754, 3227708771u, 107905661u, 3226089788u, 1943427674u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 755, 3213396365u, 760006940u, 1054265604u, 1749976597u, 3213396288u, 1015782970u, 0, TANH_TOLERANCE, 0}, +{ 756, 3225190472u, 2787503556u, 1081282610u, 1195841206u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 757, 3213822252u, 545462045u, 3208381743u, 1981311808u, 3213822096u, 1895015686u, 0, TANH_TOLERANCE, 0}, +{ 758, 1070669320u, 3657978397u, 1104463616u, 3501253426u, 1070643315u, 3340057444u, 0, TANH_TOLERANCE, 0}, +{ 759, 1067709649u, 1804177501u, 3210693633u, 3606766729u, 1067708987u, 2207822296u, 0, TANH_TOLERANCE, 0}, +{ 760, 1074759727u, 1336278526u, 1043741618u, 3165279431u, 1072691666u, 3920633442u, 0, TANH_TOLERANCE, 0}, +{ 761, 1069103403u, 1599382075u, 1058018527u, 4212580517u, 1069098074u, 3887268780u, 0, TANH_TOLERANCE, 0}, +{ 762, 3217988086u, 3007589929u, 3202026547u, 2792028313u, 3217950731u, 2952417810u, 0, TANH_TOLERANCE, 0}, +{ 763, 3228965522u, 1866066996u, 1060329048u, 3727175322u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 764, 3215193859u, 150890940u, 1056025306u, 3082724735u, 3215193196u, 1187099324u, 0, TANH_TOLERANCE, 0}, +{ 765, 1071446123u, 80400395u, 1093584426u, 3478941315u, 1071326261u, 48805005u, 0, TANH_TOLERANCE, 0}, +{ 766, 3228571942u, 4050954182u, 3219263194u, 2537475930u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 767, 1071133327u, 2881752155u, 3212589299u, 2559651278u, 1071061848u, 3503400932u, 0, TANH_TOLERANCE, 0}, +{ 768, 3228044784u, 440309030u, 3214267461u, 3788040806u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 769, 1080553671u, 918813144u, 3208535698u, 1607035904u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 770, 1066254699u, 2497054124u, 1089139147u, 2549609010u, 1066254562u, 1621993583u, 0, TANH_TOLERANCE, 0}, +{ 771, 1066960585u, 790219083u, 1054657139u, 2797979479u, 1066960277u, 3785521302u, 0, TANH_TOLERANCE, 0}, +{ 772, 1070364312u, 1149462078u, 1095765205u, 3879963182u, 1070334162u, 791933143u, 0, TANH_TOLERANCE, 0}, +{ 773, 3216361301u, 2684353926u, 3205212854u, 1732474928u, 3216357868u, 1244044034u, 0, TANH_TOLERANCE, 0}, +{ 774, 1079508325u, 2742237025u, 1051317716u, 3386396147u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 775, 1071619594u, 3408320912u, 1103071166u, 4233059513u, 1071466003u, 2250109031u, 0, TANH_TOLERANCE, 0}, +{ 776, 1071155004u, 1077495917u, 1088399968u, 433115118u, 1071080664u, 2213941110u, 0, TANH_TOLERANCE, 0}, +{ 777, 3217130484u, 841366493u, 1051716814u, 4121125128u, 3217123372u, 2948102763u, 0, TANH_TOLERANCE, 0}, +{ 778, 1070923540u, 321857207u, 1089128010u, 1149988239u, 1070876210u, 287366057u, 0, TANH_TOLERANCE, 0}, +{ 779, 3226668295u, 799866606u, 3197637091u, 3924438208u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 780, 3213082986u, 2002049816u, 1077053447u, 2240354761u, 3213082946u, 1332721886u, 0, TANH_TOLERANCE, 0}, +{ 781, 3222714827u, 478939968u, 1097035749u, 1066716440u, 3220176847u, 1148390538u, 0, TANH_TOLERANCE, 0}, +{ 782, 3224085033u, 1653104725u, 1088548129u, 81977716u, 3220176895u, 4294949325u, 0, TANH_TOLERANCE, 0}, +{ 783, 3215735644u, 3899475018u, 3189694084u, 3330093036u, 3215733772u, 108014255u, 0, TANH_TOLERANCE, 0}, +{ 784, 1077778247u, 2612450289u, 1079065127u, 603380842u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 785, 1080713847u, 3962735564u, 1101570429u, 1372490825u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 786, 1069486080u, 1479841439u, 1059312257u, 541504905u, 1069476148u, 1330025412u, 0, TANH_TOLERANCE, 0}, +{ 787, 1075516450u, 2626148789u, 1057571099u, 4121656076u, 1072693242u, 2025230023u, 0, TANH_TOLERANCE, 0}, +{ 788, 1075321933u, 1902560314u, 1043130231u, 3557671562u, 1072693223u, 2642910265u, 0, TANH_TOLERANCE, 0}, +{ 789, 3214801292u, 41779312u, 1081626342u, 831171823u, 3214800731u, 509784550u, 0, TANH_TOLERANCE, 0}, +{ 790, 1069665436u, 1393168821u, 1066457405u, 1381616968u, 1069657975u, 1271360986u, 0, TANH_TOLERANCE, 0}, +{ 791, 1073386717u, 3756584649u, 3222267229u, 1423157432u, 1072547282u, 502039030u, 0, TANH_TOLERANCE, 0}, +{ 792, 3229269850u, 1894912556u, 1042426694u, 155024547u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 793, 3214327880u, 35164295u, 3203391785u, 1037041084u, 3214327634u, 3083858517u, 0, TANH_TOLERANCE, 0}, +{ 794, 1076388871u, 3957875950u, 3232195211u, 1590756436u, 1072693247u, 4294507195u, 0, TANH_TOLERANCE, 0}, +{ 795, 1071990050u, 1447585080u, 1071279485u, 1107922438u, 1071815538u, 3161902907u, 0, TANH_TOLERANCE, 0}, +{ 796, 1067224038u, 981897615u, 1051856116u, 430357614u, 1067223553u, 3187978985u, 0, TANH_TOLERANCE, 0}, +{ 797, 3222281335u, 395145384u, 3219821938u, 50586510u, 3220175565u, 2064559548u, 0, TANH_TOLERANCE, 0}, +{ 798, 1072921640u, 750827797u, 1082862669u, 230466783u, 1072355622u, 1074964933u, 0, TANH_TOLERANCE, 0}, +{ 799, 1077231635u, 1365083575u, 3204848310u, 1700831722u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 800, 3220187542u, 344241827u, 1071538935u, 2715566077u, 3219685795u, 4089371904u, 0, TANH_TOLERANCE, 0}, +{ 801, 3227659912u, 4069301823u, 3193208760u, 2949125229u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 802, 1081211291u, 3585711710u, 1065801594u, 2302229267u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 803, 3214041900u, 709803845u, 1048741487u, 2296910194u, 3214041770u, 2865692980u, 0, TANH_TOLERANCE, 0}, +{ 804, 3214252299u, 744421179u, 1069302001u, 2659232829u, 3214252089u, 1383114050u, 0, TANH_TOLERANCE, 0}, +{ 805, 1078155904u, 1799949903u, 3192522886u, 4212149209u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 806, 3217642838u, 145234164u, 3250614064u, 912384201u, 3217621494u, 2301037676u, 0, TANH_TOLERANCE, 0}, +{ 807, 3225830600u, 2784620507u, 1102812948u, 3531481022u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 808, 3229139567u, 383952592u, 3205659905u, 3633194728u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 809, 3216059164u, 3792395543u, 1070072378u, 3864816376u, 3216057481u, 392473577u, 0, TANH_TOLERANCE, 0}, +{ 810, 3217899185u, 2115553675u, 1066288499u, 3538377867u, 3217866517u, 4139851017u, 0, TANH_TOLERANCE, 0}, +{ 811, 3229006513u, 1230026762u, 1090719723u, 440819880u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 812, 3214518020u, 2991290482u, 1096886719u, 1097971167u, 3214517669u, 464087563u, 0, TANH_TOLERANCE, 0}, +{ 813, 1077465688u, 1098035020u, 3230900504u, 1479059095u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 814, 3229036868u, 1719428427u, 3188631907u, 3707377409u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 815, 1068964805u, 3748932896u, 1084908557u, 1325384361u, 1068960705u, 3897061665u, 0, TANH_TOLERANCE, 0}, +{ 816, 1076315468u, 3979168763u, 1057455255u, 2454615952u, 1072693247u, 4293557095u, 0, TANH_TOLERANCE, 0}, +{ 817, 1068835624u, 1449164578u, 1056960316u, 1654931641u, 1068832484u, 4023712312u, 0, TANH_TOLERANCE, 0}, +{ 818, 1073536162u, 2120487381u, 3226298974u, 2364226633u, 1072582528u, 2771358353u, 0, TANH_TOLERANCE, 0}, +{ 819, 1074022852u, 1074268944u, 1065730444u, 280016852u, 1072667115u, 442967526u, 0, TANH_TOLERANCE, 0}, +{ 820, 3216036896u, 3315127889u, 3236295594u, 2900924954u, 3216035310u, 3763110972u, 0, TANH_TOLERANCE, 0}, +{ 821, 3215300259u, 2246037502u, 1049691002u, 1496066550u, 3215299421u, 2831592142u, 0, TANH_TOLERANCE, 0}, +{ 822, 3213978379u, 4191285446u, 3217936236u, 2382392789u, 3213978269u, 3840860417u, 0, TANH_TOLERANCE, 0}, +{ 823, 1078153244u, 640099844u, 1042152237u, 2064279383u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 824, 1075719134u, 3468560824u, 1093251038u, 310958750u, 1072693246u, 3531801958u, 0, TANH_TOLERANCE, 0}, +{ 825, 1080011184u, 1413568905u, 1100941106u, 1627289946u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 826, 3213569646u, 3797143370u, 3195497539u, 3843275034u, 3213569542u, 1270881281u, 0, TANH_TOLERANCE, 0}, +{ 827, 3229008721u, 2806642640u, 3201943068u, 2515980718u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 828, 1077440132u, 632580632u, 1078673506u, 3259601317u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 829, 3216709215u, 3309678799u, 1049337078u, 3056787074u, 3216702620u, 1653632981u, 0, TANH_TOLERANCE, 0}, +{ 830, 3221495289u, 2341164249u, 1080834967u, 2810890005u, 3220149628u, 3005879799u, 0, TANH_TOLERANCE, 0}, +{ 831, 1072262554u, 932124675u, 1093915797u, 662682630u, 1071982362u, 3057316859u, 0, TANH_TOLERANCE, 0}, +{ 832, 3228258571u, 1367996113u, 3251723684u, 2974064663u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 833, 1074987851u, 323437999u, 1090499064u, 901457511u, 1072692936u, 364088582u, 0, TANH_TOLERANCE, 0}, +{ 834, 3225293116u, 4184941840u, 3196770014u, 2458988443u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 835, 1077132524u, 2023065054u, 3211994098u, 2734612965u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 836, 1071414726u, 3679267365u, 3237728785u, 1699558211u, 1071300429u, 3732495732u, 0, TANH_TOLERANCE, 0}, +{ 837, 1077593250u, 1826799031u, 1078709629u, 3986905229u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 838, 1068572425u, 351061688u, 3194386466u, 4105857588u, 1068570755u, 499330562u, 0, TANH_TOLERANCE, 0}, +{ 839, 1068808070u, 1365244058u, 1064457319u, 1452191426u, 1068805114u, 1012629484u, 0, TANH_TOLERANCE, 0}, +{ 840, 1071462417u, 2463030625u, 3215975031u, 3773488326u, 1071339602u, 4185089979u, 0, TANH_TOLERANCE, 0}, +{ 841, 3229256575u, 752664055u, 1065110394u, 1835931663u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 842, 1077559328u, 3496172149u, 1089617208u, 109068701u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 843, 3215960879u, 1636966254u, 1086098766u, 2016598298u, 3215958236u, 2999409352u, 0, TANH_TOLERANCE, 0}, +{ 844, 1067708534u, 3551516956u, 1097969102u, 1317953425u, 1067707874u, 2624410332u, 0, TANH_TOLERANCE, 0}, +{ 845, 3223540761u, 2977627788u, 1045339018u, 516058480u, 3220176895u, 4222297914u, 0, TANH_TOLERANCE, 0}, +{ 846, 3224825666u, 3901731263u, 3189566462u, 32272932u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 847, 1074136068u, 1956025297u, 3246628529u, 3840733905u, 1072676243u, 765228757u, 0, TANH_TOLERANCE, 0}, +{ 848, 1080943668u, 561057891u, 3198494340u, 4271027193u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 849, 3228909825u, 692989850u, 3242630588u, 2492225971u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 850, 3218062309u, 3439913962u, 1067477011u, 2973333638u, 3218020721u, 3960544974u, 0, TANH_TOLERANCE, 0}, +{ 851, 3219236869u, 877613377u, 1044917899u, 809672798u, 3219132175u, 1311516534u, 0, TANH_TOLERANCE, 0}, +{ 852, 3222171454u, 905426932u, 1046417457u, 1086320855u, 3220174816u, 151676798u, 0, TANH_TOLERANCE, 0}, +{ 853, 3227472261u, 2645567288u, 1051258339u, 557182478u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 854, 3216640862u, 186287752u, 1061342054u, 4054003419u, 3216634997u, 2519513944u, 0, TANH_TOLERANCE, 0}, +{ 855, 1079440881u, 3506889716u, 3243866036u, 519056371u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 856, 1065722725u, 2171898436u, 3246911982u, 1091500784u, 1065722672u, 3180746426u, 0, TANH_TOLERANCE, 0}, +{ 857, 3226870457u, 368493885u, 3222871893u, 1419055230u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 858, 1078319084u, 2010971245u, 3188804530u, 1518695799u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 859, 3218009421u, 1239207795u, 1040192984u, 2199481342u, 3217970879u, 3474753941u, 0, TANH_TOLERANCE, 0}, +{ 860, 3218318669u, 4264613432u, 3203460972u, 3558930895u, 3218279698u, 4197303057u, 0, TANH_TOLERANCE, 0}, +{ 861, 1068125075u, 3772748958u, 3227667376u, 309688336u, 1068123562u, 1489711826u, 0, TANH_TOLERANCE, 0}, +{ 862, 3223403009u, 1077949160u, 1075769893u, 2405271377u, 3220176895u, 3700387119u, 0, TANH_TOLERANCE, 0}, +{ 863, 1078203664u, 3751608506u, 3232278094u, 930375071u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 864, 3215394369u, 1518334131u, 3205247482u, 791756713u, 3215393353u, 103206669u, 0, TANH_TOLERANCE, 0}, +{ 865, 1067240397u, 2825203170u, 3245054001u, 1822981827u, 1067239900u, 1515673819u, 0, TANH_TOLERANCE, 0}, +{ 866, 1080093419u, 514474738u, 1089072073u, 3300845441u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 867, 3219536978u, 247369460u, 3197320093u, 687450958u, 3219340336u, 978352660u, 0, TANH_TOLERANCE, 0}, +{ 868, 1081092750u, 2722237629u, 1058272368u, 90602316u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 869, 3217535619u, 1845900544u, 3231520830u, 3389751458u, 3217518115u, 4229139541u, 0, TANH_TOLERANCE, 0}, +{ 870, 3227612301u, 737689911u, 3195377751u, 3462616966u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 871, 3221441232u, 3620285831u, 1055501023u, 2708056059u, 3220143434u, 3921561u, 0, TANH_TOLERANCE, 0}, +{ 872, 3220513572u, 4073430285u, 1056206159u, 172017902u, 3219898084u, 1973970623u, 0, TANH_TOLERANCE, 0}, +{ 873, 3219161094u, 2799176222u, 1052706894u, 4083892667u, 3219020605u, 733511961u, 0, TANH_TOLERANCE, 0}, +{ 874, 3216959621u, 1562351330u, 1069705601u, 1247765260u, 3216949835u, 4127746042u, 0, TANH_TOLERANCE, 0}, +{ 875, 3224328691u, 51853475u, 3189080201u, 2783553144u, 3220176895u, 4294966860u, 0, TANH_TOLERANCE, 0}, +{ 876, 3220502929u, 3851781549u, 3241598113u, 514064046u, 3219892754u, 382488881u, 0, TANH_TOLERANCE, 0}, +{ 877, 1080123021u, 934745487u, 3248182437u, 2798581921u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 878, 3219373949u, 2948648757u, 3232177250u, 4278702895u, 3219231339u, 732036294u, 0, TANH_TOLERANCE, 0}, +{ 879, 1073534300u, 4259101461u, 1061606772u, 84229920u, 1072582145u, 1140039901u, 0, TANH_TOLERANCE, 0}, +{ 880, 3215901351u, 3891230598u, 1095924595u, 3049217547u, 3215898929u, 4061131300u, 0, TANH_TOLERANCE, 0}, +{ 881, 1074207325u, 3806018919u, 3243191216u, 280177341u, 1072680278u, 119798727u, 0, TANH_TOLERANCE, 0}, +{ 882, 1070061714u, 3900344258u, 1063647809u, 4206745890u, 1070043882u, 4225813589u, 0, TANH_TOLERANCE, 0}, +{ 883, 3222464456u, 2126253040u, 3207248026u, 808507485u, 3220176566u, 3729330534u, 0, TANH_TOLERANCE, 0}, +{ 884, 1076653133u, 3465685634u, 3230391053u, 3754958214u, 1072693247u, 4294959137u, 0, TANH_TOLERANCE, 0}, +{ 885, 1080840988u, 461094531u, 1101110393u, 1316091396u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 886, 1071271770u, 4197635149u, 1091873113u, 1240127141u, 1071180785u, 300469245u, 0, TANH_TOLERANCE, 0}, +{ 887, 1074333893u, 118603800u, 1105304898u, 4291425557u, 1072685235u, 2023333141u, 0, TANH_TOLERANCE, 0}, +{ 888, 3219720621u, 3744663425u, 3212482771u, 953662066u, 3219451491u, 1728510743u, 0, TANH_TOLERANCE, 0}, +{ 889, 1076782697u, 3564196690u, 3228101916u, 904305212u, 1072693247u, 4294966166u, 0, TANH_TOLERANCE, 0}, +{ 890, 1067207479u, 3566257266u, 3235138829u, 2734275140u, 1067207008u, 396173854u, 0, TANH_TOLERANCE, 0}, +{ 891, 3227171261u, 606044282u, 3241318094u, 2446416887u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 892, 1065744532u, 2336116589u, 3197594053u, 2296925138u, 1065744477u, 1318672729u, 0, TANH_TOLERANCE, 0}, +{ 893, 1070101995u, 907670625u, 3240769036u, 1827119006u, 1070082762u, 1452920190u, 0, TANH_TOLERANCE, 0}, +{ 894, 1066487279u, 2818710946u, 3246059905u, 553394170u, 1066487171u, 3077210550u, 0, TANH_TOLERANCE, 0}, +{ 895, 3213621342u, 4099522736u, 3232742168u, 3718083858u, 3213621228u, 4270652673u, 0, TANH_TOLERANCE, 0}, +{ 896, 1078739788u, 1059279404u, 1080245336u, 175941677u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 897, 1082121019u, 1650862428u, 1061816101u, 1723201723u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 898, 3226429902u, 2462163405u, 3218946201u, 3876535372u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 899, 1076004278u, 495844137u, 1073721460u, 772777946u, 1072693247u, 4132231651u, 0, TANH_TOLERANCE, 0}, +{ 900, 1068143970u, 458757721u, 3245680321u, 3609892707u, 1068142406u, 1203906592u, 0, TANH_TOLERANCE, 0}, +{ 901, 3214254476u, 2533012202u, 1079980803u, 3592268374u, 3214254265u, 3301236168u, 0, TANH_TOLERANCE, 0}, +{ 902, 3216996268u, 4108274117u, 1063045844u, 571992389u, 3216985944u, 4098370140u, 0, TANH_TOLERANCE, 0}, +{ 903, 1077984359u, 3541110973u, 1096296754u, 3118427427u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 904, 3213902987u, 1213941007u, 1105433735u, 2172963370u, 3213902897u, 2586721683u, 0, TANH_TOLERANCE, 0}, +{ 905, 1079027567u, 272190288u, 1095452370u, 4026581530u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 906, 1079855269u, 2843638672u, 1100510986u, 3190536898u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 907, 1076417062u, 2014317727u, 3247389683u, 2428462015u, 1072693247u, 4294668042u, 0, TANH_TOLERANCE, 0}, +{ 908, 1078248077u, 688442200u, 1047852515u, 3035186380u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 909, 1074567060u, 1010095511u, 3221288076u, 405287991u, 1072689952u, 558226479u, 0, TANH_TOLERANCE, 0}, +{ 910, 3229225943u, 2983070435u, 1089546472u, 2907918480u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 911, 1076696665u, 81928569u, 1056007286u, 2740556321u, 1072693247u, 4294963097u, 0, TANH_TOLERANCE, 0}, +{ 912, 1066276691u, 2076689028u, 1081558619u, 3039159031u, 1066276549u, 2514845407u, 0, TANH_TOLERANCE, 0}, +{ 913, 1067230382u, 1376882094u, 3211003208u, 1296286481u, 1067229892u, 3821406691u, 0, TANH_TOLERANCE, 0}, +{ 914, 1074871434u, 744133164u, 3200943494u, 955832216u, 1072692489u, 3864723433u, 0, TANH_TOLERANCE, 0}, +{ 915, 3223144598u, 176522478u, 1069999908u, 2891249491u, 3220176894u, 705332519u, 0, TANH_TOLERANCE, 0}, +{ 916, 1065584698u, 3685851715u, 3187829932u, 2363997529u, 1065584660u, 211014232u, 0, TANH_TOLERANCE, 0}, +{ 917, 1065409879u, 3974431579u, 1052505165u, 2589067816u, 1065409854u, 4054288065u, 0, TANH_TOLERANCE, 0}, +{ 918, 3213516885u, 3819109588u, 1048561488u, 969143351u, 3213516790u, 1379942954u, 0, TANH_TOLERANCE, 0}, +{ 919, 1073687973u, 4246896124u, 1104584799u, 1940097860u, 1072609810u, 1441804246u, 0, TANH_TOLERANCE, 0}, +{ 920, 1066912836u, 2228686199u, 3220231833u, 777624847u, 1066912555u, 3407343459u, 0, TANH_TOLERANCE, 0}, +{ 921, 3224127274u, 4189906558u, 3203004203u, 854242364u, 3220176895u, 4294957863u, 0, TANH_TOLERANCE, 0}, +{ 922, 1081890311u, 4089051094u, 3227282692u, 2693170723u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 923, 1066855127u, 1278581412u, 3239296746u, 1774588717u, 1066854876u, 2541069805u, 0, TANH_TOLERANCE, 0}, +{ 924, 3221324110u, 1794845306u, 1104879344u, 4135865182u, 3220124819u, 2264282728u, 0, TANH_TOLERANCE, 0}, +{ 925, 1081283231u, 754938390u, 1061291430u, 2010786993u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 926, 1073581409u, 2034303731u, 3240176537u, 314147356u, 1072591461u, 214940394u, 0, TANH_TOLERANCE, 0}, +{ 927, 3224109162u, 567588900u, 3195452230u, 1421366017u, 3220176895u, 4294954860u, 0, TANH_TOLERANCE, 0}, +{ 928, 3221944027u, 2708717091u, 1071975971u, 1364590470u, 3220171946u, 3353839435u, 0, TANH_TOLERANCE, 0}, +{ 929, 3229068611u, 3461956134u, 3207820115u, 1605709634u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 930, 1071594452u, 1497124553u, 1051715442u, 916736957u, 1071446066u, 3751200891u, 0, TANH_TOLERANCE, 0}, +{ 931, 1070002699u, 834914365u, 1064667143u, 2839166298u, 1069986795u, 4288384363u, 0, TANH_TOLERANCE, 0}, +{ 932, 1069862861u, 2139295776u, 1062816721u, 914592523u, 1069850968u, 1656920492u, 0, TANH_TOLERANCE, 0}, +{ 933, 3213754179u, 851569132u, 1058503154u, 1399378677u, 3213754038u, 2687975447u, 0, TANH_TOLERANCE, 0}, +{ 934, 3224100513u, 3897202342u, 3245382590u, 246600375u, 3220176895u, 4294953106u, 0, TANH_TOLERANCE, 0}, +{ 935, 3222314580u, 3620429520u, 1055627557u, 229305u, 3220175863u, 2092509791u, 0, TANH_TOLERANCE, 0}, +{ 936, 1076618801u, 3641997865u, 3206673888u, 93720614u, 1072693247u, 4294953519u, 0, TANH_TOLERANCE, 0}, +{ 937, 3222565555u, 32766320u, 1062084905u, 3668443038u, 3220176743u, 3446256579u, 0, TANH_TOLERANCE, 0}, +{ 938, 3222250420u, 2039713492u, 3248699388u, 1346210821u, 3220175356u, 3537038166u, 0, TANH_TOLERANCE, 0}, +{ 939, 1078369952u, 1335820726u, 3191756860u, 1808427032u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 940, 1070879947u, 650692001u, 1103515670u, 2253348763u, 1070836863u, 2862482944u, 0, TANH_TOLERANCE, 0}, +{ 941, 3213415283u, 2372623300u, 3210185343u, 3200572848u, 3213415203u, 3712949820u, 0, TANH_TOLERANCE, 0}, +{ 942, 1080873125u, 762317532u, 3194595095u, 3192607437u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 943, 1070651309u, 217775356u, 3232827087u, 2969367386u, 1070626514u, 2747666722u, 0, TANH_TOLERANCE, 0}, +{ 944, 1069755463u, 3621353969u, 1077994795u, 3873976266u, 1069746150u, 163612163u, 0, TANH_TOLERANCE, 0}, +{ 945, 1078719075u, 268372152u, 3221764390u, 3216978962u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 946, 3227563243u, 142942404u, 1075322987u, 1746449109u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 947, 1081986200u, 496534875u, 3254522293u, 2532372502u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 948, 3228205445u, 2999955409u, 3222793392u, 1868977643u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 949, 1074319042u, 3353193428u, 3218469191u, 3326244297u, 1072684769u, 1756315237u, 0, TANH_TOLERANCE, 0}, +{ 950, 1072413103u, 73646871u, 3231442171u, 3711510104u, 1072063156u, 1138124218u, 0, TANH_TOLERANCE, 0}, +{ 951, 1077900612u, 218135177u, 3198908856u, 3082199105u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 952, 1072262784u, 1061628117u, 3248859043u, 86776158u, 1071982492u, 946844398u, 0, TANH_TOLERANCE, 0}, +{ 953, 3217921858u, 938869114u, 1087911145u, 2416710759u, 3217888034u, 157440628u, 0, TANH_TOLERANCE, 0}, +{ 954, 1079848192u, 2970853959u, 3239543429u, 1887505029u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 955, 3225145875u, 1337895935u, 1076463812u, 1172733328u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 956, 1068014296u, 1469010822u, 3229583535u, 551399515u, 1068013056u, 745955852u, 0, TANH_TOLERANCE, 0}, +{ 957, 1074118123u, 1849711538u, 1049053713u, 1744276190u, 1072675043u, 2479863773u, 0, TANH_TOLERANCE, 0}, +{ 958, 3226410140u, 2976596113u, 3192137295u, 3033242648u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 959, 1079824113u, 876810930u, 3197470945u, 2571587447u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 960, 3226042170u, 4007797282u, 3225853845u, 4069319648u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 961, 1067202926u, 3840538373u, 1043189552u, 3668774580u, 1067202458u, 2670505126u, 0, TANH_TOLERANCE, 0}, +{ 962, 3220757432u, 200857661u, 3229758439u, 3359367736u, 3219997347u, 873171144u, 0, TANH_TOLERANCE, 0}, +{ 963, 3227826349u, 111868139u, 3227902082u, 2366064003u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 964, 1066215262u, 3510904416u, 3222131653u, 3822770497u, 1066215133u, 3308089664u, 0, TANH_TOLERANCE, 0}, +{ 965, 3226947075u, 789151814u, 1099269239u, 2958956055u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 966, 1076290712u, 722163228u, 1105524559u, 1534462169u, 1072693247u, 4292909799u, 0, TANH_TOLERANCE, 0}, +{ 967, 1066509006u, 2207037106u, 3208952465u, 1231254630u, 1066508892u, 1078364023u, 0, TANH_TOLERANCE, 0}, +{ 968, 3215709852u, 3838689849u, 3198769679u, 1302617170u, 3215708057u, 808607773u, 0, TANH_TOLERANCE, 0}, +{ 969, 1076501722u, 2527556476u, 3240373426u, 124352692u, 1072693247u, 4294885069u, 0, TANH_TOLERANCE, 0}, +{ 970, 3215269445u, 3502371499u, 1043411944u, 4190072016u, 3215268661u, 2097129318u, 0, TANH_TOLERANCE, 0}, +{ 971, 1070967598u, 1798470077u, 3200116917u, 3421833729u, 1070915714u, 623414423u, 0, TANH_TOLERANCE, 0}, +{ 972, 3214486476u, 3653237931u, 3204255012u, 3683870669u, 3214486144u, 2924063688u, 0, TANH_TOLERANCE, 0}, +{ 973, 1069317222u, 376530104u, 1073853547u, 565755892u, 1069309555u, 442847759u, 0, TANH_TOLERANCE, 0}, +{ 974, 3226775211u, 558292492u, 1051772749u, 4267873474u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 975, 3221626981u, 509637100u, 3212030069u, 215050379u, 3220160354u, 521049736u, 0, TANH_TOLERANCE, 0}, +{ 976, 1078425613u, 3571665665u, 3188628584u, 757824767u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 977, 3220042217u, 998858159u, 1063077962u, 436029885u, 3219617538u, 1003022105u, 0, TANH_TOLERANCE, 0}, +{ 978, 3217481301u, 996300405u, 3193842624u, 80548098u, 3217465556u, 1091661181u, 0, TANH_TOLERANCE, 0}, +{ 979, 3222557384u, 3876129407u, 3215332180u, 2226970413u, 3220176734u, 59833828u, 0, TANH_TOLERANCE, 0}, +{ 980, 3225026041u, 200013509u, 3224552716u, 414878724u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 981, 3224325637u, 309319541u, 1048979765u, 1261662434u, 3220176895u, 4294966839u, 0, TANH_TOLERANCE, 0}, +{ 982, 1077718303u, 4062255924u, 3224274128u, 4289485681u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, +{ 983, 3224601748u, 1611969213u, 1053890378u, 3774617276u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 984, 1075169883u, 1752164782u, 3239587974u, 612223386u, 1072693170u, 909326654u, 0, TANH_TOLERANCE, 0}, +{ 985, 1065663030u, 2024044989u, 1074932678u, 3259111307u, 1065662984u, 399148943u, 0, TANH_TOLERANCE, 0}, +{ 986, 1068936158u, 2564965629u, 1093571065u, 169360454u, 1068932286u, 1946243873u, 0, TANH_TOLERANCE, 0}, +{ 987, 1077016178u, 1860101737u, 3191222372u, 1676437468u, 1072693247u, 4294967291u, 0, TANH_TOLERANCE, 0}, +{ 988, 1070288728u, 588387057u, 3192103292u, 2495288012u, 1070262055u, 2204208977u, 0, TANH_TOLERANCE, 0}, +{ 989, 3214127225u, 659070058u, 1073095700u, 1393632068u, 3214127066u, 672489002u, 0, TANH_TOLERANCE, 0}, +{ 990, 3220828991u, 4276187829u, 3217553330u, 1868253275u, 3220019394u, 2922613580u, 0, TANH_TOLERANCE, 0}, +{ 991, 3222171696u, 2085481575u, 3215994784u, 800910002u, 3220174817u, 4105080085u, 0, TANH_TOLERANCE, 0}, +{ 992, 1069517748u, 1950570756u, 3200582211u, 941022151u, 1069507347u, 2421477801u, 0, TANH_TOLERANCE, 0}, +{ 993, 1070113280u, 2075610870u, 3250142022u, 3605152103u, 1070093642u, 2347649094u, 0, TANH_TOLERANCE, 0}, +{ 994, 3216567890u, 3792931748u, 3204857863u, 804393211u, 3216562745u, 455243881u, 0, TANH_TOLERANCE, 0}, +{ 995, 3229529122u, 3430071177u, 3226288311u, 3652522729u, 3220176896u, 0u, 0, TANH_TOLERANCE, 0}, +{ 996, 3215994766u, 236884699u, 3227874605u, 2193269825u, 3215993354u, 3732743523u, 0, TANH_TOLERANCE, 0}, +{ 997, 1071228049u, 2744231849u, 1046186036u, 771053722u, 1071143543u, 2181158284u, 0, TANH_TOLERANCE, 0}, +{ 998, 1076656004u, 3000189819u, 1096500901u, 2057239777u, 1072693247u, 4294959487u, 0, TANH_TOLERANCE, 0}, +{ 999, 1078106941u, 205759408u, 3244643377u, 2702292618u, 1072693248u, 0u, 0, TANH_TOLERANCE, 0}, + + +// AUTOMATICALLY GENERATED VECTORS STOP + +}; + +#endif // CYGONCE_LIBM_TANH_H multiple inclusion protection + +// EOF tanh.h diff --git a/packages/language/c/libm/current/tests/vectors/vector_support.h b/packages/language/c/libm/current/tests/vectors/vector_support.h new file mode 100644 --- /dev/null +++ b/packages/language/c/libm/current/tests/vectors/vector_support.h @@ -0,0 +1,489 @@ +#ifndef CYGONCE_LIBM_VECTOR_SUPPORT_H +#define CYGONCE_LIBM_VECTOR_SUPPORT_H +//======================================================================== +// +// vector_support.h +// +// Support for testing of the math library using test vectors +// +//======================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Cygnus eCos Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://sourceware.cygnus.com/ecos +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Cygnus Operating System, released +// September 30, 1998. +// +// The Initial Developer of the Original Code is Cygnus. Portions created +// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//======================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour@cygnus.co.uk +// Contributors: jlarmour@cygnus.co.uk +// Date: 1998-02-13 +// Purpose: +// Description: +// Usage: #include "vectors/vector_support.h" +// +//####DESCRIPTIONEND#### +// +//======================================================================== + +// CONFIGURATION + +#include // Configuration header + +// Include the Math library? +#ifdef CYGPKG_LIBM + +// INCLUDES + +#include // Common type definitions and support +#include // Test infrastructure +#include // Header for this package +#include // Cyg_libm_ieee_double_shape_type + +#ifndef CYGSEM_LIBM_COMPAT_IEEE_ONLY +# include // For Cyg_ErrNo +#endif + +// CONSTANTS + +#define PROBLEM_THRESHOLD 10 // Number of test vectors allowed to fail + // before we give up completely + +// HOW TO START TESTS + +#ifndef CYGPKG_LIBM + +externC int main( int, char ** ); + +externC void +cyg_user_start( void ) +{ + (void) main(0, NULL); +} // cyg_user_start() + +# define START_TEST( test ) CYG_MACRO_START \ + CYG_ADDRESS _foo_ = (CYG_ADDRESS)&test; \ + CYG_UNUSED_PARAM( CYG_ADDRESS, _foo_ ); \ + CYG_MACRO_END + +#elif defined(CYGPKG_LIBC) + +# include + +externC void +cyg_package_start( void ) +{ + cyg_iso_c_start(); +} // cyg_package_start() + +# define START_TEST( test ) test(0) + +#elif defined(CYGFUN_KERNEL_API_C) + +# include + +# define STACKSIZE 32768 + +static cyg_uint8 stack[STACKSIZE]; +static cyg_handle_t thr_handle; +static cyg_thread thr; + +# define START_TEST( test ) CYG_MACRO_START \ + cyg_thread_create( 4, &test, (cyg_addrword_t)0, "test", \ + &stack[0], STACKSIZE, &thr_handle, &thr ); \ + cyg_thread_resume( thr_handle ); \ + cyg_scheduler_start(); \ + CYG_MACRO_END + +externC int main( int, char ** ); + +externC void +cyg_user_start( void ) +{ + (void) main(0, NULL); +} // cyg_user_start() + +#else + +externC int main( int, char ** ); + +externC void +cyg_user_start( void ) +{ + (void) main(0, NULL); +} // cyg_user_start() + +# define START_TEST( test ) CYG_MACRO_START \ + CYG_ADDRESS _foo_ = (CYG_ADDRESS)&test; \ + CYG_UNUSED_PARAM( CYG_ADDRESS, _foo_ ); \ + CYG_MACRO_END + +#endif + + +// TYPE DEFINITIONS + + +typedef enum { + CYG_LIBM_TEST_VEC_NONE, // this indicates whether the "double" + CYG_LIBM_TEST_VEC_INT, // is being used to store a double, an + CYG_LIBM_TEST_VEC_DOUBLE, // int, or its not being used at all! + CYG_LIBM_TEST_VEC_INT_P, // int pointer + CYG_LIBM_TEST_VEC_DOUBLE_P // double pointer +} Cyg_libm_test_arg_type; + + +// Define a type for a test vector record + +typedef struct { + cyg_ucount32 vector_num; // id number of this test vector record + + // if any of the following arguments are ints rather than doubles, then + // use the lsw part to store it + + cyg_uint32 arg1_msw; // first argument + cyg_uint32 arg1_lsw; + cyg_uint32 arg2_msw; // second argument + cyg_uint32 arg2_lsw; + cyg_uint32 result_msw; // expected return value + cyg_uint32 result_lsw; + +#ifndef CYGSEM_LIBM_COMPAT_IEEE_ONLY + Cyg_ErrNo errno_val; // expected value of errno. 0==unchanged +#else + cyg_uint32 errno_val; +#endif + + double tolerance; // relative amount that it is allowed + // to vary. i.e. the value should be + // plus or minus result*tolerance + + int matherr_type; // if testing the matherr() function, + // what type should the exception be +} Cyg_libm_test_double_vec_t; + + +// types to cope with the different forms of function to be called by the +// test vector + +typedef double (*ddfn)( double, double ); +typedef double (*difn)( double, int ); +typedef double (*dfn)( double ); +typedef double (*ddpfn)( double, double *); +typedef double (*dipfn)( double, int *); + + +// STATIC FUNCTIONS + +// equivalent of abs() for doubles. We want to be independent of fabs() + +static double +my_abs_d( double x ) +{ + Cyg_libm_ieee_double_shape_type t; + + t.value = x; + + t.number.sign = 0; + + return t.value; +} // my_abs_d() + + +static cyg_bool +checkErrorAcceptable( Cyg_libm_ieee_double_shape_type is, + Cyg_libm_ieee_double_shape_type shouldbe, + double tolerance) // _relative_ amount it can vary +{ + Cyg_libm_ieee_double_shape_type temp_doub; + + // first do a short-circuit check if its identical + if ( (is.parts.lsw == shouldbe.parts.lsw) && + (is.parts.msw == shouldbe.parts.msw) ) + return false; + + // now check special cases + + // +0 == -0 + if ( (is.parts.lsw == 0) && (shouldbe.parts.lsw == 0) && + ((is.parts.msw & 0x7fffffff) == 0) && + ((shouldbe.parts.msw & 0x7fffffff) == 0) ) + return false; + + // +-infinity == +-infinity + if ((is.parts.lsw == 0) && (shouldbe.parts.lsw == 0) && + (is.number.fraction0 == 0) && (shouldbe.number.fraction0 == 0) && + (is.number.exponent == 2047) && (shouldbe.number.exponent == 2047)) + { + return (is.number.sign != shouldbe.number.sign); + } // if + + // both NaN. Assumes isnan works, but its pretty safe + if ( isnan(is.value) && isnan(shouldbe.value) ) + return false; + else if (isnan(is.value) || isnan(shouldbe.value) ) + return true; + + // check same sign. Even around small values close to 0 we would want + // it to be on the right _side_ of 0 + if ( is.number.sign != shouldbe.number.sign ) + return true; + + // okay, now work out what tolerance means for us + + // find out what the difference is in the first place + temp_doub.value = my_abs_d( shouldbe.value - is.value ); + + // Check "both ways round" to deal with both under and overflow cases + if ( ((temp_doub.value / tolerance) < my_abs_d(shouldbe.value)) || + (temp_doub.value < (my_abs_d(shouldbe.value) * tolerance)) ) + return false; + else + return true; // so its not close enough + +} // checkErrorAcceptable() + + +// This allows us to run through any test vectors of form: +// double = fn(double, double) +// double = fn(double) +// double = fn(double, int) +// double = fn(double, int *) +// double = fn(double, double *) +// +// result type being non-double is left as a future enhancement +// +// This returns true if the tests all succeeded and false if any failed +// +static cyg_bool +doTestVec( CYG_ADDRESS func_ptr, + Cyg_libm_test_arg_type arg1_type, + Cyg_libm_test_arg_type arg2_type, + Cyg_libm_test_arg_type result_type, + const Cyg_libm_test_double_vec_t *vectors, + cyg_ucount32 num_vectors ) +{ + cyg_ucount32 problems=0; + cyg_ucount32 i; + Cyg_libm_ieee_double_shape_type arg1, arg2, result_wanted, ret; + + if ((arg1_type != CYG_LIBM_TEST_VEC_DOUBLE) || + (result_type != CYG_LIBM_TEST_VEC_DOUBLE) ) { + CYG_TEST_FAIL("Test vector arguments are not correct type!"); + return false; + } // if + + switch (arg2_type) { + case CYG_LIBM_TEST_VEC_DOUBLE: + + { + ddfn fn = (ddfn) func_ptr; + + for (i=0; + (i < num_vectors) && (problems < PROBLEM_THRESHOLD); + i++) { + arg1.parts.msw = vectors[i].arg1_msw; + arg1.parts.lsw = vectors[i].arg1_lsw; + + arg2.parts.msw = vectors[i].arg2_msw; + arg2.parts.lsw = vectors[i].arg2_lsw; + + result_wanted.parts.msw = vectors[i].result_msw; + result_wanted.parts.lsw = vectors[i].result_lsw; + + ret.value = (*fn)( arg1.value, arg2.value ); + + if ((vectors[i].errno_val) != 0) { + +#ifndef CYGSEM_LIBM_COMPAT_IEEE_ONLY + // In IEEE-mode we can't check the answer if this + // is an error case + + if ((cyg_libm_get_compat_mode() != + CYGNUM_LIBM_COMPAT_IEEE) && + (errno != vectors[i].errno_val)) { + + ++problems; + CYG_TEST_FAIL( "error not set correctly"); + + } // if +#endif + + continue; // no point checking value in an error case + } // if + if (checkErrorAcceptable( ret, result_wanted, + vectors[i].tolerance) ) { + ++problems; + CYG_TEST_FAIL( "Result out of tolerance"); + } // if + } // for + + } // compound + + break; + + case CYG_LIBM_TEST_VEC_INT: + + { + difn fn = (difn) func_ptr; + + for (i=0; + (i < num_vectors) && (problems < PROBLEM_THRESHOLD); + i++) { + arg1.parts.msw = vectors[i].arg1_msw; + arg1.parts.lsw = vectors[i].arg1_lsw; + + result_wanted.parts.msw = vectors[i].result_msw; + result_wanted.parts.lsw = vectors[i].result_lsw; + + ret.value = (*fn)( arg1.value, vectors[i].arg2_lsw ); + if (checkErrorAcceptable( ret, result_wanted, + vectors[i].tolerance) ) { + ++problems; + CYG_TEST_FAIL( "Result out of tolerance"); + } // if + } // for + + } // compound + + break; + + case CYG_LIBM_TEST_VEC_INT_P: + + { + dipfn fn = (dipfn) func_ptr; + int my_int; + Cyg_libm_ieee_double_shape_type my_doub1, my_doub2; + + for (i=0; + (i < num_vectors) && (problems < PROBLEM_THRESHOLD); + i++) { + arg1.parts.msw = vectors[i].arg1_msw; + arg1.parts.lsw = vectors[i].arg1_lsw; + + + result_wanted.parts.msw = vectors[i].result_msw; + result_wanted.parts.lsw = vectors[i].result_lsw; + + ret.value = (*fn)( arg1.value, &my_int ); + if (checkErrorAcceptable( ret, result_wanted, + vectors[i].tolerance) ) { + ++problems; + CYG_TEST_FAIL( "Result out of tolerance"); + } // if + + my_doub1.value = (double) my_int; + my_doub2.value = (double) (signed)vectors[i].arg2_lsw; + + if (checkErrorAcceptable( my_doub1, my_doub2, + vectors[i].tolerance) ) { + ++problems; + CYG_TEST_FAIL( "Integer result out of tolerance"); + } // if + + + } // for + + } // compound + + break; + + case CYG_LIBM_TEST_VEC_DOUBLE_P: + + { + ddpfn fn = (ddpfn) func_ptr; + Cyg_libm_ieee_double_shape_type my_doub1; + + for (i=0; + (i < num_vectors) && (problems < PROBLEM_THRESHOLD); + i++) { + arg1.parts.msw = vectors[i].arg1_msw; + arg1.parts.lsw = vectors[i].arg1_lsw; + + arg2.parts.msw = vectors[i].arg2_msw; + arg2.parts.lsw = vectors[i].arg2_lsw; + + + result_wanted.parts.msw = vectors[i].result_msw; + result_wanted.parts.lsw = vectors[i].result_lsw; + + ret.value = (*fn)( arg1.value, &my_doub1.value ); + if (checkErrorAcceptable( ret, result_wanted, + vectors[i].tolerance) ) { + ++problems; + CYG_TEST_FAIL( "Result out of tolerance"); + } // if + + if (checkErrorAcceptable( my_doub1, arg2, + vectors[i].tolerance) ) { + ++problems; + CYG_TEST_FAIL( "Returned double result out of " + "tolerance"); + } // if + + + } // for + + } // compound + + break; + + case CYG_LIBM_TEST_VEC_NONE: + + { + dfn fn = (dfn) func_ptr; + + for (i=0; + (i < num_vectors) && (problems < PROBLEM_THRESHOLD); + i++) { + arg1.parts.msw = vectors[i].arg1_msw; + arg1.parts.lsw = vectors[i].arg1_lsw; + + result_wanted.parts.msw = vectors[i].result_msw; + result_wanted.parts.lsw = vectors[i].result_lsw; + + ret.value = (*fn)( arg1.value ); + if (checkErrorAcceptable( ret, result_wanted, + vectors[i].tolerance) ) { + ++problems; + CYG_TEST_FAIL( "Result out of tolerance"); + } // if + } // for + + } // compound + + break; + + default: + CYG_TEST_FAIL("Second argument of unknown type!"); + return false; + } // switch + + if (problems != 0) + return false; + else + return true; + +} // doTestVec() + +#endif // ifdef CYGPKG_LIBM + +#endif // CYGONCE_LIBM_VECTOR_SUPPORT_H multiple inclusion protection + +// EOF vector_support.h diff --git a/packages/packages b/packages/packages new file mode 100644 --- /dev/null +++ b/packages/packages @@ -0,0 +1,242 @@ +#============================================================================= +# +# packages +# +# This file lists the available packages. +# +#============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================= +######DESCRIPTIONBEGIN#### +# +# Author(s): bartv +# Contributors: bartv +# Date: 1998-04-11 +# +# Purpose: To provide the interim build system with information +# about the various packages. +# +# Description: This file defines details of the available packages. +# HAL packages are not contained within this file. +# They are handled by the targets file instead. +# +# Usage: +# +#####DESCRIPTIONEND#### +#=============================================================================== +# + +# +# Format of this file: +# +# Each package is defined by a statement of the form: +# package +# +# The name of the package should correspond to the formal name of the package +# as per CDL, for example CYGPKG_KERNEL. Most of the time aliases will be +# uses instead. +# +# The body can contain the following commands: +# +# 1) alias one or more aliases for this target. The first alias will +# be used for output purposes. All aliases will be accepted +# as input, and the input matching is not case-sensitive. +# +# 2) directory the package's location within the component repository. +# +# 3) default_value whether or not this package should be enabled by default. +# Currently the main packages such as the kernel are enabled, +# but support packages such as the Common Device Code are +# enabled only if there is a device driver that uses them. +# +# 4) include_dir the location in the install tree where the header files +# should go. +# +# 5) hardware a flag indicating that this package is normally associated +# with specific hardware, and hence should only be enabled +# for appropriate hardware. + +package CYGPKG_HAL { + alias { "eCos common HAL" hal hal_common } + directory hal/common + default_value 1 + include_dir cyg/hal +} + +package CYGPKG_INFRA { + alias { Infrastructure infra } + directory infra + default_value 1 + include_dir cyg/infra +} + +package CYGPKG_KERNEL { + alias { "eCos kernel" kernel } + directory kernel + default_value 1 + include_dir cyg/kernel +} + +package CYGPKG_UITRON { + alias { "uITRON compatibility" uitron } + directory compat/uitron + default_value 1 + include_dir cyg/compat/uitron +} + +package CYGPKG_LIBC { + alias { "C Library" libc clib clibrary } + directory language/c/libc + default_value 1 +} + +package CYGPKG_LIBM { + alias { "Math Library" libm mathlib mathlibrary } + directory language/c/libm + default_value 1 +} + +package CYGPKG_ERROR { + alias { "Common error code support" error errors } + directory error + default_value 1 + include_dir cyg/error +} + +package CYGPKG_DEVICES { + alias { "Common Device Code" devices devices_common } + directory devs/common + default_value 1 + include_dir cyg/devs/common +} + +package CYGPKG_HAL_MN10300 { + alias { "MN10300 common HAL" hal_mn10300 mn10300_hal mn10300_arch_hal } + directory hal/mn10300/arch + include_dir cyg/hal + hardware +} + +package CYGPKG_HAL_MN10300_STDEVAL1 { + alias { "MN10300 stdeval1 support" hal_mn10300_stdeval1 mn10300_stdeval1_hal } + directory hal/mn10300/stdeval1 + include_dir cyg/hal + hardware +} + +package CYGPKG_HAL_MN10300_SIM { + alias { "MN10300 simulator support" hal_mn10300_sim mn10300_sim_hal } + directory hal/mn10300/sim + include_dir cyg/hal + hardware +} + +package CYGPKG_HAL_TX39 { + alias { "TX39 common HAL" hal_tx39 tx39_hal tx39_arch_hal } + directory hal/mips/arch/ + include_dir cyg/hal + hardware +} + +package CYGPKG_HAL_TX39_JMR3904 { + alias { "TX39 jmr3904 support" hal_tx39_jmr3904 tx39_jmr3904_hal } + directory hal/mips/jmr3904 + include_dir cyg/hal + hardware +} + +package CYGPKG_HAL_TX39_SIM { + alias { "TX39 simulator support" hal_tx39_sim tx39_sim_hal } + directory hal/mips/sim + include_dir cyg/hal + hardware +} + +package CYGPKG_HAL_POWERPC { + alias { "PowerPC common HAL" hal_powerpc powerpc_hal powerpc_arch_hal } + directory hal/powerpc/arch + include_dir cyg/hal + hardware +} + +package CYGPKG_HAL_POWERPC_COGENT { + alias { "PowerPC Cogent board support" hal_powerpc_cogent powerpc_cogent_hal } + directory hal/powerpc/cogent + include_dir cyg/hal + hardware +} + +package CYGPKG_HAL_POWERPC_SIM { + alias { "PowerPC simulator support" hal_powerpc_sim powerpc_sim_hal } + directory hal/powerpc/sim + include_dir cyg/hal + hardware +} + + +package CYGPKG_DEVICES_GDB { + alias { "GDB Pseudo Device" devices_gdb device_gdb } + directory devs/gdb + default_value 1 + include_dir cyg/devs/gdb + hardware +} + +package CYGPKG_DEVICES_SERIAL_RS232_COMMON { + alias { "Common Serial Device Code" devices_serial_rs232_common } + directory devs/serial/rs232/common + include_dir cyg/devs/serial/rs232/common + hardware +} + +package CYGPKG_DEVICES_WALLCLOCK { + alias { "Wallclock Device Code" wallclock devices_wallclock device_wallclock } + directory devs/wallclock + include_dir cyg/devs + hardware +} + +package CYGPKG_DEVICES_WATCHDOG { + alias { "Watchdog Device Code" watchdog devices_watchdog device_watchdog } + directory devs/watchdog + include_dir cyg/devs + hardware +} + +package CYGPKG_DEVICES_SERIAL_RS232_TX39 { + alias { "TX39 Serial Device Code" devices_serial_rs232_tx39 } + directory devs/serial/rs232/tx39 + include_dir cyg/devs/serial/rs232/tx39 + hardware +} + +package CYGPKG_DEVICES_SERIAL_RS232_MN10300 { + alias { "MN10300 Serial Device Code" devices_serial_rs232_mn10300 } + directory devs/serial/rs232/mn10300 + include_dir cyg/devs/serial/rs232/mn10300 + hardware +} + + + + diff --git a/packages/pkgconf.tcl b/packages/pkgconf.tcl new file mode 100644 --- /dev/null +++ b/packages/pkgconf.tcl @@ -0,0 +1,5751 @@ +# {{{ Banner + +#=============================================================================== +# +# pkgconf.tcl +# +# A temporary build system for target-side software. +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): bartv +# Contributors: bartv +# Date: 1998-04-10 +# Purpose: To generate a build tree (aka a configuration directory) +# and fill in basic configurability information. +# Description: +# Usage: +# +#####DESCRIPTIONEND#### +#=============================================================================== +# + +# }}} + +# {{{ Version check + +# ---------------------------------------------------------------------------- +# pkgconf.tcl requires at least version 8.0 of Tcl, since it makes use of +# namespaces. It is possible that some users still have older versions. + +if { [info tclversion] < 8.0 } { + puts "You are running Tcl version [info tclversion], patchlevel [info patchlevel]" + puts "The pkgconf.tcl script requires version 8.0 or later." + puts "Tcl is open source software and can be readily obtained via the internet." + puts "Good starting places for more information include www.tclconsortium.org" + puts "and www.scriptics.com" + exit 0 +} + +# }}} +# {{{ Namespace definition + +# ---------------------------------------------------------------------------- +# Namespaces. All code and variables in this script are kept in the namespace +# "pkgconf". This is not really necessary for stand-alone operation, but if it +# ever becomes desirable to embed this script in a larger application then +# using a namespace is a lot easier. +# +# As a fringe benefit, all global variables can be declared inside this +# namespace and initialised. +# + +namespace eval pkgconf { + + # Is this program running on a real operating system or under Windows ? + variable windows_host [expr {$tcl_platform(platform) == "windows"}] + + # Is this script running in command-line or GUI mode ? This is determined + # in large part by the command used to invoke the script. + variable gui_mode 0 + + # Keep track of whether or not GUI mode is possible at all. If + # TK is not loaded into the current interpreter then only + # command-line operation is possible. + variable gui_possible 0 + + # Where is the component repository ? The following input sources + # are available: + # 1) the command line argument --srcdir. This requires + # the arguments to be parsed early on. + # 2) the environment variable PKGCONF_COMPONENT_REPOSITORY. + # 3) $argv0 should correspond to the location of the pkgconf.tcl + # script. + # + variable component_repository "" + if { [info exists ::env(PKGCONF_COMPONENT_REPOSITORY)] } { + set component_repository $::env(PKGCONF_COMPONENT_REPOSITORY) + } else { + # Care has to be taken not to end up with a spurious /. at the end, + # since that would confuse later checks of component_repository != build_tree + set component_repository [pwd] + if { [file dirname $argv0] != "." } { + set component_repository [file join $component_repository [file dirname $argv0]] + } + } + + # Where is the build tree ? This can be specified using the command + # line argument --builddir, the environment variable PKGCONF_BUILD_TREE, + # or it defaults to the current directory (in accordance with the + # normal behaviour of configure scripts). + variable build_tree "" + if { [info exists ::env(PKGCONF_BUILD_TREE)] } { + set build_tree $::env(PKGCONF_BUILD_TREE) + } else { + set build_tree [pwd] + } + + # Details of the command line arguments, if any. + variable list_targets_arg 0; # --targets + variable list_packages_arg 0; # --packages + variable list_pkgdata_arg 0; # --pkgdata + variable list_flags_arg 0; # --flags + variable no_windows_arg 0; # --nw + variable target_arg ""; # --target=abc + variable platform_arg ""; # --platform=sim + variable startup_arg ""; # --platform=rom + variable prefix_arg ""; # --prefix=/tmp/install + variable disable_args ""; # --disable-uitron + # This is a list of all disabled packages. + variable enable_args ""; # --enable-uitron, as above. + array set version_args {}; # --kernel_version=v0.3 + # This is an array indexed by package name. + array set cflags_args {}; # DBGFLAGS="-Wall -Werror" + # This is an array indexed by flag name. + variable force_arg 0; # Forcibly overwrite configuration files. + variable defaults_arg 0; # Do not use the values from the save file. + variable use_links_arg 0; # Make use of symbolic links. + variable use_copies_arg 0; # The inverse. + + # Details of all known packages. These come out of the packages file. + # The variable known_packages is a simple list, and the rest of the + # data is held in an array package_data(). + variable known_packages "" + array set package_data {}; + + # Details of all known targets, as supplied by the targets file. + # The variable known_targets is a simple list, and the rest of the + # data is held in an array target_data. + variable known_targets "" + array set target_data {}; + + # Details of all the compiler flags that can be used within the + # build system. + variable known_compiler_flags { + ARCHFLAGS CARCHFLAGS CXXARCHFLAGS LDARCHFLAGS + ERRFLAGS CERRFLAGS CXXERRFLAGS LDERRFLAGS + LANGFLAGS CLANGFLAGS CXXLANGFLAGS LDLANGFLAGS + DBGFLAGS CDBGFLAGS CXXDBGFLAGS LDDBGFLAGS + EXTRAFLAGS CEXTRAFLAGS CXXEXTRAFLAGS LDEXTRAFLAGS + } + + # Details of the current configuration values. It is convenient + # to store these in an array as well. The array gets filled in by + # pkgconf::setup_defaults + array set config_data {}; + + # Contents of the current save file, if any. + array set saved_data {}; + + # These variables are used by the code that creates the build tree + variable inc_dirs; # For each package with exported header + # files, the path to those header files + # relative to either the component repository + # or the build tree. + variable tests_dirs; # Ditto for package tests directories. + variable src_dirs; # Ditto for src directories. + + variable install_inc_dirs; # Names of all the directories that should + # exist below install/include, including pkgconf. + variable install_inc_files; # Ditto for all the files, but excluding + # ones in pkgconf. + variable pkgconf_files; # Names of all the configuration headers + variable install_test_dirs; # What directories should be created in install/tests + + # What routines should be invoked for outputting fatal errors and + # for warning messages ? + variable fatal_error_handler pkgconf::cli_fatal_error + variable warning_handler pkgconf::cli_warning + variable report_handler pkgconf::cli_report +} + +# }}} +# {{{ Infrastructure + +# ---------------------------------------------------------------------------- +# Minimal infrastructure support. +# +# There must be some way of reporting fatal errors, of outputting warnings, +# and of generating report messages. The implementation of these things +# obviously depends on whether or not TK is present. In addition, if this +# script is being run inside a larger application then that larger +# application must be able to install its own versions of the routines. +# +# Once it is possible to report fatal errors, an assertion facility becomes +# feasible. +# + +# +# These routines output fatal errors, warnings or miscellaneous messages. +# Their implementations depend on the mode in which this script is operating. +# +proc pkgconf::fatal_error { msg } { + $pkgconf::fatal_error_handler "$msg" +} + +proc pkgconf::warning { msg } { + $pkgconf::warning_handler "$msg" +} + +proc pkgconf::report { msg } { + $pkgconf::report_handler "$msg" +} + +# +# Command line versions. +# NOTE: some formatting so that there are linebreaks at ~72 columns would be +# a good idea. +# +proc pkgconf::cli_fatal_error_handler { msg } { + puts "pkgconf fatal error: $msg" + exit 1 +} + +proc pkgconf::cli_warning_handler { msg } { + puts "pkgconf warning: $msg" +} + +proc pkgconf::cli_report_handler { msg } { + puts "$msg" +} + +# +# Determine the default destination for warnings and for fatal errors. +# In GUI mode message boxes should be used, otherwise the text should just +# go to stdout (stderr is more dubious). +# +# This routine gets invoked before any command line arguments have +# been processed, to set up a sensible default. It gets invoked again +# afterwards, since there may have been a change between GUI and CLI +# mode. +# +# After the first call to this function it is possible to use assertions. +# +proc pkgconf::initialise_error_handling { } { + + if { $pkgconf::gui_mode } { + set pkgconf::fatal_error_handler pkgconf::gui_fatal_error_handler + set pkgconf::warning_handler pkgconf::gui_warning_handler + set pkgconf::report_handler pkgconf::gui_report_handler + } else { + set pkgconf::fatal_error_handler pkgconf::cli_fatal_error_handler + set pkgconf::warning_handler pkgconf::cli_warning_handler + set pkgconf::report_handler pkgconf::cli_report_handler + } +} + +# +# These routines can be used by containing programs to provide their +# own error handling. +# +proc pkgconf::set_fatal_error_handler { fn } { + ASSERT { $fn != "" } + set pkgconf::fatal_error_handler $fn +} + +proc pkgconf::set_warning_handler { fn } { + ASSERT { $fn != "" } + set pkgconf::warning_handler $fn +} + +proc pkgconf::set_report_handler { fn } { + ASSERT { $fn != "" } + set pkgconf::report_handler $fn +} + +# +# A very simple assertion facility. It takes a single argument, an expression +# that should be evaluated in the calling function's scope, and on failure it +# should generate a fatal error. +# +proc pkgconf::ASSERT { condition } { + + set result [uplevel 1 [list expr $condition]] + + if { $result == 0 } { + fatal_error "Assertion failure.\nPredicate \"$condition\"\nThe failure occurred in \"[info level -1]\"" + } +} + +# }}} +# {{{ Utilities + +# ---------------------------------------------------------------------------- +# cdl_compare_version. This is a partial implementation of the full +# cdl_compare_version facility defined in the product specification. Its +# purpose is to order the various versions of a given package with +# the most recent version first. As a special case, "current" is +# always considered the most recent. +# +# There are similarities between cdl_compare_version and with Tcl's +# package vcompare, but cdl_compare_version is more general. +# + +proc pkgconf::cdl_compare_version { arg1 arg2 } { + + if { $arg1 == $arg2 } { + return 0 + } + if { $arg1 == "current"} { + return -1 + } + if { $arg2 == "current" } { + return 1 + } + + set index1 0 + set index2 0 + set ch1 "" + set ch2 "" + set num1 "" + set num2 "" + + while { 1} { + + set ch1 [string index $arg1 $index1] + set ch2 [string index $arg2 $index2] + set num1 "" + set num2 "" + + if { ($ch1 == "") && ($ch2 == "") } { + + # Both strings have terminated at the same time. There may have + # been some spurious leading zeroes in numbers. + return 0 + + } elseif { $ch1 == "" } { + + # The first string has ended first. If ch2 is a separator then + # arg2 is a derived version, e.g. v0.3.p1 and hence newer. Otherwise ch2 + # is an experimental version v0.3beta and hence older. + if { [string match \[-._\] $ch2] } { + return 1 + } else { + return -1 + } + } elseif { $ch2 == "" } { + + # Equivalent to the above. + if { [string match \[-._\] $ch1] } { + return -1 + } else { + return 1 + } + } + + # There is still data to be processed. + # Check for both strings containing numbers at the current index. + if { ( [string match \[0-9\] $ch1] ) && ( [string match \[0-9\] $ch2] ) } { + + # Extract the entire numbers from the version string. + while { [string match \[0-9\] $ch1] } { + set num1 "$num1$ch1" + incr index1 + set ch1 [string index $arg1 $index1] + } + while { [string match \[0-9\] $ch2] } { + set num2 "$num2$ch2" + incr index2 + set ch2 [string index $arg2 $index2] + } + + if { $num1 < $num2 } { + return 1 + } elseif { $num1 > $num2 } { + return -1 + } + continue + } + + # This is not numerical data. If the two characters are the same then + # move on. + if { $ch1 == $ch2 } { + incr index1 + incr index2 + continue + } + + # Next check if both strings are at a separator. All separators can be + # used interchangeably. + if { ( [string match \[-._\] $ch1] ) && ( [string match \[-._\] $ch2] ) } { + incr index1 + incr index2 + continue + } + + # There are differences in the characters and they are not interchangeable. + # Just return a standard string comparison. + return [string compare $ch1 $ch2] + } +} + +if { 0 } { + + puts "compare current v0.1 : [pkgconf::cdl_compare_version current v0.1]" + puts "compare v0.1 current : [pkgconf::cdl_compare_version v0.1 current]" + puts "compare current current : [pkgconf::cdl_compare_version current current]" + puts "compare v0.1 v0.1 : [pkgconf::cdl_compare_version v0.1 v0.1]" + puts "compare v0_1 v0.1 : [pkgconf::cdl_compare_version v0_1 v0.1]" + puts "compare v0.1 v0_1 : [pkgconf::cdl_compare_version v0.1 v0_1]" + puts "compare v0_1 v0-1 : [pkgconf::cdl_compare_version v0_1 v0-1]" + puts "compare v0-1 v0_1 : [pkgconf::cdl_compare_version v0-1 v0_1]" + puts "compare v0.2 v0.1 : [pkgconf::cdl_compare_version v0.2 v0.1]" + puts "compare v0.1 v0.2 : [pkgconf::cdl_compare_version v0.1 v0.2]" + puts "compare v0.10 v0.2 : [pkgconf::cdl_compare_version v0.10 v0.2]" + puts "compare v0.2 v0.10 : [pkgconf::cdl_compare_version v0.2 v0.10]" + puts "compare 980410 980412 : [pkgconf::cdl_compare_version 980410 980412]" + puts "compare 980412 980410 : [pkgconf::cdl_compare_version 980412 980410]" + puts "compare ss980410 ss980412 : [pkgconf::cdl_compare_version ss980410 ss980412]" + puts "compare ss980412 ss980410 : [pkgconf::cdl_compare_version ss980412 ss980410]" + puts "compare v0.1.2 v0.1.3 : [pkgconf::cdl_compare_version v0.1.2 v0.1.3]" + puts "compare v0.1.3 v0.1.2 : [pkgconf::cdl_compare_version v0.1.3 v0.1.2]" + puts "compare v1.0 v0.1.3 : [pkgconf::cdl_compare_version v1.0 v0.1.3]" + puts "compare v0.1.3 v1.0 : [pkgconf::cdl_compare_version v0.1.3 v1.0]" + puts "compare v1.0beta v1.0 : [pkgconf::cdl_compare_version v1.0beta v1.0]" + puts "compare v1.0 v1.0beta : [pkgconf::cdl_compare_version v1.0 v1.0beta]" + puts "compare v1.0.p1 v1.0 : [pkgconf::cdl_compare_version v1.0.p1 v1.0]" + puts "compare v1.0 v1.0.p1 : [pkgconf::cdl_compare_version v1.0 v1.0.p1]" +} + +# }}} +# {{{ Argument parsing + +# ---------------------------------------------------------------------------- +# Parsing the arguments. The following arguments should be accepted for +# backwards compatibility reasons. +# +# --target= +# --platform=sim +# --startup=rom or --startup=ram +# --prefix= +# --disable-uitron +# --disable-libc +# +# There was also a --disable-kernel_c_api, but that is no longer supported. +# For now disabling only applies to entire packages, not to components +# within a package. The argument --release=debug has also been disabled +# because it affects too many things (the makevars file, various #define's, +# etc.). +# +# Also it was possible to use --disable-uitron=yes, but that was +# undocumented and is not worth supporting. +# +# Configure allowed --srcdir=xxx, although it did not need it. It is useful +# to support this, and to add --builddir. --installdir as a prefix alias +# then makes sense. +# +# --help should be supported if present as a single argument. +# +# It is desirable to support additional arguments of the form: +# +# --enable-uitron (to undo a disable in the saved data) +# --kernel-version=current +# --uitron-version=v0.3 +# +# Similarly it is desirable to allow users to control compiler flags, e.g. +# DBGFLAGS="-Wall -Werror" +# +# A new argument is --nw, to disable the GUI environment. Other new +# arguments are: +# --targets and --packages to display the appropriate details +# --force to force files to be copied across from the repository +# --defaults to cause the program to ignore the values in the save file. +# --linkhdrs and --copyhdrs to control how header files should be handled. +# +# It is also a good idea to be a bit more flexible about the format +# of the command line arguments, for example -target=xxx should work, +# as should -target xxx +# +# The argv0 argument should be the name of this script. It can be used +# to get at the component repository location. If this script has been +# run incorrectly then currently it will fail: in future it may be +# desirable to check an environment variable instead. +# +# The argv argument is a string containing the rest of the arguments. +# If any of the arguments contain spaces then this argument will be +# surrounded by braces. If any of the arguments contain braces then +# things will break. +# + +proc pkgconf::parse_arguments { argv0 argv } { + + # First, check for --help or any of the variants. If this script + # is running in a larger program then it is assumed that the + # containing program will not pass --help as an argument. + if { ( $argv == "--help" ) || ( $argv == "-help" ) || + ( $argv == "--H" ) || ( $argv == "-H" ) } { + + argument_help + exit 0 + } + + if { $argv != "" } { + + # There are arguments. If any of the arguments contained + # spaces then these arguments will have been surrounded + # by braces, which is a nuisance. So start by turning the + # arguments into a numerically indexed array. + + set argc 0 + array set args { } + foreach arg $argv { + set args([incr argc]) $arg + } + + # Now examine each argument with regular expressions. It is + # useful to have some variables filled in by the regexp + # matching. + set dummy "" + set match1 "" + set match2 "" + for { set i 1 } { $i <= $argc } { incr i } { + + # Check for -nw. The regexp allows an optional -, followed by + # the text -nw, and nothing else. + if { [regexp -- {^-?-nw$} $args($i)] == 1 } { + set pkgconf::no_windows_arg 1 + continue + } + + # Check for --packages and the other simple ones. + if { [regexp -- {^-?-packages$} $args($i)] == 1 } { + set pkgconf::list_packages_arg 1 + continue + } + if { [regexp -- {^-?-pkgdata$} $args($i)] == 1 } { + set pkgconf::list_pkgdata_arg 1 + continue + } + if { [regexp -- {^-?-targets$} $args($i)] == 1 } { + set pkgconf::list_targets_arg 1 + continue + } + if { [regexp -- {^-?-flags$} $args($i)] == 1 } { + set pkgconf::list_flags_arg 1 + continue + } + if { [regexp -- {^-?-force$} $args($i)] == 1 } { + set pkgconf::force_arg 1 + continue + } + if { [regexp -- {^-?-defaults$} $args($i)] == 1 } { + set pkgconf::defaults_arg 1 + continue + } + if { [regexp -- {^-?-linkhdrs$} $args($i)] == 1 } { + set pkgconf::use_links_arg 1 + continue + } + if { [regexp -- {^-?-copyhdrs$} $args($i)] == 1 } { + set pkgconf::use_copies_arg 1 + continue + } + + # Now for the directories. srcdir and builddir will have + # been calculated already, but may be overridden here. + if { [regexp -- {^-?-src_?dir=?(.*)$} $args($i) dummy match1] == 1 } { + if { $match1 != "" } { + set pkgconf::component_repository $match1 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --srcdir" + } else { + set pkgconf::component_repository $args([incr i]) + } + } + continue + } + if { [regexp -- {^-?-build_?dir=?(.*)$} $args($i) dummy match1] == 1 } { + if { $match1 != "" } { + set pkgconf::build_tree $match1 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --builddir" + } else { + set pkgconf::build_tree $args([incr i]) + } + } + continue + } + + # And prefix, before moving on to the more interesting ones. + # Prefix is a pathname so spaces are legitimate, as are dots, + # directory separators, and drive indicators. + # + # NOTE: strictly speaking the pattern should be platform specific. + if { [regexp -- {^-?-prefix=?(.*)$} $args($i) dummy match1] == 1 } { + if { $match1 != "" } { + set pkgconf::prefix_arg $match1 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --prefix" + } else { + set pkgconf::prefix_arg $args([incr i]) + } + } + continue + } + + # --installdir is a useful alias for prefix. + if { [regexp -- {^-?-install_?dir=?(.*)$} $args($i) dummy match1] == 1 } { + if { $match1 != "" } { + set pkgconf::prefix_arg $match1 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --installdir" + } else { + set pkgconf::prefix_arg $args([incr i]) + } + } + continue + } + + + # Now check for a --target arg. The -target must match exactly, + # but there can be one leading hyphen that gets ignored. The + # target can be part of the same argument (with an = in between) + # or it can be all of the next argument. + # + # This code will match spuriously with --targetxxx, i.e. the + # = is optional. This is harmless. + # + # The target is not validated at this point, that happens after + # reading in the targets file. It is possible to specify + # several --target arguments, and only the last one takes + # effect. + if { [regexp -- {^-?-target=?([_a-zA-Z0-9]*)$} $args($i) dummy match1] == 1 } { + if { $match1 != "" } { + set pkgconf::target_arg $match1 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --target" + } else { + set pkgconf::target_arg $args([incr i]) + } + } + continue + } + + # Ditto for --platform. + if { [regexp -- {^-?-platform=?([_a-zA-Z0-9]*)$} $args($i) dummy match1] == 1 } { + if { $match1 != "" } { + set pkgconf::platform_arg $match1 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --platform" + } else { + set pkgconf::platform_arg $args([incr i]) + } + } + continue + } + + # And for --startup. + if { [regexp -- {^-?-startup=?([_a-zA-Z0-9]*)$} $args($i) dummy match1] == 1 } { + if { $match1 != "" } { + set pkgconf::startup_arg $match1 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --startup" + } else { + set pkgconf::startup_arg $args([incr i]) + } + } + continue + } + + # Now for --disable-. The disabled packages are stored + # in a simple list. + if { [regexp -- {^-?-disable-?=?([_a-zA-Z0-9]*)$} $args($i) dummy match1] == 1 } { + if { $match1 != "" } { + lappend pkgconf::disable_args $match1 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --disable" + } else { + lappend pkgconf::disable_args $args([incr i]) + } + } + continue + } + + # The same for --enable-. + if { [regexp -- {^-?-enable-?=?([_a-zA-Z0-9]*)$} $args($i) dummy match1] == 1 } { + if { $match1 != "" } { + lappend pkgconf::enable_args $match1 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --enable" + } else { + lappend pkgconf::enable_args $args([incr i]) + } + } + continue + } + + # And for ---version=xxx + # These versions are stored in an array indexed by the + # package string. + if {[regexp -- {^-?-([_a-zA-Z0-9]+)-?version=?([_\.a-zA-Z0-9]*)$} $args($i) dummy match1 match2] == 1} { + if { $match2 != "" } { + set pkgconf::version_args($match1) $match2 + } else { + if { $i == $argc } { + fatal_error "pkgconf: missing argument after --$match1-version" + } else { + set pkgconf::version_args($match1) $args([incr i]) + } + } + continue + } + + # For each of the known compiler flags, check for a definition of + # this flag. The flags are stored in an array cflags_args(). + # Note that an empty string is legal, so that the default flags + # from the targets file can be disabled. + set its_a_flag 0 + foreach flag $pkgconf::known_compiler_flags { + if { [regexp -- "^[set flag]=(.*)\$" $args($i) dummy match1] == 1 } { + set pkgconf::cflags_args($flag) $match1 + set its_a_flag 1 + break + } + } + if { $its_a_flag != 0 } { + continue + } + + # An unrecognised argument. + fatal_error "pkgconf: invalid argument $args($i)" + } + } + + # Under Windows it is desirable to do some checking on any directories that + # have been provided. Some cygwin pathnames that a user might supply are + # not acceptable to Tcl. + if { $pkgconf::windows_host } { + set pkgconf::component_repository [get_pathname_for_tcl $pkgconf::component_repository] + set pkgconf::build_tree [get_pathname_for_tcl $pkgconf::build_tree] + if { $pkgconf::prefix_arg != "" } { + set pkgconf::prefix_arg [get_pathname_for_tcl $pkgconf::prefix_arg] + } + } + + # Enabling this facilitates testing of the parsing code. + if { 0 } { + puts "component repository is $pkgconf::component_repository" + puts "build tree is $pkgconf::build_tree" + puts "prefix_arg is $pkgconf::prefix_arg" + puts "list_targets_arg is $pkgconf::list_targets_arg" + puts "list_packages_arg is $pkgconf::list_packages_arg" + puts "list_pkgdata_arg is $pkgconf::list_pkgdata_arg" + puts "list_flags_arg is $pkgconf::list_flags_arg" + puts "no_windows_arg is $pkgconf::no_windows_arg" + puts "target_arg is $pkgconf::target_arg" + puts "platform_arg is $pkgconf::platform_arg" + puts "startup_arg is $pkgconf::startup_arg" + puts "disable_args is $pkgconf::disable_args" + puts "enable_args is $pkgconf::enable_args" + puts "force_arg is $pkgconf::force_arg" + puts "defaults_arg is $pkgconf::defaults_arg" + puts "use_links_arg is $pkgconf::use_links_arg" + puts "use_copies_arg is $pkgconf::use_copies_arg" + foreach i [array names pkgconf::version_args] { + puts "Package $i needs version $pkgconf::version_args($i)" + } + foreach flag [array names pkgconf::cflags_args] { + puts "Compiler flag $flag has value $pkgconf::cflags_args($flag)" + } + exit 0 + } + +} + +# +# Display help information if the user has typed --help, -H, --H, or -help. +# The help text uses two hyphens for consistency with configure. +# Arguably this should change. +# +# Not all legal command line arguments are listed. Some of the command +# line arguments like --flags are intended for internal use only. +# +# NOTE: if this command is being invoked from a shell script that sets +# the defaults for a particular architecture then the information will not +# be completely accurate. There is no easy solution for this problem. +# +# NOTE: it would be a really good idea to give an example command line. +# Unfortunately this command line must include a target architecture, +# and there is no sensible default for that. +# +proc pkgconf::argument_help { } { + + puts "Usage: pkgconf \[options\]" + puts "Available options are:" + puts " --help : display this text." + puts " --packages : list all packages." + puts " --targets : list all possible targets." + puts " --target= : target the specified architecture." + puts " --platform=sim : target the simulator rather than hardware." + puts " --startup=rom : generate code suitable for ROMming." + puts " --disable- : disable a given package." + puts " --enable- : enable a given package." + puts " ---version=v0.3 : use a specific version of a package." + puts " --defaults : use default settings instead of the save file." + puts " --srcdir= : specify location of the component repository." + puts " --builddir= : specify location of the build directory." + puts " --prefix= : specify location of the install directory." +} + +# }}} +# {{{ Packages file + +# ---------------------------------------------------------------------------- +# The component repository should contain a file "packages" containing details +# of all supported packages. This file is actually an executable Tcl script +# containing instances of the "package" command, which takes three arguments. +# It is necessary to update the variables pkgconf::known_packages and +# pkgconf::package_data. +# + +proc pkgconf::read_packages { } { + + ASSERT { $pkgconf::component_repository != "" } + ASSERT { [array names pkgconf::package_data] == "" } + ASSERT { $pkgconf::known_packages == "" } + + # A safe interpreter is used to process the packages file. + # This is somewhat overcautious, but it is also harmless. + # The following two commands are made accessible to the slave + # interpreter and are responsible for updating the actual data. + proc set_package_data { name value } { + set pkgconf::package_data($name) $value + } + proc add_known_package { name } { + lappend pkgconf::known_packages $name + } + + # Create the parser, add the aliased commands, and then define + # the routines that do the real work. + set parser [interp create -safe] + $parser alias set_package_data pkgconf::set_package_data + $parser alias add_known_package pkgconf::add_known_package + + $parser eval { + + set current_package "" + + proc package { name body } { + + add_known_package $name + set_package_data "$name,alias" $name + set_package_data "$name,dir" "" + set_package_data "$name,versions" "" + set_package_data "$name,default" 0 + set_package_data "$name,incdir" "" + set_package_data "$name,hardware" 0 + + # Evaluate the body such that the commands know what the current package is. + set ::current_package $name + eval $body + set ::current_package "" + } + + proc alias { str } { + set_package_data "$::current_package,alias" $str + } + + # The remaining commands are basically clones of alias. + proc directory { dir } { + set_package_data "$::current_package,dir" $dir + } + + proc default_value { val } { + set_package_data "$::current_package,default" $val + } + + proc include_dir { dir } { + set_package_data "$::current_package,incdir" $dir + } + + proc hardware { } { + set_package_data "$::current_package,hardware" 1 + } + } + + # The parser is ready to evaluate the script. To avoid having to give the + # safe interpreter file I/O capabilities, the file is actually read in + # here and then evaluated. + set filename [file join $pkgconf::component_repository "packages"] + set status [ catch { + set fd [open $filename r] + set script [read $fd] + close $fd + $parser eval $script + } message] + + if { $status != 0 } { + pkgconf::fatal_error "Unexpected error while processing $filename\n$message" + } + + # The interpreter and the aliased commands are no longer required. + rename set_package_data {} + rename add_known_package {} + interp delete $parser + + # At this stage the packages file has been read in. It is a good idea to + # check that all of these packages are present and correct, and incidentally + # figure out which versions are present. + foreach pkg $pkgconf::known_packages { + + set pkgdir [file join $pkgconf::component_repository $pkgconf::package_data($pkg,dir)] + if { ![file exists $pkgdir] || ![file isdir $pkgdir] } { + fatal_error \ +"The file [file join $pkgconf::component_repository "packages"] lists a package\ +$pkg which should be present in $pkgdir. This package is missing." + } + + # Each subdirectory should correspond to a release. A utility routine + # is available for this. + set pkgconf::package_data($pkg,versions) [locate_subdirs $pkgdir] + if { $pkgconf::package_data($pkg,versions) == "" } { + fatal_error "The package $pkg does not contain any version directories." + } + + # Sort all the versions using a version-aware comparison version + set pkgconf::package_data($pkg,versions) [ + lsort -command pkgconf::cdl_compare_version $pkgconf::package_data($pkg,versions) + ] + } + + # Handle the --packages argument. + if { $pkgconf::list_packages_arg != 0 } { + + # The user wants to know about all the arguments. Just to be fancy + # this code does some alignment. + set name_maxlen 0 + + foreach pkg $pkgconf::known_packages { + if { [string length $pkg] > $name_maxlen} { + set name_maxlen [string length $pkg] + } + } + + puts "Known packages are:" + foreach pkg $pkgconf::known_packages { + puts "[format " %-*s : " $name_maxlen $pkg]" + puts " Available versions: $pkgconf::package_data($pkg,versions)" + puts " Aliases : $pkgconf::package_data($pkg,alias)" + if { $pkgconf::package_data($pkg,hardware) } { + puts " This package is only available on specific hardware." + } + if { $pkgconf::package_data($pkg,default) } { + puts " This package is enabled by default." + } else { + puts " This package is disabled by default." + } + } + } + + # Ditto for the --pkgdata argument. In this case the data is intended for use + # by other programs, and is not necessarily intelligible to users. + if { $pkgconf::list_pkgdata_arg != 0 } { + foreach pkg $pkgconf::known_packages { + set dir [file join $pkgconf::package_data($pkg,dir) [lindex $pkgconf::package_data($pkg,versions) 0]] + set dir [file nativename $dir] + if { $pkgconf::windows_host != 0 } { + regsub -all {\\} $dir {\\\\} dir + } + set alias [get_build_alias $pkg] + puts "\"$pkg\" \"$alias\" \"$dir\"" + } + } +} + +# +# Given a package name as supplied by the user, return the internal package name. +# This involves searching through the list of aliases. +# +proc pkgconf::find_package { name } { + + foreach pkg $pkgconf::known_packages { + + if { [string toupper $pkg] == [string toupper $name] } { + return $pkg + } + + foreach alias $pkgconf::package_data($pkg,alias) { + if { [string toupper $alias] == [string toupper $name] } { + return $pkg + } + } + } + + return "" +} + +# +# Given a package name, return the first alias string. This is useful for +# output code. +# +proc pkgconf::get_package_alias { name } { + + pkgconf::ASSERT { [lsearch -exact $pkgconf::known_packages $name] != -1 } + set alias [lindex $pkgconf::package_data($name,alias) 0] + return $alias +} + +# +# Does a given package actually exist ? This copes with aliases +# as well. +proc pkgconf::is_package { name } { + + ASSERT { $name != "" } + + set result 0 + set name [find_package $name] + if { $name != "" } { + set result 1 + } + return $result +} + +# +# Is a particular package a hardware-specific package ? This code +# deals with aliases as well +proc pkgconf::is_hardware_package { name } { + + ASSERT { $name != "" } + + set name [find_package $name] + ASSERT { $name != "" } + + set result 0 + if { $pkgconf::package_data($name,hardware) != 0 } { + set result 1 + } + return $result +} + +# +# Is a particular version string valid for the given package ? +proc pkgconf::is_valid_version { pkg version } { + + ASSERT { $pkg != "" } + ASSERT { $version != "" } + + set pkg [find_package $pkg] + ASSERT { $pkg != "" } + + set result 0 + set index [lsearch -exact $pkgconf::package_data($pkg,versions) $version] + if { $index != -1 } { + set result 1 + } + return $result +} + +# }}} +# {{{ Targets file + +# ---------------------------------------------------------------------------- +# The handling of the targets file is similar to that for the packages file, +# but a targets file is a bit more complicated. +# + +proc pkgconf::read_targets { } { + + ASSERT { $pkgconf::component_repository != "" } + ASSERT { [array names pkgconf::target_data] == "" } + ASSERT { $pkgconf::known_targets == "" } + ASSERT { $pkgconf::known_compiler_flags != "" } + + proc add_known_target { name } { + + lappend pkgconf::known_targets $name + set pkgconf::target_data($name,alias) $name + set pkgconf::target_data($name,prefix) "" + set pkgconf::target_data($name,known_platforms) "" + set pkgconf::target_data($name,packages) "" + } + proc add_known_platform { arch name } { + lappend pkgconf::target_data($arch,known_platforms) $name + set pkgconf::target_data($arch,$name,alias) "" + set pkgconf::target_data($arch,$name,startup) "" + set pkgconf::target_data($arch,$name,packages) "" + } + proc set_target_data { name value } { + set pkgconf::target_data($name) $value + } + + set parser [interp create -safe] + interp share {} stdout $parser + $parser alias set_target_data pkgconf::set_target_data + $parser alias add_known_target pkgconf::add_known_target + $parser alias add_known_platform pkgconf::add_known_platform + $parser eval [list set known_compiler_flags $pkgconf::known_compiler_flags] + + $parser eval { + + set current_target "" + set current_platform "" + + proc target { name body } { + + add_known_target $name + + # Evaluate the body such that the commands know what the current target is. + set ::current_target $name + eval $body + set ::current_target "" + } + + proc alias { str } { + + # If processing a platform body, update the platform data. Otherwise update the + # target data. There should be only one alias command per body. + if { $::current_platform != "" } { + set_target_data "$::current_target,$::current_platform,alias" $str + } else { + set_target_data "$::current_target,alias" $str + } + } + + proc command_prefix { str } { + set_target_data "$::current_target,prefix" $str + } + + proc packages { list } { + if { $::current_platform != "" } { + set_target_data "$::current_target,$::current_platform,packages" $list + } else { + set_target_data "$::current_target,packages" $list + } + } + + proc hal { dir } { + if { $::current_platform != "" } { + set_target_data "$::current_target,$::current_platform,haldir" $dir + } else { + set_target_data "$::current_target,haldir" $dir + } + } + + proc platform { name body } { + + add_known_platform $::current_target $name + + set ::current_platform $name + eval $body + set ::current_platform "" + } + + proc startup { types } { + set_target_data "$::current_target,$::current_platform,startup" $types + } + + # The cflags command is much more complicated than the others. The argument + # to cflags should be a list of paired data, e.g. ERRFLAGS -Wall. + # The first entry in each pair should be one of the known compiler + # flags, the second one should be its value. + proc cflags { str } { + + set arg_count [llength $str] + if { ($arg_count % 2) != 0 } { + error "Invalid argument list to cflags command in $current_target" + } + for { set i 0 } { $i < $arg_count } { incr i 2 } { + set flag [lindex $str $i] + set value [lindex $str [expr $i + 1]] + if { [lsearch -exact $::known_compiler_flags $flag] == -1 } { + error "Invalid compiler flag $flag for target $::current_target" + } + if { $::current_platform != "" } { + set_target_data "$::current_target,$::current_platform,cflags,$flag" $value + } else { + set_target_data "$::current_target,cflags,$flag" $value + } + } + } + + } + + # The parser is ready to evaluate the script. To avoid having to give the + # safe interpreter file I/O capabilities, the file is actually read in + # here and then evaluated. + set filename [file join $pkgconf::component_repository "targets"] + set status [ catch { + set fd [open $filename r] + set script [read $fd] + close $fd + $parser eval $script + } message] + + if { $status != 0 } { + puts "Unexpected error while processing $filename\n$message" + exit 1 + } + + # The interpreter and the aliased commands are no longer required. + rename add_known_target {} + rename add_known_platform {} + rename set_target_data {} + interp delete $parser + + # The targets file has been read in, so it is time for some consistency checks. + foreach target $pkgconf::known_targets { + + # If this target involves some special packages, check that these + # packages were actually defined in the packages file. Also check + # that these packages are listed as hardware packages so that + # they will not be enabled by default. + ASSERT { [info exists pkgconf::target_data($target,packages)] } + foreach pkg $pkgconf::target_data($target,packages) { + + if { [is_package $pkg] == 0 } { + fatal_error \ +"The targets file $filename lists a package $pkg\ +for the $target architecture. This package is not listed\ +in the packages file." + + } elseif { [is_hardware_package $pkg] == 0 } { + + fatal_error \ +"The targets file $filename lists a package $pkg\ +for the $target architecture. According to the packages\ +file this package is not hardware-specific." + } + } + + ASSERT { [info exists pkgconf::target_data($target,known_platforms)] } + foreach platform $pkgconf::target_data($target,known_platforms) { + + ASSERT { [info exists pkgconf::target_data($target,$platform,packages)] } + foreach pkg $pkgconf::target_data($target,packages) { + + if { [is_package $pkg] == 0 } { + + fatal_error \ +"The target file $filename lists a package $pkg\ +for the $target architecture and the $platform platform.\ +This package is not listed in the packages file." + + } elseif { [is_hardware_package $pkg] == 0 } { + + fatal_error \ +"The target file $filename lists a package $pkg\ +for the $target architecture and the $platform platform.\ +According to the packages file this package is not hardware-specific." + } + } + } + + # Also check that all required data for all targets and platforms has + # been supplied. A command prefix is required, as is a startup list. + + if { [llength $pkgconf::target_data($target,known_platforms)] == 0 } { + warning "The targets file $filename lists the $target architecture but no platforms." + set index [lsearch -exact $pkgconf::known_targets $target] + ASSERT { $index != -1 } + set pkgconf::known_targets [lreplace $pkgconf::known_targets $index $index] + continue + } + + if { $pkgconf::target_data($target,prefix) == "" } { + fatal_error "The targets file $filename does not list a command prefix for the $target architecture." + } + + foreach platform $pkgconf::target_data($target,known_platforms) { + if { [llength $pkgconf::target_data($target,$platform,startup)] == 0 } { + fatal_error \ +"The targets file $filename does not list any startup options for target $target, platform $platform." + } + } + } + + # At this stage there may be no targets left over. + if { [llength $pkgconf::known_targets] == 0 } { + fatal_error "The targets file $filename does not list any usable targets." + } + + # All the directories exist. Did the user ask for a list of all targets ? + if { $pkgconf::list_targets_arg } { + + # The user wants to know about all the targets. Just to be fancy + # this code does some alignment. + set name_maxlen 0 + + foreach target $pkgconf::known_targets { + if { [string length $target] > $name_maxlen} { + set name_maxlen [string length $target] + } + } + + puts "Known targets:" + foreach target $pkgconf::known_targets { + + puts "[format " %-*s : aliases $pkgconf::target_data($target,alias)" $name_maxlen $target]" + + set packages $pkgconf::target_data($target,packages) + if { [llength $packages] > 0 } { + puts " Required packages" + foreach package $packages { + puts " [pkgconf::get_package_alias $package] ($package)" + } + } + + foreach platform $pkgconf::target_data($target,known_platforms) { + puts " Platform $platform, supported startups $pkgconf::target_data($target,$platform,startup)" + set packages $pkgconf::target_data($target,$platform,packages) + if { [llength $packages] > 0 } { + puts " Required packages" + foreach package $packages { + puts " [pkgconf::get_package_alias $package] ($package)" + } + } + } + } + } +} + +# +# Given a target name as supplied by the user, return the internal target name. +# This involves searching through the list of aliases. +# +proc pkgconf::find_target { name } { + + foreach target $pkgconf::known_targets { + + if { [string toupper $target] == [string toupper $name] } { + return $target + } + + foreach alias $pkgconf::target_data($target,alias) { + if { [string toupper $alias] == [string toupper $name] } { + return $target + } + } + } + + return "" +} + +# +# Ditto but for a given platform name. The target name must be known already. +# + +proc pkgconf::find_platform { target name } { + + pkgconf::ASSERT { [lsearch -exact $pkgconf::known_targets $target] != -1 } + + foreach platform $pkgconf::target_data($target,known_platforms) { + + if { [string toupper $platform] == [string toupper $name] } { + return $platform + } + + foreach alias $pkgconf::target_data($target,$platform,alias) { + + if { [string toupper $alias] == [string toupper $name] } { + return $platform + } + } + } + return "" +} + +# +# Given a target name, return the first alias. This is useful for output +# code. +# +proc pkgconf::get_target_alias { name } { + + pkgconf::ASSERT { [lsearch -exact $pkgconf::known_targets $name] != -1 } + + set alias [lindex $pkgconf::target_data($name,alias) 0] + return $alias +} + +# +# Ditto for platforms. +# +proc pkgconf::get_platform_alias { target name } { + + pkgconf::ASSERT { [lsearch -exact $pkgconf::known_targets $target] != -1 } + pkgconf::ASSERT { [lsearch -exact $pkgconf::target_data($target,known_platforms) $name] != -1 } + + set alias [lindex $pkgconf::target_data($target,$name,alias) 0] + return $alias +} + +# +# For a given target and platform, return an appropriate set of compiler flags. +# +proc pkgconf::get_platform_cflags { target platform flag } { + + ASSERT { [lsearch -exact $pkgconf::known_targets $target] != -1 } + ASSERT { [lsearch -exact $pkgconf::target_data($target,known_platforms) $platform] != -1 } + ASSERT { [lsearch -exact $pkgconf::known_compiler_flags $flag] != -1 } + + # A particular flag may be defined specifically for a platform. + # Or it may come from the target information. Or there may not be + # a default value. + if { [info exists pkgconf::target_data($target,$platform,cflags,$flag)] != 0 } { + return $pkgconf::target_data($target,$platform,cflags,$flag) + } elseif { [info exists pkgconf::target_data($target,cflags,$flag)] != 0 } { + return $pkgconf::target_data($target,cflags,$flag) + } else { + return "" + } +} + +# +# Is a given target or platform actually valid ? This code copes +# with aliases as well. +proc pkgconf::is_target { name } { + + ASSERT { $name != "" } + + set name [find_target $name] + set result 0 + if { $name != "" } { + set result 1 + } + return $result +} + +proc pkgconf::is_platform { target name } { + + ASSERT { $target != "" } + ASSERT { $name != "" } + + set target [find_target $target] + ASSERT { $target != "" } + + set name [find_platform $target $name] + set result 0 + if { $name != "" } { + set result 1 + } + return $result +} + +proc pkgconf::is_startup { target platform name } { + + ASSERT { $target != "" } + ASSERT { $name != "" } + + set target [find_target $target] + ASSERT { $target != "" } + + set platform [find_platform $target $platform] + ASSERT { $platform != "" } + + set index [lsearch -exact $pkgconf::target_data($target,$platform,startup) $name] + set result 0 + if { $index != -1 } { + set result 1 + } + return $result +} + +# +# Get hold of the default platform and startup for a given target. + +proc pkgconf::get_default_platform { target } { + + ASSERT { $target != "" } + + set target [find_target $target] + ASSERT { $target != "" } + + set platform [lindex $pkgconf::target_data($target,known_platforms) 0] + return $platform +} + +proc pkgconf::get_default_startup { target platform } { + + ASSERT { $target != "" } + ASSERT { $platform != "" } + + set target [find_target $target] + ASSERT { $target != "" } + set platform [find_platform $target $platform] + ASSERT { $platform != "" } + + set startup [lindex $pkgconf::target_data($target,$platform,startup) 0] + return $startup +} + +# }}} +# {{{ Configuration Data + +# {{{ setup_defaults + +# ---------------------------------------------------------------------------- +# The setup_defaults routine is responsible for deciding on default values. +# If there is only one supported architecture then this can be selected, +# and then it is also possible to select a platform and a startup mode. +# All known packages can be enabled by default, and the latest version +# of each package can be selected. +# +# All configuration data is held in the array config_data(). It is +# important to make sure that all fields are initialised. +# + +proc pkgconf::setup_defaults { } { + + ASSERT { [llength [array names pkgconf::config_data] ] == 0 } + ASSERT { $pkgconf::known_packages != "" } + ASSERT { $pkgconf::known_targets != "" } + ASSERT { $pkgconf::build_tree != "" } + + set pkgconf::config_data(target) "" + set pkgconf::config_data(platform) "" + set pkgconf::config_data(startup) "" + set pkgconf::config_data(prefix) "" + set pkgconf::config_data(use_links) 0 + + # Packages fall into a number of different categories. + # + # 1) some packages are hardware-specific. They should be enabled + # by default if that hardware has been selected, but the user + # must still be able to disable them in case they cause problems. + # + # 2) some packages are enabled by default, but can be disabled by + # the user. There are actually some packages that should never + # be disabled, especially infra, but that would complicate things. + # + # 3) some packages are disabled by default, but can be enabled by + # the user. + # + # The easiest way to track this information is to store the target + # and platform data, which gives us the hardware packages, plus + # separate lists of which packages are explicitly enabled or disabled. + # All other information can be derived from that. + set pkgconf::config_data(enabled_packages) "" + set pkgconf::config_data(disabled_packages) "" + + # For each package fill in a default version number. + foreach pkg $pkgconf::known_packages { + + ASSERT { $pkgconf::package_data($pkg,versions) != "" } + ASSERT { [info exists pkgconf::config_data($pkg,version)] == 0 } + set pkgconf::config_data($pkg,version) [lindex $pkgconf::package_data($pkg,versions) 0] + } + + # If there is only one target architecture, default to it. Also + # default to the first platform for that target and the first + # startup for that platform. + if { [llength $pkgconf::known_targets] == 1 } { + set pkgconf::config_data(target) [lindex $pkgconf::known_targets 0] + + ASSERT { $pkgconf::target_data($pkgconf::config_data(target),known_platforms) != "" } + set pkgconf::config_data(platform) [get_default_platform $pkgconf::config_data(target)] + + ASSERT { $pkgconf::target_data($pkgconf::config_data(target),$pkgconf::config_data(platform),startup) != "" } + set pkgconf::config_data(startup) [get_default_startup $pkgconf::config_data(target) $pkgconf::config_data(platform)] + } + + if { [info exists ::env(PKGCONF_USE_LINKS)] } { + set pkgconf::config_data(use_links) 1 + } + + if { 0 } { + foreach i [array names pkgconf::config_data] { + puts "pkgconf::config_data($i) : $pkgconf::config_data($i)" + } + exit 0 + } +} + +# }}} +# {{{ read_save_file + +# ---------------------------------------------------------------------------- +# The build tree may have a save file. The aim here is that +# if the user wants to change some aspects of the configuration, e.g. to +# switch between the eval board and the simulator, it should not be +# necessary to pass all the command line arguments again. Instead the +# system should work out past settings and re-use those where possible. +# +# This routine should be invoked after the defaults are set up but +# before the command line arguments take effect. +# +# There is a command line argument --defaults which stops the saved +# values from taking effect. The save file is still read in because +# it is useful to know what is in the build tree at the moment. +# + +proc pkgconf::read_save_file { } { + + ASSERT { $pkgconf::build_tree != "" } + + # Get rid of any old settings that might be hanging around. + foreach i [array names pkgconf::saved_data] { + unset pkgconf::saved_data($i) + } + + set filename [file join $pkgconf::build_tree "pkgconf.sav"] + if { [file exists $filename] && [file isfile $filename] } { + + # Read in the saved data. A safe interpreter is used, just in case. + proc set_saved_data { name value } { + set pkgconf::saved_data($name) $value + } + set parser [interp create -safe] + $parser alias set_saved_data pkgconf::set_saved_data + + set status [ catch { + set fd [open $filename r] + set script [read $fd] + close $fd + $parser eval $script + } message] + if { $status != 0 } { + pkgconf::fatal_error "Unexpected error while reading back save file $filename\n$message" + } + + rename set_saved_data {} + interp delete $parser + } + + # It is a good idea to check that the data read back is consistent. + # It is also a good idea to check some aliases, in case something + # has been renamed between releases. + if { [info exists pkgconf::saved_data(target)] } { + + set target_name [find_target $pkgconf::saved_data(target)] + if { $target_name == "" } { + warning "The save file $filename contained an invalid target $pkgconf::saved_data(target). This has been ignored." + } else { + set pkgconf::saved_data(target) $target_name + set pkgconf::config_data(target) $target_name + set pkgconf::config_data(platform) [get_default_platform $pkgconf::config_data(target)] + set pkgconf::config_data(startup) \ + [get_default_startup $pkgconf::config_data(target) $pkgconf::config_data(platform)] + } + } + + # There is no point in validating platform or startup unless the target is known. + if { $pkgconf::config_data(target) != "" } { + + ASSERT { $pkgconf::target_data($pkgconf::config_data(target),known_platforms) != "" } + + if { [info exists pkgconf::saved_data(platform)] } { + + set platform_name [find_platform $pkgconf::config_data(target) $pkgconf::saved_data(platform)] + if { $platform_name == "" } { + warning \ +"The save file $filename specified an unknown platform $pkgconf::saved_data(platform).\ +The platform $pkgconf::config_data(platform) has been substituted." + } else { + set pkgconf::saved_data(platform) $platform_name + set pkgconf::config_data(platform) $platform_name + set pkgconf::config_data(startup) [get_default_startup $pkgconf::config_data(target) $platform_name] + } + + } + + # Currently if there is a target then there is always a platform, + # possibly the default one. + ASSERT { $pkgconf::target_data($pkgconf::config_data(target),$pkgconf::config_data(platform),startup) != "" } + + if { [info exists pkgconf::saved_data(startup)] } { + + if { [is_startup $pkgconf::config_data(target) $pkgconf::config_data(platform) $pkgconf::saved_data(startup)] \ + == 0 } { + warning \ +"The save file $filename specified an unknown startup $pkgconf::saved_data(startup).\ +$pkgconf::config_data(startup) startup has been substituted." + } else { + set pkgconf::config_data(startup) $pkgconf::saved_data(startup) + } + } + } + + # There should be an entry listing all packages for which there is + # a version entry. This can be used to update the version numbers + # which should be used in this configuration. + if { [info exists pkgconf::saved_data(versioned_packages) ] != 0 } { + foreach pkg $pkgconf::saved_data(versioned_packages) { + + # Check that there is a saved version string for this package. + # There should be, but it is not worth worrying about. + if { [info exists pkgconf::saved_data($pkg,version)] == 0 } { + continue + } + set version $pkgconf::saved_data($pkg,version) + + # Does this package still exist ? + if { [is_package $pkg] == 0 } { + warning \ +"The save file $filename specified version $version for package $pkg.\ +This package does not exist in the current repository, so the version string\ +has been ignored." + continue + } + set pkg [find_package $pkg] + ASSERT { $pkg != "" } + + # Is the version valid ? + if { [is_valid_version $pkg $version] == 0 } { + warning \ +"The save file $filename specified version $version for package $pkg.\ +This version is not present in the current repository so the version\ +string has been ignored." + } else { + set pkgconf::config_data($pkg,version) $version + } + } + } + + # Now check that all the packages listed in the save file are known. + # If any are missing then they are just discarded. Known packages + # are used to update the appropriate current configuration data. + if { [info exists pkgconf::saved_data(enabled_packages)] == 0 } { + set pkgconf::saved_data(enabled_packages) "" + } + if { [info exists pkgconf::saved_data(disabled_packages)] == 0 } { + set pkgconf::saved_data(disabled_packages) "" + } + + foreach pkg $pkgconf::saved_data(enabled_packages) { + + if { [is_package $pkg] == 0 } { + warning \ +"The save file $filename mentioned a package $pkg.\ +This package does not exist in the current repository and +has been ignored." + continue + } + + set pkg [find_package $pkg] + set index [lsearch -exact $pkgconf::config_data(enabled_packages) $pkg] + if { $index == -1 } { + lappend pkgconf::config_data(enabled_packages) $pkg + } + } + + foreach pkg $pkgconf::saved_data(disabled_packages) { + + if { [is_package $pkg] == 0 } { + warning \ +"The save file $filename mentioned a package $pkg.\ +This package does not exist in the current repository and +has been ignored." + continue + } + + set pkg [find_package $pkg] + set index [lsearch -exact $pkgconf::config_data(disabled_packages) $pkg] + if { $index == -1 } { + lappend pkgconf::config_data(disabled_packages) $pkg + } + + # Better make sure that a package is not simultaneously enabled and disabled. + set index [lsearch -exact $pkgconf::config_data(enabled_packages) $pkg] + if { $index != -1 } { + set pkgconf::config_data(enabled_packages) [lreplace $pkgconf::config_data(enabled_packages) $index $index] + } + } + + # Now check for any compiler flags + foreach flag $pkgconf::known_compiler_flags { + if { [info exists pkgconf::saved_data(cflags,$flag)] } { + set pkgconf::config_data(cflags,$flag) $pkgconf::saved_data(cflags,$flag) + } + } + + # Update the install directory if appropriate. + # There is not a lot of checking that can be done here. + if { [info exists pkgconf::saved_data(prefix) ] } { + set pkgconf::config_data(prefix) $pkgconf::saved_data(prefix) + } + + # And check for the use_links option + if { [info exists pkgconf::saved_data(use_links)] } { + set pkgconf::config_data(use_links) $pkgconf::saved_data(use_links) + } + + # Now, possibly undo all of this if the user specified --defaults. + if { $pkgconf::defaults_arg != 0 } { + foreach entry [array names pkgconf::config_data] { + unset pkgconf::config_data($entry) + } + setup_defaults + } + + if { 0 } { + foreach i [array names pkgconf::config_data] { + puts "pkgconf::config_data($i) : $pkgconf::config_data($i)" + } + exit 0 + } +} + +# }}} +# {{{ write_save_file + +# ---------------------------------------------------------------------------- +# Outputting the save file. This is a relatively simple operation assuming +# no file I/O errors happen. The saved_data array is updated with the new +# contents of the save file. It is not yet clear whether this will be useful, +# but it should not cause any problems either. +# + +proc pkgconf::write_save_file { } { + + # Check for minimal consistency. If any variables are missing then + # this will be handled (poorly) by the catch statement. + ASSERT { [info exists pkgconf::config_data(target)] } + ASSERT { $pkgconf::build_tree != "" } + + set savename [file join $pkgconf::build_tree "pkgconf.sav"] + set open_file "" + + set status [catch { + + set open_file [open $savename w] + output_banner $open_file "pkgconf.sav" + + if { $pkgconf::config_data(target) != "" } { + puts $open_file "set_saved_data target $pkgconf::config_data(target)" + set pkgconf::saved_data(target) $pkgconf::config_data(target) + } + if { $pkgconf::config_data(platform) != "" } { + puts $open_file "set_saved_data platform $pkgconf::config_data(platform)" + set pkgconf::saved_data(platform) $pkgconf::config_data(platform) + } + if { $pkgconf::config_data(startup) != "" } { + puts $open_file "set_saved_data startup $pkgconf::config_data(startup)" + set pkgconf::saved_data(startup) $pkgconf::config_data(startup) + } + if { $pkgconf::config_data(enabled_packages) != "" } { + # The use of the list command here avoids problems with multiple + # arguments when the file is read back. + puts $open_file "set_saved_data enabled_packages [list $pkgconf::config_data(enabled_packages)]" + set pkgconf::saved_data(enabled_packages) $pkgconf::config_data(enabled_packages) + } + if { $pkgconf::config_data(disabled_packages) != "" } { + puts $open_file "set_saved_data disabled_packages [list $pkgconf::config_data(disabled_packages)]" + set pkgconf::saved_data(disabled_packages) $pkgconf::config_data(disabled_packages) + } + foreach pkg $pkgconf::known_packages { + ASSERT { [info exists pkgconf::config_data($pkg,version)] } + puts $open_file "set_saved_data \"$pkg,version\" $pkgconf::config_data($pkg,version)" + set pkgconf::saved_data($pkg,version) $pkgconf::config_data($pkg,version) + } + # This allows the versions to be read back in more easily, even if + # there is a change to the number of packages. + puts $open_file "set_saved_data versioned_packages [list $pkgconf::known_packages]" + + foreach flag $pkgconf::known_compiler_flags { + if { [info exists pkgconf::config_data(cflags,$flag)] != 0 } { + puts $open_file "set_saved_data \"cflags,$flag\" \"$pkgconf::config_data(cflags,$flag)\"" + } + } + if { $pkgconf::config_data(use_links) != 0 } { + puts $open_file "set_saved_data use_links 1" + } + + puts $open_file "set_saved_data prefix \"$pkgconf::config_data(prefix)\"" + set pkgconf::saved_data(prefix) $pkgconf::config_data(prefix) + + puts $open_file "\n# End of $savename" + close $open_file + } message ] + + if { $status != 0 } { + + if { $open_file != "" } { + # Whatever error occurred, it happened after the file was opened. + # This is bad news, the file may be corrupt. To avoid complications, + # try to delete it. + catch { + close $open_file + file delete $savename + } + # Also get rid of the saved_data array. + foreach i [array names saved_data] { + unset saved_data($i) + } + } + fatal_error "An unexpected error occurred while generating the save file $savename: $message" + } +} + +# }}} +# {{{ process_arguments() + +# ---------------------------------------------------------------------------- +# This procedure takes care of updating the configuration information using +# the command line arguments, for example if there was an argument specifying +# a different version for a particular package then it is this procedure +# which takes care of it. This procedure also takes care of validating the +# arguments. +# +# This procedure should be invoked after setup_defaults has filled in the +# default values for all configuration data, and after read_save_file +# has updated them with saved data. +# +# There is a separate validation routine which gets invoked first. +# This takes care of serious errors in the command line arguments. +# + +proc pkgconf::process_arguments { } { + + variable known_compiler_flags + variable known_packages + variable package_data + variable known_targets + variable target_data + + variable config_data + variable target_arg + variable platform_arg + variable startup_arg + variable prefix_arg + variable disable_args + variable enable_args + variable version_args + variable use_links_arg + variable use_copies_arg + variable cflags_args + + # Constructing the file name strings here facilitates generating + # error messages. + set packages_file [file join $pkgconf::component_repository "packages"] + set targets_file [file join $pkgconf::component_repository "targets"] + + # The target, platform, and startup values are used throughout so it + # is convenient to have locals. + set target $pkgconf::config_data(target) + set platform $pkgconf::config_data(platform) + set startup $pkgconf::config_data(startup) + + # Start by validating the --target argument This target must + # be present in the known_targets list. If it is then the + # target architecture can be updated. + + if { $pkgconf::target_arg != "" } { + + set target [find_target $pkgconf::target_arg] + if { $target == "" } { + fatal_error "Invalid argument --target=$target_arg, this target is not listed in $targets_file" + } + set pkgconf::config_data(target) $target + + # It is possible that the platform and startup data from the save file + # are no longer valid because of a change in the target. If so then the + # relevant fields have to be cleared. + if { $platform != "" } { + set platform [find_platform $target $platform] + set pkgconf::config_data(platform) $platform + if { ($platform != "") && ($startup != "") } { + if { [lsearch -exact $pkgconf::target_data($target,$platform,startup) $startup] == -1 } { + set startup "" + set pkgconf::config_data(startup) "" + } + } + } + + # Next, if the platform and startup are not currently known then + # it is possible to set up defaults for this target. + if { $platform == "" } { + set platform [lindex $pkgconf::target_data($target,known_platforms) 0] + set pkgconf::config_data(platform) $platform + } + if { $startup == "" } { + set startup [lindex $pkgconf::target_data($target,$platform,startup) 0] + set pkgconf::config_data(startup) $startup + } + } + + # If the target is known then it is possible to verify platform and startup + # arguments. Without a target these arguments are meaningless. + + if { ($target != "") && ($pkgconf::platform_arg != "") } { + + set platform [find_platform $target $pkgconf::platform_arg] + if { $platform == "" } { + fatal_error "Invalid argument --platform=$pkgconf::platform_arg, this platform is not listed in $targets_file" + } + set pkgconf::config_data(platform) $platform + } + + if { ($target != "") && ($platform != "") && ($pkgconf::startup_arg != "" ) } { + + if { [lsearch -exact $pkgconf::target_data($target,$platform,startup) $pkgconf::startup_arg] == -1 } { + fatal_error "Invalid argument --startup=$startup_arg, this startup is not listed in $targets_file" + } + set startup $pkgconf::startup_arg + set config_data(startup) $startup + } + + # It is not really possible to validate the prefix argument. + if { $pkgconf::prefix_arg != "" } { + set pkgconf::config_data(prefix) $pkgconf::prefix_arg + } + + # Cope with the use of symbolic links vs. copies + if { $pkgconf::use_links_arg } { + set pkgconf::config_data(use_links) 1 + } + if { $pkgconf::use_copies_arg } { + set pkgconf::config_data(use_links) 0 + } + + # For each package that is being disabled, make sure it is on the + # list of disabled packages and not on the list of enabled packages. + # The former operation is actually unnecessary if the package is + # disabled by default, but harmless. + foreach pkg $pkgconf::disable_args { + set match [find_package $pkg] + if { $match == "" } { + fatal_error "Invalid argument --disable-$pkg, package $pkg is not listed in $packages_file." + } + + set index [lsearch -exact $pkgconf::config_data(enabled_packages) $match] + if { $index != -1 } { + set pkgconf::config_data(enabled_packages) [lreplace $pkgconf::config_data(enabled_packages) $index $index] + } + set index [lsearch -exact $pkgconf::config_data(disabled_packages) $match] + if { $index == -1 } { + lappend pkgconf::config_data(disabled_packages) $match + } + } + + # For each package that should be enabled, add it to the list of enabled + # packages and remove it from the list of disabled packages. Again the + # former is actually unnecessary if the package is enabled by default. + foreach pkg $pkgconf::enable_args { + set match [find_package $pkg] + if { $match == "" } { + fatal_error "Invalid argument --enable-$pkg, package $pkg is not listed in $packages_file." + } + + set index [lsearch -exact $pkgconf::config_data(disabled_packages) $match] + if { $index != -1 } { + set pkgconf::config_data(disabled_packages) [lreplace $pkgconf::config_data(disabled_packages) $index $index] + } + set index [lsearch -exact $pkgconf::config_data(enabled_packages) $match] + if { $index == -1 } { + lappend config_data(enabled_packages) $match + } + } + + # For each package where a version has been specified, validate this + # version and use it. Also make sure that the package is enabled. + foreach pkg [array names pkgconf::version_args] { + + set match [find_package $pkg] + if { $match == "" } { + fatal_error "Invalid argument --$pkg-version, package $pkg is not listed in $packages_file." + } + if { [lsearch -exact $pkgconf::package_data($match,versions) $pkgconf::version_args($pkg)] == -1 } { + fatal_error "Invalid argument --$pkg-version=$pkgconf::version_args($pkg), that version is not available." + } + set pkgconf::config_data($match,version) $pkgconf::version_args($pkg) + + set index [lsearch -exact $pkgconf::config_data(disabled_packages) $match] + if { $index != -1 } { + set pkgconf::config_data(disabled_packages) [lreplace $pkgconf::config_data(disabled_packages) $index $index] + } + if { ($pkgconf::package_data($match,hardware) == 1) || ($pkgconf::package_data($match,default) == 0) } { + set index [lsearch -exact $pkgconf::config_data(enabled_packages) $match] + if { $index == -1 } { + lappend config_data(enabled_packages) $match + } + } + } + + # For each compiler flag that has been specified explicitly on the command line, + # store it in the configuration data + foreach flag [array names pkgconf::cflags_args] { + set pkgconf::config_data(cflags,$flag) $pkgconf::cflags_args($flag) + } +} + +# }}} +# {{{ reset_data() + +# ---------------------------------------------------------------------------- +# This routine gets rid of all data. It can be used if the script is +# switching from one configuration to a different one. +# +proc pkgconf::reset_data { } { + + foreach i [array names pkgconf::config_data] { + unset pkgconf::config_data($i) + } + foreach i [array names pkgconf::saved_data] { + unset pkgconf::saved_data($i) + } +} + +# }}} + +# }}} +# {{{ GUI + +# {{{ GUI variables + +namespace eval pkgconf { + + namespace export gui + + # Which editor should be used for fine-grained configuration options ? + # The VISUAL environment variable is the correct way to obtain this + # information on Unix operating systems. Windows machines do not + # seem to have an obvious equivalent. + variable editor "" + if { [info exists ::env(VISUAL)] } { + set editor $::env(VISUAL) + } + + # The names of the pages in the notebook. These names are + # invented by the notebook widget. + variable target_frame "" + variable packages_frame "" + variable options_frame "" + variable flags_frame "" + variable build_frame "" + + # It is convenient to keep track of whether or not certain information + # has changed. This simplifies the task of deciding whether or not + # a page in the notebook needs redrawing. + # + # Note: currently if the user makes a change and then undoes that + # change the variable remains set. It is possible to get around this, + # but that would require a bit more work. + variable packages_page_needs_refresh 0 + variable options_page_needs_refresh 0 + variable build_page_needs_refresh 0 + + # Is it currently possible to do a build, or is it necessary to + # update the build tree first. + variable build_tree_needs_update 0 + + # Each notebook page is given its own array of global data. + array set target_page_data {}; + array set packages_page_data {}; + array set options_page_data {}; + array set flags_page_data {}; + array set build_page_data {}; + + # The state of the build output window. There are two flags to consider: + # whether the output window is visible or not; and whether the output + # window is docked or not. + variable output_docked 1 + variable output_visible 0 + + # For gui mode, what is the name of the toplevel window ? + # If this script is embedded in a larger application then it can + # be made to run inside a frame in that window. + namespace export set_toplevel_window + variable toplevel ".pkgconf" +} + +# }}} +# {{{ Effective Tcl support + +# ---------------------------------------------------------------------------- +# For now the intention is to allow this script to be run from a completely +# standard wish or tclsh interpreter, version 8.0 or later. This means it is +# not possible to use extensions such as TIX or ITCL. However in the GUI +# it is still desirable to have a notebook widget, so here is an +# implementation in vanilla TK. The balloon widget from the same source +# is used as well. +# +# The code derives from the book Effective Tcl/Tk programming by Mark +# Harrison and Michael McLennan. The actual source code was obtained from +# the Addison-Wesley web site and contains the following copyright. +# +# This distribution contains examples from the "Effective Tcl/Tk +# Programming" book. You can study these examples as you read +# through the book, and you can steal the code for your own +# applications! +# +# +# The code is enclosed in a separate namespace. Also I have modified +# the code in a number of places to make it more general-purpose. +# +namespace eval pkgconf::efftcl { + +# ---------------------------------------------------------------------- +# EXAMPLE: tabnotebook that can dial up pages +# ---------------------------------------------------------------------- +# Effective Tcl/Tk Programming +# Mark Harrison, DSC Communications Corp. +# Michael McLennan, Bell Labs Innovations for Lucent Technologies +# Addison-Wesley Professional Computing Series +# ====================================================================== +# Copyright (c) 1996-1997 Lucent Technologies Inc. and Mark Harrison +# ====================================================================== + +# BLV fix: this script may execute in tclsh rather than in wish, +# so the option command may not be available. +if { [info command "option"] == "option"} { + + # BLV: I do not like this background colour for the tabs. + if { 0 } { + option add *Tabnotebook.tabs.background #666666 widgetDefault + } + option add *Tabnotebook.margin 6 widgetDefault + option add *Tabnotebook.tabColor #a6a6a6 widgetDefault + option add *Tabnotebook.activeTabColor #d9d9d9 widgetDefault + option add *Tabnotebook.tabFont \ + -*-helvetica-bold-r-normal--*-120-* widgetDefault +} + +# BLV fix: replace global variables with per-namespace ones. +array set tnInfo {} +array set bhInfo {} + +proc tabnotebook_create {win} { + variable tnInfo + + frame $win -class Tabnotebook + canvas $win.tabs -highlightthickness 0 + pack $win.tabs -fill x + + notebook_create $win.notebook + pack $win.notebook -expand yes -fill both + + set tnInfo($win-tabs) "" + set tnInfo($win-current) "" + set tnInfo($win-pending) "" + return $win +} + +# +# BLV fix: add three arguments, one specifying a function to be +# invoked when the tab becomes visible, another for when the user +# leaves the tab, and a text string for balloon help. This function can +# be used to redraw a page if this is necessary due to changes in other +# pages, and an empty string can be used if desired. An empty string +# can also be used for the balloon help. +# + +proc tabnotebook_page {win name enterfn leavefn help} { + variable tnInfo + + set page [notebook_page $win.notebook $name] + lappend tnInfo($win-tabs) $name + set tnInfo($name-enterfn) $enterfn + set tnInfo($name-leavefn) $leavefn + set tnInfo($name-help) $help + + if {$tnInfo($win-pending) == ""} { + set id [after idle [list pkgconf::efftcl::tabnotebook_refresh $win]] + set tnInfo($win-pending) $id + } + return $page +} + +proc tabnotebook_refresh {win} { + variable tnInfo + + $win.tabs delete all + + set margin [option get $win margin Margin] + set color [option get $win tabColor Color] + set font [option get $win tabFont Font] + set x 2 + set maxh 0 + + foreach name $tnInfo($win-tabs) { + set id [$win.tabs create text \ + [expr $x+$margin+2] [expr -0.5*$margin] \ + -anchor sw -text $name -font $font \ + -tags [list $name]] + + set bbox [$win.tabs bbox $id] + set wd [expr [lindex $bbox 2]-[lindex $bbox 0]] + set ht [expr [lindex $bbox 3]-[lindex $bbox 1]] + if {$ht > $maxh} { + set maxh $ht + } + + $win.tabs create polygon 0 0 $x 0 \ + [expr $x+$margin] [expr -$ht-$margin] \ + [expr $x+$margin+$wd] [expr -$ht-$margin] \ + [expr $x+$wd+2*$margin] 0 \ + 2000 0 2000 10 0 10 \ + -outline black -fill $color \ + -tags [list $name tab tab-$name] + + $win.tabs raise $id + + $win.tabs bind $name \ + [list pkgconf::efftcl::tabnotebook_display $win $name] + + # BLV - add support for balloon help + if { $tnInfo($name-help) != "" } { + balloonhelp_canvas_for $win.tabs $name $tnInfo($name-help) + } + set x [expr $x+$wd+2*$margin] + } + set height [expr $maxh+2*$margin] + $win.tabs move all 0 $height + + $win.tabs configure -width $x -height [expr $height+4] + + if {$tnInfo($win-current) != ""} { + tabnotebook_display $win $tnInfo($win-current) + } else { + tabnotebook_display $win [lindex $tnInfo($win-tabs) 0] + } + set tnInfo($win-pending) "" +} + +proc tabnotebook_display {win name} { + variable tnInfo + variable nbInfo + + # BLV: invoke appropriate callbacks in the current and new + # tabs. + set old_tab $tnInfo($win-current) + if { ($old_tab != "") && ($tnInfo($old_tab-leavefn) != "") } { + $tnInfo($old_tab-leavefn) $nbInfo($win.notebook-page-$old_tab)) + } + if { $tnInfo($name-enterfn) != "" } { + $tnInfo($name-enterfn) $nbInfo($win.notebook-page-$name) + } + + notebook_display $win.notebook $name + + set normal [option get $win tabColor Color] + $win.tabs itemconfigure tab -fill $normal + + set active [option get $win activeTabColor Color] + $win.tabs itemconfigure tab-$name -fill $active + $win.tabs raise $name + + set tnInfo($win-current) $name +} + +# ---------------------------------------------------------------------- +# EXAMPLE: simple notebook that can dial up pages +# ---------------------------------------------------------------------- +# Effective Tcl/Tk Programming +# Mark Harrison, DSC Communications Corp. +# Michael McLennan, Bell Labs Innovations for Lucent Technologies +# Addison-Wesley Professional Computing Series +# ====================================================================== +# Copyright (c) 1996-1997 Lucent Technologies Inc. and Mark Harrison +# ====================================================================== + +# BLV - again check for TK being present. +if { [info command option] == "option" } { + option add *Notebook.borderWidth 2 widgetDefault + option add *Notebook.relief sunken widgetDefault +} + +# BLV: replace nbInfo global with a per-namespace variable +array set nbInfo {} + +proc notebook_create {win} { + variable nbInfo + + frame $win -class Notebook + pack propagate $win 0 + + set nbInfo($win-count) 0 + set nbInfo($win-pages) "" + set nbInfo($win-current) "" + return $win +} + +proc notebook_page {win name} { + variable nbInfo + + set page "$win.page[incr nbInfo($win-count)]" + lappend nbInfo($win-pages) $page + set nbInfo($win-page-$name) $page + + frame $page + + if {$nbInfo($win-count) == 1} { + after idle [list pkgconf::efftcl::notebook_display $win $name] + } + + return $page +} + +proc notebook_display {win name} { + variable nbInfo + + set page "" + if {[info exists nbInfo($win-page-$name)]} { + set page $nbInfo($win-page-$name) + } elseif {[winfo exists $win.page$name]} { + set page $win.page$name + } + if {$page == ""} { + error "bad notebook page \"$name\"" + } + + notebook_fix_size $win + + if {$nbInfo($win-current) != ""} { + pack forget $nbInfo($win-current) + } + pack $page -expand yes -fill both + set nbInfo($win-current) $page +} + +proc notebook_fix_size {win} { + variable nbInfo + + update idletasks + + set maxw 0 + set maxh 0 + foreach page $nbInfo($win-pages) { + set w [winfo reqwidth $page] + if {$w > $maxw} { + set maxw $w + } + set h [winfo reqheight $page] + if {$h > $maxh} { + set maxh $h + } + } + set bd [$win cget -borderwidth] + set maxw [expr $maxw+2*$bd] + set maxh [expr $maxh+2*$bd] + $win configure -width $maxw -height $maxh +} + +# ---------------------------------------------------------------------- +# EXAMPLE: use "wm" commands to manage a balloon help window +# ---------------------------------------------------------------------- +# Effective Tcl/Tk Programming +# Mark Harrison, DSC Communications Corp. +# Michael McLennan, Bell Labs Innovations for Lucent Technologies +# Addison-Wesley Professional Computing Series +# ====================================================================== +# Copyright (c) 1996-1997 Lucent Technologies Inc. and Mark Harrison +# ====================================================================== + +# BLV fix: again this script may execute in tclsh rather than in wish. +if { [info command "option"] == "option" } { + option add *Balloonhelp*background white widgetDefault + option add *Balloonhelp*foreground black widgetDefault + option add *Balloonhelp.info.wrapLength 3i widgetDefault + option add *Balloonhelp.info.justify left widgetDefault + option add *Balloonhelp.info.font \ + -*-lucida-medium-r-normal-sans-*-120-* widgetDefault + + toplevel .balloonhelp -class Balloonhelp \ + -background black -borderwidth 1 -relief flat + + # BLV fix: I want to create the arrow image inline rather than + # read it in from a file. + image create bitmap arrow -data "\ +#define arrow_width 8 +#define arrow_height 8 +static unsigned char arrow_bits[] = { + 0x1f, 0x0f, 0x0f, 0x1f, 0x39, 0x70, 0x20, 0x00}; +" + label .balloonhelp.arrow -anchor nw -image arrow + +# label .balloonhelp.arrow -anchor nw \ +# -bitmap @[file join $env(EFFTCL_LIBRARY) images arrow.xbm] + pack .balloonhelp.arrow -side left -fill y + + label .balloonhelp.info + pack .balloonhelp.info -side left -fill y + + wm overrideredirect .balloonhelp 1 + wm withdraw .balloonhelp +} + +# ---------------------------------------------------------------------- +# USAGE: balloonhelp_for +# +# Adds balloon help to the widget named . Whenever the mouse +# pointer enters this widget and rests within it for a short delay, +# a balloon help window will automatically appear showing the +# help . +# ---------------------------------------------------------------------- + +proc balloonhelp_for {win mesg} { + variable bhInfo + set bhInfo($win) $mesg + + bind $win {pkgconf::efftcl::balloonhelp_pending %W %W} + bind $win {pkgconf::efftcl::balloonhelp_cancel} +} + +# BLV: a variant that can be used for canvas items. + +proc balloonhelp_canvas_for { canvas id mesg } { + variable bhInfo + set bhInfo($canvas-$id) $mesg + + $canvas bind $id [list pkgconf::efftcl::balloonhelp_pending $canvas $canvas-$id] + $canvas bind $id {pkgconf::efftcl::balloonhelp_cancel} +} + +# ---------------------------------------------------------------------- +# USAGE: balloonhelp_control +# +# Turns balloon help on/off for the entire application. +# ---------------------------------------------------------------------- +set bhInfo(active) 1 + +proc balloonhelp_control {state} { + variable bhInfo + + if {$state} { + set bhInfo(active) 1 + } else { + balloonhelp_cancel + set bhInfo(active) 0 + } +} + +# ---------------------------------------------------------------------- +# USAGE: balloonhelp_pending +# +# Used internally to mark the point in time when a widget is first +# touched. Sets up an "after" event so that balloon help will appear +# if the mouse remains within the current window. +# ---------------------------------------------------------------------- + +# BLV - the first argument identifies the window, the second the help +# string. +proc balloonhelp_pending {win id} { + variable bhInfo + + balloonhelp_cancel + set bhInfo(pending) [after 1500 [list pkgconf::efftcl::balloonhelp_show $win $id]] +} + +# ---------------------------------------------------------------------- +# USAGE: balloonhelp_cancel +# +# Used internally to mark the point in time when the mouse pointer +# leaves a widget. Cancels any pending balloon help requested earlier +# and hides the balloon help window, in case it is visible. +# ---------------------------------------------------------------------- +proc balloonhelp_cancel {} { + variable bhInfo + + if {[info exists bhInfo(pending)]} { + after cancel $bhInfo(pending) + unset bhInfo(pending) + } + wm withdraw .balloonhelp +} + +# ---------------------------------------------------------------------- +# USAGE: balloonhelp_show +# +# Used internally to display the balloon help window for the +# specified . +# ---------------------------------------------------------------------- + +# BLV - the first argument identifies the window, the second the +# help message. + +proc balloonhelp_show {win id} { + variable bhInfo + + if {$bhInfo(active)} { + .balloonhelp.info configure -text $bhInfo($id) + + # BLV: switched from using window-relative positions + # to mouse relative position. + if { 0 } { + set x [expr [winfo rootx $win]+10] + set y [expr [winfo rooty $win]+[winfo height $win]] + } else { + set coords [winfo pointerxy $win] + set x [expr [lindex $coords 0] + 15] + set y [expr [lindex $coords 1] + 15] + } + if { ($x >= 0) && ($y >= 0) } { + wm geometry .balloonhelp +$x+$y + wm deiconify .balloonhelp + raise .balloonhelp + } + } + unset bhInfo(pending) +} + +} + +# }}} +# {{{ standalone initialisation + +# ---------------------------------------------------------------------------- +# GUI Start-up. It is necessary to work out a few things about the operating +# environment. +# +# 1) is this script being run via tclsh or via wish ? If the former then only +# command line operation is possible. If the latter then a GUI environment +# can be provided as well. +# +# 2) if TK is present, has it been extended with Tix ? If so use the standard +# TK color scheme etc., not the Tix variant. +# +# 3) if TK is present, get rid of the top-level window. +# +# If this command is not being run stand-alone then it is the responsibility +# of the calling code to take appropriate action, e.g. to enable gui mode +# and to set up the appropriate options. +# + +proc pkgconf::gui_standalone_init { } { + + variable gui_possible + + if { [info command tk] == "tk" } { + + # TK is loaded. For now allow GUI mode, but the actual decision + # depends on command line arguments. + set gui_possible 1 + + # Get rid of the top-level window. Otherwise this might pop up if the + # script performs a blocking operation too early. + wm withdraw . + + # If TIX is also present, prevent the TIX color scheme etc. from taking + # effect. + if { [info command tix] == "tix" } { + tix resetoptions TK TK + } + + # It is probably not a good idea to accept "send" messages. However + # setting the appname also affects option handling, which is more + # useful. Note that the send command is not available in all versions + # of Tcl. + if { [info command send] == "send" } { + rename send {} + } + tk appname pkgconf + + } else { + + # TK is not loaded, so gui mode is not possible. + set gui_possible 0 + } +} + +# }}} +# {{{ set toplevel window + +# ---------------------------------------------------------------------------- +# Allow a containing program, if any, to specify the window in which +# this script should do its funky stuff. It is not possible to change +# this window while pkgconf is active, so if for any reason it is +# necessary to change the toplevel window then the old one must be +# destroyed first, the new name must be installed, and then there +# must be a new call to pkgconf::gui to redraw the window. +# + +proc pkgconf::set_toplevel_window { name } { + variable toplevel + set toplevel $name +} + +# }}} +# {{{ main GUI draw routine + +# ---------------------------------------------------------------------------- +# The main GUI code. +# +# The routine pkgconf::gui is responsible for creating the various windows. +# These are as follows: +# +# 1) a menu bar containing menus for File, Window and Help. Currently the only +# entry in File is Exit, and the entries in Help are all disabled. The +# Window menu allows the output window to be hidden or shown. +# +# 2) a notebook frame containing four pages: +# +# a) target hardware. This lists all known target architectures, +# and allows the user to select the appropriate one using a +# set of radio buttons. +# +# b) packages. This lists all known packages and the versions for +# each package. Unfortunately neither radio buttons nor checkbuttons +# provide entirely the right paradigm here, but checkbuttons are +# good enough. +# +# c) an edit page. This allows the user to invoke a text editor for +# any of the fine-grained configuration headers. +# +# d) a compiler flags page. This allows the user to manipulate the +# compiler flags etc. +# +# e) a build page. This allows the user to create the build tree and to +# invoke make, make tests, make clean, etc. There is also an entry +# field to allow the install directory to be changed. +# +# 3) a label field along the bottom, which can be used by the various +# frames to display warning messages. +# +# 4) a separate frame to hold the outputs of builds. This can be either +# docked below the main frame, or it can be a separate toplevel window. +# The build frame contains a number of buttons to allow the text +# screen to be cleared, removed from the display, docked/undocked, +# or saved to a file. +# +# 5) the options database is consulted to decide whether the output +# window should be docked or not by default. +# +# 6) if there is a file ~/.pkgconfrc this file gets executed. It is +# assumed to contain valid Tcl code. +# +# If this script is running inside a large application then there may be +# a frame $toplevel_window already. If so this frame should be used. +# Otherwise a separate toplevel window should be created, complete with +# menu bar. +# + +proc pkgconf::gui { } { + + variable toplevel + if { [winfo exists $toplevel] == 0 } { + create_toplevel_window + } + + # Now create a notebook, and add four pages to it. The names of these + # pages have to be stored in separate variables. + variable target_frame + variable packages_frame + variable options_frame + variable flags_frame + variable build_frame + + efftcl::tabnotebook_create $toplevel.notebook + set target_frame [efftcl::tabnotebook_page $toplevel.notebook "Target" \ + pkgconf::nbpage_targets_enter pkgconf::nbpage_targets_leave \ + "Select target hardware"] + set packages_frame [efftcl::tabnotebook_page $toplevel.notebook "Packages" \ + pkgconf::nbpage_packages_enter pkgconf::nbpage_packages_leave \ + "Select desired packages"] + set options_frame [efftcl::tabnotebook_page $toplevel.notebook "Options" \ + pkgconf::nbpage_options_enter pkgconf::nbpage_options_leave \ + "Edit configuration options"] + set flags_frame [efftcl::tabnotebook_page $toplevel.notebook "Flags" \ + pkgconf::nbpage_flags_enter pkgconf::nbpage_flags_leave \ + "Edit compiler flags"] + set build_frame [efftcl::tabnotebook_page $toplevel.notebook "Build" \ + pkgconf::nbpage_build_enter pkgconf::nbpage_build_leave \ + "Build this configuration"] + + # By default the notebook is the widget that expands. If a build output + # window is present instead then it is the output window that expands. + pack $toplevel.notebook -side top -fill both -expand 1 + + # Make sure that the message window exists, since some of the + # notebook update routines refer to it. + label $toplevel.message -text "" -anchor w -relief raised -borderwidth 2 + pack $toplevel.message -side top -fill x + + # Now create the notebook pages. + nbpage_targets_initialise $target_frame + nbpage_packages_initialise $packages_frame + nbpage_options_initialise $options_frame + nbpage_flags_initialise $flags_frame + nbpage_build_initialise $build_frame + + # Create the output window, but leave it hidden for now. + frame $toplevel.output + frame $toplevel.output.buttons + button $toplevel.output.buttons.hide -text "Hide" -command pkgconf::output_hide_window + button $toplevel.output.buttons.undock -text "Undock" -command pkgconf::output_undock_window + button $toplevel.output.buttons.clear -text "Clear" -command pkgconf::output_clear_window + button $toplevel.output.buttons.save -text "Save..." -command pkgconf::output_save + pack $toplevel.output.buttons.hide \ + $toplevel.output.buttons.undock \ + $toplevel.output.buttons.clear \ + $toplevel.output.buttons.save -side left -expand 1 + pack $toplevel.output.buttons -side top -fill x + text $toplevel.output.text -wrap word -state disabled -yscrollcommand [list $toplevel.output.scroll set] + pack $toplevel.output.text -side left -fill both -expand 1 + scrollbar $toplevel.output.scroll -orient vertical -command [list $toplevel.output.text yview] + pack $toplevel.output.scroll -side right -fill y + + # Create a toplevel window matching the output frame, but leave it + # hidden for now. Give it the same bindings as the toplevel window. + toplevel .pkgconf_output -menu .menubar -class Pkgconf + wm withdraw .pkgconf_output + wm title .pkgconf_output "pkgconf build output" + wm protocol .pkgconf_output WM_DELETE_WINDOW { pkgconf::handle_exit } + + bind .pkgconf_output { pkgconf::handle_exit } + bind .pkgconf_output { pkgconf::handle_exit } + + frame .pkgconf_output.buttons + button .pkgconf_output.buttons.hide -text "Hide" -command pkgconf::output_hide_window + button .pkgconf_output.buttons.undock -text "Dock" -command pkgconf::output_undock_window + button .pkgconf_output.buttons.clear -text "Clear" -command pkgconf::output_clear_window + button .pkgconf_output.buttons.save -text "Save..." -command pkgconf::output_save + pack .pkgconf_output.buttons.hide \ + .pkgconf_output.buttons.undock \ + .pkgconf_output.buttons.clear \ + .pkgconf_output.buttons.save -side left -expand 1 + pack .pkgconf_output.buttons -side top -fill x + text .pkgconf_output.text -wrap word -state disabled -yscrollcommand { .pkgconf_output.scroll set } + pack .pkgconf_output.text -side left -fill both -expand 1 + scrollbar .pkgconf_output.scroll -orient vertical -command { .pkgconf_output.text yview } + pack .pkgconf_output.scroll -side right -fill y + + efftcl::balloonhelp_for $toplevel.output.buttons.hide \ + "Remove the build output window, until more output appears." + efftcl::balloonhelp_for .pkgconf_output.buttons.hide \ + "Remove the build output window, until more output appears." + efftcl::balloonhelp_for $toplevel.output.buttons.undock \ + "Make the build output appear in a separate window." + efftcl::balloonhelp_for .pkgconf_output.buttons.undock \ + "Attach the build output to the main pkgconf window." + efftcl::balloonhelp_for $toplevel.output.buttons.clear \ + "Remove all build output text." + efftcl::balloonhelp_for .pkgconf_output.buttons.clear \ + "Remove all build output text." + efftcl::balloonhelp_for $toplevel.output.buttons.save \ + "Save build output to a file." + efftcl::balloonhelp_for .pkgconf_output.buttons.save \ + "Save build output to a file." + + # Consult the options database. + variable output_docked + option add "*docked" 1 startupFile + set output_docked [option get $toplevel docked Pkgconf] + + # Look for a file ~/.pkgconfrc and execute it. + if { [file isfile [file join "~" ".pkgconfrc"]] } { + if { [namespace eval :: { catch { source [file join "~" ".pkgconfrc"] } message } ] != 0 } { + warning "The following error occurred while executing ~/.pkgconfrc: $message" + } + } +} + +# ---------------------------------------------------------------------------- +# This routine creates the toplevel window, if pkgconf is running +# independently rather than inside a larger application. + +proc pkgconf::create_toplevel_window { } { + + variable toplevel + + # Start by creating the menubar. TK8's support for native menus is + # used. + menu .menubar -type menubar + menu .menubar.config -tearoff 0 -type normal + menu .menubar.edit -tearoff 0 -type normal + menu .menubar.view -tearoff 0 -type normal + menu .menubar.help -tearoff 0 -type normal + + .menubar.config add command -label "Exit" -command pkgconf::handle_exit -underline 1 \ + -accelerator "Alt+Q" + + .menubar.edit add command -label "Undo" -state disabled + .menubar.edit add command -label "Redo" -state disabled + + .menubar.view add checkbutton -label "Show output" \ + -variable pkgconf::output_visible -onvalue 1 -offvalue 0 \ + -command pkgconf::output_menu + .menubar.view add checkbutton -label "Balloon help" \ + -variable pkgconf::efftcl::bhInfo(active) -onvalue 1 -offvalue 0 + + .menubar.help add command -label "Help on pkgconf" -state disabled + .menubar.help add command -label "Help on the system" -state disabled + .menubar.help add command -label "Search" -state disabled + .menubar.help add separator + .menubar.help add command -label "About pkgconf" -state disabled + + .menubar add cascade -menu .menubar.config -label "Configuration" -underline 0 + .menubar add cascade -menu .menubar.edit -label "Edit" -underline 0 + .menubar add cascade -menu .menubar.view -label "View" -underline 0 + .menubar add cascade -menu .menubar.help -label "Help" -underline 0 + + # Create the toplevel window, giving it a menubar and a name, + # and establish the accelerator binding. + toplevel $toplevel -menu .menubar -class Pkgconf + wm title $toplevel pkgconf + bind $toplevel { pkgconf::handle_exit } + wm protocol $toplevel WM_DELETE_WINDOW { pkgconf::handle_exit } + + # Although there is a Configuration menu instead of a file menu, it is + # desirable to support alt-f-x as a reasonably standard way of exiting + # the program. + bind $toplevel { pkgconf::handle_exit } +} + +# ---------------------------------------------------------------------------- +# This routine gets invoked for exit handling: when the user invokes the +# exit entry on the file menu; or when the alt-q accelerator is used; or +# when a window delete request is received. For now the code just exits, +# but it might be an idea to offer to save configuration changes if any. +# +proc pkgconf::handle_exit { } { + exit 0 +} + +# }}} +# {{{ Notebook pages + +# {{{ Targets page + +# ---------------------------------------------------------------------------- +# The targets page. This allows the user to select the target architecture, +# platform, and startup. The range of available target architectures cannot +# change while the program is running, so this window is actually fixed. +# + +proc pkgconf::nbpage_targets_initialise { win } { + + variable config_data + variable known_targets + variable target_data + variable target_page_data + + # I need a variable that can be associated with the radiobuttons and + # identifies the selected target uniquely. It is not really + # possible to do this with the three variables in the config data + # directly. + set target_page_data(selection) [list $config_data(target) $config_data(platform) $config_data(startup)] + + # Conceivably the number of targets could be larger than can fit + # conveniently on to one screen, so it is desirable use a scrollable + # form. Start by creating a scrollbar, a canvas, and a frame within + # that canvas, and set up a standard resize callback. The canvas + # starts off small, but expands as necessary. The actual size will + # therefore be determined by whichever page does not have a + # vertical scrollbar, typically the build page. + scrollbar $win.scrollbar -command "$win.viewport yview" -orient vertical + pack $win.scrollbar -side right -fill y + + canvas $win.viewport -height 10m -yscrollcommand "$win.scrollbar set" + pack $win.viewport -fill both -expand 1 -padx 20 -pady 20 + + frame $win.viewport.form + $win.viewport create window 0 0 -anchor nw -window $win.viewport.form + + bind $win.viewport.form "pkgconf::nbpage_form_resized $win" + + # Now fill in the form with details of all the targets. + # These are arranged in a simple grid. + set form $win.viewport.form + set row 0 + + foreach target $known_targets { + + label $form.arch-$row -text "Target [get_target_alias $target]" -anchor w + grid $form.arch-$row -row $row -column 0 -sticky w + incr row + + foreach platform $target_data($target,known_platforms) { + foreach startup $target_data($target,$platform,startup) { + + label $form.platform-$row -text " Platform [get_platform_alias $target $platform]," -anchor w + grid $form.platform-$row -row $row -column 0 -sticky w + label $form.startup-$row -text "$startup startup" -anchor w + grid $form.startup-$row -row $row -column 1 -sticky w -ipadx 5 + radiobutton $form.button-$row -variable pkgconf::target_page_data(selection) \ + -value [list $target $platform $startup] \ + -command pkgconf::clear_status_line + grid $form.button-$row -row $row -column 2 -sticky w + incr row + } + } + } +} + +# +# The enter routine gets invoked when the user switches to the targets tab, +# and also during start-up since the targets tab is the first one. It is +# responsible for keeping track of the initial target selection, so that +# when the user switches to a different tab it is possible to know whether +# or not the target has actually changed. +# +# As a useful side effect, the routine updates the status line. +# +proc pkgconf::nbpage_targets_enter { win } { + + variable config_data + variable target_page_data + + set target_page_data(initial_selection) $target_page_data(selection) + + if { ($config_data(target) == "") || ($config_data(platform) == "") || ($config_data(startup) == "") } { + set_status_line "Please select a target system." + } else { + clear_status_line + } +} + +proc pkgconf::nbpage_targets_leave { win } { + + variable target_page_data + + if { $target_page_data(selection) != $target_page_data(initial_selection) } { + variable config_data + variable build_tree_needs_update + + set config_data(target) [lindex $target_page_data(selection) 0] + set config_data(platform) [lindex $target_page_data(selection) 1] + set config_data(startup) [lindex $target_page_data(selection) 2] + set build_tree_needs_update 1 + + # A change of target has implications for the compiler flags, which + # must be handled immediately. The user may not go into the flags + # tab so the changes cannot be done in the flags tab enter/leave + # routines. + update_compiler_flags + } +} + +# +# This routine take care of resize operations. Whenever the size +# of the form changes the canvas' scroll region needs to be adjusted. +# +# Note that this code is also used for the packages page. +# +proc pkgconf::nbpage_form_resized { win } { + + set bbox [$win.viewport bbox all] + set old_bbox [$win.viewport cget -scrollregion] + set width [winfo width $win.viewport.form] + set old_width [$win.viewport cget -width] + if { ("$bbox" != "$old_bbox") || ($width != $old_width) } { + $win.viewport configure -width $width -scrollregion $bbox + } +} + +# }}} +# {{{ Packages page + +# ---------------------------------------------------------------------------- +# The packages page. This is mostly similar to the targets page. +# It is necessary to provide a mechanism for disabling packages. +# It is also necessary to worry about changes to the target architecture. +# The initialise() routine takes care of most of these things. + +proc pkgconf::nbpage_packages_initialise { win } { + + variable config_data + variable known_packages + variable package_data + variable target_data + variable packages_page_data + + # Start by storing details of the target that is currently + # being displayed. + set packages_page_data(current_target) $config_data(target) + set packages_page_data(current_platform) $config_data(platform) + + # Typically the number of packages will be larger than can fit + # conveniently on to one screen, so it is desirable use a scrollable + # form. Start by creating a scrollbar, a canvas, and a frame within + # that canvas, and set up a standard resize callback. The canvas + # starts of small, but expands as necessary. The actual size will + # therefore be determined by whichever page does not have a + # vertical scrollbar, typically the build page. + scrollbar $win.scrollbar -command "$win.viewport yview" -orient vertical + pack $win.scrollbar -side right -fill y + + canvas $win.viewport -height 10m -yscrollcommand "$win.scrollbar set" + pack $win.viewport -fill both -expand 1 -padx 20 -pady 20 + + frame $win.viewport.form + $win.viewport create window 0 0 -anchor nw -window $win.viewport.form + + bind $win.viewport.form "pkgconf::nbpage_form_resized $win" + + # Now fill in the form with details of all the packages. + # These are arranged in a simple grid. + set form $win.viewport.form + set row 0 + + # Now handle the packages themselves. Each package can be in one + # of the following states: + # + # 1) a hardware package is enabled by default if it is specified + # for the current target or platform, disabled otherwise. + # However the user should be able to explicitly enable or + # disable it. This is handled by config_data(enabled_packages) + # and config_data(disabled_packages). + # + # 2) a non-hardware package may be enabled or disabled by default, + # but the user can change this. Again this is handled by + # enabled_packages and disabled_packages. + # + # It is convenient to cache the list of target and platform specific + # packages. + set target_packages "" + set platform_packages "" + if { $config_data(target) != "" } { + set target_packages $target_data($config_data(target),packages) + if { $config_data(platform) != "" } { + set platform_packages $target_data($config_data(target),$config_data(platform),packages) + } + } + foreach pkg $known_packages { + + # What is the current version of each package ? + set current_version "" + + if { $package_data($pkg,hardware) != 0 } { + if { ([lsearch -exact $target_packages $pkg] != -1) || ([lsearch -exact $platform_packages $pkg] != -1)} { + set current_version $config_data($pkg,version) + } + } elseif { $package_data($pkg,default) != 0 } { + set current_version $config_data($pkg,version) + } + + if { [lsearch -exact $config_data(enabled_packages) $pkg] != -1 } { + set current_version $config_data($pkg,version) + } + if { [lsearch -exact $config_data(disabled_packages) $pkg] != -1 } { + set current_version "" + } + + # Store the current version, so that it is easier to figure out what + # has changed. + set packages_page_data($pkg,version) $current_version + + label $form.label-$row -text "[get_package_alias $pkg]:" + grid $form.label-$row -row $row -column 0 -sticky w + foreach version $package_data($pkg,versions) { + label $form.version-$row -text "Version $version" + grid $form.version-$row -row $row -column 1 -sticky w -ipady 5 + + radiobutton $form.button-$row -variable pkgconf::packages_page_data($pkg,version) \ + -value $version -command [list pkgconf::nbpage_packages_change $pkg] + grid $form.button-$row -row $row -column 2 -sticky w + incr row + } + label $form.version-$row -text "Disable" + grid $form.version-$row -row $row -column 1 -sticky w + radiobutton $form.button-$row -variable pkgconf::packages_page_data($pkg,version) \ + -value "" -command [list pkgconf::nbpage_packages_change $pkg] + grid $form.button-$row -row $row -column 2 -sticky w + incr row + } +} + +# +# This routine gets invoked whenever there is a change to one of the +# packages. It sets a flag indicating that the build tree is out of data. +# It will also update the appropriate config_data. +# +proc pkgconf::nbpage_packages_change { pkg } { + + variable build_tree_needs_update + set build_tree_needs_update 1 + + variable packages_page_data + variable config_data + + set version $packages_page_data($pkg,version) + if { $version == "" } { + + # This package is being explicitly disabled. + set index [lsearch -exact $config_data(enabled_packages) $pkg] + if { $index != -1 } { + set config_data(enabled_packages) [lreplace $config_data(enabled_packages) $index $index] + } + + set index [lsearch -exact $config_data(disabled_packages) $pkg] + if { $index == -1 } { + lappend config_data(disabled_packages) $pkg + } + } else { + + # A package version is being changed, possibly causing it to + # be enabled. + set config_data($pkg,version) $version + + set index [lsearch -exact $config_data(disabled_packages) $pkg] + if { $index != -1 } { + set config_data(disabled_packages) [lreplace $config_data(disabled_packages) $index $index] + } + + set index [lsearch -exact $config_data(enabled_packages) $pkg] + if { $index == -1 } { + lappend config_data(enabled_packages) $pkg + } + } +} + +# +# The packages page needs to be redrawn every time a different target is +# selected, so that the user can select which version of the HAL packages +# should be used. The redraw can be achieved by deleting the existing +# contents of the window and re-invoking the initialise function. + +proc pkgconf::nbpage_packages_enter { win } { + + variable packages_page_data + variable config_data + + if { ($packages_page_data(current_target) != $config_data(target)) || + ($packages_page_data(current_platform) != $config_data(platform)) } { + + foreach subwin [winfo children $win] { + destroy $subwin + } + nbpage_packages_initialise $win + } + + # If the target architecture is not yet known, remind the user. + if { ($config_data(target) == "") || ($config_data(platform) == "") || ($config_data(startup) == "") } { + set_status_line "Please select a target system." + } else { + clear_status_line + } +} + +# +# Currently this code does nothing, instead it is left to the +# nbpage_packages_change routine above to update the appropriate +# global information. This is unfortunate in that if the user +# makes a mistake and undoes it pkgconf still thinks that the +# build tree is out of date. + +proc pkgconf::nbpage_packages_leave { win } { +} + +# }}} +# {{{ Options page + +# ---------------------------------------------------------------------------- +# The options page. This consists of two frame arranged vertically. +# The top frame allows the user to select the editor to use, which is +# initialised from the VISUAL environment variable. The bottom frame +# is another scrollable canvas allowing the user to select a header +# file to edit. +# +# A number of special cases have to be allowed for. If there is no +# text editor then all the buttons to edit a text file have to +# be disabled. If there is no pkgconf directory in the build tree +# yet then there will be no files to edit. Even if there is an +# an pkgconf directory it may not contain all the files it is +# supposed to, especially if the build tree is not up to date. +# + +proc pkgconf::nbpage_options_initialise { win } { + + # Start with the top frame. This contains a label, an entry field, + # and a button that invokes a file selector. + # NOTE: these borderwidths should not be hardwired. + variable editor + frame $win.top -relief raised -borderwidth 2 + label $win.top.label -text "Editor:" + entry $win.top.entry -relief sunken -borderwidth 2 -textvariable pkgconf::editor + button $win.top.button -text "Browse..." -command pkgconf::nbpage_options_browse + pack $win.top.button -side right + pack $win.top.entry -side right -fill x -expand 1 + pack $win.top.label -side left + pack $win.top -side top -fill x + + efftcl::balloonhelp_for $win.top.entry "The text editor that should be used." + efftcl::balloonhelp_for $win.top.button "Select the text editor that should be used." + + # The entry widget does not support a command callback when + # a string has been typed in, so it is necessary to use the + # trace facility instead to enable or disable the buttons. + # Note that this routine may get invoked from the update routine, + # so it is necessary to clean up the old trace. + trace vdelete pkgconf::editor w pkgconf::nbpage_options_editor_changed + trace variable pkgconf::editor w pkgconf::nbpage_options_editor_changed + + # At this point there are now button widgets in this page. The + # nbpage_options_editor_changed routine used this list. + variable options_page_data + set options_page_data(buttons) "" + + # Now check for editable files in the pkgconf directory. + # Three of the files, makefile, pkgconf.mak and system.h are generated + # and should not be edited by users. There may also be various .stamp + # files used by the build system. + variable build_tree + set files "" + foreach filename [glob -nocomplain [file join $build_tree "pkgconf" "*"]] { + set filename [file tail $filename] + if { [string match {*.stamp} $filename] } continue + if { ($filename == "makefile") || ($filename == "pkgconf.mak") || ($filename == "system.h") } continue + lappend files $filename + } + + if { $files == "" } { + + # OK, just display a message. There is likely to be an appropriate + # warning in the message frame at the bottom of the window already. + label $win.message -text "There are no configuration files to edit." + pack $win.message -fill both -expand 1 + + # A valid configuration always has a makevars file to edit, so the + # implication is that the build tree is out of date. It probably + # makes sense to set the relevant flag here. + variable build_tree_needs_update + set build_tree_needs_update 1 + return + } + + # The editable files are displayed in a scrollable frame, just + # like the targets and packages pages. + scrollbar $win.scrollbar -command "$win.viewport yview" -orient vertical + pack $win.scrollbar -side right -fill y + + canvas $win.viewport -height 10m -yscrollcommand "$win.scrollbar set" + pack $win.viewport -fill both -expand 1 -padx 20 -pady 20 + + frame $win.viewport.form + $win.viewport create window 0 0 -anchor nw -window $win.viewport.form + + bind $win.viewport.form "pkgconf::nbpage_form_resized $win" + + # Now fill in the form with all the buttons. + set form $win.viewport.form + set row 0 + + foreach file $files { + + button $form.button-$row -text "" -anchor w \ + -command [list pkgconf::nbpage_options_edit $file] + grid $form.button-$row -row $row -column 0 -sticky we -padx 10 -pady 5 + label $form.label-$row -anchor w -text "Edit [file join $build_tree pkgconf $file]" + grid $form.label-$row -row $row -column 1 -sticky w + + efftcl::balloonhelp_for $form.button-$row "Edit this configuration file." + lappend options_page_data(buttons) $form.button-$row + if { $editor == "" } { + $form.button-$row configure -state disabled + } + incr row + } +} + +# The options page needs to be redrawn every time the build tree is +# regenerated, since this may result in a different set of editable +# configuration header files. + +proc pkgconf::nbpage_options_enter { win } { + + variable options_page_needs_refresh + + if { $options_page_needs_refresh != 0 } { + set options_page_needs_refresh 0 + foreach subwin [winfo children $win] { destroy $subwin } + nbpage_options_initialise $win + } + + # It is also desirable to display some warnings. + variable config_data + variable build_tree_needs_update + variable editor + variable options_page_data + + set options_page_data(no_editor) 0 + + if { ($config_data(target) == "") || ($config_data(platform) == "") || ($config_data(startup) == "") } { + set_status_line "The target hardware has not yet been selected." + } elseif { $build_tree_needs_update } { + set_status_line "The build tree needs updating." + } elseif { $editor == "" } { + set options_page_data(no_editor) 1 + set_status_line "No text editor has been defined yet." + } else { + clear_status_line + } +} + +# +# There are no obvious actions to be taken if the user switches to +# a different tab. Even if the user has invoked the editor on a +# configuration file there is no guarantee that anything has actually +# changed. +proc pkgconf::nbpage_options_leave { win } { +} + +# +# This procedure allows the user to select a text editor. It gets invoked +# from the browse button. +# +# NOTE: on windows it might be desirable to specify a .exe extension as +# the type, but even that is optional under NT. +# +proc pkgconf::nbpage_options_browse { } { + + variable editor + variable build_tree + variable toplevel + + set filename [tk_getOpenFile -initialdir $build_tree -parent $toplevel -title "Select text editor"] + if { $filename == "" } { + return + } + set editor $filename +} + +# +# This procedure is invoked whenever the editor variable is changed. +# Its purpose is to enable or disable the buttons for the various +# configuration headers. +# +# The code does not actually check whether the current editor value corresponds +# to a valid executable. It is just about possible to check for an existing +# file somewhere in the path, but that is expensive and there is still no +# guarantee that the file is a valid executable. +# + +proc pkgconf::nbpage_options_editor_changed { name1 name2 mode } { + + variable editor + variable options_page_data + variable toplevel + + if { $editor == "" } { + + foreach button $options_page_data(buttons) { + $button configure -state disabled + } + } else { + if { $options_page_data(no_editor) } { + $toplevel.message configure -text "" + set options_page_data(no_editor) 0 + } + foreach button $options_page_data(buttons) { + $button configure -state normal + } + } +} + +# This routine gets invoked to edit a header file. It simply +# executes the current editor in the background. No attempt is +# made to wait for command completion, to prevent a single file +# from being edited multiple times, or anything like that. + +proc pkgconf::nbpage_options_edit { filename } { + + variable editor + variable build_tree + + run_command pkgconf::nbpage_options_ignore $editor [file join $build_tree pkgconf $filename] +} + +# This callback gets invoked from the run_command code whenever the +# editor sends output. In the case of emacsclient such output +# is the unfortunate string "Waiting for Emacs...Done". In the case +# of xterm -e vi there is no output. +# +# On the whole it is better to ignore the output. This may mean +# that warning or error messages get discared. + +proc pkgconf::nbpage_options_ignore { msg } { + +} + +# }}} +# {{{ Flags page + +# ---------------------------------------------------------------------------- +# The flags page. This consists of a big grid, arranged vertically into +# five separate categories of flags. Within each category there is a +# label identifying the category and four separate entry fields for the +# various variables. +# +# The data for a given flag can come from two sources. The default value +# comes from the targets file, and in most cases this will be an empty +# string. Alternatively the user can overwrite it, e.g. as a command +# line argument or in the GUI, in which case the changed information +# gets saved in the pkgconf save file. +# + +proc pkgconf::nbpage_flags_initialise { win } { + + variable flags_page_data + variable known_compiler_flags + variable config_data + + # Start by creating array entries for all the known compiler flags. + if { ($config_data(target) != "") && ($config_data(platform) != "") } { + foreach flag $known_compiler_flags { + set flags_page_data($flag) [get_platform_cflags $config_data(target) $config_data(platform) $flag] + } + } else { + foreach flag $known_compiler_flags { + set flags_page_data($flag) "" + } + } + + # If the current configuration information contains any compiler flags, + # update the appropriate variable. + foreach flag $known_compiler_flags { + if { [info exists config_data(cflags,$flag)] } { + set flags_page_data($flag) $config_data(cflags,$flag) + } + } + + # Keep track of which target and platform the current settings correspond to. + set flags_page_data(target) $config_data(target) + set flags_page_data(platform) $config_data(platform) + + # Time to actually create the interface. + # Again this tab uses a frame inside a scrolled canvas. + scrollbar $win.scrollbar -command "$win.viewport yview" -orient vertical + pack $win.scrollbar -side right -fill y + + canvas $win.viewport -height 10m -yscrollcommand "$win.scrollbar set" + pack $win.viewport -fill both -expand 1 -padx 20 -pady 20 + + frame $win.viewport.form + $win.viewport create window 0 0 -anchor nw -window $win.viewport.form + + bind $win.viewport.form "pkgconf::nbpage_form_resized $win" + + # Now fill in the form with details of all the flags. + # These are arranged in a simple grid. + set form $win.viewport.form + set row 0 + + grid columnconfigure $form 1 -weight 1 + label $form.archflags -text "Architecture-related compiler flags" + grid $form.archflags -row $row -column 0 -columnspan 2 -sticky w + incr row + foreach flag { ARCHFLAGS CARCHFLAGS CXXARCHFLAGS LDARCHFLAGS } { + label $form.label-$flag -text $flag + grid $form.label-$flag -row $row -column 0 -sticky w + entry $form.entry-$flag -textvariable pkgconf::flags_page_data($flag) -width 60 + grid $form.entry-$flag -row $row -column 1 -sticky we + incr row + } + + label $form.errflags -text "Warnings and errors" + grid $form.errflags -row $row -column 0 -columnspan 2 -sticky w + incr row + foreach flag { ERRFLAGS CERRFLAGS CXXERRFLAGS LDERRFLAGS } { + label $form.label-$flag -text $flag + grid $form.label-$flag -row $row -column 0 -sticky w + entry $form.entry-$flag -textvariable pkgconf::flags_page_data($flag) + grid $form.entry-$flag -row $row -column 1 -sticky we + incr row + } + + label $form.dbgflags -text "Debugging and optimization levels" + grid $form.dbgflags -row $row -column 0 -columnspan 2 -sticky w + incr row + foreach flag { DBGFLAGS CDBGFLAGS CXXDBGFLAGS LDDBGFLAGS } { + label $form.label-$flag -text $flag + grid $form.label-$flag -row $row -column 0 -sticky w + entry $form.entry-$flag -textvariable pkgconf::flags_page_data($flag) + grid $form.entry-$flag -row $row -column 1 -sticky we + incr row + } + + label $form.langflags -text "Language-related flags" + grid $form.langflags -row $row -column 0 -columnspan 2 -sticky w + incr row + foreach flag { LANGFLAGS CLANGFLAGS CXXLANGFLAGS LDLANGFLAGS } { + label $form.label-$flag -text $flag + grid $form.label-$flag -row $row -column 0 -sticky w + entry $form.entry-$flag -textvariable pkgconf::flags_page_data($flag) + grid $form.entry-$flag -row $row -column 1 -sticky we + incr row + } + + label $form.extraflags -text "Miscellaneous" + grid $form.extraflags -row $row -column 0 -columnspan 2 -sticky w + incr row + foreach flag { EXTRAFLAGS CEXTRAFLAGS CXXEXTRAFLAGS LDEXTRAFLAGS } { + label $form.label-$flag -text $flag + grid $form.label-$flag -row $row -column 0 -sticky w + entry $form.entry-$flag -textvariable pkgconf::flags_page_data($flag) + grid $form.entry-$flag -row $row -column 1 -sticky we + incr row + } +} + +# +# There is nothing to be done on entry to this tab. If the target architecture +# has changed then there will have been a separate call to update_compiler_flags +# below. This cannot be delayed until the enter call because there is no +# guarantee that the user will switch to the flags tab after changing target +# architecture. +# +proc pkgconf::nbpage_flags_enter { win } { +} + +# +# On leaving the page it is necessary to check for any flags that are +# different from the default settings, and update the config_data +# settings appropriately. +# +proc pkgconf::nbpage_flags_leave { win } { + + variable config_data + variable flags_page_data + variable known_compiler_flags + + if { ($config_data(target) == "") && ($config_data(platform) == "") } { + + # If no target has been defined then it is not possible to compare + # with the default setting. All that can be done is set or clear + # the current config setting. + foreach flag $known_compiler_flags { + if { $flags_page_data($flag) == "" } { + if { [info exists config_data(cflags,$flag) ] } { + unset config_data(cflags,$flag) + } + } else { + set config_data(cflags,$flag) $flags_page_data($flag) + } + } + } else { + + # For any flag which currently has default settings, + # clear the appropriate config_data() entry. Otherwise store + # the flag data. + foreach flag $known_compiler_flags { + + if { $flags_page_data($flag) == [get_platform_cflags $config_data(target) $config_data(platform) $flag] } { + if { [info exists config_data(cflags,$flag) ] } { + unset config_data(cflags,$flag) + } + } else { + set config_data(cflags,$flag) $flags_page_data($flag) + } + } + } +} + +# +# When the target architecture changes it is necessary to update the compiler +# flags appropriately. Basically any flag that was defined by the old target +# has to be cleared, and then any flag defined for the new target has to be +# installed. There is a risk that some user changes will be lost, but there +# is no easy solution to this. +# +proc pkgconf::update_compiler_flags { } { + + variable config_data + variable flags_page_data + variable known_compiler_flags + + foreach flag $known_compiler_flags { + + if { ($flags_page_data(target) == "") || ($flags_page_data(platform) == "") } { + set old_default_flag "" + } else { + set old_default_flag [get_platform_cflags $flags_page_data(target) $flags_page_data(platform) $flag] + } + set new_default_flag [get_platform_cflags $config_data(target) $config_data(platform) $flag] + + # If there is no change to the default flags leave things well alone. + # That way user changes will not get overwritten. + if { $old_default_flag == $new_default_flag } { + continue + } + + # Otherwise always install the new settings, which may mean eliminating + # user changes. + set flags_page_data($flag) $new_default_flag + if { [info exists config_data(cflags,$flag)] } { + unset config_data(cflags,$flag) + } + } + + set flags_page_data(target) $config_data(target) + set flags_page_data(platform) $config_data(platform) +} + +# }}} +# {{{ Build page + +# ---------------------------------------------------------------------------- +# The build page. This consists of the following buttons, gridded, +# with explanatory text. +# +# 1) Update build tree +# 2) Make +# 3) Make tests +# 4) Make clean +# +# The make buttons should be disabled if the build tree is out of date. +# This is controlled by the variable build_tree_needs_update, which +# may have got set during the options page creation. An additional +# check that needs to be made here is whether or not the makefile +# exists. If the current config data does not specify the target +# then even the "Update tree" button must be disabled. +# +# Whenever a make is in progress all the buttons should be disabled. +# + +proc pkgconf::nbpage_build_initialise { win } { + + # Update the variable build_tree_needs_update if there is no + # makefile in the build tree. + variable build_tree_needs_update + variable component_repository + variable build_tree + variable config_data + + if { [file isfile [file join $build_tree makefile]] == 0 } { + set build_tree_needs_update 1 + } + if { ($config_data(target) == "") || ($config_data(platform) == "") || ($config_data(startup) == "") } { + set build_tree_needs_update 1 + } + + # Create three labels identifying the various trees. + frame $win.top + label $win.top.source_label -anchor w -text "Component repository:" + label $win.top.source_value -anchor w -text "$component_repository" + label $win.top.build_label -anchor w -text "Current build tree:" + label $win.top.build_value -anchor w -text "$build_tree" + label $win.top.install_label -anchor w -text "Current install tree:" + label $win.top.install_value -anchor w -text "$config_data(prefix)" + grid $win.top.source_label -row 0 -column 0 -sticky w + grid $win.top.source_value -row 0 -column 1 -sticky we + grid $win.top.build_label -row 1 -column 0 -sticky w + grid $win.top.build_value -row 1 -column 1 -sticky we + grid $win.top.install_label -row 2 -column 0 -sticky w + grid $win.top.install_value -row 2 -column 1 -sticky we + grid columnconfigure $win.top 1 -weight 1 + pack $win.top -side top -fill x -padx 5 -pady 5 + + # Create a grid with the four buttons and with explanatory + # messages. + frame $win.grid + pack $win.grid -fill both -expand 1 + set win $win.grid + + button $win.tree -text "Update tree" -command pkgconf::nbpage_build_update_tree + button $win.make -text "Make" -command pkgconf::nbpage_build_make + button $win.tests -text "Make tests" -command pkgconf::nbpage_build_tests + button $win.clean -text "Make clean" -command pkgconf::nbpage_build_clean + + if { ($config_data(target) == "" ) || ($config_data(platform) == "") || ($config_data(startup) == "") } { + $win.tree configure -state disabled + } + if { $build_tree_needs_update } { + $win.make configure -state disabled + $win.tests configure -state disabled + $win.clean configure -state disabled + } + grid $win.tree -row 0 -column 0 -sticky we -padx 5 -pady 5 + grid $win.make -row 1 -column 0 -sticky we -padx 5 -pady 5 + grid $win.tests -row 2 -column 0 -sticky we -padx 5 -pady 5 + grid $win.clean -row 3 -column 0 -sticky we -padx 5 -pady 5 + + message $win.treemsg -anchor w -justify left -width 300 -text \ + "Create or update the build and install trees." + message $win.makemsg -anchor w -justify left -width 300 -text \ + "Build the current configuration, leaving libraries and header files in the install tree." + message $win.testsmsg -anchor w -justify left -width 300 -text \ + "Build the test executables for the current configuration. These executables will be\ + placed in the install tree." + message $win.cleanmsg -anchor w -justify left -width 300 -text \ + "Perform a clean-up operation in the build and install trees." + grid $win.treemsg -row 0 -column 1 -sticky we + grid $win.makemsg -row 1 -column 1 -sticky we + grid $win.testsmsg -row 2 -column 1 -sticky we + grid $win.cleanmsg -row 3 -column 1 -sticky we + grid columnconfigure $win 1 -weight 1 +} + +# The build page needs refreshing every time that the user changes the +# target or one of the packages. The important question is whether or +# not the build tree needs to be updated before any builds can take place. +# Of course the build tree can only be generated if the target architecture +# is known. + +proc pkgconf::nbpage_build_enter { win } { + + variable build_tree_needs_update + variable build_frame + variable toplevel + + if { $build_tree_needs_update } { + $build_frame.grid.make configure -state disabled + $build_frame.grid.tests configure -state disabled + $build_frame.grid.clean configure -state disabled + + set_status_line "The build tree must be updated before this configuration can be built." + } else { + clear_status_line + } + + variable config_data + if { ($config_data(target) == "") || ($config_data(platform) == "") || ($config_data(startup) == "") } { + $build_frame.grid.tree configure -state disabled + set_status_line "The target hardware has not yet been selected." + } else { + $build_frame.grid.tree configure -state normal + } +} + +# +# There are no actual settings that can be changed in this tab, +# so no updates are required. +# +proc pkgconf::nbpage_build_leave { win } { +} + +# +# This callback function is invoked during the various makes. +# If it is passed an empty string then the command has finished and +# all the buttons can be reenabled. Otherwise it is necessary to send +# some text to the output window. + +proc pkgconf::nbpage_build_handle_output { mesg } { + + if { $mesg == "" } { + output_add_text "Build has finished.\n" + nbpage_build_control_buttons 1 + } else { + output_add_text "$mesg\n" + } +} + + +# This utility is used to control all the buttons in the build frame. +proc pkgconf::nbpage_build_control_buttons { on } { + + variable build_frame + set buttons [grid slaves $build_frame.grid -column 0] + foreach button $buttons { + if { $on } { + $button configure -state normal + } else { + $button configure -state disabled + } + } +} + +# +# These functions get invoked for the buttons in the build page. +# +proc pkgconf::nbpage_build_update_tree { } { + + variable toplevel + variable options_page_needs_refresh + variable build_tree_needs_update + + nbpage_build_control_buttons 0 + produce_build_tree + nbpage_build_control_buttons 1 + $toplevel.message configure -text "" + set options_page_needs_refresh 1 + set build_tree_needs_update 0 +} + +proc pkgconf::nbpage_build_make { } { + + variable build_tree + variable config_data + + nbpage_build_control_buttons 0 + output_add_text "Building current configuration.\nBuild tree is $build_tree.\nInstall tree is $config_data(prefix)\n" + run_command pkgconf::nbpage_build_handle_output make -C $build_tree +} + +proc pkgconf::nbpage_build_tests { } { + + variable build_tree + variable config_data + nbpage_build_control_buttons 0 + output_add_text \ + "Building test executables.\nBuild tree is $build_tree\nInstall tree is $config_data(prefix)\n" + run_command pkgconf::nbpage_build_handle_output make -C $build_tree tests +} + +proc pkgconf::nbpage_build_clean { } { + + variable build_tree + nbpage_build_control_buttons 0 + output_add_text "Cleaning build tree $build_tree.\n" + run_command pkgconf::nbpage_build_handle_output make -C $build_tree clean +} + +# }}} + +# }}} +# {{{ Output window + +# ---------------------------------------------------------------------------- +# These routines take care of the output window. There are two variables +# describing the current state of the window: output_docked and +# output_visible. There are four commands which can be invoked from +# buttons, and a further command which can be invoked from the windows +# menu. There is also a routine which can be used to add text to +# the current output window, making it visible if necessary. +# +# The packing of the main .pkgconf window has to be redone every time +# the output window is displayed or hidden, if the output window is +# currently docked. To avoid duplicating code there are auxiliary +# routine output_make_visible and output_make_invisible. +# + +# This routine is invoked from the View menu. Its purpose is to +# hide or display the output window, depending on the value of +# output_visible. Note that output_visible indicates the desired +# state of affairs, not the actual state of affairs. +# +proc pkgconf::output_menu { } { + + variable output_visible + + if { $output_visible == 0 } { + output_make_invisible + } else { + output_make_visible + } +} + +proc pkgconf::output_make_visible { } { + + variable output_docked + variable toplevel + + if { $output_docked == 0 } { + # The output is in a separate window. Deiconifying it should make + # it visible. + wm deiconify .pkgconf_output + } else { + # It is necessary to repack the main window. This time it is the + # output frame that should expand. + pack forget $toplevel.notebook $toplevel.message + pack $toplevel.notebook -side top -fill x + pack $toplevel.message -side top -fill x + pack $toplevel.output -side top -fill both -expand 1 + } +} + +proc pkgconf::output_make_invisible { } { + + variable output_docked + variable toplevel + + if { $output_docked == 0 } { + # The output is in a separate window, just withdraw it. + wm withdraw .pkgconf_output + } else { + # It is necessary to repack the .pkgconf window without + # the output window. This time it is the notebook which + # should expand to fit all available space. + pack forget $toplevel.notebook $toplevel.message $toplevel.output + pack $toplevel.notebook -side top -fill both -expand 1 + pack $toplevel.message -side top -fill x + } +} + +# +# This routine is invoked when the output window is already visible +# and the user has pressed the button in that window to make it +# invisible. +# +proc pkgconf::output_hide_window { } { + + variable output_visible + variable toplevel + ASSERT { $output_visible != 0 } + + output_make_invisible + set output_visible 0 +} + +# +# Switch between a docked and an undocked window. The window must +# currently be visible. Any text must be copied across from +# one widget to the other. +# +proc pkgconf::output_undock_window { } { + + variable output_visible + variable output_docked + variable toplevel + + ASSERT { $output_visible != 0 } + + output_make_invisible + + $toplevel.output.text configure -state normal + .pkgconf_output.text configure -state normal + + if { $output_docked == 0 } { + $toplevel.output.text insert end [.pkgconf_output.text get 1.0 "end - 1 chars"] + .pkgconf_output.text delete 1.0 end + set output_docked 1 + } else { + .pkgconf_output.text insert end [$toplevel.output.text get 1.0 "end - 1 chars"] + $toplevel.output.text delete 1.0 end + set output_docked 0 + } + + $toplevel.output.text configure -state disabled + .pkgconf_output.text configure -state disabled + + output_make_visible +} + +# +# Clear the text window, which should currently be visible. +# +proc pkgconf::output_clear_window { } { + + variable output_visible + variable output_docked + variable toplevel + + ASSERT { $output_visible != 0 } + if { $output_docked == 0 } { + .pkgconf_output.text configure -state normal + .pkgconf_output.text delete 1.0 end + .pkgconf_output.text configure -state disabled + } else { + $toplevel.output.text configure -state normal + $toplevel.output.text delete 1.0 end + $toplevel.output.text configure -state disabled + } +} + +# +# Save the current contents of the text window to a file. +# +proc pkgconf::output_save { } { + + variable build_tree + variable output_docked + variable toplevel + + set filename [tk_getSaveFile -initialdir $build_tree -initialfile pkgconf.log \ + -parent [expr { $output_docked ? "$toplevel" : ".pkgconf_output" } ] ] + + if { $filename == "" } { + return + } + + if { [catch { + set file [open $filename w] + if { $output_docked == 0 } { + puts $file [.pkgconf_output.text get 1.0 "end - 1 chars"] + } else { + puts $file [$toplevel.output.text get 1.0 "end - 1 chars"] + } + close $file + } message] != 0 } { + warning "Failed to save build output to $filename: $message" + } +} + +# +# Output some text. This gets invoked mainly during builds, but also +# by the report() function when generating a build tree. It is +# necessary to make sure that the text widget is visible. +# +proc pkgconf::output_add_text { msg } { + + variable output_visible + variable output_docked + variable toplevel + + if { $output_visible == 0 } { + output_make_visible + set output_visible 1 + } + + if { $output_docked == 0 } { + .pkgconf_output.text configure -state normal + .pkgconf_output.text insert end $msg + .pkgconf_output.text configure -state disabled + .pkgconf_output.text see end + } else { + $toplevel.output.text configure -state normal + $toplevel.output.text insert end $msg + $toplevel.output.text configure -state disabled + $toplevel.output.text see end + } +} + +# }}} +# {{{ Status line + +# ---------------------------------------------------------------------------- +# Some utility routines to update the status line. + +proc pkgconf::set_status_line { text } { + variable toplevel + $toplevel.message configure -text $text +} + +proc pkgconf::clear_status_line { } { + variable toplevel + $toplevel.message configure -text "" +} + +# }}} +# {{{ Diagnostics + +# ---------------------------------------------------------------------------- +# GUI versions of the same routines. For now tk_messageBox will have +# to suffice for fatal error +# +proc pkgconf::gui_fatal_error_handler { msg } { + + variable toplevel + + if { [winfo exists $toplevel] } { + tk_messageBox -parent $toplevel -icon error -title "pkgconf: fatal error" -type ok -message $msg + } else { + tk_messageBox -icon error -title "pkgconf: fatal error" -type ok -message $msg + } + exit 1 +} + +proc pkgconf::gui_warning_handler { msg } { + + variable toplevel + + if { [winfo exists $toplevel] } { + tk_messageBox -parent $toplevel -icon error -title "pkgconf: fatal error" -type ok -message $msg + } else { + tk_messageBox -icon error -title "pkgconf: fatal error" -type ok -message $msg + } +} + +proc pkgconf::gui_report_handler { msg } { + + output_add_text "$msg\n" + update +} + +# }}} +# {{{ Executing external commands + +# ---------------------------------------------------------------------------- +# This code is responsible for executing external commands. The broken nature +# of pipes under Windows makes this somewhat more difficult than it should be. + +proc pkgconf::run_command { callback command args } { + + # Start up the specified command. Actually the main command is run such that + # both stdout and stderr are piped into cat, thus making sure that the + # stderr output is not discarded. + set result [catch { set pipe [open "|[concat $command $args] 2>@ stdout" "r"] } message] + if { $result != 0 } { + warning "Failed to execute $command: $message" + return + } + + # Now set the pipe to non-blocking, to prevent the whole GUI from + # locking up by accident. + fconfigure $pipe -blocking 0 + + # Set up an event handler to read back any output. + fileevent $pipe readable [list pkgconf::handle_command_output $pipe $callback] +} + +# +# This routine gets invoked whenever there may be data waiting on the +# pipe. +# +proc pkgconf::handle_command_output { pipe callback } { + + set data "" + set count [gets $pipe data] + if { $count > 0 } { + $callback $data + } elseif { [eof $pipe] } { + catch { close $pipe } + $callback "" + } +} + +# }}} + +# }}} +# {{{ Produce build tree + +# {{{ Description + +# ---------------------------------------------------------------------------- +# Producing the build tree. This requires the following information: +# +# 1) the location of the component repository. This should be known. +# +# 2) the location of the build tree. This should also be known. +# +# 3) full details of the target architecture. These may not have been supplied +# yet, which would result in a fatal error. +# +# 4) details of which packages are explicitly enabled or disabled. +# +# 5) details of which version of each package should be used. +# +# 6) prefix information, i.e. where the system will be installed. +# The default value "" indicates an install directory relative to the +# build tree. +# +# This routine may be called for an empty build tree, or it +# may be used to update an existing build tree. +# +# The steps that have to be taken are as follows: +# +# 1) create a pkgconf directory, which is where all the editable +# header files will end up. A few other files will end up there +# as well. +# +# 2) examine all packages, including the hal packages. For each package: +# +# a) if there is a src directory in the component repository, reproduce +# this in the build tree. If this src directory has any +# sub-directories, these have to be created as well. +# +# The src directory should contain a file PKGconf.mak. This has to be +# copied across as makefile. There may also be PKGconf.mak files in +# subdirectories which should also get copied across. Typically the +# latter will be for internal development purposes. +# +# b) if there is an include directory in the component repository, +# make a matching directory in the build tree. Ditto for any +# subdirectories other than pkgconf. +# +# The purpose of this include directory is to allow users to make +# editable copies of the header files in the build tree. A makefile +# is generated in this directory which will take care of updating the +# header files that actually get used for building, i.e. those in the +# include directory. The header files are not actually copied across +# at this point, that will happen during the first make. +# +# The pkgconf directory is handled differently. Every file in +# pkgconf is copied across to the build tree's pkgconf directory, +# unless there is already a matching file in the build tree. +# This avoids overwriting edits made by the user in the build +# tree. The disadvantage is that if the version in the component +# repository is edited it will have to be copied by hand, or the +# -force command line argument will have to be used. +# +# c) if there is a tests directory in the component repository, make +# a matching directory in the build tree and copy +# across PKGconf.mak. If this tests directory has any subdirectories +# then these must be created as well. +# +# 3) create the install directory tree, complete with lib, include, and tests +# directories, and the include/pkgconf sub-directory. Additional +# sub-directories within include need not be generated at this point, +# that happens as such sub-directories are encountered within the +# component repository. +# +# 4) copy across the makevars file. +# +# 5) generate the files specific to this configuration. +# +# Note that subdirectories corresponding to old packages are not +# deleted, they simply get ignored. Arguably this should change, +# but then you run the risk of deleting user changes in a package +# that has been disabled only temporarily. +# + +# }}} +# {{{ Check requirements + +# ---------------------------------------------------------------------------- +# It is not possible to generate a build tree unless certain requirements +# are satisfied. Most of these will have been checked elsewhere. +# +proc pkgconf::check_requirements { } { + + ASSERT { $pkgconf::build_tree != "" } + ASSERT { $pkgconf::component_repository != "" } + + if { $pkgconf::component_repository == $pkgconf::build_tree } { + report "Builds of eCos cannot happen in the same directory as the sources." + report "Currently your build tree is $pkgconf::build_tree." + report "This is the same directory as your component repository." + fatal_error "Unable to proceed with builds in this directory." + } + + if { $pkgconf::config_data(target) == "" } { + fatal_error "No target architecture has been specified." + } + if { $pkgconf::config_data(platform) == "" } { + fatal_error "No target platform has been specified." + } + if { $pkgconf::config_data(startup) == "" } { + fatal_error "No target startup mechanism has been specified." + } +} + +# }}} +# {{{ Directory and file utilities + +# ---------------------------------------------------------------------------- +# Start with a number of utility routines to access all files in +# a directory, stripping out well-known files such as makefile.am. +# The routines take an optional pattern argument if only certain +# files are of interest. +# +# Note that symbolic links are returned as well as files. +# +proc pkgconf::locate_files { dir { pattern "*"} } { + + ASSERT { $dir != "" } + + # Start by getting a list of all the files. + set filelist [glob -nocomplain -- [file join $dir $pattern]] + + # Eliminate the pathnames from all of these files + set filenames "" + foreach file $filelist { + lappend filenames [file tail $file] + } + + # Eliminate any obviously spurious entries. + foreach file { CVS Makefile.am Makefile.in makefile acinclude.m4 aclocal.m4 configure.in configure } { + set index [lsearch -exact $filenames $file] + if { $index != -1 } { + set filenames [lreplace $filenames $index $index] + } + } + + # Eliminate any subdirectories. + set subdirs "" + foreach name $filenames { + if { [file isdir [file join $dir $name]] } { + lappend subdirs $name + } + } + foreach subdir $subdirs { + set index [lsearch -exact $filenames $subdir] + set filenames [lreplace $filenames $index $index] + } + + return $filenames +} + +# +# This utility returns all sub-directories, as opposed to all files. +# A variant glob pattern is used here. This version is not recursive. +proc pkgconf::locate_subdirs { dir { pattern "*" }} { + + ASSERT { $dir != "" } + + set dirlist [glob -nocomplain -- [file join $dir $pattern "."]] + + # Eliminate the pathnames and the spurious /. at the end of each entry + set dirnames "" + foreach dir $dirlist { + lappend dirnames [file tail [file dirname $dir]] + } + + # Get rid of the CVS directory, if any + set index [lsearch -exact $dirnames "CVS"] + if { $index != -1 } { + set dirnames [lreplace $dirnames $index $index] + } + + # That should be it. + return $dirnames +} + +# +# A variant which is recursive. This one does not support a pattern. +# +proc pkgconf::locate_all_subdirs { dir } { + + ASSERT { $dir != "" } + + set result "" + foreach subdir [locate_subdirs $dir] { + lappend result $subdir + foreach x [locate_all_subdirs [file join $dir $subdir]] { + lappend result [file join $subdir $x] + } + } + return $result +} + +# +# This routine returns a list of all the files in a given directory and in +# all subdirectories, preserving the subdirectory name. +# +proc pkgconf::locate_all_files { dir { pattern "*" } } { + + ASSERT { $dir != "" } + + set files [locate_files $dir $pattern] + set subdirs [locate_subdirs $dir] + + foreach subdir $subdirs { + set subfiles [locate_all_files [file join $dir $subdir] $pattern] + foreach file $subfiles { + lappend files [file join $subdir $file] + } + } + + return $files +} + +# +# Sometimes a directory may be empty, or contain just a CVS subdirectory, +# in which case there is no point in copying it across. +# +proc pkgconf::is_empty_directory { dir } { + + ASSERT { $dir != "" } + + set contents [glob -nocomplain -- [file join $dir "*"]] + if { [llength $contents] == 0 } { + return 1 + } + if { ([llength $contents] == 1) && [string match {*CVS} $contents] } { + return 1 + } + return 0 +} + +# ---------------------------------------------------------------------------- +# Given a pathname such as kernel/current/include, this routine returns +# a string which points at the build tree's pkgconf directory +# complete with the appropriate number of ..'s in the pathname +# +proc pkgconf::get_dotdots_pkgconf { dir } { + + set result ".." + + while { 1} { + set dir [file dirname $dir] + if { ($dir == ".") || ($dir == ":") } { + break + } + set result [file join $result ".."] + } + + set result [file join $result "pkgconf"] + return $result +} + +# ---------------------------------------------------------------------------- +# Internally this script works using native path names. When outputting the +# makefile information it is necessary to output the paths in a format that +# is understood by GnuMake. +# +proc pkgconf::get_pathname_for_make { dir } { + + # First of all, handle directory separators. Under Unix this is a no-op. + # Under Windows the current directory separator may be \ instead of /. + # It is not entirely clear under what circumstances Tcl's "file nativename" + # facility uses / vs. \, but converting all existing backslashes to + # forward slashes should be harmless. + if { $pkgconf::windows_host != 0 } { + regsub -all -- {\\} $dir "/" dir + } + + # Next cope with spaces in pathnames. GnuMake does not always cope + # sensibly with these, even if backslash quoting is used - there + # are known problems with VPATH and with the wildcard function. Under + # Unix there is no simple solution, but it is unlikely that the problem + # will arise in the first place. Under Windows it is quite likely that + # the problem will arise, but it is possible to work around it + # by using a short file name. + + set index [string first " " $dir] + if { $index != -1 } { + if { $pkgconf::windows_host != 0 } { + + # This call will only work if the specified object already exists. + # This should not be a problem, as the pathnames are likely to + # be relative to the component repository, the build tree, or the + # install tree. The component repository must already exist. The + # build tree must already exist, since this call will only be + # invoked when generating makefiles inside the build tree. The + # install tree will have been created before pkgconf/pkgconf.mak + # is written out, and that is the only place that needs to refer + # to it. + + set dir [file attribute $dir -shortname] + } else { + fatal_error "Cannot cope with pathname \"$pathname\".\nPathnames with spaces are not supported on this platform." + } + } + + # Other characters that have special meaning include: []*?()$^|&#<>"'`; + # At least, that is the list used within vmake. $ has to be quoted as $$, + # the others should be quoted with a single backslash. + regsub -all -- {\$} $dir {$$} dir + foreach char { {\[} {\]} {\*} {\?} {\(} {\)} {\^} {\|} {\&} {\#} {\<} {\>} {\"} {\'} {\`} {\;} } { + regsub -all -- $char $dir "\\$char" dir + } + + # Now cope with Windows drive names. + # + # First, volume-relative filenames. If the directory string begins with + # c:xxx, as opposed to c:/xxx, it is necessary to figure out what the + # current directory is on drive c: and use this as prefix for the rest + # of the string. + # + # Once volume-relative filenames have been handled the directory may be + # along the lines of c:/Cygnus/eCos/whatever. This is problematical for + # GnuMake since the colon character has special meaning in various places, + # e.g. to identify static pattern rules. cygwin32 uses //c/ as an alias + # for c:/ wherever appropriate. + if { $pkgconf::windows_host != 0 } { + + set dummy "" + set match1 "" + set match2 "" + set match3 "" + + if { [regexp -- {^([a-zA-Z]:)(/)?(.*)} $dir dummy match1 match2 match3] == 1 } { + if { $match2 == "" } { + set result [catch { + set current_dir [pwd] + cd $match1 + set dir [pwd] + regsub -all -- {\\} $dir "/" dir + set dir [file join $dir $match3] + cd $current_dir + } message] + if { $result != 0 } { + fatal_error "Failed to determine current directory on drive $match1" + } + } + } + + if { [regexp -- {^([a-zA-Z]):} $dir dummy match1] == 1 } { + set dir "//$match1[string range $dir 2 end]" + } + } + + return $dir +} + +# ---------------------------------------------------------------------------- +# Take a cygwin32 filename such as //d/tmp/pkgobj and turn it into something +# acceptable to Tcl, i.e. d:/tmp/pkgobj. There are a few other complications... + +proc pkgconf::get_pathname_for_tcl { name } { + + if { $pkgconf::windows_host } { + set dummy "" + set match1 "" + set match2 "" + + # If the pathname is relative to ~, expand it now. + if { [regexp -- {^~(.*)$} $name dummy match1] } { + set name [file nativename $name] + } + + # For consistency, get rid of any backslashes in the pathname. + # Especially since the file nativename command above may have + # introduced some. + regsub -all -- {\\} $name "/" name + + # And now replace //d/tmp/pkgobj with d:/tmp/pkgobj + if { [regexp -- {^//([a-zA-Z])(/.*)$} $name dummy match1 match2] == 1 } { + set name "$match1:$match2" + } + + # If the pathname is relative to the cygwin root, get hold of the + # drive name. + if { ([regexp -- {^/(.*)$} $name dummy match1] == 1) && ([regexp -- {^//.*$} $name dummy] == 0) } { + set saved_dir [pwd] + cd / + set name [file join [pwd] $match1] + cd $saved_dir + } + } + return $name +} + +# ---------------------------------------------------------------------------- +# Output a standard banner to a generated file. +# + +proc pkgconf::output_banner { file name } { + + puts $file \ +"# +# File $name +# +# This file is generated automatically by the pkgconf program. +# It should not be edited. Any changes made to this file may +# be overwritten by pkgconf. +#" +} + +# ---------------------------------------------------------------------------- +# Make sure that a newly created or copied file is writable. This operation +# is platform-specific. Under Unix at most the current user is given +# permission, since there does not seem to be any easy way to get hold +# of the real umask. + +proc pkgconf::make_writable { name } { + + ASSERT { $name != "" } + ASSERT { [file isfile $name] } + + if { [file writable $name] == 0 } { + if { $pkgconf::windows_host != 0 } { + file attributes $name -readonly 0 + } else { + set mask [file attributes $name -permissions] + set mask [expr $mask | 0200] + file attributes $name -permissions $mask + } + } +} + +# }}} +# {{{ Other utilities + +# ---------------------------------------------------------------------------- +# This code works out what packages should go into the current configuration. +# The rules are as follows: +# +# 1) all hardware-specific packages should be disabled, unless they are +# mentioned explicitly in the targets file for the current target or +# platform, or unless they are enabled explicitly by the user. +# +# 2) all other packages which are enabled by default should be included, +# unless they are disabled explicitly by the user. +# +# 3) all non-hardware packages which are disabled by default should be +# left out, unless they are enabled explicitly by the user. + +proc pkgconf::get_current_packages { } { + + ASSERT { $pkgconf::config_data(target) != "" } + ASSERT { $pkgconf::config_data(platform) != "" } + ASSERT { [info exists pkgconf::target_data($pkgconf::config_data(target),packages)] } + ASSERT { [info exists pkgconf::target_data($pkgconf::config_data(target),$pkgconf::config_data(platform),packages)] } + ASSERT { [info exists pkgconf::config_data(enabled_packages)] } + ASSERT { [info exists pkgconf::config_data(disabled_packages)] } + + set result "" + set target_packages $pkgconf::target_data($pkgconf::config_data(target),packages) + set platform_packages $pkgconf::target_data($pkgconf::config_data(target),$pkgconf::config_data(platform),packages) + set enabled_packages $pkgconf::config_data(enabled_packages) + set disabled_packages $pkgconf::config_data(disabled_packages) + + foreach pkg $pkgconf::known_packages { + + ASSERT { [info exists pkgconf::package_data($pkg,hardware)] } + + if { $pkgconf::package_data($pkg,hardware) } { + + if { [lsearch -exact $disabled_packages $pkg] != -1 } { + continue + } elseif { [lsearch -exact $target_packages $pkg] != -1 } { + lappend result $pkg + } elseif { [lsearch -exact $platform_packages $pkg] != -1 } { + lappend result $pkg + } elseif { [lsearch -exact $enabled_packages $pkg] != -1 } { + lappend result $pkg + } + + } elseif { $pkgconf::package_data($pkg,default) != 0 } { + if { [lsearch -exact $disabled_packages $pkg] == -1 } { + lappend result $pkg + } + } else { + if { [lsearch -exact $enabled_packages $pkg] != -1 } { + lappend result $pkg + } + } + } + + return $result +} + +# ---------------------------------------------------------------------------- +# A utility to determine whether or not a particular setting has changed relative to +# what is currently in the build tree. Information about the latter comes from +# the save file, but may not exist the first time that the build tree is generated. +# The config_data array itself may be sparsely populated, especially when it comes +# to compiler flags. + +proc pkgconf::value_has_changed { name } { + + ASSERT {$name != ""} + + if { [info exists pkgconf::config_data($name)] == 0 } { + + if { [info exists pkgconf::saved_data($name)] == 0 } { + return 0 + } else { + return 1 + } + + } else { + + if { [info exists pkgconf::saved_data($name)] == 0 } { + return 1 + } + if { $pkgconf::saved_data($name) != $pkgconf::config_data($name) } { + return 1 + } + return 0 + } +} + +# ---------------------------------------------------------------------------- +# Has there been a change in the packages in the system, either which packages +# are present or any of their versions ? If there has been a change in the +# packages then the amount of work that has to be done inside pkgconf is +# increased significantly. + +proc pkgconf::packages_have_changed { } { + + if { [value_has_changed "target"] || [value_has_changed "platform"] } { + return 1 + } + if { [value_has_changed "enabled_packages"] || [value_has_changed "disabled_packages"] } { + return 1 + } + foreach pkg $pkgconf::known_packages { + if { [value_has_changed "$pkg,version"] } { + return 1 + } + } + + return 0 +} + + +# ---------------------------------------------------------------------------- +# Given the name of a package, e.g. CYGPKG_KERNEL, return something which is +# more acceptable in the build tree. Creating directories and files with +# names containing lots of upper case characters is unacceptable. + +proc pkgconf::get_build_alias { name } { + + ASSERT { $name != ""} + + set index [string first "_" $name] + if { $index != -1 } { + set new_name [string range $name [incr index] end] + if { $new_name != "" } { + set name $new_name + } + } + set name [string tolower $name] + return $name +} + +# }}} +# {{{ Process a package + +# ---------------------------------------------------------------------------- +# Process an entire package. The header files, the src directory, and the +# tests directory are all handled separately. + +proc pkgconf::process_package { name dir } { + + report "Processing package $dir" + + set incdir [file join $dir "include"] + if { [file isdir [file join $pkgconf::component_repository $incdir]] } { + lappend pkgconf::inc_dirs $incdir + process_package_includes $name $incdir + } + + set srcdir [file join $dir "src"] + if { [file isdir [file join $pkgconf::component_repository $srcdir]] } { + if { [file isfile [file join $pkgconf::component_repository $srcdir PKGconf.mak]] } { + lappend pkgconf::src_dirs $srcdir + process_package_src $srcdir + } + } + + set testsdir [file join $dir "tests"] + if { [file isdir [file join $pkgconf::component_repository $testsdir]] } { + if { [file isfile [file join $pkgconf::component_repository $testsdir PKGconf.mak]] } { + lappend pkgconf::tests_dirs $testsdir + process_package_tests $name $testsdir + } + } +} + +# ---------------------------------------------------------------------------- +# Processing the header files is somewhat complicated. The include directories +# and any subdirectories except pkgconf have to be created in the build tree. +# Details of these subdirectories get stored in the variable header_subdirs. +# A pro-forma makefile has to be generated in the build tree, using details +# of all the header files. These header files must also be appended to the +# variable header_files. Any files in pkgconf have to be copied across +# to the pkgconf directory, but must not overwrite the files that are +# already there. +# +# As an additional complication, each package may define its own header +# file directory. For example a package xyz may specify that all of its +# exported header files should go into the xyz subdirectory of the install +# include tree, not at the top level. There are special cases for the HAL. +# +# Note that if there are any spurious directories already present, these +# do not get deleted. However the generated makefile will not reference +# them so it should be harmless. +# + +proc pkgconf::process_package_includes { name dir } { + + # What subdirectory in the install tree should be used ? + ASSERT { [info exists pkgconf::package_data($name,incdir)] } + set pkg_incdir $pkgconf::package_data($name,incdir) + + # Get information about the package's include directory. + set pkg_inc_dirs [locate_all_subdirs [file join $pkgconf::component_repository $dir]] + set pkg_pkgconf_files [locate_files [file join $pkgconf::component_repository $dir "pkgconf"]] + set pkg_inc_files [locate_all_files [file join $pkgconf::component_repository $dir]] + + # Remove all pkgconf headers from the all_headers list. pkgconf headers + # are handled by a separate makefile in the pkgconf directory. + foreach hdr $pkg_pkgconf_files { + set index [lsearch -exact $pkg_inc_files [file join pkgconf $hdr]] + ASSERT { $index != -1 } + set pkg_inc_files [lreplace $pkg_inc_files $index $index] + } + + # Remove all unwanted subdirectories. These include pkgconf (which is handled + # specially) and any empty subdirectories. + set tmp "" + foreach subdir $pkg_inc_dirs { + if { ($subdir == "pkgconf") } { + continue + } + if { [is_empty_directory [file join $pkgconf::component_repository $dir $subdir] ] } { + continue + } + lappend tmp $subdir + } + set pkg_inc_dirs $tmp + + # Create the include directory in the build tree, plus any subdirectories. + # This directory tree must map the structure of the source tree, so there is + # no need to worry about thispkg_incdir. + file mkdir [file join $pkgconf::build_tree $dir] + foreach subdir $pkg_inc_dirs { + file mkdir [file join $pkgconf::build_tree $dir $subdir] + } + + # Copy across the pkgconf files that are not already present. + # Also keep track of this information globally. + foreach hdr $pkg_pkgconf_files { + if { [lsearch -exact $pkgconf::pkgconf_files $hdr] != -1 } { + return -code error "Duplicate configuration header file $hdr" + } + lappend pkgconf::pkgconf_files $hdr + + set src [file join $pkgconf::component_repository $dir "pkgconf" $hdr] + set dest [file join $pkgconf::build_tree "pkgconf" $hdr] + if { (! [file isfile $dest]) || ($pkgconf::force_arg != 0) } { + file copy -force -- $src $dest + make_writable $dest + } + } + + # Keep track of all the subdirectories that should be generated + # in the install tree. Note that packages may share these + # subdirectories, e.g. the sys subdirectory will be used by + # both the C library and by a POSIX compatibily layer. + # + # It is necessary to list pkg_incdir separately, and all + # of its parent directories. Otherwise it is not possible to + # clean up the install tree correctly when packages get removed. + if { $pkg_incdir != "" } { + set current_path "" + foreach field [file split $pkg_incdir] { + set current_path [file join $current_path $field] + if { [lsearch -exact $pkgconf::install_inc_dirs $current_path] == -1 } { + lappend pkgconf::install_inc_dirs $current_path + } + } + } + foreach subdir $pkg_inc_dirs { + set dest [file join $pkg_incdir $subdir] + if { [lsearch -exact $pkgconf::install_inc_dirs $dest] == -1 } { + lappend pkgconf::install_inc_dirs $dest + } + } + + # Keep track of all header files, checking for duplicates. + foreach hdr $pkg_inc_files { + set dest [file join $pkg_incdir $hdr] + if { [lsearch -exact $pkgconf::install_inc_files $dest] != -1 } { + return -code error "Duplicate header file $dest" + } + lappend pkgconf::install_inc_files $dest + } + + # Generate the makefile in the target directory. First set up + # some variables to contain the right sort of data for a makefile. + if { $pkg_incdir == "" } { + set pkg_incdir "." + } else { + set pkg_incdir [get_pathname_for_make $pkg_incdir] + } + set tmp "" + foreach file $pkg_inc_files { + lappend tmp [get_pathname_for_make $file] + } + set pkg_inc_files $tmp + + set filename [file join $dir "makefile"] + set makefile [open [file join $pkgconf::build_tree $filename] "w"] + output_banner $makefile $filename + puts $makefile \ +" +include [get_pathname_for_make [file join [get_dotdots_pkgconf $dir] "pkgconf.mak"]] + +HEADERS := $pkg_inc_files +TARGETS := \$(foreach hdr,\$(HEADERS),\$(PREFIX)/include/$pkg_incdir/\$(hdr)) +.PHONY : build clean +VPATH := . [file join \$(COMPONENT_REPOSITORY) $dir] + +build: \$(TARGETS) + +" + foreach hdr $pkg_inc_files { + puts $makefile "\$(PREFIX)/include/$pkg_incdir/$hdr : $hdr" + if { $pkgconf::config_data(use_links) == 0 } { + puts $makefile "\t@\$(CP) \$< \$@" + } else { + puts $makefile "\t@\$(RM) \$@; ln -s \$< \$@" + } + puts $makefile "" + } + + puts $makefile "clean:" + foreach hdr $pkg_inc_files { + puts $makefile "\t@\$(RM) \$(PREFIX)/include/$pkg_incdir/$hdr" + } + puts $makefile "\n# End of $filename" + close $makefile +} + +# ---------------------------------------------------------------------------- +# Processing the src directory is relatively straightforward. It is +# necessary to create the src directory in the build tree, plus any +# subdirectories. It is also necessary to copy across the PKGconf.mak +# file from the component repository to the build tree, assuming the +# destination file does not already exist, and do the same in any +# subdirectories. +# +proc pkgconf::process_package_src { dir } { + + set srcdir [file join $pkgconf::component_repository $dir] + set destdir [file join $pkgconf::build_tree $dir] + + file mkdir $destdir + set subdirs [locate_all_subdirs $srcdir] + foreach subdir $subdirs { + if { [is_empty_directory [file join $srcdir $subdir] ] } { + continue + } + file mkdir [file join $destdir $subdir] + } + + set makefiles [locate_all_files $srcdir "PKGconf.mak"] + foreach makefile $makefiles { + set destname [file join $destdir [file dirname $makefile] "makefile"] + + if { ([file isfile $destname] == 0) || $pkgconf::force_arg } { + file copy -force -- [file join $srcdir $makefile] $destname + make_writable $destname + } + } +} + +# ---------------------------------------------------------------------------- +# Processing the tests directories is just the same as the source +# directories, for now. There is one additional complication in that +# the test executables have to get installed, so it is necessary to +# keep track of which directories are needed in the install tree. + +proc pkgconf::process_package_tests { name dir } { + + set srcdir [file join $pkgconf::component_repository $dir] + set destdir [file join $pkgconf::build_tree $dir] + + lappend pkgconf::install_test_dirs [get_build_alias $name] + + file mkdir $destdir + set subdirs [locate_all_subdirs $srcdir] + + foreach subdir $subdirs { + lappend pkgconf::install_test_dirs [file join [get_build_alias $name] $subdir] + file mkdir [file join $destdir $subdir] + } + + set makefiles [locate_all_files $srcdir "PKGconf.mak"] + foreach makefile $makefiles { + set destname [file join $destdir [file dirname $makefile] "makefile"] + if { ([file isfile $destname] == 0) || $pkgconf::force_arg } { + file copy -force -- [file join $srcdir $makefile] $destname + make_writable $destname + } + } +} + +# }}} +# {{{ Install tree + +# ---------------------------------------------------------------------------- +# These routines take care of the install tree. The routine +# produce_install_tree gets invoked after details of all the packages +# are known, and hence after details of all the subdirectories +# are known. +# +# Currently this routine will empty out the lib and tests directory +# completely. It will also get rid of any files and subdirectories in +# include which are no longer of interest. +# +# Clearing out libtarget.a and any similar libraries avoids problems +# if the target architecture has changed. Such a change should cause +# all source files to be rebuilt via a dependency on the makefile +# auxiliary files. However it would result in an attempt to create +# a library archive containing a mixture of architectures, which could +# cause all sorts of problems. To make sure that the library gets +# regenerated during the next build all the stamp files have to be +# deleted. +# +# It is not a good idea to manipulate header files unnecessarily, +# since changing these would result in application code being +# recompiled as well as system code. However if the old and new +# configurations involve a header file with the same name but coming +# from different packages, (e.g. a standard HAL header if you switch +# targets or platforms, or a package header if you change the version +# of that package) then there are complications. +# +# For now the code is draconian and just deletes everything. This +# needs to be optimised. +# + +proc pkgconf::produce_install_tree { } { + + ASSERT { $pkgconf::build_tree != "" } + + if { $pkgconf::config_data(prefix) != "" } { + set prefix $pkgconf::config_data(prefix) + } else { + set prefix [file join $pkgconf::build_tree "install"] + } + ASSERT { $prefix != "" } + + # There should be at least an include/pkgconf subdirectory + ASSERT { $pkgconf::install_inc_dirs != "" } + + # In Tcl the mkdir call is a no-op if the directory already exists. + report "Generating install directory $prefix" + file mkdir $prefix + file mkdir [file join $prefix "include"] + file mkdir [file join $prefix "lib"] + file mkdir [file join $prefix "tests"] + + foreach subdir $pkgconf::install_inc_dirs { + file mkdir [file join $prefix "include" $subdir] + } + foreach subdir $pkgconf::install_test_dirs { + file mkdir [file join $prefix "tests" $subdir] + } + + if { 0 } { + + # BLV - this code does not work with the makefiles that are now + # generated for the various include directories. If the old + # configuration involved a header file xyz.h from package A and + # the new configuration involves a header file xyz.h from a + # different package (or a different version of the same package) + # then the old header file would hang around. A temporary + # work-around is to delete all header files. A proper fix is + # rather more complicated. + + # Examine all the files currently in the include directory. If + # any of them are not recognised then they should be deleted. + # Typically this happens if a package is removed. + # + # There may be problems if users put the install tree under + # source code control, in that files just disappear. However even if + # the source code control system restores an old file this should be + # harmless. The directory routines ignore CVS subdirectories and all + # hidden files. + # + # Files in pkgconf have to be treated specially. These are listed + # in pkgconf_files, not header_files. + + set existing_headers [locate_all_files [file join $prefix "include"]] + set pkgconf_headers [locate_all_files [file join $prefix "include" pkgconf]] + + foreach file $pkgconf_headers { + if { [lsearch -exact $pkgconf::pkgconf_files $file] == -1 } { + set filename [file join $prefix "include" $file] + report "Deleting unnecessary file $filename" + file delete -- $filename + } + + # Make sure that this file does not get processed again in the + # next loop. + set file [file join "pkgconf" $file] + set index [lsearch -exact $existing_headers $file] + ASSERT { $index != -1 } + set existing_headers [lreplace $existing_headers $index $index] + } + + foreach file $existing_headers { + if { [lsearch -exact $pkgconf::install_inc_files $file] == -1 } { + set filename [file join $prefix "include" $file] + report "Deleting unnecessary file $filename" + file delete -- $filename + } + } + + # If the user has switched from symbolic links to file copies then + # it is also necessary to delete the old symbolic links. The reverse + # also applies. + set existing_headers [locate_all_files [file join $prefix "include"]] + set files_removed 0 + foreach file $existing_headers { + + set filename [file join $prefix "include" $file] + set type [file type $filename] + + if { ($pkgconf::config_data(use_links) == 0 ) && ($type == "link") } { + file delete -- $filename + set files_removed 1 + } elseif { ($pkgconf::config_data(use_links) == 1 ) && ($type == "file") } { + file delete -- $filename + set files_removed 1 + } + } + if { $files_removed != 0 } { + if { $pkgconf::config_data(use_links) == 0 } { + report "Symbolic links in [file join $prefix include] deleted." + } else { + report "Header file copies in [file join $prefix include] deleted." + } + } + + # Now get rid of any unwanted subdirectories. + set existing_subdirs [locate_all_subdirs [file join $prefix "include"]] + foreach subdir $existing_subdirs { + if { [lsearch -exact $pkgconf::install_inc_dirs $subdir] == -1 } { + set dirname [file join $prefix "include" $subdir] + report "Deleting unnecessary directory $dirname" + file delete -force -- $dirname + } + } + + } else { + + # BLV - delete all header files for now. This is inefficient but safe. + + set existing_headers [locate_all_files [file join $prefix "include"]] + foreach file $existing_headers { + set filename [file join $prefix "include" $file] + file delete -- $filename + } + + # Now get rid of any unwanted subdirectories. + set existing_subdirs [locate_all_subdirs [file join $prefix "include"]] + foreach subdir $existing_subdirs { + if { [lsearch -exact $pkgconf::install_inc_dirs $subdir] == -1 } { + set dirname [file join $prefix "include" $subdir] + report "Deleting unnecessary directory $dirname" + file delete -force -- $dirname + } + } + } + + # Get rid of all the files in lib. + set lib_files [locate_files [file join $prefix "lib"]] + if { $lib_files != "" } { + report "Deleting old library files $lib_files" + foreach file $lib_files { + file delete -- [file join $prefix "lib" $file] + } + } + + # And get rid of any stamp files spread around the object tree + foreach src_dir $pkgconf::src_dirs { + set dirname [file join $pkgconf::build_tree $src_dir] + set stamp_files [locate_files $dirname "*.stamp"] + foreach file $stamp_files { + file delete -- [file join $dirname $file] + } + } + + # Ditto for tests + set test_files [locate_all_files [file join $prefix "tests"]] + if { $test_files != "" } { + report "Deleting old test executables." + foreach file $test_files { + file delete -- [file join $prefix "tests" $file] + } + } + foreach test_dir $pkgconf::tests_dirs { + set dirname [file join $pkgconf::build_tree $test_dir] + set stamp_files [locate_files $dirname "*.stamp"] + foreach file $stamp_files { + file delete -- [file join $dirname $file] + } + } + + # If there has been a change in the packages in the system + # then the various makefile.deps files currently in the + # build tree may contain references to header files that + # are no longer present. Therefore it is necessary to + # get rid of the makefile.deps files. Any changes to the + # packages will result in a new pkgconf/pkgconf.mak file + # and all object files depend on this, so everything that + # needs to be rebuilt will still be rebuilt and new + # dependency files will be generated. + # + # If there has not been a change to the packages then the + # makefile.deps files must not be deleted, or there would + # be problems when just a header file is changed. + if { [packages_have_changed] } { + + foreach src_dir $pkgconf::src_dirs { + set dirname [file join $pkgconf::build_tree $src_dir] + set dep_files [locate_files $dirname "makefile.deps"] + foreach file $dep_files { + file delete -- [file join $dirname $file] + } + } + + foreach test_dir $pkgconf::tests_dirs { + set dirname [file join $pkgconf::build_tree $test_dir] + set dep_files [locate_files $dirname "makefile.deps"] + foreach file $dep_files { + file delete -- [file join $dirname $file] + } + } + } +} + +# }}} +# {{{ Produce misc. files + +# ---------------------------------------------------------------------------- +# Three files have to be generated, and one additional file can be copied. +# +# 1) pkgconf/makevars has to be copied from the component repository. +# 2) pkgconf/makevars relies on pkgconf/pkgconf.mak, which is generated +# 3) pkgconf/system.h has to be generated. +# 5) pkgconf/makefile has to be generated. +# + +proc pkgconf::produce_misc_files { } { + + report "Generating miscellaneous files." + + # Start by copying across pkgconf/makevars unless these files + # already exist in the build tree. Note that these files are + # user-editable so they cannot be overwritten automatically. + set destname [file join $pkgconf::build_tree "pkgconf" "makevars"] + set sourcename [file join $pkgconf::component_repository "pkgconf" "makevars"] + if { (![file isfile $destname]) || ($pkgconf::force_arg != 0) } { + file copy -force -- $sourcename $destname + make_writable $destname + } + + # Next generate the file pkgconf.mak. This should only happen if any + # of the data in the file is changed, because there are file-level + # dependencies in the various makefiles. Additions to the packages + # file will normally be caught by a missing version number. Other + # changes to the packages or targets file may not be caught. + + set config_changed 0 + if { [packages_have_changed] } { + set config_changed 1 + } + if { [value_has_changed "prefix"] } { + set config_changed 1 + } + foreach flag $pkgconf::known_compiler_flags { + if { [value_has_changed "cflags,$flag"] } { + set config_changed 1 + break + } + } + if { ![file isfile [file join $pkgconf::build_tree "pkgconf" "pkgconf.mak"]] } { + set config_changed 1 + } + if { $pkgconf::force_arg != 0 } { + set config_changed 1 + } + + if { $config_changed != 0 } { + + set filename [file join "pkgconf" "pkgconf.mak"] + set file [open [file join $pkgconf::build_tree $filename] "w"] + output_banner $file $filename + + # All PKGconf.mak files should include the master pkgconf.mak + # file ASAP. It is desirable to have a goal at the top of that + # file. This is likely to be the first goal detected by make, + # and hence the default. + puts $file "\ndefault: build\n" + + set command_prefix $pkgconf::target_data($pkgconf::config_data(target),prefix) + + puts $file "" + puts $file "COMPONENT_REPOSITORY\t\t:= [get_pathname_for_make $pkgconf::component_repository]" + puts $file "BUILD_TREE\t\t\t:= [get_pathname_for_make $pkgconf::build_tree]" + + # The prefix (i.e. install directory) should default to somewhere + # relative to the build tree. + set prefix $pkgconf::config_data(prefix) + if { $prefix == "" } { + set prefix [file join $pkgconf::build_tree "install"] + } + puts $file "PREFIX\t\t\t\t:= [get_pathname_for_make $prefix]" + if { $pkgconf::windows_host != 0 } { + puts $file "EXEEXT\t\t\t\t:= .exe" + } + puts $file "" + puts $file "PKGCONF_CC\t\t\t:= $command_prefix-gcc" + puts $file "PKGCONF_CXX\t\t\t:= $command_prefix-gcc" + puts $file "PKGCONF_AR\t\t\t:= $command_prefix-ar" + puts $file "PKGCONF_LD\t\t\t:= $command_prefix-ld" + puts $file "PKGCONF_OBJCOPY\t\t\t:= $command_prefix-objcopy" + puts $file "" + + foreach flag $pkgconf::known_compiler_flags { + set value "" + if { [info exists pkgconf::config_data(cflags,$flag)] != 0 } { + set value $pkgconf::config_data(cflags,$flag) + } else { + set value [get_platform_cflags $pkgconf::config_data(target) $pkgconf::config_data(platform) $flag] + } + if { $value != "" } { + puts $file "PKGCONF_[set flag]\t\t:= $value" + } + } + puts $file "" + + foreach pkg [get_current_packages] { + set varname "[get_build_alias $pkg]_DIR" + set dirname [file join $pkgconf::package_data($pkg,dir) $pkgconf::config_data($pkg,version)] + puts $file "$varname\t\t:= $dirname" + } + + # There are several files containing information about make variables + # rules. The current file, pkgconf.mak, contains information that + # is known to the pkgconf script and should not be edited by users. + # There may be a per-package file in the build tree's pkgconf + # directory, containing per-package settings. And there is the + # makevars file which users can edit to override anything else. + # + # The makefiles for the various packages should only + # need to include one of these files, the rest can be handled + # automatically. Since pkgconf.mak is generated it knows the + # location of the build tree, making it a lot easier to find + # the others. Therefore pkgconf.mak is included first, then + # the per-package file, and finally the makevars file. + + puts $file " +PACKAGE_RULES_FILE := \$(wildcard \$(BUILD_TREE)/pkgconf/\$(PACKAGE).mak) +ifneq ($(PACKAGE_RULES_FILE),) +include $(PACKAGE_RULES_FILE) +endif" + + puts $file "\ninclude \$(BUILD_TREE)/pkgconf/makevars" + + puts $file "\n# End of $filename" + close $file + } + + # And the file system.h + # + # Again, because of file-level dependencies this file should only + # be written out if anything has actually changed. + set config_changed 0 + if { [packages_have_changed] || [value_has_changed "startup"] } { + set config_changed 1 + } + if { ![file isfile [file join $pkgconf::build_tree "pkgconf" "system.h"]] } { + set config_changed 1 + } + if { $pkgconf::force_arg != 0 } { + set config_changed 1 + } + + if { $config_changed != 0 } { + + set filename [file join "pkgconf" "system.h"] + set file [open [file join $pkgconf::build_tree $filename] "w"] + puts $file \ +"#ifndef CYGONCE_PKGCONF_SYSTEM_H +#define CYGONCE_PKGCONF_SYSTEM_H +/* + * File $filename + * + * This file is generated automatically by the pkgconf program. + * It should not be edited. Any changes to this file may be + * overwritten by pkgconf. + */ +" + puts $file "#define CYG_HAL_[string toupper $pkgconf::config_data(target)]" + puts $file \ + "#define CYG_HAL_[string toupper $pkgconf::config_data(target)]_[string toupper $pkgconf::config_data(platform)]" + puts $file "#define CYG_HAL_STARTUP_[string toupper $pkgconf::config_data(startup)]" + puts $file "" + set current_packages [get_current_packages] + foreach pkg $pkgconf::known_packages { + if { [lsearch -exact $current_packages $pkg] == -1 } { + puts $file "#undef $pkg" + } else { + puts $file "#define $pkg" + } + } + + puts $file "\ +\n#endif /* CYGONCE_PKGCONF_SYSTEM_H */ +/* EOF $filename */" + close $file + } + + # Always output a makefile in the pkgconf directory. This is harmless + # because there should be no file-level dependencies on this file (just + # like the toplevel makefile). + set filename [file join "pkgconf" "makefile"] + set makefile [open [file join $pkgconf::build_tree $filename] "w"] + output_banner $makefile $filename + + puts $makefile \ +"include pkgconf.mak + +.PHONY : build clean +HEADERS := $pkgconf::pkgconf_files +TARGETS := \$(foreach hdr,\$(HEADERS),\$(PREFIX)/include/pkgconf/\$(hdr)) + +build: \$(TARGETS) +" + + foreach hdr $pkgconf::pkgconf_files { + puts $makefile "\$(PREFIX)/include/pkgconf/$hdr : $hdr" + if { $pkgconf::config_data(use_links) == 0 } { + puts $makefile "\t@\$(CP) \$< \$@" + } else { + puts $makefile "\t@\$(RM) \$@; ln -s \$< \$@" + } + puts $makefile "" + } + + puts $makefile "clean:" + foreach hdr $pkgconf::pkgconf_files { + puts $makefile "\t@\$(RM) \$(PREFIX)/include/pkgconf/$hdr" + } + puts $makefile "\n# End of $filename" + close $makefile + +} + +# }}} +# {{{ Produce the master makefile + +# ---------------------------------------------------------------------------- +# This routine is responsible for generating the master makefile that +# exists at the top of a build tree. This makefile supports three main +# targets: default, tests and clean. There is a subsidiary target +# "headers" which takes care of the header files. +# + +proc pkgconf::produce_makefile { } { + + report "Generating toplevel makefile." + + ASSERT { $pkgconf::build_tree != "" } + set filename [file join $pkgconf::build_tree "makefile"] + set makefile [open $filename "w"] + output_banner $makefile "makefile" + + puts $makefile \ +" +include pkgconf/pkgconf.mak +.PHONY: default build clean tests headers" + + puts $makefile "\nbuild: headers" + foreach src_dir $pkgconf::src_dirs { + puts $makefile "\t\$(MAKE) -C $src_dir" + } + puts $makefile "\t@echo Build finished." + + puts $makefile "\ntests: build" + foreach tests_dir $pkgconf::tests_dirs { + puts $makefile "\t\$(MAKE) -C $tests_dir" + } + puts $makefile "\t@echo Tests build finished." + + puts $makefile \ +"\nlibobjs := \$(wildcard \$(PREFIX)/lib/*) +clean: +ifneq (\$(libobjs),) +\t\$(RM) \$(libobjs) +endif +\tmake -C pkgconf clean" + foreach src_dir $pkgconf::src_dirs { + puts $makefile "\t\$(MAKE) -C $src_dir clean" + } + foreach tests_dir $pkgconf::tests_dirs { + puts $makefile "\t\$(MAKE) -C $tests_dir clean" + } + foreach inc_dir $pkgconf::inc_dirs { + puts $makefile "\t@\$(MAKE) -silent -C $inc_dir clean" + } + puts $makefile "\t@echo Clean finished." + + puts $makefile "\nheaders:" + puts $makefile "\t@echo Checking header files." + puts $makefile "\t@\$(MAKE) -silent -C pkgconf" + foreach inc_dir $pkgconf::inc_dirs { + puts $makefile "\t@\$(MAKE) -silent -C $inc_dir" + } + + puts $makefile "" + puts $makefile "# End of makefile" + close $makefile +} + +# }}} + +# {{{ Produce_build_tree + +proc pkgconf::produce_build_tree { } { + + # First, check that all the requirements have been satisfied. Normally + # this will have been taken care of earlier. + check_requirements + + # What is the install tree ? + set prefix $pkgconf::config_data(prefix) + if { $prefix == "" } { + set prefix [file join $pkgconf::build_tree "install"] + } + set target $pkgconf::config_data(target) + set platform $pkgconf::config_data(platform) + set startup $pkgconf::config_data(startup) + + # Report the configuration that is being built. + report "Generating build tree." + report "Component repository is $pkgconf::component_repository" + report "Build tree is $pkgconf::build_tree" + report "Install directory is $prefix" + report "Architecture $target, platform $platform, startup $startup." + if { $pkgconf::config_data(use_links) != 0 } { + report "Using symbolic links for the header files." + } + + # Reset the list of all the header files that should be in the install + # tree, and related variables. + set pkgconf::inc_dirs "" + set pkgconf::src_dirs "" + set pkgconf::tests_dirs "" + set pkgconf::install_inc_dirs "pkgconf" + set pkgconf::install_inc_files "" + set pkgconf::pkgconf_files "makevars pkgconf.mak system.h" + set pkgconf::install_test_dirs "" + + set status [catch { + + # Create the toplevel build tree directory, if necessary. + if { ! [file exists $pkgconf::build_tree] } { + report "Creating build tree $pkgconf::build_tree" + file mkdir $pkgconf::build_tree + } + # Create the pkgconf subdirectory. A failure here indicates that + # the build tree is not writable, and it is useful to detect this + # before too much processing takes place. + set dirname [file join $pkgconf::build_tree pkgconf] + if { ! [file exists $dirname] } { + report "Creating directory $dirname" + file mkdir $dirname + } + + # Process each package that is part of the current configuration + foreach pkg [get_current_packages] { + set dirname $pkgconf::package_data($pkg,dir) + set dirname [file join $dirname $pkgconf::config_data($pkg,version)] + process_package $pkg $dirname + } + + # The install tree must exist before the misc files are generated. + # See get_pathname_for_make for details. + produce_install_tree + produce_misc_files + produce_makefile + + report "Generating save file." + write_save_file + report "The Build tree is ready." + + } message] + + if { $status != 0 } { + fatal_error "An unexpected error occurred while generating the build tree: $message" + } +} + +# }}} + +# }}} +# {{{ main() + +# ---------------------------------------------------------------------------- +# Initialise data. This routine is responsible for reading in the +# packages file and the targets file, setting up the default data, +# reading in the save file if any, and processing the command line +# arguments if any. +# + +proc pkgconf::initialise_data { } { + + # First, read the packages and targets files. These routines will + # also deal with the --packages and --targets arguments, and + # they will check for any invalid packages or targets that may + # have been passed. The order of these two calls should not be + # changed since read_targets needs to know about the available + # packages for some of its validations. + pkgconf::read_packages + pkgconf::read_targets + + # If either or both of the --packages or --targets arguments + # were used, do not go any further. The user was just asking + # for information. Ditto for --pkgdata, which can be used by + # other programs to get information about the various + # packages in a format more appropriate for them. + # + # NOTE: the parsing code does not actually check that no + # further arguments were passed, but it is unlikely that the + # user would both ask for a list of packages and expect + # something to happen. + if { ( $pkgconf::list_packages_arg != 0 ) || + ( $pkgconf::list_targets_arg != 0 ) || + ( $pkgconf::list_pkgdata_arg != 0 ) } { + exit 0 + } + + # Set up default values for all options which are managed directly + # by this program. + pkgconf::setup_defaults + + # Check for a save file in the existing build tree. + # If so read it in, updating the default values. + pkgconf::read_save_file + + # Now process the command line arguments, which will again result + # in updates to the default values. + pkgconf::process_arguments + + # If the -flags argument was used, list the compiler flags currently + # in use. This could not be done earlier since the compiler flags + # may depend on the save file and on other command line arguments. + if { $pkgconf::list_flags_arg != 0 } { + foreach flag $pkgconf::known_compiler_flags { + set value "" + if { [info exists pkgconf::config_data(cflags,$flag)] != 0 } { + set value $pkgconf::config_data(cflags,$flag) + } else { + set value [get_platform_cflags $pkgconf::config_data(target) $pkgconf::config_data(platform) $flag] + } + if { $value != "" } { + puts "$flag\t\"$value\"" + } + } + exit 0 + } + + if { 0 } { + puts "target: $pkgconf::config_data(target)" + puts "platform: $pkgconf::config_data(platform)" + puts "startup: $pkgconf::config_data(startup)" + puts "prefix: $pkgconf::config_data(prefix)" + puts "packages: $pkgconf::config_data(packages)" + foreach pkg $pkgconf::config_data(packages) { + puts "$pkg version $pkgconf::config_data($pkg,version)" + } + exit 0 + } +} + +# ---------------------------------------------------------------------------- +# Main(). This code only runs if the script is being run stand-alone rather +# than as part of a larger application. The controlling predicate is the +# existence of the variable pkgconf_not_standalone which can be set by +# the containing program if any. +# + +if { ! [info exists pkgconf_not_standalone] } { + + # Do some necessary GUI initialisation such as hiding the main window + # during startup. + pkgconf::gui_standalone_init + + # Decide where warnings and fatal errors should go. + pkgconf::initialise_error_handling + + # Parse the arguments and set the global variables appropriately. + pkgconf::parse_arguments $argv0 $argv + + # Initialise all the data, e.g. by reading in the packages and + # targets files. + pkgconf::initialise_data + + # At this stage the code can do one of two things: run the GUI, + # or build/update the build tree. + # The GUI can be run if the necessary commands are available and + # if the user did not pass -nw. + if { $pkgconf::gui_possible && ! $pkgconf::no_windows_arg } { + } else { + set pkgconf::gui_mode 0 + } + + # Reset error handling to the correct mode + pkgconf::initialise_error_handling + + # Either enter GUI mode, or produce the build tree + if { $pkgconf::gui_mode } { + pkgconf::gui + } else { + pkgconf::produce_build_tree + exit 0 + } +} + +# }}} + + diff --git a/packages/pkgconf/makevars b/packages/pkgconf/makevars new file mode 100644 --- /dev/null +++ b/packages/pkgconf/makevars @@ -0,0 +1,276 @@ +#=============================================================================== +# +# makevars +# +# This file allows users to control some aspects of the build process. +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +# +# Some of the commands used to do builds should generally be specified by +# pkgconf. This is because the commands are target-specific, and it is +# pkgconf that knows about the target architecture and the information held +# in the targets file. Never the less it is desirable to allow users to +# redefine the commands. +# +# First, make automatically defines a number of variables unless it is +# given the -r or --no-builtin-rules arguments. The built-in values are +# unlikely to be correct when doing cross compilation. The following +# checks eliminate any such built-in definitions. +ifeq ($(origin CC),default) +CC := +endif +ifeq ($(origin CXX),default) +CXX := +endif +ifeq ($(origin AR),default) +AR := +endif +ifeq ($(origin LD),default) +LD := +endif +ifeq ($(origin CP),default) +CP := +endif +ifeq ($(origin RM),default) +RM := +endif +ifeq ($(origin TOUCH),default) +TOUCH := +endif +ifeq ($(origin CAT),default) +CAT := +endif +ifeq ($(origin TAIL),default) +TAIL := +endif + +# +# At this stage all of the variables identifying commands will be empty +# or undefined strings, or they will have been set on the make command +# line or in environment variables. +# +# For each command that is not currently defined, a default value +# is defined here. Users may make a persistent change to the commands by +# commenting out the default value and filling in an alternative one. +# +ifeq ($(CC),) +CC := $(PKGCONF_CC) +#CC := +endif +ifeq ($(CXX),) +CXX := $(PKGCONF_CXX) +#CXX := +endif +ifeq ($(AR),) +AR := $(PKGCONF_AR) +#AR := +endif +ifeq ($(LD),) +LD := $(PKGCONF_LD) +#LD := +endif +ifeq ($(OBJCOPY),) +OBJCOPY := $(PKGCONF_OBJCOPY) +#OBJCOPY := +endif +ifeq ($(CP),) +CP := install -m 0644 +#CP := +endif +ifeq ($(RM),) +RM := rm -f +#RM := +endif +ifeq ($(TOUCH),) +TOUCH := touch +#TOUCH := +endif +ifeq ($(CAT),) +CAT := cat +#CAT := +endif +ifeq ($(TAIL),) +TAIL := tail +#tail := +endif + +# +# Next deal with the various compiler flags. None of the flags should +# conflict with any built-in variables, so it is sufficient to check +# that a given flag has not been defined on the make command line or via +# an environment variable. +# +# As with the command variables, users can disable the default +# settings by commenting out one line and filling in the next line. +# +# There are five categories of flags: +# 1) architecture-related, i.e. -mthis -mthat -mthe-other +# 2) error and warning related, e.g. -Wall -Werror +# 3) language-related, e.g. -fno-rtti for C++ code +# 4) debug and code generation, e.g. -g -O2 +# 5) everything else, e.g. -DCYG_RELEASE_DEBUG +# +# For each category there are four variables. The first one, e.g. +# ARCHFLAGS, is used for all build operations. The second, e.g. +# CARCHFLAGS, is used only when compiling to C code (in addition to +# the generic ARCHFLAGS). The third, e.g. CXXARCHFLAGS is used when +# compiling C++ code and the last, LDARCHFLAGS, is used when linking +# executables (typically test programs). +# + +ifeq ($(ARCHFLAGS),) +ARCHFLAGS := $(PKGCONF_ARCHFLAGS) +#ARCHFLAGS := +endif +ifeq ($(CARCHFLAGS),) +CARCHFLAGS := $(PKGCONF_CARCHFLAGS) +#CARCHFLAGS := +endif +ifeq ($(CXXARCHFLAGS),) +CXXARCHFLAGS := $(PKGCONF_CXXARCHFLAGS) +#CXXARCHFLAGS := +endif +ifeq ($(LDARCHFLAGS),) +LDARCHFLAGS := $(PKGCONF_LDARCHFLAGS) +#LDARCHFLAGS := +endif +ifeq ($(ERRFLAGS),) +ERRFLAGS := $(PKGCONF_ERRFLAGS) +#ERRFLAGS := +endif +ifeq ($(CERRFLAGS),) +CERRFLAGS := $(PKGCONF_CERRFLAGS) +#CERRFLAGS := +endif +ifeq ($(CXXERRFLAGS),) +CXXERRFLAGS := $(PKGCONF_CXXERRFLAGS) +#CXXERRFLAGS := +endif +ifeq ($(LDERRFLAGS),) +LDERRFLAGS := $(PKGCONF_LDERRFLAGS) +#LDERRFLAGS := +endif +ifeq ($(LANGFLAGS),) +LANGFLAGS := $(PKGCONF_LANGFLAGS) +#LANGFLAGS := +endif +ifeq ($(CLANGFLAGS),) +CLANGFLAGS := $(PKGCONF_CLANGFLAGS) +#CLANGFLAGS := +endif +ifeq ($(CXXLANGFLAGS),) +CXXLANGFLAGS := $(PKGCONF_CXXLANGFLAGS) +#CXXLANGFLAGS := +endif +ifeq ($(LDLANGFLAGS),) +LDLANGFLAGS := $(PKGCONF_LDLANGFLAGS) +#LDLANGFLAGS := +endif +ifeq ($(DBGFLAGS),) +DBGFLAGS := $(PKGCONF_DBGFLAGS) +#DBGFLAGS := +endif +ifeq ($(CDBGFLAGS),) +CDBGFLAGS := $(PKGCONF_CDBGFLAGS) +#CDBGFLAGS := +endif +ifeq ($(CXXDBGFLAGS),) +CXXDBGFLAGS := $(PKGCONF_CXXDBGFLAGS) +#CXXDBGFLAGS := +endif +ifeq ($(LDDBGFLAGS),) +LDDBGFLAGS := $(PKGCONF_LDDBGFLAGS) +#LDDBGFLAGS := +endif +ifeq ($(EXTRAFLAGS),) +EXTRAFLAGS := $(PKGCONF_EXTRAFLAGS) +#EXTRAFLAGS := +endif +ifeq ($(CEXTRAFLAGS),) +CEXTRAFLAGS := $(PKGCONF_CEXTRAFLAGS) +#CEXTRAFLAGS := +endif +ifeq ($(CXXEXTRAFLAGS),) +CXXEXTRAFLAGS := $(PKGCONF_CXXEXTRAFLAGS) +#CXXEXTRAFLAGS := +endif +ifeq ($(LDEXTRAFLAGS),) +LDEXTRAFLAGS := $(PKGCONF_LDEXTRAFLAGS) +#LDEXTRAFLAGS := +endif + +# +# Now combine all the above flags, so that the build rules are actually legible. +# +CFLAGS := $(ARCHFLAGS) $(CARCHFLAGS) +CFLAGS := $(CFLAGS) $(ERRFLAGS) $(CERRFLAGS) +CFLAGS := $(CFLAGS) $(LANGFLAGS) $(CLANGFLAGS) +CFLAGS := $(CFLAGS) $(DBGFLAGS) $(CDBGFLAGS) +CFLAGS := $(CFLAGS) $(EXTRAFLAGS) $(CEXTRAFLAGS) +CFLAGS := $(strip $(CFLAGS)) + +CXXFLAGS := $(ARCHFLAGS) $(CXXARCHFLAGS) +CXXFLAGS := $(CXXFLAGS) $(ERRFLAGS) $(CXXERRFLAGS) +CXXFLAGS := $(CXXFLAGS) $(LANGFLAGS) $(CXXLANGFLAGS) +CXXFLAGS := $(CXXFLAGS) $(DBGFLAGS) $(CXXDBGFLAGS) +CXXFLAGS := $(CXXFLAGS) $(EXTRAFLAGS) $(CXXEXTRAFLAGS) +CXXFLAGS := $(strip $(CXXFLAGS)) + +LDFLAGS := $(ARCHFLAGS) $(LDARCHFLAGS) +LDFLAGS := $(LDFLAGS) $(ERRFLAGS) $(LDERRFLAGS) +LDFLAGS := $(LDFLAGS) $(LANGFLAGS) $(LDLANGFLAGS) +LDFLAGS := $(LDFLAGS) $(DBGFLAGS) $(LDDBGFLAGS) +LDFLAGS := $(LDFLAGS) $(EXTRAFLAGS) $(LDEXTRAFLAGS) +LDFLAGS := $(strip $(LDFLAGS)) + +# +# Clear the default INCLUDE_PATH. This will be set up in +# makrules.src et al. on the basis of the VPATH environment +# variable. +INCLUDE_PATH := + +# +# Finally, it is possible for users to change the rules that actually +# perform most of the build operations. + +$(PACKAGE)_%.o : %.c + $(CC) -c $(INCLUDE_PATH) $(CFLAGS) -Wp,-MD,$(@:.o=.tmp) -o $@ $< + @echo -e "\\n$@ : $< \\\\" > $(@:.o=.d) + @$(TAIL) -n +2 $(@:.o=.tmp) >> $(@:.o=.d) + @$(RM) $(@:.o=.tmp) + +$(PACKAGE)_%.o : %.cxx + $(CXX) -c $(INCLUDE_PATH) $(CXXFLAGS) -Wp,-MD,$(@:.o=.tmp) -o $@ $< + @echo -e "\\n$@ : $< \\\\" > $(@:.o=.d) + @$(TAIL) -n +2 $(@:.o=.tmp) >> $(@:.o=.d) + @$(RM) $(@:.o=.tmp) + +$(PACKAGE)_%.o : %.S + $(CXX) -c $(INCLUDE_PATH) $(CFLAGS) -Wp,-MD,$(@:.o=.tmp) -o $@ $< + @echo -e "\\n$@ : $< \\\\" > $(@:.o=.d) + @$(TAIL) -n +2 $(@:.o=.tmp) >> $(@:.o=.d) + @$(RM) $(@:.o=.tmp) + diff --git a/packages/pkgconf/makrules.prv b/packages/pkgconf/makrules.prv new file mode 100644 --- /dev/null +++ b/packages/pkgconf/makrules.prv @@ -0,0 +1,108 @@ +#============================================================================= +# +# makrules.prv +# +# This file contains generic rules that can be applied to +# directories where private programs are built; you must tell +# it where we are by setting $WHEREAMI eg. to src/test +# +#============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================= + +.PHONY: default build clean + +# Source files can be picked up from the build tree or the component +# repository. This allows copies of the sources to be made in the +# build tree and edited there. +VPATH := . $(COMPONENT_REPOSITORY)/$($(PACKAGE)_DIR)/$(WHEREAMI) + +# The object files and the dependency files can be deduced mainly +# from the list of tests. +STAMPS := $(foreach target,$(TESTS),$(target).stamp) +OBJECTS := $(STAMPS:.stamp=.o) +OBJECTS := $(foreach obj,$(OBJECTS),$(dir $(obj))$(PACKAGE)_$(notdir $(obj))) +DEPS := $(OBJECTS:.o=.d) $(OTHER_DEPS) + +# The header file search path is as follows: +# +# $(PREFIX)/include +# These headers are what will be used by application code. +# +# . +# Header files private to a package and copied into the build tree. +# +# $(COMPONENT_REPOSITORY)//src +# Header files private to a package and still in the repository. +# +# It is possible for additional paths to be specified by the user, +# typically by editing the makevars file. Any such search paths take +# precedence over the default path. + +INCLUDE_PATH := $(INCLUDE_PATH) -I$(PREFIX)/include $(foreach dir,$(VPATH),-I$(dir)) + +# These rules cause mostof the work to be done. +build: $(STAMPS) $(OTHER_TESTS) +ifneq ($(strip $(DEPS)),) + @$(CAT) $(DEPS) > makefile.deps +endif + +clean: $(foreach test,$(TESTS),$(test).clean) $(OTHER_CLEAN) + @$(RM) makefile.deps +ifneq ($(strip $(DEPS)),) + @$(RM) $(DEPS) +endif + +# These rules generate a test executable from a single .o file, +# and perform a matching clean-up operation. It is also necessary +# to have dependencies on libtarget.a et al. + +ifneq ($(STAMPS),) + +LIBDEPS := $(wildcard $(PREFIX)/lib/*) + +%.stamp: $(PACKAGE)_%.o $(LIBDEPS) + $(CC) -o $*$(EXEEXT) $< $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -nostdlib + @$(TOUCH) $@ + +%.clean: + $(RM) $*$(EXEEXT) $(PACKAGE)_$*.o + @$(RM) $*.stamp +endif + +# +# These file dependencies ensure that all files are rebuilt if +# there is a change to the build environment, e.g. if a different +# compiler is being used. +# +ifneq ($(strip $(OBJECTS)),) +$(OBJECTS) : $(BUILD_TREE)/pkgconf/pkgconf.mak +$(OBJECTS) : $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) +endif + +# +# This rule reads in any previously generated dependency information. +# +ifneq ($(wildcard makefile.deps),) +include makefile.deps +endif diff --git a/packages/pkgconf/makrules.src b/packages/pkgconf/makrules.src new file mode 100644 --- /dev/null +++ b/packages/pkgconf/makrules.src @@ -0,0 +1,123 @@ +#=============================================================================== +# +# makrules.src +# +# This file contains generic rules that can be applied to all src +# directories. +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== + +.PHONY: default build clean + +# Source files can be picked up from the build tree or the component +# repository. This allows copies of the sources to be made in the +# build tree and edited there. +VPATH := . $(COMPONENT_REPOSITORY)/$($(PACKAGE)_DIR)/src + +# The object files and the dependency files can be deduced mainly +# from the list of source files. OTHER_OBJS and OTHER_DEPS are +# provided as an escape mechanism, as is OTHER_TARGETS. + +OBJECTS := $(COMPILE:.cxx=.o) +OBJECTS := $(OBJECTS:.c=.o) +OBJECTS := $(OBJECTS:.S=.o) +OBJECTS := $(foreach obj,$(OBJECTS),$(dir $(obj))$(PACKAGE)_$(notdir $(obj))) +DEPS := $(OBJECTS:.o=.d) + +OBJECTS := $(OBJECTS) $(OTHER_OBJS) +DEPS := $(DEPS) $(OTHER_DEPS) + +# The header file search path is as follows: +# +# $(PREFIX)/include +# These headers are what will be used by application code. +# +# . +# Header files private to a package and copied into the build tree. +# +# $(COMPONENT_REPOSITORY)//src +# Header files private to a package and still in the repository. +# +# It is possible for additional paths to be specified by the user, +# typically by editing the makevars file. Any such search paths take +# precedence over the default path. + +INCLUDE_PATH := $(INCLUDE_PATH) -I$(PREFIX)/include $(foreach dir,$(VPATH),-I$(dir)) + +# +# This is the default target. It is responsible for updating the library, +# building any special targets, and updating the dependency information. + +build: $(LIBRARY).stamp $(OTHER_TARGETS) +ifneq ($(strip $(DEPS)),) + @$(CAT) $(DEPS) > makefile.deps +endif + + +# Updating the library involves using ar with any object files that +# have been rebuilt. After any s + +$(LIBRARY).stamp: $(OBJECTS) +ifneq ($(strip $(OBJECTS)),) + $(AR) crs $(PREFIX)/lib/$(LIBRARY) $? +endif + $(TOUCH) $@ + + +# The clean target cleans up the intermediate files, any object +# files, and any dependency files. + +clean: $(OTHER_CLEAN) + $(RM) $(LIBRARY).stamp + @$(RM) makefile.deps +ifneq ($(strip $(OBJECTS)),) + $(RM) $(OBJECTS) +endif +ifneq ($(strip $(DEPS)),) + @$(RM) $(DEPS) +endif + +# +# These file dependencies ensure that all files are rebuilt if +# there is a change to the build environment, e.g. if a different +# compiler is being used. +# +ifneq ($(strip $(OBJECTS)),) +$(OBJECTS) : $(BUILD_TREE)/pkgconf/pkgconf.mak +$(OBJECTS) : $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) +endif +ifneq ($(strip $(OTHER_TARGETS)),) +$(OTHER_TARGETS) : $(BUILD_TREE)/pkgconf/pkgconf.mak +$(OTHER_TARGETS) : $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) +endif + +# +# This rule reads in any previously generated dependency information. +# +ifneq ($(wildcard makefile.deps),) +include makefile.deps +endif + + diff --git a/packages/pkgconf/makrules.tst b/packages/pkgconf/makrules.tst new file mode 100644 --- /dev/null +++ b/packages/pkgconf/makrules.tst @@ -0,0 +1,106 @@ +#============================================================================= +# +# makrules.tst +# +# This file contains generic rules that can be applied to all tests +# directories. +# +#============================================================================= +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#============================================================================= + +.PHONY: default build clean + +# Source files can be picked up from the build tree or the component +# repository. This allows copies of the sources to be made in the +# build tree and edited there. +VPATH := . $(COMPONENT_REPOSITORY)/$($(PACKAGE)_DIR)/tests + +# The object files and the dependency files can be deduced mainly +# from the list of tests. +STAMPS := $(foreach target,$(TESTS),$(target).stamp) +OBJECTS := $(STAMPS:.stamp=.o) +OBJECTS := $(foreach obj,$(OBJECTS),$(dir $(obj))$(PACKAGE)_$(notdir $(obj))) +DEPS := $(OBJECTS:.o=.d) $(OTHER_DEPS) + +# The header file search path is as follows: +# +# $(PREFIX)/include +# These headers are what will be used by application code. +# +# . +# Header files private to a package and copied into the build tree. +# +# $(COMPONENT_REPOSITORY)//src +# Header files private to a package and still in the repository. +# +# It is possible for additional paths to be specified by the user, +# typically by editing the makevars file. Any such search paths take +# precedence over the default path. + +INCLUDE_PATH := $(INCLUDE_PATH) -I$(PREFIX)/include $(foreach dir,$(VPATH),-I$(dir)) + +# These rules cause mostof the work to be done. +build: $(STAMPS) $(OTHER_TESTS) +ifneq ($(strip $(DEPS)),) + @$(CAT) $(DEPS) > makefile.deps +endif + +clean: $(foreach test,$(TESTS),$(test).clean) $(OTHER_CLEAN) + @$(RM) makefile.deps +ifneq ($(strip $(DEPS)),) + @$(RM) $(DEPS) +endif + +# These rules generate a test executable from a single .o file, +# and perform a matching clean-up operation. It is also necessary +# to have dependencies on libtarget.a et al. + +ifneq ($(STAMPS),) + +LIBDEPS := $(wildcard $(PREFIX)/lib/*) + +%.stamp: $(PACKAGE)_%.o $(LIBDEPS) + $(CC) -o $(PREFIX)/tests/$(PACKAGE)/$*$(EXEEXT) $< $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -nostdlib + @$(TOUCH) $@ + +%.clean: + $(RM) $(PREFIX)/tests/$(PACKAGE)/$*$(EXEEXT) $(dir $*.o)$(PACKAGE)_$(notdir $*.o) + @$(RM) $*.stamp +endif + +# These file dependencies ensure that all files are rebuilt if +# there is a change to the build environment, e.g. if a different +# compiler is being used. +# +ifneq ($(strip $(OBJECTS)),) +$(OBJECTS) : $(BUILD_TREE)/pkgconf/pkgconf.mak +$(OBJECTS) : $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) +endif + +# +# This rule reads in any previously generated dependency information. +# +ifneq ($(wildcard makefile.deps),) +include makefile.deps +endif diff --git a/packages/targets b/packages/targets new file mode 100644 --- /dev/null +++ b/packages/targets @@ -0,0 +1,189 @@ +#=============================================================================== +# +# targets +# +# This file lists the supported target architectures. +# +#=============================================================================== +#####COPYRIGHTBEGIN#### +# +# ------------------------------------------- +# The contents of this file are subject to the Cygnus eCos Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://sourceware.cygnus.com/ecos +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations under +# the License. +# +# The Original Code is eCos - Embedded Cygnus Operating System, released +# September 30, 1998. +# +# The Initial Developer of the Original Code is Cygnus. Portions created +# by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +# ------------------------------------------- +# +#####COPYRIGHTEND#### +#=============================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): bartv +# Contributors: bartv +# Date: 1998-04-11 +# +# Purpose: To provide the interim build system with information +# about the supported targets. +# +# Description: This file defines details of the supported target architectures. +# Usage: +# +#####DESCRIPTIONEND#### +#=============================================================================== +# + +# +# Format of this file: +# +# Each target architecture is defined by a statement of the form: +# target +# +# The name of the architecture and acts as the default alias string. +# +# The body can contain the following commands: +# +# 1) alias one or more aliases for this target. The first alias will +# be used for output purposes. All aliases will be accepted +# as input, and the input matching is not case-sensitive. +# 2) command_prefix what goes before gcc/ld/whatever, e.g. powerpc-eabi +# 3) flags compiler flags that should be used. +# 4) packages the names of one or more packages that should be +# loaded automatically for this target. +# 5) platform definition of a specific platform for this architecture. +# Each platform definition is similar to a target definition, +# consisting of a name and a body. The name can be used in a +# --platform argument to pkgconf. The body can contain the +# following commands: +# +# 5a) alias an alias for this platform, used for output. +# 5b) packages the names of one or more packages that should be loaded +# automatically for this platform. +# 5c) cflags replacement compiler flags needed on this platform +# 5d) startup a list of the legal start-ups, typically either just ram +# or both ram and rom. This corresponds to the --startup +# argument to pkgconf. +# + +target mn10300 { + alias { MN10300 mn10300-elf am30 am30-elf am32 am32-elf } + command_prefix mn10300-elf + packages CYGPKG_HAL_MN10300 + + cflags { + ERRFLAGS "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef" + CXXERRFLAGS "-Woverloaded-virtual" + DBGFLAGS "-g -O2" + LANGFLAGS "-ffunction-sections -fdata-sections" + CXXLANGFLAGS "-fno-rtti -fno-exceptions -fvtable-gc -finit-priority" + LDLANGFLAGS "-Wl,--gc-sections -Wl,-static" + } + + platform stdeval1 { + alias { "Evaluation board" } + startup { ram rom } + packages { + CYGPKG_HAL_MN10300_STDEVAL1 + CYGPKG_DEVICES_GDB + CYGPKG_DEVICES_SERIAL_RS232_COMMON + CYGPKG_DEVICES_SERIAL_RS232_MN10300 + CYGPKG_DEVICES_WALLCLOCK + CYGPKG_DEVICES_WATCHDOG + } + + } + platform sim { + alias { "Simulator" } + startup { ram } + packages { + CYGPKG_HAL_MN10300_SIM + CYGPKG_DEVICES_WALLCLOCK + CYGPKG_DEVICES_WATCHDOG + } + } +} + + +target tx39 { + alias { TX39 mips-tx39 mips-tx39-elf } + command_prefix mips-tx39-elf + packages CYGPKG_HAL_TX39 + + cflags { + ERRFLAGS "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef" + CXXERRFLAGS "-Woverloaded-virtual" + LANGFLAGS "-ffunction-sections -fdata-sections" + DBGFLAGS "-g -O2" + CXXLANGFLAGS "-fno-rtti -fno-exceptions -fvtable-gc -finit-priority" + LDLANGFLAGS "-Wl,--gc-sections -Wl,-static" + } + + platform jmr3904 { + alias { "JMR-TX3904 evaluation board" jmr3904 } + hal hal/mips/jmr3904 + startup { ram rom } + packages { + CYGPKG_HAL_TX39_JMR3904 + CYGPKG_DEVICES_SERIAL_RS232_COMMON + CYGPKG_DEVICES_SERIAL_RS232_TX39 + CYGPKG_DEVICES_WALLCLOCK + CYGPKG_DEVICES_WATCHDOG + } + } + platform sim { + alias { "Simulator" } + startup { ram } + packages { + CYGPKG_HAL_TX39_SIM + CYGPKG_DEVICES_WALLCLOCK + CYGPKG_DEVICES_WATCHDOG + } + } +} + +target powerpc { + alias { PowerPC powerpc-eabi } + command_prefix powerpc-eabi + packages { CYGPKG_HAL_POWERPC } + + cflags { + ARCHFLAGS "-mcpu=860 -D_SOFT_FLOAT" + ERRFLAGS "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef" + CXXERRFLAGS "-Woverloaded-virtual" + LANGFLAGS "-ffunction-sections -fdata-sections" + DBGFLAGS "-g -O2" + CXXLANGFLAGS "-fno-rtti -fno-exceptions -fvtable-gc -finit-priority" + LDLANGFLAGS "-Wl,--gc-sections -Wl,-static" + } + hal hal/powerpc/arch + + platform cogent { + alias { "Cogent board" } + startup { ram rom } + packages { + CYGPKG_HAL_POWERPC_COGENT + CYGPKG_DEVICES_WALLCLOCK + CYGPKG_DEVICES_WATCHDOG + } + } + platform sim { + alias { "Simulator" } + startup { ram } + packages { + CYGPKG_HAL_POWERPC_SIM + CYGPKG_DEVICES_WALLCLOCK + CYGPKG_DEVICES_WATCHDOG + } + } +} +