Commit Graph
100 Commits
Author SHA1 Message Date
David Karoly 92d226c2a9 headers/os: Bump max gcc to 14.x
Change-Id: Ia5601dae1c2d70f148df5dfde97bbba841af0b17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7561
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2024-03-30 15:01:16 +00:00
David Karoly 8d024b7062 boot/efi/riscv64: fix initial page mapping
Change-Id: I777069a7f7b96b4cdabeef40cf7e055516abfe00
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7237
Reviewed-by: X512 X512 <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-12-23 20:59:23 +00:00
David Karoly 8497e56650 Debugger: implement DWARF5 indirect string and address forms
Change-Id: Ie3ee6f4eb14606ee2d412d8e7122d59472619f81
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7059
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-11-23 18:06:20 +00:00
David Karoly 85a7824e2a Debugger: introduce ReadUInt
Change-Id: Iaa32db71b3a015d5496d60a96fb30763b924c89f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7103
Reviewed-by: Rene Gollent <[email protected]>
2023-11-22 19:22:58 +00:00
David Karoly 3c16ba4e78 Debugger: introduce target endianness handling
Change-Id: I597a667de1461383ce9e96e8ea9902895cf80ec6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7073
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-11-13 08:19:54 +00:00
David Karoly 9435152cbb Debugger: implement ReadU24
Change-Id: I1385b935f229da51df959fd7644a9cd2d36e0e25
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7058
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2023-10-24 17:15:25 +00:00
David Karoly d5be5b61c5 Debugger: handle call_site similarly to GNU_call_site
Change-Id: I37c6a2903bd5001c03b86aa09f1d2d04ab87365e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7040
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-10-13 10:51:23 +00:00
David Karoly 7dec7afe4b Debugger: add DWARF5 attribute and form definitions
Introduce new attribute classes:
* addrptr represents an offset into the .debug_addr_section
* loclist represents an offset or an index to a location list
* rangelist represents an offset or an index to a range list
* stroffsetsptr represents an index to the indirect string table

The semantics of some existing attribute classes changed:
* loclistptr represents an offset into the
  .debug_loc / .debug_loclist section
  It will be used only when setting loclists_base attribute.
  In all other places we should use loclist attribute class.
* rangelistptr represents an offset into the
  .debug_ranges / .debug_rnglist section
  It will be used only when setting rnglists_base attribute.
  In all other places we should use rangelist attribute class.

Define lookup table for new DW_AT_* attribute types
* change the existing references to AC_LOCLISTPTR to AC_LOCLIST
  as in those places now either an index or an offset can be accepted
  (previously there were no indexes, only offsets everywhere)
* only DW_AT_loclists_base uses AC_LOCLISTPTR
* similarly for AC_RANGELISTPTR and AC_RANGELIST as ranges
  can be specified using either an index or an offset
* only DW_AT_rnglists_base uses AC_RANGELISTPTR

Define lookup table for new DW_FORM_* attribute forms
* similar reshuffle for location lists and range lists

Change-Id: I78d307889cd6082a19870afdc571dc0c83d19644
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6982
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-10-13 10:50:55 +00:00
David Karoly 0ec674cdcc Debugger: fix lookup for DWARF5 tag names
Change-Id: Ibbc47d031deee387d93bcfec5cc629230f891b0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7039
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Rene Gollent <[email protected]>
2023-10-11 20:01:57 +00:00
David Karoly 16236e175d Debugger: add DWARF5 tag names
Change-Id: I2ad594f0b1b8f7306d62d8f395379f8d1125c9e9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6993
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-10-10 13:47:33 +00:00
David Karoly 8b61424d3b Debugger: fix typo call_size vs call_site
Change-Id: I0dadac94be729531aedaa7c3fdbac12679fd4835
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6992
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-10-09 15:14:23 +00:00
David Karoly 3f2abbc390 Debugger: implement DWARF5 compile unit header parsing
* introduce new field unitType. Currently we support only
  DW_UT_compile unit type.

* abbrevOffset and addressSize are shuffled around

Change-Id: I67db242240012b52e0ec59f87ffab7cb937eb212
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6981
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-10-06 13:20:07 +00:00
David Karoly a5c358a6db Debugger: implement parsing DW_FORM_implicit_const
For attributes with form DW_FORM_implicit_const, the attribute
specification contains a third part which is a signed LEB128
number. This value shall be used as the value of the attribute
when parsing the debug_info section.

