Commit Graph

4708 Commits

Author SHA1 Message Date
Oliver Tappe
40135926f9 Adjust glibc's definition of mbstate_t
* instead of unification, we now keep both our and glibc's fields
  separate in order to allow for both our code and glibc's to use
  such a struct at the same time (independently)
2012-02-07 21:43:02 +01:00
Oliver Tappe
0d03f689b2 Fix crash in fwide():
* _IO_USER_BUF was being used to indicate a user-owned buffer without
  taking into account that there are two of those: one for the normal
  and another one for the wide version of a stream. Backport
  _IO_FLAGS2_USER_WBUF from current glibc version to fix that.
2012-02-07 21:43:01 +01:00
czeidler
610ef6c007 Finally applying the patch that adds support to add path information to stat and attr monitor messages.
* for all open FD the path information is stored in a map
* this info is used to fill the missing fields in the node monitor
2012-01-22 17:34:17 +13:00
Alexander von Gluck IV
8dd1e875c1 kernel: Fix FPU SSE + MMX instruction usage.
* Rename init_sse to init_fpu and handle FPU setup.
* Stop trying to set up FPU before VM init.
  We tried to set up the FPU before VM init, then
  set it up again after VM init with SSE extensions,
  this caused SSE and MMX applications to crash.
* Be more logical in FPU setup by detecting CPU flag prior
  to enabling FPU. (it's unlikely Haiku will run on
  a processor without a fpu... but lets be consistant)
* SSE2 gcc code now runs (faster even) without GPF
* tqh confirms his previously crashing mmx code now works
* The non-SSE FPU enable after VM init needs tested!
2012-01-20 15:06:01 -06:00
Jérôme Duval
c59b279b71 Added workarounds and options for gcc 4.6.2
* add -Wno-unused-but-set-variable for gcc 4.6.x with a TODO
* fix warnings about wrong size of pointer cast in ioapic.cpp and AudioBuffer.cpp
2012-01-19 19:44:42 +01:00
Jérôme Duval
c40f31867b Fix with enabled tracing. 2012-01-19 18:28:34 +01:00
Oliver Tappe
174676503b Drop now unneeded glibc wchar-files (plus others). 2012-01-07 22:03:24 +01:00
Oliver Tappe
b7417fbec1 Switch wchar from glibc to our own implementations. 2012-01-07 22:02:48 +01:00
Oliver Tappe
7efc2e3a0e Add our own implementations for all wchar.h functions.
* add implementation for wcpcpy(), wcpncpy(), wcscasecmp(), wcscat(),
  wcschr(), wcscmp(), wcscpy(), wcscspn(), wcsdup(), wcslcat(),
  wcslcpy(), wcslen(), wcsncasecmp(), wcsncat(), wcsncmp(), wcsncpy(),
  wcsnlen(), wcspbrk(), wcsrchr(), wcsspn(), wcsstr(), wcstok(),
  wmemchr(), wmemcmp(), wmemcpy(), wmemmove(), wmemset
* add implementations for GNU-extensions used by our glibc and some
  other programs/libs: wcschrnul(), wmempcpy()
* add stub for wcsftime()
2012-01-07 22:01:40 +01:00
Oliver Tappe
d7965519f2 Cleanup: LocaleBackend.h is not a local header for wchar. 2012-01-07 21:48:39 +01:00
Oliver Tappe
bd55dcbefb Add our implementation for wcscoll() and wcsxfrm().
* add Wcscoll() and Wcsxfrm() ICU locale backend
* provide implementations of wcscoll() and wcsxfrm() that are using
  the respective methods of the locale backend
2012-01-07 21:47:31 +01:00
François Revol
8e977a874f M68K: Only enumerate ST modes as fallback. 2012-01-05 01:44:38 +01:00
François Revol
595938e710 M68K: Don't trace mmu boot code anymore 2012-01-05 01:44:37 +01:00
François Revol
68aea33966 Try another load address for PPC CFE loader.
This is the address the OpenFirmware is loaded to by CFE on the Amiga X-1000.
Doesn't seem to help much though.
2012-01-05 01:03:28 +01:00
Philippe Saint-Pierre
4040b622f4 VM: Memory leak fix in case of bad driver settings file
CID 5891.
2012-01-02 22:12:09 -05:00
Fredrik Holmqvist
9aec8e8424 Remove strlen from PPC glibc as well.
This should fix the PPC build. Sorry for that, k thx bye.
2011-12-31 21:32:57 +01:00
Philippe Saint-Pierre
a42c52c07e devfs: Fix memory leak
Following r25662 (where devfs was migrated to the new driver architecture),
the issue noted in CID 872 and already fixed in r25643 was reintroduced.
2011-12-30 20:50:48 -05:00
Philippe Saint-Pierre
d2a423e499 driver_settings: Replace type of bufferSize from size_t to ssize_t
At various locations, checks are made so that bufferSize is >= 0, which never
occurs. CID 4197.
2011-12-29 14:08:15 -05:00
Fredrik Holmqvist
79423142ff Stylefixes as pointed out by Axel and some minor changes possible in cpp.
No functional change.
2011-12-29 18:59:00 +01:00
Fredrik Holmqvist
87dfde44f7 Stop using glibc's asm strlen and use our own.
Mostly done because olta want less dependency on glibc.
It should also make porting a tiny bit simpler.

