Commit Graph

4650 Commits

Author SHA1 Message Date
Ingo Weinhold
222b8cf7b7 cache_io(): Since satisfy_cache_io() (respectively the function it calls)
unlocks the cache, we have to look up the page again, since someone else could
have removed it in the meantime. Possibly fixes #7514.

+r1alpha3


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41564 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-18 10:13:44 +00:00
Michael Lotz
aa373c439f We have to decouple the enumeration and marking of the NMIs from the actual NMI
pin configuration as the configuration only happens after preparing the
configuration where we already need the NMI mask.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41536 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-16 14:59:25 +00:00
Michael Lotz
74e9ede3b2 Simplify and clean up. Removed most of the shifts and made direct masks out of
the macros. This makes things more readable and also fixes the few remaining
80 char limit violations. No functional change intended.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41533 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-16 14:32:01 +00:00
Michael Lotz
bc409b4915 Fix minor debug output oversight in the last commit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41532 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-16 14:11:24 +00:00
Michael Lotz
9ae3fdcb02 * Move redirection entry configuration into a separate function and allow to
specify the delivery mode.
* Use that function from ioapic_configure_io_interrupt() and use it when
  configuring NMI sources to actually set the entries to NMI.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-16 14:06:27 +00:00
Michael Lotz
86d59c04c6 Support NMI sources. Any non maskable interrupt (NMI) will be marked as
unavailable for routing so that we don't end up configuring anything on them.
I haven't seen these in actual use though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41530 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-16 13:36:31 +00:00
Michael Lotz
22d72c8ee1 Guard against IO-APICs with too many entries. We only support 64 entries because
we use a 64 bit level triggered mask. In practice these don't exist as far as I
know. If we encounter them at a later stage we need to revisit the mask.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41529 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-16 13:25:45 +00:00
Michael Lotz
fb5a1727f4 * Implement interrupt source overrides. We install a relay interrupt handler
at the override entry to trigger the overriden vector so that we don't need
  to configure any additional redirections.
* Also configures the polarity and trigger modes found in the override entry.
* When disabling the legacy PIC, retrieve the enabled interrupts and re-enable
  then in the IO-APIC. This will for example make the ACPI SCI work that is
  installed prior to switching interrupt models. Through the transparent support
  for interrupt source overrides it'll also automatically relay from the old to
  the new vector.

This should make ACPI interrupts work and should support relocating the ISA PIT
from irq 0 to a different global system interrupt (usually 2) so that it can
still work when IO-APICs are in use.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-16 12:57:40 +00:00
Michael Lotz
9c1714ec1a Enable IO-APICs by default. It's been tested on a broad spectrum of hardware and
all reports so far have been positive. We fall back to legacy mode in the cases
where we can't figure out the correct routing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41527 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-16 08:42:30 +00:00
Oliver Tappe
6a5ce30120 Move functions declared in private/system/system_info.h out of the public namespace.
* prepend private functions get_system_info_etc(), start_watching_system() and 
  stop_watching_system() with '__'
* adjust callers accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41517 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-15 17:02:36 +00:00
Oliver Tappe
22a7fe9695 Cleanup system-revision stuff.
* move system_revision.h to headers/private/libroot
* unify libroot's get_system_revision() (the one I introduced recently) with kernel's
  get_haiku_revision(), the function is now called get_haiku_revision() in the kernel
  and __get_haiku_revision() in libroot