Change-Id: I3e9aa3ba70b3aa05e6d2f570a1464966c38e4b1b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6980
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Rene Gollent <[email protected]>
2023-10-04 21:23:40 +00:00
David Karoly 006478bfce Debugger: implement DWARFv5 line-info handling
* add new field for .debug_line_str section
* implement reading string and int values tagged with DW_FORM_*
* skip new fields addressSize, segmentSelectorSize in line info header
* parse directories and file names according to new syntax
* enable line-info parsing up to version 5

Change-Id: I1dd7e0d834c73f6d72b7115c7ded9f868be84a3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6978
Reviewed-by: Rene Gollent <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-10-03 15:40:26 +00:00
David Karoly 908afdaae4 m68k: update linker script for kernel
adapted from the toolchain's m68kelf.xc linker script

Change-Id: Ia3276f32f8de5938dae13f54f3e0675b71c194a5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6956
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-09-28 07:11:23 +00:00
David Karoly 91ef2c3c00 kernel/m68k: fix relocation for R_68K_JMP_SLOT
R_68K_JMP_SLOT should be handled similarly to R_68K_GLOB_DAT i.e.
the relocated value is symbol_value + addend. see e.g. in uclibc:
https://git.uclibc.org/uClibc/tree/ldso/ldso/m68k/elfinterp.c#n222

(also the G variable is never assigned any nonzero value?)

before this change we get jumps to 0x00000000, bus errors with
pc=0x00000030 etc.
after this change we are able to call functions!

Change-Id: Ibe135adb0dc6248a2baf5d6eca1543fdddf3a9e8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6957
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-09-27 07:06:50 +00:00
David Karoly 9dc5767db6 boot/atari_m68k: fix stack after toscallLLWWWWW
Change-Id: I3c0712d2eee173eb1744b7eb8b5b35a3b4bdc71f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6946
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-09-26 08:49:47 +00:00
David Karoly a72ea36f95 boot/atari_m68k: add revision number to bootloader binary
Change-Id: Id68078ada652d5815a4392e8d94c4bd4ef3efcdb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6947
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-09-23 17:20:27 +00:00
David Karoly a944d6a02d boot/atari_m68k: fix crash on boot menu
Change-Id: I7d2afdd14ae9942fedd720b7d581a5acf2d6f40f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6945
Reviewed-by: waddlesplash <[email protected]>
2023-09-23 17:20:22 +00:00
David Karoly 1978148f9e boot/amiga_m68k: Handle, ExecDevice should be subclasses of Node
hrev55571 introduced several new pure virtual functions in Node,
none of which are implemented in Handle or ExecDevice any of their
descendants.

This change fixes the build after the Node/ConsoleNode refactor.

Change-Id: I098005df063160fd984e70da29ddb24a1d7a7133
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6940
Reviewed-by: waddlesplash <[email protected]>
2023-09-21 17:58:22 +00:00
David Karoly 45c84b2857 boot/atari_m68k: Handle should be a subclass of Node
hrev55571 introduced several new pure virtual functions in Node,
none of which are implemented in Handle or any of its descendants.

This change fixes the build after the Node/ConsoleNode refactor.

