summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits
Commit message (Collapse)AuthorAgeFilesLines
* [project @ 2002-02-12 15:17:13 by simonmar]simonmar2002-02-1217-2175/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch over to the new hierarchical libraries --------------------------------------------- This commit reorganises our libraries to use the new hierarchical module namespace extension. The basic story is this: - fptools/libraries contains the new hierarchical libraries. Everything in here is "clean", i.e. most deprecated stuff has been removed. - fptools/libraries/base is the new base package (replacing "std") and contains roughly what was previously in std, lang, and concurrent, minus deprecated stuff. Things that are *not allowed* in libraries/base include: Addr, ForeignObj, ByteArray, MutableByteArray, _casm_, _ccall_, ``'', PrimIO For ByteArrays and MutableByteArrays we use UArray and STUArray/IOUArray respectively now. Modules previously called PrelFoo are now under fptools/libraries/GHC. eg. PrelBase is now GHC.Base. - fptools/libraries/haskell98 provides the Haskell 98 std. libraries (Char, IO, Numeric etc.) as a package. This package is enabled by default. - fptools/libraries/network is a rearranged version of the existing net package (the old package net is still available; see below). - Other packages will migrate to fptools/libraries in due course. NB. you need to checkout fptools/libraries as well as fptools/hslibs now. The nightly build scripts will need to be tweaked. - fptools/hslibs still contains (almost) the same stuff as before. Where libraries have moved into the new hierarchy, the hslibs version contains a "stub" that just re-exports the new version. The idea is that code will gradually migrate from fptools/hslibs into fptools/libraries as it gets cleaned up, and in a version or two we can remove the old packages altogether. - I've taken the opportunity to make some changes to the build system, ripping out the old hslibs Makefile stuff from mk/target.mk; the new package building Makefile code is in mk/package.mk (auto-included from mk/target.mk). The main improvement is that packages now register themselves at make boot time using ghc-pkg, and the monolithic package.conf in ghc/driver is gone. I've updated the standard packages but haven't tested win32, graphics, xlib, object-io, or OpenGL yet. The Makefiles in these packages may need some further tweaks, and they'll need pkg.conf.in files added. - Unfortunately all this rearrangement meant I had to bump the interface-file version and create a bunch of .hi-boot-6 files :-(
* [project @ 2002-01-07 15:29:56 by sof]sof2002-01-071-1/+1
| | | | | Ho-hum, readdir() and readdir_r() with GNU libc doesn't flag the end of the directory stream the same way. Cope.
* [project @ 2002-01-05 11:28:31 by sof]sof2002-01-051-4/+4
| | | | fix pathconf() usage
* [project @ 2002-01-04 23:21:18 by sof]sof2002-01-041-4/+4
| | | | prel_readdir: tidied
* [project @ 2002-01-04 10:56:09 by sof]sof2002-01-042-0/+57
| | | | | getDirectoryContents: use the re-entrant readdir_r() to get at directory entries, if available.
* [project @ 2002-01-03 14:43:30 by sof]sof2002-01-031-2/+2
| | | | prel_sizeof_{termios,sigset_t}: sync up proto and impl
* [project @ 2001-12-28 22:58:17 by sof]sof2001-12-281-2/+2
| | | | struct sigset_t -> sigset_t
* [project @ 2001-12-27 11:29:58 by sof]sof2001-12-273-9/+246
| | | | | | | | | | Get rid of uses of #const, #peek, #poke and #ptr from PrelPosix.hsc (this leaves just uses of #type in PrelPosix) - provide constant and accessor wrappers via PrelIOUtils.c instead. Who knows, we might just be able to bootstrap via .hc files again..? Only compiled & tested under Win32.
* [project @ 2001-12-20 17:38:40 by sewardj]sewardj2001-12-202-0/+21
| | | | | | | | | Move some small inline-in-C functions out of PrelPosix.hsc and into the supporting cbits sources, where they belong. Following this change, can you now compile the entire Prelude on x86-linux with the native code generator, and get something which actually works properly.
* [project @ 2001-12-20 16:39:29 by simonmar]simonmar2001-12-201-152/+16
| | | | | | | | | | Now that we can derive arbitrary classes for newtypes, use this to derive all the classes we need for the types in PrelCTypes and PrelCTypesISO, instead of the previous hack of explicitly coercing the methods. This should improve the quality of code using these types too; the coercions were surely getting in the way of optimisations before.
* [project @ 2001-12-17 10:12:34 by simonmar]simonmar2001-12-171-40/+42
| | | | slightly clearer fix for previous bogon, and re-indent the function
* [project @ 2001-12-17 09:30:07 by simonpj]simonpj2001-12-171-1/+0
| | | | Fix ifdefery bracketing bug on Win32
* [project @ 2001-12-07 11:34:48 by sewardj]sewardj2001-12-071-7/+8
| | | | | | | | | | | | | | | | | | | | | Change the story on shifting primops: SllOp, SrlOp, ISllOp, ISraOp, ISrlOp. In the old primop story, these were implemented by C macros which checked that the shift amount did not exceed the word size, and if so returns a suitable value (0 or -1). This gives consistent, defined behaviour for any shift amount. However, these checks were not implemented on the NCG route, an inconsistency. New story: these primops do NOT check their args; they just do the shift. Shift values >= word size give undefined results. To reflect this, their Haskell names have been prefixed with 'unchecked'. The checks are now done on the Bits instances in the Prelude. This means all code generation routes are consistently checked, and hopefully the simplifier will remove the checks for literal shift amounts. I have tried to fix up the implementation for 64-bit platforms too, but not having one to hand, I don't know if it will work as-is.
* [project @ 2001-12-05 17:35:12 by sewardj]sewardj2001-12-051-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------------------------------------------- Translate out PrimOps at the AbstractC level -------------------------------------------- This is the first in what might be a series of changes intended to make GHC less dependent on its C back end. The main change is to translate PrimOps into vanilla abstract C inside the compiler, rather than having to duplicate that work in each code generation route. The main changes are: * A new type, MachOp, in compiler/absCSyn/MachOp.hs. A MachOp is a primitive operation which we can reasonably expect the native code generators to implement. The set is quite small and unlikely to change much, if at all. * Translations from PrimOps to MachOps, at the end of absCSyn/AbsCUtils. This should perhaps be moved to a different module, but it is hard to see how to do this without creating a circular dep between it and AbsCUtils. * The x86 insn selector has been updated to track these changes. The sparc insn selector remains to be done. As a result of this, it is possible to compile much more code via the NCG than before. Almost all the Prelude can be compiled with it. Currently it does not know how to do 64-bit code generation. Once this is fixed, the entire Prelude should be compilable that way. I also took the opportunity to clean up the NCG infrastructure. The old Stix data type has been split into StixStmt (statements) and StixExpr (now denoting values only). This removes a class of impossible constructions and clarifies the NCG. Still to do, in no particular order: * String and literal lifting, currently done in the NCG at the top of nativeGen/MachCode, should be done in the AbstractC flattener, for the benefit of all targets. * Further cleaning up of Stix assignments. * Remove word-size dependency from Abstract C. (should be easy). * Translate out MagicIds in the AbsC -> Stix translation, not in the Stix constant folder. (!) Testsuite failures caused by this: * memo001 - fails (segfaults) for some unknown reason now. * arith003 - wrong answer in gcdInt boundary cases. * arith011 - wrong answer for shifts >= word size. * cg044 - wrong answer for some FP boundary cases. These should be fixed, but I don't think they are mission-critical for anyone.
* [project @ 2001-12-05 12:20:39 by simonmar]simonmar2001-12-051-1/+1
| | | | unbreak inputReady().
* [project @ 2001-12-04 04:47:38 by keller]keller2001-12-041-1/+1
| | | | added closing bracket at end of file
* [project @ 2001-12-03 22:44:48 by sof]sof2001-12-031-5/+6
| | | | Use the message queue friendly MsgWaitForMultipleObjects()
* [project @ 2001-12-03 20:59:08 by sof]sof2001-12-032-9/+24
| | | | Support IO.hWaitForInput on Win32 platforms (on file and socket handles).
* [project @ 2001-12-02 15:47:08 by panne]panne2001-12-021-2/+2
| | | | | | | Hmmm, we probably should install HsStd.h, too. PackageSrc.hs mentions it, and "make boot" in ghc/utils/hsc2hs fails without it. Perhaps this should be fixed differently, but I can't figure out how to do this correctly...
* [project @ 2001-11-26 20:04:00 by sof]sof2001-11-263-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the IO implementation work with WinSock once again. When creating sockets with WinSock, you don't get back a file descriptor, but a SOCKET (which just so happens to map to the same type as a 'normal' file descriptor). This SOCKET value cannot be used with the CRT ops read(), write(), close(), but you have to use the socket-specific operations (recv(), send(), and closesocket(), respectively) instead. To keep track of this distinction between file and socket file descriptors, the following changes were made: * a Handle__ has got a new field, haIsStream, which is True for sockets / streams. (this field is essentially unused in non-Win32 settings, but I decided not to conditionalise its presence). * PrelHandle.openFd now takes an extra (Maybe FDType) argument, which lets you force what type of FD we're converting into a Handle (this is crucial for WinSock SOCKETs, since we don't want to attempt fstat()ing them). Fixes breakage that was introduced with May 2001 (or earlier) rewrite of the IO layer. This commit build upon recent IO changes to HEAD, so merging it to STABLE will require importing those changes too (I'll let others be the judge whether this should be done or not).
* [project @ 2001-11-21 02:29:00 by sof]sof2001-11-212-4/+4
| | | | | | Have prototypes and implementation of prel_PrelHandle_{write,read}() match up with the stated Haskell FFI type in PrelHandle.hs, i.e., the size parameter is a CInt, not an Int.
* [project @ 2001-11-09 20:58:40 by sof]sof2001-11-091-1/+1
| | | | prel_PrelHandle_read(): de-hebetudified.
* [project @ 2001-11-08 17:04:28 by simonmar]simonmar2001-11-081-6/+1
| | | | minor simplification
* [project @ 2001-11-07 19:37:17 by sof]sof2001-11-072-3/+24
| | | | made to work on Unices
* [project @ 2001-11-07 18:26:27 by sof]sof2001-11-071-2/+4
| | | | bring writeErrString__() proto into scope
* [project @ 2001-11-07 18:23:31 by sof]sof2001-11-072-0/+76
| | | | | | prev. commit didn't introduce these two files correctly - PrelIOUtils.{c,h} contain simple C wrappers to handle some aspects of OS I/O in a plat-indep. manner.
* [project @ 2001-11-07 18:19:49 by sof]sof2001-11-071-0/+28
| | | | cbits/PrelIOUtils.c
* [project @ 2001-11-07 08:32:34 by sof]sof2001-11-072-1/+707
| | | | Function wrappers for misc error codes
* [project @ 2001-11-07 07:57:57 by sof]sof2001-11-072-0/+105
| | | | Wrapper functions reqd to implement Directory
* [project @ 2001-09-17 17:23:32 by sewardj]sewardj2001-09-171-3/+3
| | | | Fix utterly bogus implementation of system on Windoze.
* [project @ 2001-08-17 11:13:04 by rrt]rrt2001-08-171-2/+8
| | | | | | | Add a dummy function _ErrorHdrHook to return the address of ErrorHdrHook. Dunno how this ever compiled before. Maybe this is just a special Friday effect. Maybe I shouldn't be committing stuff today. Maybe I should just give up now.
* [project @ 2001-08-17 11:06:58 by simonmar]simonmar2001-08-171-1/+4
| | | | include <string.h>
* [project @ 2001-08-17 10:10:15 by rrt]rrt2001-08-171-2/+2
| | | | Use EXCLUDED_SRCS to handle ilxstubs.c
* [project @ 2001-08-17 00:17:55 by sof]sof2001-08-171-2/+2
| | | | SRC_CC_OPTS: add GHC_{INCLUDE,RUNTIME}_DIR to include path
* [project @ 2001-08-15 10:16:46 by rrt]rrt2001-08-151-17/+1
| | | | argc and argv no longer need faking; System.lhs copes
* [project @ 2001-08-15 09:23:25 by rrt]rrt2001-08-151-5/+18
| | | | Fake argc & argv
* [project @ 2001-08-14 13:40:07 by sewardj]sewardj2001-08-142-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the story about POSIX headers in C compilation. Until now, all C code in the RTS and library cbits has by default been compiled with settings for POSIXness enabled, that is: #define _POSIX_SOURCE 1 #define _POSIX_C_SOURCE 199309L #define _ISOC9X_SOURCE If you wanted to negate this, you'd have to define NON_POSIX_SOURCE before including headers. This scheme has some bad effects: * It means that ccall-unfoldings exported via interfaces from a module compiled with -DNON_POSIX_SOURCE may not compile when imported into a module which does not -DNON_POSIX_SOURCE. * It overlaps with the feature tests we do with autoconf. * It seems to have caused borkage in the Solaris builds for some considerable period of time. The New Way is: * The default changes to not-being-in-Posix mode. * If you want to force a C file into Posix mode, #include as the **first** include the new file ghc/includes/PosixSource.h. Most of the RTS C sources have this include now. * NON_POSIX_SOURCE is almost totally expunged. Unfortunately we have to retain some vestiges of it in ghc/compiler so that modules compiled via C on Solaris using older compilers don't break.
* [project @ 2001-08-07 08:18:15 by rrt]rrt2001-08-071-27/+3
| | | | | Revert to shell-based method on Windows; the raw CreateProcess method is now in hslibs/lang/SystemExts.
* [project @ 2001-07-23 15:11:55 by simonmar]simonmar2001-07-231-2/+2
| | | | | | | | Grrr. Do not #include "Stg.h" in plain C code, because that enables all the global register variables. #include "Rts.h" directly instead. This was correct in the original StgLongLong.c, why on earth it was changed is beyond me.
* [project @ 2001-07-16 09:23:24 by rrt]rrt2001-07-162-3/+39
| | | | | | | | Add stubs for ILXized cbits DLL. Don't call resetNonBlockingFd when DLLized; this stops the cbits DLL depending on the RTS, which ILX needs; it doesn't matter for Windows, as that doesn't have non-blocking IO implemented anyway.
* [project @ 2001-07-14 00:06:13 by sof]sof2001-07-141-36/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Heal HEID - eqForeignObjZh in include/PrimOps.h didn't have quite the right shape (the result is a macro arg). hslibs/lang/ForeignObj wasn't up on the change to eqForeignObj now being a primop. - recent ghc/compiler/deSugar/ changes broke the handling of CCall & FFI decls quite a bit. Backed out most the rewrites of Type.splitFoo to TcType.tcSplitFoo (i.e., now back to using TcType.tcSplitFoo). The backed-out newtype-related changes were by no means accidental. But, I don't profess to understand their intention to make the proper fix, so my change is just a stop-gap measure to get HEAD back to the land of the living. - recent changes to the behaviour of 'hiding' & qualified names broke hslibs/lang/CString hslibs/data/edison/Seq/ListSeq, hslibs/data/edison/Coll/TestOrdBag, hslibs/data/edison/Coll/UnbalancedSet, hslibs/data/edison/Coll/TestOrdSet, hslibs/data/edison/Seq/TestSeq - rename 64-bit 'primop' funs that now live in lib/std/cbits/longlong.c back to what they used to be called (i.e., prefixed with "stg_"). Why? - less likely they'll clash with other (user supplied) entry points at link-time. - matches protos in ghc/includes/PrimOp.h
* [project @ 2001-07-13 13:40:48 by rrt]rrt2001-07-131-0/+76
| | | | Function stubs for ILX
* [project @ 2001-07-13 13:40:26 by rrt]rrt2001-07-131-3/+6
| | | | Add StgPrimFloat.c for ILX
* [project @ 2001-07-13 11:11:34 by rrt]rrt2001-07-131-1/+2
| | | | Explain why errno is imported via a function
* [project @ 2001-07-13 11:03:47 by rrt]rrt2001-07-131-0/+89
| | | | | Move 64-bit arithmetic support into std_cbits; there's no reason for it to be in the RTS.
* [project @ 2001-07-12 10:34:54 by rrt]rrt2001-07-121-7/+1
| | | | | | | | | | Remove addrOf_ErrorHdrHook, as the NCG now can (or should) cope with foreign labels, and in any case, we don't use the NCG to build the standard library. The motivation for this fix is preventing HSstd_cbits depending on the RTS, so that it can be built as a DLL (for .NET) without needing to get the RTS built as a DLL (that way lies madness).
* [project @ 2001-07-09 16:30:50 by sof]sof2001-07-091-2/+2
| | | | get rid off gcc warning
* [project @ 2001-07-05 13:01:14 by rrt]rrt2001-07-051-2/+2
| | | | | | Change HSLIB to PACKAGE and HSLIB_DEPS to PACKAGE_DEPS, which makes more sense. Also unbreaks the build system, in an arse-about-face sort of way (or, if you prefer, cart-before-horse).
* [project @ 2001-06-29 11:40:48 by simonpj]simonpj2001-06-291-2/+8
| | | | Share handles with creator so that error messages come out
* [project @ 2001-06-29 11:35:14 by simonpj]simonpj2001-06-291-1/+4
| | | | Add comments