Merge branch 'master' into sam460ex
This commit is contained in:
commit
813cf8cdba
3
data/etc/profile.d/colorgrep.sh
Normal file
3
data/etc/profile.d/colorgrep.sh
Normal file
@ -0,0 +1,3 @@
|
||||
alias egrep='egrep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias grep='grep --color=auto'
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
* Copyright 2002-2012, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||
@ -16,18 +16,21 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
status_t devfs_unpublish_file_device(const char *path);
|
||||
status_t devfs_publish_file_device(const char *path, const char *filePath);
|
||||
status_t devfs_unpublish_file_device(const char* path);
|
||||
status_t devfs_publish_file_device(const char* path, const char* filePath);
|
||||
|
||||
status_t devfs_unpublish_partition(const char *path);
|
||||
status_t devfs_publish_partition(const char *name, const partition_info *info);
|
||||
status_t devfs_rename_partition(const char *devicePath, const char *oldName,
|
||||
const char *newName);
|
||||
status_t devfs_unpublish_partition(const char* path);
|
||||
status_t devfs_publish_partition(const char* name, const partition_info* info);
|
||||
status_t devfs_rename_partition(const char* devicePath, const char* oldName,
|
||||
const char* newName);
|
||||
|
||||
status_t devfs_unpublish_device(const char *path, bool disconnect);
|
||||
status_t devfs_publish_device(const char *path, device_hooks *calls);
|
||||
status_t devfs_publish_directory(const char *path);
|
||||
status_t devfs_rescan_driver(const char *driverName);
|
||||
status_t devfs_unpublish_device(const char* path, bool disconnect);
|
||||
status_t devfs_publish_device(const char* path, device_hooks* calls);
|
||||
status_t devfs_publish_directory(const char* path);
|
||||
status_t devfs_rescan_driver(const char* driverName);
|
||||
|
||||
void devfs_compute_geometry_size(device_geometry* geometry, uint64 blockCount,
|
||||
uint32 blockSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -140,12 +140,22 @@ public:
|
||||
|
||||
bool operator==(const BReference<Type>& other) const
|
||||
{
|
||||
return (fObject == other.fObject);
|
||||
return fObject == other.fObject;
|
||||
}
|
||||
|
||||
bool operator==(const Type* other) const
|
||||
{
|
||||
return fObject == other;
|
||||
}
|
||||
|
||||
bool operator!=(const BReference<Type>& other) const
|
||||
{
|
||||
return (fObject != other.fObject);
|
||||
return fObject != other.fObject;
|
||||
}
|
||||
|
||||
bool operator!=(const Type* other) const
|
||||
{
|
||||
return fObject != other;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2010, Haiku, Inc. All rights reserved.
|
||||
* Copyright 2004-2012, Haiku, Inc. All rights reserved.
|
||||
* Copyright 2002-2003, Thomas Kurschel. All rights reserved.
|
||||
*
|
||||
* Distributed under the terms of the MIT License.
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <fs/devfs.h>
|
||||
#include <io_requests.h>
|
||||
#include <vm/vm_page.h>
|
||||
|
||||
@ -205,10 +206,8 @@ get_geometry(cd_handle *handle, device_geometry *geometry)
|
||||
if (status == B_DEV_MEDIA_CHANGED)
|
||||
return B_DEV_MEDIA_CHANGED;
|
||||
|
||||
geometry->bytes_per_sector = info->block_size;
|
||||
geometry->sectors_per_track = 1;
|
||||
geometry->cylinder_count = info->capacity;
|
||||
geometry->head_count = 1;
|
||||
devfs_compute_geometry_size(geometry, info->capacity, info->block_size);
|
||||
|
||||
geometry->device_type = info->device_type;
|
||||
geometry->removable = info->removable;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Copyright 2008-2012, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Copyright 2002/03, Thomas Kurschel. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
@ -20,6 +20,8 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <fs/devfs.h>
|
||||
|
||||
#include "dma_resources.h"
|
||||
#include "IORequest.h"
|
||||
#include "IOSchedulerSimple.h"
|
||||
@ -65,7 +67,7 @@ static device_manager_info* sDeviceManager;
|
||||
|
||||
|
||||
static status_t
|
||||
update_capacity(das_driver_info *device)
|
||||
update_capacity(das_driver_info* device)
|
||||
{
|
||||
TRACE("update_capacity()\n");
|
||||
|
||||
@ -88,20 +90,12 @@ get_geometry(das_handle* handle, device_geometry* geometry)
|
||||
das_driver_info* info = handle->info;
|
||||
|
||||
status_t status = update_capacity(info);
|
||||
if (status < B_OK)
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
geometry->bytes_per_sector = info->block_size;
|
||||
if (info->capacity > UINT_MAX) {
|
||||
// TODO this doesn't work for capacity greater than 35TB
|
||||
geometry->sectors_per_track = 256;
|
||||
geometry->cylinder_count = info->capacity / (256 * 32);
|
||||
geometry->head_count = 32;
|
||||
} else {
|
||||
geometry->sectors_per_track = 1;
|
||||
geometry->cylinder_count = info->capacity;
|
||||
geometry->head_count = 1;
|
||||
}
|
||||
|
||||
devfs_compute_geometry_size(geometry, info->capacity, info->block_size);
|
||||
|
||||
geometry->device_type = B_DISK;
|
||||
geometry->removable = info->removable;
|
||||
|
||||
|
@ -1,18 +1,23 @@
|
||||
/*
|
||||
* Copyright 2008-2010, Haiku Inc. All rights reserved.
|
||||
* Copyright 2008-2012, Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Michael Lotz <mmlr@mlotz.ch>
|
||||
*/
|
||||
|
||||
#include <ByteOrder.h>
|
||||
#include <KernelExport.h>
|
||||
#include <Drivers.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "usb_disk.h"
|
||||
|
||||
#include <ByteOrder.h>
|
||||
#include <Drivers.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <fs/devfs.h>
|
||||
|
||||
#include "usb_disk_scsi.h"
|
||||
|
||||
|
||||
@ -463,7 +468,7 @@ usb_disk_request_sense(device_lun *lun)
|
||||
TRACE_ALWAYS("request_sense: media changed\n");
|
||||
lun->media_changed = true;
|
||||
lun->media_present = true;
|
||||
|
||||
|
||||
return B_DEV_MEDIA_CHANGED;
|
||||
}
|
||||
// fall through
|
||||
@ -1058,17 +1063,17 @@ usb_disk_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
|
||||
break;
|
||||
}
|
||||
|
||||
device_geometry *geometry = (device_geometry *)buffer;
|
||||
geometry->bytes_per_sector = lun->block_size;
|
||||
geometry->cylinder_count = lun->block_count;
|
||||
geometry->sectors_per_track = geometry->head_count = 1;
|
||||
geometry->device_type = lun->device_type;
|
||||
geometry->removable = lun->removable;
|
||||
geometry->read_only = lun->write_protected;
|
||||
geometry->write_once = (lun->device_type == B_WORM);
|
||||
device_geometry geometry;
|
||||
devfs_compute_geometry_size(&geometry, lun->block_count,
|
||||
lun->block_size);
|
||||
|
||||
geometry.device_type = lun->device_type;
|
||||
geometry.removable = lun->removable;
|
||||
geometry.read_only = lun->write_protected;
|
||||
geometry.write_once = lun->device_type == B_WORM;
|
||||
TRACE("B_GET_GEOMETRY: %ld sectors at %ld bytes per sector\n",
|
||||
geometry->cylinder_count, geometry->bytes_per_sector);
|
||||
result = B_OK;
|
||||
geometry.cylinder_count, geometry.bytes_per_sector);
|
||||
result = user_memcpy(buffer, &geometry, sizeof(device_geometry));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -137,6 +137,7 @@ const struct supported_device {
|
||||
// Radeon 4330 - RV710
|
||||
{0x954f, 3, 2, RADEON_RV710, CHIP_IGP, "Radeon HD 4300"},
|
||||
{0x9552, 3, 2, RADEON_RV710, CHIP_IGP, "Radeon HD 4300"},
|
||||
{0x9553, 3, 2, RADEON_RV710, CHIP_IGP, "Radeon HD 4500"},
|
||||
{0x9555, 3, 2, RADEON_RV710, CHIP_STD, "Radeon HD 4350"},
|
||||
{0x9540, 3, 2, RADEON_RV710, CHIP_STD, "Radeon HD 4550"},
|
||||
{0x9452, 3, 2, RADEON_RV730, CHIP_STD, "AMD FireStream 9250"},
|
||||
|
@ -33,6 +33,41 @@ char *signal_names[NSIG + 4] = {
|
||||
"SIGVTALRM",
|
||||
"SIGXCPU",
|
||||
"SIGXFSZ",
|
||||
"SIGBUS",
|
||||
"SIGJUNK(31)",
|
||||
"SIGJUNK(32)",
|
||||
"SIGRTMIN",
|
||||
"SIGRTMIN+1",
|
||||
"SIGRTMIN+2",
|
||||
"SIGRTMIN+3",
|
||||
"SIGRTMAX-3",
|
||||
"SIGRTMAX-2",
|
||||
"SIGRTMAX-1",
|
||||
"SIGRTMAX",
|
||||
"SIGJUNK(41)",
|
||||
"SIGJUNK(42)",
|
||||
"SIGJUNK(43)",
|
||||
"SIGJUNK(44)",
|
||||
"SIGJUNK(45)",
|
||||
"SIGJUNK(46)",
|
||||
"SIGJUNK(47)",
|
||||
"SIGJUNK(48)",
|
||||
"SIGJUNK(49)",
|
||||
"SIGJUNK(50)",
|
||||
"SIGJUNK(51)",
|
||||
"SIGJUNK(52)",
|
||||
"SIGJUNK(53)",
|
||||
"SIGJUNK(54)",
|
||||
"SIGJUNK(55)",
|
||||
"SIGJUNK(56)",
|
||||
"SIGJUNK(57)",
|
||||
"SIGJUNK(58)",
|
||||
"SIGJUNK(59)",
|
||||
"SIGJUNK(60)",
|
||||
"SIGJUNK(61)",
|
||||
"SIGJUNK(62)",
|
||||
"SIGJUNK(63)",
|
||||
"SIGJUNK(64)",
|
||||
"DEBUG",
|
||||
"ERR",
|
||||
"RETURN",
|
||||
|
@ -275,13 +275,10 @@ BDeskWindow::CreatePoseView(Model* model)
|
||||
void
|
||||
BDeskWindow::AddWindowContextMenus(BMenu* menu)
|
||||
{
|
||||
BMenuItem* item;
|
||||
|
||||
BRoster roster;
|
||||
if (!roster.IsRunning(kDeskbarSignature)) {
|
||||
item = new BMenuItem(B_TRANSLATE("Restart Deskbar"),
|
||||
new BMessage(kRestartDeskbar));
|
||||
menu->AddItem(item);
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Restart Deskbar"),
|
||||
new BMessage(kRestartDeskbar)));
|
||||
menu->AddSeparatorItem();
|
||||
}
|
||||
|
||||
@ -298,7 +295,7 @@ BDeskWindow::AddWindowContextMenus(BMenu* menu)
|
||||
|
||||
BMessage* message = new BMessage(kIconMode);
|
||||
message->AddInt32("size", 32);
|
||||
item = new BMenuItem(B_TRANSLATE("32 x 32"), message);
|
||||
BMenuItem* item = new BMenuItem(B_TRANSLATE("32 x 32"), message);
|
||||
item->SetMarked(PoseView()->IconSizeInt() == 32);
|
||||
item->SetTarget(PoseView());
|
||||
iconSizeMenu->AddItem(item);
|
||||
|
@ -45,7 +45,7 @@ local shared_files =
|
||||
tif_zip.c
|
||||
;
|
||||
|
||||
Includes [ FGristFiles tif_jpeg.c ]
|
||||
Includes [ FGristFiles tif_jpeg.c tif_ojpeg.c ]
|
||||
: $(HAIKU_JPEG_HEADERS_DEPENDENCY) ;
|
||||
|
||||
Objects $(shared_files) ;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Copyright 2002-2012, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||
@ -26,6 +26,7 @@
|
||||
#include <debug.h>
|
||||
#include <elf.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <fs/devfs.h>
|
||||
#include <fs/KPath.h>
|
||||
#include <fs/node_monitor.h>
|
||||
#include <kdevice_manager.h>
|
||||
@ -1498,17 +1499,16 @@ devfs_ioctl(fs_volume* _volume, fs_vnode* _vnode, void* _cookie, uint32 op,
|
||||
device_geometry geometry;
|
||||
status_t status = vnode->stream.u.dev.device->Control(
|
||||
cookie->device_cookie, op, &geometry, length);
|
||||
if (status < B_OK)
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
// patch values to match partition size
|
||||
geometry.sectors_per_track = 0;
|
||||
if (geometry.bytes_per_sector == 0)
|
||||
geometry.bytes_per_sector = 512;
|
||||
geometry.sectors_per_track = partition->info.size
|
||||
/ geometry.bytes_per_sector;
|
||||
geometry.head_count = 1;
|
||||
geometry.cylinder_count = 1;
|
||||
|
||||
devfs_compute_geometry_size(&geometry,
|
||||
partition->info.size / geometry.bytes_per_sector,
|
||||
geometry.bytes_per_sector);
|
||||
|
||||
return user_memcpy(buffer, &geometry, sizeof(device_geometry));
|
||||
}
|
||||
@ -2207,6 +2207,21 @@ devfs_unpublish_device(BaseDevice* device, bool disconnect)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
devfs_compute_geometry_size(device_geometry* geometry, uint64 blockCount,
|
||||
uint32 blockSize)
|
||||
{
|
||||
if (blockCount > UINT32_MAX)
|
||||
geometry->head_count = (blockCount + UINT32_MAX - 1) / UINT32_MAX;
|
||||
else
|
||||
geometry->head_count = 1;
|
||||
|
||||
geometry->cylinder_count = 1;
|
||||
geometry->sectors_per_track = blockCount / geometry->head_count;
|
||||
geometry->bytes_per_sector = blockSize;
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - support API for legacy drivers
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user