Change-Id: I825b90a114d83105f46d566e7fe1f644ba997ec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6939
Reviewed-by: waddlesplash <[email protected]>
2023-09-21 17:57:43 +00:00
David Karoly 39fa47a536 boot/next_m68k/mmu: implement missing functions
Change-Id: I78b51ab394c9083b081f12ca4e02f50904f67674
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6938
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-09-20 18:47:12 +00:00
David Karoly 6393778b93 boot/amiga_m68k/mmu: implement missing functions
Change-Id: I1164ca30659684d8d273b58a7cc0ea33dde0a240
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6937
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-09-20 18:47:12 +00:00
David Karoly 3b7ddf557f boot/atari_m68k/mmu: implement missing functions
Change-Id: I7605abc7f5e7b5b15d6dd33ec3bd73777a0804aa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6936
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-09-20 18:47:12 +00:00
David Karoly ad29214d43 boot/libs: hush warnings for zstd on arm64
Change-Id: I971cdefd670d26e669e9bdfd9c9a29ca5508ff9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6915
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-09-20 18:45:57 +00:00
David Karoly 31199cd950 update bootstrap package versions for ppc
Change-Id: I84d8e32cbba725e952d0864c4a82028fa91b5209
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6912
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-09-17 19:14:00 +00:00
David Karoly ad115900db ppc: use generic_msi
Change-Id: Ibe9e80bc9853f529bc1f0ef3dad78cd37af82280
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6911
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-09-17 19:13:19 +00:00
David Karoly f76f6d8f57 libroot/musl: Import ppc atomic_arch.h.
Change-Id: I51b460b6a126cf401679ae2fd398445bd9969761
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6910
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-09-17 19:12:54 +00:00
David Karoly dc3b3e172d m68k: VMTranslationMap.h is not needed in arch_vm.h
Change-Id: Ica0efdeabaa73be0030e0522352c0c3bf311a9ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6913
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-09-17 19:12:33 +00:00
David Karoly 420ca7cfe1 m68k: use generic_msi
Change-Id: Ifced80c25c08632ade10190658f2fc17b1de5309
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6909
Reviewed-by: waddlesplash <[email protected]>
2023-09-17 19:12:11 +00:00
David Karoly edc473bb3a libroot/musl: Import m68k atomic_arch.h.
Change-Id: I33aef6b417177ac7b998715b60ced7f28be8c3eb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6908
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-09-17 19:11:43 +00:00
David Karoly d7b59fd308 libroot/musl: adopt default implementation for a_crash from upstream
Change-Id: I30a1075163c1702755c86d0bd85beeb75ad894d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6907
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-09-13 00:35:24 +00:00
David Karoly 05f767f88d Debugger: add DWARFv5 constants to Dwarf.h
Change-Id: I81d3e3cc6d896ca90e8c10f01783cc294b91886f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6903
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-09-10 13:04:22 +00:00
David Karoly dfc8e0741a update bootstrap package versions for m68k
Change-Id: I813ddbd1619b57aceac6f303e6ea716736d8db2d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6902
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-09-10 11:43:30 +00:00
David Karoly 3f2464f759 Debugger: implement parsing for v4 line-info
Differences between DWARF v3/v4 for line-info:
- added new field maxOpsPerInstruction
  this new field will typically have the value of 1
  unless VLIW architecture is being used
  (which is not the case for Haiku)
- state machine contains a new field op_index
  it has any relevance only when maxOpsPerInstruction > 1
  i.e. on VLIW architectures
- added new operation DW_LNE_set_discriminator
  this is already implemented in LineNumberProgram.cpp

This implementation just reads maxOpsPerInstruction and
checks that it is set to 1, which is what we expect on
all architectures currently supported by Haiku.

Change-Id: I14755d615a0e2b3a5177928c4d8f9014940a5fcf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6876
Reviewed-by: Rene Gollent <[email protected]>
2023-08-30 13:24:23 +00:00
David Karoly 3568a4e11f update bootstrap package versions for x86_64
Change-Id: I623b927096547a1bc98d1011169142d841c78eac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6846
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-08-20 16:08:31 +00:00
David Karoly 6308236831 arm, arm64, riscv64: use gcc-13.2.0 for bootstrap build
Change-Id: I3cda82b46a224bddc51f9850c1fee9006a51b73e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6844
Reviewed-by: Adrien Destugues <[email protected]>
2023-08-19 12:24:18 +00:00
David Karoly 2b514ce830 riscv64: update bootstrap package versions
Change-Id: I45b96ae1249985a2d92bcae7c826e40186d3b4a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6813
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-08-13 19:33:47 +00:00
David Karoly 26bd8b3958 arm: update bootstrap package versions
Change-Id: Iaea37926246a95764253dcb24c47ab6b931c538c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6812
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-08-13 19:25:06 +00:00
David Karoly 45e19f162a arm64: update bootstrap package versions
Change-Id: Ifc42e09d1fed8ca51c214bee53dda8d0a203b5b8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6811
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-08-13 19:24:49 +00:00
David Karoly b9cca28d48 boot: implement skip-init when detecting UART from FDT
Change-Id: I012c6238b083197c8e268185904aa0ecf6641ba3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6638
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-06-25 09:24:16 +00:00
David Karoly b4c0589f3a kernel/arm: remove unneeded call to get_commpage_image
Change-Id: Id978ebea32ea45500ed1f30f24eaeb0017487133
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6614
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-06-21 19:37:10 +00:00
David Karoly 426dc0c7e4 kernel/arm: remove unneeded call to arch_thread_set_current_thread
Change-Id: I1026c733033458ed02fab9e9e61f041441e56d1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6615
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-06-21 09:17:17 +00:00
David Karoly c629d42947 kernel/arm: remove unused barrier functions
Change-Id: I45c863c4ac027cc3ec5bb1922c22c58433603875
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6613
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-06-21 09:17:02 +00:00
David Karoly ddc88ea85a docs: remove TODO item for ARM Accessed and Modifed page flags
Change-Id: I497c054e4a58a39804e2a1ef7a5d30eb8cc73130
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6611
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-06-19 20:49:48 +00:00
David Karoly b799d160f2 kernel/arm/paging: implement Modified Flag
* Introduce SWDBM flag similarly to the arm64 port
* Reuse TEX[2] for SWDBM flag which should be availble
  to be used by the operating system if TEX remap
  is enabled.