* system_revision.c is now being built as part of libroot and as part of the kernel
* adjusted all callers of get_system_revision() accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41516 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-15 16:33:30 +00:00
Michael Lotz
e64bb27712 Fix another oversight of r41500. The size check was using sizeof(char *) instead
of bufferSize, corrupting entries when multiple items within the same menu were
checked.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41505 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-14 23:22:35 +00:00
Michael Lotz
192bc027ea Disabling the local APIC also means disabling SMP, as the APIC is the base for
all inter-CPU messaging. The previously described timekeeping is just an extra
function of local APICs. Before, if you'd select "disable local APIC" it would
still blindly write to invalid memory (targetting the non-mapped local APIC) and
then just hang waiting for the other CPUs (that were obviously not responding
to the init sequence that wasn't programmed).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41504 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-14 23:09:18 +00:00
Michael Lotz
ba0c232abb Fix typo that caused the (first) IO-APIC address not to be set anymore when
configuring SMP via MP tables. We don't support that method anyhow, but it
should still report correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-14 22:37:26 +00:00
Rene Gollent
469cccb22c Fix small error in previous commit that resulted in the fix not working as intended.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41501 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-14 21:12:07 +00:00
Rene Gollent
e21407d07b When applying settings from the boot menus, aggregate them and then add them
to the kernel args in a single go. Otherwise we wind up with more link list
entries than expected, which in turn resulted in settings not quite being
parsed properly upon entering the kernel, which meant that if options were
chosen in both the debug and safe mode menus, only the debug ones were
applied. This might also have resulted in the kernel settings not being
loaded correctly in such an instance.

Should fix various issues people have had with safe mode settings not being
applied properly.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41500 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-14 20:37:37 +00:00
Oliver Tappe
a961bbc69d * move sHaikuRevision from uname.c into new system_revision.c
* add private function get_system_revision() for accessing the
  revision string
* adjust uname to use get_system_revision

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-13 20:38:14 +00:00
Michael Lotz
8908aef9c2 * Don't map the IO-APIC within the bootloader. We don't need it to set up SMP
at all and, since there can be multiple IO-APICs, we need to do the
  enumeration again in the kernel anyway. Also only set ioapic_phys the first
  time we encounter an IO-APIC object as it looks cleaner when we arrive at the
  first IO-APIC default address.
* Therefore we don't have to worry about already mapped IO-APICs when
  enumerating them in the kernel.
* Also remove the mapping function that is now not used anymore.
* We still use the ioapic_phys field of the kernel args to determine whether
  there is an IO-APIC at all to avoid needlessly doing the enumeration again.

This fixes multi IO-APIC configurations, because before we would indeed map
the last IO-APIC listed in the MADT, but then in the kernel assumed we mapped
the first one. We'd end up with mapping the last listed IO-APIC twice and the
first IO-APIC never, always programming the last one when we actually targetted
the first one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41476 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-13 16:31:31 +00:00
Michael Lotz
0798779a2f Resolve TODO: Take the writing order into account. Ensure the mask bit is
written first/last depending on the operation to avoid modifying entries that
are still unmasked or unmasking entries that aren't set up yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41457 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-12 00:11:34 +00:00
Michael Lotz
f91cbdde46 Better watch those 1s. These are actually signed 32 bit values, so they will
have unexpected side effects once we shift them more than 30 bits.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 23:38:06 +00:00
Michael Lotz
ca00b28e8b Fix another case where the local interrupt vector would be added instead of the
global system one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41451 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 23:17:12 +00:00
Michael Lotz
0414a20330 Print some more MADT entries when debug output is enabled. Right now they are
informational only, but most of these entries actually need to be handled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 23:14:02 +00:00
Michael Lotz
6347525607 * Always retrieve the APIC ID from the descriptors.
* Actually program the IO-APIC ID when configuring the IO-APIC.
* Moved some debug output around.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 19:55:56 +00:00
Ingo Weinhold
5e36c12a42 mmu_allocate_physical(): The wrong base argument was passed to
get_free_physical_address_range(). Fixes the debug syslog feature.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41446 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 19:10:26 +00:00
Michael Lotz
a56cbb2afb * When initializing MSI support, don't assume a single 24 entry IO-APIC. Instead
mark the ISA interrupts as unusable and then use ioapic_is_interrupt_available
  to determine if that vector is possibly taken by an IO-APIC. If IO-APICs are
  not used, this will simply always return false, leaving all vectors free for
  MSI use.
* The msi_init() now has to be done after a potential IO-APIC init, so it is now
  done after ioapic_init() instead of inside apic_init().
* Add apic_disable_local_ints() to clear the local ints on the local APIC once
  we are in APIC mode (i.e. the IO-APIC is set up and we don't need the external
  routing anymore).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41445 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 18:05:05 +00:00
Michael Lotz
0f91697fd7 Fix previous commit and add printing APIC id fields.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41437 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 11:24:15 +00:00
Michael Lotz
cdb247a328 Extended and fix some of the debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41436 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 11:16:10 +00:00
Michael Lotz
7a8ce431b5 Obviously we want to use the GSI as interrupt vector as well...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41435 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 09:49:51 +00:00
Michael Lotz
e9d5569740 Only make GSI 0 into an ExtInt and GSIs 1-15 ISA interrupts. When having
multiple IO-APICs every IO-APIC was initialized to the standard mapping before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41434 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 09:13:21 +00:00
Michael Lotz
ca67ddb353 When enumerating IO-APICs failed, try to still get the routing done with how far
we got. If the routing is possible with the limited IO-APICs everythings good,
if not we will simply fail at the routing preparation stage where we can still
fall back gracefully. This makes things a bit more error resilient.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41432 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 09:01:50 +00:00
Michael Lotz
eda743903e Provide an interrupt availability check callback instead of a maximum IRQ
number. This accounts for possible gaps in the IO-APIC GSI mappings. Since most
of the time there will be only a single IO-APIC the extra overhead is relatively
small.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41431 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 08:47:56 +00:00
Michael Lotz
d11e32a807 Enumerate IO-APICs using the ACPI Multiple APIC Descriptor Table (MADT). We do
the same for the first IO-APIC in the bootloader (also using the MADT), but
here we can use the ACPI module. The enumerated IO-APICs are added to the list
and should be usable from there on. For lack of hardware I wasn't able to really
test that though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 08:27:03 +00:00
Michael Lotz
5d01e61a91 * Prepared everything to eventually support multiple IO-APICs.
* Added some TODOs regarding register write order that might have bad side
  effects.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41428 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 02:50:36 +00:00
Michael Lotz
dc14d97b7f * Move the legacy PIC and the IO-APIC code into their own source file. No
functional change intended.
* Use an appropriately sized sLevelTriggeredInterrupts for each controller type.
  This also fixes an out of bound access for IO-APICs with more than 32 entries
  and also returns the right mode in such cases.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41426 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-11 00:53:03 +00:00
Michael Lotz
393b3b70a7 Fix build with TRACEs on.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41422 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-10 18:47:11 +00:00
Oliver Tappe
af2da315dc Fix the larger problem that was hiding behind the build problem of set_haiku_revsion on FreeBSD:
* the length of the sHaikuRevision character array symbol needs to be set explicitly,
  as using either _SYS_NAMELEN or sizeof(utsname::version) will only return the values
  for the host, which may not match ours, thus potentially causing problems when using
  sHaikuRevision
* add headers/private/system_revision.h which defines SYSTEM_REVISION_LENGTH to 128
* adjust definitions of sHaikuRevision in libroot and kernel accordingly
utsname::version is shorter than SYSTEM_REVISION_LENGTH, but that doesn't cause any harm
until we have indeed switched to a DVCS (in which case longer revision strings will be 
cut off by 'uname').


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41421 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-10 15:35:04 +00:00
Michael Lotz
c7e314bba7 Use const references instead of pointers for the print functions.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41417 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-10 10:07:46 +00:00
Michael Lotz
9173e3843e * Choose the desired configuration of the link devices at preparation time
already. This allows to detect invalid settings before starting to enable
  IRQ routing and therefore allows to gracefully fall back to PIC mode on error.
* Actually read the number of IO-APIC entries before using that number in
  routing preparation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-10 09:59:50 +00:00
Michael Lotz
ad1757252e Check hardwired and chosen IRQs against the maximum we can address. Try to fail
gracefully in such cases (resulting in the IO-APIC not being used).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41415 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-10 09:29:57 +00:00
Michael Lotz
414f205aee Remove the IRQ to IO-APIC pin mapping array. It isn't used as we don't redirect
vectors at all. It'd also not work for multi IO-APIC setups which we don't
support yet (but are relatively rare anyway).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41414 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-10 08:50:57 +00:00
Michael Lotz
3c4a8701d6 Remove comment that does no longer apply.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-10 07:31:55 +00:00
Michael Lotz
c5c4213aee Actually increase the usage counter by the amount of devices behind the link
device as it may have multiple devices routed to it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-09 16:49:17 +00:00
Michael Lotz
80c4e0ced0 * Balance the IRQs amongst the possible ones. A simple usage counter, filled by
hardwired GSIs and updated on configuring the link devices, is used for that.
  This doesn't guarantee optimal results as some link devices may not be
  configurable to some IRQs and we might fill up their slots this way. Most of
  the time this should be good enough though.
* Take the BIOS assigned IRQ white list into account when assigning IRQs in the
  ISA range and avoid assigning to non white listed IRQs. Quite probably it'd be
  ok to use all of the IRQs present in the possible IRQ list, but let's play it
  safe...
* Also white listed are the IRQs that were set on the link device before
  reconfiguration.
* Some cleanup, use references instead of pointers where applicable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41401 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-09 16:46:18 +00:00
Michael Lotz
35ce82238f * Seperated out reading and enabling IRQ routing. Reading will only read the
configuration that doesn't require any link device changes and will only
  prepare for updating the pci_info. Enabling then does the link device setup
  and updates the pci_info with the new IRQ values.
* Configuring link devices now takes into account that multiple devices may
  share a single link device, meaning that the sharing PCI devices can't be
  configured independently.

We still only blindly configure the first possible IRQ on the link devices, but
now we actually have all the information to change that. Working on that next.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41400 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-09 15:38:18 +00:00
Michael Lotz
cbfddcd6e8 * Separate out matching PCI devices and updating their info. They will be called
independently. Matching will happen first to enumerate and match all devices.
  Updating will happen after configuring all link devices, so once we know the
  final GSI of all entries. The info about matching functions is kept in a
  bitmask in the table entry.
* Move routing table entry handling out of the loop into it's own function to
  faciliate early returns.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-09 13:26:41 +00:00
Michael Lotz
f65eaf15ad Read and keep around the originally assigned interrupt_line of the PCI devices.
Those can be used to white list PCI IRQs in ISA space (<= 15) as those are
basically guaranteed not to overlap with ISA devices. Those white listed entries
can then be used if we only have a 16 pin IO-APIC or if there are only legacy
IRQ resources available for configuration (i.e. ones with bitmasks of 16 bits,
limiting their range to IRQs 0-15).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-09 12:19:41 +00:00
Michael Lotz
de7dbd8a33 Tiny cleanup, that one went past the 80 chars.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-09 11:59:31 +00:00
Michael Lotz
a07f84d9cb Do the PCI device matching using direct PCI config space matches instead of
using the already parsed pci_info data from the PCI module. This removes the
need to iterate over all of the pci_infos for each routing table entries which
makes this an order of magnitude less expensive. Heavily inspired by the
corresponding FreeBSD code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41395 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-09 11:53:52 +00:00
Philippe Houdoin
48315186a8 Remove reference to SVN, now that revision is a VCS-agnostic string...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41394 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-09 11:49:03 +00:00
Michael Lotz
c2507ed4ae Actually use the ACPICA headers to get at the correct types instead of
duplicating the structs on our side. IRQ assignment didn't work with extended
IRQ resources because the alignment of the structs were different in our local
duplicates...
Brings in the ACPICA naming sheme and isn't really clean either. So all of the
reconfiguration should probably just be moved into the ACPI bus_manager.
On the plus side we can now use the proper descriptive macros instead of the
hardcoded numbers which fixes a few of the TODOs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41393 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-09 01:56:20 +00:00
Oliver Tappe
6250297a08 Switch haiku-revision from uint32 to string, as that's going to be required soon, no matter if we switch to Git or Mercurial
* increase _SYS_NAMELEN defined in sys/utsname.h to 128 to allow long(ish) revisions
* sHaikuRevision is now a static character array (in both libroot and kernel)
* adjust build tool set_haiku_revision to write the revision as string


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-08 20:02:42 +00:00
Michael Lotz
d3e3ae8edc Implement a very naive configure_link_device() function that just blindly sets
the first possible configuration. This will probably result in a "everything
mapped to a single IRQ" situation, but should get systems that make use of link
devices in APIC mode at least running.
To make more sensible decisions the interface has to be changed next as it
currently doesn't allow to get anything but the very first possible config.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41384 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-08 13:15:26 +00:00
Michael Lotz
2a127b718c Reimplement the IRQ setting function. Based on the template we get from current
resources we input the desired configuration and then set them. Note that the
set_current_resources() ("_SRS") method is pretty picky (on the low-level ACPI
side) and needs the configuration in exactly the form get_current_resources()
("_CRS") returns, so that's why we need to utilize that buffer as a template.
Looking at FreeBSD there seem to be systems that don't actually provide a
"_CRS", where we will need to fall back to using the get_possible_resources()
("_PRS") data to construct a valid template...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-08 12:56:49 +00:00
Michael Lotz
348eade4a8 Print the routing table unconditionally for now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41373 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-08 01:17:02 +00:00
Michael Lotz
9b50b2889a * Implement the PCI address retrieval on the kernel side and remove the need
for the introduced get_pci_info() method in ACPI as it doesn't work reliably.
  The new version should be more robust and efficient as it only resolves the
  root bridge values once.
* Don't try to read and use the secondary bus register for the root bridge as
  it isn't actually a normal bridge. We get the root bridge bus by using the
  Base Bus Number (_BBN) method.
* Rewrite the logic to recurse down to all busses.
* Minor debug output changes to make the info more readable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-08 01:07:39 +00:00
Michael Lotz
56b5ad0781 Added a temporary opt-in option "enable_ioapic" to the boot menu. This way the
IO-APIC can be easily enabled to test it on various configurations. Note that
the previous default opt-out didn't work because the safemode options would not
be touched at all when not actually entering the boot menu.
Once IO-APIC is more broadly tested this can be removed again and the opt-out
option reenabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-07 21:41:09 +00:00
Michael Lotz
90fd2a0795 Added root name for PCI express, a note about why it works even without it and
a TODO to eventually do it correctly anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41368 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-07 17:36:10 +00:00
Michael Lotz
8c804ef2d6 * Added functionality to resolve the addresses provided in the IRQ routing table
to PCI devices partly using the new ACPI interface and by using bridge config
  information from PCI.
* Added lookup of matching device/pin combinations and update of the relevant
  interrupt line variable via the new PCI module function. This means that the
  Global System Interrupt (GSI) that is used after switching to the IO-APIC is
  now stored in the PCI config space and drivers enumerating these devices will
  now attach their interrupt handlers to the right IRQs.
* Resolve all relevant interrupt information directly into the irq_routing_entry
  so that can be used as the single source for config information. This includes
  resolving the current setting of any PCI link devices into the irq field that
  represents a GSI now.
* Use that info to configure interrupts in arch_int.cpp and remove the logic
  there.
* Some cleanup and added debug output.

This implements the final missing part for using IO-APICs and full APIC mode for
interrupt routing. Note that there is no quirk handling of any form, so this
may very well not work on some configurations. Note also that I have tested this
only on one machine so far. Once proper testing is done the default of disabling
the IO-APIC can be removed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41367 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-07 17:32:12 +00:00
François Revol
6d4e8bc473 More Milan specific stuff...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41355 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-06 21:35:17 +00:00
François Revol
6091174371 Add some calls for Milan debugging.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41351 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-06 20:11:05 +00:00
Michael Lotz
218aaf536f * Prettify the printed routing table.
* Remove wrong extra line when printing an irq_descriptor.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-06 02:01:09 +00:00
Michael Lotz
1882d05b95 We need to specify the intended interrupt model with ACPI so that we get the
correct PCI IRQ routing table for that mode. With this, we finally get the right
PIRQ <-> Global System Interrupt mapping and can therefore program the right
IO APIC entries. The only missing part now is to fix up the pci_info of the
devices with the then active GSI.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41338 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-06 01:55:58 +00:00
Michael Lotz
c846e2aab0 Remove wrong comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41329 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-05 20:06:23 +00:00
Michael Lotz
c0b7f988f4 * Change some of the structure fields to more sensible types.
* The irq values we get from ACPICA are already converted, remove the wrong
  extra conversion from bitfield to irq number.
* Add and handle extended irq structures.
* Disable the legacy PIC when done configuring the IOAPIC. Since during that
  configuration the ACPI module is initialized, the ACPI SCI is still enabled
  in the PIC instead of the IOAPIC. We'll have to delay that routing in the
  ACPI module for it to work.
* Correctly handle the fixed IRQ case for the PCI interrupt routing (hopefully).
* Actually allow for enumeration of possible IRQ settings. Not yet used though.

All of this brings us a bit closer, though it still won't work for PCI
interrupts. ISA interrupts work fine through the IOAPIC as far as my hardware
goes, but PCI interrupts are connected to dedicated IOAPIC pins and I still
haven't figured out how to determine their exact routing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41328 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-05 19:59:04 +00:00
Michael Lotz
8e52f69ef2 Cleanup and a minor debug output change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41313 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-03 22:49:27 +00:00
Clemens Zeidler
08444962ae Interpret a year like 10 as 2010 and not as 1910 if the now time is near 2010. Add test case for that.
Should fix #7257.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41146 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-31 04:55:08 +00:00
Axel Dörfler
5b82a6b615 * Obviously forgot to compile after a last minute change, sorry!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41121 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-26 22:07:27 +00:00
Axel Dörfler
ea8749b6b5 * legacy_driver::devices_used was not taken into account when deciding to
unload a driver. This was causing bug #4608 depending on the order of events;
  now you should have less worries removing your USB device before having it
  unmounted.
* Added a "legacy_device" KDL command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-26 20:26:33 +00:00
Axel Dörfler
31cf5e520a * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-26 20:23:21 +00:00
Axel Dörfler
2545ff58c1 * Applied patch by VinDuv/Jonas to use the existing check_for_key() that fixes
a problem on the Mac which obviously messed up its BIOS.
* This busy loops, but CPU utilization should be a maxed out in the boot loader
  anyway - we could add a pause, though.
* This closes bug #2654.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41117 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-26 20:01:37 +00:00
Fredrik Holmqvist
7fae779766 Just some cleanup. We won't need pci module for setup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41025 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-19 11:47:18 +00:00
Ithamar R. Adema
e59aab0981 ARM: Some header cleanup in preperation of more CPU support code...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40948 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-14 13:48:21 +00:00
Ithamar R. Adema
36fa904ede Fix aligment of data segment, by moving our ARM ldscript closer to the X86 one. This restores
the state of the ARM port to booting all the way up to the idle thread again.

However, will still need to investigate why we need the PHDRS magic, likely due to improper
setup of the ARM toolchain. If anyone has ideas, please let me know!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-13 23:17:29 +00:00
Ithamar R. Adema
60644e6de6 * Add support for R_ARM_ABS32 to kernel ELF linker
* Removal of some commented out (messy) code



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-13 15:48:52 +00:00
Ithamar R. Adema
5707f2519c * Quiet down VM debug output, so we can easily find errors ;)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-13 10:42:18 +00:00
Ithamar R. Adema
8bbaee6124 * Fix ARM kernel compilation
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-13 10:28:51 +00:00
Jérôme Duval
8775d8d25d dir_remove() now handles a path which ends with "/./" and fixed #6817.
Another way would be to disallow removing such a path, as Linux does.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40819 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-05 17:17:19 +00:00
Oliver Tappe
e8226ce48d * fix support for influencing tzset() via TZ environment variable
(now at least <std> and <offset> are supported properly)
* instead of creating a TimeZone object whenever needed, we now
  create it in tzset() and keep it around