Testresults, mean values on Haiku from libMicro:
 * with glibc: strlen_10: 0.03859S, strlen_1k: 1.67075S.
 * with strlen.cpp: strlen_10: 0.03854S, strlen_1k: 1.66938S.

So at least on my machine it's possible to beat glibc ;)
2011-12-29 17:41:03 +01:00
Fredrik Holmqvist
55cf69968f Rename strlen.c strnlen.c to strlen.cpp strnlen.cpp.
No changes in the files themselves in this commit.
2011-12-29 15:43:23 +01:00
Oliver Tappe
f4995c1381 Improve timezone names returned by POSIX functions.
* Use TimeZone::SHORT specifier instead of SHORT_COMMONLY_USED, since
  the former yields more appropriate (textual) values. Strangely enough,
  it used to be the other way around, which is why we didn't used SHORT
  in the past.
2011-12-27 14:14:55 +01:00
Fredrik Holmqvist
7928259c69 Style fixes. No functional changes.
* Parameter renamed from s to string.
 * HasZeroByte renamed to LACKS_ZERO_BYTE and the check is inverted.
 * Removed space between cast and variable.
2011-12-26 18:24:22 +01:00
Fredrik Holmqvist
11048d3619 Reworked strlen and strnlen to follow style guide.
Fix problems pointed out by Marcus.
2011-12-25 17:00:31 +01:00
Fredrik Holmqvist
753a02c156 Reworked strlen and strnlen to look at four bytes at the time. From what I understand this should be safe.
Based on info from bit twiddling hacks: http://graphics.stanford.edu/~seander/bithacks.html
2011-12-24 22:27:44 +01:00
Oliver Tappe
2ba22cc36a Fix crash of AboutSystem on gcc4.
* Glibc declares and uses its own version of mbstate_t, which is
  incompatibly with our own. Mix our own fields into glibc's
  mbstate_t, such that the two structs are compatible.
2011-12-19 18:49:16 +01:00
Oliver Tappe
ec99f3b2a6 Adjust mbstate_t to embed the state of the ICU converter.
* make room in mbstate_t for containing an ICU-converter's state
  (well, in fact the whole converter object)
* adjust libroot's locale add-on to clone converters into a given
  mbstate_t directly
* adjust ICUThreadLocalStorageValue to contain the converter pointer
  instead of a converter-ID (if the converter is related to an
  mbstate_t, it points into the mbstate_t).
* adjust users of converters to directly use converter pointers
  instead of ICUConverterRef
* drop now unused ICUConverterManager and ICUConverterRef
* update gcc4 optional package

This brings our multibyte implementation into a fully working state,
both non-ascii and non-8-bit characters can now be handled normally
in the Terminal, i.e. this finally fixes #6276.

N.B.: Since the size of mbstate_t has changed, everything (including
the compiler!) needs to be rebuilt.
2011-12-15 13:18:11 +01:00
John Scipione
0e35d5d2e5 Change instances of wether in comments to whether. No functional change intended. 2011-12-12 14:41:49 -05:00
Oliver Tappe
5de93d5b1f Adjust libroot to invoke internal (__...) mbs-functions. 2011-12-12 17:27:44 +01:00
Oliver Tappe
8703b5fdf5 Fix gcc4-build and handling of src-pointer upon error.
* the reference to MB_CUR_MAX requires stdlib.h
* if an conversion error occurs, the returned src pointer must point to
  the character that triggered the error
2011-12-12 17:27:44 +01:00
Oliver Tappe
70dda8d85a Fix POSIX-specific mbsrtowcs() and wcsrtombs().
* src was sometimes accessed incorrectly (needs double dereference)
* the source pointers may only be adjusted in case there is the
  destination pointer is not NULL
