diff --git a/build/jam/HaikuCD b/build/jam/HaikuCD index e88ba3bf90..d77e752d90 100644 --- a/build/jam/HaikuCD +++ b/build/jam/HaikuCD @@ -28,8 +28,6 @@ AddVariableToScript $(script) : isCD : 1 ; AddVariableToScript $(script) : cdLabel : $(HAIKU_CD_LABEL) ; AddVariableToScript $(script) : addBuildCompatibilityLibDir : $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ; -AddVariableToScript $(script) : stripOptionalPackageDebugSymbols - : $(HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES) ; AddTargetVariableToScript $(script) : addattr ; AddTargetVariableToScript $(script) : copyattr ; AddTargetVariableToScript $(script) : rc ; diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index b19863e4d1..67fc6122aa 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -904,8 +904,6 @@ AddVariableToScript $(script) : addBuildCompatibilityLibDir : $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ; AddVariableToScript $(script) : dontClearImage : $(HAIKU_DONT_CLEAR_IMAGE) ; AddVariableToScript $(script) : updateOnly : [ IsUpdateHaikuImageOnly ] ; -AddVariableToScript $(script) : stripOptionalPackageDebugSymbols - : $(HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES) ; AddTargetVariableToScript $(script) : addattr ; AddTargetVariableToScript $(script) : bfs_shell : bfsShell ; AddTargetVariableToScript $(script) : fs_shell_command : fsShellCommand ; diff --git a/build/jam/ImageRules b/build/jam/ImageRules index 48ebb82b6e..c2275408d3 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -283,16 +283,17 @@ rule CopyDirectoryToContainer container : directoryTokens : sourceDirectory } rule ExtractArchiveToContainer container : directoryTokens : archiveFile - : extractedSubDir + : extractedSubDir : stripDebugSymbols { # ExtractArchiveToContainer : : - # : ; + # : : ; local directory = [ AddDirectoryToContainer $(container) : $(directoryTokens) ] ; ARCHIVE_FILES_TO_INSTALL on $(directory) += $(archiveFile) ; ARCHIVE_SUBDIR_TO_INSTALL_FROM on $(archiveFile) = $(extractedSubDir) ; + ARCHIVE_FILES_TO_STRIP on $(archiveFile) = $(stripDebugSymbols) ; } rule AddDriversToContainer container : relativeDirectoryTokens : targets @@ -607,6 +608,11 @@ rule CreateContainerExtractFilesScript container : script ARCHIVE_SUBDIR_TO_INSTALL_FROM on $(dummyTarget) = $(extractedSubDir:E=.) ; + local stripDebugSymbols = [ on $(archiveFile) + return $(ARCHIVE_FILES_TO_STRIP) ] ; + STRIP_DEBUG_SYMBOLS_FROM_ARCHIVE on $(dummyTarget) = + $(stripDebugSymbols) ; + Depends $(dummyTarget) : $(initScript) $(archiveFile) $(serializationDependency) ; Depends $(script) : $(dummyTarget) ; @@ -622,7 +628,8 @@ rule CreateContainerExtractFilesScript container : script actions AddExtractFileToContainerExtractFilesScript { echo extractFile "\"$(2[2])\"" "\"$(TARGET_DIR)\"" \ - "\"$(ARCHIVE_SUBDIR_TO_INSTALL_FROM)\"" >> $(2[1]) + "\"$(ARCHIVE_SUBDIR_TO_INSTALL_FROM)\"" \ + "\"$(STRIP_DEBUG_SYMBOLS_FROM_ARCHIVE)\"" >> $(2[1]) } @@ -729,7 +736,7 @@ rule AddWifiFirmwareToHaikuImage driver : package : archive : extract } rule ExtractArchiveToHaikuImage dirTokens : archiveFile : alwaysUpdate - : extractedSubDir + : extractedSubDir : stripDebugSymbols { # ExtractArchiveToHaikuImage : : # : ; @@ -738,7 +745,7 @@ rule ExtractArchiveToHaikuImage dirTokens : archiveFile : alwaysUpdate # requested. if ! [ IsUpdateHaikuImageOnly ] || $(alwaysUpdate) { ExtractArchiveToContainer $(HAIKU_IMAGE_CONTAINER_NAME) : $(dirTokens) - : $(archiveFile) : $(extractedSubDir) ; + : $(archiveFile) : $(extractedSubDir) : $(stripDebugSymbols) ; } } @@ -825,6 +832,7 @@ rule InstallSourceArchive file : url } rule InstallOptionalHaikuImagePackage package : url : dirTokens : isCDPackage + : stripDebugSymbols { # download archive file local archiveFile = [ DownloadFile $(package) : $(url) ] ; @@ -835,8 +843,17 @@ rule InstallOptionalHaikuImagePackage package : url : dirTokens : isCDPackage # copy onto image AddFilesToHaikuImage _packages_ : $(archiveFile) ; } else { + if $(HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES) = 1 { + stripDebugSymbols ?= 1 ; + # The script will only test for = 1. This is in case someone + # manually set the flag 'true' + if $(stripDebugSymbols) = true { + stripDebugSymbols = 1 ; + } + } # extract onto image - ExtractArchiveToHaikuImage $(dirTokens) : $(archiveFile) ; + ExtractArchiveToHaikuImage $(dirTokens) : $(archiveFile) + : : : $(stripDebugSymbols) ; } } @@ -1472,7 +1489,7 @@ actions BuildCDBootPPCImage1 bind MAPS || \ genisoimage -v -hfs -part -map $(MAPS) -no-desktop -hfs-volid bootimg \ -V bootimg -hfs-bless $(HAIKU_OUTPUT_DIR)/cd/ppc -prep-boot \ - ppc/$(>[2]:D=) -r -o $(<) $(HAIKU_OUTPUT_DIR)/cd + ppc/$(>[2]:D=) -r -o $(<) $(HAIKU_OUTPUT_DIR)/cd #$(RM) -R $(HAIKU_OUTPUT_DIR)/cd } diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages index 9541517d35..592acfdad1 100644 --- a/build/jam/OptionalPackages +++ b/build/jam/OptionalPackages @@ -848,7 +848,7 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentMin ] && $(TARGET_ARCH) = x86 { AddHeaderDirectoryToHaikuImage libs tiff : 3rdparty ; AddHeaderDirectoryToHaikuImage libs zlib : 3rdparty ; - CopyDirectoryToHaikuImage develop headers : + CopyDirectoryToHaikuImage develop headers : [ FDirName $(HAIKU_FREETYPE_DIR) develop headers 3rdparty ] ; CopyDirectoryToHaikuImage develop headers : $(HAIKU_JPEG_HEADERS) : 3rdparty ; @@ -2050,11 +2050,13 @@ if [ IsOptionalHaikuImagePackageAdded wpa_supplicant ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage wpa_supplicant-0.7.3-x86-gcc4-2012-04-03.zip - : $(baseURL)/wpa_supplicant-0.7.3-x86-gcc4-2012-04-03.zip ; + : $(baseURL)/wpa_supplicant-0.7.3-x86-gcc4-2012-04-03.zip + : : : false ; } else { InstallOptionalHaikuImagePackage wpa_supplicant-0.7.3-x86-gcc2-2012-04-03.zip - : $(baseURL)/wpa_supplicant-0.7.3-x86-gcc2-2012-04-03.zip ; + : $(baseURL)/wpa_supplicant-0.7.3-x86-gcc2-2012-04-03.zip + : : : false ; } } diff --git a/build/jam/ReleaseBuildProfiles b/build/jam/ReleaseBuildProfiles index 8857651666..8de37d93db 100644 --- a/build/jam/ReleaseBuildProfiles +++ b/build/jam/ReleaseBuildProfiles @@ -16,6 +16,7 @@ switch $(HAIKU_BUILD_PROFILE) { HAIKU_ROOT_USER_REAL_NAME = "Yourself" ; AddGroupToHaikuImage party : 101 : user sshd ; HAIKU_IMAGE_HOST_NAME = shredder ; + HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES = 1 ; HAIKU_IMAGE_SIZE = 800 ; AddOptionalHaikuImagePackages TimGMSoundFont TrackerNewTemplates @@ -37,6 +38,7 @@ switch $(HAIKU_BUILD_PROFILE) { HAIKU_ROOT_USER_NAME = user ; HAIKU_ROOT_USER_REAL_NAME = "Yourself" ; AddGroupToHaikuImage party : 101 : user sshd ; + HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES = 1 ; HAIKU_IMAGE_HOST_NAME = shredder ; HAIKU_IMAGE_SIZE = 600 ; diff --git a/build/jam/UserBuildConfig.ReadMe b/build/jam/UserBuildConfig.ReadMe index d1c9eb172d..637de80f67 100644 --- a/build/jam/UserBuildConfig.ReadMe +++ b/build/jam/UserBuildConfig.ReadMe @@ -63,6 +63,7 @@ HAIKU_IMAGE_DIR = /tmp ; HAIKU_IMAGE_SIZE = 100 ; # Enable stripping the debug symbols from optional packages. +# Note, some optional packages may override this to prevent stripping. HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES = 1 ; # Set image volume label to "Walter". Default label is "Haiku". diff --git a/build/scripts/build_haiku_image b/build/scripts/build_haiku_image index d6001f9d19..155e5f6876 100755 --- a/build/scripts/build_haiku_image +++ b/build/scripts/build_haiku_image @@ -16,7 +16,6 @@ set -o errexit # dontClearImage # isVMwareImage # optionalPackageDescriptions -# stripOptionalPackageDebugSymbols # # addattr # copyattr @@ -158,10 +157,11 @@ stripDebugInfo() extractFile() { - # extractFile + # extractFile archiveFile=$1 targetExtractedDir=$2 extractedSubDir=$3 + stripDebugSymbols=$4 echo "Extracting $archiveFile ..." @@ -188,7 +188,7 @@ extractFile() rm $extractDir/.OptionalPackageDescription fi - if [ "$stripOptionalPackageDebugSymbols" = "1" ]; then + if [ "$stripDebugSymbols" = "1" ]; then # strip executables in common/bin if [ -d $extractDir/common/bin ]; then for file in `find $extractDir/common/bin -type f -a -perm +100 \ diff --git a/headers/private/shared/cpu_type.h b/headers/private/shared/cpu_type.h index 7a4f7f6d01..c9454230d7 100644 --- a/headers/private/shared/cpu_type.h +++ b/headers/private/shared/cpu_type.h @@ -192,6 +192,8 @@ get_cpu_model_string(system_info *info) return "604"; case B_CPU_PPC_604e: return "604e"; + default: + return NULL; #endif /* __POWERPC__ */ #if __INTEL__ case B_CPU_x86: @@ -395,7 +397,6 @@ get_cpu_model_string(system_info *info) /* National Semiconductor */ case B_CPU_NATIONAL_GEODE_GX1: return "Geode GX1"; -#endif /* __INTEL__ */ default: if ((info->cpu_type & B_CPU_x86_VENDOR_MASK) == B_CPU_INTEL_x86) { @@ -404,6 +405,7 @@ get_cpu_model_string(system_info *info) return parse_intel(cpuidName); } return NULL; +#endif /* __INTEL__ */ } } diff --git a/src/add-ons/kernel/drivers/audio/hda/driver.h b/src/add-ons/kernel/drivers/audio/hda/driver.h index c4799b27f3..615290379a 100644 --- a/src/add-ons/kernel/drivers/audio/hda/driver.h +++ b/src/add-ons/kernel/drivers/audio/hda/driver.h @@ -70,6 +70,7 @@ struct hda_controller { area_id regs_area; vuint8* regs; uint32 irq; + bool msi; uint16 codec_status; uint32 num_input_streams; diff --git a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp index 350e36a994..da9408eb11 100644 --- a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp +++ b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp @@ -12,6 +12,8 @@ #include +#include + #include "driver.h" #include "hda_codec_defs.h" @@ -52,6 +54,8 @@ static const struct { // {B_SR_384000, MAKE_RATE(44100, ??, ??), 384000}, }; +static pci_x86_module_info* sPCIx86Module; + static inline void update_pci_register(hda_controller* controller, uint8 reg, uint32 mask, uint32 value, uint8 size) @@ -797,7 +801,7 @@ hda_hw_init(hda_controller* controller) uint16 capabilities, stateStatus, cmd; status_t status; - /* Map MMIO registers */ + // Map MMIO registers controller->regs_area = map_physical_memory("hda_hw_regs", controller->pci_info.u.h0.base_registers[0], controller->pci_info.u.h0.base_register_sizes[0], B_ANY_KERNEL_ADDRESS, @@ -808,7 +812,8 @@ hda_hw_init(hda_controller* controller) } cmd = (gPci->read_pci_config)(controller->pci_info.bus, - controller->pci_info.device, controller->pci_info.function, PCI_command, 2); + controller->pci_info.device, controller->pci_info.function, + PCI_command, 2); if (!(cmd & PCI_command_master)) { (gPci->write_pci_config)(controller->pci_info.bus, controller->pci_info.device, controller->pci_info.function, @@ -816,18 +821,42 @@ hda_hw_init(hda_controller* controller) dprintf("hda: enabling PCI bus mastering\n"); } - /* Absolute minimum hw is online; we can now install interrupt handler */ + if (get_module(B_PCI_X86_MODULE_NAME, (module_info**)&sPCIx86Module) + != B_OK) + sPCIx86Module = NULL; + + // Absolute minimum hw is online; we can now install interrupt handler + controller->irq = controller->pci_info.u.h0.interrupt_line; + controller->msi = false; + + if (sPCIx86Module != NULL && sPCIx86Module->get_msi_count( + controller->pci_info.bus, controller->pci_info.device, + controller->pci_info.function) >= 1) { + // Try MSI first + uint8 vector; + if (sPCIx86Module->configure_msi(controller->pci_info.bus, + controller->pci_info.device, controller->pci_info.function, + 1, &vector) == B_OK + && sPCIx86Module->enable_msi(controller->pci_info.bus, + controller->pci_info.device, controller->pci_info.function) + == B_OK) { + dprintf("hda: using MSI vector %u\n", vector); + controller->irq = vector; + controller->msi = true; + } + } + status = install_io_interrupt_handler(controller->irq, (interrupt_handler)hda_interrupt_handler, controller, 0); if (status != B_OK) goto no_irq; - /* TCSEL is reset to TC0 (clear 0-2 bits) */ + // TCSEL is reset to TC0 (clear 0-2 bits) update_pci_register(controller, PCI_HDA_TCSEL, PCI_HDA_TCSEL_MASK, 0, 1); - /* Enable snooping for ATI and Nvidia, right now for all their hda-devices, - but only based on guessing. */ + // Enable snooping for ATI and Nvidia, right now for all their hda-devices, + // but only based on guessing. switch (controller->pci_info.vendor_id) { case NVIDIA_VENDORID: update_pci_register(controller, NVIDIA_HDA_TRANSREG, @@ -854,7 +883,7 @@ hda_hw_init(hda_controller* controller) controller->num_output_streams = GLOBAL_CAP_OUTPUT_STREAMS(capabilities); controller->num_bidir_streams = GLOBAL_CAP_BIDIR_STREAMS(capabilities); - /* show some hw features */ + // show some hw features dprintf("hda: HDA v%d.%d, O:%ld/I:%ld/B:%ld, #SDO:%d, 64bit:%s\n", controller->Read8(HDAC_VERSION_MAJOR), controller->Read8(HDAC_VERSION_MINOR), @@ -863,29 +892,27 @@ hda_hw_init(hda_controller* controller) GLOBAL_CAP_NUM_SDO(capabilities), GLOBAL_CAP_64BIT(capabilities) ? "yes" : "no"); - /* Get controller into valid state */ + // Get controller into valid state status = reset_controller(controller); if (status != B_OK) { dprintf("hda: reset_controller failed\n"); goto reset_failed; } - /* Setup CORB/RIRB/DMA POS */ + // Setup CORB/RIRB/DMA POS status = init_corb_rirb_pos(controller); if (status != B_OK) { dprintf("hda: init_corb_rirb_pos failed\n"); goto corb_rirb_failed; } - /* - * Don't enable codec state change interrupts. We don't handle - * them, as we want to use the STATE_STATUS register to identify - * available codecs. We'd have to clear that register in the interrupt - * handler to 'ack' the codec change. - */ + // Don't enable codec state change interrupts. We don't handle + // them, as we want to use the STATE_STATUS register to identify + // available codecs. We'd have to clear that register in the interrupt + // handler to 'ack' the codec change. controller->Write16(HDAC_WAKE_ENABLE, 0x0); - /* Enable controller interrupts */ + // Enable controller interrupts controller->Write32(HDAC_INTR_CONTROL, INTR_CONTROL_GLOBAL_ENABLE | INTR_CONTROL_CONTROLLER_ENABLE); @@ -939,6 +966,11 @@ no_irq: controller->regs_area = B_ERROR; controller->regs = NULL; + if (sPCIx86Module != NULL) { + put_module(B_PCI_X86_MODULE_NAME); + sPCIx86Module = NULL; + } + error: dprintf("hda: ERROR: %s(%ld)\n", strerror(status), status); @@ -952,7 +984,7 @@ hda_hw_stop(hda_controller* controller) { int index; - /* Stop all audio streams */ + // Stop all audio streams for (index = 0; index < HDA_MAX_STREAMS; index++) { if (controller->streams[index] && controller->streams[index]->running) hda_stream_stop(controller, controller->streams[index]); @@ -969,7 +1001,7 @@ hda_hw_uninit(hda_controller* controller) if (controller == NULL) return; - /* Stop all audio streams */ + // Stop all audio streams hda_hw_stop(controller); if (controller->buffer_ready_sem >= B_OK) { @@ -979,13 +1011,24 @@ hda_hw_uninit(hda_controller* controller) reset_controller(controller); - /* Disable interrupts, and remove interrupt handler */ + // Disable interrupts, and remove interrupt handler controller->Write32(HDAC_INTR_CONTROL, 0); + if (controller->msi) { + // Disable MSI + sPCIx86Module->disable_msi(controller->pci_info.bus, + controller->pci_info.device, controller->pci_info.function); + } + remove_io_interrupt_handler(controller->irq, (interrupt_handler)hda_interrupt_handler, controller); - /* Delete corb/rirb area */ + if (sPCIx86Module != NULL) { + put_module(B_PCI_X86_MODULE_NAME); + sPCIx86Module = NULL; + } + + // Delete corb/rirb area if (controller->corb_rirb_pos_area >= 0) { delete_area(controller->corb_rirb_pos_area); controller->corb_rirb_pos_area = B_ERROR; @@ -994,17 +1037,16 @@ hda_hw_uninit(hda_controller* controller) controller->stream_positions = NULL; } - /* Unmap registers */ + // Unmap registers if (controller->regs_area >= 0) { delete_area(controller->regs_area); controller->regs_area = B_ERROR; controller->regs = NULL; } - /* Now delete all codecs */ + // Now delete all codecs for (index = 0; index < HDA_MAX_CODECS; index++) { if (controller->codecs[index] != NULL) hda_codec_delete(controller->codecs[index]); } } - diff --git a/src/apps/drivesetup/PartitionList.cpp b/src/apps/drivesetup/PartitionList.cpp index 49b9b84673..f711aa306f 100644 --- a/src/apps/drivesetup/PartitionList.cpp +++ b/src/apps/drivesetup/PartitionList.cpp @@ -224,7 +224,7 @@ PartitionListRow::PartitionListRow(BPartition* partition) if (partition->ContainsFileSystem()) SetField(new BStringField(partition->Type()), kFilesystemColumn); else - SetField(new BStringField(kUnavailableString), kFilesystemColumn); + SetField(new BStringField(kUnavailableString), kFilesystemColumn); SetField(new BStringField(kUnavailableString), kVolumeNameColumn); } @@ -250,7 +250,7 @@ PartitionListRow::PartitionListRow(BPartition* partition) delete_driver_settings(handle); } - + SetField(new BStringField(parameters), kParametersColumn); } else { SetField(new BStringField(kUnavailableString), kParametersColumn); @@ -281,6 +281,19 @@ PartitionListRow::PartitionListRow(partition_id parentID, partition_id id, } +const char* +PartitionListRow::DevicePath() +{ + BBitmapStringField* stringField + = dynamic_cast(GetField(kDeviceColumn)); + + if (stringField == NULL) + return NULL; + + return stringField->String(); +} + + // #pragma mark - PartitionListView @@ -312,6 +325,30 @@ PartitionListView::AttachedToWindow() } +bool +PartitionListView::InitiateDrag(BPoint rowPoint, bool wasSelected) +{ + PartitionListRow* draggedRow + = dynamic_cast(RowAt(rowPoint)); + if (draggedRow == NULL) + return false; + + const char* draggedPath = draggedRow->DevicePath(); + if (draggedPath == NULL) + return false; + + BRect draggedRowRect; + GetRowRect(draggedRow, &draggedRowRect); + + BMessage dragMessage(B_MIME_DATA); + dragMessage.AddData("text/plain", B_MIME_TYPE, draggedPath, + strlen(draggedPath)); + + DragMessage(&dragMessage, draggedRowRect, NULL); + return true; +} + + PartitionListRow* PartitionListView::FindRow(partition_id id, PartitionListRow* parent) { diff --git a/src/apps/drivesetup/PartitionList.h b/src/apps/drivesetup/PartitionList.h index c3319cea9d..8ed7952025 100644 --- a/src/apps/drivesetup/PartitionList.h +++ b/src/apps/drivesetup/PartitionList.h @@ -77,6 +77,9 @@ public: { return fOffset; } off_t Size() const { return fSize; } + + const char* DevicePath(); + private: partition_id fPartitionID; partition_id fParentID; @@ -93,6 +96,8 @@ public: virtual void AttachedToWindow(); + virtual bool InitiateDrag(BPoint rowPoint, bool wasSelected); + PartitionListRow* FindRow(partition_id id, PartitionListRow* parent = NULL); PartitionListRow* AddPartition(BPartition* partition); diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index ec2f0879b8..5e228fc4da 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -9324,7 +9324,8 @@ BPoseView::MoveColumnTo(BColumn* src, BColumn* dest) BColumn* column = fColumnList->ItemAt(index); column->SetOffset(offset); last = column; - offset = last->Offset() + last->Width() + kTitleColumnExtraMargin; + offset = last->Offset() + last->Width() + kTitleColumnExtraMargin + - kRoomForLine / 2; } // invalidate everything to the right of miny diff --git a/src/system/boot/arch/arm/arch_framebuffer_omap3.cpp b/src/system/boot/arch/arm/arch_framebuffer_omap3.cpp index 1ebffef832..03e38b26a8 100644 --- a/src/system/boot/arch/arm/arch_framebuffer_omap3.cpp +++ b/src/system/boot/arch/arm/arch_framebuffer_omap3.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include diff --git a/src/system/boot/arch/arm/arch_framebuffer_pxa.cpp b/src/system/boot/arch/arm/arch_framebuffer_pxa.cpp index 196401de2b..1bcc304d21 100644 --- a/src/system/boot/arch/arm/arch_framebuffer_pxa.cpp +++ b/src/system/boot/arch/arm/arch_framebuffer_pxa.cpp @@ -10,13 +10,13 @@ #include "arch_framebuffer.h" +#include #include #include #include #include #include #include -#include #include #include @@ -101,7 +101,7 @@ dprintf("error %08x\n", err); return B_NO_INIT; pixelFormat = bppCode = read_io_32(LCCR3); - bppCode = (bppCode >> 26) & 0x08 | (bppCode >> 24) & 0x07; + bppCode = ((bppCode >> 26) & 0x08) | ((bppCode >> 24) & 0x07); pixelFormat >>= 30; dma = (struct pxa27x_lcd_dma_descriptor *)(read_io_32(FDADR0) & ~0x0f); @@ -147,7 +147,7 @@ status_t ArchFBArmPxa270::SetVideoMode(int width, int height, int depth) { dprintf("%s(%d, %d, %d)\n", __FUNCTION__, width, height, depth); - status_t err; + void *fb; uint32 fbSize = width * height * depth / 8; //fb = malloc(800 * 600 * 4 + 16 - 1); diff --git a/src/system/boot/platform/raspberrypi_arm/cpu.cpp b/src/system/boot/platform/raspberrypi_arm/cpu.cpp index f8d27d992b..bed511e7cf 100644 --- a/src/system/boot/platform/raspberrypi_arm/cpu.cpp +++ b/src/system/boot/platform/raspberrypi_arm/cpu.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include diff --git a/src/system/kernel/cache/block_cache.cpp b/src/system/kernel/cache/block_cache.cpp index 22e20ccb8b..b18dc1baec 100644 --- a/src/system/kernel/cache/block_cache.cpp +++ b/src/system/kernel/cache/block_cache.cpp @@ -3059,6 +3059,8 @@ cache_abort_sub_transaction(void* _cache, int32 id) block->transaction_next = NULL; block->transaction = NULL; + transaction->num_blocks--; + if (block->previous_transaction == NULL) { cache->Free(block->original_data); block->original_data = NULL; diff --git a/src/tests/system/kernel/cache/block_cache_test.cpp b/src/tests/system/kernel/cache/block_cache_test.cpp index d0b88f171b..561f6ec52e 100644 --- a/src/tests/system/kernel/cache/block_cache_test.cpp +++ b/src/tests/system/kernel/cache/block_cache_test.cpp @@ -20,6 +20,8 @@ #define TEST_BLOCKS(number, count) \ test_blocks(number, count, __LINE__) +#define TEST_TRANSACTION(id, num, mainNum, subNum) \ + test_transaction(id, num, mainNum, subNum, __LINE__) #define TEST_BLOCK_DATA(block, number, type) \ if ((block)->type ## _data != NULL && gBlocks[(number)]. type == 0) \ @@ -157,6 +159,28 @@ init_test_blocks() } +void +test_transaction(int32 id, int32 numBlocks, int32 numMainBlocks, + int32 numSubBlocks, int32 line) +{ + MutexLocker locker(&gCache->lock); + cache_transaction* transaction = lookup_transaction(gCache, id); + + if (numBlocks != transaction->num_blocks) { + error(line, "Transaction %d has wrong num_blocks (is %d, should be " + "%d)!", id, transaction->num_blocks, numBlocks); + } + if (numMainBlocks != transaction->main_num_blocks) { + error(line, "Transaction %d has wrong num_blocks (is %d, should be " + "%d)!", id, transaction->main_num_blocks, numMainBlocks); + } + if (numSubBlocks != transaction->sub_num_blocks) { + error(line, "Transaction %d has wrong num_blocks (is %d, should be " + "%d)!", id, transaction->sub_num_blocks, numSubBlocks); + } +} + + void test_blocks(off_t number, int32 count, int32 line) { @@ -391,7 +415,9 @@ test_abort_sub_transaction() block_cache_put(gCache, 1); + TEST_TRANSACTION(id, 2, 2, 1); cache_abort_sub_transaction(gCache, id); + TEST_TRANSACTION(id, 2, 2, 0); gBlocks[0].write = true; gBlocks[0].is_dirty = false; @@ -417,7 +443,9 @@ test_abort_sub_transaction() gBlocks[1].is_dirty = true; TEST_BLOCKS(1, 1); + TEST_TRANSACTION(id, 1, 0, 0); cache_start_sub_transaction(gCache, id); + TEST_TRANSACTION(id, 1, 1, 0); gBlocks[0].present = true; @@ -427,7 +455,9 @@ test_abort_sub_transaction() block_cache_put(gCache, 0); + TEST_TRANSACTION(id, 2, 1, 1); cache_abort_sub_transaction(gCache, id); + TEST_TRANSACTION(id, 1, 1, 0); gBlocks[0].write = false; gBlocks[0].is_dirty = false; @@ -445,9 +475,6 @@ test_abort_sub_transaction() void test_block_cache_discard() { - // TODO: test transaction-less block caches - // TODO: test read-only block caches - // Test transactions and block caches start_test("Discard in main"); @@ -469,11 +496,14 @@ test_block_cache_discard() gBlocks[2].present = false; + TEST_TRANSACTION(id, 1, 0, 0); block = block_cache_get_empty(gCache, 2, id); + TEST_TRANSACTION(id, 2, 0, 0); block_cache_discard(gCache, 2, 1); block_cache_put(gCache, 2); cache_end_transaction(gCache, id, NULL, NULL); + TEST_TRANSACTION(id, 1, 0, 0); cache_sync_transaction(gCache, id); start_test("Discard in sub"); @@ -606,6 +636,8 @@ main(int argc, char** argv) { block_cache_init(); + // TODO: test transaction-less block caches + // TODO: test read-only block caches test_abort_transaction(); test_abort_sub_transaction(); test_block_cache_discard();