* add tests for TZ to locale_test

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40788 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-03 00:34:51 +00:00
Jérôme Duval
548836e4f8 * if ioctl hook wasn't found, now returns B_DEV_INVALID_IOCTL
* in case fd_ioctl() was about to return B_DEV_INVALID_IOCTL, translate to ENOTTY to satisfy #7279.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40787 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-02 18:58:14 +00:00
Jérôme Duval
57ceeee424 copy sig_action structure from the current thread if we're the same team. Helps with #7235
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-26 15:26:47 +00:00
Jérôme Duval
fa90700d74 reverted r40686
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40699 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-26 10:45:03 +00:00
Jérôme Duval
3116b031dc FIONBIO and FIONREAD don't apply to directories, files, attributes: returns ENOTTY in these cases. This fixes #7279.
ENOTTY could also be replaced with a B_ error code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40686 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-25 19:58:25 +00:00
Philippe Saint-Pierre
85b2f68b69 Fix build on gcc2.
(Note, I honestly have no idea what was initially wrong with the code; everything seamt right to me..)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40676 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-25 01:49:26 +00:00
Jérôme Duval
3a04b74922 Don't dereference thread after free(). Thanks to Stephan for noticing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40674 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-24 22:53:01 +00:00
Jérôme Duval
bafa759148 now correctly init the thread id in the pthread struct for main thread and threads spawned with spawn_thread(). This definitely helps for #7235.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40665 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-24 17:28:59 +00:00
Philippe Houdoin
a4c21b1c82 Check if the name is already used in add_debugger_command*() and reject
duplicate attempt(s).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40611 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-22 11:56:57 +00:00
Oliver Tappe
fff761afab Closing #7227:
* fix debug-heap's handling of page-guarded allocations in realloc()
* let calloc() use page-guarded allocations, too, if requested


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40533 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-16 17:42:23 +00:00
Axel Dörfler
3d0d4b6200 * Implemented a way to specify additional debug options via MALLOC_DEBUG when
using libroot_debug.so, instead of having to hardcode them in the application
  via calling private heap functions.