* Introduce SetAndClearPageTableEntryFlags for updating
  accessed and modified flags atomically
* Startup sequence is handled similarly to accessed flag, i.e.
  set Modified flag in initially mapped pages in bootloader and early map.
* Once the kernel initialization has progressed enough,
  pages are mapped as read-only and modified flag handling is done
  in the page fault handler.

Change-Id: I8f761e2c6325d1b91481abd569d5e8befded0761
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6518
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-06-18 11:18:24 +00:00
David Karoly b6e15e8bf5 boot/arm: enable TEX remap
Configure PRRR and NMRR as follows:
- memory type 0 is Strongly-Ordered
- memory type 1 is Shareable Device
- memory type 2 is Normal, Inner/Outer Write-Through
- memory type 3 is Normal, Inner/Outer Write-Back, no Write-Allocate

This way no change is needed in B and C bits so we can keep the
existing MemoryTypeToPageTableEntryFlags() implementation.

Change-Id: Icb4b18b0082774fdbef28576cee8624fae610538
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6607
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-06-15 10:43:14 +00:00
David Karoly f61fb770f0 kernel/arm: don't set Accessed Flag when initially mapping a page
Pages should not be marked as accessed when initially mapping them.

However, there's a short interval during kernel startup when new pages
are mapped but the fault handler is not installed yet.

Therefore, we set Accessed Flag to 1 in early_map.
Once the kernel initialization has progressed enough, we start mapping
new pages with Accessed Flag set to 0.

The chicken and egg problem of initially mapping the vector page is
tackled by preallocating the vector page in the boot loader.

Change-Id: Ie3be4f81812d7a090af57e8c79420598d16182b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6450
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-06-06 18:49:56 +00:00
David Karoly d38dcdde74 kernel/arm/paging: implement Accessed flag querying
Change-Id: I519235124bbc93d41eec4be3e773576758a575a7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6445
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-05-17 19:32:29 +00:00
David Karoly cce0386a4d kernel/arm/paging: implement Accessed Flag handling
Change-Id: Ida5f8faa538df9244e44ef30a73b61b2ffb693af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6444
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-05-17 19:32:29 +00:00
David Karoly 0d5bde4295 kernel/arm/paging: remove empty code block related to global pages
Change-Id: I2f8b9da371cb4e2e496e985035bda78b139ff8e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6443
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-05-17 19:32:15 +00:00
David Karoly 290e43c06e boot/efi/arm: enable access flag
Change-Id: I29bfc2183f180291d6a1a9b11d1d6fd2dce4878d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6438
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-05-16 18:07:55 +00:00
David Karoly 84745ade1b kernel/arm/paging: use simplified permission model
Change-Id: Ie0ed357ee9ca5bee4c10c6cbf74eaba77acdd179
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6435
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2023-05-16 18:07:45 +00:00
David Karoly c10c49daf7 kernel/arm64: refactor TLS initialization
Change-Id: I3022749d49ca4159ef2e3c129178be12f8b3b972
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6440
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-05-14 19:18:31 +00:00
David Karoly 191eff4135 kernel/arm: remove unused function arch_check_syscall_restart
Change-Id: I5cb8643937cf1dccfce21dbb1478b0468e99a7e8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6439
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-05-14 19:15:40 +00:00
David Karoly 786c14d06d boot/arm64: set trace level with constexprs
Change-Id: I8d37065cd84476b07df4756659bb011c2b877397
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6434
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-05-11 11:24:17 +00:00
David Karoly 54fc4c3c49 boot/arm: set trace level with constexprs
Change-Id: Ib5671238cd9c442f9948c6bee2aff30cbfbff0f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6427
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: X512 <[email protected]>
2023-05-09 21:09:11 +00:00
David Karoly 6c58b765f3 kernel/arm: use inline functions for accessing coproc registers
Change-Id: I626ef5722f4ae043de9e8b0c37dbde97ac0513be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6422
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-09 20:50:42 +00:00
David Karoly 9875f74d65 kernel/arm/paging: fix alignment issue in InterruptGetPageTableAt
Page tables are 1KB aligned on ARMv7 so in some rare cases the
assertion for checking page alignment could trigger.

