diff --git a/boot/armllb/boot.s b/boot/armllb/boot.s index 899013f4..93a3fb74 100644 --- a/boot/armllb/boot.s +++ b/boot/armllb/boot.s @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS Boot Loader + * PROJECT: Boot Loader * LICENSE: BSD - See COPYING.ARM in the top level directory * FILE: boot/armllb/boot.s * PURPOSE: Implements the entry point for ARM machines diff --git a/boot/bootdata/bootcd.ini b/boot/bootdata/bootcd.ini index 588dd8d3..4b89bf33 100644 --- a/boot/bootdata/bootcd.ini +++ b/boot/bootdata/bootcd.ini @@ -3,7 +3,7 @@ DefaultOS=Setup TimeOut=0 [Display] -TitleText=ReactOS Setup +TitleText=Setup StatusBarColor=Cyan StatusBarTextColor=Black BackdropTextColor=White diff --git a/boot/bootdata/hivebcd.inf b/boot/bootdata/hivebcd.inf index 4ca0783d..0a28aa30 100644 --- a/boot/bootdata/hivebcd.inf +++ b/boot/bootdata/hivebcd.inf @@ -7,10 +7,10 @@ BCD,"BCD00000000\Description\Control","TreatAtSystem",0x00010001,1 BCD,"BCD00000000\Description\Control","KeyName",,"BCD00000000" ; -; ReactOS Boot Manager +; Boot Manager ; BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Description","Type",0x00010001,0x10100002 ; identifier={bootmgr} -BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\12000004","Element",,"ReactOS Boot Manager" ; description +BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\12000004","Element",,"Boot Manager" ; description BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\12000005","Element",,"en-US" ; locale="en-US" BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\14000006","Element",0x10000,"{7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}" ; inherit={globalsettings} BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\23000003","Element",,"{7619dcc9-fafe-11d9-b411-000476eba25f}" ; default={winload} @@ -19,7 +19,7 @@ BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\2400001 BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\25000004","Element",0x1,0x1e ; timeout=30 ; -; ReactOS Boot Loader +; Boot Loader ; BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Description","Type",0x00010001,0x10200003 ; identifier={winload} BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\11000001","Element",0x1,\ ; device=boot diff --git a/boot/bootdata/hivecls.inf b/boot/bootdata/hivecls.inf index e8bbdf0e..3ea5aff0 100644 --- a/boot/bootdata/hivecls.inf +++ b/boot/bootdata/hivecls.inf @@ -55,18 +55,18 @@ HKCR,"anifile","",0x00000000,"Animated Cursor" HKCR,"anifile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\main.cpl,-1039" HKCR,"anifile\DefaultIcon","",0x00000000,"%1" -; ReactOS Batch Files +; Batch Files HKCR,".bat","",0x00000000,"batfile" -HKCR,"batfile","",0x00000000,"ReactOS Batch File" +HKCR,"batfile","",0x00000000,"Batch File" HKCR,"batfile","EditFlags",0x00010001,0x00000010 HKCR,"batfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-201" HKCR,"batfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-153" HKCR,"batfile\shell\edit\command","",0x00020000,"%SystemRoot%\system32\notepad.exe %1" HKCR,"batfile\shell\open\command","",0x00000000,"""%1"" %*" -; ReactOS Command Script Files +; Command Script Files HKCR,".cmd","",0x00000000,"cmdfile" -HKCR,"cmdfile","",0x00000000,"ReactOS Command Script" +HKCR,"cmdfile","",0x00000000,"Command Script" HKCR,"cmdfile","EditFlags",0x00010001,0x00000010 HKCR,"cmdfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-202" HKCR,"cmdfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-153" @@ -640,7 +640,7 @@ XMLFILE="XML Document" XSLFILE="XSL Stylesheet" ;; In msi.dll -MSIPACK="ReactOS Installer Package" +MSIPACK="Installer Package" ;; In themeui.dll MSSTYLESFILE="Visual Style File" @@ -708,7 +708,7 @@ CPLFILE_OPENWITH="Ouvrir avec le Panneau de Contr̫le" CHMFILE="Fichier d'aide HTML compil̩" XMLFILE="Document XML" XSLFILE="Feuille de style XSL" -MSIPACK="Package ReactOS Installer" +MSIPACK="Package Installer" MSSTYLESFILE="Fichier de styles visuels" THEMEFILE="Fichier de th̬mes" WAVFILE="Son Wave" diff --git a/boot/bootdata/hivedef.inf b/boot/bootdata/hivedef.inf index 4837441c..6cf6cd80 100644 --- a/boot/bootdata/hivedef.inf +++ b/boot/bootdata/hivedef.inf @@ -155,7 +155,7 @@ HKCU,"Control Panel\International",,0x00000012 HKCU,"Control Panel\International\Geo",,0x00000012 ; Cursors Schemes -HKCU,"Control Panel\Cursors",,,"ReactOS Default" +HKCU,"Control Panel\Cursors",,,"Default" HKCU,"Control Panel\Cursors","Scheme Source",0x00010001,0x00000002 ; PowerCfg @@ -217,7 +217,7 @@ HKCU,"Control Panel\Appearance","Current",0x00020000,"%DESKTOP_SCHEME_0%" HKCU,"Control Panel\Appearance","NewCurrent",0x00020000,"%DESKTOP_SCHEME_0%" HKCU,"Control Panel\Appearance\New Schemes","SelectedSize",0x00020000,"0" HKCU,"Control Panel\Appearance\New Schemes","SelectedStyle",0x00020000,"0" -; ReactOS Standard +; Standard HKCU,"Control Panel\Appearance\New Schemes\0","DisplayName",0x00020000,"@themeui.dll,-883" HKCU,"Control Panel\Appearance\New Schemes\0","LegacyName",0x00020000,"%DESKTOP_SCHEME_0%" HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","DisplayName",0x00020000,"@themeui.dll,-2019" @@ -1211,7 +1211,7 @@ HKCU,"Control Panel\Appearance\New Schemes\13\Sizes\0","Size #5",0x000b0001,0c,0 HKCU,"Control Panel\Appearance\New Schemes\13\Sizes\0","Size #6",0x000b0001,0c,00,00,00,00,00,00,00 HKCU,"Control Panel\Appearance\New Schemes\13\Sizes\0","Size #7",0x000b0001,12,00,00,00,00,00,00,00 HKCU,"Control Panel\Appearance\New Schemes\13\Sizes\0","Size #8",0x000b0001,12,00,00,00,00,00,00,00 -; ReactOS Classic +; Classic HKCU,"Control Panel\Appearance\New Schemes\14","DisplayName",0x00020000,"@themeui.dll,-880" HKCU,"Control Panel\Appearance\New Schemes\14","LegacyName",0x00020000,"%DESKTOP_SCHEME_14%" HKCU,"Control Panel\Appearance\New Schemes\14\Sizes\0","DisplayName",0x00020000,"@themeui.dll,-2019" @@ -1923,7 +1923,7 @@ HKCU,"SOFTWARE",,0x00000012 HKCU,"SOFTWARE\Policies",,0x00000012 HKCU,"SOFTWARE\Microsoft",,0x00000012 -; ReactOS Calculator +; Calculator HKCU,"SOFTWARE\Microsoft\Calc",,0x00000012 HKCU,"SOFTWARE\Microsoft\Calc","layout",0x00010001,0x00000001 HKCU,"SOFTWARE\Microsoft\Calc","UseSep",0x00010001,0x00000001 @@ -2128,7 +2128,7 @@ HKCU,"AppEvents\Schemes\Apps\Explorer\Navigating",,0x00000012 HKCU,"AppEvents\Schemes\Apps\Explorer\Navigating\.Current","",0x00020000,"" HKCU,"AppEvents\Schemes\Apps\Explorer\Navigating\.Default","",0x00020000,"" HKCU,"AppEvents\Schemes\Names",,0x00000012 -HKCU,"AppEvents\Schemes\Names\.Default","",0x00000002,"ReactOS Default" +HKCU,"AppEvents\Schemes\Names\.Default","",0x00000002,"Default" HKCU,"AppEvents\Schemes\Names\.None","",0x00000002,"No sounds" HKCU,"AppEvents\EventLabels",,0x00000012 @@ -2184,9 +2184,9 @@ HKCU,"AppEvents\EventLabels\SystemQuestion","",0x00000000,"Question" HKCU,"AppEvents\EventLabels\SystemQuestion","DispFileName",0x00000000,"@mmsys.cpl,-5849" HKCU,"AppEvents\EventLabels\SystemStart","",0x00000000,"Start ReactOS" HKCU,"AppEvents\EventLabels\SystemStart","DispFileName",0x00000000,"@mmsys.cpl,-5850" -HKCU,"AppEvents\EventLabels\WindowsLogoff","",0x00000000,"ReactOS Logoff" +HKCU,"AppEvents\EventLabels\WindowsLogoff","",0x00000000,"Logoff" HKCU,"AppEvents\EventLabels\WindowsLogoff","DispFileName",0x00000000,"@mmsys.cpl,-5852" -HKCU,"AppEvents\EventLabels\WindowsLogon","",0x00000000,"ReactOS Logon" +HKCU,"AppEvents\EventLabels\WindowsLogon","",0x00000000,"Logon" HKCU,"AppEvents\EventLabels\WindowsLogon","DispFileName",0x00000000,"@mmsys.cpl,-5853" ;-------------------------------- STRINGS ------------------------------- diff --git a/boot/bootdata/hivesft.inf b/boot/bootdata/hivesft.inf index 27112694..70ea9ca9 100644 --- a/boot/bootdata/hivesft.inf +++ b/boot/bootdata/hivesft.inf @@ -117,7 +117,7 @@ HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls",,0x00000012 HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls","Console",0x00020000,"%SystemRoot%\system32\console.dll" ; Cursors Schemes -HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cursors\Schemes","ReactOS Default",0x00020000,""",,,,,,,,,,,,,""" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cursors\Schemes","Default",0x00020000,""",,,,,,,,,,,,,""" ; Common shell folders HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",,0x00000012 diff --git a/boot/bootdata/hivesys.inf b/boot/bootdata/hivesys.inf index 0bcc9ebd..139e4b95 100644 --- a/boot/bootdata/hivesys.inf +++ b/boot/bootdata/hivesys.inf @@ -1900,9 +1900,9 @@ HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ObjectName",0x00000000,"LocalS HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Start",0x00010001,0x00000003 HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Type",0x00010001,0x00000020 -; ReactOS Telnet Service -HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Description",0x00000000,"ReactOS Telnet Service" -HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","DisplayName",0x00000000,"ReactOS Telnet Service" +; Telnet Service +HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Description",0x00000000,"Telnet Service" +HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","DisplayName",0x00000000,"Telnet Service" HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ErrorControl",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Group",0x00000000,"Network" HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ImagePath",0x00020000,"%SystemRoot%\system32\telnetd.exe" @@ -1923,9 +1923,9 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Themes","ObjectName",0x00000000,"LocalSy HKLM,"SYSTEM\CurrentControlSet\Services\Themes","Start",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\Themes","Type",0x00010001,0x00000020 -; ReactOS Installer Service +; Installer Service HKLM,"SYSTEM\CurrentControlSet\Services\MSIServer","DependOnService",0x00010000,"RPCSS" -HKLM,"SYSTEM\CurrentControlSet\Services\MSIServer","DisplayName",0x00000000,"ReactOS Installer" +HKLM,"SYSTEM\CurrentControlSet\Services\MSIServer","DisplayName",0x00000000,"Installer" HKLM,"SYSTEM\CurrentControlSet\Services\MSIServer","Description",0x00000000,"Controls installation, maintenance, and removal of software packaged as an MSI (Windows Installer)" HKLM,"SYSTEM\CurrentControlSet\Services\MSIServer","ErrorControl",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\MSIServer","ImagePath",0x00020000,"%SystemRoot%\system32\msiexec.exe /V" @@ -1935,7 +1935,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\MSIServer","Type",0x00010001,0x00000020 ; WMI Service HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","DependOnService",0x00010000,"RPCSS" -HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","DisplayName",0x00000000,"ReactOS Management Infrastructure" +HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","DisplayName",0x00000000,"Management Infrastructure" HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","Description",0x00000000,"Provides interface to system management information" HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","ErrorControl",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\winmgmt","Group",0x00000000,"WMI" diff --git a/boot/bootdata/hybridcd.ini b/boot/bootdata/hybridcd.ini index d53ab953..51dda03a 100644 --- a/boot/bootdata/hybridcd.ini +++ b/boot/bootdata/hybridcd.ini @@ -3,7 +3,7 @@ DefaultOS=Setup TimeOut=5 [Display] -TitleText=ReactOS Hybrid-CD +TitleText=Hybrid-CD StatusBarColor=Cyan StatusBarTextColor=Black BackdropTextColor=White diff --git a/boot/freeldr/bootsect/dosmbr.S b/boot/freeldr/bootsect/dosmbr.S index a042c476..1a0645c6 100644 --- a/boot/freeldr/bootsect/dosmbr.S +++ b/boot/freeldr/bootsect/dosmbr.S @@ -1,6 +1,6 @@ /* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Bootsector for ISO file system + * PROJECT: Bootsector for ISO file system * PURPOSE: Normal DOS boot sector * Ported to NASM from FreeDOS fdisk 1.2.0 by: * PROGRAMMERS: Casper Hornstrup (chorns@users.sourceforge.net) diff --git a/boot/freeldr/bootsect/fat32.S b/boot/freeldr/bootsect/fat32.S index 8b606d10..bbabd6d8 100644 --- a/boot/freeldr/bootsect/fat32.S +++ b/boot/freeldr/bootsect/fat32.S @@ -1,6 +1,6 @@ /* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Bootsector + * PROJECT: Bootsector * FILE: boot/freeldr/bootsect/fat32.S * PURPOSE: * PROGRAMMERS: Brian Palmer diff --git a/boot/freeldr/bootsect/faty.S b/boot/freeldr/bootsect/faty.S index c1aa1a2d..3956b974 100644 --- a/boot/freeldr/bootsect/faty.S +++ b/boot/freeldr/bootsect/faty.S @@ -1,6 +1,6 @@ /* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Bootsector + * PROJECT: Bootsector * FILE: boot/freeldr/bootsect/faty.S * PURPOSE: Combined FAT12, FAT16 and FAT32 boot sector * PROGRAMMERS: Brian Palmer diff --git a/boot/freeldr/bootsect/isoboot.S b/boot/freeldr/bootsect/isoboot.S index a3733e07..6f89f53e 100644 --- a/boot/freeldr/bootsect/isoboot.S +++ b/boot/freeldr/bootsect/isoboot.S @@ -1,6 +1,6 @@ /* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Bootsector for ISO file system + * PROJECT: Bootsector for ISO file system * FILE: boot/freeldr/bootsect/isoboot.S * PURPOSE: * PROGRAMMERS: ? diff --git a/boot/freeldr/freeldr/arch/arm/boot.S b/boot/freeldr/freeldr/arch/arm/boot.S index b664e9fb..8f259683 100644 --- a/boot/freeldr/freeldr/arch/arm/boot.S +++ b/boot/freeldr/freeldr/arch/arm/boot.S @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS Boot Loader + * PROJECT: Boot Loader * LICENSE: BSD - See COPYING.ARM in the top level directory * FILE: boot/freeldr/freeldr/arch/arm/boot.S * PURPOSE: Implements the entry point for ARM machines diff --git a/boot/freeldr/freeldr/arch/powerpc/boot.s b/boot/freeldr/freeldr/arch/powerpc/boot.s deleted file mode 100644 index cc67a408..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/boot.s +++ /dev/null @@ -1,111 +0,0 @@ - .section ".text" - .extern PpcInit - .globl _start - .globl call_ofw -_start: - sync - isync - - lis %r1,stackend@ha - addi %r1,%r1,stackend@l - - /* Store ofw call addr */ - mr %r21,%r5 - lis %r10,ofw_call_addr@ha - stw %r5,ofw_call_addr@l(%r10) - - bl zero_registers - - /* Zero CTR */ - mtcr %r31 - - lis %r3,PpcInit@ha - addi %r3,%r3,PpcInit@l - mtlr %r3 - - /* Check for ofw */ - lis %r3,ofw_call_addr@ha - lwz %r3,ofw_call_addr@l(%r3) - cmpw %r3,%r31 /* Zero? */ - mr %r3,%r31 - beq initfp - - lis %r3,call_ofw@ha - addi %r3,%r3,call_ofw@l - b bootme - -initfp: - /* Enabling FP at this point won't hurt, and the varargs scheme we're - * using now requires it. */ - mfmsr %r0 - ori %r0,%r0,8192 - mtmsr %r0 - -bootme: - blr - -zero_registers: - xor %r2,%r2,%r2 - mr %r0,%r2 - mr %r3,%r2 - - mr %r4,%r2 - mr %r5,%r2 - mr %r6,%r2 - mr %r7,%r2 - - mr %r8,%r2 - mr %r9,%r2 - mr %r10,%r2 - mr %r11,%r2 - - mr %r12,%r2 - mr %r13,%r2 - mr %r14,%r2 - mr %r15,%r2 - - mr %r12,%r2 - mr %r13,%r2 - mr %r14,%r2 - mr %r15,%r2 - - mr %r16,%r2 - mr %r17,%r2 - mr %r18,%r2 - mr %r19,%r2 - - mr %r20,%r2 - mr %r21,%r2 - mr %r22,%r2 - mr %r23,%r2 - - mr %r24,%r2 - mr %r25,%r2 - mr %r26,%r2 - mr %r27,%r2 - - mr %r28,%r2 - mr %r29,%r2 - mr %r30,%r2 - mr %r31,%r2 - - blr - -ofw_memory_size: - .long 0 - .long 0 - .long 0 - .long 0 - - .align 4 -stack: - .space 0x4000 -stackend: - .long 0,0,0,0 - - .globl _bss - .section ".bss2" -_bss: - .long 0 - - .align 4 diff --git a/boot/freeldr/freeldr/arch/powerpc/compat.h b/boot/freeldr/freeldr/arch/powerpc/compat.h deleted file mode 100644 index e62d16de..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/compat.h +++ /dev/null @@ -1,105 +0,0 @@ -#pragma once - -#define __init -#define __initdata - -#define SPRN_MSSCR0 0x3f6 /* Memory Subsystem Control Register 0 */ -#define SPRN_MSSSR0 0x3f7 /* Memory Subsystem Status Register 1 */ -#define SPRN_LDSTCR 0x3f8 /* Load/Store control register */ -#define SPRN_LDSTDB 0x3f4 /* */ -#define SPRN_LR 0x008 /* Link Register */ -#ifndef SPRN_PIR -#define SPRN_PIR 0x3FF /* Processor Identification Register */ -#endif -#define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */ -#define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */ -#define SPRN_PURR 0x135 /* Processor Utilization of Resources Reg */ -#define SPRN_PVR 0x11F /* Processor Version Register */ -#define SPRN_RPA 0x3D6 /* Required Physical Address Register */ -#define SPRN_SDA 0x3BF /* Sampled Data Address Register */ -#define SPRN_SDR1 0x019 /* MMU Hash Base Register */ -#define SPRN_ASR 0x118 /* Address Space Register */ -#define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ -#define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ -#define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ -#define SPRN_SPRG2 0x112 /* Special Purpose Register General 2 */ -#define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */ -#define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */ -#define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */ -#define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */ -#define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */ -#define SPRN_SRR0 0x01A /* Save/Restore Register 0 */ -#define SPRN_SRR1 0x01B /* Save/Restore Register 1 */ -#ifndef SPRN_SVR -#define SPRN_SVR 0x11E /* System Version Register */ -#endif -#define SPRN_THRM1 0x3FC /* Thermal Management Register 1 */ -/* these bits were defined in inverted endian sense originally, ugh, confusing */ - -/* Values for PP (assumes Ks=0, Kp=1) */ -#define PP_RWXX 0 /* Supervisor read/write, User none */ -#define PP_RWRX 1 /* Supervisor read/write, User read */ -#define PP_RWRW 2 /* Supervisor read/write, User read/write */ -#define PP_RXRX 3 /* Supervisor read, User read */ - -/* Block size masks */ -#define BL_128K 0x000 -#define BL_256K 0x001 -#define BL_512K 0x003 -#define BL_1M 0x007 -#define BL_2M 0x00F -#define BL_4M 0x01F -#define BL_8M 0x03F -#define BL_16M 0x07F -#define BL_32M 0x0FF -#define BL_64M 0x1FF -#define BL_128M 0x3FF -#define BL_256M 0x7FF - -/* BAT Access Protection */ -#define BPP_XX 0x00 /* No access */ -#define BPP_RX 0x01 /* Read only */ -#define BPP_RW 0x02 /* Read/write */ - -/* Definitions for 40x embedded chips. */ -#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */ -#define _PAGE_FILE 0x001 /* when !present: nonlinear file mapping */ -#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */ -#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */ -#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */ -#define _PAGE_USER 0x010 /* matches one of the zone permission bits */ -#define _PAGE_RW 0x040 /* software: Writes permitted */ -#define _PAGE_DIRTY 0x080 /* software: dirty page */ -#define _PAGE_HWWRITE 0x100 /* hardware: Dirty & RW, set in exception */ -#define _PAGE_HWEXEC 0x200 /* hardware: EX permission */ -#define _PAGE_ACCESSED 0x400 /* software: R: page referenced */ - -#define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */ -#define _PMD_BAD 0x802 -#define _PMD_SIZE 0x0e0 /* size field, != 0 for large-page PMD entry */ -#define _PMD_SIZE_4M 0x0c0 -#define _PMD_SIZE_16M 0x0e0 -#define PMD_PAGE_SIZE(pmdval) (1024 << (((pmdval) & _PMD_SIZE) >> 4)) - -#define PVR_VER(pvr)(((pvr) >> 16) & 0xFFFF) /* Version field */ - -#define KERNELBASE 0x80000000 - -typedef unsigned char __u8; -typedef unsigned short __u16; -typedef unsigned int __u32; - -typedef struct _pci_reg_property { - struct { - int a_hi, a_mid, a_lo; - } addr; - int size_hi, size_lo; -} pci_reg_property; - -void btext_drawstring(const char *c); -void btext_drawhex(unsigned long v); - -void *ioremap(__u32 phys, __u32 size); -void iounmap(void *logical); - -__u32 GetPVR(void); diff --git a/boot/freeldr/freeldr/arch/powerpc/loader.c b/boot/freeldr/freeldr/arch/powerpc/loader.c deleted file mode 100644 index 24c958a7..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/loader.c +++ /dev/null @@ -1,349 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * Copyright (C) 2005 Alex Ionescu - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -#define _NTSYSTEM_ -#include - -#define NDEBUG -#include - -#define DbgPrint printf - -extern PVOID KernelBase; -extern PVOID KernelMemory; - -PVOID -NTAPI -LdrPEGetExportByName(PVOID BaseAddress, - PUCHAR SymbolName, - USHORT Hint); - -/* FUNCTIONS *****************************************************************/ - -PLOADER_MODULE -NTAPI -LdrGetModuleObject(PCHAR ModuleName) -{ - ULONG i; - - for (i = 0; i < LoaderBlock.ModsCount; i++) - { - if (strstr(_strupr((PCHAR)reactos_modules[i].String), _strupr(ModuleName))) - { - return &reactos_modules[i]; - } - } - - return NULL; -} - -PVOID -NTAPI -LdrPEFixupForward(IN PCHAR ForwardName) -{ - CHAR NameBuffer[128]; - PCHAR p; - PLOADER_MODULE ModuleObject; - - strcpy(NameBuffer, ForwardName); - p = strchr(NameBuffer, '.'); - if (p == NULL) return NULL; - *p = 0; - - ModuleObject = LdrGetModuleObject(NameBuffer); - if (!ModuleObject) - { - DbgPrint("LdrPEFixupForward: failed to find module %s\n", NameBuffer); - return NULL; - } - - return LdrPEGetExportByName((PVOID)ModuleObject->ModStart, (PUCHAR)(p + 1), 0xffff); -} - -PVOID -NTAPI -LdrPEGetExportByName(PVOID BaseAddress, - PUCHAR SymbolName, - USHORT Hint) -{ - PIMAGE_EXPORT_DIRECTORY ExportDir; - PULONG * ExFunctions; - PULONG * ExNames; - USHORT * ExOrdinals; - PVOID ExName; - ULONG Ordinal; - PVOID Function; - LONG minn, maxn, mid, res; - ULONG ExportDirSize; - - /* HAL and NTOS use a virtual address, switch it to physical mode */ - if ((ULONG_PTR)BaseAddress & 0x80000000) - { - BaseAddress = (PVOID)((ULONG_PTR)BaseAddress - KSEG0_BASE + (ULONG)KernelMemory); - } - - ExportDir = (PIMAGE_EXPORT_DIRECTORY) - RtlImageDirectoryEntryToData(BaseAddress, - TRUE, - IMAGE_DIRECTORY_ENTRY_EXPORT, - &ExportDirSize); - if (!ExportDir) - { - DbgPrint("LdrPEGetExportByName(): no export directory!\n"); - return NULL; - } - - /* The symbol names may be missing entirely */ - if (!ExportDir->AddressOfNames) - { - DbgPrint("LdrPEGetExportByName(): symbol names missing entirely\n"); - return NULL; - } - - /* - * Get header pointers - */ - ExNames = (PULONG *)RVA(BaseAddress, ExportDir->AddressOfNames); - ExOrdinals = (USHORT *)RVA(BaseAddress, ExportDir->AddressOfNameOrdinals); - ExFunctions = (PULONG *)RVA(BaseAddress, ExportDir->AddressOfFunctions); - - /* - * Check the hint first - */ - if (Hint < ExportDir->NumberOfNames) - { - ExName = RVA(BaseAddress, ExNames[Hint]); - if (strcmp(ExName, (PCHAR)SymbolName) == 0) - { - Ordinal = ExOrdinals[Hint]; - Function = RVA(BaseAddress, ExFunctions[Ordinal]); - if ((ULONG_PTR)Function >= (ULONG_PTR)ExportDir && - (ULONG_PTR)Function < (ULONG_PTR)ExportDir + ExportDirSize) - { - Function = LdrPEFixupForward((PCHAR)Function); - if (Function == NULL) - { - DbgPrint("LdrPEGetExportByName(): failed to find %s\n", Function); - } - return Function; - } - - if (Function != NULL) return Function; - } - } - - /* - * Binary search - */ - minn = 0; - maxn = ExportDir->NumberOfNames - 1; - while (minn <= maxn) - { - mid = (minn + maxn) / 2; - - ExName = RVA(BaseAddress, ExNames[mid]); - res = strcmp(ExName, (PCHAR)SymbolName); - if (res == 0) - { - Ordinal = ExOrdinals[mid]; - Function = RVA(BaseAddress, ExFunctions[Ordinal]); - if ((ULONG_PTR)Function >= (ULONG_PTR)ExportDir && - (ULONG_PTR)Function < (ULONG_PTR)ExportDir + ExportDirSize) - { - Function = LdrPEFixupForward((PCHAR)Function); - if (Function == NULL) - { - DbgPrint("1: failed to find %s\n", Function); - } - return Function; - } - if (Function != NULL) - { - return Function; - } - } - else if (res > 0) - { - maxn = mid - 1; - } - else - { - minn = mid + 1; - } - } - - /* Fall back on unsorted */ - minn = 0; - maxn = ExportDir->NumberOfNames - 1; - while (minn <= maxn) - { - ExName = RVA(BaseAddress, ExNames[minn]); - res = strcmp(ExName, (PCHAR)SymbolName); - if (res == 0) - { - Ordinal = ExOrdinals[minn]; - Function = RVA(BaseAddress, ExFunctions[Ordinal]); - if ((ULONG_PTR)Function >= (ULONG_PTR)ExportDir && - (ULONG_PTR)Function < (ULONG_PTR)ExportDir + ExportDirSize) - { - Function = LdrPEFixupForward((PCHAR)Function); - if (Function == NULL) - { - DbgPrint("LdrPEGetExportByName(): failed to find %s\n",SymbolName); - } - return Function; - } - if (Function != NULL) - { - return Function; - } - DbgPrint("Failed to get function %s\n", SymbolName); - } - minn++; - } - - DbgPrint("2: failed to find %s\n",SymbolName); - return (PVOID)NULL; -} - -NTSTATUS -NTAPI -LdrPEProcessImportDirectoryEntry(PVOID DriverBase, - PLOADER_MODULE LoaderModule, - PIMAGE_IMPORT_DESCRIPTOR ImportModuleDirectory) -{ - PVOID* ImportAddressList; - PULONG FunctionNameList; - - if (ImportModuleDirectory == NULL || ImportModuleDirectory->Name == 0) - { - return STATUS_UNSUCCESSFUL; - } - - /* Get the import address list. */ - ImportAddressList = (PVOID*)RVA(DriverBase, ImportModuleDirectory->FirstThunk); - - /* Get the list of functions to import. */ - if (ImportModuleDirectory->OriginalFirstThunk != 0) - { - FunctionNameList = (PULONG)RVA(DriverBase, ImportModuleDirectory->OriginalFirstThunk); - } - else - { - FunctionNameList = (PULONG)RVA(DriverBase, ImportModuleDirectory->FirstThunk); - } - - /* Walk through function list and fixup addresses. */ - while (*FunctionNameList != 0L) - { - if ((*FunctionNameList) & 0x80000000) - { - DbgPrint("Failed to import ordinal from %s\n", LoaderModule->String); - return STATUS_UNSUCCESSFUL; - } - else - { - IMAGE_IMPORT_BY_NAME *pe_name; - pe_name = RVA(DriverBase, *FunctionNameList); - *ImportAddressList = LdrPEGetExportByName((PVOID)LoaderModule->ModStart, pe_name->Name, pe_name->Hint); - - /* Fixup the address to be virtual */ - *ImportAddressList = (PVOID)(ULONG_PTR)*ImportAddressList + (ULONG_PTR)KernelBase - (ULONG_PTR)KernelMemory; - - - //DbgPrint("Looked for: %s and found: %x\n", pe_name->Name, *ImportAddressList); - if ((*ImportAddressList) == NULL) - { - DbgPrint("Failed to import %s from %s\n", pe_name->Name, LoaderModule->String); - return STATUS_UNSUCCESSFUL; - } - } - ImportAddressList++; - FunctionNameList++; - } - return STATUS_SUCCESS; -} - -extern BOOLEAN FrLdrLoadDriver(PCHAR szFileName, INT nPos); - -NTSTATUS -NTAPI -LdrPEGetOrLoadModule(IN PCHAR ModuleName, - IN PCHAR ImportedName, - IN PLOADER_MODULE* ImportedModule) -{ - NTSTATUS Status = STATUS_SUCCESS; - - *ImportedModule = LdrGetModuleObject(ImportedName); - if (*ImportedModule == NULL) - { - /* - * For now, we only support import-loading the HAL. - * Later, FrLdrLoadDriver should be made to share the same - * code, and we'll just call it instead. - */ - FrLdrLoadDriver(ImportedName, 0); - - /* Return the new module */ - *ImportedModule = LdrGetModuleObject(ImportedName); - if (*ImportedModule == NULL) - { - DbgPrint("Error loading import: %s\n", ImportedName); - return STATUS_UNSUCCESSFUL; - } - } - - return Status; -} - -NTSTATUS -NTAPI -LdrPEFixupImports(IN PVOID DllBase, - IN PCHAR DllName) -{ - PIMAGE_IMPORT_DESCRIPTOR ImportModuleDirectory; - PCHAR ImportedName; - NTSTATUS Status; - PLOADER_MODULE ImportedModule; - ULONG Size; - - /* Process each import module */ - ImportModuleDirectory = (PIMAGE_IMPORT_DESCRIPTOR) - RtlImageDirectoryEntryToData(DllBase, - TRUE, - IMAGE_DIRECTORY_ENTRY_IMPORT, - &Size); - while (ImportModuleDirectory && ImportModuleDirectory->Name) - { - /* Check to make sure that import lib is kernel */ - ImportedName = (PCHAR) DllBase + ImportModuleDirectory->Name; - //DbgPrint("Processing imports for file: %s into file: %s\n", DllName, ImportedName); - - Status = LdrPEGetOrLoadModule(DllName, ImportedName, &ImportedModule); - if (!NT_SUCCESS(Status)) return Status; - - Status = LdrPEProcessImportDirectoryEntry(DllBase, ImportedModule, ImportModuleDirectory); - if (!NT_SUCCESS(Status)) return Status; - - //DbgPrint("Imports for file: %s into file: %s complete\n", DllName, ImportedName); - ImportModuleDirectory++; - } - - return STATUS_SUCCESS; -} diff --git a/boot/freeldr/freeldr/arch/powerpc/mach.c b/boot/freeldr/freeldr/arch/powerpc/mach.c deleted file mode 100644 index be8cf7e8..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/mach.c +++ /dev/null @@ -1,560 +0,0 @@ -/* - * FreeLoader PowerPC Part - * Copyright (C) 2005 Art Yerkes - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -#include "freeldr.h" -#include "machine.h" -#include "ppcmmu/mmu.h" -#include "of.h" -#include "prep.h" -#include "compat.h" - -extern void BootMain( LPSTR CmdLine ); -extern PCHAR GetFreeLoaderVersionString(); -extern ULONG CacheSizeLimit; -of_proxy ofproxy; -void *PageDirectoryStart, *PageDirectoryEnd; -static int chosen_package, stdin_handle, stdout_handle, part_handle = -1; -int mmu_handle = 0; -int claimed[4]; -BOOLEAN AcpiPresent = FALSE; -char BootPath[0x100] = { 0 }, BootPart[0x100] = { 0 }, CmdLine[0x100] = { "bootprep" }; -jmp_buf jmp; -volatile char *video_mem = 0; - -void PpcOfwPutChar( int ch ) { - char buf[3]; - if( ch == 0x0a ) { buf[0] = 0x0d; buf[1] = 0x0a; } - else { buf[0] = ch; buf[1] = 0; } - buf[2] = 0; - ofw_write(stdout_handle, buf, strlen(buf)); -} - -int PpcFindDevice( int depth, int parent, char *devname, int *nth ) { - static char buf[256]; - int next = 0; - int gotname = 0; - int match = 0; - int i; - - next = ofw_child( parent ); - - //printf( "next = %x\n", next ); - - gotname = ofw_getprop(parent, "name", buf, 256); - - //printf( "gotname = %d\n", gotname ); - - match = !strncmp(buf, devname, strlen(devname)); - - if( !nth && match ) return parent; - - for( i = 0; i < depth; i++ ) PpcOfwPutChar( ' ' ); - - if( depth == 1 ) { - if( gotname > 0 ) { - printf( "%c Name: %s\n", match ? '*' : ' ', buf ); - } else { - printf( "- No name attribute for %x\n", parent ); - } - } - - while( !match && next ) { - i = PpcFindDevice( depth+1, next, devname, nth ); - if( i ) return i; - next = ofw_peer( next ); - } - - return 0; -} - -BOOLEAN PpcConsKbHit() { - return FALSE; -} - -int PpcConsGetCh() { - char buf; - ofw_read( stdin_handle, &buf, 1 ); - return buf; -} - -void PpcVideoClearScreen( UCHAR Attr ) { -} - -VOID PpcVideoGetDisplaySize( PULONG Width, PULONG Height, PULONG Depth ) { - *Width = 80; - *Height = 25; - *Depth = 16; -} - -ULONG PpcVideoGetBufferSize() { - ULONG Width, Height, Depth; - MachVideoGetDisplaySize( &Width, &Height, &Depth ); - return Width * Height * Depth / 8; -} - -VIDEODISPLAYMODE PpcVideoSetDisplayMode( char *DisplayMode, BOOLEAN Init ) { - //printf( "DisplayMode: %s %s\n", DisplayMode, Init ? "true" : "false" ); - if( Init && !video_mem ) { - video_mem = MmAllocateMemory( PpcVideoGetBufferSize() ); - } - return VideoTextMode; -} - -VOID PpcVideoSetTextCursorPosition( ULONG X, ULONG Y ) { - printf("SetTextCursorPosition(%d,%d)\n", X,Y); -} - -VOID PpcVideoHideShowTextCursor( BOOLEAN Show ) { - printf("HideShowTextCursor(%s)\n", Show ? "true" : "false"); -} - -VOID PpcVideoPutChar( int Ch, UCHAR Attr, unsigned X, unsigned Y ) { - printf( "\033[%d;%dH%c", Y, X, Ch ); -} - -VOID PpcVideoCopyOffScreenBufferToVRAM( PVOID Buffer ) { - int i,j; - ULONG w,h,d; - PCHAR ChBuf = Buffer; - int offset = 0; - - MachVideoGetDisplaySize( &w, &h, &d ); - - for( i = 0; i < h; i++ ) { - for( j = 0; j < w; j++ ) { - offset = (j * 2) + (i * w * 2); - if( ChBuf[offset] != video_mem[offset] ) { - video_mem[offset] = ChBuf[offset]; - MachVideoPutChar(ChBuf[offset],0,j+1,i+1); - } - } - } -} - -BOOLEAN PpcVideoIsPaletteFixed() { - return FALSE; -} - -VOID PpcVideoSetPaletteColor( UCHAR Color, - UCHAR Red, UCHAR Green, UCHAR Blue ) { - printf( "SetPaletteColor(%x,%x,%x,%x)\n", Color, Red, Green, Blue ); -} - -VOID PpcVideoGetPaletteColor( UCHAR Color, - UCHAR *Red, UCHAR *Green, UCHAR *Blue ) { - printf( "GetPaletteColor(%x)\n", Color); -} - -VOID PpcVideoSync() { - printf( "Sync\n" ); -} - -int mmu_initialized = 0; -int mem_range_end; -VOID PpcInitializeMmu() -{ - if(!mmu_initialized) - { - MmuInit(); - MmuDbgInit(0, 0x800003f8); - MmuSetMemorySize(mem_range_end); - //MmuDbgEnter(0x20); - mmu_initialized = 1; - } -} - -ULONG PpcPrepGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap, - ULONG MaxMemoryMapSize ); - -/* - * Get memory the proper openfirmware way - */ -ULONG PpcGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap, - ULONG MaxMemoryMapSize ) { - int i, memhandle, total = 0, slots = 0, last = 0x40000, allocstart = 0x1000000; - int regdata[0x40]; - - printf("PpcGetMemoryMap(%d)\n", MaxMemoryMapSize); - - memhandle = ofw_finddevice("/memory"); - - ofw_getprop(memhandle, "reg", (char *)regdata, sizeof(regdata)); - - /* Try to claim some memory in usable blocks. Try to get some 8mb bits */ - for( i = 0; i < sizeof(claimed) / sizeof(claimed[0]); ) { - if (!claimed[i]) - claimed[i] = ofw_claim(allocstart, 8 * 1024 * 1024, 0x1000); - - allocstart += 8 * 1024 * 1024; - - if (claimed[i]) { - if (last < claimed[i]) { - BiosMemoryMap[slots].Type = BiosMemoryAcpiReclaim; - BiosMemoryMap[slots].BaseAddress = last; - BiosMemoryMap[slots].Length = claimed[i] - last; - slots++; - } - - BiosMemoryMap[slots].Type = BiosMemoryUsable; - BiosMemoryMap[slots].BaseAddress = claimed[i]; - BiosMemoryMap[slots].Length = 8 * 1024 * 1024; - - total += BiosMemoryMap[slots].Length; - last = - BiosMemoryMap[slots].BaseAddress + - BiosMemoryMap[slots].Length; - slots++; - i++; - } - } - - /* Get the rest until the end of the memory object as we see it */ - if (last < regdata[1]) { - BiosMemoryMap[slots].Type = BiosMemoryAcpiReclaim; - BiosMemoryMap[slots].BaseAddress = last; - BiosMemoryMap[slots].Length = regdata[1] - last; - slots++; - } - - for (i = 0; i < slots; i++) { - printf("MemoryMap[%d] = (%x:%x)\n", - i, - (int)BiosMemoryMap[i].BaseAddress, - (int)BiosMemoryMap[i].Length); - - } - - mem_range_end = regdata[1]; - - printf( "Returning memory map (%d entries, %dk free, %dk total ram)\n", - slots, total / 1024, regdata[1] / 1024 ); - - return slots; -} - -BOOLEAN PpcDiskGetBootPath( char *OutBootPath, unsigned Size ) { - strncpy( OutBootPath, BootPath, Size ); - return TRUE; -} - -BOOLEAN PpcDiskReadLogicalSectors( ULONG DriveNumber, ULONGLONG SectorNumber, - ULONG SectorCount, PVOID Buffer ) { - int rlen = 0; - - if( part_handle == -1 ) { - part_handle = ofw_open( BootPart ); - - if( part_handle == -1 ) { - printf("Could not open any disk devices we know about\n"); - return FALSE; - } - } - - if( part_handle == -1 ) { - printf("Got partition handle %x\n", part_handle); - return FALSE; - } - - if( ofw_seek( part_handle, - (ULONG)(SectorNumber >> 25), - (ULONG)((SectorNumber * 512) & 0xffffffff) ) ) { - printf("Seek to %x failed\n", (ULONG)(SectorNumber * 512)); - return FALSE; - } - - rlen = ofw_read( part_handle, Buffer, (ULONG)(SectorCount * 512) ); - return rlen > 0; -} - -BOOLEAN PpcDiskGetDriveGeometry( ULONG DriveNumber, PGEOMETRY DriveGeometry ) { - printf("GetGeometry(%d)\n", DriveNumber); - DriveGeometry->BytesPerSector = 512; - DriveGeometry->Heads = 16; - DriveGeometry->Sectors = 63; - return TRUE; -} - -ULONG PpcDiskGetCacheableBlockCount( ULONG DriveNumber ) { - printf("GetCacheableBlockCount\n"); - return 1; -} - -TIMEINFO* -PpcGetTime(VOID) -{ - static TIMEINFO TimeInfo; - //printf("PpcGetTime\n"); - return &TimeInfo; -} - -VOID NarrowToWide(WCHAR *wide_name, char *name) -{ - char *copy_name; - WCHAR *wide_name_ptr; - for (wide_name_ptr = wide_name, copy_name = name; - (*wide_name_ptr = *copy_name); - wide_name_ptr++, copy_name++); -} - -/* Recursively copy the device tree into our representation - * It'll be passed to HAL. - * - * When NT was first done on PPC, it was on PReP hardware, which is very - * like PC hardware (really, just a PPC on a PC motherboard). HAL can guess - * the addresses of needed resources in this scheme as it can on x86. - * - * Most PPC hardware doesn't assign fixed addresses to hardware, which is - * the problem that open firmware partially solves. It allows hardware makers - * much more leeway in building PPC systems. Unfortunately, because - * openfirmware as originally specified neither captures nor standardizes - * all possible information, and also because of bugs, most OSs use a hybrid - * configuration scheme that relies both on verification of devices and - * recording information from openfirmware to be treated as hints. - */ -VOID OfwCopyDeviceTree -(PCONFIGURATION_COMPONENT_DATA ParentKey, - char *name, - int innode, - ULONG *BusNumber, - ULONG *DiskController, - ULONG *DiskNumber) -{ - int proplen = 0, node = innode; - char *prev_name, cur_name[64], data[256], *slash, devtype[64]; - wchar_t wide_name[64]; - PCONFIGURATION_COMPONENT_DATA NewKey; - - NarrowToWide(wide_name, name); - - /* Create a key for this device */ - FldrCreateComponentKey - (ParentKey, - AdapterClass, - MultiFunctionAdapter, - 0, - 0, - (ULONG)-1, - NULL, - NULL, - 0, - &NewKey); - - /* Add properties */ - for (prev_name = ""; ofw_nextprop(node, prev_name, cur_name) == 1; ) - { - proplen = ofw_getproplen(node, cur_name); - if (proplen > 256 || proplen < 0) - { - printf("Warning: not getting prop %s (too long: %d)\n", - cur_name, proplen); - continue; - } - ofw_getprop(node, cur_name, data, sizeof(data)); - - /* Get device type so we can examine it */ - if (!strcmp(cur_name, "device_type")) - strcpy(devtype, (char *)data); - - NarrowToWide(wide_name, cur_name); - //RegSetValue(NewKey, wide_name, REG_BINARY, data, proplen); - - strcpy(data, cur_name); - prev_name = data; - } - -#if 0 - /* Special device handling */ - if (!strcmp(devtype, "ata")) - { - OfwHandleDiskController(NewKey, node, *DiskController); - (*DiskController)++; - *DiskNumber = 0; - } - else if (!strcmp(devtype, "disk")) - { - OfwHandleDiskObject(NewKey, node, *DiskController, *DiskNumber); - (*DiskNumber)++; - } -#endif - - /* Subdevices */ - for (node = ofw_child(node); node; node = ofw_peer(node)) - { - ofw_package_to_path(node, data, sizeof(data)); - slash = strrchr(data, '/'); - if (slash) slash++; else continue; - OfwCopyDeviceTree - (NewKey, slash, node, BusNumber, DiskController, DiskNumber); - } -} - -PCONFIGURATION_COMPONENT_DATA PpcHwDetect() { - PCONFIGURATION_COMPONENT_DATA RootKey; - ULONG BusNumber = 0, DiskController = 0, DiskNumber = 0; - int node = ofw_finddevice("/"); - - FldrCreateSystemKey(&RootKey); - - OfwCopyDeviceTree(RootKey,"/",node,&BusNumber,&DiskController,&DiskNumber); - return RootKey; -} - -VOID -PpcHwIdle(VOID) -{ - /* UNIMPLEMENTED */ -} - -void PpcDefaultMachVtbl() -{ - MachVtbl.ConsPutChar = PpcOfwPutChar; - MachVtbl.ConsKbHit = PpcConsKbHit; - MachVtbl.ConsGetCh = PpcConsGetCh; - MachVtbl.VideoClearScreen = PpcVideoClearScreen; - MachVtbl.VideoSetDisplayMode = PpcVideoSetDisplayMode; - MachVtbl.VideoGetDisplaySize = PpcVideoGetDisplaySize; - MachVtbl.VideoGetBufferSize = PpcVideoGetBufferSize; - MachVtbl.VideoSetTextCursorPosition = PpcVideoSetTextCursorPosition; - MachVtbl.VideoHideShowTextCursor = PpcVideoHideShowTextCursor; - MachVtbl.VideoPutChar = PpcVideoPutChar; - MachVtbl.VideoCopyOffScreenBufferToVRAM = - PpcVideoCopyOffScreenBufferToVRAM; - MachVtbl.VideoIsPaletteFixed = PpcVideoIsPaletteFixed; - MachVtbl.VideoSetPaletteColor = PpcVideoSetPaletteColor; - MachVtbl.VideoGetPaletteColor = PpcVideoGetPaletteColor; - MachVtbl.VideoSync = PpcVideoSync; - - MachVtbl.GetMemoryMap = PpcGetMemoryMap; - - MachVtbl.DiskGetBootPath = PpcDiskGetBootPath; - MachVtbl.DiskReadLogicalSectors = PpcDiskReadLogicalSectors; - MachVtbl.DiskGetDriveGeometry = PpcDiskGetDriveGeometry; - MachVtbl.DiskGetCacheableBlockCount = PpcDiskGetCacheableBlockCount; - - MachVtbl.GetTime = PpcGetTime; - - MachVtbl.HwDetect = PpcHwDetect; - MachVtbl.HwIdle = PpcHwIdle; -} - -void PpcOfwInit() -{ - chosen_package = ofw_finddevice( "/chosen" ); - - ofw_getprop(chosen_package, "bootargs", - CmdLine, sizeof(CmdLine)); - ofw_getprop( chosen_package, "stdin", - (char *)&stdin_handle, sizeof(stdin_handle) ); - ofw_getprop( chosen_package, "stdout", - (char *)&stdout_handle, sizeof(stdout_handle) ); - ofw_getprop( chosen_package, "mmu", - (char *)&mmu_handle, sizeof(mmu_handle) ); - - // Allow forcing prep for broken OFW - if(!strncmp(CmdLine, "bootprep", 8)) - { - printf("Going to PREP init...\n"); - ofproxy = NULL; - PpcPrepInit(); - return; - } - - printf( "FreeLDR version [%s]\n", GetFreeLoaderVersionString() ); - - BootMain( CmdLine ); -} - -void PpcInit( of_proxy the_ofproxy ) { - // Hack to be a bit easier on ram - CacheSizeLimit = 64 * 1024; - ofproxy = the_ofproxy; - PpcDefaultMachVtbl(); - if(ofproxy) PpcOfwInit(); - else PpcPrepInit(); -} - -void MachInit(const char *CmdLine) { - int i, len; - char *sep; - - BootPart[0] = 0; - BootPath[0] = 0; - - printf( "Determining boot device: [%s]\n", CmdLine ); - - sep = NULL; - for( i = 0; i < strlen(CmdLine); i++ ) { - if( strncmp(CmdLine + i, "boot=", 5) == 0) { - strcpy(BootPart, CmdLine + i + 5); - sep = strchr(BootPart, ','); - if( sep ) - *sep = 0; - while(CmdLine[i] && CmdLine[i]!=',') i++; - } - } - - if( strlen(BootPart) == 0 ) { - if (ofproxy) - len = ofw_getprop(chosen_package, "bootpath", - BootPath, sizeof(BootPath)); - else - len = 0; - if( len < 0 ) len = 0; - BootPath[len] = 0; - printf( "Boot Path: %s\n", BootPath ); - - sep = strrchr(BootPath, ','); - - strcpy(BootPart, BootPath); - if( sep ) { - BootPart[sep - BootPath] = 0; - } - } - - printf( "FreeLDR starting (boot partition: %s)\n", BootPart ); -} - -void beep() { -} - -UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address) { - return GetPhysByte(((ULONG)Address)+0x80000000); -} - -void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value) { - SetPhysByte(((ULONG)Address)+0x80000000, Value); -} - -void DiskStopFloppyMotor() { -} - -void BootOldLinuxKernel( unsigned long size ) { - ofw_exit(); -} - -void BootNewLinuxKernel() { - ofw_exit(); -} - -void ChainLoadBiosBootSectorCode() { - ofw_exit(); -} - -void DbgBreakPoint() { - __asm__("twi 31,0,0"); -} diff --git a/boot/freeldr/freeldr/arch/powerpc/mboot.c b/boot/freeldr/freeldr/arch/powerpc/mboot.c deleted file mode 100644 index 352d2378..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/mboot.c +++ /dev/null @@ -1,842 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * Copyright (C) 2005 Alex Ionescu - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include -#include "ppcmmu/mmu.h" -#include "compat.h" - -#define NDEBUG -#include - -/* We'll check this to see if we're in OFW land */ -extern of_proxy ofproxy; - -PVOID KernelMemory = 0; - -/* Bits to shift to convert a Virtual Address into an Offset in the Page Table */ -#define PFN_SHIFT 12 - -/* Bits to shift to convert a Virtual Address into an Offset in the Page Directory */ -#define PDE_SHIFT 22 -#define PDE_SHIFT_PAE 18 - -#define STARTUP_BASE 0xC0000000 -#define HYPERSPACE_BASE 0xC0400000 -#define HYPERSPACE_PAE_BASE 0xC0800000 -#define APIC_BASE 0xFEC00000 -#define KPCR_BASE 0xFF000000 - -#define LowMemPageTableIndex 0 -#define StartupPageTableIndex (STARTUP_BASE >> 22) -#define HyperspacePageTableIndex (HYPERSPACE_BASE >> 22) -#define KpcrPageTableIndex (KPCR_BASE >> 22) -#define ApicPageTableIndex (APIC_BASE >> 22) - -#define BAT_GRANULARITY (64 * 1024) -#define KernelMemorySize (8 * 1024 * 1024) -#define XROUNDUP(x,n) ((((ULONG)x) + ((n) - 1)) & (~((n) - 1))) - -#define TAG_MBOOT 'oobM' - -char reactos_module_strings[64][256]; // Array to hold module names - -/* Load Address of Next Module */ -ULONG_PTR NextModuleBase = 0; - -/* Currently Opened Module */ -PLOADER_MODULE CurrentModule = NULL; - -/* Unrelocated Kernel Base in Virtual Memory */ -ULONG_PTR KernelBase; - -/* Wether PAE is to be used or not */ -BOOLEAN PaeModeEnabled; - -/* Kernel Entrypoint in Physical Memory */ -ULONG_PTR KernelEntryPoint; - -/* Dummy to bring in memmove */ -PVOID memmove_dummy = memmove; - -PLOADER_MODULE -NTAPI -LdrGetModuleObject(PCHAR ModuleName); - -NTSTATUS -NTAPI -LdrPEFixupImports(IN PVOID DllBase, - IN PCHAR DllName); - -VOID PpcInitializeMmu(int max); - -/* FUNCTIONS *****************************************************************/ - -/*++ - * FrLdrStartup - * INTERNAL - * - * Prepares the system for loading the Kernel. - * - * Params: - * Magic - Multiboot Magic - * - * Returns: - * None. - * - * Remarks: - * None. - * - *--*/ - -typedef void (*KernelEntryFn)( void * ); - -int MmuPageMiss(int trapCode, ppc_trap_frame_t *trap) -{ - int i; - printf("TRAP %x\n", trapCode); - for( i = 0; i < 40; i++ ) - printf("r[%d] %x\n", i, trap->gpr[i]); - printf("HALT!\n"); - while(1); -} - -typedef struct _ppc_map_set_t { - int mapsize; - int usecount; - ppc_map_info_t *info; -} ppc_map_set_t; - -extern int mmu_handle; -paddr_t MmuTranslate(paddr_t possibly_virtual) -{ - if (ofproxy) - { - /* Openfirmware takes liberties with boot-time memory. - * if you're in a unitary kernel, it's not as difficult, but since - * we rely on loading things into virtual space from here, we need - * to detect the mappings so far. - */ - int args[2]; - args[0] = possibly_virtual; - args[1] = 1; /* Marker to tell we want a physical addr */ - return (paddr_t)ofw_callmethod_ret("translate", mmu_handle, 2, args, 3); - } - else - { - /* Other booters don't remap ram */ - return possibly_virtual; - } -} - -VOID -NTAPI -FrLdrAddPageMapping(ppc_map_set_t *set, int proc, paddr_t phys, vaddr_t virt) -{ - int j; - paddr_t page = ROUND_DOWN(phys, (1<usecount; j++ ) - { - if(set->info[j].addr == page) return; - } - - if (!set->mapsize) - { - set->mapsize = 0x80; - set->info = MmAllocateMemory(0x80 * sizeof(*set->info)); - } - else if (set->mapsize <= set->usecount) - { - ppc_map_info_t *newinfo = MmAllocateMemory(set->mapsize * 2 * sizeof(*set->info)); - memcpy(newinfo, set->info, set->mapsize * sizeof(*set->info)); - MmFreeMemory(set->info); - set->info = newinfo; - set->mapsize *= 2; - } - - set->info[set->usecount].flags = MMU_ALL_RW; - set->info[set->usecount].proc = proc; - set->info[set->usecount].addr = virt; - set->info[set->usecount].phys = page; - set->usecount++; -} - -extern int _start[], _end[]; - -VOID -NTAPI -FrLdrStartup(ULONG Magic) -{ - ULONG_PTR i, tmp, OldModCount = 0; - PCHAR ModHeader; - CHAR ModulesTreated[64] = { 0 }; - ULONG NumberOfEntries = 0, UsedEntries = 0; - PPAGE_LOOKUP_TABLE_ITEM FreeLdrMap = MmGetMemoryMap(&NumberOfEntries); - ppc_map_set_t memmap = { }; - - printf("FrLdrStartup\n"); - - /* Disable EE */ - __asm__("mfmsr %0" : "=r" (tmp)); - tmp &= 0x7fff; - __asm__("mtmsr %0" : : "r" (tmp)); - - while(OldModCount != LoaderBlock.ModsCount) - { - printf("Added %d modules last pass\n", - LoaderBlock.ModsCount - OldModCount); - - OldModCount = LoaderBlock.ModsCount; - - for(i = 0; i < LoaderBlock.ModsCount; i++) - { - if (!ModulesTreated[i]) - { - ModulesTreated[i] = 1; - ModHeader = ((PCHAR)reactos_modules[i].ModStart); - if(ModHeader[0] == 'M' && ModHeader[1] == 'Z') - LdrPEFixupImports - ((PVOID)reactos_modules[i].ModStart, - (PCHAR)reactos_modules[i].String); - } - } - } - - printf("Starting mmu\n"); - - PpcInitializeMmu(0); - - printf("Allocating vsid 0 (kernel)\n"); - MmuAllocVsid(0, 0xff00); - - /* We'll use vsid 1 for freeldr (expendable) */ - printf("Allocating vsid 1 (freeldr)\n"); - MmuAllocVsid(1, 0xff); - - printf("Mapping Freeldr Code (%x-%x)\n", _start, _end); - - /* Map memory zones */ - /* Freeldr itself */ - for( i = (int)_start; - i < (int)_end; - i += (1<= (ULONG)KernelMemory && - tmp < (ULONG)KernelMemory + KernelMemorySize) { - FrLdrAddPageMapping(&memmap, 0, tmp, KernelBase + tmp - (ULONG)KernelMemory); - } else { - FrLdrAddPageMapping(&memmap, 1, tmp, 0); - } - } - } - - MmuMapPage(memmap.info, memmap.usecount); - - printf("Finished Mapping the Freeldr Heap (used %d pages)\n", UsedEntries); - - printf("Setting initial segments\n"); - MmuSetVsid(0, 8, 1); - MmuSetVsid(8, 16, 0); - - printf("Segments set!\n"); - - MmuTurnOn((KernelEntryFn)KernelEntryPoint, &LoaderBlock); - - /* Nothing more */ - while(1); -} - -/*++ - * FrLdrSetupPae - * INTERNAL - * - * Configures PAE on a MP System, and sets the PDBR if it's supported, or if - * the system is UP. - * - * Params: - * Magic - Multiboot Magic - * - * Returns: - * None. - * - * Remarks: - * None. - * - *--*/ -VOID -FASTCALL -FrLdrSetupPae(ULONG Magic) -{ -} - -/*++ - * FrLdrGetKernelBase - * INTERNAL - * - * Gets the Kernel Base to use. - * - * Params: - * - * Returns: - * None. - * - * Remarks: - * Sets both the FreeLdr internal variable as well as the one which - * will be used by the Kernel. - * - *--*/ -VOID -FASTCALL -FrLdrGetKernelBase(VOID) -{ - PCHAR p; - - /* Default kernel base at 2GB */ - KernelBase = 0x80800000; - - /* Set KernelBase */ - LoaderBlock.KernelBase = 0x80000000; - - /* Read Command Line */ - p = (PCHAR)LoaderBlock.CommandLine; - while ((p = strchr(p, '/')) != NULL) { - - /* Find "/3GB" */ - if (!_strnicmp(p + 1, "3GB", 3)) { - - /* Make sure there's nothing following it */ - if (p[4] == ' ' || p[4] == 0) { - - /* Use 3GB */ - KernelBase = 0xE0000000; - LoaderBlock.KernelBase = 0xC0000000; - } - } - - p++; - } -} - -/*++ - * FrLdrGetPaeMode - * INTERNAL - * - * Determines whether PAE mode shoudl be enabled or not. - * - * Params: - * None. - * - * Returns: - * None. - * - * Remarks: - * None. - * - *--*/ -VOID -FASTCALL -FrLdrGetPaeMode(VOID) -{ -} - -/*++ - * FrLdrSetupPageDirectory - * INTERNAL - * - * Sets up the ReactOS Startup Page Directory. - * - * Params: - * None. - * - * Returns: - * None. - * - * Remarks: - * We are setting PDEs, but using the equvivalent (for our purpose) PTE structure. - * As such, please note that PageFrameNumber == PageEntryNumber. - * - *--*/ -VOID -FASTCALL -FrLdrSetupPageDirectory(VOID) -{ -} - -/*++ - * FrLdrMapModule - * INTERNAL - * - * Loads the indicated elf image as PE. The target will appear to be - * a PE image whose ImageBase has ever been KernelAddr. - * - * Params: - * Image -- File to load - * ImageName -- Name of image for the modules list - * MemLoadAddr -- Freeldr address of module - * KernelAddr -- Kernel address of module - *--*/ -#define ELF_SECTION(n) ((Elf32_Shdr*)(sptr + (n * shsize))) -#define COFF_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((DWORD)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+(SWAPW(((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader)))) - -BOOLEAN -NTAPI -FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG KernelAddr) -{ - PIMAGE_DOS_HEADER ImageHeader = 0; - PIMAGE_NT_HEADERS NtHeader = 0; - PIMAGE_SECTION_HEADER Section; - ULONG SectionCount; - ULONG ImageSize; - INT i, j; - PLOADER_MODULE ModuleData; - //int phsize, phnum; - int shsize, shnum, relsize, SectionAddr = 0; - PCHAR sptr; - Elf32_Ehdr ehdr; - Elf32_Shdr *shdr; - LPSTR TempName; - - TempName = strrchr(ImageName, '\\'); - if(TempName) TempName++; else TempName = (LPSTR)ImageName; - ModuleData = LdrGetModuleObject(TempName); - - if(ModuleData) - { - return TRUE; - } - - if(!KernelAddr) - KernelAddr = (ULONG)NextModuleBase - (ULONG)KernelMemory + KernelBase; - if(!MemLoadAddr) - MemLoadAddr = (PCHAR)NextModuleBase; - - ModuleData = &reactos_modules[LoaderBlock.ModsCount]; - //printf("Loading file (elf at %x)\n", KernelAddr); - - /* Load the first 1024 bytes of the kernel image so we can read the PE header */ - if (!FsReadFile(KernelImage, sizeof(ehdr), NULL, &ehdr)) { - - /* Fail if we couldn't read */ - printf("Couldn't read the elf header\n"); - return FALSE; - } - - /* Start by getting elf headers */ - //phsize = ehdr.e_phentsize; - //phnum = ehdr.e_phnum; - shsize = ehdr.e_shentsize; - shnum = ehdr.e_shnum; - sptr = (PCHAR)FrLdrTempAlloc(shnum * shsize, TAG_MBOOT); - - /* Read section headers */ - FsSetFilePointer(KernelImage, ehdr.e_shoff); - FsReadFile(KernelImage, shsize * shnum, NULL, sptr); - - /* Now we'll get the PE Header */ - for( i = 0; i < shnum; i++ ) - { - shdr = ELF_SECTION(i); - shdr->sh_addr = 0; - - /* Find the PE Header */ - if (shdr->sh_type == TYPE_PEHEADER) - { - FsSetFilePointer(KernelImage, shdr->sh_offset); - FsReadFile(KernelImage, shdr->sh_size, NULL, MemLoadAddr); - ImageHeader = (PIMAGE_DOS_HEADER)MemLoadAddr; - NtHeader = (PIMAGE_NT_HEADERS)((PCHAR)MemLoadAddr + SWAPD(ImageHeader->e_lfanew)); -#if 0 - printf("NtHeader at %x\n", SWAPD(ImageHeader->e_lfanew)); - printf("SectionAlignment %x\n", - SWAPD(NtHeader->OptionalHeader.SectionAlignment)); - SectionAddr = ROUND_UP - (shdr->sh_size, SWAPD(NtHeader->OptionalHeader.SectionAlignment)); - printf("Header ends at %x\n", SectionAddr); -#endif - break; - } - } - - if(i == shnum) - { - printf("No peheader section encountered :-(\n"); - return 0; - } -#if 0 - else - { - printf("DOS SIG: %s\n", (PCHAR)MemLoadAddr); - } -#endif - - /* Save the Image Base */ - NtHeader->OptionalHeader.ImageBase = SWAPD(KernelAddr); - - /* Load the file image */ - Section = COFF_FIRST_SECTION(NtHeader); - SectionCount = SWAPW(NtHeader->FileHeader.NumberOfSections); - - /* Walk each section */ - for (i=0; i < SectionCount; i++, Section++) - { - shdr = ELF_SECTION((SWAPD(Section->PointerToRawData)+1)); - - shdr->sh_addr = SectionAddr = SWAPD(Section->VirtualAddress); - shdr->sh_addr += KernelAddr; - - Section->PointerToRawData = SWAPD((Section->VirtualAddress - KernelAddr)); - - if (shdr->sh_type != SHT_NOBITS) - { - /* Content area */ - printf("Loading section %d at %x (real: %x:%d)\n", i, KernelAddr + SectionAddr, MemLoadAddr+SectionAddr, shdr->sh_size); - FsSetFilePointer(KernelImage, shdr->sh_offset); - FsReadFile(KernelImage, shdr->sh_size, NULL, MemLoadAddr + SectionAddr); - } - else - { - /* Zero it out */ - printf("BSS section %d at %x\n", i, KernelAddr + SectionAddr); - memset(MemLoadAddr + SectionAddr, 0, - ROUND_UP(shdr->sh_size, - SWAPD(NtHeader->OptionalHeader.SectionAlignment))); - } - } - - ImageSize = SWAPD(NtHeader->OptionalHeader.SizeOfImage); - printf("Total image size is %x\n", ImageSize); - - /* Handle relocation sections */ - for (i = 0; i < shnum; i++) { - Elf32_Rela reloc = { }; - ULONG *Target32; - USHORT *Target16; - int numreloc, relstart, targetSection; - Elf32_Sym symbol; - PCHAR RelocSection, SymbolSection; - - shdr = ELF_SECTION(i); - /* Only relocs here */ - if((shdr->sh_type != SHT_REL) && - (shdr->sh_type != SHT_RELA)) continue; - - relstart = shdr->sh_offset; - relsize = shdr->sh_type == SHT_RELA ? 12 : 8; - numreloc = shdr->sh_size / relsize; - targetSection = shdr->sh_info; - - if (!ELF_SECTION(targetSection)->sh_addr) continue; - - RelocSection = FrLdrTempAlloc(shdr->sh_size, TAG_MBOOT); - FsSetFilePointer(KernelImage, relstart); - FsReadFile(KernelImage, shdr->sh_size, NULL, RelocSection); - - /* Get the symbol section */ - shdr = ELF_SECTION(shdr->sh_link); - - SymbolSection = FrLdrTempAlloc(shdr->sh_size, TAG_MBOOT); - FsSetFilePointer(KernelImage, shdr->sh_offset); - FsReadFile(KernelImage, shdr->sh_size, NULL, SymbolSection); - - for(j = 0; j < numreloc; j++) - { - ULONG S,A,P; - - /* Get the reloc */ - memcpy(&reloc, RelocSection + (j * relsize), sizeof(reloc)); - - /* Get the symbol */ - memcpy(&symbol, SymbolSection + (ELF32_R_SYM(reloc.r_info) * sizeof(symbol)), sizeof(symbol)); - - /* Compute addends */ - S = symbol.st_value + ELF_SECTION(symbol.st_shndx)->sh_addr; - A = reloc.r_addend; - P = reloc.r_offset + ELF_SECTION(targetSection)->sh_addr; - -#if 0 - printf("Symbol[%d] %d -> %d(%x:%x) -> %x(+%x)@%x\n", - ELF32_R_TYPE(reloc.r_info), - ELF32_R_SYM(reloc.r_info), - symbol.st_shndx, - ELF_SECTION(symbol.st_shndx)->sh_addr, - symbol.st_value, - S, - A, - P); -#endif - - Target32 = (ULONG*)(((PCHAR)MemLoadAddr) + (P - KernelAddr)); - Target16 = (USHORT *)Target32; - - switch (ELF32_R_TYPE(reloc.r_info)) - { - case R_PPC_NONE: - break; - case R_PPC_ADDR32: - *Target32 = S + A; - break; - case R_PPC_REL32: - *Target32 = S + A - P; - break; - case R_PPC_UADDR32: /* Special: Treat as RVA */ - *Target32 = S + A - KernelAddr; - break; - case R_PPC_ADDR24: - *Target32 = (ADDR24_MASK & (S+A)) | (*Target32 & ~ADDR24_MASK); - break; - case R_PPC_REL24: - *Target32 = (ADDR24_MASK & (S+A-P)) | (*Target32 & ~ADDR24_MASK); - break; - case R_PPC_ADDR16_LO: - *Target16 = S + A; - break; - case R_PPC_ADDR16_HA: - *Target16 = (S + A + 0x8000) >> 16; - break; - default: - break; - } - -#if 0 - printf("reloc[%d:%x]: (type %x sym %d val %d) off %x add %x (old %x new %x)\n", - j, - ((ULONG)Target32) - ((ULONG)MemLoadAddr), - ELF32_R_TYPE(reloc.r_info), - ELF32_R_SYM(reloc.r_info), - symbol.st_value, - reloc.r_offset, reloc.r_addend, - x, *Target32); -#endif - } - - FrLdrTempFree(SymbolSection, TAG_MBOOT); - FrLdrTempFree(RelocSection, TAG_MBOOT); - } - - FrLdrTempFree(sptr, TAG_MBOOT); - - ModuleData->ModStart = (ULONG)MemLoadAddr; - /* Increase the next Load Base */ - NextModuleBase = ROUND_UP((ULONG)MemLoadAddr + ImageSize, PAGE_SIZE); - ModuleData->ModEnd = NextModuleBase; - ModuleData->String = (ULONG)MmAllocateMemory(strlen(ImageName)+1); - strcpy((PCHAR)ModuleData->String, ImageName); - printf("Module %s (%x-%x) next at %x\n", - ModuleData->String, - ModuleData->ModStart, - ModuleData->ModEnd, - NextModuleBase); - LoaderBlock.ModsCount++; - - /* Return Success */ - return TRUE; -} - -/*++ - * FrLdrMapKernel - * INTERNAL - * - * Maps the Kernel into memory, does PE Section Mapping, initializes the - * uninitialized data sections, and relocates the image. - * - * Params: - * KernelImage - FILE Structure representing the ntoskrnl image file. - * - * Returns: - * TRUE if the Kernel was mapped. - * - * Remarks: - * None. - * - *--*/ -BOOLEAN -NTAPI -FrLdrMapKernel(FILE *KernelImage) -{ - /* Get Kernel Base */ - FrLdrGetKernelBase(); - - /* Allocate kernel memory */ - KernelMemory = MmAllocateMemory(KernelMemorySize); - - return FrLdrMapModule(KernelImage, "ntoskrnl.exe", KernelMemory, KernelBase); -} - -ULONG_PTR -NTAPI -FrLdrLoadModule(FILE *ModuleImage, - LPCSTR ModuleName, - PULONG ModuleSize) -{ - ULONG LocalModuleSize; - ULONG_PTR ThisModuleBase = NextModuleBase; - PLOADER_MODULE ModuleData; - LPSTR NameBuffer; - LPSTR TempName; - - /* Get current module data structure and module name string array */ - ModuleData = &reactos_modules[LoaderBlock.ModsCount]; - - /* Get only the Module Name */ - do { - - TempName = strchr(ModuleName, '\\'); - - if(TempName) { - ModuleName = TempName + 1; - } - - } while(TempName); - NameBuffer = reactos_module_strings[LoaderBlock.ModsCount]; - - - /* Get Module Size */ - LocalModuleSize = FsGetFileSize(ModuleImage); - - /* Fill out Module Data Structure */ - ModuleData->ModStart = NextModuleBase; - ModuleData->ModEnd = NextModuleBase + LocalModuleSize; - - /* Save name */ - strcpy(NameBuffer, ModuleName); - ModuleData->String = (ULONG_PTR)NameBuffer; - - /* Load the file image */ - FsReadFile(ModuleImage, LocalModuleSize, NULL, (PVOID)NextModuleBase); - - /* Move to next memory block and increase Module Count */ - NextModuleBase = ROUND_UP(ModuleData->ModEnd, PAGE_SIZE); - LoaderBlock.ModsCount++; - - /* Return Module Size if required */ - if (ModuleSize != NULL) { - *ModuleSize = LocalModuleSize; - } - - printf("Module %s (%x-%x) next at %x\n", - ModuleData->String, - ModuleData->ModStart, - ModuleData->ModEnd, - NextModuleBase); - - return ThisModuleBase; -} - -PVOID -NTAPI -FrLdrMapImage(IN FILE *Image, IN PCHAR ShortName, IN ULONG ImageType) -{ - PVOID Result = NULL; - - printf("Loading image %s (type %d)\n", ShortName, ImageType); - - if (ImageType == 1) - { - if(FrLdrMapKernel(Image)) - Result = (PVOID)KernelMemory; - } - else - { - PVOID ModuleBase = (PVOID)NextModuleBase; - - if(FrLdrMapModule(Image, ShortName, 0, 0)) - Result = ModuleBase; - } - return Result; -} - -ULONG_PTR -NTAPI -FrLdrCreateModule(LPCSTR ModuleName) -{ - PLOADER_MODULE ModuleData; - LPSTR NameBuffer; - - /* Get current module data structure and module name string array */ - ModuleData = &reactos_modules[LoaderBlock.ModsCount]; - NameBuffer = reactos_module_strings[LoaderBlock.ModsCount]; - - /* Set up the structure */ - ModuleData->ModStart = NextModuleBase; - ModuleData->ModEnd = -1; - - /* Copy the name */ - strcpy(NameBuffer, ModuleName); - ModuleData->String = (ULONG_PTR)NameBuffer; - - /* Set the current Module */ - CurrentModule = ModuleData; - - /* Return Module Base Address */ - return(ModuleData->ModStart); -} - -BOOLEAN -NTAPI -FrLdrCloseModule(ULONG_PTR ModuleBase, - ULONG ModuleSize) -{ - PLOADER_MODULE ModuleData = CurrentModule; - - /* Make sure a module is opened */ - if (ModuleData) { - - /* Make sure this is the right module and that it hasn't been closed */ - if ((ModuleBase == ModuleData->ModStart) && (ModuleData->ModEnd == MAXULONG_PTR)) { - - /* Close the Module */ - ModuleData->ModEnd = ModuleData->ModStart + ModuleSize; - - /* Set the next Module Base and increase the number of modules */ - NextModuleBase = ROUND_UP(ModuleData->ModEnd, PAGE_SIZE); - LoaderBlock.ModsCount++; - - /* Close the currently opened module */ - CurrentModule = NULL; - - /* Success */ - return(TRUE); - } - } - - /* Failure path */ - return(FALSE); -} diff --git a/boot/freeldr/freeldr/arch/powerpc/mmu.c b/boot/freeldr/freeldr/arch/powerpc/mmu.c deleted file mode 100644 index e195eaea..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/mmu.c +++ /dev/null @@ -1,399 +0,0 @@ -#include -#include "ppcmmu/mmu.h" - -inline int GetMSR() { - register int res asm ("r3"); - __asm__("mfmsr 3"); - return res; -} - -inline int GetDEC() { - register int res asm ("r3"); - __asm__("mfdec 3"); - return res; -} - -__asm__("\t.globl GetPhys\n" - "GetPhys:\t\n" - "mflr 0\n\t" - "stwu 0,-16(1)\n\t" - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "isync\n\t" - "sync\n\t" - "lwz 3,0(3)\n\t" /* Get actual value at phys addr r3 */ - "mtmsr 5\n\t" - "isync\n\t" - "sync\n\t" - "lwz 0,0(1)\n\t" - "addi 1,1,16\n\t" - "mtlr 0\n\t" - "blr" - ); - -__asm__("\t.globl GetPhysHalf\n" - "GetPhysHalf:\t\n" - "mflr 0\n\t" - "stwu 0,-16(1)\n\t" - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "isync\n\t" - "sync\n\t" - "lhz 3,0(3)\n\t" /* Get actual value at phys addr r3 */ - "mtmsr 5\n\t" - "isync\n\t" - "sync\n\t" - "lwz 0,0(1)\n\t" - "addi 1,1,16\n\t" - "mtlr 0\n\t" - "blr" - ); - -__asm__("\t.globl GetPhysByte\n" - "GetPhysByte:\t\n" - "mflr 0\n\t" - "stwu 0,-16(1)\n\t" - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "isync\n\t" - "sync\n\t" - "lbz 3,0(3)\n\t" /* Get actual value at phys addr r3 */ - "mtmsr 5\n\t" - "isync\n\t" - "sync\n\t" - "lwz 0,0(1)\n\t" - "addi 1,1,16\n\t" - "mtlr 0\n\t" - "blr" - ); - -__asm__("\t.globl SetPhys\n" - "SetPhys:\t\n" - "mflr 0\n\t" - "stwu 0,-16(1)\n\t" - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "sync\n\t" - "eieio\n\t" - "stw 4,0(3)\n\t" /* Set actual value at phys addr r3 */ - "dcbst 0,3\n\t" - "mtmsr 5\n\t" - "sync\n\t" - "eieio\n\t" - "mr 3,4\n\t" - "lwz 0,0(1)\n\t" - "addi 1,1,16\n\t" - "mtlr 0\n\t" - "blr" - ); - -__asm__("\t.globl SetPhysHalf\n" - "SetPhysHalf:\t\n" - "mflr 0\n\t" - "stwu 0,-16(1)\n\t" - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "sync\n\t" - "eieio\n\t" - "sth 4,0(3)\n\t" /* Set actual value at phys addr r3 */ - "dcbst 0,3\n\t" - "mtmsr 5\n\t" - "sync\n\t" - "eieio\n\t" - "mr 3,4\n\t" - "lwz 0,0(1)\n\t" - "addi 1,1,16\n\t" - "mtlr 0\n\t" - "blr" - ); - -__asm__("\t.globl SetPhysByte\n" - "SetPhysByte:\t\n" - "mflr 0\n\t" - "stwu 0,-16(1)\n\t" - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "sync\n\t" - "eieio\n\t" - "stb 4,0(3)\n\t" /* Set actual value at phys addr r3 */ - "dcbst 0,3\n\t" - "mtmsr 5\n\t" - "sync\n\t" - "eieio\n\t" - "mr 3,4\n\t" - "lwz 0,0(1)\n\t" - "addi 1,1,16\n\t" - "mtlr 0\n\t" - "blr" - ); - -inline int GetSR(int n) { - register int res asm ("r3"); - switch( n ) { - case 0: - __asm__("mfsr 3,0"); - break; - case 1: - __asm__("mfsr 3,1"); - break; - case 2: - __asm__("mfsr 3,2"); - break; - case 3: - __asm__("mfsr 3,3"); - break; - case 4: - __asm__("mfsr 3,4"); - break; - case 5: - __asm__("mfsr 3,5"); - break; - case 6: - __asm__("mfsr 3,6"); - break; - case 7: - __asm__("mfsr 3,7"); - break; - case 8: - __asm__("mfsr 3,8"); - break; - case 9: - __asm__("mfsr 3,9"); - break; - case 10: - __asm__("mfsr 3,10"); - break; - case 11: - __asm__("mfsr 3,11"); - break; - case 12: - __asm__("mfsr 3,12"); - break; - case 13: - __asm__("mfsr 3,13"); - break; - case 14: - __asm__("mfsr 3,14"); - break; - case 15: - __asm__("mfsr 3,15"); - break; - } - return res; -} - -inline void GetBat( int bat, int inst, int *batHi, int *batLo ) { - register int bh asm("r3"), bl asm("r4"); - if( inst ) { - switch( bat ) { - case 0: - __asm__("mfibatu 3,0"); - __asm__("mfibatl 4,0"); - break; - case 1: - __asm__("mfibatu 3,1"); - __asm__("mfibatl 4,1"); - break; - case 2: - __asm__("mfibatu 3,2"); - __asm__("mfibatl 4,2"); - break; - case 3: - __asm__("mfibatu 3,3"); - __asm__("mfibatl 4,3"); - break; - } - } else { - switch( bat ) { - case 0: - __asm__("mfdbatu 3,0"); - __asm__("mfdbatl 4,0"); - break; - case 1: - __asm__("mfdbatu 3,1"); - __asm__("mfdbatl 4,1"); - break; - case 2: - __asm__("mfdbatu 3,2"); - __asm__("mfdbatl 4,2"); - break; - case 3: - __asm__("mfdbatu 3,3"); - __asm__("mfdbatl 4,3"); - break; - } - } - *batHi = bh; - *batLo = bl; -} - -inline void SetBat( int bat, int inst, int batHi, int batLo ) { - register int bh asm("r3"), bl asm("r4"); - bh = batHi; - bl = batLo; - if( inst ) { - switch( bat ) { - case 0: - __asm__("mtibatu 0,3"); - __asm__("mtibatl 0,4"); - break; - case 1: - __asm__("mtibatu 1,3"); - __asm__("mtibatl 1,4"); - break; - case 2: - __asm__("mtibatu 2,3"); - __asm__("mtibatl 2,4"); - break; - case 3: - __asm__("mtibatu 3,3"); - __asm__("mtibatl 3,4"); - break; - } - } else { - switch( bat ) { - case 0: - __asm__("mtdbatu 0,3"); - __asm__("mtdbatl 0,4"); - break; - case 1: - __asm__("mtdbatu 1,3"); - __asm__("mtdbatl 1,4"); - break; - case 2: - __asm__("mtdbatu 2,3"); - __asm__("mtdbatl 2,4"); - break; - case 3: - __asm__("mtdbatu 3,3"); - __asm__("mtdbatl 3,4"); - break; - } - } - __asm__("isync\n\tsync"); -} - -inline int GetSDR1() { - register int res asm("r3"); - __asm__("mfsdr1 3"); - return res; -} - -inline void SetSDR1( int sdr ) { -#if 0 - int i,j; -#endif - __asm__("mtsdr1 3"); -#if 0 - __asm__("sync"); - __asm__("isync"); - __asm__("ptesync"); - - for( i = 0; i < 256; i++ ) { - j = i << 12; - __asm__("tlbie %0,0" : : "r" (j)); - } - __asm__("eieio"); - __asm__("tlbsync"); - __asm__("ptesync"); -#endif -} - -inline int BatHit( int bath, int batl, int virt ) { - int mask = 0xfffe0000 & ~((batl & 0x3f) << 17); - return (batl & 0x40) && ((virt & mask) == (bath & mask)); -} - -inline int BatTranslate( int bath, int batl, int virt ) { - return (virt & 0x007fffff) | (batl & 0xfffe0000); -} - -/* translate address */ -int PpcVirt2phys( int virt, int inst ) { - int msr = GetMSR(); - int txmask = inst ? 0x20 : 0x10; - int i, bath, batl, sr, sdr1, physbase, valo; - int hash, hashmask, ptehi, ptelo, ptegaddr; - //int vahi, npteg; - int vsid, pteh, ptevsid, pteapi; - - if( msr & txmask ) { - sr = GetSR( virt >> 28 ); - vsid = sr & 0xfffffff; - //vahi = vsid >> 4; - valo = (vsid << 28) | (virt & 0xfffffff); - if( sr & 0x80000000 ) { - return valo; - } - - for( i = 0; i < 4; i++ ) { - GetBat( i, inst, &bath, &batl ); - if( BatHit( bath, batl, virt ) ) { - return BatTranslate( bath, batl, virt ); - } - } - - sdr1 = GetSDR1(); - - physbase = sdr1 & ~0xffff; - hashmask = ((sdr1 & 0x1ff) << 10) | 0x3ff; - hash = (vsid & 0x7ffff) ^ ((valo >> 12) & 0xffff); - //npteg = hashmask + 1; - - for( pteh = 0; pteh < 0x80; pteh += 64, hash ^= 0x7ffff ) { - ptegaddr = ((hashmask & hash) * 64) + physbase; - - for( i = 0; i < 8; i++ ) { - ptehi = GetPhys( ptegaddr + (i * 8) ); - ptelo = GetPhys( ptegaddr + (i * 8) + 4 ); - - ptevsid = (ptehi >> 7) & 0xffffff; - pteapi = ptehi & 0x3f; - - if( (ptehi & 64) != pteh ) continue; - if( ptevsid != (vsid & 0xffffff) ) continue; - if( pteapi != ((virt >> 22) & 0x3f) ) continue; - - return (ptelo & 0xfffff000) | (virt & 0xfff); - } - } - return -1; - } else { - return virt; - } -} - -/* Add a new page table entry for the indicated mapping */ -BOOLEAN InsertPageEntry( int virt, int phys, int slot, int _sdr1 ) { - int i, ptehi, ptelo; - int sdr1 = _sdr1 ? _sdr1 : GetSDR1(); - int sr = GetSR( (virt >> 28) & 0xf ); - int vsid = sr & 0xfffffff; - int physbase = sdr1 & ~0xffff; - int hashmask = ((sdr1 & 0x1ff) << 10) | 0x3ff; - int valo = (vsid << 28) | (virt & 0xfffffff); - int hash = (vsid & 0x7ffff) ^ ((valo >> 12) & 0xffff); - int ptegaddr = ((hashmask & hash) * 64) + physbase; - - for( i = 0; i < 8; i++ ) { - ptehi = GetPhys( ptegaddr + (i * 8) ); - - if( (slot != i) && (ptehi & 0x80000000) ) continue; - - ptehi = (1 << 31) | (vsid << 7) | ((virt >> 22) & 0x3f); - ptelo = phys & ~0xfff; - - SetPhys( ptegaddr + (i * 8), ptehi ); - SetPhys( ptegaddr + (i * 8) + 4, ptelo ); - - return TRUE; - } - - return FALSE; -} diff --git a/boot/freeldr/freeldr/arch/powerpc/ofw_method.c b/boot/freeldr/freeldr/arch/powerpc/ofw_method.c deleted file mode 100644 index 0a160b54..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/ofw_method.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include "of.h" - -typedef struct _ofw_method_call { - const char *call_method; - int nargs; - int nrets; - const char *method_name; - int handle; - int args_rets[8]; -} ofw_method_call; - -extern int (*ofw_call_addr)(void *argstruct); - -int ofw_callmethod_ret(const char *method, int handle, int nargs, int *args, int ret) -{ - ofw_method_call callframe = { 0 }; - callframe.call_method = "call-method"; - callframe.nargs = nargs + 2; - callframe.nrets = ret+1; - callframe.method_name = method; - callframe.handle = handle; - memcpy(callframe.args_rets, args, sizeof(int)*nargs); - ofw_call_addr(&callframe); - return callframe.args_rets[nargs+ret]; -} diff --git a/boot/freeldr/freeldr/arch/powerpc/ofw_util.s b/boot/freeldr/freeldr/arch/powerpc/ofw_util.s deleted file mode 100644 index 1a214451..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/ofw_util.s +++ /dev/null @@ -1,48 +0,0 @@ - .section .text - .globl ofw_functions - .globl ofw_call_addr - .globl call_ofw -call_ofw: - /* R3 has the function offset to call (n * 4) - * Other arg registers are unchanged. */ - subi %r1,%r1,0x100 - stw %r8,24(%r1) - mflr %r8 - stw %r8,0(%r1) - stw %r3,4(%r1) - stw %r4,8(%r1) - stw %r5,12(%r1) - stw %r6,16(%r1) - stw %r7,20(%r1) - stw %r9,28(%r1) - stw %r10,32(%r1) - stw %r20,36(%r1) - - lis %r10,ofw_functions@ha - addi %r8,%r10,ofw_functions@l - add %r8,%r3,%r8 - lwz %r9,0(%r8) - mtctr %r9 - - mr %r3,%r4 - mr %r4,%r5 - mr %r5,%r6 - mr %r6,%r7 - mr %r7,%r8 - mr %r8,%r9 - - /* Call ofw proxy function */ - bctrl - - lwz %r8,0(%r1) - mtlr %r8 - lwz %r4,8(%r1) - lwz %r5,12(%r1) - lwz %r6,16(%r1) - lwz %r7,20(%r1) - lwz %r8,24(%r1) - lwz %r9,28(%r1) - lwz %r10,32(%r1) - lwz %r20,36(%r1) - addi %r1,%r1,0x100 - blr diff --git a/boot/freeldr/freeldr/arch/powerpc/prep.c b/boot/freeldr/freeldr/arch/powerpc/prep.c deleted file mode 100644 index 713e6163..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/prep.c +++ /dev/null @@ -1,148 +0,0 @@ -#include "freeldr.h" -#include "machine.h" -#include "ppcmmu/mmu.h" -#include "prep.h" - -int prep_serial = 0x800003f8; -extern int mem_range_end; - -void sync() { __asm__("eieio\n\tsync"); } - -/* Simple serial */ - -void PpcPrepPutChar( int ch ) { - if( ch == 0x0a ) { - SetPhysByte(prep_serial, 0x0d); - sync(); - } - SetPhysByte(prep_serial, ch); - sync(); -} - -BOOLEAN PpcPrepDiskReadLogicalSectors -( ULONG DriveNumber, ULONGLONG SectorNumber, - ULONG SectorCount, PVOID Buffer ) { - int secct; - - for(secct = 0; secct < SectorCount; secct++) - { - ide_seek(&ide1_desc, SectorNumber + secct, 0); - ide_read(&ide1_desc, ((PCHAR)Buffer) + secct * 512, 512); - } - /* Never give up! */ - return TRUE; -} - -BOOLEAN PpcPrepConsKbHit() -{ - return 1; - //return GetPhysByte(prep_serial+5) & 1; -} - -int PpcPrepConsGetCh() -{ - while(!PpcPrepConsKbHit()); - return GetPhysByte(prep_serial); -} - -void PpcPrepVideoClearScreen(UCHAR Attr) -{ - printf("\033c"); -} - -VIDEODISPLAYMODE PpcPrepVideoSetDisplayMode( char *DisplayMode, BOOLEAN Init ) -{ - return VideoTextMode; -} - -void PpcPrepVideoGetDisplaySize( PULONG Width, PULONG Height, PULONG Depth ) -{ - *Width = 80; - *Height = 25; - *Depth = 16; -} - -VOID PpcInitializeMmu(int max); - -ULONG PpcPrepGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap, - ULONG MaxMemoryMapSize ) -{ - // Probe memory - paddr_t physAddr; - register int oldStore = 0, newStore = 0, change = 0, oldmsr; - - __asm__("mfmsr %0\n" : "=r" (oldmsr)); - change = oldmsr & 0x6fff; - __asm__("mtmsr %0\n" : : "r" (change)); - - // Find the last ram address in physical space ... this bypasses mapping - // but could run into non-ram objects right above ram. Usually systems - // aren't designed like that though. - for (physAddr = 0x40000, change = newStore; - (physAddr < 0x80000000) && (change == newStore); - physAddr += 1 << 12) - { - oldStore = GetPhys(physAddr); - newStore = (physAddr & 0x1000) ? 0x55aa55aa : 0xaa55aa55; - SetPhys(physAddr, newStore); - change = GetPhys(physAddr); - SetPhys(physAddr, oldStore); - } - // Back off by one page - physAddr -= 0x1000; - BiosMemoryMap[0].BaseAddress = 0x30000; // End of ppcmmu - BiosMemoryMap[0].Type = BiosMemoryUsable; - BiosMemoryMap[0].Length = physAddr - BiosMemoryMap[0].BaseAddress; - - __asm__("mtmsr %0\n" : : "r" (oldmsr)); - - mem_range_end = physAddr; - - printf("Actual RAM: %d Mb\n", physAddr >> 20); - return 1; -} - -/* Most PReP hardware is in standard locations, based on the corresponding - * hardware on PCs. */ -PCONFIGURATION_COMPONENT_DATA PpcPrepHwDetect() { - PCONFIGURATION_COMPONENT_DATA SystemKey; - - /* Create the 'System' key */ - FldrCreateSystemKey(&SystemKey); - - printf("DetectHardware() Done\n"); - return SystemKey; -} - -VOID -PpcPrepHwIdle(VOID) -{ - /* UNIMPLEMENTED */ -} - -void PpcPrepInit() -{ - MachVtbl.ConsPutChar = PpcPrepPutChar; - - printf("Serial on\n"); - - ide_setup( &ide1_desc ); - - MachVtbl.DiskReadLogicalSectors = PpcPrepDiskReadLogicalSectors; - - MachVtbl.ConsKbHit = PpcPrepConsKbHit; - MachVtbl.ConsGetCh = PpcPrepConsGetCh; - - MachVtbl.VideoClearScreen = PpcPrepVideoClearScreen; - MachVtbl.VideoSetDisplayMode = PpcPrepVideoSetDisplayMode; - MachVtbl.VideoGetDisplaySize = PpcPrepVideoGetDisplaySize; - - MachVtbl.GetMemoryMap = PpcPrepGetMemoryMap; - MachVtbl.HwDetect = PpcPrepHwDetect; - MachVtbl.HwIdle = PcPrepHwIdle; - - printf( "FreeLDR version [%s]\n", GetFreeLoaderVersionString() ); - - BootMain( "" ); -} - diff --git a/boot/freeldr/freeldr/arch/powerpc/prep.h b/boot/freeldr/freeldr/arch/powerpc/prep.h deleted file mode 100644 index c539b88b..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/prep.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -extern struct _pci_desc pci1_desc; -extern struct _idectl_desc ide1_desc; -extern struct _vga_desc vga1_desc; -struct _pci_bar { - unsigned long data; -}; - -void sync( void ); -void PpcPrepInit( void ); -void ide_seek( void *extension, int low, int high ); -int ide_read( void *extension, char *buffer, int bytes ); -void ide_setup( void *extension ); - -void print_bar( struct _pci_bar *bar ); -void pci_setup -( PCONFIGURATION_COMPONENT_DATA pci_bus, - struct _pci_desc *pci_desc ); -void pci_read_bar -( struct _pci_desc *pci_desc, - int bus, int dev, int fn, int bar, - struct _pci_bar *bar_data ); - -void vga_setup -( PCONFIGURATION_COMPONENT_DATA pci_bus, - struct _pci_desc *pci_desc, struct _vga_desc *vga_desc, - int bus, int dev, int fn ); diff --git a/boot/freeldr/freeldr/arch/powerpc/prep_ide.c b/boot/freeldr/freeldr/arch/powerpc/prep_ide.c deleted file mode 100644 index a96bf4d1..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/prep_ide.c +++ /dev/null @@ -1,106 +0,0 @@ -#include "freeldr.h" -#include "machine.h" -#include "ppcmmu/mmu.h" -#include "prep.h" - -#define SWAP_W(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff)) - -typedef struct _idectl_desc { - int port; - long long seekto; - int seek_cylinder, seek_head, seek_sector; - int cylinders, heads, sectors, bytespersec; -} idectl_desc; - -idectl_desc ide1_desc = { 0x800001f0 }; - -void ide_seek( void *extension, int low, int high ) { - idectl_desc *desc = (idectl_desc *)extension; - long long seekto = ((((long long)high) << 32) | (low & 0xffffffff)); - /* order = sector, head, cylinder */ - desc->seek_sector = seekto % desc->sectors; - seekto /= desc->sectors; - desc->seek_head = seekto % desc->heads; - seekto /= desc->heads; - desc->seek_cylinder = seekto; - desc->seekto = seekto; -} - -/* Thanks chuck moore. This is based on the color forth ide code */ -/* Wait for ready */ -void ide_rdy( void *extension ) { - idectl_desc *desc = (idectl_desc *)extension; - while( !(GetPhysByte(desc->port+7) & 0x40) ) sync(); -} - -void ide_drq( void *extension ) { - idectl_desc *desc = (idectl_desc *)extension; - while( !(GetPhysByte(desc->port+7) & 0x08) ) sync(); -} - -void ide_bsy( void *extension ) { - idectl_desc *desc = (idectl_desc *)extension; - while( GetPhysByte(desc->port+7) & 0x80 ) - { - printf("Waiting for not busy\n"); - sync(); - } -} - -int ide_read( void *extension, char *buffer, int bytes ) { - idectl_desc *desc = (idectl_desc *)extension; - short *databuf = (short *)buffer; - int inwords; - - ide_bsy( extension ); - SetPhysByte(desc->port+2, bytes / desc->bytespersec); - SetPhysByte(desc->port+3, desc->seek_sector + 1); - SetPhysByte(desc->port+4, desc->seek_cylinder); - SetPhysByte(desc->port+5, desc->seek_cylinder >> 8); - SetPhysByte(desc->port+6, desc->seek_head | 0xa0); - SetPhysByte(desc->port+7, 0x20); - - for( inwords = 0; inwords < desc->bytespersec / sizeof(short); inwords++ ) { - databuf[inwords] = GetPhysHalf(desc->port); - } - - desc->seekto += desc->bytespersec; - ide_seek( extension, desc->seekto, desc->seekto >> 32 ); - - return bytes - (bytes % desc->bytespersec); -} - -void ide_setup( void *extension ) { - idectl_desc *desc = (idectl_desc *)extension; - short identbuffer[256]; - char namebuf[41]; - short *databuf = (short *)identbuffer, in; - int inwords; - - ide_rdy( extension ); - ide_bsy( extension ); - desc->bytespersec = 512; - SetPhysByte(desc->port+2, 1); - SetPhysByte(desc->port+3, 0); - SetPhysByte(desc->port+4, 0); - SetPhysByte(desc->port+5, 0); - SetPhysByte(desc->port+6, 0); - SetPhysByte(desc->port+7, 0xec); - ide_drq( extension ); - - for( inwords = 0; inwords < desc->bytespersec / sizeof(short); inwords++ ) { - in = GetPhysHalf(desc->port); - databuf[inwords] = SWAP_W(in); - sync(); - } - - desc->cylinders = identbuffer[1]; - desc->heads = identbuffer[3]; - desc->sectors = identbuffer[6]; - - /* Debug: Write out hard disc model */ - - strncpy(namebuf, (char *)(identbuffer+0x1b), 41); - printf("HARD DISC MODEL: %s c,h,s %d,%d,%d\n", - namebuf, desc->cylinders, desc->heads, desc->sectors); -} diff --git a/boot/freeldr/freeldr/arch/powerpc/prep_pci.c b/boot/freeldr/freeldr/arch/powerpc/prep_pci.c deleted file mode 100644 index df92704e..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/prep_pci.c +++ /dev/null @@ -1,127 +0,0 @@ -#include -#include "prep.h" - -typedef struct _pci_cfg { - unsigned long addr; - unsigned long data; -} pci_cfg; - -typedef struct _pci_desc { - pci_cfg *cfg; -} pci_desc; - -pci_desc pci1_desc = { (void *)0x80000cf8 }; -#define rev16(x) ((((x)>>8)&0xff)|(((x)&0xff)<<8)) -#define rev32(x) ((((x)>>24)&0xff)|(((x)>>8)&0xff00)|(((x)&0xff00)<<8)|(((x)&0xff)<<24)) -#define pci_addr(bus,dev,fn,reg) \ - (0x80000000 | \ - ((bus & 0xff) << 16) | \ - ((dev & 0x1f) << 11) | \ - ((fn & 7) << 8) | \ - (reg & 0xfc)) -#if 0 -#define pci_cfg_addr(bus,dev,fn,reg) \ - ((bus == 0) ? \ - ((1 << (dev + 16)) | \ - (dev << 11) | \ - (fn << 8) | \ - ((reg & 0xfc) | 1)) : pci_addr(bus,dev,fn,reg)) -#else -#define pci_cfg_addr(bus,dev,fn,reg) pci_addr(bus,dev,fn,reg) -#endif - unsigned long pci_read( pci_desc *desc, int bus, int dev, int fn, int reg, int len ) { - sync(); - unsigned long save_state = desc->cfg->addr, ret = 0; - unsigned long addr = pci_cfg_addr(bus,dev,fn,reg); - unsigned long offset = reg & 3; - desc->cfg->addr = rev32(addr); - sync(); - switch( len ) { - case 4: - ret = desc->cfg->data; - break; - case 2: - ret = desc->cfg->data; - ret = (ret >> (offset << 3)) & 0xffff; - break; - case 1: - ret = desc->cfg->data; - ret = (ret >> (offset << 3)) & 0xff; - break; - } - desc->cfg->addr = save_state; - sync(); - return ret; - } - -void pci_read_bar( pci_desc *desc, int bus, int dev, int fn, int bar, - struct _pci_bar *bar_data ) { - bar_data->data = pci_read( desc, bus, dev, fn, 0x10 + (bar * 4), 4 ); -} - -/* - * Imagine: offset 3, len 1 - * let oldval = 0x12345678 and val = 0xabcd1234; - * mask = ((1 << 8) - 1) << 24; // 0xff000000 - * oldval = (0x12345678 & 0x00ffffff) | (0xabcd1234 & 0xff000000) = 0xab345678; - */ -void pci_write( pci_desc *desc, int bus, int dev, int fn, int reg, int len, int val ) { - unsigned long save_state = desc->cfg->addr; - unsigned long addr = pci_cfg_addr(bus,dev,fn,reg); - unsigned long offset = reg & 3; - unsigned long oldval = pci_read( desc, bus, dev, fn, reg & ~3, 4 ); - unsigned long mask = ((1 << (len * 8)) - 1) << (offset << 3); - oldval = (oldval & ~mask) | ((val << (offset << 3)) & mask); - desc->cfg->addr = rev32(addr); - sync(); - desc->cfg->data = rev32(oldval); - sync(); - desc->cfg->addr = save_state; - sync(); -} - -void pci_write_bar( pci_desc *desc, int bus, int dev, int fn, int bar, struct _pci_bar *bar_data ) { - pci_write( desc, bus, dev, fn, 0x10 + (bar * 4), 4, bar_data->data ); -} - -void print_bar( struct _pci_bar *bar ) { - printf("BAR: %x\n", bar->data); -} - -#define PCI_VENDORID 0 -#define PCI_DEVICEID 2 -#define PCI_HEADER_TYPE 0xe -#define PCI_BASECLASS 0xb - -void pci_setup( PCONFIGURATION_COMPONENT_DATA pcibus, pci_desc *desc ) { - unsigned char type; - unsigned short vendor, device, devclass; - int funcs, bus, dev, fn; - - pci1_desc.cfg = (pci_cfg *)0x80000cf8; - - printf("PCI Bus:\n"); - for( bus = 0; bus < 1; bus++ ) { - for( dev = 0; dev < 32; dev++ ) { - type = pci_read(desc,bus,dev,0,PCI_HEADER_TYPE,1); - vendor = pci_read(desc,bus,dev,0,PCI_VENDORID,2); - device = pci_read(desc,bus,dev,0,PCI_DEVICEID,2); - - if(vendor == 0 || vendor == 0xffff) continue; - if(type & 0x80) funcs = 8; else funcs = 1; - - for( fn = 0; fn < funcs; fn++ ) { - devclass = pci_read(desc,bus,dev,fn,PCI_BASECLASS,1); - printf(" %d:%d -> vendor:device:class %x:%x:%x\n", - bus, dev, vendor, device, devclass); - - if( devclass == 3 ) { - printf("Setting up vga...\n"); - vga_setup(pcibus,desc,&vga1_desc,bus,dev,fn); - printf("Done with vga\n"); - } - } - } - } - printf("^-- end PCI\n"); -} diff --git a/boot/freeldr/freeldr/arch/powerpc/prep_vga.c b/boot/freeldr/freeldr/arch/powerpc/prep_vga.c deleted file mode 100644 index ee8fdbbf..00000000 --- a/boot/freeldr/freeldr/arch/powerpc/prep_vga.c +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include "prep.h" - -struct _vga_desc { - char *port; - char *addr; -}; - -#define VGA_WIDTH 1024 -#define VGA_HEIGHT 768 -struct _vga_desc vga1_desc = { (char *)0x800003c0 }; - -void vga_setup( PCONFIGURATION_COMPONENT_DATA pcibus, - struct _pci_desc *desc, struct _vga_desc *vga_desc, - int bus, int dev, int fn ) { - struct _pci_bar bar_data; - int i; - - for( i = 0; i < 6; i++ ) { - pci_read_bar( desc, bus, dev, fn, i, &bar_data ); - print_bar( &bar_data ); - if( (bar_data.data > 0x10000) || ((bar_data.data&1) == 1) ) { - vga_desc->addr = (char *)(0xc0000000 + (bar_data.data & ~0x7ff)); -// BootInfo.dispDeviceBase = vga_desc->addr; - break; - } - } -} diff --git a/sdk/include/asm/asm.inc b/sdk/include/asm/asm.inc index 7b8e8317..5c591ca7 100644 --- a/sdk/include/asm/asm.inc +++ b/sdk/include/asm/asm.inc @@ -1,6 +1,6 @@ /* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Kernel + * PROJECT: Kernel * FILE: include/asm/asm.inc * PURPOSE: ASM macros for GAS and MASM/ML64 * PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org) diff --git a/sdk/include/ddk/isvbop.inc b/sdk/include/ddk/isvbop.inc index 7a13b4bc..2067ed73 100644 --- a/sdk/include/ddk/isvbop.inc +++ b/sdk/include/ddk/isvbop.inc @@ -3,7 +3,7 @@ * * Windows NT Device Driver Kit * - * This file is part of the ReactOS DDK package. + * This file is part of the DDK package. * * Contributors: * Hermes Belusca-Maito (hermes.belusca@sfr.fr) diff --git a/sdk/include/psdk/common.ver b/sdk/include/psdk/common.ver index 1b5cd9a1..d9731fd3 100644 --- a/sdk/include/psdk/common.ver +++ b/sdk/include/psdk/common.ver @@ -1,5 +1,4 @@ /* - * PROJECT: ReactOS * LICENSE: GPL - See COPYING in the top level directory * FILE: include/psdk/common.ver * PURPOSE: Common Version File. diff --git a/sdk/include/reactos/libs/libxml/xmlversion.h.in b/sdk/include/reactos/libs/libxml/xmlversion.h.in index b173be9e..00a836fb 100644 --- a/sdk/include/reactos/libs/libxml/xmlversion.h.in +++ b/sdk/include/reactos/libs/libxml/xmlversion.h.in @@ -435,7 +435,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); */ #ifndef LIBXML_ATTR_ALLOC_SIZE -# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))) +# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) # define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # else # define LIBXML_ATTR_ALLOC_SIZE(x) diff --git a/sdk/include/reactos/version.h.cmake b/sdk/include/reactos/version.h.cmake index 10128c63..7b6a0d5c 100644 --- a/sdk/include/reactos/version.h.cmake +++ b/sdk/include/reactos/version.h.cmake @@ -1,6 +1,6 @@ /* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel + * PROJECT: kernel * FILE: include/reactos/version.h.cmake * PURPOSE: Defines the current version * PROGRAMMER: David Welch (welch@mcmail.com) diff --git a/sdk/lib/3rdparty/bzip2/CHANGES b/sdk/lib/3rdparty/bzip2/CHANGES deleted file mode 100644 index 81e97ca6..00000000 --- a/sdk/lib/3rdparty/bzip2/CHANGES +++ /dev/null @@ -1,327 +0,0 @@ - ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ - - -0.9.0 -~~~~~ -First version. - - -0.9.0a -~~~~~~ -Removed 'ranlib' from Makefile, since most modern Unix-es -don't need it, or even know about it. - - -0.9.0b -~~~~~~ -Fixed a problem with error reporting in bzip2.c. This does not effect -the library in any way. Problem is: versions 0.9.0 and 0.9.0a (of the -program proper) compress and decompress correctly, but give misleading -error messages (internal panics) when an I/O error occurs, instead of -reporting the problem correctly. This shouldn't give any data loss -(as far as I can see), but is confusing. - -Made the inline declarations disappear for non-GCC compilers. - - -0.9.0c -~~~~~~ -Fixed some problems in the library pertaining to some boundary cases. -This makes the library behave more correctly in those situations. The -fixes apply only to features (calls and parameters) not used by -bzip2.c, so the non-fixedness of them in previous versions has no -effect on reliability of bzip2.c. - -In bzlib.c: - * made zero-length BZ_FLUSH work correctly in bzCompress(). - * fixed bzWrite/bzRead to ignore zero-length requests. - * fixed bzread to correctly handle read requests after EOF. - * wrong parameter order in call to bzDecompressInit in - bzBuffToBuffDecompress. Fixed. - -In compress.c: - * changed setting of nGroups in sendMTFValues() so as to - do a bit better on small files. This _does_ effect - bzip2.c. - - -0.9.5a -~~~~~~ -Major change: add a fallback sorting algorithm (blocksort.c) -to give reasonable behaviour even for very repetitive inputs. -Nuked --repetitive-best and --repetitive-fast since they are -no longer useful. - -Minor changes: mostly a whole bunch of small changes/ -bugfixes in the driver (bzip2.c). Changes pertaining to the -user interface are: - - allow decompression of symlink'd files to stdout - decompress/test files even without .bz2 extension - give more accurate error messages for I/O errors - when compressing/decompressing to stdout, don't catch control-C - read flags from BZIP2 and BZIP environment variables - decline to break hard links to a file unless forced with -f - allow -c flag even with no filenames - preserve file ownerships as far as possible - make -s -1 give the expected block size (100k) - add a flag -q --quiet to suppress nonessential warnings - stop decoding flags after --, so files beginning in - can be handled - resolved inconsistent naming: bzcat or bz2cat ? - bzip2 --help now returns 0 - -Programming-level changes are: - - fixed syntax error in GET_LL4 for Borland C++ 5.02 - let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC} - fix overshoot of mode-string end in bzopen_or_bzdopen - wrapped bzlib.h in #ifdef __cplusplus ... extern "C" { ... } - close file handles under all error conditions - added minor mods so it compiles with DJGPP out of the box - fixed Makefile so it doesn't give problems with BSD make - fix uninitialised memory reads in dlltest.c - -0.9.5b -~~~~~~ -Open stdin/stdout in binary mode for DJGPP. - -0.9.5c -~~~~~~ -Changed BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1. The + 1 -version could cause the sorted order to be wrong in some extremely -obscure cases. Also changed setting of quadrant in blocksort.c. - -0.9.5d -~~~~~~ -The only functional change is to make bzlibVersion() in the library -return the correct string. This has no effect whatsoever on the -functioning of the bzip2 program or library. Added a couple of casts -so the library compiles without warnings at level 3 in MS Visual -Studio 6.0. Included a Y2K statement in the file Y2K_INFO. All other -changes are minor documentation changes. - -1.0 -~~~ -Several minor bugfixes and enhancements: - -* Large file support. The library uses 64-bit counters to - count the volume of data passing through it. bzip2.c - is now compiled with -D_FILE_OFFSET_BITS=64 to get large - file support from the C library. -v correctly prints out - file sizes greater than 4 gigabytes. All these changes have - been made without assuming a 64-bit platform or a C compiler - which supports 64-bit ints, so, except for the C library - aspect, they are fully portable. - -* Decompression robustness. The library/program should be - robust to any corruption of compressed data, detecting and - handling _all_ corruption, instead of merely relying on - the CRCs. What this means is that the program should - never crash, given corrupted data, and the library should - always return BZ_DATA_ERROR. - -* Fixed an obscure race-condition bug only ever observed on - Solaris, in which, if you were very unlucky and issued - control-C at exactly the wrong time, both input and output - files would be deleted. - -* Don't run out of file handles on test/decompression when - large numbers of files have invalid magic numbers. - -* Avoid library namespace pollution. Prefix all exported - symbols with BZ2_. - -* Minor sorting enhancements from my DCC2000 paper. - -* Advance the version number to 1.0, so as to counteract the - (false-in-this-case) impression some people have that programs - with version numbers less than 1.0 are in some way, experimental, - pre-release versions. - -* Create an initial Makefile-libbz2_so to build a shared library. - Yes, I know I should really use libtool et al ... - -* Make the program exit with 2 instead of 0 when decompression - fails due to a bad magic number (ie, an invalid bzip2 header). - Also exit with 1 (as the manual claims :-) whenever a diagnostic - message would have been printed AND the corresponding operation - is aborted, for example - bzip2: Output file xx already exists. - When a diagnostic message is printed but the operation is not - aborted, for example - bzip2: Can't guess original name for wurble -- using wurble.out - then the exit value 0 is returned, unless some other problem is - also detected. - - I think it corresponds more closely to what the manual claims now. - - -1.0.1 -~~~~~ -* Modified dlltest.c so it uses the new BZ2_ naming scheme. -* Modified makefile-msc to fix minor build probs on Win2k. -* Updated README.COMPILATION.PROBLEMS. - -There are no functionality changes or bug fixes relative to version -1.0.0. This is just a documentation update + a fix for minor Win32 -build problems. For almost everyone, upgrading from 1.0.0 to 1.0.1 is -utterly pointless. Don't bother. - - -1.0.2 -~~~~~ -A bug fix release, addressing various minor issues which have appeared -in the 18 or so months since 1.0.1 was released. Most of the fixes -are to do with file-handling or documentation bugs. To the best of my -knowledge, there have been no data-loss-causing bugs reported in the -compression/decompression engine of 1.0.0 or 1.0.1. - -Note that this release does not improve the rather crude build system -for Unix platforms. The general plan here is to autoconfiscate/ -libtoolise 1.0.2 soon after release, and release the result as 1.1.0 -or perhaps 1.2.0. That, however, is still just a plan at this point. - -Here are the changes in 1.0.2. Bug-reporters and/or patch-senders in -parentheses. - -* Fix an infinite segfault loop in 1.0.1 when a directory is - encountered in -f (force) mode. - (Trond Eivind Glomsrod, Nicholas Nethercote, Volker Schmidt) - -* Avoid double fclose() of output file on certain I/O error paths. - (Solar Designer) - -* Don't fail with internal error 1007 when fed a long stream (> 48MB) - of byte 251. Also print useful message suggesting that 1007s may be - caused by bad memory. - (noticed by Juan Pedro Vallejo, fixed by me) - -* Fix uninitialised variable silly bug in demo prog dlltest.c. - (Jorj Bauer) - -* Remove 512-MB limitation on recovered file size for bzip2recover - on selected platforms which support 64-bit ints. At the moment - all GCC supported platforms, and Win32. - (me, Alson van der Meulen) - -* Hard-code header byte values, to give correct operation on platforms - using EBCDIC as their native character set (IBM's OS/390). - (Leland Lucius) - -* Copy file access times correctly. - (Marty Leisner) - -* Add distclean and check targets to Makefile. - (Michael Carmack) - -* Parameterise use of ar and ranlib in Makefile. Also add $(LDFLAGS). - (Rich Ireland, Bo Thorsen) - -* Pass -p (create parent dirs as needed) to mkdir during make install. - (Jeremy Fusco) - -* Dereference symlinks when copying file permissions in -f mode. - (Volker Schmidt) - -* Majorly simplify implementation of uInt64_qrm10. - (Bo Lindbergh) - -* Check the input file still exists before deleting the output one, - when aborting in cleanUpAndFail(). - (Joerg Prante, Robert Linden, Matthias Krings) - -Also a bunch of patches courtesy of Philippe Troin, the Debian maintainer -of bzip2: - -* Wrapper scripts (with manpages): bzdiff, bzgrep, bzmore. - -* Spelling changes and minor enhancements in bzip2.1. - -* Avoid race condition between creating the output file and setting its - interim permissions safely, by using fopen_output_safely(). - No changes to bzip2recover since there is no issue with file - permissions there. - -* do not print senseless report with -v when compressing an empty - file. - -* bzcat -f works on non-bzip2 files. - -* do not try to escape shell meta-characters on unix (the shell takes - care of these). - -* added --fast and --best aliases for -1 -9 for gzip compatibility. - - -1.0.3 (15 Feb 05) -~~~~~~~~~~~~~~~~~ -Fixes some minor bugs since the last version, 1.0.2. - -* Further robustification against corrupted compressed data. - There are currently no known bitstreams which can cause the - decompressor to crash, loop or access memory which does not - belong to it. If you are using bzip2 or the library to - decompress bitstreams from untrusted sources, an upgrade - to 1.0.3 is recommended. This fixes CAN-2005-1260. - -* The documentation has been converted to XML, from which html - and pdf can be derived. - -* Various minor bugs in the documentation have been fixed. - -* Fixes for various compilation warnings with newer versions of - gcc, and on 64-bit platforms. - -* The BZ_NO_STDIO cpp symbol was not properly observed in 1.0.2. - This has been fixed. - - -1.0.4 (20 Dec 06) -~~~~~~~~~~~~~~~~~ -Fixes some minor bugs since the last version, 1.0.3. - -* Fix file permissions race problem (CAN-2005-0953). - -* Avoid possible segfault in BZ2_bzclose. From Coverity's NetBSD - scan. - -* 'const'/prototype cleanups in the C code. - -* Change default install location to /usr/local, and handle multiple - 'make install's without error. - -* Sanitise file names more carefully in bzgrep. Fixes CAN-2005-0758 - to the extent that applies to bzgrep. - -* Use 'mktemp' rather than 'tempfile' in bzdiff. - -* Tighten up a couple of assertions in blocksort.c following automated - analysis. - -* Fix minor doc/comment bugs. - - -1.0.5 (10 Dec 07) -~~~~~~~~~~~~~~~~~ -Security fix only. Fixes CERT-FI 20469 as it applies to bzip2. - - -1.0.6 (6 Sept 10) -~~~~~~~~~~~~~~~~~ - -* Security fix for CVE-2010-0405. This was reported by Mikolaj - Izdebski. - -* Make the documentation build on Ubuntu 10.04 diff --git a/sdk/lib/3rdparty/bzip2/README b/sdk/lib/3rdparty/bzip2/README deleted file mode 100644 index 9fb0f636..00000000 --- a/sdk/lib/3rdparty/bzip2/README +++ /dev/null @@ -1,215 +0,0 @@ - -This is the README for bzip2/libzip2. -This version is fully compatible with the previous public releases. - ------------------------------------------------------------------- -This file is part of bzip2/libbzip2, a program and library for -lossless, block-sorting data compression. - -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward - -Please read the WARNING, DISCLAIMER and PATENTS sections in this file. - -This program is released under the terms of the license contained -in the file LICENSE. ------------------------------------------------------------------- - -Complete documentation is available in Postscript form (manual.ps), -PDF (manual.pdf) or html (manual.html). A plain-text version of the -manual page is available as bzip2.txt. - - -HOW TO BUILD -- UNIX - -Type 'make'. This builds the library libbz2.a and then the programs -bzip2 and bzip2recover. Six self-tests are run. If the self-tests -complete ok, carry on to installation: - -To install in /usr/local/bin, /usr/local/lib, /usr/local/man and -/usr/local/include, type - - make install - -To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type - - make install PREFIX=/xxx/yyy - -If you are (justifiably) paranoid and want to see what 'make install' -is going to do, you can first do - - make -n install or - make -n install PREFIX=/xxx/yyy respectively. - -The -n instructs make to show the commands it would execute, but not -actually execute them. - - -HOW TO BUILD -- UNIX, shared library libbz2.so. - -Do 'make -f Makefile-libbz2_so'. This Makefile seems to work for -Linux-ELF (RedHat 7.2 on an x86 box), with gcc. I make no claims -that it works for any other platform, though I suspect it probably -will work for most platforms employing both ELF and gcc. - -bzip2-shared, a client of the shared library, is also built, but not -self-tested. So I suggest you also build using the normal Makefile, -since that conducts a self-test. A second reason to prefer the -version statically linked to the library is that, on x86 platforms, -building shared objects makes a valuable register (%ebx) unavailable -to gcc, resulting in a slowdown of 10%-20%, at least for bzip2. - -Important note for people upgrading .so's from 0.9.0/0.9.5 to version -1.0.X. All the functions in the library have been renamed, from (eg) -bzCompress to BZ2_bzCompress, to avoid namespace pollution. -Unfortunately this means that the libbz2.so created by -Makefile-libbz2_so will not work with any program which used an older -version of the library. I do encourage library clients to make the -effort to upgrade to use version 1.0, since it is both faster and more -robust than previous versions. - - -HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. - -It's difficult for me to support compilation on all these platforms. -My approach is to collect binaries for these platforms, and put them -on the master web site (http://www.bzip.org). Look there. However -(FWIW), bzip2-1.0.X is very standard ANSI C and should compile -unmodified with MS Visual C. If you have difficulties building, you -might want to read README.COMPILATION.PROBLEMS. - -At least using MS Visual C++ 6, you can build from the unmodified -sources by issuing, in a command shell: - - nmake -f makefile.msc - -(you may need to first run the MSVC-provided script VCVARS32.BAT - so as to set up paths to the MSVC tools correctly). - - -VALIDATION - -Correct operation, in the sense that a compressed file can always be -decompressed to reproduce the original, is obviously of paramount -importance. To validate bzip2, I used a modified version of Mark -Nelson's churn program. Churn is an automated test driver which -recursively traverses a directory structure, using bzip2 to compress -and then decompress each file it encounters, and checking that the -decompressed data is the same as the original. - - - -Please read and be aware of the following: - -WARNING: - - This program and library (attempts to) compress data by - performing several non-trivial transformations on it. - Unless you are 100% familiar with *all* the algorithms - contained herein, and with the consequences of modifying them, - you should NOT meddle with the compression or decompression - machinery. Incorrect changes can and very likely *will* - lead to disastrous loss of data. - - -DISCLAIMER: - - I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE - USE OF THIS PROGRAM/LIBRARY, HOWSOEVER CAUSED. - - Every compression of a file implies an assumption that the - compressed file can be decompressed to reproduce the original. - Great efforts in design, coding and testing have been made to - ensure that this program works correctly. However, the complexity - of the algorithms, and, in particular, the presence of various - special cases in the code which occur with very low but non-zero - probability make it impossible to rule out the possibility of bugs - remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS - PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER - SMALL, THAT THE DATA WILL NOT BE RECOVERABLE. - - That is not to say this program is inherently unreliable. - Indeed, I very much hope the opposite is true. bzip2/libbzip2 - has been carefully constructed and extensively tested. - - -PATENTS: - - To the best of my knowledge, bzip2/libbzip2 does not use any - patented algorithms. However, I do not have the resources - to carry out a patent search. Therefore I cannot give any - guarantee of the above statement. - - - -WHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ? - - * Approx 10% faster compression, 30% faster decompression - * -t (test mode) is a lot quicker - * Can decompress concatenated compressed files - * Programming interface, so programs can directly read/write .bz2 files - * Less restrictive (BSD-style) licensing - * Flag handling more compatible with GNU gzip - * Much more documentation, i.e., a proper user manual - * Hopefully, improved portability (at least of the library) - -WHAT'S NEW IN 0.9.5 ? - - * Compression speed is much less sensitive to the input - data than in previous versions. Specifically, the very - slow performance caused by repetitive data is fixed. - * Many small improvements in file and flag handling. - * A Y2K statement. - -WHAT'S NEW IN 1.0.0 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.2 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.3 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.4 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.5 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.6 ? - - See the CHANGES file. - - -I hope you find bzip2 useful. Feel free to contact me at - jseward@bzip.org -if you have any suggestions or queries. Many people mailed me with -comments, suggestions and patches after the releases of bzip-0.15, -bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, -1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this -feedback. I thank you for your comments. - -bzip2's "home" is http://www.bzip.org/ - -Julian Seward -jseward@bzip.org -Cambridge, UK. - -18 July 1996 (version 0.15) -25 August 1996 (version 0.21) - 7 August 1997 (bzip2, version 0.1) -29 August 1997 (bzip2, version 0.1pl2) -23 August 1998 (bzip2, version 0.9.0) - 8 June 1999 (bzip2, version 0.9.5) - 4 Sept 1999 (bzip2, version 0.9.5d) - 5 May 2000 (bzip2, version 1.0pre8) -30 December 2001 (bzip2, version 1.0.2pre1) -15 February 2005 (bzip2, version 1.0.3) -20 December 2006 (bzip2, version 1.0.4) -10 December 2007 (bzip2, version 1.0.5) - 6 Sept 2010 (bzip2, version 1.0.6) diff --git a/sdk/lib/3rdparty/bzip2/Y2K_INFO b/sdk/lib/3rdparty/bzip2/Y2K_INFO deleted file mode 100644 index 55fd56a2..00000000 --- a/sdk/lib/3rdparty/bzip2/Y2K_INFO +++ /dev/null @@ -1,34 +0,0 @@ - -Y2K status of bzip2 and libbzip2, versions 0.1, 0.9.0 and 0.9.5 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Informally speaking: - bzip2 is a compression program built on top of libbzip2, - a library which does the real work of compression and - decompression. As far as I am aware, libbzip2 does not have - any date-related code at all. - - bzip2 itself copies dates from source to destination files - when compressing or decompressing, using the 'stat' and 'utime' - UNIX system calls. It doesn't examine, manipulate or store the - dates in any way. So as far as I can see, there shouldn't be any - problem with bzip2 providing 'stat' and 'utime' work correctly - on your system. - - On non-unix platforms (those for which BZ_UNIX in bzip2.c is - not set to 1), bzip2 doesn't even do the date copying. - - Overall, informally speaking, I don't think bzip2 or libbzip2 - have a Y2K problem. - -Formally speaking: - I am not prepared to offer you any assurance whatsoever - regarding Y2K issues in my software. You alone assume the - entire risk of using the software. The disclaimer of liability - in the LICENSE file in the bzip2 source distribution continues - to apply on this issue as with every other issue pertaining - to the software. - -Julian Seward -Cambridge, UK -25 August 1999 diff --git a/sdk/lib/3rdparty/freetype/ChangeLog b/sdk/lib/3rdparty/freetype/ChangeLog deleted file mode 100644 index 113dd3c9..00000000 --- a/sdk/lib/3rdparty/freetype/ChangeLog +++ /dev/null @@ -1,663 +0,0 @@ -2016-09-08 Werner Lemberg - - * Version 2.7 released. - ======================= - - - Tag sources with `VER-2-7'. - - * docs/VERSION.TXT: Add entry for version 2.7. - - * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, - builds/windows/vc2005/index.html, - builds/windows/vc2008/freetype.vcproj, - builds/windows/vc2008/index.html, - builds/windows/vc2010/freetype.vcxproj, - builds/windows/vc2010/index.html, - builds/windows/visualc/freetype.dsp, - builds/windows/visualc/freetype.vcproj, - builds/windows/visualc/index.html, - builds/windows/visualce/freetype.dsp, - builds/windows/visualce/freetype.vcproj, - builds/windows/visualce/index.html, - builds/wince/vc2005-ce/freetype.vcproj, - builds/wince/vc2005-ce/index.html, - builds/wince/vc2008-ce/freetype.vcproj, - builds/wince/vc2008-ce/index.html: s/2.6.5/2.7/, s/265/27/. - - * include/freetype/freetype.h (FREETYPE_MINOR): Set to 7. - (FREETYPE_PATCH): Set to 0. - - * builds/unix/configure.raw (version_info): Set to 18:6:12. - * CMakeLists.txt (VERSION_MINOR): Set to 7. - (VERSION_PATCH): Set to 0. - - * docs/CHANGES: Updated. - -2016-09-08 Werner Lemberg - - * src/truetype/ttinterp.c: Include `ttgxvar.h'. - - This fixes the `multi' build. - -2016-09-08 Werner Lemberg - - [autofit] Another improvement to Armenian support. - - Suggested by Hrant H Papazian . - - * src/autofit/afscript.h: Use better suited characters to derive - default stem widths. - -2016-09-07 Alexei Podtelezhnikov - - * src/smooth/ftgrays.c (gray_hline): Microptimize. - -2016-09-06 Alexei Podtelezhnikov - - [smooth] Operate in absolute bitmap coordinates. - - Simpler bitmap addressing improves performance by 1.5%. - - * src/smooth/ftgrays.c (gray_TWorker): Remove count fields. - (gray_dump_cells, gray_find_cell, gray_set_cell, gray_hline, - gray_sweep, gray_convert_glyph, gray_raster_render): Updated. - -2016-09-06 Alexei Podtelezhnikov - - [smooth] Improve contour start (take 2). - - * src/smooth/ftgrays.c (gray_move_to): Call `gray_set_cell' directly - instead of... - (gray_start_cell): ... this function, which is removed. - (gray_convert_glyph): Make initial y-coordinate invalid. - -2016-09-06 Werner Lemberg - - [type1] MM fonts support exactly zero named instances (#48748). - - * src/type1/t1load.c (T1_Get_MM_Var): Set `num_namedstyles' to zero. - -2016-09-06 Jonathan Kew - - [cff] Fix uninitialized memory. - - Problem reported as - - https://bugzilla.mozilla.org/show_bug.cgi?id=1270288 - - * src/cff/cf2interp.c (cf2_interpT2CharString): Initialize `storage' - array to handle a `get' opcode without a previous `put'. - -2016-09-05 Alexei Podtelezhnikov - - * src/smooth/ftgrays.c (gray_move_to, gray_start_cell): Revert. - -2016-09-05 Alexei Podtelezhnikov - - [smooth] Improve contour start. - - * src/smooth/ftgrays.c (gray_move_to): Call `gray_set_cell' directly - instead of... - (gray_start_cell): ... this function, which is removed. - -2016-09-05 Werner Lemberg - - [cff] Fix memory initialization. - - * src/cff/cf2stack.c (cf2_stack_init): Use `FT_NEW'. The `Q' - variants of FreeType's memory allocation macros don't do zeroing. - -2016-09-05 Werner Lemberg - - [ftrandom] Minor improvements. - - * src/tools/ftrandom/ftrandom.c (_XOPEN_SOURCE): New macro, set to - 500. - - * src/tools/ftrandom/Makefile (CFLAGS): Split off include - directories to ... - (INCLUDES): ... this new variable. - (LDFLAGS): New variable. - (ftrandom.o, ftrandom): Updated. - -2016-09-05 Werner Lemberg - - [autofit] Improve Armenian support. - - Thanks to Hrant H Papazian for help. - - * src/autofit/afblue.dat (AF_BLUE_STRING_ARMENIAN_*): Improve - selection of characters. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - -2016-09-04 Werner Lemberg - - [ftrandom] Improve Makefile. - - It now supports both a normal build (`./configure && make') and a - development build (`make devel'). - - * src/tools/ftrandom/Makefile (VPATH): Set it so that - `libfreetype.a' gets searched in both `objs' (for the development - build) and `objs/.libs' (for a normal build which uses libtool). - (LIBS): Add missing libraries. - (ftrandom.o): New rule. - (ftrandom): Use automatic variables. - -2016-09-03 Werner Lemberg - - [truetype] More fixes for handling of GX deltas. - - Problems reported by Bob Taylor . - - * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix rough - sanity test for glyph variation array header size. - Always set stream position before reading packed x and y deltas. - Fix thinko w.r.t. `localpoints' array. - -2016-09-03 Werner Lemberg - - [ftrandom] Various fixes. - - * src/tools/ftrandom/ftrandom.c (GOOD_FONTS_DIR): Provide better - default. - (error_fraction): Make it of type `double' to work as advertized Р- this was completely broken. - Update all related code. - (error_count, fcnt): Make it unsigned to fix compiler warnings. - Update all related code. - (fontlist): Change `len' member to `long' to fix compiler warnings. - (FT_MoveTo, FT_LineTo, FT_ConicTo, FT_CubicTo, abort_test): Tag - unused variables. - (TestFace, FindFonts, copyfont, do_test): Fix compiler warnings. - (ExecuteTest): Ditto. - Call `FT_Done_FreeType'. - (getErrorCnt): Replace `ceil' with an ordinary cast to `unsigned - int'. - (usage): Improve output. - (main): Fix compiler warnings. - - * src/tools/ftrandom/README: Updated. - -2016-09-03 Werner Lemberg - - [base] Avoid negative bitmap stroke dimensions (#48985). - - * src/base/ftobjs.c (FT_Open_Face): Check whether negation was - actually successful. For example, this can fail for value - -32768 if the type is `signed short'. If there are problems, - disable the stroke. - -2016-09-03 Werner Lemberg - - [cff] Avoid null pointer passed to FT_MEM_COPY (#48984). - - * src/cff/cffload.c (cff_index_get_name): Check `byte_len'. - -2016-09-02 Werner Lemberg - - [unix] Enable 64bit support in file system access (#48962). - - * builds/unix/configure.raw: Call `AC_SYS_LARGEFILE'. - -2016-09-02 Werner Lemberg - - [sfnt] Avoid left shift of negative value (#48980). - - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Use unsigned - constant. - -2016-09-02 Werner Lemberg - - * src/smooth/ftgrays.c (gray_hline): Fix clang compiler warnings. - -2016-09-02 Werner Lemberg - - Some preparations for the next release. - - * include/freetype/config/ftoption.h - (TT_CONFIG_OPTION_SUBPIXEL_HINTING): Enable. - - * docs/CHANGES: Updated. - -2016-09-01 Alexei Podtelezhnikov - - [smooth] Simplify span rendering more. - - It turns out that there is significant cost associated with `FT_Span' - creation and calls to `gray_render_span' because it happerns so - frequently. This removes these steps from our internal use but leaves - it alone for `FT_RASTER_FLAG_DIRECT" to preserve API. The speed gain - is about 5%. - - * src/smooth/ftgrays.c (gray_render_span): Removed. The code is - migrated to... - (gray_hline): ... here. - -2016-08-30 Alexei Podtelezhnikov - - [smooth] Streamline pixmap drawing a bit more. - - Zero coverage is unlikely (1 out of 256) to warrant checking. This - gives 0.5% speed improvement in rendering simple glyphs. - - * src/smooth/ftgrays.c (gray_hline, gray_render_span): Remove checks. - -2016-08-29 Alexei Podtelezhnikov - - [smooth] Streamline pixmap drawing. - - This gives 2% speed improvement in rendering simple glyphs. - - * src/smooth/ftgrays.c (TPixmap): Reduced pixmap descriptor with a - pointer to its bottom-left and pitch to be used in... - (gray_TWorker): ... here. - (gray_render_span): Move pixmap flow check from here... - (gray_raster_render): .. to here. - -2016-08-27 Alexei Podtelezhnikov - - [smooth] Reduce stack of band boundaries. - - * src/smooth/ftgrays.c (gray_TBand): Removed. - (gray_convert_glyph): Updated to stack band boundaries concisely. - -2016-08-26 Werner Lemberg - - * src/cid/cidload.c (cid_face_open): Improve handling of `SDBytes'. - -2016-08-26 Werner Lemberg - - [cid] Fix commit from 2016-05-16. - - * src/cid/cidparse.c (cid_parser_new): Fix off-by-one errors. - -2016-08-26 Werner Lemberg - - [sfnt] Cache offset and size to bitmap data table. - - This commit avoids `EBDT' and friends being looked up again and - again while loading a single embedded bitmap. - - * include/freetype/internal/tttypes.h (TT_FaceRec) - [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: New fields `ebdt_start' and - `ebdt_size'. - - * src/sfnt/ttsbit.c (tt_sbit_decoder_init): Move table lookup to ... - (tt_face_load_sbit): ... this function; also store the table size - and offset. - -2016-08-26 Alexei Podtelezhnikov - - * src/smooth/ftgrays.c (gray_raster_render): Minor tweaks. - -2016-08-26 Werner Lemberg - - [type1] Fix heap buffer overflow. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36 - - * src/type1/t1load.c (parse_charstrings): Reject fonts that don't - contain glyph names. - -2016-08-25 Werner Lemberg - - [sfnt] Fix previous commit (#48901). - - * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary): Thinkos. - -2016-08-25 Werner Lemberg - - [sfnt] Speed up handling of invalid format 4 cmaps. - - * src/sfnt/ttcmap.c (tt_cmap4_next, tt_cmap4_char_map_binary): Add - tests for `num_glyph' from `tt_cmap4_char_map_linear'. - -2016-08-25 Werner Lemberg - - * include/freetype/internal/ftdriver.h: Remove unused typedefs. - -2016-08-22 Alexei Podtelezhnikov - - [smooth] Simplify span rendering. - - This removes unnecessary complexity of span merging and buffering. - Instead, the spans are rendered as they come, speeding up the - rendering by about 5% as a result. - - * src/smooth/ftgrays.c [FT_MAX_GRAY_SPANS]: Macro removed. - (gray_TWorker): Remove span buffer and related fields. - (gray_sweep, gray_hline): Updated. - - * include/freetype/ftimage.h: Remove documentation note about - `FT_MAX_GRAY_SPANS', which was never in `ftoption.h' and is now gone. - -2016-08-16 Werner Lemberg - - [truetype] Fix `MPS' instruction. - - According to Greg Hitchcock, MPS in DWrite really returns the point - size. - - * src/truetype/ttobjs.h (TT_SizeRec): Add `point_size' member. - - * src/truetype/ttdriver.c (tt_size_request): Set `point_size'. - - * src/truetype/ttinterp.h (TT_ExecContextRec): Add `pointSize' - member. - - * src/truetype/ttinterp.c (TT_Load_Context): Updated. - (Ins_MPS): Fix instruction. - -2016-08-16 Werner Lemberg - - [lzw] Optimize last commit. - - * src/lzw/ftzopen.c (ft_lzwstate_get_code): Move check into - conditional clause. - -2016-08-16 Werner Lemberg - - [lzw] Avoid invalid left shift. - - Reported as - - https://bugzilla.mozilla.org/show_bug.cgi?id=1295366 - - * src/lzw/ftzopen.c (ft_lzwstate_get_code): Limit `num_bits'. - -2016-08-16 Werner Lemberg - - [lzw] Avoid buffer overrun. - - Reported as - - https://bugzilla.mozilla.org/show_bug.cgi?id=1273283 - - * src/lzw/ftzopen.c (ft_lzwstate_refill): Ensure `buf_size' doesn't - underflow. - -2016-08-16 Werner Lemberg - - [truetype] Fix compiler warning. - - * src/truetype/ttgload.c (load_truetype_glyph): Add cast. - -2016-08-13 Werner Lemberg - - [winfonts] Avoid zero bitmap width and height. - - Reported as - - https://bugzilla.mozilla.org/show_bug.cgi?id=1272173 - - * src/winfonts/winfnt.c (FNT_Face_Init): Check zero pixel height. - (FNT_Load_Glyph): Check for zero pitch. - -2016-08-11 Alexei Podtelezhnikov - - * src/truetype/ttinterp.c (Pop_Push_Count): Revert changes. - -2016-08-11 Alexei Podtelezhnikov - - * src/truetype/ttinterp.c (TT_RunIns): Minor and formatting. - -2016-08-11 Alexei Podtelezhnikov - - * src/truetype/ttinterp.c (Pop_Push_Count): Fix some entries. - -2016-08-10 Peter Klotz - - * src/smooth/ftgrays.c (gray_hline): Fix uninitialized access. - -2016-08-10 Werner Lemberg - - [sfnt] Use correct type for `italicAngle' field (#48732). - - * src/sfnt/ttload.c (tt_face_load_post): Fix types. - -2016-08-06 Jon Spencer - - [sfnt] Fix `FT_Get_Advance' for bitmap strikes. - - `FT_Get_Advance' returns 0 for bitmap fonts. It first gets the - advance value from the font table and then scales it by the - `font->size->metrics->x_scale' field. But `FT_Select_Size' doesn't - set that value for bitmap fonts and the advance gets scaled to zero. - - Taken from - - https://github.com/behdad/harfbuzz/issues/252 - - * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) - : Set scale values. - -2016-08-06 Behdad Esfahbod - - [truetype] Fix GX variation handling of composites. - - * src/truetype/ttgload.c (load_truetype_glyph) - [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Check `ARGS_ARE_XY_VALUES' flag. - -2016-08-05 Alexei Podtelezhnikov - - [smooth] Minor refactoring. - - * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line): - Updated. - -2016-07-29 Werner Lemberg - - [sfnt, truetype] Don't abort on invalid `maxComponentDepth'. - - Since 2016-05-16 we detect infinite recursion directly. - - * src/sfnt/ttload.c (tt_face_load_maxp): Don't adjust - `maxComponentDepth'. - * src/truetype/ttgload.c (load_truetype_glyph): Don't abort if - `maxComponentDepth' is not valid. Instead, simply adjust its value - and emit a tracing message. - -2016-07-26 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Minor. - - No functional change. - -2016-07-22 Hin-Tak Leung - - [truetype] Record the end of IDEFs. - - To match the logic in FDEF. The value of the end is only used for - bound-checking in `Ins_JMPR', so it may not have been obvious that - it was not recorded. Tested (as part of Font Validator 2.0) all the - fonts on Fedora and did not see any change. - - * src/truetype/ttinterp.c (Ins_IDEF): Updated. - -2016-07-19 Werner Lemberg - - [truetype] Sanitizer fix, second try. - - * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary - tests and use only one slot more. - -2016-07-19 Werner Lemberg - - [truetype] Sanitizer fix. - - * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Increase array - to fix nested loops. - -2016-07-18 Werner Lemberg - - [truetype] Make GETDATA work only for GX fonts. - - * src/truetype/ttinterp.c (opcode_name): Updated. - (Ins_GETDATA): Only define for `TT_CONFIG_OPTION_GX_VAR_SUPPORT'. - (TT_RunIns): Updated. - -2016-07-17 Werner Lemberg - - [truetype] Add support for Apple's - - GETDATA[], opcode 0x92 - - bytecode instruction. It always returns 17, and we have absolutely - no idea what it is good for... - - * src/truetype/ttinterp.c (Pop_Push_Count, opcode_name): Updated. - (Ins_GETDATA): New function. - (TT_RunIns): Add it. - -2016-07-16 Werner Lemberg - - [truetype] Add bytecode support for GX variation fonts. - - This commit implements undocumented (but confirmed) stuff from - Apple's old bytecode engine. - - GETVARIATION[], opcode 0x91 - This opcode pushes normalized variation coordinates for all axes - onto the stack (in 2.14 format). Coordinate of first axis gets - pushed first. - - GETINFO[], selector bit 3 - If GX variation support is enabled, bit 10 of the result is set - to 1. - - * src/truetype/ttinterp.c: Include FT_MULTIPLE_MASTERS_H. - (opcode_name) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated. - (Ins_GETINFO) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Handle selector - bit 3, checking support for variation glyph hinting. - (Ins_GETVARIATION) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New function - to implement opcode 0x91. - (TT_RunIns) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Handle opcode 0x91. - -2016-07-16 Werner Lemberg - - [truetype] Fix GETINFO bytecode instruction. - - * src/truetype/ttinterp.c (Ins_GETINFO): Fix return value for - stretching information. - -2016-07-16 Behdad Esfahbod - - [truetype] Make all glyphs in `Zycon' GX font work. - - * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary - tests. - -2016-07-16 Werner Lemberg - - [truetype] Fix GX delta tracing. - - * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Trace - relative point movements. - -2016-07-16 Behdad Esfahbod - - [truetype] More fixes for GX. - - This finally fixes the rendering of the cyclist and the lizard in - the `Zycon' font. - - * src/truetype/ttgxvar.c (ft_var_readpackedpoints): `first' point - index is always cumulative. - - (tt_handle_deltas): Rename to... - (tt_interpolate_deltas): ... This. - Add new parameter for output point array. - Update caller. - - (TT_Vary_Apply_Glyph_Deltas): Add `points_out' array; it now holds - the intermediate results of `tt_interpolate_deltas' that are to be - added to `outline->points'. - -2016-07-15 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_hints_compute_segments): Thinko. - - `max_pos' is always larger than `min_pos' so `FT_ABS' is not needed. - - Reported by Alexei. - -2016-07-16 Nikolaus Waxweiler - - * src/truetype/ttinterp.c (Ins_MIRP): Fix copy-and-paste error. - - Problem reported by Hin-Tak Leung. - -2016-07-15 Werner Lemberg - - [autofit] Update and improve segment and edge tracing. - - * src/autofit/afhints.c (af_glyph_hints_dump_segments): Trace - `delta' also. - Don't show first point of segment as a replacement for `pos'; this - is (a) misleading, since the difference to `pos' can be almost - arbitrarily large in corner cases, and (b) it is better to have all - segment data in font units instead of a single value given in output - space coordinates. - Improve layout. - (af_glyph_hints_dump_edges): Show px->units and units->px conversion - values for convenience. - Improve layout. - -2016-07-15 Werner Lemberg - - [autofit] For edges, reject segments wider than 1px (#41334). - - * src/autofit/afhints.h (AF_SegmentRec): New member `delta'. - - * src/autofit/aflatin.c (af_latin_hints_compute_segments): Compute - `delta'. - (af_latin_hints_compute_edges): Reject segments with a delta larger - than 0.5px. - -2016-07-14 Werner Lemberg - - * include/freetype/freetype.h (FT_IS_NAMED_INSTANCE): New macro. - -2016-07-14 Werner Lemberg - - [sfnt] Fix `face_index' value in `FT_Face' for named instances. - - * src/sfnt/sfobjc.s (sfnt_init_face): Don't strip off higher 16bits. - -2016-07-14 Werner Lemberg - - * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix tracing. - -2016-07-14 Behdad Esfahbod - - [truetype] Fix gxvar delta interpolation. - - The coordinates of the base font should be used for interpolation - purposes, NOT the current points (i.e., the result of accumulation - of previous deltas). - - * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Initialize - `points_org' before looping over all tuples. - - ----------------------------------------------------------------------------- - -Copyright 2016 by -David Turner, Robert Wilhelm, and Werner Lemberg. - -This file is part of the FreeType project, and may only be used, modified, -and distributed under the terms of the FreeType project license, -LICENSE.TXT. By continuing to use, modify, or distribute this file you -indicate that you have read the license and understand and accept it -fully. - - -Local Variables: -version-control: never -coding: utf-8 -End: diff --git a/sdk/lib/3rdparty/freetype/src/tools/ftrandom/README b/sdk/lib/3rdparty/freetype/src/tools/ftrandom/README index 7c610864..03d14766 100644 --- a/sdk/lib/3rdparty/freetype/src/tools/ftrandom/README +++ b/sdk/lib/3rdparty/freetype/src/tools/ftrandom/README @@ -65,5 +65,5 @@ Two possible solutions. . Run ftrandom within a debugging tool like `valgrind' to catch various memory issues. -. Compile FreeType with sanitizer flags as provided by gcc or clang, for +. Compile FreeType with sanitizer flags as provided by gcc, for example, then link it with ftrandom. diff --git a/sdk/lib/3rdparty/stlport/INSTALL b/sdk/lib/3rdparty/stlport/INSTALL deleted file mode 100644 index 8617ef9f..00000000 --- a/sdk/lib/3rdparty/stlport/INSTALL +++ /dev/null @@ -1,166 +0,0 @@ -********************************************************************** -* INSTALL file for STLport * -* * -********************************************************************** - -STLport is a full ANSI C++ Standard library. - -This distribution contains STLport sources only, no binaries. -To use STLport iostreams, locale and complex numbers, you have to build STLport -library from sources in "build/lib" directory and link your programs with it. - -Starting with 5.0 the 'wrapper' mode is not supported anymore. You cannot use native -compiler iostreams implementation with STLport STL (see doc/FAQ for explanations). -Now you have to choose between STLport iostreams or no iostreams. - -==== Unpacking and installing STLport ========== - -1) Unpack STLport archive to a directory accessible during compilation. - NOTE: DO NOT overwrite header files coming with the compiler, even if you made - a backup - this won't work! Most probably, you've already unpacked the archive before - reading this file though ;) - -2) Make sure "stlport" directory of this distribution comes before compiler's one - in your include paths when you compile the project. - - Note: for SunPro CC 5.0 and higher, there used to be special directory "stlport/SC5" - this is now obsolete, please make sure you do not use it anymore. - -3) Make sure you do not rename this "stlport" subdirectory - - that may result in compilation errors. - - NOTE: Your compiler should be recognized by STLport source code with no configuring. - Please edit appropriate configuration header for your compiler - directly if you have to make compiler-specific configuration changes - (see stlport/stl/config). - -4) Run: - - configure --help - - Depending on your environment, Windows command shell or Unix like shell, - configure.bat or configure script will be run respectively. For Windows users - running configure script is mandatory in order to declare the compiler you are - going to use. - -5) Go to "build/lib" subdirectory. It contains various makefiles for different - compilers and 'make' utilities (GNU Make and Microsoft's nmake supported). - - Verify you can do command line compiles. IDE users may have to do something - special, like add environment variables (for Microsoft) or install - additional compiler components (for Metrowerks), before they can use their - command line compilers (see doc/README.xxxx for additionnal information). - - configure script should have already created a Makefile file so that you only - have to call 'make' or 'nmake' (for some platforms GNU make might be hidden - behind 'gmake'). - - IMPORTANT: - - If you DO NOT plan to use STLport iostreams and/or locale implementation but just - the STL, you do not have to build the library. - - If you have decided to disable STLport iostreams and locale using _STLP_NO_IOSTREAMS - configuration macro in stlport/stl/config/user_config.h, you may stop reading here. - - -==== Building STLport iostreams library ========== - -Below are step-by-step instructions to build STLport streams library. This is a general -build process description, for a more detailed one check README files in the doc folder: - -5) Using appropriate make command (make or nmake), do - - make clean install - - to build the STLport libraries. Make files are set up to build several different - flavors - debug/nondebug, static/dynamic versions. But not all flavors will be build - by default. See build/lib/README for other make targets. - - Note: 'install' target work slightly different than usual - it installs libraries into - /lib and bin catalogs, NOT IN SYSTEM CATALOG. You can do the system - install by just copying stlport and lib folder to the destination of your choise. For - example on UNIX-like platforms this can be done with the following commands: - - su - tar cf - stlport | (cd /usr/local/include; tar xf -) - chmod -R a+r /usr/local/include/stlport - chown -R root:root /usr/local/include/stlport - (cd lib; tar cf - --exclude=CVS --exclude=.cvsignore .) | (cd /usr/local/lib; tar xf -) - chown -R root:root /usr/local/lib/libstlport* - exit - - Note: System install is optional, most of compilers/linkers support searching for includes - and libs throught out the whole filesystem, just check your documentation on how to achieve - this. - - If you use cross-compiler, you can find libraries in the /lib/ - catalog. - -6) If build fails, you may choose to : - - try fixing the build ;) - - wait until somebody else will submit corresponding changes to be incorporated in next STLport - release/snapshot. - - In case you do patch STLport, please submit your patches to - https://sourceforge.net/tracker/?atid=766246&group_id=146814&func=browse - -==== Linking your application with STLport library ========== - -7) Check the build: - - Example: - - - under Linux and other Unixes: - - cd build/test/unit - make install - ../../../bin/stl_unit_test - ../../../bin-g/stl_unit_test - - - under Windows: - - cd build\test\unit - nmake install - cd ..\..\..\bin - stl_unit_test - stl_unit_testd - stl_unit_teststld - -8) Supply the "lib" subdirectory to the library search path and add desired - library to the list of libraries to link with. - Examples (imagine you have mytest.cpp in the same directory as this file is): - With GCC : g++ -pthread -I./stlport mytest.cpp -L./lib/ -lstlport - With DEC CC : cxx -I./stlport mytest.cpp -L./lib/ -lstlport - With SUN CC : CC -mt -I./stlport mytest.cpp -L./lib/ -lstlport - ..... - For several compilers supporting auto linking feature (VC++, Borland, DMC), - you do not have to specify "stlport.M.m.lib" explicitly, as it is being choosen - and forced to link automatically by "#pragma"'s in compiler config files - Appropriate version is being selected based on compiler options and _STLP_DEBUG - setting. All you have to do is to set library search path for the linker. - - Example : - cl.exe /I.\stlport mytest.cpp /link /libpath:.\lib /MD - -9) If you linked your application with shared STLport library (.so or .dll), please - make suze that your .so or .dll can be found by the dynamic linker. - Under Windows, the paths searched depend on the particular flavor, see the MSDN - documentation for LoadLibrary at http://msdn.microsoft.com. The easiest ways are to - either modify the PATH environment variable or copy all .dll's next to the - executable like it is done per default when unit tests executable are put next - to dlls. - Under Linux, the environment variable LD_LIBRARY_PATH can be adjusted to point - to the dir containing .so. See the manpage for ld.so for more info. - -10) STLport builds only multithreaded libraries, so your application should be compiled - as multithreaded, too. Use -pthread (or -pthreads on Solaris) option for GCC, -mt for SunPro, - /MT for VC, and so on. Sometimes you should define _REENTRANT or something else, depends - upon platform/compiler. See compiler's and linker's options on command line when you build - unit tests (build/test/unit) for reference. The last is useful for ANY platform. - -11) Don't hesitate to read READMEs (doc/README*, build/lib/README*, build/test/unit/README*) - and doc/FAQ. - -12) Have fun! - diff --git a/sdk/lib/3rdparty/stlport/INSTALL.unixes b/sdk/lib/3rdparty/stlport/INSTALL.unixes deleted file mode 100644 index f9b2e21c..00000000 --- a/sdk/lib/3rdparty/stlport/INSTALL.unixes +++ /dev/null @@ -1,120 +0,0 @@ -********************************************************************** -* INSTALL file for STLport 5.2 * -* * -********************************************************************** - -STLport is a full ANSI C++ Standard library. - -This distribution contains STLport sources only, no binaries. -To use STLport iostreams, locale and complex numbers, you have -to build STLport library from sources and link your programs with it. - -Starting with 5.0 the 'wrapper' mode is not supported anymore. -You cannot use native compiler iostreams implementation with STLport STL -(see doc/FAQ for explanations). - -==== Installing STLport ========== - -0) DO NOT overwrite/move/rename header files coming with the compiler, - even if you made a backup---STLport need this headers and don't - override ones. - -1) Run - - ./configure --help - - read options description; if you use compiler - different from gcc, pay attention to --use-compiler-family= option. - -2) Run - - ./configure