* The following options are implemented: 'p' turns on paranoid validation,
  'w' triggers periodic wall checking every 500ms ('W' does the same, but every
  100ms), 'g' to use guard pages (beware, this will dramatically increase
  memory usage), and 'r' which forbids reusing of memory, freed memory is never
  actually freed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40514 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-15 17:54:24 +00:00
Axel Dörfler
aa06eeb1b9 * If retrieving the cache line failed, try again using an uncached access. That
should help with the remaining I/O errors with (older) CDs that I see only on
  Haiku. Not yet tested, though.
* Added a bit of debug output to see when/if it's triggered.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40344 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-01 18:03:28 +00:00
Axel Dörfler
3f8bbbe05a * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40343 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-01 17:55:38 +00:00
Oliver Tappe
77a8a5cce3 * added B_COMMON_CACHE_DIRECTORY to find_directory()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40279 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-24 20:42:48 +00:00
Rene Gollent
d78e0dc9d7 CID 10326 - remove superfluous for loop.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40277 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-23 23:12:26 +00:00
Ingo Weinhold
b7786ebd30 find_undefined_symbol_add_on(): Resolve non-weak symbols defined in the add-on
to themselves. This works around the problem that those symbols could be
resolved to symbols in the application, which is usually undesired. Weak
symbols have the same problem, but the the runtime loader cannot decide which
should be resolved locally and which mustn't.

The root issue is that BeOS style add-ons simply cannot be supported by a
standard-complying ELF loader.

Affects gcc 4 only, since with gcc 2 we link everything symbolically. The best
solution for the time being would be to build gcc 4 add-ons with default
hidden visibility, exporting only the symbols that should be visible.

Related ticket: #7114


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40248 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-19 11:59:03 +00:00
Philippe Houdoin
4499da3990 Moved generic boot platform code to its own static lib, boot_platform_generic.a.
I hope I didn't break anything, as I can and have only test
bios_ia32's haiku_loader. Flame me otherwise.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40240 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-17 16:50:58 +00:00
Oliver Tappe
137c5fe2ba * add implementation of bindfs, which can be used to bind-mount
a folder to some other place in the filesystem hierarchy
* add helper function to VFS that encapsulates the "conversion" of a
  vnode-pointer to a fs_vnode-pointer (used by bindfs)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40238 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-16 16:33:11 +00:00
Axel Dörfler
51d7642503 * Added a new B_GET_DEVICE_NAME ioctl - this should be implemented by all
drivers in the future, such that NetworkStatus and similar software can show
  nice names for the devices. The device manager should implement this and
  return the B_DEVICE_PRETTY_NAME of the device (and in turn, new style drivers
  should actually set this).
* Implemented handling of this ioctl in the scsi_periph to return the vendor/
  product strings.
* Implemented this in the ATA bus manager to return the model from the info
  block.
* KDiskDevice now fills in the partition_data::name if the B_GET_DEVICE_NAME
  succeeds.
* As a side effect, at least BootManager now shows the drive name; maybe
  DriveSetup does as well for the raw device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40231 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-13 19:41:01 +00:00