This change introduces an offsetting mechanism similar to GetPageTableAt.

Change-Id: Ibf5cf60d35573143fa7c750ef9e3627f693005a7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6423
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-05-09 20:10:32 +00:00
David Karoly c13766fc00 kernel/arm: check for access flag fault in page fault handler
Change-Id: Icc782a692e5dcd861958ffea934386b4d4e569c7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6428
Reviewed-by: waddlesplash <[email protected]>
2023-05-09 20:10:12 +00:00
David Karoly 3d2b8a2045 remove unused header arm920t.h
Change-Id: I288e083857b6da30788be3f902dedd07e3e54d9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6426
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-05-09 18:27:46 +00:00
David Karoly 00377c99e7 libroot/uname: remove unused architectures alpha, mips, sh4
Change-Id: I38b273d8d7c16a34552cc4aaed7d54b7026d590c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6410
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-05-08 06:49:01 +00:00
David Karoly 19537d01d1 kernel/arm: adjust function names for getting/setting SCTLR
Change-Id: I28d6101c772a5065beec5af20f6d2a0c1855ae6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6421
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2023-05-07 17:35:21 +00:00
David Karoly 2b9f3f2962 libroot/uname: fix uname for arm
Change-Id: I2538c3f00307ccf9c71dd602eae383136f81cd3f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6409
Reviewed-by: Adrien Destugues <[email protected]>
2023-05-04 20:28:15 +00:00
David Karoly e37168ad4f kits/app: fix unaligned copy in BMessage
BMessage contents are packed so we might get alignment exception on some
architectures when fetching fields from message with Find##typeName.

As memcpy() is already used when composing message content in AddData,
here we introduce memcpy in Find##typeName functions.

Change-Id: I0213409a219acda138f8d2fe7023e5dcfcd5cff3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6195
Tested-by: Automation <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-03-30 14:54:15 +00:00
David Karoly 60b19d7eac kernel/arm: implement signals, fork, restart syscall
Change-Id: I24219b83d90710ef719190183ba6f069f82dae61
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6198
Tested-by: Automation <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-03-20 17:28:20 +00:00
David Karoly 772df0f646 kernel/arm/paging: assume nothing is dirty
This is a workaround to allow early bootup to progress further.

Eventually accessed and modified page flags will need to be implemented
but for now this patch allows to proceed with bringup attempts
for the ARM port.

