Commit Graph
100 Commits
Author SHA1 Message Date
Adrien Destugues 515d86dace debug_server: build a new debug window
Use radio buttons laid out vertically so that locales with long labels
(no short word for "write core file") can still look nice. This is open
for experiment, buttons laid out vertically are another option. At least
now we have a window t work from, as BAlert doesn't cut it here.

While I'm at it, use a ladybug icon for this one, so it's visibly
different from normal application alerts.

Change-Id: I08ba9573f132901484224e107404348e7dca97f4
Reviewed-on: https://review.haiku-os.org/c/1459
Reviewed-by: waddlesplash <[email protected]>
2019-06-08 16:24:17 +00:00
PulkoMandy 7048289678 openfirmware: fix jamfiles
Without the MultiArchDirSetup, these would not use the boot cflags, and
end up being compiled position-independant. Of course, the a.out format
does not allow relocations, so this could not work.

Change-Id: I6bb570e545f1533200511e6881f71feedb77025b
Reviewed-on: https://review.haiku-os.org/c/1481
Reviewed-by: waddlesplash <[email protected]>
2019-05-25 18:16:35 +00:00
PulkoMandy cdbda49e88 sparc: fix openfirmware entry point.
According to the IEEE standard documentation, the OpenFirmware entry
point should be in %o3. But that doesn't work, and both FreeBSD and
NetBSD expect it in %o4 (5th argument of the function). I suspect this
was changed for 64bit sparc, but neither the sparc nor 64bit
openfirmware specs mention it.

Move the sparc and powerpc specific parts out of the generic start.cpp
for openfirmware as they each have some specificities. More
specifically:
- sparc already clears bss for us
- entry point arguments are different
- determine_machine is of course platform specific

Change-Id: Icaa05087e88ea4d29198e3565223459aed75cdf9
Reviewed-on: https://review.haiku-os.org/c/1470
Reviewed-by: waddlesplash <[email protected]>
2019-05-25 18:16:35 +00:00
PulkoMandy 906c14da63 sparc: use generic w_sqrtl.c implementation.
I accidentally imported a newer version of the file that does the same
thing as the existing one.

Change-Id: Ifab3b24218f017cc57a459e0467cb8225accd9e5
Reviewed-on: https://review.haiku-os.org/c/1368
Reviewed-by: waddlesplash <[email protected]>
2019-05-25 18:16:35 +00:00
PulkoMandy 864a3f996b sparc: do not leave a hole between .text and .data
The a.out format does not allow to handle this properly. So we need the
two sections to be contiguous.