Ingo Weinhold
cd463b4dd2 find_undefined_symbol_beos(): Forgot to return the image in the code
introduced in r40211.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40228 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-12 22:43:01 +00:00
Axel Dörfler
b16710b814 * Replaced one occurence of sprintf() with snprintf().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40224 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-12 18:42:48 +00:00
Philippe Houdoin
bcd197ad9b Removed last video_rle.cpp reference and made boot_zlib.a requirment more factual.
Thanks François for cleaning up after me.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40218 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-12 17:24:32 +00:00
François Revol
2f6b97dc30 This should hopefully fix build break introduced by r40215.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40217 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-12 17:16:05 +00:00
Philippe Houdoin
67938b0d59 Switched boot splash compression to use boot_zlib (which was already
used by tarfs anyway) instead of RLE.
While this should allows larger logo/icons, it doesn't remove the
current 300000 bytes size limits for haiku_loader, so #6710 is not yet fixed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40215 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-12 15:43:14 +00:00
Ingo Weinhold
ca7aa99f98 * Added SymbolLookupInfo::requestingSymbol which is passed in by
resolve_symbol().
* find_undefined_symbol_beos(): Does now check whether
  SymbolLookupInfo::requestingSymbol is defined, and, if so, returns it
  directly. This saves the time for the hash table lookup and also works
  around broken files like SoundPlay. Fixes the runtime loader part of #7094.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40211 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-12 12:43:13 +00:00
Ingo Weinhold
4535495d80 Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
  respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
  private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-10 21:54:38 +00:00