Change-Id: Icad415a5d484213a76a90ca79bb76463140a8bdf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6197
Tested-by: Commit checker robot <[email protected]>
Tested-by: Automation <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-03-18 07:26:05 +00:00
David Karoly 434aab5a4d headers/kernel: remove alpha folder
Change-Id: I057cb53ad68113e9dce2bb13f172d4c3eb1406af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6196
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Automation <[email protected]>
2023-03-12 10:36:01 +00:00
David Karoly 0aeb55c8ac arm: remove unused variables from arch_kernel_args
Change-Id: Ice2be644142b646205648f44fb5bce5e9848e69d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6192
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Automation <[email protected]>
2023-03-11 21:05:49 +00:00
David Karoly 9a9c5e9fee kernel/arm: clean up x86 PAE related code
Change-Id: I2bd1f1dc699396fee1ec03b5895e995c3aca5fef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6193
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Automation <[email protected]>
2023-03-11 21:05:37 +00:00
David Karoly f964790bcc headers/kernel: remove sh4 folder
Change-Id: I71e52b0f4e81c872b9bc14490bf7c38b261120b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6194
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Automation <[email protected]>
2023-03-11 21:05:20 +00:00
David Karoly b19fa88344 boot/arm64: don't map EFI loader code and data regions
Change-Id: Ic3e83dceb917c84db6baed1f1e4af4a27ece5372
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6177
Tested-by: Automation <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2023-03-09 09:39:14 +00:00
David Karoly e490b6343a kernel/arm64: align interrupt postlude with other architectures
Change-Id: I0a5325f163d2ca99bfdaa35d7addedcfdc16ff9a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6178
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-03-07 20:30:31 +00:00
David Karoly 1831c1c60d libroot/crypt: remove selectsmix
There's only one implementation of smix so we don't
need any selection logic.

Change-Id: Id43e4ed49ee5a96755c3c4ab975bd128024e57b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6065
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-02-14 20:32:20 +00:00
David Karoly 6b8403b44b libroot/crypt: replace crypt_des implementation with musl's
This is required to make crypt_r() really reentrant.

Change-Id: I81497be16cae21fabb5895a88e27e6c20d3e06e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6066
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-02-13 19:38:56 +00:00
David Karoly 125b262675 libroot: introduce crypt_r
Change-Id: Ieacd1b383ac078a440227c7954f5531a36fbbd62
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5827
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-02-10 18:00:44 +00:00
David Karoly 756f03a03d ldscripts: remove mipsel
Change-Id: I94c554553a751ce83166c43ed55cee9df7ef0f81
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5828
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-11-25 17:44:16 +00:00
David Karoly 9ae2ef5de6 boot/efi: implement ring buffer
Change-Id: I7c384eb859e28ce824bd5cc5e85039d80462eb67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5722
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-10-19 00:10:25 +00:00
David Karoly a3fb982730 boot/efi/riscv64: use generic mmu functions
Change-Id: I671f41b9c163c522ffa7ffcb2509f279c4c9496a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5701
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-10-10 21:28:59 +00:00
David Karoly f151690800 fix revision string for BIOS loader
The original linker script puts sHaikuRevision after __bss_start
which results in the revision string getting overwritten with zeroes
when the boot loader starts.

This change ensures that sHaikuRevision comes before __bss_start.

Change-Id: I271f2571ea274092f91f01019dcf8dcc1ad01bf3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5721
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-10-06 20:12:47 +00:00
David Karoly 05c1a8991e enable EFI boot for 32-bit ISO image
Building EFI partition for 32-bit anyboot ISO image was disabled
in hrev52443 to fix issue #14656.

As haiku_loader.efi is now available for the x86 architecture
since hrev55917, we can re-enable building EFI system partition
for the 32-bit ISO.

We can also remove the build rules related to HAIKU_ANYBOOT_LEGACY
as it is not used any more.

Change-Id: I9c2c272bcd0f9c1a98ee6cea300374dc26b4818d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5716
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-10-06 20:12:05 +00:00
David Karoly 2ca24be640 boot: embed Haiku revision in loader binary
Change-Id: I9f71fba6c2c4fdaa63e118825c5fd00d51b556fb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5693
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-10-03 18:50:39 +00:00
David Karoly a3c9f71efd boot/efi: factor out generic mmu functions
This change moves the common functions related to EFI memory map
to arch/generic for arm, arm64, x86.

riscv64 and x86_64 shall be handled separately as they use some
more architecture-specific logic:
* riscv64 needs special treatment for the M-mode resident code
  located at 0x80000000 which is reported as available in the
  EFI memory map provided by u-boot.
* x86_64 has a slightly different logic for building the
  memory regions list so some additional rework and testing will be
  needed before it can be unified with the generic mmu functions.