2011-12-12 17:27:43 +01:00
Oliver Tappe
0ad71bca30 Simplify wcrtomb() wrapper.
* since the backend now supports it, we can safely pass NULL as s
  to the backend
2011-12-12 17:27:43 +01:00
Oliver Tappe
47e0423a09 Drop public symbols for mbsnrtowcs() and wcsnrtombs().
We only implement POSIX_VERSION 199009, so these needn't be exported.
2011-12-12 17:27:43 +01:00
Oliver Tappe
0cf89c88d3 Activate our own wcs*tombs()-functions.
* add our own version of these functions to the build
* drop the glibc implementations of those functions
2011-12-12 17:27:42 +01:00
Oliver Tappe
995d6d827f Implement our own version of wcsrtombs().
* add WcharStringToMultibyte() to libroot's locale backend
* implement wcstombs(), wcsrtombs() and wcsnrtombs() on top of that
  new backend function
2011-12-12 17:27:42 +01:00
Oliver Tappe
b8b6531011 Add implementation for mbstowcs().
* implement mbstowcs() on top of mbsrtowcs()
* drop glibc's version of mbstowcs()
2011-12-12 17:27:42 +01:00
Oliver Tappe
73186b2fcd Add implementation of mbsrtowcs() to our locale backend.
* add MultibyteStringToWchar() to ICU locale backend
* implement mbsrtowcs() and mbsnrtowcs() on top of 
  MultibyteStringToWchar()
* drop respective glibc files
2011-12-12 17:27:41 +01:00
Oliver Tappe
d0e7bc307c Reset ICU-converter in case of error. 2011-12-12 17:27:41 +01:00
Oliver Tappe
cf13327bef Whitespace cleanup. 2011-12-12 17:27:40 +01:00
Michael Lotz
6ef7d359c7 ASSERT() that there really aren't any wired pages. 2011-12-11 17:08:10 +01:00
Michael Lotz
af09f123d3 Create the right cache type ([non-]swappable) on copy on write.
When forking a team, copy on write areas (and therefore caches) are
created for all the areas in the parent team, but they were always
created as swappable. If the parent team had some B_FULL_LOCK areas,
which aren't swappable, the wrong type of cache would be created which
lead to them not being mergeable later on (causing a panic).

Comments about a possibly cleaner way to figure out the cache type
would be welcome.
2011-12-11 17:08:10 +01:00
Jérôme Duval
86216323af Fixed math.h part of #2696
* added lgammal_r wrapper
* removed gamma_r and gammaf_r functions from math.h
2011-12-11 12:28:53 +01:00
Jérôme Duval
04fccd250f added hcreate, hdestroy, hsearch from glibc 2011-12-11 10:49:18 +01:00
Michael Lotz
44c3f5c188 Clean up the mess added in hrev43461 and solve it differently.
* Define a MEMALIGN macro that is either just defined to malloc() or
  to the actual memalign() depending on where KMessage is used. We only
  use memalign() inside the kernel and libroot.
* Add a comment to the macro explaining that this allows the use of
  special heap implementations that might return unaligned buffers for
  debugging purposes.
2011-12-10 23:20:18 +01:00
Michael Lotz
e339322a88 Fix hrev43405 by moving the reference above the autolocker.
The change in hrev43405 wasn't correct, as it put the reference
object definition after the one of the corresponding locker, causing
the reference to be released before the unlock would happen.

Finally fixes #8187. Thanks Ingo for pointing that out.
2011-12-10 21:35:40 +01:00
Michael Lotz
5585262bb1 Revert hrev43455 and instead just align the size.
While this isn't really correct, it works for the use case it is
intended and doesn't open the can of worms we get when trying to do
memalign() across platforms (due to build tools use of KMessage).
2011-12-10 21:03:14 +01:00
Michael Lotz
33f0ed7a03 Revert hrev43457.
This reverts commit 82929f8a76.
2011-12-10 21:03:13 +01:00
Michael Lotz
8eff10a8bf Revert hrev43458.
This reverts commit 80e6a84bf0.
2011-12-10 21:03:13 +01:00
Michael Lotz
a173514ad1 Revert hrev43459.
This reverts commit c8a48d783c.
2011-12-10 21:03:12 +01:00
Michael Lotz
c8a48d783c Same as hrev43457 (- the error) but for the bootloader heap. 2011-12-10 19:15:10 +01:00