Jérôme Duval
bee827e203 changed dirfd() to its POSIX signature, without const (see #4947).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40137 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-06 21:34:06 +00:00
Ingo Weinhold
44b9a93e46 Added intermediate (addr_t) casts before the cast of the parse_expression()
result (uint64) to pointer (CID 4723-4726).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40121 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-04 21:28:46 +00:00
Ingo Weinhold
0af0e394a5 Missed earlier: LargeMemoryPhysicalPageMapper::MemsetPhysical(): Changed
pageOffset variable type from phys_addr_t to addr_t. Avoids potential width
difference when casting to pointer later (CID 4718).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40120 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-04 21:16:53 +00:00
Ingo Weinhold
5defb0fe6f LargeMemoryPhysicalPageMapper::Memcpy{From,To}Physical(): Changed pageOffset
variable type from phys_addr_t to addr_t. Avoids potential width difference
when casting to pointer later (CID 4719-4722).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-04 21:13:53 +00:00
Ingo Weinhold
e468e31f7f Added intermediate cast to addr_t before cast to pointer (CID 4717).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-04 21:05:07 +00:00
Ingo Weinhold
40982d1e05 Check user_strlcpy() return value (CID 4053).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40096 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-03 19:09:14 +00:00
Ingo Weinhold
0068f3c810 Fixed uint32 underflow in backwards loop (CID 2601).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40095 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-03 18:30:19 +00:00
Ingo Weinhold
a5270963e5 Changed put_parameter() return type to void. The value was always true and
never checked anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40094 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-03 18:03:23 +00:00
Ingo Weinhold
a0d93d1416 * VMCache::Unlock(): Renamed local variable consumerLocked to avoid shadowing
the parameter (CID 5329).
* _MergeWithOnlyConsumer(): Removed the somewhat weird consumerLocked
  parameter. The caller can unlock itself, if desired. Improves Unlock()
  readability.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40084 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-03 00:44:40 +00:00
Ingo Weinhold
b734adba63 find_thread(): thread::name is an array, so the NULL check is useless
(CID 4073).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40083 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-03 00:09:27 +00:00
Ingo Weinhold
66e8557230 common_rename(): Fixed incorrect check (array address instead of first
element, CID 4077).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40082 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 23:46:17 +00:00
Ingo Weinhold
e85a4793d2 strcpy() -> strlcpy() (CID 7986).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40081 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 23:32:47 +00:00
Ingo Weinhold
b0da468aeb call_apm_bios(): Moved otherwise unreachable code into "#if __GNUC__ < 4"
block (CID 10315).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40080 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 23:30:28 +00:00
Ingo Weinhold
b51ec9de58 sprintf() -> snprintf() (CID 7985).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40079 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 23:16:01 +00:00
Ingo Weinhold
3872a2d2fc Fixed suspicious implicit sign extension computing the frame buffer size
(CIDs 8056, 8057, 8058).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40078 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 23:14:10 +00:00
Ingo Weinhold
447e61909f Always initialize fSize in the BIOSDrive constructor -- InitCheck() uses it
(CID 10272).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40077 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 23:03:01 +00:00
Ingo Weinhold
b2330bb319 strcpy() -> strlcpy() (CID 7984).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40076 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 22:37:31 +00:00
Ingo Weinhold
80b5decbec Init MenuItem::fShortcut in constructor (CID 10273).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 22:35:09 +00:00
Ingo Weinhold
61aa1456a5 Check get_node_from() return value (CID 647).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 22:27:10 +00:00
Ingo Weinhold
70fc82404f sprintf() -> snprintf() (CID 7983).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 22:22:32 +00:00
Ingo Weinhold
3e9f742d23 Check fstat() return value (CID 2514).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40072 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 22:20:18 +00:00
Oliver Tappe
db03311342 Closing #7056:
* inherit umask of calling process to images loaded via exec...()

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40071 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 19:12:19 +00:00
Ingo Weinhold
be4b43e03f At least theoretically kernelSettings and safemodeSettings can be NULL
(CID 4230).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40069 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 14:44:33 +00:00
Ingo Weinhold
8018cd7f61 Also initialize fCachedBlock, as it is used in the destructor. Related to
CID 10271, though that's actually the only member it doesn't mention.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40068 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 14:36:25 +00:00
Ingo Weinhold
10a50e7cd5 Broken if condition (CID 2600).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40067 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 14:28:55 +00:00
Ingo Weinhold
9a3d05d795 Check return value of fstat() (CID 2513). Cannot really fail in the boot
loader, but the check doesn't harm either.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 14:22:32 +00:00
Ingo Weinhold
a037e9b3d0 Init fNode (CID 10264).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40065 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 14:16:19 +00:00
Ingo Weinhold
f746d7fb49 * Removed my copyright. I had nothing to do with this file.
* FileMapDisk::RegisterFileMapBootItem(): Commented out unreachable code
  (CID 10367).
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40064 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 14:13:21 +00:00
Ingo Weinhold
097b4917d3 Use the unnamed namespace instead of an unofficial one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40061 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 00:44:41 +00:00
Oliver Tappe
bd2a7a1a44 Closing #3145:
* apply a patch by hamish (as part of GCI) that lets fseek() discard 
  characters pushed onto the stream via ungetc()

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40055 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-01 19:04:32 +00:00
Fredrik Holmqvist
7f83c5cd84 No need to use loadAddress as delta as delta isn't used for i==0. CID3197, CID 1972 and ticket #6990.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39987 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 17:04:58 +00:00
Fredrik Holmqvist
ec349ca3bb If there is an error opening the file (negative id) there is no need for close. CID 3474.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 11:59:34 +00:00
Fredrik Holmqvist
3c0241d8b5 While the functions didn't use the delta for i==0 accessing arrays at [0 - 1] can't be good.
CID 3197. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-28 11:23:40 +00:00
Michael Lotz
c907ee755a Undo the part of r34947 that changed the re-use check. It wasn't broken, since
the address variable is incremented in the loop above and at the end will be
equal to sNextVirtualAddress if the address space can be reused. Fixes early
boot resets due to wrongly reused virtual addresses (and them being freed while
still in use by the original user). Fixes #7026, thanks to Urias for testing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-27 02:15:05 +00:00
Michael Lotz
b2acbcbfb3 CID 8122, 2210 (pointing at the same), 8121 and 2209 (pointing at the same):
Taking the size of a pointer instead of the actual extended registers struct.
Not sure this is used, but if it is it made the whole fpu/sse state in the
debugger useless.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39960 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-27 01:44:43 +00:00
Michael Lotz
f3eff1ca00 Free the header after possibly accessing it when tracing is enabled. Also guard
the trace output against header being NULL (i.e. failed to map).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39958 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-27 00:51:05 +00:00
Oliver Tappe
9201344705 Fix CID-5893 (resource leak):
* close the dlopen()-ed image if the locale backend could not be created


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39950 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-26 15:26:58 +00:00
Oliver Tappe
4167bb128b Fix CID-34 (dead code):
* eliminate code that will never be reached

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39949 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-26 15:19:12 +00:00
Oliver Tappe
b97c958d25 Adjust for CID-8007:
use strlcpy() instead of strcpy() for improved clarity, although
the buffer is always wide enough [famous last words ...]

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39948 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-26 14:53:39 +00:00
Jérôme Duval
99f77939d9 adding a LegacyDrivers namespace to avoid clash with other components (see #7018).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39945 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-26 14:21:36 +00:00
Marcus Overhagen
1550ecf11a The IN_CLASS* macros use host byte order.
This fixes netmask and broadcast ip for PXE booting.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39928 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-24 00:32:19 +00:00
Marcus Overhagen
f9e04ff0e1 This removes pxe_stage1.S and thus also removes the build target "pxehaiku".
In r21611, about 3 years ago, the switch into protected mode was moved 
from stage1 to stage2, which makes stage1 obsolete. You have to use 
"pxehaiku-loader" when booting Haiku by PXE on x86.

Trying to use stage1 to boot stage2 resulted in tripple fault during
setup of ss segment, because stage1 switches to protected mode before
calling stage2, but stage2 expects real mode. The documentation is not
up to date.




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-17 17:53:29 +00:00
Ingo Weinhold
d23cadce4c [_{kern,user}_]{start,stop}_system_watching()
-> [_{kern,user}_]{start,stop}_watching_system()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39872 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 17:01:23 +00:00
Ingo Weinhold
88e38c178a Replace uses of obsolescent BReference[able] API.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 14:29:37 +00:00
Rene Gollent
260241b41b The wrong ID was being passed into _SendMessage(), leading to all thread
property change notifications being sent as having occurred for the team's
main thread.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39865 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 04:15:39 +00:00
Rene Gollent
03a4f3aff3 Fix gcc2 kernel build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 03:00:22 +00:00
Ingo Weinhold
d2bf328d72 Implemented a generic system watching mechanism with a userland API. Currently
only a few events can be watched (team creation/deletion/exec, thread creation/
deletion/name changes). The functions start_system_watching()/
stop_system_watching start/stop watching events.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39862 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 01:49:52 +00:00
Ingo Weinhold
4ebc8f615d * Added a "name changed" notification to the thread notification service.
* Added a "team" field to the notification events.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39861 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 01:44:15 +00:00
Ingo Weinhold
2d8d1cdbaa * Implemented a generic way to associate data with a team which is
automatically cleaned up when the team is deleted: Class AssociatedData is
  the base class for a data item, AssociatedDataOwner a container for them
  (struct team derives from it). Functions team_associate_data() and
  team_dissociate_data() add/remove data.
* Turned sTeamHash into a BOpenHashTable (necessary since struct team is no
  longer a POD).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39860 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-16 01:15:35 +00:00
Rene Gollent
27a115f668 Revert r39846 and r39847.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39849 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-14 17:55:38 +00:00
Rene Gollent
7040b50df5 Add support for thread rename and priority change notifications to the
debugger API/message set.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39846 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-14 05:08:47 +00:00
François Revol
917c4aeb8d ISO C and POSIX mandate _Exit() in stdlib.h to be the same as _exit().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39665 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-28 05:07:53 +00:00
Philippe Houdoin
3986ce0335 Relative add-ons pathnames are now searched in ADDON_PATH too
if they're not found from current working directory.
Fix #6427.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39661 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-27 09:57:16 +00:00
Ingo Weinhold
07655104d5 Eliminated _acquire_spinlock(). Since the macro is defined after
acquire_spinlock_inline(), there's actually no undesired recursion.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39647 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-26 13:55:20 +00:00
Ingo Weinhold
c07db2ec3f * elf_find_symbol(): Skip undefined symbols and symbols with the wrong binding.
* Implemented missing handling of symbolically linked images and of weak
  symbols.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-26 13:32:24 +00:00
Ingo Weinhold
78f7f8745e find_undefined_symbol_beos(): Look up the symbol in the requesting image
first. Fixes binary compatibility issue introduced with symbol preemption
support in the runtime loader. For unknown reasons liblayout.so, though
linked symbolically, contains a non-weak (!), preemptable BFont type info,
which was no longer resolved correctly with the new method.
Fixes #6892.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39617 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-24 22:11:42 +00:00
Ingo Weinhold
38eb09a376 Fixed regression introduced by r38409: For a parameterless escape sequence
process_vt100_command() would be invoked with argument count 1 (instead of 0).
This broke e.g. the "dis" command and the command history navigation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-23 16:43:28 +00:00
Ingo Weinhold
25dc253d6a * Merged weak-symbols branch.
* Fixed trivial merge conflict in src/system/libroot/posix/locale/nl_langinfo.cpp
* Fixed gcc 2 compilation of src/system/glue/init_term_dyn.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-22 13:06:36 +00:00
François Revol
2757dc8c3a Fix build with VFS_PAGES_IO_TRACING.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39566 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-21 22:28:49 +00:00
François Revol
3bb30583a3 Fix the licence, we use MIT now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39557 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-21 17:03:03 +00:00
François Revol
34dc99625d Update copyrights.
Btw Axel, keyboard.cpp (forked from the bios_ia32 one) is still under "OpenBeOS licence" with 2 other copies, I suppose you are ok to change to MIT ?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 18:41:52 +00:00
François Revol
180ffdeaa4 Cleanup. Try to exit ARAnyM from platform_exit().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 18:25:51 +00:00
François Revol
866bb10f42 Add some more Falcon video modes. Use VsetRGB() to set 8bit palette, though it's not really useful yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39544 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 17:33:44 +00:00
François Revol
20d6d508c1 Add the VsetRGB() XBIOS call.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39543 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 17:29:39 +00:00
François Revol
7a2ec456cf For now only output debug text on screen if framebuffer is not enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39542 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 17:24:18 +00:00
François Revol
2d84444351 Native Falcon video modes support, including truecolor (16bpp chunky) which we can use for the boot splash. Some debugging code left to cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39533 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 04:30:49 +00:00
François Revol
67572c21e8 Print natfeat IDs as hex.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39532 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 04:29:12 +00:00
François Revol
ffc80aab15 Add some needed XBIOS calls.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 04:28:44 +00:00
François Revol
42df5ff102 Some support for video initialization using natfeat fVDI, but sadly it seems to return NULL for the framebuffer so it's not usable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-19 13:52:17 +00:00
François Revol
a3f64d4460 Add a comment about why we currently force floppy boot when started from haiku.prg.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39493 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-19 09:02:59 +00:00
François Revol
6874c88139 When the boot drive API & id is not known, try to determine the id via natfeat. XXX not sure which API it refers too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39492 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-19 08:55:15 +00:00
François Revol
9c30d75b8c - use only native error codes,
- fix nat_feat_call() macro for more than 1 arg,
- add BOOTSTRAP natfeat calls get_bootdrive() and get_bootargs().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39491 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-19 08:51:59 +00:00
Ingo Weinhold
631cc3ea7b Keep things in order.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-16 20:54:49 +00:00
Ingo Weinhold
698fcd85da Should have been part of r39453. The libroot implementation of
get_extended_team_info().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39454 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-16 19:43:37 +00:00
Ingo Weinhold
56d734a1aa Added new private API to get more information on a team:
* Userland interface: get_extended_team_info().
* Syscall: _kern_get_extended_team_info.

Only partially implemented yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39453 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-16 19:42:08 +00:00
Ingo Weinhold
f31ab90a8d KMessage::Dump(): Fixed broken format.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-16 19:39:45 +00:00
Andreas Färber
cb49ed72a6 boot_loader_openfirmware: Fix trace output
Update the variable name.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-14 19:04:48 +00:00
Oliver Tappe
de2e54ace0 Adjust tzset() implementation to better follow the POSIX specs and
make some more perl tests happy.
* no longer expect a ICU timezone ID in the TZ environment variable,
  but only expect this format if the TZ-value is starting with ':'
* accept "standard" TZ-values like "EST5" (of which only "EST" is
  relevant to us) - if such a value is specified, we hardcode the
  timezone name to the given value, no matter how ICU calls it
* adjust tests accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39415 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-13 01:13:38 +00:00
Oliver Tappe
5ae9cf0060 * fix warning about deprecated conversion
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39412 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-13 00:21:23 +00:00
Oliver Tappe
bd13a264f7 Fix #6740:
* remove declaration of ctype-..._l() functions, as we do not provide
  them and they are not really needed by our hacked glibc
* replace remaining invocations of isspace_l() and isupper_l() in glibc
  with isspace() and isupper() respectively
This allows libroot to be built in DEBUG mode, again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39380 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-09 21:36:35 +00:00
François Revol
f3319425ed Return 0 on success for the mount() and unmount() compatibility calls. Just cleaner.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39362 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-08 21:46:22 +00:00
François Revol
193e56fbef Add mount() and unmount() BeOS compatibility calls. This should help to run some old apps like Helios...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39330 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-06 22:28:07 +00:00
François Revol
ceee0a32a4 Fix warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39328 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-06 20:39:48 +00:00
Ingo Weinhold
e5d4255933 Init AtExitInfoBlock::fFirstUnused in the constructor. Probably fixes #6793.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39324 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-06 13:08:04 +00:00
Ingo Weinhold
3d64976518 The TRACE() macro is defined in runtime_loader_private.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39315 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-05 20:37:57 +00:00
Stephan Aßmus
08e6655afe Patch by kaliber (ticket #6333): Removed many instances of
passing an additional -Wall to the compiler, which may actually
have unwanted effects. -Wall is standard by the build system.
Also, -Wno-multichar was passed unnecessarily for Haiku targets.
I didn't remove it for the bfs_shell, hope this is what Ingo meant
in the ticket.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39314 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-05 20:31:11 +00:00
Ingo Weinhold
aa3507feea terminate_program(): Call the termination function of all images, not only
of the program image and its transitive dependencies.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39306 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-04 21:15:39 +00:00
Ingo Weinhold
e60625b708 get_sorted_image_list(): Allow passing a NULL image argument, meaning that
all loaded images will be sorted and returned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39305 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-04 21:14:09 +00:00
François Revol
2ef563d813 80 cols & cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39304 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-04 19:37:30 +00:00
François Revol
f649b1fa77 Make multiboot.h usable from assembler, and remove duplicate defines.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39303 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-04 19:06:36 +00:00
Ingo Weinhold
fb8e088927 Added dummy __cxa_atexit() and __cxa_finalize() to the kernel. We might
actually implement those, if we decide to support global
constructors/destructors in kernel add-ons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39300 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-04 16:26:43 +00:00
Ingo Weinhold
d64f6189c0 unload_library(): Added comment about the exit hook handling.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39299 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-04 16:22:11 +00:00
Ingo Weinhold
85f9496a24 Implemented __cxa_atexit() and __cxa_finalize() which are required by the
Itanium ABI. Whether __cxa_atexit() really works for associating hooks with
DSOs has not been tested yet, as our compiler doesn't use the function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39298 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-04 16:21:20 +00:00
Ingo Weinhold
b502275bc8 exit.c -> exit.cpp
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39295 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-04 11:07:01 +00:00
François Revol
4219bd961b Rework the ConsoleDevice to be a full featured window based console.
Only looses high intensity color from the plain console, but doesn't eat keystrokes, and a 2nd window opens for dprintf stuff.
Only Amiga makes it possible ;-)
http://revolf.free.fr/beos/shots/shot_haiku_loader_amiga_m68k_004.png


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39264 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-01 22:35:43 +00:00
François Revol
a55b596e1c Allocate the IOReq if not done yet at Open() time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-01 17:57:36 +00:00
François Revol
499f2a5c48 Some more work to get video support working, add generic code to support the boot splash in.
However all modes available are planar, and there doesn't seem to be a way to tell it in the kernel args framebuffer struct...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39255 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-01 17:24:20 +00:00
François Revol
9bc9cf069d Cleanup. Add a LLKeyboardDevice using lowlevel.library but it doesn't seem to be available in the kickstart I have anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39254 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-01 17:22:25 +00:00
Matt Madia
331c79ad0f Fixes error "SubInclude HAIKU_TOP without prior SubDir HAIKU_TOP", when
jamming from src/system/glue/arch.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39237 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-31 18:08:54 +00:00
François Revol
3091264bb5 s/Copyirght/Copyright/ unless it's a neologism from Ithamar :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39235 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-31 17:27:50 +00:00
François Revol
d9025c9aae Last remnants of NewOS here.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39223 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-31 00:56:14 +00:00
François Revol
3be6531e51 Remove antique makefile left from NewOS.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39222 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-31 00:46:38 +00:00
Ithamar R. Adema
e7682a8e3e ARM:
* Disable TRACE output of ELF relocation
* Implement R_ARM_RELATIVE (for kernel modules)

No more errors on 'loading' of kernel modules now!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39220 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 23:10:36 +00:00
Ithamar R. Adema
c9a4637342 * ARM: Initial stab at fixing ELF relocations (much more to do though for full ELF relocation support).
We now boot right up to "INIT: main: done... begin idle loop on cpu 0" ! :)
(Please note that there's still *lots* stubbed out)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 22:53:32 +00:00
Ithamar R. Adema
c917cd6261 * ARM: Major VM work
- This is mostly a copy of the x86 32bit paging method and infrastructure, this was copied for two reasons:
		1) It is the most complete VM arch
		2) The first ARM PAE patches have landed on alkml, so we will have to deal with it in the future as well,
		   and this infrastructure has proven to be ready ;)
	- No protection features, or dirty/accessed tracking yet
	- Lots of #if 0

	but....

	It boots all the way up to init_modules() now, and then dies because of a lack of (ARM) ELF relocation implementation!

	Since at this point the VM can be fully initialised, I'm going to focus on CPU exceptions next, so we can get KDL to trigger
	when it happens, and I can actually debug from there ;)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39206 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 14:10:30 +00:00