Change-Id: I44455d4fb728bd47d5dcebc48c52b7d90d808104
Reviewed-on: https://review.haiku-os.org/c/1469
Reviewed-by: waddlesplash <[email protected]>
2019-05-25 18:16:35 +00:00
PulkoMandy 94ba4f6406 sparc: fix bootloader executable format
- The entry point has to be at the start of the text section
- Use the correct formqt ("impure") for the a.out file
- Strip all symbols (the bootloader isn't relocatable)

Change-Id: I2b973c39eaf1416f874bf1b2668b1e3090eb5f7b
Reviewed-on: https://review.haiku-os.org/c/1468
Reviewed-by: waddlesplash <[email protected]>
2019-05-25 18:16:35 +00:00
Adrien Destugues 66cb2efaa8 Move StripeView to libshared
Change-Id: Ib8ff2f731f9d34e04854f1c2ec288a3db1036793
Reviewed-on: https://review.haiku-os.org/c/1458
Reviewed-by: Rene Gollent <[email protected]>
2019-05-21 06:55:45 +00:00
Adrien Destugues 33fc4f4063 Revert "debug_server: Remove the "Write core file" button."
This reverts commit 02079c66f3.

Change-Id: I95a4bbef67e2a982da49a18105a4cbd85c4e11e9
Reviewed-on: https://review.haiku-os.org/c/1457
Reviewed-by: Rene Gollent <[email protected]>
2019-05-21 06:55:45 +00:00
Adrien Destugues d4b3a3277d SerialConnect: implement PopLine to get items from scrollback
Allows to make the scrollback visible again when resizing, instead of
adding blank lines at the bottom.

Change-Id: I7a14188cdcb14bcd197325b935d8cfe2435ae80f
Reviewed-on: https://review.haiku-os.org/c/1464
Reviewed-by: waddlesplash <[email protected]>
2019-05-19 14:00:48 +00:00
Adrien Destugues 1eb386084c SerialConnect: add a clear/reset menu.
Change-Id: I0435ba679e19094d201d65ac0c6290cd194ec344
Reviewed-on: https://review.haiku-os.org/c/1463
Reviewed-by: waddlesplash <[email protected]>
2019-05-19 13:46:19 +00:00
Adrien Destugues 506f9764d4 Some notes about openboot.
As I keep looking for the commands to do anything...

Next step is to figure out network booting and set up an easy way to
test haiku_loader.
2019-05-19 14:31:21 +02:00
PulkoMandy 00b283c042 Fix long double support for ARM.
Fixes #15056.

Change-Id: I48c00b955346971aa88b731ccad1953a4044983d
Reviewed-on: https://review.haiku-os.org/c/1442
Reviewed-by: Alex von Gluck IV <[email protected]>
2019-05-08 20:14:25 +00:00
Adrien Destugues a92e224f9a listusb: add some standard subclass codes
From https://www.usb.org/defined-class-codes

Change-Id: Icd029ff2078650fad3c2fa90f1d82cf80b0662b0
Reviewed-on: https://review.haiku-os.org/c/1423
Reviewed-by: Rene Gollent <[email protected]>
2019-04-30 17:20:13 +00:00
Adrien Destugues 088cebb96f BFileGameSound: remove annoying printf.
Change-Id: If12c4031e7ec245a79cca51fe1304f6cc21f28e4
Reviewed-on: https://review.haiku-os.org/c/1415
Reviewed-by: Stefano Ceccherini <[email protected]>
2019-04-28 07:32:42 +00:00
Adrien Destugues 53830ab75a DriveSetup: disable 'Open with diskprobe' when no partition selected
This was part of the original DriveSetup patch but I missed it when
splitting it in smaller parts.
2019-04-11 18:03:14 +02:00
PulkoMandy 8586b74cfc sparc: fix versions mismatches in HaikuPortsCross
Change-Id: Id733ccb211ca7eb47a104727be8045497190d551
Reviewed-on: https://review.haiku-os.org/c/1400
Reviewed-by: waddlesplash <[email protected]>
2019-04-09 18:20:44 +00:00
PulkoMandy 0788d17ae2 Fix missing absolute dir.
The variable is used after a "cd" so it must be absolute.

Change-Id: I8d591b8642179603249ac56a1fcac082f29c870c
Reviewed-on: https://review.haiku-os.org/c/1387
Reviewed-by: waddlesplash <[email protected]>
2019-04-06 17:37:25 +00:00
PulkoMandy b1ec65fcfe sparc: link the runtime_loader
Change-Id: Id30476480f4e4141935d6735209ecc0872dd6696
Reviewed-on: https://review.haiku-os.org/c/1367
Reviewed-by: waddlesplash <[email protected]>
2019-04-04 20:31:25 +00:00
PulkoMandy 1cba023e0a sparc: fix support for elf in boot mode
Change-Id: I901a4e494dd5273a0aa433f08b94363b486c58e1
Reviewed-on: https://review.haiku-os.org/c/1366
Reviewed-by: waddlesplash <[email protected]>
2019-04-04 20:31:25 +00:00
PulkoMandy 815a1596a6 openfirmware: support a.out bootloader
Apparently each architecture and manufacturer uses a different binary
format (I heard current POWER hardware uses elf).

Change-Id: I4f1b9977d0a9d5a700c2d50b36844d6e4640b68b
Reviewed-on: https://review.haiku-os.org/c/1365
Reviewed-by: waddlesplash <[email protected]>
2019-04-04 20:31:25 +00:00
PulkoMandy fea91fdc77 sparc: pci bus manager
Copied from PPC with the hooks for Apple hardware removed.
To be completed with the actual PCI bus implementation for Sun machines.
This is where we start doing machine specific stuff, apparently.

Change-Id: I06af4de9621e9d40593d153642478d928083e49a
Reviewed-on: https://review.haiku-os.org/c/1364
Reviewed-by: waddlesplash <[email protected]>
2019-04-04 20:31:25 +00:00
PulkoMandy d0ff1a1f2f openfirmware: fix mismatched prototype
Change-Id: I294608aa739bedef47c6c1f34fba0241444a8901
Reviewed-on: https://review.haiku-os.org/c/1363
Reviewed-by: waddlesplash <[email protected]>
2019-04-04 20:31:25 +00:00
PulkoMandy 2f2d56e2e3 Move stack_trace.cpp to generic directory.
4 architectures are using it, so it is generic enough.
Make it error out for platforms where the stack grows in the other
direction. Another implementation can be added for them.

Change-Id: Ia52b5dd34da7b5ebcca0782af079c43d72ba3a8e
Reviewed-on: https://review.haiku-os.org/c/1340
Reviewed-by: waddlesplash <[email protected]>
2019-04-04 20:31:25 +00:00
PulkoMandy e8f58ba4be sparc: fix bootloader build
- Add various missing jamfiles
- Add required implementation stubs
- Update openfirmware jamfiles for multiboot support
- Update linker rules for sparc loader

Change-Id: I2d06c7a4d33827f58d82946687003f9a0dcb1b7d
Reviewed-on: https://review.haiku-os.org/c/1329
Reviewed-by: waddlesplash <[email protected]>
2019-04-04 20:31:25 +00:00
PulkoMandy 8ff82ee2d4 sparc: fix debug support
Declare and use the correct registers to define a stack frame.

Change-Id: Ice3ba8f8715313a715f6b1cb553a6883541f5cc4
Reviewed-on: https://review.haiku-os.org/c/1327
Reviewed-by: Alex von Gluck IV <[email protected]>
2019-03-30 15:23:15 +00:00
PulkoMandy 3bfbec8336 sparc: More missing defines in platform headers
* Kernel is 64 bit, and we won't need a 32bit load base.

Change-Id: I729bab01c8f71083002db061e153b0e5052b9a1c
Reviewed-on: https://review.haiku-os.org/c/1326
Reviewed-by: Alex von Gluck IV <[email protected]>
2019-03-30 15:23:15 +00:00
PulkoMandy 5ef707395a sparc: fix some 64bit intolerant code
Change-Id: I90bea483d7cf18696a6d5d2f18e8cada409884a2
Reviewed-on: https://review.haiku-os.org/c/1325
Reviewed-by: Alex von Gluck IV <[email protected]>
2019-03-30 15:23:15 +00:00
PulkoMandy ddf7e72f86 loader: Do not assume ELF32 for any non-EFI target.
sparc is 64bit even at the bootloader stage.

Change-Id: Idbf39497503aac08e72c691cf655e97f95347784
Reviewed-on: https://review.haiku-os.org/c/1324
Reviewed-by: Alex von Gluck IV <[email protected]>
2019-03-30 15:23:15 +00:00
PulkoMandy f23db0edb5 sparc: add to known architectures in configure script
Change-Id: Ic6cfdd2a94c8d6c0a7f4963fe892f8dc73e97afd
Reviewed-on: https://review.haiku-os.org/c/1323
Reviewed-by: Alex von Gluck IV <[email protected]>
2019-03-30 15:23:15 +00:00
PulkoMandy 1e4172254d sparc: fill in HaikuPorts file.
Change-Id: I7aef31e72a826936c45e3644a72eb0598386f1ae
Reviewed-on: https://review.haiku-os.org/c/1309
Reviewed-by: Alex von Gluck IV <[email protected]>
2019-03-26 20:41:46 +00:00
PulkoMandy 464b202703 sparc: add float/double swapping functions.
Change-Id: I07590af796d689b5e97c03a97727edfd58f5a811
Reviewed-on: https://review.haiku-os.org/c/1183
Reviewed-by: waddlesplash <[email protected]>
2019-03-26 20:41:46 +00:00
PulkoMandy c3ba570c08 remove unused byteswap functions.
We need these only for gcc2, which doesn't have builtins.
Only swapping floats and doubles remains to implement for all
architectures.

Change-Id: I60e39ad42d4ef762f3324f934f2996dde1412f1a
Reviewed-on: https://review.haiku-os.org/c/1182
Reviewed-by: waddlesplash <[email protected]>
2019-03-26 20:41:46 +00:00
PulkoMandy 4b2da9c371 glibc: cleanup long double support
- Add 128 bit long double support from current glibc and a few headers
  they need
- Move the existing 80 bit float support in a sub directory of generic,
  it is not universal to all archs (see file added in docs/develop/arch).
  Also include some new .h files for x86 that are needed after these
  changes (from newer versions of the glibc).
- Adjust Jamfiles for m68k, x86 and x86_64 to use the 80bit format
- Do not adjust arm jamfiles, it was wrongly using 80bit long double and
  should be fixed to use 64bit instead (which means the double functions
  can be used with aliases)
- Do not adjust powerpc jamfiles, because it uses yet another format and
  we build it without long double support anyways.

Note that I moved only the files that were creating compile errors,
quite likely more of the s_* and e_* files need to be moved to the
specific directories, see glibc list here:

https://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps/ieee754/ldbl-128
https://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps/ieee754/ldbl-96

Change-Id: Ic2d8a454ba9a3b99638e4fbb63daf02df0fea403
Reviewed-on: https://review.haiku-os.org/c/1143
Reviewed-by: waddlesplash <[email protected]>
2019-03-26 20:40:50 +00:00
Adrien Destugues 8741bcf4f1 Add icon for postscript files.
Change-Id: I28bdd7abd8e8d5091104fff5a7a73787d45b1635
Reviewed-on: https://review.haiku-os.org/c/1313
Reviewed-by: humdinger <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2019-03-26 20:24:08 +00:00
Adrien Destugues 9fef538b5b DHCP: fix timeout handling
We allowed a delay only for few DHCP states. As a result, DHCP requests
would timeout immediately after sending the initial discover, and
moreover the code would then switch to "renew" state, trying to renew
without an assigned address.

The result is a quick succession of DISCOVER and empty REQUEST messages.
Eventually, the server could send us an OFFER as reply to our DISCOVER,
unless it decided that the empty REQUEST means "I'm requesting from
another server", which would lead it to cancelling its lease.

This would only work by luck on unbusy networks unlike the one I'm using
today.

Change-Id: I86905b341dc70f7dbcc780b954005e39e7c39ee0
Reviewed-on: https://review.haiku-os.org/c/1296
Reviewed-by: waddlesplash <[email protected]>
2019-03-18 17:00:13 +00:00
PulkoMandy f42cda29e8 sparc: get libroot to build
Add various stubs to fix undefined references. No implementation for
anything yet.

Change-Id: I2d398bc2369d099e3a35f0713058d6a5edc6801d
Reviewed-on: https://review.haiku-os.org/c/1138
Reviewed-by: waddlesplash <[email protected]>
2019-03-10 20:57:18 +00:00
PulkoMandy 803a4704e8 sparc: soft-float support library
No sparc implementation actually has "long double" implemented in
hardware. The instructions are defined in the spec, but they are caught
and emulated by traps.

gcc even bypasses the traps and calls the support functions directly.

Import the required functions from FreeBSD (they implement the
operations as specified in the sparc ABI) and link them into the kernel,
for now (they will also need to be in libroot).

Change-Id: Ifc21faa29fffa4bf5d3941468b62d81229a44971
Reviewed-on: https://review.haiku-os.org/c/1137
Reviewed-by: waddlesplash <[email protected]>
2019-03-10 20:57:18 +00:00
PulkoMandy 1c297254e5 sparc: cleanup netresolv
It's trying to set a field that doesn't exist.

Change-Id: Ic45b966585486d5da07ee8dace35160dac9355ed
Reviewed-on: https://review.haiku-os.org/c/1106
Reviewed-by: waddlesplash <[email protected]>
2019-03-10 20:57:18 +00:00
PulkoMandy df19aba5e9 debug_commands: align user_data to 64bits
It is cast to a struct with 64bit fields, so it should be aligned
properly.

Change-Id: I513cfba4d8fc4f4286b13edabc47fbbda3227bf6
Reviewed-on: https://review.haiku-os.org/c/1089
Reviewed-by: waddlesplash <[email protected]>
2019-03-10 20:57:18 +00:00
PulkoMandy 14ffc38e44 kernel list: use BytePointer
Change-Id: I259cc33ad71cfbabc7f85278287a64a31dcb5e44
Reviewed-on: https://review.haiku-os.org/c/1101
Reviewed-by: waddlesplash <[email protected]>
2019-03-10 20:57:18 +00:00
Adrien Destugues 810071751d BytePointer: address Axel's post-merge comments
These changes had been on review on Gerrit for a few weeks, why do the
comment come only after they were merged?

Change-Id: I54064973e08b8b4dc0624f4c09c7cafb7f04e437
Reviewed-on: https://review.haiku-os.org/c/1185
Reviewed-by: waddlesplash <[email protected]>
2019-03-10 20:41:03 +00:00
Adrien Destugues fb7498fe2e system profiler: revert use of BytePointer.
This went through review way too fast once again. I did warn that these
changes were completely untested, and indeed this one was broken. Be
very careful when pressing the submit button, please!

Change-Id: I6e0230efe94830033f5427451f67fe6ce29a28e6
Reviewed-on: https://review.haiku-os.org/c/1184
Reviewed-by: waddlesplash <[email protected]>
2019-03-10 20:41:03 +00:00
PulkoMandy d581bcba52 slab: use BytePointer
Change-Id: I786f720ccd0c1469287a70906d05633218c25ceb
Reviewed-on: https://review.haiku-os.org/c/1100
Reviewed-by: waddlesplash <[email protected]>
2019-03-09 17:09:11 +00:00
PulkoMandy 995aabb04e MessagingService: use BytePointer
Change-Id: If7890e215180206010a374b8afa9f4cd47325afc
Reviewed-on: https://review.haiku-os.org/c/1099
Reviewed-by: waddlesplash <[email protected]>
2019-03-09 17:09:11 +00:00
PulkoMandy 5bf19df235 system profiler: use BytePointer
Change-Id: I297edd8aa5f2d8d35af660d557a2c78d68afab97
Reviewed-on: https://review.haiku-os.org/c/1092
Reviewed-by: waddlesplash <[email protected]>
2019-03-09 17:09:11 +00:00
PulkoMandy 401f42f794 kernel/fs/fd: use BytePointer
Change-Id: I0fcb549d313fe7193d8e1c2b6b0a44ae4b2fcb95
Reviewed-on: https://review.haiku-os.org/c/1090
Reviewed-by: waddlesplash <[email protected]>
2019-03-09 17:09:11 +00:00
PulkoMandy 1b312d7f0a kernel/elf: use BytePointer
Change-Id: I3a40921854540d78dec025b2a349e3a153f91d55
Reviewed-on: https://review.haiku-os.org/c/1083
Reviewed-by: Adrien Destugues <[email protected]>
2019-03-09 17:09:11 +00:00
PulkoMandy eea7ceb31d Add BytePointer to help with pointer conversions
This behaves mostly like a pointer, but pointer maths works in bytes,
not the native object size.

It avoids casting to char* and back when doing byte-based pointer math,
making the code easier to read.

Change-Id: I6a8681a398345f0c7d419a2cfe7244d972ffa62f
Reviewed-on: https://review.haiku-os.org/c/1086
Reviewed-by: waddlesplash <[email protected]>
2019-03-09 17:09:11 +00:00
PulkoMandy 6823ced505 Add some notes about the sparc architecture.
Change-Id: I2fd042981d2771abdedcd3648e2eeb6e06db4253
Reviewed-on: https://review.haiku-os.org/c/1142
Reviewed-by: waddlesplash <[email protected]>
2019-03-03 21:01:12 +00:00
PulkoMandy 8bdd63fe5d Synchronize sysdep.h with current glibc
So that I can more easily import sparc headers from it.

NO_UNDERSCORES is gone and is now always the default.
Some previously arch-specific defines are now valid for all platforms.

Change-Id: If9876b241719559bdcb5cd9d8b1dc97e5e3d96b3
Reviewed-on: https://review.haiku-os.org/c/1141
Reviewed-by: waddlesplash <[email protected]>
2019-03-03 21:01:12 +00:00
PulkoMandy a7c23bb4a9 kernel/arch/sparc: stubs to get the kernel to link
Add empty implementation of timer, elf, vm, debugger support, to let the
kernel link.

Also add the kernel linker script.

Change-Id: If0795fa6554aea3df1ee544c25cc4832634ffd78
Reviewed-on: https://review.haiku-os.org/c/1108
Reviewed-by: waddlesplash <[email protected]>
2019-03-03 20:56:20 +00:00
PulkoMandy e6c9be767b sparc: interrupt management functions
Change-Id: Icc689cc0cc0075fbccdad23f77cfa53b1f32df3c
Reviewed-on: https://review.haiku-os.org/c/1107
Reviewed-by: waddlesplash <[email protected]>
2019-03-03 20:56:20 +00:00
PulkoMandy c1566b1555 sparc: more platform headers
Previous commit adding these was merged very quickly, so here's one
more...

Change-Id: I23c424db7631db1f0ec48e2d0ae47c8409ae6af2
Reviewed-on: https://review.haiku-os.org/c/1088
Reviewed-by: waddlesplash <[email protected]>
2019-03-03 20:56:20 +00:00
PulkoMandy c5769c4f6b Make -Wcast-align only a warning
On x86 and x86_64, this warning is never emitted because it is perfectly
fine to do unaligned access. On sparc, such accesses are not supported
by the hardware and will generate a SIGBUS. This must be caught by a
trap handler, and the unaligned access performed there, slowly, using
byte by byte access.

However, making this a Werror is annoying because it will trigger
everytime one casts a byte pointer to something larger, even when
alignment is actually preserved. So, removing all such warnings would be
nearly impossible (for example, just for the mergesort function, there
is a whole GSoC project for it at FreeBSD).

Keep it as a warning for now. The warning can be silenced by using
BytePointer, if desired. We should also investigate where the SIGBUS
trap is triggered a lot and consider improving the alignment of data
where possible.

Change-Id: I6b90025e8c6d69ef1ccda3c10eee270ccc1ebd29
Reviewed-on: https://review.haiku-os.org/c/1103
Reviewed-by: waddlesplash <[email protected]>
2019-03-03 20:56:20 +00:00
PulkoMandy 5f49c55851 m68k: simplify a Jamfile.
I'm copypasting a lot from this, so I may as well clean it up while I'm
at it.

Change-Id: I9288c087abbf95475f980b5539f2fd19fad7f775
Reviewed-on: https://review.haiku-os.org/c/1136
Reviewed-by: waddlesplash <[email protected]>
2019-03-03 20:56:20 +00:00
PulkoMandy d3a6abe920 sparc: freebsd_network defines
Change-Id: Ib668c69d6b506c6efaeb50d0a3e4784f836ce61a
Reviewed-on: https://review.haiku-os.org/c/1105
Reviewed-by: waddlesplash <[email protected]>
2019-03-01 11:55:38 +00:00
PulkoMandy 167f096576 sparc: update gcc package in HaikuPortsCross
Use the latest version of the compiler for bootstrap.

Change-Id: I43639b560de2d4f3dc3fed48c3d4bd32a544cb57
Reviewed-on: https://review.haiku-os.org/c/1104
Reviewed-by: Jérôme Duval <[email protected]>
2019-03-01 11:54:55 +00:00
PulkoMandy fcffcb1576 RepositoryRules: fix typo
This went through review too fast, the wrong variable name was used so
the package name was not listed...

Change-Id: I81d4aa57fdb65297ae9f63ebf123d7a6395a99b6
Reviewed-on: https://review.haiku-os.org/c/1109
Reviewed-by: waddlesplash <[email protected]>
2019-02-24 19:45:14 +00:00
PulkoMandy 6f7d94a13d vm: fix stack erase when printing 64bit value
Getting 64 bytes of data in a 32 bit variable is a bad idea

Change-Id: I760e1cfb996a9be053dbc50d6610b3e865cde65d
Reviewed-on: https://review.haiku-os.org/c/1096
Reviewed-by: waddlesplash <[email protected]>
2019-02-23 23:50:37 +00:00
PulkoMandy e12480694e bootstrap: a little more explicit error if things are wrong
There seems to be a problem with the way we set the gcc_bootstrap
package build to depend on the bootstrap package with haiku headers.
If said package cannot be built (for example some definitions are
missing for a new architecture), we end up passing an empty string as
the package to use to haikuporter.

The error message given by Haikuporter is confusing, and not easy to
investigate. So, intercept the error earlier to save time for the next
person to hit this problem.

Change-Id: I64f326e5cb3bb0d44632864ad38ad10bb88d0c7b
Reviewed-on: https://review.haiku-os.org/c/1082
Reviewed-by: waddlesplash <[email protected]>
2019-02-23 16:30:50 +00:00
Adrien Destugues 518af33f33 mmc/sd: support for SD v2.0 cards
Older cards did not implement CMD8, so handle the command stalling, and
proceed with initialization (not querying about SDHC support in that
case, as per the spec).

Change-Id: Ie842effc2f99e1adf1990b3215be79db493138b5
Reviewed-on: https://review.haiku-os.org/c/1056
Reviewed-by: waddlesplash <[email protected]>
2019-02-19 18:34:03 +00:00
Adrien Destugues ff76d2df8e sdhci and mmc implementation
sdhci:
- Add semaphore for interrupt management
- Add basic operations (setting clock, executing a command)
- Add early initialization (clocks and power up)
- Wrap the bus in a C++ class to ease usage
- Expose API to MMC bus manager
- TODO: manage card insertion and removal interrupts
- TODO: use MSI when available

mmc_bus:
- Implements SD card management independant of the way we access the bus
  (later on different drivers can provide the same API as SDHCI)
- Worker thread to do the initialization
- Implement card initialization process up until getting an RCA from the
  card. This is the generic part to assign an ID to the card, after this
  point commands can be targetted at the specific card so it can be
  handed over to the mmc_disk driver.
- TODO: initialization for non-SDHC cards which do not reply to CMD8.

Change-Id: I71950ca3ce206378a68fa7f97c19f638183d6cdd
Reviewed-on: https://review.haiku-os.org/c/1032
Reviewed-by: waddlesplash <[email protected]>
2019-02-19 18:33:25 +00:00
Adrien Destugues 8b6f4cb290 Update SDHCI and device driver docs
Change-Id: Ic64b501b7166dd718aaf12412833f912e23bc6bf
Reviewed-on: https://review.haiku-os.org/c/967
Reviewed-by: waddlesplash <[email protected]>
2019-02-16 21:46:56 +00:00
Adrien Destugues 601c0fcae2 sdhci: silently handle empty interrupts
On my system the interrupt line is shared with the PS/2 controller, so
there are a lot of unhandled interrupts. Just silently ignore them.

Change-Id: Ia6812a5a1d78907622ddebbd03165ed016e26e26
Reviewed-on: https://review.haiku-os.org/c/1031
Reviewed-by: waddlesplash <[email protected]>
2019-02-11 21:36:25 +00:00
Adrien Destugues 3aef22f7c8 sdhci: implement uninit_bus
Also avoid leaking resources in case initialization fails.

Change-Id: Ia533182eeeb81b7d52b49510b1f375a4fc55258f
Reviewed-on: https://review.haiku-os.org/c/1030
Reviewed-by: waddlesplash <[email protected]>
2019-02-11 21:36:25 +00:00
Adrien Destugues cdc4a175ca sdhci: refactor, get CMD0 working
- Define a class for each register, allowing easier access to relevant
  values. This avoids dealing with bitshifts and magic constants all
  over the code.
- Fix definition of CMD0 and the flags used to submit it. We now get a
  command completion interrupt, yay!
- Make some changes to support v3 and v4 controllers:
  - Enable PLL (harmless for older versions)
  - Manage faster and more configurable clock settings

Change-Id: I8a97edcb881acc1ac2a8b0a2593930f18e777594
Reviewed-on: https://review.haiku-os.org/c/1029
Reviewed-by: waddlesplash <[email protected]>
2019-02-11 21:36:25 +00:00
Adrien Destugues f37553039b sdhci: define all registers from spec v4.20
Change-Id: Icf71fc2864bb084292f70c2433029ad2742727c8
Reviewed-on: https://review.haiku-os.org/c/1028
Reviewed-by: Stephan Aßmus <[email protected]>
2019-02-11 16:32:55 +00:00
Adrien Destugues 899da7db5a sdhci: Cleanup of registrer dump traces
- Try to group things on a single line where it makes sense
- Use hexadecimal values where appropriate

Change-Id: Ia5ebef84db5d511ea2603dfa4ffc9e90f7e86ca7
Reviewed-on: https://review.haiku-os.org/c/1027
Reviewed-by: Stephan Aßmus <[email protected]>
2019-02-11 16:32:55 +00:00
Adrien Destugues e89985cc31 Fix drawing of B_GRAY1 bitmaps.
- Colors were reversed
- Padding was not handled properly because of a roundeing error

Add a test that shows the issue (behavior confirmed against BeOS)

Change-Id: I4c6e954fb6bdab92ad4e0e96897e78b26eb4727b
Reviewed-on: https://review.haiku-os.org/c/1025
Reviewed-by: Stephan Aßmus <[email protected]>
2019-02-10 09:59:38 +00:00
Adrien Destugues 7232789211 Extract parse_size function from ramdisk command.
Change-Id: If7dd36321e1ed2feb20b4c76ddaf303bc997d8b7
Reviewed-on: https://review.haiku-os.org/c/1018
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
2019-02-08 07:19:26 +00:00
Adrien Destugues f0a99f2bea WebPositive: check if SSE2 is available.
We cannot run if it's not, but at least let's have an understandable
error message.

Fixes #14583

Change-Id: Ibe2e5d7721a1c48f06c2ac37d007a59d80c14bab
Reviewed-on: https://review.haiku-os.org/c/1007
Reviewed-by: waddlesplash <[email protected]>
2019-02-04 16:44:50 +00:00
Adrien Destugues 71aec29751 PPM translator: use a buffer for reading
Reading the file 1 byte at a time from a BFile is very inefficient.
Add a buffer, which makes things a lot faster (parsing a 200x200 image
used to run for a few seconds with 100% CPU use).

Change-Id: Ie2eea819475c9301fbb6102c41fa05ec2d2ca343
Reviewed-on: https://review.haiku-os.org/c/906
Reviewed-by: waddlesplash <[email protected]>
2019-01-26 20:46:59 +00:00
Adrien Destugues 58913f60e8 PPM translator: read 1-bit and greyscale files
Change-Id: I0d9de6cb6eca99a78aada00c5299c16668c414f8
Reviewed-on: https://review.haiku-os.org/c/905
Reviewed-by: waddlesplash <[email protected]>
2019-01-26 20:46:59 +00:00
Adrien Destugues 5d57984ba5 PPM translator: remove pre-R4 support
Change-Id: I26721cdd767bbf0df2936e97a2af322fed49cabf
Reviewed-on: https://review.haiku-os.org/c/904
Reviewed-by: waddlesplash <[email protected]>
2019-01-26 20:46:59 +00:00
Adrien Destugues 32c7f1e79f MIME db: identify ASCII variant of PPM; PBM, PGM files
Change-Id: I05574601bfae0094b7509a123cfd19d7fb02e7fd
Reviewed-on: https://review.haiku-os.org/c/903
Reviewed-by: waddlesplash <[email protected]>
2019-01-26 20:46:59 +00:00
Adrien Destugues 72c5a125f1 PPM translator: clang-format
Change-Id: I290f9b369af37d919308759b83c42122f7f309bc
Reviewed-on: https://review.haiku-os.org/c/902
Reviewed-by: waddlesplash <[email protected]>
2019-01-26 20:46:59 +00:00
Adrien Destugues 5f603da01a Better shape for submenu arrow
Just use BControLook where appropriate. It already provides a nice arrow
drawing function (also used in DeskBar expander and in scrollbar
buttons).

Fix second part of #8900

Changes by John Scipione:

Update menu mark and submenu arrow color with menu text color

Use text color for checkmark and submenu arrow colors, tint less black.
This means that colored bg/white text menu item will also draw a white
checkmark and submenu arrow.

Break out BMenuItem::Draw functionality into private methods _IsActive,
_LowColor() and _HighColor() methods and use them to set the mark colors.

Scale submenu arrow and checkmark with item height (which scales with
font size.)

does not align shortcuts with submenu arrows... but if you were to do
that you'd add item->Bounds().Height() / 2.

Signed-off-by: John Scipione <[email protected]>

Change-Id: I8299094ef88bf227510b116eb1b84c261dc94723
Reviewed-on: https://review.haiku-os.org/c/341
Reviewed-by: Stefano Ceccherini <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2019-01-14 15:59:57 +00:00
PulkoMandy 4c1d9cf74e Fix "since" entries in BPropertyInfo.
These methods and fields are missing from the R4 and R5 Be Book, but are
mentionned in the R4 release notes and present in the R5 headers.

Change-Id: I4de8298449bd66e0ee7fe0b52690552916314123
Reviewed-on: https://review.haiku-os.org/820
Reviewed-by: waddlesplash <[email protected]>
2019-01-03 19:09:22 +00:00
Adrien Destugues d52d36aa5d open: don't print "invalid argument" when opening an URL.
Reset the error code.

Change-Id: I5b58c3082f5758d4cbca8c9706048e3414f939c9
Reviewed-on: https://review.haiku-os.org/807
Reviewed-by: waddlesplash <[email protected]>
2019-01-01 17:48:29 +00:00
Adrien Destugues 588a0c9f67 BMenu: Use BUnicodeChar for unicode char manipulation.
It is not allowed to use isspace, tolower, etc, on character outside of
the char type range (and EOF). Use BUnicodeChar instead to avoid out of
bound accesses.

Fixes the second crash in #14753.

Signed-off-by: Augustin Cavalier <[email protected]>
Some changes by me to make "index" a byte instead of character index
as it needs to be.
2018-12-22 00:25:10 -05:00
Adrien Destugues 16a54a87fd Merge usb_floppy back into usb_disk.
- USB pen drive seems to still work. More extensive testing welcome.
- USB floppies don't work yet, but they don't work anymore with the
  current driver, either. I'm still investigating that part.

Fixes #9276

Change-Id: I8aa5ab828ad2ad867d0c187062d6e179372fc2ad
Reviewed-on: https://review.haiku-os.org/747
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2018-12-14 22:51:44 +00:00
Adrien Destugues 5490645d16 ffmpeg: Undo changes to frame time computation
I was misled by ffmpeg docs, the timestamp is indeed in microseconds
already at this point.
2018-12-04 19:16:29 +01:00
Adrien Destugues 151343ebc8 BLooper: API to hijack existing thread.
I need this to use loopers in WebKit, which spawns threads and expects
to be able to turn them into event loops later on.

This is the pattern already used in BApplication, we may as well make it
available elsewhere.

Change-Id: I5939ca89d33cb3bcc92567b302c2038d976af598
Reviewed-on: https://review.haiku-os.org/735
Reviewed-by: Axel Dörfler <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2018-12-02 21:36:31 +00:00
Adrien Destugues 3340ebea4c emulex_oce: fix gcc2 build. 2018-11-29 20:58:30 +01:00
Adrien Destugues 92bb7e91ed Revert "haiku_loader.hpkg: Add each compiled boot target"
This reverts commit 349326db27.

Makes the system unbootable on my gcc2 BIOS machine.
2018-11-29 20:42:47 +01:00
Adrien Destugues a4ba432352 Fix line counting in StringView.cpp
- if fText is an empty string, we would start searching past its end,
  possibly leading to a crash (noticed this in HaikuDepot).
- if fText is NULL, BString would report a size of 0 lines, it makes
  more sense to report a size of 1 line.
2018-11-17 14:12:25 +01:00
Adrien Destugues e4425315dd Proofread and update the HIG
- Use neutral they to make the user (and in one instance, the
  'stereotypical lazy developer') gender neutral. Thanks to hacker news
  commenters for raising the issue.
- Various updates and clarifications on cursors (not restricted to black
  and white anymore), toolbars & about boxes (we now have a standard
  implementation for them), zooming (exemple more strongly showing that
  it should be "fit to contents" especially on modern high resolution
  displays)
- Reword english in some places

Change-Id: Ic8a392665c08e5186a1fb8aa95e4b741862a8dd7
Reviewed-on: https://review.haiku-os.org/681
Reviewed-by: waddlesplash <[email protected]>
2018-11-09 21:43:21 +00:00
Adrien Destugues d02879c185 HIG: rewrap
This will ease managing the doc and reviewing upcoming changes.
2018-11-09 20:48:44 +01:00
Adrien Destugues c4bb4fbb7e Devices: remove "not implemented" driver line
This just confuses users. Let's re-add it when we have implemented it.
2018-11-09 20:30:39 +01:00
Adrien Destugues 0ca6ba69fa screenmode: remove leftover debug print. 2018-11-09 20:29:35 +01:00
Adrien Destugues 4c8208af52 ffmpeg: fix crash at end of video stream
Mixing new and old style decoding APIs won't work. And we were still
using the old API for managing the end of videos.

Change-Id: Ic194ab98721455658ecefde4f951c3f1e43ae1be
Reviewed-on: https://review.haiku-os.org/679
Reviewed-by: waddlesplash <[email protected]>
2018-11-08 20:09:08 +00:00
Adrien Destugues 5e14319a11 ffmpeg: use new producer/consumer API for video decoding
This API allows us to send whole packets no matter how the video is
formatted, and get frames out as they are ready (sometimes multiple
frames per packets, which did not work well with the previous API).

Change-Id: I0bd7d4706e330bb11d87cb41e93cfc6995b4b3a5
Reviewed-on: https://review.haiku-os.org/665
Reviewed-by: waddlesplash <[email protected]>
2018-11-04 17:04:06 +00:00
Adrien Destugues ce402e82f2 ffmpeg: remove deprecated comment.
This field is deprecated.

Change-Id: I18c3b89ef7438c61b464aaf8bebc1484bf479d6b
Reviewed-on: https://review.haiku-os.org/664
Reviewed-by: waddlesplash <[email protected]>
2018-11-04 17:03:13 +00:00
Adrien Destugues 9e2c056c27 ffmpeg: fix timestamp tracing
Use ffmpeg functions to format the timestamps.

Change-Id: Idd51feb22fc6c5a70e177604eb995ae2d8601cd4
Reviewed-on: https://review.haiku-os.org/663
Reviewed-by: waddlesplash <[email protected]>
2018-11-04 17:03:13 +00:00
Adrien Destugues 22e03e588e Allow to change brightness from the command line
screenmode can now set the brightness (only for intel_extreme, still).
Both absolute and relative values are accepted, allowing to bind
keyboard shortcuts to "increase brightness" and "decrease brightness".

Change-Id: I5221532ebdfba5df1b4d4e1f3331406359f2807c
Reviewed-on: https://review.haiku-os.org/655
Reviewed-by: Kacper Kasper <[email protected]>
2018-11-03 15:51:08 +00:00
Adrien Destugues 95e0ce2c0b Add an haiku_extras package.
Curerntly contains support for amiga RDB and Apple (PPC) partitionning systems,
that is, things that might be useful, but not for most users, and was
not part of the default package.

Naming inspired from the Extras disk shipped with Amiga Workbench, for
lack of a better idea.

Change-Id: I57fb229806139939bc019e6c43b0aec7ea1f483a
Reviewed-on: https://review.haiku-os.org/652
Reviewed-by: waddlesplash <[email protected]>
2018-11-03 00:43:41 +00:00
Adrien Destugues ffd9d565d2 BDate: do not use strftime
Using BDateFimeFormat avoids going through libroot and up again to ICU
throuhg the locale add-on. Moreover, it uses the Locale settings
directly instead of relying on the LC_* environment variables.

Fixes day names in Web+ history menu always showing in english. Tnaks to
Oco for noticing!

Change-Id: I0c7f321a6147e8f5ab31f82de836c5ad23bb321b
Reviewed-on: https://review.haiku-os.org/650
Reviewed-by: waddlesplash <[email protected]>
2018-11-01 23:03:41 +00:00
Adrien Destugues 18033c30dc Remove sticker artwork.
Now lives at github.com/haiku/artwork with other artwork.
2018-10-31 19:36:03 +01:00
Adrien Destugues 03e5dd5273 Fix documentation for BMessage::Previous
The function allocates a message because it uses lazy initialization,
however the user does not get ownership and must not delete it.

Fixes #14413.
2018-08-28 19:14:57 +02:00
Adrien Destugues c2d37953f3 Rework PLL calculations for Iron Lake
The limits were wrong in several places. Checked the sandy bridge, ivy
brige and haswell docs, they all say mostly the same.

- The value of p2 is either 7, 14, 5 or 10 depending on 1 bit in the
  config register and on the display type. We can guess which values are
  right according to the global P limit (5-80 when using 5/10,
  28-something when using 14/7). The values are different because CRT
  need a precise, but rather low pixel clock, while modern display
  interface can accomodate being faster than required by a few MHz, but
  need a much higher speed (the bits are transferred serially, so they
  need to be at least 8 times faster than a DAC).

- The limits for N were obviously wrong, as the register is written with
  N-2, so values less than 2 make no sense. Use 3-8 as specified in the
  datasheet.

- The reference frequency (set by the driver) was wrong, too. It is
  120MHz, not 96. It is 100MHz in some cases (FDI, etc), we should see
  when this happens and switch to the right reference for PLL
  computations.

- There was an attempt to minimize the value of N (a powersaving effort,
  I guess?), but it would basically force the loop to stop at the first
  value of N tested, resulting in way off timings in some cases.

- To ease testing and stop sending patches and syslogs back and forth
  with vidrep, extract the "test mode" from pll.cpp into a proper test
  executable, making it a little easier to experiment with the code and
  fix the problems.

This should fix #13669 and possibly other cases of "out of range", black
screen, bad timings, etc.

Change-Id: Ic4c1c159701f352b7c1ef15a647f023c82ac26c
Reviewed-on: https://review.haiku-os.org/360
Reviewed-by: Axel Dörfler <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2018-08-25 18:52:33 +00:00