Hendiadyoin1
009b196a04
LibC: Add x86_64 Registers
2021-03-21 09:35:23 +01:00
Itamar
ae67cabe11
CMake: Make libc.a self-contained
...
Previously, libc.a contained undefined symbols from ssp and libsystem,
which caused static compilation to fail.
We now generate libc.a with a custom CMake rule that combines all
object files from libc, ssp and libsystem to form libc.a
Closes #5758 .
2021-03-19 22:55:53 +01:00
Jean-Baptiste Boric
7a079f7780
LibC+Kernel: Switch off_t to 64 bits
2021-03-17 23:22:42 +01:00
thatdutchguy
10e3e8f6d4
Kernel: Add _SC_CLK_TCK to sysconf.
...
Unbreaks the hatari port.
2021-03-16 21:56:47 +01:00
Ben Wiederhake
430e7fb181
LibC: Rename feclearexcept{s,}
...
This will also help with making ports compile again :D
https://github.com/SerenityOS/serenity/pull/5762#issuecomment-798779561
2021-03-14 11:30:38 +01:00
Andreas Kling
ef1e5db1d0
Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
...
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Ben Wiederhake
bceb98e2df
Userland: Remove superfluous headers
...
Userland has no reason to access 'kmalloc'.
2021-03-11 12:32:53 +01:00
Andreas Kling
9588f01739
UserspaceEmulator+LibC: Use sys$emuctl() to pass malloc info to UE
...
Get rid of the awkward secret handshake sequence between malloc and UE
and simply use sys$emuctl() to notify UE of malloc, free and realloc.
2021-03-09 11:31:18 +01:00
Andreas Kling
4faeaf101c
LibC: Don't scrub memory in malloc/free when running in UE
...
Since UE is keeping track of the heap anyway, we can skip the scrubbing
and drastically improve the speed of malloc and free when emulating.
2021-03-09 08:59:10 +01:00
Mițca Dumitru
a13f2b7df3
LibC: Add defines to float.h
...
This doesn't define FLT_EVAL_METHOD as I'm not sure what I should actually use for that
2021-03-09 07:28:06 +01:00
Mițca Dumitru
857b0e1dc3
LibC: Add imaxdiv and lldiv
2021-03-09 07:28:06 +01:00
Mițca Dumitru
5265a2d23e
LibC: Remove stdbool.h as it is provided by the compiler
2021-03-08 08:56:15 +01:00
Mițca Dumitru
35829304d6
LibC: Define static_assert in assert.h when it's being used in C
2021-03-08 08:56:15 +01:00
Mițca Dumitru
a13e8d49cf
LibC: Fix typo in fenv.h
...
`FE_TOWARDSZERO` is actually spelled `FE_TOWARDZERO` (without the 'S')
2021-03-04 19:40:40 +01:00
William McPherson
2479ead718
Everywhere: Remove unnecessary clang-format off
s
...
Mostly due to the fact that clang-format allows aligned comments via
AlignTrailingComments.
We could also use raw string literals in inline asm, which clang-format
deals with properly (and would be nicer in a lot of places).
2021-03-04 11:01:48 +01:00
Mițca Dumitru
00ef931f79
LibC: Implement fenv.h
2021-03-01 09:14:26 +01:00
AnotherTest
f05e518cbc
LibRegex: Implement section B.1.4. of the ECMA262 spec
...
This allows the parser to deal with crazy patterns like the one
in #5517 .
2021-02-27 07:31:01 +01:00
Andreas Kling
eb08a0edd5
LibC: Make it compile on 64-bit
...
It won't actually work on 64-bit yet, but let's do our future selves
a favor and make it compile.
2021-02-25 16:27:12 +01:00
Andreas Kling
8714f389f9
LibC: Add x86_64 implementation of setjmp() and longjmp()
2021-02-25 16:27:12 +01:00
Andreas Kling
bb9cf083c4
LibC: Avoid double memory clearing in calloc()
...
calloc() was internally calling malloc_impl() which would scrub out
all the allocated memory with the scrub byte (0xdc). We would then
immediately zero-fill the memory.
This was obviously a waste of time, and our hash tables were doing
it all the time. :^)
2021-02-24 23:03:38 +01:00
Andreas Kling
7db8ccc0e4
LibC+DynamicLoader: Move "transactional memory" GCC stubs to LibC
...
Instead of having a special case in the dynamic loader where we ignore
TM-related GCC symbols, just stub them out in LibC like we already do
for various other things we don't support.
2021-02-24 14:54:26 +01:00
Andreas Kling
679cc154e6
Everywhere: Remove unused RELEASE_ASSERT macro
2021-02-23 21:11:53 +01:00
Andreas Kling
5d180d1f99
Everywhere: Rename ASSERT => VERIFY
...
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
AnotherTest
43948aee51
LibC: Don't #define away __{BEGIN,END}_DECLS in stdarg.h
...
That would force anything that includes this to have language-specific
linkage, and absolutely break `sys/cdefs.h`.
Fixes #5452 .
2021-02-21 18:27:50 +01:00
Andreas Kling
8d98051551
AK+LibC: Remove dbgprintf() :^)
...
Everything has been moved to dbgln() or other AK::Format-based APIs.
We can finally get rid of this old thing.
2021-02-20 17:17:30 +01:00
Linus Groh
edec5e29a3
LibC: Remove serenity.h.rej
2021-02-18 09:23:11 +01:00
jonno85uk
83d880180e
LibC: Use "static inline" for inline functions in arpa/inet.h ( #5392 )
...
This makes it work when compiling as C.
2021-02-18 00:02:47 +01:00
Andreas Kling
403b34d38e
LibC: Convert dbgprintf() => dbgln() in SSP handler
2021-02-17 15:48:55 +01:00
Andreas Kling
dffab4e034
LibC: Convert dbgprintf() => dbgln()
2021-02-17 15:39:32 +01:00
AnotherTest
e438dd3c9b
LibC: Teach scanf how to read "%lu" and "%llu" (unsigned long{, long})
...
This makes the gcc port work again.
2021-02-16 10:38:52 +01:00
Ben Wiederhake
b3f0a5c917
LibC: Fix typo in comment
2021-02-15 22:09:01 +01:00
AnotherTest
8bc1bcb34b
LibC: Reimplement scanf from the ground up
...
This adds support for some previously unsupported features
(e.g. length modifiers) and fixes at least one FIXME.
Fixes #90 .
2021-02-15 17:32:56 +01:00
AnotherTest
0bf496f864
LibC: Make strtoull accept the '0x' prefix when base 16 is specified
...
Dr.POSIX says it should be.
2021-02-15 17:32:56 +01:00
AnotherTest
5729e76c7d
Meta: Make it possible to (somewhat) build the system inside Serenity
...
This removes some hard references to the toolchain, some unnecessary
uses of an external install command, and disables a -Werror flag (for
the time being) - only if run inside serenity.
With this, we can build and link the kernel :^)
2021-02-15 17:32:56 +01:00
AnotherTest
bb777459a0
LibC+LibPthread: Implement pthread_atfork()
...
This required a bit of rearchitecture, as pthread_atfork() required a
mutex, and duplicating a mutex impl for it was silly.
As such, this patch moves some standalone bits of pthread into LibC and
uses those to implement atfork().
It should be noted that for programs that don't use atfork(), this
mechanism only costs two atomic loads (as opposed to the normal mutex
lock+unlock) :^)
2021-02-15 17:32:56 +01:00
AnotherTest
8e074f8665
LibC+LibPthread: Implement pthread_rwlock_*
...
This implementation is pretty damn dumb, and probably has more bugs than
features.
But for the time being, it seems to work. however, we should definitely
replace it with a good implementation sometime very soon :^)
2021-02-15 17:32:56 +01:00
AnotherTest
26a8a84ded
LibC+LibPthread: Stub out pthread_rwlock_* functions
2021-02-15 17:32:56 +01:00
AnotherTest
9e2c37a8b2
LibC: Add 'cfmakeraw()'
2021-02-15 17:32:56 +01:00
AnotherTest
0c07c005b5
LibC: Stub out some addrinfo things
2021-02-15 17:32:56 +01:00
AnotherTest
4519950266
Kernel+LibC: Add the _SC_GETPW_R_SIZE_MAX sysconf enum
...
It just returns 4096 :P
2021-02-15 17:32:56 +01:00
AnotherTest
71054c4c06
LibC: Add reentrant versions of getpw{uid,nam}
...
Pretty hacky, but it should be fine.
2021-02-15 17:32:56 +01:00
AnotherTest
a3a7ab83c4
Kernel+LibC: Implement readv
...
We already had writev, so let's just add readv too.
2021-02-15 17:32:56 +01:00
AnotherTest
1e79c04616
Kernel+LibC: Stub out SO_{SND_RCV}BUF
2021-02-15 17:32:56 +01:00
AnotherTest
2db4ab80a2
LibC: Pull fd_set.h into unistd.h
2021-02-15 17:32:56 +01:00
AnotherTest
9b69c73dfe
LibC: Stub out semaphore.h
2021-02-15 17:32:56 +01:00
Andreas Kling
781d29a337
Kernel+Userland: Give sys$recvfd() an options argument for O_CLOEXEC
...
@bugaevc pointed out that we shouldn't be setting this flag in
userspace, and he's right of course.
2021-02-14 10:39:48 +01:00
Andreas Kling
3c7782fdbe
LibC: Remove FIXME spam in setlocale()
2021-02-11 23:31:56 +01:00
Linus Groh
2b03e95354
LibC: Define ICMP header type constants in netinet/ip_icmp.h
...
Let's get rid of some magic numbers soon. :^)
2021-02-08 20:00:08 +01:00
AnotherTest
09a43969ba
Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...)
...
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
2021-02-08 18:08:55 +01:00
Ben Wiederhake
de947acaf9
AK: Clean up includes around printf/vdbgprintf
2021-02-08 18:03:57 +01:00