Ithamar R. Adema
72d414a517 * ARM: Start physical allocated range at top of memory; otherwise our page directory/tables won't be included
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39204 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 13:55:29 +00:00
Ingo Weinhold
13b81a3b8e * Added new thread flag THREAD_FLAGS_SINGLE_STEP, which is set to indicate that
userland single-stepping is enabled for the thread.
* x86_exit_user_debug_at_kernel_entry(): Always store DR6 and DR7 in the CPU
  structure, not only when breakpoints are installed.
* x86_handle_debug_exception(): When encountering a syscall single-step, also
  set the THREAD_FLAGS_DEBUG_THREAD thread flag. Otherwise the
  B_THREAD_DEBUG_STOP would be ignored.
* x86 interrupt handling, DISABLE_BREAKPOINTS():
  - Renamed to STOP_USER_DEBUGGING().
  - Now it also call x86_exit_user_debug_at_kernel_entry() when
    THREAD_FLAGS_SINGLE_STEP is set, so that the debug registers are saved.

Fixes #6751.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39201 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 11:31:01 +00:00
Ingo Weinhold
ee7817042b update_thread_user_debug_flag(): Don't set the THREAD_FLAGS_DEBUG_THREAD thread
flag, when B_THREAD_DEBUG_SINGLE_STEP is set. Not sure, if there ever was a
reason to do that, but there isn't now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39200 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 10:33:04 +00:00
François Revol
c489b073c8 Partial build fix. Still a lot to do to catch up with Ingo...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39189 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 01:33:50 +00:00
Ithamar R. Adema
7bc3564aa8 * ARM: Some more cleanup...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39168 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-28 11:19:20 +00:00
Ithamar R. Adema
ac4c302248 * Adjust code to use the new page directory/table helper macros.
* Some more code cleanup.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39138 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-25 11:19:17 +00:00
François Revol
ee0c130257 Display flags and interlace in the mode menu items.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39136 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 22:46:06 +00:00
François Revol
b14f16077c Fix setting console position.
Generate a list of video modes, though there seem to be some dups and missing ones... The Nominal resolution doesn't mean it can't be better.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39135 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 22:28:13 +00:00
François Revol
2e74287ab2 Force a 040 detection for now, it seems E-UAE is making kickstart detect it randomly :(
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 22:26:27 +00:00
Clemens Zeidler
4a5a077ff7 Add a private B_ATTR_CHANGE_NOTIFICATION flag to the open query syscall to tell the query to send notifications when an entry attribute changed and the entry stays in the query. Previously you only get created and removed messages, now you can also get updated messages. Only implement it for bfs.
Fix copy right.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 20:47:46 +00:00
François Revol
062c606d62 An implementation of a ConsoleDevice using console.device but it seems it requires having a window open.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 16:28:23 +00:00
François Revol
77fd9ce1f9 Of course we need the Exec call definition for ColdReboot().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 16:26:17 +00:00
François Revol
e4e2237013 reboot sanely from platform_exit().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39126 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 16:21:59 +00:00
Clemens Zeidler
ccdff0eb1f Fix bug when comparing flags. Simplify hash map key. Thanks Ingo!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 08:54:21 +00:00
François Revol
fc13691eeb Add a Clear() call to ExecDevice.
Seems there is a lowlevel.library which might be easier to use for keyboard, add some defs for it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39113 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 02:55:46 +00:00
François Revol
4ae7f92a58 Fix console_clear_screen(), ClearScreen() only clears from the current y position so we must Move() before.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39111 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 02:12:18 +00:00
François Revol
6fff309da9 Almost working keyboard input. One can now select menu items, though it seems to miss 2/3 of the key presses.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39110 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 02:06:30 +00:00
François Revol
f2b7a266d7 Add an ExecDevice class to handle devices using Exec's IORequest calls. Subclass it as KeyboardDevice to use keyboard.device.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39108 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 01:16:36 +00:00
Clemens Zeidler
d63309cf5e Store the volume watcher in a separate hash table to not collide with
normal nodes.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39107 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-24 00:49:48 +00:00
Ithamar R. Adema
3164579353 * ARM: Map full page directory, instead of just the first page
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39092 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-23 20:28:49 +00:00
François Revol
22d81b6c8e Implement proper console color handling.
Don't draw over the screen title.
Oddly the menu doesn't seem to clear the screen.
Looks much better now:
http://revolf.free.fr/beos/shots/shot_haiku_loader_amiga_m68k_003.png


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39076 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-23 19:13:55 +00:00
François Revol
bf6cf21094 Fix AmigaOS calls : a6 is required to point to the library base, but our gcc uses it as frame pointer, so we must save it before calling.
Fix the console and remove test panics. We now display the menu, although not in the best colors :
http://revolf.free.fr/beos/shots/shot_haiku_loader_amiga_m68k_002.png
(Yes, the mouse moves too :p)
Amiga !!!!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-23 15:53:51 +00:00
Ithamar R. Adema
e8b7cfe80e * ARM: print memory map before starting kernel
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39058 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-23 08:51:09 +00:00
François Revol
04fc737059 Start of implementation for the console. dprintf() now uses one of the console handles for simplicity.
It crashes for now though, seems we have a stack alignment issue or maybe mangled registers. Or maybe it's due to non-static initializers not being done.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39053 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-22 21:09:10 +00:00
François Revol
2be003bc1e Add missing packed attributes.
Add needed TextFont struct.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-22 21:06:25 +00:00
François Revol
5a0d2097fe - DisplayAlert() already waits for a mouse click.
- Implement dprintf() with DisplayAlert() for now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-22 19:19:03 +00:00
François Revol
51bac633cf More of the needed AmigaOS APIs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39049 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-22 19:16:43 +00:00
Ithamar R. Adema
29ce3dedd9 * Remove references to vectors, they are not at physical address 0, but on either virtual address 0 or (in case of high vectors) on 0xffff0000....
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-22 15:57:57 +00:00
Clemens Zeidler
33d9a03d72 Add a watch_volume method to the node monitor to be able to watch node changes on a whole volume and not only for one node.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39020 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-20 12:31:53 +00:00
Ithamar R. Adema
18b48221c9 * don't mess with the stack before storing the register state :$
This finally makes KDL fully usuable on the ARM port!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39015 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-19 23:11:57 +00:00
Ithamar R. Adema
22e3bbdf9b * Implement ARM TLB/cache functions
* General code cleanup...



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39010 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-19 12:26:38 +00:00
Rene Gollent
ad47c011b8 More fixes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 20:32:46 +00:00
Rene Gollent
c7b27349ee Another build fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 20:30:12 +00:00
Rene Gollent
1f0b0045c2 Fix build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39007 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 20:26:33 +00:00
Ithamar R. Adema
7889c39de4 * Fixup longjump too... One step closer to a working KDL...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39002 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 14:00:17 +00:00
Ithamar R. Adema
4795b05a88 * Fixup trace message
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 13:03:59 +00:00
Ithamar R. Adema
a9de9aea54 * Fix atomic_get :$
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39000 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 12:39:59 +00:00
Ithamar R. Adema
60beb9c01e * Fixup atomic calls; currently only minimally tested on __ARM_ARCH__ < 6
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 12:10:16 +00:00
Ithamar R. Adema
c395771a69 * Force GCC to align sInitialHeap on 8-byte boundary, otherwise Free() will complain (hit on ARM)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38997 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 09:42:59 +00:00
Ithamar R. Adema
fb2cbc781e * Fix incorrect class name in kprintfs
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38995 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 01:43:47 +00:00
Ithamar R. Adema
cd4265c803 * For ARM, we now always read from the serial for KDL input.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38994 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 01:15:13 +00:00
Ithamar R. Adema
a85c91d6f0 * Fix setjmp/jmpbuf_t size so we can finally get to the KDL prompt
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38993 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 00:50:59 +00:00