Import the following upstream commits:
30a807de7d76dbc244c3afb1d55817da286c78245477b93a3b
which contain new supported devices added in inf file and two bugfixes from me, which fix all playback distortions with all XP-compatible HD audio codecs.
Tested and works fine with Realtek HD audio codec R2.74 on ALC660 controller at least, but it still needs to be tested with other codecs as well (like SigmaTel etc.).
Also update the commit hash in 3rd party files.txt appropriately.
Remove *_new prefix from the new HDAudBus driver, since it's now used by default and the previous (old) one was removed.
[DOC] Update the path of the new HDAudBus driver to the current actual one.
CORE-20528
Addendum to commit 912c8ad987 (PR #5187)
Fix a bug where "KDCOM/KDGDB_NAME_ON_CD" CMake variables weren't used
as variables, but directly as names.
```
gdb_input.c(243): error C4477: '_snprintf' : format string '%p' requires
an argument of type 'void *', but variadic argument 1 has type 'UINT_PTR'
i386_sup.c(98): error C4090: 'return': different 'const' qualifiers
amd64_sup.c(115): error C4090: 'return': different 'const' qualifiers
```
But add KDGDB compilation only for x86 and x64, since for other
architectures (e.g. ARM) it currently emits the following error:
```
drivers/base/kdgdb/kdgdb.h(149): fatal error C1189: #error:
"Please define relevant macros for your architecture"
```
For the time being, keep the "GDB" build configuration macro, used for
Gitpod testing... but this needs to be replaced with a more robust solution.
Because of this, rename kdgdb.dll to kdcom.dll, and kdcom.dll to kdser.dll
so that GDB is used by default, and we don't get a file name clash too.
Revert also commit 57cf5cdc5d.
This is the same feature as the one that already exists in the
NTOS:KD!kdmain.c module used by the in-kernel KDBG debugger
(GCC builds), first introduced in commit 4ce30245de (r54473),
and documented at:
https://reactos.org/wiki/Debugging#Changing_the_serial_port_address
This feature is useful if one uses a PCI, PCIe, PCMCIA, or ExpressCard
serial card on real hardware (these cards are used e.g. with laptops
without a built-in serial port), or with AMT serial over LAN.
After determining the serial port I/O address (say, 0xCC00), specify
the debug port as follows:
/DEBUGPORT=COM:0xCC00
instead of the usual syntax: /DEBUGPORT=COMn (n an integer).
The same syntax can be used for debugging FreeLoader as well: in the
FREELDR.INI file, add a "Debug" line in the "FREELOADER" section,
as follows:
```
[FREELOADER]
Debug=/DEBUG /DEBUGPORT=COM:0xCC00 /BAUDRATE=115200
```
----
NOTE for KDCOM/KDGDB:
Since `strtoul()` is used, but isn't exported by ntoskrnl, link against
the "strtol" static library that has been introduced in commit d317d4fbcc
(r71481).
Don't loop past the end of the command-line buffer, if the command-line
terminates with a lone "DEBUGPORT" without any extra parameter following.
For example: "some things DEBUGPORT "
- Don't hardcode constant string lengths.
- Use `_strnicmp()` -- Ideally we shouldn't have to unconditionally upcase
the global kernel command-line string to perform substrings comparisons.
- Cast `atol()` returned value to `ULONG`.
- The "IRQ" debugger option was introduced in commit 5a6adb4f13 (r2546).
It was used by the in-kernel GDB stub, to manually wire an interrupt
handler `GspBreakIn()` to allow the debugger to break into the system
when a command is received on the GDB serial port.
Side-remark:
The hooking was done via `HalGetInterruptVector()` + `IoConnectInterrupt()`,
but only at phase 1 initialization when the memory manager was up, which
can be "late" enough during system boot initialization.
Instead of using `IoConnectInterrupt()`, one could have used explicit
`KeInitializeInterrupt()` + `KeConnectInterrupt()` calls that would
have worked much earlier in the boot stage.
- This functionality was soon after disabled in commit c804ca06be (r2946)
in the GDB stub (see `ntoskrnl/kd/gdbstub.c!KdGdbStubInit()`), never
to be re-enabled again.
It was removed completely in commit e160c0fb26 (r14799).
- Since ReactOS was (until recently) always debugged locally using the
in-kernel KDBG debugger, break-in was done with TAB-K keypress,
intercepted by the keyboard driver that triggered a `DbgBreakPoint()`,
thus no break-in via serial port interrupt was necessary.
- Remote debugger break-in detection, which is the standard method that
is used when remote-debugging using KD transport DLLs and WinDbg, was
introduced in commit 12e7593f24 (r25984). As with the rest of debugger
communication and as done on Windows, detection is done by polling the
serial port at certain times, namely in the `KeUpdateSystemTime()`
kernel procedure periodically invoked by the timer interrupt.
This break-in detection was then erroneously removed in commit bf8b9467dc
(r45140), and reinstated in commit 014b23b9a (r56194).
- Parsing of this "IRQ" option was copy-pasted in other modules (FreeLoader,
KDCOM, and KDGDB), even though it was never used. The parsing was then
removed in KDBG itself in commit 95faf65ebf, but left in the other
modules... until now!
Cherry-picking commit
3158b917a2
See https://github.com/bobranten/Ext4Fsd/issues/83 for more information,
and debug traces.
## How to reproduce:
- Format a partition in Ext2 with Paragon Hard Disk Manager 2010 Professional.
- Compile ReactOS with MSVC, ensuring that the driver is compiled with
`EXT2_HTREE_INDEX` defined and set to 1, and with Run-time error checks
enabled with the `/RTC1` flag (this is the default in our source tree).
- Install ReactOS on this partition.
## What's being observed:
After reboot, some filesystem paths are accessed, and the code inside the
`#ifdef EXT2_HTREE_INDEX` block is taken (in ext2/src/dirctl.c#L777-L794).
For some reasons, the retrieved `rc` doesn't get the "expected" value and
the `goto errorout;` path is taken. After this label, `FileIndex` was
reset to `ByteOffset`, which remained uninitialized.
A bugcheck ensues because of the failed check (usage of uninitialized variable).
C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp: In function 'BOOLEAN UniataChipDetectChannels(PVOID, PPCI_COMMON_CONFIG, ULONG, PPORT_CONFIGURATION_INFORMATION)':
C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp:111:5: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
111 | for(i=deviceExtension->AHCI_PI_mask, n=0; i; n++, i=i>>1);
| ^~~
In file included from C:/ReactOS/reactos/drivers/storage/ide/uniata/stdafx.h:13,
from C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp:48:
C:/ReactOS/reactos/drivers/storage/ide/uniata/atapi.h:154:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
154 | #define KdPrint2(_x_) {;}
| ^
C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp:112:5: note: in expansion of macro 'KdPrint2'
112 | KdPrint2((PRINT_PREFIX "mask -> %d chans\n", n));
| ^~~~~~~~
Fixes GCC 13 warning about misleading indentation.
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c: In function 'acpi_evaluate_reference':
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:367:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
367 | if (buffer.Pointer)
| ^~
In file included from C:/ReactOS/reactos/drivers/bus/acpi/acpica/include/acpi.h:70,
from C:/ReactOS/reactos/drivers/bus/acpi/precomp.h:6,
from C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:26:
C:/ReactOS/reactos/drivers/bus/acpi/acpica/include/acoutput.h:496:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
496 | #define return_ACPI_STATUS(s) return(s)
| ^~~~~~
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:370:9: note: in expansion of macro 'return_ACPI_STATUS'
370 | return_ACPI_STATUS(status);
| ^~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/drivers/filesystems/ext2/src/ext4/ext4_extents.c: In function 'ext4_ext_insert_index':
C:/ReactOS/reactos/drivers/filesystems/ext2/src/ext4/ext4_extents.c:788:22: warning: taking address of packed member of 'struct ext4_extent_header' may result in an unaligned pointer value [-Waddress-of-packed-member]
788 | le16_add_cpu(&curp->p_hdr->eh_entries, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~
Also apply _SEH2_VOLATILE where needed (all variables that are set in the __try block and referenced in the __except or __finally block).
It's hard to tell whether these are false positives, because the code is quite a mess.
C:/ReactOS/reactos/drivers/filesystems/udfs/udfinit.cpp: In function 'NTSTATUS UDFDismountDevice(PUNICODE_STRING)':
C:/ReactOS/reactos/drivers/filesystems/udfs/udfinit.cpp:643:36: error: 'Buffer' is used uninitialized [-Werror=uninitialized]
643 | PFILE_FS_ATTRIBUTE_INFORMATION Buffer;
| ^~~~~~
- Read the interface metric from the registry.
- Assign an automatic metric to an interface if a registry value is not available.
- Determine the automatic metric from the link speed. The metric for the loopback interface is always 1.
- Identify 127.x.x.x addresses as on-link addresses.
- Modify the neighbor cache to map all 127.x.x.x addresses to the loopback address (127.0.0.1).
- Create a single entry for all 127.x.x.x addresses instead of one entry per address. This entry belongs to the loopback address.
CORE-7484
RtlConvertUlongToLargeInteger and RtlConvertLongToLargeInteger are
obsolete NT routines that assign a 32-bit integer to LARGE_INTEGER.QuadPart.
Replace all driver/DLL usages with inline .QuadPart assignments or
standard C/C++ casts. This removes unnecessary function calls.
CORE-19438
Use hardcoded value '1' instead of predefined 'PCI_BUS_INTERFACE_STANDARD_VERSION', as in the current upstream.
Import upstream commit 4c92e71ef9.
According to the note from CoolStar, that defined value is different on Windows 11, so it causes some problems and '1' should be used instead.
Missed that during the import before.
Addendum to 7c2d923007.
Its purpose is to offer an out-of-the-box generic framebuffer video
(a video miniport driver for win32k will be introduced in a future PR)
to ease ReactOS porting to other possibly non-PC-compatible systems,
where no VGA-compatible video is present and only linear framebuffers
are available; for example: XBOX, UEFI with GOP only, AppleTV, etc.
Of course, once ReactOS is ported, one can then (and should) write,
or use existing video drivers tailored to the system of interest.
Together with our FreeLoader, this driver could also be employed for
of porting/modding Windows 2000/XP/2003 attempts to other platforms,
as this has been done by external contributors.
Current limitations:
- Only supports 32 bits-per-pixel ARGB format. This limitation will be
removed in subsequent PR(s).
- May be slow during rendering (region color filling and scrolling);
I will try to improve this as time goes.
This driver's code is loosely based upon preliminary code by Justin Miller
and on the existing XBOX bootvid implementation.
Tested by Justin Miller (@TheDarkFire) for UEFI, and by Sylas Hollander
(@DistroHopper39B) with his AppleTV port.
It has also been tested with VESA linear modes on PC by myself.
Stop pointless target_sources(xxx PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>). The only effect it has is to force the object file into the target, which was already done by specifying the libraries as OBJECT libraries, which is also pointless, and only leads to problems.
Use `PCSTR` for the type of the (Hal,Inbv,Vid)DisplayString() routines'
`String` parameter, instead of `PCHAR` or `PUCHAR`, since it points to a
NUL-terminated string. (The buffer isn't a counted string.)
And improve SAL annotations along the way.
This makes the code more readable than using e.g. `VidpScrollRegion[0]`,
`VidpScrollRegion[1]` etc. instead of `VidpScrollRegion.Left`,
`VidpScrollRegion.Top` respectively.
Based on a suggestion by Dmitry Borisov.
In addition:
- move back common function prototypes to precomp.h;
- const-ify `VidpFontData` and adjust its usages;
- improve SAL annotations for `InitPaletteWithTable()`;
- rename the (Vid)ResetDisplay() parameter to "SetMode".
These drivers expect PC/AT compatible hardware thus they are unsuitable for PC-98.
Disable the drivers for the time being until we have a proper implementation.
CORE-17977