Change-Id: I430c84dfc693c5b6f04c170dec8ffb1db2c2ace1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5694
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-09-27 19:13:36 +00:00
David Karoly 820db870a7 kernel/x86: fix build for 32-bit ELF loader on 64-bit arch
Change-Id: I7c9e8cb7a3d03d40167f7924c17e95f5ad646afe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5695
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-09-26 14:54:39 +00:00
David Karoly 5897f7b623 boot/efi/x86: enable support for 64-bit ELF
Change-Id: Id3b207444b55041dc83ee1afdd61b467ce13ff70
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5665
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-09-26 14:30:19 +00:00
David Karoly 84bd9b4ad5 boot/efi/arm64/mmu: convert TRACE to use new syntax
Change-Id: Ib25cee9e7ea37a68d0d432db8b99eb419e453e7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5689
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: David Karoly <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-09-23 18:10:39 +00:00
David Karoly cec78ae332 kernel/arm64: introduce virtual_ranges_to_keep
Change-Id: I6de950cb18892ebf2dd2aefa34b65b90a17e3f2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5682
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2022-09-23 13:57:43 +00:00
David Karoly a0c8f15f33 kernel/arm64: implement iframe stack and unwinding
Change-Id: I1587c1f57bd73777a188bb8f1bc58263de82fcb9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5684
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: David Karoly <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-09-23 13:56:16 +00:00
David Karoly 139831c54c boot/efi/x86_64: log memory map on bootup
Change-Id: I94c169d598d771a813b16e31fd892d7cdafcaad8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5687
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-09-23 11:39:04 +00:00
David Karoly 537d67ae5c kernel/arm: fix frame pointer after unwinding iframe
Change-Id: I285896ff6624e26695e282d02011a31de32fc297
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5678
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-09-20 08:19:47 +00:00
David Karoly ef89435316 boot/x86: unify KERNEL_LOAD_ADDRESS for BIOS and EFI
Change-Id: Ia3157c7c0908698da94c1aa85cb6366fb00fb7f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5670
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-09-19 14:51:58 +00:00
David Karoly 303283fb7a kernel/arm64: implement stack trace
Change-Id: If5627fb4d37bdb7260d7e14c0c3e8cf7bcbee53d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5672
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2022-09-19 14:51:18 +00:00
David Karoly 9a31a30528 implement TLS for arm64
Use the EL0 Read-Only Software Thread ID Register aka TPIDRRO_EL0
to store TLS pointer.

The EL0 Read-Only Software Thread ID Register is read-only in User mode
and read/write in privileged modes.

Change-Id: Idea7e3d66cd391dbbe3f9395cb37716089a49e13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5673
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2022-09-19 14:51:00 +00:00
David Karoly 98dea60252 kernel/x86/elf: fix build with TRACE enabled
Change-Id: Ibed0d5e628500b0c5e2f999d95587490079519d3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5671
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-09-18 06:16:09 +00:00
David Karoly 806a5d179e boot/efi/x86: move bootGDTDescriptor to local variable
Global variable gBootGDTDescriptor is used only in function arch_start_kernel()
so we can convert it to a local variable.

Change-Id: I8b6ad2c0903364bdcdcc1039aea6c9c09253fe09
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5663
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2022-09-15 07:39:02 +00:00
David Karoly 6a7095af63 boot/efi/x86: move bootGDT local variable
Global variable gBootGDT is used only in function arch_mmu_init_gdt()
so we can convert it to a local variable.

Change-Id: I06174dcd6df4b7bd5136a7e2fabafdc3273f03d3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5662
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-09-15 07:39:02 +00:00
David Karoly e98ad6fc50 kernel/x86/pae: fix build with TRACE enabled
Change-Id: Ifbf979608978a66ad6d2b9af8002c39f1f205422
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5661
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-09-15 04:36:38 +00:00
David Karoly f9be2680d9 x86: use elif defined(__x86_64__) in arch_kernel.h
Change-Id: Ibad5f34d73d48c5d1af870131f20ae9b52d88eb8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5664
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-09-15 04:33:47 +00:00
David Karoly 61299599e0 kernel/arm: disable interrupts when returning from exception handler
Change-Id: I66a7d023d105e2bf066b9597f7703755c73c3e55
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5633
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-09-10 15:19:00 +00:00
David Karoly 7fe1087ed4 bfs: fix alignment of struct dirent
This is needed on ARMv7 as inode number is stored using STRD instruction
which can result in alignment fault even when SCTLR.A bit is disabled.

see ARMARM section A3.2.1, Unaligned data access

Change-Id: Ib17bf3f78e84ad7987d8158426bc9b27ded28a8e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5623
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-09-08 18:06:26 +00:00